From 92877866c7a02130a2a961ef5ba1faf3fadd8245 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Mon, 3 Nov 2025 08:57:26 -0800 Subject: [PATCH 001/562] Fix leak in PointerEvent (#54374) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54374 `eventState` retains a `hitPath` which may retain views, so will leak if not cleaned up. Changelog: [Internal] Reviewed By: lenaic Differential Revision: D86091939 fbshipit-source-id: 8eb6c3f55cefa176430b6e05c414be9aeeed460d --- .../com/facebook/react/uimanager/events/PointerEvent.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/PointerEvent.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/PointerEvent.kt index a725ee109774..e05ca8bdf2f0 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/PointerEvent.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/PointerEvent.kt @@ -29,7 +29,7 @@ internal class PointerEvent private constructor() : Event() { private lateinit var _eventName: String private var coalescingKey = UNSET_COALESCING_KEY private var pointersEventData: List? = null - private lateinit var eventState: PointerEventState + private var eventState: PointerEventState? = null private fun init( eventName: String, @@ -84,7 +84,7 @@ internal class PointerEvent private constructor() : Event() { return@EventAnimationDriverMatchSpec false } if (isBubblingEvent(eventName)) { - for (viewTarget in eventState.hitPathForActivePointer) { + for (viewTarget in checkNotNull(eventState).hitPathForActivePointer) { if (viewTarget.getViewId() == viewTag) { return@EventAnimationDriverMatchSpec true } @@ -97,10 +97,10 @@ internal class PointerEvent private constructor() : Event() { } override fun onDispose() { + eventState = null pointersEventData = null - val motionEvent = motionEvent - this.motionEvent = null motionEvent?.recycle() + motionEvent = null // Either `this` is in the event pool, or motionEvent // is null. It is in theory not possible for a PointerEvent to @@ -137,6 +137,7 @@ internal class PointerEvent private constructor() : Event() { val pointerEvent = Arguments.createMap() val motionEvent = checkNotNull(motionEvent) val pointerId = motionEvent.getPointerId(index) + val eventState = checkNotNull(eventState) // https://www.w3.org/TR/pointerevents/#pointerevent-interface pointerEvent.putDouble("pointerId", pointerId.toDouble()) From d05da386ff6441c6a087c040e49212b6a37a5162 Mon Sep 17 00:00:00 2001 From: Nolan O'Brien Date: Mon, 3 Nov 2025 10:38:13 -0800 Subject: [PATCH 002/562] Fix missing enum values in switch statements (#54373) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54373 `-Wswitch-enum` was introduced in 2024 and is beneficial because it will err when switch statement is missing a case for an enum, even with `default:` present. This helps alert developers when they add an enum value of all the switch statements that need updating. These diffs are to help progress the codebase so that we can enable `-Wswitch-enum` by default in `fbobjc` ## Changelog: [Internal] - Make enum exhaustive Reviewed By: cipolleschi Differential Revision: D85956869 fbshipit-source-id: 2833822e1f82e77909229c566798547e1cb7f084 --- .../Libraries/Text/TextInput/RCTBaseTextInputView.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm b/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm index c916ce895fb5..9fa7b9284df1 100644 --- a/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm +++ b/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm @@ -727,6 +727,9 @@ - (NSString *)returnKeyTypeToString:(UIReturnKeyType)returnKeyType return @"Join"; case UIReturnKeyEmergencyCall: return @"Emergency Call"; + case UIReturnKeyDefault: + case UIReturnKeyContinue: + case UIReturnKeyDone: default: return @"Done"; } From 4ed0d6e09f2d41be98df676063ff671b604715e8 Mon Sep 17 00:00:00 2001 From: Luna Wei Date: Mon, 3 Nov 2025 12:33:55 -0800 Subject: [PATCH 003/562] Add errors for unavailable properties (#54388) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54388 Changelog: [Internal] - Throw error when accessing unsupported properties for IntersectionObserver Reviewed By: rubennorte Differential Revision: D85976617 fbshipit-source-id: a357ea7584a5036df5f8bc3142d640d1e4bb841d --- .../IntersectionObserver.js | 48 +++++++++ .../__tests__/IntersectionObserver-itest.js | 97 +++++++++++++++++++ 2 files changed, 145 insertions(+) diff --git a/packages/react-native/src/private/webapis/intersectionobserver/IntersectionObserver.js b/packages/react-native/src/private/webapis/intersectionobserver/IntersectionObserver.js index 83a729b417b7..e333c4decf4e 100644 --- a/packages/react-native/src/private/webapis/intersectionobserver/IntersectionObserver.js +++ b/packages/react-native/src/private/webapis/intersectionobserver/IntersectionObserver.js @@ -94,6 +94,24 @@ export default class IntersectionObserver { ); } + if (options != null && 'delay' in options) { + throw new Error( + "Failed to construct 'IntersectionObserver': The 'delay' option is not supported.", + ); + } + + if (options != null && 'scrollMargin' in options) { + throw new Error( + "Failed to construct 'IntersectionObserver': The 'scrollMargin' option is not supported.", + ); + } + + if (options != null && 'trackVisibility' in options) { + throw new Error( + "Failed to construct 'IntersectionObserver': The 'trackVisibility' option is not supported.", + ); + } + this._callback = callback; this._rootThresholds = normalizeRootThreshold(options?.rnRootThreshold); @@ -152,6 +170,36 @@ export default class IntersectionObserver { return this._rootThresholds; } + /** + * The `delay` option is not supported. + * @throws {Error} Always throws an error indicating this property is not supported. + */ + get delay(): number { + throw new Error( + "Failed to read the 'delay' property from 'IntersectionObserver': This property is not supported.", + ); + } + + /** + * The `scrollMargin` option is not supported. + * @throws {Error} Always throws an error indicating this property is not supported. + */ + get scrollMargin(): string { + throw new Error( + "Failed to read the 'scrollMargin' property from 'IntersectionObserver': This property is not supported.", + ); + } + + /** + * The `trackVisibility` option is not supported. + * @throws {Error} Always throws an error indicating this property is not supported. + */ + get trackVisibility(): boolean { + throw new Error( + "Failed to read the 'trackVisibility' property from 'IntersectionObserver': This property is not supported.", + ); + } + /** * Adds an element to the set of target elements being watched by the * `IntersectionObserver`. diff --git a/packages/react-native/src/private/webapis/intersectionobserver/__tests__/IntersectionObserver-itest.js b/packages/react-native/src/private/webapis/intersectionobserver/__tests__/IntersectionObserver-itest.js index 9c5852a63209..9e75b3e5be50 100644 --- a/packages/react-native/src/private/webapis/intersectionobserver/__tests__/IntersectionObserver-itest.js +++ b/packages/react-native/src/private/webapis/intersectionobserver/__tests__/IntersectionObserver-itest.js @@ -473,6 +473,103 @@ describe('IntersectionObserver', () => { new IntersectionObserver(() => {}, {rnRootThreshold: []}).thresholds, ).toEqual([0]); }); + + describe('unsupported options', () => { + it('should throw if `delay` option is specified', () => { + expect(() => { + // $FlowExpectedError[prop-missing] delay is not defined in Flow. + return new IntersectionObserver(() => {}, {delay: 100}); + }).toThrow( + "Failed to construct 'IntersectionObserver': The 'delay' option is not supported.", + ); + }); + + it('should throw if `scrollMargin` option is specified', () => { + expect(() => { + // $FlowExpectedError[prop-missing] scrollMargin is not defined in Flow. + return new IntersectionObserver(() => {}, {scrollMargin: '10px'}); + }).toThrow( + "Failed to construct 'IntersectionObserver': The 'scrollMargin' option is not supported.", + ); + }); + + it('should throw if `trackVisibility` option is specified', () => { + expect(() => { + // $FlowExpectedError[prop-missing] trackVisibility is not defined in Flow. + return new IntersectionObserver(() => {}, {trackVisibility: true}); + }).toThrow( + "Failed to construct 'IntersectionObserver': The 'trackVisibility' option is not supported.", + ); + }); + + it('should throw if `delay` option is set to undefined explicitly', () => { + expect(() => { + // $FlowExpectedError[prop-missing] delay is not defined in Flow. + return new IntersectionObserver(() => {}, {delay: undefined}); + }).toThrow( + "Failed to construct 'IntersectionObserver': The 'delay' option is not supported.", + ); + }); + + it('should throw if `scrollMargin` option is set to null explicitly', () => { + expect(() => { + // $FlowExpectedError[prop-missing] scrollMargin is not defined in Flow. + return new IntersectionObserver(() => {}, {scrollMargin: null}); + }).toThrow( + "Failed to construct 'IntersectionObserver': The 'scrollMargin' option is not supported.", + ); + }); + + it('should not throw when unsupported options are not specified', () => { + expect(() => { + return new IntersectionObserver(() => {}, { + threshold: 0.5, + rootMargin: '10px', + }); + }).not.toThrow(); + }); + + it('should throw if multiple unsupported options are specified', () => { + expect(() => { + // $FlowExpectedError[prop-missing] delay and trackVisibility are not defined in Flow. + return new IntersectionObserver(() => {}, { + delay: 100, + trackVisibility: true, + }); + }).toThrow( + "Failed to construct 'IntersectionObserver': The 'delay' option is not supported.", + ); + }); + }); + + describe('unsupported property getters', () => { + it('should throw when accessing delay getter', () => { + observer = new IntersectionObserver(() => {}); + expect(() => { + return observer.delay; + }).toThrow( + "Failed to read the 'delay' property from 'IntersectionObserver': This property is not supported.", + ); + }); + + it('should throw when accessing scrollMargin getter', () => { + observer = new IntersectionObserver(() => {}); + expect(() => { + return observer.scrollMargin; + }).toThrow( + "Failed to read the 'scrollMargin' property from 'IntersectionObserver': This property is not supported.", + ); + }); + + it('should throw when accessing trackVisibility getter', () => { + observer = new IntersectionObserver(() => {}); + expect(() => { + return observer.trackVisibility; + }).toThrow( + "Failed to read the 'trackVisibility' property from 'IntersectionObserver': This property is not supported.", + ); + }); + }); }); describe('observe(target)', () => { From b5658a9de9e5d300d848976a621d0399716e24e1 Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Mon, 3 Nov 2025 13:52:51 -0800 Subject: [PATCH 004/562] Define TracingTestBase class for tests (#54375) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54375 # Changelog: [Internal] Extracts `startTracing()`, `stopTracing()` helpers from NetworkReporterTest into a re-usable `TracingTestBase` class. Reviewed By: sbuggay Differential Revision: D86027333 fbshipit-source-id: d34547d75500c73171ae37c78e96c0f2ad78d454 --- .../tests/NetworkReporterTest.cpp | 58 +------------ .../jsinspector-modern/tests/TracingTest.h | 82 +++++++++++++++++++ 2 files changed, 85 insertions(+), 55 deletions(-) create mode 100644 packages/react-native/ReactCommon/jsinspector-modern/tests/TracingTest.h diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tests/NetworkReporterTest.cpp b/packages/react-native/ReactCommon/jsinspector-modern/tests/NetworkReporterTest.cpp index 21ba36af0bdc..848a248b7aa6 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tests/NetworkReporterTest.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/tests/NetworkReporterTest.cpp @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#include "JsiIntegrationTest.h" +#include "TracingTest.h" #include "engines/JsiIntegrationTestHermesEngineAdapter.h" #include @@ -31,13 +31,13 @@ struct NetworkReporterTestParams { */ template requires std::convertible_to -class NetworkReporterTestBase : public JsiIntegrationPortableTestBase< +class NetworkReporterTestBase : public TracingTestBase< JsiIntegrationTestHermesEngineAdapter, folly::QueuedImmediateExecutor>, public WithParamInterface { protected: NetworkReporterTestBase() - : JsiIntegrationPortableTestBase({ + : TracingTestBase({ .networkInspectionEnabled = true, .enableNetworkEventReporting = WithParamInterface::GetParam() @@ -68,58 +68,6 @@ class NetworkReporterTestBase : public JsiIntegrationPortableTestBase< urlMatcher); } - void startTracing() { - this->expectMessageFromPage(JsonEq(R"({ - "id": 1, - "result": {} - })")); - - this->toPage_->sendMessage(R"({ - "id": 1, - "method": "Tracing.start" - })"); - } - - /** - * Helper method to end tracing and collect all trace events from potentially - * multiple chunked Tracing.dataCollected messages. - * \returns A vector containing all collected trace events - */ - std::vector endTracingAndCollectEvents() { - InSequence s; - - this->expectMessageFromPage(JsonEq(R"({ - "id": 1, - "result": {} - })")); - - std::vector allTraceEvents; - - EXPECT_CALL( - fromPage(), - onMessage(JsonParsed(AtJsonPtr("/method", "Tracing.dataCollected")))) - .Times(AtLeast(1)) - .WillRepeatedly(Invoke([&allTraceEvents](const std::string& message) { - auto parsedMessage = folly::parseJson(message); - auto& events = parsedMessage.at("params").at("value"); - allTraceEvents.insert( - allTraceEvents.end(), - std::make_move_iterator(events.begin()), - std::make_move_iterator(events.end())); - })); - - this->expectMessageFromPage(JsonParsed(AllOf( - AtJsonPtr("/method", "Tracing.tracingComplete"), - AtJsonPtr("/params/dataLossOccurred", false)))); - - this->toPage_->sendMessage(R"({ - "id": 1, - "method": "Tracing.end" - })"); - - return allTraceEvents; - } - private: std::optional getScriptUrlById(const std::string& scriptId) { auto it = scriptUrlsById_.find(scriptId); diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tests/TracingTest.h b/packages/react-native/ReactCommon/jsinspector-modern/tests/TracingTest.h new file mode 100644 index 000000000000..c2109f5e3f30 --- /dev/null +++ b/packages/react-native/ReactCommon/jsinspector-modern/tests/TracingTest.h @@ -0,0 +1,82 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include "JsiIntegrationTest.h" + +#include +#include +#include +#include + +#include "FollyDynamicMatchers.h" + +namespace facebook::react::jsinspector_modern { + +/** + * Base test class providing tracing-related test utilities for tests. + */ +template +class TracingTestBase : public JsiIntegrationPortableTestBase { + protected: + using JsiIntegrationPortableTestBase::JsiIntegrationPortableTestBase; + + /** + * Helper method to start tracing via Tracing.start CDP command. + */ + void startTracing() + { + this->expectMessageFromPage(JsonEq(R"({ + "id": 1, + "result": {} + })")); + + this->toPage_->sendMessage(R"({ + "id": 1, + "method": "Tracing.start" + })"); + } + + /** + * Helper method to end tracing and collect all trace events from potentially + * multiple chunked Tracing.dataCollected messages. + * \returns A vector containing all collected trace events + */ + std::vector endTracingAndCollectEvents() + { + testing::InSequence s; + + this->expectMessageFromPage(JsonEq(R"({ + "id": 1, + "result": {} + })")); + + std::vector allTraceEvents; + + EXPECT_CALL(this->fromPage(), onMessage(JsonParsed(AtJsonPtr("/method", "Tracing.dataCollected")))) + .Times(testing::AtLeast(1)) + .WillRepeatedly(testing::Invoke([&allTraceEvents](const std::string &message) { + auto parsedMessage = folly::parseJson(message); + auto &events = parsedMessage.at("params").at("value"); + allTraceEvents.insert( + allTraceEvents.end(), std::make_move_iterator(events.begin()), std::make_move_iterator(events.end())); + })); + + this->expectMessageFromPage(JsonParsed( + testing::AllOf(AtJsonPtr("/method", "Tracing.tracingComplete"), AtJsonPtr("/params/dataLossOccurred", false)))); + + this->toPage_->sendMessage(R"({ + "id": 1, + "method": "Tracing.end" + })"); + + return allTraceEvents; + } +}; + +} // namespace facebook::react::jsinspector_modern From dc9702e77cd2e4809ae2c3c44a897bf48572701a Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Mon, 3 Nov 2025 17:09:20 -0800 Subject: [PATCH 005/562] Remove outdated comments (#54376) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54376 # Changelog: [Internal] Tracing is stable. Reviewed By: sbuggay Differential Revision: D85996397 fbshipit-source-id: c3444532445815fab332401c38f96eab7e8d2316 --- .../ReactCommon/jsinspector-modern/TracingAgent.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.cpp b/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.cpp index e661b0e741a5..05ab99798ab1 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.cpp @@ -53,7 +53,6 @@ TracingAgent::~TracingAgent() { bool TracingAgent::handleRequest(const cdp::PreparsedRequest& req) { if (req.method == "Tracing.start") { - // @cdp Tracing.start support is experimental. if (sessionState_.isDebuggerDomainEnabled) { frontendChannel_( cdp::jsonError( @@ -81,7 +80,6 @@ bool TracingAgent::handleRequest(const cdp::PreparsedRequest& req) { return true; } else if (req.method == "Tracing.end") { - // @cdp Tracing.end support is experimental. auto state = hostTargetController_.stopTracing(); sessionState_.hasPendingTraceRecording = false; From 502efe1ccf468cdede1c1b1839880473932d7302 Mon Sep 17 00:00:00 2001 From: Peter Abbondanzo Date: Mon, 3 Nov 2025 17:38:48 -0800 Subject: [PATCH 006/562] Clean up sweepActiveTouchOnChildNativeGesturesAndroid (#54389) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54389 This feature flag had its default value set to the expected value in https://github.com/facebook/react-native/pull/54307, let's remove it Changelog: [Internal] Reviewed By: alanleedev Differential Revision: D85914420 fbshipit-source-id: 77c156f3ab6dcfba840973c3f9d6b1a602cf9274 --- .../featureflags/ReactNativeFeatureFlags.kt | 8 +-- .../ReactNativeFeatureFlagsCxxAccessor.kt | 12 +---- .../ReactNativeFeatureFlagsCxxInterop.kt | 4 +- .../ReactNativeFeatureFlagsDefaults.kt | 4 +- .../ReactNativeFeatureFlagsLocalAccessor.kt | 13 +---- .../ReactNativeFeatureFlagsProvider.kt | 4 +- .../react/uimanager/JSTouchDispatcher.kt | 3 +- .../JReactNativeFeatureFlagsCxxInterop.cpp | 16 +----- .../JReactNativeFeatureFlagsCxxInterop.h | 5 +- .../featureflags/ReactNativeFeatureFlags.cpp | 6 +-- .../featureflags/ReactNativeFeatureFlags.h | 7 +-- .../ReactNativeFeatureFlagsAccessor.cpp | 54 +++++++------------ .../ReactNativeFeatureFlagsAccessor.h | 6 +-- .../ReactNativeFeatureFlagsDefaults.h | 6 +-- .../ReactNativeFeatureFlagsDynamicProvider.h | 11 +--- .../ReactNativeFeatureFlagsProvider.h | 3 +- .../NativeReactNativeFeatureFlags.cpp | 7 +-- .../NativeReactNativeFeatureFlags.h | 4 +- .../ReactNativeFeatureFlags.config.js | 11 ---- .../featureflags/ReactNativeFeatureFlags.js | 7 +-- .../specs/NativeReactNativeFeatureFlags.js | 3 +- 21 files changed, 38 insertions(+), 156 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt index a714ad328127..dc58209bc0cc 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<15ede8025e516f2bdc0329efe49f4a62>> */ /** @@ -420,12 +420,6 @@ public object ReactNativeFeatureFlags { @JvmStatic public fun skipActivityIdentityAssertionOnHostPause(): Boolean = accessor.skipActivityIdentityAssertionOnHostPause() - /** - * A flag to tell Fabric to sweep active touches from JSTouchDispatcher in Android when a child native gesture is started. - */ - @JvmStatic - public fun sweepActiveTouchOnChildNativeGesturesAndroid(): Boolean = accessor.sweepActiveTouchOnChildNativeGesturesAndroid() - /** * Enables storing js caller stack when creating promise in native module. This is useful in case of Promise rejection and tracing the cause. */ diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt index 4409b2e23e0e..fa2da9976aba 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<447ccc7271b71b0208a2297b7eba5995>> + * @generated SignedSource<> */ /** @@ -85,7 +85,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces private var shouldPressibilityUseW3CPointerEventsForHoverCache: Boolean? = null private var shouldTriggerResponderTransferOnScrollAndroidCache: Boolean? = null private var skipActivityIdentityAssertionOnHostPauseCache: Boolean? = null - private var sweepActiveTouchOnChildNativeGesturesAndroidCache: Boolean? = null private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null @@ -689,15 +688,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces return cached } - override fun sweepActiveTouchOnChildNativeGesturesAndroid(): Boolean { - var cached = sweepActiveTouchOnChildNativeGesturesAndroidCache - if (cached == null) { - cached = ReactNativeFeatureFlagsCxxInterop.sweepActiveTouchOnChildNativeGesturesAndroid() - sweepActiveTouchOnChildNativeGesturesAndroidCache = cached - } - return cached - } - override fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean { var cached = traceTurboModulePromiseRejectionsOnAndroidCache if (cached == null) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt index e024962250cd..1c5d5b126fb2 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<9a1bdbc2a3ae299433e690b254d7bf0a>> */ /** @@ -158,8 +158,6 @@ public object ReactNativeFeatureFlagsCxxInterop { @DoNotStrip @JvmStatic public external fun skipActivityIdentityAssertionOnHostPause(): Boolean - @DoNotStrip @JvmStatic public external fun sweepActiveTouchOnChildNativeGesturesAndroid(): Boolean - @DoNotStrip @JvmStatic public external fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean @DoNotStrip @JvmStatic public external fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt index 3a7001ecd28a..7a6da3918a34 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<0d78a0405db2a10c14bd69aaf2a3708a>> */ /** @@ -153,8 +153,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi override fun skipActivityIdentityAssertionOnHostPause(): Boolean = false - override fun sweepActiveTouchOnChildNativeGesturesAndroid(): Boolean = true - override fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean = false override fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean = false diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt index 9ba527303268..44527788e4ac 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6f6b5abe79764b88cf3ed62fe0230786>> + * @generated SignedSource<<98f16fd1bb180b247ee87bb24b10120e>> */ /** @@ -89,7 +89,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc private var shouldPressibilityUseW3CPointerEventsForHoverCache: Boolean? = null private var shouldTriggerResponderTransferOnScrollAndroidCache: Boolean? = null private var skipActivityIdentityAssertionOnHostPauseCache: Boolean? = null - private var sweepActiveTouchOnChildNativeGesturesAndroidCache: Boolean? = null private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null @@ -758,16 +757,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc return cached } - override fun sweepActiveTouchOnChildNativeGesturesAndroid(): Boolean { - var cached = sweepActiveTouchOnChildNativeGesturesAndroidCache - if (cached == null) { - cached = currentProvider.sweepActiveTouchOnChildNativeGesturesAndroid() - accessedFeatureFlags.add("sweepActiveTouchOnChildNativeGesturesAndroid") - sweepActiveTouchOnChildNativeGesturesAndroidCache = cached - } - return cached - } - override fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean { var cached = traceTurboModulePromiseRejectionsOnAndroidCache if (cached == null) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt index 742294dfb3bc..4285920dadfd 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6b61490a8d6b1df1d6264016455382f8>> + * @generated SignedSource<> */ /** @@ -153,8 +153,6 @@ public interface ReactNativeFeatureFlagsProvider { @DoNotStrip public fun skipActivityIdentityAssertionOnHostPause(): Boolean - @DoNotStrip public fun sweepActiveTouchOnChildNativeGesturesAndroid(): Boolean - @DoNotStrip public fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean @DoNotStrip public fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSTouchDispatcher.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSTouchDispatcher.kt index 136265e4974e..3175211cd1f6 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSTouchDispatcher.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSTouchDispatcher.kt @@ -14,7 +14,6 @@ import com.facebook.infer.annotation.Assertions import com.facebook.react.bridge.ReactContext import com.facebook.react.common.ReactConstants import com.facebook.react.common.annotations.UnstableReactNativeAPI -import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags import com.facebook.react.uimanager.common.UIManagerType import com.facebook.react.uimanager.events.EventDispatcher import com.facebook.react.uimanager.events.TouchEvent @@ -59,7 +58,7 @@ public class JSTouchDispatcher(private val viewGroup: ViewGroup) { dispatchCancelEvent(androidEvent, eventDispatcher) childIsHandlingNativeGesture = true - if (targetTag != -1 && ReactNativeFeatureFlags.sweepActiveTouchOnChildNativeGesturesAndroid()) { + if (targetTag != -1) { val surfaceId = UIManagerHelper.getSurfaceId(viewGroup) sweepActiveTouchForTag(surfaceId, targetTag, reactContext) } diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp index 185614ae10cc..1b9c3b99fe92 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<13ed11b5c260fae79048ea80745d22fe>> + * @generated SignedSource<> */ /** @@ -429,12 +429,6 @@ class ReactNativeFeatureFlagsJavaProvider return method(javaProvider_); } - bool sweepActiveTouchOnChildNativeGesturesAndroid() override { - static const auto method = - getReactNativeFeatureFlagsProviderJavaClass()->getMethod("sweepActiveTouchOnChildNativeGesturesAndroid"); - return method(javaProvider_); - } - bool traceTurboModulePromiseRejectionsOnAndroid() override { static const auto method = getReactNativeFeatureFlagsProviderJavaClass()->getMethod("traceTurboModulePromiseRejectionsOnAndroid"); @@ -866,11 +860,6 @@ bool JReactNativeFeatureFlagsCxxInterop::skipActivityIdentityAssertionOnHostPaus return ReactNativeFeatureFlags::skipActivityIdentityAssertionOnHostPause(); } -bool JReactNativeFeatureFlagsCxxInterop::sweepActiveTouchOnChildNativeGesturesAndroid( - facebook::jni::alias_ref /*unused*/) { - return ReactNativeFeatureFlags::sweepActiveTouchOnChildNativeGesturesAndroid(); -} - bool JReactNativeFeatureFlagsCxxInterop::traceTurboModulePromiseRejectionsOnAndroid( facebook::jni::alias_ref /*unused*/) { return ReactNativeFeatureFlags::traceTurboModulePromiseRejectionsOnAndroid(); @@ -1182,9 +1171,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() { makeNativeMethod( "skipActivityIdentityAssertionOnHostPause", JReactNativeFeatureFlagsCxxInterop::skipActivityIdentityAssertionOnHostPause), - makeNativeMethod( - "sweepActiveTouchOnChildNativeGesturesAndroid", - JReactNativeFeatureFlagsCxxInterop::sweepActiveTouchOnChildNativeGesturesAndroid), makeNativeMethod( "traceTurboModulePromiseRejectionsOnAndroid", JReactNativeFeatureFlagsCxxInterop::traceTurboModulePromiseRejectionsOnAndroid), diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h index 150eff908cfe..c38366ce5d2e 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +++ b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<1e57bf8252c16fc10bbfcae08710af85>> + * @generated SignedSource<<6238eb0739467af8477aa8fa79a023bf>> */ /** @@ -225,9 +225,6 @@ class JReactNativeFeatureFlagsCxxInterop static bool skipActivityIdentityAssertionOnHostPause( facebook::jni::alias_ref); - static bool sweepActiveTouchOnChildNativeGesturesAndroid( - facebook::jni::alias_ref); - static bool traceTurboModulePromiseRejectionsOnAndroid( facebook::jni::alias_ref); diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp index 943b7b8f3528..61d6015d3138 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5d596cc470e66861d7c1b2ffbb15b268>> + * @generated SignedSource<<6f88454830626622f9b5720ae0395938>> */ /** @@ -286,10 +286,6 @@ bool ReactNativeFeatureFlags::skipActivityIdentityAssertionOnHostPause() { return getAccessor().skipActivityIdentityAssertionOnHostPause(); } -bool ReactNativeFeatureFlags::sweepActiveTouchOnChildNativeGesturesAndroid() { - return getAccessor().sweepActiveTouchOnChildNativeGesturesAndroid(); -} - bool ReactNativeFeatureFlags::traceTurboModulePromiseRejectionsOnAndroid() { return getAccessor().traceTurboModulePromiseRejectionsOnAndroid(); } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h index 99cb2ad19520..1da19577c945 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<41492e85e1feeb20d2e3e60b6cc6cbe7>> + * @generated SignedSource<> */ /** @@ -364,11 +364,6 @@ class ReactNativeFeatureFlags { */ RN_EXPORT static bool skipActivityIdentityAssertionOnHostPause(); - /** - * A flag to tell Fabric to sweep active touches from JSTouchDispatcher in Android when a child native gesture is started. - */ - RN_EXPORT static bool sweepActiveTouchOnChildNativeGesturesAndroid(); - /** * Enables storing js caller stack when creating promise in native module. This is useful in case of Promise rejection and tracing the cause. */ diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp index cfce571cebeb..9d3bdac3918e 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> */ /** @@ -1199,24 +1199,6 @@ bool ReactNativeFeatureFlagsAccessor::skipActivityIdentityAssertionOnHostPause() return flagValue.value(); } -bool ReactNativeFeatureFlagsAccessor::sweepActiveTouchOnChildNativeGesturesAndroid() { - auto flagValue = sweepActiveTouchOnChildNativeGesturesAndroid_.load(); - - if (!flagValue.has_value()) { - // This block is not exclusive but it is not necessary. - // If multiple threads try to initialize the feature flag, we would only - // be accessing the provider multiple times but the end state of this - // instance and the returned flag value would be the same. - - markFlagAsAccessed(65, "sweepActiveTouchOnChildNativeGesturesAndroid"); - - flagValue = currentProvider_->sweepActiveTouchOnChildNativeGesturesAndroid(); - sweepActiveTouchOnChildNativeGesturesAndroid_ = flagValue; - } - - return flagValue.value(); -} - bool ReactNativeFeatureFlagsAccessor::traceTurboModulePromiseRejectionsOnAndroid() { auto flagValue = traceTurboModulePromiseRejectionsOnAndroid_.load(); @@ -1226,7 +1208,7 @@ bool ReactNativeFeatureFlagsAccessor::traceTurboModulePromiseRejectionsOnAndroid // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(66, "traceTurboModulePromiseRejectionsOnAndroid"); + markFlagAsAccessed(65, "traceTurboModulePromiseRejectionsOnAndroid"); flagValue = currentProvider_->traceTurboModulePromiseRejectionsOnAndroid(); traceTurboModulePromiseRejectionsOnAndroid_ = flagValue; @@ -1244,7 +1226,7 @@ bool ReactNativeFeatureFlagsAccessor::updateRuntimeShadowNodeReferencesOnCommit( // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(67, "updateRuntimeShadowNodeReferencesOnCommit"); + markFlagAsAccessed(66, "updateRuntimeShadowNodeReferencesOnCommit"); flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommit(); updateRuntimeShadowNodeReferencesOnCommit_ = flagValue; @@ -1262,7 +1244,7 @@ bool ReactNativeFeatureFlagsAccessor::useAlwaysAvailableJSErrorHandling() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(68, "useAlwaysAvailableJSErrorHandling"); + markFlagAsAccessed(67, "useAlwaysAvailableJSErrorHandling"); flagValue = currentProvider_->useAlwaysAvailableJSErrorHandling(); useAlwaysAvailableJSErrorHandling_ = flagValue; @@ -1280,7 +1262,7 @@ bool ReactNativeFeatureFlagsAccessor::useFabricInterop() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(69, "useFabricInterop"); + markFlagAsAccessed(68, "useFabricInterop"); flagValue = currentProvider_->useFabricInterop(); useFabricInterop_ = flagValue; @@ -1298,7 +1280,7 @@ bool ReactNativeFeatureFlagsAccessor::useNativeEqualsInNativeReadableArrayAndroi // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(70, "useNativeEqualsInNativeReadableArrayAndroid"); + markFlagAsAccessed(69, "useNativeEqualsInNativeReadableArrayAndroid"); flagValue = currentProvider_->useNativeEqualsInNativeReadableArrayAndroid(); useNativeEqualsInNativeReadableArrayAndroid_ = flagValue; @@ -1316,7 +1298,7 @@ bool ReactNativeFeatureFlagsAccessor::useNativeTransformHelperAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(71, "useNativeTransformHelperAndroid"); + markFlagAsAccessed(70, "useNativeTransformHelperAndroid"); flagValue = currentProvider_->useNativeTransformHelperAndroid(); useNativeTransformHelperAndroid_ = flagValue; @@ -1334,7 +1316,7 @@ bool ReactNativeFeatureFlagsAccessor::useNativeViewConfigsInBridgelessMode() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(72, "useNativeViewConfigsInBridgelessMode"); + markFlagAsAccessed(71, "useNativeViewConfigsInBridgelessMode"); flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode(); useNativeViewConfigsInBridgelessMode_ = flagValue; @@ -1352,7 +1334,7 @@ bool ReactNativeFeatureFlagsAccessor::useOptimizedEventBatchingOnAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(73, "useOptimizedEventBatchingOnAndroid"); + markFlagAsAccessed(72, "useOptimizedEventBatchingOnAndroid"); flagValue = currentProvider_->useOptimizedEventBatchingOnAndroid(); useOptimizedEventBatchingOnAndroid_ = flagValue; @@ -1370,7 +1352,7 @@ bool ReactNativeFeatureFlagsAccessor::useRawPropsJsiValue() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(74, "useRawPropsJsiValue"); + markFlagAsAccessed(73, "useRawPropsJsiValue"); flagValue = currentProvider_->useRawPropsJsiValue(); useRawPropsJsiValue_ = flagValue; @@ -1388,7 +1370,7 @@ bool ReactNativeFeatureFlagsAccessor::useShadowNodeStateOnClone() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(75, "useShadowNodeStateOnClone"); + markFlagAsAccessed(74, "useShadowNodeStateOnClone"); flagValue = currentProvider_->useShadowNodeStateOnClone(); useShadowNodeStateOnClone_ = flagValue; @@ -1406,7 +1388,7 @@ bool ReactNativeFeatureFlagsAccessor::useSharedAnimatedBackend() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(76, "useSharedAnimatedBackend"); + markFlagAsAccessed(75, "useSharedAnimatedBackend"); flagValue = currentProvider_->useSharedAnimatedBackend(); useSharedAnimatedBackend_ = flagValue; @@ -1424,7 +1406,7 @@ bool ReactNativeFeatureFlagsAccessor::useTraitHiddenOnAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(77, "useTraitHiddenOnAndroid"); + markFlagAsAccessed(76, "useTraitHiddenOnAndroid"); flagValue = currentProvider_->useTraitHiddenOnAndroid(); useTraitHiddenOnAndroid_ = flagValue; @@ -1442,7 +1424,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(78, "useTurboModuleInterop"); + markFlagAsAccessed(77, "useTurboModuleInterop"); flagValue = currentProvider_->useTurboModuleInterop(); useTurboModuleInterop_ = flagValue; @@ -1460,7 +1442,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModules() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(79, "useTurboModules"); + markFlagAsAccessed(78, "useTurboModules"); flagValue = currentProvider_->useTurboModules(); useTurboModules_ = flagValue; @@ -1478,7 +1460,7 @@ double ReactNativeFeatureFlagsAccessor::viewCullingOutsetRatio() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(80, "viewCullingOutsetRatio"); + markFlagAsAccessed(79, "viewCullingOutsetRatio"); flagValue = currentProvider_->viewCullingOutsetRatio(); viewCullingOutsetRatio_ = flagValue; @@ -1496,7 +1478,7 @@ double ReactNativeFeatureFlagsAccessor::virtualViewHysteresisRatio() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(81, "virtualViewHysteresisRatio"); + markFlagAsAccessed(80, "virtualViewHysteresisRatio"); flagValue = currentProvider_->virtualViewHysteresisRatio(); virtualViewHysteresisRatio_ = flagValue; @@ -1514,7 +1496,7 @@ double ReactNativeFeatureFlagsAccessor::virtualViewPrerenderRatio() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(82, "virtualViewPrerenderRatio"); + markFlagAsAccessed(81, "virtualViewPrerenderRatio"); flagValue = currentProvider_->virtualViewPrerenderRatio(); virtualViewPrerenderRatio_ = flagValue; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h index 9cdfddf5134c..4ba753976e18 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> */ /** @@ -97,7 +97,6 @@ class ReactNativeFeatureFlagsAccessor { bool shouldPressibilityUseW3CPointerEventsForHover(); bool shouldTriggerResponderTransferOnScrollAndroid(); bool skipActivityIdentityAssertionOnHostPause(); - bool sweepActiveTouchOnChildNativeGesturesAndroid(); bool traceTurboModulePromiseRejectionsOnAndroid(); bool updateRuntimeShadowNodeReferencesOnCommit(); bool useAlwaysAvailableJSErrorHandling(); @@ -126,7 +125,7 @@ class ReactNativeFeatureFlagsAccessor { std::unique_ptr currentProvider_; bool wasOverridden_; - std::array, 83> accessedFeatureFlags_; + std::array, 82> accessedFeatureFlags_; std::atomic> commonTestFlag_; std::atomic> cdpInteractionMetricsEnabled_; @@ -193,7 +192,6 @@ class ReactNativeFeatureFlagsAccessor { std::atomic> shouldPressibilityUseW3CPointerEventsForHover_; std::atomic> shouldTriggerResponderTransferOnScrollAndroid_; std::atomic> skipActivityIdentityAssertionOnHostPause_; - std::atomic> sweepActiveTouchOnChildNativeGesturesAndroid_; std::atomic> traceTurboModulePromiseRejectionsOnAndroid_; std::atomic> updateRuntimeShadowNodeReferencesOnCommit_; std::atomic> useAlwaysAvailableJSErrorHandling_; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h index c6e14d892d38..df1d3ce5faa9 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<6120a91f22fd02a0ff5144df38bd1737>> */ /** @@ -287,10 +287,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider { return false; } - bool sweepActiveTouchOnChildNativeGesturesAndroid() override { - return true; - } - bool traceTurboModulePromiseRejectionsOnAndroid() override { return false; } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h index d406d579c1c2..f693d40520c0 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<36163e6b41d151326f7a0948b332672f>> */ /** @@ -630,15 +630,6 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef return ReactNativeFeatureFlagsDefaults::skipActivityIdentityAssertionOnHostPause(); } - bool sweepActiveTouchOnChildNativeGesturesAndroid() override { - auto value = values_["sweepActiveTouchOnChildNativeGesturesAndroid"]; - if (!value.isNull()) { - return value.getBool(); - } - - return ReactNativeFeatureFlagsDefaults::sweepActiveTouchOnChildNativeGesturesAndroid(); - } - bool traceTurboModulePromiseRejectionsOnAndroid() override { auto value = values_["traceTurboModulePromiseRejectionsOnAndroid"]; if (!value.isNull()) { diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h index 3d9d5e0882a4..7ea44550584a 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5dcaab263795b1605da54dbbb617264f>> + * @generated SignedSource<<0f6fd731ebddc32a0583ceb3c81f2b32>> */ /** @@ -90,7 +90,6 @@ class ReactNativeFeatureFlagsProvider { virtual bool shouldPressibilityUseW3CPointerEventsForHover() = 0; virtual bool shouldTriggerResponderTransferOnScrollAndroid() = 0; virtual bool skipActivityIdentityAssertionOnHostPause() = 0; - virtual bool sweepActiveTouchOnChildNativeGesturesAndroid() = 0; virtual bool traceTurboModulePromiseRejectionsOnAndroid() = 0; virtual bool updateRuntimeShadowNodeReferencesOnCommit() = 0; virtual bool useAlwaysAvailableJSErrorHandling() = 0; diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp index 3ce5dc6213b1..95f0c57d38a0 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +++ b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6bd64914d0e2f0c727490a420496fbb0>> + * @generated SignedSource<> */ /** @@ -369,11 +369,6 @@ bool NativeReactNativeFeatureFlags::skipActivityIdentityAssertionOnHostPause( return ReactNativeFeatureFlags::skipActivityIdentityAssertionOnHostPause(); } -bool NativeReactNativeFeatureFlags::sweepActiveTouchOnChildNativeGesturesAndroid( - jsi::Runtime& /*runtime*/) { - return ReactNativeFeatureFlags::sweepActiveTouchOnChildNativeGesturesAndroid(); -} - bool NativeReactNativeFeatureFlags::traceTurboModulePromiseRejectionsOnAndroid( jsi::Runtime& /*runtime*/) { return ReactNativeFeatureFlags::traceTurboModulePromiseRejectionsOnAndroid(); diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h index b06fdb50ff99..808548a19449 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +++ b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<99624bd7682ad34476ac395e8acc43c7>> + * @generated SignedSource<<762f97c6e72f9339ef925adb8481713f>> */ /** @@ -166,8 +166,6 @@ class NativeReactNativeFeatureFlags bool skipActivityIdentityAssertionOnHostPause(jsi::Runtime& runtime); - bool sweepActiveTouchOnChildNativeGesturesAndroid(jsi::Runtime& runtime); - bool traceTurboModulePromiseRejectionsOnAndroid(jsi::Runtime& runtime); bool updateRuntimeShadowNodeReferencesOnCommit(jsi::Runtime& runtime); diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index 18cc5cd3ad78..3e3eab636161 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -741,17 +741,6 @@ const definitions: FeatureFlagDefinitions = { }, ossReleaseStage: 'none', }, - sweepActiveTouchOnChildNativeGesturesAndroid: { - defaultValue: true, - metadata: { - dateAdded: '2025-07-30', - description: - 'A flag to tell Fabric to sweep active touches from JSTouchDispatcher in Android when a child native gesture is started.', - expectedReleaseValue: true, - purpose: 'experimentation', - }, - ossReleaseStage: 'none', - }, traceTurboModulePromiseRejectionsOnAndroid: { defaultValue: false, metadata: { diff --git a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js index 444c3d5be9b8..a04bfd730679 100644 --- a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6bc2fbc946e21d0b51dd9bc71ac041e7>> + * @generated SignedSource<<9284928dae8d148f3ce8041fdbe84990>> * @flow strict * @noformat */ @@ -115,7 +115,6 @@ export type ReactNativeFeatureFlags = $ReadOnly<{ shouldPressibilityUseW3CPointerEventsForHover: Getter, shouldTriggerResponderTransferOnScrollAndroid: Getter, skipActivityIdentityAssertionOnHostPause: Getter, - sweepActiveTouchOnChildNativeGesturesAndroid: Getter, traceTurboModulePromiseRejectionsOnAndroid: Getter, updateRuntimeShadowNodeReferencesOnCommit: Getter, useAlwaysAvailableJSErrorHandling: Getter, @@ -474,10 +473,6 @@ export const shouldTriggerResponderTransferOnScrollAndroid: Getter = cr * Skip activity identity assertion in ReactHostImpl::onHostPause() */ export const skipActivityIdentityAssertionOnHostPause: Getter = createNativeFlagGetter('skipActivityIdentityAssertionOnHostPause', false); -/** - * A flag to tell Fabric to sweep active touches from JSTouchDispatcher in Android when a child native gesture is started. - */ -export const sweepActiveTouchOnChildNativeGesturesAndroid: Getter = createNativeFlagGetter('sweepActiveTouchOnChildNativeGesturesAndroid', true); /** * Enables storing js caller stack when creating promise in native module. This is useful in case of Promise rejection and tracing the cause. */ diff --git a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js index 314709b8087d..c0c4f3e45a13 100644 --- a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0b1f3b307c28d6798d4c15029ad5bc58>> + * @generated SignedSource<<374975d041863bc8d509d2ce0aa8c883>> * @flow strict * @noformat */ @@ -90,7 +90,6 @@ export interface Spec extends TurboModule { +shouldPressibilityUseW3CPointerEventsForHover?: () => boolean; +shouldTriggerResponderTransferOnScrollAndroid?: () => boolean; +skipActivityIdentityAssertionOnHostPause?: () => boolean; - +sweepActiveTouchOnChildNativeGesturesAndroid?: () => boolean; +traceTurboModulePromiseRejectionsOnAndroid?: () => boolean; +updateRuntimeShadowNodeReferencesOnCommit?: () => boolean; +useAlwaysAvailableJSErrorHandling?: () => boolean; From cf85c1d67bdea08addd18854eceecd64f557d45c Mon Sep 17 00:00:00 2001 From: David Vacca Date: Mon, 3 Nov 2025 18:46:28 -0800 Subject: [PATCH 007/562] Add KDoc documentation to ViewManagerOnDemandReactPackage (#54394) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54394 Added comprehensive KDoc documentation to the ViewManagerOnDemandReactPackage interface and its public methods. This interface enables lazy initialization of ViewManagers by deferring their creation until they are actually needed by JavaScript code. The documentation explains the purpose, benefits, and implementation considerations of this on-demand loading pattern. The documentation includes: - Interface-level overview explaining the lazy loading pattern and its performance benefits - Detailed method documentation for getViewManagerNames() and createViewManager() - Thread safety considerations - Parameter and return value descriptions - Usage guidelines and best practices changelog: [internal] internal Reviewed By: alanleedev Differential Revision: D86012042 fbshipit-source-id: d54fef193111c76e07aab0b69f2b567d69856bf6 --- .../react/ViewManagerOnDemandReactPackage.kt | 57 +++++++++++++++++-- 1 file changed, 53 insertions(+), 4 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ViewManagerOnDemandReactPackage.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ViewManagerOnDemandReactPackage.kt index 3b3f381c24ff..ad3ab87ff94f 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ViewManagerOnDemandReactPackage.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ViewManagerOnDemandReactPackage.kt @@ -10,16 +10,65 @@ package com.facebook.react import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.uimanager.ViewManager +/** + * Interface for React Native packages that provide ViewManagers on-demand rather than eagerly. + * + * This interface enables lazy initialization of ViewManagers, improving startup performance by + * deferring the creation of ViewManager instances until they are actually needed by the JavaScript + * code. Instead of instantiating all ViewManagers during package initialization, implementing + * classes can defer creation until a specific ViewManager is requested by name. + * + * This pattern is particularly beneficial for applications with many ViewManagers, as it reduces + * memory footprint and initialization time by only creating the ViewManagers that are actively + * used. + * + * Implementing classes should maintain a registry or factory mechanism to create ViewManagers based + * on their names when requested. + * + * @see com.facebook.react.uimanager.ViewManager + * @see com.facebook.react.ReactPackage + */ public interface ViewManagerOnDemandReactPackage { /** - * Provides a list of names of ViewManagers with which these modules can be accessed from JS. - * Typically, this is ViewManager.getName(). + * Provides the names of all ViewManagers available in this package. + * + * This method returns a collection of ViewManager names that can be accessed from JavaScript. The + * names returned should match the values returned by [ViewManager.getName] for each ViewManager + * that this package can create. The React Native framework uses these names to determine which + * ViewManagers are available and to request their creation on-demand. + * + * This method is called during the initialization phase to register available ViewManagers + * without actually instantiating them, enabling lazy loading. + * + * @param reactContext The React application context, which provides access to the Android + * application context and React Native lifecycle information + * @return A collection of ViewManager names. Returns an empty collection if no ViewManagers are + * available. The returned names should be unique within this package */ public fun getViewManagerNames(reactContext: ReactApplicationContext): Collection /** - * Creates and returns a ViewManager with a specific name {@param viewManagerName}. It's up to an - * implementing package how to interpret the name. + * Creates and returns a ViewManager instance for the specified name. + * + * This method is called lazily when a ViewManager is actually needed by the JavaScript code, + * rather than during package initialization. The implementation should create and configure the + * appropriate ViewManager based on the provided name. The name parameter corresponds to one of + * the names returned by [getViewManagerNames]. + * + * Implementations have flexibility in how they interpret the name and create ViewManagers. For + * example, they might use a factory pattern, reflection, or a simple name-to-class mapping. + * + * This method may be called on any thread, so implementations should ensure thread safety if + * necessary. + * + * @param reactContext The React application context, which provides access to the Android + * application context and React Native lifecycle information needed to initialize the + * ViewManager + * @param viewManagerName The name of the ViewManager to create, matching one of the names + * returned by [getViewManagerNames] + * @return A ViewManager instance for the specified name, or null if the name is not recognized or + * the ViewManager cannot be created. Returning null will result in a JavaScript error when the + * native component is used */ public fun createViewManager( reactContext: ReactApplicationContext, From b9bdef6a53993db735ced7e73ef89cdead8eb8e8 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Mon, 3 Nov 2025 18:46:28 -0800 Subject: [PATCH 008/562] Add comprehensive KDoc documentation to ReactAxOrderHelper (#54395) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54395 Added comprehensive KDoc documentation to the ReactAxOrderHelper object and all public methods to improve code readability and developer experience. The ReactAxOrderHelper utility manages accessibility focus order in React Native views by storing/restoring focusability states and building ordered lists of views based on accessibility preferences. This documentation explains the purpose, behavior, and parameters of each method to help developers understand the accessibility ordering implementation. The documentation includes: - Object-level overview explaining the helper's role in managing accessibility order - Detailed method documentation for cleanUpAxOrder(), restoreFocusability(), disableFocusForSubtree(), and buildAxOrderList() - Parameter descriptions with clear explanations of expected inputs - Comprehensive descriptions of what each method does and when to use it changelog: [internal] internal Reviewed By: alanleedev Differential Revision: D86012271 fbshipit-source-id: b1aaa204e23ec9520c97482c7ff264ec4b1c7287 --- .../react/uimanager/ReactAxOrderHelper.kt | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAxOrderHelper.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAxOrderHelper.kt index dc216837f1bd..78407dc50385 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAxOrderHelper.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAxOrderHelper.kt @@ -11,7 +11,22 @@ import android.view.View import android.view.ViewGroup import com.facebook.react.R +/** + * Helper object for managing accessibility order in React Native views. + * + * This object provides utilities to manage the accessibility focus order of views by storing and + * restoring focusability states, and building ordered lists of views based on accessibility order + * preferences. + */ public object ReactAxOrderHelper { + /** + * Cleans up accessibility order state from a view and its children. + * + * This method removes stored focusability states and accessibility order parent references from + * the view hierarchy. It recursively processes all children of ViewGroup instances. + * + * @param view The view from which to clean up accessibility order state + */ @JvmStatic public fun cleanUpAxOrder(view: View) { val originalFocusability = view.getTag(R.id.original_focusability) as Boolean? @@ -31,6 +46,15 @@ public object ReactAxOrderHelper { } } + /** + * Restores the original focusability state of a view and its children. + * + * This method traverses the view hierarchy and restores the focusability state that was + * previously saved with the `R.id.original_focusability` tag. This is typically used after + * accessibility order operations are complete to return views to their original state. + * + * @param view The view whose focusability state should be restored + */ @JvmStatic public fun restoreFocusability(view: View) { val originalFocusability = view.getTag(R.id.original_focusability) as Boolean? @@ -45,6 +69,16 @@ public object ReactAxOrderHelper { } } + /** + * Disables focus for all views in the subtree that are not in the accessibility order list. + * + * This method recursively traverses the view hierarchy and disables focusability for views that + * are not included in the provided accessibility order list. It stores the original focusability + * state before modifying it, allowing for later restoration. + * + * @param view The root view of the subtree to process + * @param axOrderList The list of native IDs that should maintain their focusability + */ public fun disableFocusForSubtree(view: View, axOrderList: MutableList<*>) { if (!axOrderList.contains(view.getTag(R.id.view_tag_native_id))) { if (view.getTag(R.id.original_focusability) == null) { @@ -60,6 +94,19 @@ public object ReactAxOrderHelper { } } + /** + * Builds an ordered list of views based on accessibility order preferences. + * + * This method recursively traverses the view hierarchy starting from the given view, looking for + * views whose native IDs match entries in the accessibility order list. When matches are found, + * views are placed in the result array at positions corresponding to their position in the + * accessibility order list. This method also tags each view with its accessibility order parent. + * + * @param view The current view being processed in the hierarchy traversal + * @param parent The parent view that defines the accessibility order context + * @param axOrderList The list of native IDs defining the desired accessibility order + * @param result The output array where views are placed according to their order in axOrderList + */ public fun buildAxOrderList( view: View, parent: View, From ce259c5a746de76204d541a6596c9bf64399c768 Mon Sep 17 00:00:00 2001 From: Devan Buggay Date: Mon, 3 Nov 2025 18:55:38 -0800 Subject: [PATCH 009/562] Add CDP frame events (#54249) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54249 Scaffolding for the bare minimum events needed to have frames show up on the performance timeline. layerTreeId hardcoded to `1` for now. Support for dropped and idle frames to be added later, full list can be found here https://github.com/facebook/react-native-devtools-frontend/blob/main/front_end/models/trace/types/TraceEvents.ts#L2971. Some more thought needs to be put into how Android frame timing maps to these events. {F1982947634} Changelog: [Internal] Reviewed By: rubennorte Differential Revision: D85347959 fbshipit-source-id: 950b8866170e963dbb7e7ebbf0873ecb84676304 --- .../tracing/PerformanceTracer.cpp | 64 +++++++++++++++++++ .../tracing/PerformanceTracer.h | 35 +++++++++- 2 files changed, 98 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp index 66f1b4844479..d2f04fca875a 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp @@ -737,6 +737,70 @@ void PerformanceTracer::enqueueTraceEventsFromPerformanceTracerEvent( .args = folly::dynamic::object("data", std::move(data)), }); }, + [&](PerformanceTracerSetLayerTreeIdEvent&& event) { + folly::dynamic data = folly::dynamic::object("frame", event.frame)( + "layerTreeId", event.layerTreeId); + + events.emplace_back( + TraceEvent{ + .name = "SetLayerTreeId", + .cat = "devtools.timeline", + .ph = 'I', + .ts = event.start, + .pid = processId_, + .s = 't', + .tid = event.threadId, + .args = folly::dynamic::object("data", std::move(data)), + }); + }, + [&](PerformanceTracerFrameBeginDrawEvent&& event) { + folly::dynamic data = folly::dynamic::object( + "frameSeqId", event.frameSeqId)("layerTreeId", 1); + + events.emplace_back( + TraceEvent{ + .name = "BeginFrame", + .cat = "devtools.timeline", + .ph = 'I', + .ts = event.start, + .pid = processId_, + .s = 't', + .tid = event.threadId, + .args = std::move(data), + }); + }, + [&](PerformanceTracerFrameCommitEvent&& event) { + folly::dynamic data = folly::dynamic::object( + "frameSeqId", event.frameSeqId)("layerTreeId", 1); + + events.emplace_back( + TraceEvent{ + .name = "Commit", + .cat = "devtools.timeline", + .ph = 'I', + .ts = event.start, + .pid = processId_, + .s = 't', + .tid = event.threadId, + .args = std::move(data), + }); + }, + [&](PerformanceTracerFrameDrawEvent&& event) { + folly::dynamic data = folly::dynamic::object( + "frameSeqId", event.frameSeqId)("layerTreeId", 1); + + events.emplace_back( + TraceEvent{ + .name = "DrawFrame", + .cat = "devtools.timeline", + .ph = 'I', + .ts = event.start, + .pid = processId_, + .s = 't', + .tid = event.threadId, + .args = std::move(data), + }); + }, }, std::move(event)); } diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h index 462c3c4d51a4..d60eb265d783 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h @@ -290,6 +290,35 @@ class PerformanceTracer { HighResTimeStamp createdAt = HighResTimeStamp::now(); }; + struct PerformanceTracerSetLayerTreeIdEvent { + std::string frame; + int layerTreeId; + HighResTimeStamp start; + ThreadId threadId; + HighResTimeStamp createdAt = HighResTimeStamp::now(); + }; + + struct PerformanceTracerFrameBeginDrawEvent { + int frameSeqId; + HighResTimeStamp start; + ThreadId threadId; + HighResTimeStamp createdAt = HighResTimeStamp::now(); + }; + + struct PerformanceTracerFrameCommitEvent { + int frameSeqId; + HighResTimeStamp start; + ThreadId threadId; + HighResTimeStamp createdAt = HighResTimeStamp::now(); + }; + + struct PerformanceTracerFrameDrawEvent { + int frameSeqId; + HighResTimeStamp start; + ThreadId threadId; + HighResTimeStamp createdAt = HighResTimeStamp::now(); + }; + using PerformanceTracerEvent = std::variant< PerformanceTracerEventTimeStamp, PerformanceTracerEventEventLoopTask, @@ -298,7 +327,11 @@ class PerformanceTracer { PerformanceTracerEventMeasure, PerformanceTracerResourceSendRequest, PerformanceTracerResourceReceiveResponse, - PerformanceTracerResourceFinish>; + PerformanceTracerResourceFinish, + PerformanceTracerSetLayerTreeIdEvent, + PerformanceTracerFrameBeginDrawEvent, + PerformanceTracerFrameCommitEvent, + PerformanceTracerFrameDrawEvent>; #pragma mark - Private fields and methods From 91d4332030b8112fb5d700dbe8860ecd5339c0a2 Mon Sep 17 00:00:00 2001 From: Devan Buggay Date: Mon, 3 Nov 2025 18:55:38 -0800 Subject: [PATCH 010/562] Expose frame events on PerformanceTracer (#54361) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54361 Expose a couple frame related events on the PerformanceTracer and call setLayerTreeId when tracing starts (needed for DevTools to parse frames) Changelog: [Internal] Reviewed By: rubennorte Differential Revision: D85145809 fbshipit-source-id: 421ee5441041da64f486f5492fa6705b965751f9 --- .../tracing/PerformanceTracer.cpp | 35 +++++++++++++++++++ .../tracing/PerformanceTracer.h | 13 +++++++ 2 files changed, 48 insertions(+) diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp index d2f04fca875a..d596decb121a 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp @@ -360,6 +360,41 @@ void PerformanceTracer::reportResourceFinish( }); } +void PerformanceTracer::setLayerTreeId(std::string frame, int layerTreeId) { + enqueueEvent( + PerformanceTracerSetLayerTreeIdEvent{ + .frame = std::move(frame), + .layerTreeId = layerTreeId, + .start = HighResTimeStamp::now(), + .threadId = getCurrentThreadId(), + }); +} + +void PerformanceTracer::reportFrameTiming( + int frameSeqId, + HighResTimeStamp start, + HighResTimeStamp end) { + ThreadId threadId = getCurrentThreadId(); + enqueueEvent( + PerformanceTracerFrameBeginDrawEvent{ + .frameSeqId = frameSeqId, + .start = start, + .threadId = threadId, + }); + enqueueEvent( + PerformanceTracerFrameCommitEvent{ + .frameSeqId = frameSeqId, + .start = start, + .threadId = threadId, + }); + enqueueEvent( + PerformanceTracerFrameDrawEvent{ + .frameSeqId = frameSeqId, + .start = end, + .threadId = threadId, + }); +} + /* static */ TraceEvent PerformanceTracer::constructRuntimeProfileTraceEvent( RuntimeProfileId profileId, ProcessId processId, diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h index d60eb265d783..f763cc8597ba 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h @@ -161,6 +161,19 @@ class PerformanceTracer { int encodedDataLength, int decodedBodyLength); + /** + * Sets the active layer tree ID in Chrome DevTools. This is needed in + * order for frames to be parsed. + * + * https://chromedevtools.github.io/devtools-protocol/tot/LayerTree/ + */ + void setLayerTreeId(std::string frame, int layerTreeId); + + /** + * Reports the required frame CDP events for a given native frame. + */ + void reportFrameTiming(int frameSeqId, HighResTimeStamp start, HighResTimeStamp end); + /** * Creates "Profile" Trace Event. * From 6515ada02f8853acc987d76fc6a3b69dd0288ecb Mon Sep 17 00:00:00 2001 From: Calix Tang Date: Mon, 3 Nov 2025 23:05:25 -0800 Subject: [PATCH 011/562] Add logging interface, context, callbacks to VirtualView (#54392) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54392 ## Changelog: [Internal] Adds a VirtualView-specific logging interface, related default implementation within hook. Uses returned callbacks in VirtualView to do lifecycle-related logging. ### Public API Change Changes `ModeChangeEvent` (defined in `VirtualView.js`) to include a field for the Virtual View's current `VirtualViewRenderState`. Reviewed By: lunaleaps Differential Revision: D85712933 fbshipit-source-id: 0bc7a9f0a10e1e801f235975ba179832306815d7 --- packages/react-native/ReactNativeApi.d.ts | 18 +++++++++++-- .../components/virtualview/VirtualView.js | 25 ++++++++++++------- .../virtualview/logger/VirtualViewLogger.js | 21 ++++++++++++++++ .../logger/VirtualViewLoggerTypes.js | 24 ++++++++++++++++++ 4 files changed, 77 insertions(+), 11 deletions(-) create mode 100644 packages/react-native/src/private/components/virtualview/logger/VirtualViewLogger.js create mode 100644 packages/react-native/src/private/components/virtualview/logger/VirtualViewLoggerTypes.js diff --git a/packages/react-native/ReactNativeApi.d.ts b/packages/react-native/ReactNativeApi.d.ts index 2ac82083cbfe..0213edd87dd2 100644 --- a/packages/react-native/ReactNativeApi.d.ts +++ b/packages/react-native/ReactNativeApi.d.ts @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<4e0d1f9ebc86fb237989b7099bf6f9df>> + * @generated SignedSource<> * * This file was generated by scripts/js-api/build-types/index.js. */ @@ -3188,6 +3188,7 @@ declare type ModalRefProps = { declare type ModeChangeEvent = Readonly< Omit & { mode: VirtualViewMode + renderState: VirtualViewRenderState target: HostInstance } > @@ -5838,6 +5839,19 @@ declare namespace VirtualViewMode { export function members(): IterableIterator export function getName(value: VirtualViewMode): string } +declare enum VirtualViewRenderState { + None = 2, + Rendered = 1, + Unknown = 0, +} +declare namespace VirtualViewRenderState { + function cast(value: null | number | undefined): VirtualViewRenderState + function isValid( + value: null | number | undefined, + ): value is VirtualViewRenderState + function members(): IterableIterator + function getName(value: VirtualViewRenderState): string +} declare type WebPlatform = { OS: "web" select: (spec: PlatformSelectSpec) => T @@ -6038,7 +6052,7 @@ export { ModalProps, // 270223fa ModalPropsAndroid, // 515fb173 ModalPropsIOS, // 4fbcedf6 - ModeChangeEvent, // b889a7ce + ModeChangeEvent, // af2c4926 MouseEvent, // 53ede3db NativeAppEventEmitter, // b4d20c1d NativeColorValue, // d2094c29 diff --git a/packages/react-native/src/private/components/virtualview/VirtualView.js b/packages/react-native/src/private/components/virtualview/VirtualView.js index 51183386877c..c57c9cdfc2b8 100644 --- a/packages/react-native/src/private/components/virtualview/VirtualView.js +++ b/packages/react-native/src/private/components/virtualview/VirtualView.js @@ -15,6 +15,7 @@ import type {NativeModeChangeEvent} from './VirtualViewNativeComponent'; import StyleSheet from '../../../../Libraries/StyleSheet/StyleSheet'; import * as ReactNativeFeatureFlags from '../../featureflags/ReactNativeFeatureFlags'; +import {useVirtualViewLogging} from './logger/VirtualViewLogger'; import VirtualViewExperimentalNativeComponent from './VirtualViewExperimentalNativeComponent'; import VirtualViewClassicNativeComponent from './VirtualViewNativeComponent'; import nullthrows from 'nullthrows'; @@ -45,6 +46,7 @@ export type Rect = $ReadOnly<{ export type ModeChangeEvent = $ReadOnly<{ ...Omit, + renderState: VirtualViewRenderState, mode: VirtualViewMode, target: HostInstance, }>; @@ -90,21 +92,26 @@ function createVirtualView(initialState: State): VirtualViewComponent { _logs.states?.push(state); } const isHidden = state !== NotHidden; + const loggingCallbacksRef = useVirtualViewLogging(isHidden, nativeID); const handleModeChange = ( event: NativeSyntheticEvent, ) => { const mode = nullthrows(VirtualViewMode.cast(event.nativeEvent.mode)); + const modeChangeEvent: ModeChangeEvent = { + mode, + renderState: isHidden + ? VirtualViewRenderState.None + : VirtualViewRenderState.Rendered, + // $FlowFixMe[incompatible-type] - we know this is a HostInstance + target: event.currentTarget as HostInstance, + targetRect: event.nativeEvent.targetRect, + thresholdRect: event.nativeEvent.thresholdRect, + }; + loggingCallbacksRef.current?.logModeChange(modeChangeEvent); + const emitModeChange = - onModeChange == null - ? null - : onModeChange.bind(null, { - mode, - // $FlowFixMe[incompatible-type] - we know this is a HostInstance - target: event.currentTarget as HostInstance, - targetRect: event.nativeEvent.targetRect, - thresholdRect: event.nativeEvent.thresholdRect, - }); + onModeChange == null ? null : onModeChange.bind(null, modeChangeEvent); match (mode) { VirtualViewMode.Visible => { diff --git a/packages/react-native/src/private/components/virtualview/logger/VirtualViewLogger.js b/packages/react-native/src/private/components/virtualview/logger/VirtualViewLogger.js new file mode 100644 index 000000000000..2c589d3faf92 --- /dev/null +++ b/packages/react-native/src/private/components/virtualview/logger/VirtualViewLogger.js @@ -0,0 +1,21 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow strict-local + * @format + * @oncall react_native + */ + +import type {IVirtualViewLogFunctions} from './VirtualViewLoggerTypes'; + +import {useRef} from 'react'; + +export hook useVirtualViewLogging( + initiallyHidden: boolean, + nativeID?: string, +): React.RefObject { + return useRef(null); +} diff --git a/packages/react-native/src/private/components/virtualview/logger/VirtualViewLoggerTypes.js b/packages/react-native/src/private/components/virtualview/logger/VirtualViewLoggerTypes.js new file mode 100644 index 000000000000..79cdd0368fed --- /dev/null +++ b/packages/react-native/src/private/components/virtualview/logger/VirtualViewLoggerTypes.js @@ -0,0 +1,24 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow strict-local + * @format + * @oncall react_native + */ + +import type {ModeChangeEvent} from '../../../../..'; + +export interface IVirtualViewLogFunctions { + logMount: () => void; + logModeChange: (event: ModeChangeEvent) => void; + logUnmount: () => void; +} +export interface IVirtualViewLogger { + getVirtualViewLoggingCallbacks( + initiallyHidden: boolean, + nativeID?: string, + ): IVirtualViewLogFunctions; +} From 30370f6aef1d9c177cf778fad415e59313a12c6c Mon Sep 17 00:00:00 2001 From: Jakub Piasecki Date: Tue, 4 Nov 2025 00:33:24 -0800 Subject: [PATCH 012/562] Update `test-release-local` script (#54385) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54385 Changelog: [Internal] `test-release-local` shouldn't be changing the hermes version stored in `version.properties` as this script should be called on a cut branch with hermes already bumped. Reviewed By: cipolleschi Differential Revision: D86105703 fbshipit-source-id: 5a1edd9f7a6cd756521749c2b0023ea683dadf82 --- scripts/release-testing/test-release-local.js | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/scripts/release-testing/test-release-local.js b/scripts/release-testing/test-release-local.js index b0cfebf19ba5..936f4b7252b9 100644 --- a/scripts/release-testing/test-release-local.js +++ b/scripts/release-testing/test-release-local.js @@ -17,8 +17,6 @@ * and to make it more accessible for other devs to play around with. */ -import {getPackageVersionStrByTag} from '../releases/utils/npm-utils'; - const {initNewProjectFromSource} = require('../e2e/init-project-e2e'); const {REPO_ROOT} = require('../shared/consts'); const { @@ -250,27 +248,6 @@ async function testRNTestProject( ? path.join(ciArtifacts.baseTmpPath(), 'maven-local') : '/private/tmp/maven-local'; - const latestHermesCommitly = await getPackageVersionStrByTag( - 'hermes-compiler', - 'nightly', - ); - const latestHermesV1 = await getPackageVersionStrByTag( - 'hermes-compiler', - 'latest-v1', - ); - sed( - '-i', - 'HERMES_VERSION_NAME=.*', - `HERMES_VERSION_NAME=${latestHermesCommitly}`, - 'sdks/hermes-engine/version.properties', - ); - sed( - '-i', - 'HERMES_V1_VERSION_NAME=.*', - `HERMES_V1_VERSION_NAME=${latestHermesV1}`, - 'sdks/hermes-engine/version.properties', - ); - const {newLocalNodeTGZ} = await prepareArtifacts( ciArtifacts, mavenLocalPath, From 1ffa38d0752b35725e79fb5be93fa461041c18e1 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Tue, 4 Nov 2025 02:24:03 -0800 Subject: [PATCH 013/562] Replace Perf Issues warning icon with issue flag (#54386) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54386 Changelog: [Internal] Reviewed By: sbuggay Differential Revision: D86107870 fbshipit-source-id: 0cc408945376e053ddfe4ebdf07c51c1bf07b521 --- .../devsupport/perfmonitor/PerfMonitorOverlayView.kt | 7 ++++--- .../src/main/res/devsupport/drawable/ic_perf_issue.xml | 10 ++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 packages/react-native/ReactAndroid/src/main/res/devsupport/drawable/ic_perf_issue.xml diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorOverlayView.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorOverlayView.kt index 512fb852b724..3dbc7a89f41f 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorOverlayView.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorOverlayView.kt @@ -120,12 +120,12 @@ internal class PerfMonitorOverlayView( setTextColor(Color.WHITE) typeface = TYPEFACE_BOLD val alertDrawable = - context.getDrawable(android.R.drawable.ic_dialog_alert)?.apply { + context.getDrawable(R.drawable.ic_perf_issue)?.apply { setBounds( 0, 1, - dpToPx(TEXT_SIZE_PRIMARY).toInt(), - dpToPx(TEXT_SIZE_PRIMARY).toInt() + 1, + dpToPx(ISSUE_ICON_SIZE).toInt(), + dpToPx(ISSUE_ICON_SIZE).toInt() + 1, ) } setCompoundDrawables(alertDrawable, null, null, null) @@ -214,6 +214,7 @@ internal class PerfMonitorOverlayView( private val COLOR_OVERLAY_BORDER = Color.parseColor("#6C6C6C") private val TEXT_SIZE_PRIMARY = 12f private val TEXT_SIZE_ACCESSORY = 10f + private val ISSUE_ICON_SIZE = 15f private val TYPEFACE_BOLD = Typeface.create("sans-serif", Typeface.BOLD) } } diff --git a/packages/react-native/ReactAndroid/src/main/res/devsupport/drawable/ic_perf_issue.xml b/packages/react-native/ReactAndroid/src/main/res/devsupport/drawable/ic_perf_issue.xml new file mode 100644 index 000000000000..c7aa67e24306 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/res/devsupport/drawable/ic_perf_issue.xml @@ -0,0 +1,10 @@ + + + + From a460df216527b1a4435bd72f027565c5fd5e05a3 Mon Sep 17 00:00:00 2001 From: Jakub Gryko Date: Tue, 4 Nov 2025 02:46:42 -0800 Subject: [PATCH 014/562] Fix keyboard navigation through nested a11y views in ReactHorizontalScrollView with snapToInterval enabled (#54351) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54351 Navigating with keyboard through a11y items in horizontal FlatList that are not the direct child of the ScrollView contentView is broken, because instead of focusing the next focusable sibling, arrowScroll scrolls to the next page. This issue only happens when FlatList has snapToInterval enabled. Fixed the condition that checked if a given focusable view belongs to the contentView. Changelog: [Android] [Fixed] - Fix keyboard navigation through items in horizontal ScrollView with snapToInterval enabled Reviewed By: Abbondanzo Differential Revision: D85261167 fbshipit-source-id: 220c6648c0381899f312b1b1f3923ed5203899b1 --- .../views/scroll/ReactHorizontalScrollView.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java index f4896af4b180..d28150173b1d 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java @@ -28,6 +28,7 @@ import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; +import android.view.ViewParent; import android.view.accessibility.AccessibilityNodeInfo; import android.widget.HorizontalScrollView; import android.widget.OverScroller; @@ -740,6 +741,20 @@ public boolean pageScroll(int direction) { return handled; } + private boolean isDescendantOf(View parent, View view) { + if (view == null || parent == null) { + return false; + } + ViewParent p = view.getParent(); + while (p != null && p.getParent() != null) { + if (p == parent) { + return true; + } + p = p.getParent(); + } + return false; + } + @Override public boolean arrowScroll(int direction) { boolean handled = false; @@ -751,7 +766,7 @@ public boolean arrowScroll(int direction) { View currentFocused = findFocus(); View nextFocused = FocusFinder.getInstance().findNextFocus(this, currentFocused, direction); View rootChild = getContentView(); - if (rootChild != null && nextFocused != null && nextFocused.getParent() == rootChild) { + if (isDescendantOf(rootChild, nextFocused)) { if (!isScrolledInView(nextFocused) && !isMostlyScrolledInView(nextFocused)) { smoothScrollToNextPage(direction); } From 8fa8fb7a5265dc879106dbec6ec0232268910c56 Mon Sep 17 00:00:00 2001 From: Phecda Su Date: Tue, 4 Nov 2025 03:44:57 -0800 Subject: [PATCH 015/562] fix(type): `color` and `blurRadius` of BoxShadowValue mistakenly swapped (#54401) Summary: Fix https://github.com/facebook/react-native/issues/54400 This PR fixes a type definition error. ## Changelog: [GENERAL] [FIXED] - `color` and `blurRadius` of BoxShadowValue mistakenly swapped Pull Request resolved: https://github.com/facebook/react-native/pull/54401 Test Plan: use `tsc` to check Reviewed By: cipolleschi Differential Revision: D86188123 Pulled By: javache fbshipit-source-id: 731fa0cbc1266c2c504e71d89cff7e3aff3e9a9e --- .../react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts b/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts index c0fe6608d450..9446cbe4a248 100644 --- a/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts +++ b/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts @@ -343,8 +343,8 @@ export type DropShadowValue = { export type BoxShadowValue = { offsetX: number | string; offsetY: number | string; - color?: string | undefined; - blurRadius?: ColorValue | number | undefined; + color?: ColorValue | undefined; + blurRadius?: string | number | undefined; spreadDistance?: number | string | undefined; inset?: boolean | undefined; }; From c7a6935587862c16a2b680ef03bbfa8eb500da53 Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Tue, 4 Nov 2025 04:49:44 -0800 Subject: [PATCH 016/562] Default init custom C++ TM struct properties (#54391) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54391 Changelog: [Internal][Fixed] Default init custom C++ TM struct properties Right now we don't do it and produce code as: ``` template struct NativeEditableObjectModulePropertyVal { P0 classOrList; P1 commonFields; P2 desc; P3 isDefault; P4 isSet; P5 scriptValue; P6 value; bool operator==(const NativeEditableObjectModulePropertyVal &other) const { return classOrList == other.classOrList && commonFields == other.commonFields && desc == other.desc && isDefault == other.isDefault && isSet == other.isSet && scriptValue == other.scriptValue && value == other.value; } }; ``` Now we do: ``` template struct NativeEditableObjectModulePropertyVal { P0 classOrList{}; P1 commonFields{}; P2 desc{}; P3 isDefault{}; P4 isSet{}; P5 scriptValue{}; P6 value{}; bool operator==(const NativeEditableObjectModulePropertyVal &other) const { return classOrList == other.classOrList && commonFields == other.commonFields && desc == other.desc && isDefault == other.isDefault && isSet == other.isSet && scriptValue == other.scriptValue && value == other.value; } }; ``` Reviewed By: sbuggay, lenaic Differential Revision: D86142954 fbshipit-source-id: 989e81c55b1fad7e1e58ea89461f064772143c9d --- .../GenerateModuleH-test.js.snap | 20 ++--- .../src/generators/modules/GenerateModuleH.js | 2 +- .../GenerateModuleH-test.js.snap | 82 +++++++++---------- 3 files changed, 52 insertions(+), 52 deletions(-) diff --git a/packages/react-native-codegen/e2e/deep_imports/__tests__/modules/__snapshots__/GenerateModuleH-test.js.snap b/packages/react-native-codegen/e2e/deep_imports/__tests__/modules/__snapshots__/GenerateModuleH-test.js.snap index f4faebb774d9..12b33f60c4df 100644 --- a/packages/react-native-codegen/e2e/deep_imports/__tests__/modules/__snapshots__/GenerateModuleH-test.js.snap +++ b/packages/react-native-codegen/e2e/deep_imports/__tests__/modules/__snapshots__/GenerateModuleH-test.js.snap @@ -290,10 +290,10 @@ struct NativeEnumTurboModuleStateTypeBridging { template struct NativeEnumTurboModuleStateTypeWithEnums { - P0 state; - P1 regular; - P2 str; - P3 num; + P0 state{}; + P1 regular{}; + P2 str{}; + P3 num{}; P4 lowerCase; bool operator==(const NativeEnumTurboModuleStateTypeWithEnums &other) const { return state == other.state && regular == other.regular && str == other.str && num == other.num && lowerCase == other.lowerCase; @@ -594,7 +594,7 @@ private: template struct NativePartialAnnotationTurboModuleSomeObj { - P0 a; + P0 a{}; P1 b; bool operator==(const NativePartialAnnotationTurboModuleSomeObj &other) const { return a == other.a && b == other.b; @@ -1887,10 +1887,10 @@ struct NativeEnumTurboModuleStateTypeBridging { template struct NativeEnumTurboModuleStateTypeWithEnums { - P0 state; - P1 regular; - P2 str; - P3 num; + P0 state{}; + P1 regular{}; + P2 str{}; + P3 num{}; P4 lowerCase; bool operator==(const NativeEnumTurboModuleStateTypeWithEnums &other) const { return state == other.state && regular == other.regular && str == other.str && num == other.num && lowerCase == other.lowerCase; @@ -2191,7 +2191,7 @@ private: template struct NativePartialAnnotationTurboModuleSomeObj { - P0 a; + P0 a{}; P1 b; bool operator==(const NativePartialAnnotationTurboModuleSomeObj &other) const { return a == other.a && b == other.b; diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js index d73766b5a8f3..2779f16572e1 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleH.js @@ -374,7 +374,7 @@ function createStructsString( template <${templateParameterWithTypename}> struct ${structName} { -${templateMemberTypes.map(v => ' ' + v).join(';\n')}; +${templateMemberTypes.map(v => ' ' + v).join('{};\n')}; bool operator==(const ${structName} &other) const { return ${value.properties .map(v => `${v.name} == other.${v.name}`) diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleH-test.js.snap b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleH-test.js.snap index cef99ae744d1..dab0a5575f8d 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleH-test.js.snap +++ b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleH-test.js.snap @@ -269,8 +269,8 @@ struct Bridging { template struct NativeSampleTurboModuleConstantsStruct { - P0 const1; - P1 const2; + P0 const1{}; + P1 const2{}; P2 const3; bool operator==(const NativeSampleTurboModuleConstantsStruct &other) const { return const1 == other.const1 && const2 == other.const2 && const3 == other.const3; @@ -323,8 +323,8 @@ struct NativeSampleTurboModuleConstantsStructBridging { template struct NativeSampleTurboModuleBinaryTreeNode { - std::unique_ptr> left; - P0 value; + std::unique_ptr> left{}; + P0 value{}; std::unique_ptr> right; bool operator==(const NativeSampleTurboModuleBinaryTreeNode &other) const { return left == other.left && value == other.value && right == other.right; @@ -380,7 +380,7 @@ struct NativeSampleTurboModuleBinaryTreeNodeBridging { template struct NativeSampleTurboModuleGraphNode { - P0 label; + P0 label{}; std::optional>> neighbors; bool operator==(const NativeSampleTurboModuleGraphNode &other) const { return label == other.label && neighbors == other.neighbors; @@ -429,8 +429,8 @@ struct NativeSampleTurboModuleGraphNodeBridging { template struct NativeSampleTurboModuleObjectStruct { - P0 a; - P1 b; + P0 a{}; + P1 b{}; P2 c; bool operator==(const NativeSampleTurboModuleObjectStruct &other) const { return a == other.a && b == other.b && c == other.c; @@ -484,8 +484,8 @@ struct NativeSampleTurboModuleObjectStructBridging { template struct NativeSampleTurboModuleValueStruct { - P0 x; - P1 y; + P0 x{}; + P1 y{}; P2 z; bool operator==(const NativeSampleTurboModuleValueStruct &other) const { return x == other.x && y == other.y && z == other.z; @@ -537,9 +537,9 @@ struct NativeSampleTurboModuleValueStructBridging { template struct NativeSampleTurboModuleMenuItem { - P0 label; - P1 onPress; - P2 shortcut; + P0 label{}; + P1 onPress{}; + P2 shortcut{}; std::optional>> items; bool operator==(const NativeSampleTurboModuleMenuItem &other) const { return label == other.label && onPress == other.onPress && shortcut == other.shortcut && items == other.items; @@ -915,8 +915,8 @@ namespace facebook::react { template struct NativeSampleTurboModuleObjectStruct { - P0 a; - P1 b; + P0 a{}; + P1 b{}; P2 c; bool operator==(const NativeSampleTurboModuleObjectStruct &other) const { return a == other.a && b == other.b && c == other.c; @@ -1056,10 +1056,10 @@ namespace facebook::react { template struct AliasTurboModuleOptions { - P0 offset; - P1 size; - P2 displaySize; - P3 resizeMode; + P0 offset{}; + P1 size{}; + P2 displaySize{}; + P3 resizeMode{}; P4 allowExternalStorage; bool operator==(const AliasTurboModuleOptions &other) const { return offset == other.offset && size == other.size && displaySize == other.displaySize && resizeMode == other.resizeMode && allowExternalStorage == other.allowExternalStorage; @@ -1178,11 +1178,11 @@ namespace facebook::react { template struct NativeCameraRollManagerPhotoIdentifierImage { - P0 uri; - P1 playableDuration; - P2 width; - P3 height; - P4 isStored; + P0 uri{}; + P1 playableDuration{}; + P2 width{}; + P3 height{}; + P4 isStored{}; P5 filename; bool operator==(const NativeCameraRollManagerPhotoIdentifierImage &other) const { return uri == other.uri && playableDuration == other.playableDuration && width == other.width && height == other.height && isStored == other.isStored && filename == other.filename; @@ -1292,7 +1292,7 @@ struct NativeCameraRollManagerPhotoIdentifierBridging { template struct NativeCameraRollManagerPhotoIdentifiersPage { - P0 edges; + P0 edges{}; P1 page_info; bool operator==(const NativeCameraRollManagerPhotoIdentifiersPage &other) const { return edges == other.edges && page_info == other.page_info; @@ -1339,12 +1339,12 @@ struct NativeCameraRollManagerPhotoIdentifiersPageBridging { template struct NativeCameraRollManagerGetPhotosParams { - P0 first; - P1 after; - P2 groupName; - P3 groupTypes; - P4 assetType; - P5 maxSize; + P0 first{}; + P1 after{}; + P2 groupName{}; + P3 groupTypes{}; + P4 assetType{}; + P5 maxSize{}; P6 mimeTypes; bool operator==(const NativeCameraRollManagerGetPhotosParams &other) const { return first == other.first && after == other.after && groupName == other.groupName && groupTypes == other.groupTypes && assetType == other.assetType && maxSize == other.maxSize && mimeTypes == other.mimeTypes; @@ -1475,10 +1475,10 @@ private: template struct NativeExceptionsManagerStackFrame { - P0 column; - P1 file; - P2 lineNumber; - P3 methodName; + P0 column{}; + P1 file{}; + P2 lineNumber{}; + P3 methodName{}; P4 collapse; bool operator==(const NativeExceptionsManagerStackFrame &other) const { return column == other.column && file == other.file && lineNumber == other.lineNumber && methodName == other.methodName && collapse == other.collapse; @@ -1546,13 +1546,13 @@ struct NativeExceptionsManagerStackFrameBridging { template struct NativeExceptionsManagerExceptionData { - P0 message; - P1 originalMessage; - P2 name; - P3 componentStack; - P4 stack; - P5 id; - P6 isFatal; + P0 message{}; + P1 originalMessage{}; + P2 name{}; + P3 componentStack{}; + P4 stack{}; + P5 id{}; + P6 isFatal{}; P7 extraData; bool operator==(const NativeExceptionsManagerExceptionData &other) const { return message == other.message && originalMessage == other.originalMessage && name == other.name && componentStack == other.componentStack && stack == other.stack && id == other.id && isFatal == other.isFatal && extraData == other.extraData; From 6fa75cce48f4f3dc631c181a25a9401a2bf88eeb Mon Sep 17 00:00:00 2001 From: Dawid Malecki Date: Tue, 4 Nov 2025 05:19:59 -0800 Subject: [PATCH 017/562] iOS: Add new `RCTCustomBundleConfiguration` for modifying bundle URL (#54006) Summary: ## Summary: Following the [RFC](https://github.com/react-native-community/discussions-and-proposals/pull/933), this PR introduces a new `RCTBundleConfiguration` interface for modifying the bundle URL and exposes a new API for setting its instance in the `RCTReactNativeFactory`. The configuration object includes: - bundleFilePath - the URL of the bundle to load from the file system, - packagerServerScheme - the server scheme (e.g. http or https) to use when loading from the packager, - packagerServerHost - the server host (e.g. localhost) to use when loading from the packager. The `RCTBundleConfiguration` allows only for either `bundleFilePath` or `(packagerServerScheme, packagerServerHost)` to be set by defining appropriate initializers. The logic for creating bundle URL query items is extracted to a separate `createJSBundleURLQuery` method and is used by `RCTBundleManager` to set the configured `packagerServerHost` and `packagerServerScheme`. If the configuration is not defined, the `getBundleURL` method returns the result of the passed `fallbackURLProvider`. The `bundleFilePath` should be created with `[NSURL fileURLWithPath:]`, as otherwise the HMR client is created and fails ungracefully. The check is added in the `getBundle` method to log the error beforehand: Simulator Screenshot - iPhone 16 Pro - 2025-10-15 at 17 09 58 When the `bundleFilePath` is set in the `RCTBundleConfiguration` the `Connect to Metro...` message shouldn't be suggested. ## Changelog: [IOS][ADDED] - Add new `RCTBundleConfiguration` for modifying bundle URL on `RCTReactNativeFactory`. Pull Request resolved: https://github.com/facebook/react-native/pull/54006 Test Plan: Test plan included in the last diff in the stack. Reviewed By: cipolleschi Differential Revision: D84058022 Pulled By: coado fbshipit-source-id: 62c24ec5c6b089220ef9b78add487dcd65aaac9e --- .../React/Base/RCTBundleManager.h | 66 +++++++++++-- .../React/Base/RCTBundleManager.m | 98 +++++++++++++++++++ .../React/Base/RCTBundleURLProvider.h | 24 +++++ .../React/Base/RCTBundleURLProvider.mm | 53 +++++++++- 4 files changed, 230 insertions(+), 11 deletions(-) diff --git a/packages/react-native/React/Base/RCTBundleManager.h b/packages/react-native/React/Base/RCTBundleManager.h index fa0559ba50cd..79dd4b0762ff 100644 --- a/packages/react-native/React/Base/RCTBundleManager.h +++ b/packages/react-native/React/Base/RCTBundleManager.h @@ -9,19 +9,71 @@ @class RCTBridge; -typedef NSURL * (^RCTBridgelessBundleURLGetter)(void); -typedef void (^RCTBridgelessBundleURLSetter)(NSURL *bundleURL); +typedef NSURL *_Nullable (^RCTBridgelessBundleURLGetter)(void); +typedef void (^RCTBridgelessBundleURLSetter)(NSURL *_Nullable bundleURL); +typedef NSMutableArray *_Nullable (^RCTPackagerOptionsUpdater)( + NSMutableArray *_Nullable options); + +/** + * Configuration class for setting up custom bundle locations + */ +@interface RCTBundleConfiguration : NSObject + ++ (nonnull instancetype)defaultConfiguration; + +/** + * The URL of the bundle to load from the file system + */ +@property (nonatomic, readonly, nullable) NSURL *bundleFilePath; + +/** + * The server scheme (e.g. http or https) to use when loading from the packager + */ +@property (nonatomic, readonly, nullable) NSString *packagerServerScheme; + +/** + * The server host (e.g. localhost) to use when loading from the packager + */ +@property (nonatomic, readonly, nullable) NSString *packagerServerHost; + +/** + * A block that modifies the packager options when loading from the packager + */ +@property (nonatomic, copy, nullable) RCTPackagerOptionsUpdater packagerOptionsUpdater; + +/** + * The relative path to the bundle. + */ +@property (nonatomic, readonly, nullable) NSString *bundlePath; + +- (nonnull instancetype)initWithBundleFilePath:(nullable NSURL *)bundleFilePath; + +- (nonnull instancetype)initWithPackagerServerScheme:(nullable NSString *)packagerServerScheme + packagerServerHost:(nullable NSString *)packagerServerHost + bundlePath:(nullable NSString *)bundlePath; + +- (nullable NSURL *)getBundleURL; + +- (nullable NSString *)getPackagerServerScheme; + +- (nullable NSString *)getPackagerServerHost; + +@end /** * A class that allows NativeModules/TurboModules to read/write the bundleURL, with or without the bridge. */ @interface RCTBundleManager : NSObject + +- (nullable instancetype)initWithBundleConfig:(nullable RCTBundleConfiguration *)bundleConfig; + #ifndef RCT_REMOVE_LEGACY_ARCH -- (void)setBridge:(RCTBridge *)bridge; +- (void)setBridge:(nullable RCTBridge *)bridge; #endif // RCT_REMOVE_LEGACY_ARCH -- (void)setBridgelessBundleURLGetter:(RCTBridgelessBundleURLGetter)getter - andSetter:(RCTBridgelessBundleURLSetter)setter - andDefaultGetter:(RCTBridgelessBundleURLGetter)defaultGetter; +- (void)setBridgelessBundleURLGetter:(nullable RCTBridgelessBundleURLGetter)getter + andSetter:(nullable RCTBridgelessBundleURLSetter)setter + andDefaultGetter:(nullable RCTBridgelessBundleURLGetter)defaultGetter; - (void)resetBundleURL; -@property NSURL *bundleURL; +@property (nonatomic, nullable) NSURL *bundleURL; +@property (nonatomic, nonnull) RCTBundleConfiguration *bundleConfig; @end diff --git a/packages/react-native/React/Base/RCTBundleManager.m b/packages/react-native/React/Base/RCTBundleManager.m index baa23d912365..bb81de59c83d 100644 --- a/packages/react-native/React/Base/RCTBundleManager.m +++ b/packages/react-native/React/Base/RCTBundleManager.m @@ -6,9 +6,93 @@ */ #import "RCTBundleManager.h" +#import #import "RCTAssert.h" #import "RCTBridge+Private.h" #import "RCTBridge.h" +#import "RCTLog.h" + +@implementation RCTBundleConfiguration + ++ (instancetype)defaultConfiguration +{ + return [[self alloc] initWithBundleFilePath:nil packagerServerScheme:nil packagerServerHost:nil bundlePath:nil]; +} + +- (instancetype)initWithBundleFilePath:(NSURL *)bundleFilePath +{ + return [self initWithBundleFilePath:bundleFilePath packagerServerScheme:nil packagerServerHost:nil bundlePath:nil]; +} + +- (instancetype)initWithPackagerServerScheme:(NSString *)packagerServerScheme + packagerServerHost:(NSString *)packagerServerHost + bundlePath:(NSString *)bundlePath +{ + return [self initWithBundleFilePath:nil + packagerServerScheme:packagerServerScheme + packagerServerHost:packagerServerHost + bundlePath:bundlePath]; +} + +- (instancetype)initWithBundleFilePath:(NSURL *)bundleFilePath + packagerServerScheme:(NSString *)packagerServerScheme + packagerServerHost:(NSString *)packagerServerHost + bundlePath:(NSString *)bundlePath +{ + if (self = [super init]) { + _bundleFilePath = bundleFilePath; + _packagerServerScheme = packagerServerScheme; + _packagerServerHost = packagerServerHost; + _bundlePath = bundlePath; + _packagerOptionsUpdater = ^NSMutableArray *(NSMutableArray *options) + { + return options; + }; + } + + return self; +} + +- (NSString *)getPackagerServerScheme +{ + if (!_packagerServerScheme) { + return [[RCTBundleURLProvider sharedSettings] packagerScheme]; + } + + return _packagerServerScheme; +} + +- (NSString *)getPackagerServerHost +{ + if (!_packagerServerHost) { + return [[RCTBundleURLProvider sharedSettings] packagerServerHostPort]; + } + + return _packagerServerHost; +} + +- (NSURL *)getBundleURL +{ + if (_packagerServerScheme && _packagerServerHost) { + return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:_bundlePath + packagerServerScheme:_packagerServerScheme + packagerServerHost:_packagerServerHost + packagerOptionsUpdater:_packagerOptionsUpdater]; + } + + if (_bundleFilePath) { + if (!_bundleFilePath.fileURL) { + RCTLogError(@"Bundle file path must be a file URL"); + return nil; + } + + return _bundleFilePath; + } + + return nil; +} + +@end @implementation RCTBundleManager { #ifndef RCT_REMOVE_LEGACY_ARCH @@ -19,6 +103,20 @@ @implementation RCTBundleManager { RCTBridgelessBundleURLGetter _bridgelessBundleURLDefaultGetter; } +- (instancetype)initWithBundleConfig:(RCTBundleConfiguration *)bundleConfig +{ + if (self = [super init]) { + self.bundleConfig = bundleConfig ? bundleConfig : [RCTBundleConfiguration defaultConfiguration]; + } + + return self; +} + +- (instancetype)init +{ + return [self initWithBundleConfig:[RCTBundleConfiguration defaultConfiguration]]; +} + #ifndef RCT_REMOVE_LEGACY_ARCH - (void)setBridge:(RCTBridge *)bridge { diff --git a/packages/react-native/React/Base/RCTBundleURLProvider.h b/packages/react-native/React/Base/RCTBundleURLProvider.h index 3ade62f9c2f2..cc060e4d42d2 100644 --- a/packages/react-native/React/Base/RCTBundleURLProvider.h +++ b/packages/react-native/React/Base/RCTBundleURLProvider.h @@ -7,6 +7,7 @@ #import +#import "RCTBundleManager.h" #import "RCTDefines.h" RCT_EXTERN NSString *_Nonnull const RCTBundleURLProviderUpdatedNotification; @@ -88,6 +89,16 @@ NS_ASSUME_NONNULL_BEGIN */ - (NSURL *__nullable)jsBundleURLForFallbackExtension:(NSString *__nullable)extension; +/** + * Returns the jsBundleURL for a given bundle entrypoint, + * the packager scheme, server host and options updater + * for modifying default packager options. + */ +- (NSURL *__nullable)jsBundleURLForBundleRoot:(NSString *)bundleRoot + packagerServerScheme:(NSString *)packagerServerScheme + packagerServerHost:(NSString *)packagerServerHost + packagerOptionsUpdater:(RCTPackagerOptionsUpdater)packagerOptionsUpdater; + /** * Returns the resourceURL for a given bundle entrypoint and * the fallback offline resource file if the packager is not running. @@ -97,6 +108,19 @@ NS_ASSUME_NONNULL_BEGIN resourceExtension:(NSString *)extension offlineBundle:(NSBundle *)offlineBundle; +/** + * Returns the query items for given options used to create the jsBundleURL. + */ ++ (NSArray *)createJSBundleURLQuery:(NSString *)packagerHost + packagerScheme:(NSString *__nullable)scheme + enableDev:(BOOL)enableDev + enableMinification:(BOOL)enableMinification + inlineSourceMap:(BOOL)inlineSourceMap + modulesOnly:(BOOL)modulesOnly + runModule:(BOOL)runModule + additionalOptions: + (NSDictionary *__nullable)additionalOptions; + /** * The IP address or hostname of the packager. */ diff --git a/packages/react-native/React/Base/RCTBundleURLProvider.mm b/packages/react-native/React/Base/RCTBundleURLProvider.mm index 89ccd0c7ad7a..e99b2dcc1515 100644 --- a/packages/react-native/React/Base/RCTBundleURLProvider.mm +++ b/packages/react-native/React/Base/RCTBundleURLProvider.mm @@ -313,6 +313,54 @@ + (NSURL *__nullable)jsBundleURLForBundleRoot:(NSString *)bundleRoot additionalOptions:(NSDictionary *__nullable)additionalOptions { NSString *path = [NSString stringWithFormat:@"/%@.bundle", bundleRoot]; + NSArray *queryItems = [self createJSBundleURLQuery:packagerHost + packagerScheme:scheme + enableDev:enableDev + enableMinification:enableMinification + inlineSourceMap:inlineSourceMap + modulesOnly:modulesOnly + runModule:runModule + additionalOptions:additionalOptions]; + + return [RCTBundleURLProvider resourceURLForResourcePath:path + packagerHost:packagerHost + scheme:scheme + queryItems:[queryItems copy]]; +} + +- (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot + packagerServerScheme:(NSString *)packagerServerScheme + packagerServerHost:(NSString *)packagerServerHost + packagerOptionsUpdater:(RCTPackagerOptionsUpdater)packagerOptionsUpdater +{ + NSArray *queryItems = [RCTBundleURLProvider createJSBundleURLQuery:packagerServerHost + packagerScheme:packagerServerScheme + enableDev:[self enableDev] + enableMinification:[self enableMinification] + inlineSourceMap:[self inlineSourceMap] + modulesOnly:NO + runModule:YES + additionalOptions:nil]; + + NSArray *updatedQueryItems = packagerOptionsUpdater((NSMutableArray *)queryItems); + NSString *path = [NSString stringWithFormat:@"/%@.bundle", bundleRoot]; + + return [RCTBundleURLProvider resourceURLForResourcePath:path + packagerHost:packagerServerHost + scheme:packagerServerScheme + queryItems:updatedQueryItems]; +} + ++ (NSArray *)createJSBundleURLQuery:(NSString *)packagerHost + packagerScheme:(NSString *__nullable)scheme + enableDev:(BOOL)enableDev + enableMinification:(BOOL)enableMinification + inlineSourceMap:(BOOL)inlineSourceMap + modulesOnly:(BOOL)modulesOnly + runModule:(BOOL)runModule + additionalOptions: + (NSDictionary *__nullable)additionalOptions +{ BOOL lazy = enableDev; NSMutableArray *queryItems = [[NSMutableArray alloc] initWithArray:@[ [[NSURLQueryItem alloc] initWithName:@"platform" value:RCTPlatformName], @@ -345,10 +393,7 @@ + (NSURL *__nullable)jsBundleURLForBundleRoot:(NSString *)bundleRoot } } - return [[self class] resourceURLForResourcePath:path - packagerHost:packagerHost - scheme:scheme - queryItems:[queryItems copy]]; + return queryItems; } + (NSURL *)resourceURLForResourcePath:(NSString *)path From 2c8a376c47cd112b765ef5b4003751875ba9a4b0 Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Tue, 4 Nov 2025 06:15:12 -0800 Subject: [PATCH 018/562] Remove RCTCxxModule (#53532) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53532 Changelog: [General][Breaking] Remove RCTCxxModule Reviewed By: javache Differential Revision: D81294192 fbshipit-source-id: 46c0bcdf289a7d46b75bf4ab0fb3c36fca7eb35f --- .../React/CxxBridge/RCTCxxBridge.mm | 3 +- .../React/CxxModule/RCTCxxModule.h | 29 ------- .../React/CxxModule/RCTCxxModule.mm | 87 ------------------- .../React/CxxModule/RCTCxxUtils.mm | 12 +-- .../ios/ReactCommon/RCTTurboModuleManager.mm | 31 +------ 5 files changed, 6 insertions(+), 156 deletions(-) delete mode 100644 packages/react-native/React/CxxModule/RCTCxxModule.h delete mode 100644 packages/react-native/React/CxxModule/RCTCxxModule.mm diff --git a/packages/react-native/React/CxxBridge/RCTCxxBridge.mm b/packages/react-native/React/CxxBridge/RCTCxxBridge.mm index 7a85fe7d5823..a67f5bc646b9 100644 --- a/packages/react-native/React/CxxBridge/RCTCxxBridge.mm +++ b/packages/react-native/React/CxxBridge/RCTCxxBridge.mm @@ -19,7 +19,6 @@ #import #import #import -#import #import #import #import @@ -992,7 +991,7 @@ - (void)_prepareModulesWithDispatchGroup:(dispatch_group_t)dispatchGroup // modules on the main thread in parallel with loading the JS code, so // they will already be available before they are ever required. dispatch_block_t block = ^{ - if (self.valid && ![moduleData.moduleClass isSubclassOfClass:[RCTCxxModule class]]) { + if (self.valid) { [self->_performanceLogger appendStartForTag:RCTPLNativeModuleMainThread]; (void)[moduleData instance]; [moduleData gatherConstants]; diff --git a/packages/react-native/React/CxxModule/RCTCxxModule.h b/packages/react-native/React/CxxModule/RCTCxxModule.h deleted file mode 100644 index 2c70e2952bc2..000000000000 --- a/packages/react-native/React/CxxModule/RCTCxxModule.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#import - -#import - -#import - -namespace facebook::xplat::module { -class CxxModule; -} // namespace facebook::xplat::module - -/** - * Subclass RCTCxxModule to use cross-platform CxxModule on iOS. - * - * Subclasses must implement the createModule method to lazily produce the module. When running under the Cxx bridge - * modules will be accessed directly, under the Objective-C bridge method access is wrapped through RCTCxxMethod. - */ -@interface RCTCxxModule : NSObject - -// To be implemented by subclasses -- (std::unique_ptr)createModule; - -@end diff --git a/packages/react-native/React/CxxModule/RCTCxxModule.mm b/packages/react-native/React/CxxModule/RCTCxxModule.mm deleted file mode 100644 index d347d3795a84..000000000000 --- a/packages/react-native/React/CxxModule/RCTCxxModule.mm +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#import "RCTCxxModule.h" - -#import -#import -#import -#import - -#import "RCTCxxMethod.h" - -using namespace facebook::react; - -@implementation RCTCxxModule { - std::unique_ptr _module; -} - -+ (NSString *)moduleName -{ - return @""; -} - -+ (BOOL)requiresMainQueueSetup -{ - return NO; -} - -- (void)lazyInit -{ - if (!_module) { - _module = [self createModule]; - - if (_module) { - RCTAssert( - [RCTBridgeModuleNameForClass([self class]) isEqualToString:@(_module->getName().c_str())], - @"CxxModule class name %@ does not match runtime name %s", - RCTBridgeModuleNameForClass([self class]), - _module->getName().c_str()); - } - } -} - -- (std::unique_ptr)createModule -{ - RCTAssert(NO, @"Subclass %@ must override createModule", [self class]); - return nullptr; -} - -- (NSArray> *)methodsToExport -{ - [self lazyInit]; - if (!_module) { - return nil; - } - - NSMutableArray *moduleMethods = [NSMutableArray new]; - for (const auto &method : _module->getMethods()) { - [moduleMethods addObject:[[RCTCxxMethod alloc] initWithCxxMethod:method]]; - } - return moduleMethods; -} - -- (NSDictionary *)constantsToExport -{ - return [self getConstants]; -} - -- (NSDictionary *)getConstants -{ - [self lazyInit]; - if (!_module) { - return nil; - } - - NSMutableDictionary *moduleConstants = [NSMutableDictionary new]; - for (const auto &c : _module->getConstants()) { - moduleConstants[@(c.first.c_str())] = convertFollyDynamicToId(c.second); - } - return moduleConstants; -} - -@end diff --git a/packages/react-native/React/CxxModule/RCTCxxUtils.mm b/packages/react-native/React/CxxModule/RCTCxxUtils.mm index 4c018e6fc967..68691e540243 100644 --- a/packages/react-native/React/CxxModule/RCTCxxUtils.mm +++ b/packages/react-native/React/CxxModule/RCTCxxUtils.mm @@ -13,7 +13,6 @@ #import #import "DispatchMessageQueueThread.h" -#import "RCTCxxModule.h" #import "RCTNativeModule.h" namespace facebook::react { @@ -27,16 +26,7 @@ { std::vector> nativeModules; for (RCTModuleData *moduleData in modules) { - if ([moduleData.moduleClass isSubclassOfClass:[RCTCxxModule class]]) { - nativeModules.emplace_back( - std::make_unique( - instance, - [moduleData.name UTF8String], - [moduleData] { return [(RCTCxxModule *)(moduleData.instance) createModule]; }, - std::make_shared(moduleData))); - } else { - nativeModules.emplace_back(std::make_unique(bridge, moduleData)); - } + nativeModules.emplace_back(std::make_unique(bridge, moduleData)); } return nativeModules; } diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm index ac4c5c5c2a0f..430039da4178 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm +++ b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm @@ -21,7 +21,6 @@ #import #import #import -#import #import #import #import @@ -30,7 +29,6 @@ #import #import #import -#import #import #import @@ -387,24 +385,12 @@ - (instancetype)initWithBridgeProxy:(RCTBridgeProxy *)bridgeProxy } /** - * Step 2d: If the moduleClass is a legacy CxxModule, return a TurboCxxModule instance that - * wraps CxxModule. - */ - Class moduleClass = [module class]; - if ([moduleClass isSubclassOfClass:RCTCxxModule.class]) { - // Use TurboCxxModule compat class to wrap the CxxModule instance. - // This is only for migration convenience, despite less performant. - auto turboModule = std::make_shared([((RCTCxxModule *)module) createModule], _jsInvoker); - _turboModuleCache.insert({moduleName, turboModule}); - return turboModule; - } - - /** - * Step 2e: Return an exact sub-class of ObjC TurboModule + * Step 3: Return an exact sub-class of ObjC TurboModule * * Use respondsToSelector: below to infer conformance to @protocol(RCTTurboModule). Using conformsToProtocol: is * expensive. */ + Class moduleClass = [module class]; if ([module respondsToSelector:@selector(getTurboModule:)]) { ObjCTurboModule::InitParams params = { .moduleName = moduleName, @@ -467,15 +453,6 @@ - (instancetype)initWithBridgeProxy:(RCTBridgeProxy *)bridgeProxy std::shared_ptr nativeMethodCallInvoker = std::make_shared(methodQueue, [self _requiresMainQueueSetup:moduleClass]); - // If module is a legacy cxx module, return TurboCxxModule - if ([moduleClass isSubclassOfClass:RCTCxxModule.class]) { - // Use TurboCxxModule compat class to wrap the CxxModule instance. - // This is only for migration convenience, despite less performant. - auto turboModule = std::make_shared([((RCTCxxModule *)module) createModule], _jsInvoker); - _legacyModuleCache.insert({moduleName, turboModule}); - return turboModule; - } - // Create interop module ObjCTurboModule::InitParams params = { .moduleName = moduleName, @@ -496,7 +473,7 @@ - (instancetype)initWithBridgeProxy:(RCTBridgeProxy *)bridgeProxy - (BOOL)_isTurboModule:(const char *)moduleName { Class moduleClass = [self _getModuleClassFromName:moduleName]; - return moduleClass != nil && (isTurboModuleClass(moduleClass) && ![moduleClass isSubclassOfClass:RCTCxxModule.class]); + return moduleClass != nil && isTurboModuleClass(moduleClass); } - (BOOL)_isLegacyModule:(const char *)moduleName @@ -507,7 +484,7 @@ - (BOOL)_isLegacyModule:(const char *)moduleName - (BOOL)_isLegacyModuleClass:(Class)moduleClass { - return moduleClass != nil && (!isTurboModuleClass(moduleClass) || [moduleClass isSubclassOfClass:RCTCxxModule.class]); + return moduleClass != nil && !isTurboModuleClass(moduleClass); } - (id)_moduleProviderForName:(const char *)moduleName From 5465a511f4c23692371ebe5756d260281386520a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ma=C5=82ecki?= Date: Tue, 4 Nov 2025 06:50:19 -0800 Subject: [PATCH 019/562] iOS: Set `RCTBundleConfiguration` on `RCTReactNativeFactory` and pass it down to the `RCTHost` (#54256) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54256 ## Summary In this diff the `RCTBundleConfiguration` is set on the `RCTReactNativeFactory` and passed down to the `RCTHost` instance where it is set on the bundle manager. The diff prepares bundle config for final usage by packager connection and bundle loader. ## Changelog [IOS][CHANGED] - Add `RCTBundleConfiguration` property on `RCTReactNativeFactory` and pass it down to `RCTHost`. Reviewed By: cipolleschi Differential Revision: D85247248 fbshipit-source-id: a2403ea0247cd8f0aedfffc1eafda1f98b265061 --- .../AppDelegate/RCTReactNativeFactory.h | 3 +++ .../AppDelegate/RCTReactNativeFactory.mm | 12 +++++++++ .../AppDelegate/RCTRootViewFactory.h | 14 +++++++--- .../AppDelegate/RCTRootViewFactory.mm | 26 +++++++++++++++---- .../platform/ios/ReactCommon/RCTHost.h | 5 ++-- .../platform/ios/ReactCommon/RCTHost.mm | 16 +++++++----- 6 files changed, 59 insertions(+), 17 deletions(-) diff --git a/packages/react-native/Libraries/AppDelegate/RCTReactNativeFactory.h b/packages/react-native/Libraries/AppDelegate/RCTReactNativeFactory.h index 455d23e42cb5..1671d7080907 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTReactNativeFactory.h +++ b/packages/react-native/Libraries/AppDelegate/RCTReactNativeFactory.h @@ -24,6 +24,7 @@ @class RCTBridge; @protocol RCTComponentViewProtocol; @class RCTSurfacePresenterBridgeAdapter; +@class RCTBundleConfiguration; @class RCTDevMenuConfiguration; NS_ASSUME_NONNULL_BEGIN @@ -117,6 +118,8 @@ typedef NS_ENUM(NSInteger, RCTReleaseLevel) { Canary, Experimental, Stable }; @property (nonatomic, weak) id delegate; +@property (nonatomic, strong, nonnull) RCTBundleConfiguration *bundleConfiguration; + @property (nonatomic, nullable) RCTDevMenuConfiguration *devMenuConfiguration; @end diff --git a/packages/react-native/Libraries/AppDelegate/RCTReactNativeFactory.mm b/packages/react-native/Libraries/AppDelegate/RCTReactNativeFactory.mm index a54e17796f05..e1eecb0ae73b 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTReactNativeFactory.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTReactNativeFactory.mm @@ -6,6 +6,7 @@ */ #import "RCTReactNativeFactory.h" +#import #import #import #import @@ -42,6 +43,8 @@ @interface RCTReactNativeFactory () < @implementation RCTReactNativeFactory +@synthesize bundleConfiguration = _bundleConfiguration; + - (instancetype)initWithDelegate:(id)delegate { return [self initWithDelegate:delegate releaseLevel:Stable]; @@ -84,6 +87,7 @@ - (void)startReactNativeWithModuleName:(NSString *)moduleName UIView *rootView = [self.rootViewFactory viewWithModuleName:moduleName initialProperties:initialProperties launchOptions:launchOptions + bundleConfiguration:self.bundleConfiguration devMenuConfiguration:self.devMenuConfiguration]; UIViewController *rootViewController = [_delegate createRootViewController]; [_delegate setRootView:rootView toRootViewController:rootViewController]; @@ -112,6 +116,14 @@ - (NSURL *_Nullable)bundleURL return _delegate.bundleURL; } +- (RCTBundleConfiguration *)bundleConfiguration +{ + if (_bundleConfiguration == nullptr) { + _bundleConfiguration = [RCTBundleConfiguration defaultConfiguration]; + } + return _bundleConfiguration; +} + #pragma mark - RCTJSRuntimeConfiguratorProtocol - (JSRuntimeFactoryRef)createJSRuntimeFactory diff --git a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.h b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.h index 119d91a9ee29..7473c01a8b25 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.h +++ b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.h @@ -18,6 +18,7 @@ @class RCTHost; @class RCTRootView; @class RCTSurfacePresenterBridgeAdapter; +@class RCTBundleConfiguration; @class RCTDevMenuConfiguration; NS_ASSUME_NONNULL_BEGIN @@ -202,12 +203,14 @@ typedef void (^RCTLoadSourceForBridgeBlock)(RCTBridge *bridge, RCTSourceLoadBloc * @parameter: moduleName - the name of the app, used by Metro to resolve the module. * @parameter: initialProperties - a set of initial properties. * @parameter: launchOptions - a dictionary with a set of options. + * @parameter: bundleConfiguration - a configuration for custom bundle source URL. * @parameter: devMenuConfiguration - a configuration for enabling/disabling dev menu. */ - (UIView *_Nonnull)viewWithModuleName:(NSString *)moduleName initialProperties:(NSDictionary *__nullable)initialProperties launchOptions:(NSDictionary *__nullable)launchOptions - devMenuConfiguration:(RCTDevMenuConfiguration *__nullable)devMenuConfiguration; + bundleConfiguration:(RCTBundleConfiguration *)bundleConfiguration + devMenuConfiguration:(RCTDevMenuConfiguration *)devMenuConfiguration; - (UIView *_Nonnull)viewWithModuleName:(NSString *)moduleName initialProperties:(NSDictionary *__nullable)initialProperties @@ -226,15 +229,18 @@ typedef void (^RCTLoadSourceForBridgeBlock)(RCTBridge *bridge, RCTSourceLoadBloc * Use it to speed up later viewWithModuleName: calls. * * @parameter: launchOptions - a dictionary with a set of options. + * @parameter: bundleConfiguration - a configuration for custom bundle source URL. * @parameter: devMenuConfiguration - a configuration for enabling/disabling dev menu. */ - (void)initializeReactHostWithLaunchOptions:(NSDictionary *__nullable)launchOptions + bundleConfiguration:(RCTBundleConfiguration *)bundleConfiguration devMenuConfiguration:(RCTDevMenuConfiguration *)devMenuConfiguration; -- (RCTHost *)createReactHost:(NSDictionary *__nullable)launchOptions; - - (RCTHost *)createReactHost:(NSDictionary *__nullable)launchOptions - devMenuConfiguration:(RCTDevMenuConfiguration *__nullable)devMenuConfiguration; + bundleConfiguration:(RCTBundleConfiguration *)bundleConfiguration + devMenuConfiguration:(RCTDevMenuConfiguration *)devMenuConfiguration; + +- (RCTHost *)createReactHost:(NSDictionary *__nullable)launchOptions; @end diff --git a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm index 77201b675ec5..266d6bab211c 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm @@ -21,7 +21,6 @@ #else #import #endif -#import #import #import #import @@ -137,6 +136,7 @@ - (UIView *)viewWithModuleName:(NSString *)moduleName initialProperties:(NSDicti return [self viewWithModuleName:moduleName initialProperties:initialProperties launchOptions:nil + bundleConfiguration:[RCTBundleConfiguration defaultConfiguration] devMenuConfiguration:[RCTDevMenuConfiguration defaultConfiguration]]; } @@ -145,17 +145,21 @@ - (UIView *)viewWithModuleName:(NSString *)moduleName return [self viewWithModuleName:moduleName initialProperties:nil launchOptions:nil + bundleConfiguration:[RCTBundleConfiguration defaultConfiguration] devMenuConfiguration:[RCTDevMenuConfiguration defaultConfiguration]]; } - (void)initializeReactHostWithLaunchOptions:(NSDictionary *)launchOptions + bundleConfiguration:(RCTBundleConfiguration *)bundleConfiguration devMenuConfiguration:(RCTDevMenuConfiguration *)devMenuConfiguration { // Enable TurboModule interop by default in Bridgeless mode RCTEnableTurboModuleInterop(YES); RCTEnableTurboModuleInteropBridgeProxy(YES); - [self createReactHostIfNeeded:launchOptions devMenuConfiguration:devMenuConfiguration]; + [self createReactHostIfNeeded:launchOptions + bundleConfiguration:bundleConfiguration + devMenuConfiguration:devMenuConfiguration]; return; } @@ -166,15 +170,19 @@ - (UIView *)viewWithModuleName:(NSString *)moduleName return [self viewWithModuleName:moduleName initialProperties:initialProperties launchOptions:launchOptions + bundleConfiguration:[RCTBundleConfiguration defaultConfiguration] devMenuConfiguration:[RCTDevMenuConfiguration defaultConfiguration]]; } - (UIView *)viewWithModuleName:(NSString *)moduleName initialProperties:(NSDictionary *)initProps launchOptions:(NSDictionary *)launchOptions + bundleConfiguration:(RCTBundleConfiguration *)bundleConfiguration devMenuConfiguration:(RCTDevMenuConfiguration *)devMenuConfiguration { - [self initializeReactHostWithLaunchOptions:launchOptions devMenuConfiguration:devMenuConfiguration]; + [self initializeReactHostWithLaunchOptions:launchOptions + bundleConfiguration:bundleConfiguration + devMenuConfiguration:devMenuConfiguration]; RCTFabricSurface *surface = [self.reactHost createSurfaceWithModuleName:moduleName initialProperties:initProps ? initProps : @{}]; @@ -245,20 +253,27 @@ - (void)createBridgeAdapterIfNeeded #pragma mark - New Arch Utilities - (void)createReactHostIfNeeded:(NSDictionary *)launchOptions + bundleConfiguration:(RCTBundleConfiguration *)bundleConfiguration devMenuConfiguration:(RCTDevMenuConfiguration *)devMenuConfiguration { if (self.reactHost) { return; } - self.reactHost = [self createReactHost:launchOptions devMenuConfiguration:devMenuConfiguration]; + + self.reactHost = [self createReactHost:launchOptions + bundleConfiguration:bundleConfiguration + devMenuConfiguration:devMenuConfiguration]; } - (RCTHost *)createReactHost:(NSDictionary *)launchOptions { - return [self createReactHost:launchOptions devMenuConfiguration:[RCTDevMenuConfiguration defaultConfiguration]]; + return [self createReactHost:launchOptions + bundleConfiguration:[RCTBundleConfiguration defaultConfiguration] + devMenuConfiguration:[RCTDevMenuConfiguration defaultConfiguration]]; } - (RCTHost *)createReactHost:(NSDictionary *)launchOptions + bundleConfiguration:(RCTBundleConfiguration *)bundleConfiguration devMenuConfiguration:(RCTDevMenuConfiguration *)devMenuConfiguration { __weak __typeof(self) weakSelf = self; @@ -270,6 +285,7 @@ - (RCTHost *)createReactHost:(NSDictionary *)launchOptions return [weakSelf createJSRuntimeFactory]; } launchOptions:launchOptions + bundleConfiguration:bundleConfiguration devMenuConfiguration:devMenuConfiguration]; [reactHost setBundleURLProvider:^NSURL *() { return [weakSelf bundleURL]; diff --git a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.h b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.h index 0aa5845a80f3..9f4721be7f6d 100644 --- a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.h +++ b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.h @@ -18,6 +18,7 @@ NS_ASSUME_NONNULL_BEGIN @class RCTFabricSurface; @class RCTHost; @class RCTModuleRegistry; +@class RCTBundleConfiguration; @class RCTDevMenuConfiguration; @protocol RCTTurboModuleManagerDelegate; @@ -65,8 +66,8 @@ typedef std::shared_ptr (^RCTHostJSEngineProv turboModuleManagerDelegate:(id)turboModuleManagerDelegate jsEngineProvider:(RCTHostJSEngineProvider)jsEngineProvider launchOptions:(nullable NSDictionary *)launchOptions - devMenuConfiguration:(RCTDevMenuConfiguration *__nullable)devMenuConfiguration - NS_DESIGNATED_INITIALIZER; + bundleConfiguration:(RCTBundleConfiguration *)bundleConfiguration + devMenuConfiguration:(RCTDevMenuConfiguration *)devMenuConfiguration NS_DESIGNATED_INITIALIZER; - (instancetype)initWithBundleURLProvider:(RCTHostBundleURLProvider)provider hostDelegate:(id)hostDelegate diff --git a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm index 5c7bf6b986a7..07f4c0686816 100644 --- a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm +++ b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm @@ -152,10 +152,6 @@ - (instancetype)initWithBundleURL:(NSURL *)bundleURL launchOptions:launchOptions]; } -/** - Host initialization should not be resource intensive. A host may be created before any intention of using React Native - has been expressed. - */ - (instancetype)initWithBundleURLProvider:(RCTHostBundleURLProvider)provider hostDelegate:(id)hostDelegate turboModuleManagerDelegate:(id)turboModuleManagerDelegate @@ -167,24 +163,32 @@ - (instancetype)initWithBundleURLProvider:(RCTHostBundleURLProvider)provider turboModuleManagerDelegate:turboModuleManagerDelegate jsEngineProvider:jsEngineProvider launchOptions:launchOptions + bundleConfiguration:[RCTBundleConfiguration defaultConfiguration] devMenuConfiguration:[RCTDevMenuConfiguration defaultConfiguration]]; } +/** + Host initialization should not be resource intensive. A host may be created before any intention of using React Native + has been expressed. + */ - (instancetype)initWithBundleURLProvider:(RCTHostBundleURLProvider)provider hostDelegate:(id)hostDelegate turboModuleManagerDelegate:(id)turboModuleManagerDelegate jsEngineProvider:(RCTHostJSEngineProvider)jsEngineProvider launchOptions:(nullable NSDictionary *)launchOptions + bundleConfiguration:(RCTBundleConfiguration *)bundleConfiguration devMenuConfiguration:(RCTDevMenuConfiguration *)devMenuConfiguration { if (self = [super init]) { _hostDelegate = hostDelegate; _turboModuleManagerDelegate = turboModuleManagerDelegate; - _bundleManager = [RCTBundleManager new]; + _bundleManager = [[RCTBundleManager alloc] initWithBundleConfig:bundleConfiguration]; _moduleRegistry = [RCTModuleRegistry new]; _jsEngineProvider = [jsEngineProvider copy]; _launchOptions = [launchOptions copy]; + [self setBundleURLProvider:provider]; + __weak RCTHost *weakSelf = self; auto bundleURLGetter = ^NSURL *() { RCTHost *strongSelf = weakSelf; @@ -450,7 +454,7 @@ - (void)_setBundleURL:(NSURL *)bundleURL // Sanitize the bundle URL _bundleURL = [RCTConvert NSURL:_bundleURL.absoluteString]; - // Update the global bundle URLq + // Update the global bundle URL RCTReloadCommandSetBundleURL(_bundleURL); } From 57bed9a20c7c7d474dfe8f989437a523616d98cd Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Tue, 4 Nov 2025 07:07:16 -0800 Subject: [PATCH 020/562] Cleanup bundle loading logic (#54403) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54403 Small tweaks to correct atomicity, set the thread name, and avoid a cop of the loaded bundle. Changelog: [Internal] Reviewed By: christophpurrer Differential Revision: D85144130 fbshipit-source-id: a7ecdf5d33b5f30a62e00c4e5ac9fcfa93a056a2 --- .../ReactCxxPlatform/react/runtime/ReactHost.cpp | 13 ++++++++----- .../react/threading/TaskDispatchThread.cpp | 4 ++-- .../react/threading/TaskDispatchThread.h | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp b/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp index 3b63b088cc26..43d7296f07a5 100644 --- a/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp +++ b/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -401,11 +402,13 @@ void ReactHost::destroyReactInstance() { } void ReactHost::reloadReactInstance() { - if (isReloadingReactInstance_) { + if (isReloadingReactInstance_.exchange(true)) { return; } - isReloadingReactInstance_ = true; + std::thread([this]() { + folly::setThreadName("ReactReload"); + std::vector surfaceProps; for (auto& surfaceId : surfaceManager_->getRunningSurfaces()) { if (auto surfaceProp = surfaceManager_->getSurfaceProps(surfaceId); @@ -469,9 +472,8 @@ bool ReactHost::loadScriptFromDevServer() { } }) .get(); - auto script = std::make_unique(response); - reactInstance_->loadScript( - std::move(script), devServerHelper_->getBundleUrl()); + auto script = std::make_unique(std::move(response)); + reactInstance_->loadScript(std::move(script), bundleUrl); devServerHelper_->setupHMRClient(); return true; } catch (...) { @@ -486,6 +488,7 @@ bool ReactHost::loadScriptFromDevServer() { bool ReactHost::loadScriptFromBundlePath(const std::string& bundlePath) { try { LOG(INFO) << "Loading JS bundle from bundle path: " << bundlePath; + // TODO: use platform-native asset loading strategy auto script = std::make_unique( ResourceLoader::getFileContents(bundlePath)); reactInstance_->loadScript(std::move(script), bundlePath); diff --git a/packages/react-native/ReactCxxPlatform/react/threading/TaskDispatchThread.cpp b/packages/react-native/ReactCxxPlatform/react/threading/TaskDispatchThread.cpp index 466d95b07f7c..6944043c5d58 100644 --- a/packages/react-native/ReactCxxPlatform/react/threading/TaskDispatchThread.cpp +++ b/packages/react-native/ReactCxxPlatform/react/threading/TaskDispatchThread.cpp @@ -22,9 +22,9 @@ namespace facebook::react { TaskDispatchThread::TaskDispatchThread( - std::string threadName, + std::string_view threadName, int priorityOffset) noexcept - : threadName_(std::move(threadName)) { + : threadName_(threadName) { #ifdef ANDROID // Attaches the thread to JVM just in case anything calls out to Java thread_ = std::thread([&]() { diff --git a/packages/react-native/ReactCxxPlatform/react/threading/TaskDispatchThread.h b/packages/react-native/ReactCxxPlatform/react/threading/TaskDispatchThread.h index 6c637237bf24..3fe2c996ba6d 100644 --- a/packages/react-native/ReactCxxPlatform/react/threading/TaskDispatchThread.h +++ b/packages/react-native/ReactCxxPlatform/react/threading/TaskDispatchThread.h @@ -26,7 +26,7 @@ class TaskDispatchThread { using TaskFn = std::function; using TimePoint = std::chrono::time_point; - TaskDispatchThread(std::string threadName = "", int priorityOffset = 0) noexcept; + TaskDispatchThread(std::string_view threadName = "", int priorityOffset = 0) noexcept; ~TaskDispatchThread() noexcept; From 5f69ff704af31601c42289196716d0dabae0d487 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Tue, 4 Nov 2025 07:07:16 -0800 Subject: [PATCH 021/562] Rename TurboModuleManagerDelegate to TurboModuleProvider (#54390) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54390 Simplify the concepts used. These are provider methods for TurboModules, nothing more. Changelog: [Internal] Reviewed By: shwanton Differential Revision: D85052393 fbshipit-source-id: 7f972b211196d12156dfd9aa8890d8f7251cdd57 --- ...oModuleManager.h => TurboModuleProvider.h} | 5 ++-- .../react/runtime/ReactHost.cpp | 24 ++++++++----------- .../react/runtime/ReactHost.h | 4 ++-- .../tester/src/TesterAppDelegate.cpp | 6 ++--- ...Delegate.h => TesterTurboModuleProvider.h} | 6 ++--- ...gate.cpp => TesterTurboModuleProvider.cpp} | 9 ++++--- ...gate.cpp => TesterTurboModuleProvider.cpp} | 8 +++---- 7 files changed, 29 insertions(+), 33 deletions(-) rename packages/react-native/ReactCxxPlatform/react/nativemodule/{TurboModuleManager.h => TurboModuleProvider.h} (82%) rename private/react-native-fantom/tester/src/platform/{TesterTurboModuleManagerDelegate.h => TesterTurboModuleProvider.h} (63%) rename private/react-native-fantom/tester/src/platform/meta/{TesterTurboModuleManagerDelegate.cpp => TesterTurboModuleProvider.cpp} (76%) rename private/react-native-fantom/tester/src/platform/oss/{TesterTurboModuleManagerDelegate.cpp => TesterTurboModuleProvider.cpp} (67%) diff --git a/packages/react-native/ReactCxxPlatform/react/nativemodule/TurboModuleManager.h b/packages/react-native/ReactCxxPlatform/react/nativemodule/TurboModuleProvider.h similarity index 82% rename from packages/react-native/ReactCxxPlatform/react/nativemodule/TurboModuleManager.h rename to packages/react-native/ReactCxxPlatform/react/nativemodule/TurboModuleProvider.h index bd8dce5e1056..e5c031ab16b0 100644 --- a/packages/react-native/ReactCxxPlatform/react/nativemodule/TurboModuleManager.h +++ b/packages/react-native/ReactCxxPlatform/react/nativemodule/TurboModuleProvider.h @@ -9,15 +9,16 @@ #include #include + #include #include #include namespace facebook::react { -using TurboModuleManagerDelegate = +using TurboModuleProvider = std::function(const std::string &name, const std::shared_ptr &jsInvoker)>; -using TurboModuleManagerDelegates = std::vector; +using TurboModuleProviders = std::vector; } // namespace facebook::react diff --git a/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp b/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp index 43d7296f07a5..a5f14842c823 100644 --- a/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp +++ b/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp @@ -60,7 +60,7 @@ struct ReactInstanceData { JsErrorHandler::OnJsError onJsError; Logger logger; std::shared_ptr devUIDelegate; - TurboModuleManagerDelegates turboModuleManagerDelegates; + TurboModuleProviders turboModuleProviders; std::shared_ptr logBoxSurfaceDelegate; std::shared_ptr animatedNodesManagerProvider; @@ -75,7 +75,7 @@ ReactHost::ReactHost( JsErrorHandler::OnJsError onJsError, Logger logger, std::shared_ptr devUIDelegate, - TurboModuleManagerDelegates turboModuleManagerDelegates, + TurboModuleProviders turboModuleProviders, std::shared_ptr logBoxSurfaceDelegate, std::shared_ptr animatedNodesManagerProvider, @@ -92,7 +92,7 @@ ReactHost::ReactHost( .onJsError = std::move(onJsError), .logger = std::move(logger), .devUIDelegate = devUIDelegate, - .turboModuleManagerDelegates = std::move(turboModuleManagerDelegates), + .turboModuleProviders = std::move(turboModuleProviders), .logBoxSurfaceDelegate = logBoxSurfaceDelegate, .animatedNodesManagerProvider = animatedNodesManagerProvider, .bindingsInstallFunc = std::move(bindingsInstallFunc)}); @@ -259,18 +259,16 @@ void ReactHost::createReactInstance() { reactInstance_->initializeRuntime( { #if defined(WITH_PERFETTO) || defined(RNCXX_WITH_PROFILING_PROVIDER) - .isProfiling = true + .isProfiling = true, #else - .isProfiling = false + .isProfiling = false, #endif - , .runtimeDiagnosticFlags = ""}, [weakMountingManager = std::weak_ptr(reactInstanceData_->mountingManager), logger = reactInstanceData_->logger, devUIDelegate = reactInstanceData_->devUIDelegate, - turboModuleManagerDelegates = - reactInstanceData_->turboModuleManagerDelegates, + turboModuleProviders = reactInstanceData_->turboModuleProviders, jsInvoker = std::move(jsInvoker), logBoxSurfaceDelegate = reactInstanceData_->logBoxSurfaceDelegate, devServerHelper = @@ -297,7 +295,7 @@ void ReactHost::createReactInstance() { }); auto turboModuleProvider = - [turboModuleManagerDelegates, + [turboModuleProviders, jsInvoker, logBoxSurfaceDelegate, devServerHelper, @@ -311,11 +309,9 @@ void ReactHost::createReactInstance() { react_native_assert( !name.empty() && "TurboModule name must not be empty"); - for (const auto& turboModuleManagerDelegate : - turboModuleManagerDelegates) { - if (turboModuleManagerDelegate) { - if (auto turboModule = - turboModuleManagerDelegate(name, jsInvoker)) { + for (const auto& turboModuleProvider : turboModuleProviders) { + if (turboModuleProvider) { + if (auto turboModule = turboModuleProvider(name, jsInvoker)) { return turboModule; } } diff --git a/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.h b/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.h index 9a02cddb9a7d..f589d16bb4b3 100644 --- a/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.h +++ b/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.h @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include @@ -48,7 +48,7 @@ class ReactHost { JsErrorHandler::OnJsError onJsError, Logger logger, std::shared_ptr devUIDelegate = nullptr, - TurboModuleManagerDelegates turboModuleManagerDelegates = {}, + TurboModuleProviders turboModuleProviders = {}, std::shared_ptr logBoxSurfaceDelegate = nullptr, std::shared_ptr animatedNodesManagerProvider = nullptr, ReactInstance::BindingsInstallFunc bindingsInstallFunc = nullptr); diff --git a/private/react-native-fantom/tester/src/TesterAppDelegate.cpp b/private/react-native-fantom/tester/src/TesterAppDelegate.cpp index 8a784aaa0618..77a6cd17376b 100644 --- a/private/react-native-fantom/tester/src/TesterAppDelegate.cpp +++ b/private/react-native-fantom/tester/src/TesterAppDelegate.cpp @@ -8,7 +8,7 @@ #include "TesterAppDelegate.h" #include "NativeFantom.h" -#include "platform/TesterTurboModuleManagerDelegate.h" +#include "platform/TesterTurboModuleProvider.h" #include "stubs/StubClock.h" #include "stubs/StubHttpClient.h" #include "stubs/StubQueue.h" @@ -88,7 +88,7 @@ TesterAppDelegate::TesterAppDelegate( runLoopObserverManager_ = std::make_shared(); - TurboModuleManagerDelegates turboModuleProviders{ + TurboModuleProviders turboModuleProviders{ [&](const std::string& name, const std::shared_ptr& jsInvoker) -> std::shared_ptr { @@ -105,7 +105,7 @@ TesterAppDelegate::TesterAppDelegate( return nullptr; } }, - TesterTurboModuleManagerDelegate::getTurboModuleManagerDelegate()}; + TesterTurboModuleProvider::getTurboModuleProvider()}; g_setNativeAnimatedNowTimestampFunction(StubClock::now); diff --git a/private/react-native-fantom/tester/src/platform/TesterTurboModuleManagerDelegate.h b/private/react-native-fantom/tester/src/platform/TesterTurboModuleProvider.h similarity index 63% rename from private/react-native-fantom/tester/src/platform/TesterTurboModuleManagerDelegate.h rename to private/react-native-fantom/tester/src/platform/TesterTurboModuleProvider.h index 6148b86dce79..cbe5fbead9d6 100644 --- a/private/react-native-fantom/tester/src/platform/TesterTurboModuleManagerDelegate.h +++ b/private/react-native-fantom/tester/src/platform/TesterTurboModuleProvider.h @@ -7,11 +7,11 @@ #pragma once -#include +#include namespace facebook::react { -class TesterTurboModuleManagerDelegate { +class TesterTurboModuleProvider { public: - static TurboModuleManagerDelegate getTurboModuleManagerDelegate(); + static TurboModuleProvider getTurboModuleProvider(); }; } // namespace facebook::react diff --git a/private/react-native-fantom/tester/src/platform/meta/TesterTurboModuleManagerDelegate.cpp b/private/react-native-fantom/tester/src/platform/meta/TesterTurboModuleProvider.cpp similarity index 76% rename from private/react-native-fantom/tester/src/platform/meta/TesterTurboModuleManagerDelegate.cpp rename to private/react-native-fantom/tester/src/platform/meta/TesterTurboModuleProvider.cpp index 080c285e3c16..ab6cfa836f12 100644 --- a/private/react-native-fantom/tester/src/platform/meta/TesterTurboModuleManagerDelegate.cpp +++ b/private/react-native-fantom/tester/src/platform/meta/TesterTurboModuleProvider.cpp @@ -4,14 +4,13 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ - -#include "../TesterTurboModuleManagerDelegate.h" +#include "../TesterTurboModuleProvider.h" #include namespace facebook::react { -/* static */ TurboModuleManagerDelegate -TesterTurboModuleManagerDelegate::getTurboModuleManagerDelegate() { - return TurboModuleManagerDelegate{ +/* static */ TurboModuleProvider +TesterTurboModuleProvider::getTurboModuleProvider() { + return TurboModuleProvider{ [](const std::string& name, const std::shared_ptr& jsInvoker) -> std::shared_ptr { if (name == NativeCxxModuleExample::kModuleName) { diff --git a/private/react-native-fantom/tester/src/platform/oss/TesterTurboModuleManagerDelegate.cpp b/private/react-native-fantom/tester/src/platform/oss/TesterTurboModuleProvider.cpp similarity index 67% rename from private/react-native-fantom/tester/src/platform/oss/TesterTurboModuleManagerDelegate.cpp rename to private/react-native-fantom/tester/src/platform/oss/TesterTurboModuleProvider.cpp index 9d7b54b2cb09..71216cba2aca 100644 --- a/private/react-native-fantom/tester/src/platform/oss/TesterTurboModuleManagerDelegate.cpp +++ b/private/react-native-fantom/tester/src/platform/oss/TesterTurboModuleProvider.cpp @@ -5,12 +5,12 @@ * LICENSE file in the root directory of this source tree. */ -#include "../TesterTurboModuleManagerDelegate.h" +#include "../TesterTurboModuleProvider.h" namespace facebook::react { -/* static */ TurboModuleManagerDelegate -TesterTurboModuleManagerDelegate::getTurboModuleManagerDelegate() { - return TurboModuleManagerDelegate{ +/* static */ TurboModuleProvider +TesterTurboModuleProvider::getTurboModuleProvider() { + return TurboModuleProvider{ [](const std::string& name, const std::shared_ptr& jsInvoker) -> std::shared_ptr { return nullptr; }}; } From 7cb10a822245ef3a5f933112bed98bda1d7b9e4f Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Tue, 4 Nov 2025 07:07:16 -0800 Subject: [PATCH 022/562] Use AssetManagerString on Android (#54384) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54384 Delegate to the existing AssetManager loading logic in RN Android in the platform-specific ResourceLoader bits. Changelog: [Internal] Reviewed By: christophpurrer Differential Revision: D86099684 fbshipit-source-id: 43d33aa9b4f353e817966d76b8272950d954feab --- .../src/main/jni/react/jni/JSLoader.h | 3 ++- .../react/io/ResourceLoader.cpp | 20 +++++++------------ .../react/io/ResourceLoader.h | 7 +++++-- .../io/platform/android/ResourceLoader.cpp | 17 ++++++---------- .../react/io/platform/cxx/ResourceLoader.cpp | 16 +++++---------- .../ReactCxxPlatform/react/jni/JniHelper.cpp | 2 ++ .../react/runtime/ReactHost.cpp | 4 +--- 7 files changed, 28 insertions(+), 41 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/jni/JSLoader.h b/packages/react-native/ReactAndroid/src/main/jni/react/jni/JSLoader.h index 4c0135bfe201..e41806bf68cd 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/jni/JSLoader.h +++ b/packages/react-native/ReactAndroid/src/main/jni/react/jni/JSLoader.h @@ -10,11 +10,12 @@ #include #include -#include #include namespace facebook::react { +class JSBigString; + struct JAssetManager : jni::JavaClass { static constexpr auto kJavaDescriptor = "Landroid/content/res/AssetManager;"; }; diff --git a/packages/react-native/ReactCxxPlatform/react/io/ResourceLoader.cpp b/packages/react-native/ReactCxxPlatform/react/io/ResourceLoader.cpp index 5e800fba6297..dd7e68171950 100644 --- a/packages/react-native/ReactCxxPlatform/react/io/ResourceLoader.cpp +++ b/packages/react-native/ReactCxxPlatform/react/io/ResourceLoader.cpp @@ -6,9 +6,9 @@ */ #include "ResourceLoader.h" + +#include #include -#include -#include namespace facebook::react { /* static */ bool ResourceLoader::isAbsolutePath(const std::string& path) { @@ -32,19 +32,13 @@ namespace facebook::react { return isResourceFile(path); } -/* static */ std::string ResourceLoader::getFileContents( +/* static */ std::unique_ptr ResourceLoader::getFileContents( const std::string& path) { - if (isAbsolutePath(path)) { - std::ifstream file(path, std::ios::binary); - if (!file.good()) { - return getResourceFileContents(path); - } - std::stringstream buffer; - buffer << file.rdbuf(); - return buffer.str(); + if (isResourceFile(path)) { + return getResourceFileContents(path); + } else { + return JSBigFileString::fromPath(path); } - - return getResourceFileContents(path); } /* static */ std::filesystem::path ResourceLoader::getCacheDirectory( diff --git a/packages/react-native/ReactCxxPlatform/react/io/ResourceLoader.h b/packages/react-native/ReactCxxPlatform/react/io/ResourceLoader.h index 870213964c91..8b4588a1e87f 100644 --- a/packages/react-native/ReactCxxPlatform/react/io/ResourceLoader.h +++ b/packages/react-native/ReactCxxPlatform/react/io/ResourceLoader.h @@ -11,18 +11,21 @@ #include namespace facebook::react { + +class JSBigString; + class ResourceLoader { public: static bool isDirectory(const std::string &path); static bool isFile(const std::string &path); static bool isAbsolutePath(const std::string &path); - static std::string getFileContents(const std::string &path); + static std::unique_ptr getFileContents(const std::string &path); static std::filesystem::path getCacheDirectory(const std::string &path = std::string()); protected: static bool isResourceDirectory(const std::string &path); static bool isResourceFile(const std::string &path); - static std::string getResourceFileContents(const std::string &path); + static std::unique_ptr getResourceFileContents(const std::string &path); private: static constexpr const auto CACHE_DIR = ".react-native-cxx-cache"; diff --git a/packages/react-native/ReactCxxPlatform/react/io/platform/android/ResourceLoader.cpp b/packages/react-native/ReactCxxPlatform/react/io/platform/android/ResourceLoader.cpp index c6dedb6b4686..616a23a281ae 100644 --- a/packages/react-native/ReactCxxPlatform/react/io/platform/android/ResourceLoader.cpp +++ b/packages/react-native/ReactCxxPlatform/react/io/platform/android/ResourceLoader.cpp @@ -10,12 +10,15 @@ #include #include +#include #include +#include #include namespace facebook::react { namespace { + AAssetManager* assetManager_ = nullptr; AAssetManager* getAssetManager() { @@ -52,17 +55,9 @@ bool ResourceLoader::isResourceFile(const std::string& path) { return true; } -std::string ResourceLoader::getResourceFileContents(const std::string& path) { - auto asset = AAssetManager_open( - getAssetManager(), path.c_str(), AASSET_MODE_STREAMING); - if (asset == nullptr) { - throw std::runtime_error("File not found " + path); - } - - std::string result( - (const char*)AAsset_getBuffer(asset), (size_t)AAsset_getLength(asset)); - AAsset_close(asset); - return result; +std::unique_ptr ResourceLoader::getResourceFileContents( + const std::string& path) { + return loadScriptFromAssets(getAssetManager(), path); } std::filesystem::path ResourceLoader::getCacheRootPath() { diff --git a/packages/react-native/ReactCxxPlatform/react/io/platform/cxx/ResourceLoader.cpp b/packages/react-native/ReactCxxPlatform/react/io/platform/cxx/ResourceLoader.cpp index 8cd2d27c2281..2ff6f3545550 100644 --- a/packages/react-native/ReactCxxPlatform/react/io/platform/cxx/ResourceLoader.cpp +++ b/packages/react-native/ReactCxxPlatform/react/io/platform/cxx/ResourceLoader.cpp @@ -5,11 +5,10 @@ * LICENSE file in the root directory of this source tree. */ +#include #include #include -#include -#include namespace facebook::react { @@ -21,17 +20,12 @@ bool ResourceLoader::isResourceFile(const std::string& path) { return std::filesystem::exists(path) && !std::filesystem::is_directory(path); } -std::string ResourceLoader::getResourceFileContents(const std::string& path) { - std::ifstream file(path, std::ios::binary); - if (!file.good()) { - throw std::runtime_error("File not found " + path); - } - std::stringstream buffer; - buffer << file.rdbuf(); - return buffer.str(); +/* static */ std::unique_ptr +ResourceLoader::getResourceFileContents(const std::string& path) { + return JSBigFileString::fromPath(path); } -std::filesystem::path ResourceLoader::getCacheRootPath() { +/* static */ std::filesystem::path ResourceLoader::getCacheRootPath() { return std::filesystem::temp_directory_path(); } } // namespace facebook::react diff --git a/packages/react-native/ReactCxxPlatform/react/jni/JniHelper.cpp b/packages/react-native/ReactCxxPlatform/react/jni/JniHelper.cpp index a3689d5d0949..3799ed893ad8 100644 --- a/packages/react-native/ReactCxxPlatform/react/jni/JniHelper.cpp +++ b/packages/react-native/ReactCxxPlatform/react/jni/JniHelper.cpp @@ -5,6 +5,8 @@ * LICENSE file in the root directory of this source tree. */ +#include "JniHelper.h" + #include #include diff --git a/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp b/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp index a5f14842c823..d58d0a18692f 100644 --- a/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp +++ b/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp @@ -484,9 +484,7 @@ bool ReactHost::loadScriptFromDevServer() { bool ReactHost::loadScriptFromBundlePath(const std::string& bundlePath) { try { LOG(INFO) << "Loading JS bundle from bundle path: " << bundlePath; - // TODO: use platform-native asset loading strategy - auto script = std::make_unique( - ResourceLoader::getFileContents(bundlePath)); + auto script = ResourceLoader::getFileContents(bundlePath); reactInstance_->loadScript(std::move(script), bundlePath); LOG(INFO) << "Loaded JS bundle from bundle path: " << bundlePath; return true; From f51973a9d12eff42bca4d149bb3881c88b4eb68e Mon Sep 17 00:00:00 2001 From: Jakub Piasecki Date: Tue, 4 Nov 2025 08:40:01 -0800 Subject: [PATCH 023/562] Update `publish-npm` script not to change Hermes versions on stable branches (#54404) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54404 Changelog: [Internal] Updates the `publish-npm` script, so that it doesn't try to use the latest (nightly) releases of Hermes when invoked on a stable branch before a version is updated from 1000.0.0. This is the same change as the one used for 0.83 release: https://github.com/facebook/react-native/pull/54402. Reviewed By: cipolleschi Differential Revision: D86201041 fbshipit-source-id: 6e6fc2981853ca1218913e224c97fadea48a72f5 --- .../releases-ci/__tests__/publish-npm-test.js | 32 ++++++++++++++++++- scripts/releases-ci/publish-npm.js | 8 +++-- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/scripts/releases-ci/__tests__/publish-npm-test.js b/scripts/releases-ci/__tests__/publish-npm-test.js index a494dc31a57e..2fee2e9ab90b 100644 --- a/scripts/releases-ci/__tests__/publish-npm-test.js +++ b/scripts/releases-ci/__tests__/publish-npm-test.js @@ -21,6 +21,7 @@ const getNpmInfoMock = jest.fn(); const generateAndroidArtifactsMock = jest.fn(); const getPackagesMock = jest.fn(); const updateHermesVersionsToNightlyMock = jest.fn(); +const getBranchName = jest.fn(); const {REPO_ROOT} = require('../../shared/consts'); const {publishNpm} = require('../publish-npm'); @@ -38,6 +39,7 @@ describe('publish-npm', () => { exitIfNotOnGit: command => command(), getCurrentCommit: () => 'currentco_mmit', isTaggedLatest: isTaggedLatestMock, + getBranchName: getBranchName, })) .mock('../../releases/utils/release-utils', () => ({ generateAndroidArtifacts: generateAndroidArtifactsMock, @@ -93,12 +95,13 @@ describe('publish-npm', () => { }); describe("publishNpm('dry-run')", () => { - it('should set version and not publish', async () => { + it('should set version, hermes version, and not publish', async () => { const version = '1000.0.0-currentco'; getNpmInfoMock.mockReturnValueOnce({ version, tag: null, }); + getBranchName.mockReturnValueOnce('main'); await publishNpm('dry-run'); @@ -118,6 +121,33 @@ describe('publish-npm', () => { expect(publishExternalArtifactsToMavenMock).not.toHaveBeenCalled(); expect(publishPackageMock).not.toHaveBeenCalled(); }); + + it('should set version, not set hermes version, and not publish', async () => { + const version = '1000.0.0-currentco'; + getNpmInfoMock.mockReturnValueOnce({ + version, + tag: null, + }); + getBranchName.mockReturnValueOnce('0.83-stable'); + + await publishNpm('dry-run'); + + expect(updateHermesVersionsToNightlyMock).not.toHaveBeenCalled(); + expect(setVersionMock).not.toBeCalled(); + expect(updateReactNativeArtifactsMock).toBeCalledWith(version, 'dry-run'); + + // Generate Android artifacts is now delegate to build_android entirely + expect(generateAndroidArtifactsMock).not.toHaveBeenCalled(); + + expect(consoleLogMock).toHaveBeenCalledWith( + 'Skipping `npm publish` because --dry-run is set.', + ); + + // Expect termination + expect(publishAndroidArtifactsToMavenMock).not.toHaveBeenCalled(); + expect(publishExternalArtifactsToMavenMock).not.toHaveBeenCalled(); + expect(publishPackageMock).not.toHaveBeenCalled(); + }); }); describe("publishNpm('nightly')", () => { diff --git a/scripts/releases-ci/publish-npm.js b/scripts/releases-ci/publish-npm.js index 75193c1f4ca7..985cf4f13872 100755 --- a/scripts/releases-ci/publish-npm.js +++ b/scripts/releases-ci/publish-npm.js @@ -26,6 +26,7 @@ const { publishAndroidArtifactsToMaven, publishExternalArtifactsToMaven, } = require('../releases/utils/release-utils'); +const {getBranchName} = require('../releases/utils/scm-utils'); const {REPO_ROOT} = require('../shared/consts'); const {getPackages} = require('../shared/monorepoUtils'); const fs = require('fs'); @@ -119,8 +120,11 @@ async function publishNpm(buildType /*: BuildType */) /*: Promise */ { const packageJson = JSON.parse(packageJsonContent); if (packageJson.version === '1000.0.0') { - // Set hermes versions to latest available - await updateHermesVersionsToNightly(); + // Set hermes versions to latest available if not on a stable branch + if (!/.*-stable/.test(getBranchName())) { + await updateHermesVersionsToNightly(); + } + await updateReactNativeArtifacts(version, buildType); } } From 7164f96d581115e6a7a5646a50ded8e5fdff7742 Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Tue, 4 Nov 2025 09:04:31 -0800 Subject: [PATCH 024/562] Limit WebSocket queue size for packager connection (#54300) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54300 # Changelog: [Internal] Establishes a queue mechanism on top of the OkHttp's WebSocket implementation. This mechanism will control the queue size and guarantee that we don't have more than 16MB scheduled. This prevents the scenario of when OkHttp forces WS disconnection because of this threshold. Reviewed By: motiz88, alanleedev Differential Revision: D85581509 fbshipit-source-id: ac3e830c935c1301b674739c96fcbe18446eaa71 --- .../CxxInspectorPackagerConnection.kt | 108 ++++++++++++++++-- ...xxInspectorPackagerConnectionWebSocket.cpp | 31 ++++- .../CxxInspectorPackagerConnectionTest.kt | 28 +++++ 3 files changed, 156 insertions(+), 11 deletions(-) create mode 100644 packages/react-native/ReactAndroid/src/test/java/com/facebook/react/devsupport/CxxInspectorPackagerConnectionTest.kt diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/CxxInspectorPackagerConnection.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/CxxInspectorPackagerConnection.kt index a92d4ac26c62..5e3be8b14413 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/CxxInspectorPackagerConnection.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/CxxInspectorPackagerConnection.kt @@ -9,11 +9,17 @@ package com.facebook.react.devsupport import android.os.Handler import android.os.Looper +import com.facebook.common.logging.FLog import com.facebook.jni.HybridData import com.facebook.proguard.annotations.DoNotStrip import com.facebook.proguard.annotations.DoNotStripAny +import com.facebook.react.common.annotations.VisibleForTesting import com.facebook.soloader.SoLoader import java.io.Closeable +import java.nio.ByteBuffer +import java.nio.charset.StandardCharsets +import java.util.ArrayDeque +import java.util.Queue import java.util.concurrent.TimeUnit import okhttp3.OkHttpClient import okhttp3.Request @@ -67,7 +73,7 @@ internal class CxxInspectorPackagerConnection( */ @DoNotStripAny private interface IWebSocket : Closeable { - fun send(message: String) + fun send(chunk: ByteBuffer) /** * Close the WebSocket connection. NOTE: There is no close() method in the C++ interface. @@ -76,6 +82,95 @@ internal class CxxInspectorPackagerConnection( override fun close() } + /** + * A simple WebSocket wrapper that prevents having more than 16MiB of messages queued + * simultaneously. This is done to stop OkHttp from closing the WebSocket connection. + * + * https://github.com/facebook/react-native/issues/39651. + * https://github.com/square/okhttp/blob/4e7dbec1ea6c9cf8d80422ac9d44b9b185c749a3/okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/ws/RealWebSocket.kt#L684. + */ + private class InspectorPackagerWebSocketImpl( + private val nativeWebSocket: WebSocket, + private val handler: Handler, + ) : IWebSocket { + private val messageQueue: Queue> = ArrayDeque() + private val queueLock = Any() + private val drainRunnable = + object : Runnable { + override fun run() { + FLog.d(TAG, "Attempting to drain the message queue after ${drainDelayMs}ms") + tryDrainQueue() + } + } + + /** + * We are providing a String to OkHttp's WebSocket, because there is no guarantee that all CDP + * clients will support binary data format. + */ + override fun send(chunk: ByteBuffer) { + synchronized(queueLock) { + val messageSize = chunk.capacity() + val message = StandardCharsets.UTF_8.decode(chunk).toString() + val currentQueueSize = nativeWebSocket.queueSize() + + if (currentQueueSize + messageSize > MAX_QUEUE_SIZE) { + FLog.d(TAG, "Reached queue size limit. Queueing the message.") + messageQueue.offer(Pair(message, messageSize)) + scheduleDrain() + } else { + if (messageQueue.isEmpty()) { + nativeWebSocket.send(message) + } else { + messageQueue.offer(Pair(message, messageSize)) + tryDrainQueue() + } + } + } + } + + override fun close() { + synchronized(queueLock) { + handler.removeCallbacks(drainRunnable) + messageQueue.clear() + nativeWebSocket.close(1000, "End of session") + } + } + + private fun tryDrainQueue() { + synchronized(queueLock) { + while (messageQueue.isNotEmpty()) { + val (nextMessage, nextMessageSize) = messageQueue.peek() ?: break + val currentQueueSize = nativeWebSocket.queueSize() + + if (currentQueueSize + nextMessageSize <= MAX_QUEUE_SIZE) { + messageQueue.poll() + if (!nativeWebSocket.send(nextMessage)) { + // The WebSocket is closing, closed, or cancelled. + handler.removeCallbacks(drainRunnable) + messageQueue.clear() + + break + } + } else { + scheduleDrain() + break + } + } + } + } + + private fun scheduleDrain() { + FLog.d(TAG, "Scheduled a task to drain messages queue.") + handler.removeCallbacks(drainRunnable) + handler.postDelayed(drainRunnable, drainDelayMs) + } + + companion object { + private val TAG: String = InspectorPackagerWebSocketImpl::class.java.simpleName + private const val drainDelayMs: Long = 100 + } + } + /** Java implementation of the C++ InspectorPackagerConnectionDelegate interface. */ private class DelegateImpl { private val httpClient = @@ -130,15 +225,8 @@ internal class CxxInspectorPackagerConnection( } }, ) - return object : IWebSocket { - override fun send(message: String) { - webSocket.send(message) - } - override fun close() { - webSocket.close(1000, "End of session") - } - } + return InspectorPackagerWebSocketImpl(webSocket, handler) } @DoNotStrip @@ -152,6 +240,8 @@ internal class CxxInspectorPackagerConnection( SoLoader.loadLibrary("react_devsupportjni") } + @VisibleForTesting internal const val MAX_QUEUE_SIZE = 16L * 1024 * 1024 // 16MiB + @JvmStatic private external fun initHybrid( url: String, diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/devsupport/JCxxInspectorPackagerConnectionWebSocket.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/devsupport/JCxxInspectorPackagerConnectionWebSocket.cpp index 7de472736303..efd1948f7aa5 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/devsupport/JCxxInspectorPackagerConnectionWebSocket.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/devsupport/JCxxInspectorPackagerConnectionWebSocket.cpp @@ -5,6 +5,8 @@ * LICENSE file in the root directory of this source tree. */ +#include + #include "JCxxInspectorPackagerConnectionWebSocket.h" using namespace facebook::jni; @@ -12,10 +14,35 @@ using namespace facebook::react::jsinspector_modern; namespace facebook::react::jsinspector_modern { +namespace { + +local_ref getReadOnlyByteBufferFromStringView( + std::string_view sv) { + auto buffer = JByteBuffer::wrapBytes( + const_cast(reinterpret_cast(sv.data())), + sv.size()); + + /** + * Return a read-only buffer that shares the underlying contents. + * This guards from accidential mutations on the Java side, since we did + * casting above. + * + * https://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html#asReadOnlyBuffer-- + */ + static auto method = + buffer->javaClassStatic()->getMethod( + "asReadOnlyBuffer"); + return method(buffer); +} + +} // namespace + void JCxxInspectorPackagerConnectionWebSocket::send(std::string_view message) { static auto method = - javaClassStatic()->getMethod("send"); - method(self(), std::string(message)); + javaClassStatic()->getMethod)>( + "send"); + auto byteBuffer = getReadOnlyByteBufferFromStringView(message); + method(self(), byteBuffer); } void JCxxInspectorPackagerConnectionWebSocket::close() { diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/devsupport/CxxInspectorPackagerConnectionTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/devsupport/CxxInspectorPackagerConnectionTest.kt new file mode 100644 index 000000000000..462317018ec7 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/devsupport/CxxInspectorPackagerConnectionTest.kt @@ -0,0 +1,28 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package com.facebook.react.devsupport + +import okhttp3.internal.ws.RealWebSocket +import org.assertj.core.api.Assertions.assertThat +import org.junit.Test + +class CxxInspectorPackagerConnectionTest { + + @Test + fun testMaxQueueSizeEquality() { + val okHttpRealWebSocketClass = RealWebSocket::class.java + val okHttpMaxQueueSizeField = okHttpRealWebSocketClass.getDeclaredField("MAX_QUEUE_SIZE") + okHttpMaxQueueSizeField.isAccessible = true + + val okHttpMaxQueueSize = okHttpMaxQueueSizeField.getLong(null) + assertThat(okHttpMaxQueueSize).isNotNull + + assertThat(okHttpMaxQueueSize) + .isEqualTo(CxxInspectorPackagerConnection.Companion.MAX_QUEUE_SIZE) + } +} From 728dfef37ac4e073086c2d3af665c9566f36e2f2 Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Tue, 4 Nov 2025 09:04:31 -0800 Subject: [PATCH 025/562] Bump chunk size for android (#54301) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54301 # Changelog: [Internal] Previously, we would read every single kilobyte and do Java -> C++ call with `jni`. For big objects, like source maps, this means that we were doing at least 1024 calls for a single megabyte of incoming data. From my observations, some source maps on Twilight could reach 30Mb+. There is a trade-off between how much of memory we want to allocate while reading a stream and a runtime. I didn't notice any differences while changing the chunk size from 8Kb to 1Mb and some values in between; in the end it purely depends on the OkHttp's or Okio's implementation of the stream, looks like it uses 8Kb as a chunk size by default: {F1983042734} Reviewed By: huntie Differential Revision: D85652217 fbshipit-source-id: 68474f0b7eece13a0a1c8ea9e617b99a26d81ff9 --- .../react/devsupport/inspector/InspectorNetworkHelper.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/InspectorNetworkHelper.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/InspectorNetworkHelper.kt index a7ba76b09e03..f8459b4b51e3 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/InspectorNetworkHelper.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/InspectorNetworkHelper.kt @@ -66,7 +66,7 @@ internal object InspectorNetworkHelper { response.body().use { responseBody -> if (responseBody != null) { val inputStream = responseBody.byteStream() - val chunkSize = 1024 + val chunkSize = 8 * 1024 // 8Kb val buffer = ByteArray(chunkSize) var bytesRead: Int From 95216bc78fb2ecc4b58c7b91c628c9f12113aaa5 Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Tue, 4 Nov 2025 09:04:31 -0800 Subject: [PATCH 026/562] Increase the size of the chunk of ProfileChunk events (#54352) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54352 # Changelog: [Internal] Since we can now avoid disconnections, it should be safe to increase the chunk size. This should improve the trace loading time. Reviewed By: huntie Differential Revision: D85937959 fbshipit-source-id: 4f0ef023a4d756217de0c756dbc1decbd99698d4 --- .../ReactCommon/jsinspector-modern/TracingAgent.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.cpp b/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.cpp index 05ab99798ab1..a34a722436fe 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/TracingAgent.cpp @@ -26,12 +26,8 @@ const uint16_t TRACE_EVENT_CHUNK_SIZE = 1000; /** * The maximum number of ProfileChunk trace events * that will be sent in a single CDP Tracing.dataCollected message. - * TODO(T219394401): Increase the size once we manage the queue on OkHTTP - side - * properly and avoid WebSocket disconnections when sending a message larger - * than 16MB. */ -const uint16_t PROFILE_TRACE_EVENT_CHUNK_SIZE = 1; +const uint16_t PROFILE_TRACE_EVENT_CHUNK_SIZE = 10; } // namespace From dcee4b967c004fe3647428d5933c93f1557b3470 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Tue, 4 Nov 2025 09:26:24 -0800 Subject: [PATCH 027/562] Update Perf Issue count to match bg tracing window (#54387) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54387 Changelog: [Internal] Reviewed By: sbuggay Differential Revision: D86107869 fbshipit-source-id: dfaf224557158616918a5c89080e7c8802ec1d35 --- .../perfmonitor/PerfMonitorOverlayManager.kt | 23 ++++++++++++++++++- .../jsinspector-modern/PerfMonitorV2.cpp | 10 +++++++- .../jsinspector-modern/PerfMonitorV2.h | 5 +++- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorOverlayManager.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorOverlayManager.kt index aa10fdc89a1f..8e506f5f1a90 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorOverlayManager.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorOverlayManager.kt @@ -7,6 +7,8 @@ package com.facebook.react.devsupport.perfmonitor +import android.os.Handler +import android.os.Looper import com.facebook.react.bridge.UiThreadUtil import com.facebook.react.devsupport.interfaces.TracingState @@ -23,6 +25,7 @@ internal class PerfMonitorOverlayManager( private var view: PerfMonitorOverlayView? = null private var tracingState: TracingState = TracingState.ENABLEDINCDPMODE private var perfIssueCount: Int = 0 + private val handler = Handler(Looper.getMainLooper()) /** Enable the Perf Monitor overlay. */ fun enable() { @@ -75,6 +78,7 @@ internal class PerfMonitorOverlayManager( tracingState = state if (state != TracingState.DISABLED) { perfIssueCount = 0 + handler.removeCallbacksAndMessages(null) } UiThreadUtil.runOnUiThread { view?.updateRecordingState(state) @@ -84,10 +88,23 @@ internal class PerfMonitorOverlayManager( } override fun onPerfIssueAdded(name: String) { + perfIssueCount++ + UiThreadUtil.runOnUiThread { - view?.updatePerfIssueCount(++perfIssueCount) + view?.updatePerfIssueCount(perfIssueCount) view?.show() } + + handler.postDelayed( + { + perfIssueCount-- + UiThreadUtil.runOnUiThread { + view?.updatePerfIssueCount(perfIssueCount) + view?.show() + } + }, + PERF_ISSUE_EXPIRY_MS, + ) } private fun handleRecordingButtonPress() { @@ -105,4 +122,8 @@ internal class PerfMonitorOverlayManager( TracingState.ENABLEDINCDPMODE -> Unit } } + + companion object { + private const val PERF_ISSUE_EXPIRY_MS = 20_000L + } } diff --git a/packages/react-native/ReactCommon/jsinspector-modern/PerfMonitorV2.cpp b/packages/react-native/ReactCommon/jsinspector-modern/PerfMonitorV2.cpp index 223388973435..5da0475e6d25 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/PerfMonitorV2.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/PerfMonitorV2.cpp @@ -21,7 +21,15 @@ void PerfMonitorUpdateHandler::handlePerfIssueAdded( delegate_.unstable_onPerfIssueAdded( PerfIssuePayload{ .name = payload["name"].asString(), - .severity = payload["severity"].asString(), + .severity = payload["severity"].isNull() + ? std::nullopt + : std::make_optional(payload["severity"].asString()), + .description = payload["description"].isNull() + ? std::nullopt + : std::make_optional(payload["description"].asString()), + .learnMoreUrl = payload["learnMoreUrl"].isNull() + ? std::nullopt + : std::make_optional(payload["learnMoreUrl"].asString()), }); } } diff --git a/packages/react-native/ReactCommon/jsinspector-modern/PerfMonitorV2.h b/packages/react-native/ReactCommon/jsinspector-modern/PerfMonitorV2.h index e5c9db4dd3fe..e8336f4755ab 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/PerfMonitorV2.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/PerfMonitorV2.h @@ -7,6 +7,7 @@ #pragma once +#include #include namespace facebook::react::jsinspector_modern { @@ -15,7 +16,9 @@ class HostTargetDelegate; struct PerfIssuePayload { std::string name; - std::string severity; + std::optional severity; + std::optional description; + std::optional learnMoreUrl; }; /** From e1890754f2b3ffcd2ccb9a8358c066f397361e22 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Tue, 4 Nov 2025 10:28:52 -0800 Subject: [PATCH 028/562] Update detail key used for Performance Issues (#54410) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54410 See https://github.com/reactwg/react/discussions/400 Changelog: [Internal] Reviewed By: hoxyq Differential Revision: D86189162 fbshipit-source-id: f42ec6851819237464168a1fc3465a4f0d20b701 --- .../react/internal/featureflags/ReactNativeFeatureFlags.kt | 4 ++-- .../react/featureflags/ReactNativeFeatureFlags.h | 4 ++-- .../react/performance/cdpmetrics/CdpPerfIssuesReporter.cpp | 6 ++++-- .../scripts/featureflags/ReactNativeFeatureFlags.config.js | 2 +- .../src/private/featureflags/ReactNativeFeatureFlags.js | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt index dc58209bc0cc..61c4d681cfa0 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<15ede8025e516f2bdc0329efe49f4a62>> + * @generated SignedSource<<890156e9513bff7c7c6252f8cf4402e4>> */ /** @@ -379,7 +379,7 @@ public object ReactNativeFeatureFlags { public fun overrideBySynchronousMountPropsAtMountingAndroid(): Boolean = accessor.overrideBySynchronousMountPropsAtMountingAndroid() /** - * Enable reporting Performance Issues (`detail.rnPerfIssue`). Displayed in the V2 Performance Monitor and the "Performance Issues" sub-panel in DevTools. + * Enable reporting Performance Issues (`detail.devtools.performanceIssue`). Displayed in the V2 Performance Monitor and the "Performance Issues" sub-panel in DevTools. */ @JvmStatic public fun perfIssuesEnabled(): Boolean = accessor.perfIssuesEnabled() diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h index 1da19577c945..7b7dc6c8c338 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<7e530e01e8c31edb68099a11bc371b89>> */ /** @@ -330,7 +330,7 @@ class ReactNativeFeatureFlags { RN_EXPORT static bool overrideBySynchronousMountPropsAtMountingAndroid(); /** - * Enable reporting Performance Issues (`detail.rnPerfIssue`). Displayed in the V2 Performance Monitor and the "Performance Issues" sub-panel in DevTools. + * Enable reporting Performance Issues (`detail.devtools.performanceIssue`). Displayed in the V2 Performance Monitor and the "Performance Issues" sub-panel in DevTools. */ RN_EXPORT static bool perfIssuesEnabled(); diff --git a/packages/react-native/ReactCommon/react/performance/cdpmetrics/CdpPerfIssuesReporter.cpp b/packages/react-native/ReactCommon/react/performance/cdpmetrics/CdpPerfIssuesReporter.cpp index 5b528cb83ae9..0666c138d66d 100644 --- a/packages/react-native/ReactCommon/react/performance/cdpmetrics/CdpPerfIssuesReporter.cpp +++ b/packages/react-native/ReactCommon/react/performance/cdpmetrics/CdpPerfIssuesReporter.cpp @@ -42,8 +42,10 @@ void CdpPerfIssuesReporter::onMeasureEntry( return; } - if (detail.count("rnPerfIssue") != 0 && detail["rnPerfIssue"].isObject()) { - auto& perfIssue = detail["rnPerfIssue"]; + if (detail.count("devtools") != 0 && detail["devtools"].isObject() && + detail["devtools"].count("performanceIssue") != 0 && + detail["devtools"]["performanceIssue"].isObject()) { + auto& perfIssue = detail["devtools"]["performanceIssue"]; if (perfIssue.count("name") != 0 && perfIssue.count("severity") != 0 && perfIssue.count("description") != 0) { diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index 3e3eab636161..bbe9a39649ea 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -671,7 +671,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { dateAdded: '2025-10-24', description: - 'Enable reporting Performance Issues (`detail.rnPerfIssue`). Displayed in the V2 Performance Monitor and the "Performance Issues" sub-panel in DevTools.', + 'Enable reporting Performance Issues (`detail.devtools.performanceIssue`). Displayed in the V2 Performance Monitor and the "Performance Issues" sub-panel in DevTools.', expectedReleaseValue: true, purpose: 'experimentation', }, diff --git a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js index a04bfd730679..8395c2bfe66a 100644 --- a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<9284928dae8d148f3ce8041fdbe84990>> + * @generated SignedSource<> * @flow strict * @noformat */ @@ -446,7 +446,7 @@ export const hideOffscreenVirtualViewsOnIOS: Getter = createNativeFlagG */ export const overrideBySynchronousMountPropsAtMountingAndroid: Getter = createNativeFlagGetter('overrideBySynchronousMountPropsAtMountingAndroid', false); /** - * Enable reporting Performance Issues (`detail.rnPerfIssue`). Displayed in the V2 Performance Monitor and the "Performance Issues" sub-panel in DevTools. + * Enable reporting Performance Issues (`detail.devtools.performanceIssue`). Displayed in the V2 Performance Monitor and the "Performance Issues" sub-panel in DevTools. */ export const perfIssuesEnabled: Getter = createNativeFlagGetter('perfIssuesEnabled', false); /** From f687292aad20a79d9d8d8a706aa2fec64fe92f4b Mon Sep 17 00:00:00 2001 From: Nolan O'Brien Date: Tue, 4 Nov 2025 10:52:17 -0800 Subject: [PATCH 029/562] Fix missing enum values in switch statements (xplat/js) Summary: Make improvements so that it is safe to use the `-Wswitch-enum` compiler error in a project consuming RN Changelog: [iOS] [Fixed] - Improve support for projects with `-Wswitch-enum` compiler error Differential Revision: D86026884 fbshipit-source-id: 0407cc24d39d8da3badcc38a890b1dcff4b8f10c --- packages/react-native/React/CoreModules/RCTPlatform.mm | 5 +++-- .../ReactCommon/react/renderer/css/CSSSyntaxParser.h | 7 +++++++ .../react-native/ReactCommon/yoga/yoga/style/StyleLength.h | 7 +++++++ .../ReactCommon/yoga/yoga/style/StyleSizeLength.h | 7 +++++++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/packages/react-native/React/CoreModules/RCTPlatform.mm b/packages/react-native/React/CoreModules/RCTPlatform.mm index 2aa4e28be8e7..09060d5e2016 100644 --- a/packages/react-native/React/CoreModules/RCTPlatform.mm +++ b/packages/react-native/React/CoreModules/RCTPlatform.mm @@ -31,10 +31,11 @@ return @"tv"; case UIUserInterfaceIdiomCarPlay: return @"carplay"; -#if TARGET_OS_VISION case UIUserInterfaceIdiomVision: return @"vision"; -#endif + case UIUserInterfaceIdiomMac: + return @"mac"; + case UIUserInterfaceIdiomUnspecified: default: return @"unknown"; } diff --git a/packages/react-native/ReactCommon/react/renderer/css/CSSSyntaxParser.h b/packages/react-native/ReactCommon/react/renderer/css/CSSSyntaxParser.h index 811518aeb75b..6fc072509258 100644 --- a/packages/react-native/ReactCommon/react/renderer/css/CSSSyntaxParser.h +++ b/packages/react-native/ReactCommon/react/renderer/css/CSSSyntaxParser.h @@ -277,7 +277,14 @@ struct CSSComponentValueVisitorDispatcher { return {}; } +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wswitch-enum" +#endif switch (parser.peek().type()) { +#ifdef __clang__ +#pragma clang diagnostic pop +#endif case CSSTokenType::Function: if (auto ret = visitFunction(visitors...)) { return *ret; diff --git a/packages/react-native/ReactCommon/yoga/yoga/style/StyleLength.h b/packages/react-native/ReactCommon/yoga/yoga/style/StyleLength.h index 01e69718b2bc..8099ce7df4e4 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/style/StyleLength.h +++ b/packages/react-native/ReactCommon/yoga/yoga/style/StyleLength.h @@ -74,7 +74,14 @@ class StyleLength { } constexpr FloatOptional resolve(float referenceLength) { +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wswitch-enum" +#endif switch (unit_) { +#ifdef __clang__ +#pragma clang diagnostic pop +#endif case Unit::Point: return value_; case Unit::Percent: diff --git a/packages/react-native/ReactCommon/yoga/yoga/style/StyleSizeLength.h b/packages/react-native/ReactCommon/yoga/yoga/style/StyleSizeLength.h index 8dc4f2401320..fc4d371e421b 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/style/StyleSizeLength.h +++ b/packages/react-native/ReactCommon/yoga/yoga/style/StyleSizeLength.h @@ -99,7 +99,14 @@ class StyleSizeLength { } constexpr FloatOptional resolve(float referenceLength) { +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wswitch-enum" +#endif switch (unit_) { +#ifdef __clang__ +#pragma clang diagnostic pop +#endif case Unit::Point: return value_; case Unit::Percent: From 3012aac2adc04659d6b882e910b1ecf14c8e5225 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Tue, 4 Nov 2025 13:06:33 -0800 Subject: [PATCH 030/562] JSBigString implements jsi::Buffer (#54206) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54206 We don't need `BigStringBuffer` as a separate abstraction when `JSBigString` implements almost exactly the same interface. Changelog: [General][Changed] BigStringBuffer is deprecated and will be removed in a future release - use JSBigString instead [General][Breaking] JSBigString mutable data accessor has been renamed to mutableData Reviewed By: Abbondanzo Differential Revision: D84458636 fbshipit-source-id: f507fd4ff842301af3047afeccf853f30a2f72df --- .../src/main/jni/react/jni/JSLoader.cpp | 2 +- .../ReactCommon/cxxreact/JSBigString.h | 19 ++++++++++++++----- .../cxxreact/JSIndexedRAMBundle.cpp | 9 ++++----- .../jsiexecutor/jsireact/JSIExecutor.cpp | 5 ++--- .../jsiexecutor/jsireact/JSIExecutor.h | 4 ++-- .../react/runtime/ReactInstance.cpp | 8 ++++---- 6 files changed, 27 insertions(+), 20 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/jni/JSLoader.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/jni/JSLoader.cpp index 15be4c408bcf..e9e0471879f7 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/jni/JSLoader.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/jni/JSLoader.cpp @@ -72,7 +72,7 @@ loadScriptFromAssets(AAssetManager* manager, const std::string& assetName) { } auto buf = std::make_unique(script->size()); - memcpy(buf->data(), script->c_str(), script->size()); + memcpy(buf->mutableData(), script->c_str(), script->size()); return buf; } } diff --git a/packages/react-native/ReactCommon/cxxreact/JSBigString.h b/packages/react-native/ReactCommon/cxxreact/JSBigString.h index 6e3030043a74..3668b3254625 100644 --- a/packages/react-native/ReactCommon/cxxreact/JSBigString.h +++ b/packages/react-native/ReactCommon/cxxreact/JSBigString.h @@ -10,6 +10,8 @@ #include #include +#include + #ifndef RN_EXPORT #ifdef _MSC_VER #define RN_EXPORT @@ -27,15 +29,17 @@ namespace facebook::react { // large string needs to be curried into a std::function<>, which must // by CopyConstructible. -class JSBigString { +class JSBigString : public facebook::jsi::Buffer { public: JSBigString() = default; - // Not copyable + // Not copyable or movable JSBigString(const JSBigString &) = delete; JSBigString &operator=(const JSBigString &) = delete; + JSBigString(JSBigString &&) = delete; + JSBigString &operator=(JSBigString &&) = delete; - virtual ~JSBigString() = default; + ~JSBigString() override = default; virtual bool isAscii() const = 0; @@ -43,7 +47,12 @@ class JSBigString { virtual const char *c_str() const = 0; // Length of the c_str without the NULL byte. - virtual size_t size() const = 0; + size_t size() const override = 0; + + const uint8_t *data() const final + { + return reinterpret_cast(c_str()); + } }; // Concrete JSBigString implementation which holds a std::string @@ -105,7 +114,7 @@ class RN_EXPORT JSBigBufferString : public JSBigString { return m_size; } - char *data() + char *mutableData() { return m_data; } diff --git a/packages/react-native/ReactCommon/cxxreact/JSIndexedRAMBundle.cpp b/packages/react-native/ReactCommon/cxxreact/JSIndexedRAMBundle.cpp index 3d9036d9cad0..f2320b002614 100644 --- a/packages/react-native/ReactCommon/cxxreact/JSIndexedRAMBundle.cpp +++ b/packages/react-native/ReactCommon/cxxreact/JSIndexedRAMBundle.cpp @@ -60,8 +60,8 @@ void JSIndexedRAMBundle::init() { "header size must exactly match the input file format"); readBundle(reinterpret_cast(header), sizeof(header)); - const size_t numTableEntries = folly::Endian::little(header[1]); - const size_t startupCodeSize = folly::Endian::little(header[2]); + size_t numTableEntries = folly::Endian::little(header[1]); + std::streamsize startupCodeSize = folly::Endian::little(header[2]); // allocate memory for meta data and lookup table. m_table = ModuleTable(numTableEntries); @@ -73,7 +73,7 @@ void JSIndexedRAMBundle::init() { // read the startup code m_startupCode = std::make_unique(startupCodeSize - 1); - readBundle(m_startupCode->data(), startupCodeSize - 1); + readBundle(m_startupCode->mutableData(), startupCodeSize - 1); } JSIndexedRAMBundle::Module JSIndexedRAMBundle::getModule( @@ -109,8 +109,7 @@ std::string JSIndexedRAMBundle::getModuleCode(const uint32_t id) const { return ret; } -void JSIndexedRAMBundle::readBundle(char* buffer, const std::streamsize bytes) - const { +void JSIndexedRAMBundle::readBundle(char* buffer, std::streamsize bytes) const { if (!m_bundle->read(buffer, bytes)) { if ((m_bundle->rdstate() & std::ios::eofbit) != 0) { throw std::ios_base::failure("Unexpected end of RAM Bundle file"); diff --git a/packages/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp b/packages/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp index 0a47fcaeb0af..183b148c635a 100644 --- a/packages/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp +++ b/packages/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp @@ -168,8 +168,7 @@ void JSIExecutor::loadBundle( ReactMarker::logTaggedMarker( ReactMarker::RUN_JS_BUNDLE_START, scriptName.c_str()); } - runtime_->evaluateJavaScript( - std::make_unique(std::move(script)), sourceURL); + runtime_->evaluateJavaScript(std::move(script), sourceURL); flush(); if (hasLogger) { ReactMarker::logTaggedMarker( @@ -212,7 +211,7 @@ void JSIExecutor::registerBundle( "Empty bundle registered with ID " + tag + " from " + bundlePath); } runtime_->evaluateJavaScript( - std::make_unique(std::move(script)), + std::move(script), JSExecutor::getSyntheticBundlePath(bundleId, bundlePath)); } ReactMarker::logTaggedMarker( diff --git a/packages/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.h b/packages/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.h index b8d8b2e11dea..ad088e873bce 100644 --- a/packages/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.h +++ b/packages/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.h @@ -49,7 +49,7 @@ namespace facebook::react { using JSIScopedTimeoutInvoker = std::function &invokee, std::function errorMessageProducer)>; -class BigStringBuffer : public jsi::Buffer { +class [[deprecated("JSBigString implements jsi::Buffer directly")]] BigStringBuffer : public jsi::Buffer { public: BigStringBuffer(std::unique_ptr script) : script_(std::move(script)) {} @@ -60,7 +60,7 @@ class BigStringBuffer : public jsi::Buffer { const uint8_t *data() const override { - return reinterpret_cast(script_->c_str()); + return script_->data(); } private: diff --git a/packages/react-native/ReactCommon/react/runtime/ReactInstance.cpp b/packages/react-native/ReactCommon/react/runtime/ReactInstance.cpp index c2ecf402d79c..7b3e6786b463 100644 --- a/packages/react-native/ReactCommon/react/runtime/ReactInstance.cpp +++ b/packages/react-native/ReactCommon/react/runtime/ReactInstance.cpp @@ -221,7 +221,7 @@ void ReactInstance::loadScript( const std::string& sourceURL, std::function&& beforeLoad, std::function&& afterLoad) { - auto buffer = std::make_shared(std::move(script)); + std::shared_ptr buffer(std::move(script)); std::string scriptName = simpleBasename(sourceURL); runtimeScheduler_->scheduleWork([this, @@ -232,7 +232,7 @@ void ReactInstance::loadScript( std::weak_ptr( bufferedRuntimeExecutor_), beforeLoad, - afterLoad](jsi::Runtime& runtime) { + afterLoad](jsi::Runtime& runtime) mutable { if (beforeLoad) { beforeLoad(runtime); } @@ -357,7 +357,6 @@ void ReactInstance::registerSegment( throw std::invalid_argument( "Empty segment registered with ID " + tag + " from " + segmentPath); } - auto buffer = std::make_shared(std::move(script)); bool hasLogger(ReactMarker::logTaggedMarkerBridgelessImpl != nullptr); if (hasLogger) { @@ -369,7 +368,8 @@ void ReactInstance::registerSegment( #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" runtime.evaluateJavaScript( - buffer, JSExecutor::getSyntheticBundlePath(segmentId, segmentPath)); + std::move(script), + JSExecutor::getSyntheticBundlePath(segmentId, segmentPath)); #pragma clang diagnostic pop LOG(WARNING) << "Finished evaluating segment " << segmentId << " in ReactInstance::registerSegment"; From 963f7a5c24532cdd9019911a05dc57bd57b9f095 Mon Sep 17 00:00:00 2001 From: Peter Abbondanzo Date: Tue, 4 Nov 2025 14:00:43 -0800 Subject: [PATCH 031/562] Maintain momentum through non-zero velocity when paging is enabled (#54413) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54413 We should treat `ACTION_SCROLL` events akin to momentum scrolling--they represent a scroll with non-zero velocity--but not as momentum events themselves--they don't have a real velocity after they've dispatched. When paging is enabled, we should run the same `flingAndSnap` logic and rely on this non-zero velocity to encourage scrolling to the next item in the direction of the scroll rather than immediately picking the nearest offset. The end effect of this change is that scrolling down will always go to the next item regardless of when scrolling stops. Scrolling up will always go to the previous item. Similar for horizontal scrolling per right/left scrolling. Changelog: [Internal] Reviewed By: necolas Differential Revision: D86151012 fbshipit-source-id: 14987beac931e3d47a4cc013f5d2a4ccb5c2b8bd --- .../react/views/scroll/ReactHorizontalScrollView.java | 9 +++++++-- .../com/facebook/react/views/scroll/ReactScrollView.java | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java index d28150173b1d..7ca497966320 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java @@ -849,8 +849,13 @@ public boolean dispatchGenericMotionEvent(MotionEvent ev) { @Override public void run() { mPostTouchRunnable = null; - // Trigger snap alignment now that scrolling has stopped - handlePostTouchScrolling(0, 0); + // +1/-1 velocity if scrolling right or left. This is to ensure that the + // next/previous page is picked rather than sliding backwards to the current page + int velocityX = (int) Math.signum(hScroll); + if (mDisableIntervalMomentum) { + velocityX = 0; + } + flingAndSnap(velocityX); } }; postOnAnimationDelayed(mPostTouchRunnable, ReactScrollViewHelper.MOMENTUM_DELAY); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java index b0f62037bba6..542e2485aea8 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java @@ -688,8 +688,13 @@ public boolean dispatchGenericMotionEvent(MotionEvent ev) { @Override public void run() { mPostTouchRunnable = null; - // Trigger snap alignment now that scrolling has stopped - handlePostTouchScrolling(0, 0); + // +1/-1 velocity if scrolling down or up. This is to ensure that the + // next/previous page is picked rather than sliding backwards to the current page + int velocityY = (int) -Math.signum(vScroll); + if (mDisableIntervalMomentum) { + velocityY = 0; + } + flingAndSnap(velocityY); } }; postOnAnimationDelayed(mPostTouchRunnable, ReactScrollViewHelper.MOMENTUM_DELAY); From 5ec5cc3a340af05691e342b75e7abf79144ec5c4 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Tue, 4 Nov 2025 18:25:02 -0800 Subject: [PATCH 032/562] Refactor on ReactDelegate (#54415) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54415 This is a small refactor of ReactDelegate changelog: [internal] internal Reviewed By: alanleedev Differential Revision: D86218278 fbshipit-source-id: 13886e6c6b8d4759e7387927fd38f51f158dcf40 --- .../main/java/com/facebook/react/ReactDelegate.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.kt index 18a5193763c7..367516c289ee 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.kt @@ -68,9 +68,9 @@ public open class ReactDelegate { launchOptions: Bundle?, ) { this.activity = activity - mainComponentName = appKey + this.mainComponentName = appKey this.launchOptions = launchOptions - doubleTapReloadRecognizer = DoubleTapReloadRecognizer() + this.doubleTapReloadRecognizer = DoubleTapReloadRecognizer() this.reactNativeHost = reactNativeHost } @@ -81,9 +81,9 @@ public open class ReactDelegate { launchOptions: Bundle?, ) { this.activity = activity - mainComponentName = appKey + this.mainComponentName = appKey this.launchOptions = launchOptions - doubleTapReloadRecognizer = DoubleTapReloadRecognizer() + this.doubleTapReloadRecognizer = DoubleTapReloadRecognizer() this.reactHost = reactHost } @@ -95,11 +95,11 @@ public open class ReactDelegate { launchOptions: Bundle?, fabricEnabled: Boolean, ) { - isFabricEnabled = fabricEnabled + this.isFabricEnabled = fabricEnabled this.activity = activity - mainComponentName = appKey + this.mainComponentName = appKey this.launchOptions = launchOptions - doubleTapReloadRecognizer = DoubleTapReloadRecognizer() + this.doubleTapReloadRecognizer = DoubleTapReloadRecognizer() this.reactNativeHost = reactNativeHost } From 8123f3191c8c5207d5e902cb2aead11695beb34c Mon Sep 17 00:00:00 2001 From: Nick Lefever Date: Wed, 5 Nov 2025 04:11:31 -0800 Subject: [PATCH 033/562] Add feature flag to disable subview clipping (#54416) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54416 See title Changelog: [Internal] Reviewed By: christophpurrer Differential Revision: D86262692 fbshipit-source-id: bf7fb2a45e33a0c6974af6138b3735cfeef1ae0c --- .../featureflags/ReactNativeFeatureFlags.kt | 8 +- .../ReactNativeFeatureFlagsCxxAccessor.kt | 12 +- .../ReactNativeFeatureFlagsCxxInterop.kt | 4 +- .../ReactNativeFeatureFlagsDefaults.kt | 4 +- .../ReactNativeFeatureFlagsLocalAccessor.kt | 13 +- .../ReactNativeFeatureFlagsProvider.kt | 4 +- .../scroll/ReactHorizontalScrollView.java | 4 + .../react/views/scroll/ReactScrollView.java | 4 + .../react/views/view/ReactViewGroup.kt | 12 +- .../JReactNativeFeatureFlagsCxxInterop.cpp | 16 +- .../JReactNativeFeatureFlagsCxxInterop.h | 5 +- .../featureflags/ReactNativeFeatureFlags.cpp | 6 +- .../featureflags/ReactNativeFeatureFlags.h | 7 +- .../ReactNativeFeatureFlagsAccessor.cpp | 168 ++++++++++-------- .../ReactNativeFeatureFlagsAccessor.h | 6 +- .../ReactNativeFeatureFlagsDefaults.h | 6 +- .../ReactNativeFeatureFlagsDynamicProvider.h | 11 +- .../ReactNativeFeatureFlagsProvider.h | 3 +- .../NativeReactNativeFeatureFlags.cpp | 7 +- .../NativeReactNativeFeatureFlags.h | 4 +- .../ReactNativeFeatureFlags.config.js | 11 ++ .../featureflags/ReactNativeFeatureFlags.js | 7 +- .../specs/NativeReactNativeFeatureFlags.js | 3 +- 23 files changed, 230 insertions(+), 95 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt index 61c4d681cfa0..64d9a66bae33 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<890156e9513bff7c7c6252f8cf4402e4>> + * @generated SignedSource<<66a87f8b82a1b3497eb9181a4ac6bab7>> */ /** @@ -78,6 +78,12 @@ public object ReactNativeFeatureFlags { @JvmStatic public fun disableOldAndroidAttachmentMetricsWorkarounds(): Boolean = accessor.disableOldAndroidAttachmentMetricsWorkarounds() + /** + * Force disable subview clipping for ReactViewGroup on Android + */ + @JvmStatic + public fun disableSubviewClippingAndroid(): Boolean = accessor.disableSubviewClippingAndroid() + /** * Turns off the global measurement cache used by TextLayoutManager on Android. */ diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt index fa2da9976aba..9acd97571f71 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<5112bb2a180751673d4197088af9fdd1>> */ /** @@ -28,6 +28,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces private var disableFabricCommitInCXXAnimatedCache: Boolean? = null private var disableMountItemReorderingAndroidCache: Boolean? = null private var disableOldAndroidAttachmentMetricsWorkaroundsCache: Boolean? = null + private var disableSubviewClippingAndroidCache: Boolean? = null private var disableTextLayoutManagerCacheAndroidCache: Boolean? = null private var enableAccessibilityOrderCache: Boolean? = null private var enableAccumulatedUpdatesInRawPropsAndroidCache: Boolean? = null @@ -175,6 +176,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces return cached } + override fun disableSubviewClippingAndroid(): Boolean { + var cached = disableSubviewClippingAndroidCache + if (cached == null) { + cached = ReactNativeFeatureFlagsCxxInterop.disableSubviewClippingAndroid() + disableSubviewClippingAndroidCache = cached + } + return cached + } + override fun disableTextLayoutManagerCacheAndroid(): Boolean { var cached = disableTextLayoutManagerCacheAndroidCache if (cached == null) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt index 1c5d5b126fb2..95d3a9173a7e 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<9a1bdbc2a3ae299433e690b254d7bf0a>> + * @generated SignedSource<> */ /** @@ -44,6 +44,8 @@ public object ReactNativeFeatureFlagsCxxInterop { @DoNotStrip @JvmStatic public external fun disableOldAndroidAttachmentMetricsWorkarounds(): Boolean + @DoNotStrip @JvmStatic public external fun disableSubviewClippingAndroid(): Boolean + @DoNotStrip @JvmStatic public external fun disableTextLayoutManagerCacheAndroid(): Boolean @DoNotStrip @JvmStatic public external fun enableAccessibilityOrder(): Boolean diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt index 7a6da3918a34..41ef0bd821b4 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0d78a0405db2a10c14bd69aaf2a3708a>> + * @generated SignedSource<<32ad8dfa8f1c1d662ff0ea7b424eb070>> */ /** @@ -39,6 +39,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi override fun disableOldAndroidAttachmentMetricsWorkarounds(): Boolean = true + override fun disableSubviewClippingAndroid(): Boolean = false + override fun disableTextLayoutManagerCacheAndroid(): Boolean = false override fun enableAccessibilityOrder(): Boolean = false diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt index 44527788e4ac..6028c97c5038 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<98f16fd1bb180b247ee87bb24b10120e>> + * @generated SignedSource<> */ /** @@ -32,6 +32,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc private var disableFabricCommitInCXXAnimatedCache: Boolean? = null private var disableMountItemReorderingAndroidCache: Boolean? = null private var disableOldAndroidAttachmentMetricsWorkaroundsCache: Boolean? = null + private var disableSubviewClippingAndroidCache: Boolean? = null private var disableTextLayoutManagerCacheAndroidCache: Boolean? = null private var enableAccessibilityOrderCache: Boolean? = null private var enableAccumulatedUpdatesInRawPropsAndroidCache: Boolean? = null @@ -187,6 +188,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc return cached } + override fun disableSubviewClippingAndroid(): Boolean { + var cached = disableSubviewClippingAndroidCache + if (cached == null) { + cached = currentProvider.disableSubviewClippingAndroid() + accessedFeatureFlags.add("disableSubviewClippingAndroid") + disableSubviewClippingAndroidCache = cached + } + return cached + } + override fun disableTextLayoutManagerCacheAndroid(): Boolean { var cached = disableTextLayoutManagerCacheAndroidCache if (cached == null) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt index 4285920dadfd..7c23983138b4 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> */ /** @@ -39,6 +39,8 @@ public interface ReactNativeFeatureFlagsProvider { @DoNotStrip public fun disableOldAndroidAttachmentMetricsWorkarounds(): Boolean + @DoNotStrip public fun disableSubviewClippingAndroid(): Boolean + @DoNotStrip public fun disableTextLayoutManagerCacheAndroid(): Boolean @DoNotStrip public fun enableAccessibilityOrder(): Boolean diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java index 7ca497966320..395da1ee0aa6 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java @@ -291,6 +291,10 @@ public void setScrollPerfTag(@Nullable String scrollPerfTag) { @Override public void setRemoveClippedSubviews(boolean removeClippedSubviews) { + if (ReactNativeFeatureFlags.disableSubviewClippingAndroid()) { + return; + } + if (removeClippedSubviews && mClippingRect == null) { mClippingRect = new Rect(); } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java index 542e2485aea8..3f7469a5a380 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java @@ -719,6 +719,10 @@ public boolean executeKeyEvent(KeyEvent event) { @Override public void setRemoveClippedSubviews(boolean removeClippedSubviews) { + if (ReactNativeFeatureFlags.disableSubviewClippingAndroid()) { + return; + } + if (removeClippedSubviews && mClippingRect == null) { mClippingRect = new Rect(); } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt index 6147dd2e348f..396958473d9f 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt @@ -32,6 +32,7 @@ import com.facebook.react.bridge.UiThreadUtil.assertOnUiThread import com.facebook.react.bridge.UiThreadUtil.runOnUiThread import com.facebook.react.common.ReactConstants.TAG import com.facebook.react.config.ReactFeatureFlags +import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags import com.facebook.react.touch.OnInterceptTouchEventListener import com.facebook.react.touch.ReactHitSlopView import com.facebook.react.touch.ReactInterceptingViewGroup @@ -362,8 +363,17 @@ public open class ReactViewGroup public constructor(context: Context?) : } override var removeClippedSubviews: Boolean - get() = _removeClippedSubviews + get() { + if (ReactNativeFeatureFlags.disableSubviewClippingAndroid()) { + return false + } + return _removeClippedSubviews + } set(newValue) { + if (ReactNativeFeatureFlags.disableSubviewClippingAndroid()) { + return + } + if (newValue == _removeClippedSubviews) { return } diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp index 1b9c3b99fe92..220807e3fd24 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> */ /** @@ -87,6 +87,12 @@ class ReactNativeFeatureFlagsJavaProvider return method(javaProvider_); } + bool disableSubviewClippingAndroid() override { + static const auto method = + getReactNativeFeatureFlagsProviderJavaClass()->getMethod("disableSubviewClippingAndroid"); + return method(javaProvider_); + } + bool disableTextLayoutManagerCacheAndroid() override { static const auto method = getReactNativeFeatureFlagsProviderJavaClass()->getMethod("disableTextLayoutManagerCacheAndroid"); @@ -575,6 +581,11 @@ bool JReactNativeFeatureFlagsCxxInterop::disableOldAndroidAttachmentMetricsWorka return ReactNativeFeatureFlags::disableOldAndroidAttachmentMetricsWorkarounds(); } +bool JReactNativeFeatureFlagsCxxInterop::disableSubviewClippingAndroid( + facebook::jni::alias_ref /*unused*/) { + return ReactNativeFeatureFlags::disableSubviewClippingAndroid(); +} + bool JReactNativeFeatureFlagsCxxInterop::disableTextLayoutManagerCacheAndroid( facebook::jni::alias_ref /*unused*/) { return ReactNativeFeatureFlags::disableTextLayoutManagerCacheAndroid(); @@ -1000,6 +1011,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() { makeNativeMethod( "disableOldAndroidAttachmentMetricsWorkarounds", JReactNativeFeatureFlagsCxxInterop::disableOldAndroidAttachmentMetricsWorkarounds), + makeNativeMethod( + "disableSubviewClippingAndroid", + JReactNativeFeatureFlagsCxxInterop::disableSubviewClippingAndroid), makeNativeMethod( "disableTextLayoutManagerCacheAndroid", JReactNativeFeatureFlagsCxxInterop::disableTextLayoutManagerCacheAndroid), diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h index c38366ce5d2e..b6cb81ed6250 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +++ b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6238eb0739467af8477aa8fa79a023bf>> + * @generated SignedSource<<1e735f99b2d275f5065fb7959e45adc5>> */ /** @@ -54,6 +54,9 @@ class JReactNativeFeatureFlagsCxxInterop static bool disableOldAndroidAttachmentMetricsWorkarounds( facebook::jni::alias_ref); + static bool disableSubviewClippingAndroid( + facebook::jni::alias_ref); + static bool disableTextLayoutManagerCacheAndroid( facebook::jni::alias_ref); diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp index 61d6015d3138..b6b5724c2729 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6f88454830626622f9b5720ae0395938>> + * @generated SignedSource<<5a7c80b50fda63afb95e8c6f4651eebc>> */ /** @@ -58,6 +58,10 @@ bool ReactNativeFeatureFlags::disableOldAndroidAttachmentMetricsWorkarounds() { return getAccessor().disableOldAndroidAttachmentMetricsWorkarounds(); } +bool ReactNativeFeatureFlags::disableSubviewClippingAndroid() { + return getAccessor().disableSubviewClippingAndroid(); +} + bool ReactNativeFeatureFlags::disableTextLayoutManagerCacheAndroid() { return getAccessor().disableTextLayoutManagerCacheAndroid(); } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h index 7b7dc6c8c338..f8bb4c8b49cc 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<7e530e01e8c31edb68099a11bc371b89>> + * @generated SignedSource<<8122e5c1e177a8f3deb2462a86f7cf64>> */ /** @@ -79,6 +79,11 @@ class ReactNativeFeatureFlags { */ RN_EXPORT static bool disableOldAndroidAttachmentMetricsWorkarounds(); + /** + * Force disable subview clipping for ReactViewGroup on Android + */ + RN_EXPORT static bool disableSubviewClippingAndroid(); + /** * Turns off the global measurement cache used by TextLayoutManager on Android. */ diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp index 9d3bdac3918e..e79f9912c3f1 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> */ /** @@ -173,6 +173,24 @@ bool ReactNativeFeatureFlagsAccessor::disableOldAndroidAttachmentMetricsWorkarou return flagValue.value(); } +bool ReactNativeFeatureFlagsAccessor::disableSubviewClippingAndroid() { + auto flagValue = disableSubviewClippingAndroid_.load(); + + if (!flagValue.has_value()) { + // This block is not exclusive but it is not necessary. + // If multiple threads try to initialize the feature flag, we would only + // be accessing the provider multiple times but the end state of this + // instance and the returned flag value would be the same. + + markFlagAsAccessed(8, "disableSubviewClippingAndroid"); + + flagValue = currentProvider_->disableSubviewClippingAndroid(); + disableSubviewClippingAndroid_ = flagValue; + } + + return flagValue.value(); +} + bool ReactNativeFeatureFlagsAccessor::disableTextLayoutManagerCacheAndroid() { auto flagValue = disableTextLayoutManagerCacheAndroid_.load(); @@ -182,7 +200,7 @@ bool ReactNativeFeatureFlagsAccessor::disableTextLayoutManagerCacheAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(8, "disableTextLayoutManagerCacheAndroid"); + markFlagAsAccessed(9, "disableTextLayoutManagerCacheAndroid"); flagValue = currentProvider_->disableTextLayoutManagerCacheAndroid(); disableTextLayoutManagerCacheAndroid_ = flagValue; @@ -200,7 +218,7 @@ bool ReactNativeFeatureFlagsAccessor::enableAccessibilityOrder() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(9, "enableAccessibilityOrder"); + markFlagAsAccessed(10, "enableAccessibilityOrder"); flagValue = currentProvider_->enableAccessibilityOrder(); enableAccessibilityOrder_ = flagValue; @@ -218,7 +236,7 @@ bool ReactNativeFeatureFlagsAccessor::enableAccumulatedUpdatesInRawPropsAndroid( // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(10, "enableAccumulatedUpdatesInRawPropsAndroid"); + markFlagAsAccessed(11, "enableAccumulatedUpdatesInRawPropsAndroid"); flagValue = currentProvider_->enableAccumulatedUpdatesInRawPropsAndroid(); enableAccumulatedUpdatesInRawPropsAndroid_ = flagValue; @@ -236,7 +254,7 @@ bool ReactNativeFeatureFlagsAccessor::enableAndroidLinearText() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(11, "enableAndroidLinearText"); + markFlagAsAccessed(12, "enableAndroidLinearText"); flagValue = currentProvider_->enableAndroidLinearText(); enableAndroidLinearText_ = flagValue; @@ -254,7 +272,7 @@ bool ReactNativeFeatureFlagsAccessor::enableAndroidTextMeasurementOptimizations( // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(12, "enableAndroidTextMeasurementOptimizations"); + markFlagAsAccessed(13, "enableAndroidTextMeasurementOptimizations"); flagValue = currentProvider_->enableAndroidTextMeasurementOptimizations(); enableAndroidTextMeasurementOptimizations_ = flagValue; @@ -272,7 +290,7 @@ bool ReactNativeFeatureFlagsAccessor::enableBridgelessArchitecture() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(13, "enableBridgelessArchitecture"); + markFlagAsAccessed(14, "enableBridgelessArchitecture"); flagValue = currentProvider_->enableBridgelessArchitecture(); enableBridgelessArchitecture_ = flagValue; @@ -290,7 +308,7 @@ bool ReactNativeFeatureFlagsAccessor::enableCppPropsIteratorSetter() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(14, "enableCppPropsIteratorSetter"); + markFlagAsAccessed(15, "enableCppPropsIteratorSetter"); flagValue = currentProvider_->enableCppPropsIteratorSetter(); enableCppPropsIteratorSetter_ = flagValue; @@ -308,7 +326,7 @@ bool ReactNativeFeatureFlagsAccessor::enableCustomFocusSearchOnClippedElementsAn // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(15, "enableCustomFocusSearchOnClippedElementsAndroid"); + markFlagAsAccessed(16, "enableCustomFocusSearchOnClippedElementsAndroid"); flagValue = currentProvider_->enableCustomFocusSearchOnClippedElementsAndroid(); enableCustomFocusSearchOnClippedElementsAndroid_ = flagValue; @@ -326,7 +344,7 @@ bool ReactNativeFeatureFlagsAccessor::enableDestroyShadowTreeRevisionAsync() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(16, "enableDestroyShadowTreeRevisionAsync"); + markFlagAsAccessed(17, "enableDestroyShadowTreeRevisionAsync"); flagValue = currentProvider_->enableDestroyShadowTreeRevisionAsync(); enableDestroyShadowTreeRevisionAsync_ = flagValue; @@ -344,7 +362,7 @@ bool ReactNativeFeatureFlagsAccessor::enableDoubleMeasurementFixAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(17, "enableDoubleMeasurementFixAndroid"); + markFlagAsAccessed(18, "enableDoubleMeasurementFixAndroid"); flagValue = currentProvider_->enableDoubleMeasurementFixAndroid(); enableDoubleMeasurementFixAndroid_ = flagValue; @@ -362,7 +380,7 @@ bool ReactNativeFeatureFlagsAccessor::enableEagerMainQueueModulesOnIOS() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(18, "enableEagerMainQueueModulesOnIOS"); + markFlagAsAccessed(19, "enableEagerMainQueueModulesOnIOS"); flagValue = currentProvider_->enableEagerMainQueueModulesOnIOS(); enableEagerMainQueueModulesOnIOS_ = flagValue; @@ -380,7 +398,7 @@ bool ReactNativeFeatureFlagsAccessor::enableEagerRootViewAttachment() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(19, "enableEagerRootViewAttachment"); + markFlagAsAccessed(20, "enableEagerRootViewAttachment"); flagValue = currentProvider_->enableEagerRootViewAttachment(); enableEagerRootViewAttachment_ = flagValue; @@ -398,7 +416,7 @@ bool ReactNativeFeatureFlagsAccessor::enableFabricLogs() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(20, "enableFabricLogs"); + markFlagAsAccessed(21, "enableFabricLogs"); flagValue = currentProvider_->enableFabricLogs(); enableFabricLogs_ = flagValue; @@ -416,7 +434,7 @@ bool ReactNativeFeatureFlagsAccessor::enableFabricRenderer() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(21, "enableFabricRenderer"); + markFlagAsAccessed(22, "enableFabricRenderer"); flagValue = currentProvider_->enableFabricRenderer(); enableFabricRenderer_ = flagValue; @@ -434,7 +452,7 @@ bool ReactNativeFeatureFlagsAccessor::enableFontScaleChangesUpdatingLayout() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(22, "enableFontScaleChangesUpdatingLayout"); + markFlagAsAccessed(23, "enableFontScaleChangesUpdatingLayout"); flagValue = currentProvider_->enableFontScaleChangesUpdatingLayout(); enableFontScaleChangesUpdatingLayout_ = flagValue; @@ -452,7 +470,7 @@ bool ReactNativeFeatureFlagsAccessor::enableIOSTextBaselineOffsetPerLine() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(23, "enableIOSTextBaselineOffsetPerLine"); + markFlagAsAccessed(24, "enableIOSTextBaselineOffsetPerLine"); flagValue = currentProvider_->enableIOSTextBaselineOffsetPerLine(); enableIOSTextBaselineOffsetPerLine_ = flagValue; @@ -470,7 +488,7 @@ bool ReactNativeFeatureFlagsAccessor::enableIOSViewClipToPaddingBox() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(24, "enableIOSViewClipToPaddingBox"); + markFlagAsAccessed(25, "enableIOSViewClipToPaddingBox"); flagValue = currentProvider_->enableIOSViewClipToPaddingBox(); enableIOSViewClipToPaddingBox_ = flagValue; @@ -488,7 +506,7 @@ bool ReactNativeFeatureFlagsAccessor::enableImagePrefetchingAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(25, "enableImagePrefetchingAndroid"); + markFlagAsAccessed(26, "enableImagePrefetchingAndroid"); flagValue = currentProvider_->enableImagePrefetchingAndroid(); enableImagePrefetchingAndroid_ = flagValue; @@ -506,7 +524,7 @@ bool ReactNativeFeatureFlagsAccessor::enableImagePrefetchingOnUiThreadAndroid() // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(26, "enableImagePrefetchingOnUiThreadAndroid"); + markFlagAsAccessed(27, "enableImagePrefetchingOnUiThreadAndroid"); flagValue = currentProvider_->enableImagePrefetchingOnUiThreadAndroid(); enableImagePrefetchingOnUiThreadAndroid_ = flagValue; @@ -524,7 +542,7 @@ bool ReactNativeFeatureFlagsAccessor::enableImmediateUpdateModeForContentOffsetC // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(27, "enableImmediateUpdateModeForContentOffsetChanges"); + markFlagAsAccessed(28, "enableImmediateUpdateModeForContentOffsetChanges"); flagValue = currentProvider_->enableImmediateUpdateModeForContentOffsetChanges(); enableImmediateUpdateModeForContentOffsetChanges_ = flagValue; @@ -542,7 +560,7 @@ bool ReactNativeFeatureFlagsAccessor::enableImperativeFocus() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(28, "enableImperativeFocus"); + markFlagAsAccessed(29, "enableImperativeFocus"); flagValue = currentProvider_->enableImperativeFocus(); enableImperativeFocus_ = flagValue; @@ -560,7 +578,7 @@ bool ReactNativeFeatureFlagsAccessor::enableInteropViewManagerClassLookUpOptimiz // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(29, "enableInteropViewManagerClassLookUpOptimizationIOS"); + markFlagAsAccessed(30, "enableInteropViewManagerClassLookUpOptimizationIOS"); flagValue = currentProvider_->enableInteropViewManagerClassLookUpOptimizationIOS(); enableInteropViewManagerClassLookUpOptimizationIOS_ = flagValue; @@ -578,7 +596,7 @@ bool ReactNativeFeatureFlagsAccessor::enableKeyEvents() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(30, "enableKeyEvents"); + markFlagAsAccessed(31, "enableKeyEvents"); flagValue = currentProvider_->enableKeyEvents(); enableKeyEvents_ = flagValue; @@ -596,7 +614,7 @@ bool ReactNativeFeatureFlagsAccessor::enableLayoutAnimationsOnAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(31, "enableLayoutAnimationsOnAndroid"); + markFlagAsAccessed(32, "enableLayoutAnimationsOnAndroid"); flagValue = currentProvider_->enableLayoutAnimationsOnAndroid(); enableLayoutAnimationsOnAndroid_ = flagValue; @@ -614,7 +632,7 @@ bool ReactNativeFeatureFlagsAccessor::enableLayoutAnimationsOnIOS() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(32, "enableLayoutAnimationsOnIOS"); + markFlagAsAccessed(33, "enableLayoutAnimationsOnIOS"); flagValue = currentProvider_->enableLayoutAnimationsOnIOS(); enableLayoutAnimationsOnIOS_ = flagValue; @@ -632,7 +650,7 @@ bool ReactNativeFeatureFlagsAccessor::enableMainQueueCoordinatorOnIOS() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(33, "enableMainQueueCoordinatorOnIOS"); + markFlagAsAccessed(34, "enableMainQueueCoordinatorOnIOS"); flagValue = currentProvider_->enableMainQueueCoordinatorOnIOS(); enableMainQueueCoordinatorOnIOS_ = flagValue; @@ -650,7 +668,7 @@ bool ReactNativeFeatureFlagsAccessor::enableModuleArgumentNSNullConversionIOS() // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(34, "enableModuleArgumentNSNullConversionIOS"); + markFlagAsAccessed(35, "enableModuleArgumentNSNullConversionIOS"); flagValue = currentProvider_->enableModuleArgumentNSNullConversionIOS(); enableModuleArgumentNSNullConversionIOS_ = flagValue; @@ -668,7 +686,7 @@ bool ReactNativeFeatureFlagsAccessor::enableNativeCSSParsing() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(35, "enableNativeCSSParsing"); + markFlagAsAccessed(36, "enableNativeCSSParsing"); flagValue = currentProvider_->enableNativeCSSParsing(); enableNativeCSSParsing_ = flagValue; @@ -686,7 +704,7 @@ bool ReactNativeFeatureFlagsAccessor::enableNetworkEventReporting() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(36, "enableNetworkEventReporting"); + markFlagAsAccessed(37, "enableNetworkEventReporting"); flagValue = currentProvider_->enableNetworkEventReporting(); enableNetworkEventReporting_ = flagValue; @@ -704,7 +722,7 @@ bool ReactNativeFeatureFlagsAccessor::enablePreparedTextLayout() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(37, "enablePreparedTextLayout"); + markFlagAsAccessed(38, "enablePreparedTextLayout"); flagValue = currentProvider_->enablePreparedTextLayout(); enablePreparedTextLayout_ = flagValue; @@ -722,7 +740,7 @@ bool ReactNativeFeatureFlagsAccessor::enablePropsUpdateReconciliationAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(38, "enablePropsUpdateReconciliationAndroid"); + markFlagAsAccessed(39, "enablePropsUpdateReconciliationAndroid"); flagValue = currentProvider_->enablePropsUpdateReconciliationAndroid(); enablePropsUpdateReconciliationAndroid_ = flagValue; @@ -740,7 +758,7 @@ bool ReactNativeFeatureFlagsAccessor::enableResourceTimingAPI() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(39, "enableResourceTimingAPI"); + markFlagAsAccessed(40, "enableResourceTimingAPI"); flagValue = currentProvider_->enableResourceTimingAPI(); enableResourceTimingAPI_ = flagValue; @@ -758,7 +776,7 @@ bool ReactNativeFeatureFlagsAccessor::enableSwiftUIBasedFilters() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(40, "enableSwiftUIBasedFilters"); + markFlagAsAccessed(41, "enableSwiftUIBasedFilters"); flagValue = currentProvider_->enableSwiftUIBasedFilters(); enableSwiftUIBasedFilters_ = flagValue; @@ -776,7 +794,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewCulling() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(41, "enableViewCulling"); + markFlagAsAccessed(42, "enableViewCulling"); flagValue = currentProvider_->enableViewCulling(); enableViewCulling_ = flagValue; @@ -794,7 +812,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecycling() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(42, "enableViewRecycling"); + markFlagAsAccessed(43, "enableViewRecycling"); flagValue = currentProvider_->enableViewRecycling(); enableViewRecycling_ = flagValue; @@ -812,7 +830,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForImage() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(43, "enableViewRecyclingForImage"); + markFlagAsAccessed(44, "enableViewRecyclingForImage"); flagValue = currentProvider_->enableViewRecyclingForImage(); enableViewRecyclingForImage_ = flagValue; @@ -830,7 +848,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForScrollView() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(44, "enableViewRecyclingForScrollView"); + markFlagAsAccessed(45, "enableViewRecyclingForScrollView"); flagValue = currentProvider_->enableViewRecyclingForScrollView(); enableViewRecyclingForScrollView_ = flagValue; @@ -848,7 +866,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForText() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(45, "enableViewRecyclingForText"); + markFlagAsAccessed(46, "enableViewRecyclingForText"); flagValue = currentProvider_->enableViewRecyclingForText(); enableViewRecyclingForText_ = flagValue; @@ -866,7 +884,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForView() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(46, "enableViewRecyclingForView"); + markFlagAsAccessed(47, "enableViewRecyclingForView"); flagValue = currentProvider_->enableViewRecyclingForView(); enableViewRecyclingForView_ = flagValue; @@ -884,7 +902,7 @@ bool ReactNativeFeatureFlagsAccessor::enableVirtualViewClippingWithoutScrollView // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(47, "enableVirtualViewClippingWithoutScrollViewClipping"); + markFlagAsAccessed(48, "enableVirtualViewClippingWithoutScrollViewClipping"); flagValue = currentProvider_->enableVirtualViewClippingWithoutScrollViewClipping(); enableVirtualViewClippingWithoutScrollViewClipping_ = flagValue; @@ -902,7 +920,7 @@ bool ReactNativeFeatureFlagsAccessor::enableVirtualViewContainerStateExperimenta // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(48, "enableVirtualViewContainerStateExperimental"); + markFlagAsAccessed(49, "enableVirtualViewContainerStateExperimental"); flagValue = currentProvider_->enableVirtualViewContainerStateExperimental(); enableVirtualViewContainerStateExperimental_ = flagValue; @@ -920,7 +938,7 @@ bool ReactNativeFeatureFlagsAccessor::enableVirtualViewDebugFeatures() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(49, "enableVirtualViewDebugFeatures"); + markFlagAsAccessed(50, "enableVirtualViewDebugFeatures"); flagValue = currentProvider_->enableVirtualViewDebugFeatures(); enableVirtualViewDebugFeatures_ = flagValue; @@ -938,7 +956,7 @@ bool ReactNativeFeatureFlagsAccessor::enableVirtualViewRenderState() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(50, "enableVirtualViewRenderState"); + markFlagAsAccessed(51, "enableVirtualViewRenderState"); flagValue = currentProvider_->enableVirtualViewRenderState(); enableVirtualViewRenderState_ = flagValue; @@ -956,7 +974,7 @@ bool ReactNativeFeatureFlagsAccessor::enableVirtualViewWindowFocusDetection() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(51, "enableVirtualViewWindowFocusDetection"); + markFlagAsAccessed(52, "enableVirtualViewWindowFocusDetection"); flagValue = currentProvider_->enableVirtualViewWindowFocusDetection(); enableVirtualViewWindowFocusDetection_ = flagValue; @@ -974,7 +992,7 @@ bool ReactNativeFeatureFlagsAccessor::enableWebPerformanceAPIsByDefault() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(52, "enableWebPerformanceAPIsByDefault"); + markFlagAsAccessed(53, "enableWebPerformanceAPIsByDefault"); flagValue = currentProvider_->enableWebPerformanceAPIsByDefault(); enableWebPerformanceAPIsByDefault_ = flagValue; @@ -992,7 +1010,7 @@ bool ReactNativeFeatureFlagsAccessor::fixMappingOfEventPrioritiesBetweenFabricAn // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(53, "fixMappingOfEventPrioritiesBetweenFabricAndReact"); + markFlagAsAccessed(54, "fixMappingOfEventPrioritiesBetweenFabricAndReact"); flagValue = currentProvider_->fixMappingOfEventPrioritiesBetweenFabricAndReact(); fixMappingOfEventPrioritiesBetweenFabricAndReact_ = flagValue; @@ -1010,7 +1028,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxEnabledRelease() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(54, "fuseboxEnabledRelease"); + markFlagAsAccessed(55, "fuseboxEnabledRelease"); flagValue = currentProvider_->fuseboxEnabledRelease(); fuseboxEnabledRelease_ = flagValue; @@ -1028,7 +1046,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxNetworkInspectionEnabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(55, "fuseboxNetworkInspectionEnabled"); + markFlagAsAccessed(56, "fuseboxNetworkInspectionEnabled"); flagValue = currentProvider_->fuseboxNetworkInspectionEnabled(); fuseboxNetworkInspectionEnabled_ = flagValue; @@ -1046,7 +1064,7 @@ bool ReactNativeFeatureFlagsAccessor::hideOffscreenVirtualViewsOnIOS() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(56, "hideOffscreenVirtualViewsOnIOS"); + markFlagAsAccessed(57, "hideOffscreenVirtualViewsOnIOS"); flagValue = currentProvider_->hideOffscreenVirtualViewsOnIOS(); hideOffscreenVirtualViewsOnIOS_ = flagValue; @@ -1064,7 +1082,7 @@ bool ReactNativeFeatureFlagsAccessor::overrideBySynchronousMountPropsAtMountingA // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(57, "overrideBySynchronousMountPropsAtMountingAndroid"); + markFlagAsAccessed(58, "overrideBySynchronousMountPropsAtMountingAndroid"); flagValue = currentProvider_->overrideBySynchronousMountPropsAtMountingAndroid(); overrideBySynchronousMountPropsAtMountingAndroid_ = flagValue; @@ -1082,7 +1100,7 @@ bool ReactNativeFeatureFlagsAccessor::perfIssuesEnabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(58, "perfIssuesEnabled"); + markFlagAsAccessed(59, "perfIssuesEnabled"); flagValue = currentProvider_->perfIssuesEnabled(); perfIssuesEnabled_ = flagValue; @@ -1100,7 +1118,7 @@ bool ReactNativeFeatureFlagsAccessor::perfMonitorV2Enabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(59, "perfMonitorV2Enabled"); + markFlagAsAccessed(60, "perfMonitorV2Enabled"); flagValue = currentProvider_->perfMonitorV2Enabled(); perfMonitorV2Enabled_ = flagValue; @@ -1118,7 +1136,7 @@ double ReactNativeFeatureFlagsAccessor::preparedTextCacheSize() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(60, "preparedTextCacheSize"); + markFlagAsAccessed(61, "preparedTextCacheSize"); flagValue = currentProvider_->preparedTextCacheSize(); preparedTextCacheSize_ = flagValue; @@ -1136,7 +1154,7 @@ bool ReactNativeFeatureFlagsAccessor::preventShadowTreeCommitExhaustion() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(61, "preventShadowTreeCommitExhaustion"); + markFlagAsAccessed(62, "preventShadowTreeCommitExhaustion"); flagValue = currentProvider_->preventShadowTreeCommitExhaustion(); preventShadowTreeCommitExhaustion_ = flagValue; @@ -1154,7 +1172,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldPressibilityUseW3CPointerEventsForHo // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(62, "shouldPressibilityUseW3CPointerEventsForHover"); + markFlagAsAccessed(63, "shouldPressibilityUseW3CPointerEventsForHover"); flagValue = currentProvider_->shouldPressibilityUseW3CPointerEventsForHover(); shouldPressibilityUseW3CPointerEventsForHover_ = flagValue; @@ -1172,7 +1190,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldTriggerResponderTransferOnScrollAndr // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(63, "shouldTriggerResponderTransferOnScrollAndroid"); + markFlagAsAccessed(64, "shouldTriggerResponderTransferOnScrollAndroid"); flagValue = currentProvider_->shouldTriggerResponderTransferOnScrollAndroid(); shouldTriggerResponderTransferOnScrollAndroid_ = flagValue; @@ -1190,7 +1208,7 @@ bool ReactNativeFeatureFlagsAccessor::skipActivityIdentityAssertionOnHostPause() // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(64, "skipActivityIdentityAssertionOnHostPause"); + markFlagAsAccessed(65, "skipActivityIdentityAssertionOnHostPause"); flagValue = currentProvider_->skipActivityIdentityAssertionOnHostPause(); skipActivityIdentityAssertionOnHostPause_ = flagValue; @@ -1208,7 +1226,7 @@ bool ReactNativeFeatureFlagsAccessor::traceTurboModulePromiseRejectionsOnAndroid // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(65, "traceTurboModulePromiseRejectionsOnAndroid"); + markFlagAsAccessed(66, "traceTurboModulePromiseRejectionsOnAndroid"); flagValue = currentProvider_->traceTurboModulePromiseRejectionsOnAndroid(); traceTurboModulePromiseRejectionsOnAndroid_ = flagValue; @@ -1226,7 +1244,7 @@ bool ReactNativeFeatureFlagsAccessor::updateRuntimeShadowNodeReferencesOnCommit( // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(66, "updateRuntimeShadowNodeReferencesOnCommit"); + markFlagAsAccessed(67, "updateRuntimeShadowNodeReferencesOnCommit"); flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommit(); updateRuntimeShadowNodeReferencesOnCommit_ = flagValue; @@ -1244,7 +1262,7 @@ bool ReactNativeFeatureFlagsAccessor::useAlwaysAvailableJSErrorHandling() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(67, "useAlwaysAvailableJSErrorHandling"); + markFlagAsAccessed(68, "useAlwaysAvailableJSErrorHandling"); flagValue = currentProvider_->useAlwaysAvailableJSErrorHandling(); useAlwaysAvailableJSErrorHandling_ = flagValue; @@ -1262,7 +1280,7 @@ bool ReactNativeFeatureFlagsAccessor::useFabricInterop() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(68, "useFabricInterop"); + markFlagAsAccessed(69, "useFabricInterop"); flagValue = currentProvider_->useFabricInterop(); useFabricInterop_ = flagValue; @@ -1280,7 +1298,7 @@ bool ReactNativeFeatureFlagsAccessor::useNativeEqualsInNativeReadableArrayAndroi // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(69, "useNativeEqualsInNativeReadableArrayAndroid"); + markFlagAsAccessed(70, "useNativeEqualsInNativeReadableArrayAndroid"); flagValue = currentProvider_->useNativeEqualsInNativeReadableArrayAndroid(); useNativeEqualsInNativeReadableArrayAndroid_ = flagValue; @@ -1298,7 +1316,7 @@ bool ReactNativeFeatureFlagsAccessor::useNativeTransformHelperAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(70, "useNativeTransformHelperAndroid"); + markFlagAsAccessed(71, "useNativeTransformHelperAndroid"); flagValue = currentProvider_->useNativeTransformHelperAndroid(); useNativeTransformHelperAndroid_ = flagValue; @@ -1316,7 +1334,7 @@ bool ReactNativeFeatureFlagsAccessor::useNativeViewConfigsInBridgelessMode() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(71, "useNativeViewConfigsInBridgelessMode"); + markFlagAsAccessed(72, "useNativeViewConfigsInBridgelessMode"); flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode(); useNativeViewConfigsInBridgelessMode_ = flagValue; @@ -1334,7 +1352,7 @@ bool ReactNativeFeatureFlagsAccessor::useOptimizedEventBatchingOnAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(72, "useOptimizedEventBatchingOnAndroid"); + markFlagAsAccessed(73, "useOptimizedEventBatchingOnAndroid"); flagValue = currentProvider_->useOptimizedEventBatchingOnAndroid(); useOptimizedEventBatchingOnAndroid_ = flagValue; @@ -1352,7 +1370,7 @@ bool ReactNativeFeatureFlagsAccessor::useRawPropsJsiValue() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(73, "useRawPropsJsiValue"); + markFlagAsAccessed(74, "useRawPropsJsiValue"); flagValue = currentProvider_->useRawPropsJsiValue(); useRawPropsJsiValue_ = flagValue; @@ -1370,7 +1388,7 @@ bool ReactNativeFeatureFlagsAccessor::useShadowNodeStateOnClone() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(74, "useShadowNodeStateOnClone"); + markFlagAsAccessed(75, "useShadowNodeStateOnClone"); flagValue = currentProvider_->useShadowNodeStateOnClone(); useShadowNodeStateOnClone_ = flagValue; @@ -1388,7 +1406,7 @@ bool ReactNativeFeatureFlagsAccessor::useSharedAnimatedBackend() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(75, "useSharedAnimatedBackend"); + markFlagAsAccessed(76, "useSharedAnimatedBackend"); flagValue = currentProvider_->useSharedAnimatedBackend(); useSharedAnimatedBackend_ = flagValue; @@ -1406,7 +1424,7 @@ bool ReactNativeFeatureFlagsAccessor::useTraitHiddenOnAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(76, "useTraitHiddenOnAndroid"); + markFlagAsAccessed(77, "useTraitHiddenOnAndroid"); flagValue = currentProvider_->useTraitHiddenOnAndroid(); useTraitHiddenOnAndroid_ = flagValue; @@ -1424,7 +1442,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(77, "useTurboModuleInterop"); + markFlagAsAccessed(78, "useTurboModuleInterop"); flagValue = currentProvider_->useTurboModuleInterop(); useTurboModuleInterop_ = flagValue; @@ -1442,7 +1460,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModules() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(78, "useTurboModules"); + markFlagAsAccessed(79, "useTurboModules"); flagValue = currentProvider_->useTurboModules(); useTurboModules_ = flagValue; @@ -1460,7 +1478,7 @@ double ReactNativeFeatureFlagsAccessor::viewCullingOutsetRatio() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(79, "viewCullingOutsetRatio"); + markFlagAsAccessed(80, "viewCullingOutsetRatio"); flagValue = currentProvider_->viewCullingOutsetRatio(); viewCullingOutsetRatio_ = flagValue; @@ -1478,7 +1496,7 @@ double ReactNativeFeatureFlagsAccessor::virtualViewHysteresisRatio() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(80, "virtualViewHysteresisRatio"); + markFlagAsAccessed(81, "virtualViewHysteresisRatio"); flagValue = currentProvider_->virtualViewHysteresisRatio(); virtualViewHysteresisRatio_ = flagValue; @@ -1496,7 +1514,7 @@ double ReactNativeFeatureFlagsAccessor::virtualViewPrerenderRatio() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(81, "virtualViewPrerenderRatio"); + markFlagAsAccessed(82, "virtualViewPrerenderRatio"); flagValue = currentProvider_->virtualViewPrerenderRatio(); virtualViewPrerenderRatio_ = flagValue; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h index 4ba753976e18..cc1e6e79a02e 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> */ /** @@ -40,6 +40,7 @@ class ReactNativeFeatureFlagsAccessor { bool disableFabricCommitInCXXAnimated(); bool disableMountItemReorderingAndroid(); bool disableOldAndroidAttachmentMetricsWorkarounds(); + bool disableSubviewClippingAndroid(); bool disableTextLayoutManagerCacheAndroid(); bool enableAccessibilityOrder(); bool enableAccumulatedUpdatesInRawPropsAndroid(); @@ -125,7 +126,7 @@ class ReactNativeFeatureFlagsAccessor { std::unique_ptr currentProvider_; bool wasOverridden_; - std::array, 82> accessedFeatureFlags_; + std::array, 83> accessedFeatureFlags_; std::atomic> commonTestFlag_; std::atomic> cdpInteractionMetricsEnabled_; @@ -135,6 +136,7 @@ class ReactNativeFeatureFlagsAccessor { std::atomic> disableFabricCommitInCXXAnimated_; std::atomic> disableMountItemReorderingAndroid_; std::atomic> disableOldAndroidAttachmentMetricsWorkarounds_; + std::atomic> disableSubviewClippingAndroid_; std::atomic> disableTextLayoutManagerCacheAndroid_; std::atomic> enableAccessibilityOrder_; std::atomic> enableAccumulatedUpdatesInRawPropsAndroid_; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h index df1d3ce5faa9..d2de2e204ac0 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<6120a91f22fd02a0ff5144df38bd1737>> + * @generated SignedSource<<4e4623461411b957286ef050ec0c4f6f>> */ /** @@ -59,6 +59,10 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider { return true; } + bool disableSubviewClippingAndroid() override { + return false; + } + bool disableTextLayoutManagerCacheAndroid() override { return false; } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h index f693d40520c0..5731aa38e58b 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<36163e6b41d151326f7a0948b332672f>> + * @generated SignedSource<> */ /** @@ -117,6 +117,15 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef return ReactNativeFeatureFlagsDefaults::disableOldAndroidAttachmentMetricsWorkarounds(); } + bool disableSubviewClippingAndroid() override { + auto value = values_["disableSubviewClippingAndroid"]; + if (!value.isNull()) { + return value.getBool(); + } + + return ReactNativeFeatureFlagsDefaults::disableSubviewClippingAndroid(); + } + bool disableTextLayoutManagerCacheAndroid() override { auto value = values_["disableTextLayoutManagerCacheAndroid"]; if (!value.isNull()) { diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h index 7ea44550584a..0b0d28f10150 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0f6fd731ebddc32a0583ceb3c81f2b32>> + * @generated SignedSource<<5dbb5d1dd34c8bdd887de68a074449b6>> */ /** @@ -33,6 +33,7 @@ class ReactNativeFeatureFlagsProvider { virtual bool disableFabricCommitInCXXAnimated() = 0; virtual bool disableMountItemReorderingAndroid() = 0; virtual bool disableOldAndroidAttachmentMetricsWorkarounds() = 0; + virtual bool disableSubviewClippingAndroid() = 0; virtual bool disableTextLayoutManagerCacheAndroid() = 0; virtual bool enableAccessibilityOrder() = 0; virtual bool enableAccumulatedUpdatesInRawPropsAndroid() = 0; diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp index 95f0c57d38a0..e566c70eb868 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +++ b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<5963824c70d97cf048050db905350692>> */ /** @@ -84,6 +84,11 @@ bool NativeReactNativeFeatureFlags::disableOldAndroidAttachmentMetricsWorkaround return ReactNativeFeatureFlags::disableOldAndroidAttachmentMetricsWorkarounds(); } +bool NativeReactNativeFeatureFlags::disableSubviewClippingAndroid( + jsi::Runtime& /*runtime*/) { + return ReactNativeFeatureFlags::disableSubviewClippingAndroid(); +} + bool NativeReactNativeFeatureFlags::disableTextLayoutManagerCacheAndroid( jsi::Runtime& /*runtime*/) { return ReactNativeFeatureFlags::disableTextLayoutManagerCacheAndroid(); diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h index 808548a19449..d4da9a5798fa 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +++ b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<762f97c6e72f9339ef925adb8481713f>> + * @generated SignedSource<<84b5ef5e3ada0d6f2b10abfffa6d9d0f>> */ /** @@ -52,6 +52,8 @@ class NativeReactNativeFeatureFlags bool disableOldAndroidAttachmentMetricsWorkarounds(jsi::Runtime& runtime); + bool disableSubviewClippingAndroid(jsi::Runtime& runtime); + bool disableTextLayoutManagerCacheAndroid(jsi::Runtime& runtime); bool enableAccessibilityOrder(jsi::Runtime& runtime); diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index bbe9a39649ea..4db09968a1f1 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -135,6 +135,17 @@ const definitions: FeatureFlagDefinitions = { }, ossReleaseStage: 'none', }, + disableSubviewClippingAndroid: { + defaultValue: false, + metadata: { + dateAdded: '2025-11-05', + description: + 'Force disable subview clipping for ReactViewGroup on Android', + expectedReleaseValue: false, + purpose: 'experimentation', + }, + ossReleaseStage: 'none', + }, disableTextLayoutManagerCacheAndroid: { defaultValue: false, metadata: { diff --git a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js index 8395c2bfe66a..04a9285046bd 100644 --- a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<954a37442d8c691f35c868b9998a5aa3>> * @flow strict * @noformat */ @@ -58,6 +58,7 @@ export type ReactNativeFeatureFlags = $ReadOnly<{ disableFabricCommitInCXXAnimated: Getter, disableMountItemReorderingAndroid: Getter, disableOldAndroidAttachmentMetricsWorkarounds: Getter, + disableSubviewClippingAndroid: Getter, disableTextLayoutManagerCacheAndroid: Getter, enableAccessibilityOrder: Getter, enableAccumulatedUpdatesInRawPropsAndroid: Getter, @@ -245,6 +246,10 @@ export const disableMountItemReorderingAndroid: Getter = createNativeFl * Disable some workarounds for old Android versions in TextLayoutManager logic for retrieving attachment metrics */ export const disableOldAndroidAttachmentMetricsWorkarounds: Getter = createNativeFlagGetter('disableOldAndroidAttachmentMetricsWorkarounds', true); +/** + * Force disable subview clipping for ReactViewGroup on Android + */ +export const disableSubviewClippingAndroid: Getter = createNativeFlagGetter('disableSubviewClippingAndroid', false); /** * Turns off the global measurement cache used by TextLayoutManager on Android. */ diff --git a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js index c0c4f3e45a13..c60064de83dd 100644 --- a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<374975d041863bc8d509d2ce0aa8c883>> + * @generated SignedSource<<05001c6fab50172dc659d30b5e82af20>> * @flow strict * @noformat */ @@ -33,6 +33,7 @@ export interface Spec extends TurboModule { +disableFabricCommitInCXXAnimated?: () => boolean; +disableMountItemReorderingAndroid?: () => boolean; +disableOldAndroidAttachmentMetricsWorkarounds?: () => boolean; + +disableSubviewClippingAndroid?: () => boolean; +disableTextLayoutManagerCacheAndroid?: () => boolean; +enableAccessibilityOrder?: () => boolean; +enableAccumulatedUpdatesInRawPropsAndroid?: () => boolean; From 289caf4ebab528c1bc39c31ab69e6101a87c9fee Mon Sep 17 00:00:00 2001 From: Jakub Piasecki Date: Wed, 5 Nov 2025 06:59:21 -0800 Subject: [PATCH 034/562] Include `.hermesv1version` file in the NPM package (#54419) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54419 Changelog: [Internal] React Native uses `files` field in `package.json` to list everything that should end up in the apckage. `.hermesv1version` file was missing from that list, which is fixed by this diff. Reviewed By: huntie, cipolleschi Differential Revision: D86295805 fbshipit-source-id: 8a17191f26f9536884e4aaf09447121c020d1212 --- packages/react-native/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-native/package.json b/packages/react-native/package.json index 97a223c4e712..e1232b7f7745 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -129,6 +129,7 @@ "scripts/xcode/ccache.conf", "scripts/xcode/with-environment.sh", "sdks/.hermesversion", + "sdks/.hermesv1version", "sdks/hermes-engine", "sdks/hermesc", "settings.gradle.kts", From fe18f1f27354c09135c8f9638132e29873f030e3 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Wed, 5 Nov 2025 07:44:09 -0800 Subject: [PATCH 035/562] Add changelog for v0.83.0-rc.0 (#54420) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54420 Changelog: [Internal] Reviewed By: javache Differential Revision: D86301165 fbshipit-source-id: 83012e6c2558f7b3a1189a661b10e153d7c2e378 --- CHANGELOG.md | 135 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd0109a8ce91..4f867fe1dcdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,140 @@ # Changelog +## v0.83.0-rc.0 + +### Breaking + +None + +### Added + +- Enable Web Performance APIs ([beccee2164](https://github.com/facebook/react-native/commit/beccee21649eb0353e2828c65f0045053f04c6db) by [@rubennorte](https://github.com/rubennorte)) +- Merge the [iOS](https://github.com/facebook/react-native/pull/52283) and [android](https://github.com/facebook/react-native/pull/52282) PR into this, this PR includes `BackgroundImageExample`. I have also added testcases for parsing syntax in JS. ([3d08683d0f](https://github.com/facebook/react-native/commit/3d08683d0fcb66cd657e3f72388a53605c7c3974) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway)) +- Added eslint rule to warn when a non-error is being thrown from a function or rejected for a promise. ([94995fdd9f](https://github.com/facebook/react-native/commit/94995fdd9f278eb3858d4aabb4e63cdc3997017a) by [@vzaidman](https://github.com/vzaidman)) +- Add meaningful error reporting when `AccessibilityInfo`'s methods are not available. ([9cadfe6607](https://github.com/facebook/react-native/commit/9cadfe6607159f78bdd45929e0eb9b3292240cb9) by [@vzaidman](https://github.com/vzaidman)) +- Background image native parser. ([a9780f9102](https://github.com/facebook/react-native/commit/a9780f9102800a53e381271bcf27542eaea4a46e) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway)) +- Expose NativeComponentRegistry API to index.d.ts ([3f7f9d8fb8](https://github.com/facebook/react-native/commit/3f7f9d8fb8beb41408d092870a7c7cac58029a4d) by [@gabrieldonadel](https://github.com/gabrieldonadel)) +- AnimationBackend initialisation and style updates ([e091759947](https://github.com/facebook/react-native/commit/e09175994759a8868148b4a5d31768e18057d5a4) by [@bartlomiejbloniarz](https://github.com/bartlomiejbloniarz)) +- Unstable_setAnimationBackend, unstable_getAnimationBackend in UIManager ([7ec470d49a](https://github.com/facebook/react-native/commit/7ec470d49abded215fef260d577b8424207f7fb9) by Bartlomiej Bloniarz) +- Make AnimatedNodesManager use the backend behind the flag ([325c681cb1](https://github.com/facebook/react-native/commit/325c681cb17996c15b246ad0012cbde3d4631f08) by Bartlomiej Bloniarz) +- DevServer banners can now be closed on tap. On iOS, don't close them after 15s anymore. ([6936bd9f6b](https://github.com/facebook/react-native/commit/6936bd9f6bcb4fce5af33442e72992e7aa3767d6) by [@vzaidman](https://github.com/vzaidman)) +- New banner added to indicate that Fast Refresh has lost connection, and that the app needs to be restarted to reconnect ([4148746941](https://github.com/facebook/react-native/commit/4148746941f957031dd65fe94481bb3ea6367a47) by [@vzaidman](https://github.com/vzaidman)) +- Add `react-native/typescript-config/strict` export enabling the `react-native-strict-api` custom condition. ([0198c92c71](https://github.com/facebook/react-native/commit/0198c92c714cdfe48bb8d84771e5ef25c17fb47f) by [@kraenhansen](https://github.com/kraenhansen)) +- `unstable_NativeText` and `unstable_NativeView` are now exported from the `react-native` package ([90ac3ac7bd](https://github.com/facebook/react-native/commit/90ac3ac7bd2c7f8761d02e503224828f8af97fec) by [@huntie](https://github.com/huntie)) +- Create FeatureFlag overrideBySynchronousMountPropsAtMountingAndroid ([5774bd105d](https://github.com/facebook/react-native/commit/5774bd105d8f9377fb7f53a260c158fd2fd02271) by [@zeyap](https://github.com/zeyap)) +- `ListViewToken` is now exposed when using `"react-native-strict-api"` ([0a0b48b5ff](https://github.com/facebook/react-native/commit/0a0b48b5fff508a1976604bedc931a1b5110a4f2) by [@huntie](https://github.com/huntie)) + +#### Android specific + +- Added new `setBundleSource` method to `ReactHost` for changing bundle URL at runtime. ([005d705aff](https://github.com/facebook/react-native/commit/005d705aff70e560ac937740798b69582a5b6954) by [@coado](https://github.com/coado)) +- Background size, position and repeat styles. ([e859293674](https://github.com/facebook/react-native/commit/e859293674243d94895f710d1cb197e9e6f2e9e8) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway)) +- Add new configuration for `RCTDevMenu` ([4ddf2ce64f](https://github.com/facebook/react-native/commit/4ddf2ce64f8c6886a575c69872273005fd4d90cd) by [@coado](https://github.com/coado)) +- Hot reload banner is now displayed in blue background like on iOS ([4d45e5987c](https://github.com/facebook/react-native/commit/4d45e5987c1d85e5f56ae9501ba74eed48939307) by [@vzaidman](https://github.com/vzaidman)) + +#### iOS specific + +- Add contrast and hue-rotate CSS filters ([20ba98e00d](https://github.com/facebook/react-native/commit/20ba98e00da84b629cf2c1b11fa24c28c7046093) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway)) +- Add grayscale, drop-shadow and saturate CSS filters ([1198a55d50](https://github.com/facebook/react-native/commit/1198a55d50809b9086771fa0b40415dd487afe0f) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway)) +- Background size, position and repeat styles. ([d8c2f1c883](https://github.com/facebook/react-native/commit/d8c2f1c883180828ce2784c4b30565e2bec194cf) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway)) +- Added way to set the RCT_REMOVE_LEGACY_ARCH flag from Cocoapods to compile ou the legacy arch ([5abda9c7da](https://github.com/facebook/react-native/commit/5abda9c7dacc5533fac35675c09100c7120dd634) by [@cipolleschi](https://github.com/cipolleschi)) +- Added support for symbolication of precompiled React.xcframework ([07f40ec6b4](https://github.com/facebook/react-native/commit/07f40ec6b48bf4b6507bda5819b873f3a7334dea) by [@chrfalch](https://github.com/chrfalch)) +- Add new configuration for `RCTDevMenu` ([29d5aa582f](https://github.com/facebook/react-native/commit/29d5aa582ffd6c395e34a1d03d2fdd742df647af) by [@coado](https://github.com/coado)) +- Filter blur ([b365e26593](https://github.com/facebook/react-native/commit/b365e26593112fee8824c53a2787679a29cbe9ab) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway)) +- Add support for condensed system font when using the new react native architecture. ([07da2ff3e1](https://github.com/facebook/react-native/commit/07da2ff3e18bbb71f428985f185d5f971843ec26) by [@ismarbesic](https://github.com/ismarbesic)) +- Make codegen generate PAckage.swift file for the codegen targets ([a7cd3cc08f](https://github.com/facebook/react-native/commit/a7cd3cc08fd2679bb00666162d91ee2fb7107d06) by [@cipolleschi](https://github.com/cipolleschi)) + +### Changed + +- Bump eslint-plugin-react-hooks to 7.0.1 ([28101284a9](https://github.com/facebook/react-native/commit/28101284a92ac0c93f646636423e6edf5e830006) by [@cipolleschi](https://github.com/cipolleschi)) +- Use Hermes artifacts published independently from React Native ([27bb34c006](https://github.com/facebook/react-native/commit/27bb34c006bb5daaac639d065aaa4c963528814e) by [@j-piasecki](https://github.com/j-piasecki)) +- Move `std::function` into `CallInvoker::invokeAsync` instead of copying it ([5ffff0153c](https://github.com/facebook/react-native/commit/5ffff0153cd3d5be6f3dc3c27cf91c7b3baa4bdb) by [@mrousavy](https://github.com/mrousavy)) +- Bump React version to 19.2 ([6f482708b5](https://github.com/facebook/react-native/commit/6f482708b5abd31ec12c18afc874420f06eb22e3) by [@cipolleschi](https://github.com/cipolleschi)) +- Updated copyright header in Yoga CMake file from Facebook to Meta. ([118a6621f5](https://github.com/facebook/react-native/commit/118a6621f5c4b15d89505b4dc12f05870c042194) by [@aialok](https://github.com/aialok)) +- Move using declarations into AnimationBackend class ([9e98c72ad3](https://github.com/facebook/react-native/commit/9e98c72ad34e0124df4ae846381fbc862d87206c) by [@zeyap](https://github.com/zeyap)) +- Metro bump to ^0.83.3 ([89f0a37800](https://github.com/facebook/react-native/commit/89f0a3780066e1d74b0cf45ff65a79534638f157) by [@robhogan](https://github.com/robhogan)) +- Initialize the backend in NativeAnimatedNodesManagerProvider ([3f396616d2](https://github.com/facebook/react-native/commit/3f396616d20beaebeb1fa7ab35deebc195bbcd2b) by Bartlomiej Bloniarz) +- Update version of Hermes V1 used for React Native ([4f2755bda5](https://github.com/facebook/react-native/commit/4f2755bda58ed627fe46376b337364484076b604) by [@j-piasecki](https://github.com/j-piasecki)) +- Improve codegen error when ios native project not found ([bc3503452f](https://github.com/facebook/react-native/commit/bc3503452f70e1f6917070f3a1b00d75bcd46b3f) by [@vonovak](https://github.com/vonovak)) +- Changed the coordinates of hermes artifacts when using Hermes V1 ([ae89022f9a](https://github.com/facebook/react-native/commit/ae89022f9a3c3a97204016c263bf857c38f7993c) by [@j-piasecki](https://github.com/j-piasecki)) + +#### Android specific + +- Changed value of `HERMESVM_HEAP_HV_MODE` to `HEAP_HV_PREFER32` for Hermes V1 ([fcb51b1392](https://github.com/facebook/react-native/commit/fcb51b13921dea7ed7d478d6944b52df470e2bef) by [@j-piasecki](https://github.com/j-piasecki)) +- Defer to responder system to terminate on scroll ([1e1af623b1](https://github.com/facebook/react-native/commit/1e1af623b14f7952c2f39a601098533f899bb464) by [@zeyap](https://github.com/zeyap)) +- Add Log error to discourage usages of getJSModule(RCTEventEmitter) API ([aab0d3397c](https://github.com/facebook/react-native/commit/aab0d3397c67bb3e27c3607ff2ed240859b5b039) by [@mdvacca](https://github.com/mdvacca)) +- Request layout on configuration change only when the font scale has changed ([e02e7b1a29](https://github.com/facebook/react-native/commit/e02e7b1a2943b3ec6e1eb15723c86a8255b100a6) by [@j-piasecki](https://github.com/j-piasecki)) +- Migrated ReactRoot to Kotlin ([0b14a19ea6](https://github.com/facebook/react-native/commit/0b14a19ea6f0bfd97fc8d3e3663615feab875d66) by [@sbuggay](https://github.com/sbuggay)) +- Runtime check that NewArchitecture is enabled in DefaultNewArchitectureEntryPoint ([d0d08e4554](https://github.com/facebook/react-native/commit/d0d08e4554c2b3a7676793fe2a43cedcf54b523f) by [@cortinico](https://github.com/cortinico)) +- [c++ animated] Course correct props at SurfaceMountingManager.updateProps() ([dae2f606c7](https://github.com/facebook/react-native/commit/dae2f606c76905de74e76db7b0a20052a5caea46) by [@zeyap](https://github.com/zeyap)) +- Split VirtualViewContainerState into classic, experimental versions [Android] ([793f99d949](https://github.com/facebook/react-native/commit/793f99d949049c7ab9a7991af0a19010d5444b9f) by [@CalixTang](https://github.com/CalixTang)) + +#### iOS specific + +- Use `CGImageSourceCreateImageAtIndex` instead of `CGImageSourceCreateThumbnailAtIndex` to decode full-sized images ([be4fcdafb1](https://github.com/facebook/react-native/commit/be4fcdafb13c2cee702bb120b0feb9b5966ca50e) by [@tsapeta](https://github.com/tsapeta)) +- Updated logging functions for prebuilds ([f0f8b95719](https://github.com/facebook/react-native/commit/f0f8b957190f2f9bf162528210c41f1437346af9) by [@chrfalch](https://github.com/chrfalch)) + +### Deprecated + +#### Android specific + +- Mark `NetworkingModule.sendRequestInternal` as deprecated ([30999b868c](https://github.com/facebook/react-native/commit/30999b868cf1655b6799edfa65dba2cc9fa8161a) by [@motiz88](https://github.com/motiz88)) +- Clean up batchingControlledByJS in NativeAnimated kotlin ([c9dcd64ed5](https://github.com/facebook/react-native/commit/c9dcd64ed557d477828549e54afa71a12e5294ec) by [@zeyap](https://github.com/zeyap)) + +### Fixed + +- Fixing an issue with the error LogBox formatting on windows causing text to wrap ([e2b62bc435](https://github.com/facebook/react-native/commit/e2b62bc43549545dfb29e7efad7aaf115cadc1f2) by Gianni Moschini) +- Add missing value to switch for `-Wswitch-enum` builds ([3ff4ab2290](https://github.com/facebook/react-native/commit/3ff4ab2290f87ee121ca29b76614207bbb3ad8e4) by [@NSProgrammer](https://github.com/NSProgrammer)) +- Use size_t instead of int for vector iteration in cloneMultipleRecursive ([f9754d3459](https://github.com/facebook/react-native/commit/f9754d34590fe4d988065a92de5d512883de3b33) by Harini Malothu) +- Fixed missing type definitions for new DOM APIs in legacy TypeScript types. ([05ec7e0ad1](https://github.com/facebook/react-native/commit/05ec7e0ad13cce59e7e3161aa1005392584d6c59) by [@rubennorte](https://github.com/rubennorte)) +- ResizeMethod was not propagated correctly on Android with Props 2.0 ([7c543db181](https://github.com/facebook/react-native/commit/7c543db181a0c2dfce46cb26428e7bbc0341945c) by [@Abbondanzo](https://github.com/Abbondanzo)) +- Updated sync script to emit “Meta Platforms, Inc.” instead of "Facebook, Inc." in copyright notice. ([0b68dcfac8](https://github.com/facebook/react-native/commit/0b68dcfac80e37423c886cc481a616506351bd81) by [@willspag](https://github.com/willspag)) +- Avoid data loss during conversion ([c629019080](https://github.com/facebook/react-native/commit/c62901908088b9c03baffb8903e9b19ba1bc919d) by [@vineethkuttan](https://github.com/vineethkuttan)) +- Fixed https://github.com/facebook/react-native/issues/54102 ([5f5a77c342](https://github.com/facebook/react-native/commit/5f5a77c342abca18080f54daf16b70a524ae093e) by [@SamChou19815](https://github.com/SamChou19815)) +- TypeScript types of `positions` in `GradientValue` ([f7ea40bc28](https://github.com/facebook/react-native/commit/f7ea40bc28605fb712910e20d150af0bb9942611) by [@SimpleCreations](https://github.com/SimpleCreations)) +- Invalidate transform cache when `react-native/babel-preset` is updated ([2d2011c7ae](https://github.com/facebook/react-native/commit/2d2011c7ae0145369ad226417e9ecc3bf6df7890) by [@robhogan](https://github.com/robhogan)) +- Fixed Types in Refresh control ([ed24a4d05b](https://github.com/facebook/react-native/commit/ed24a4d05bb2e1e4a7e32a955777e59e827ebce5) by [@riteshshukla04](https://github.com/riteshshukla04)) +- Only remove the Fast Refresh "Refreshing..." toast when all bundles being loaded finished loading. ([92cae27cb2](https://github.com/facebook/react-native/commit/92cae27cb24590e96b01a1dc9547687bafea877b) by [@vzaidman](https://github.com/vzaidman)) +- 9-element (2d) transform matrix are not correctly working ([ce243df972](https://github.com/facebook/react-native/commit/ce243df9725baff265fcd275b420ee78971e75cb) by [@cortinico](https://github.com/cortinico)) +- Allow `EventEmitter`s to be optional (for push safety) ([4308185b64](https://github.com/facebook/react-native/commit/4308185b64145f315132865cc69f219bc3299eb3) by Tom Scallon) +- The `ItemSeparatorComponent` prop on list components now accepts a React element as well as a component function. ([35f6ed1146](https://github.com/facebook/react-native/commit/35f6ed1146fae2c36113f5705230188790a0d70c) by [@huntie](https://github.com/huntie)) +- Fix array type parsing in DynamicEventPayload::extractValue ([cf5040b4f8](https://github.com/facebook/react-native/commit/cf5040b4f82934c075a72b35d5f2d1d0dfa7aac1) by [@zeyap](https://github.com/zeyap)) +- ReactCxxPlatform] Don't crash on reload ([5d65794ee4](https://github.com/facebook/react-native/commit/5d65794ee4fadc135d1c47ccd3bcce36e594ab8d) by [@christophpurrer](https://github.com/christophpurrer)) + +#### Android specific + +- Issue with restarting scroll in maintainVisibleContentPosition ([a034841fd6](https://github.com/facebook/react-native/commit/a034841fd68a93778d4999f8bc540cf6a5fef8d4) by [@rozele](https://github.com/rozele)) +- Defers focus until View is attached ([9d498f676d](https://github.com/facebook/react-native/commit/9d498f676d96b1c8d3d6c58dc188ea51e88e3474) by [@rozele](https://github.com/rozele)) +- Resolves an int overflow in findNextFocusableElement ([363d297260](https://github.com/facebook/react-native/commit/363d2972608e90abb423f9e0592270978a73fb9f) by [@rozele](https://github.com/rozele)) +- Fix text not scaling down when system fontScale < 1.0 ([642f086b8c](https://github.com/facebook/react-native/commit/642f086b8ce4088d7f0b3c6453e2bb8c5f75e41b) by [@kdwkr](https://github.com/kdwkr)) +- Controller-driven scroll events now honor paging/snap alignment ([ed75963c0d](https://github.com/facebook/react-native/commit/ed75963c0d14ba0b7c85b0aaed8fe635d60d1b99) by [@Abbondanzo](https://github.com/Abbondanzo)) +- Fixed displaying dev menu items in light mode. ([269b0bd877](https://github.com/facebook/react-native/commit/269b0bd877b018e9d54e7b08ab9b4d265daaaef3) by [@coado](https://github.com/coado)) +- Fix request permission not always resolving in Android 16 ([39ede95921](https://github.com/facebook/react-native/commit/39ede959211e10032f147d2b0b7af783cba049c8) by [@lukmccall](https://github.com/lukmccall)) +- Fix build failures with RNGP due to AGP 9.0.0-alpha05 ([69dc655005](https://github.com/facebook/react-native/commit/69dc655005bc20feb119ddeca7f663d2d64a6275) by [@cortinico](https://github.com/cortinico)) +- Focused scroll into view behaviors for nested vertical scroll views ([26502c6319](https://github.com/facebook/react-native/commit/26502c63193c3f4814af82ca6f8ff4c45abbb76b) by [@rozele](https://github.com/rozele)) +- Fixed `SoLoader` race condition in `InspectorNetworkRequestListener` ([6c874f25e2](https://github.com/facebook/react-native/commit/6c874f25e20499f6f5a2ccac38b157018e3ccb33) by [@vzaidman](https://github.com/vzaidman)) +- Request layout on attached surfaces when font scale changes ([417e068220](https://github.com/facebook/react-native/commit/417e0682203d70bd5ca510f7999a7f6c6990566f) by [@j-piasecki](https://github.com/j-piasecki)) +- Fixed ReactAndroid.api ([2065c31800](https://github.com/facebook/react-native/commit/2065c31800cff27b648989fd0f965cdb36b8f6d5) by [@arushikesarwani94](https://github.com/arushikesarwani94)) +- Correct deprecation message for `ReactContextBaseJavaModule#getCurrentActivity()` ([81bbbe3c45](https://github.com/facebook/react-native/commit/81bbbe3c458628187c078fe2c0ef2b5d13867fe5) by [@vladd-g](https://github.com/vladd-g)) +- Do not crash inside getEncodedScreenSizeWithoutVerticalInsets if SurfaceMountingManager is null ([f59a6f9508](https://github.com/facebook/react-native/commit/f59a6f9508f92391b26d44854f3da238ccbc5e62) by [@cortinico](https://github.com/cortinico)) +- Read the Hermes V1 opt-in flag from the apps properties when building from source ([813b9441ca](https://github.com/facebook/react-native/commit/813b9441cad3c5bd45ef25f438217281e66dcf65) by [@j-piasecki](https://github.com/j-piasecki)) + +#### iOS specific + +- Fix using iOS nightly prebuilds in release mode ([19d87c874e](https://github.com/facebook/react-native/commit/19d87c874edb534d3acf5cb6576c6335983b661e) by [@gabrieldonadel](https://github.com/gabrieldonadel)) +- Fix iOS version mismatch when using nightly prebuilds ([790860782e](https://github.com/facebook/react-native/commit/790860782e07c02b3d89742006d9e73fea62bcfc) by [@gabrieldonadel](https://github.com/gabrieldonadel)) +- Fix autolinking-generated react-native-config output not being used in ReactCodegen script phase due to temp output directory ([c0290329cd](https://github.com/facebook/react-native/commit/c0290329cdb1771ec087c8552049a287c67259c6) by [@kitten](https://github.com/kitten)) +- Add missing `break;` to `-[RCTViewManager pointerEvents]` ([916e53f845](https://github.com/facebook/react-native/commit/916e53f845cdb438c1bb38590d7743f113eed8f7) by [@NSProgrammer](https://github.com/NSProgrammer)) +- Address unexpected warning about "Unbalanced calls start/end for tag 20/19" ([796d182d89](https://github.com/facebook/react-native/commit/796d182d8989ff826eaa3a57458bdfc79750f820) by [@lokshunhung](https://github.com/lokshunhung)) +- Raised the maximum number of pointers tracked at the same time to 17 ([58bd51e7e2](https://github.com/facebook/react-native/commit/58bd51e7e23cbd1f5f0f360587610c9fc70c0d76) by [@j-piasecki](https://github.com/j-piasecki)) +- Apply tint color to Actions sheets buttons ([535efc1403](https://github.com/facebook/react-native/commit/535efc1403e53bde190ce5ddb7ecf97918c5e5fd) by [@cipolleschi](https://github.com/cipolleschi)) +- Revert action sheet behavior not to break apps on iOS 26 ([82d2352b19](https://github.com/facebook/react-native/commit/82d2352b19b5255c74d17efea467bdad2ba93f29) by [@cipolleschi](https://github.com/cipolleschi)) +- Update the `source`property to avoid multiple downloads ([0a71b43fbc](https://github.com/facebook/react-native/commit/0a71b43fbc9d759bb8effd0197031a955687d07a) by [@chrfalch](https://github.com/chrfalch)) +- BoxShadow + overflow hidden combination interfering with pointerEvents and transform scale. ([c8e5f9766b](https://github.com/facebook/react-native/commit/c8e5f9766b8caaf66aa61ef48eeab740a10a725a) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway)) +- Make `RCTSetDefaultFontHandler` compatible with the new arch, and add a more powerful version as `RCTSetDefaultFontResolver` ([64b30a9376](https://github.com/facebook/react-native/commit/64b30a937607e436b7979e245c456e7ca45bfd11) by [@javache](https://github.com/javache)) +- Fix RCTDeviceInfo crash when application.delegate.window is nil in modern iOS app architectures ([968909488a](https://github.com/facebook/react-native/commit/968909488a844c695a92ce000497840e577190dd) by [@25harsh](https://github.com/25harsh)) +- Modal swipe dismissal works only for the first time ([3a0c402d26](https://github.com/facebook/react-native/commit/3a0c402d26c366126fe7b36b2d504be4f658d68d) by [@okwasniewski](https://github.com/okwasniewski)) +- Images are removed from memory more aggressively to prevent OOMs ([3895831c2b](https://github.com/facebook/react-native/commit/3895831c2bc83faf68223bb2a491e796d2799b24) by [@sammy-SC](https://github.com/sammy-SC)) + ## v0.82.1 ### Fixed From 7aae5562f388e2b8aac31166a336d29067455544 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Wed, 5 Nov 2025 10:01:03 -0800 Subject: [PATCH 036/562] Remove RCT_EXPORT_MODULE from Core modules (#54288) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54288 This change remove the usage of RCT_EXPORT_MODULE from all the classes of React Native Core. This allow us to remove the +load method that runs at initialization of React Native and that can slow down the start of React Native itself. All the classes are still registered due to the [`RCTBridge`'s `getCoreModuleClasses`](https://github.com/facebook/react-native/blob/main/packages/react-native/React/Base/RCTBridge.mm#L46) which manually lists all the classes that got modified. --- ## TODO There are some classes that should be loaded using the respective plugins. Currently, the OSS implementation only uses the [CoreModulePlugin](https://github.com/facebook/react-native/blob/main/packages/react-native/React/CoreModules/CoreModulesPlugins.mm#L19), but we should add the lookup also in these others plugins: - RCTBlobPlugins.mm - RCTImagePlugins.mm - RCTNetworkPlugins.mm - RCTSettingsPlugins.mm - RCTLinkingPlugins.mm - RCTVibrationPlugins.mm - RCTAnimationPlugins.mm - RCTPushNotificationPlugins.mm (if the import is available. The push notification module is not included by default) ## Changelog: [Internal] - Remove RCT_EXPORT_MODULE from RN Core Modules Reviewed By: javache Differential Revision: D85580258 fbshipit-source-id: 6df6002afdcd2d7344a4a9fb2674a9f34c7abc1e --- packages/react-native/Libraries/Blob/RCTBlobManager.mm | 5 ++++- packages/react-native/Libraries/Blob/RCTFileReaderModule.mm | 5 ++++- .../Libraries/Image/RCTBundleAssetImageLoader.mm | 5 ++++- packages/react-native/Libraries/Image/RCTGIFImageDecoder.mm | 5 ++++- .../react-native/Libraries/Image/RCTImageEditingManager.mm | 5 ++++- packages/react-native/Libraries/Image/RCTImageLoader.mm | 5 ++++- .../react-native/Libraries/Image/RCTImageStoreManager.mm | 5 ++++- .../react-native/Libraries/Image/RCTImageViewManager.mm | 5 ++++- .../Libraries/Image/RCTLocalAssetImageLoader.mm | 5 ++++- .../react-native/Libraries/LinkingIOS/RCTLinkingManager.mm | 5 ++++- .../Libraries/NativeAnimation/RCTNativeAnimatedModule.mm | 5 ++++- .../NativeAnimation/RCTNativeAnimatedTurboModule.mm | 5 ++++- .../react-native/Libraries/Network/RCTDataRequestHandler.mm | 5 ++++- .../react-native/Libraries/Network/RCTFileRequestHandler.mm | 5 ++++- .../react-native/Libraries/Network/RCTHTTPRequestHandler.mm | 5 ++++- packages/react-native/Libraries/Network/RCTNetworking.mm | 5 ++++- .../PushNotificationIOS/RCTPushNotificationManager.mm | 5 ++++- .../react-native/Libraries/Settings/RCTSettingsManager.mm | 5 ++++- .../Libraries/Text/BaseText/RCTBaseTextViewManager.mm | 5 ++++- .../Libraries/Text/RawText/RCTRawTextViewManager.mm | 5 ++++- .../react-native/Libraries/Text/Text/RCTTextViewManager.mm | 5 ++++- .../TextInput/Multiline/RCTMultilineTextInputViewManager.mm | 5 ++++- .../Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm | 5 ++++- .../Text/TextInput/RCTInputAccessoryViewManager.mm | 5 ++++- .../Singleline/RCTSinglelineTextInputViewManager.mm | 5 ++++- .../Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm | 5 ++++- packages/react-native/Libraries/Vibration/RCTVibration.mm | 5 ++++- .../React/CoreModules/RCTAccessibilityManager.mm | 5 ++++- .../react-native/React/CoreModules/RCTActionSheetManager.mm | 5 ++++- packages/react-native/React/CoreModules/RCTAlertManager.mm | 5 ++++- packages/react-native/React/CoreModules/RCTAppState.mm | 5 ++++- packages/react-native/React/CoreModules/RCTAppearance.mm | 5 ++++- packages/react-native/React/CoreModules/RCTClipboard.mm | 5 ++++- .../react-native/React/CoreModules/RCTDevLoadingView.mm | 5 ++++- packages/react-native/React/CoreModules/RCTDevMenu.mm | 5 ++++- packages/react-native/React/CoreModules/RCTDevSettings.mm | 5 ++++- .../React/CoreModules/RCTDevToolsRuntimeSettingsModule.mm | 6 +++++- packages/react-native/React/CoreModules/RCTDeviceInfo.mm | 5 ++++- .../react-native/React/CoreModules/RCTEventDispatcher.mm | 5 ++++- .../react-native/React/CoreModules/RCTExceptionsManager.mm | 5 ++++- packages/react-native/React/CoreModules/RCTI18nManager.mm | 5 ++++- .../react-native/React/CoreModules/RCTKeyboardObserver.mm | 5 ++++- packages/react-native/React/CoreModules/RCTLogBox.mm | 5 ++++- packages/react-native/React/CoreModules/RCTPerfMonitor.mm | 5 ++++- packages/react-native/React/CoreModules/RCTPlatform.mm | 5 ++++- packages/react-native/React/CoreModules/RCTRedBox.mm | 5 ++++- packages/react-native/React/CoreModules/RCTSourceCode.mm | 5 ++++- .../react-native/React/CoreModules/RCTStatusBarManager.mm | 5 ++++- packages/react-native/React/CoreModules/RCTTiming.mm | 5 ++++- .../react-native/React/CoreModules/RCTWebSocketModule.mm | 5 ++++- packages/react-native/React/Modules/RCTUIManager.mm | 5 ++++- .../React/Views/RCTActivityIndicatorViewManager.m | 5 ++++- .../react-native/React/Views/RCTDebuggingOverlayManager.m | 5 ++++- packages/react-native/React/Views/RCTModalHostViewManager.m | 5 ++++- packages/react-native/React/Views/RCTModalManager.m | 5 ++++- packages/react-native/React/Views/RCTSwitchManager.m | 5 ++++- packages/react-native/React/Views/RCTViewManager.m | 5 ++++- .../React/Views/RefreshControl/RCTRefreshControlManager.m | 5 ++++- .../React/Views/SafeAreaView/RCTSafeAreaViewManager.m | 5 ++++- .../React/Views/ScrollView/RCTScrollContentViewManager.m | 5 ++++- .../React/Views/ScrollView/RCTScrollViewManager.m | 5 ++++- .../platform/ios/ReactCommon/RCTSampleTurboModule.mm | 5 ++++- 62 files changed, 249 insertions(+), 62 deletions(-) diff --git a/packages/react-native/Libraries/Blob/RCTBlobManager.mm b/packages/react-native/Libraries/Blob/RCTBlobManager.mm index 981778817ef4..6dfcb4a1bcc4 100755 --- a/packages/react-native/Libraries/Blob/RCTBlobManager.mm +++ b/packages/react-native/Libraries/Blob/RCTBlobManager.mm @@ -42,7 +42,10 @@ @implementation RCTBlobManager { dispatch_queue_t _processingQueue; } -RCT_EXPORT_MODULE(BlobModule) ++ (NSString *)moduleName +{ + return @"BlobModule"; +} @synthesize bridge = _bridge; @synthesize moduleRegistry = _moduleRegistry; diff --git a/packages/react-native/Libraries/Blob/RCTFileReaderModule.mm b/packages/react-native/Libraries/Blob/RCTFileReaderModule.mm index 02180144f281..ae38238301d6 100644 --- a/packages/react-native/Libraries/Blob/RCTFileReaderModule.mm +++ b/packages/react-native/Libraries/Blob/RCTFileReaderModule.mm @@ -20,7 +20,10 @@ @interface RCTFileReaderModule () @implementation RCTFileReaderModule -RCT_EXPORT_MODULE(FileReaderModule) ++ (NSString *)moduleName +{ + return @"FileReaderModule"; +} @synthesize moduleRegistry = _moduleRegistry; diff --git a/packages/react-native/Libraries/Image/RCTBundleAssetImageLoader.mm b/packages/react-native/Libraries/Image/RCTBundleAssetImageLoader.mm index 538bf842fcf1..6f05e536bfe0 100644 --- a/packages/react-native/Libraries/Image/RCTBundleAssetImageLoader.mm +++ b/packages/react-native/Libraries/Image/RCTBundleAssetImageLoader.mm @@ -20,7 +20,10 @@ @interface RCTBundleAssetImageLoader () @implementation RCTBundleAssetImageLoader -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"BundleAssetImageLoader"; +} - (BOOL)canLoadImageURL:(NSURL *)requestURL { diff --git a/packages/react-native/Libraries/Image/RCTGIFImageDecoder.mm b/packages/react-native/Libraries/Image/RCTGIFImageDecoder.mm index 92628c6c8f26..f5e9cca76f0b 100644 --- a/packages/react-native/Libraries/Image/RCTGIFImageDecoder.mm +++ b/packages/react-native/Libraries/Image/RCTGIFImageDecoder.mm @@ -20,7 +20,10 @@ @interface RCTGIFImageDecoder () @implementation RCTGIFImageDecoder -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"GIFImageDecoder"; +} - (BOOL)canDecodeImageData:(NSData *)imageData { diff --git a/packages/react-native/Libraries/Image/RCTImageEditingManager.mm b/packages/react-native/Libraries/Image/RCTImageEditingManager.mm index 7f72f130217f..bfd62aa1c7be 100644 --- a/packages/react-native/Libraries/Image/RCTImageEditingManager.mm +++ b/packages/react-native/Libraries/Image/RCTImageEditingManager.mm @@ -24,7 +24,10 @@ @interface RCTImageEditingManager () @implementation RCTImageEditingManager -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"ImageEditingManager"; +} @synthesize moduleRegistry = _moduleRegistry; diff --git a/packages/react-native/Libraries/Image/RCTImageLoader.mm b/packages/react-native/Libraries/Image/RCTImageLoader.mm index 9c2553d7ec52..ea29bef42946 100644 --- a/packages/react-native/Libraries/Image/RCTImageLoader.mm +++ b/packages/react-native/Libraries/Image/RCTImageLoader.mm @@ -92,7 +92,10 @@ @implementation RCTImageLoader { @synthesize maxConcurrentDecodingTasks = _maxConcurrentDecodingTasks; @synthesize maxConcurrentDecodingBytes = _maxConcurrentDecodingBytes; -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"RCTImageLoader"; +} - (instancetype)init { diff --git a/packages/react-native/Libraries/Image/RCTImageStoreManager.mm b/packages/react-native/Libraries/Image/RCTImageStoreManager.mm index f5f9a88b4689..8c8d62c6a434 100644 --- a/packages/react-native/Libraries/Image/RCTImageStoreManager.mm +++ b/packages/react-native/Libraries/Image/RCTImageStoreManager.mm @@ -32,7 +32,10 @@ @implementation RCTImageStoreManager { @synthesize methodQueue = _methodQueue; -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"ImageStoreManager"; +} + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/Libraries/Image/RCTImageViewManager.mm b/packages/react-native/Libraries/Image/RCTImageViewManager.mm index 74e1713b820a..a316c39a2fa8 100644 --- a/packages/react-native/Libraries/Image/RCTImageViewManager.mm +++ b/packages/react-native/Libraries/Image/RCTImageViewManager.mm @@ -20,7 +20,10 @@ @implementation RCTImageViewManager -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"ImageViewManager"; +} - (RCTShadowView *)shadowView { diff --git a/packages/react-native/Libraries/Image/RCTLocalAssetImageLoader.mm b/packages/react-native/Libraries/Image/RCTLocalAssetImageLoader.mm index 517804aaff3b..74246d45f165 100644 --- a/packages/react-native/Libraries/Image/RCTLocalAssetImageLoader.mm +++ b/packages/react-native/Libraries/Image/RCTLocalAssetImageLoader.mm @@ -20,7 +20,10 @@ @interface RCTLocalAssetImageLoader () @implementation RCTLocalAssetImageLoader -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"LocalAssetImageLoader"; +} - (BOOL)canLoadImageURL:(NSURL *)requestURL { diff --git a/packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm b/packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm index db689678d652..7d66efdc946e 100644 --- a/packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm +++ b/packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm @@ -27,7 +27,10 @@ @interface RCTLinkingManager () @implementation RCTLinkingManager -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"LinkingManager"; +} - (dispatch_queue_t)methodQueue { diff --git a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm b/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm index 9120e8c4754b..818d71a2916f 100644 --- a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm +++ b/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm @@ -30,7 +30,10 @@ @implementation RCTNativeAnimatedModule { NSMutableDictionary *_animIdIsManagedByFabric; } -RCT_EXPORT_MODULE(); ++ (NSString *)moduleName +{ + return @"NativeAnimatedModule"; +} + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm b/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm index a168bddff83a..b192de009ee4 100644 --- a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm +++ b/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm @@ -30,7 +30,10 @@ @implementation RCTNativeAnimatedTurboModule { NSSet *_userDrivenAnimationEndedEvents; } -RCT_EXPORT_MODULE(); ++ (NSString *)moduleName +{ + return @"NativeAnimatedTurboModule"; +} + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/Libraries/Network/RCTDataRequestHandler.mm b/packages/react-native/Libraries/Network/RCTDataRequestHandler.mm index d52f6ba8ad6d..0ed1ad4a8cf5 100644 --- a/packages/react-native/Libraries/Network/RCTDataRequestHandler.mm +++ b/packages/react-native/Libraries/Network/RCTDataRequestHandler.mm @@ -20,7 +20,10 @@ @implementation RCTDataRequestHandler { std::mutex _operationHandlerMutexLock; } -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"DataRequestHandler"; +} - (void)invalidate { diff --git a/packages/react-native/Libraries/Network/RCTFileRequestHandler.mm b/packages/react-native/Libraries/Network/RCTFileRequestHandler.mm index a1de92f33fe6..6a082bdb82b3 100644 --- a/packages/react-native/Libraries/Network/RCTFileRequestHandler.mm +++ b/packages/react-native/Libraries/Network/RCTFileRequestHandler.mm @@ -24,7 +24,10 @@ @implementation RCTFileRequestHandler { std::mutex _operationHandlerMutexLock; } -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"FileRequestHandler"; +} - (void)invalidate { diff --git a/packages/react-native/Libraries/Network/RCTHTTPRequestHandler.mm b/packages/react-native/Libraries/Network/RCTHTTPRequestHandler.mm index 0303970a2e47..17e7c3a1eaa9 100644 --- a/packages/react-native/Libraries/Network/RCTHTTPRequestHandler.mm +++ b/packages/react-native/Libraries/Network/RCTHTTPRequestHandler.mm @@ -33,7 +33,10 @@ @implementation RCTHTTPRequestHandler { @synthesize moduleRegistry = _moduleRegistry; -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"HTTPRequestHandler"; +} - (void)invalidate { diff --git a/packages/react-native/Libraries/Network/RCTNetworking.mm b/packages/react-native/Libraries/Network/RCTNetworking.mm index 86e80e24cde6..7c53d0e8d1f4 100644 --- a/packages/react-native/Libraries/Network/RCTNetworking.mm +++ b/packages/react-native/Libraries/Network/RCTNetworking.mm @@ -167,7 +167,10 @@ @implementation RCTNetworking { @synthesize methodQueue = _methodQueue; -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"Networking"; +} + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm b/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm index b113503efe5c..e14a8780c551 100644 --- a/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm +++ b/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm @@ -154,7 +154,10 @@ static BOOL IsNotificationRemote(UNNotification *notification) return [notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]; } -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"PushNotificationManager"; +} - (dispatch_queue_t)methodQueue { diff --git a/packages/react-native/Libraries/Settings/RCTSettingsManager.mm b/packages/react-native/Libraries/Settings/RCTSettingsManager.mm index e1515ef05c24..b66eb12900b5 100644 --- a/packages/react-native/Libraries/Settings/RCTSettingsManager.mm +++ b/packages/react-native/Libraries/Settings/RCTSettingsManager.mm @@ -25,7 +25,10 @@ @implementation RCTSettingsManager { @synthesize moduleRegistry = _moduleRegistry; -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"SettingsManager"; +} + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/Libraries/Text/BaseText/RCTBaseTextViewManager.mm b/packages/react-native/Libraries/Text/BaseText/RCTBaseTextViewManager.mm index 4843a9bd4db4..076a78b08b9b 100644 --- a/packages/react-native/Libraries/Text/BaseText/RCTBaseTextViewManager.mm +++ b/packages/react-native/Libraries/Text/BaseText/RCTBaseTextViewManager.mm @@ -11,7 +11,10 @@ @implementation RCTBaseTextViewManager -RCT_EXPORT_MODULE(RCTBaseText) ++ (NSString *)moduleName +{ + return @"BaseText"; +} - (UIView *)view { diff --git a/packages/react-native/Libraries/Text/RawText/RCTRawTextViewManager.mm b/packages/react-native/Libraries/Text/RawText/RCTRawTextViewManager.mm index 15a851da28d7..9595ff96de76 100644 --- a/packages/react-native/Libraries/Text/RawText/RCTRawTextViewManager.mm +++ b/packages/react-native/Libraries/Text/RawText/RCTRawTextViewManager.mm @@ -13,7 +13,10 @@ @implementation RCTRawTextViewManager -RCT_EXPORT_MODULE(RCTRawText) ++ (NSString *)moduleName +{ + return @"RawText"; +} - (UIView *)view { diff --git a/packages/react-native/Libraries/Text/Text/RCTTextViewManager.mm b/packages/react-native/Libraries/Text/Text/RCTTextViewManager.mm index cf093baaf48b..b17ca60310ca 100644 --- a/packages/react-native/Libraries/Text/Text/RCTTextViewManager.mm +++ b/packages/react-native/Libraries/Text/Text/RCTTextViewManager.mm @@ -26,7 +26,10 @@ @implementation RCTTextViewManager { NSHashTable *_shadowViews; } -RCT_EXPORT_MODULE(RCTText) ++ (NSString *)moduleName +{ + return @"TextViewManager"; +} RCT_REMAP_SHADOW_PROPERTY(numberOfLines, maximumNumberOfLines, NSInteger) RCT_REMAP_SHADOW_PROPERTY(ellipsizeMode, lineBreakMode, NSLineBreakMode) diff --git a/packages/react-native/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.mm b/packages/react-native/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.mm index cbf1433cca0d..44fd7dbbcbc8 100644 --- a/packages/react-native/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.mm +++ b/packages/react-native/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.mm @@ -12,7 +12,10 @@ @implementation RCTMultilineTextInputViewManager -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"MultilineTextInputViewManager"; +} - (UIView *)view { diff --git a/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm b/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm index 3503ccf45226..19a27781612e 100644 --- a/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm +++ b/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm @@ -30,7 +30,10 @@ @implementation RCTBaseTextInputViewManager { NSHashTable *_shadowViews; } -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"BaseTextInputViewManager"; +} #pragma mark - Unified properties diff --git a/packages/react-native/Libraries/Text/TextInput/RCTInputAccessoryViewManager.mm b/packages/react-native/Libraries/Text/TextInput/RCTInputAccessoryViewManager.mm index 34e4a575285c..fa910d516027 100644 --- a/packages/react-native/Libraries/Text/TextInput/RCTInputAccessoryViewManager.mm +++ b/packages/react-native/Libraries/Text/TextInput/RCTInputAccessoryViewManager.mm @@ -14,7 +14,10 @@ @implementation RCTInputAccessoryViewManager -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"InputAccessoryViewManager"; +} - (UIView *)view { diff --git a/packages/react-native/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.mm b/packages/react-native/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.mm index 13cd754c7655..14dd7a52d9cb 100644 --- a/packages/react-native/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.mm +++ b/packages/react-native/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.mm @@ -14,7 +14,10 @@ @implementation RCTSinglelineTextInputViewManager -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"SinglelineTextInputViewManager"; +} - (RCTShadowView *)shadowView { diff --git a/packages/react-native/Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm b/packages/react-native/Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm index e3d054ed17fd..ebfdcccd4a26 100644 --- a/packages/react-native/Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm +++ b/packages/react-native/Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm @@ -13,7 +13,10 @@ @implementation RCTVirtualTextViewManager -RCT_EXPORT_MODULE(RCTVirtualText) ++ (NSString *)moduleName +{ + return @"VirtualTextViewManager"; +} - (UIView *)view { diff --git a/packages/react-native/Libraries/Vibration/RCTVibration.mm b/packages/react-native/Libraries/Vibration/RCTVibration.mm index 389dc871c4d2..19b0b7463974 100644 --- a/packages/react-native/Libraries/Vibration/RCTVibration.mm +++ b/packages/react-native/Libraries/Vibration/RCTVibration.mm @@ -18,7 +18,10 @@ @interface RCTVibration () @implementation RCTVibration -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"Vibration"; +} - (void)vibrate { diff --git a/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm b/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm index 37e4228d2836..4f4bd623ca17 100644 --- a/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm +++ b/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm @@ -33,7 +33,10 @@ @implementation RCTAccessibilityManager @synthesize moduleRegistry = _moduleRegistry; @synthesize multipliers = _multipliers; -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"AccessibilityManager"; +} + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTActionSheetManager.mm b/packages/react-native/React/CoreModules/RCTActionSheetManager.mm index 6472cc44f0bc..151223c6e6af 100644 --- a/packages/react-native/React/CoreModules/RCTActionSheetManager.mm +++ b/packages/react-native/React/CoreModules/RCTActionSheetManager.mm @@ -42,7 +42,10 @@ + (BOOL)requiresMainQueueSetup return NO; } -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"ActionSheetManager"; +} @synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED; diff --git a/packages/react-native/React/CoreModules/RCTAlertManager.mm b/packages/react-native/React/CoreModules/RCTAlertManager.mm index 2b9fc60c9681..7a42f861a491 100644 --- a/packages/react-native/React/CoreModules/RCTAlertManager.mm +++ b/packages/react-native/React/CoreModules/RCTAlertManager.mm @@ -40,7 +40,10 @@ @implementation RCTAlertManager { NSHashTable *_alertControllers; } -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"AlertManager"; +} - (dispatch_queue_t)methodQueue { diff --git a/packages/react-native/React/CoreModules/RCTAppState.mm b/packages/react-native/React/CoreModules/RCTAppState.mm index 1998115ea273..1b864f3b0fab 100644 --- a/packages/react-native/React/CoreModules/RCTAppState.mm +++ b/packages/react-native/React/CoreModules/RCTAppState.mm @@ -43,7 +43,10 @@ @implementation RCTAppState { facebook::react::ModuleConstants _constants; } -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"AppState"; +} + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTAppearance.mm b/packages/react-native/React/CoreModules/RCTAppearance.mm index d25d9f64e6bd..ebfea185c104 100644 --- a/packages/react-native/React/CoreModules/RCTAppearance.mm +++ b/packages/react-native/React/CoreModules/RCTAppearance.mm @@ -92,7 +92,10 @@ - (instancetype)init return self; } -RCT_EXPORT_MODULE(Appearance) ++ (NSString *)moduleName +{ + return @"Appearance"; +} + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTClipboard.mm b/packages/react-native/React/CoreModules/RCTClipboard.mm index 2dc098a47302..cfb0883dfe0e 100644 --- a/packages/react-native/React/CoreModules/RCTClipboard.mm +++ b/packages/react-native/React/CoreModules/RCTClipboard.mm @@ -19,7 +19,10 @@ @interface RCTClipboard () @implementation RCTClipboard -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"Clipboard"; +} - (dispatch_queue_t)methodQueue { diff --git a/packages/react-native/React/CoreModules/RCTDevLoadingView.mm b/packages/react-native/React/CoreModules/RCTDevLoadingView.mm index 0dd2a7f100cb..93d7d6b82acc 100644 --- a/packages/react-native/React/CoreModules/RCTDevLoadingView.mm +++ b/packages/react-native/React/CoreModules/RCTDevLoadingView.mm @@ -37,7 +37,10 @@ @implementation RCTDevLoadingView { dispatch_block_t _initialMessageBlock; } -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"DevLoadingView"; +} - (instancetype)init { diff --git a/packages/react-native/React/CoreModules/RCTDevMenu.mm b/packages/react-native/React/CoreModules/RCTDevMenu.mm index 890c1596df74..85eee89af938 100644 --- a/packages/react-native/React/CoreModules/RCTDevMenu.mm +++ b/packages/react-native/React/CoreModules/RCTDevMenu.mm @@ -124,7 +124,10 @@ @implementation RCTDevMenu { @synthesize callableJSModules = _callableJSModules; @synthesize bundleManager = _bundleManager; -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"DevMenu"; +} + (void)initialize { diff --git a/packages/react-native/React/CoreModules/RCTDevSettings.mm b/packages/react-native/React/CoreModules/RCTDevSettings.mm index fbbeec0e703d..804e5a02b4fe 100644 --- a/packages/react-native/React/CoreModules/RCTDevSettings.mm +++ b/packages/react-native/React/CoreModules/RCTDevSettings.mm @@ -134,7 +134,10 @@ @implementation RCTDevSettings @synthesize isInspectable = _isInspectable; @synthesize bundleManager = _bundleManager; -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"RCTDevSettings"; +} - (instancetype)init { diff --git a/packages/react-native/React/CoreModules/RCTDevToolsRuntimeSettingsModule.mm b/packages/react-native/React/CoreModules/RCTDevToolsRuntimeSettingsModule.mm index ba4e2559697a..5793f88b0830 100644 --- a/packages/react-native/React/CoreModules/RCTDevToolsRuntimeSettingsModule.mm +++ b/packages/react-native/React/CoreModules/RCTDevToolsRuntimeSettingsModule.mm @@ -23,7 +23,11 @@ @interface RCTDevToolsRuntimeSettingsModule () )delegate { diff --git a/packages/react-native/React/CoreModules/RCTI18nManager.mm b/packages/react-native/React/CoreModules/RCTI18nManager.mm index 7d3b9eaa11cf..c6dedeab7c33 100644 --- a/packages/react-native/React/CoreModules/RCTI18nManager.mm +++ b/packages/react-native/React/CoreModules/RCTI18nManager.mm @@ -19,7 +19,10 @@ @interface RCTI18nManager () @implementation RCTI18nManager -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"I18nManager"; +} + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTKeyboardObserver.mm b/packages/react-native/React/CoreModules/RCTKeyboardObserver.mm index 79f4f8f4170f..822dbe13de1a 100644 --- a/packages/react-native/React/CoreModules/RCTKeyboardObserver.mm +++ b/packages/react-native/React/CoreModules/RCTKeyboardObserver.mm @@ -20,7 +20,10 @@ @interface RCTKeyboardObserver () @implementation RCTKeyboardObserver -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"KeyboardObserver"; +} - (void)startObserving { diff --git a/packages/react-native/React/CoreModules/RCTLogBox.mm b/packages/react-native/React/CoreModules/RCTLogBox.mm index adfbb11a80e9..8e5c19bdbe6a 100644 --- a/packages/react-native/React/CoreModules/RCTLogBox.mm +++ b/packages/react-native/React/CoreModules/RCTLogBox.mm @@ -27,7 +27,10 @@ @implementation RCTLogBox { @synthesize bridge = _bridge; -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"LogBox"; +} + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTPerfMonitor.mm b/packages/react-native/React/CoreModules/RCTPerfMonitor.mm index e67ef6a40764..60dbaf5ffbb8 100644 --- a/packages/react-native/React/CoreModules/RCTPerfMonitor.mm +++ b/packages/react-native/React/CoreModules/RCTPerfMonitor.mm @@ -114,7 +114,10 @@ @implementation RCTPerfMonitor { @synthesize bridge = _bridge; @synthesize moduleRegistry = _moduleRegistry; -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"PerfMonitor"; +} + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTPlatform.mm b/packages/react-native/React/CoreModules/RCTPlatform.mm index 09060d5e2016..088157f20b8e 100644 --- a/packages/react-native/React/CoreModules/RCTPlatform.mm +++ b/packages/react-native/React/CoreModules/RCTPlatform.mm @@ -48,7 +48,10 @@ @implementation RCTPlatform { ModuleConstants _constants; } -RCT_EXPORT_MODULE(PlatformConstants) ++ (NSString *)moduleName +{ + return @"PlatformConstants"; +} + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTRedBox.mm b/packages/react-native/React/CoreModules/RCTRedBox.mm index fb057b969214..71c1f277f76b 100644 --- a/packages/react-native/React/CoreModules/RCTRedBox.mm +++ b/packages/react-native/React/CoreModules/RCTRedBox.mm @@ -480,7 +480,10 @@ @implementation RCTRedBox { @synthesize moduleRegistry = _moduleRegistry; @synthesize bundleManager = _bundleManager; -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"RedBox"; +} - (void)registerErrorCustomizer:(id)errorCustomizer { diff --git a/packages/react-native/React/CoreModules/RCTSourceCode.mm b/packages/react-native/React/CoreModules/RCTSourceCode.mm index ad5008429f89..47bf41729da1 100644 --- a/packages/react-native/React/CoreModules/RCTSourceCode.mm +++ b/packages/react-native/React/CoreModules/RCTSourceCode.mm @@ -18,7 +18,10 @@ @interface RCTSourceCode () @implementation RCTSourceCode -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"SourceCode"; +} @synthesize bundleManager = _bundleManager; diff --git a/packages/react-native/React/CoreModules/RCTStatusBarManager.mm b/packages/react-native/React/CoreModules/RCTStatusBarManager.mm index a7cd2cc9db5e..2e891bd446e2 100644 --- a/packages/react-native/React/CoreModules/RCTStatusBarManager.mm +++ b/packages/react-native/React/CoreModules/RCTStatusBarManager.mm @@ -68,7 +68,10 @@ static BOOL RCTViewControllerBasedStatusBarAppearance() return value; } -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"StatusBarManager"; +} + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTTiming.mm b/packages/react-native/React/CoreModules/RCTTiming.mm index 14ee7844c7fe..f07d91a8044d 100644 --- a/packages/react-native/React/CoreModules/RCTTiming.mm +++ b/packages/react-native/React/CoreModules/RCTTiming.mm @@ -107,7 +107,10 @@ @implementation RCTTiming { @synthesize paused = _paused; @synthesize pauseCallback = _pauseCallback; -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"Timing"; +} - (instancetype)initWithDelegate:(id)delegate { diff --git a/packages/react-native/React/CoreModules/RCTWebSocketModule.mm b/packages/react-native/React/CoreModules/RCTWebSocketModule.mm index e29d76a76a23..1541561e78b4 100644 --- a/packages/react-native/React/CoreModules/RCTWebSocketModule.mm +++ b/packages/react-native/React/CoreModules/RCTWebSocketModule.mm @@ -39,7 +39,10 @@ @implementation RCTWebSocketModule { NSMutableDictionary> *_contentHandlers; } -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"WebSocketModule"; +} - (dispatch_queue_t)methodQueue { diff --git a/packages/react-native/React/Modules/RCTUIManager.mm b/packages/react-native/React/Modules/RCTUIManager.mm index c3d1cf6d7240..0cfab1413037 100644 --- a/packages/react-native/React/Modules/RCTUIManager.mm +++ b/packages/react-native/React/Modules/RCTUIManager.mm @@ -179,7 +179,10 @@ @implementation RCTUIManager { @synthesize bridge = _bridge; @synthesize moduleRegistry = _moduleRegistry; -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"RCTUIManager"; +} + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/Views/RCTActivityIndicatorViewManager.m b/packages/react-native/React/Views/RCTActivityIndicatorViewManager.m index 8b9b79a0523d..0d62c172ad02 100644 --- a/packages/react-native/React/Views/RCTActivityIndicatorViewManager.m +++ b/packages/react-native/React/Views/RCTActivityIndicatorViewManager.m @@ -27,7 +27,10 @@ @implementation RCTConvert (UIActivityIndicatorView) @implementation RCTActivityIndicatorViewManager -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"ActivityIndicatorViewManager"; +} - (UIView *)view { diff --git a/packages/react-native/React/Views/RCTDebuggingOverlayManager.m b/packages/react-native/React/Views/RCTDebuggingOverlayManager.m index 83a85a19039b..31bf173e12ce 100644 --- a/packages/react-native/React/Views/RCTDebuggingOverlayManager.m +++ b/packages/react-native/React/Views/RCTDebuggingOverlayManager.m @@ -17,7 +17,10 @@ @implementation RCTDebuggingOverlayManager -RCT_EXPORT_MODULE(DebuggingOverlay) ++ (NSString *)moduleName +{ + return @"DebuggingOverlay"; +} - (UIView *)view { diff --git a/packages/react-native/React/Views/RCTModalHostViewManager.m b/packages/react-native/React/Views/RCTModalHostViewManager.m index 147cd4124398..c84b05da51c8 100644 --- a/packages/react-native/React/Views/RCTModalHostViewManager.m +++ b/packages/react-native/React/Views/RCTModalHostViewManager.m @@ -40,7 +40,10 @@ @implementation RCTModalHostViewManager { NSPointerArray *_hostViews; } -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"ModalHostViewManager "; +} - (UIView *)view { diff --git a/packages/react-native/React/Views/RCTModalManager.m b/packages/react-native/React/Views/RCTModalManager.m index 6e15eb83416f..effb33ffa309 100644 --- a/packages/react-native/React/Views/RCTModalManager.m +++ b/packages/react-native/React/Views/RCTModalManager.m @@ -17,7 +17,10 @@ @interface RCTModalManager () @implementation RCTModalManager -RCT_EXPORT_MODULE(); ++ (NSString *)moduleName +{ + return @"ModalManager"; +} - (NSArray *)supportedEvents { diff --git a/packages/react-native/React/Views/RCTSwitchManager.m b/packages/react-native/React/Views/RCTSwitchManager.m index 5398419a4c09..f758780f8d45 100644 --- a/packages/react-native/React/Views/RCTSwitchManager.m +++ b/packages/react-native/React/Views/RCTSwitchManager.m @@ -16,7 +16,10 @@ @implementation RCTSwitchManager -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"SwitchManager"; +} - (UIView *)view { diff --git a/packages/react-native/React/Views/RCTViewManager.m b/packages/react-native/React/Views/RCTViewManager.m index 1ace350d2422..d6f63ef1bd3c 100644 --- a/packages/react-native/React/Views/RCTViewManager.m +++ b/packages/react-native/React/Views/RCTViewManager.m @@ -128,7 +128,10 @@ @implementation RCTViewManager @synthesize bridge = _bridge; -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"RCTViewManager"; +} - (dispatch_queue_t)methodQueue { diff --git a/packages/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m b/packages/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m index 1e9ff527f4e6..46b5d488b0db 100644 --- a/packages/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m +++ b/packages/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m @@ -15,7 +15,10 @@ @implementation RCTRefreshControlManager -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"RefreshControlManager"; +} - (UIView *)view { diff --git a/packages/react-native/React/Views/SafeAreaView/RCTSafeAreaViewManager.m b/packages/react-native/React/Views/SafeAreaView/RCTSafeAreaViewManager.m index f8d2d8696ddd..61670f857f85 100644 --- a/packages/react-native/React/Views/SafeAreaView/RCTSafeAreaViewManager.m +++ b/packages/react-native/React/Views/SafeAreaView/RCTSafeAreaViewManager.m @@ -15,7 +15,10 @@ @implementation RCTSafeAreaViewManager -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"SafeAreaViewManager"; +} - (UIView *)view { diff --git a/packages/react-native/React/Views/ScrollView/RCTScrollContentViewManager.m b/packages/react-native/React/Views/ScrollView/RCTScrollContentViewManager.m index 4d79c3404c2b..896916f606bd 100644 --- a/packages/react-native/React/Views/ScrollView/RCTScrollContentViewManager.m +++ b/packages/react-native/React/Views/ScrollView/RCTScrollContentViewManager.m @@ -14,7 +14,10 @@ @implementation RCTScrollContentViewManager -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"ScrollContentViewManager"; +} - (RCTScrollContentView *)view { diff --git a/packages/react-native/React/Views/ScrollView/RCTScrollViewManager.m b/packages/react-native/React/Views/ScrollView/RCTScrollViewManager.m index 985771805c59..fbf857f63aa2 100644 --- a/packages/react-native/React/Views/ScrollView/RCTScrollViewManager.m +++ b/packages/react-native/React/Views/ScrollView/RCTScrollViewManager.m @@ -53,7 +53,10 @@ @implementation RCTConvert (UIScrollView) @implementation RCTScrollViewManager -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"ScrollViewManager"; +} - (UIView *)view { diff --git a/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm b/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm index 7486ffcb9ff8..83f07891e3a1 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm +++ b/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm @@ -24,7 +24,10 @@ @implementation RCTSampleTurboModule { } // Backward-compatible export -RCT_EXPORT_MODULE() ++ (NSString *)moduleName +{ + return @"SampleTurboModule"; +} // Backward-compatible queue configuration + (BOOL)requiresMainQueueSetup From ef6f3f6032f124c2ccc7e58941b0c0cf7c105f9e Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Wed, 5 Nov 2025 11:21:55 -0800 Subject: [PATCH 037/562] Remove move constructor from SurfaceHandler (#54108) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54108 Removed SurfaceHandler's move constructor, to avoid any potential issues with referencing moved-from instances. Changelog: [Internal] Reviewed By: Abbondanzo, mdvacca Differential Revision: D83977790 fbshipit-source-id: 3ea7a64f2183b7f28c62cca06537d3a26ba0bea8 --- .../React/Fabric/Surface/RCTFabricSurface.mm | 2 +- .../react/fabric/FabricUIManagerBinding.cpp | 62 +++++++++++-------- .../renderer/scheduler/SurfaceHandler.cpp | 20 ------ .../react/renderer/scheduler/SurfaceHandler.h | 6 +- .../renderer/scheduler/SurfaceManager.cpp | 5 +- 5 files changed, 42 insertions(+), 53 deletions(-) diff --git a/packages/react-native/React/Fabric/Surface/RCTFabricSurface.mm b/packages/react-native/React/Fabric/Surface/RCTFabricSurface.mm index 1382f13e9ac1..cf932b52bf00 100644 --- a/packages/react-native/React/Fabric/Surface/RCTFabricSurface.mm +++ b/packages/react-native/React/Fabric/Surface/RCTFabricSurface.mm @@ -57,7 +57,7 @@ - (instancetype)initWithSurfacePresenter:(RCTSurfacePresenter *)surfacePresenter if (self = [super init]) { _surfacePresenter = surfacePresenter; - _surfaceHandler = SurfaceHandler{RCTStringFromNSString(moduleName), getNextRootViewTag()}; + _surfaceHandler.emplace(RCTStringFromNSString(moduleName), getNextRootViewTag()); _surfaceHandler->setProps(convertIdToFollyDynamic(initialProperties)); [_surfacePresenter registerSurface:self]; diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp index 801c8f1fd601..cf813835bc95 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp @@ -166,34 +166,39 @@ void FabricUIManagerBinding::startSurface( return; } - auto layoutContext = LayoutContext{}; - layoutContext.pointScaleFactor = pointScaleFactor_; + SurfaceHandler* surfaceHandler = nullptr; + { + std::unique_lock lock(surfaceHandlerRegistryMutex_); + auto [it, _] = surfaceHandlerRegistry_.try_emplace( + surfaceId, + std::in_place_index<0>, + moduleName->toStdString(), + surfaceId); + surfaceHandler = &std::get(it->second); + } - auto surfaceHandler = SurfaceHandler{moduleName->toStdString(), surfaceId}; - surfaceHandler.setContextContainer(scheduler->getContextContainer()); + surfaceHandler->setContextContainer(scheduler->getContextContainer()); if (initialProps != nullptr) { - surfaceHandler.setProps(initialProps->consume()); + surfaceHandler->setProps(initialProps->consume()); } - surfaceHandler.constraintLayout({}, layoutContext); - scheduler->registerSurface(surfaceHandler); + auto layoutContext = LayoutContext{}; + layoutContext.pointScaleFactor = pointScaleFactor_; + surfaceHandler->constraintLayout({}, layoutContext); + + scheduler->registerSurface(*surfaceHandler); auto mountingManager = getMountingManager("startSurface"); if (mountingManager != nullptr) { mountingManager->onSurfaceStart(surfaceId); } - surfaceHandler.start(); + surfaceHandler->start(); if (ReactNativeFeatureFlags::enableLayoutAnimationsOnAndroid()) { - surfaceHandler.getMountingCoordinator()->setMountingOverrideDelegate( + surfaceHandler->getMountingCoordinator()->setMountingOverrideDelegate( animationDriver_); } - - { - std::unique_lock lock(surfaceHandlerRegistryMutex_); - surfaceHandlerRegistry_.emplace(surfaceId, std::move(surfaceHandler)); - } } jint FabricUIManagerBinding::findNextFocusableElement( @@ -338,31 +343,36 @@ void FabricUIManagerBinding::startSurfaceWithConstraints( constraints.layoutDirection = isRTL != 0 ? LayoutDirection::RightToLeft : LayoutDirection::LeftToRight; - auto surfaceHandler = SurfaceHandler{moduleName->toStdString(), surfaceId}; - surfaceHandler.setContextContainer(scheduler->getContextContainer()); + SurfaceHandler* surfaceHandler = nullptr; + { + std::unique_lock lock(surfaceHandlerRegistryMutex_); + auto [it, _] = surfaceHandlerRegistry_.try_emplace( + surfaceId, + std::in_place_index<0>, + moduleName->toStdString(), + surfaceId); + surfaceHandler = &std::get(it->second); + } + + surfaceHandler->setContextContainer(scheduler->getContextContainer()); if (initialProps != nullptr) { - surfaceHandler.setProps(initialProps->consume()); + surfaceHandler->setProps(initialProps->consume()); } - surfaceHandler.constraintLayout(constraints, context); + surfaceHandler->constraintLayout(constraints, context); - scheduler->registerSurface(surfaceHandler); + scheduler->registerSurface(*surfaceHandler); auto mountingManager = getMountingManager("startSurfaceWithConstraints"); if (mountingManager != nullptr) { mountingManager->onSurfaceStart(surfaceId); } - surfaceHandler.start(); + surfaceHandler->start(); if (ReactNativeFeatureFlags::enableLayoutAnimationsOnAndroid()) { - surfaceHandler.getMountingCoordinator()->setMountingOverrideDelegate( + surfaceHandler->getMountingCoordinator()->setMountingOverrideDelegate( animationDriver_); } - - { - std::unique_lock lock(surfaceHandlerRegistryMutex_); - surfaceHandlerRegistry_.emplace(surfaceId, std::move(surfaceHandler)); - } } // Used by non-bridgeless+Fabric diff --git a/packages/react-native/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp b/packages/react-native/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp index 976454fb6658..565052187030 100644 --- a/packages/react-native/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp +++ b/packages/react-native/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp @@ -23,26 +23,6 @@ SurfaceHandler::SurfaceHandler( parameters_.surfaceId = surfaceId; } -SurfaceHandler::SurfaceHandler(SurfaceHandler&& other) noexcept { - operator=(std::move(other)); -} - -SurfaceHandler& SurfaceHandler::operator=(SurfaceHandler&& other) noexcept { - std::unique_lock lock1(linkMutex_, std::defer_lock); - std::unique_lock lock2(parametersMutex_, std::defer_lock); - std::unique_lock lock3(other.linkMutex_, std::defer_lock); - std::unique_lock lock4(other.parametersMutex_, std::defer_lock); - std::lock(lock1, lock2, lock3, lock4); - - link_ = other.link_; - parameters_ = other.parameters_; - - other.link_ = Link{}; - other.parameters_ = Parameters{}; - other.parameters_.contextContainer = parameters_.contextContainer; - return *this; -} - #pragma mark - Surface Life-Cycle Management void SurfaceHandler::setContextContainer( diff --git a/packages/react-native/ReactCommon/react/renderer/scheduler/SurfaceHandler.h b/packages/react-native/ReactCommon/react/renderer/scheduler/SurfaceHandler.h index b93caa204f67..b031a51c5455 100644 --- a/packages/react-native/ReactCommon/react/renderer/scheduler/SurfaceHandler.h +++ b/packages/react-native/ReactCommon/react/renderer/scheduler/SurfaceHandler.h @@ -67,11 +67,11 @@ class SurfaceHandler { virtual ~SurfaceHandler() noexcept; /* - * Movable-only. + * Not moveable or copyable */ - SurfaceHandler(SurfaceHandler &&other) noexcept; + SurfaceHandler(SurfaceHandler &&other) noexcept = delete; SurfaceHandler(const SurfaceHandler &SurfaceHandler) noexcept = delete; - SurfaceHandler &operator=(SurfaceHandler &&other) noexcept; + SurfaceHandler &operator=(SurfaceHandler &&other) noexcept = delete; SurfaceHandler &operator=(const SurfaceHandler &other) noexcept = delete; #pragma mark - Surface Life-Cycle Management diff --git a/packages/react-native/ReactCommon/react/renderer/scheduler/SurfaceManager.cpp b/packages/react-native/ReactCommon/react/renderer/scheduler/SurfaceManager.cpp index 52e11a7c5fa5..8547f401bd43 100644 --- a/packages/react-native/ReactCommon/react/renderer/scheduler/SurfaceManager.cpp +++ b/packages/react-native/ReactCommon/react/renderer/scheduler/SurfaceManager.cpp @@ -29,9 +29,8 @@ void SurfaceManager::startSurface( const LayoutContext& layoutContext) noexcept { { std::unique_lock lock(mutex_); - auto surfaceHandler = SurfaceHandler{moduleName, surfaceId}; - surfaceHandler.setContextContainer(scheduler_.getContextContainer()); - registry_.emplace(surfaceId, std::move(surfaceHandler)); + auto [it, _] = registry_.try_emplace(surfaceId, moduleName, surfaceId); + it->second.setContextContainer(scheduler_.getContextContainer()); } visit(surfaceId, [&](const SurfaceHandler& surfaceHandler) { From 1033dbd1da013a07ee5d2a13fadeba9f38fa8426 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Wed, 5 Nov 2025 13:22:17 -0800 Subject: [PATCH 038/562] Fix Dynamic framework build and resolve circular dependency for JSC (#54421) Summary: OSS community shared with me that we have a circular dependency in React-utils.podspec that prevent them from building with JSC. While fixing it, I realized that the dynamic framework build was broken. So I fixed them both. ## Changelog: [iOS][Fixed] - Fixed build with dynamic frameworks Pull Request resolved: https://github.com/facebook/react-native/pull/54421 Test Plan: Build RNTester locally with USE_FRAMEWORKS=dynamic Reviewed By: javache Differential Revision: D86309592 Pulled By: cipolleschi fbshipit-source-id: f2995332ae135ce951480b353df7d597ff8a85ec --- .../react-native/React/CoreModules/React-CoreModules.podspec | 1 + packages/react-native/React/Runtime/React-RCTRuntime.podspec | 1 + .../react-native/ReactCommon/cxxreact/React-cxxreact.podspec | 1 + .../ReactCommon/jsiexecutor/React-jsiexecutor.podspec | 1 + .../tracing/React-jsinspectortracing.podspec | 4 ++++ .../ReactCommon/jsitooling/React-jsitooling.podspec | 1 + .../react-native/ReactCommon/react/utils/React-utils.podspec | 4 +++- 7 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/react-native/React/CoreModules/React-CoreModules.podspec b/packages/react-native/React/CoreModules/React-CoreModules.podspec index 08fbf0b9aae8..e9e095590e6e 100644 --- a/packages/react-native/React/CoreModules/React-CoreModules.podspec +++ b/packages/react-native/React/CoreModules/React-CoreModules.podspec @@ -61,6 +61,7 @@ Pod::Spec.new do |s| add_dependency(s, "React-RCTFBReactNativeSpec") add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"]) add_dependency(s, "React-NativeModulesApple") + add_dependency(s, "React-utils", :additional_framework_paths => ["react/utils/platform/ios"]) add_rn_third_party_dependencies(s) add_rncore_dependency(s) diff --git a/packages/react-native/React/Runtime/React-RCTRuntime.podspec b/packages/react-native/React/Runtime/React-RCTRuntime.podspec index ffd2ac92b266..76b745957eb5 100644 --- a/packages/react-native/React/Runtime/React-RCTRuntime.podspec +++ b/packages/react-native/React/Runtime/React-RCTRuntime.podspec @@ -56,6 +56,7 @@ Pod::Spec.new do |s| add_dependency(s, "React-RuntimeCore") add_dependency(s, "React-RuntimeApple") + add_dependency(s, "React-utils", :additional_framework_paths => ["react/utils/platform/ios"]) if use_third_party_jsc() s.exclude_files = ["RCTHermesInstanceFactory.{mm,h}", "RCTJscInstanceFactory.{mm,h}"] diff --git a/packages/react-native/ReactCommon/cxxreact/React-cxxreact.podspec b/packages/react-native/ReactCommon/cxxreact/React-cxxreact.podspec index d6282664acff..59fbcf3c593e 100644 --- a/packages/react-native/ReactCommon/cxxreact/React-cxxreact.podspec +++ b/packages/react-native/ReactCommon/cxxreact/React-cxxreact.podspec @@ -44,6 +44,7 @@ Pod::Spec.new do |s| s.dependency "React-logger", version s.dependency "React-debug", version s.dependency "React-timing", version + add_dependency(s, "React-utils", :additional_framework_paths => ["react/utils/platform/ios"]) s.resource_bundles = {'React-cxxreact_privacy' => 'PrivacyInfo.xcprivacy'} diff --git a/packages/react-native/ReactCommon/jsiexecutor/React-jsiexecutor.podspec b/packages/react-native/ReactCommon/jsiexecutor/React-jsiexecutor.podspec index fdcaa4022ac6..03497f2e1463 100644 --- a/packages/react-native/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +++ b/packages/react-native/ReactCommon/jsiexecutor/React-jsiexecutor.podspec @@ -37,6 +37,7 @@ Pod::Spec.new do |s| add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern') add_dependency(s, "React-jsinspectorcdp", :framework_name => 'jsinspector_moderncdp') add_dependency(s, "React-jsinspectortracing", :framework_name => 'jsinspector_moderntracing') + add_dependency(s, "React-utils", :additional_framework_paths => ["react/utils/platform/ios"]) if use_hermes() s.dependency 'hermes-engine' end diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/React-jsinspectortracing.podspec b/packages/react-native/ReactCommon/jsinspector-modern/tracing/React-jsinspectortracing.podspec index 41deaa712ae8..38675d367517 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/React-jsinspectortracing.podspec +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/React-jsinspectortracing.podspec @@ -48,6 +48,10 @@ Pod::Spec.new do |s| s.dependency "React-oscompat" s.dependency "React-timing" + if use_hermes() + s.dependency "hermes-engine" + end + add_rn_third_party_dependencies(s) add_rncore_dependency(s) end diff --git a/packages/react-native/ReactCommon/jsitooling/React-jsitooling.podspec b/packages/react-native/ReactCommon/jsitooling/React-jsitooling.podspec index 49c1dcd83156..dc005f8c4200 100644 --- a/packages/react-native/ReactCommon/jsitooling/React-jsitooling.podspec +++ b/packages/react-native/ReactCommon/jsitooling/React-jsitooling.podspec @@ -42,6 +42,7 @@ Pod::Spec.new do |s| add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern') add_dependency(s, "React-jsinspectorcdp", :framework_name => 'jsinspector_moderncdp') add_dependency(s, "React-jsinspectortracing", :framework_name => 'jsinspector_moderntracing') + add_dependency(s, "React-utils", :additional_framework_paths => ["react/utils/platform/ios"]) add_rn_third_party_dependencies(s) add_rncore_dependency(s) diff --git a/packages/react-native/ReactCommon/react/utils/React-utils.podspec b/packages/react-native/ReactCommon/react/utils/React-utils.podspec index d3061f63bb06..1a939b49cb28 100644 --- a/packages/react-native/ReactCommon/react/utils/React-utils.podspec +++ b/packages/react-native/ReactCommon/react/utils/React-utils.podspec @@ -47,7 +47,9 @@ Pod::Spec.new do |s| s.dependency "React-jsi", version - depend_on_js_engine(s) + if use_hermes() + s.dependency "hermes-engine" + end add_rn_third_party_dependencies(s) add_rncore_dependency(s) From de5141a3df538e862e75f41342f451413b530177 Mon Sep 17 00:00:00 2001 From: Devan Buggay Date: Wed, 5 Nov 2025 16:53:51 -0800 Subject: [PATCH 039/562] Clean up stale QE rn_arch_android:use_optimized_event_batching_android (#54417) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54417 Remove feature rn_arch_android:use_optimized_event_batching_android flag. Changelog: [internal] Reviewed By: javache Differential Revision: D86131089 fbshipit-source-id: 8ac81bc97a97071fc9fbf1f32ebda081d76db575 --- .../featureflags/ReactNativeFeatureFlags.kt | 8 +--- .../ReactNativeFeatureFlagsCxxAccessor.kt | 12 +----- .../ReactNativeFeatureFlagsCxxInterop.kt | 4 +- .../ReactNativeFeatureFlagsDefaults.kt | 4 +- .../ReactNativeFeatureFlagsLocalAccessor.kt | 13 +------ .../ReactNativeFeatureFlagsProvider.kt | 4 +- .../uimanager/events/FabricEventDispatcher.kt | 39 ++----------------- .../JReactNativeFeatureFlagsCxxInterop.cpp | 16 +------- .../JReactNativeFeatureFlagsCxxInterop.h | 5 +-- .../featureflags/ReactNativeFeatureFlags.cpp | 6 +-- .../featureflags/ReactNativeFeatureFlags.h | 7 +--- .../ReactNativeFeatureFlagsAccessor.cpp | 38 +++++------------- .../ReactNativeFeatureFlagsAccessor.h | 6 +-- .../ReactNativeFeatureFlagsDefaults.h | 6 +-- .../ReactNativeFeatureFlagsDynamicProvider.h | 11 +----- .../ReactNativeFeatureFlagsProvider.h | 3 +- .../NativeReactNativeFeatureFlags.cpp | 7 +--- .../NativeReactNativeFeatureFlags.h | 4 +- .../ReactNativeFeatureFlags.config.js | 11 ------ .../featureflags/ReactNativeFeatureFlags.js | 7 +--- .../specs/NativeReactNativeFeatureFlags.js | 3 +- 21 files changed, 32 insertions(+), 182 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt index 64d9a66bae33..29bf8fb06bdd 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<66a87f8b82a1b3497eb9181a4ac6bab7>> + * @generated SignedSource<<9646ebeba75ec903be5ade7e2333f0c8>> */ /** @@ -468,12 +468,6 @@ public object ReactNativeFeatureFlags { @JvmStatic public fun useNativeViewConfigsInBridgelessMode(): Boolean = accessor.useNativeViewConfigsInBridgelessMode() - /** - * Uses an optimized mechanism for event batching on Android that does not need to wait for a Choreographer frame callback. - */ - @JvmStatic - public fun useOptimizedEventBatchingOnAndroid(): Boolean = accessor.useOptimizedEventBatchingOnAndroid() - /** * Instead of using folly::dynamic as internal representation in RawProps and RawValue, use jsi::Value */ diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt index 9acd97571f71..ec42740a8754 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5112bb2a180751673d4197088af9fdd1>> + * @generated SignedSource<<9d6ccbe6d02608901fc18ad88baab176>> */ /** @@ -93,7 +93,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces private var useNativeEqualsInNativeReadableArrayAndroidCache: Boolean? = null private var useNativeTransformHelperAndroidCache: Boolean? = null private var useNativeViewConfigsInBridgelessModeCache: Boolean? = null - private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null private var useRawPropsJsiValueCache: Boolean? = null private var useShadowNodeStateOnCloneCache: Boolean? = null private var useSharedAnimatedBackendCache: Boolean? = null @@ -761,15 +760,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces return cached } - override fun useOptimizedEventBatchingOnAndroid(): Boolean { - var cached = useOptimizedEventBatchingOnAndroidCache - if (cached == null) { - cached = ReactNativeFeatureFlagsCxxInterop.useOptimizedEventBatchingOnAndroid() - useOptimizedEventBatchingOnAndroidCache = cached - } - return cached - } - override fun useRawPropsJsiValue(): Boolean { var cached = useRawPropsJsiValueCache if (cached == null) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt index 95d3a9173a7e..d49354281fdd 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> */ /** @@ -174,8 +174,6 @@ public object ReactNativeFeatureFlagsCxxInterop { @DoNotStrip @JvmStatic public external fun useNativeViewConfigsInBridgelessMode(): Boolean - @DoNotStrip @JvmStatic public external fun useOptimizedEventBatchingOnAndroid(): Boolean - @DoNotStrip @JvmStatic public external fun useRawPropsJsiValue(): Boolean @DoNotStrip @JvmStatic public external fun useShadowNodeStateOnClone(): Boolean diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt index 41ef0bd821b4..fdd3b815149e 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<32ad8dfa8f1c1d662ff0ea7b424eb070>> + * @generated SignedSource<<7b8a5ad9a3353ea32a39bd139e9174f7>> */ /** @@ -169,8 +169,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi override fun useNativeViewConfigsInBridgelessMode(): Boolean = false - override fun useOptimizedEventBatchingOnAndroid(): Boolean = false - override fun useRawPropsJsiValue(): Boolean = true override fun useShadowNodeStateOnClone(): Boolean = false diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt index 6028c97c5038..ec66c76e0c87 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<9bb9a7cf89c92f5a397b2328fa983dc6>> */ /** @@ -97,7 +97,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc private var useNativeEqualsInNativeReadableArrayAndroidCache: Boolean? = null private var useNativeTransformHelperAndroidCache: Boolean? = null private var useNativeViewConfigsInBridgelessModeCache: Boolean? = null - private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null private var useRawPropsJsiValueCache: Boolean? = null private var useShadowNodeStateOnCloneCache: Boolean? = null private var useSharedAnimatedBackendCache: Boolean? = null @@ -838,16 +837,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc return cached } - override fun useOptimizedEventBatchingOnAndroid(): Boolean { - var cached = useOptimizedEventBatchingOnAndroidCache - if (cached == null) { - cached = currentProvider.useOptimizedEventBatchingOnAndroid() - accessedFeatureFlags.add("useOptimizedEventBatchingOnAndroid") - useOptimizedEventBatchingOnAndroidCache = cached - } - return cached - } - override fun useRawPropsJsiValue(): Boolean { var cached = useRawPropsJsiValueCache if (cached == null) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt index 7c23983138b4..cd76bc3df19c 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> */ /** @@ -169,8 +169,6 @@ public interface ReactNativeFeatureFlagsProvider { @DoNotStrip public fun useNativeViewConfigsInBridgelessMode(): Boolean - @DoNotStrip public fun useOptimizedEventBatchingOnAndroid(): Boolean - @DoNotStrip public fun useRawPropsJsiValue(): Boolean @DoNotStrip public fun useShadowNodeStateOnClone(): Boolean diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FabricEventDispatcher.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FabricEventDispatcher.kt index 8380092e7ccb..7c2e43fc5699 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FabricEventDispatcher.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FabricEventDispatcher.kt @@ -7,14 +7,12 @@ package com.facebook.react.uimanager.events -import android.os.Handler import android.view.Choreographer import com.facebook.react.bridge.LifecycleEventListener import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridge.ReactSoftExceptionLogger import com.facebook.react.bridge.UiThreadUtil import com.facebook.react.common.annotations.UnstableReactNativeAPI -import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags import com.facebook.react.modules.core.ReactChoreographer import com.facebook.react.uimanager.UIManagerHelper import com.facebook.react.uimanager.common.UIManagerType @@ -41,19 +39,6 @@ internal class FabricEventDispatcher( private val postEventDispatchListeners = CopyOnWriteArrayList() private val currentFrameCallback = ScheduleDispatchFrameCallback() - private var isDispatchScheduled = false - private val dispatchEventsRunnable = Runnable { - isDispatchScheduled = false - Systrace.beginSection(Systrace.TRACE_TAG_REACT, "BatchEventDispatchedListeners") - try { - for (listener in postEventDispatchListeners) { - listener.onBatchEventDispatched() - } - } finally { - Systrace.endSection(Systrace.TRACE_TAG_REACT) - } - } - init { reactContext.addLifecycleEventListener(this) eventEmitter.registerFabricEventEmitter(fabricEventEmitter) @@ -109,14 +94,7 @@ internal class FabricEventDispatcher( } private fun scheduleDispatchOfBatchedEvents() { - if (ReactNativeFeatureFlags.useOptimizedEventBatchingOnAndroid()) { - if (!isDispatchScheduled) { - isDispatchScheduled = true - uiThreadHandler.postAtFrontOfQueue(dispatchEventsRunnable) - } - } else { - currentFrameCallback.maybeScheduleDispatchOfBatchedEvents() - } + currentFrameCallback.maybeScheduleDispatchOfBatchedEvents() } /** Add a listener to this EventDispatcher. */ @@ -139,9 +117,7 @@ internal class FabricEventDispatcher( override fun onHostResume() { scheduleDispatchOfBatchedEvents() - if (!ReactNativeFeatureFlags.useOptimizedEventBatchingOnAndroid()) { - currentFrameCallback.resume() - } + currentFrameCallback.resume() } override fun onHostPause() { @@ -165,12 +141,7 @@ internal class FabricEventDispatcher( private fun cancelDispatchOfBatchedEvents() { UiThreadUtil.assertOnUiThread() - if (ReactNativeFeatureFlags.useOptimizedEventBatchingOnAndroid()) { - isDispatchScheduled = false - uiThreadHandler.removeCallbacks(dispatchEventsRunnable) - } else { - currentFrameCallback.stop() - } + currentFrameCallback.stop() } private inner class ScheduleDispatchFrameCallback : Choreographer.FrameCallback { @@ -229,8 +200,4 @@ internal class FabricEventDispatcher( } } } - - private companion object { - private val uiThreadHandler: Handler = UiThreadUtil.getUiThreadHandler() - } } diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp index 220807e3fd24..df06cc588264 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<0527dbb4a838be34b80d76b11d18cea0>> */ /** @@ -477,12 +477,6 @@ class ReactNativeFeatureFlagsJavaProvider return method(javaProvider_); } - bool useOptimizedEventBatchingOnAndroid() override { - static const auto method = - getReactNativeFeatureFlagsProviderJavaClass()->getMethod("useOptimizedEventBatchingOnAndroid"); - return method(javaProvider_); - } - bool useRawPropsJsiValue() override { static const auto method = getReactNativeFeatureFlagsProviderJavaClass()->getMethod("useRawPropsJsiValue"); @@ -906,11 +900,6 @@ bool JReactNativeFeatureFlagsCxxInterop::useNativeViewConfigsInBridgelessMode( return ReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode(); } -bool JReactNativeFeatureFlagsCxxInterop::useOptimizedEventBatchingOnAndroid( - facebook::jni::alias_ref /*unused*/) { - return ReactNativeFeatureFlags::useOptimizedEventBatchingOnAndroid(); -} - bool JReactNativeFeatureFlagsCxxInterop::useRawPropsJsiValue( facebook::jni::alias_ref /*unused*/) { return ReactNativeFeatureFlags::useRawPropsJsiValue(); @@ -1206,9 +1195,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() { makeNativeMethod( "useNativeViewConfigsInBridgelessMode", JReactNativeFeatureFlagsCxxInterop::useNativeViewConfigsInBridgelessMode), - makeNativeMethod( - "useOptimizedEventBatchingOnAndroid", - JReactNativeFeatureFlagsCxxInterop::useOptimizedEventBatchingOnAndroid), makeNativeMethod( "useRawPropsJsiValue", JReactNativeFeatureFlagsCxxInterop::useRawPropsJsiValue), diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h index b6cb81ed6250..64a4b5ec585d 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +++ b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<1e735f99b2d275f5065fb7959e45adc5>> + * @generated SignedSource<> */ /** @@ -249,9 +249,6 @@ class JReactNativeFeatureFlagsCxxInterop static bool useNativeViewConfigsInBridgelessMode( facebook::jni::alias_ref); - static bool useOptimizedEventBatchingOnAndroid( - facebook::jni::alias_ref); - static bool useRawPropsJsiValue( facebook::jni::alias_ref); diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp index b6b5724c2729..c3adaa661754 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5a7c80b50fda63afb95e8c6f4651eebc>> + * @generated SignedSource<> */ /** @@ -318,10 +318,6 @@ bool ReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode() { return getAccessor().useNativeViewConfigsInBridgelessMode(); } -bool ReactNativeFeatureFlags::useOptimizedEventBatchingOnAndroid() { - return getAccessor().useOptimizedEventBatchingOnAndroid(); -} - bool ReactNativeFeatureFlags::useRawPropsJsiValue() { return getAccessor().useRawPropsJsiValue(); } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h index f8bb4c8b49cc..5a46288842e9 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8122e5c1e177a8f3deb2462a86f7cf64>> + * @generated SignedSource<<467f48f2231ceb6772a9a9da9e3badb9>> */ /** @@ -404,11 +404,6 @@ class ReactNativeFeatureFlags { */ RN_EXPORT static bool useNativeViewConfigsInBridgelessMode(); - /** - * Uses an optimized mechanism for event batching on Android that does not need to wait for a Choreographer frame callback. - */ - RN_EXPORT static bool useOptimizedEventBatchingOnAndroid(); - /** * Instead of using folly::dynamic as internal representation in RawProps and RawValue, use jsi::Value */ diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp index e79f9912c3f1..7093ce280a74 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<8f6640b5dc86a3f50b14ba9d222de89c>> */ /** @@ -1343,24 +1343,6 @@ bool ReactNativeFeatureFlagsAccessor::useNativeViewConfigsInBridgelessMode() { return flagValue.value(); } -bool ReactNativeFeatureFlagsAccessor::useOptimizedEventBatchingOnAndroid() { - auto flagValue = useOptimizedEventBatchingOnAndroid_.load(); - - if (!flagValue.has_value()) { - // This block is not exclusive but it is not necessary. - // If multiple threads try to initialize the feature flag, we would only - // be accessing the provider multiple times but the end state of this - // instance and the returned flag value would be the same. - - markFlagAsAccessed(73, "useOptimizedEventBatchingOnAndroid"); - - flagValue = currentProvider_->useOptimizedEventBatchingOnAndroid(); - useOptimizedEventBatchingOnAndroid_ = flagValue; - } - - return flagValue.value(); -} - bool ReactNativeFeatureFlagsAccessor::useRawPropsJsiValue() { auto flagValue = useRawPropsJsiValue_.load(); @@ -1370,7 +1352,7 @@ bool ReactNativeFeatureFlagsAccessor::useRawPropsJsiValue() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(74, "useRawPropsJsiValue"); + markFlagAsAccessed(73, "useRawPropsJsiValue"); flagValue = currentProvider_->useRawPropsJsiValue(); useRawPropsJsiValue_ = flagValue; @@ -1388,7 +1370,7 @@ bool ReactNativeFeatureFlagsAccessor::useShadowNodeStateOnClone() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(75, "useShadowNodeStateOnClone"); + markFlagAsAccessed(74, "useShadowNodeStateOnClone"); flagValue = currentProvider_->useShadowNodeStateOnClone(); useShadowNodeStateOnClone_ = flagValue; @@ -1406,7 +1388,7 @@ bool ReactNativeFeatureFlagsAccessor::useSharedAnimatedBackend() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(76, "useSharedAnimatedBackend"); + markFlagAsAccessed(75, "useSharedAnimatedBackend"); flagValue = currentProvider_->useSharedAnimatedBackend(); useSharedAnimatedBackend_ = flagValue; @@ -1424,7 +1406,7 @@ bool ReactNativeFeatureFlagsAccessor::useTraitHiddenOnAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(77, "useTraitHiddenOnAndroid"); + markFlagAsAccessed(76, "useTraitHiddenOnAndroid"); flagValue = currentProvider_->useTraitHiddenOnAndroid(); useTraitHiddenOnAndroid_ = flagValue; @@ -1442,7 +1424,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(78, "useTurboModuleInterop"); + markFlagAsAccessed(77, "useTurboModuleInterop"); flagValue = currentProvider_->useTurboModuleInterop(); useTurboModuleInterop_ = flagValue; @@ -1460,7 +1442,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModules() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(79, "useTurboModules"); + markFlagAsAccessed(78, "useTurboModules"); flagValue = currentProvider_->useTurboModules(); useTurboModules_ = flagValue; @@ -1478,7 +1460,7 @@ double ReactNativeFeatureFlagsAccessor::viewCullingOutsetRatio() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(80, "viewCullingOutsetRatio"); + markFlagAsAccessed(79, "viewCullingOutsetRatio"); flagValue = currentProvider_->viewCullingOutsetRatio(); viewCullingOutsetRatio_ = flagValue; @@ -1496,7 +1478,7 @@ double ReactNativeFeatureFlagsAccessor::virtualViewHysteresisRatio() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(81, "virtualViewHysteresisRatio"); + markFlagAsAccessed(80, "virtualViewHysteresisRatio"); flagValue = currentProvider_->virtualViewHysteresisRatio(); virtualViewHysteresisRatio_ = flagValue; @@ -1514,7 +1496,7 @@ double ReactNativeFeatureFlagsAccessor::virtualViewPrerenderRatio() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(82, "virtualViewPrerenderRatio"); + markFlagAsAccessed(81, "virtualViewPrerenderRatio"); flagValue = currentProvider_->virtualViewPrerenderRatio(); virtualViewPrerenderRatio_ = flagValue; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h index cc1e6e79a02e..b626cc49c70c 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> */ /** @@ -105,7 +105,6 @@ class ReactNativeFeatureFlagsAccessor { bool useNativeEqualsInNativeReadableArrayAndroid(); bool useNativeTransformHelperAndroid(); bool useNativeViewConfigsInBridgelessMode(); - bool useOptimizedEventBatchingOnAndroid(); bool useRawPropsJsiValue(); bool useShadowNodeStateOnClone(); bool useSharedAnimatedBackend(); @@ -126,7 +125,7 @@ class ReactNativeFeatureFlagsAccessor { std::unique_ptr currentProvider_; bool wasOverridden_; - std::array, 83> accessedFeatureFlags_; + std::array, 82> accessedFeatureFlags_; std::atomic> commonTestFlag_; std::atomic> cdpInteractionMetricsEnabled_; @@ -201,7 +200,6 @@ class ReactNativeFeatureFlagsAccessor { std::atomic> useNativeEqualsInNativeReadableArrayAndroid_; std::atomic> useNativeTransformHelperAndroid_; std::atomic> useNativeViewConfigsInBridgelessMode_; - std::atomic> useOptimizedEventBatchingOnAndroid_; std::atomic> useRawPropsJsiValue_; std::atomic> useShadowNodeStateOnClone_; std::atomic> useSharedAnimatedBackend_; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h index d2de2e204ac0..32aecdc212e3 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<4e4623461411b957286ef050ec0c4f6f>> + * @generated SignedSource<<85c260dcb8eb9209a53207c3c54183f0>> */ /** @@ -319,10 +319,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider { return false; } - bool useOptimizedEventBatchingOnAndroid() override { - return false; - } - bool useRawPropsJsiValue() override { return true; } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h index 5731aa38e58b..34ce8c68d0c7 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<0224a638fbec556a62c58f5d84c4c662>> */ /** @@ -702,15 +702,6 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef return ReactNativeFeatureFlagsDefaults::useNativeViewConfigsInBridgelessMode(); } - bool useOptimizedEventBatchingOnAndroid() override { - auto value = values_["useOptimizedEventBatchingOnAndroid"]; - if (!value.isNull()) { - return value.getBool(); - } - - return ReactNativeFeatureFlagsDefaults::useOptimizedEventBatchingOnAndroid(); - } - bool useRawPropsJsiValue() override { auto value = values_["useRawPropsJsiValue"]; if (!value.isNull()) { diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h index 0b0d28f10150..f2dcc71af4ec 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5dbb5d1dd34c8bdd887de68a074449b6>> + * @generated SignedSource<> */ /** @@ -98,7 +98,6 @@ class ReactNativeFeatureFlagsProvider { virtual bool useNativeEqualsInNativeReadableArrayAndroid() = 0; virtual bool useNativeTransformHelperAndroid() = 0; virtual bool useNativeViewConfigsInBridgelessMode() = 0; - virtual bool useOptimizedEventBatchingOnAndroid() = 0; virtual bool useRawPropsJsiValue() = 0; virtual bool useShadowNodeStateOnClone() = 0; virtual bool useSharedAnimatedBackend() = 0; diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp index e566c70eb868..05c867b7f714 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +++ b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5963824c70d97cf048050db905350692>> + * @generated SignedSource<> */ /** @@ -409,11 +409,6 @@ bool NativeReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode( return ReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode(); } -bool NativeReactNativeFeatureFlags::useOptimizedEventBatchingOnAndroid( - jsi::Runtime& /*runtime*/) { - return ReactNativeFeatureFlags::useOptimizedEventBatchingOnAndroid(); -} - bool NativeReactNativeFeatureFlags::useRawPropsJsiValue( jsi::Runtime& /*runtime*/) { return ReactNativeFeatureFlags::useRawPropsJsiValue(); diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h index d4da9a5798fa..cd406e004de4 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +++ b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<84b5ef5e3ada0d6f2b10abfffa6d9d0f>> + * @generated SignedSource<<0d898a94decb43e191a343676c8afb91>> */ /** @@ -182,8 +182,6 @@ class NativeReactNativeFeatureFlags bool useNativeViewConfigsInBridgelessMode(jsi::Runtime& runtime); - bool useOptimizedEventBatchingOnAndroid(jsi::Runtime& runtime); - bool useRawPropsJsiValue(jsi::Runtime& runtime); bool useShadowNodeStateOnClone(jsi::Runtime& runtime); diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index 4db09968a1f1..6388b73719a7 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -825,17 +825,6 @@ const definitions: FeatureFlagDefinitions = { }, ossReleaseStage: 'canary', }, - useOptimizedEventBatchingOnAndroid: { - defaultValue: false, - metadata: { - dateAdded: '2024-08-29', - description: - 'Uses an optimized mechanism for event batching on Android that does not need to wait for a Choreographer frame callback.', - expectedReleaseValue: true, - purpose: 'experimentation', - }, - ossReleaseStage: 'none', - }, useRawPropsJsiValue: { defaultValue: true, metadata: { diff --git a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js index 04a9285046bd..aa7c52f4a1b2 100644 --- a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<954a37442d8c691f35c868b9998a5aa3>> + * @generated SignedSource<> * @flow strict * @noformat */ @@ -123,7 +123,6 @@ export type ReactNativeFeatureFlags = $ReadOnly<{ useNativeEqualsInNativeReadableArrayAndroid: Getter, useNativeTransformHelperAndroid: Getter, useNativeViewConfigsInBridgelessMode: Getter, - useOptimizedEventBatchingOnAndroid: Getter, useRawPropsJsiValue: Getter, useShadowNodeStateOnClone: Getter, useSharedAnimatedBackend: Getter, @@ -506,10 +505,6 @@ export const useNativeTransformHelperAndroid: Getter = createNativeFlag * When enabled, the native view configs are used in bridgeless mode. */ export const useNativeViewConfigsInBridgelessMode: Getter = createNativeFlagGetter('useNativeViewConfigsInBridgelessMode', false); -/** - * Uses an optimized mechanism for event batching on Android that does not need to wait for a Choreographer frame callback. - */ -export const useOptimizedEventBatchingOnAndroid: Getter = createNativeFlagGetter('useOptimizedEventBatchingOnAndroid', false); /** * Instead of using folly::dynamic as internal representation in RawProps and RawValue, use jsi::Value */ diff --git a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js index c60064de83dd..218586e3e244 100644 --- a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<05001c6fab50172dc659d30b5e82af20>> + * @generated SignedSource<<53fc9aca82f76eb0519b03187993359a>> * @flow strict * @noformat */ @@ -98,7 +98,6 @@ export interface Spec extends TurboModule { +useNativeEqualsInNativeReadableArrayAndroid?: () => boolean; +useNativeTransformHelperAndroid?: () => boolean; +useNativeViewConfigsInBridgelessMode?: () => boolean; - +useOptimizedEventBatchingOnAndroid?: () => boolean; +useRawPropsJsiValue?: () => boolean; +useShadowNodeStateOnClone?: () => boolean; +useSharedAnimatedBackend?: () => boolean; From c726c27537d5fe81f3eeeef9a181888fcf1bb2c1 Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Thu, 6 Nov 2025 00:51:16 -0800 Subject: [PATCH 040/562] Remove CxxModule support from CatalystInstance (#54269) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54269 Changelog: [General][Breaking] Remove CxxModule support from CatalystInstance Reviewed By: javache Differential Revision: D85458376 fbshipit-source-id: 11fa38b5058e5654d3d6e1eda3bc2ceaba0c91ec --- .../facebook/react/bridge/CatalystInstanceImpl.java | 8 ++------ .../src/main/jni/react/jni/CatalystInstanceImpl.cpp | 10 +++------- .../src/main/jni/react/jni/CatalystInstanceImpl.h | 5 +---- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java index 6a15edf67709..f3e799d14178 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java @@ -157,7 +157,6 @@ private CatalystInstanceImpl( mReactQueueConfiguration.getJSQueueThread(), mNativeModulesQueueThread, mNativeModuleRegistry.getJavaModules(this), - mNativeModuleRegistry.getCxxModules(), mInspectorTarget); FLog.d(ReactConstants.TAG, "Initializing React Xplat Bridge after initializeBridge"); Systrace.endSection(TRACE_TAG_REACT); @@ -212,13 +211,11 @@ public void extendNativeModules(NativeModuleRegistry modules) { // Extend the Java-visible registry of modules mNativeModuleRegistry.registerModules(modules); Collection javaModules = modules.getJavaModules(this); - Collection cxxModules = modules.getCxxModules(); // Extend the Cxx-visible registry of modules wrapped in appropriate interfaces - jniExtendNativeModules(javaModules, cxxModules); + jniExtendNativeModules(javaModules); } - private native void jniExtendNativeModules( - Collection javaModules, Collection cxxModules); + private native void jniExtendNativeModules(Collection javaModules); private native void initializeBridge( InstanceCallback callback, @@ -226,7 +223,6 @@ private native void initializeBridge( MessageQueueThread jsQueue, MessageQueueThread moduleQueue, Collection javaModules, - Collection cxxModules, @Nullable ReactInstanceManagerInspectorTarget inspectorTarget); @Override diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp index cc618247533c..4bf4824d88b7 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp @@ -164,8 +164,6 @@ void CatalystInstanceImpl::initializeBridge( jni::alias_ref nativeModulesQueue, jni::alias_ref::javaobject> javaModules, - jni::alias_ref::javaobject> - cxxModules, jni::alias_ref inspectorTarget) { set_react_native_logfunc(&log); @@ -196,7 +194,7 @@ void CatalystInstanceImpl::initializeBridge( moduleRegistry_ = std::make_shared(buildNativeModuleList( std::weak_ptr(instance_), javaModules, - cxxModules, + {}, moduleMessageQueue_)); instance_->initializeBridge( @@ -211,13 +209,11 @@ void CatalystInstanceImpl::initializeBridge( void CatalystInstanceImpl::extendNativeModules( jni::alias_ref::javaobject> - javaModules, - jni::alias_ref::javaobject> - cxxModules) { + javaModules) { moduleRegistry_->registerModules(buildNativeModuleList( std::weak_ptr(instance_), javaModules, - cxxModules, + {}, moduleMessageQueue_)); } diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h b/packages/react-native/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h index 2993161ac7ac..1e302b1b707a 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h +++ b/packages/react-native/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h @@ -60,12 +60,9 @@ class [[deprecated("This API will be removed along with the legacy architecture. jni::alias_ref jsQueue, jni::alias_ref nativeModulesQueue, jni::alias_ref::javaobject> javaModules, - jni::alias_ref::javaobject> cxxModules, jni::alias_ref inspectorTarget); - void extendNativeModules( - jni::alias_ref::javaobject> javaModules, - jni::alias_ref::javaobject> cxxModules); + void extendNativeModules(jni::alias_ref::javaobject> javaModules); /** * Sets the source URL of the underlying bridge without loading any JS code. From bc6fbfb0a8b3d4e065e72e6d28d0ccbb0447363e Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Thu, 6 Nov 2025 04:25:36 -0800 Subject: [PATCH 041/562] Change visibility of tracing methods for RuntimeTarget (#54281) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54281 # Changelog: [Internal] This is not used, nor required. The controller is the canonical way of using targets. Reviewed By: huntie Differential Revision: D85440639 fbshipit-source-id: 81702fed06a74dfa54b45689e7e304f63e4dd903 --- .../jsinspector-modern/RuntimeTarget.h | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTarget.h b/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTarget.h index 236cf83e7de3..a2598d026f83 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTarget.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTarget.h @@ -207,19 +207,6 @@ class JSINSPECTOR_EXPORT RuntimeTarget : public EnableExecutorFromThis createTracingAgent(tracing::TraceRecordingState &state); - /** - * Start sampling profiler for a particular JavaScript runtime. - */ - void enableSamplingProfiler(); - /** - * Stop sampling profiler for a particular JavaScript runtime. - */ - void disableSamplingProfiler(); - /** - * Return recorded sampling profile for the previous sampling session. - */ - tracing::RuntimeSamplingProfile collectSamplingProfile(); - private: using Domain = RuntimeTargetController::Domain; @@ -275,6 +262,18 @@ class JSINSPECTOR_EXPORT RuntimeTarget : public EnableExecutorFromThis tracingAgent_; + /** + * Start sampling profiler for a particular JavaScript runtime. + */ + void enableSamplingProfiler(); + /** + * Stop sampling profiler for a particular JavaScript runtime. + */ + void disableSamplingProfiler(); + /** + * Return recorded sampling profile for the previous sampling session. + */ + tracing::RuntimeSamplingProfile collectSamplingProfile(); /** * Adds a function with the given name on the runtime's global object, that From f1f69462fde2d39add2fdbed2693163a3333b18f Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Thu, 6 Nov 2025 04:25:36 -0800 Subject: [PATCH 042/562] Expose a public getter on a TracingAgent for background mode (#54282) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54282 # Changelog: [Internal] It is already in a tracing session state, we are going to use it in RuntimeTarget. Reviewed By: huntie Differential Revision: D85440638 fbshipit-source-id: 34e9a485b2701580f6ceef4262537a5a428dfcee --- .../ReactCommon/jsinspector-modern/RuntimeAgent.h | 2 +- .../jsinspector-modern/tracing/TargetTracingAgent.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactCommon/jsinspector-modern/RuntimeAgent.h b/packages/react-native/ReactCommon/jsinspector-modern/RuntimeAgent.h index 7e0b62b442e7..74d5c935a571 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/RuntimeAgent.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/RuntimeAgent.h @@ -99,7 +99,7 @@ class RuntimeAgent final { * Lifetime of this agent is bound to the lifetime of the Tracing session - * HostTargetTraceRecording and to the lifetime of the RuntimeTarget. */ -class RuntimeTracingAgent : tracing::TargetTracingAgent { +class RuntimeTracingAgent : public tracing::TargetTracingAgent { public: explicit RuntimeTracingAgent(tracing::TraceRecordingState &state, RuntimeTargetController &targetController); diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/TargetTracingAgent.h b/packages/react-native/ReactCommon/jsinspector-modern/tracing/TargetTracingAgent.h index f92ffe7b2631..a1a1260c6494 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/TargetTracingAgent.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/TargetTracingAgent.h @@ -27,6 +27,11 @@ class TargetTracingAgent { (void)state_; } + bool isRunningInBackgroundMode() + { + return state_.mode == tracing::Mode::Background; + } + protected: TraceRecordingState &state_; }; From 72834e6326849c7820911d26407fe65e264f0d32 Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Thu, 6 Nov 2025 04:25:36 -0800 Subject: [PATCH 043/562] Add a getter for enabling console.createTask (#54283) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54283 # Changelog: [Internal] This will control scenarios when we enable `console.createTask` implementation, and when we just use the stub version. Reviewed By: huntie Differential Revision: D85440641 fbshipit-source-id: 61b36a2452c2c656be2865defda25eb472c64d4c --- .../ReactCommon/jsinspector-modern/RuntimeTarget.cpp | 12 ++++++++++++ .../ReactCommon/jsinspector-modern/RuntimeTarget.h | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTarget.cpp b/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTarget.cpp index 0f84ecd0e179..2fe2f51552bc 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTarget.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTarget.cpp @@ -248,6 +248,18 @@ bool RuntimeTarget::isDomainEnabled(Domain domain) const { return threadSafeDomainStatus_[domain]; } +bool RuntimeTarget::isConsoleCreateTaskEnabled() const { + if (isDomainEnabled(Domain::Runtime)) { + return true; + } + + if (auto tracingAgent = tracingAgent_.lock()) { + return tracingAgent->isRunningInBackgroundMode(); + } + + return false; +} + RuntimeTargetController::RuntimeTargetController(RuntimeTarget& target) : target_(target) {} diff --git a/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTarget.h b/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTarget.h index a2598d026f83..7312baac0dbc 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTarget.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTarget.h @@ -292,6 +292,10 @@ class JSINSPECTOR_EXPORT RuntimeTarget : public EnableExecutorFromThis Date: Thu, 6 Nov 2025 04:25:36 -0800 Subject: [PATCH 044/562] Define main entities (#54334) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54334 # Changelog: [Internal] This defines the main entities for the console.createTask(): - ConsoleTaskOrchestrator: global stack that can be used as a source of pending tasks. - ConsoleTaskContext: RAII object, captures the context for a specific task. Lifetime is bound to the lifetime of the task object in JavaScript. - ConsoleTask: RAII-like object. Initialized only during the callback run of `task.run(...)`. I couldn't find a better way to solve this without having a static singleton. Native modules don't have access to ReactInstance object, so we won't be able to access this global stack from `performance.measure` implementation, for example. Not using the word `async` anywhere in the naming, because the current implementation doesn't support async stack traces. Reviewed By: sbuggay Differential Revision: D85481864 fbshipit-source-id: 4a0b317cccb8c2492647f06472b00fc0daa2c8a3 --- .../jsinspector-modern/ConsoleTask.cpp | 27 +++++ .../jsinspector-modern/ConsoleTask.h | 38 +++++++ .../jsinspector-modern/ConsoleTaskContext.cpp | 57 ++++++++++ .../jsinspector-modern/ConsoleTaskContext.h | 107 ++++++++++++++++++ .../ConsoleTaskOrchestrator.cpp | 55 +++++++++ .../ConsoleTaskOrchestrator.h | 48 ++++++++ 6 files changed, 332 insertions(+) create mode 100644 packages/react-native/ReactCommon/jsinspector-modern/ConsoleTask.cpp create mode 100644 packages/react-native/ReactCommon/jsinspector-modern/ConsoleTask.h create mode 100644 packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskContext.cpp create mode 100644 packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskContext.h create mode 100644 packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskOrchestrator.cpp create mode 100644 packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskOrchestrator.h diff --git a/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTask.cpp b/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTask.cpp new file mode 100644 index 000000000000..371d628f9689 --- /dev/null +++ b/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTask.cpp @@ -0,0 +1,27 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#include "ConsoleTask.h" +#include "ConsoleTaskOrchestrator.h" + +namespace facebook::react::jsinspector_modern { + +ConsoleTask::ConsoleTask(std::shared_ptr taskContext) + : taskContext_(std::move(taskContext)), + orchestrator_(ConsoleTaskOrchestrator::getInstance()) { + if (taskContext_) { + orchestrator_.startTask(taskContext_->id()); + } +} + +ConsoleTask::~ConsoleTask() { + if (taskContext_) { + orchestrator_.finishTask(taskContext_->id()); + } +} + +} // namespace facebook::react::jsinspector_modern diff --git a/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTask.h b/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTask.h new file mode 100644 index 000000000000..599396ca614f --- /dev/null +++ b/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTask.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include + +namespace facebook::react::jsinspector_modern { + +class ConsoleTaskContext; +class RuntimeTargetDelegate; +class ConsoleTaskOrchestrator; + +class ConsoleTask { + public: + /** + * \param runtimeTargetDelegate The delegate to the corresponding runtime. + * \param taskContext The context that tracks the task. + */ + explicit ConsoleTask(std::shared_ptr taskContext); + ~ConsoleTask(); + + ConsoleTask(const ConsoleTask &) = default; + ConsoleTask &operator=(const ConsoleTask &) = delete; + + ConsoleTask(ConsoleTask &&) = default; + ConsoleTask &operator=(ConsoleTask &&) = delete; + + private: + std::shared_ptr taskContext_; + ConsoleTaskOrchestrator &orchestrator_; +}; + +} // namespace facebook::react::jsinspector_modern diff --git a/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskContext.cpp b/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskContext.cpp new file mode 100644 index 000000000000..53ba29297836 --- /dev/null +++ b/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskContext.cpp @@ -0,0 +1,57 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#include "ConsoleTaskContext.h" +#include "ConsoleTaskOrchestrator.h" +#include "RuntimeTarget.h" + +namespace facebook::react::jsinspector_modern { + +ConsoleTaskContext::ConsoleTaskContext( + jsi::Runtime& runtime, + RuntimeTargetDelegate& runtimeTargetDelegate, + std::string name) + : runtimeTargetDelegate_(runtimeTargetDelegate), + name_(std::move(name)), + orchestrator_(ConsoleTaskOrchestrator::getInstance()) { + stackTrace_ = runtimeTargetDelegate_.captureStackTrace(runtime); +} + +ConsoleTaskContext::~ConsoleTaskContext() { + orchestrator_.cancelTask(id()); +} + +ConsoleTaskId ConsoleTaskContext::id() const { + return ConsoleTaskId{(void*)this}; +} + +std::optional ConsoleTaskContext::getSerializedStackTrace() + const { + auto maybeValue = runtimeTargetDelegate_.serializeStackTrace(*stackTrace_); + if (maybeValue) { + maybeValue.value()["description"] = name_; + } + + return maybeValue; +} + +std::function()> +ConsoleTaskContext::getSerializedStackTraceProvider() const { + return [selfWeak = weak_from_this()]() -> std::optional { + if (auto self = selfWeak.lock()) { + return self->getSerializedStackTrace(); + } + + return std::nullopt; + }; +} + +void ConsoleTaskContext::schedule() { + orchestrator_.scheduleTask(id(), weak_from_this()); +} + +} // namespace facebook::react::jsinspector_modern diff --git a/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskContext.h b/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskContext.h new file mode 100644 index 000000000000..e651168661bc --- /dev/null +++ b/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskContext.h @@ -0,0 +1,107 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include "StackTrace.h" + +#include +#include + +#include +#include +#include +#include + +namespace facebook::react::jsinspector_modern { + +class ConsoleTaskOrchestrator; +class RuntimeTargetDelegate; + +class ConsoleTaskId { + public: + ConsoleTaskId() = default; + ~ConsoleTaskId() = default; + + ConsoleTaskId(const ConsoleTaskId &) = default; + ConsoleTaskId &operator=(const ConsoleTaskId &) = default; + + ConsoleTaskId(ConsoleTaskId &&) = default; + ConsoleTaskId &operator=(ConsoleTaskId &&) = default; + + bool operator==(const ConsoleTaskId &) const = default; + inline operator bool() const + { + return (bool)id_; + } + + explicit inline operator void *() const + { + return id_; + } + + private: + explicit inline ConsoleTaskId(void *id) : id_(id) + { + assert(id_ != nullptr); + } + + void *id_{nullptr}; + + friend class ConsoleTaskContext; +}; + +class ConsoleTaskContext : public std::enable_shared_from_this { + public: + ConsoleTaskContext(jsi::Runtime &runtime, RuntimeTargetDelegate &runtimeTargetDelegate, std::string name); + ~ConsoleTaskContext(); + + // Can't be moved or copied: the address of `ConsoleTaskContext` is used to + // identify this task and all corresponding invocations. + ConsoleTaskContext(const ConsoleTaskContext &) = delete; + ConsoleTaskContext &operator=(const ConsoleTaskContext &) = delete; + + ConsoleTaskContext(ConsoleTaskContext &&) = delete; + ConsoleTaskContext &operator=(ConsoleTaskContext &&) = delete; + + /** + * Unique identifier that is calculated based on the address of + * ConsoleTaskContext. + */ + ConsoleTaskId id() const; + + /** + * Returns the serialized stack trace that was captured during the allocation + * of ConsoleTaskContext. + */ + std::optional getSerializedStackTrace() const; + + /** + * Returns a function that returns the serialized stack trace, if available. + */ + std::function()> getSerializedStackTraceProvider() const; + + void schedule(); + + private: + RuntimeTargetDelegate &runtimeTargetDelegate_; + std::string name_; + ConsoleTaskOrchestrator &orchestrator_; + std::unique_ptr stackTrace_; +}; + +} // namespace facebook::react::jsinspector_modern + +namespace std { +template <> +struct hash { + size_t operator()(const facebook::react::jsinspector_modern::ConsoleTaskId &id) const + { + return std::hash{}(static_cast(id)); + } +}; +} // namespace std diff --git a/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskOrchestrator.cpp b/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskOrchestrator.cpp new file mode 100644 index 000000000000..17baa16a19ea --- /dev/null +++ b/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskOrchestrator.cpp @@ -0,0 +1,55 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#include "ConsoleTaskOrchestrator.h" + +namespace facebook::react::jsinspector_modern { + +/* static */ ConsoleTaskOrchestrator& ConsoleTaskOrchestrator::getInstance() { + static ConsoleTaskOrchestrator instance; + return instance; +} + +void ConsoleTaskOrchestrator::scheduleTask( + ConsoleTaskId taskId, + std::weak_ptr taskContext) { + std::lock_guard lock(mutex_); + tasks_.emplace(taskId, taskContext); +} + +void ConsoleTaskOrchestrator::cancelTask(ConsoleTaskId id) { + std::lock_guard lock(mutex_); + tasks_.erase(id); +} + +void ConsoleTaskOrchestrator::startTask(ConsoleTaskId id) { + std::lock_guard lock(mutex_); + stack_.push(id); +} + +void ConsoleTaskOrchestrator::finishTask(ConsoleTaskId id) { + std::lock_guard lock(mutex_); + assert(stack_.top() == id); + + stack_.pop(); +} + +std::shared_ptr ConsoleTaskOrchestrator::top() const { + std::lock_guard lock(mutex_); + if (stack_.empty()) { + return nullptr; + } + + auto it = tasks_.find(stack_.top()); + if (it == tasks_.end()) { + return nullptr; + } + + return it->second.lock(); +} + +} // namespace facebook::react::jsinspector_modern diff --git a/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskOrchestrator.h b/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskOrchestrator.h new file mode 100644 index 000000000000..79d645baeda9 --- /dev/null +++ b/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskOrchestrator.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include + +#include "ConsoleTaskContext.h" + +namespace facebook::react::jsinspector_modern { + +class ConsoleTaskOrchestrator { + public: + static ConsoleTaskOrchestrator &getInstance(); + + ~ConsoleTaskOrchestrator() = default; + + ConsoleTaskOrchestrator(const ConsoleTaskOrchestrator &) = delete; + ConsoleTaskOrchestrator &operator=(const ConsoleTaskOrchestrator &) = delete; + + ConsoleTaskOrchestrator(ConsoleTaskOrchestrator &&) = delete; + ConsoleTaskOrchestrator &operator=(ConsoleTaskOrchestrator &&) = delete; + + void scheduleTask(ConsoleTaskId taskId, std::weak_ptr taskContext); + void cancelTask(ConsoleTaskId taskId); + + void startTask(ConsoleTaskId taskId); + void finishTask(ConsoleTaskId taskId); + std::shared_ptr top() const; + + private: + ConsoleTaskOrchestrator() = default; + + std::stack stack_; + std::unordered_map> tasks_; + /** + * Protects the stack_ and tasks_ members. + */ + mutable std::mutex mutex_; +}; + +} // namespace facebook::react::jsinspector_modern From 33ec06154a1ce6b4a226c96a329bb58090900360 Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Thu, 6 Nov 2025 04:25:36 -0800 Subject: [PATCH 045/562] Define console.createTask (#54338) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54338 # Changelog: [Internal] Adds a basic implementation of the `console.createTask()` method. When this method is called, the `ConsoleTaskContext` is allocated. When `task.run()` is called, the corresponding `ConsoleTask` that has a pointer to `ConsoleTaskContext` will push it onto the stack in `ConsoleTaskOrchestrator`. Also adds types to corresponding Flow declarations. Reviewed By: sbuggay Differential Revision: D85481865 fbshipit-source-id: 31c96dba9eb4e6cb76f6e5a13661fe40e4d49807 --- packages/polyfills/console.js | 7 + .../RuntimeTargetConsole.cpp | 92 ++++++++++++ .../tests/ConsoleCreateTaskTest.cpp | 131 ++++++++++++++++++ packages/react-native/flow/bom.js.flow | 7 + 4 files changed, 237 insertions(+) create mode 100644 packages/react-native/ReactCommon/jsinspector-modern/tests/ConsoleCreateTaskTest.cpp diff --git a/packages/polyfills/console.js b/packages/polyfills/console.js index 04439593c96a..9777f930586e 100644 --- a/packages/polyfills/console.js +++ b/packages/polyfills/console.js @@ -571,6 +571,11 @@ function consoleAssertPolyfill(expression, label) { function stub() {} +// https://developer.chrome.com/docs/devtools/console/api#createtask +function consoleCreateTaskStub() { + return {run: cb => cb()}; +} + if (global.nativeLoggingHook) { const originalConsole = global.console; // Preserve the original `console` as `originalConsole` @@ -587,6 +592,7 @@ if (global.nativeLoggingHook) { timeStamp: stub, count: stub, countReset: stub, + createTask: consoleCreateTaskStub, ...(originalConsole ?? {}), error: getNativeLogFunction(LOG_LEVELS.error), info: getNativeLogFunction(LOG_LEVELS.info), @@ -705,6 +711,7 @@ if (global.nativeLoggingHook) { time: stub, timeEnd: stub, timeStamp: stub, + createTask: consoleCreateTaskStub, }; Object.defineProperty(console, '_isPolyfilled', { diff --git a/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTargetConsole.cpp b/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTargetConsole.cpp index 839869e013f3..85511d920531 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTargetConsole.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTargetConsole.cpp @@ -5,6 +5,9 @@ * LICENSE file in the root directory of this source tree. */ +#include "ConsoleTask.h" +#include "ConsoleTaskContext.h" + #include #include @@ -521,6 +524,68 @@ void installConsoleTimeStamp( }))); } +/** + * run method of the task object returned from console.createTask(). + */ +jsi::Value consoleTaskRun( + jsi::Runtime& runtime, + const jsi::Value* args, + size_t count, + std::shared_ptr taskContext) { + if (count < 1 || !args[0].isObject()) { + throw JSError(runtime, "First argument must be a function"); + } + auto fnObj = args[0].getObject(runtime); + if (!fnObj.isFunction(runtime)) { + throw JSError(runtime, "First argument must be a function"); + } + + ConsoleTask consoleTask{taskContext}; + + auto fn = fnObj.getFunction(runtime); + return fn.call(runtime); +} + +/** + * console.createTask. Non-standardized. + * https://developer.chrome.com/docs/devtools/console/api#createtask + */ +jsi::Value consoleCreateTask( + jsi::Runtime& runtime, + const jsi::Value* args, + size_t count, + RuntimeTargetDelegate& runtimeTargetDelegate, + bool /* enabled */) { + if (count < 1 || !args[0].isString()) { + throw JSError(runtime, "First argument must be a non-empty string"); + } + auto name = args[0].asString(runtime).utf8(runtime); + if (name.empty()) { + throw JSError(runtime, "First argument must be a non-empty string"); + } + + jsi::Object task{runtime}; + auto taskContext = std::make_shared( + runtime, runtimeTargetDelegate, name); + taskContext->schedule(); + + task.setProperty( + runtime, + "run", + jsi::Function::createFromHostFunction( + runtime, + jsi::PropNameID::forAscii(runtime, "run"), + 0, + [taskContext]( + jsi::Runtime& runtime, + const jsi::Value& /*thisVal*/, + const jsi::Value* args, + size_t count) { + return consoleTaskRun(runtime, args, count, taskContext); + })); + return task; +} + } // namespace void RuntimeTarget::installConsoleHandler() { @@ -624,6 +689,33 @@ void RuntimeTarget::installConsoleHandler() { */ installConsoleTimeStamp(runtime, originalConsole, console); + /** + * console.createTask + */ + console.setProperty( + runtime, + "createTask", + jsi::Function::createFromHostFunction( + runtime, + jsi::PropNameID::forAscii(runtime, "createTask"), + 0, + [state, selfWeak]( + jsi::Runtime& runtime, + const jsi::Value& /*thisVal*/, + const jsi::Value* args, + size_t count) { + jsi::Value task; + tryExecuteSync(selfWeak, [&](auto& self) { + task = consoleCreateTask( + runtime, + args, + count, + self.delegate_, + self.isConsoleCreateTaskEnabled()); + }); + return task; + })); + // Install forwarding console methods. #define FORWARDING_CONSOLE_METHOD(name, type) \ installConsoleMethod(#name, console_##name); diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tests/ConsoleCreateTaskTest.cpp b/packages/react-native/ReactCommon/jsinspector-modern/tests/ConsoleCreateTaskTest.cpp new file mode 100644 index 000000000000..79fbf844a67d --- /dev/null +++ b/packages/react-native/ReactCommon/jsinspector-modern/tests/ConsoleCreateTaskTest.cpp @@ -0,0 +1,131 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#include + +#include "JsiIntegrationTest.h" +#include "engines/JsiIntegrationTestHermesEngineAdapter.h" + +#include + +using namespace ::testing; + +namespace facebook::react::jsinspector_modern { + +/** + * A test fixture for the console.createTask API. + */ +class ConsoleCreateTaskTest : public JsiIntegrationPortableTestBase< + JsiIntegrationTestHermesEngineAdapter, + folly::QueuedImmediateExecutor> {}; + +TEST_F(ConsoleCreateTaskTest, Installed) { + auto result = eval("typeof console.createTask"); + auto& runtime = engineAdapter_->getRuntime(); + EXPECT_EQ(result.asString(runtime).utf8(runtime), "function"); +} + +TEST_F(ConsoleCreateTaskTest, ReturnsTaskObject) { + auto result = eval("typeof console.createTask('test-task')"); + auto& runtime = engineAdapter_->getRuntime(); + EXPECT_EQ(result.asString(runtime).utf8(runtime), "object"); +} + +TEST_F(ConsoleCreateTaskTest, TaskObjectHasRunMethod) { + auto result = eval("typeof console.createTask('test-task').run"); + auto& runtime = engineAdapter_->getRuntime(); + EXPECT_EQ(result.asString(runtime).utf8(runtime), "function"); +} + +TEST_F(ConsoleCreateTaskTest, RunMethodExecutesFunction) { + auto result = eval(R"( + let executed = false; + const task = console.createTask('test-task'); + task.run(() => { executed = true; }); + executed; + )"); + EXPECT_TRUE(result.getBool()); +} + +TEST_F(ConsoleCreateTaskTest, RunMethodReturnsValue) { + auto result = eval(R"( + const task = console.createTask('test-task'); + task.run(() => 42); + )"); + EXPECT_EQ(result.getNumber(), 42); +} + +TEST_F(ConsoleCreateTaskTest, ThrowsOnNoArguments) { + EXPECT_THROW(eval("console.createTask()"), facebook::jsi::JSError); +} + +TEST_F(ConsoleCreateTaskTest, ThrowsOnEmptyString) { + EXPECT_THROW(eval("console.createTask('')"), facebook::jsi::JSError); +} + +TEST_F(ConsoleCreateTaskTest, ThrowsOnNonStringArgument) { + EXPECT_THROW(eval("console.createTask(123)"), facebook::jsi::JSError); + EXPECT_THROW(eval("console.createTask(null)"), facebook::jsi::JSError); + EXPECT_THROW(eval("console.createTask(undefined)"), facebook::jsi::JSError); + EXPECT_THROW(eval("console.createTask({})"), facebook::jsi::JSError); +} + +TEST_F(ConsoleCreateTaskTest, RunMethodThrowsOnNoArguments) { + EXPECT_THROW( + eval(R"( + const task = console.createTask('test-task'); + task.run(); + )"), + facebook::jsi::JSError); +} + +TEST_F(ConsoleCreateTaskTest, RunMethodThrowsOnNonFunction) { + EXPECT_THROW( + eval(R"( + const task = console.createTask('test-task'); + task.run(123); + )"), + facebook::jsi::JSError); + EXPECT_THROW( + eval(R"( + const task = console.createTask('test-task'); + task.run('not a function'); + )"), + facebook::jsi::JSError); + EXPECT_THROW( + eval(R"( + const task = console.createTask('test-task'); + task.run({}); + )"), + facebook::jsi::JSError); +} + +TEST_F(ConsoleCreateTaskTest, MultipleTasksCanBeCreated) { + auto result = eval(R"( + const task1 = console.createTask('task-1'); + const task2 = console.createTask('task-2'); + let count = 0; + task1.run(() => { count++; }); + task2.run(() => { count++; }); + count; + )"); + EXPECT_EQ(result.getNumber(), 2); +} + +TEST_F(ConsoleCreateTaskTest, TaskCanBeRunMultipleTimes) { + auto result = eval(R"( + const task = console.createTask('test-task'); + let count = 0; + task.run(() => { count++; }); + task.run(() => { count++; }); + task.run(() => { count++; }); + count; + )"); + EXPECT_EQ(result.getNumber(), 3); +} + +} // namespace facebook::react::jsinspector_modern diff --git a/packages/react-native/flow/bom.js.flow b/packages/react-native/flow/bom.js.flow index 896253932a47..fe78011fa4cb 100644 --- a/packages/react-native/flow/bom.js.flow +++ b/packages/react-native/flow/bom.js.flow @@ -25,6 +25,10 @@ type DevToolsColor = | 'warning' | 'error'; +declare interface ConsoleTask { + run(f: () => T): T; +} + // $FlowExpectedError[libdef-override] Flow core definitions are incomplete. declare var console: { // Logging @@ -75,6 +79,9 @@ declare var console: { detail?: {[string]: mixed}, ): void, + // Stack tagging + createTask(label: string): ConsoleTask, + ... }; From 8ec75a634818ed4d246afcf6e0d34bddb6feabf5 Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Thu, 6 Nov 2025 04:25:36 -0800 Subject: [PATCH 046/562] Simple Fantom benchmark (#54333) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54333 # Changelog: [Internal] I couldn't add it to the previous diff, since console.createTask is not present on the base revision. See [1]. Reviewed By: sbuggay Differential Revision: D85860982 fbshipit-source-id: cf78dfc3ba1653a0cd133d924d18a2129cb5b1a4 --- .../consoleCreateTask-benchmark-itest.js | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 packages/react-native/src/private/webapis/console/__tests__/consoleCreateTask-benchmark-itest.js diff --git a/packages/react-native/src/private/webapis/console/__tests__/consoleCreateTask-benchmark-itest.js b/packages/react-native/src/private/webapis/console/__tests__/consoleCreateTask-benchmark-itest.js new file mode 100644 index 000000000000..7ba03b1f42c7 --- /dev/null +++ b/packages/react-native/src/private/webapis/console/__tests__/consoleCreateTask-benchmark-itest.js @@ -0,0 +1,35 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow strict-local + * @format + * @fantom_mode dev + */ + +/** + * We force the DEV mode, because Fusebox infra is not installed in production builds. + * We want to benchmark the implementation, not the polyfill. + */ + +import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment'; + +import * as Fantom from '@react-native/fantom'; + +const fn = () => {}; + +Fantom.unstable_benchmark + .suite('console.createTask', { + minIterations: 50000, + disableOptimizedBuildCheck: true, + }) + .test('JavaScript shim', () => { + const task: ConsoleTask = {run: cb => cb()}; + task.run(fn); + }) + .test('implementation', () => { + const task = console.createTask('task'); + task.run(fn); + }); From 21c211d6ff1c06345e111c001bc22543069d2221 Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Thu, 6 Nov 2025 04:25:36 -0800 Subject: [PATCH 047/562] JSX Fantom benchmark (#54336) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54336 # Changelog: [Internal] Adds a benchmark that is scoped to JSX scenario. React uses createTask() on JSX instances to preserve owner stacks relationship, and so users can see tree-like stacks in the debugger. Since this only happens in DEV, I have to force dev mode in Fantom as well. Reviewed By: sbuggay Differential Revision: D85860981 fbshipit-source-id: 7988c4afe3e83ed960c4cd18c9896b01ccdaa446 --- .../consoleCreateTask-jsx-benchmark-itest.js | 79 +++++++++++++++++++ ...o-consoleCreateTask-jsx-benchmark-itest.js | 19 +++++ 2 files changed, 98 insertions(+) create mode 100644 packages/react-native/src/private/webapis/console/__tests__/consoleCreateTask-jsx-benchmark-itest.js create mode 100644 packages/react-native/src/private/webapis/console/__tests__/no-consoleCreateTask-jsx-benchmark-itest.js diff --git a/packages/react-native/src/private/webapis/console/__tests__/consoleCreateTask-jsx-benchmark-itest.js b/packages/react-native/src/private/webapis/console/__tests__/consoleCreateTask-jsx-benchmark-itest.js new file mode 100644 index 000000000000..a840438c2b25 --- /dev/null +++ b/packages/react-native/src/private/webapis/console/__tests__/consoleCreateTask-jsx-benchmark-itest.js @@ -0,0 +1,79 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow strict-local + * @format + * @fantom_mode dev + */ + +/** + * We force the DEV mode, because React only uses console.createTask in DEV builds. + */ + +import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment'; + +import * as Fantom from '@react-native/fantom'; +import {View} from 'react-native'; + +let root; + +function Node(props: {depth: number}): React.Node { + if (props.depth === 500) { + return ; + } + + return ( + + + + ); +} +function Root(props: {prop: boolean}): React.Node { + return ; +} + +Fantom.unstable_benchmark + .suite( + `console.createTask ${typeof console.createTask === 'function' ? 'installed' : 'removed'}`, + { + minIterations: 100, + disableOptimizedBuildCheck: true, + }, + ) + .test( + 'Rendering 1000 views', + () => { + let recursiveViews: React.MixedElement; + for (let i = 0; i < 1000; ++i) { + recursiveViews = {recursiveViews}; + } + + Fantom.runTask(() => root.render(recursiveViews)); + }, + { + beforeEach: () => { + root = Fantom.createRoot(); + }, + afterEach: () => { + root.destroy(); + }, + }, + ) + .test( + 'Updating a subtree of 500 nodes', + () => { + Fantom.runTask(() => root.render()); + }, + { + beforeEach: () => { + root = Fantom.createRoot(); + Fantom.runTask(() => root.render()); + }, + afterEach: () => { + root.destroy(); + }, + }, + ); diff --git a/packages/react-native/src/private/webapis/console/__tests__/no-consoleCreateTask-jsx-benchmark-itest.js b/packages/react-native/src/private/webapis/console/__tests__/no-consoleCreateTask-jsx-benchmark-itest.js new file mode 100644 index 000000000000..eb5f7a7db1dc --- /dev/null +++ b/packages/react-native/src/private/webapis/console/__tests__/no-consoleCreateTask-jsx-benchmark-itest.js @@ -0,0 +1,19 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow strict-local + * @format + * @fantom_mode dev + */ + +/** + * We force the DEV mode, because React only uses console.createTask in DEV builds. + */ + +//$FlowExpectedError[cannot-write] +delete console.createTask; + +require('./consoleCreateTask-jsx-benchmark-itest.js'); From d6e70791d872569a31e491de4d3b16b1fa612f2f Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Thu, 6 Nov 2025 04:25:36 -0800 Subject: [PATCH 048/562] No-op by default (#54335) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54335 # Changelog: [Internal] Actually gate the task scheduling logic, so that the implementation is a no-op by default, if we are not tracing in the background or have Runtime CDP domain enabled. The drawback is that we might loose stack traces for some component renders, if the corresponding JSX declaration was called before we've enabled the `console.createTask()`. Reviewed By: huntie Differential Revision: D85849862 fbshipit-source-id: 2c3e8119ca0ab5677b2c00e83b9a616d5e924db1 --- .../jsinspector-modern/RuntimeTargetConsole.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTargetConsole.cpp b/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTargetConsole.cpp index 85511d920531..ac9c8c84362f 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTargetConsole.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTargetConsole.cpp @@ -555,7 +555,7 @@ jsi::Value consoleCreateTask( const jsi::Value* args, size_t count, RuntimeTargetDelegate& runtimeTargetDelegate, - bool /* enabled */) { + bool enabled) { if (count < 1 || !args[0].isString()) { throw JSError(runtime, "First argument must be a non-empty string"); } @@ -565,9 +565,12 @@ jsi::Value consoleCreateTask( } jsi::Object task{runtime}; - auto taskContext = std::make_shared( - runtime, runtimeTargetDelegate, name); - taskContext->schedule(); + std::shared_ptr taskContext = nullptr; + if (enabled) { + taskContext = std::make_shared( + runtime, runtimeTargetDelegate, name); + taskContext->schedule(); + } task.setProperty( runtime, From af23d4e1f048e62f2419b3815af569954ca2bb74 Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Thu, 6 Nov 2025 04:25:36 -0800 Subject: [PATCH 049/562] Use in console.timeStamp (#54339) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54339 # Changelog: [Internal] Whenever the `console.timeStamp()` is called and we are actually tracing, we will peek at the `ConsoleTaskOrchestrator` stack and check if there is a task. If so, it means that this call happened inside a task context, so we can request a stack trace and propagate it down to `PerformanceTracer`. Reviewed By: huntie Differential Revision: D85481866 fbshipit-source-id: 5bb7c4b7505f0811eff91eed53dc7822a0c063eb --- .../jsinspector-modern/RuntimeTargetConsole.cpp | 12 +++++++++++- .../jsinspector-modern/tracing/PerformanceTracer.cpp | 9 ++++++++- .../jsinspector-modern/tracing/PerformanceTracer.h | 4 +++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTargetConsole.cpp b/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTargetConsole.cpp index ac9c8c84362f..5cf5e4438276 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTargetConsole.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTargetConsole.cpp @@ -7,6 +7,7 @@ #include "ConsoleTask.h" #include "ConsoleTaskContext.h" +#include "ConsoleTaskOrchestrator.h" #include #include @@ -480,8 +481,17 @@ void consoleTimeStamp( } if (performanceTracer.isTracing()) { + auto taskContext = ConsoleTaskOrchestrator::getInstance().top(); + performanceTracer.reportTimeStamp( - label, start, end, trackName, trackGroup, color, std::move(detail)); + label, + start, + end, + trackName, + trackGroup, + color, + std::move(detail), + taskContext ? taskContext->getSerializedStackTraceProvider() : nullptr); } if (ReactPerfettoLogger::isTracing()) { diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp index d596decb121a..c8206324b5dc 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp @@ -214,7 +214,8 @@ void PerformanceTracer::reportTimeStamp( std::optional trackName, std::optional trackGroup, std::optional color, - std::optional detail) { + std::optional detail, + std::function()>&& stackTraceProvider) { if (!tracingAtomic_) { return; } @@ -233,6 +234,7 @@ void PerformanceTracer::reportTimeStamp( .trackGroup = std::move(trackGroup), .color = std::move(color), .detail = std::move(detail), + .stackTraceProvider = std::move(stackTraceProvider), .threadId = getCurrentThreadId(), }); } @@ -695,6 +697,11 @@ void PerformanceTracer::enqueueTraceEventsFromPerformanceTracerEvent( } data["devtools"] = folly::toJson(devtoolsDetail); } + if (event.stackTraceProvider) { + if (auto maybeStackTrace = event.stackTraceProvider()) { + data["rnStackTrace"] = std::move(*maybeStackTrace); + } + } events.emplace_back( TraceEvent{ diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h index f763cc8597ba..0e4f3964dc08 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h @@ -97,7 +97,8 @@ class PerformanceTracer { std::optional trackName = std::nullopt, std::optional trackGroup = std::nullopt, std::optional color = std::nullopt, - std::optional detail = std::nullopt); + std::optional detail = std::nullopt, + std::function()> &&stackTraceProvider = nullptr); /** * Record an Event Loop tick, which will be represented as an Event Loop task @@ -267,6 +268,7 @@ class PerformanceTracer { std::optional trackGroup; std::optional color; std::optional detail; + std::function()> stackTraceProvider; ThreadId threadId; HighResTimeStamp createdAt = HighResTimeStamp::now(); }; From 7722eae226f136ab449f383d637821dbd6479641 Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Thu, 6 Nov 2025 04:25:36 -0800 Subject: [PATCH 050/562] Use in performance.measure (#54337) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54337 # Changelog: [Internal] The approach is identical to `console.timeStamp()`, see the diff below for more context. In this diff, we apply this approach to `performance.measure()`. Reviewed By: huntie Differential Revision: D85481863 fbshipit-source-id: 061996b1a3801907fa611889cd2cc59606be5d43 --- .../jsinspector-modern/tracing/PerformanceTracer.cpp | 10 +++++++++- .../jsinspector-modern/tracing/PerformanceTracer.h | 4 +++- .../react/performance/timeline/CMakeLists.txt | 1 + .../performance/timeline/PerformanceEntryReporter.cpp | 11 ++++++++++- .../timeline/React-performancetimeline.podspec | 1 + 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp index c8206324b5dc..cf4b443df9bb 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp @@ -187,7 +187,8 @@ void PerformanceTracer::reportMeasure( const std::string& name, HighResTimeStamp start, HighResDuration duration, - folly::dynamic&& detail) { + folly::dynamic&& detail, + std::function()>&& stackTraceProvider) { if (!tracingAtomic_) { return; } @@ -204,6 +205,7 @@ void PerformanceTracer::reportMeasure( .duration = duration, .detail = std::move(detail), .threadId = getCurrentThreadId(), + .stackTraceProvider = std::move(stackTraceProvider), }); } @@ -608,6 +610,12 @@ void PerformanceTracer::enqueueTraceEventsFromPerformanceTracerEvent( beginEventArgs = folly::dynamic::object("detail", folly::toJson(event.detail)); } + if (event.stackTraceProvider) { + if (auto maybeStackTrace = event.stackTraceProvider()) { + beginEventArgs["data"] = folly::dynamic::object( + "rnStackTrace", std::move(*maybeStackTrace)); + } + } auto eventId = ++performanceMeasureCount_; diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h index 0e4f3964dc08..96bf715ab3f1 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h @@ -81,7 +81,8 @@ class PerformanceTracer { const std::string &name, HighResTimeStamp start, HighResDuration duration, - folly::dynamic &&detail = nullptr); + folly::dynamic &&detail = nullptr, + std::function()> &&stackTraceProvider = nullptr); /** * Record a "TimeStamp" Trace Event - a labelled entry on Performance @@ -257,6 +258,7 @@ class PerformanceTracer { HighResDuration duration; folly::dynamic detail; ThreadId threadId; + std::function()> stackTraceProvider; HighResTimeStamp createdAt = HighResTimeStamp::now(); }; diff --git a/packages/react-native/ReactCommon/react/performance/timeline/CMakeLists.txt b/packages/react-native/ReactCommon/react/performance/timeline/CMakeLists.txt index 742f6f9fefe3..38475e307660 100644 --- a/packages/react-native/ReactCommon/react/performance/timeline/CMakeLists.txt +++ b/packages/react-native/ReactCommon/react/performance/timeline/CMakeLists.txt @@ -16,6 +16,7 @@ target_compile_options(react_performance_timeline PRIVATE -Wpedantic) target_include_directories(react_performance_timeline PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(react_performance_timeline + jsinspector jsinspector_tracing reactperflogger react_featureflags diff --git a/packages/react-native/ReactCommon/react/performance/timeline/PerformanceEntryReporter.cpp b/packages/react-native/ReactCommon/react/performance/timeline/PerformanceEntryReporter.cpp index 17b3bbecd5a2..ed33d46d69d6 100644 --- a/packages/react-native/ReactCommon/react/performance/timeline/PerformanceEntryReporter.cpp +++ b/packages/react-native/ReactCommon/react/performance/timeline/PerformanceEntryReporter.cpp @@ -7,6 +7,7 @@ #include "PerformanceEntryReporter.h" +#include #include #include #include @@ -381,8 +382,16 @@ void PerformanceEntryReporter::traceMeasure( } if (performanceTracer.isTracing()) { + auto taskContext = + jsinspector_modern::ConsoleTaskOrchestrator::getInstance().top(); + performanceTracer.reportMeasure( - entry.name, entry.startTime, entry.duration, std::move(detail)); + entry.name, + entry.startTime, + entry.duration, + std::move(detail), + taskContext ? taskContext->getSerializedStackTraceProvider() + : nullptr); } } } diff --git a/packages/react-native/ReactCommon/react/performance/timeline/React-performancetimeline.podspec b/packages/react-native/ReactCommon/react/performance/timeline/React-performancetimeline.podspec index 6e190bbfe6d9..31c88d97abe9 100644 --- a/packages/react-native/ReactCommon/react/performance/timeline/React-performancetimeline.podspec +++ b/packages/react-native/ReactCommon/react/performance/timeline/React-performancetimeline.podspec @@ -41,6 +41,7 @@ Pod::Spec.new do |s| resolve_use_frameworks(s, header_mappings_dir: "../../..", module_name: "React_performancetimeline") s.dependency "React-featureflags" + add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern') add_dependency(s, "React-jsinspectortracing", :framework_name => 'jsinspector_moderntracing') s.dependency "React-timing" s.dependency "React-perflogger" From 53d8a98ee3b031919fa0f77dae91be5e0153dc72 Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Thu, 6 Nov 2025 04:25:36 -0800 Subject: [PATCH 051/562] Serialize stack trace eagerly (#54418) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54418 # Changelog: [Internal] Previosuly, we were serializing only at the end of tracing. We were creating a weak pointer to encapsulating `ConsoleTaskContext`. Initially I've decided to do it this way for performance reasons, but this resulted in missing a significant portion of stack traces, if the corresponding task was already gc-ed. Unfortunately, we have to serialize them at the time of reporting to `PerformanceTracer`. Reviewed By: huntie Differential Revision: D86207507 fbshipit-source-id: 58b15145ef081a02f2d79d75e05380968eb43a06 --- .../jsinspector-modern/ConsoleTaskContext.cpp | 11 ---------- .../jsinspector-modern/ConsoleTaskContext.h | 5 ----- .../RuntimeTargetConsole.cpp | 2 +- .../tracing/PerformanceTracer.cpp | 22 ++++++++----------- .../tracing/PerformanceTracer.h | 8 +++---- .../timeline/PerformanceEntryReporter.cpp | 3 +-- 6 files changed, 15 insertions(+), 36 deletions(-) diff --git a/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskContext.cpp b/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskContext.cpp index 53ba29297836..e3a677604425 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskContext.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskContext.cpp @@ -39,17 +39,6 @@ std::optional ConsoleTaskContext::getSerializedStackTrace() return maybeValue; } -std::function()> -ConsoleTaskContext::getSerializedStackTraceProvider() const { - return [selfWeak = weak_from_this()]() -> std::optional { - if (auto self = selfWeak.lock()) { - return self->getSerializedStackTrace(); - } - - return std::nullopt; - }; -} - void ConsoleTaskContext::schedule() { orchestrator_.scheduleTask(id(), weak_from_this()); } diff --git a/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskContext.h b/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskContext.h index e651168661bc..86fa68a571ba 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskContext.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/ConsoleTaskContext.h @@ -80,11 +80,6 @@ class ConsoleTaskContext : public std::enable_shared_from_this getSerializedStackTrace() const; - /** - * Returns a function that returns the serialized stack trace, if available. - */ - std::function()> getSerializedStackTraceProvider() const; - void schedule(); private: diff --git a/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTargetConsole.cpp b/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTargetConsole.cpp index 5cf5e4438276..5bf6c544fc8b 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTargetConsole.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/RuntimeTargetConsole.cpp @@ -491,7 +491,7 @@ void consoleTimeStamp( trackGroup, color, std::move(detail), - taskContext ? taskContext->getSerializedStackTraceProvider() : nullptr); + taskContext ? taskContext->getSerializedStackTrace() : nullptr); } if (ReactPerfettoLogger::isTracing()) { diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp index cf4b443df9bb..12d5051686f2 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp @@ -188,7 +188,7 @@ void PerformanceTracer::reportMeasure( HighResTimeStamp start, HighResDuration duration, folly::dynamic&& detail, - std::function()>&& stackTraceProvider) { + std::optional stackTrace) { if (!tracingAtomic_) { return; } @@ -205,7 +205,7 @@ void PerformanceTracer::reportMeasure( .duration = duration, .detail = std::move(detail), .threadId = getCurrentThreadId(), - .stackTraceProvider = std::move(stackTraceProvider), + .stackTrace = std::move(stackTrace), }); } @@ -217,7 +217,7 @@ void PerformanceTracer::reportTimeStamp( std::optional trackGroup, std::optional color, std::optional detail, - std::function()>&& stackTraceProvider) { + std::optional stackTrace) { if (!tracingAtomic_) { return; } @@ -236,7 +236,7 @@ void PerformanceTracer::reportTimeStamp( .trackGroup = std::move(trackGroup), .color = std::move(color), .detail = std::move(detail), - .stackTraceProvider = std::move(stackTraceProvider), + .stackTrace = std::move(stackTrace), .threadId = getCurrentThreadId(), }); } @@ -610,11 +610,9 @@ void PerformanceTracer::enqueueTraceEventsFromPerformanceTracerEvent( beginEventArgs = folly::dynamic::object("detail", folly::toJson(event.detail)); } - if (event.stackTraceProvider) { - if (auto maybeStackTrace = event.stackTraceProvider()) { - beginEventArgs["data"] = folly::dynamic::object( - "rnStackTrace", std::move(*maybeStackTrace)); - } + if (event.stackTrace) { + beginEventArgs["data"] = folly::dynamic::object( + "rnStackTrace", std::move(*event.stackTrace)); } auto eventId = ++performanceMeasureCount_; @@ -705,10 +703,8 @@ void PerformanceTracer::enqueueTraceEventsFromPerformanceTracerEvent( } data["devtools"] = folly::toJson(devtoolsDetail); } - if (event.stackTraceProvider) { - if (auto maybeStackTrace = event.stackTraceProvider()) { - data["rnStackTrace"] = std::move(*maybeStackTrace); - } + if (event.stackTrace) { + data["rnStackTrace"] = std::move(*event.stackTrace); } events.emplace_back( diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h index 96bf715ab3f1..fcab366784ac 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h +++ b/packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h @@ -82,7 +82,7 @@ class PerformanceTracer { HighResTimeStamp start, HighResDuration duration, folly::dynamic &&detail = nullptr, - std::function()> &&stackTraceProvider = nullptr); + std::optional stackTrace = nullptr); /** * Record a "TimeStamp" Trace Event - a labelled entry on Performance @@ -99,7 +99,7 @@ class PerformanceTracer { std::optional trackGroup = std::nullopt, std::optional color = std::nullopt, std::optional detail = std::nullopt, - std::function()> &&stackTraceProvider = nullptr); + std::optional stackTrace = std::nullopt); /** * Record an Event Loop tick, which will be represented as an Event Loop task @@ -258,7 +258,7 @@ class PerformanceTracer { HighResDuration duration; folly::dynamic detail; ThreadId threadId; - std::function()> stackTraceProvider; + std::optional stackTrace; HighResTimeStamp createdAt = HighResTimeStamp::now(); }; @@ -270,7 +270,7 @@ class PerformanceTracer { std::optional trackGroup; std::optional color; std::optional detail; - std::function()> stackTraceProvider; + std::optional stackTrace; ThreadId threadId; HighResTimeStamp createdAt = HighResTimeStamp::now(); }; diff --git a/packages/react-native/ReactCommon/react/performance/timeline/PerformanceEntryReporter.cpp b/packages/react-native/ReactCommon/react/performance/timeline/PerformanceEntryReporter.cpp index ed33d46d69d6..8e42bbfc9243 100644 --- a/packages/react-native/ReactCommon/react/performance/timeline/PerformanceEntryReporter.cpp +++ b/packages/react-native/ReactCommon/react/performance/timeline/PerformanceEntryReporter.cpp @@ -390,8 +390,7 @@ void PerformanceEntryReporter::traceMeasure( entry.startTime, entry.duration, std::move(detail), - taskContext ? taskContext->getSerializedStackTraceProvider() - : nullptr); + taskContext ? taskContext->getSerializedStackTrace() : nullptr); } } } From b4876a3f6677068b6ec55a28fb6b7d4569a9c5fe Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Thu, 6 Nov 2025 05:06:50 -0800 Subject: [PATCH 052/562] Back out "Remove RCT_EXPORT_MODULE from Core modules" (#54428) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54428 Backing this out because there are a couple of internal tests going in timeout when this land. I believe that for the tests some of these modules are not registered correctly. ## Changelog: [Internal] - ## Facebook: See T244088155. For some reasons, these two tests: - `buck test @//fbobjc/mode/buck2/ios-tests fbsource//fbobjc/Libraries/FBReactKit:FDSMediaWrapperServerSnapshotTests_Facebook` ([link](https://www.internalfb.com/intern/test/844425131558081)) - `buck test @//fbobjc/mode/buck2/ios-tests fbsource//fbobjc/Libraries/FBReactKit:FDSInlineReactionsServerSnapshotTests_Facebook` ([link](https://www.internalfb.com/intern/test/844425131558078)) timeouts with diff D85580258. I need to investigate which modules make these tests time out. It could be that the test setup is missing some plugin. I'm also surprised why other FDS tests are actually passing... Reviewed By: javache Differential Revision: D86401358 fbshipit-source-id: b9c87fef3ab164340e2e4f108d9e6fb2c379ebc0 --- packages/react-native/Libraries/Blob/RCTBlobManager.mm | 5 +---- packages/react-native/Libraries/Blob/RCTFileReaderModule.mm | 5 +---- .../Libraries/Image/RCTBundleAssetImageLoader.mm | 5 +---- packages/react-native/Libraries/Image/RCTGIFImageDecoder.mm | 5 +---- .../react-native/Libraries/Image/RCTImageEditingManager.mm | 5 +---- packages/react-native/Libraries/Image/RCTImageLoader.mm | 5 +---- .../react-native/Libraries/Image/RCTImageStoreManager.mm | 5 +---- .../react-native/Libraries/Image/RCTImageViewManager.mm | 5 +---- .../Libraries/Image/RCTLocalAssetImageLoader.mm | 5 +---- .../react-native/Libraries/LinkingIOS/RCTLinkingManager.mm | 5 +---- .../Libraries/NativeAnimation/RCTNativeAnimatedModule.mm | 5 +---- .../NativeAnimation/RCTNativeAnimatedTurboModule.mm | 5 +---- .../react-native/Libraries/Network/RCTDataRequestHandler.mm | 5 +---- .../react-native/Libraries/Network/RCTFileRequestHandler.mm | 5 +---- .../react-native/Libraries/Network/RCTHTTPRequestHandler.mm | 5 +---- packages/react-native/Libraries/Network/RCTNetworking.mm | 5 +---- .../PushNotificationIOS/RCTPushNotificationManager.mm | 5 +---- .../react-native/Libraries/Settings/RCTSettingsManager.mm | 5 +---- .../Libraries/Text/BaseText/RCTBaseTextViewManager.mm | 5 +---- .../Libraries/Text/RawText/RCTRawTextViewManager.mm | 5 +---- .../react-native/Libraries/Text/Text/RCTTextViewManager.mm | 5 +---- .../TextInput/Multiline/RCTMultilineTextInputViewManager.mm | 5 +---- .../Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm | 5 +---- .../Text/TextInput/RCTInputAccessoryViewManager.mm | 5 +---- .../Singleline/RCTSinglelineTextInputViewManager.mm | 5 +---- .../Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm | 5 +---- packages/react-native/Libraries/Vibration/RCTVibration.mm | 5 +---- .../React/CoreModules/RCTAccessibilityManager.mm | 5 +---- .../react-native/React/CoreModules/RCTActionSheetManager.mm | 5 +---- packages/react-native/React/CoreModules/RCTAlertManager.mm | 5 +---- packages/react-native/React/CoreModules/RCTAppState.mm | 5 +---- packages/react-native/React/CoreModules/RCTAppearance.mm | 5 +---- packages/react-native/React/CoreModules/RCTClipboard.mm | 5 +---- .../react-native/React/CoreModules/RCTDevLoadingView.mm | 5 +---- packages/react-native/React/CoreModules/RCTDevMenu.mm | 5 +---- packages/react-native/React/CoreModules/RCTDevSettings.mm | 5 +---- .../React/CoreModules/RCTDevToolsRuntimeSettingsModule.mm | 6 +----- packages/react-native/React/CoreModules/RCTDeviceInfo.mm | 5 +---- .../react-native/React/CoreModules/RCTEventDispatcher.mm | 5 +---- .../react-native/React/CoreModules/RCTExceptionsManager.mm | 5 +---- packages/react-native/React/CoreModules/RCTI18nManager.mm | 5 +---- .../react-native/React/CoreModules/RCTKeyboardObserver.mm | 5 +---- packages/react-native/React/CoreModules/RCTLogBox.mm | 5 +---- packages/react-native/React/CoreModules/RCTPerfMonitor.mm | 5 +---- packages/react-native/React/CoreModules/RCTPlatform.mm | 5 +---- packages/react-native/React/CoreModules/RCTRedBox.mm | 5 +---- packages/react-native/React/CoreModules/RCTSourceCode.mm | 5 +---- .../react-native/React/CoreModules/RCTStatusBarManager.mm | 5 +---- packages/react-native/React/CoreModules/RCTTiming.mm | 5 +---- .../react-native/React/CoreModules/RCTWebSocketModule.mm | 5 +---- packages/react-native/React/Modules/RCTUIManager.mm | 5 +---- .../React/Views/RCTActivityIndicatorViewManager.m | 5 +---- .../react-native/React/Views/RCTDebuggingOverlayManager.m | 5 +---- packages/react-native/React/Views/RCTModalHostViewManager.m | 5 +---- packages/react-native/React/Views/RCTModalManager.m | 5 +---- packages/react-native/React/Views/RCTSwitchManager.m | 5 +---- packages/react-native/React/Views/RCTViewManager.m | 5 +---- .../React/Views/RefreshControl/RCTRefreshControlManager.m | 5 +---- .../React/Views/SafeAreaView/RCTSafeAreaViewManager.m | 5 +---- .../React/Views/ScrollView/RCTScrollContentViewManager.m | 5 +---- .../React/Views/ScrollView/RCTScrollViewManager.m | 5 +---- .../platform/ios/ReactCommon/RCTSampleTurboModule.mm | 5 +---- 62 files changed, 62 insertions(+), 249 deletions(-) diff --git a/packages/react-native/Libraries/Blob/RCTBlobManager.mm b/packages/react-native/Libraries/Blob/RCTBlobManager.mm index 6dfcb4a1bcc4..981778817ef4 100755 --- a/packages/react-native/Libraries/Blob/RCTBlobManager.mm +++ b/packages/react-native/Libraries/Blob/RCTBlobManager.mm @@ -42,10 +42,7 @@ @implementation RCTBlobManager { dispatch_queue_t _processingQueue; } -+ (NSString *)moduleName -{ - return @"BlobModule"; -} +RCT_EXPORT_MODULE(BlobModule) @synthesize bridge = _bridge; @synthesize moduleRegistry = _moduleRegistry; diff --git a/packages/react-native/Libraries/Blob/RCTFileReaderModule.mm b/packages/react-native/Libraries/Blob/RCTFileReaderModule.mm index ae38238301d6..02180144f281 100644 --- a/packages/react-native/Libraries/Blob/RCTFileReaderModule.mm +++ b/packages/react-native/Libraries/Blob/RCTFileReaderModule.mm @@ -20,10 +20,7 @@ @interface RCTFileReaderModule () @implementation RCTFileReaderModule -+ (NSString *)moduleName -{ - return @"FileReaderModule"; -} +RCT_EXPORT_MODULE(FileReaderModule) @synthesize moduleRegistry = _moduleRegistry; diff --git a/packages/react-native/Libraries/Image/RCTBundleAssetImageLoader.mm b/packages/react-native/Libraries/Image/RCTBundleAssetImageLoader.mm index 6f05e536bfe0..538bf842fcf1 100644 --- a/packages/react-native/Libraries/Image/RCTBundleAssetImageLoader.mm +++ b/packages/react-native/Libraries/Image/RCTBundleAssetImageLoader.mm @@ -20,10 +20,7 @@ @interface RCTBundleAssetImageLoader () @implementation RCTBundleAssetImageLoader -+ (NSString *)moduleName -{ - return @"BundleAssetImageLoader"; -} +RCT_EXPORT_MODULE() - (BOOL)canLoadImageURL:(NSURL *)requestURL { diff --git a/packages/react-native/Libraries/Image/RCTGIFImageDecoder.mm b/packages/react-native/Libraries/Image/RCTGIFImageDecoder.mm index f5e9cca76f0b..92628c6c8f26 100644 --- a/packages/react-native/Libraries/Image/RCTGIFImageDecoder.mm +++ b/packages/react-native/Libraries/Image/RCTGIFImageDecoder.mm @@ -20,10 +20,7 @@ @interface RCTGIFImageDecoder () @implementation RCTGIFImageDecoder -+ (NSString *)moduleName -{ - return @"GIFImageDecoder"; -} +RCT_EXPORT_MODULE() - (BOOL)canDecodeImageData:(NSData *)imageData { diff --git a/packages/react-native/Libraries/Image/RCTImageEditingManager.mm b/packages/react-native/Libraries/Image/RCTImageEditingManager.mm index bfd62aa1c7be..7f72f130217f 100644 --- a/packages/react-native/Libraries/Image/RCTImageEditingManager.mm +++ b/packages/react-native/Libraries/Image/RCTImageEditingManager.mm @@ -24,10 +24,7 @@ @interface RCTImageEditingManager () @implementation RCTImageEditingManager -+ (NSString *)moduleName -{ - return @"ImageEditingManager"; -} +RCT_EXPORT_MODULE() @synthesize moduleRegistry = _moduleRegistry; diff --git a/packages/react-native/Libraries/Image/RCTImageLoader.mm b/packages/react-native/Libraries/Image/RCTImageLoader.mm index ea29bef42946..9c2553d7ec52 100644 --- a/packages/react-native/Libraries/Image/RCTImageLoader.mm +++ b/packages/react-native/Libraries/Image/RCTImageLoader.mm @@ -92,10 +92,7 @@ @implementation RCTImageLoader { @synthesize maxConcurrentDecodingTasks = _maxConcurrentDecodingTasks; @synthesize maxConcurrentDecodingBytes = _maxConcurrentDecodingBytes; -+ (NSString *)moduleName -{ - return @"RCTImageLoader"; -} +RCT_EXPORT_MODULE() - (instancetype)init { diff --git a/packages/react-native/Libraries/Image/RCTImageStoreManager.mm b/packages/react-native/Libraries/Image/RCTImageStoreManager.mm index 8c8d62c6a434..f5f9a88b4689 100644 --- a/packages/react-native/Libraries/Image/RCTImageStoreManager.mm +++ b/packages/react-native/Libraries/Image/RCTImageStoreManager.mm @@ -32,10 +32,7 @@ @implementation RCTImageStoreManager { @synthesize methodQueue = _methodQueue; -+ (NSString *)moduleName -{ - return @"ImageStoreManager"; -} +RCT_EXPORT_MODULE() + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/Libraries/Image/RCTImageViewManager.mm b/packages/react-native/Libraries/Image/RCTImageViewManager.mm index a316c39a2fa8..74e1713b820a 100644 --- a/packages/react-native/Libraries/Image/RCTImageViewManager.mm +++ b/packages/react-native/Libraries/Image/RCTImageViewManager.mm @@ -20,10 +20,7 @@ @implementation RCTImageViewManager -+ (NSString *)moduleName -{ - return @"ImageViewManager"; -} +RCT_EXPORT_MODULE() - (RCTShadowView *)shadowView { diff --git a/packages/react-native/Libraries/Image/RCTLocalAssetImageLoader.mm b/packages/react-native/Libraries/Image/RCTLocalAssetImageLoader.mm index 74246d45f165..517804aaff3b 100644 --- a/packages/react-native/Libraries/Image/RCTLocalAssetImageLoader.mm +++ b/packages/react-native/Libraries/Image/RCTLocalAssetImageLoader.mm @@ -20,10 +20,7 @@ @interface RCTLocalAssetImageLoader () @implementation RCTLocalAssetImageLoader -+ (NSString *)moduleName -{ - return @"LocalAssetImageLoader"; -} +RCT_EXPORT_MODULE() - (BOOL)canLoadImageURL:(NSURL *)requestURL { diff --git a/packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm b/packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm index 7d66efdc946e..db689678d652 100644 --- a/packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm +++ b/packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm @@ -27,10 +27,7 @@ @interface RCTLinkingManager () @implementation RCTLinkingManager -+ (NSString *)moduleName -{ - return @"LinkingManager"; -} +RCT_EXPORT_MODULE() - (dispatch_queue_t)methodQueue { diff --git a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm b/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm index 818d71a2916f..9120e8c4754b 100644 --- a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm +++ b/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm @@ -30,10 +30,7 @@ @implementation RCTNativeAnimatedModule { NSMutableDictionary *_animIdIsManagedByFabric; } -+ (NSString *)moduleName -{ - return @"NativeAnimatedModule"; -} +RCT_EXPORT_MODULE(); + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm b/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm index b192de009ee4..a168bddff83a 100644 --- a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm +++ b/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm @@ -30,10 +30,7 @@ @implementation RCTNativeAnimatedTurboModule { NSSet *_userDrivenAnimationEndedEvents; } -+ (NSString *)moduleName -{ - return @"NativeAnimatedTurboModule"; -} +RCT_EXPORT_MODULE(); + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/Libraries/Network/RCTDataRequestHandler.mm b/packages/react-native/Libraries/Network/RCTDataRequestHandler.mm index 0ed1ad4a8cf5..d52f6ba8ad6d 100644 --- a/packages/react-native/Libraries/Network/RCTDataRequestHandler.mm +++ b/packages/react-native/Libraries/Network/RCTDataRequestHandler.mm @@ -20,10 +20,7 @@ @implementation RCTDataRequestHandler { std::mutex _operationHandlerMutexLock; } -+ (NSString *)moduleName -{ - return @"DataRequestHandler"; -} +RCT_EXPORT_MODULE() - (void)invalidate { diff --git a/packages/react-native/Libraries/Network/RCTFileRequestHandler.mm b/packages/react-native/Libraries/Network/RCTFileRequestHandler.mm index 6a082bdb82b3..a1de92f33fe6 100644 --- a/packages/react-native/Libraries/Network/RCTFileRequestHandler.mm +++ b/packages/react-native/Libraries/Network/RCTFileRequestHandler.mm @@ -24,10 +24,7 @@ @implementation RCTFileRequestHandler { std::mutex _operationHandlerMutexLock; } -+ (NSString *)moduleName -{ - return @"FileRequestHandler"; -} +RCT_EXPORT_MODULE() - (void)invalidate { diff --git a/packages/react-native/Libraries/Network/RCTHTTPRequestHandler.mm b/packages/react-native/Libraries/Network/RCTHTTPRequestHandler.mm index 17e7c3a1eaa9..0303970a2e47 100644 --- a/packages/react-native/Libraries/Network/RCTHTTPRequestHandler.mm +++ b/packages/react-native/Libraries/Network/RCTHTTPRequestHandler.mm @@ -33,10 +33,7 @@ @implementation RCTHTTPRequestHandler { @synthesize moduleRegistry = _moduleRegistry; -+ (NSString *)moduleName -{ - return @"HTTPRequestHandler"; -} +RCT_EXPORT_MODULE() - (void)invalidate { diff --git a/packages/react-native/Libraries/Network/RCTNetworking.mm b/packages/react-native/Libraries/Network/RCTNetworking.mm index 7c53d0e8d1f4..86e80e24cde6 100644 --- a/packages/react-native/Libraries/Network/RCTNetworking.mm +++ b/packages/react-native/Libraries/Network/RCTNetworking.mm @@ -167,10 +167,7 @@ @implementation RCTNetworking { @synthesize methodQueue = _methodQueue; -+ (NSString *)moduleName -{ - return @"Networking"; -} +RCT_EXPORT_MODULE() + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm b/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm index e14a8780c551..b113503efe5c 100644 --- a/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm +++ b/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm @@ -154,10 +154,7 @@ static BOOL IsNotificationRemote(UNNotification *notification) return [notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]; } -+ (NSString *)moduleName -{ - return @"PushNotificationManager"; -} +RCT_EXPORT_MODULE() - (dispatch_queue_t)methodQueue { diff --git a/packages/react-native/Libraries/Settings/RCTSettingsManager.mm b/packages/react-native/Libraries/Settings/RCTSettingsManager.mm index b66eb12900b5..e1515ef05c24 100644 --- a/packages/react-native/Libraries/Settings/RCTSettingsManager.mm +++ b/packages/react-native/Libraries/Settings/RCTSettingsManager.mm @@ -25,10 +25,7 @@ @implementation RCTSettingsManager { @synthesize moduleRegistry = _moduleRegistry; -+ (NSString *)moduleName -{ - return @"SettingsManager"; -} +RCT_EXPORT_MODULE() + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/Libraries/Text/BaseText/RCTBaseTextViewManager.mm b/packages/react-native/Libraries/Text/BaseText/RCTBaseTextViewManager.mm index 076a78b08b9b..4843a9bd4db4 100644 --- a/packages/react-native/Libraries/Text/BaseText/RCTBaseTextViewManager.mm +++ b/packages/react-native/Libraries/Text/BaseText/RCTBaseTextViewManager.mm @@ -11,10 +11,7 @@ @implementation RCTBaseTextViewManager -+ (NSString *)moduleName -{ - return @"BaseText"; -} +RCT_EXPORT_MODULE(RCTBaseText) - (UIView *)view { diff --git a/packages/react-native/Libraries/Text/RawText/RCTRawTextViewManager.mm b/packages/react-native/Libraries/Text/RawText/RCTRawTextViewManager.mm index 9595ff96de76..15a851da28d7 100644 --- a/packages/react-native/Libraries/Text/RawText/RCTRawTextViewManager.mm +++ b/packages/react-native/Libraries/Text/RawText/RCTRawTextViewManager.mm @@ -13,10 +13,7 @@ @implementation RCTRawTextViewManager -+ (NSString *)moduleName -{ - return @"RawText"; -} +RCT_EXPORT_MODULE(RCTRawText) - (UIView *)view { diff --git a/packages/react-native/Libraries/Text/Text/RCTTextViewManager.mm b/packages/react-native/Libraries/Text/Text/RCTTextViewManager.mm index b17ca60310ca..cf093baaf48b 100644 --- a/packages/react-native/Libraries/Text/Text/RCTTextViewManager.mm +++ b/packages/react-native/Libraries/Text/Text/RCTTextViewManager.mm @@ -26,10 +26,7 @@ @implementation RCTTextViewManager { NSHashTable *_shadowViews; } -+ (NSString *)moduleName -{ - return @"TextViewManager"; -} +RCT_EXPORT_MODULE(RCTText) RCT_REMAP_SHADOW_PROPERTY(numberOfLines, maximumNumberOfLines, NSInteger) RCT_REMAP_SHADOW_PROPERTY(ellipsizeMode, lineBreakMode, NSLineBreakMode) diff --git a/packages/react-native/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.mm b/packages/react-native/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.mm index 44fd7dbbcbc8..cbf1433cca0d 100644 --- a/packages/react-native/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.mm +++ b/packages/react-native/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.mm @@ -12,10 +12,7 @@ @implementation RCTMultilineTextInputViewManager -+ (NSString *)moduleName -{ - return @"MultilineTextInputViewManager"; -} +RCT_EXPORT_MODULE() - (UIView *)view { diff --git a/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm b/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm index 19a27781612e..3503ccf45226 100644 --- a/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm +++ b/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm @@ -30,10 +30,7 @@ @implementation RCTBaseTextInputViewManager { NSHashTable *_shadowViews; } -+ (NSString *)moduleName -{ - return @"BaseTextInputViewManager"; -} +RCT_EXPORT_MODULE() #pragma mark - Unified properties diff --git a/packages/react-native/Libraries/Text/TextInput/RCTInputAccessoryViewManager.mm b/packages/react-native/Libraries/Text/TextInput/RCTInputAccessoryViewManager.mm index fa910d516027..34e4a575285c 100644 --- a/packages/react-native/Libraries/Text/TextInput/RCTInputAccessoryViewManager.mm +++ b/packages/react-native/Libraries/Text/TextInput/RCTInputAccessoryViewManager.mm @@ -14,10 +14,7 @@ @implementation RCTInputAccessoryViewManager -+ (NSString *)moduleName -{ - return @"InputAccessoryViewManager"; -} +RCT_EXPORT_MODULE() - (UIView *)view { diff --git a/packages/react-native/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.mm b/packages/react-native/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.mm index 14dd7a52d9cb..13cd754c7655 100644 --- a/packages/react-native/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.mm +++ b/packages/react-native/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.mm @@ -14,10 +14,7 @@ @implementation RCTSinglelineTextInputViewManager -+ (NSString *)moduleName -{ - return @"SinglelineTextInputViewManager"; -} +RCT_EXPORT_MODULE() - (RCTShadowView *)shadowView { diff --git a/packages/react-native/Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm b/packages/react-native/Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm index ebfdcccd4a26..e3d054ed17fd 100644 --- a/packages/react-native/Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm +++ b/packages/react-native/Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm @@ -13,10 +13,7 @@ @implementation RCTVirtualTextViewManager -+ (NSString *)moduleName -{ - return @"VirtualTextViewManager"; -} +RCT_EXPORT_MODULE(RCTVirtualText) - (UIView *)view { diff --git a/packages/react-native/Libraries/Vibration/RCTVibration.mm b/packages/react-native/Libraries/Vibration/RCTVibration.mm index 19b0b7463974..389dc871c4d2 100644 --- a/packages/react-native/Libraries/Vibration/RCTVibration.mm +++ b/packages/react-native/Libraries/Vibration/RCTVibration.mm @@ -18,10 +18,7 @@ @interface RCTVibration () @implementation RCTVibration -+ (NSString *)moduleName -{ - return @"Vibration"; -} +RCT_EXPORT_MODULE() - (void)vibrate { diff --git a/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm b/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm index 4f4bd623ca17..37e4228d2836 100644 --- a/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm +++ b/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm @@ -33,10 +33,7 @@ @implementation RCTAccessibilityManager @synthesize moduleRegistry = _moduleRegistry; @synthesize multipliers = _multipliers; -+ (NSString *)moduleName -{ - return @"AccessibilityManager"; -} +RCT_EXPORT_MODULE() + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTActionSheetManager.mm b/packages/react-native/React/CoreModules/RCTActionSheetManager.mm index 151223c6e6af..6472cc44f0bc 100644 --- a/packages/react-native/React/CoreModules/RCTActionSheetManager.mm +++ b/packages/react-native/React/CoreModules/RCTActionSheetManager.mm @@ -42,10 +42,7 @@ + (BOOL)requiresMainQueueSetup return NO; } -+ (NSString *)moduleName -{ - return @"ActionSheetManager"; -} +RCT_EXPORT_MODULE() @synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED; diff --git a/packages/react-native/React/CoreModules/RCTAlertManager.mm b/packages/react-native/React/CoreModules/RCTAlertManager.mm index 7a42f861a491..2b9fc60c9681 100644 --- a/packages/react-native/React/CoreModules/RCTAlertManager.mm +++ b/packages/react-native/React/CoreModules/RCTAlertManager.mm @@ -40,10 +40,7 @@ @implementation RCTAlertManager { NSHashTable *_alertControllers; } -+ (NSString *)moduleName -{ - return @"AlertManager"; -} +RCT_EXPORT_MODULE() - (dispatch_queue_t)methodQueue { diff --git a/packages/react-native/React/CoreModules/RCTAppState.mm b/packages/react-native/React/CoreModules/RCTAppState.mm index 1b864f3b0fab..1998115ea273 100644 --- a/packages/react-native/React/CoreModules/RCTAppState.mm +++ b/packages/react-native/React/CoreModules/RCTAppState.mm @@ -43,10 +43,7 @@ @implementation RCTAppState { facebook::react::ModuleConstants _constants; } -+ (NSString *)moduleName -{ - return @"AppState"; -} +RCT_EXPORT_MODULE() + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTAppearance.mm b/packages/react-native/React/CoreModules/RCTAppearance.mm index ebfea185c104..d25d9f64e6bd 100644 --- a/packages/react-native/React/CoreModules/RCTAppearance.mm +++ b/packages/react-native/React/CoreModules/RCTAppearance.mm @@ -92,10 +92,7 @@ - (instancetype)init return self; } -+ (NSString *)moduleName -{ - return @"Appearance"; -} +RCT_EXPORT_MODULE(Appearance) + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTClipboard.mm b/packages/react-native/React/CoreModules/RCTClipboard.mm index cfb0883dfe0e..2dc098a47302 100644 --- a/packages/react-native/React/CoreModules/RCTClipboard.mm +++ b/packages/react-native/React/CoreModules/RCTClipboard.mm @@ -19,10 +19,7 @@ @interface RCTClipboard () @implementation RCTClipboard -+ (NSString *)moduleName -{ - return @"Clipboard"; -} +RCT_EXPORT_MODULE() - (dispatch_queue_t)methodQueue { diff --git a/packages/react-native/React/CoreModules/RCTDevLoadingView.mm b/packages/react-native/React/CoreModules/RCTDevLoadingView.mm index 93d7d6b82acc..0dd2a7f100cb 100644 --- a/packages/react-native/React/CoreModules/RCTDevLoadingView.mm +++ b/packages/react-native/React/CoreModules/RCTDevLoadingView.mm @@ -37,10 +37,7 @@ @implementation RCTDevLoadingView { dispatch_block_t _initialMessageBlock; } -+ (NSString *)moduleName -{ - return @"DevLoadingView"; -} +RCT_EXPORT_MODULE() - (instancetype)init { diff --git a/packages/react-native/React/CoreModules/RCTDevMenu.mm b/packages/react-native/React/CoreModules/RCTDevMenu.mm index 85eee89af938..890c1596df74 100644 --- a/packages/react-native/React/CoreModules/RCTDevMenu.mm +++ b/packages/react-native/React/CoreModules/RCTDevMenu.mm @@ -124,10 +124,7 @@ @implementation RCTDevMenu { @synthesize callableJSModules = _callableJSModules; @synthesize bundleManager = _bundleManager; -+ (NSString *)moduleName -{ - return @"DevMenu"; -} +RCT_EXPORT_MODULE() + (void)initialize { diff --git a/packages/react-native/React/CoreModules/RCTDevSettings.mm b/packages/react-native/React/CoreModules/RCTDevSettings.mm index 804e5a02b4fe..fbbeec0e703d 100644 --- a/packages/react-native/React/CoreModules/RCTDevSettings.mm +++ b/packages/react-native/React/CoreModules/RCTDevSettings.mm @@ -134,10 +134,7 @@ @implementation RCTDevSettings @synthesize isInspectable = _isInspectable; @synthesize bundleManager = _bundleManager; -+ (NSString *)moduleName -{ - return @"RCTDevSettings"; -} +RCT_EXPORT_MODULE() - (instancetype)init { diff --git a/packages/react-native/React/CoreModules/RCTDevToolsRuntimeSettingsModule.mm b/packages/react-native/React/CoreModules/RCTDevToolsRuntimeSettingsModule.mm index 5793f88b0830..ba4e2559697a 100644 --- a/packages/react-native/React/CoreModules/RCTDevToolsRuntimeSettingsModule.mm +++ b/packages/react-native/React/CoreModules/RCTDevToolsRuntimeSettingsModule.mm @@ -23,11 +23,7 @@ @interface RCTDevToolsRuntimeSettingsModule () )delegate { diff --git a/packages/react-native/React/CoreModules/RCTI18nManager.mm b/packages/react-native/React/CoreModules/RCTI18nManager.mm index c6dedeab7c33..7d3b9eaa11cf 100644 --- a/packages/react-native/React/CoreModules/RCTI18nManager.mm +++ b/packages/react-native/React/CoreModules/RCTI18nManager.mm @@ -19,10 +19,7 @@ @interface RCTI18nManager () @implementation RCTI18nManager -+ (NSString *)moduleName -{ - return @"I18nManager"; -} +RCT_EXPORT_MODULE() + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTKeyboardObserver.mm b/packages/react-native/React/CoreModules/RCTKeyboardObserver.mm index 822dbe13de1a..79f4f8f4170f 100644 --- a/packages/react-native/React/CoreModules/RCTKeyboardObserver.mm +++ b/packages/react-native/React/CoreModules/RCTKeyboardObserver.mm @@ -20,10 +20,7 @@ @interface RCTKeyboardObserver () @implementation RCTKeyboardObserver -+ (NSString *)moduleName -{ - return @"KeyboardObserver"; -} +RCT_EXPORT_MODULE() - (void)startObserving { diff --git a/packages/react-native/React/CoreModules/RCTLogBox.mm b/packages/react-native/React/CoreModules/RCTLogBox.mm index 8e5c19bdbe6a..adfbb11a80e9 100644 --- a/packages/react-native/React/CoreModules/RCTLogBox.mm +++ b/packages/react-native/React/CoreModules/RCTLogBox.mm @@ -27,10 +27,7 @@ @implementation RCTLogBox { @synthesize bridge = _bridge; -+ (NSString *)moduleName -{ - return @"LogBox"; -} +RCT_EXPORT_MODULE() + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTPerfMonitor.mm b/packages/react-native/React/CoreModules/RCTPerfMonitor.mm index 60dbaf5ffbb8..e67ef6a40764 100644 --- a/packages/react-native/React/CoreModules/RCTPerfMonitor.mm +++ b/packages/react-native/React/CoreModules/RCTPerfMonitor.mm @@ -114,10 +114,7 @@ @implementation RCTPerfMonitor { @synthesize bridge = _bridge; @synthesize moduleRegistry = _moduleRegistry; -+ (NSString *)moduleName -{ - return @"PerfMonitor"; -} +RCT_EXPORT_MODULE() + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTPlatform.mm b/packages/react-native/React/CoreModules/RCTPlatform.mm index 088157f20b8e..09060d5e2016 100644 --- a/packages/react-native/React/CoreModules/RCTPlatform.mm +++ b/packages/react-native/React/CoreModules/RCTPlatform.mm @@ -48,10 +48,7 @@ @implementation RCTPlatform { ModuleConstants _constants; } -+ (NSString *)moduleName -{ - return @"PlatformConstants"; -} +RCT_EXPORT_MODULE(PlatformConstants) + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTRedBox.mm b/packages/react-native/React/CoreModules/RCTRedBox.mm index 71c1f277f76b..fb057b969214 100644 --- a/packages/react-native/React/CoreModules/RCTRedBox.mm +++ b/packages/react-native/React/CoreModules/RCTRedBox.mm @@ -480,10 +480,7 @@ @implementation RCTRedBox { @synthesize moduleRegistry = _moduleRegistry; @synthesize bundleManager = _bundleManager; -+ (NSString *)moduleName -{ - return @"RedBox"; -} +RCT_EXPORT_MODULE() - (void)registerErrorCustomizer:(id)errorCustomizer { diff --git a/packages/react-native/React/CoreModules/RCTSourceCode.mm b/packages/react-native/React/CoreModules/RCTSourceCode.mm index 47bf41729da1..ad5008429f89 100644 --- a/packages/react-native/React/CoreModules/RCTSourceCode.mm +++ b/packages/react-native/React/CoreModules/RCTSourceCode.mm @@ -18,10 +18,7 @@ @interface RCTSourceCode () @implementation RCTSourceCode -+ (NSString *)moduleName -{ - return @"SourceCode"; -} +RCT_EXPORT_MODULE() @synthesize bundleManager = _bundleManager; diff --git a/packages/react-native/React/CoreModules/RCTStatusBarManager.mm b/packages/react-native/React/CoreModules/RCTStatusBarManager.mm index 2e891bd446e2..a7cd2cc9db5e 100644 --- a/packages/react-native/React/CoreModules/RCTStatusBarManager.mm +++ b/packages/react-native/React/CoreModules/RCTStatusBarManager.mm @@ -68,10 +68,7 @@ static BOOL RCTViewControllerBasedStatusBarAppearance() return value; } -+ (NSString *)moduleName -{ - return @"StatusBarManager"; -} +RCT_EXPORT_MODULE() + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTTiming.mm b/packages/react-native/React/CoreModules/RCTTiming.mm index f07d91a8044d..14ee7844c7fe 100644 --- a/packages/react-native/React/CoreModules/RCTTiming.mm +++ b/packages/react-native/React/CoreModules/RCTTiming.mm @@ -107,10 +107,7 @@ @implementation RCTTiming { @synthesize paused = _paused; @synthesize pauseCallback = _pauseCallback; -+ (NSString *)moduleName -{ - return @"Timing"; -} +RCT_EXPORT_MODULE() - (instancetype)initWithDelegate:(id)delegate { diff --git a/packages/react-native/React/CoreModules/RCTWebSocketModule.mm b/packages/react-native/React/CoreModules/RCTWebSocketModule.mm index 1541561e78b4..e29d76a76a23 100644 --- a/packages/react-native/React/CoreModules/RCTWebSocketModule.mm +++ b/packages/react-native/React/CoreModules/RCTWebSocketModule.mm @@ -39,10 +39,7 @@ @implementation RCTWebSocketModule { NSMutableDictionary> *_contentHandlers; } -+ (NSString *)moduleName -{ - return @"WebSocketModule"; -} +RCT_EXPORT_MODULE() - (dispatch_queue_t)methodQueue { diff --git a/packages/react-native/React/Modules/RCTUIManager.mm b/packages/react-native/React/Modules/RCTUIManager.mm index 0cfab1413037..c3d1cf6d7240 100644 --- a/packages/react-native/React/Modules/RCTUIManager.mm +++ b/packages/react-native/React/Modules/RCTUIManager.mm @@ -179,10 +179,7 @@ @implementation RCTUIManager { @synthesize bridge = _bridge; @synthesize moduleRegistry = _moduleRegistry; -+ (NSString *)moduleName -{ - return @"RCTUIManager"; -} +RCT_EXPORT_MODULE() + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/Views/RCTActivityIndicatorViewManager.m b/packages/react-native/React/Views/RCTActivityIndicatorViewManager.m index 0d62c172ad02..8b9b79a0523d 100644 --- a/packages/react-native/React/Views/RCTActivityIndicatorViewManager.m +++ b/packages/react-native/React/Views/RCTActivityIndicatorViewManager.m @@ -27,10 +27,7 @@ @implementation RCTConvert (UIActivityIndicatorView) @implementation RCTActivityIndicatorViewManager -+ (NSString *)moduleName -{ - return @"ActivityIndicatorViewManager"; -} +RCT_EXPORT_MODULE() - (UIView *)view { diff --git a/packages/react-native/React/Views/RCTDebuggingOverlayManager.m b/packages/react-native/React/Views/RCTDebuggingOverlayManager.m index 31bf173e12ce..83a85a19039b 100644 --- a/packages/react-native/React/Views/RCTDebuggingOverlayManager.m +++ b/packages/react-native/React/Views/RCTDebuggingOverlayManager.m @@ -17,10 +17,7 @@ @implementation RCTDebuggingOverlayManager -+ (NSString *)moduleName -{ - return @"DebuggingOverlay"; -} +RCT_EXPORT_MODULE(DebuggingOverlay) - (UIView *)view { diff --git a/packages/react-native/React/Views/RCTModalHostViewManager.m b/packages/react-native/React/Views/RCTModalHostViewManager.m index c84b05da51c8..147cd4124398 100644 --- a/packages/react-native/React/Views/RCTModalHostViewManager.m +++ b/packages/react-native/React/Views/RCTModalHostViewManager.m @@ -40,10 +40,7 @@ @implementation RCTModalHostViewManager { NSPointerArray *_hostViews; } -+ (NSString *)moduleName -{ - return @"ModalHostViewManager "; -} +RCT_EXPORT_MODULE() - (UIView *)view { diff --git a/packages/react-native/React/Views/RCTModalManager.m b/packages/react-native/React/Views/RCTModalManager.m index effb33ffa309..6e15eb83416f 100644 --- a/packages/react-native/React/Views/RCTModalManager.m +++ b/packages/react-native/React/Views/RCTModalManager.m @@ -17,10 +17,7 @@ @interface RCTModalManager () @implementation RCTModalManager -+ (NSString *)moduleName -{ - return @"ModalManager"; -} +RCT_EXPORT_MODULE(); - (NSArray *)supportedEvents { diff --git a/packages/react-native/React/Views/RCTSwitchManager.m b/packages/react-native/React/Views/RCTSwitchManager.m index f758780f8d45..5398419a4c09 100644 --- a/packages/react-native/React/Views/RCTSwitchManager.m +++ b/packages/react-native/React/Views/RCTSwitchManager.m @@ -16,10 +16,7 @@ @implementation RCTSwitchManager -+ (NSString *)moduleName -{ - return @"SwitchManager"; -} +RCT_EXPORT_MODULE() - (UIView *)view { diff --git a/packages/react-native/React/Views/RCTViewManager.m b/packages/react-native/React/Views/RCTViewManager.m index d6f63ef1bd3c..1ace350d2422 100644 --- a/packages/react-native/React/Views/RCTViewManager.m +++ b/packages/react-native/React/Views/RCTViewManager.m @@ -128,10 +128,7 @@ @implementation RCTViewManager @synthesize bridge = _bridge; -+ (NSString *)moduleName -{ - return @"RCTViewManager"; -} +RCT_EXPORT_MODULE() - (dispatch_queue_t)methodQueue { diff --git a/packages/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m b/packages/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m index 46b5d488b0db..1e9ff527f4e6 100644 --- a/packages/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m +++ b/packages/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m @@ -15,10 +15,7 @@ @implementation RCTRefreshControlManager -+ (NSString *)moduleName -{ - return @"RefreshControlManager"; -} +RCT_EXPORT_MODULE() - (UIView *)view { diff --git a/packages/react-native/React/Views/SafeAreaView/RCTSafeAreaViewManager.m b/packages/react-native/React/Views/SafeAreaView/RCTSafeAreaViewManager.m index 61670f857f85..f8d2d8696ddd 100644 --- a/packages/react-native/React/Views/SafeAreaView/RCTSafeAreaViewManager.m +++ b/packages/react-native/React/Views/SafeAreaView/RCTSafeAreaViewManager.m @@ -15,10 +15,7 @@ @implementation RCTSafeAreaViewManager -+ (NSString *)moduleName -{ - return @"SafeAreaViewManager"; -} +RCT_EXPORT_MODULE() - (UIView *)view { diff --git a/packages/react-native/React/Views/ScrollView/RCTScrollContentViewManager.m b/packages/react-native/React/Views/ScrollView/RCTScrollContentViewManager.m index 896916f606bd..4d79c3404c2b 100644 --- a/packages/react-native/React/Views/ScrollView/RCTScrollContentViewManager.m +++ b/packages/react-native/React/Views/ScrollView/RCTScrollContentViewManager.m @@ -14,10 +14,7 @@ @implementation RCTScrollContentViewManager -+ (NSString *)moduleName -{ - return @"ScrollContentViewManager"; -} +RCT_EXPORT_MODULE() - (RCTScrollContentView *)view { diff --git a/packages/react-native/React/Views/ScrollView/RCTScrollViewManager.m b/packages/react-native/React/Views/ScrollView/RCTScrollViewManager.m index fbf857f63aa2..985771805c59 100644 --- a/packages/react-native/React/Views/ScrollView/RCTScrollViewManager.m +++ b/packages/react-native/React/Views/ScrollView/RCTScrollViewManager.m @@ -53,10 +53,7 @@ @implementation RCTConvert (UIScrollView) @implementation RCTScrollViewManager -+ (NSString *)moduleName -{ - return @"ScrollViewManager"; -} +RCT_EXPORT_MODULE() - (UIView *)view { diff --git a/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm b/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm index 83f07891e3a1..7486ffcb9ff8 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm +++ b/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm @@ -24,10 +24,7 @@ @implementation RCTSampleTurboModule { } // Backward-compatible export -+ (NSString *)moduleName -{ - return @"SampleTurboModule"; -} +RCT_EXPORT_MODULE() // Backward-compatible queue configuration + (BOOL)requiresMainQueueSetup From 0eda52ad3b7b04c4e19e225f94a70ac76a605913 Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Thu, 6 Nov 2025 06:01:41 -0800 Subject: [PATCH 053/562] Update debugger-frontend from 7aa57d1...d8824de (#54427) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54427 # Changelog: [Internal] Changelog: [Internal] - Update `react-native/debugger-frontend` from 7aa57d1...d8824de Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/7aa57d13e50ce9d74a91c9315c9b0ded00fbc19f...d8824de5790a32c018ec9926a970daa7feb9a84c). ### Changelog | Commit | Author | Date/Time | Subject | | ------ | ------ | --------- | ------- | | [d8824de57](https://github.com/facebook/react-native-devtools-frontend/commit/d8824de57) | Ruslan Lesiutin (28902667+hoxyq@users.noreply.github.com) | 2025-11-06T09:26:14Z | [feat: track ReactNativeApplication.traceRequested event (#219)](https://github.com/facebook/react-native-devtools-frontend/commit/d8824de57) | Reviewed By: huntie Differential Revision: D86400548 fbshipit-source-id: 3b741b7223240ba923bb566e17612dc726b7e722 --- packages/debugger-frontend/BUILD_INFO | 4 ++-- .../dist/third-party/front_end/core/host/host.js | 2 +- .../dist/third-party/front_end/core/sdk/sdk.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/debugger-frontend/BUILD_INFO b/packages/debugger-frontend/BUILD_INFO index b846dec3d961..1aab01b7e543 100644 --- a/packages/debugger-frontend/BUILD_INFO +++ b/packages/debugger-frontend/BUILD_INFO @@ -1,5 +1,5 @@ -@generated SignedSource<<4bb67766e15e25a481c4c38873260a7a>> -Git revision: 7aa57d13e50ce9d74a91c9315c9b0ded00fbc19f +@generated SignedSource<> +Git revision: d8824de5790a32c018ec9926a970daa7feb9a84c Built with --nohooks: false Is local checkout: false Remote URL: https://github.com/facebook/react-native-devtools-frontend diff --git a/packages/debugger-frontend/dist/third-party/front_end/core/host/host.js b/packages/debugger-frontend/dist/third-party/front_end/core/host/host.js index 2bd6d58f614e..98fae274f241 100644 --- a/packages/debugger-frontend/dist/third-party/front_end/core/host/host.js +++ b/packages/debugger-frontend/dist/third-party/front_end/core/host/host.js @@ -1 +1 @@ -import*as e from"../common/common.js";import*as r from"../root/root.js";import*as t from"../i18n/i18n.js";import*as n from"../platform/platform.js";var o;!function(e){e.AppendedToURL="appendedToURL",e.CanceledSaveURL="canceledSaveURL",e.ColorThemeChanged="colorThemeChanged",e.ContextMenuCleared="contextMenuCleared",e.ContextMenuItemSelected="contextMenuItemSelected",e.DeviceCountUpdated="deviceCountUpdated",e.DevicesDiscoveryConfigChanged="devicesDiscoveryConfigChanged",e.DevicesPortForwardingStatusChanged="devicesPortForwardingStatusChanged",e.DevicesUpdated="devicesUpdated",e.DispatchMessage="dispatchMessage",e.DispatchMessageChunk="dispatchMessageChunk",e.EnterInspectElementMode="enterInspectElementMode",e.EyeDropperPickedColor="eyeDropperPickedColor",e.FileSystemsLoaded="fileSystemsLoaded",e.FileSystemRemoved="fileSystemRemoved",e.FileSystemAdded="fileSystemAdded",e.FileSystemFilesChangedAddedRemoved="FileSystemFilesChangedAddedRemoved",e.IndexingTotalWorkCalculated="indexingTotalWorkCalculated",e.IndexingWorked="indexingWorked",e.IndexingDone="indexingDone",e.KeyEventUnhandled="keyEventUnhandled",e.ReloadInspectedPage="reloadInspectedPage",e.RevealSourceLine="revealSourceLine",e.SavedURL="savedURL",e.SearchCompleted="searchCompleted",e.SetInspectedTabId="setInspectedTabId",e.SetUseSoftMenu="setUseSoftMenu",e.ShowPanel="showPanel"}(o||(o={}));const s=[[o.AppendedToURL,"appendedToURL",["url"]],[o.CanceledSaveURL,"canceledSaveURL",["url"]],[o.ColorThemeChanged,"colorThemeChanged",[]],[o.ContextMenuCleared,"contextMenuCleared",[]],[o.ContextMenuItemSelected,"contextMenuItemSelected",["id"]],[o.DeviceCountUpdated,"deviceCountUpdated",["count"]],[o.DevicesDiscoveryConfigChanged,"devicesDiscoveryConfigChanged",["config"]],[o.DevicesPortForwardingStatusChanged,"devicesPortForwardingStatusChanged",["status"]],[o.DevicesUpdated,"devicesUpdated",["devices"]],[o.DispatchMessage,"dispatchMessage",["messageObject"]],[o.DispatchMessageChunk,"dispatchMessageChunk",["messageChunk","messageSize"]],[o.EnterInspectElementMode,"enterInspectElementMode",[]],[o.EyeDropperPickedColor,"eyeDropperPickedColor",["color"]],[o.FileSystemsLoaded,"fileSystemsLoaded",["fileSystems"]],[o.FileSystemRemoved,"fileSystemRemoved",["fileSystemPath"]],[o.FileSystemAdded,"fileSystemAdded",["errorMessage","fileSystem"]],[o.FileSystemFilesChangedAddedRemoved,"fileSystemFilesChangedAddedRemoved",["changed","added","removed"]],[o.IndexingTotalWorkCalculated,"indexingTotalWorkCalculated",["requestId","fileSystemPath","totalWork"]],[o.IndexingWorked,"indexingWorked",["requestId","fileSystemPath","worked"]],[o.IndexingDone,"indexingDone",["requestId","fileSystemPath"]],[o.KeyEventUnhandled,"keyEventUnhandled",["event"]],[o.ReloadInspectedPage,"reloadInspectedPage",["hard"]],[o.RevealSourceLine,"revealSourceLine",["url","lineNumber","columnNumber"]],[o.SavedURL,"savedURL",["url","fileSystemPath"]],[o.SearchCompleted,"searchCompleted",["requestId","fileSystemPath","files"]],[o.SetInspectedTabId,"setInspectedTabId",["tabId"]],[o.SetUseSoftMenu,"setUseSoftMenu",["useSoftMenu"]],[o.ShowPanel,"showPanel",["panelName"]]];var i=Object.freeze({__proto__:null,EventDescriptors:s,get Events(){return o}});const a={systemError:"System error",connectionError:"Connection error",certificateError:"Certificate error",httpError:"HTTP error",cacheError:"Cache error",signedExchangeError:"Signed Exchange error",ftpError:"FTP error",certificateManagerError:"Certificate manager error",dnsResolverError:"DNS resolver error",unknownError:"Unknown error",httpErrorStatusCodeSS:"HTTP error: status code {PH1}, {PH2}",invalidUrl:"Invalid URL",decodingDataUrlFailed:"Decoding Data URL failed"},d=t.i18n.registerUIStrings("core/host/ResourceLoader.ts",a),c=t.i18n.getLocalizedString.bind(void 0,d);let l=0;const u={},m=function(e){return u[++l]=e,l},g=function(e){u[e].close(),delete u[e]},p=function(e,r){u[e].write(r)};function h(e,r,t){if(void 0===e||void 0===t)return null;if(0!==e){if(function(e){return e<=-300&&e>-400}(e))return c(a.httpErrorStatusCodeSS,{PH1:String(r),PH2:t});const n=function(e){return c(e>-100?a.systemError:e>-200?a.connectionError:e>-300?a.certificateError:e>-400?a.httpError:e>-500?a.cacheError:e>-600?a.signedExchangeError:e>-700?a.ftpError:e>-800?a.certificateManagerError:e>-900?a.dnsResolverError:a.unknownError)}(e);return`${n}: ${t}`}return null}const S=function(r,t,n,o,s){const i=m(n);if(new e.ParsedURL.ParsedURL(r).isDataURL())return void(e=>new Promise(((r,t)=>{const n=new XMLHttpRequest;n.withCredentials=!1,n.open("GET",e,!0),n.onreadystatechange=function(){if(n.readyState===XMLHttpRequest.DONE){if(200!==n.status)return n.onreadystatechange=null,void t(new Error(String(n.status)));n.onreadystatechange=null,r(n.responseText)}},n.send(null)})))(r).then((function(e){p(i,e),l({statusCode:200})})).catch((function(e){l({statusCode:404,messageOverride:c(a.decodingDataUrlFailed)})}));if(!s&&function(e){try{const r=new URL(e);return"file:"===r.protocol&&""!==r.host}catch{return!1}}(r))return void(o&&o(!1,{},{statusCode:400,netError:-20,netErrorName:"net::BLOCKED_BY_CLIENT",message:"Loading from a remote file path is prohibited for security reasons."}));const d=[];if(t)for(const e in t)d.push(e+": "+t[e]);function l(e){if(o){const{success:r,description:t}=function(e){const{statusCode:r,netError:t,netErrorName:n,urlValid:o,messageOverride:s}=e;let i="";const d=r>=200&&r<300;if("string"==typeof s)i=s;else if(!d)if(void 0===t)i=c(!1===o?a.invalidUrl:a.unknownError);else{const e=h(t,r,n);e&&(i=e)}return console.assert(d===(0===i.length)),{success:d,description:{statusCode:r,netError:t,netErrorName:n,urlValid:o,message:i}}}(e);o(r,e.headers||{},t)}g(i)}f.loadNetworkResource(r,d.join("\r\n"),i,l)};var v=Object.freeze({__proto__:null,ResourceLoader:{},bindOutputStream:m,discardOutputStream:g,load:function(r,t,n,o){const s=new e.StringOutputStream.StringOutputStream;S(r,t,s,(function(e,r,t){n(e,r,s.data(),t)}),o)},loadAsStream:S,netErrorToMessage:h,streamWrite:p});const C={devtoolsS:"DevTools - {PH1}"},I=t.i18n.registerUIStrings("core/host/InspectorFrontendHost.ts",C),w=t.i18n.getLocalizedString.bind(void 0,I),k="/overrides";class E{#e=new Map;events;#r=null;recordedCountHistograms=[];recordedEnumeratedHistograms=[];recordedPerformanceHistograms=[];constructor(){function e(e){!("mac"===this.platform()?e.metaKey:e.ctrlKey)||"+"!==e.key&&"-"!==e.key||e.stopPropagation()}"undefined"!=typeof document&&document.addEventListener("keydown",(r=>{e.call(this,r)}),!0)}platform(){const e=navigator.userAgent;return e.includes("Windows NT")?"windows":e.includes("Mac OS X")?"mac":"linux"}loadCompleted(){}bringToFront(){}closeWindow(){}setIsDocked(e,r){window.setTimeout(r,0)}showSurvey(e,r){window.setTimeout((()=>r({surveyShown:!1})),0)}canShowSurvey(e,r){window.setTimeout((()=>r({canShowSurvey:!1})),0)}setInspectedPageBounds(e){}inspectElementCompleted(){}setInjectedScriptForOrigin(e,r){}inspectedURLChanged(e){document.title=w(C.devtoolsS,{PH1:e.replace(/^https?:\/\//,"")})}copyText(e){null!=e&&navigator.clipboard.writeText(e)}openInNewTab(r){e.ParsedURL.schemeIs(r,"javascript:")||window.open(r,"_blank")}openSearchResultsInNewTab(r){e.Console.Console.instance().error("Search is not enabled in hosted mode. Please inspect using chrome://inspect")}showItemInFolder(r){e.Console.Console.instance().error("Show item in folder is not enabled in hosted mode. Please inspect using chrome://inspect")}save(e,r,t,n){let s=this.#e.get(e);s||(s=[],this.#e.set(e,s)),s.push(r),this.events.dispatchEventToListeners(o.SavedURL,{url:e,fileSystemPath:e})}append(e,r){const t=this.#e.get(e);t&&(t.push(r),this.events.dispatchEventToListeners(o.AppendedToURL,e))}close(e){const r=this.#e.get(e)||[];this.#e.delete(e);let t="";if(e)try{const r=n.StringUtilities.trimURL(e);t=n.StringUtilities.removeURLFragment(r)}catch(r){t=e}const o=document.createElement("a");o.download=t;const s=new Blob([r.join("")],{type:"text/plain"}),i=URL.createObjectURL(s);o.href=i,o.click(),URL.revokeObjectURL(i)}sendMessageToBackend(e){}recordCountHistogram(e,r,t,n,o){this.recordedCountHistograms.length>=100&&this.recordedCountHistograms.shift(),this.recordedCountHistograms.push({histogramName:e,sample:r,min:t,exclusiveMax:n,bucketSize:o})}recordEnumeratedHistogram(e,r,t){this.recordedEnumeratedHistograms.length>=100&&this.recordedEnumeratedHistograms.shift(),this.recordedEnumeratedHistograms.push({actionName:e,actionCode:r})}recordPerformanceHistogram(e,r){this.recordedPerformanceHistograms.length>=100&&this.recordedPerformanceHistograms.shift(),this.recordedPerformanceHistograms.push({histogramName:e,duration:r})}recordUserMetricsAction(e){}connectAutomaticFileSystem(e,r,t,n){queueMicrotask((()=>n({success:!1})))}disconnectAutomaticFileSystem(e){}requestFileSystems(){this.events.dispatchEventToListeners(o.FileSystemsLoaded,[])}addFileSystem(e){window.webkitRequestFileSystem(window.TEMPORARY,1048576,(e=>{this.#r=e;const r={fileSystemName:"sandboxedRequestedFileSystem",fileSystemPath:k,rootURL:"filesystem:devtools://devtools/isolated/",type:"overrides"};this.events.dispatchEventToListeners(o.FileSystemAdded,{fileSystem:r})}))}removeFileSystem(e){const r=e=>{e.forEach((e=>{e.isDirectory?e.removeRecursively((()=>{})):e.isFile&&e.remove((()=>{}))}))};this.#r&&this.#r.root.createReader().readEntries(r),this.#r=null,this.events.dispatchEventToListeners(o.FileSystemRemoved,k)}isolatedFileSystem(e,r){return this.#r}loadNetworkResource(e,r,t,n){fetch(e).then((async e=>{const r=await e.arrayBuffer();let t=r;if(function(e){const r=new Uint8Array(e);return!(!r||r.length<3)&&31===r[0]&&139===r[1]&&8===r[2]}(r)){const e=new DecompressionStream("gzip"),n=e.writable.getWriter();n.write(r),n.close(),t=e.readable}return await new Response(t).text()})).then((function(e){p(t,e),n({statusCode:200,headers:void 0,messageOverride:void 0,netError:void 0,netErrorName:void 0,urlValid:void 0})})).catch((function(){n({statusCode:404,headers:void 0,messageOverride:void 0,netError:void 0,netErrorName:void 0,urlValid:void 0})}))}registerPreference(e,r){}getPreferences(e){const r={};for(const e in window.localStorage)r[e]=window.localStorage[e];e(r)}getPreference(e,r){r(window.localStorage[e])}setPreference(e,r){window.localStorage[e]=r}removePreference(e){delete window.localStorage[e]}clearPreferences(){window.localStorage.clear()}getSyncInformation(e){if("getSyncInformationForTesting"in globalThis)return e(globalThis.getSyncInformationForTesting());e({isSyncActive:!1,arePreferencesSynced:!1})}getHostConfig(e){const r={devToolsVeLogging:{enabled:!0},thirdPartyCookieControls:{thirdPartyCookieMetadataEnabled:!0,thirdPartyCookieHeuristicsEnabled:!0,managedBlockThirdPartyCookies:"Unset"}};if("hostConfigForTesting"in globalThis){const{hostConfigForTesting:e}=globalThis;for(const t of Object.keys(e)){const n=t=>{"object"==typeof r[t]&&"object"==typeof e[t]?r[t]={...r[t],...e[t]}:r[t]=e[t]??r[t]};n(t)}}e(r)}upgradeDraggedFileSystemPermissions(e){}indexPath(e,r,t){}stopIndexing(e){}searchInPath(e,r,t){}zoomFactor(){return 1}zoomIn(){}zoomOut(){}resetZoom(){}setWhitelistedShortcuts(e){}setEyeDropperActive(e){}showCertificateViewer(e){}reattach(e){e()}readyForTest(){}connectionReady(){}setOpenNewWindowForPopups(e){}setDevicesDiscoveryConfig(e){}setDevicesUpdatesEnabled(e){}openRemotePage(e,r){}openNodeFrontend(){}showContextMenuAtPoint(e,r,t,n){throw new Error("Soft context menu should be used")}isHostedMode(){return!0}setAddExtensionCallback(e){}async initialTargetId(){return null}doAidaConversation(e,r,t){t({error:"Not implemented"})}registerAidaClientEvent(e,r){r({error:"Not implemented"})}recordImpression(e){}recordResize(e){}recordClick(e){}recordHover(e){}recordDrag(e){}recordChange(e){}recordKeyDown(e){}recordSettingAccess(e){}}let f=globalThis.InspectorFrontendHost;class y{constructor(){for(const e of s)this[e[1]]=this.dispatch.bind(this,e[0],e[2],e[3])}dispatch(e,r,t,...n){if(r.length<2){try{f.events.dispatchEventToListeners(e,n[0])}catch(e){console.error(e+" "+e.stack)}return}const o={};for(let e=0;e=0&&(o.options??={},o.options.temperature=i),s&&(o.options??={},o.options.model_id=s),o}static async checkAccessPreconditions(){if(!navigator.onLine)return"no-internet";const e=await new Promise((e=>f.getSyncInformation((r=>e(r)))));return e.accountEmail?e.isSyncPaused?"sync-is-paused":"available":"no-account-email"}async*fetch(e,r){if(!f.doAidaConversation)throw new Error("doAidaConversation is not available");const t=(()=>{let{promise:e,resolve:t,reject:n}=Promise.withResolvers();return r?.signal?.addEventListener("abort",(()=>{n(new O)}),{once:!0}),{write:async r=>{t(r),({promise:e,resolve:t,reject:n}=Promise.withResolvers())},close:async()=>{t(null)},read:()=>e,fail:e=>n(e)}})(),n=m(t);let o;f.doAidaConversation(JSON.stringify(e),n,(e=>{403===e.statusCode?t.fail(new Error("Server responded: permission denied")):e.error?t.fail(new Error(`Cannot send request: ${e.error} ${e.detail||""}`)):"net::ERR_TIMED_OUT"===e.netErrorName?t.fail(new Error("doAidaConversation timed out")):200!==e.statusCode?t.fail(new Error(`Request failed: ${JSON.stringify(e)}`)):t.close()}));const s=[];let i=!1;const a=[];let d={rpcGlobalId:0};for(;o=await t.read();){let e,r=!1;if(o.length){o.startsWith(",")&&(o=o.slice(1)),o.startsWith("[")||(o="["+o),o.endsWith("]")||(o+="]");try{e=JSON.parse(o)}catch(e){throw new Error("Cannot parse chunk: "+o,{cause:e})}for(const t of e){if("metadata"in t&&(d=t.metadata,d?.attributionMetadata?.attributionAction===T.BLOCK))throw new N;if("textChunk"in t)i&&(s.push(_),i=!1),s.push(t.textChunk.text),r=!0;else if("codeChunk"in t)i||(s.push(_),i=!0),s.push(t.codeChunk.code),r=!0;else{if(!("functionCallChunk"in t))throw"error"in t?new Error(`Server responded: ${JSON.stringify(t)}`):new Error("Unknown chunk result");a.push({name:t.functionCallChunk.functionCall.name,args:t.functionCallChunk.functionCall.args})}}r&&(yield{explanation:s.join("")+(i?_:""),metadata:d,completed:!1})}}yield{explanation:s.join("")+(i?_:""),metadata:d,functionCalls:a.length?a:void 0,completed:!0}}registerClientEvent(e){const{promise:r,resolve:t}=Promise.withResolvers();return f.registerAidaClientEvent(JSON.stringify({client:M,event_time:(new Date).toISOString(),...e}),t),r}}let D;class H extends e.ObjectWrapper.ObjectWrapper{#t;#n;constructor(){super()}static instance(){return D||(D=new H),D}addEventListener(e,r){const t=!this.hasEventListeners(e),n=super.addEventListener(e,r);return t&&(window.clearTimeout(this.#t),this.pollAidaAvailability()),n}removeEventListener(e,r){super.removeEventListener(e,r),this.hasEventListeners(e)||window.clearTimeout(this.#t)}async pollAidaAvailability(){this.#t=window.setTimeout((()=>this.pollAidaAvailability()),2e3);const e=await L.checkAccessPreconditions();if(e!==this.#n){this.#n=e;const t=await new Promise((e=>f.getHostConfig(e)));Object.assign(r.Runtime.hostConfig,t),this.dispatchEventToListeners("aidaAvailabilityChanged")}}}var U=Object.freeze({__proto__:null,AidaAbortError:O,AidaBlockError:N,AidaClient:L,CLIENT_NAME:M,get CitationSourceType(){return x},get ClientFeature(){return P},get FunctionalityType(){return A},HostConfigTracker:H,get RecitationAction(){return T},get Role(){return b},get UserTier(){return R},convertToUserTierEnum:function(e){if(e)switch(e){case"TESTERS":return R.TESTERS;case"BETA":return R.BETA;case"PUBLIC":return R.PUBLIC}return R.BETA}});let W,B,V,G,j;function q(){return W||(W=f.platform()),W}var X=Object.freeze({__proto__:null,fontFamily:function(){if(j)return j;switch(q()){case"linux":j="Roboto, Ubuntu, Arial, sans-serif";break;case"mac":j="'Lucida Grande', sans-serif";break;case"windows":j="'Segoe UI', Tahoma, sans-serif"}return j},isCustomDevtoolsFrontend:function(){return void 0===G&&(G=window.location.toString().startsWith("devtools://devtools/custom/")),G},isMac:function(){return void 0===B&&(B="mac"===q()),B},isWin:function(){return void 0===V&&(V="windows"===q()),V},platform:q,setPlatformForTests:function(e){W=e,B=void 0,V=void 0}});let z=null;function K(){return null===z&&(z=new $),z}class ${#o="error";#s=new Set;#i=null;#a=null;#d="rn_inspector";#c={};#l=new Map;isEnabled(){return!0===globalThis.enableReactNativePerfMetrics}addEventListener(e){this.#s.add(e);return()=>{this.#s.delete(e)}}removeAllEventListeners(){this.#s.clear()}sendEvent(e){if(!0!==globalThis.enableReactNativePerfMetrics)return;const r=this.#u(e),t=[];for(const e of this.#s)try{e(r)}catch(e){t.push(e)}if(t.length>0){const e=new AggregateError(t);console.error("Error occurred when calling event listeners",e)}}registerPerfMetricsGlobalPostMessageHandler(){!0===globalThis.enableReactNativePerfMetrics&&!0===globalThis.enableReactNativePerfMetricsGlobalPostMessage&&this.addEventListener((e=>{window.postMessage({event:e,tag:"react-native-chrome-devtools-perf-metrics"},window.location.origin)}))}registerGlobalErrorReporting(){window.addEventListener("error",(e=>{const[r,t]=Y(`[RNPerfMetrics] uncaught error: ${e.message}`,e.error);this.sendEvent({eventName:"Browser.Error",params:{type:"error",message:r,error:t}})}),{passive:!0}),window.addEventListener("unhandledrejection",(e=>{const[r,t]=Y("[RNPerfMetrics] unhandled promise rejection",e.reason);this.sendEvent({eventName:"Browser.Error",params:{type:"rejectedPromise",message:r,error:t}})}),{passive:!0});const e=globalThis.console,r=e[this.#o];e[this.#o]=(...t)=>{try{const e=t[0],[r,n]=Y("[RNPerfMetrics] console.error",e);this.sendEvent({eventName:"Browser.Error",params:{message:r,error:n,type:"consoleError"}})}catch(e){const[r,t]=Y("[RNPerfMetrics] Error handling console.error",e);this.sendEvent({eventName:"Browser.Error",params:{message:r,error:t,type:"consoleError"}})}finally{r.apply(e,t)}}}setLaunchId(e){this.#i=e}setAppId(e){this.#a=e}setTelemetryInfo(e){this.#c=e}entryPointLoadingStarted(e){this.#d=e,this.sendEvent({eventName:"Entrypoint.LoadingStarted",entryPoint:e})}entryPointLoadingFinished(e){this.sendEvent({eventName:"Entrypoint.LoadingFinished",entryPoint:e})}browserVisibilityChanged(e){this.sendEvent({eventName:"Browser.VisibilityChange",params:{visibilityState:e}})}remoteDebuggingTerminated(e={}){this.sendEvent({eventName:"Connection.DebuggingTerminated",params:e})}developerResourceLoadingStarted(e,r){const t=Q(e);this.sendEvent({eventName:"DeveloperResource.LoadingStarted",params:{url:t,loadingMethod:r}})}developerResourceLoadingFinished(e,r,t){const n=Q(e);this.sendEvent({eventName:"DeveloperResource.LoadingFinished",params:{url:n,loadingMethod:r,success:t.success,errorMessage:t.errorDescription?.message}})}developerResourcesStartupLoadingFinishedEvent(e,r){this.sendEvent({eventName:"DeveloperResources.StartupLoadingFinished",params:{numResources:e,timeSinceLaunch:r}})}fuseboxSetClientMetadataStarted(){this.sendEvent({eventName:"FuseboxSetClientMetadataStarted"})}fuseboxSetClientMetadataFinished(e,r){if(e)this.sendEvent({eventName:"FuseboxSetClientMetadataFinished",params:{success:!0}});else{const[e,t]=Y("[RNPerfMetrics] Fusebox setClientMetadata failed",r);this.sendEvent({eventName:"FuseboxSetClientMetadataFinished",params:{success:!1,error:t,errorMessage:e}})}}heapSnapshotStarted(){this.sendEvent({eventName:"MemoryPanelActionStarted",params:{action:"snapshot"}})}heapSnapshotFinished(e){this.sendEvent({eventName:"MemoryPanelActionFinished",params:{action:"snapshot",success:e}})}heapProfilingStarted(){this.sendEvent({eventName:"MemoryPanelActionStarted",params:{action:"profiling"}})}heapProfilingFinished(e){this.sendEvent({eventName:"MemoryPanelActionFinished",params:{action:"profiling",success:e}})}heapSamplingStarted(){this.sendEvent({eventName:"MemoryPanelActionStarted",params:{action:"sampling"}})}heapSamplingFinished(e){this.sendEvent({eventName:"MemoryPanelActionFinished",params:{action:"sampling",success:e}})}stackTraceSymbolicationSucceeded(e){this.sendEvent({eventName:"StackTraceSymbolicationSucceeded",params:{specialHermesFrameTypes:e}})}stackTraceSymbolicationFailed(e,r,t){this.sendEvent({eventName:"StackTraceSymbolicationFailed",params:{stackTrace:e,line:r,reason:t}})}stackTraceFrameUrlResolutionSucceeded(){this.sendEvent({eventName:"StackTraceFrameUrlResolutionSucceeded"})}stackTraceFrameUrlResolutionFailed(e){this.sendEvent({eventName:"StackTraceFrameUrlResolutionFailed",params:{uniqueUrls:e}})}manualBreakpointSetSucceeded(e){this.sendEvent({eventName:"ManualBreakpointSetSucceeded",params:{bpSettingDuration:e}})}stackTraceFrameClicked(e){this.sendEvent({eventName:"StackTraceFrameClicked",params:{isLinkified:e}})}panelShown(e,r){}panelShownInLocation(e,r){this.sendEvent({eventName:"PanelShown",params:{location:r,newPanelName:e}}),this.#l.set(r,e)}#u(e){return{...e,...{timestamp:performance.timeOrigin+performance.now(),launchId:this.#i,appId:this.#a,entryPoint:this.#d,telemetryInfo:this.#c,currentPanels:this.#l}}}}function Q(e){const{url:r}=e;return"http"===e.scheme||"https"===e.scheme?r:`${r.slice(0,100)} …(omitted ${r.length-100} characters)`}function Y(e,r){if(r instanceof Error){return[`${e}: ${r.message}`,r]}const t=`${e}: ${String(r)}`;return[t,new Error(t,{cause:r})]}var J,Z,ee,re,te,ne,oe,se,ie,ae,de,ce,le,ue=Object.freeze({__proto__:null,getInstance:K});class me{#m;#g;#p;constructor(){this.#m=!1,this.#g=!1,this.#p=""}panelShown(e,r){const t=Z[e]||0;f.recordEnumeratedHistogram("DevTools.PanelShown",t,Z.MAX_VALUE),f.recordUserMetricsAction("DevTools_PanelShown_"+e),r||(this.#m=!0),K().panelShown(e,r)}panelShownInLocation(e,r){const t=ee[`${e}-${r}`]||0;f.recordEnumeratedHistogram("DevTools.PanelShownInLocation",t,ee.MAX_VALUE),K().panelShownInLocation(e,r)}settingsPanelShown(e){this.panelShown("settings-"+e)}sourcesPanelFileDebugged(e){const r=e&&te[e]||te.Unknown;f.recordEnumeratedHistogram("DevTools.SourcesPanelFileDebugged",r,te.MAX_VALUE)}sourcesPanelFileOpened(e){const r=e&&te[e]||te.Unknown;f.recordEnumeratedHistogram("DevTools.SourcesPanelFileOpened",r,te.MAX_VALUE)}networkPanelResponsePreviewOpened(e){const r=e&&te[e]||te.Unknown;f.recordEnumeratedHistogram("DevTools.NetworkPanelResponsePreviewOpened",r,te.MAX_VALUE)}actionTaken(e){f.recordEnumeratedHistogram("DevTools.ActionTaken",e,J.MAX_VALUE)}panelLoaded(e,r){this.#g||e!==this.#p||(this.#g=!0,requestAnimationFrame((()=>{window.setTimeout((()=>{performance.mark(r),this.#m||f.recordPerformanceHistogram(r,performance.now())}),0)})))}setLaunchPanel(e){this.#p=e}performanceTraceLoad(e){f.recordPerformanceHistogram("DevTools.TraceLoad",e.duration)}keybindSetSettingChanged(e){const r=ne[e]||0;f.recordEnumeratedHistogram("DevTools.KeybindSetSettingChanged",r,ne.MAX_VALUE)}keyboardShortcutFired(e){const r=oe[e]||oe.OtherShortcut;f.recordEnumeratedHistogram("DevTools.KeyboardShortcutFired",r,oe.MAX_VALUE)}issuesPanelOpenedFrom(e){f.recordEnumeratedHistogram("DevTools.IssuesPanelOpenedFrom",e,6)}issuesPanelIssueExpanded(e){if(void 0===e)return;const r=ie[e];void 0!==r&&f.recordEnumeratedHistogram("DevTools.IssuesPanelIssueExpanded",r,ie.MAX_VALUE)}issuesPanelResourceOpened(e,r){const t=ae[e+r];void 0!==t&&f.recordEnumeratedHistogram("DevTools.IssuesPanelResourceOpened",t,ae.MAX_VALUE)}issueCreated(e){const r=de[e];void 0!==r&&f.recordEnumeratedHistogram("DevTools.IssueCreated",r,de.MAX_VALUE)}experimentEnabledAtLaunch(e){const r=se[e];void 0!==r&&f.recordEnumeratedHistogram("DevTools.ExperimentEnabledAtLaunch",r,se.MAX_VALUE)}navigationSettingAtFirstTimelineLoad(e){f.recordEnumeratedHistogram("DevTools.TimelineNavigationSettingState",e,4)}experimentDisabledAtLaunch(e){const r=se[e];void 0!==r&&f.recordEnumeratedHistogram("DevTools.ExperimentDisabledAtLaunch",r,se.MAX_VALUE)}experimentChanged(e,r){const t=se[e];if(void 0===t)return;const n=r?"DevTools.ExperimentEnabled":"DevTools.ExperimentDisabled";f.recordEnumeratedHistogram(n,t,se.MAX_VALUE)}developerResourceLoaded(e){e>=8||f.recordEnumeratedHistogram("DevTools.DeveloperResourceLoaded",e,8)}developerResourceScheme(e){e>=9||f.recordEnumeratedHistogram("DevTools.DeveloperResourceScheme",e,9)}language(e){const r=ce[e];void 0!==r&&f.recordEnumeratedHistogram("DevTools.Language",r,ce.MAX_VALUE)}syncSetting(e){f.getSyncInformation((r=>{let t=1;r.isSyncActive&&!r.arePreferencesSynced?t=2:r.isSyncActive&&r.arePreferencesSynced&&(t=e?4:3),f.recordEnumeratedHistogram("DevTools.SyncSetting",t,5)}))}recordingAssertion(e){f.recordEnumeratedHistogram("DevTools.RecordingAssertion",e,4)}recordingToggled(e){f.recordEnumeratedHistogram("DevTools.RecordingToggled",e,3)}recordingReplayFinished(e){f.recordEnumeratedHistogram("DevTools.RecordingReplayFinished",e,5)}recordingReplaySpeed(e){f.recordEnumeratedHistogram("DevTools.RecordingReplaySpeed",e,5)}recordingReplayStarted(e){f.recordEnumeratedHistogram("DevTools.RecordingReplayStarted",e,4)}recordingEdited(e){f.recordEnumeratedHistogram("DevTools.RecordingEdited",e,11)}recordingExported(e){f.recordEnumeratedHistogram("DevTools.RecordingExported",e,6)}recordingCodeToggled(e){f.recordEnumeratedHistogram("DevTools.RecordingCodeToggled",e,3)}recordingCopiedToClipboard(e){f.recordEnumeratedHistogram("DevTools.RecordingCopiedToClipboard",e,9)}cssHintShown(e){f.recordEnumeratedHistogram("DevTools.CSSHintShown",e,14)}lighthouseModeRun(e){f.recordEnumeratedHistogram("DevTools.LighthouseModeRun",e,4)}lighthouseCategoryUsed(e){f.recordEnumeratedHistogram("DevTools.LighthouseCategoryUsed",e,6)}swatchActivated(e){f.recordEnumeratedHistogram("DevTools.SwatchActivated",e,11)}animationPlaybackRateChanged(e){f.recordEnumeratedHistogram("DevTools.AnimationPlaybackRateChanged",e,4)}animationPointDragged(e){f.recordEnumeratedHistogram("DevTools.AnimationPointDragged",e,5)}workspacesPopulated(e){f.recordPerformanceHistogram("DevTools.Workspaces.PopulateWallClocktime",e)}visualLoggingProcessingDone(e){f.recordPerformanceHistogram("DevTools.VisualLogging.ProcessingTime",e)}freestylerQueryLength(e){f.recordCountHistogram("DevTools.Freestyler.QueryLength",e,0,1e5,100)}freestylerEvalResponseSize(e){f.recordCountHistogram("DevTools.Freestyler.EvalResponseSize",e,0,1e5,100)}}!function(e){e[e.WindowDocked=1]="WindowDocked",e[e.WindowUndocked=2]="WindowUndocked",e[e.ScriptsBreakpointSet=3]="ScriptsBreakpointSet",e[e.TimelineStarted=4]="TimelineStarted",e[e.ProfilesCPUProfileTaken=5]="ProfilesCPUProfileTaken",e[e.ProfilesHeapProfileTaken=6]="ProfilesHeapProfileTaken",e[e.ConsoleEvaluated=8]="ConsoleEvaluated",e[e.FileSavedInWorkspace=9]="FileSavedInWorkspace",e[e.DeviceModeEnabled=10]="DeviceModeEnabled",e[e.AnimationsPlaybackRateChanged=11]="AnimationsPlaybackRateChanged",e[e.RevisionApplied=12]="RevisionApplied",e[e.FileSystemDirectoryContentReceived=13]="FileSystemDirectoryContentReceived",e[e.StyleRuleEdited=14]="StyleRuleEdited",e[e.CommandEvaluatedInConsolePanel=15]="CommandEvaluatedInConsolePanel",e[e.DOMPropertiesExpanded=16]="DOMPropertiesExpanded",e[e.ResizedViewInResponsiveMode=17]="ResizedViewInResponsiveMode",e[e.TimelinePageReloadStarted=18]="TimelinePageReloadStarted",e[e.ConnectToNodeJSFromFrontend=19]="ConnectToNodeJSFromFrontend",e[e.ConnectToNodeJSDirectly=20]="ConnectToNodeJSDirectly",e[e.CpuThrottlingEnabled=21]="CpuThrottlingEnabled",e[e.CpuProfileNodeFocused=22]="CpuProfileNodeFocused",e[e.CpuProfileNodeExcluded=23]="CpuProfileNodeExcluded",e[e.SelectFileFromFilePicker=24]="SelectFileFromFilePicker",e[e.SelectCommandFromCommandMenu=25]="SelectCommandFromCommandMenu",e[e.ChangeInspectedNodeInElementsPanel=26]="ChangeInspectedNodeInElementsPanel",e[e.StyleRuleCopied=27]="StyleRuleCopied",e[e.CoverageStarted=28]="CoverageStarted",e[e.LighthouseStarted=29]="LighthouseStarted",e[e.LighthouseFinished=30]="LighthouseFinished",e[e.ShowedThirdPartyBadges=31]="ShowedThirdPartyBadges",e[e.LighthouseViewTrace=32]="LighthouseViewTrace",e[e.FilmStripStartedRecording=33]="FilmStripStartedRecording",e[e.CoverageReportFiltered=34]="CoverageReportFiltered",e[e.CoverageStartedPerBlock=35]="CoverageStartedPerBlock",e[e["SettingsOpenedFromGear-deprecated"]=36]="SettingsOpenedFromGear-deprecated",e[e["SettingsOpenedFromMenu-deprecated"]=37]="SettingsOpenedFromMenu-deprecated",e[e["SettingsOpenedFromCommandMenu-deprecated"]=38]="SettingsOpenedFromCommandMenu-deprecated",e[e.TabMovedToDrawer=39]="TabMovedToDrawer",e[e.TabMovedToMainPanel=40]="TabMovedToMainPanel",e[e.CaptureCssOverviewClicked=41]="CaptureCssOverviewClicked",e[e.VirtualAuthenticatorEnvironmentEnabled=42]="VirtualAuthenticatorEnvironmentEnabled",e[e.SourceOrderViewActivated=43]="SourceOrderViewActivated",e[e.UserShortcutAdded=44]="UserShortcutAdded",e[e.ShortcutRemoved=45]="ShortcutRemoved",e[e.ShortcutModified=46]="ShortcutModified",e[e.CustomPropertyLinkClicked=47]="CustomPropertyLinkClicked",e[e.CustomPropertyEdited=48]="CustomPropertyEdited",e[e.ServiceWorkerNetworkRequestClicked=49]="ServiceWorkerNetworkRequestClicked",e[e.ServiceWorkerNetworkRequestClosedQuickly=50]="ServiceWorkerNetworkRequestClosedQuickly",e[e.NetworkPanelServiceWorkerRespondWith=51]="NetworkPanelServiceWorkerRespondWith",e[e.NetworkPanelCopyValue=52]="NetworkPanelCopyValue",e[e.ConsoleSidebarOpened=53]="ConsoleSidebarOpened",e[e.PerfPanelTraceImported=54]="PerfPanelTraceImported",e[e.PerfPanelTraceExported=55]="PerfPanelTraceExported",e[e.StackFrameRestarted=56]="StackFrameRestarted",e[e.CaptureTestProtocolClicked=57]="CaptureTestProtocolClicked",e[e.BreakpointRemovedFromRemoveButton=58]="BreakpointRemovedFromRemoveButton",e[e.BreakpointGroupExpandedStateChanged=59]="BreakpointGroupExpandedStateChanged",e[e.HeaderOverrideFileCreated=60]="HeaderOverrideFileCreated",e[e.HeaderOverrideEnableEditingClicked=61]="HeaderOverrideEnableEditingClicked",e[e.HeaderOverrideHeaderAdded=62]="HeaderOverrideHeaderAdded",e[e.HeaderOverrideHeaderEdited=63]="HeaderOverrideHeaderEdited",e[e.HeaderOverrideHeaderRemoved=64]="HeaderOverrideHeaderRemoved",e[e.HeaderOverrideHeadersFileEdited=65]="HeaderOverrideHeadersFileEdited",e[e.PersistenceNetworkOverridesEnabled=66]="PersistenceNetworkOverridesEnabled",e[e.PersistenceNetworkOverridesDisabled=67]="PersistenceNetworkOverridesDisabled",e[e.BreakpointRemovedFromContextMenu=68]="BreakpointRemovedFromContextMenu",e[e.BreakpointsInFileRemovedFromRemoveButton=69]="BreakpointsInFileRemovedFromRemoveButton",e[e.BreakpointsInFileRemovedFromContextMenu=70]="BreakpointsInFileRemovedFromContextMenu",e[e.BreakpointsInFileCheckboxToggled=71]="BreakpointsInFileCheckboxToggled",e[e.BreakpointsInFileEnabledDisabledFromContextMenu=72]="BreakpointsInFileEnabledDisabledFromContextMenu",e[e.BreakpointConditionEditedFromSidebar=73]="BreakpointConditionEditedFromSidebar",e[e.WorkspaceTabAddFolder=74]="WorkspaceTabAddFolder",e[e.WorkspaceTabRemoveFolder=75]="WorkspaceTabRemoveFolder",e[e.OverrideTabAddFolder=76]="OverrideTabAddFolder",e[e.OverrideTabRemoveFolder=77]="OverrideTabRemoveFolder",e[e.WorkspaceSourceSelected=78]="WorkspaceSourceSelected",e[e.OverridesSourceSelected=79]="OverridesSourceSelected",e[e.StyleSheetInitiatorLinkClicked=80]="StyleSheetInitiatorLinkClicked",e[e.BreakpointRemovedFromGutterContextMenu=81]="BreakpointRemovedFromGutterContextMenu",e[e.BreakpointRemovedFromGutterToggle=82]="BreakpointRemovedFromGutterToggle",e[e.StylePropertyInsideKeyframeEdited=83]="StylePropertyInsideKeyframeEdited",e[e.OverrideContentFromSourcesContextMenu=84]="OverrideContentFromSourcesContextMenu",e[e.OverrideContentFromNetworkContextMenu=85]="OverrideContentFromNetworkContextMenu",e[e.OverrideScript=86]="OverrideScript",e[e.OverrideStyleSheet=87]="OverrideStyleSheet",e[e.OverrideDocument=88]="OverrideDocument",e[e.OverrideFetchXHR=89]="OverrideFetchXHR",e[e.OverrideImage=90]="OverrideImage",e[e.OverrideFont=91]="OverrideFont",e[e.OverrideContentContextMenuSetup=92]="OverrideContentContextMenuSetup",e[e.OverrideContentContextMenuAbandonSetup=93]="OverrideContentContextMenuAbandonSetup",e[e.OverrideContentContextMenuActivateDisabled=94]="OverrideContentContextMenuActivateDisabled",e[e.OverrideContentContextMenuOpenExistingFile=95]="OverrideContentContextMenuOpenExistingFile",e[e.OverrideContentContextMenuSaveNewFile=96]="OverrideContentContextMenuSaveNewFile",e[e.ShowAllOverridesFromSourcesContextMenu=97]="ShowAllOverridesFromSourcesContextMenu",e[e.ShowAllOverridesFromNetworkContextMenu=98]="ShowAllOverridesFromNetworkContextMenu",e[e.AnimationGroupsCleared=99]="AnimationGroupsCleared",e[e.AnimationsPaused=100]="AnimationsPaused",e[e.AnimationsResumed=101]="AnimationsResumed",e[e.AnimatedNodeDescriptionClicked=102]="AnimatedNodeDescriptionClicked",e[e.AnimationGroupScrubbed=103]="AnimationGroupScrubbed",e[e.AnimationGroupReplayed=104]="AnimationGroupReplayed",e[e.OverrideTabDeleteFolderContextMenu=105]="OverrideTabDeleteFolderContextMenu",e[e.WorkspaceDropFolder=107]="WorkspaceDropFolder",e[e.WorkspaceSelectFolder=108]="WorkspaceSelectFolder",e[e.OverrideContentContextMenuSourceMappedWarning=109]="OverrideContentContextMenuSourceMappedWarning",e[e.OverrideContentContextMenuRedirectToDeployed=110]="OverrideContentContextMenuRedirectToDeployed",e[e.NewStyleRuleAdded=111]="NewStyleRuleAdded",e[e.TraceExpanded=112]="TraceExpanded",e[e.InsightConsoleMessageShown=113]="InsightConsoleMessageShown",e[e.InsightRequestedViaContextMenu=114]="InsightRequestedViaContextMenu",e[e.InsightRequestedViaHoverButton=115]="InsightRequestedViaHoverButton",e[e.InsightRatedPositive=117]="InsightRatedPositive",e[e.InsightRatedNegative=118]="InsightRatedNegative",e[e.InsightClosed=119]="InsightClosed",e[e.InsightErrored=120]="InsightErrored",e[e.InsightHoverButtonShown=121]="InsightHoverButtonShown",e[e.SelfXssWarningConsoleMessageShown=122]="SelfXssWarningConsoleMessageShown",e[e.SelfXssWarningDialogShown=123]="SelfXssWarningDialogShown",e[e.SelfXssAllowPastingInConsole=124]="SelfXssAllowPastingInConsole",e[e.SelfXssAllowPastingInDialog=125]="SelfXssAllowPastingInDialog",e[e.ToggleEmulateFocusedPageFromStylesPaneOn=126]="ToggleEmulateFocusedPageFromStylesPaneOn",e[e.ToggleEmulateFocusedPageFromStylesPaneOff=127]="ToggleEmulateFocusedPageFromStylesPaneOff",e[e.ToggleEmulateFocusedPageFromRenderingTab=128]="ToggleEmulateFocusedPageFromRenderingTab",e[e.ToggleEmulateFocusedPageFromCommandMenu=129]="ToggleEmulateFocusedPageFromCommandMenu",e[e.InsightGenerated=130]="InsightGenerated",e[e.InsightErroredApi=131]="InsightErroredApi",e[e.InsightErroredMarkdown=132]="InsightErroredMarkdown",e[e.ToggleShowWebVitals=133]="ToggleShowWebVitals",e[e.InsightErroredPermissionDenied=134]="InsightErroredPermissionDenied",e[e.InsightErroredCannotSend=135]="InsightErroredCannotSend",e[e.InsightErroredRequestFailed=136]="InsightErroredRequestFailed",e[e.InsightErroredCannotParseChunk=137]="InsightErroredCannotParseChunk",e[e.InsightErroredUnknownChunk=138]="InsightErroredUnknownChunk",e[e.InsightErroredOther=139]="InsightErroredOther",e[e.AutofillReceived=140]="AutofillReceived",e[e.AutofillReceivedAndTabAutoOpened=141]="AutofillReceivedAndTabAutoOpened",e[e.AnimationGroupSelected=142]="AnimationGroupSelected",e[e.ScrollDrivenAnimationGroupSelected=143]="ScrollDrivenAnimationGroupSelected",e[e.ScrollDrivenAnimationGroupScrubbed=144]="ScrollDrivenAnimationGroupScrubbed",e[e.AiAssistanceOpenedFromElementsPanel=145]="AiAssistanceOpenedFromElementsPanel",e[e.AiAssistanceOpenedFromStylesTab=146]="AiAssistanceOpenedFromStylesTab",e[e.ConsoleFilterByContext=147]="ConsoleFilterByContext",e[e.ConsoleFilterBySource=148]="ConsoleFilterBySource",e[e.ConsoleFilterByUrl=149]="ConsoleFilterByUrl",e[e.InsightConsentReminderShown=150]="InsightConsentReminderShown",e[e.InsightConsentReminderCanceled=151]="InsightConsentReminderCanceled",e[e.InsightConsentReminderConfirmed=152]="InsightConsentReminderConfirmed",e[e.InsightsOnboardingShown=153]="InsightsOnboardingShown",e[e.InsightsOnboardingCanceledOnPage1=154]="InsightsOnboardingCanceledOnPage1",e[e.InsightsOnboardingCanceledOnPage2=155]="InsightsOnboardingCanceledOnPage2",e[e.InsightsOnboardingConfirmed=156]="InsightsOnboardingConfirmed",e[e.InsightsOnboardingNextPage=157]="InsightsOnboardingNextPage",e[e.InsightsOnboardingPrevPage=158]="InsightsOnboardingPrevPage",e[e.InsightsOnboardingFeatureDisabled=159]="InsightsOnboardingFeatureDisabled",e[e.InsightsOptInTeaserShown=160]="InsightsOptInTeaserShown",e[e.InsightsOptInTeaserSettingsLinkClicked=161]="InsightsOptInTeaserSettingsLinkClicked",e[e.InsightsOptInTeaserConfirmedInSettings=162]="InsightsOptInTeaserConfirmedInSettings",e[e.InsightsReminderTeaserShown=163]="InsightsReminderTeaserShown",e[e.InsightsReminderTeaserConfirmed=164]="InsightsReminderTeaserConfirmed",e[e.InsightsReminderTeaserCanceled=165]="InsightsReminderTeaserCanceled",e[e.InsightsReminderTeaserSettingsLinkClicked=166]="InsightsReminderTeaserSettingsLinkClicked",e[e.InsightsReminderTeaserAbortedInSettings=167]="InsightsReminderTeaserAbortedInSettings",e[e.GeneratingInsightWithoutDisclaimer=168]="GeneratingInsightWithoutDisclaimer",e[e.AiAssistanceOpenedFromElementsPanelFloatingButton=169]="AiAssistanceOpenedFromElementsPanelFloatingButton",e[e.AiAssistanceOpenedFromNetworkPanel=170]="AiAssistanceOpenedFromNetworkPanel",e[e.AiAssistanceOpenedFromSourcesPanel=171]="AiAssistanceOpenedFromSourcesPanel",e[e.AiAssistanceOpenedFromSourcesPanelFloatingButton=172]="AiAssistanceOpenedFromSourcesPanelFloatingButton",e[e.AiAssistanceOpenedFromPerformancePanel=173]="AiAssistanceOpenedFromPerformancePanel",e[e.AiAssistanceOpenedFromNetworkPanelFloatingButton=174]="AiAssistanceOpenedFromNetworkPanelFloatingButton",e[e.AiAssistancePanelOpened=175]="AiAssistancePanelOpened",e[e.AiAssistanceQuerySubmitted=176]="AiAssistanceQuerySubmitted",e[e.AiAssistanceAnswerReceived=177]="AiAssistanceAnswerReceived",e[e.AiAssistanceDynamicSuggestionClicked=178]="AiAssistanceDynamicSuggestionClicked",e[e.AiAssistanceSideEffectConfirmed=179]="AiAssistanceSideEffectConfirmed",e[e.AiAssistanceSideEffectRejected=180]="AiAssistanceSideEffectRejected",e[e.AiAssistanceError=181]="AiAssistanceError",e[e.AiAssistanceOpenedFromPerformanceInsight=182]="AiAssistanceOpenedFromPerformanceInsight",e[e.MAX_VALUE=183]="MAX_VALUE"}(J||(J={})),function(e){e[e.elements=1]="elements",e[e.resources=2]="resources",e[e.network=3]="network",e[e.sources=4]="sources",e[e.timeline=5]="timeline",e[e["heap-profiler"]=6]="heap-profiler",e[e.console=8]="console",e[e.layers=9]="layers",e[e["console-view"]=10]="console-view",e[e.animations=11]="animations",e[e["network.config"]=12]="network.config",e[e.rendering=13]="rendering",e[e.sensors=14]="sensors",e[e["sources.search"]=15]="sources.search",e[e.security=16]="security",e[e["js-profiler"]=17]="js-profiler",e[e.lighthouse=18]="lighthouse",e[e.coverage=19]="coverage",e[e["protocol-monitor"]=20]="protocol-monitor",e[e["remote-devices"]=21]="remote-devices",e[e["web-audio"]=22]="web-audio",e[e["changes.changes"]=23]="changes.changes",e[e["performance.monitor"]=24]="performance.monitor",e[e["release-note"]=25]="release-note",e[e["live-heap-profile"]=26]="live-heap-profile",e[e["sources.quick"]=27]="sources.quick",e[e["network.blocked-urls"]=28]="network.blocked-urls",e[e["settings-preferences"]=29]="settings-preferences",e[e["settings-workspace"]=30]="settings-workspace",e[e["settings-experiments"]=31]="settings-experiments",e[e["settings-blackbox"]=32]="settings-blackbox",e[e["settings-devices"]=33]="settings-devices",e[e["settings-throttling-conditions"]=34]="settings-throttling-conditions",e[e["settings-emulation-locations"]=35]="settings-emulation-locations",e[e["settings-shortcuts"]=36]="settings-shortcuts",e[e["issues-pane"]=37]="issues-pane",e[e["settings-keybinds"]=38]="settings-keybinds",e[e.cssoverview=39]="cssoverview",e[e["chrome-recorder"]=40]="chrome-recorder",e[e["trust-tokens"]=41]="trust-tokens",e[e["reporting-api"]=42]="reporting-api",e[e["interest-groups"]=43]="interest-groups",e[e["back-forward-cache"]=44]="back-forward-cache",e[e["service-worker-cache"]=45]="service-worker-cache",e[e["background-service-background-fetch"]=46]="background-service-background-fetch",e[e["background-service-background-sync"]=47]="background-service-background-sync",e[e["background-service-push-messaging"]=48]="background-service-push-messaging",e[e["background-service-notifications"]=49]="background-service-notifications",e[e["background-service-payment-handler"]=50]="background-service-payment-handler",e[e["background-service-periodic-background-sync"]=51]="background-service-periodic-background-sync",e[e["service-workers"]=52]="service-workers",e[e["app-manifest"]=53]="app-manifest",e[e.storage=54]="storage",e[e.cookies=55]="cookies",e[e["frame-details"]=56]="frame-details",e[e["frame-resource"]=57]="frame-resource",e[e["frame-window"]=58]="frame-window",e[e["frame-worker"]=59]="frame-worker",e[e["dom-storage"]=60]="dom-storage",e[e["indexed-db"]=61]="indexed-db",e[e["web-sql"]=62]="web-sql",e[e["performance-insights"]=63]="performance-insights",e[e.preloading=64]="preloading",e[e["bounce-tracking-mitigations"]=65]="bounce-tracking-mitigations",e[e["developer-resources"]=66]="developer-resources",e[e["autofill-view"]=67]="autofill-view",e[e.MAX_VALUE=68]="MAX_VALUE"}(Z||(Z={})),function(e){e[e["elements-main"]=1]="elements-main",e[e["elements-drawer"]=2]="elements-drawer",e[e["resources-main"]=3]="resources-main",e[e["resources-drawer"]=4]="resources-drawer",e[e["network-main"]=5]="network-main",e[e["network-drawer"]=6]="network-drawer",e[e["sources-main"]=7]="sources-main",e[e["sources-drawer"]=8]="sources-drawer",e[e["timeline-main"]=9]="timeline-main",e[e["timeline-drawer"]=10]="timeline-drawer",e[e["heap_profiler-main"]=11]="heap_profiler-main",e[e["heap_profiler-drawer"]=12]="heap_profiler-drawer",e[e["console-main"]=13]="console-main",e[e["console-drawer"]=14]="console-drawer",e[e["layers-main"]=15]="layers-main",e[e["layers-drawer"]=16]="layers-drawer",e[e["console-view-main"]=17]="console-view-main",e[e["console-view-drawer"]=18]="console-view-drawer",e[e["animations-main"]=19]="animations-main",e[e["animations-drawer"]=20]="animations-drawer",e[e["network.config-main"]=21]="network.config-main",e[e["network.config-drawer"]=22]="network.config-drawer",e[e["rendering-main"]=23]="rendering-main",e[e["rendering-drawer"]=24]="rendering-drawer",e[e["sensors-main"]=25]="sensors-main",e[e["sensors-drawer"]=26]="sensors-drawer",e[e["sources.search-main"]=27]="sources.search-main",e[e["sources.search-drawer"]=28]="sources.search-drawer",e[e["security-main"]=29]="security-main",e[e["security-drawer"]=30]="security-drawer",e[e["lighthouse-main"]=33]="lighthouse-main",e[e["lighthouse-drawer"]=34]="lighthouse-drawer",e[e["coverage-main"]=35]="coverage-main",e[e["coverage-drawer"]=36]="coverage-drawer",e[e["protocol-monitor-main"]=37]="protocol-monitor-main",e[e["protocol-monitor-drawer"]=38]="protocol-monitor-drawer",e[e["remote-devices-main"]=39]="remote-devices-main",e[e["remote-devices-drawer"]=40]="remote-devices-drawer",e[e["web-audio-main"]=41]="web-audio-main",e[e["web-audio-drawer"]=42]="web-audio-drawer",e[e["changes.changes-main"]=43]="changes.changes-main",e[e["changes.changes-drawer"]=44]="changes.changes-drawer",e[e["performance.monitor-main"]=45]="performance.monitor-main",e[e["performance.monitor-drawer"]=46]="performance.monitor-drawer",e[e["release-note-main"]=47]="release-note-main",e[e["release-note-drawer"]=48]="release-note-drawer",e[e["live_heap_profile-main"]=49]="live_heap_profile-main",e[e["live_heap_profile-drawer"]=50]="live_heap_profile-drawer",e[e["sources.quick-main"]=51]="sources.quick-main",e[e["sources.quick-drawer"]=52]="sources.quick-drawer",e[e["network.blocked-urls-main"]=53]="network.blocked-urls-main",e[e["network.blocked-urls-drawer"]=54]="network.blocked-urls-drawer",e[e["settings-preferences-main"]=55]="settings-preferences-main",e[e["settings-preferences-drawer"]=56]="settings-preferences-drawer",e[e["settings-workspace-main"]=57]="settings-workspace-main",e[e["settings-workspace-drawer"]=58]="settings-workspace-drawer",e[e["settings-experiments-main"]=59]="settings-experiments-main",e[e["settings-experiments-drawer"]=60]="settings-experiments-drawer",e[e["settings-blackbox-main"]=61]="settings-blackbox-main",e[e["settings-blackbox-drawer"]=62]="settings-blackbox-drawer",e[e["settings-devices-main"]=63]="settings-devices-main",e[e["settings-devices-drawer"]=64]="settings-devices-drawer",e[e["settings-throttling-conditions-main"]=65]="settings-throttling-conditions-main",e[e["settings-throttling-conditions-drawer"]=66]="settings-throttling-conditions-drawer",e[e["settings-emulation-locations-main"]=67]="settings-emulation-locations-main",e[e["settings-emulation-locations-drawer"]=68]="settings-emulation-locations-drawer",e[e["settings-shortcuts-main"]=69]="settings-shortcuts-main",e[e["settings-shortcuts-drawer"]=70]="settings-shortcuts-drawer",e[e["issues-pane-main"]=71]="issues-pane-main",e[e["issues-pane-drawer"]=72]="issues-pane-drawer",e[e["settings-keybinds-main"]=73]="settings-keybinds-main",e[e["settings-keybinds-drawer"]=74]="settings-keybinds-drawer",e[e["cssoverview-main"]=75]="cssoverview-main",e[e["cssoverview-drawer"]=76]="cssoverview-drawer",e[e["chrome_recorder-main"]=77]="chrome_recorder-main",e[e["chrome_recorder-drawer"]=78]="chrome_recorder-drawer",e[e["trust_tokens-main"]=79]="trust_tokens-main",e[e["trust_tokens-drawer"]=80]="trust_tokens-drawer",e[e["reporting_api-main"]=81]="reporting_api-main",e[e["reporting_api-drawer"]=82]="reporting_api-drawer",e[e["interest_groups-main"]=83]="interest_groups-main",e[e["interest_groups-drawer"]=84]="interest_groups-drawer",e[e["back_forward_cache-main"]=85]="back_forward_cache-main",e[e["back_forward_cache-drawer"]=86]="back_forward_cache-drawer",e[e["service_worker_cache-main"]=87]="service_worker_cache-main",e[e["service_worker_cache-drawer"]=88]="service_worker_cache-drawer",e[e["background_service_backgroundFetch-main"]=89]="background_service_backgroundFetch-main",e[e["background_service_backgroundFetch-drawer"]=90]="background_service_backgroundFetch-drawer",e[e["background_service_backgroundSync-main"]=91]="background_service_backgroundSync-main",e[e["background_service_backgroundSync-drawer"]=92]="background_service_backgroundSync-drawer",e[e["background_service_pushMessaging-main"]=93]="background_service_pushMessaging-main",e[e["background_service_pushMessaging-drawer"]=94]="background_service_pushMessaging-drawer",e[e["background_service_notifications-main"]=95]="background_service_notifications-main",e[e["background_service_notifications-drawer"]=96]="background_service_notifications-drawer",e[e["background_service_paymentHandler-main"]=97]="background_service_paymentHandler-main",e[e["background_service_paymentHandler-drawer"]=98]="background_service_paymentHandler-drawer",e[e["background_service_periodicBackgroundSync-main"]=99]="background_service_periodicBackgroundSync-main",e[e["background_service_periodicBackgroundSync-drawer"]=100]="background_service_periodicBackgroundSync-drawer",e[e["service_workers-main"]=101]="service_workers-main",e[e["service_workers-drawer"]=102]="service_workers-drawer",e[e["app_manifest-main"]=103]="app_manifest-main",e[e["app_manifest-drawer"]=104]="app_manifest-drawer",e[e["storage-main"]=105]="storage-main",e[e["storage-drawer"]=106]="storage-drawer",e[e["cookies-main"]=107]="cookies-main",e[e["cookies-drawer"]=108]="cookies-drawer",e[e["frame_details-main"]=109]="frame_details-main",e[e["frame_details-drawer"]=110]="frame_details-drawer",e[e["frame_resource-main"]=111]="frame_resource-main",e[e["frame_resource-drawer"]=112]="frame_resource-drawer",e[e["frame_window-main"]=113]="frame_window-main",e[e["frame_window-drawer"]=114]="frame_window-drawer",e[e["frame_worker-main"]=115]="frame_worker-main",e[e["frame_worker-drawer"]=116]="frame_worker-drawer",e[e["dom_storage-main"]=117]="dom_storage-main",e[e["dom_storage-drawer"]=118]="dom_storage-drawer",e[e["indexed_db-main"]=119]="indexed_db-main",e[e["indexed_db-drawer"]=120]="indexed_db-drawer",e[e["web_sql-main"]=121]="web_sql-main",e[e["web_sql-drawer"]=122]="web_sql-drawer",e[e["performance_insights-main"]=123]="performance_insights-main",e[e["performance_insights-drawer"]=124]="performance_insights-drawer",e[e["preloading-main"]=125]="preloading-main",e[e["preloading-drawer"]=126]="preloading-drawer",e[e["bounce_tracking_mitigations-main"]=127]="bounce_tracking_mitigations-main",e[e["bounce_tracking_mitigations-drawer"]=128]="bounce_tracking_mitigations-drawer",e[e["developer-resources-main"]=129]="developer-resources-main",e[e["developer-resources-drawer"]=130]="developer-resources-drawer",e[e["autofill-view-main"]=131]="autofill-view-main",e[e["autofill-view-drawer"]=132]="autofill-view-drawer",e[e.MAX_VALUE=133]="MAX_VALUE"}(ee||(ee={})),function(e){e[e.OtherSidebarPane=0]="OtherSidebarPane",e[e.styles=1]="styles",e[e.computed=2]="computed",e[e["elements.layout"]=3]="elements.layout",e[e["elements.event-listeners"]=4]="elements.event-listeners",e[e["elements.dom-breakpoints"]=5]="elements.dom-breakpoints",e[e["elements.dom-properties"]=6]="elements.dom-properties",e[e["accessibility.view"]=7]="accessibility.view",e[e.MAX_VALUE=8]="MAX_VALUE"}(re||(re={})),function(e){e[e.Unknown=0]="Unknown",e[e["text/css"]=2]="text/css",e[e["text/html"]=3]="text/html",e[e["application/xml"]=4]="application/xml",e[e["application/wasm"]=5]="application/wasm",e[e["application/manifest+json"]=6]="application/manifest+json",e[e["application/x-aspx"]=7]="application/x-aspx",e[e["application/jsp"]=8]="application/jsp",e[e["text/x-c++src"]=9]="text/x-c++src",e[e["text/x-coffeescript"]=10]="text/x-coffeescript",e[e["application/vnd.dart"]=11]="application/vnd.dart",e[e["text/typescript"]=12]="text/typescript",e[e["text/typescript-jsx"]=13]="text/typescript-jsx",e[e["application/json"]=14]="application/json",e[e["text/x-csharp"]=15]="text/x-csharp",e[e["text/x-java"]=16]="text/x-java",e[e["text/x-less"]=17]="text/x-less",e[e["application/x-httpd-php"]=18]="application/x-httpd-php",e[e["text/x-python"]=19]="text/x-python",e[e["text/x-sh"]=20]="text/x-sh",e[e["text/x-gss"]=21]="text/x-gss",e[e["text/x-sass"]=22]="text/x-sass",e[e["text/x-scss"]=23]="text/x-scss",e[e["text/markdown"]=24]="text/markdown",e[e["text/x-clojure"]=25]="text/x-clojure",e[e["text/jsx"]=26]="text/jsx",e[e["text/x-go"]=27]="text/x-go",e[e["text/x-kotlin"]=28]="text/x-kotlin",e[e["text/x-scala"]=29]="text/x-scala",e[e["text/x.svelte"]=30]="text/x.svelte",e[e["text/javascript+plain"]=31]="text/javascript+plain",e[e["text/javascript+minified"]=32]="text/javascript+minified",e[e["text/javascript+sourcemapped"]=33]="text/javascript+sourcemapped",e[e["text/x.angular"]=34]="text/x.angular",e[e["text/x.vue"]=35]="text/x.vue",e[e["text/javascript+snippet"]=36]="text/javascript+snippet",e[e["text/javascript+eval"]=37]="text/javascript+eval",e[e.MAX_VALUE=38]="MAX_VALUE"}(te||(te={})),function(e){e[e.devToolsDefault=0]="devToolsDefault",e[e.vsCode=1]="vsCode",e[e.MAX_VALUE=2]="MAX_VALUE"}(ne||(ne={})),function(e){e[e.OtherShortcut=0]="OtherShortcut",e[e["quick-open.show-command-menu"]=1]="quick-open.show-command-menu",e[e["console.clear"]=2]="console.clear",e[e["console.toggle"]=3]="console.toggle",e[e["debugger.step"]=4]="debugger.step",e[e["debugger.step-into"]=5]="debugger.step-into",e[e["debugger.step-out"]=6]="debugger.step-out",e[e["debugger.step-over"]=7]="debugger.step-over",e[e["debugger.toggle-breakpoint"]=8]="debugger.toggle-breakpoint",e[e["debugger.toggle-breakpoint-enabled"]=9]="debugger.toggle-breakpoint-enabled",e[e["debugger.toggle-pause"]=10]="debugger.toggle-pause",e[e["elements.edit-as-html"]=11]="elements.edit-as-html",e[e["elements.hide-element"]=12]="elements.hide-element",e[e["elements.redo"]=13]="elements.redo",e[e["elements.toggle-element-search"]=14]="elements.toggle-element-search",e[e["elements.undo"]=15]="elements.undo",e[e["main.search-in-panel.find"]=16]="main.search-in-panel.find",e[e["main.toggle-drawer"]=17]="main.toggle-drawer",e[e["network.hide-request-details"]=18]="network.hide-request-details",e[e["network.search"]=19]="network.search",e[e["network.toggle-recording"]=20]="network.toggle-recording",e[e["quick-open.show"]=21]="quick-open.show",e[e["settings.show"]=22]="settings.show",e[e["sources.search"]=23]="sources.search",e[e["background-service.toggle-recording"]=24]="background-service.toggle-recording",e[e["components.collect-garbage"]=25]="components.collect-garbage",e[e["console.clear.history"]=26]="console.clear.history",e[e["console.create-pin"]=27]="console.create-pin",e[e["coverage.start-with-reload"]=28]="coverage.start-with-reload",e[e["coverage.toggle-recording"]=29]="coverage.toggle-recording",e[e["debugger.breakpoint-input-window"]=30]="debugger.breakpoint-input-window",e[e["debugger.evaluate-selection"]=31]="debugger.evaluate-selection",e[e["debugger.next-call-frame"]=32]="debugger.next-call-frame",e[e["debugger.previous-call-frame"]=33]="debugger.previous-call-frame",e[e["debugger.run-snippet"]=34]="debugger.run-snippet",e[e["debugger.toggle-breakpoints-active"]=35]="debugger.toggle-breakpoints-active",e[e["elements.capture-area-screenshot"]=36]="elements.capture-area-screenshot",e[e["emulation.capture-full-height-screenshot"]=37]="emulation.capture-full-height-screenshot",e[e["emulation.capture-node-screenshot"]=38]="emulation.capture-node-screenshot",e[e["emulation.capture-screenshot"]=39]="emulation.capture-screenshot",e[e["emulation.show-sensors"]=40]="emulation.show-sensors",e[e["emulation.toggle-device-mode"]=41]="emulation.toggle-device-mode",e[e["help.release-notes"]=42]="help.release-notes",e[e["help.report-issue"]=43]="help.report-issue",e[e["input.start-replaying"]=44]="input.start-replaying",e[e["input.toggle-pause"]=45]="input.toggle-pause",e[e["input.toggle-recording"]=46]="input.toggle-recording",e[e["inspector-main.focus-debuggee"]=47]="inspector-main.focus-debuggee",e[e["inspector-main.hard-reload"]=48]="inspector-main.hard-reload",e[e["inspector-main.reload"]=49]="inspector-main.reload",e[e["live-heap-profile.start-with-reload"]=50]="live-heap-profile.start-with-reload",e[e["live-heap-profile.toggle-recording"]=51]="live-heap-profile.toggle-recording",e[e["main.debug-reload"]=52]="main.debug-reload",e[e["main.next-tab"]=53]="main.next-tab",e[e["main.previous-tab"]=54]="main.previous-tab",e[e["main.search-in-panel.cancel"]=55]="main.search-in-panel.cancel",e[e["main.search-in-panel.find-next"]=56]="main.search-in-panel.find-next",e[e["main.search-in-panel.find-previous"]=57]="main.search-in-panel.find-previous",e[e["main.toggle-dock"]=58]="main.toggle-dock",e[e["main.zoom-in"]=59]="main.zoom-in",e[e["main.zoom-out"]=60]="main.zoom-out",e[e["main.zoom-reset"]=61]="main.zoom-reset",e[e["network-conditions.network-low-end-mobile"]=62]="network-conditions.network-low-end-mobile",e[e["network-conditions.network-mid-tier-mobile"]=63]="network-conditions.network-mid-tier-mobile",e[e["network-conditions.network-offline"]=64]="network-conditions.network-offline",e[e["network-conditions.network-online"]=65]="network-conditions.network-online",e[e["profiler.heap-toggle-recording"]=66]="profiler.heap-toggle-recording",e[e["profiler.js-toggle-recording"]=67]="profiler.js-toggle-recording",e[e["resources.clear"]=68]="resources.clear",e[e["settings.documentation"]=69]="settings.documentation",e[e["settings.shortcuts"]=70]="settings.shortcuts",e[e["sources.add-folder-to-workspace"]=71]="sources.add-folder-to-workspace",e[e["sources.add-to-watch"]=72]="sources.add-to-watch",e[e["sources.close-all"]=73]="sources.close-all",e[e["sources.close-editor-tab"]=74]="sources.close-editor-tab",e[e["sources.create-snippet"]=75]="sources.create-snippet",e[e["sources.go-to-line"]=76]="sources.go-to-line",e[e["sources.go-to-member"]=77]="sources.go-to-member",e[e["sources.jump-to-next-location"]=78]="sources.jump-to-next-location",e[e["sources.jump-to-previous-location"]=79]="sources.jump-to-previous-location",e[e["sources.rename"]=80]="sources.rename",e[e["sources.save"]=81]="sources.save",e[e["sources.save-all"]=82]="sources.save-all",e[e["sources.switch-file"]=83]="sources.switch-file",e[e["timeline.jump-to-next-frame"]=84]="timeline.jump-to-next-frame",e[e["timeline.jump-to-previous-frame"]=85]="timeline.jump-to-previous-frame",e[e["timeline.load-from-file"]=86]="timeline.load-from-file",e[e["timeline.next-recording"]=87]="timeline.next-recording",e[e["timeline.previous-recording"]=88]="timeline.previous-recording",e[e["timeline.record-reload"]=89]="timeline.record-reload",e[e["timeline.save-to-file"]=90]="timeline.save-to-file",e[e["timeline.show-history"]=91]="timeline.show-history",e[e["timeline.toggle-recording"]=92]="timeline.toggle-recording",e[e["sources.increment-css"]=93]="sources.increment-css",e[e["sources.increment-css-by-ten"]=94]="sources.increment-css-by-ten",e[e["sources.decrement-css"]=95]="sources.decrement-css",e[e["sources.decrement-css-by-ten"]=96]="sources.decrement-css-by-ten",e[e["layers.reset-view"]=97]="layers.reset-view",e[e["layers.pan-mode"]=98]="layers.pan-mode",e[e["layers.rotate-mode"]=99]="layers.rotate-mode",e[e["layers.zoom-in"]=100]="layers.zoom-in",e[e["layers.zoom-out"]=101]="layers.zoom-out",e[e["layers.up"]=102]="layers.up",e[e["layers.down"]=103]="layers.down",e[e["layers.left"]=104]="layers.left",e[e["layers.right"]=105]="layers.right",e[e["help.report-translation-issue"]=106]="help.report-translation-issue",e[e["rendering.toggle-prefers-color-scheme"]=107]="rendering.toggle-prefers-color-scheme",e[e["chrome-recorder.start-recording"]=108]="chrome-recorder.start-recording",e[e["chrome-recorder.replay-recording"]=109]="chrome-recorder.replay-recording",e[e["chrome-recorder.toggle-code-view"]=110]="chrome-recorder.toggle-code-view",e[e["chrome-recorder.copy-recording-or-step"]=111]="chrome-recorder.copy-recording-or-step",e[e["changes.revert"]=112]="changes.revert",e[e["changes.copy"]=113]="changes.copy",e[e["elements.new-style-rule"]=114]="elements.new-style-rule",e[e["elements.refresh-event-listeners"]=115]="elements.refresh-event-listeners",e[e["coverage.clear"]=116]="coverage.clear",e[e["coverage.export"]=117]="coverage.export",e[e["timeline.dim-third-parties"]=118]="timeline.dim-third-parties",e[e.MAX_VALUE=119]="MAX_VALUE"}(oe||(oe={})),function(e){e[e["capture-node-creation-stacks"]=1]="capture-node-creation-stacks",e[e["live-heap-profile"]=11]="live-heap-profile",e[e["protocol-monitor"]=13]="protocol-monitor",e[e["sampling-heap-profiler-timeline"]=17]="sampling-heap-profiler-timeline",e[e["show-option-tp-expose-internals-in-heap-snapshot"]=18]="show-option-tp-expose-internals-in-heap-snapshot",e[e["timeline-invalidation-tracking"]=26]="timeline-invalidation-tracking",e[e["timeline-show-all-events"]=27]="timeline-show-all-events",e[e["timeline-v8-runtime-call-stats"]=28]="timeline-v8-runtime-call-stats",e[e.apca=39]="apca",e[e["font-editor"]=41]="font-editor",e[e["full-accessibility-tree"]=42]="full-accessibility-tree",e[e["contrast-issues"]=44]="contrast-issues",e[e["experimental-cookie-features"]=45]="experimental-cookie-features",e[e["instrumentation-breakpoints"]=61]="instrumentation-breakpoints",e[e["authored-deployed-grouping"]=63]="authored-deployed-grouping",e[e["just-my-code"]=65]="just-my-code",e[e["highlight-errors-elements-panel"]=73]="highlight-errors-elements-panel",e[e["use-source-map-scopes"]=76]="use-source-map-scopes",e[e["network-panel-filter-bar-redesign"]=79]="network-panel-filter-bar-redesign",e[e["timeline-show-postmessage-events"]=86]="timeline-show-postmessage-events",e[e["timeline-enhanced-traces"]=90]="timeline-enhanced-traces",e[e["timeline-compiled-sources"]=91]="timeline-compiled-sources",e[e["timeline-debug-mode"]=93]="timeline-debug-mode",e[e["timeline-experimental-insights"]=102]="timeline-experimental-insights",e[e["timeline-dim-unrelated-events"]=103]="timeline-dim-unrelated-events",e[e["timeline-alternative-navigation"]=104]="timeline-alternative-navigation",e[e.MAX_VALUE=106]="MAX_VALUE"}(se||(se={})),function(e){e[e.CrossOriginEmbedderPolicy=0]="CrossOriginEmbedderPolicy",e[e.MixedContent=1]="MixedContent",e[e.SameSiteCookie=2]="SameSiteCookie",e[e.HeavyAd=3]="HeavyAd",e[e.ContentSecurityPolicy=4]="ContentSecurityPolicy",e[e.Other=5]="Other",e[e.Generic=6]="Generic",e[e.ThirdPartyPhaseoutCookie=7]="ThirdPartyPhaseoutCookie",e[e.GenericCookie=8]="GenericCookie",e[e.MAX_VALUE=9]="MAX_VALUE"}(ie||(ie={})),function(e){e[e.CrossOriginEmbedderPolicyRequest=0]="CrossOriginEmbedderPolicyRequest",e[e.CrossOriginEmbedderPolicyElement=1]="CrossOriginEmbedderPolicyElement",e[e.MixedContentRequest=2]="MixedContentRequest",e[e.SameSiteCookieCookie=3]="SameSiteCookieCookie",e[e.SameSiteCookieRequest=4]="SameSiteCookieRequest",e[e.HeavyAdElement=5]="HeavyAdElement",e[e.ContentSecurityPolicyDirective=6]="ContentSecurityPolicyDirective",e[e.ContentSecurityPolicyElement=7]="ContentSecurityPolicyElement",e[e.MAX_VALUE=13]="MAX_VALUE"}(ae||(ae={})),function(e){e[e.MixedContentIssue=0]="MixedContentIssue",e[e["ContentSecurityPolicyIssue::kInlineViolation"]=1]="ContentSecurityPolicyIssue::kInlineViolation",e[e["ContentSecurityPolicyIssue::kEvalViolation"]=2]="ContentSecurityPolicyIssue::kEvalViolation",e[e["ContentSecurityPolicyIssue::kURLViolation"]=3]="ContentSecurityPolicyIssue::kURLViolation",e[e["ContentSecurityPolicyIssue::kTrustedTypesSinkViolation"]=4]="ContentSecurityPolicyIssue::kTrustedTypesSinkViolation",e[e["ContentSecurityPolicyIssue::kTrustedTypesPolicyViolation"]=5]="ContentSecurityPolicyIssue::kTrustedTypesPolicyViolation",e[e["HeavyAdIssue::NetworkTotalLimit"]=6]="HeavyAdIssue::NetworkTotalLimit",e[e["HeavyAdIssue::CpuTotalLimit"]=7]="HeavyAdIssue::CpuTotalLimit",e[e["HeavyAdIssue::CpuPeakLimit"]=8]="HeavyAdIssue::CpuPeakLimit",e[e["CrossOriginEmbedderPolicyIssue::CoepFrameResourceNeedsCoepHeader"]=9]="CrossOriginEmbedderPolicyIssue::CoepFrameResourceNeedsCoepHeader",e[e["CrossOriginEmbedderPolicyIssue::CoopSandboxedIFrameCannotNavigateToCoopPage"]=10]="CrossOriginEmbedderPolicyIssue::CoopSandboxedIFrameCannotNavigateToCoopPage",e[e["CrossOriginEmbedderPolicyIssue::CorpNotSameOrigin"]=11]="CrossOriginEmbedderPolicyIssue::CorpNotSameOrigin",e[e["CrossOriginEmbedderPolicyIssue::CorpNotSameOriginAfterDefaultedToSameOriginByCoep"]=12]="CrossOriginEmbedderPolicyIssue::CorpNotSameOriginAfterDefaultedToSameOriginByCoep",e[e["CrossOriginEmbedderPolicyIssue::CorpNotSameSite"]=13]="CrossOriginEmbedderPolicyIssue::CorpNotSameSite",e[e["CookieIssue::ExcludeSameSiteNoneInsecure::ReadCookie"]=14]="CookieIssue::ExcludeSameSiteNoneInsecure::ReadCookie",e[e["CookieIssue::ExcludeSameSiteNoneInsecure::SetCookie"]=15]="CookieIssue::ExcludeSameSiteNoneInsecure::SetCookie",e[e["CookieIssue::WarnSameSiteNoneInsecure::ReadCookie"]=16]="CookieIssue::WarnSameSiteNoneInsecure::ReadCookie",e[e["CookieIssue::WarnSameSiteNoneInsecure::SetCookie"]=17]="CookieIssue::WarnSameSiteNoneInsecure::SetCookie",e[e["CookieIssue::WarnSameSiteStrictLaxDowngradeStrict::Secure"]=18]="CookieIssue::WarnSameSiteStrictLaxDowngradeStrict::Secure",e[e["CookieIssue::WarnSameSiteStrictLaxDowngradeStrict::Insecure"]=19]="CookieIssue::WarnSameSiteStrictLaxDowngradeStrict::Insecure",e[e["CookieIssue::WarnCrossDowngrade::ReadCookie::Secure"]=20]="CookieIssue::WarnCrossDowngrade::ReadCookie::Secure",e[e["CookieIssue::WarnCrossDowngrade::ReadCookie::Insecure"]=21]="CookieIssue::WarnCrossDowngrade::ReadCookie::Insecure",e[e["CookieIssue::WarnCrossDowngrade::SetCookie::Secure"]=22]="CookieIssue::WarnCrossDowngrade::SetCookie::Secure",e[e["CookieIssue::WarnCrossDowngrade::SetCookie::Insecure"]=23]="CookieIssue::WarnCrossDowngrade::SetCookie::Insecure",e[e["CookieIssue::ExcludeNavigationContextDowngrade::Secure"]=24]="CookieIssue::ExcludeNavigationContextDowngrade::Secure",e[e["CookieIssue::ExcludeNavigationContextDowngrade::Insecure"]=25]="CookieIssue::ExcludeNavigationContextDowngrade::Insecure",e[e["CookieIssue::ExcludeContextDowngrade::ReadCookie::Secure"]=26]="CookieIssue::ExcludeContextDowngrade::ReadCookie::Secure",e[e["CookieIssue::ExcludeContextDowngrade::ReadCookie::Insecure"]=27]="CookieIssue::ExcludeContextDowngrade::ReadCookie::Insecure",e[e["CookieIssue::ExcludeContextDowngrade::SetCookie::Secure"]=28]="CookieIssue::ExcludeContextDowngrade::SetCookie::Secure",e[e["CookieIssue::ExcludeContextDowngrade::SetCookie::Insecure"]=29]="CookieIssue::ExcludeContextDowngrade::SetCookie::Insecure",e[e["CookieIssue::ExcludeSameSiteUnspecifiedTreatedAsLax::ReadCookie"]=30]="CookieIssue::ExcludeSameSiteUnspecifiedTreatedAsLax::ReadCookie",e[e["CookieIssue::ExcludeSameSiteUnspecifiedTreatedAsLax::SetCookie"]=31]="CookieIssue::ExcludeSameSiteUnspecifiedTreatedAsLax::SetCookie",e[e["CookieIssue::WarnSameSiteUnspecifiedLaxAllowUnsafe::ReadCookie"]=32]="CookieIssue::WarnSameSiteUnspecifiedLaxAllowUnsafe::ReadCookie",e[e["CookieIssue::WarnSameSiteUnspecifiedLaxAllowUnsafe::SetCookie"]=33]="CookieIssue::WarnSameSiteUnspecifiedLaxAllowUnsafe::SetCookie",e[e["CookieIssue::WarnSameSiteUnspecifiedCrossSiteContext::ReadCookie"]=34]="CookieIssue::WarnSameSiteUnspecifiedCrossSiteContext::ReadCookie",e[e["CookieIssue::WarnSameSiteUnspecifiedCrossSiteContext::SetCookie"]=35]="CookieIssue::WarnSameSiteUnspecifiedCrossSiteContext::SetCookie",e[e["SharedArrayBufferIssue::TransferIssue"]=36]="SharedArrayBufferIssue::TransferIssue",e[e["SharedArrayBufferIssue::CreationIssue"]=37]="SharedArrayBufferIssue::CreationIssue",e[e.LowTextContrastIssue=41]="LowTextContrastIssue",e[e["CorsIssue::InsecurePrivateNetwork"]=42]="CorsIssue::InsecurePrivateNetwork",e[e["CorsIssue::InvalidHeaders"]=44]="CorsIssue::InvalidHeaders",e[e["CorsIssue::WildcardOriginWithCredentials"]=45]="CorsIssue::WildcardOriginWithCredentials",e[e["CorsIssue::PreflightResponseInvalid"]=46]="CorsIssue::PreflightResponseInvalid",e[e["CorsIssue::OriginMismatch"]=47]="CorsIssue::OriginMismatch",e[e["CorsIssue::AllowCredentialsRequired"]=48]="CorsIssue::AllowCredentialsRequired",e[e["CorsIssue::MethodDisallowedByPreflightResponse"]=49]="CorsIssue::MethodDisallowedByPreflightResponse",e[e["CorsIssue::HeaderDisallowedByPreflightResponse"]=50]="CorsIssue::HeaderDisallowedByPreflightResponse",e[e["CorsIssue::RedirectContainsCredentials"]=51]="CorsIssue::RedirectContainsCredentials",e[e["CorsIssue::DisallowedByMode"]=52]="CorsIssue::DisallowedByMode",e[e["CorsIssue::CorsDisabledScheme"]=53]="CorsIssue::CorsDisabledScheme",e[e["CorsIssue::PreflightMissingAllowExternal"]=54]="CorsIssue::PreflightMissingAllowExternal",e[e["CorsIssue::PreflightInvalidAllowExternal"]=55]="CorsIssue::PreflightInvalidAllowExternal",e[e["CorsIssue::NoCorsRedirectModeNotFollow"]=57]="CorsIssue::NoCorsRedirectModeNotFollow",e[e["QuirksModeIssue::QuirksMode"]=58]="QuirksModeIssue::QuirksMode",e[e["QuirksModeIssue::LimitedQuirksMode"]=59]="QuirksModeIssue::LimitedQuirksMode",e[e.DeprecationIssue=60]="DeprecationIssue",e[e["ClientHintIssue::MetaTagAllowListInvalidOrigin"]=61]="ClientHintIssue::MetaTagAllowListInvalidOrigin",e[e["ClientHintIssue::MetaTagModifiedHTML"]=62]="ClientHintIssue::MetaTagModifiedHTML",e[e["CorsIssue::PreflightAllowPrivateNetworkError"]=63]="CorsIssue::PreflightAllowPrivateNetworkError",e[e["GenericIssue::CrossOriginPortalPostMessageError"]=64]="GenericIssue::CrossOriginPortalPostMessageError",e[e["GenericIssue::FormLabelForNameError"]=65]="GenericIssue::FormLabelForNameError",e[e["GenericIssue::FormDuplicateIdForInputError"]=66]="GenericIssue::FormDuplicateIdForInputError",e[e["GenericIssue::FormInputWithNoLabelError"]=67]="GenericIssue::FormInputWithNoLabelError",e[e["GenericIssue::FormAutocompleteAttributeEmptyError"]=68]="GenericIssue::FormAutocompleteAttributeEmptyError",e[e["GenericIssue::FormEmptyIdAndNameAttributesForInputError"]=69]="GenericIssue::FormEmptyIdAndNameAttributesForInputError",e[e["GenericIssue::FormAriaLabelledByToNonExistingId"]=70]="GenericIssue::FormAriaLabelledByToNonExistingId",e[e["GenericIssue::FormInputAssignedAutocompleteValueToIdOrNameAttributeError"]=71]="GenericIssue::FormInputAssignedAutocompleteValueToIdOrNameAttributeError",e[e["GenericIssue::FormLabelHasNeitherForNorNestedInput"]=72]="GenericIssue::FormLabelHasNeitherForNorNestedInput",e[e["GenericIssue::FormLabelForMatchesNonExistingIdError"]=73]="GenericIssue::FormLabelForMatchesNonExistingIdError",e[e["GenericIssue::FormHasPasswordFieldWithoutUsernameFieldError"]=74]="GenericIssue::FormHasPasswordFieldWithoutUsernameFieldError",e[e["GenericIssue::FormInputHasWrongButWellIntendedAutocompleteValueError"]=75]="GenericIssue::FormInputHasWrongButWellIntendedAutocompleteValueError",e[e["StylesheetLoadingIssue::LateImportRule"]=76]="StylesheetLoadingIssue::LateImportRule",e[e["StylesheetLoadingIssue::RequestFailed"]=77]="StylesheetLoadingIssue::RequestFailed",e[e["CorsIssue::PreflightMissingPrivateNetworkAccessId"]=78]="CorsIssue::PreflightMissingPrivateNetworkAccessId",e[e["CorsIssue::PreflightMissingPrivateNetworkAccessName"]=79]="CorsIssue::PreflightMissingPrivateNetworkAccessName",e[e["CorsIssue::PrivateNetworkAccessPermissionUnavailable"]=80]="CorsIssue::PrivateNetworkAccessPermissionUnavailable",e[e["CorsIssue::PrivateNetworkAccessPermissionDenied"]=81]="CorsIssue::PrivateNetworkAccessPermissionDenied",e[e["CookieIssue::WarnThirdPartyPhaseout::ReadCookie"]=82]="CookieIssue::WarnThirdPartyPhaseout::ReadCookie",e[e["CookieIssue::WarnThirdPartyPhaseout::SetCookie"]=83]="CookieIssue::WarnThirdPartyPhaseout::SetCookie",e[e["CookieIssue::ExcludeThirdPartyPhaseout::ReadCookie"]=84]="CookieIssue::ExcludeThirdPartyPhaseout::ReadCookie",e[e["CookieIssue::ExcludeThirdPartyPhaseout::SetCookie"]=85]="CookieIssue::ExcludeThirdPartyPhaseout::SetCookie",e[e["SelectElementAccessibilityIssue::DisallowedSelectChild"]=86]="SelectElementAccessibilityIssue::DisallowedSelectChild",e[e["SelectElementAccessibilityIssue::DisallowedOptGroupChild"]=87]="SelectElementAccessibilityIssue::DisallowedOptGroupChild",e[e["SelectElementAccessibilityIssue::NonPhrasingContentOptionChild"]=88]="SelectElementAccessibilityIssue::NonPhrasingContentOptionChild",e[e["SelectElementAccessibilityIssue::InteractiveContentOptionChild"]=89]="SelectElementAccessibilityIssue::InteractiveContentOptionChild",e[e["SelectElementAccessibilityIssue::InteractiveContentLegendChild"]=90]="SelectElementAccessibilityIssue::InteractiveContentLegendChild",e[e["SRIMessageSignatureIssue::MissingSignatureHeader"]=91]="SRIMessageSignatureIssue::MissingSignatureHeader",e[e["SRIMessageSignatureIssue::MissingSignatureInputHeader"]=92]="SRIMessageSignatureIssue::MissingSignatureInputHeader",e[e["SRIMessageSignatureIssue::InvalidSignatureHeader"]=93]="SRIMessageSignatureIssue::InvalidSignatureHeader",e[e["SRIMessageSignatureIssue::InvalidSignatureInputHeader"]=94]="SRIMessageSignatureIssue::InvalidSignatureInputHeader",e[e["SRIMessageSignatureIssue::SignatureHeaderValueIsNotByteSequence"]=95]="SRIMessageSignatureIssue::SignatureHeaderValueIsNotByteSequence",e[e["SRIMessageSignatureIssue::SignatureHeaderValueIsParameterized"]=96]="SRIMessageSignatureIssue::SignatureHeaderValueIsParameterized",e[e["SRIMessageSignatureIssue::SignatureHeaderValueIsIncorrectLength"]=97]="SRIMessageSignatureIssue::SignatureHeaderValueIsIncorrectLength",e[e["SRIMessageSignatureIssue::SignatureInputHeaderMissingLabel"]=98]="SRIMessageSignatureIssue::SignatureInputHeaderMissingLabel",e[e["SRIMessageSignatureIssue::SignatureInputHeaderValueNotInnerList"]=99]="SRIMessageSignatureIssue::SignatureInputHeaderValueNotInnerList",e[e["SRIMessageSignatureIssue::SignatureInputHeaderValueMissingComponents"]=100]="SRIMessageSignatureIssue::SignatureInputHeaderValueMissingComponents",e[e["SRIMessageSignatureIssue::SignatureInputHeaderInvalidComponentType"]=101]="SRIMessageSignatureIssue::SignatureInputHeaderInvalidComponentType",e[e["SRIMessageSignatureIssue::SignatureInputHeaderInvalidComponentName"]=102]="SRIMessageSignatureIssue::SignatureInputHeaderInvalidComponentName",e[e["SRIMessageSignatureIssue::SignatureInputHeaderInvalidHeaderComponentParameter"]=103]="SRIMessageSignatureIssue::SignatureInputHeaderInvalidHeaderComponentParameter",e[e["SRIMessageSignatureIssue::SignatureInputHeaderInvalidDerivedComponentParameter"]=104]="SRIMessageSignatureIssue::SignatureInputHeaderInvalidDerivedComponentParameter",e[e["SRIMessageSignatureIssue::SignatureInputHeaderKeyIdLength"]=105]="SRIMessageSignatureIssue::SignatureInputHeaderKeyIdLength",e[e["SRIMessageSignatureIssue::SignatureInputHeaderInvalidParameter"]=106]="SRIMessageSignatureIssue::SignatureInputHeaderInvalidParameter",e[e["SRIMessageSignatureIssue::SignatureInputHeaderMissingRequiredParameters"]=107]="SRIMessageSignatureIssue::SignatureInputHeaderMissingRequiredParameters",e[e["SRIMessageSignatureIssue::ValidationFailedSignatureExpired"]=108]="SRIMessageSignatureIssue::ValidationFailedSignatureExpired",e[e["SRIMessageSignatureIssue::ValidationFailedInvalidLength"]=109]="SRIMessageSignatureIssue::ValidationFailedInvalidLength",e[e["SRIMessageSignatureIssue::ValidationFailedSignatureMismatch"]=110]="SRIMessageSignatureIssue::ValidationFailedSignatureMismatch",e[e["CorsIssue::LocalNetworkAccessPermissionDenied"]=111]="CorsIssue::LocalNetworkAccessPermissionDenied",e[e["SRIMessageSignatureIssue::ValidationFailedIntegrityMismatch"]=112]="SRIMessageSignatureIssue::ValidationFailedIntegrityMismatch",e[e.MAX_VALUE=113]="MAX_VALUE"}(de||(de={})),function(e){e[e.af=1]="af",e[e.am=2]="am",e[e.ar=3]="ar",e[e.as=4]="as",e[e.az=5]="az",e[e.be=6]="be",e[e.bg=7]="bg",e[e.bn=8]="bn",e[e.bs=9]="bs",e[e.ca=10]="ca",e[e.cs=11]="cs",e[e.cy=12]="cy",e[e.da=13]="da",e[e.de=14]="de",e[e.el=15]="el",e[e["en-GB"]=16]="en-GB",e[e["en-US"]=17]="en-US",e[e["es-419"]=18]="es-419",e[e.es=19]="es",e[e.et=20]="et",e[e.eu=21]="eu",e[e.fa=22]="fa",e[e.fi=23]="fi",e[e.fil=24]="fil",e[e["fr-CA"]=25]="fr-CA",e[e.fr=26]="fr",e[e.gl=27]="gl",e[e.gu=28]="gu",e[e.he=29]="he",e[e.hi=30]="hi",e[e.hr=31]="hr",e[e.hu=32]="hu",e[e.hy=33]="hy",e[e.id=34]="id",e[e.is=35]="is",e[e.it=36]="it",e[e.ja=37]="ja",e[e.ka=38]="ka",e[e.kk=39]="kk",e[e.km=40]="km",e[e.kn=41]="kn",e[e.ko=42]="ko",e[e.ky=43]="ky",e[e.lo=44]="lo",e[e.lt=45]="lt",e[e.lv=46]="lv",e[e.mk=47]="mk",e[e.ml=48]="ml",e[e.mn=49]="mn",e[e.mr=50]="mr",e[e.ms=51]="ms",e[e.my=52]="my",e[e.ne=53]="ne",e[e.nl=54]="nl",e[e.no=55]="no",e[e.or=56]="or",e[e.pa=57]="pa",e[e.pl=58]="pl",e[e["pt-PT"]=59]="pt-PT",e[e.pt=60]="pt",e[e.ro=61]="ro",e[e.ru=62]="ru",e[e.si=63]="si",e[e.sk=64]="sk",e[e.sl=65]="sl",e[e.sq=66]="sq",e[e["sr-Latn"]=67]="sr-Latn",e[e.sr=68]="sr",e[e.sv=69]="sv",e[e.sw=70]="sw",e[e.ta=71]="ta",e[e.te=72]="te",e[e.th=73]="th",e[e.tr=74]="tr",e[e.uk=75]="uk",e[e.ur=76]="ur",e[e.uz=77]="uz",e[e.vi=78]="vi",e[e.zh=79]="zh",e[e["zh-HK"]=80]="zh-HK",e[e["zh-TW"]=81]="zh-TW",e[e.zu=82]="zu",e[e.MAX_VALUE=83]="MAX_VALUE"}(ce||(ce={})),function(e){e[e.OtherSection=0]="OtherSection",e[e.Identity=1]="Identity",e[e.Presentation=2]="Presentation",e[e["Protocol Handlers"]=3]="Protocol Handlers",e[e.Icons=4]="Icons",e[e["Window Controls Overlay"]=5]="Window Controls Overlay",e[e.MAX_VALUE=6]="MAX_VALUE"}(le||(le={}));var ge=Object.freeze({__proto__:null,get Action(){return J},get DevtoolsExperiments(){return se},get ElementsSidebarTabCodes(){return re},get IssueCreated(){return de},get IssueExpanded(){return ie},get IssueResourceOpened(){return ae},get KeybindSetSettings(){return ne},get KeyboardShortcutAction(){return oe},get Language(){return ce},get ManifestSectionCodes(){return le},get MediaTypes(){return te},get PanelCodes(){return Z},get PanelWithLocation(){return ee},UserMetrics:me});const pe=new me,he=K();export{U as AidaClient,F as InspectorFrontendHost,i as InspectorFrontendHostAPI,X as Platform,ue as RNPerfMetrics,v as ResourceLoader,ge as UserMetrics,he as rnPerfMetrics,pe as userMetrics}; +import*as e from"../common/common.js";import*as r from"../root/root.js";import*as t from"../i18n/i18n.js";import*as n from"../platform/platform.js";var o;!function(e){e.AppendedToURL="appendedToURL",e.CanceledSaveURL="canceledSaveURL",e.ColorThemeChanged="colorThemeChanged",e.ContextMenuCleared="contextMenuCleared",e.ContextMenuItemSelected="contextMenuItemSelected",e.DeviceCountUpdated="deviceCountUpdated",e.DevicesDiscoveryConfigChanged="devicesDiscoveryConfigChanged",e.DevicesPortForwardingStatusChanged="devicesPortForwardingStatusChanged",e.DevicesUpdated="devicesUpdated",e.DispatchMessage="dispatchMessage",e.DispatchMessageChunk="dispatchMessageChunk",e.EnterInspectElementMode="enterInspectElementMode",e.EyeDropperPickedColor="eyeDropperPickedColor",e.FileSystemsLoaded="fileSystemsLoaded",e.FileSystemRemoved="fileSystemRemoved",e.FileSystemAdded="fileSystemAdded",e.FileSystemFilesChangedAddedRemoved="FileSystemFilesChangedAddedRemoved",e.IndexingTotalWorkCalculated="indexingTotalWorkCalculated",e.IndexingWorked="indexingWorked",e.IndexingDone="indexingDone",e.KeyEventUnhandled="keyEventUnhandled",e.ReloadInspectedPage="reloadInspectedPage",e.RevealSourceLine="revealSourceLine",e.SavedURL="savedURL",e.SearchCompleted="searchCompleted",e.SetInspectedTabId="setInspectedTabId",e.SetUseSoftMenu="setUseSoftMenu",e.ShowPanel="showPanel"}(o||(o={}));const s=[[o.AppendedToURL,"appendedToURL",["url"]],[o.CanceledSaveURL,"canceledSaveURL",["url"]],[o.ColorThemeChanged,"colorThemeChanged",[]],[o.ContextMenuCleared,"contextMenuCleared",[]],[o.ContextMenuItemSelected,"contextMenuItemSelected",["id"]],[o.DeviceCountUpdated,"deviceCountUpdated",["count"]],[o.DevicesDiscoveryConfigChanged,"devicesDiscoveryConfigChanged",["config"]],[o.DevicesPortForwardingStatusChanged,"devicesPortForwardingStatusChanged",["status"]],[o.DevicesUpdated,"devicesUpdated",["devices"]],[o.DispatchMessage,"dispatchMessage",["messageObject"]],[o.DispatchMessageChunk,"dispatchMessageChunk",["messageChunk","messageSize"]],[o.EnterInspectElementMode,"enterInspectElementMode",[]],[o.EyeDropperPickedColor,"eyeDropperPickedColor",["color"]],[o.FileSystemsLoaded,"fileSystemsLoaded",["fileSystems"]],[o.FileSystemRemoved,"fileSystemRemoved",["fileSystemPath"]],[o.FileSystemAdded,"fileSystemAdded",["errorMessage","fileSystem"]],[o.FileSystemFilesChangedAddedRemoved,"fileSystemFilesChangedAddedRemoved",["changed","added","removed"]],[o.IndexingTotalWorkCalculated,"indexingTotalWorkCalculated",["requestId","fileSystemPath","totalWork"]],[o.IndexingWorked,"indexingWorked",["requestId","fileSystemPath","worked"]],[o.IndexingDone,"indexingDone",["requestId","fileSystemPath"]],[o.KeyEventUnhandled,"keyEventUnhandled",["event"]],[o.ReloadInspectedPage,"reloadInspectedPage",["hard"]],[o.RevealSourceLine,"revealSourceLine",["url","lineNumber","columnNumber"]],[o.SavedURL,"savedURL",["url","fileSystemPath"]],[o.SearchCompleted,"searchCompleted",["requestId","fileSystemPath","files"]],[o.SetInspectedTabId,"setInspectedTabId",["tabId"]],[o.SetUseSoftMenu,"setUseSoftMenu",["useSoftMenu"]],[o.ShowPanel,"showPanel",["panelName"]]];var i=Object.freeze({__proto__:null,EventDescriptors:s,get Events(){return o}});const a={systemError:"System error",connectionError:"Connection error",certificateError:"Certificate error",httpError:"HTTP error",cacheError:"Cache error",signedExchangeError:"Signed Exchange error",ftpError:"FTP error",certificateManagerError:"Certificate manager error",dnsResolverError:"DNS resolver error",unknownError:"Unknown error",httpErrorStatusCodeSS:"HTTP error: status code {PH1}, {PH2}",invalidUrl:"Invalid URL",decodingDataUrlFailed:"Decoding Data URL failed"},d=t.i18n.registerUIStrings("core/host/ResourceLoader.ts",a),c=t.i18n.getLocalizedString.bind(void 0,d);let l=0;const u={},m=function(e){return u[++l]=e,l},g=function(e){u[e].close(),delete u[e]},p=function(e,r){u[e].write(r)};function h(e,r,t){if(void 0===e||void 0===t)return null;if(0!==e){if(function(e){return e<=-300&&e>-400}(e))return c(a.httpErrorStatusCodeSS,{PH1:String(r),PH2:t});const n=function(e){return c(e>-100?a.systemError:e>-200?a.connectionError:e>-300?a.certificateError:e>-400?a.httpError:e>-500?a.cacheError:e>-600?a.signedExchangeError:e>-700?a.ftpError:e>-800?a.certificateManagerError:e>-900?a.dnsResolverError:a.unknownError)}(e);return`${n}: ${t}`}return null}const S=function(r,t,n,o,s){const i=m(n);if(new e.ParsedURL.ParsedURL(r).isDataURL())return void(e=>new Promise(((r,t)=>{const n=new XMLHttpRequest;n.withCredentials=!1,n.open("GET",e,!0),n.onreadystatechange=function(){if(n.readyState===XMLHttpRequest.DONE){if(200!==n.status)return n.onreadystatechange=null,void t(new Error(String(n.status)));n.onreadystatechange=null,r(n.responseText)}},n.send(null)})))(r).then((function(e){p(i,e),l({statusCode:200})})).catch((function(e){l({statusCode:404,messageOverride:c(a.decodingDataUrlFailed)})}));if(!s&&function(e){try{const r=new URL(e);return"file:"===r.protocol&&""!==r.host}catch{return!1}}(r))return void(o&&o(!1,{},{statusCode:400,netError:-20,netErrorName:"net::BLOCKED_BY_CLIENT",message:"Loading from a remote file path is prohibited for security reasons."}));const d=[];if(t)for(const e in t)d.push(e+": "+t[e]);function l(e){if(o){const{success:r,description:t}=function(e){const{statusCode:r,netError:t,netErrorName:n,urlValid:o,messageOverride:s}=e;let i="";const d=r>=200&&r<300;if("string"==typeof s)i=s;else if(!d)if(void 0===t)i=c(!1===o?a.invalidUrl:a.unknownError);else{const e=h(t,r,n);e&&(i=e)}return console.assert(d===(0===i.length)),{success:d,description:{statusCode:r,netError:t,netErrorName:n,urlValid:o,message:i}}}(e);o(r,e.headers||{},t)}g(i)}f.loadNetworkResource(r,d.join("\r\n"),i,l)};var v=Object.freeze({__proto__:null,ResourceLoader:{},bindOutputStream:m,discardOutputStream:g,load:function(r,t,n,o){const s=new e.StringOutputStream.StringOutputStream;S(r,t,s,(function(e,r,t){n(e,r,s.data(),t)}),o)},loadAsStream:S,netErrorToMessage:h,streamWrite:p});const C={devtoolsS:"DevTools - {PH1}"},I=t.i18n.registerUIStrings("core/host/InspectorFrontendHost.ts",C),w=t.i18n.getLocalizedString.bind(void 0,I),k="/overrides";class E{#e=new Map;events;#r=null;recordedCountHistograms=[];recordedEnumeratedHistograms=[];recordedPerformanceHistograms=[];constructor(){function e(e){!("mac"===this.platform()?e.metaKey:e.ctrlKey)||"+"!==e.key&&"-"!==e.key||e.stopPropagation()}"undefined"!=typeof document&&document.addEventListener("keydown",(r=>{e.call(this,r)}),!0)}platform(){const e=navigator.userAgent;return e.includes("Windows NT")?"windows":e.includes("Mac OS X")?"mac":"linux"}loadCompleted(){}bringToFront(){}closeWindow(){}setIsDocked(e,r){window.setTimeout(r,0)}showSurvey(e,r){window.setTimeout((()=>r({surveyShown:!1})),0)}canShowSurvey(e,r){window.setTimeout((()=>r({canShowSurvey:!1})),0)}setInspectedPageBounds(e){}inspectElementCompleted(){}setInjectedScriptForOrigin(e,r){}inspectedURLChanged(e){document.title=w(C.devtoolsS,{PH1:e.replace(/^https?:\/\//,"")})}copyText(e){null!=e&&navigator.clipboard.writeText(e)}openInNewTab(r){e.ParsedURL.schemeIs(r,"javascript:")||window.open(r,"_blank")}openSearchResultsInNewTab(r){e.Console.Console.instance().error("Search is not enabled in hosted mode. Please inspect using chrome://inspect")}showItemInFolder(r){e.Console.Console.instance().error("Show item in folder is not enabled in hosted mode. Please inspect using chrome://inspect")}save(e,r,t,n){let s=this.#e.get(e);s||(s=[],this.#e.set(e,s)),s.push(r),this.events.dispatchEventToListeners(o.SavedURL,{url:e,fileSystemPath:e})}append(e,r){const t=this.#e.get(e);t&&(t.push(r),this.events.dispatchEventToListeners(o.AppendedToURL,e))}close(e){const r=this.#e.get(e)||[];this.#e.delete(e);let t="";if(e)try{const r=n.StringUtilities.trimURL(e);t=n.StringUtilities.removeURLFragment(r)}catch(r){t=e}const o=document.createElement("a");o.download=t;const s=new Blob([r.join("")],{type:"text/plain"}),i=URL.createObjectURL(s);o.href=i,o.click(),URL.revokeObjectURL(i)}sendMessageToBackend(e){}recordCountHistogram(e,r,t,n,o){this.recordedCountHistograms.length>=100&&this.recordedCountHistograms.shift(),this.recordedCountHistograms.push({histogramName:e,sample:r,min:t,exclusiveMax:n,bucketSize:o})}recordEnumeratedHistogram(e,r,t){this.recordedEnumeratedHistograms.length>=100&&this.recordedEnumeratedHistograms.shift(),this.recordedEnumeratedHistograms.push({actionName:e,actionCode:r})}recordPerformanceHistogram(e,r){this.recordedPerformanceHistograms.length>=100&&this.recordedPerformanceHistograms.shift(),this.recordedPerformanceHistograms.push({histogramName:e,duration:r})}recordUserMetricsAction(e){}connectAutomaticFileSystem(e,r,t,n){queueMicrotask((()=>n({success:!1})))}disconnectAutomaticFileSystem(e){}requestFileSystems(){this.events.dispatchEventToListeners(o.FileSystemsLoaded,[])}addFileSystem(e){window.webkitRequestFileSystem(window.TEMPORARY,1048576,(e=>{this.#r=e;const r={fileSystemName:"sandboxedRequestedFileSystem",fileSystemPath:k,rootURL:"filesystem:devtools://devtools/isolated/",type:"overrides"};this.events.dispatchEventToListeners(o.FileSystemAdded,{fileSystem:r})}))}removeFileSystem(e){const r=e=>{e.forEach((e=>{e.isDirectory?e.removeRecursively((()=>{})):e.isFile&&e.remove((()=>{}))}))};this.#r&&this.#r.root.createReader().readEntries(r),this.#r=null,this.events.dispatchEventToListeners(o.FileSystemRemoved,k)}isolatedFileSystem(e,r){return this.#r}loadNetworkResource(e,r,t,n){fetch(e).then((async e=>{const r=await e.arrayBuffer();let t=r;if(function(e){const r=new Uint8Array(e);return!(!r||r.length<3)&&31===r[0]&&139===r[1]&&8===r[2]}(r)){const e=new DecompressionStream("gzip"),n=e.writable.getWriter();n.write(r),n.close(),t=e.readable}return await new Response(t).text()})).then((function(e){p(t,e),n({statusCode:200,headers:void 0,messageOverride:void 0,netError:void 0,netErrorName:void 0,urlValid:void 0})})).catch((function(){n({statusCode:404,headers:void 0,messageOverride:void 0,netError:void 0,netErrorName:void 0,urlValid:void 0})}))}registerPreference(e,r){}getPreferences(e){const r={};for(const e in window.localStorage)r[e]=window.localStorage[e];e(r)}getPreference(e,r){r(window.localStorage[e])}setPreference(e,r){window.localStorage[e]=r}removePreference(e){delete window.localStorage[e]}clearPreferences(){window.localStorage.clear()}getSyncInformation(e){if("getSyncInformationForTesting"in globalThis)return e(globalThis.getSyncInformationForTesting());e({isSyncActive:!1,arePreferencesSynced:!1})}getHostConfig(e){const r={devToolsVeLogging:{enabled:!0},thirdPartyCookieControls:{thirdPartyCookieMetadataEnabled:!0,thirdPartyCookieHeuristicsEnabled:!0,managedBlockThirdPartyCookies:"Unset"}};if("hostConfigForTesting"in globalThis){const{hostConfigForTesting:e}=globalThis;for(const t of Object.keys(e)){const n=t=>{"object"==typeof r[t]&&"object"==typeof e[t]?r[t]={...r[t],...e[t]}:r[t]=e[t]??r[t]};n(t)}}e(r)}upgradeDraggedFileSystemPermissions(e){}indexPath(e,r,t){}stopIndexing(e){}searchInPath(e,r,t){}zoomFactor(){return 1}zoomIn(){}zoomOut(){}resetZoom(){}setWhitelistedShortcuts(e){}setEyeDropperActive(e){}showCertificateViewer(e){}reattach(e){e()}readyForTest(){}connectionReady(){}setOpenNewWindowForPopups(e){}setDevicesDiscoveryConfig(e){}setDevicesUpdatesEnabled(e){}openRemotePage(e,r){}openNodeFrontend(){}showContextMenuAtPoint(e,r,t,n){throw new Error("Soft context menu should be used")}isHostedMode(){return!0}setAddExtensionCallback(e){}async initialTargetId(){return null}doAidaConversation(e,r,t){t({error:"Not implemented"})}registerAidaClientEvent(e,r){r({error:"Not implemented"})}recordImpression(e){}recordResize(e){}recordClick(e){}recordHover(e){}recordDrag(e){}recordChange(e){}recordKeyDown(e){}recordSettingAccess(e){}}let f=globalThis.InspectorFrontendHost;class y{constructor(){for(const e of s)this[e[1]]=this.dispatch.bind(this,e[0],e[2],e[3])}dispatch(e,r,t,...n){if(r.length<2){try{f.events.dispatchEventToListeners(e,n[0])}catch(e){console.error(e+" "+e.stack)}return}const o={};for(let e=0;e=0&&(o.options??={},o.options.temperature=i),s&&(o.options??={},o.options.model_id=s),o}static async checkAccessPreconditions(){if(!navigator.onLine)return"no-internet";const e=await new Promise((e=>f.getSyncInformation((r=>e(r)))));return e.accountEmail?e.isSyncPaused?"sync-is-paused":"available":"no-account-email"}async*fetch(e,r){if(!f.doAidaConversation)throw new Error("doAidaConversation is not available");const t=(()=>{let{promise:e,resolve:t,reject:n}=Promise.withResolvers();return r?.signal?.addEventListener("abort",(()=>{n(new O)}),{once:!0}),{write:async r=>{t(r),({promise:e,resolve:t,reject:n}=Promise.withResolvers())},close:async()=>{t(null)},read:()=>e,fail:e=>n(e)}})(),n=m(t);let o;f.doAidaConversation(JSON.stringify(e),n,(e=>{403===e.statusCode?t.fail(new Error("Server responded: permission denied")):e.error?t.fail(new Error(`Cannot send request: ${e.error} ${e.detail||""}`)):"net::ERR_TIMED_OUT"===e.netErrorName?t.fail(new Error("doAidaConversation timed out")):200!==e.statusCode?t.fail(new Error(`Request failed: ${JSON.stringify(e)}`)):t.close()}));const s=[];let i=!1;const a=[];let d={rpcGlobalId:0};for(;o=await t.read();){let e,r=!1;if(o.length){o.startsWith(",")&&(o=o.slice(1)),o.startsWith("[")||(o="["+o),o.endsWith("]")||(o+="]");try{e=JSON.parse(o)}catch(e){throw new Error("Cannot parse chunk: "+o,{cause:e})}for(const t of e){if("metadata"in t&&(d=t.metadata,d?.attributionMetadata?.attributionAction===T.BLOCK))throw new N;if("textChunk"in t)i&&(s.push(_),i=!1),s.push(t.textChunk.text),r=!0;else if("codeChunk"in t)i||(s.push(_),i=!0),s.push(t.codeChunk.code),r=!0;else{if(!("functionCallChunk"in t))throw"error"in t?new Error(`Server responded: ${JSON.stringify(t)}`):new Error("Unknown chunk result");a.push({name:t.functionCallChunk.functionCall.name,args:t.functionCallChunk.functionCall.args})}}r&&(yield{explanation:s.join("")+(i?_:""),metadata:d,completed:!1})}}yield{explanation:s.join("")+(i?_:""),metadata:d,functionCalls:a.length?a:void 0,completed:!0}}registerClientEvent(e){const{promise:r,resolve:t}=Promise.withResolvers();return f.registerAidaClientEvent(JSON.stringify({client:M,event_time:(new Date).toISOString(),...e}),t),r}}let D;class H extends e.ObjectWrapper.ObjectWrapper{#t;#n;constructor(){super()}static instance(){return D||(D=new H),D}addEventListener(e,r){const t=!this.hasEventListeners(e),n=super.addEventListener(e,r);return t&&(window.clearTimeout(this.#t),this.pollAidaAvailability()),n}removeEventListener(e,r){super.removeEventListener(e,r),this.hasEventListeners(e)||window.clearTimeout(this.#t)}async pollAidaAvailability(){this.#t=window.setTimeout((()=>this.pollAidaAvailability()),2e3);const e=await L.checkAccessPreconditions();if(e!==this.#n){this.#n=e;const t=await new Promise((e=>f.getHostConfig(e)));Object.assign(r.Runtime.hostConfig,t),this.dispatchEventToListeners("aidaAvailabilityChanged")}}}var U=Object.freeze({__proto__:null,AidaAbortError:O,AidaBlockError:N,AidaClient:L,CLIENT_NAME:M,get CitationSourceType(){return x},get ClientFeature(){return P},get FunctionalityType(){return A},HostConfigTracker:H,get RecitationAction(){return T},get Role(){return b},get UserTier(){return R},convertToUserTierEnum:function(e){if(e)switch(e){case"TESTERS":return R.TESTERS;case"BETA":return R.BETA;case"PUBLIC":return R.PUBLIC}return R.BETA}});let W,B,V,G,j;function q(){return W||(W=f.platform()),W}var X=Object.freeze({__proto__:null,fontFamily:function(){if(j)return j;switch(q()){case"linux":j="Roboto, Ubuntu, Arial, sans-serif";break;case"mac":j="'Lucida Grande', sans-serif";break;case"windows":j="'Segoe UI', Tahoma, sans-serif"}return j},isCustomDevtoolsFrontend:function(){return void 0===G&&(G=window.location.toString().startsWith("devtools://devtools/custom/")),G},isMac:function(){return void 0===B&&(B="mac"===q()),B},isWin:function(){return void 0===V&&(V="windows"===q()),V},platform:q,setPlatformForTests:function(e){W=e,B=void 0,V=void 0}});let z=null;function K(){return null===z&&(z=new $),z}class ${#o="error";#s=new Set;#i=null;#a=null;#d="rn_inspector";#c={};#l=new Map;isEnabled(){return!0===globalThis.enableReactNativePerfMetrics}addEventListener(e){this.#s.add(e);return()=>{this.#s.delete(e)}}removeAllEventListeners(){this.#s.clear()}sendEvent(e){if(!0!==globalThis.enableReactNativePerfMetrics)return;const r=this.#u(e),t=[];for(const e of this.#s)try{e(r)}catch(e){t.push(e)}if(t.length>0){const e=new AggregateError(t);console.error("Error occurred when calling event listeners",e)}}registerPerfMetricsGlobalPostMessageHandler(){!0===globalThis.enableReactNativePerfMetrics&&!0===globalThis.enableReactNativePerfMetricsGlobalPostMessage&&this.addEventListener((e=>{window.postMessage({event:e,tag:"react-native-chrome-devtools-perf-metrics"},window.location.origin)}))}registerGlobalErrorReporting(){window.addEventListener("error",(e=>{const[r,t]=Y(`[RNPerfMetrics] uncaught error: ${e.message}`,e.error);this.sendEvent({eventName:"Browser.Error",params:{type:"error",message:r,error:t}})}),{passive:!0}),window.addEventListener("unhandledrejection",(e=>{const[r,t]=Y("[RNPerfMetrics] unhandled promise rejection",e.reason);this.sendEvent({eventName:"Browser.Error",params:{type:"rejectedPromise",message:r,error:t}})}),{passive:!0});const e=globalThis.console,r=e[this.#o];e[this.#o]=(...t)=>{try{const e=t[0],[r,n]=Y("[RNPerfMetrics] console.error",e);this.sendEvent({eventName:"Browser.Error",params:{message:r,error:n,type:"consoleError"}})}catch(e){const[r,t]=Y("[RNPerfMetrics] Error handling console.error",e);this.sendEvent({eventName:"Browser.Error",params:{message:r,error:t,type:"consoleError"}})}finally{r.apply(e,t)}}}setLaunchId(e){this.#i=e}setAppId(e){this.#a=e}setTelemetryInfo(e){this.#c=e}entryPointLoadingStarted(e){this.#d=e,this.sendEvent({eventName:"Entrypoint.LoadingStarted",entryPoint:e})}entryPointLoadingFinished(e){this.sendEvent({eventName:"Entrypoint.LoadingFinished",entryPoint:e})}browserVisibilityChanged(e){this.sendEvent({eventName:"Browser.VisibilityChange",params:{visibilityState:e}})}remoteDebuggingTerminated(e={}){this.sendEvent({eventName:"Connection.DebuggingTerminated",params:e})}developerResourceLoadingStarted(e,r){const t=Q(e);this.sendEvent({eventName:"DeveloperResource.LoadingStarted",params:{url:t,loadingMethod:r}})}developerResourceLoadingFinished(e,r,t){const n=Q(e);this.sendEvent({eventName:"DeveloperResource.LoadingFinished",params:{url:n,loadingMethod:r,success:t.success,errorMessage:t.errorDescription?.message}})}developerResourcesStartupLoadingFinishedEvent(e,r){this.sendEvent({eventName:"DeveloperResources.StartupLoadingFinished",params:{numResources:e,timeSinceLaunch:r}})}fuseboxSetClientMetadataStarted(){this.sendEvent({eventName:"FuseboxSetClientMetadataStarted"})}fuseboxSetClientMetadataFinished(e,r){if(e)this.sendEvent({eventName:"FuseboxSetClientMetadataFinished",params:{success:!0}});else{const[e,t]=Y("[RNPerfMetrics] Fusebox setClientMetadata failed",r);this.sendEvent({eventName:"FuseboxSetClientMetadataFinished",params:{success:!1,error:t,errorMessage:e}})}}traceRequested(){this.sendEvent({eventName:"Tracing.TraceRequested"})}heapSnapshotStarted(){this.sendEvent({eventName:"MemoryPanelActionStarted",params:{action:"snapshot"}})}heapSnapshotFinished(e){this.sendEvent({eventName:"MemoryPanelActionFinished",params:{action:"snapshot",success:e}})}heapProfilingStarted(){this.sendEvent({eventName:"MemoryPanelActionStarted",params:{action:"profiling"}})}heapProfilingFinished(e){this.sendEvent({eventName:"MemoryPanelActionFinished",params:{action:"profiling",success:e}})}heapSamplingStarted(){this.sendEvent({eventName:"MemoryPanelActionStarted",params:{action:"sampling"}})}heapSamplingFinished(e){this.sendEvent({eventName:"MemoryPanelActionFinished",params:{action:"sampling",success:e}})}stackTraceSymbolicationSucceeded(e){this.sendEvent({eventName:"StackTraceSymbolicationSucceeded",params:{specialHermesFrameTypes:e}})}stackTraceSymbolicationFailed(e,r,t){this.sendEvent({eventName:"StackTraceSymbolicationFailed",params:{stackTrace:e,line:r,reason:t}})}stackTraceFrameUrlResolutionSucceeded(){this.sendEvent({eventName:"StackTraceFrameUrlResolutionSucceeded"})}stackTraceFrameUrlResolutionFailed(e){this.sendEvent({eventName:"StackTraceFrameUrlResolutionFailed",params:{uniqueUrls:e}})}manualBreakpointSetSucceeded(e){this.sendEvent({eventName:"ManualBreakpointSetSucceeded",params:{bpSettingDuration:e}})}stackTraceFrameClicked(e){this.sendEvent({eventName:"StackTraceFrameClicked",params:{isLinkified:e}})}panelShown(e,r){}panelShownInLocation(e,r){this.sendEvent({eventName:"PanelShown",params:{location:r,newPanelName:e}}),this.#l.set(r,e)}#u(e){return{...e,...{timestamp:performance.timeOrigin+performance.now(),launchId:this.#i,appId:this.#a,entryPoint:this.#d,telemetryInfo:this.#c,currentPanels:this.#l}}}}function Q(e){const{url:r}=e;return"http"===e.scheme||"https"===e.scheme?r:`${r.slice(0,100)} …(omitted ${r.length-100} characters)`}function Y(e,r){if(r instanceof Error){return[`${e}: ${r.message}`,r]}const t=`${e}: ${String(r)}`;return[t,new Error(t,{cause:r})]}var J,Z,ee,re,te,ne,oe,se,ie,ae,de,ce,le,ue=Object.freeze({__proto__:null,getInstance:K});class me{#m;#g;#p;constructor(){this.#m=!1,this.#g=!1,this.#p=""}panelShown(e,r){const t=Z[e]||0;f.recordEnumeratedHistogram("DevTools.PanelShown",t,Z.MAX_VALUE),f.recordUserMetricsAction("DevTools_PanelShown_"+e),r||(this.#m=!0),K().panelShown(e,r)}panelShownInLocation(e,r){const t=ee[`${e}-${r}`]||0;f.recordEnumeratedHistogram("DevTools.PanelShownInLocation",t,ee.MAX_VALUE),K().panelShownInLocation(e,r)}settingsPanelShown(e){this.panelShown("settings-"+e)}sourcesPanelFileDebugged(e){const r=e&&te[e]||te.Unknown;f.recordEnumeratedHistogram("DevTools.SourcesPanelFileDebugged",r,te.MAX_VALUE)}sourcesPanelFileOpened(e){const r=e&&te[e]||te.Unknown;f.recordEnumeratedHistogram("DevTools.SourcesPanelFileOpened",r,te.MAX_VALUE)}networkPanelResponsePreviewOpened(e){const r=e&&te[e]||te.Unknown;f.recordEnumeratedHistogram("DevTools.NetworkPanelResponsePreviewOpened",r,te.MAX_VALUE)}actionTaken(e){f.recordEnumeratedHistogram("DevTools.ActionTaken",e,J.MAX_VALUE)}panelLoaded(e,r){this.#g||e!==this.#p||(this.#g=!0,requestAnimationFrame((()=>{window.setTimeout((()=>{performance.mark(r),this.#m||f.recordPerformanceHistogram(r,performance.now())}),0)})))}setLaunchPanel(e){this.#p=e}performanceTraceLoad(e){f.recordPerformanceHistogram("DevTools.TraceLoad",e.duration)}keybindSetSettingChanged(e){const r=ne[e]||0;f.recordEnumeratedHistogram("DevTools.KeybindSetSettingChanged",r,ne.MAX_VALUE)}keyboardShortcutFired(e){const r=oe[e]||oe.OtherShortcut;f.recordEnumeratedHistogram("DevTools.KeyboardShortcutFired",r,oe.MAX_VALUE)}issuesPanelOpenedFrom(e){f.recordEnumeratedHistogram("DevTools.IssuesPanelOpenedFrom",e,6)}issuesPanelIssueExpanded(e){if(void 0===e)return;const r=ie[e];void 0!==r&&f.recordEnumeratedHistogram("DevTools.IssuesPanelIssueExpanded",r,ie.MAX_VALUE)}issuesPanelResourceOpened(e,r){const t=ae[e+r];void 0!==t&&f.recordEnumeratedHistogram("DevTools.IssuesPanelResourceOpened",t,ae.MAX_VALUE)}issueCreated(e){const r=de[e];void 0!==r&&f.recordEnumeratedHistogram("DevTools.IssueCreated",r,de.MAX_VALUE)}experimentEnabledAtLaunch(e){const r=se[e];void 0!==r&&f.recordEnumeratedHistogram("DevTools.ExperimentEnabledAtLaunch",r,se.MAX_VALUE)}navigationSettingAtFirstTimelineLoad(e){f.recordEnumeratedHistogram("DevTools.TimelineNavigationSettingState",e,4)}experimentDisabledAtLaunch(e){const r=se[e];void 0!==r&&f.recordEnumeratedHistogram("DevTools.ExperimentDisabledAtLaunch",r,se.MAX_VALUE)}experimentChanged(e,r){const t=se[e];if(void 0===t)return;const n=r?"DevTools.ExperimentEnabled":"DevTools.ExperimentDisabled";f.recordEnumeratedHistogram(n,t,se.MAX_VALUE)}developerResourceLoaded(e){e>=8||f.recordEnumeratedHistogram("DevTools.DeveloperResourceLoaded",e,8)}developerResourceScheme(e){e>=9||f.recordEnumeratedHistogram("DevTools.DeveloperResourceScheme",e,9)}language(e){const r=ce[e];void 0!==r&&f.recordEnumeratedHistogram("DevTools.Language",r,ce.MAX_VALUE)}syncSetting(e){f.getSyncInformation((r=>{let t=1;r.isSyncActive&&!r.arePreferencesSynced?t=2:r.isSyncActive&&r.arePreferencesSynced&&(t=e?4:3),f.recordEnumeratedHistogram("DevTools.SyncSetting",t,5)}))}recordingAssertion(e){f.recordEnumeratedHistogram("DevTools.RecordingAssertion",e,4)}recordingToggled(e){f.recordEnumeratedHistogram("DevTools.RecordingToggled",e,3)}recordingReplayFinished(e){f.recordEnumeratedHistogram("DevTools.RecordingReplayFinished",e,5)}recordingReplaySpeed(e){f.recordEnumeratedHistogram("DevTools.RecordingReplaySpeed",e,5)}recordingReplayStarted(e){f.recordEnumeratedHistogram("DevTools.RecordingReplayStarted",e,4)}recordingEdited(e){f.recordEnumeratedHistogram("DevTools.RecordingEdited",e,11)}recordingExported(e){f.recordEnumeratedHistogram("DevTools.RecordingExported",e,6)}recordingCodeToggled(e){f.recordEnumeratedHistogram("DevTools.RecordingCodeToggled",e,3)}recordingCopiedToClipboard(e){f.recordEnumeratedHistogram("DevTools.RecordingCopiedToClipboard",e,9)}cssHintShown(e){f.recordEnumeratedHistogram("DevTools.CSSHintShown",e,14)}lighthouseModeRun(e){f.recordEnumeratedHistogram("DevTools.LighthouseModeRun",e,4)}lighthouseCategoryUsed(e){f.recordEnumeratedHistogram("DevTools.LighthouseCategoryUsed",e,6)}swatchActivated(e){f.recordEnumeratedHistogram("DevTools.SwatchActivated",e,11)}animationPlaybackRateChanged(e){f.recordEnumeratedHistogram("DevTools.AnimationPlaybackRateChanged",e,4)}animationPointDragged(e){f.recordEnumeratedHistogram("DevTools.AnimationPointDragged",e,5)}workspacesPopulated(e){f.recordPerformanceHistogram("DevTools.Workspaces.PopulateWallClocktime",e)}visualLoggingProcessingDone(e){f.recordPerformanceHistogram("DevTools.VisualLogging.ProcessingTime",e)}freestylerQueryLength(e){f.recordCountHistogram("DevTools.Freestyler.QueryLength",e,0,1e5,100)}freestylerEvalResponseSize(e){f.recordCountHistogram("DevTools.Freestyler.EvalResponseSize",e,0,1e5,100)}}!function(e){e[e.WindowDocked=1]="WindowDocked",e[e.WindowUndocked=2]="WindowUndocked",e[e.ScriptsBreakpointSet=3]="ScriptsBreakpointSet",e[e.TimelineStarted=4]="TimelineStarted",e[e.ProfilesCPUProfileTaken=5]="ProfilesCPUProfileTaken",e[e.ProfilesHeapProfileTaken=6]="ProfilesHeapProfileTaken",e[e.ConsoleEvaluated=8]="ConsoleEvaluated",e[e.FileSavedInWorkspace=9]="FileSavedInWorkspace",e[e.DeviceModeEnabled=10]="DeviceModeEnabled",e[e.AnimationsPlaybackRateChanged=11]="AnimationsPlaybackRateChanged",e[e.RevisionApplied=12]="RevisionApplied",e[e.FileSystemDirectoryContentReceived=13]="FileSystemDirectoryContentReceived",e[e.StyleRuleEdited=14]="StyleRuleEdited",e[e.CommandEvaluatedInConsolePanel=15]="CommandEvaluatedInConsolePanel",e[e.DOMPropertiesExpanded=16]="DOMPropertiesExpanded",e[e.ResizedViewInResponsiveMode=17]="ResizedViewInResponsiveMode",e[e.TimelinePageReloadStarted=18]="TimelinePageReloadStarted",e[e.ConnectToNodeJSFromFrontend=19]="ConnectToNodeJSFromFrontend",e[e.ConnectToNodeJSDirectly=20]="ConnectToNodeJSDirectly",e[e.CpuThrottlingEnabled=21]="CpuThrottlingEnabled",e[e.CpuProfileNodeFocused=22]="CpuProfileNodeFocused",e[e.CpuProfileNodeExcluded=23]="CpuProfileNodeExcluded",e[e.SelectFileFromFilePicker=24]="SelectFileFromFilePicker",e[e.SelectCommandFromCommandMenu=25]="SelectCommandFromCommandMenu",e[e.ChangeInspectedNodeInElementsPanel=26]="ChangeInspectedNodeInElementsPanel",e[e.StyleRuleCopied=27]="StyleRuleCopied",e[e.CoverageStarted=28]="CoverageStarted",e[e.LighthouseStarted=29]="LighthouseStarted",e[e.LighthouseFinished=30]="LighthouseFinished",e[e.ShowedThirdPartyBadges=31]="ShowedThirdPartyBadges",e[e.LighthouseViewTrace=32]="LighthouseViewTrace",e[e.FilmStripStartedRecording=33]="FilmStripStartedRecording",e[e.CoverageReportFiltered=34]="CoverageReportFiltered",e[e.CoverageStartedPerBlock=35]="CoverageStartedPerBlock",e[e["SettingsOpenedFromGear-deprecated"]=36]="SettingsOpenedFromGear-deprecated",e[e["SettingsOpenedFromMenu-deprecated"]=37]="SettingsOpenedFromMenu-deprecated",e[e["SettingsOpenedFromCommandMenu-deprecated"]=38]="SettingsOpenedFromCommandMenu-deprecated",e[e.TabMovedToDrawer=39]="TabMovedToDrawer",e[e.TabMovedToMainPanel=40]="TabMovedToMainPanel",e[e.CaptureCssOverviewClicked=41]="CaptureCssOverviewClicked",e[e.VirtualAuthenticatorEnvironmentEnabled=42]="VirtualAuthenticatorEnvironmentEnabled",e[e.SourceOrderViewActivated=43]="SourceOrderViewActivated",e[e.UserShortcutAdded=44]="UserShortcutAdded",e[e.ShortcutRemoved=45]="ShortcutRemoved",e[e.ShortcutModified=46]="ShortcutModified",e[e.CustomPropertyLinkClicked=47]="CustomPropertyLinkClicked",e[e.CustomPropertyEdited=48]="CustomPropertyEdited",e[e.ServiceWorkerNetworkRequestClicked=49]="ServiceWorkerNetworkRequestClicked",e[e.ServiceWorkerNetworkRequestClosedQuickly=50]="ServiceWorkerNetworkRequestClosedQuickly",e[e.NetworkPanelServiceWorkerRespondWith=51]="NetworkPanelServiceWorkerRespondWith",e[e.NetworkPanelCopyValue=52]="NetworkPanelCopyValue",e[e.ConsoleSidebarOpened=53]="ConsoleSidebarOpened",e[e.PerfPanelTraceImported=54]="PerfPanelTraceImported",e[e.PerfPanelTraceExported=55]="PerfPanelTraceExported",e[e.StackFrameRestarted=56]="StackFrameRestarted",e[e.CaptureTestProtocolClicked=57]="CaptureTestProtocolClicked",e[e.BreakpointRemovedFromRemoveButton=58]="BreakpointRemovedFromRemoveButton",e[e.BreakpointGroupExpandedStateChanged=59]="BreakpointGroupExpandedStateChanged",e[e.HeaderOverrideFileCreated=60]="HeaderOverrideFileCreated",e[e.HeaderOverrideEnableEditingClicked=61]="HeaderOverrideEnableEditingClicked",e[e.HeaderOverrideHeaderAdded=62]="HeaderOverrideHeaderAdded",e[e.HeaderOverrideHeaderEdited=63]="HeaderOverrideHeaderEdited",e[e.HeaderOverrideHeaderRemoved=64]="HeaderOverrideHeaderRemoved",e[e.HeaderOverrideHeadersFileEdited=65]="HeaderOverrideHeadersFileEdited",e[e.PersistenceNetworkOverridesEnabled=66]="PersistenceNetworkOverridesEnabled",e[e.PersistenceNetworkOverridesDisabled=67]="PersistenceNetworkOverridesDisabled",e[e.BreakpointRemovedFromContextMenu=68]="BreakpointRemovedFromContextMenu",e[e.BreakpointsInFileRemovedFromRemoveButton=69]="BreakpointsInFileRemovedFromRemoveButton",e[e.BreakpointsInFileRemovedFromContextMenu=70]="BreakpointsInFileRemovedFromContextMenu",e[e.BreakpointsInFileCheckboxToggled=71]="BreakpointsInFileCheckboxToggled",e[e.BreakpointsInFileEnabledDisabledFromContextMenu=72]="BreakpointsInFileEnabledDisabledFromContextMenu",e[e.BreakpointConditionEditedFromSidebar=73]="BreakpointConditionEditedFromSidebar",e[e.WorkspaceTabAddFolder=74]="WorkspaceTabAddFolder",e[e.WorkspaceTabRemoveFolder=75]="WorkspaceTabRemoveFolder",e[e.OverrideTabAddFolder=76]="OverrideTabAddFolder",e[e.OverrideTabRemoveFolder=77]="OverrideTabRemoveFolder",e[e.WorkspaceSourceSelected=78]="WorkspaceSourceSelected",e[e.OverridesSourceSelected=79]="OverridesSourceSelected",e[e.StyleSheetInitiatorLinkClicked=80]="StyleSheetInitiatorLinkClicked",e[e.BreakpointRemovedFromGutterContextMenu=81]="BreakpointRemovedFromGutterContextMenu",e[e.BreakpointRemovedFromGutterToggle=82]="BreakpointRemovedFromGutterToggle",e[e.StylePropertyInsideKeyframeEdited=83]="StylePropertyInsideKeyframeEdited",e[e.OverrideContentFromSourcesContextMenu=84]="OverrideContentFromSourcesContextMenu",e[e.OverrideContentFromNetworkContextMenu=85]="OverrideContentFromNetworkContextMenu",e[e.OverrideScript=86]="OverrideScript",e[e.OverrideStyleSheet=87]="OverrideStyleSheet",e[e.OverrideDocument=88]="OverrideDocument",e[e.OverrideFetchXHR=89]="OverrideFetchXHR",e[e.OverrideImage=90]="OverrideImage",e[e.OverrideFont=91]="OverrideFont",e[e.OverrideContentContextMenuSetup=92]="OverrideContentContextMenuSetup",e[e.OverrideContentContextMenuAbandonSetup=93]="OverrideContentContextMenuAbandonSetup",e[e.OverrideContentContextMenuActivateDisabled=94]="OverrideContentContextMenuActivateDisabled",e[e.OverrideContentContextMenuOpenExistingFile=95]="OverrideContentContextMenuOpenExistingFile",e[e.OverrideContentContextMenuSaveNewFile=96]="OverrideContentContextMenuSaveNewFile",e[e.ShowAllOverridesFromSourcesContextMenu=97]="ShowAllOverridesFromSourcesContextMenu",e[e.ShowAllOverridesFromNetworkContextMenu=98]="ShowAllOverridesFromNetworkContextMenu",e[e.AnimationGroupsCleared=99]="AnimationGroupsCleared",e[e.AnimationsPaused=100]="AnimationsPaused",e[e.AnimationsResumed=101]="AnimationsResumed",e[e.AnimatedNodeDescriptionClicked=102]="AnimatedNodeDescriptionClicked",e[e.AnimationGroupScrubbed=103]="AnimationGroupScrubbed",e[e.AnimationGroupReplayed=104]="AnimationGroupReplayed",e[e.OverrideTabDeleteFolderContextMenu=105]="OverrideTabDeleteFolderContextMenu",e[e.WorkspaceDropFolder=107]="WorkspaceDropFolder",e[e.WorkspaceSelectFolder=108]="WorkspaceSelectFolder",e[e.OverrideContentContextMenuSourceMappedWarning=109]="OverrideContentContextMenuSourceMappedWarning",e[e.OverrideContentContextMenuRedirectToDeployed=110]="OverrideContentContextMenuRedirectToDeployed",e[e.NewStyleRuleAdded=111]="NewStyleRuleAdded",e[e.TraceExpanded=112]="TraceExpanded",e[e.InsightConsoleMessageShown=113]="InsightConsoleMessageShown",e[e.InsightRequestedViaContextMenu=114]="InsightRequestedViaContextMenu",e[e.InsightRequestedViaHoverButton=115]="InsightRequestedViaHoverButton",e[e.InsightRatedPositive=117]="InsightRatedPositive",e[e.InsightRatedNegative=118]="InsightRatedNegative",e[e.InsightClosed=119]="InsightClosed",e[e.InsightErrored=120]="InsightErrored",e[e.InsightHoverButtonShown=121]="InsightHoverButtonShown",e[e.SelfXssWarningConsoleMessageShown=122]="SelfXssWarningConsoleMessageShown",e[e.SelfXssWarningDialogShown=123]="SelfXssWarningDialogShown",e[e.SelfXssAllowPastingInConsole=124]="SelfXssAllowPastingInConsole",e[e.SelfXssAllowPastingInDialog=125]="SelfXssAllowPastingInDialog",e[e.ToggleEmulateFocusedPageFromStylesPaneOn=126]="ToggleEmulateFocusedPageFromStylesPaneOn",e[e.ToggleEmulateFocusedPageFromStylesPaneOff=127]="ToggleEmulateFocusedPageFromStylesPaneOff",e[e.ToggleEmulateFocusedPageFromRenderingTab=128]="ToggleEmulateFocusedPageFromRenderingTab",e[e.ToggleEmulateFocusedPageFromCommandMenu=129]="ToggleEmulateFocusedPageFromCommandMenu",e[e.InsightGenerated=130]="InsightGenerated",e[e.InsightErroredApi=131]="InsightErroredApi",e[e.InsightErroredMarkdown=132]="InsightErroredMarkdown",e[e.ToggleShowWebVitals=133]="ToggleShowWebVitals",e[e.InsightErroredPermissionDenied=134]="InsightErroredPermissionDenied",e[e.InsightErroredCannotSend=135]="InsightErroredCannotSend",e[e.InsightErroredRequestFailed=136]="InsightErroredRequestFailed",e[e.InsightErroredCannotParseChunk=137]="InsightErroredCannotParseChunk",e[e.InsightErroredUnknownChunk=138]="InsightErroredUnknownChunk",e[e.InsightErroredOther=139]="InsightErroredOther",e[e.AutofillReceived=140]="AutofillReceived",e[e.AutofillReceivedAndTabAutoOpened=141]="AutofillReceivedAndTabAutoOpened",e[e.AnimationGroupSelected=142]="AnimationGroupSelected",e[e.ScrollDrivenAnimationGroupSelected=143]="ScrollDrivenAnimationGroupSelected",e[e.ScrollDrivenAnimationGroupScrubbed=144]="ScrollDrivenAnimationGroupScrubbed",e[e.AiAssistanceOpenedFromElementsPanel=145]="AiAssistanceOpenedFromElementsPanel",e[e.AiAssistanceOpenedFromStylesTab=146]="AiAssistanceOpenedFromStylesTab",e[e.ConsoleFilterByContext=147]="ConsoleFilterByContext",e[e.ConsoleFilterBySource=148]="ConsoleFilterBySource",e[e.ConsoleFilterByUrl=149]="ConsoleFilterByUrl",e[e.InsightConsentReminderShown=150]="InsightConsentReminderShown",e[e.InsightConsentReminderCanceled=151]="InsightConsentReminderCanceled",e[e.InsightConsentReminderConfirmed=152]="InsightConsentReminderConfirmed",e[e.InsightsOnboardingShown=153]="InsightsOnboardingShown",e[e.InsightsOnboardingCanceledOnPage1=154]="InsightsOnboardingCanceledOnPage1",e[e.InsightsOnboardingCanceledOnPage2=155]="InsightsOnboardingCanceledOnPage2",e[e.InsightsOnboardingConfirmed=156]="InsightsOnboardingConfirmed",e[e.InsightsOnboardingNextPage=157]="InsightsOnboardingNextPage",e[e.InsightsOnboardingPrevPage=158]="InsightsOnboardingPrevPage",e[e.InsightsOnboardingFeatureDisabled=159]="InsightsOnboardingFeatureDisabled",e[e.InsightsOptInTeaserShown=160]="InsightsOptInTeaserShown",e[e.InsightsOptInTeaserSettingsLinkClicked=161]="InsightsOptInTeaserSettingsLinkClicked",e[e.InsightsOptInTeaserConfirmedInSettings=162]="InsightsOptInTeaserConfirmedInSettings",e[e.InsightsReminderTeaserShown=163]="InsightsReminderTeaserShown",e[e.InsightsReminderTeaserConfirmed=164]="InsightsReminderTeaserConfirmed",e[e.InsightsReminderTeaserCanceled=165]="InsightsReminderTeaserCanceled",e[e.InsightsReminderTeaserSettingsLinkClicked=166]="InsightsReminderTeaserSettingsLinkClicked",e[e.InsightsReminderTeaserAbortedInSettings=167]="InsightsReminderTeaserAbortedInSettings",e[e.GeneratingInsightWithoutDisclaimer=168]="GeneratingInsightWithoutDisclaimer",e[e.AiAssistanceOpenedFromElementsPanelFloatingButton=169]="AiAssistanceOpenedFromElementsPanelFloatingButton",e[e.AiAssistanceOpenedFromNetworkPanel=170]="AiAssistanceOpenedFromNetworkPanel",e[e.AiAssistanceOpenedFromSourcesPanel=171]="AiAssistanceOpenedFromSourcesPanel",e[e.AiAssistanceOpenedFromSourcesPanelFloatingButton=172]="AiAssistanceOpenedFromSourcesPanelFloatingButton",e[e.AiAssistanceOpenedFromPerformancePanel=173]="AiAssistanceOpenedFromPerformancePanel",e[e.AiAssistanceOpenedFromNetworkPanelFloatingButton=174]="AiAssistanceOpenedFromNetworkPanelFloatingButton",e[e.AiAssistancePanelOpened=175]="AiAssistancePanelOpened",e[e.AiAssistanceQuerySubmitted=176]="AiAssistanceQuerySubmitted",e[e.AiAssistanceAnswerReceived=177]="AiAssistanceAnswerReceived",e[e.AiAssistanceDynamicSuggestionClicked=178]="AiAssistanceDynamicSuggestionClicked",e[e.AiAssistanceSideEffectConfirmed=179]="AiAssistanceSideEffectConfirmed",e[e.AiAssistanceSideEffectRejected=180]="AiAssistanceSideEffectRejected",e[e.AiAssistanceError=181]="AiAssistanceError",e[e.AiAssistanceOpenedFromPerformanceInsight=182]="AiAssistanceOpenedFromPerformanceInsight",e[e.MAX_VALUE=183]="MAX_VALUE"}(J||(J={})),function(e){e[e.elements=1]="elements",e[e.resources=2]="resources",e[e.network=3]="network",e[e.sources=4]="sources",e[e.timeline=5]="timeline",e[e["heap-profiler"]=6]="heap-profiler",e[e.console=8]="console",e[e.layers=9]="layers",e[e["console-view"]=10]="console-view",e[e.animations=11]="animations",e[e["network.config"]=12]="network.config",e[e.rendering=13]="rendering",e[e.sensors=14]="sensors",e[e["sources.search"]=15]="sources.search",e[e.security=16]="security",e[e["js-profiler"]=17]="js-profiler",e[e.lighthouse=18]="lighthouse",e[e.coverage=19]="coverage",e[e["protocol-monitor"]=20]="protocol-monitor",e[e["remote-devices"]=21]="remote-devices",e[e["web-audio"]=22]="web-audio",e[e["changes.changes"]=23]="changes.changes",e[e["performance.monitor"]=24]="performance.monitor",e[e["release-note"]=25]="release-note",e[e["live-heap-profile"]=26]="live-heap-profile",e[e["sources.quick"]=27]="sources.quick",e[e["network.blocked-urls"]=28]="network.blocked-urls",e[e["settings-preferences"]=29]="settings-preferences",e[e["settings-workspace"]=30]="settings-workspace",e[e["settings-experiments"]=31]="settings-experiments",e[e["settings-blackbox"]=32]="settings-blackbox",e[e["settings-devices"]=33]="settings-devices",e[e["settings-throttling-conditions"]=34]="settings-throttling-conditions",e[e["settings-emulation-locations"]=35]="settings-emulation-locations",e[e["settings-shortcuts"]=36]="settings-shortcuts",e[e["issues-pane"]=37]="issues-pane",e[e["settings-keybinds"]=38]="settings-keybinds",e[e.cssoverview=39]="cssoverview",e[e["chrome-recorder"]=40]="chrome-recorder",e[e["trust-tokens"]=41]="trust-tokens",e[e["reporting-api"]=42]="reporting-api",e[e["interest-groups"]=43]="interest-groups",e[e["back-forward-cache"]=44]="back-forward-cache",e[e["service-worker-cache"]=45]="service-worker-cache",e[e["background-service-background-fetch"]=46]="background-service-background-fetch",e[e["background-service-background-sync"]=47]="background-service-background-sync",e[e["background-service-push-messaging"]=48]="background-service-push-messaging",e[e["background-service-notifications"]=49]="background-service-notifications",e[e["background-service-payment-handler"]=50]="background-service-payment-handler",e[e["background-service-periodic-background-sync"]=51]="background-service-periodic-background-sync",e[e["service-workers"]=52]="service-workers",e[e["app-manifest"]=53]="app-manifest",e[e.storage=54]="storage",e[e.cookies=55]="cookies",e[e["frame-details"]=56]="frame-details",e[e["frame-resource"]=57]="frame-resource",e[e["frame-window"]=58]="frame-window",e[e["frame-worker"]=59]="frame-worker",e[e["dom-storage"]=60]="dom-storage",e[e["indexed-db"]=61]="indexed-db",e[e["web-sql"]=62]="web-sql",e[e["performance-insights"]=63]="performance-insights",e[e.preloading=64]="preloading",e[e["bounce-tracking-mitigations"]=65]="bounce-tracking-mitigations",e[e["developer-resources"]=66]="developer-resources",e[e["autofill-view"]=67]="autofill-view",e[e.MAX_VALUE=68]="MAX_VALUE"}(Z||(Z={})),function(e){e[e["elements-main"]=1]="elements-main",e[e["elements-drawer"]=2]="elements-drawer",e[e["resources-main"]=3]="resources-main",e[e["resources-drawer"]=4]="resources-drawer",e[e["network-main"]=5]="network-main",e[e["network-drawer"]=6]="network-drawer",e[e["sources-main"]=7]="sources-main",e[e["sources-drawer"]=8]="sources-drawer",e[e["timeline-main"]=9]="timeline-main",e[e["timeline-drawer"]=10]="timeline-drawer",e[e["heap_profiler-main"]=11]="heap_profiler-main",e[e["heap_profiler-drawer"]=12]="heap_profiler-drawer",e[e["console-main"]=13]="console-main",e[e["console-drawer"]=14]="console-drawer",e[e["layers-main"]=15]="layers-main",e[e["layers-drawer"]=16]="layers-drawer",e[e["console-view-main"]=17]="console-view-main",e[e["console-view-drawer"]=18]="console-view-drawer",e[e["animations-main"]=19]="animations-main",e[e["animations-drawer"]=20]="animations-drawer",e[e["network.config-main"]=21]="network.config-main",e[e["network.config-drawer"]=22]="network.config-drawer",e[e["rendering-main"]=23]="rendering-main",e[e["rendering-drawer"]=24]="rendering-drawer",e[e["sensors-main"]=25]="sensors-main",e[e["sensors-drawer"]=26]="sensors-drawer",e[e["sources.search-main"]=27]="sources.search-main",e[e["sources.search-drawer"]=28]="sources.search-drawer",e[e["security-main"]=29]="security-main",e[e["security-drawer"]=30]="security-drawer",e[e["lighthouse-main"]=33]="lighthouse-main",e[e["lighthouse-drawer"]=34]="lighthouse-drawer",e[e["coverage-main"]=35]="coverage-main",e[e["coverage-drawer"]=36]="coverage-drawer",e[e["protocol-monitor-main"]=37]="protocol-monitor-main",e[e["protocol-monitor-drawer"]=38]="protocol-monitor-drawer",e[e["remote-devices-main"]=39]="remote-devices-main",e[e["remote-devices-drawer"]=40]="remote-devices-drawer",e[e["web-audio-main"]=41]="web-audio-main",e[e["web-audio-drawer"]=42]="web-audio-drawer",e[e["changes.changes-main"]=43]="changes.changes-main",e[e["changes.changes-drawer"]=44]="changes.changes-drawer",e[e["performance.monitor-main"]=45]="performance.monitor-main",e[e["performance.monitor-drawer"]=46]="performance.monitor-drawer",e[e["release-note-main"]=47]="release-note-main",e[e["release-note-drawer"]=48]="release-note-drawer",e[e["live_heap_profile-main"]=49]="live_heap_profile-main",e[e["live_heap_profile-drawer"]=50]="live_heap_profile-drawer",e[e["sources.quick-main"]=51]="sources.quick-main",e[e["sources.quick-drawer"]=52]="sources.quick-drawer",e[e["network.blocked-urls-main"]=53]="network.blocked-urls-main",e[e["network.blocked-urls-drawer"]=54]="network.blocked-urls-drawer",e[e["settings-preferences-main"]=55]="settings-preferences-main",e[e["settings-preferences-drawer"]=56]="settings-preferences-drawer",e[e["settings-workspace-main"]=57]="settings-workspace-main",e[e["settings-workspace-drawer"]=58]="settings-workspace-drawer",e[e["settings-experiments-main"]=59]="settings-experiments-main",e[e["settings-experiments-drawer"]=60]="settings-experiments-drawer",e[e["settings-blackbox-main"]=61]="settings-blackbox-main",e[e["settings-blackbox-drawer"]=62]="settings-blackbox-drawer",e[e["settings-devices-main"]=63]="settings-devices-main",e[e["settings-devices-drawer"]=64]="settings-devices-drawer",e[e["settings-throttling-conditions-main"]=65]="settings-throttling-conditions-main",e[e["settings-throttling-conditions-drawer"]=66]="settings-throttling-conditions-drawer",e[e["settings-emulation-locations-main"]=67]="settings-emulation-locations-main",e[e["settings-emulation-locations-drawer"]=68]="settings-emulation-locations-drawer",e[e["settings-shortcuts-main"]=69]="settings-shortcuts-main",e[e["settings-shortcuts-drawer"]=70]="settings-shortcuts-drawer",e[e["issues-pane-main"]=71]="issues-pane-main",e[e["issues-pane-drawer"]=72]="issues-pane-drawer",e[e["settings-keybinds-main"]=73]="settings-keybinds-main",e[e["settings-keybinds-drawer"]=74]="settings-keybinds-drawer",e[e["cssoverview-main"]=75]="cssoverview-main",e[e["cssoverview-drawer"]=76]="cssoverview-drawer",e[e["chrome_recorder-main"]=77]="chrome_recorder-main",e[e["chrome_recorder-drawer"]=78]="chrome_recorder-drawer",e[e["trust_tokens-main"]=79]="trust_tokens-main",e[e["trust_tokens-drawer"]=80]="trust_tokens-drawer",e[e["reporting_api-main"]=81]="reporting_api-main",e[e["reporting_api-drawer"]=82]="reporting_api-drawer",e[e["interest_groups-main"]=83]="interest_groups-main",e[e["interest_groups-drawer"]=84]="interest_groups-drawer",e[e["back_forward_cache-main"]=85]="back_forward_cache-main",e[e["back_forward_cache-drawer"]=86]="back_forward_cache-drawer",e[e["service_worker_cache-main"]=87]="service_worker_cache-main",e[e["service_worker_cache-drawer"]=88]="service_worker_cache-drawer",e[e["background_service_backgroundFetch-main"]=89]="background_service_backgroundFetch-main",e[e["background_service_backgroundFetch-drawer"]=90]="background_service_backgroundFetch-drawer",e[e["background_service_backgroundSync-main"]=91]="background_service_backgroundSync-main",e[e["background_service_backgroundSync-drawer"]=92]="background_service_backgroundSync-drawer",e[e["background_service_pushMessaging-main"]=93]="background_service_pushMessaging-main",e[e["background_service_pushMessaging-drawer"]=94]="background_service_pushMessaging-drawer",e[e["background_service_notifications-main"]=95]="background_service_notifications-main",e[e["background_service_notifications-drawer"]=96]="background_service_notifications-drawer",e[e["background_service_paymentHandler-main"]=97]="background_service_paymentHandler-main",e[e["background_service_paymentHandler-drawer"]=98]="background_service_paymentHandler-drawer",e[e["background_service_periodicBackgroundSync-main"]=99]="background_service_periodicBackgroundSync-main",e[e["background_service_periodicBackgroundSync-drawer"]=100]="background_service_periodicBackgroundSync-drawer",e[e["service_workers-main"]=101]="service_workers-main",e[e["service_workers-drawer"]=102]="service_workers-drawer",e[e["app_manifest-main"]=103]="app_manifest-main",e[e["app_manifest-drawer"]=104]="app_manifest-drawer",e[e["storage-main"]=105]="storage-main",e[e["storage-drawer"]=106]="storage-drawer",e[e["cookies-main"]=107]="cookies-main",e[e["cookies-drawer"]=108]="cookies-drawer",e[e["frame_details-main"]=109]="frame_details-main",e[e["frame_details-drawer"]=110]="frame_details-drawer",e[e["frame_resource-main"]=111]="frame_resource-main",e[e["frame_resource-drawer"]=112]="frame_resource-drawer",e[e["frame_window-main"]=113]="frame_window-main",e[e["frame_window-drawer"]=114]="frame_window-drawer",e[e["frame_worker-main"]=115]="frame_worker-main",e[e["frame_worker-drawer"]=116]="frame_worker-drawer",e[e["dom_storage-main"]=117]="dom_storage-main",e[e["dom_storage-drawer"]=118]="dom_storage-drawer",e[e["indexed_db-main"]=119]="indexed_db-main",e[e["indexed_db-drawer"]=120]="indexed_db-drawer",e[e["web_sql-main"]=121]="web_sql-main",e[e["web_sql-drawer"]=122]="web_sql-drawer",e[e["performance_insights-main"]=123]="performance_insights-main",e[e["performance_insights-drawer"]=124]="performance_insights-drawer",e[e["preloading-main"]=125]="preloading-main",e[e["preloading-drawer"]=126]="preloading-drawer",e[e["bounce_tracking_mitigations-main"]=127]="bounce_tracking_mitigations-main",e[e["bounce_tracking_mitigations-drawer"]=128]="bounce_tracking_mitigations-drawer",e[e["developer-resources-main"]=129]="developer-resources-main",e[e["developer-resources-drawer"]=130]="developer-resources-drawer",e[e["autofill-view-main"]=131]="autofill-view-main",e[e["autofill-view-drawer"]=132]="autofill-view-drawer",e[e.MAX_VALUE=133]="MAX_VALUE"}(ee||(ee={})),function(e){e[e.OtherSidebarPane=0]="OtherSidebarPane",e[e.styles=1]="styles",e[e.computed=2]="computed",e[e["elements.layout"]=3]="elements.layout",e[e["elements.event-listeners"]=4]="elements.event-listeners",e[e["elements.dom-breakpoints"]=5]="elements.dom-breakpoints",e[e["elements.dom-properties"]=6]="elements.dom-properties",e[e["accessibility.view"]=7]="accessibility.view",e[e.MAX_VALUE=8]="MAX_VALUE"}(re||(re={})),function(e){e[e.Unknown=0]="Unknown",e[e["text/css"]=2]="text/css",e[e["text/html"]=3]="text/html",e[e["application/xml"]=4]="application/xml",e[e["application/wasm"]=5]="application/wasm",e[e["application/manifest+json"]=6]="application/manifest+json",e[e["application/x-aspx"]=7]="application/x-aspx",e[e["application/jsp"]=8]="application/jsp",e[e["text/x-c++src"]=9]="text/x-c++src",e[e["text/x-coffeescript"]=10]="text/x-coffeescript",e[e["application/vnd.dart"]=11]="application/vnd.dart",e[e["text/typescript"]=12]="text/typescript",e[e["text/typescript-jsx"]=13]="text/typescript-jsx",e[e["application/json"]=14]="application/json",e[e["text/x-csharp"]=15]="text/x-csharp",e[e["text/x-java"]=16]="text/x-java",e[e["text/x-less"]=17]="text/x-less",e[e["application/x-httpd-php"]=18]="application/x-httpd-php",e[e["text/x-python"]=19]="text/x-python",e[e["text/x-sh"]=20]="text/x-sh",e[e["text/x-gss"]=21]="text/x-gss",e[e["text/x-sass"]=22]="text/x-sass",e[e["text/x-scss"]=23]="text/x-scss",e[e["text/markdown"]=24]="text/markdown",e[e["text/x-clojure"]=25]="text/x-clojure",e[e["text/jsx"]=26]="text/jsx",e[e["text/x-go"]=27]="text/x-go",e[e["text/x-kotlin"]=28]="text/x-kotlin",e[e["text/x-scala"]=29]="text/x-scala",e[e["text/x.svelte"]=30]="text/x.svelte",e[e["text/javascript+plain"]=31]="text/javascript+plain",e[e["text/javascript+minified"]=32]="text/javascript+minified",e[e["text/javascript+sourcemapped"]=33]="text/javascript+sourcemapped",e[e["text/x.angular"]=34]="text/x.angular",e[e["text/x.vue"]=35]="text/x.vue",e[e["text/javascript+snippet"]=36]="text/javascript+snippet",e[e["text/javascript+eval"]=37]="text/javascript+eval",e[e.MAX_VALUE=38]="MAX_VALUE"}(te||(te={})),function(e){e[e.devToolsDefault=0]="devToolsDefault",e[e.vsCode=1]="vsCode",e[e.MAX_VALUE=2]="MAX_VALUE"}(ne||(ne={})),function(e){e[e.OtherShortcut=0]="OtherShortcut",e[e["quick-open.show-command-menu"]=1]="quick-open.show-command-menu",e[e["console.clear"]=2]="console.clear",e[e["console.toggle"]=3]="console.toggle",e[e["debugger.step"]=4]="debugger.step",e[e["debugger.step-into"]=5]="debugger.step-into",e[e["debugger.step-out"]=6]="debugger.step-out",e[e["debugger.step-over"]=7]="debugger.step-over",e[e["debugger.toggle-breakpoint"]=8]="debugger.toggle-breakpoint",e[e["debugger.toggle-breakpoint-enabled"]=9]="debugger.toggle-breakpoint-enabled",e[e["debugger.toggle-pause"]=10]="debugger.toggle-pause",e[e["elements.edit-as-html"]=11]="elements.edit-as-html",e[e["elements.hide-element"]=12]="elements.hide-element",e[e["elements.redo"]=13]="elements.redo",e[e["elements.toggle-element-search"]=14]="elements.toggle-element-search",e[e["elements.undo"]=15]="elements.undo",e[e["main.search-in-panel.find"]=16]="main.search-in-panel.find",e[e["main.toggle-drawer"]=17]="main.toggle-drawer",e[e["network.hide-request-details"]=18]="network.hide-request-details",e[e["network.search"]=19]="network.search",e[e["network.toggle-recording"]=20]="network.toggle-recording",e[e["quick-open.show"]=21]="quick-open.show",e[e["settings.show"]=22]="settings.show",e[e["sources.search"]=23]="sources.search",e[e["background-service.toggle-recording"]=24]="background-service.toggle-recording",e[e["components.collect-garbage"]=25]="components.collect-garbage",e[e["console.clear.history"]=26]="console.clear.history",e[e["console.create-pin"]=27]="console.create-pin",e[e["coverage.start-with-reload"]=28]="coverage.start-with-reload",e[e["coverage.toggle-recording"]=29]="coverage.toggle-recording",e[e["debugger.breakpoint-input-window"]=30]="debugger.breakpoint-input-window",e[e["debugger.evaluate-selection"]=31]="debugger.evaluate-selection",e[e["debugger.next-call-frame"]=32]="debugger.next-call-frame",e[e["debugger.previous-call-frame"]=33]="debugger.previous-call-frame",e[e["debugger.run-snippet"]=34]="debugger.run-snippet",e[e["debugger.toggle-breakpoints-active"]=35]="debugger.toggle-breakpoints-active",e[e["elements.capture-area-screenshot"]=36]="elements.capture-area-screenshot",e[e["emulation.capture-full-height-screenshot"]=37]="emulation.capture-full-height-screenshot",e[e["emulation.capture-node-screenshot"]=38]="emulation.capture-node-screenshot",e[e["emulation.capture-screenshot"]=39]="emulation.capture-screenshot",e[e["emulation.show-sensors"]=40]="emulation.show-sensors",e[e["emulation.toggle-device-mode"]=41]="emulation.toggle-device-mode",e[e["help.release-notes"]=42]="help.release-notes",e[e["help.report-issue"]=43]="help.report-issue",e[e["input.start-replaying"]=44]="input.start-replaying",e[e["input.toggle-pause"]=45]="input.toggle-pause",e[e["input.toggle-recording"]=46]="input.toggle-recording",e[e["inspector-main.focus-debuggee"]=47]="inspector-main.focus-debuggee",e[e["inspector-main.hard-reload"]=48]="inspector-main.hard-reload",e[e["inspector-main.reload"]=49]="inspector-main.reload",e[e["live-heap-profile.start-with-reload"]=50]="live-heap-profile.start-with-reload",e[e["live-heap-profile.toggle-recording"]=51]="live-heap-profile.toggle-recording",e[e["main.debug-reload"]=52]="main.debug-reload",e[e["main.next-tab"]=53]="main.next-tab",e[e["main.previous-tab"]=54]="main.previous-tab",e[e["main.search-in-panel.cancel"]=55]="main.search-in-panel.cancel",e[e["main.search-in-panel.find-next"]=56]="main.search-in-panel.find-next",e[e["main.search-in-panel.find-previous"]=57]="main.search-in-panel.find-previous",e[e["main.toggle-dock"]=58]="main.toggle-dock",e[e["main.zoom-in"]=59]="main.zoom-in",e[e["main.zoom-out"]=60]="main.zoom-out",e[e["main.zoom-reset"]=61]="main.zoom-reset",e[e["network-conditions.network-low-end-mobile"]=62]="network-conditions.network-low-end-mobile",e[e["network-conditions.network-mid-tier-mobile"]=63]="network-conditions.network-mid-tier-mobile",e[e["network-conditions.network-offline"]=64]="network-conditions.network-offline",e[e["network-conditions.network-online"]=65]="network-conditions.network-online",e[e["profiler.heap-toggle-recording"]=66]="profiler.heap-toggle-recording",e[e["profiler.js-toggle-recording"]=67]="profiler.js-toggle-recording",e[e["resources.clear"]=68]="resources.clear",e[e["settings.documentation"]=69]="settings.documentation",e[e["settings.shortcuts"]=70]="settings.shortcuts",e[e["sources.add-folder-to-workspace"]=71]="sources.add-folder-to-workspace",e[e["sources.add-to-watch"]=72]="sources.add-to-watch",e[e["sources.close-all"]=73]="sources.close-all",e[e["sources.close-editor-tab"]=74]="sources.close-editor-tab",e[e["sources.create-snippet"]=75]="sources.create-snippet",e[e["sources.go-to-line"]=76]="sources.go-to-line",e[e["sources.go-to-member"]=77]="sources.go-to-member",e[e["sources.jump-to-next-location"]=78]="sources.jump-to-next-location",e[e["sources.jump-to-previous-location"]=79]="sources.jump-to-previous-location",e[e["sources.rename"]=80]="sources.rename",e[e["sources.save"]=81]="sources.save",e[e["sources.save-all"]=82]="sources.save-all",e[e["sources.switch-file"]=83]="sources.switch-file",e[e["timeline.jump-to-next-frame"]=84]="timeline.jump-to-next-frame",e[e["timeline.jump-to-previous-frame"]=85]="timeline.jump-to-previous-frame",e[e["timeline.load-from-file"]=86]="timeline.load-from-file",e[e["timeline.next-recording"]=87]="timeline.next-recording",e[e["timeline.previous-recording"]=88]="timeline.previous-recording",e[e["timeline.record-reload"]=89]="timeline.record-reload",e[e["timeline.save-to-file"]=90]="timeline.save-to-file",e[e["timeline.show-history"]=91]="timeline.show-history",e[e["timeline.toggle-recording"]=92]="timeline.toggle-recording",e[e["sources.increment-css"]=93]="sources.increment-css",e[e["sources.increment-css-by-ten"]=94]="sources.increment-css-by-ten",e[e["sources.decrement-css"]=95]="sources.decrement-css",e[e["sources.decrement-css-by-ten"]=96]="sources.decrement-css-by-ten",e[e["layers.reset-view"]=97]="layers.reset-view",e[e["layers.pan-mode"]=98]="layers.pan-mode",e[e["layers.rotate-mode"]=99]="layers.rotate-mode",e[e["layers.zoom-in"]=100]="layers.zoom-in",e[e["layers.zoom-out"]=101]="layers.zoom-out",e[e["layers.up"]=102]="layers.up",e[e["layers.down"]=103]="layers.down",e[e["layers.left"]=104]="layers.left",e[e["layers.right"]=105]="layers.right",e[e["help.report-translation-issue"]=106]="help.report-translation-issue",e[e["rendering.toggle-prefers-color-scheme"]=107]="rendering.toggle-prefers-color-scheme",e[e["chrome-recorder.start-recording"]=108]="chrome-recorder.start-recording",e[e["chrome-recorder.replay-recording"]=109]="chrome-recorder.replay-recording",e[e["chrome-recorder.toggle-code-view"]=110]="chrome-recorder.toggle-code-view",e[e["chrome-recorder.copy-recording-or-step"]=111]="chrome-recorder.copy-recording-or-step",e[e["changes.revert"]=112]="changes.revert",e[e["changes.copy"]=113]="changes.copy",e[e["elements.new-style-rule"]=114]="elements.new-style-rule",e[e["elements.refresh-event-listeners"]=115]="elements.refresh-event-listeners",e[e["coverage.clear"]=116]="coverage.clear",e[e["coverage.export"]=117]="coverage.export",e[e["timeline.dim-third-parties"]=118]="timeline.dim-third-parties",e[e.MAX_VALUE=119]="MAX_VALUE"}(oe||(oe={})),function(e){e[e["capture-node-creation-stacks"]=1]="capture-node-creation-stacks",e[e["live-heap-profile"]=11]="live-heap-profile",e[e["protocol-monitor"]=13]="protocol-monitor",e[e["sampling-heap-profiler-timeline"]=17]="sampling-heap-profiler-timeline",e[e["show-option-tp-expose-internals-in-heap-snapshot"]=18]="show-option-tp-expose-internals-in-heap-snapshot",e[e["timeline-invalidation-tracking"]=26]="timeline-invalidation-tracking",e[e["timeline-show-all-events"]=27]="timeline-show-all-events",e[e["timeline-v8-runtime-call-stats"]=28]="timeline-v8-runtime-call-stats",e[e.apca=39]="apca",e[e["font-editor"]=41]="font-editor",e[e["full-accessibility-tree"]=42]="full-accessibility-tree",e[e["contrast-issues"]=44]="contrast-issues",e[e["experimental-cookie-features"]=45]="experimental-cookie-features",e[e["instrumentation-breakpoints"]=61]="instrumentation-breakpoints",e[e["authored-deployed-grouping"]=63]="authored-deployed-grouping",e[e["just-my-code"]=65]="just-my-code",e[e["highlight-errors-elements-panel"]=73]="highlight-errors-elements-panel",e[e["use-source-map-scopes"]=76]="use-source-map-scopes",e[e["network-panel-filter-bar-redesign"]=79]="network-panel-filter-bar-redesign",e[e["timeline-show-postmessage-events"]=86]="timeline-show-postmessage-events",e[e["timeline-enhanced-traces"]=90]="timeline-enhanced-traces",e[e["timeline-compiled-sources"]=91]="timeline-compiled-sources",e[e["timeline-debug-mode"]=93]="timeline-debug-mode",e[e["timeline-experimental-insights"]=102]="timeline-experimental-insights",e[e["timeline-dim-unrelated-events"]=103]="timeline-dim-unrelated-events",e[e["timeline-alternative-navigation"]=104]="timeline-alternative-navigation",e[e.MAX_VALUE=106]="MAX_VALUE"}(se||(se={})),function(e){e[e.CrossOriginEmbedderPolicy=0]="CrossOriginEmbedderPolicy",e[e.MixedContent=1]="MixedContent",e[e.SameSiteCookie=2]="SameSiteCookie",e[e.HeavyAd=3]="HeavyAd",e[e.ContentSecurityPolicy=4]="ContentSecurityPolicy",e[e.Other=5]="Other",e[e.Generic=6]="Generic",e[e.ThirdPartyPhaseoutCookie=7]="ThirdPartyPhaseoutCookie",e[e.GenericCookie=8]="GenericCookie",e[e.MAX_VALUE=9]="MAX_VALUE"}(ie||(ie={})),function(e){e[e.CrossOriginEmbedderPolicyRequest=0]="CrossOriginEmbedderPolicyRequest",e[e.CrossOriginEmbedderPolicyElement=1]="CrossOriginEmbedderPolicyElement",e[e.MixedContentRequest=2]="MixedContentRequest",e[e.SameSiteCookieCookie=3]="SameSiteCookieCookie",e[e.SameSiteCookieRequest=4]="SameSiteCookieRequest",e[e.HeavyAdElement=5]="HeavyAdElement",e[e.ContentSecurityPolicyDirective=6]="ContentSecurityPolicyDirective",e[e.ContentSecurityPolicyElement=7]="ContentSecurityPolicyElement",e[e.MAX_VALUE=13]="MAX_VALUE"}(ae||(ae={})),function(e){e[e.MixedContentIssue=0]="MixedContentIssue",e[e["ContentSecurityPolicyIssue::kInlineViolation"]=1]="ContentSecurityPolicyIssue::kInlineViolation",e[e["ContentSecurityPolicyIssue::kEvalViolation"]=2]="ContentSecurityPolicyIssue::kEvalViolation",e[e["ContentSecurityPolicyIssue::kURLViolation"]=3]="ContentSecurityPolicyIssue::kURLViolation",e[e["ContentSecurityPolicyIssue::kTrustedTypesSinkViolation"]=4]="ContentSecurityPolicyIssue::kTrustedTypesSinkViolation",e[e["ContentSecurityPolicyIssue::kTrustedTypesPolicyViolation"]=5]="ContentSecurityPolicyIssue::kTrustedTypesPolicyViolation",e[e["HeavyAdIssue::NetworkTotalLimit"]=6]="HeavyAdIssue::NetworkTotalLimit",e[e["HeavyAdIssue::CpuTotalLimit"]=7]="HeavyAdIssue::CpuTotalLimit",e[e["HeavyAdIssue::CpuPeakLimit"]=8]="HeavyAdIssue::CpuPeakLimit",e[e["CrossOriginEmbedderPolicyIssue::CoepFrameResourceNeedsCoepHeader"]=9]="CrossOriginEmbedderPolicyIssue::CoepFrameResourceNeedsCoepHeader",e[e["CrossOriginEmbedderPolicyIssue::CoopSandboxedIFrameCannotNavigateToCoopPage"]=10]="CrossOriginEmbedderPolicyIssue::CoopSandboxedIFrameCannotNavigateToCoopPage",e[e["CrossOriginEmbedderPolicyIssue::CorpNotSameOrigin"]=11]="CrossOriginEmbedderPolicyIssue::CorpNotSameOrigin",e[e["CrossOriginEmbedderPolicyIssue::CorpNotSameOriginAfterDefaultedToSameOriginByCoep"]=12]="CrossOriginEmbedderPolicyIssue::CorpNotSameOriginAfterDefaultedToSameOriginByCoep",e[e["CrossOriginEmbedderPolicyIssue::CorpNotSameSite"]=13]="CrossOriginEmbedderPolicyIssue::CorpNotSameSite",e[e["CookieIssue::ExcludeSameSiteNoneInsecure::ReadCookie"]=14]="CookieIssue::ExcludeSameSiteNoneInsecure::ReadCookie",e[e["CookieIssue::ExcludeSameSiteNoneInsecure::SetCookie"]=15]="CookieIssue::ExcludeSameSiteNoneInsecure::SetCookie",e[e["CookieIssue::WarnSameSiteNoneInsecure::ReadCookie"]=16]="CookieIssue::WarnSameSiteNoneInsecure::ReadCookie",e[e["CookieIssue::WarnSameSiteNoneInsecure::SetCookie"]=17]="CookieIssue::WarnSameSiteNoneInsecure::SetCookie",e[e["CookieIssue::WarnSameSiteStrictLaxDowngradeStrict::Secure"]=18]="CookieIssue::WarnSameSiteStrictLaxDowngradeStrict::Secure",e[e["CookieIssue::WarnSameSiteStrictLaxDowngradeStrict::Insecure"]=19]="CookieIssue::WarnSameSiteStrictLaxDowngradeStrict::Insecure",e[e["CookieIssue::WarnCrossDowngrade::ReadCookie::Secure"]=20]="CookieIssue::WarnCrossDowngrade::ReadCookie::Secure",e[e["CookieIssue::WarnCrossDowngrade::ReadCookie::Insecure"]=21]="CookieIssue::WarnCrossDowngrade::ReadCookie::Insecure",e[e["CookieIssue::WarnCrossDowngrade::SetCookie::Secure"]=22]="CookieIssue::WarnCrossDowngrade::SetCookie::Secure",e[e["CookieIssue::WarnCrossDowngrade::SetCookie::Insecure"]=23]="CookieIssue::WarnCrossDowngrade::SetCookie::Insecure",e[e["CookieIssue::ExcludeNavigationContextDowngrade::Secure"]=24]="CookieIssue::ExcludeNavigationContextDowngrade::Secure",e[e["CookieIssue::ExcludeNavigationContextDowngrade::Insecure"]=25]="CookieIssue::ExcludeNavigationContextDowngrade::Insecure",e[e["CookieIssue::ExcludeContextDowngrade::ReadCookie::Secure"]=26]="CookieIssue::ExcludeContextDowngrade::ReadCookie::Secure",e[e["CookieIssue::ExcludeContextDowngrade::ReadCookie::Insecure"]=27]="CookieIssue::ExcludeContextDowngrade::ReadCookie::Insecure",e[e["CookieIssue::ExcludeContextDowngrade::SetCookie::Secure"]=28]="CookieIssue::ExcludeContextDowngrade::SetCookie::Secure",e[e["CookieIssue::ExcludeContextDowngrade::SetCookie::Insecure"]=29]="CookieIssue::ExcludeContextDowngrade::SetCookie::Insecure",e[e["CookieIssue::ExcludeSameSiteUnspecifiedTreatedAsLax::ReadCookie"]=30]="CookieIssue::ExcludeSameSiteUnspecifiedTreatedAsLax::ReadCookie",e[e["CookieIssue::ExcludeSameSiteUnspecifiedTreatedAsLax::SetCookie"]=31]="CookieIssue::ExcludeSameSiteUnspecifiedTreatedAsLax::SetCookie",e[e["CookieIssue::WarnSameSiteUnspecifiedLaxAllowUnsafe::ReadCookie"]=32]="CookieIssue::WarnSameSiteUnspecifiedLaxAllowUnsafe::ReadCookie",e[e["CookieIssue::WarnSameSiteUnspecifiedLaxAllowUnsafe::SetCookie"]=33]="CookieIssue::WarnSameSiteUnspecifiedLaxAllowUnsafe::SetCookie",e[e["CookieIssue::WarnSameSiteUnspecifiedCrossSiteContext::ReadCookie"]=34]="CookieIssue::WarnSameSiteUnspecifiedCrossSiteContext::ReadCookie",e[e["CookieIssue::WarnSameSiteUnspecifiedCrossSiteContext::SetCookie"]=35]="CookieIssue::WarnSameSiteUnspecifiedCrossSiteContext::SetCookie",e[e["SharedArrayBufferIssue::TransferIssue"]=36]="SharedArrayBufferIssue::TransferIssue",e[e["SharedArrayBufferIssue::CreationIssue"]=37]="SharedArrayBufferIssue::CreationIssue",e[e.LowTextContrastIssue=41]="LowTextContrastIssue",e[e["CorsIssue::InsecurePrivateNetwork"]=42]="CorsIssue::InsecurePrivateNetwork",e[e["CorsIssue::InvalidHeaders"]=44]="CorsIssue::InvalidHeaders",e[e["CorsIssue::WildcardOriginWithCredentials"]=45]="CorsIssue::WildcardOriginWithCredentials",e[e["CorsIssue::PreflightResponseInvalid"]=46]="CorsIssue::PreflightResponseInvalid",e[e["CorsIssue::OriginMismatch"]=47]="CorsIssue::OriginMismatch",e[e["CorsIssue::AllowCredentialsRequired"]=48]="CorsIssue::AllowCredentialsRequired",e[e["CorsIssue::MethodDisallowedByPreflightResponse"]=49]="CorsIssue::MethodDisallowedByPreflightResponse",e[e["CorsIssue::HeaderDisallowedByPreflightResponse"]=50]="CorsIssue::HeaderDisallowedByPreflightResponse",e[e["CorsIssue::RedirectContainsCredentials"]=51]="CorsIssue::RedirectContainsCredentials",e[e["CorsIssue::DisallowedByMode"]=52]="CorsIssue::DisallowedByMode",e[e["CorsIssue::CorsDisabledScheme"]=53]="CorsIssue::CorsDisabledScheme",e[e["CorsIssue::PreflightMissingAllowExternal"]=54]="CorsIssue::PreflightMissingAllowExternal",e[e["CorsIssue::PreflightInvalidAllowExternal"]=55]="CorsIssue::PreflightInvalidAllowExternal",e[e["CorsIssue::NoCorsRedirectModeNotFollow"]=57]="CorsIssue::NoCorsRedirectModeNotFollow",e[e["QuirksModeIssue::QuirksMode"]=58]="QuirksModeIssue::QuirksMode",e[e["QuirksModeIssue::LimitedQuirksMode"]=59]="QuirksModeIssue::LimitedQuirksMode",e[e.DeprecationIssue=60]="DeprecationIssue",e[e["ClientHintIssue::MetaTagAllowListInvalidOrigin"]=61]="ClientHintIssue::MetaTagAllowListInvalidOrigin",e[e["ClientHintIssue::MetaTagModifiedHTML"]=62]="ClientHintIssue::MetaTagModifiedHTML",e[e["CorsIssue::PreflightAllowPrivateNetworkError"]=63]="CorsIssue::PreflightAllowPrivateNetworkError",e[e["GenericIssue::CrossOriginPortalPostMessageError"]=64]="GenericIssue::CrossOriginPortalPostMessageError",e[e["GenericIssue::FormLabelForNameError"]=65]="GenericIssue::FormLabelForNameError",e[e["GenericIssue::FormDuplicateIdForInputError"]=66]="GenericIssue::FormDuplicateIdForInputError",e[e["GenericIssue::FormInputWithNoLabelError"]=67]="GenericIssue::FormInputWithNoLabelError",e[e["GenericIssue::FormAutocompleteAttributeEmptyError"]=68]="GenericIssue::FormAutocompleteAttributeEmptyError",e[e["GenericIssue::FormEmptyIdAndNameAttributesForInputError"]=69]="GenericIssue::FormEmptyIdAndNameAttributesForInputError",e[e["GenericIssue::FormAriaLabelledByToNonExistingId"]=70]="GenericIssue::FormAriaLabelledByToNonExistingId",e[e["GenericIssue::FormInputAssignedAutocompleteValueToIdOrNameAttributeError"]=71]="GenericIssue::FormInputAssignedAutocompleteValueToIdOrNameAttributeError",e[e["GenericIssue::FormLabelHasNeitherForNorNestedInput"]=72]="GenericIssue::FormLabelHasNeitherForNorNestedInput",e[e["GenericIssue::FormLabelForMatchesNonExistingIdError"]=73]="GenericIssue::FormLabelForMatchesNonExistingIdError",e[e["GenericIssue::FormHasPasswordFieldWithoutUsernameFieldError"]=74]="GenericIssue::FormHasPasswordFieldWithoutUsernameFieldError",e[e["GenericIssue::FormInputHasWrongButWellIntendedAutocompleteValueError"]=75]="GenericIssue::FormInputHasWrongButWellIntendedAutocompleteValueError",e[e["StylesheetLoadingIssue::LateImportRule"]=76]="StylesheetLoadingIssue::LateImportRule",e[e["StylesheetLoadingIssue::RequestFailed"]=77]="StylesheetLoadingIssue::RequestFailed",e[e["CorsIssue::PreflightMissingPrivateNetworkAccessId"]=78]="CorsIssue::PreflightMissingPrivateNetworkAccessId",e[e["CorsIssue::PreflightMissingPrivateNetworkAccessName"]=79]="CorsIssue::PreflightMissingPrivateNetworkAccessName",e[e["CorsIssue::PrivateNetworkAccessPermissionUnavailable"]=80]="CorsIssue::PrivateNetworkAccessPermissionUnavailable",e[e["CorsIssue::PrivateNetworkAccessPermissionDenied"]=81]="CorsIssue::PrivateNetworkAccessPermissionDenied",e[e["CookieIssue::WarnThirdPartyPhaseout::ReadCookie"]=82]="CookieIssue::WarnThirdPartyPhaseout::ReadCookie",e[e["CookieIssue::WarnThirdPartyPhaseout::SetCookie"]=83]="CookieIssue::WarnThirdPartyPhaseout::SetCookie",e[e["CookieIssue::ExcludeThirdPartyPhaseout::ReadCookie"]=84]="CookieIssue::ExcludeThirdPartyPhaseout::ReadCookie",e[e["CookieIssue::ExcludeThirdPartyPhaseout::SetCookie"]=85]="CookieIssue::ExcludeThirdPartyPhaseout::SetCookie",e[e["SelectElementAccessibilityIssue::DisallowedSelectChild"]=86]="SelectElementAccessibilityIssue::DisallowedSelectChild",e[e["SelectElementAccessibilityIssue::DisallowedOptGroupChild"]=87]="SelectElementAccessibilityIssue::DisallowedOptGroupChild",e[e["SelectElementAccessibilityIssue::NonPhrasingContentOptionChild"]=88]="SelectElementAccessibilityIssue::NonPhrasingContentOptionChild",e[e["SelectElementAccessibilityIssue::InteractiveContentOptionChild"]=89]="SelectElementAccessibilityIssue::InteractiveContentOptionChild",e[e["SelectElementAccessibilityIssue::InteractiveContentLegendChild"]=90]="SelectElementAccessibilityIssue::InteractiveContentLegendChild",e[e["SRIMessageSignatureIssue::MissingSignatureHeader"]=91]="SRIMessageSignatureIssue::MissingSignatureHeader",e[e["SRIMessageSignatureIssue::MissingSignatureInputHeader"]=92]="SRIMessageSignatureIssue::MissingSignatureInputHeader",e[e["SRIMessageSignatureIssue::InvalidSignatureHeader"]=93]="SRIMessageSignatureIssue::InvalidSignatureHeader",e[e["SRIMessageSignatureIssue::InvalidSignatureInputHeader"]=94]="SRIMessageSignatureIssue::InvalidSignatureInputHeader",e[e["SRIMessageSignatureIssue::SignatureHeaderValueIsNotByteSequence"]=95]="SRIMessageSignatureIssue::SignatureHeaderValueIsNotByteSequence",e[e["SRIMessageSignatureIssue::SignatureHeaderValueIsParameterized"]=96]="SRIMessageSignatureIssue::SignatureHeaderValueIsParameterized",e[e["SRIMessageSignatureIssue::SignatureHeaderValueIsIncorrectLength"]=97]="SRIMessageSignatureIssue::SignatureHeaderValueIsIncorrectLength",e[e["SRIMessageSignatureIssue::SignatureInputHeaderMissingLabel"]=98]="SRIMessageSignatureIssue::SignatureInputHeaderMissingLabel",e[e["SRIMessageSignatureIssue::SignatureInputHeaderValueNotInnerList"]=99]="SRIMessageSignatureIssue::SignatureInputHeaderValueNotInnerList",e[e["SRIMessageSignatureIssue::SignatureInputHeaderValueMissingComponents"]=100]="SRIMessageSignatureIssue::SignatureInputHeaderValueMissingComponents",e[e["SRIMessageSignatureIssue::SignatureInputHeaderInvalidComponentType"]=101]="SRIMessageSignatureIssue::SignatureInputHeaderInvalidComponentType",e[e["SRIMessageSignatureIssue::SignatureInputHeaderInvalidComponentName"]=102]="SRIMessageSignatureIssue::SignatureInputHeaderInvalidComponentName",e[e["SRIMessageSignatureIssue::SignatureInputHeaderInvalidHeaderComponentParameter"]=103]="SRIMessageSignatureIssue::SignatureInputHeaderInvalidHeaderComponentParameter",e[e["SRIMessageSignatureIssue::SignatureInputHeaderInvalidDerivedComponentParameter"]=104]="SRIMessageSignatureIssue::SignatureInputHeaderInvalidDerivedComponentParameter",e[e["SRIMessageSignatureIssue::SignatureInputHeaderKeyIdLength"]=105]="SRIMessageSignatureIssue::SignatureInputHeaderKeyIdLength",e[e["SRIMessageSignatureIssue::SignatureInputHeaderInvalidParameter"]=106]="SRIMessageSignatureIssue::SignatureInputHeaderInvalidParameter",e[e["SRIMessageSignatureIssue::SignatureInputHeaderMissingRequiredParameters"]=107]="SRIMessageSignatureIssue::SignatureInputHeaderMissingRequiredParameters",e[e["SRIMessageSignatureIssue::ValidationFailedSignatureExpired"]=108]="SRIMessageSignatureIssue::ValidationFailedSignatureExpired",e[e["SRIMessageSignatureIssue::ValidationFailedInvalidLength"]=109]="SRIMessageSignatureIssue::ValidationFailedInvalidLength",e[e["SRIMessageSignatureIssue::ValidationFailedSignatureMismatch"]=110]="SRIMessageSignatureIssue::ValidationFailedSignatureMismatch",e[e["CorsIssue::LocalNetworkAccessPermissionDenied"]=111]="CorsIssue::LocalNetworkAccessPermissionDenied",e[e["SRIMessageSignatureIssue::ValidationFailedIntegrityMismatch"]=112]="SRIMessageSignatureIssue::ValidationFailedIntegrityMismatch",e[e.MAX_VALUE=113]="MAX_VALUE"}(de||(de={})),function(e){e[e.af=1]="af",e[e.am=2]="am",e[e.ar=3]="ar",e[e.as=4]="as",e[e.az=5]="az",e[e.be=6]="be",e[e.bg=7]="bg",e[e.bn=8]="bn",e[e.bs=9]="bs",e[e.ca=10]="ca",e[e.cs=11]="cs",e[e.cy=12]="cy",e[e.da=13]="da",e[e.de=14]="de",e[e.el=15]="el",e[e["en-GB"]=16]="en-GB",e[e["en-US"]=17]="en-US",e[e["es-419"]=18]="es-419",e[e.es=19]="es",e[e.et=20]="et",e[e.eu=21]="eu",e[e.fa=22]="fa",e[e.fi=23]="fi",e[e.fil=24]="fil",e[e["fr-CA"]=25]="fr-CA",e[e.fr=26]="fr",e[e.gl=27]="gl",e[e.gu=28]="gu",e[e.he=29]="he",e[e.hi=30]="hi",e[e.hr=31]="hr",e[e.hu=32]="hu",e[e.hy=33]="hy",e[e.id=34]="id",e[e.is=35]="is",e[e.it=36]="it",e[e.ja=37]="ja",e[e.ka=38]="ka",e[e.kk=39]="kk",e[e.km=40]="km",e[e.kn=41]="kn",e[e.ko=42]="ko",e[e.ky=43]="ky",e[e.lo=44]="lo",e[e.lt=45]="lt",e[e.lv=46]="lv",e[e.mk=47]="mk",e[e.ml=48]="ml",e[e.mn=49]="mn",e[e.mr=50]="mr",e[e.ms=51]="ms",e[e.my=52]="my",e[e.ne=53]="ne",e[e.nl=54]="nl",e[e.no=55]="no",e[e.or=56]="or",e[e.pa=57]="pa",e[e.pl=58]="pl",e[e["pt-PT"]=59]="pt-PT",e[e.pt=60]="pt",e[e.ro=61]="ro",e[e.ru=62]="ru",e[e.si=63]="si",e[e.sk=64]="sk",e[e.sl=65]="sl",e[e.sq=66]="sq",e[e["sr-Latn"]=67]="sr-Latn",e[e.sr=68]="sr",e[e.sv=69]="sv",e[e.sw=70]="sw",e[e.ta=71]="ta",e[e.te=72]="te",e[e.th=73]="th",e[e.tr=74]="tr",e[e.uk=75]="uk",e[e.ur=76]="ur",e[e.uz=77]="uz",e[e.vi=78]="vi",e[e.zh=79]="zh",e[e["zh-HK"]=80]="zh-HK",e[e["zh-TW"]=81]="zh-TW",e[e.zu=82]="zu",e[e.MAX_VALUE=83]="MAX_VALUE"}(ce||(ce={})),function(e){e[e.OtherSection=0]="OtherSection",e[e.Identity=1]="Identity",e[e.Presentation=2]="Presentation",e[e["Protocol Handlers"]=3]="Protocol Handlers",e[e.Icons=4]="Icons",e[e["Window Controls Overlay"]=5]="Window Controls Overlay",e[e.MAX_VALUE=6]="MAX_VALUE"}(le||(le={}));var ge=Object.freeze({__proto__:null,get Action(){return J},get DevtoolsExperiments(){return se},get ElementsSidebarTabCodes(){return re},get IssueCreated(){return de},get IssueExpanded(){return ie},get IssueResourceOpened(){return ae},get KeybindSetSettings(){return ne},get KeyboardShortcutAction(){return oe},get Language(){return ce},get ManifestSectionCodes(){return le},get MediaTypes(){return te},get PanelCodes(){return Z},get PanelWithLocation(){return ee},UserMetrics:me});const pe=new me,he=K();export{U as AidaClient,F as InspectorFrontendHost,i as InspectorFrontendHostAPI,X as Platform,ue as RNPerfMetrics,v as ResourceLoader,ge as UserMetrics,he as rnPerfMetrics,pe as userMetrics}; diff --git a/packages/debugger-frontend/dist/third-party/front_end/core/sdk/sdk.js b/packages/debugger-frontend/dist/third-party/front_end/core/sdk/sdk.js index 3ffed164c35e..aab77f4b125a 100644 --- a/packages/debugger-frontend/dist/third-party/front_end/core/sdk/sdk.js +++ b/packages/debugger-frontend/dist/third-party/front_end/core/sdk/sdk.js @@ -1 +1 @@ -import*as e from"../common/common.js";import*as t from"../../models/text_utils/text_utils.js";import*as n from"../i18n/i18n.js";import*as r from"../platform/platform.js";import{assertNotNullOrUndefined as s,UserVisibleError as i}from"../platform/platform.js";import*as o from"../root/root.js";import*as a from"../host/host.js";import*as l from"../protocol_client/protocol_client.js";import*as d from"../../third_party/codemirror.next/codemirror.next.js";const c=new Map;class h extends e.ObjectWrapper.ObjectWrapper{#e;constructor(e){super(),this.#e=e}target(){return this.#e}async preSuspendModel(e){}async suspendModel(e){}async resumeModel(){}async postResumeModel(){}dispose(){}static register(e,t){if(t.early&&!t.autostart)throw new Error(`Error registering model ${e.name}: early models must be autostarted.`);c.set(e,t)}static get registeredModels(){return c}}var u=Object.freeze({__proto__:null,SDKModel:h});const g=[{inherited:!0,name:"-webkit-border-horizontal-spacing"},{name:"-webkit-border-image"},{inherited:!0,name:"-webkit-border-vertical-spacing"},{keywords:["stretch","start","center","end","baseline"],name:"-webkit-box-align"},{keywords:["slice","clone"],name:"-webkit-box-decoration-break"},{keywords:["normal","reverse"],name:"-webkit-box-direction"},{name:"-webkit-box-flex"},{name:"-webkit-box-ordinal-group"},{keywords:["horizontal","vertical"],name:"-webkit-box-orient"},{keywords:["start","center","end","justify"],name:"-webkit-box-pack"},{name:"-webkit-box-reflect"},{longhands:["break-after"],name:"-webkit-column-break-after"},{longhands:["break-before"],name:"-webkit-column-break-before"},{longhands:["break-inside"],name:"-webkit-column-break-inside"},{inherited:!0,name:"-webkit-font-smoothing"},{inherited:!0,keywords:["auto","loose","normal","strict","after-white-space","anywhere"],name:"-webkit-line-break"},{keywords:["none"],name:"-webkit-line-clamp"},{inherited:!0,name:"-webkit-locale"},{longhands:["-webkit-mask-box-image-source","-webkit-mask-box-image-slice","-webkit-mask-box-image-width","-webkit-mask-box-image-outset","-webkit-mask-box-image-repeat"],name:"-webkit-mask-box-image"},{name:"-webkit-mask-box-image-outset"},{name:"-webkit-mask-box-image-repeat"},{name:"-webkit-mask-box-image-slice"},{name:"-webkit-mask-box-image-source"},{name:"-webkit-mask-box-image-width"},{name:"-webkit-mask-position-x"},{name:"-webkit-mask-position-y"},{name:"-webkit-perspective-origin-x"},{name:"-webkit-perspective-origin-y"},{inherited:!0,keywords:["logical","visual"],name:"-webkit-rtl-ordering"},{inherited:!0,name:"-webkit-ruby-position"},{inherited:!0,name:"-webkit-tap-highlight-color"},{inherited:!0,name:"-webkit-text-combine"},{inherited:!0,name:"-webkit-text-decorations-in-effect"},{inherited:!0,name:"-webkit-text-fill-color"},{inherited:!0,name:"-webkit-text-orientation"},{inherited:!0,keywords:["none","disc","circle","square"],name:"-webkit-text-security"},{inherited:!0,longhands:["-webkit-text-stroke-width","-webkit-text-stroke-color"],name:"-webkit-text-stroke"},{inherited:!0,name:"-webkit-text-stroke-color"},{inherited:!0,name:"-webkit-text-stroke-width"},{name:"-webkit-transform-origin-x"},{name:"-webkit-transform-origin-y"},{name:"-webkit-transform-origin-z"},{keywords:["auto","none","element"],name:"-webkit-user-drag"},{inherited:!0,keywords:["read-only","read-write","read-write-plaintext-only"],name:"-webkit-user-modify"},{inherited:!0,name:"-webkit-writing-mode"},{inherited:!0,keywords:["auto","currentcolor"],name:"accent-color"},{name:"additive-symbols"},{name:"align-content"},{name:"align-items"},{name:"align-self"},{keywords:["auto","baseline","alphabetic","ideographic","middle","central","mathematical","before-edge","text-before-edge","after-edge","text-after-edge","hanging"],name:"alignment-baseline"},{longhands:["-webkit-border-horizontal-spacing","-webkit-border-vertical-spacing","-webkit-box-align","-webkit-box-decoration-break","-webkit-box-direction","-webkit-box-flex","-webkit-box-ordinal-group","-webkit-box-orient","-webkit-box-pack","-webkit-box-reflect","-webkit-font-smoothing","-webkit-line-break","-webkit-line-clamp","-webkit-locale","-webkit-mask-box-image-outset","-webkit-mask-box-image-repeat","-webkit-mask-box-image-slice","-webkit-mask-box-image-source","-webkit-mask-box-image-width","-webkit-mask-position-x","-webkit-mask-position-y","-webkit-rtl-ordering","-webkit-ruby-position","-webkit-tap-highlight-color","-webkit-text-combine","-webkit-text-decorations-in-effect","-webkit-text-fill-color","-webkit-text-orientation","-webkit-text-security","-webkit-text-stroke-color","-webkit-text-stroke-width","-webkit-user-drag","-webkit-writing-mode","accent-color","additive-symbols","align-content","align-items","align-self","alignment-baseline","anchor-name","anchor-scope","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","animation-trigger-exit-range-end","animation-trigger-exit-range-start","animation-trigger-range-end","animation-trigger-range-start","animation-trigger-timeline","animation-trigger-type","app-region","appearance","ascent-override","aspect-ratio","backdrop-filter","backface-visibility","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position-x","background-position-y","background-repeat","background-size","base-palette","baseline-shift","baseline-source","block-size","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start-color","border-block-start-style","border-block-start-width","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-end-end-radius","border-end-start-radius","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-left-color","border-left-style","border-left-width","border-right-color","border-right-style","border-right-width","border-start-end-radius","border-start-start-radius","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","buffered-rendering","caption-side","caret-animation","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-rendering","color-scheme","column-count","column-fill","column-gap","column-height","column-rule-break","column-rule-color","column-rule-outset","column-rule-style","column-rule-width","column-span","column-width","column-wrap","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-width","container-name","container-type","content","content-visibility","corner-bottom-left-shape","corner-bottom-right-shape","corner-end-end-shape","corner-end-start-shape","corner-start-end-shape","corner-start-start-shape","corner-top-left-shape","corner-top-right-shape","counter-increment","counter-reset","counter-set","cursor","cx","cy","d","descent-override","display","dominant-baseline","dynamic-range-limit","empty-cells","fallback","field-sizing","fill","fill-opacity","fill-rule","filter","flex-basis","flex-direction","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","font-display","font-family","font-feature-settings","font-kerning","font-optical-sizing","font-palette","font-size","font-size-adjust","font-stretch","font-style","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap-rule-paint-order","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column-end","grid-column-start","grid-row-end","grid-row-start","grid-template-areas","grid-template-columns","grid-template-rows","height","hyphenate-character","hyphenate-limit-chars","hyphens","image-orientation","image-rendering","inherits","initial-letter","initial-value","inline-size","inset-block-end","inset-block-start","inset-inline-end","inset-inline-start","interactivity","interest-target-hide-delay","interest-target-show-delay","interpolate-size","isolation","justify-content","justify-items","justify-self","left","letter-spacing","lighting-color","line-break","line-clamp","line-gap-override","line-height","list-style-image","list-style-position","list-style-type","margin-block-end","margin-block-start","margin-bottom","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marker-end","marker-mid","marker-start","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-repeat","mask-size","mask-type","masonry-auto-tracks","masonry-direction","masonry-fill","masonry-slack","masonry-template-tracks","masonry-track-end","masonry-track-start","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","navigation","negative","object-fit","object-position","object-view-box","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","origin-trial-test-property","orphans","outline-color","outline-offset","outline-style","outline-width","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","override-colors","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","pad","padding-block-end","padding-block-start","padding-bottom","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-orientation","paint-order","perspective","perspective-origin","pointer-events","position","position-anchor","position-area","position-try-fallbacks","position-try-order","position-visibility","prefix","print-color-adjust","quotes","r","range","reading-flow","reading-order","resize","result","right","rotate","row-gap","row-rule-break","row-rule-color","row-rule-outset","row-rule-style","row-rule-width","ruby-align","ruby-position","rx","ry","scale","scroll-behavior","scroll-initial-target","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-marker-contain","scroll-marker-group","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-start-block","scroll-start-inline","scroll-start-x","scroll-start-y","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","size","size-adjust","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","suffix","symbols","syntax","system","tab-size","table-layout","text-align","text-align-last","text-anchor","text-autospace","text-box-edge","text-box-trim","text-combine-upright","text-decoration-color","text-decoration-line","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-spacing-trim","text-transform","text-underline-offset","text-underline-position","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","types","unicode-range","user-select","vector-effect","vertical-align","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-class","view-transition-group","view-transition-name","visibility","white-space-collapse","widows","width","will-change","word-break","word-spacing","writing-mode","x","y","z-index","zoom"],name:"all"},{keywords:["none"],name:"anchor-name"},{keywords:["none","all"],name:"anchor-scope"},{longhands:["animation-duration","animation-timing-function","animation-delay","animation-iteration-count","animation-direction","animation-fill-mode","animation-play-state","animation-name","animation-timeline","animation-range-start","animation-range-end"],name:"animation"},{keywords:["replace","add","accumulate"],name:"animation-composition"},{name:"animation-delay"},{keywords:["normal","reverse","alternate","alternate-reverse"],name:"animation-direction"},{name:"animation-duration"},{keywords:["none","forwards","backwards","both"],name:"animation-fill-mode"},{keywords:["infinite"],name:"animation-iteration-count"},{keywords:["none"],name:"animation-name"},{keywords:["running","paused"],name:"animation-play-state"},{longhands:["animation-range-start","animation-range-end"],name:"animation-range"},{name:"animation-range-end"},{name:"animation-range-start"},{keywords:["none","auto"],name:"animation-timeline"},{keywords:["linear","ease","ease-in","ease-out","ease-in-out","jump-both","jump-end","jump-none","jump-start","step-start","step-end"],name:"animation-timing-function"},{longhands:["animation-trigger-timeline","animation-trigger-type","animation-trigger-range-start","animation-trigger-range-end","animation-trigger-exit-range-start","animation-trigger-exit-range-end"],name:"animation-trigger"},{longhands:["animation-trigger-exit-range-start","animation-trigger-exit-range-end"],name:"animation-trigger-exit-range"},{name:"animation-trigger-exit-range-end"},{name:"animation-trigger-exit-range-start"},{longhands:["animation-trigger-range-start","animation-trigger-range-end"],name:"animation-trigger-range"},{name:"animation-trigger-range-end"},{name:"animation-trigger-range-start"},{keywords:["none","auto"],name:"animation-trigger-timeline"},{keywords:["once","repeat","alternate","state"],name:"animation-trigger-type"},{keywords:["none","drag","no-drag"],name:"app-region"},{name:"appearance"},{name:"ascent-override"},{keywords:["auto"],name:"aspect-ratio"},{keywords:["none"],name:"backdrop-filter"},{keywords:["visible","hidden"],name:"backface-visibility"},{longhands:["background-image","background-position-x","background-position-y","background-size","background-repeat","background-attachment","background-origin","background-clip","background-color"],name:"background"},{keywords:["scroll","fixed","local"],name:"background-attachment"},{keywords:["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],name:"background-blend-mode"},{keywords:["border-box","padding-box","content-box","text"],name:"background-clip"},{keywords:["currentcolor"],name:"background-color"},{keywords:["auto","none"],name:"background-image"},{keywords:["border-box","padding-box","content-box"],name:"background-origin"},{longhands:["background-position-x","background-position-y"],name:"background-position"},{name:"background-position-x"},{name:"background-position-y"},{name:"background-repeat"},{keywords:["auto","cover","contain"],name:"background-size"},{name:"base-palette"},{keywords:["baseline","sub","super"],name:"baseline-shift"},{keywords:["auto","first","last"],name:"baseline-source"},{keywords:["auto"],name:"block-size"},{longhands:["border-top-color","border-top-style","border-top-width","border-right-color","border-right-style","border-right-width","border-bottom-color","border-bottom-style","border-bottom-width","border-left-color","border-left-style","border-left-width","border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat"],name:"border"},{longhands:["border-block-start-color","border-block-start-style","border-block-start-width","border-block-end-color","border-block-end-style","border-block-end-width"],name:"border-block"},{longhands:["border-block-start-color","border-block-end-color"],name:"border-block-color"},{longhands:["border-block-end-width","border-block-end-style","border-block-end-color"],name:"border-block-end"},{name:"border-block-end-color"},{name:"border-block-end-style"},{name:"border-block-end-width"},{longhands:["border-block-start-width","border-block-start-style","border-block-start-color"],name:"border-block-start"},{name:"border-block-start-color"},{name:"border-block-start-style"},{name:"border-block-start-width"},{longhands:["border-block-start-style","border-block-end-style"],name:"border-block-style"},{longhands:["border-block-start-width","border-block-end-width"],name:"border-block-width"},{longhands:["border-bottom-width","border-bottom-style","border-bottom-color"],name:"border-bottom"},{keywords:["currentcolor"],name:"border-bottom-color"},{name:"border-bottom-left-radius"},{name:"border-bottom-right-radius"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"border-bottom-style"},{keywords:["thin","medium","thick"],name:"border-bottom-width"},{inherited:!0,keywords:["separate","collapse"],name:"border-collapse"},{longhands:["border-top-color","border-right-color","border-bottom-color","border-left-color"],name:"border-color"},{name:"border-end-end-radius"},{name:"border-end-start-radius"},{longhands:["border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat"],name:"border-image"},{name:"border-image-outset"},{keywords:["stretch","repeat","round","space"],name:"border-image-repeat"},{name:"border-image-slice"},{keywords:["none"],name:"border-image-source"},{keywords:["auto"],name:"border-image-width"},{longhands:["border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-end-color","border-inline-end-style","border-inline-end-width"],name:"border-inline"},{longhands:["border-inline-start-color","border-inline-end-color"],name:"border-inline-color"},{longhands:["border-inline-end-width","border-inline-end-style","border-inline-end-color"],name:"border-inline-end"},{name:"border-inline-end-color"},{name:"border-inline-end-style"},{name:"border-inline-end-width"},{longhands:["border-inline-start-width","border-inline-start-style","border-inline-start-color"],name:"border-inline-start"},{name:"border-inline-start-color"},{name:"border-inline-start-style"},{name:"border-inline-start-width"},{longhands:["border-inline-start-style","border-inline-end-style"],name:"border-inline-style"},{longhands:["border-inline-start-width","border-inline-end-width"],name:"border-inline-width"},{longhands:["border-left-width","border-left-style","border-left-color"],name:"border-left"},{keywords:["currentcolor"],name:"border-left-color"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"border-left-style"},{keywords:["thin","medium","thick"],name:"border-left-width"},{longhands:["border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius"],name:"border-radius"},{longhands:["border-right-width","border-right-style","border-right-color"],name:"border-right"},{keywords:["currentcolor"],name:"border-right-color"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"border-right-style"},{keywords:["thin","medium","thick"],name:"border-right-width"},{inherited:!0,longhands:["-webkit-border-horizontal-spacing","-webkit-border-vertical-spacing"],name:"border-spacing"},{name:"border-start-end-radius"},{name:"border-start-start-radius"},{keywords:["none"],longhands:["border-top-style","border-right-style","border-bottom-style","border-left-style"],name:"border-style"},{longhands:["border-top-width","border-top-style","border-top-color"],name:"border-top"},{keywords:["currentcolor"],name:"border-top-color"},{name:"border-top-left-radius"},{name:"border-top-right-radius"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"border-top-style"},{keywords:["thin","medium","thick"],name:"border-top-width"},{longhands:["border-top-width","border-right-width","border-bottom-width","border-left-width"],name:"border-width"},{keywords:["auto"],name:"bottom"},{keywords:["slice","clone"],name:"box-decoration-break"},{keywords:["none"],name:"box-shadow"},{keywords:["content-box","border-box"],name:"box-sizing"},{keywords:["auto","avoid","avoid-column","avoid-page","column","left","page","recto","right","verso"],name:"break-after"},{keywords:["auto","avoid","avoid-column","avoid-page","column","left","page","recto","right","verso"],name:"break-before"},{keywords:["auto","avoid","avoid-column","avoid-page"],name:"break-inside"},{keywords:["auto","dynamic","static"],name:"buffered-rendering"},{inherited:!0,keywords:["top","bottom"],name:"caption-side"},{inherited:!0,keywords:["auto","manual"],name:"caret-animation"},{inherited:!0,keywords:["auto","currentcolor"],name:"caret-color"},{keywords:["none","left","right","both","inline-start","inline-end"],name:"clear"},{keywords:["auto"],name:"clip"},{keywords:["border-box","padding-box","content-box","margin-box","fill-box","stroke-box","view-box","none"],name:"clip-path"},{inherited:!0,keywords:["nonzero","evenodd"],name:"clip-rule"},{inherited:!0,keywords:["currentcolor"],name:"color"},{inherited:!0,keywords:["auto","srgb","linearrgb"],name:"color-interpolation"},{inherited:!0,keywords:["auto","srgb","linearrgb"],name:"color-interpolation-filters"},{inherited:!0,keywords:["auto","optimizespeed","optimizequality"],name:"color-rendering"},{inherited:!0,name:"color-scheme"},{keywords:["auto"],name:"column-count"},{keywords:["balance","auto"],name:"column-fill"},{keywords:["normal"],name:"column-gap"},{keywords:["auto"],name:"column-height"},{longhands:["column-rule-width","column-rule-style","column-rule-color"],name:"column-rule"},{inherited:!1,keywords:["none","spanning-item","intersection"],name:"column-rule-break"},{keywords:["currentcolor"],name:"column-rule-color"},{inherited:!1,name:"column-rule-outset"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"column-rule-style"},{keywords:["thin","medium","thick"],name:"column-rule-width"},{keywords:["none","all"],name:"column-span"},{keywords:["auto"],name:"column-width"},{keywords:["nowrap","wrap"],name:"column-wrap"},{longhands:["column-width","column-count"],name:"columns"},{keywords:["none","strict","content","size","layout","style","paint","inline-size","block-size"],name:"contain"},{name:"contain-intrinsic-block-size"},{keywords:["none"],name:"contain-intrinsic-height"},{name:"contain-intrinsic-inline-size"},{longhands:["contain-intrinsic-width","contain-intrinsic-height"],name:"contain-intrinsic-size"},{keywords:["none"],name:"contain-intrinsic-width"},{longhands:["container-name","container-type"],name:"container"},{keywords:["none"],name:"container-name"},{keywords:["normal","inline-size","size","scroll-state"],name:"container-type"},{name:"content"},{keywords:["visible","auto","hidden"],name:"content-visibility"},{name:"corner-bottom-left-shape"},{name:"corner-bottom-right-shape"},{name:"corner-end-end-shape"},{name:"corner-end-start-shape"},{longhands:["corner-top-left-shape","corner-top-right-shape","corner-bottom-right-shape","corner-bottom-left-shape"],name:"corner-shape"},{name:"corner-start-end-shape"},{name:"corner-start-start-shape"},{name:"corner-top-left-shape"},{name:"corner-top-right-shape"},{keywords:["none"],name:"counter-increment"},{keywords:["none"],name:"counter-reset"},{keywords:["none"],name:"counter-set"},{inherited:!0,keywords:["auto","default","none","context-menu","help","pointer","progress","wait","cell","crosshair","text","vertical-text","alias","copy","move","no-drop","not-allowed","e-resize","n-resize","ne-resize","nw-resize","s-resize","se-resize","sw-resize","w-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","col-resize","row-resize","all-scroll","zoom-in","zoom-out","grab","grabbing"],name:"cursor"},{name:"cx"},{name:"cy"},{keywords:["none"],name:"d"},{name:"descent-override"},{inherited:!0,keywords:["ltr","rtl"],name:"direction"},{keywords:["inline","block","list-item","inline-block","table","inline-table","table-row-group","table-header-group","table-footer-group","table-row","table-column-group","table-column","table-cell","table-caption","-webkit-box","-webkit-inline-box","flex","inline-flex","grid","inline-grid","contents","flow-root","none","flow","math","ruby","ruby-text","masonry","inline-masonry"],name:"display"},{inherited:!0,keywords:["auto","alphabetic","ideographic","middle","central","mathematical","hanging","use-script","no-change","reset-size","text-after-edge","text-before-edge"],name:"dominant-baseline"},{inherited:!0,keywords:["standard","no-limit","constrained"],name:"dynamic-range-limit"},{inherited:!0,keywords:["show","hide"],name:"empty-cells"},{name:"fallback"},{keywords:["fixed","content"],name:"field-sizing"},{inherited:!0,name:"fill"},{inherited:!0,name:"fill-opacity"},{inherited:!0,keywords:["nonzero","evenodd"],name:"fill-rule"},{keywords:["none"],name:"filter"},{longhands:["flex-grow","flex-shrink","flex-basis"],name:"flex"},{keywords:["auto","fit-content","min-content","max-content","content"],name:"flex-basis"},{keywords:["row","row-reverse","column","column-reverse"],name:"flex-direction"},{longhands:["flex-direction","flex-wrap"],name:"flex-flow"},{name:"flex-grow"},{name:"flex-shrink"},{keywords:["nowrap","wrap","wrap-reverse"],name:"flex-wrap"},{keywords:["none","left","right","inline-start","inline-end"],name:"float"},{keywords:["currentcolor"],name:"flood-color"},{name:"flood-opacity"},{inherited:!0,longhands:["font-style","font-variant-ligatures","font-variant-caps","font-variant-numeric","font-variant-east-asian","font-variant-alternates","font-variant-position","font-variant-emoji","font-weight","font-stretch","font-size","line-height","font-family","font-optical-sizing","font-size-adjust","font-kerning","font-feature-settings","font-variation-settings"],name:"font"},{name:"font-display"},{inherited:!0,name:"font-family"},{inherited:!0,keywords:["normal"],name:"font-feature-settings"},{inherited:!0,keywords:["auto","normal","none"],name:"font-kerning"},{inherited:!0,keywords:["auto","none"],name:"font-optical-sizing"},{inherited:!0,keywords:["normal","light","dark"],name:"font-palette"},{inherited:!0,keywords:["xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","larger","smaller","-webkit-xxx-large"],name:"font-size"},{inherited:!0,keywords:["none","ex-height","cap-height","ch-width","ic-width","ic-height","from-font"],name:"font-size-adjust"},{inherited:!0,keywords:["normal","ultra-condensed","extra-condensed","condensed","semi-condensed","semi-expanded","expanded","extra-expanded","ultra-expanded"],name:"font-stretch"},{inherited:!0,keywords:["normal","italic","oblique"],name:"font-style"},{inherited:!0,longhands:["font-synthesis-weight","font-synthesis-style","font-synthesis-small-caps"],name:"font-synthesis"},{inherited:!0,keywords:["auto","none"],name:"font-synthesis-small-caps"},{inherited:!0,keywords:["auto","none"],name:"font-synthesis-style"},{inherited:!0,keywords:["auto","none"],name:"font-synthesis-weight"},{inherited:!0,longhands:["font-variant-ligatures","font-variant-caps","font-variant-alternates","font-variant-numeric","font-variant-east-asian","font-variant-position","font-variant-emoji"],name:"font-variant"},{inherited:!0,keywords:["normal"],name:"font-variant-alternates"},{inherited:!0,keywords:["normal","small-caps","all-small-caps","petite-caps","all-petite-caps","unicase","titling-caps"],name:"font-variant-caps"},{inherited:!0,keywords:["normal","jis78","jis83","jis90","jis04","simplified","traditional","full-width","proportional-width","ruby"],name:"font-variant-east-asian"},{inherited:!0,keywords:["normal","text","emoji","unicode"],name:"font-variant-emoji"},{inherited:!0,keywords:["normal","none","common-ligatures","no-common-ligatures","discretionary-ligatures","no-discretionary-ligatures","historical-ligatures","no-historical-ligatures","contextual","no-contextual"],name:"font-variant-ligatures"},{inherited:!0,keywords:["normal","lining-nums","oldstyle-nums","proportional-nums","tabular-nums","diagonal-fractions","stacked-fractions","ordinal","slashed-zero"],name:"font-variant-numeric"},{inherited:!0,keywords:["normal","sub","super"],name:"font-variant-position"},{inherited:!0,keywords:["normal"],name:"font-variation-settings"},{inherited:!0,keywords:["normal","bold","bolder","lighter"],name:"font-weight"},{inherited:!0,keywords:["auto","none","preserve-parent-color"],name:"forced-color-adjust"},{longhands:["row-gap","column-gap"],name:"gap"},{inherited:!1,keywords:["row-over-column","column-over-row"],name:"gap-rule-paint-order"},{longhands:["grid-template-rows","grid-template-columns","grid-template-areas","grid-auto-flow","grid-auto-rows","grid-auto-columns"],name:"grid"},{longhands:["grid-row-start","grid-column-start","grid-row-end","grid-column-end"],name:"grid-area"},{keywords:["auto","min-content","max-content"],name:"grid-auto-columns"},{keywords:["row","column"],name:"grid-auto-flow"},{keywords:["auto","min-content","max-content"],name:"grid-auto-rows"},{longhands:["grid-column-start","grid-column-end"],name:"grid-column"},{keywords:["auto"],name:"grid-column-end"},{keywords:["auto"],name:"grid-column-start"},{longhands:["grid-row-start","grid-row-end"],name:"grid-row"},{keywords:["auto"],name:"grid-row-end"},{keywords:["auto"],name:"grid-row-start"},{longhands:["grid-template-rows","grid-template-columns","grid-template-areas"],name:"grid-template"},{keywords:["none"],name:"grid-template-areas"},{keywords:["none"],name:"grid-template-columns"},{keywords:["none"],name:"grid-template-rows"},{keywords:["auto","fit-content","min-content","max-content"],name:"height"},{inherited:!0,name:"hyphenate-character"},{inherited:!0,keywords:["auto"],name:"hyphenate-limit-chars"},{inherited:!0,keywords:["none","manual","auto"],name:"hyphens"},{inherited:!0,name:"image-orientation"},{inherited:!0,keywords:["auto","optimizespeed","optimizequality","-webkit-optimize-contrast","pixelated"],name:"image-rendering"},{name:"inherits"},{inherited:!1,keywords:["drop","normal","raise"],name:"initial-letter"},{name:"initial-value"},{keywords:["auto"],name:"inline-size"},{longhands:["top","right","bottom","left"],name:"inset"},{longhands:["inset-block-start","inset-block-end"],name:"inset-block"},{name:"inset-block-end"},{name:"inset-block-start"},{longhands:["inset-inline-start","inset-inline-end"],name:"inset-inline"},{name:"inset-inline-end"},{name:"inset-inline-start"},{inherited:!0,keywords:["auto","inert"],name:"interactivity"},{longhands:["interest-target-show-delay","interest-target-hide-delay"],name:"interest-target-delay"},{name:"interest-target-hide-delay"},{name:"interest-target-show-delay"},{inherited:!0,keywords:["numeric-only","allow-keywords"],name:"interpolate-size"},{keywords:["auto","isolate"],name:"isolation"},{name:"justify-content"},{name:"justify-items"},{name:"justify-self"},{keywords:["auto"],name:"left"},{inherited:!0,keywords:["normal"],name:"letter-spacing"},{keywords:["currentcolor"],name:"lighting-color"},{inherited:!0,keywords:["auto","loose","normal","strict","anywhere"],name:"line-break"},{keywords:["none","auto"],name:"line-clamp"},{name:"line-gap-override"},{inherited:!0,keywords:["normal"],name:"line-height"},{inherited:!0,longhands:["list-style-position","list-style-image","list-style-type"],name:"list-style"},{inherited:!0,keywords:["none"],name:"list-style-image"},{inherited:!0,keywords:["outside","inside"],name:"list-style-position"},{inherited:!0,keywords:["disc","circle","square","disclosure-open","disclosure-closed","decimal","none"],name:"list-style-type"},{longhands:["margin-top","margin-right","margin-bottom","margin-left"],name:"margin"},{longhands:["margin-block-start","margin-block-end"],name:"margin-block"},{keywords:["auto"],name:"margin-block-end"},{keywords:["auto"],name:"margin-block-start"},{keywords:["auto"],name:"margin-bottom"},{longhands:["margin-inline-start","margin-inline-end"],name:"margin-inline"},{keywords:["auto"],name:"margin-inline-end"},{keywords:["auto"],name:"margin-inline-start"},{keywords:["auto"],name:"margin-left"},{keywords:["auto"],name:"margin-right"},{keywords:["auto"],name:"margin-top"},{inherited:!0,longhands:["marker-start","marker-mid","marker-end"],name:"marker"},{inherited:!0,keywords:["none"],name:"marker-end"},{inherited:!0,keywords:["none"],name:"marker-mid"},{inherited:!0,keywords:["none"],name:"marker-start"},{longhands:["mask-image","-webkit-mask-position-x","-webkit-mask-position-y","mask-size","mask-repeat","mask-origin","mask-clip","mask-composite","mask-mode"],name:"mask"},{name:"mask-clip"},{name:"mask-composite"},{name:"mask-image"},{name:"mask-mode"},{name:"mask-origin"},{longhands:["-webkit-mask-position-x","-webkit-mask-position-y"],name:"mask-position"},{name:"mask-repeat"},{name:"mask-size"},{keywords:["luminance","alpha"],name:"mask-type"},{keywords:["auto","min-content","max-content"],name:"masonry-auto-tracks"},{keywords:["row","row-reverse","column","column-reverse"],name:"masonry-direction"},{keywords:["normal","reverse"],name:"masonry-fill"},{longhands:["masonry-direction","masonry-fill"],name:"masonry-flow"},{keywords:["normal"],name:"masonry-slack"},{name:"masonry-template-tracks"},{longhands:["masonry-track-start","masonry-track-end"],name:"masonry-track"},{keywords:["auto"],name:"masonry-track-end"},{keywords:["auto"],name:"masonry-track-start"},{inherited:!0,name:"math-depth"},{inherited:!0,keywords:["normal","compact"],name:"math-shift"},{inherited:!0,keywords:["normal","compact"],name:"math-style"},{keywords:["none"],name:"max-block-size"},{keywords:["none"],name:"max-height"},{keywords:["none"],name:"max-inline-size"},{keywords:["none"],name:"max-width"},{name:"min-block-size"},{name:"min-height"},{name:"min-inline-size"},{name:"min-width"},{keywords:["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],name:"mix-blend-mode"},{name:"navigation"},{name:"negative"},{keywords:["fill","contain","cover","none","scale-down"],name:"object-fit"},{name:"object-position"},{keywords:["none"],name:"object-view-box"},{longhands:["offset-position","offset-path","offset-distance","offset-rotate","offset-anchor"],name:"offset"},{keywords:["auto"],name:"offset-anchor"},{name:"offset-distance"},{keywords:["none"],name:"offset-path"},{keywords:["auto","normal"],name:"offset-position"},{keywords:["auto","reverse"],name:"offset-rotate"},{name:"opacity"},{name:"order"},{keywords:["normal","none"],name:"origin-trial-test-property"},{inherited:!0,name:"orphans"},{longhands:["outline-color","outline-style","outline-width"],name:"outline"},{keywords:["currentcolor"],name:"outline-color"},{name:"outline-offset"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"outline-style"},{keywords:["thin","medium","thick"],name:"outline-width"},{longhands:["overflow-x","overflow-y"],name:"overflow"},{inherited:!1,keywords:["visible","none","auto"],name:"overflow-anchor"},{name:"overflow-block"},{keywords:["border-box","content-box","padding-box"],name:"overflow-clip-margin"},{name:"overflow-inline"},{inherited:!0,keywords:["normal","break-word","anywhere"],name:"overflow-wrap"},{keywords:["visible","hidden","scroll","auto","overlay","clip"],name:"overflow-x"},{keywords:["visible","hidden","scroll","auto","overlay","clip"],name:"overflow-y"},{keywords:["none","auto"],name:"overlay"},{name:"override-colors"},{longhands:["overscroll-behavior-x","overscroll-behavior-y"],name:"overscroll-behavior"},{name:"overscroll-behavior-block"},{name:"overscroll-behavior-inline"},{keywords:["auto","contain","none"],name:"overscroll-behavior-x"},{keywords:["auto","contain","none"],name:"overscroll-behavior-y"},{name:"pad"},{longhands:["padding-top","padding-right","padding-bottom","padding-left"],name:"padding"},{longhands:["padding-block-start","padding-block-end"],name:"padding-block"},{name:"padding-block-end"},{name:"padding-block-start"},{name:"padding-bottom"},{longhands:["padding-inline-start","padding-inline-end"],name:"padding-inline"},{name:"padding-inline-end"},{name:"padding-inline-start"},{name:"padding-left"},{name:"padding-right"},{name:"padding-top"},{keywords:["auto"],name:"page"},{longhands:["break-after"],name:"page-break-after"},{longhands:["break-before"],name:"page-break-before"},{longhands:["break-inside"],name:"page-break-inside"},{name:"page-orientation"},{inherited:!0,keywords:["normal","fill","stroke","markers"],name:"paint-order"},{keywords:["none"],name:"perspective"},{name:"perspective-origin"},{longhands:["align-content","justify-content"],name:"place-content"},{longhands:["align-items","justify-items"],name:"place-items"},{longhands:["align-self","justify-self"],name:"place-self"},{inherited:!0,keywords:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","bounding-box","all"],name:"pointer-events"},{keywords:["static","relative","absolute","fixed","sticky"],name:"position"},{keywords:["auto"],name:"position-anchor"},{keywords:["none","top","bottom","center","left","right","x-start","x-end","y-start","y-end","start","end","self-start","self-end","all"],name:"position-area"},{longhands:["position-try-order","position-try-fallbacks"],name:"position-try"},{keywords:["none","flip-block","flip-inline","flip-start"],name:"position-try-fallbacks"},{keywords:["normal","most-width","most-height","most-block-size","most-inline-size"],name:"position-try-order"},{keywords:["always","anchors-visible","no-overflow"],name:"position-visibility"},{name:"prefix"},{inherited:!0,keywords:["economy","exact"],name:"print-color-adjust"},{inherited:!0,keywords:["auto","none"],name:"quotes"},{name:"r"},{name:"range"},{keywords:["normal","flex-visual","flex-flow","grid-rows","grid-columns","grid-order","source-order"],name:"reading-flow"},{name:"reading-order"},{keywords:["none","both","horizontal","vertical","block","inline"],name:"resize"},{name:"result"},{keywords:["auto"],name:"right"},{name:"rotate"},{keywords:["normal"],name:"row-gap"},{inherited:!1,keywords:["none","spanning-item","intersection"],name:"row-rule-break"},{keywords:["currentcolor"],name:"row-rule-color"},{inherited:!1,name:"row-rule-outset"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"row-rule-style"},{keywords:["thin","medium","thick"],name:"row-rule-width"},{inherited:!0,keywords:["space-around","start","center","space-between"],name:"ruby-align"},{inherited:!0,keywords:["over","under"],name:"ruby-position"},{keywords:["auto"],name:"rx"},{keywords:["auto"],name:"ry"},{name:"scale"},{keywords:["auto","smooth"],name:"scroll-behavior"},{keywords:["none","nearest"],name:"scroll-initial-target"},{longhands:["scroll-margin-top","scroll-margin-right","scroll-margin-bottom","scroll-margin-left"],name:"scroll-margin"},{longhands:["scroll-margin-block-start","scroll-margin-block-end"],name:"scroll-margin-block"},{name:"scroll-margin-block-end"},{name:"scroll-margin-block-start"},{name:"scroll-margin-bottom"},{longhands:["scroll-margin-inline-start","scroll-margin-inline-end"],name:"scroll-margin-inline"},{name:"scroll-margin-inline-end"},{name:"scroll-margin-inline-start"},{name:"scroll-margin-left"},{name:"scroll-margin-right"},{name:"scroll-margin-top"},{keywords:["none","auto"],name:"scroll-marker-contain"},{keywords:["none","after","before"],name:"scroll-marker-group"},{longhands:["scroll-padding-top","scroll-padding-right","scroll-padding-bottom","scroll-padding-left"],name:"scroll-padding"},{longhands:["scroll-padding-block-start","scroll-padding-block-end"],name:"scroll-padding-block"},{keywords:["auto"],name:"scroll-padding-block-end"},{keywords:["auto"],name:"scroll-padding-block-start"},{keywords:["auto"],name:"scroll-padding-bottom"},{longhands:["scroll-padding-inline-start","scroll-padding-inline-end"],name:"scroll-padding-inline"},{keywords:["auto"],name:"scroll-padding-inline-end"},{keywords:["auto"],name:"scroll-padding-inline-start"},{keywords:["auto"],name:"scroll-padding-left"},{keywords:["auto"],name:"scroll-padding-right"},{keywords:["auto"],name:"scroll-padding-top"},{keywords:["none","start","end","center"],name:"scroll-snap-align"},{keywords:["normal","always"],name:"scroll-snap-stop"},{keywords:["none","x","y","block","inline","both","mandatory","proximity"],name:"scroll-snap-type"},{longhands:["scroll-start-block","scroll-start-inline"],name:"scroll-start"},{name:"scroll-start-block"},{name:"scroll-start-inline"},{name:"scroll-start-x"},{name:"scroll-start-y"},{longhands:["scroll-timeline-name","scroll-timeline-axis"],name:"scroll-timeline"},{name:"scroll-timeline-axis"},{name:"scroll-timeline-name"},{inherited:!0,keywords:["auto"],name:"scrollbar-color"},{inherited:!1,keywords:["auto","stable","both-edges"],name:"scrollbar-gutter"},{inherited:!1,keywords:["auto","thin","none"],name:"scrollbar-width"},{name:"shape-image-threshold"},{keywords:["none"],name:"shape-margin"},{keywords:["none"],name:"shape-outside"},{inherited:!0,keywords:["auto","optimizespeed","crispedges","geometricprecision"],name:"shape-rendering"},{name:"size"},{name:"size-adjust"},{inherited:!0,keywords:["none","normal","spell-out","digits","literal-punctuation","no-punctuation"],name:"speak"},{name:"speak-as"},{name:"src"},{keywords:["currentcolor"],name:"stop-color"},{name:"stop-opacity"},{inherited:!0,name:"stroke"},{inherited:!0,keywords:["none"],name:"stroke-dasharray"},{inherited:!0,name:"stroke-dashoffset"},{inherited:!0,keywords:["butt","round","square"],name:"stroke-linecap"},{inherited:!0,keywords:["miter","bevel","round"],name:"stroke-linejoin"},{inherited:!0,name:"stroke-miterlimit"},{inherited:!0,name:"stroke-opacity"},{inherited:!0,name:"stroke-width"},{name:"suffix"},{name:"symbols"},{name:"syntax"},{name:"system"},{inherited:!0,name:"tab-size"},{keywords:["auto","fixed"],name:"table-layout"},{inherited:!0,keywords:["left","right","center","justify","-webkit-left","-webkit-right","-webkit-center","start","end"],name:"text-align"},{inherited:!0,keywords:["auto","start","end","left","right","center","justify"],name:"text-align-last"},{inherited:!0,keywords:["start","middle","end"],name:"text-anchor"},{inherited:!0,keywords:["normal","no-autospace"],name:"text-autospace"},{longhands:["text-box-trim","text-box-edge"],name:"text-box"},{inherited:!0,name:"text-box-edge"},{keywords:["none","trim-start","trim-end","trim-both"],name:"text-box-trim"},{inherited:!0,keywords:["none","all"],name:"text-combine-upright"},{longhands:["text-decoration-line","text-decoration-thickness","text-decoration-style","text-decoration-color"],name:"text-decoration"},{keywords:["currentcolor"],name:"text-decoration-color"},{keywords:["none","underline","overline","line-through","blink","spelling-error","grammar-error"],name:"text-decoration-line"},{inherited:!0,keywords:["none","auto"],name:"text-decoration-skip-ink"},{keywords:["solid","double","dotted","dashed","wavy"],name:"text-decoration-style"},{inherited:!1,keywords:["auto","from-font"],name:"text-decoration-thickness"},{inherited:!0,longhands:["text-emphasis-style","text-emphasis-color"],name:"text-emphasis"},{inherited:!0,keywords:["currentcolor"],name:"text-emphasis-color"},{inherited:!0,name:"text-emphasis-position"},{inherited:!0,name:"text-emphasis-style"},{inherited:!0,name:"text-indent"},{inherited:!0,keywords:["sideways","mixed","upright"],name:"text-orientation"},{keywords:["clip","ellipsis"],name:"text-overflow"},{inherited:!0,keywords:["auto","optimizespeed","optimizelegibility","geometricprecision"],name:"text-rendering"},{inherited:!0,keywords:["none"],name:"text-shadow"},{inherited:!0,keywords:["none","auto"],name:"text-size-adjust"},{inherited:!0,longhands:["text-autospace","text-spacing-trim"],name:"text-spacing"},{inherited:!0,keywords:["normal","space-all","space-first","trim-start"],name:"text-spacing-trim"},{inherited:!0,keywords:["capitalize","uppercase","lowercase","none","math-auto"],name:"text-transform"},{inherited:!0,keywords:["auto"],name:"text-underline-offset"},{inherited:!0,keywords:["auto","from-font","under","left","right"],name:"text-underline-position"},{inherited:!0,longhands:["text-wrap-mode","text-wrap-style"],name:"text-wrap"},{inherited:!0,keywords:["wrap","nowrap"],name:"text-wrap-mode"},{inherited:!0,keywords:["auto","balance","pretty","stable"],name:"text-wrap-style"},{name:"timeline-scope"},{keywords:["auto"],name:"top"},{keywords:["auto","none","pan-x","pan-left","pan-right","pan-y","pan-up","pan-down","pinch-zoom","manipulation"],name:"touch-action"},{keywords:["none"],name:"transform"},{keywords:["content-box","border-box","fill-box","stroke-box","view-box"],name:"transform-box"},{name:"transform-origin"},{keywords:["flat","preserve-3d"],name:"transform-style"},{longhands:["transition-property","transition-duration","transition-timing-function","transition-delay","transition-behavior"],name:"transition"},{keywords:["normal","allow-discrete"],name:"transition-behavior"},{name:"transition-delay"},{name:"transition-duration"},{keywords:["none"],name:"transition-property"},{keywords:["linear","ease","ease-in","ease-out","ease-in-out","jump-both","jump-end","jump-none","jump-start","step-start","step-end"],name:"transition-timing-function"},{name:"translate"},{name:"types"},{keywords:["normal","embed","bidi-override","isolate","plaintext","isolate-override"],name:"unicode-bidi"},{name:"unicode-range"},{inherited:!0,keywords:["auto","none","text","all","contain"],name:"user-select"},{keywords:["none","non-scaling-stroke"],name:"vector-effect"},{keywords:["baseline","sub","super","text-top","text-bottom","middle"],name:"vertical-align"},{longhands:["view-timeline-name","view-timeline-axis","view-timeline-inset"],name:"view-timeline"},{name:"view-timeline-axis"},{name:"view-timeline-inset"},{name:"view-timeline-name"},{keywords:["none"],name:"view-transition-class"},{keywords:["normal","contain","nearest"],name:"view-transition-group"},{keywords:["none","auto"],name:"view-transition-name"},{inherited:!0,keywords:["visible","hidden","collapse"],name:"visibility"},{inherited:!0,longhands:["white-space-collapse","text-wrap-mode"],name:"white-space"},{inherited:!0,keywords:["collapse","preserve","preserve-breaks","break-spaces"],name:"white-space-collapse"},{inherited:!0,name:"widows"},{keywords:["auto","fit-content","min-content","max-content"],name:"width"},{keywords:["auto"],name:"will-change"},{inherited:!0,keywords:["normal","break-all","keep-all","break-word","auto-phrase"],name:"word-break"},{inherited:!0,keywords:["normal"],name:"word-spacing"},{inherited:!0,keywords:["horizontal-tb","vertical-rl","vertical-lr","sideways-rl","sideways-lr"],name:"writing-mode"},{name:"x"},{name:"y"},{keywords:["auto"],name:"z-index"},{name:"zoom"}],p={"-webkit-box-align":{values:["stretch","start","center","end","baseline"]},"-webkit-box-decoration-break":{values:["slice","clone"]},"-webkit-box-direction":{values:["normal","reverse"]},"-webkit-box-orient":{values:["horizontal","vertical"]},"-webkit-box-pack":{values:["start","center","end","justify"]},"-webkit-line-break":{values:["auto","loose","normal","strict","after-white-space","anywhere"]},"-webkit-line-clamp":{values:["none"]},"-webkit-rtl-ordering":{values:["logical","visual"]},"-webkit-text-security":{values:["none","disc","circle","square"]},"-webkit-user-drag":{values:["auto","none","element"]},"-webkit-user-modify":{values:["read-only","read-write","read-write-plaintext-only"]},"accent-color":{values:["auto","currentcolor"]},"alignment-baseline":{values:["auto","baseline","alphabetic","ideographic","middle","central","mathematical","before-edge","text-before-edge","after-edge","text-after-edge","hanging"]},"anchor-name":{values:["none"]},"anchor-scope":{values:["none","all"]},"animation-composition":{values:["replace","add","accumulate"]},"animation-direction":{values:["normal","reverse","alternate","alternate-reverse"]},"animation-fill-mode":{values:["none","forwards","backwards","both"]},"animation-iteration-count":{values:["infinite"]},"animation-name":{values:["none"]},"animation-play-state":{values:["running","paused"]},"animation-timeline":{values:["none","auto"]},"animation-timing-function":{values:["linear","ease","ease-in","ease-out","ease-in-out","jump-both","jump-end","jump-none","jump-start","step-start","step-end"]},"animation-trigger-timeline":{values:["none","auto"]},"animation-trigger-type":{values:["once","repeat","alternate","state"]},"app-region":{values:["none","drag","no-drag"]},"aspect-ratio":{values:["auto"]},"backdrop-filter":{values:["none"]},"backface-visibility":{values:["visible","hidden"]},"background-attachment":{values:["scroll","fixed","local"]},"background-blend-mode":{values:["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},"background-clip":{values:["border-box","padding-box","content-box","text"]},"background-color":{values:["currentcolor"]},"background-image":{values:["auto","none"]},"background-origin":{values:["border-box","padding-box","content-box"]},"background-size":{values:["auto","cover","contain"]},"baseline-shift":{values:["baseline","sub","super"]},"baseline-source":{values:["auto","first","last"]},"block-size":{values:["auto"]},"border-bottom-color":{values:["currentcolor"]},"border-bottom-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"border-bottom-width":{values:["thin","medium","thick"]},"border-collapse":{values:["separate","collapse"]},"border-image-repeat":{values:["stretch","repeat","round","space"]},"border-image-source":{values:["none"]},"border-image-width":{values:["auto"]},"border-left-color":{values:["currentcolor"]},"border-left-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"border-left-width":{values:["thin","medium","thick"]},"border-right-color":{values:["currentcolor"]},"border-right-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"border-right-width":{values:["thin","medium","thick"]},"border-style":{values:["none"]},"border-top-color":{values:["currentcolor"]},"border-top-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"border-top-width":{values:["thin","medium","thick"]},bottom:{values:["auto"]},"box-decoration-break":{values:["slice","clone"]},"box-shadow":{values:["none"]},"box-sizing":{values:["content-box","border-box"]},"break-after":{values:["auto","avoid","avoid-column","avoid-page","column","left","page","recto","right","verso"]},"break-before":{values:["auto","avoid","avoid-column","avoid-page","column","left","page","recto","right","verso"]},"break-inside":{values:["auto","avoid","avoid-column","avoid-page"]},"buffered-rendering":{values:["auto","dynamic","static"]},"caption-side":{values:["top","bottom"]},"caret-animation":{values:["auto","manual"]},"caret-color":{values:["auto","currentcolor"]},clear:{values:["none","left","right","both","inline-start","inline-end"]},clip:{values:["auto"]},"clip-path":{values:["border-box","padding-box","content-box","margin-box","fill-box","stroke-box","view-box","none"]},"clip-rule":{values:["nonzero","evenodd"]},color:{values:["currentcolor"]},"color-interpolation":{values:["auto","srgb","linearrgb"]},"color-interpolation-filters":{values:["auto","srgb","linearrgb"]},"color-rendering":{values:["auto","optimizespeed","optimizequality"]},"column-count":{values:["auto"]},"column-fill":{values:["balance","auto"]},"column-gap":{values:["normal"]},"column-height":{values:["auto"]},"column-rule-break":{values:["none","spanning-item","intersection"]},"column-rule-color":{values:["currentcolor"]},"column-rule-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"column-rule-width":{values:["thin","medium","thick"]},"column-span":{values:["none","all"]},"column-width":{values:["auto"]},"column-wrap":{values:["nowrap","wrap"]},contain:{values:["none","strict","content","size","layout","style","paint","inline-size","block-size"]},"contain-intrinsic-height":{values:["none"]},"contain-intrinsic-width":{values:["none"]},"container-name":{values:["none"]},"container-type":{values:["normal","inline-size","size","scroll-state"]},"content-visibility":{values:["visible","auto","hidden"]},"counter-increment":{values:["none"]},"counter-reset":{values:["none"]},"counter-set":{values:["none"]},cursor:{values:["auto","default","none","context-menu","help","pointer","progress","wait","cell","crosshair","text","vertical-text","alias","copy","move","no-drop","not-allowed","e-resize","n-resize","ne-resize","nw-resize","s-resize","se-resize","sw-resize","w-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","col-resize","row-resize","all-scroll","zoom-in","zoom-out","grab","grabbing"]},d:{values:["none"]},direction:{values:["ltr","rtl"]},display:{values:["inline","block","list-item","inline-block","table","inline-table","table-row-group","table-header-group","table-footer-group","table-row","table-column-group","table-column","table-cell","table-caption","-webkit-box","-webkit-inline-box","flex","inline-flex","grid","inline-grid","contents","flow-root","none","flow","math","ruby","ruby-text","masonry","inline-masonry"]},"dominant-baseline":{values:["auto","alphabetic","ideographic","middle","central","mathematical","hanging","use-script","no-change","reset-size","text-after-edge","text-before-edge"]},"dynamic-range-limit":{values:["standard","no-limit","constrained"]},"empty-cells":{values:["show","hide"]},"field-sizing":{values:["fixed","content"]},"fill-rule":{values:["nonzero","evenodd"]},filter:{values:["none"]},"flex-basis":{values:["auto","fit-content","min-content","max-content","content"]},"flex-direction":{values:["row","row-reverse","column","column-reverse"]},"flex-wrap":{values:["nowrap","wrap","wrap-reverse"]},float:{values:["none","left","right","inline-start","inline-end"]},"flood-color":{values:["currentcolor"]},"font-feature-settings":{values:["normal"]},"font-kerning":{values:["auto","normal","none"]},"font-optical-sizing":{values:["auto","none"]},"font-palette":{values:["normal","light","dark"]},"font-size":{values:["xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","larger","smaller","-webkit-xxx-large"]},"font-size-adjust":{values:["none","ex-height","cap-height","ch-width","ic-width","ic-height","from-font"]},"font-stretch":{values:["normal","ultra-condensed","extra-condensed","condensed","semi-condensed","semi-expanded","expanded","extra-expanded","ultra-expanded"]},"font-style":{values:["normal","italic","oblique"]},"font-synthesis-small-caps":{values:["auto","none"]},"font-synthesis-style":{values:["auto","none"]},"font-synthesis-weight":{values:["auto","none"]},"font-variant-alternates":{values:["normal"]},"font-variant-caps":{values:["normal","small-caps","all-small-caps","petite-caps","all-petite-caps","unicase","titling-caps"]},"font-variant-east-asian":{values:["normal","jis78","jis83","jis90","jis04","simplified","traditional","full-width","proportional-width","ruby"]},"font-variant-emoji":{values:["normal","text","emoji","unicode"]},"font-variant-ligatures":{values:["normal","none","common-ligatures","no-common-ligatures","discretionary-ligatures","no-discretionary-ligatures","historical-ligatures","no-historical-ligatures","contextual","no-contextual"]},"font-variant-numeric":{values:["normal","lining-nums","oldstyle-nums","proportional-nums","tabular-nums","diagonal-fractions","stacked-fractions","ordinal","slashed-zero"]},"font-variant-position":{values:["normal","sub","super"]},"font-variation-settings":{values:["normal"]},"font-weight":{values:["normal","bold","bolder","lighter"]},"forced-color-adjust":{values:["auto","none","preserve-parent-color"]},"gap-rule-paint-order":{values:["row-over-column","column-over-row"]},"grid-auto-columns":{values:["auto","min-content","max-content"]},"grid-auto-flow":{values:["row","column"]},"grid-auto-rows":{values:["auto","min-content","max-content"]},"grid-column-end":{values:["auto"]},"grid-column-start":{values:["auto"]},"grid-row-end":{values:["auto"]},"grid-row-start":{values:["auto"]},"grid-template-areas":{values:["none"]},"grid-template-columns":{values:["none"]},"grid-template-rows":{values:["none"]},height:{values:["auto","fit-content","min-content","max-content"]},"hyphenate-limit-chars":{values:["auto"]},hyphens:{values:["none","manual","auto"]},"image-rendering":{values:["auto","optimizespeed","optimizequality","-webkit-optimize-contrast","pixelated"]},"initial-letter":{values:["drop","normal","raise"]},"inline-size":{values:["auto"]},interactivity:{values:["auto","inert"]},"interpolate-size":{values:["numeric-only","allow-keywords"]},isolation:{values:["auto","isolate"]},left:{values:["auto"]},"letter-spacing":{values:["normal"]},"lighting-color":{values:["currentcolor"]},"line-break":{values:["auto","loose","normal","strict","anywhere"]},"line-clamp":{values:["none","auto"]},"line-height":{values:["normal"]},"list-style-image":{values:["none"]},"list-style-position":{values:["outside","inside"]},"list-style-type":{values:["disc","circle","square","disclosure-open","disclosure-closed","decimal","none"]},"margin-block-end":{values:["auto"]},"margin-block-start":{values:["auto"]},"margin-bottom":{values:["auto"]},"margin-inline-end":{values:["auto"]},"margin-inline-start":{values:["auto"]},"margin-left":{values:["auto"]},"margin-right":{values:["auto"]},"margin-top":{values:["auto"]},"marker-end":{values:["none"]},"marker-mid":{values:["none"]},"marker-start":{values:["none"]},"mask-type":{values:["luminance","alpha"]},"masonry-auto-tracks":{values:["auto","min-content","max-content"]},"masonry-direction":{values:["row","row-reverse","column","column-reverse"]},"masonry-fill":{values:["normal","reverse"]},"masonry-slack":{values:["normal"]},"masonry-track-end":{values:["auto"]},"masonry-track-start":{values:["auto"]},"math-shift":{values:["normal","compact"]},"math-style":{values:["normal","compact"]},"max-block-size":{values:["none"]},"max-height":{values:["none"]},"max-inline-size":{values:["none"]},"max-width":{values:["none"]},"mix-blend-mode":{values:["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"]},"object-fit":{values:["fill","contain","cover","none","scale-down"]},"object-view-box":{values:["none"]},"offset-anchor":{values:["auto"]},"offset-path":{values:["none"]},"offset-position":{values:["auto","normal"]},"offset-rotate":{values:["auto","reverse"]},"origin-trial-test-property":{values:["normal","none"]},"outline-color":{values:["currentcolor"]},"outline-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"outline-width":{values:["thin","medium","thick"]},"overflow-anchor":{values:["visible","none","auto"]},"overflow-clip-margin":{values:["border-box","content-box","padding-box"]},"overflow-wrap":{values:["normal","break-word","anywhere"]},"overflow-x":{values:["visible","hidden","scroll","auto","overlay","clip"]},"overflow-y":{values:["visible","hidden","scroll","auto","overlay","clip"]},overlay:{values:["none","auto"]},"overscroll-behavior-x":{values:["auto","contain","none"]},"overscroll-behavior-y":{values:["auto","contain","none"]},page:{values:["auto"]},"paint-order":{values:["normal","fill","stroke","markers"]},perspective:{values:["none"]},"pointer-events":{values:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","bounding-box","all"]},position:{values:["static","relative","absolute","fixed","sticky"]},"position-anchor":{values:["auto"]},"position-area":{values:["none","top","bottom","center","left","right","x-start","x-end","y-start","y-end","start","end","self-start","self-end","all"]},"position-try-fallbacks":{values:["none","flip-block","flip-inline","flip-start"]},"position-try-order":{values:["normal","most-width","most-height","most-block-size","most-inline-size"]},"position-visibility":{values:["always","anchors-visible","no-overflow"]},"print-color-adjust":{values:["economy","exact"]},quotes:{values:["auto","none"]},"reading-flow":{values:["normal","flex-visual","flex-flow","grid-rows","grid-columns","grid-order","source-order"]},resize:{values:["none","both","horizontal","vertical","block","inline"]},right:{values:["auto"]},"row-gap":{values:["normal"]},"row-rule-break":{values:["none","spanning-item","intersection"]},"row-rule-color":{values:["currentcolor"]},"row-rule-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"row-rule-width":{values:["thin","medium","thick"]},"ruby-align":{values:["space-around","start","center","space-between"]},"ruby-position":{values:["over","under"]},rx:{values:["auto"]},ry:{values:["auto"]},"scroll-behavior":{values:["auto","smooth"]},"scroll-initial-target":{values:["none","nearest"]},"scroll-marker-contain":{values:["none","auto"]},"scroll-marker-group":{values:["none","after","before"]},"scroll-padding-block-end":{values:["auto"]},"scroll-padding-block-start":{values:["auto"]},"scroll-padding-bottom":{values:["auto"]},"scroll-padding-inline-end":{values:["auto"]},"scroll-padding-inline-start":{values:["auto"]},"scroll-padding-left":{values:["auto"]},"scroll-padding-right":{values:["auto"]},"scroll-padding-top":{values:["auto"]},"scroll-snap-align":{values:["none","start","end","center"]},"scroll-snap-stop":{values:["normal","always"]},"scroll-snap-type":{values:["none","x","y","block","inline","both","mandatory","proximity"]},"scrollbar-color":{values:["auto"]},"scrollbar-gutter":{values:["auto","stable","both-edges"]},"scrollbar-width":{values:["auto","thin","none"]},"shape-margin":{values:["none"]},"shape-outside":{values:["none"]},"shape-rendering":{values:["auto","optimizespeed","crispedges","geometricprecision"]},speak:{values:["none","normal","spell-out","digits","literal-punctuation","no-punctuation"]},"stop-color":{values:["currentcolor"]},"stroke-dasharray":{values:["none"]},"stroke-linecap":{values:["butt","round","square"]},"stroke-linejoin":{values:["miter","bevel","round"]},"table-layout":{values:["auto","fixed"]},"text-align":{values:["left","right","center","justify","-webkit-left","-webkit-right","-webkit-center","start","end"]},"text-align-last":{values:["auto","start","end","left","right","center","justify"]},"text-anchor":{values:["start","middle","end"]},"text-autospace":{values:["normal","no-autospace"]},"text-box-trim":{values:["none","trim-start","trim-end","trim-both"]},"text-combine-upright":{values:["none","all"]},"text-decoration-color":{values:["currentcolor"]},"text-decoration-line":{values:["none","underline","overline","line-through","blink","spelling-error","grammar-error"]},"text-decoration-skip-ink":{values:["none","auto"]},"text-decoration-style":{values:["solid","double","dotted","dashed","wavy"]},"text-decoration-thickness":{values:["auto","from-font"]},"text-emphasis-color":{values:["currentcolor"]},"text-orientation":{values:["sideways","mixed","upright"]},"text-overflow":{values:["clip","ellipsis"]},"text-rendering":{values:["auto","optimizespeed","optimizelegibility","geometricprecision"]},"text-shadow":{values:["none"]},"text-size-adjust":{values:["none","auto"]},"text-spacing-trim":{values:["normal","space-all","space-first","trim-start"]},"text-transform":{values:["capitalize","uppercase","lowercase","none","math-auto"]},"text-underline-offset":{values:["auto"]},"text-underline-position":{values:["auto","from-font","under","left","right"]},"text-wrap-mode":{values:["wrap","nowrap"]},"text-wrap-style":{values:["auto","balance","pretty","stable"]},top:{values:["auto"]},"touch-action":{values:["auto","none","pan-x","pan-left","pan-right","pan-y","pan-up","pan-down","pinch-zoom","manipulation"]},transform:{values:["none"]},"transform-box":{values:["content-box","border-box","fill-box","stroke-box","view-box"]},"transform-style":{values:["flat","preserve-3d"]},"transition-behavior":{values:["normal","allow-discrete"]},"transition-property":{values:["none"]},"transition-timing-function":{values:["linear","ease","ease-in","ease-out","ease-in-out","jump-both","jump-end","jump-none","jump-start","step-start","step-end"]},"unicode-bidi":{values:["normal","embed","bidi-override","isolate","plaintext","isolate-override"]},"user-select":{values:["auto","none","text","all","contain"]},"vector-effect":{values:["none","non-scaling-stroke"]},"vertical-align":{values:["baseline","sub","super","text-top","text-bottom","middle"]},"view-transition-class":{values:["none"]},"view-transition-group":{values:["normal","contain","nearest"]},"view-transition-name":{values:["none","auto"]},visibility:{values:["visible","hidden","collapse"]},"white-space-collapse":{values:["collapse","preserve","preserve-breaks","break-spaces"]},width:{values:["auto","fit-content","min-content","max-content"]},"will-change":{values:["auto"]},"word-break":{values:["normal","break-all","keep-all","break-word","auto-phrase"]},"word-spacing":{values:["normal"]},"writing-mode":{values:["horizontal-tb","vertical-rl","vertical-lr","sideways-rl","sideways-lr"]},"z-index":{values:["auto"]}},m=new Map([["-epub-caption-side","caption-side"],["-epub-text-combine","-webkit-text-combine"],["-epub-text-emphasis","text-emphasis"],["-epub-text-emphasis-color","text-emphasis-color"],["-epub-text-emphasis-style","text-emphasis-style"],["-epub-text-orientation","-webkit-text-orientation"],["-epub-text-transform","text-transform"],["-epub-word-break","word-break"],["-epub-writing-mode","-webkit-writing-mode"],["-webkit-align-content","align-content"],["-webkit-align-items","align-items"],["-webkit-align-self","align-self"],["-webkit-animation","animation"],["-webkit-animation-delay","animation-delay"],["-webkit-animation-direction","animation-direction"],["-webkit-animation-duration","animation-duration"],["-webkit-animation-fill-mode","animation-fill-mode"],["-webkit-animation-iteration-count","animation-iteration-count"],["-webkit-animation-name","animation-name"],["-webkit-animation-play-state","animation-play-state"],["-webkit-animation-timing-function","animation-timing-function"],["-webkit-app-region","app-region"],["-webkit-appearance","appearance"],["-webkit-backface-visibility","backface-visibility"],["-webkit-background-clip","background-clip"],["-webkit-background-origin","background-origin"],["-webkit-background-size","background-size"],["-webkit-border-after","border-block-end"],["-webkit-border-after-color","border-block-end-color"],["-webkit-border-after-style","border-block-end-style"],["-webkit-border-after-width","border-block-end-width"],["-webkit-border-before","border-block-start"],["-webkit-border-before-color","border-block-start-color"],["-webkit-border-before-style","border-block-start-style"],["-webkit-border-before-width","border-block-start-width"],["-webkit-border-bottom-left-radius","border-bottom-left-radius"],["-webkit-border-bottom-right-radius","border-bottom-right-radius"],["-webkit-border-end","border-inline-end"],["-webkit-border-end-color","border-inline-end-color"],["-webkit-border-end-style","border-inline-end-style"],["-webkit-border-end-width","border-inline-end-width"],["-webkit-border-radius","border-radius"],["-webkit-border-start","border-inline-start"],["-webkit-border-start-color","border-inline-start-color"],["-webkit-border-start-style","border-inline-start-style"],["-webkit-border-start-width","border-inline-start-width"],["-webkit-border-top-left-radius","border-top-left-radius"],["-webkit-border-top-right-radius","border-top-right-radius"],["-webkit-box-shadow","box-shadow"],["-webkit-box-sizing","box-sizing"],["-webkit-clip-path","clip-path"],["-webkit-column-count","column-count"],["-webkit-column-gap","column-gap"],["-webkit-column-rule","column-rule"],["-webkit-column-rule-color","column-rule-color"],["-webkit-column-rule-style","column-rule-style"],["-webkit-column-rule-width","column-rule-width"],["-webkit-column-span","column-span"],["-webkit-column-width","column-width"],["-webkit-columns","columns"],["-webkit-filter","filter"],["-webkit-flex","flex"],["-webkit-flex-basis","flex-basis"],["-webkit-flex-direction","flex-direction"],["-webkit-flex-flow","flex-flow"],["-webkit-flex-grow","flex-grow"],["-webkit-flex-shrink","flex-shrink"],["-webkit-flex-wrap","flex-wrap"],["-webkit-font-feature-settings","font-feature-settings"],["-webkit-hyphenate-character","hyphenate-character"],["-webkit-justify-content","justify-content"],["-webkit-logical-height","block-size"],["-webkit-logical-width","inline-size"],["-webkit-margin-after","margin-block-end"],["-webkit-margin-before","margin-block-start"],["-webkit-margin-end","margin-inline-end"],["-webkit-margin-start","margin-inline-start"],["-webkit-mask","mask"],["-webkit-mask-clip","mask-clip"],["-webkit-mask-composite","mask-composite"],["-webkit-mask-image","mask-image"],["-webkit-mask-origin","mask-origin"],["-webkit-mask-position","mask-position"],["-webkit-mask-repeat","mask-repeat"],["-webkit-mask-size","mask-size"],["-webkit-max-logical-height","max-block-size"],["-webkit-max-logical-width","max-inline-size"],["-webkit-min-logical-height","min-block-size"],["-webkit-min-logical-width","min-inline-size"],["-webkit-opacity","opacity"],["-webkit-order","order"],["-webkit-padding-after","padding-block-end"],["-webkit-padding-before","padding-block-start"],["-webkit-padding-end","padding-inline-end"],["-webkit-padding-start","padding-inline-start"],["-webkit-perspective","perspective"],["-webkit-perspective-origin","perspective-origin"],["-webkit-print-color-adjust","print-color-adjust"],["-webkit-shape-image-threshold","shape-image-threshold"],["-webkit-shape-margin","shape-margin"],["-webkit-shape-outside","shape-outside"],["-webkit-text-emphasis","text-emphasis"],["-webkit-text-emphasis-color","text-emphasis-color"],["-webkit-text-emphasis-position","text-emphasis-position"],["-webkit-text-emphasis-style","text-emphasis-style"],["-webkit-text-size-adjust","text-size-adjust"],["-webkit-transform","transform"],["-webkit-transform-origin","transform-origin"],["-webkit-transform-style","transform-style"],["-webkit-transition","transition"],["-webkit-transition-delay","transition-delay"],["-webkit-transition-duration","transition-duration"],["-webkit-transition-property","transition-property"],["-webkit-transition-timing-function","transition-timing-function"],["-webkit-user-select","user-select"],["grid-column-gap","column-gap"],["grid-gap","gap"],["grid-row-gap","row-gap"],["word-wrap","overflow-wrap"]]);class f{#t=[];#n=new Map;#r=new Map;#s=new Set;#i=new Set;#o=new Map;#a=new Map;#l=[];#d=[];#c;constructor(e,t){this.#a=t;for(let t=0;tCSS.supports(e,t))).sort(f.sortPrefixesAndCSSWideKeywordsToEnd).map((t=>`${e}: ${t}`));this.isSVGProperty(e)||this.#l.push(...t),this.#d.push(...t)}}static isCSSWideKeyword(e){return y.includes(e)}static isPositionTryOrderKeyword(e){return v.includes(e)}static sortPrefixesAndCSSWideKeywordsToEnd(e,t){const n=f.isCSSWideKeyword(e),r=f.isCSSWideKeyword(t);if(n&&!r)return 1;if(!n&&r)return-1;const s=e.startsWith("-webkit-"),i=t.startsWith("-webkit-");return s&&!i?1:!s&&i||et?1:0}allProperties(){return this.#t}aliasesFor(){return this.#a}nameValuePresets(e){return e?this.#d:this.#l}isSVGProperty(e){return e=e.toLowerCase(),this.#i.has(e)}getLonghands(e){return this.#n.get(e)||null}getShorthands(e){return this.#r.get(e)||null}isColorAwareProperty(e){return E.has(e.toLowerCase())||this.isCustomProperty(e.toLowerCase())}isFontFamilyProperty(e){return"font-family"===e.toLowerCase()}isAngleAwareProperty(e){const t=e.toLowerCase();return E.has(t)||L.has(t)}isGridAreaDefiningProperty(e){return"grid"===(e=e.toLowerCase())||"grid-template"===e||"grid-template-areas"===e}isGridColumnNameAwareProperty(e){return e=e.toLowerCase(),["grid-column","grid-column-start","grid-column-end"].includes(e)}isGridRowNameAwareProperty(e){return e=e.toLowerCase(),["grid-row","grid-row-start","grid-row-end"].includes(e)}isGridAreaNameAwareProperty(e){return"grid-area"===(e=e.toLowerCase())}isGridNameAwareProperty(e){return this.isGridAreaNameAwareProperty(e)||this.isGridColumnNameAwareProperty(e)||this.isGridRowNameAwareProperty(e)}isLengthProperty(e){return"line-height"!==(e=e.toLowerCase())&&(T.has(e)||e.startsWith("margin")||e.startsWith("padding")||-1!==e.indexOf("width")||-1!==e.indexOf("height"))}isBezierAwareProperty(e){return e=e.toLowerCase(),M.has(e)||this.isCustomProperty(e)}isFontAwareProperty(e){return e=e.toLowerCase(),P.has(e)||this.isCustomProperty(e)}isCustomProperty(e){return e.startsWith("--")}isShadowProperty(e){return"box-shadow"===(e=e.toLowerCase())||"text-shadow"===e||"-webkit-box-shadow"===e}isStringProperty(e){return"content"===(e=e.toLowerCase())}canonicalPropertyName(e){if(this.isCustomProperty(e))return e;e=e.toLowerCase();const t=this.#a.get(e);if(t)return t;if(!e||e.length<9||"-"!==e.charAt(0))return e;const n=e.match(/(?:-webkit-)(.+)/);return n&&this.#c.has(n[1])?n[1]:e}isCSSPropertyName(e){return!!((e=e.toLowerCase()).startsWith("--")&&e.length>2||e.startsWith("-moz-")||e.startsWith("-ms-")||e.startsWith("-o-")||e.startsWith("-webkit-"))||this.#c.has(e)}isPropertyInherited(e){return(e=e.toLowerCase()).startsWith("--")||this.#s.has(this.canonicalPropertyName(e))||this.#s.has(e)}specificPropertyValues(e){const t=e.replace(/^-webkit-/,""),n=this.#o;let r=n.get(e)||n.get(t);if(!r){r=[];for(const t of F)CSS.supports(e,t)&&r.push(t);n.set(e,r)}return r}getPropertyValues(t){t=t.toLowerCase();const n=[...this.specificPropertyValues(t),...y];if(this.isColorAwareProperty(t)){n.push("currentColor");for(const t of e.Color.Nicknames.keys())n.push(t)}return n.sort(f.sortPrefixesAndCSSWideKeywordsToEnd)}propertyUsageWeight(e){return N.get(e)||N.get(this.canonicalPropertyName(e))||0}getValuePreset(e,t){const n=R.get(e);let r=n?n.get(t):null;if(!r)return null;let s=r.length,i=r.length;return r&&(s=r.indexOf("|"),i=r.lastIndexOf("|"),i=s===i?i:i-1,r=r.replace(/\|/g,"")),{text:r,startColumn:s,endColumn:i}}isHighlightPseudoType(e){return"highlight"===e||"selection"===e||"target-text"===e||"grammar-error"===e||"spelling-error"===e}}const b=new Map([["linear","cubic-bezier(0, 0, 1, 1)"],["ease","cubic-bezier(0.25, 0.1, 0.25, 1)"],["ease-in","cubic-bezier(0.42, 0, 1, 1)"],["ease-in-out","cubic-bezier(0.42, 0, 0.58, 1)"],["ease-out","cubic-bezier(0, 0, 0.58, 1)"]]),y=["inherit","initial","revert","revert-layer","unset"],v=["normal","most-height","most-width","most-block-size","most-inline-size"],I=/((?:\[[\w\- ]+\]\s*)*(?:"[^"]+"|'[^']+'))[^'"\[]*\[?[^'"\[]*/;let w=null;function S(){if(!w){w=new f(g,m)}return w}const k=new Map([["linear-gradient","linear-gradient(|45deg, black, transparent|)"],["radial-gradient","radial-gradient(|black, transparent|)"],["repeating-linear-gradient","repeating-linear-gradient(|45deg, black, transparent 100px|)"],["repeating-radial-gradient","repeating-radial-gradient(|black, transparent 100px|)"],["url","url(||)"]]),C=new Map([["blur","blur(|1px|)"],["brightness","brightness(|0.5|)"],["contrast","contrast(|0.5|)"],["drop-shadow","drop-shadow(|2px 4px 6px black|)"],["grayscale","grayscale(|1|)"],["hue-rotate","hue-rotate(|45deg|)"],["invert","invert(|1|)"],["opacity","opacity(|0.5|)"],["saturate","saturate(|0.5|)"],["sepia","sepia(|1|)"],["url","url(||)"]]),x=new Map([["superellipse(0.5)","superellipse(|0.5|)"],["superellipse(infinity)","superellipse(|infinity|)"]]),R=new Map([["filter",C],["backdrop-filter",C],["background",k],["background-image",k],["-webkit-mask-image",k],["transform",new Map([["scale","scale(|1.5|)"],["scaleX","scaleX(|1.5|)"],["scaleY","scaleY(|1.5|)"],["scale3d","scale3d(|1.5, 1.5, 1.5|)"],["rotate","rotate(|45deg|)"],["rotateX","rotateX(|45deg|)"],["rotateY","rotateY(|45deg|)"],["rotateZ","rotateZ(|45deg|)"],["rotate3d","rotate3d(|1, 1, 1, 45deg|)"],["skew","skew(|10deg, 10deg|)"],["skewX","skewX(|10deg|)"],["skewY","skewY(|10deg|)"],["translate","translate(|10px, 10px|)"],["translateX","translateX(|10px|)"],["translateY","translateY(|10px|)"],["translateZ","translateZ(|10px|)"],["translate3d","translate3d(|10px, 10px, 10px|)"],["matrix","matrix(|1, 0, 0, 1, 0, 0|)"],["matrix3d","matrix3d(|1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1|)"],["perspective","perspective(|10px|)"]])],["corner-shape",x]]),T=new Set(["background-position","border-spacing","bottom","font-size","height","left","letter-spacing","max-height","max-width","min-height","min-width","right","text-indent","top","width","word-spacing","grid-row-gap","grid-column-gap","row-gap"]),M=new Set(["animation","animation-timing-function","transition","transition-timing-function","-webkit-animation","-webkit-animation-timing-function","-webkit-transition","-webkit-transition-timing-function"]),P=new Set(["font-size","line-height","font-weight","font-family","letter-spacing"]),E=new Set(["accent-color","background","background-color","background-image","border","border-color","border-image","border-image-source","border-bottom","border-bottom-color","border-left","border-left-color","border-right","border-right-color","border-top","border-top-color","border-block","border-block-color","border-block-end","border-block-end-color","border-block-start","border-block-start-color","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-start","border-inline-start-color","box-shadow","caret-color","color","column-rule","column-rule-color","content","fill","list-style-image","mask","mask-image","mask-border","mask-border-source","outline","outline-color","scrollbar-color","stop-color","stroke","text-decoration-color","text-shadow","text-emphasis","text-emphasis-color","-webkit-border-after","-webkit-border-after-color","-webkit-border-before","-webkit-border-before-color","-webkit-border-end","-webkit-border-end-color","-webkit-border-start","-webkit-border-start-color","-webkit-box-reflect","-webkit-box-shadow","-webkit-column-rule-color","-webkit-mask","-webkit-mask-box-image","-webkit-mask-box-image-source","-webkit-mask-image","-webkit-tap-highlight-color","-webkit-text-emphasis","-webkit-text-emphasis-color","-webkit-text-fill-color","-webkit-text-stroke","-webkit-text-stroke-color","flood-color","lighting-color","stop-color"]),L=new Set(["-webkit-border-image","transform","-webkit-transform","rotate","filter","-webkit-filter","backdrop-filter","offset","offset-rotate","font-style"]),A=new Set(["over","under","over right","over left","under right","under left"]),O=new Set(["none","dot","circle","double-circle","triangle","sesame","filled","open","dot open","circle open","double-circle open","triangle open","sesame open",'"❤️"']),D=new Map([["background-repeat",new Set(["repeat","repeat-x","repeat-y","no-repeat","space","round"])],["content",new Set(["normal","close-quote","no-close-quote","no-open-quote","open-quote"])],["baseline-shift",new Set(["baseline"])],["max-height",new Set(["min-content","max-content","-webkit-fill-available","fit-content"])],["color",new Set(["black"])],["background-color",new Set(["white"])],["box-shadow",new Set(["inset"])],["text-shadow",new Set(["0 0 black"])],["-webkit-writing-mode",new Set(["horizontal-tb","vertical-rl","vertical-lr"])],["writing-mode",new Set(["lr","rl","tb","lr-tb","rl-tb","tb-rl"])],["page-break-inside",new Set(["avoid"])],["cursor",new Set(["-webkit-zoom-in","-webkit-zoom-out","-webkit-grab","-webkit-grabbing"])],["border-width",new Set(["medium","thick","thin"])],["border-style",new Set(["hidden","inset","groove","ridge","outset","dotted","dashed","solid","double"])],["size",new Set(["a3","a4","a5","b4","b5","landscape","ledger","legal","letter","portrait"])],["overflow",new Set(["hidden","visible","overlay","scroll"])],["overscroll-behavior",new Set(["contain"])],["text-rendering",new Set(["optimizeSpeed","optimizeLegibility","geometricPrecision"])],["text-align",new Set(["-webkit-auto","-webkit-match-parent"])],["clip-path",new Set(["circle","ellipse","inset","polygon","url"])],["color-interpolation",new Set(["sRGB","linearRGB"])],["word-wrap",new Set(["normal","break-word"])],["font-weight",new Set(["100","200","300","400","500","600","700","800","900"])],["text-emphasis",O],["-webkit-text-emphasis",O],["color-rendering",new Set(["optimizeSpeed","optimizeQuality"])],["-webkit-text-combine",new Set(["horizontal"])],["text-orientation",new Set(["sideways-right"])],["outline",new Set(["inset","groove","ridge","outset","dotted","dashed","solid","double","medium","thick","thin"])],["font",new Set(["caption","icon","menu","message-box","small-caption","-webkit-mini-control","-webkit-small-control","-webkit-control","status-bar"])],["dominant-baseline",new Set(["text-before-edge","text-after-edge","use-script","no-change","reset-size"])],["text-emphasis-position",A],["-webkit-text-emphasis-position",A],["alignment-baseline",new Set(["before-edge","after-edge","text-before-edge","text-after-edge","hanging"])],["page-break-before",new Set(["left","right","always","avoid"])],["border-image",new Set(["repeat","stretch","space","round"])],["text-decoration",new Set(["blink","line-through","overline","underline","wavy","double","solid","dashed","dotted"])],["font-family",new Set(["serif","sans-serif","cursive","fantasy","monospace","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","-webkit-body"])],["zoom",new Set(["normal"])],["max-width",new Set(["min-content","max-content","-webkit-fill-available","fit-content"])],["-webkit-font-smoothing",new Set(["antialiased","subpixel-antialiased"])],["border",new Set(["hidden","inset","groove","ridge","outset","dotted","dashed","solid","double","medium","thick","thin"])],["font-variant",new Set(["small-caps","normal","common-ligatures","no-common-ligatures","discretionary-ligatures","no-discretionary-ligatures","historical-ligatures","no-historical-ligatures","contextual","no-contextual","all-small-caps","petite-caps","all-petite-caps","unicase","titling-caps","lining-nums","oldstyle-nums","proportional-nums","tabular-nums","diagonal-fractions","stacked-fractions","ordinal","slashed-zero","jis78","jis83","jis90","jis04","simplified","traditional","full-width","proportional-width","ruby"])],["vertical-align",new Set(["top","bottom","-webkit-baseline-middle"])],["page-break-after",new Set(["left","right","always","avoid"])],["text-emphasis-style",O],["-webkit-text-emphasis-style",O],["transform",new Set(["scale","scaleX","scaleY","scale3d","rotate","rotateX","rotateY","rotateZ","rotate3d","skew","skewX","skewY","translate","translateX","translateY","translateZ","translate3d","matrix","matrix3d","perspective"])],["align-content",new Set(["normal","baseline","space-between","space-around","space-evenly","stretch","center","start","end","flex-start","flex-end"])],["justify-content",new Set(["normal","space-between","space-around","space-evenly","stretch","center","start","end","flex-start","flex-end","left","right"])],["place-content",new Set(["normal","space-between","space-around","space-evenly","stretch","center","start","end","flex-start","flex-end","baseline"])],["align-items",new Set(["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end","anchor-center"])],["justify-items",new Set(["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end","left","right","legacy","anchor-center"])],["place-items",new Set(["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end","anchor-center"])],["align-self",new Set(["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end","anchor-center"])],["justify-self",new Set(["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end","left","right","anchor-center"])],["place-self",new Set(["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end","anchor-center"])],["perspective-origin",new Set(["left","center","right","top","bottom"])],["transform-origin",new Set(["left","center","right","top","bottom"])],["transition-timing-function",new Set(["cubic-bezier","steps"])],["animation-timing-function",new Set(["cubic-bezier","steps"])],["-webkit-backface-visibility",new Set(["visible","hidden"])],["-webkit-column-break-after",new Set(["always","avoid"])],["-webkit-column-break-before",new Set(["always","avoid"])],["-webkit-column-break-inside",new Set(["avoid"])],["-webkit-column-span",new Set(["all"])],["-webkit-column-gap",new Set(["normal"])],["filter",new Set(["url","blur","brightness","contrast","drop-shadow","grayscale","hue-rotate","invert","opacity","saturate","sepia"])],["backdrop-filter",new Set(["url","blur","brightness","contrast","drop-shadow","grayscale","hue-rotate","invert","opacity","saturate","sepia"])],["grid-template-columns",new Set(["min-content","max-content"])],["grid-template-rows",new Set(["min-content","max-content"])],["grid-auto-flow",new Set(["dense"])],["background",new Set(["repeat","repeat-x","repeat-y","no-repeat","top","bottom","left","right","center","fixed","local","scroll","space","round","border-box","content-box","padding-box","linear-gradient","radial-gradient","repeating-linear-gradient","repeating-radial-gradient","url"])],["background-image",new Set(["linear-gradient","radial-gradient","repeating-linear-gradient","repeating-radial-gradient","url"])],["background-position",new Set(["top","bottom","left","right","center"])],["background-position-x",new Set(["left","right","center"])],["background-position-y",new Set(["top","bottom","center"])],["background-repeat-x",new Set(["repeat","no-repeat"])],["background-repeat-y",new Set(["repeat","no-repeat"])],["border-bottom",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["border-left",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["border-right",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["border-top",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["buffered-rendering",new Set(["static","dynamic"])],["color-interpolation-filters",new Set(["srgb","linearrgb"])],["column-rule",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["flex-flow",new Set(["nowrap","row","row-reverse","column","column-reverse","wrap","wrap-reverse"])],["height",new Set(["-webkit-fill-available"])],["inline-size",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["list-style",new Set(["outside","inside","disc","circle","square","decimal","decimal-leading-zero","arabic-indic","bengali","cambodian","khmer","devanagari","gujarati","gurmukhi","kannada","lao","malayalam","mongolian","myanmar","oriya","persian","urdu","telugu","tibetan","thai","lower-roman","upper-roman","lower-greek","lower-alpha","lower-latin","upper-alpha","upper-latin","cjk-earthly-branch","cjk-heavenly-stem","ethiopic-halehame","ethiopic-halehame-am","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","hangul","hangul-consonant","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","hebrew","armenian","lower-armenian","upper-armenian","georgian","cjk-ideographic","simp-chinese-formal","simp-chinese-informal","trad-chinese-formal","trad-chinese-informal","hiragana","katakana","hiragana-iroha","katakana-iroha"])],["max-block-size",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["max-inline-size",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["min-block-size",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["min-height",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["min-inline-size",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["min-width",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["object-position",new Set(["top","bottom","left","right","center"])],["shape-outside",new Set(["border-box","content-box","padding-box","margin-box"])],["-webkit-appearance",new Set(["checkbox","radio","push-button","square-button","button","inner-spin-button","listbox","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","menulist","menulist-button","meter","progress-bar","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","searchfield","searchfield-cancel-button","textfield","textarea"])],["-webkit-border-after",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["-webkit-border-after-style",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"])],["-webkit-border-after-width",new Set(["medium","thick","thin"])],["-webkit-border-before",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["-webkit-border-before-style",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"])],["-webkit-border-before-width",new Set(["medium","thick","thin"])],["-webkit-border-end",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["-webkit-border-end-style",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"])],["-webkit-border-end-width",new Set(["medium","thick","thin"])],["-webkit-border-start",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["-webkit-border-start-style",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"])],["-webkit-border-start-width",new Set(["medium","thick","thin"])],["-webkit-logical-height",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["-webkit-logical-width",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["-webkit-mask-box-image",new Set(["repeat","stretch","space","round"])],["-webkit-mask-box-image-repeat",new Set(["repeat","stretch","space","round"])],["-webkit-mask-clip",new Set(["text","border","border-box","content","content-box","padding","padding-box"])],["-webkit-mask-composite",new Set(["clear","copy","source-over","source-in","source-out","source-atop","destination-over","destination-in","destination-out","destination-atop","xor","plus-lighter"])],["-webkit-mask-image",new Set(["linear-gradient","radial-gradient","repeating-linear-gradient","repeating-radial-gradient","url"])],["-webkit-mask-origin",new Set(["border","border-box","content","content-box","padding","padding-box"])],["-webkit-mask-position",new Set(["top","bottom","left","right","center"])],["-webkit-mask-position-x",new Set(["left","right","center"])],["-webkit-mask-position-y",new Set(["top","bottom","center"])],["-webkit-mask-repeat",new Set(["repeat","repeat-x","repeat-y","no-repeat","space","round"])],["-webkit-mask-size",new Set(["contain","cover"])],["-webkit-max-logical-height",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["-webkit-max-logical-width",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["-webkit-min-logical-height",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["-webkit-min-logical-width",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["-webkit-perspective-origin-x",new Set(["left","right","center"])],["-webkit-perspective-origin-y",new Set(["top","bottom","center"])],["-webkit-text-decorations-in-effect",new Set(["blink","line-through","overline","underline"])],["-webkit-text-stroke",new Set(["medium","thick","thin"])],["-webkit-text-stroke-width",new Set(["medium","thick","thin"])],["-webkit-transform-origin-x",new Set(["left","right","center"])],["-webkit-transform-origin-y",new Set(["top","bottom","center"])],["width",new Set(["-webkit-fill-available"])],["contain-intrinsic-width",new Set(["auto none","auto 100px"])],["contain-intrinsic-height",new Set(["auto none","auto 100px"])],["contain-intrinsic-size",new Set(["auto none","auto 100px"])],["contain-intrinsic-inline-size",new Set(["auto none","auto 100px"])],["contain-intrinsic-block-size",new Set(["auto none","auto 100px"])],["white-space",new Set(["normal","pre","pre-wrap","pre-line","nowrap","break-spaces"])],["text-box-edge",new Set(["auto","text","cap","ex","text alphabetic","cap alphabetic","ex alphabetic"])],["corner-shape",new Set(["round","scoop","bevel","notch","straight","squircle","superellipse(0.5)","superellipse(infinity)"])]]),N=new Map([["align-content",57],["align-items",129],["align-self",55],["animation",175],["animation-delay",114],["animation-direction",113],["animation-duration",137],["animation-fill-mode",132],["animation-iteration-count",124],["animation-name",139],["animation-play-state",104],["animation-timing-function",141],["backface-visibility",123],["background",260],["background-attachment",119],["background-clip",165],["background-color",259],["background-image",246],["background-origin",107],["background-position",237],["background-position-x",108],["background-position-y",93],["background-repeat",234],["background-size",203],["border",263],["border-bottom",233],["border-bottom-color",190],["border-bottom-left-radius",186],["border-bottom-right-radius",185],["border-bottom-style",150],["border-bottom-width",179],["border-collapse",209],["border-color",226],["border-image",89],["border-image-outset",50],["border-image-repeat",49],["border-image-slice",58],["border-image-source",32],["border-image-width",52],["border-left",221],["border-left-color",174],["border-left-style",142],["border-left-width",172],["border-radius",224],["border-right",223],["border-right-color",182],["border-right-style",130],["border-right-width",178],["border-spacing",198],["border-style",206],["border-top",231],["border-top-color",192],["border-top-left-radius",187],["border-top-right-radius",189],["border-top-style",152],["border-top-width",180],["border-width",214],["bottom",227],["box-shadow",213],["box-sizing",216],["caption-side",96],["clear",229],["clip",173],["clip-rule",5],["color",256],["content",219],["counter-increment",111],["counter-reset",110],["cursor",250],["direction",176],["display",262],["empty-cells",99],["fill",140],["fill-opacity",82],["fill-rule",22],["filter",160],["flex",133],["flex-basis",66],["flex-direction",85],["flex-flow",94],["flex-grow",112],["flex-shrink",61],["flex-wrap",68],["float",252],["font",211],["font-family",254],["font-kerning",18],["font-size",264],["font-stretch",77],["font-style",220],["font-variant",161],["font-weight",257],["height",266],["image-rendering",90],["justify-content",127],["left",248],["letter-spacing",188],["line-height",244],["list-style",215],["list-style-image",145],["list-style-position",149],["list-style-type",199],["margin",267],["margin-bottom",241],["margin-left",243],["margin-right",238],["margin-top",253],["mask",20],["max-height",205],["max-width",225],["min-height",217],["min-width",218],["object-fit",33],["opacity",251],["order",117],["orphans",146],["outline",222],["outline-color",153],["outline-offset",147],["outline-style",151],["outline-width",148],["overflow",255],["overflow-wrap",105],["overflow-x",184],["overflow-y",196],["padding",265],["padding-bottom",230],["padding-left",235],["padding-right",232],["padding-top",240],["page",8],["page-break-after",120],["page-break-before",69],["page-break-inside",121],["perspective",92],["perspective-origin",103],["pointer-events",183],["position",261],["quotes",158],["resize",168],["right",245],["shape-rendering",38],["size",64],["speak",118],["src",170],["stop-color",42],["stop-opacity",31],["stroke",98],["stroke-dasharray",36],["stroke-dashoffset",3],["stroke-linecap",30],["stroke-linejoin",21],["stroke-miterlimit",12],["stroke-opacity",34],["stroke-width",87],["table-layout",171],["tab-size",46],["text-align",260],["text-anchor",35],["text-decoration",247],["text-indent",207],["text-overflow",204],["text-rendering",155],["text-shadow",208],["text-transform",202],["top",258],["touch-action",80],["transform",181],["transform-origin",162],["transform-style",86],["transition",193],["transition-delay",134],["transition-duration",135],["transition-property",131],["transition-timing-function",122],["unicode-bidi",156],["unicode-range",136],["vertical-align",236],["visibility",242],["-webkit-appearance",191],["-webkit-backface-visibility",154],["-webkit-background-clip",164],["-webkit-background-origin",40],["-webkit-background-size",163],["-webkit-border-end",9],["-webkit-border-horizontal-spacing",81],["-webkit-border-image",75],["-webkit-border-radius",212],["-webkit-border-start",10],["-webkit-border-start-color",16],["-webkit-border-start-width",13],["-webkit-border-vertical-spacing",43],["-webkit-box-align",101],["-webkit-box-direction",51],["-webkit-box-flex",128],["-webkit-box-ordinal-group",91],["-webkit-box-orient",144],["-webkit-box-pack",106],["-webkit-box-reflect",39],["-webkit-box-shadow",210],["-webkit-column-break-inside",60],["-webkit-column-count",84],["-webkit-column-gap",76],["-webkit-column-rule",25],["-webkit-column-rule-color",23],["-webkit-columns",44],["-webkit-column-span",29],["-webkit-column-width",47],["-webkit-filter",159],["-webkit-font-feature-settings",59],["-webkit-font-smoothing",177],["-webkit-line-break",45],["-webkit-line-clamp",126],["-webkit-margin-after",67],["-webkit-margin-before",70],["-webkit-margin-collapse",14],["-webkit-margin-end",65],["-webkit-margin-start",100],["-webkit-mask",19],["-webkit-mask-box-image",72],["-webkit-mask-image",88],["-webkit-mask-position",54],["-webkit-mask-repeat",63],["-webkit-mask-size",79],["-webkit-padding-after",15],["-webkit-padding-before",28],["-webkit-padding-end",48],["-webkit-padding-start",73],["-webkit-print-color-adjust",83],["-webkit-rtl-ordering",7],["-webkit-tap-highlight-color",169],["-webkit-text-emphasis-color",11],["-webkit-text-fill-color",71],["-webkit-text-security",17],["-webkit-text-stroke",56],["-webkit-text-stroke-color",37],["-webkit-text-stroke-width",53],["-webkit-user-drag",95],["-webkit-user-modify",62],["-webkit-user-select",194],["-webkit-writing-mode",4],["white-space",228],["widows",115],["width",268],["will-change",74],["word-break",166],["word-spacing",157],["word-wrap",197],["writing-mode",41],["z-index",239],["zoom",200]]),F=["auto","none"];var B=Object.freeze({__proto__:null,CSSMetadata:f,CSSWideKeywords:y,CubicBezierKeywordValues:b,CustomVariableRegex:/(var\(*--[\w\d]+-([\w]+-[\w]+)\))/g,GridAreaRowRegex:I,PositionTryOrderKeywords:v,URLRegex:/url\(\s*('.+?'|".+?"|[^)]+)\s*\)/g,VariableNameRegex:/(\s*--.*?)/gs,VariableRegex:/(var\(\s*--.*?\))/gs,cssMetadata:S});const _="";class H{#h;#u;#g;#p=new Map;#m=0;#f;#b=null;#y;constructor(e,t,n,r,s){this.#h=e,this.#u=t,this.#g=n,this.#f=r||"Medium",this.#y=s}static fromProtocolCookie(e){const t=new H(e.name,e.value,null,e.priority);return t.addAttribute("domain",e.domain),t.addAttribute("path",e.path),e.expires&&t.addAttribute("expires",1e3*e.expires),e.httpOnly&&t.addAttribute("http-only"),e.secure&&t.addAttribute("secure"),e.sameSite&&t.addAttribute("same-site",e.sameSite),"sourcePort"in e&&t.addAttribute("source-port",e.sourcePort),"sourceScheme"in e&&t.addAttribute("source-scheme",e.sourceScheme),"partitionKey"in e&&e.partitionKey&&t.setPartitionKey(e.partitionKey.topLevelSite,e.partitionKey.hasCrossSiteAncestor),"partitionKeyOpaque"in e&&e.partitionKeyOpaque&&t.addAttribute("partition-key",_),t.setSize(e.size),t}key(){return(this.domain()||"-")+" "+this.name()+" "+(this.path()||"-")+" "+(this.partitionKey()?this.topLevelSite()+" "+(this.hasCrossSiteAncestor()?"cross_site":"same_site"):"-")}name(){return this.#h}value(){return this.#u}type(){return this.#g}httpOnly(){return this.#p.has("http-only")}secure(){return this.#p.has("secure")}partitioned(){return this.#p.has("partitioned")||Boolean(this.partitionKey())||this.partitionKeyOpaque()}sameSite(){return this.#p.get("same-site")}partitionKey(){return this.#y}setPartitionKey(e,t){this.#y={topLevelSite:e,hasCrossSiteAncestor:t},this.#p.has("partitioned")||this.addAttribute("partitioned")}topLevelSite(){return this.#y?this.#y?.topLevelSite:""}setTopLevelSite(e,t){this.setPartitionKey(e,t)}hasCrossSiteAncestor(){return!!this.#y&&this.#y?.hasCrossSiteAncestor}setHasCrossSiteAncestor(e){this.partitionKey()&&Boolean(this.topLevelSite())&&this.setPartitionKey(this.topLevelSite(),e)}partitionKeyOpaque(){return!!this.#y&&this.topLevelSite()===_}setPartitionKeyOpaque(){this.addAttribute("partition-key",_),this.setPartitionKey(_,!1)}priority(){return this.#f}session(){return!(this.#p.has("expires")||this.#p.has("max-age"))}path(){return this.#p.get("path")}domain(){return this.#p.get("domain")}expires(){return this.#p.get("expires")}maxAge(){return this.#p.get("max-age")}sourcePort(){return this.#p.get("source-port")}sourceScheme(){return this.#p.get("source-scheme")}size(){return this.#m}url(){if(!this.domain()||!this.path())return null;let e="";const t=this.sourcePort();return t&&80!==t&&443!==t&&(e=`:${this.sourcePort()}`),(this.secure()?"https://":"http://")+this.domain()+e+this.path()}setSize(e){this.#m=e}expiresDate(e){return this.maxAge()?new Date(e.getTime()+1e3*this.maxAge()):this.expires()?new Date(this.expires()):null}addAttribute(e,t){if(e)if("priority"===e)this.#f=t;else this.#p.set(e,t)}hasAttribute(e){return this.#p.has(e)}getAttribute(e){return this.#p.get(e)}setCookieLine(e){this.#b=e}getCookieLine(){return this.#b}matchesSecurityOrigin(e){const t=new URL(e).hostname;return H.isDomainMatch(this.domain(),t)}static isDomainMatch(e,t){return t===e||!(!e||"."!==e[0])&&(e.substr(1)===t||t.length>e.length&&t.endsWith(e))}}var U,q=Object.freeze({__proto__:null,Cookie:H});class z extends l.InspectorBackend.TargetBase{#v;#h;#I=r.DevToolsPath.EmptyUrlString;#w="";#S;#g;#k;#C;#x=new Map;#R;#T=!1;#M;#P;constructor(t,n,r,s,i,o,a,l,d){switch(super(s===U.NODE,i,o,l),this.#v=t,this.#h=r,this.#S=0,s){case U.FRAME:this.#S=1027519,i?.type()!==U.FRAME&&(this.#S|=21056,e.ParsedURL.schemeIs(d?.url,"chrome-extension:")&&(this.#S&=-513));break;case U.ServiceWorker:this.#S=657468,i?.type()!==U.FRAME&&(this.#S|=1);break;case U.SHARED_WORKER:this.#S=919612;break;case U.SHARED_STORAGE_WORKLET:this.#S=526348;break;case U.Worker:this.#S=917820;break;case U.WORKLET:this.#S=524316;break;case U.NODE:this.#S=20;break;case U.AUCTION_WORKLET:this.#S=524292;break;case U.BROWSER:this.#S=131104;break;case U.TAB:this.#S=160}this.#g=s,this.#k=i,this.#C=n,this.#R=a,this.#M=d}createModels(e){this.#P=!0;const t=Array.from(h.registeredModels.entries());for(const[e,n]of t)n.early&&this.model(e);for(const[n,r]of t)(r.autostart||e.has(n))&&this.model(n);this.#P=!1}id(){return this.#C}name(){return this.#h||this.#w}setName(e){this.#h!==e&&(this.#h=e,this.#v.onNameChange(this))}type(){return this.#g}markAsNodeJSForTest(){super.markAsNodeJSForTest(),this.#g=U.NODE}targetManager(){return this.#v}hasAllCapabilities(e){return(this.#S&e)===e}decorateLabel(e){return this.#g===U.Worker||this.#g===U.ServiceWorker?"⚙ "+e:e}parentTarget(){return this.#k}outermostTarget(){let e=null,t=this;do{t.type()!==U.TAB&&t.type()!==U.BROWSER&&(e=t),t=t.parentTarget()}while(t);return e}dispose(e){super.dispose(e),this.#v.removeTarget(this);for(const e of this.#x.values())e.dispose()}model(e){if(!this.#x.get(e)){const t=h.registeredModels.get(e);if(void 0===t)throw new Error("Model class is not registered");if((this.#S&t.capabilities)===t.capabilities){const t=new e(this);this.#x.set(e,t),this.#P||this.#v.modelAdded(this,e,t,this.#v.isInScope(this))}}return this.#x.get(e)||null}models(){return this.#x}inspectedURL(){return this.#I}setInspectedURL(t){this.#I=t;const n=e.ParsedURL.ParsedURL.fromString(t);this.#w=n?n.lastPathComponentWithFragment():"#"+this.#C,this.#v.onInspectedURLChange(this),this.#h||this.#v.onNameChange(this)}hasCrashed(){return this.#T}setHasCrashed(e){const t=this.#T;this.#T=e,t&&!e&&this.resume()}async suspend(e){this.#R||(this.#R=!0,this.#T||(await Promise.all(Array.from(this.models().values(),(t=>t.preSuspendModel(e)))),await Promise.all(Array.from(this.models().values(),(t=>t.suspendModel(e))))))}async resume(){this.#R&&(this.#R=!1,this.#T||(await Promise.all(Array.from(this.models().values(),(e=>e.resumeModel()))),await Promise.all(Array.from(this.models().values(),(e=>e.postResumeModel())))))}suspended(){return this.#R}updateTargetInfo(e){this.#M=e}targetInfo(){return this.#M}}!function(e){e.FRAME="frame",e.ServiceWorker="service-worker",e.Worker="worker",e.SHARED_WORKER="shared-worker",e.SHARED_STORAGE_WORKLET="shared-storage-worklet",e.NODE="node",e.BROWSER="browser",e.AUCTION_WORKLET="auction-worklet",e.WORKLET="worklet",e.TAB="tab"}(U||(U={}));var j=Object.freeze({__proto__:null,Target:z,get Type(){return U}});let V;class W extends e.ObjectWrapper.ObjectWrapper{#E;#L;#A;#O;#D;#R;#N;#F;#B;#_;constructor(){super(),this.#E=new Set,this.#L=new Set,this.#A=new r.MapUtilities.Multimap,this.#O=new r.MapUtilities.Multimap,this.#R=!1,this.#N=null,this.#F=null,this.#D=new WeakSet,this.#B=!1,this.#_=new Set}static instance({forceNew:e}={forceNew:!1}){return V&&!e||(V=new W),V}static removeInstance(){V=void 0}onInspectedURLChange(e){e===this.#F&&(a.InspectorFrontendHost.InspectorFrontendHostInstance.inspectedURLChanged(e.inspectedURL()||r.DevToolsPath.EmptyUrlString),this.dispatchEventToListeners("InspectedURLChanged",e))}onNameChange(e){this.dispatchEventToListeners("NameChanged",e)}async suspendAllTargets(e){if(this.#R)return;this.#R=!0,this.dispatchEventToListeners("SuspendStateChanged");const t=Array.from(this.#E.values(),(t=>t.suspend(e)));await Promise.all(t)}async resumeAllTargets(){if(!this.#R)return;this.#R=!1,this.dispatchEventToListeners("SuspendStateChanged");const e=Array.from(this.#E.values(),(e=>e.resume()));await Promise.all(e)}allTargetsSuspended(){return this.#R}models(e,t){const n=[];for(const r of this.#E){if(t?.scoped&&!this.isInScope(r))continue;const s=r.model(e);s&&n.push(s)}return n}inspectedURL(){const e=this.primaryPageTarget();return e?e.inspectedURL():""}observeModels(e,t,n){const r=this.models(e,n);this.#O.set(e,t),n?.scoped&&this.#D.add(t);for(const e of r)t.modelAdded(e)}unobserveModels(e,t){this.#O.delete(e,t),this.#D.delete(t)}modelAdded(e,t,n,r){for(const e of this.#O.get(t).values())this.#D.has(e)&&!r||e.modelAdded(n)}modelRemoved(e,t,n,r){for(const e of this.#O.get(t).values())this.#D.has(e)&&!r||e.modelRemoved(n)}addModelListener(e,t,n,r,s){const i=e=>{s?.scoped&&!this.isInScope(e)||n.call(r,e)};for(const n of this.models(e))n.addEventListener(t,i);this.#A.set(t,{modelClass:e,thisObject:r,listener:n,wrappedListener:i})}removeModelListener(e,t,n,r){if(!this.#A.has(t))return;let s=null;for(const i of this.#A.get(t))i.modelClass===e&&i.listener===n&&i.thisObject===r&&(s=i.wrappedListener,this.#A.delete(t,i));if(s)for(const n of this.models(e))n.removeEventListener(t,s)}observeTargets(e,t){if(this.#L.has(e))throw new Error("Observer can only be registered once");t?.scoped&&this.#D.add(e);for(const n of this.#E)t?.scoped&&!this.isInScope(n)||e.targetAdded(n);this.#L.add(e)}unobserveTargets(e){this.#L.delete(e),this.#D.delete(e)}createTarget(e,t,n,r,s,i,o,a){const l=new z(this,e,t,n,r,s||"",this.#R,o||null,a);i&&l.pageAgent().invoke_waitForDebugger(),l.createModels(new Set(this.#O.keysArray())),this.#E.add(l);const d=this.isInScope(l);for(const e of[...this.#L])this.#D.has(e)&&!d||e.targetAdded(l);for(const[e,t]of l.models().entries())this.modelAdded(l,e,t,d);for(const e of this.#A.keysArray())for(const t of this.#A.get(e)){const n=l.model(t.modelClass);n&&n.addEventListener(e,t.wrappedListener)}return l!==l.outermostTarget()||l.type()===U.FRAME&&l!==this.primaryPageTarget()||this.#B||this.setScopeTarget(l),l}removeTarget(e){if(!this.#E.has(e))return;const t=this.isInScope(e);this.#E.delete(e);for(const n of e.models().keys()){const r=e.models().get(n);s(r),this.modelRemoved(e,n,r,t)}for(const n of[...this.#L])this.#D.has(n)&&!t||n.targetRemoved(e);for(const t of this.#A.keysArray())for(const n of this.#A.get(t)){const r=e.model(n.modelClass);r&&r.removeEventListener(t,n.wrappedListener)}}targets(){return[...this.#E]}targetById(e){return this.targets().find((t=>t.id()===e))||null}rootTarget(){return 0===this.#E.size?null:this.#E.values().next().value??null}primaryPageTarget(){let e=this.rootTarget();return e?.type()===U.TAB&&(e=this.targets().find((t=>t.parentTarget()===e&&t.type()===U.FRAME&&!t.targetInfo()?.subtype?.length))||null),e}browserTarget(){return this.#N}async maybeAttachInitialTarget(){if(!Boolean(o.Runtime.Runtime.queryParam("browserConnection")))return!1;this.#N||(this.#N=new z(this,"main","browser",U.BROWSER,null,"",!1,null,void 0),this.#N.createModels(new Set(this.#O.keysArray())));const e=await a.InspectorFrontendHost.InspectorFrontendHostInstance.initialTargetId();return this.#N.targetAgent().invoke_autoAttachRelated({targetId:e,waitForDebuggerOnStart:!0}),!0}clearAllTargetsForTest(){this.#E.clear()}isInScope(e){if(!e)return!1;for(function(e){return"source"in e&&e.source instanceof h}(e)&&(e=e.source),e instanceof h&&(e=e.target());e&&e!==this.#F;)e=e.parentTarget();return Boolean(e)&&e===this.#F}setScopeTarget(e){if(e!==this.#F){for(const e of this.targets())if(this.isInScope(e)){for(const t of this.#O.keysArray()){const n=e.models().get(t);if(n)for(const e of[...this.#O.get(t)].filter((e=>this.#D.has(e))))e.modelRemoved(n)}for(const t of[...this.#L].filter((e=>this.#D.has(e))))t.targetRemoved(e)}this.#F=e;for(const e of this.targets())if(this.isInScope(e)){for(const t of[...this.#L].filter((e=>this.#D.has(e))))t.targetAdded(e);for(const[t,n]of e.models().entries())for(const e of[...this.#O.get(t)].filter((e=>this.#D.has(e))))e.modelAdded(n)}for(const e of this.#_)e();e&&e.inspectedURL()&&this.onInspectedURLChange(e)}}addScopeChangeListener(e){this.#_.add(e)}scopeTarget(){return this.#F}}var G=Object.freeze({__proto__:null,Observer:class{targetAdded(e){}targetRemoved(e){}},SDKModelObserver:class{modelAdded(e){}modelRemoved(e){}},TargetManager:W});const K={noContentForWebSocket:"Content for WebSockets is currently not supported",noContentForRedirect:"No content available because this request was redirected",noContentForPreflight:"No content available for preflight request",noThrottling:"No throttling",offline:"Offline",slowG:"3G",fastG:"Slow 4G",fast4G:"Fast 4G",requestWasBlockedByDevtoolsS:'Request was blocked by DevTools: "{PH1}"',sFailedLoadingSS:'{PH1} failed loading: {PH2} "{PH3}".',sFinishedLoadingSS:'{PH1} finished loading: {PH2} "{PH3}".',directSocketStatusOpening:"Opening",directSocketStatusOpen:"Open",directSocketStatusClosed:"Closed",directSocketStatusAborted:"Aborted"},Q=n.i18n.registerUIStrings("core/sdk/NetworkManager.ts",K),$=n.i18n.getLocalizedString.bind(void 0,Q),X=n.i18n.getLazilyComputedLocalizedString.bind(void 0,Q),J=new WeakMap,Y=new Map([["2g","cellular2g"],["3g","cellular3g"],["4g","cellular4g"],["bluetooth","bluetooth"],["wifi","wifi"],["wimax","wimax"]]);class Z extends h{dispatcher;fetchDispatcher;#H;#U;constructor(t){super(t),this.dispatcher=new le(this),this.fetchDispatcher=new ae(t.fetchAgent(),this),this.#H=t.networkAgent(),t.registerNetworkDispatcher(this.dispatcher),t.registerFetchDispatcher(this.fetchDispatcher),e.Settings.Settings.instance().moduleSetting("cache-disabled").get()&&this.#H.invoke_setCacheDisabled({cacheDisabled:!0}),o.Runtime.hostConfig.devToolsPrivacyUI?.enabled&&!0!==o.Runtime.hostConfig.thirdPartyCookieControls?.managedBlockThirdPartyCookies&&(e.Settings.Settings.instance().createSetting("cookie-control-override-enabled",void 0).get()||e.Settings.Settings.instance().createSetting("grace-period-mitigation-disabled",void 0).get()||e.Settings.Settings.instance().createSetting("heuristic-mitigation-disabled",void 0).get())&&this.cookieControlFlagsSettingChanged(),this.#H.invoke_enable({maxPostDataSize:oe}),this.#H.invoke_setAttachDebugStack({enabled:!0}),this.#U=e.Settings.Settings.instance().createSetting("bypass-service-worker",!1),this.#U.get()&&this.bypassServiceWorkerChanged(),this.#U.addChangeListener(this.bypassServiceWorkerChanged,this),e.Settings.Settings.instance().moduleSetting("cache-disabled").addChangeListener(this.cacheDisabledSettingChanged,this),e.Settings.Settings.instance().createSetting("cookie-control-override-enabled",void 0).addChangeListener(this.cookieControlFlagsSettingChanged,this),e.Settings.Settings.instance().createSetting("grace-period-mitigation-disabled",void 0).addChangeListener(this.cookieControlFlagsSettingChanged,this),e.Settings.Settings.instance().createSetting("heuristic-mitigation-disabled",void 0).addChangeListener(this.cookieControlFlagsSettingChanged,this)}static forRequest(e){return J.get(e)||null}static canReplayRequest(t){return Boolean(J.get(t))&&Boolean(t.backendRequestId())&&!t.isRedirect()&&t.resourceType()===e.ResourceType.resourceTypes.XHR}static replayRequest(e){const t=J.get(e),n=e.backendRequestId();t&&n&&!e.isRedirect()&&t.#H.invoke_replayXHR({requestId:n})}static async searchInRequest(e,n,r,s){const i=Z.forRequest(e),o=e.backendRequestId();if(!i||!o||e.isRedirect())return[];const a=await i.#H.invoke_searchInResponseBody({requestId:o,query:n,caseSensitive:r,isRegex:s});return t.TextUtils.performSearchInSearchMatches(a.result||[],n,r,s)}static async requestContentData(n){if(n.resourceType()===e.ResourceType.resourceTypes.WebSocket)return{error:$(K.noContentForWebSocket)};if(n.finished||await n.once(Ti.FINISHED_LOADING),n.isRedirect())return{error:$(K.noContentForRedirect)};if(n.isPreflightRequest())return{error:$(K.noContentForPreflight)};const r=Z.forRequest(n);if(!r)return{error:"No network manager for request"};const s=n.backendRequestId();if(!s)return{error:"No backend request id for request"};const i=await r.#H.invoke_getResponseBody({requestId:s}),o=i.getError();return o?{error:o}:new t.ContentData.ContentData(i.body,i.base64Encoded,n.mimeType,n.charset()??void 0)}static async streamResponseBody(e){if(e.finished)return{error:"Streaming the response body is only available for in-flight requests."};const n=Z.forRequest(e);if(!n)return{error:"No network manager for request"};const r=e.backendRequestId();if(!r)return{error:"No backend request id for request"};const s=await n.#H.invoke_streamResourceContent({requestId:r}),i=s.getError();return i?{error:i}:(await e.waitForResponseReceived(),new t.ContentData.ContentData(s.bufferedData,!0,e.mimeType,e.charset()??void 0))}static async requestPostData(e){const t=Z.forRequest(e);if(!t)return console.error("No network manager for request"),null;const n=e.backendRequestId();if(!n)return console.error("No backend request id for request"),null;try{const{postData:e}=await t.#H.invoke_getRequestPostData({requestId:n});return e}catch(e){return e.message}}static connectionType(e){if(!e.download&&!e.upload)return"none";try{const t="function"==typeof e.title?e.title().toLowerCase():e.title.toLowerCase();for(const[e,n]of Y)if(t.includes(e))return n}catch{return"none"}return"other"}static lowercaseHeaders(e){const t={};for(const n in e)t[n.toLowerCase()]=e[n];return t}requestForURL(e){return this.dispatcher.requestForURL(e)}requestForId(e){return this.dispatcher.requestForId(e)}requestForLoaderId(e){return this.dispatcher.requestForLoaderId(e)}cacheDisabledSettingChanged({data:e}){this.#H.invoke_setCacheDisabled({cacheDisabled:e})}cookieControlFlagsSettingChanged(){const t=Boolean(e.Settings.Settings.instance().createSetting("cookie-control-override-enabled",void 0).get()),n=!!t&&Boolean(e.Settings.Settings.instance().createSetting("grace-period-mitigation-disabled",void 0).get()),r=!!t&&Boolean(e.Settings.Settings.instance().createSetting("heuristic-mitigation-disabled",void 0).get());this.#H.invoke_setCookieControls({enableThirdPartyCookieRestriction:t,disableThirdPartyCookieMetadata:n,disableThirdPartyCookieHeuristics:r})}dispose(){e.Settings.Settings.instance().moduleSetting("cache-disabled").removeChangeListener(this.cacheDisabledSettingChanged,this)}bypassServiceWorkerChanged(){this.#H.invoke_setBypassServiceWorker({bypass:this.#U.get()})}async getSecurityIsolationStatus(e){const t=await this.#H.invoke_getSecurityIsolationStatus({frameId:e??void 0});return t.getError()?null:t.status}async enableReportingApi(e=!0){return await this.#H.invoke_enableReportingApi({enable:e})}async loadNetworkResource(e,t,n){const r=await this.#H.invoke_loadNetworkResource({frameId:e??void 0,url:t,options:n});if(r.getError())throw new Error(r.getError());return r.resource}clearRequests(){this.dispatcher.clearRequests()}}var ee;!function(e){e.RequestStarted="RequestStarted",e.RequestUpdated="RequestUpdated",e.RequestFinished="RequestFinished",e.RequestUpdateDropped="RequestUpdateDropped",e.ResponseReceived="ResponseReceived",e.MessageGenerated="MessageGenerated",e.RequestRedirected="RequestRedirected",e.LoadingFinished="LoadingFinished",e.ReportingApiReportAdded="ReportingApiReportAdded",e.ReportingApiReportUpdated="ReportingApiReportUpdated",e.ReportingApiEndpointsChangedForOrigin="ReportingApiEndpointsChangedForOrigin"}(ee||(ee={}));const te={title:X(K.noThrottling),i18nTitleKey:K.noThrottling,download:-1,upload:-1,latency:0},ne={title:X(K.offline),i18nTitleKey:K.offline,download:0,upload:0,latency:0},re={title:X(K.slowG),i18nTitleKey:K.slowG,download:5e4,upload:5e4,latency:2e3,targetLatency:400},se={title:X(K.fastG),i18nTitleKey:K.fastG,download:18e4,upload:84375,latency:562.5,targetLatency:150},ie={title:X(K.fast4G),i18nTitleKey:K.fast4G,download:1012500,upload:168750,latency:165,targetLatency:60},oe=65536;class ae{#q;#z;constructor(e,t){this.#q=e,this.#z=t}requestPaused({requestId:e,request:t,resourceType:n,responseStatusCode:r,responseHeaders:s,networkId:i}){const o=i?this.#z.requestForId(i):null;0===o?.originalResponseHeaders.length&&s&&(o.originalResponseHeaders=s),ce.instance().requestIntercepted(new he(this.#q,t,n,e,o,r,s))}authRequired({}){}}class le{#z;#j=new Map;#V=new Map;#W=new Map;#G=new Map;#K=new Map;constructor(e){this.#z=e,ce.instance().addEventListener("RequestIntercepted",this.#Q.bind(this))}#Q(e){const t=this.requestForId(e.data);t&&t.setWasIntercepted(!0)}headersMapToHeadersArray(e){const t=[];for(const n in e){const r=e[n].split("\n");for(let e=0;e=0&&t.setTransferSize(n.encodedDataLength),n.requestHeaders&&!t.hasExtraRequestInfo()&&(t.setRequestHeaders(this.headersMapToHeadersArray(n.requestHeaders)),t.setRequestHeadersText(n.requestHeadersText||"")),t.connectionReused=n.connectionReused,t.connectionId=String(n.connectionId),n.remoteIPAddress&&t.setRemoteAddress(n.remoteIPAddress,n.remotePort||-1),n.fromServiceWorker&&(t.fetchedViaServiceWorker=!0),n.fromDiskCache&&t.setFromDiskCache(),n.fromPrefetchCache&&t.setFromPrefetchCache(),n.fromEarlyHints&&t.setFromEarlyHints(),n.cacheStorageCacheName&&t.setResponseCacheStorageCacheName(n.cacheStorageCacheName),n.serviceWorkerRouterInfo&&(t.serviceWorkerRouterInfo=n.serviceWorkerRouterInfo),n.responseTime&&t.setResponseRetrievalTime(new Date(n.responseTime)),t.timing=n.timing,t.protocol=n.protocol||"",t.alternateProtocolUsage=n.alternateProtocolUsage,n.serviceWorkerResponseSource&&t.setServiceWorkerResponseSource(n.serviceWorkerResponseSource),t.setSecurityState(n.securityState),n.securityDetails&&t.setSecurityDetails(n.securityDetails);const r=e.ResourceType.ResourceType.fromMimeTypeOverride(t.mimeType);r&&t.setResourceType(r),t.responseReceivedPromiseResolve?t.responseReceivedPromiseResolve():t.responseReceivedPromise=Promise.resolve()}requestForId(e){return this.#j.get(e)||null}requestForURL(e){return this.#V.get(e)||null}requestForLoaderId(e){return this.#W.get(e)||null}resourceChangedPriority({requestId:e,newPriority:t}){const n=this.#j.get(e);n&&n.setPriority(t)}signedExchangeReceived({requestId:t,info:n}){let r=this.#j.get(t);(r||(r=this.#V.get(n.outerResponse.url),r))&&(r.setSignedExchangeInfo(n),r.setResourceType(e.ResourceType.resourceTypes.SignedExchange),this.updateNetworkRequestWithResponse(r,n.outerResponse),this.updateNetworkRequest(r),this.#z.dispatchEventToListeners(ee.ResponseReceived,{request:r,response:n.outerResponse}))}requestWillBeSent({requestId:t,loaderId:n,documentURL:r,request:s,timestamp:i,wallTime:o,initiator:a,redirectResponse:l,type:d,frameId:c,hasUserGesture:h}){let u=this.#j.get(t);if(u){if(!l)return;u.signedExchangeInfo()||this.responseReceived({requestId:t,loaderId:n,timestamp:i,type:d||"Other",response:l,hasExtraInfo:!1,frameId:c}),u=this.appendRedirect(t,i,s.url),this.#z.dispatchEventToListeners(ee.RequestRedirected,u)}else u=Ri.create(t,s.url,r,c??null,n,a,h),J.set(u,this.#z);u.hasNetworkData=!0,this.updateNetworkRequestWithRequest(u,s),u.setIssueTime(i,o),u.setResourceType(d?e.ResourceType.resourceTypes[d]:e.ResourceType.resourceTypes.Other),s.trustTokenParams&&u.setTrustTokenParams(s.trustTokenParams);const g=this.#K.get(t);g&&(u.setTrustTokenOperationDoneEvent(g),this.#K.delete(t)),this.getExtraInfoBuilder(t).addRequest(u),this.startNetworkRequest(u,s)}requestServedFromCache({requestId:e}){const t=this.#j.get(e);t&&t.setFromMemoryCache()}responseReceived({requestId:t,loaderId:n,timestamp:r,type:s,response:i,frameId:o}){const a=this.#j.get(t),l=Z.lowercaseHeaders(i.headers);if(a)a.responseReceivedTime=r,a.setResourceType(e.ResourceType.resourceTypes[s]),this.updateNetworkRequestWithResponse(a,i),this.updateNetworkRequest(a),this.#z.dispatchEventToListeners(ee.ResponseReceived,{request:a,response:i});else{const e=l["last-modified"],t={url:i.url,frameId:o??null,loaderId:n,resourceType:s,mimeType:i.mimeType,lastModified:e?new Date(e):null};this.#z.dispatchEventToListeners(ee.RequestUpdateDropped,t)}}dataReceived(e){let t=this.#j.get(e.requestId);t||(t=this.maybeAdoptMainResourceRequest(e.requestId)),t&&(t.addDataReceivedEvent(e),this.updateNetworkRequest(t))}loadingFinished({requestId:e,timestamp:t,encodedDataLength:n}){let r=this.#j.get(e);r||(r=this.maybeAdoptMainResourceRequest(e)),r&&(this.getExtraInfoBuilder(e).finished(),this.finishNetworkRequest(r,t,n),this.#z.dispatchEventToListeners(ee.LoadingFinished,r))}loadingFailed({requestId:t,timestamp:n,type:r,errorText:s,canceled:i,blockedReason:o,corsErrorStatus:a}){const l=this.#j.get(t);if(l){if(l.failed=!0,l.setResourceType(e.ResourceType.resourceTypes[r]),l.canceled=Boolean(i),o&&(l.setBlockedReason(o),"inspector"===o)){const e=$(K.requestWasBlockedByDevtoolsS,{PH1:l.url()});this.#z.dispatchEventToListeners(ee.MessageGenerated,{message:e,requestId:t,warning:!0})}a&&l.setCorsErrorStatus(a),l.localizedFailDescription=s,this.getExtraInfoBuilder(t).finished(),this.finishNetworkRequest(l,n,-1)}}webSocketCreated({requestId:t,url:n,initiator:r}){const s=Ri.createForWebSocket(t,n,r);J.set(s,this.#z),s.setResourceType(e.ResourceType.resourceTypes.WebSocket),this.startNetworkRequest(s,null)}webSocketWillSendHandshakeRequest({requestId:e,timestamp:t,wallTime:n,request:r}){const s=this.#j.get(e);s&&(s.requestMethod="GET",s.setRequestHeaders(this.headersMapToHeadersArray(r.headers)),s.setIssueTime(t,n),this.updateNetworkRequest(s))}webSocketHandshakeResponseReceived({requestId:e,timestamp:t,response:n}){const r=this.#j.get(e);r&&(r.statusCode=n.status,r.statusText=n.statusText,r.responseHeaders=this.headersMapToHeadersArray(n.headers),r.responseHeadersText=n.headersText||"",n.requestHeaders&&r.setRequestHeaders(this.headersMapToHeadersArray(n.requestHeaders)),n.requestHeadersText&&r.setRequestHeadersText(n.requestHeadersText),r.responseReceivedTime=t,r.protocol="websocket",this.updateNetworkRequest(r))}webSocketFrameReceived({requestId:e,timestamp:t,response:n}){const r=this.#j.get(e);r&&(r.addProtocolFrame(n,t,!1),r.responseReceivedTime=t,this.updateNetworkRequest(r))}webSocketFrameSent({requestId:e,timestamp:t,response:n}){const r=this.#j.get(e);r&&(r.addProtocolFrame(n,t,!0),r.responseReceivedTime=t,this.updateNetworkRequest(r))}webSocketFrameError({requestId:e,timestamp:t,errorMessage:n}){const r=this.#j.get(e);r&&(r.addProtocolFrameError(n,t),r.responseReceivedTime=t,this.updateNetworkRequest(r))}webSocketClosed({requestId:e,timestamp:t}){const n=this.#j.get(e);n&&this.finishNetworkRequest(n,t,-1)}eventSourceMessageReceived({requestId:e,timestamp:t,eventName:n,eventId:r,data:s}){const i=this.#j.get(e);i&&i.addEventSourceMessage(t,n,r,s)}requestIntercepted({}){}requestWillBeSentExtraInfo({requestId:e,associatedCookies:t,headers:n,clientSecurityState:r,connectTiming:s,siteHasCookieInOtherPartition:i}){const o=[],a=[];for(const{blockedReasons:e,exemptionReason:n,cookie:r}of t)0===e.length?a.push({exemptionReason:n,cookie:H.fromProtocolCookie(r)}):o.push({blockedReasons:e,cookie:H.fromProtocolCookie(r)});const l={blockedRequestCookies:o,includedRequestCookies:a,requestHeaders:this.headersMapToHeadersArray(n),clientSecurityState:r,connectTiming:s,siteHasCookieInOtherPartition:i};this.getExtraInfoBuilder(e).addRequestExtraInfo(l)}responseReceivedEarlyHints({requestId:e,headers:t}){this.getExtraInfoBuilder(e).setEarlyHintsHeaders(this.headersMapToHeadersArray(t))}responseReceivedExtraInfo({requestId:e,blockedCookies:t,headers:n,headersText:r,resourceIPAddressSpace:s,statusCode:i,cookiePartitionKey:o,cookiePartitionKeyOpaque:a,exemptedCookies:l}){const d={blockedResponseCookies:t.map((e=>({blockedReasons:e.blockedReasons,cookieLine:e.cookieLine,cookie:e.cookie?H.fromProtocolCookie(e.cookie):null}))),responseHeaders:this.headersMapToHeadersArray(n),responseHeadersText:r,resourceIPAddressSpace:s,statusCode:i,cookiePartitionKey:o,cookiePartitionKeyOpaque:a,exemptedResponseCookies:l?.map((e=>({cookie:H.fromProtocolCookie(e.cookie),cookieLine:e.cookieLine,exemptionReason:e.exemptionReason})))};this.getExtraInfoBuilder(e).addResponseExtraInfo(d)}getExtraInfoBuilder(e){let t;return this.#G.has(e)?t=this.#G.get(e):(t=new ue,this.#G.set(e,t)),t}appendRedirect(e,t,n){const r=this.#j.get(e);if(!r)throw new Error(`Could not find original network request for ${e}`);let s=0;for(let e=r.redirectSource();e;e=e.redirectSource())s++;r.markAsRedirect(s),this.finishNetworkRequest(r,t,-1);const i=Ri.create(e,n,r.documentURL,r.frameId,r.loaderId,r.initiator(),r.hasUserGesture()??void 0);return J.set(i,this.#z),i.setRedirectSource(r),r.setRedirectDestination(i),i}maybeAdoptMainResourceRequest(e){const t=ce.instance().inflightMainResourceRequests.get(e);if(!t)return null;const n=Z.forRequest(t).dispatcher;n.#j.delete(e),n.#V.delete(t.url());const r=t.loaderId;r&&n.#W.delete(r);const s=n.#G.get(e);return n.#G.delete(e),this.#j.set(e,t),this.#V.set(t.url(),t),r&&this.#W.set(r,t),s&&this.#G.set(e,s),J.set(t,this.#z),t}startNetworkRequest(e,t){this.#j.set(e.requestId(),e),this.#V.set(e.url(),e);const n=e.loaderId;n&&this.#W.set(n,e),e.loaderId!==e.requestId()&&""!==e.loaderId||ce.instance().inflightMainResourceRequests.set(e.requestId(),e),this.#z.dispatchEventToListeners(ee.RequestStarted,{request:e,originalRequest:t})}updateNetworkRequest(e){this.#z.dispatchEventToListeners(ee.RequestUpdated,e)}finishNetworkRequest(t,n,r){if(t.endTime=n,t.finished=!0,r>=0){const e=t.redirectSource();e?.signedExchangeInfo()?(t.setTransferSize(0),e.setTransferSize(r),this.updateNetworkRequest(e)):t.setTransferSize(r)}if(this.#z.dispatchEventToListeners(ee.RequestFinished,t),ce.instance().inflightMainResourceRequests.delete(t.requestId()),e.Settings.Settings.instance().moduleSetting("monitoring-xhr-enabled").get()&&t.resourceType().category()===e.ResourceType.resourceCategories.XHR){let e;const n=t.failed||t.hasErrorStatusCode();e=$(n?K.sFailedLoadingSS:K.sFinishedLoadingSS,{PH1:t.resourceType().title(),PH2:t.requestMethod,PH3:t.url()}),this.#z.dispatchEventToListeners(ee.MessageGenerated,{message:e,requestId:t.requestId(),warning:!1})}}clearRequests(){for(const[e,t]of this.#j)t.finished&&this.#j.delete(e);for(const[e,t]of this.#V)t.finished&&this.#V.delete(e);for(const[e,t]of this.#W)t.finished&&this.#W.delete(e);for(const[e,t]of this.#G)t.isFinished()&&this.#G.delete(e)}webTransportCreated({transportId:t,url:n,timestamp:r,initiator:s}){const i=Ri.createForWebSocket(t,n,s);i.hasNetworkData=!0,J.set(i,this.#z),i.setResourceType(e.ResourceType.resourceTypes.WebTransport),i.setIssueTime(r,0),this.startNetworkRequest(i,null)}webTransportConnectionEstablished({transportId:e,timestamp:t}){const n=this.#j.get(e);n&&(n.responseReceivedTime=t,n.endTime=t+.001,this.updateNetworkRequest(n))}webTransportClosed({transportId:e,timestamp:t}){const n=this.#j.get(e);n&&(n.endTime=t,this.finishNetworkRequest(n,t,0))}directTCPSocketCreated(t){const r=0===t.remotePort?t.remoteAddr:`${t.remoteAddr}:${t.remotePort}`,s=Ri.createForWebSocket(t.identifier,r,t.initiator);s.hasNetworkData=!0,s.setRemoteAddress(t.remoteAddr,t.remotePort),s.protocol=n.i18n.lockedString("tcp"),s.statusText=$(K.directSocketStatusOpening),s.directSocketInfo={type:Li.TCP,status:Ai.OPENING,createOptions:{remoteAddr:t.remoteAddr,remotePort:t.remotePort,noDelay:t.options.noDelay,keepAliveDelay:t.options.keepAliveDelay,sendBufferSize:t.options.sendBufferSize,receiveBufferSize:t.options.receiveBufferSize,dnsQueryType:t.options.dnsQueryType}},s.setResourceType(e.ResourceType.resourceTypes.DirectSocket),s.setIssueTime(t.timestamp,t.timestamp),J.set(s,this.#z),this.startNetworkRequest(s,null)}directTCPSocketOpened(e){const t=this.#j.get(e.identifier);if(!t?.directSocketInfo)return;t.responseReceivedTime=e.timestamp,t.directSocketInfo.status=Ai.OPEN,t.statusText=$(K.directSocketStatusOpen),t.directSocketInfo.openInfo={remoteAddr:e.remoteAddr,remotePort:e.remotePort,localAddr:e.localAddr,localPort:e.localPort},t.setRemoteAddress(e.remoteAddr,e.remotePort);const n=0===e.remotePort?e.remoteAddr:`${e.remoteAddr}:${e.remotePort}`;t.setUrl(n),this.updateNetworkRequest(t)}directTCPSocketAborted(e){const t=this.#j.get(e.identifier);t?.directSocketInfo&&(t.failed=!0,t.directSocketInfo.status=Ai.ABORTED,t.statusText=$(K.directSocketStatusAborted),t.directSocketInfo.errorMessage=e.errorMessage,this.finishNetworkRequest(t,e.timestamp,0))}directTCPSocketClosed(e){const t=this.#j.get(e.identifier);t?.directSocketInfo&&(t.statusText=$(K.directSocketStatusClosed),t.directSocketInfo.status=Ai.CLOSED,this.finishNetworkRequest(t,e.timestamp,0))}trustTokenOperationDone(e){const t=this.#j.get(e.requestId);t?t.setTrustTokenOperationDoneEvent(e):this.#K.set(e.requestId,e)}subresourceWebBundleMetadataReceived({requestId:e,urls:t}){const n=this.getExtraInfoBuilder(e);n.setWebBundleInfo({resourceUrls:t});const r=n.finalRequest();r&&this.updateNetworkRequest(r)}subresourceWebBundleMetadataError({requestId:e,errorMessage:t}){const n=this.getExtraInfoBuilder(e);n.setWebBundleInfo({errorMessage:t});const r=n.finalRequest();r&&this.updateNetworkRequest(r)}subresourceWebBundleInnerResponseParsed({innerRequestId:e,bundleRequestId:t}){const n=this.getExtraInfoBuilder(e);n.setWebBundleInnerRequestInfo({bundleRequestId:t});const r=n.finalRequest();r&&this.updateNetworkRequest(r)}subresourceWebBundleInnerResponseError({innerRequestId:e,errorMessage:t}){const n=this.getExtraInfoBuilder(e);n.setWebBundleInnerRequestInfo({errorMessage:t});const r=n.finalRequest();r&&this.updateNetworkRequest(r)}reportingApiReportAdded(e){this.#z.dispatchEventToListeners(ee.ReportingApiReportAdded,e.report)}reportingApiReportUpdated(e){this.#z.dispatchEventToListeners(ee.ReportingApiReportUpdated,e.report)}reportingApiEndpointsChangedForOrigin(e){this.#z.dispatchEventToListeners(ee.ReportingApiEndpointsChangedForOrigin,e)}policyUpdated(){}createNetworkRequest(e,t,n,r,s,i){const o=Ri.create(e,r,s,t,n,i);return J.set(o,this.#z),o}}let de;class ce extends e.ObjectWrapper.ObjectWrapper{#$="";#X=null;#J=null;#Y=new Set;#Z=new Set;inflightMainResourceRequests=new Map;#ee=te;#te=null;#ne=e.Settings.Settings.instance().moduleSetting("request-blocking-enabled");#re=e.Settings.Settings.instance().createSetting("network-blocked-patterns",[]);#se=[];#ie=new r.MapUtilities.Multimap;#oe;#ae;constructor(){super();const e=()=>{this.updateBlockedPatterns(),this.dispatchEventToListeners("BlockedPatternsChanged")};this.#ne.addChangeListener(e),this.#re.addChangeListener(e),this.updateBlockedPatterns(),W.instance().observeModels(Z,this)}static instance(e={forceNew:null}){const{forceNew:t}=e;return de&&!t||(de=new ce),de}static dispose(){de=null}static patchUserAgentWithChromeVersion(e){const t=o.Runtime.getChromeVersion();if(t.length>0){const n=t.split(".",1)[0]+".0.100.0";return r.StringUtilities.sprintf(e,t,n)}return e}static patchUserAgentMetadataWithChromeVersion(e){if(!e.brands)return;const t=o.Runtime.getChromeVersion();if(0===t.length)return;const n=t.split(".",1)[0];for(const t of e.brands)t.version.includes("%s")&&(t.version=r.StringUtilities.sprintf(t.version,n));e.fullVersion&&e.fullVersion.includes("%s")&&(e.fullVersion=r.StringUtilities.sprintf(e.fullVersion,t))}modelAdded(e){const t=e.target().networkAgent(),n=e.target().fetchAgent();this.#oe&&t.invoke_setExtraHTTPHeaders({headers:this.#oe}),this.currentUserAgent()&&t.invoke_setUserAgentOverride({userAgent:this.currentUserAgent(),userAgentMetadata:this.#X||void 0}),this.#se.length&&t.invoke_setBlockedURLs({urls:this.#se}),this.isIntercepting()&&n.invoke_enable({patterns:this.#ie.valuesArray()}),null===this.#J?t.invoke_clearAcceptedEncodingsOverride():t.invoke_setAcceptedEncodings({encodings:this.#J}),this.#Y.add(t),this.#Z.add(n),this.isThrottling()&&this.updateNetworkConditions(t)}modelRemoved(e){for(const t of this.inflightMainResourceRequests){Z.forRequest(t[1])===e&&this.inflightMainResourceRequests.delete(t[0])}this.#Y.delete(e.target().networkAgent()),this.#Z.delete(e.target().fetchAgent())}isThrottling(){return this.#ee.download>=0||this.#ee.upload>=0||this.#ee.latency>0}isOffline(){return!this.#ee.download&&!this.#ee.upload}setNetworkConditions(e){this.#ee=e;for(const e of this.#Y)this.updateNetworkConditions(e);this.dispatchEventToListeners("ConditionsChanged")}networkConditions(){return this.#ee}updateNetworkConditions(e){const t=this.#ee;this.isThrottling()?e.invoke_emulateNetworkConditions({offline:this.isOffline(),latency:t.latency,downloadThroughput:t.download<0?0:t.download,uploadThroughput:t.upload<0?0:t.upload,packetLoss:(t.packetLoss??0)<0?0:t.packetLoss,packetQueueLength:t.packetQueueLength,packetReordering:t.packetReordering,connectionType:Z.connectionType(t)}):e.invoke_emulateNetworkConditions({offline:!1,latency:0,downloadThroughput:0,uploadThroughput:0})}setExtraHTTPHeaders(e){this.#oe=e;for(const e of this.#Y)e.invoke_setExtraHTTPHeaders({headers:this.#oe})}currentUserAgent(){return this.#ae?this.#ae:this.#$}updateUserAgentOverride(){const e=this.currentUserAgent();for(const t of this.#Y)t.invoke_setUserAgentOverride({userAgent:e,userAgentMetadata:this.#X||void 0})}setUserAgentOverride(e,t){const n=this.#$!==e;this.#$=e,this.#ae?this.#X=null:(this.#X=t,this.updateUserAgentOverride()),n&&this.dispatchEventToListeners("UserAgentChanged")}userAgentOverride(){return this.#$}setCustomUserAgentOverride(e,t=null){this.#ae=e,this.#X=t,this.updateUserAgentOverride()}setCustomAcceptedEncodingsOverride(e){this.#J=e,this.updateAcceptedEncodingsOverride(),this.dispatchEventToListeners("AcceptedEncodingsChanged")}clearCustomAcceptedEncodingsOverride(){this.#J=null,this.updateAcceptedEncodingsOverride(),this.dispatchEventToListeners("AcceptedEncodingsChanged")}isAcceptedEncodingOverrideSet(){return null!==this.#J}updateAcceptedEncodingsOverride(){const e=this.#J;for(const t of this.#Y)null===e?t.invoke_clearAcceptedEncodingsOverride():t.invoke_setAcceptedEncodings({encodings:e})}blockedPatterns(){return this.#re.get().slice()}blockingEnabled(){return this.#ne.get()}isBlocking(){return Boolean(this.#se.length)}setBlockedPatterns(e){this.#re.set(e)}setBlockingEnabled(e){this.#ne.get()!==e&&this.#ne.set(e)}updateBlockedPatterns(){const e=[];if(this.#ne.get())for(const t of this.#re.get())t.enabled&&e.push(t.url);if(e.length||this.#se.length){this.#se=e;for(const e of this.#Y)e.invoke_setBlockedURLs({urls:this.#se})}}isIntercepting(){return Boolean(this.#ie.size)}setInterceptionHandlerForPatterns(e,t){this.#ie.deleteAll(t);for(const n of e)this.#ie.set(t,n);return this.updateInterceptionPatternsOnNextTick()}updateInterceptionPatternsOnNextTick(){return this.#te||(this.#te=Promise.resolve().then(this.updateInterceptionPatterns.bind(this))),this.#te}async updateInterceptionPatterns(){e.Settings.Settings.instance().moduleSetting("cache-disabled").get()||e.Settings.Settings.instance().moduleSetting("cache-disabled").set(!0),this.#te=null;const t=[];for(const e of this.#Z)t.push(e.invoke_enable({patterns:this.#ie.valuesArray()}));this.dispatchEventToListeners("InterceptorsChanged"),await Promise.all(t)}async requestIntercepted(e){for(const t of this.#ie.keysArray())if(await t(e),e.hasResponded()&&e.networkRequest)return void this.dispatchEventToListeners("RequestIntercepted",e.networkRequest.requestId());e.hasResponded()||e.continueRequestWithoutChange()}clearBrowserCache(){for(const e of this.#Y)e.invoke_clearBrowserCache()}clearBrowserCookies(){for(const e of this.#Y)e.invoke_clearBrowserCookies()}async getCertificate(e){const t=W.instance().primaryPageTarget();if(!t)return[];const n=await t.networkAgent().invoke_getCertificate({origin:e});return n?n.tableNames:[]}async loadResource(t){const n={},r=this.currentUserAgent();r&&(n["User-Agent"]=r),e.Settings.Settings.instance().moduleSetting("cache-disabled").get()&&(n["Cache-Control"]="no-cache");const s=e.Settings.Settings.instance().moduleSetting("network.enable-remote-file-loading").get();return await new Promise((e=>a.ResourceLoader.load(t,n,((t,n,r,s)=>{e({success:t,content:r,errorDescription:s})}),s)))}}class he{#q;#le;request;resourceType;responseStatusCode;responseHeaders;requestId;networkRequest;constructor(e,t,n,r,s,i,o){this.#q=e,this.#le=!1,this.request=t,this.resourceType=n,this.responseStatusCode=i,this.responseHeaders=o,this.requestId=r,this.networkRequest=s}hasResponded(){return this.#le}static mergeSetCookieHeaders(e,t){const n=e=>{const t=new Map;for(const n of e){const e=n.value.match(/^([a-zA-Z0-9!#$%&'*+.^_`|~-]+=)(.*)$/);e?t.has(e[1])?t.get(e[1])?.push(n.value):t.set(e[1],[n.value]):t.has(n.value)?t.get(n.value)?.push(n.value):t.set(n.value,[n.value])}return t},r=n(e),s=n(t),i=[];for(const[e,t]of r)if(s.has(e))for(const t of s.get(e)||[])i.push({name:"set-cookie",value:t});else for(const e of t)i.push({name:"set-cookie",value:e});for(const[e,t]of s)if(!r.has(e))for(const e of t)i.push({name:"set-cookie",value:e});return i}async continueRequestWithContent(t,n,r,s){this.#le=!0;const i=n?await t.text():await e.Base64.encode(t).catch((e=>(console.error(e),""))),o=s?200:this.responseStatusCode||200;if(this.networkRequest){const e=this.networkRequest?.originalResponseHeaders.filter((e=>"set-cookie"===e.name))||[],t=r.filter((e=>"set-cookie"===e.name));this.networkRequest.setCookieHeaders=he.mergeSetCookieHeaders(e,t),this.networkRequest.hasOverriddenContent=s}this.#q.invoke_fulfillRequest({requestId:this.requestId,responseCode:o,body:i,responseHeaders:r}),ce.instance().dispatchEventToListeners("RequestFulfilled",this.request.url)}continueRequestWithoutChange(){console.assert(!this.#le),this.#le=!0,this.#q.invoke_continueRequest({requestId:this.requestId})}continueRequestWithError(e){console.assert(!this.#le),this.#le=!0,this.#q.invoke_failRequest({requestId:this.requestId,errorReason:e})}async responseBody(){const e=await this.#q.invoke_getResponseBody({requestId:this.requestId}),n=e.getError();if(n)return{error:n};const{mimeType:r,charset:s}=this.getMimeTypeAndCharset();return new t.ContentData.ContentData(e.body,e.base64Encoded,r??"application/octet-stream",s??void 0)}isRedirect(){return void 0!==this.responseStatusCode&&this.responseStatusCode>=300&&this.responseStatusCode<400}getMimeTypeAndCharset(){for(const e of this.responseHeaders??[])if("content-type"===e.name.toLowerCase())return r.MimeType.parseContentType(e.value);return{mimeType:this.networkRequest?.mimeType??null,charset:this.networkRequest?.charset()??null}}}class ue{#de;#ce;#he;#ue;#ge;#pe;#me;constructor(){this.#de=[],this.#ce=[],this.#ue=[],this.#he=[],this.#ge=!1,this.#pe=null,this.#me=null}addRequest(e){this.#de.push(e),this.sync(this.#de.length-1)}addRequestExtraInfo(e){this.#ce.push(e),this.sync(this.#ce.length-1)}addResponseExtraInfo(e){this.#he.push(e),this.sync(this.#he.length-1)}setEarlyHintsHeaders(e){this.#ue=e,this.updateFinalRequest()}setWebBundleInfo(e){this.#pe=e,this.updateFinalRequest()}setWebBundleInnerRequestInfo(e){this.#me=e,this.updateFinalRequest()}finished(){this.#ge=!0,this.updateFinalRequest()}isFinished(){return this.#ge}sync(e){const t=this.#de[e];if(!t)return;const n=this.#ce[e];n&&(t.addExtraRequestInfo(n),this.#ce[e]=null);const r=this.#he[e];r&&(t.addExtraResponseInfo(r),this.#he[e]=null)}finalRequest(){return this.#ge&&this.#de[this.#de.length-1]||null}updateFinalRequest(){if(!this.#ge)return;const e=this.finalRequest();e?.setWebBundleInfo(this.#pe),e?.setWebBundleInnerRequestInfo(this.#me),e?.setEarlyHintsHeaders(this.#ue)}}h.register(Z,{capabilities:16,autostart:!0});var ge=Object.freeze({__proto__:null,ConditionsSerializer:class{stringify(e){const t=e;return JSON.stringify({...t,title:"function"==typeof t.title?t.title():t.title})}parse(e){const t=JSON.parse(e);return{...t,title:t.i18nTitleKey?X(t.i18nTitleKey):t.title}}},get Events(){return ee},Fast4GConditions:ie,FetchDispatcher:ae,InterceptedRequest:he,MultitargetNetworkManager:ce,NetworkDispatcher:le,NetworkManager:Z,NoThrottlingConditions:te,OfflineConditions:ne,Slow3GConditions:re,Slow4GConditions:se,networkConditionsEqual:function(e,t){const n=e.i18nTitleKey||("function"==typeof e.title?e.title():e.title),r=t.i18nTitleKey||("function"==typeof t.title?t.title():t.title);return t.download===e.download&&t.upload===e.upload&&t.latency===e.latency&&e.packetLoss===t.packetLoss&&e.packetQueueLength===t.packetQueueLength&&e.packetReordering===t.packetReordering&&r===n}});class pe{#fe;#be;#ye=new Map;#ve;#Ie;constructor(e){this.#fe=e.fontFamily,this.#be=e.fontVariationAxes||[],this.#ve=e.src,this.#Ie=e.fontDisplay;for(const e of this.#be)this.#ye.set(e.tag,e)}getFontFamily(){return this.#fe}getSrc(){return this.#ve}getFontDisplay(){return this.#Ie}getVariationAxisByTag(e){return this.#ye.get(e)}}var me=Object.freeze({__proto__:null,CSSFontFace:pe});class fe{text;node;name;fallback;matching;computedTextCallback;constructor(e,t,n,r,s,i){this.text=e,this.node=t,this.name=n,this.fallback=r,this.matching=s,this.computedTextCallback=i}computedText(){return this.computedTextCallback(this,this.matching)}}class be extends(kt(fe)){#we;constructor(e){super(),this.#we=e}matches(e,t){const n=e.getChild("Callee"),r=e.getChild("ArgList");if("CallExpression"!==e.name||!n||"var"!==t.ast.text(n)||!r)return null;const[s,i,...o]=Pt.children(r);if("("!==s?.name||"VariableName"!==i?.name)return null;if(o.length<=1&&")"!==o[0]?.name)return null;let a=[];if(o.length>1){if(","!==o.shift()?.name)return null;if(")"!==o.pop()?.name)return null;if(a=o,0===a.length)return null;if(a.some((e=>","===e.name)))return null}const l=t.ast.text(i);return l.startsWith("--")?new fe(t.ast.text(e),e,l,a,t,this.#we):null}}class ye extends fe{matchedStyles;style;constructor(e,t,n,r,s,i,o){super(e,t,n,r,s,(()=>this.resolveVariable()?.value??this.fallbackValue())),this.matchedStyles=i,this.style=o}resolveVariable(){return this.matchedStyles.computeCSSVariable(this.style,this.name)}fallbackValue(){return 0===this.fallback.length||this.matching.hasUnresolvedVarsRange(this.fallback[0],this.fallback[this.fallback.length-1])?null:this.matching.getComputedTextRange(this.fallback[0],this.fallback[this.fallback.length-1])}}class ve extends(kt(ye)){matchedStyles;style;constructor(e,t){super(),this.matchedStyles=e,this.style=t}matches(e,t){const n=new be((()=>null)).matches(e,t);return n?new ye(n.text,n.node,n.name,n.fallback,n.matching,this.matchedStyles,this.style):null}}class Ie{text;node;constructor(e,t){this.text=e,this.node=t}}class we extends(kt(Ie)){accepts(){return!0}matches(e,t){return"BinaryExpression"===e.name?new Ie(t.ast.text(e),e):null}}class Se{text;node;computedText;constructor(e,t){this.text=e,this.node=t,"Comment"===t.name&&(this.computedText=()=>"")}render(){const e=document.createElement("span");return e.appendChild(document.createTextNode(this.text)),[e]}}class ke extends(kt(Se)){accepts(){return!0}matches(e,t){if(!e.firstChild||"NumberLiteral"===e.name){const n=t.ast.text(e);if(n.length)return new Se(n,e)}return null}}class Ce{text;node;constructor(e,t){this.text=e,this.node=t}computedText(){return this.text}}class xe extends(kt(Ce)){accepts(e){return S().isAngleAwareProperty(e)}matches(e,t){if("NumberLiteral"!==e.name)return null;const n=e.getChild("Unit");return n&&["deg","grad","rad","turn"].includes(t.ast.text(n))?new Ce(t.ast.text(e),e):null}}function Re(e,t){if("NumberLiteral"!==e.type.name)return null;const n=t.text(e);return Number(n.substring(0,n.length-t.text(e.getChild("Unit")).length))}class Te{text;node;space;color1;color2;constructor(e,t,n,r,s){this.text=e,this.node=t,this.space=n,this.color1=r,this.color2=s}}class Me extends(kt(Te)){accepts(e){return S().isColorAwareProperty(e)}matches(e,t){if("CallExpression"!==e.name||"color-mix"!==t.ast.text(e.getChild("Callee")))return null;const n=Lt("--property",t.getComputedText(e));if(!n)return null;const r=Pt.declValue(n.tree);if(!r)return null;const s=Pt.callArgs(r);if(3!==s.length)return null;const[i,o,a]=s;if(i.length<2||"in"!==n.text(Pt.stripComments(i).next().value)||o.length<1||a.length<1)return null;const l=o.filter((e=>"NumberLiteral"===e.type.name&&"%"===n.text(e.getChild("Unit")))),d=a.filter((e=>"NumberLiteral"===e.type.name&&"%"===n.text(e.getChild("Unit"))));if(l.length>1||d.length>1)return null;if(l[0]&&d[0]&&0===(Re(l[0],n)??0)&&0===(Re(d[0],n)??0))return null;const c=Pt.callArgs(e);return 3!==c.length?null:new Te(t.ast.text(e),e,c[0],c[1],c[2])}}class Pe{url;text;node;constructor(e,t,n){this.url=e,this.text=t,this.node=n}}class Ee extends(kt(Pe)){matches(e,t){if("CallLiteral"!==e.name)return null;const n=e.getChild("CallTag");if(!n||"url"!==t.ast.text(n))return null;const[,r,s,i]=Pt.siblings(n);if("("!==t.ast.text(r)||"ParenthesizedContent"!==s.name&&"StringLiteral"!==s.name||")"!==t.ast.text(i))return null;const o=t.ast.text(s),a="StringLiteral"===s.name?o.substr(1,o.length-2):o.trim();return new Pe(a,t.ast.text(e),e)}}class Le{text;node;constructor(e,t){this.text=e,this.node=t}}class Ae extends(kt(Le)){matches(e,t){const n=t.ast.text(e);return"CallExpression"===e.name&&"linear-gradient"===t.ast.text(e.getChild("Callee"))?new Le(n,e):null}accepts(e){return["background","background-image","-webkit-mask-image"].includes(e)}}class Oe{text;node;currentColorCallback;computedText;constructor(e,t,n){this.text=e,this.node=t,this.currentColorCallback=n,this.computedText=n}}class De extends(kt(Oe)){currentColorCallback;constructor(e){super(),this.currentColorCallback=e}accepts(e){return S().isColorAwareProperty(e)}matches(t,n){const r=n.ast.text(t);if("ColorLiteral"===t.name)return new Oe(r,t);if("ValueName"===t.name){if(e.Color.Nicknames.has(r))return new Oe(r,t);if("currentcolor"===r.toLowerCase()&&this.currentColorCallback){const e=this.currentColorCallback;return new Oe(r,t,(()=>e()??r))}}if("CallExpression"===t.name){const e=t.getChild("Callee");if(e&&n.ast.text(e).match(/^(rgba?|hsla?|hwba?|lab|lch|oklab|oklch|color)$/))return new Oe(r,t)}return null}}class Ne{text;node;light;dark;style;constructor(e,t,n,r,s){this.text=e,this.node=t,this.light=n,this.dark=r,this.style=s}}class Fe extends(kt(Ne)){style;constructor(e){super(),this.style=e}accepts(e){return S().isColorAwareProperty(e)}matches(e,t){if("CallExpression"!==e.name||"light-dark"!==t.ast.text(e.getChild("Callee")))return null;const n=Pt.callArgs(e);return 2!==n.length||0===n[0].length||0===n[1].length?null:new Ne(t.ast.text(e),e,n[0],n[1],this.style)}}class Be{text;node;auto;base;constructor(e,t,n,r){this.text=e,this.node=t,this.auto=n,this.base=r}}class _e extends(kt(Be)){matches(e,t){if("CallExpression"!==e.name||"-internal-auto-base"!==t.ast.text(e.getChild("Callee")))return null;const n=Pt.callArgs(e);return 2!==n.length||0===n[0].length||0===n[1].length?null:new Be(t.ast.text(e),e,n[0],n[1])}}class He{text;node;propertyName;constructor(e,t,n){this.text=e,this.node=t,this.propertyName=n}}class Ue extends(kt(He)){static isLinkableNameProperty(e){return["animation","animation-name","font-palette","position-try-fallbacks","position-try"].includes(e)}static identifierAnimationLonghandMap=new Map(Object.entries({normal:"direction",alternate:"direction",reverse:"direction","alternate-reverse":"direction",none:"fill-mode",forwards:"fill-mode",backwards:"fill-mode",both:"fill-mode",running:"play-state",paused:"play-state",infinite:"iteration-count",linear:"easing-function",ease:"easing-function","ease-in":"easing-function","ease-out":"easing-function","ease-in-out":"easing-function",steps:"easing-function","step-start":"easing-function","step-end":"easing-function"}));matchAnimationNameInShorthand(e,t){const n=t.ast.text(e);if(!Ue.identifierAnimationLonghandMap.has(n))return new He(n,e,"animation");const r=Pt.split(Pt.siblings(Pt.declValue(t.ast.tree))).find((t=>t[0].from<=e.from&&t[t.length-1].to>=e.to));if(!r)return null;const s=Lt("--p",t.getComputedTextRange(r[0],e));if(!s)return null;const i=Ue.identifierAnimationLonghandMap.get(n);for(let t=Pt.declValue(s.tree);t?.nextSibling;t=t.nextSibling)if("ValueName"===t.name){const r=Ue.identifierAnimationLonghandMap.get(s.text(t));if(r&&r===i)return new He(n,e,"animation")}return null}accepts(e){return Ue.isLinkableNameProperty(e)}matches(e,t){const{propertyName:n}=t.ast,r=t.ast.text(e),s=e.parent;if(!s)return null;const i="Declaration"===s.name,o="ArgList"===s.name&&"Callee"===s.prevSibling?.name&&"var"===t.ast.text(s.prevSibling),a=i||o,l="position-try"===n||"position-try-fallbacks"===n;return!n||"ValueName"!==e.name&&"VariableName"!==e.name||!a||"ValueName"===e.name&&l?null:"animation"===n?this.matchAnimationNameInShorthand(e,t):new He(r,e,n)}}class qe{text;node;constructor(e,t){this.text=e,this.node=t}}class ze extends(kt(qe)){accepts(e){return S().isBezierAwareProperty(e)}matches(e,t){const n=t.ast.text(e),r="ValueName"===e.name&&b.has(n),s="CallExpression"===e.name&&["cubic-bezier","linear"].includes(t.ast.text(e.getChild("Callee")));return r||s?new qe(n,e):null}}class je{text;node;constructor(e,t){this.text=e,this.node=t}}class Ve extends(kt(je)){matches(e,t){return"StringLiteral"===e.name?new je(t.ast.text(e),e):null}}class We{text;node;shadowType;constructor(e,t,n){this.text=e,this.node=t,this.shadowType=n}}class Ge extends(kt(We)){accepts(e){return S().isShadowProperty(e)}matches(e,t){if("Declaration"!==e.name)return null;const n=Pt.siblings(Pt.declValue(e));if(0===n.length)return null;const r=t.ast.textRange(n[0],n[n.length-1]);return new We(r,e,"text-shadow"===t.ast.propertyName?"textShadow":"boxShadow")}}class Ke{text;node;constructor(e,t){this.text=e,this.node=t}}class Qe extends(kt(Ke)){accepts(e){return S().isFontAwareProperty(e)}matches(e,t){if("Declaration"!==e.name)return null;const n=Pt.siblings(Pt.declValue(e));if(0===n.length)return null;const r="font-family"===t.ast.propertyName?["ValueName","StringLiteral","Comment",","]:["Comment","ValueName","NumberLiteral"];if(n.some((e=>!r.includes(e.name))))return null;const s=t.ast.textRange(n[0],n[n.length-1]);return new Ke(s,e)}}class $e{text;node;unit;constructor(e,t,n){this.text=e,this.node=t,this.unit=n}}class Xe extends(kt($e)){static LENGTH_UNITS=new Set(["em","ex","ch","cap","ic","lh","rem","rex","rch","rlh","ric","rcap","pt","pc","in","cm","mm","Q","vw","vh","vi","vb","vmin","vmax","dvw","dvh","dvi","dvb","dvmin","dvmax","svw","svh","svi","svb","svmin","svmax","lvw","lvh","lvi","lvb","lvmin","lvmax","cqw","cqh","cqi","cqb","cqmin","cqmax","cqem","cqlh","cqex","cqch"]);matches(e,t){if("NumberLiteral"!==e.name)return null;const n=t.ast.text(e.getChild("Unit"));if(!Xe.LENGTH_UNITS.has(n))return null;const r=t.ast.text(e);return new $e(r,e,n)}}class Je{text;node;func;args;constructor(e,t,n,r){this.text=e,this.node=t,this.func=n,this.args=r}}class Ye extends(kt(Je)){matches(e,t){if("CallExpression"!==e.name)return null;const n=t.ast.text(e.getChild("Callee"));if(!["min","max","clamp","calc"].includes(n))return null;const r=Pt.callArgs(e);if(r.some((e=>0===e.length||t.hasUnresolvedVarsRange(e[0],e[e.length-1]))))return null;const s=t.ast.text(e);return new Je(s,e,n,r)}}class Ze{text;node;isFlex;constructor(e,t,n){this.text=e,this.node=t,this.isFlex=n}}class et extends(kt(Ze)){static FLEX=["flex","inline-flex","block flex","inline flex"];static GRID=["grid","inline-grid","block grid","inline grid"];accepts(e){return"display"===e}matches(e,t){if("Declaration"!==e.name)return null;const n=Pt.siblings(Pt.declValue(e));if(n.length<1)return null;const r=n.filter((e=>"Important"!==e.name)).map((e=>t.getComputedText(e).trim())).filter((e=>e)),s=r.join(" ");return et.FLEX.includes(s)?new Ze(t.ast.text(e),e,!0):et.GRID.includes(s)?new Ze(t.ast.text(e),e,!1):null}}class tt{text;node;lines;constructor(e,t,n){this.text=e,this.node=t,this.lines=n}}class nt extends(kt(tt)){accepts(e){return S().isGridAreaDefiningProperty(e)}matches(e,t){if("Declaration"!==e.name||t.hasUnresolvedVars(e))return null;const n=[];let r=[],s=!1,i=!1;const o=Pt.siblings(Pt.declValue(e));!function e(o,a=!1){for(const l of o)if(t.getMatch(l)instanceof fe){const o=Lt("--property",t.getComputedText(l));if(!o)continue;const a=Pt.siblings(Pt.declValue(o.tree));if(0===a.length)continue;"StringLiteral"===a[0].name&&!s||"LineNames"===a[0].name&&!i?(n.push(r),r=[l]):r.push(l),e(a,!0)}else"BinaryExpression"===l.name?e(Pt.siblings(l.firstChild)):"StringLiteral"===l.name?(a||(s?r.push(l):(n.push(r),r=[l])),i=!0,s=!1):"LineNames"===l.name?(a||(i?r.push(l):(n.push(r),r=[l])),s=!i,i=!i):a||r.push(l)}(o),n.push(r);const a=t.ast.textRange(o[0],o[o.length-1]);return new tt(a,e,n.filter((e=>e.length>0)))}}class rt{text;node;functionName;constructor(e,t,n){this.text=e,this.node=t,this.functionName=n}}class st extends(kt(rt)){anchorFunction(e,t){if("CallExpression"!==e.name)return null;const n=t.ast.text(e.getChild("Callee"));return"anchor"===n||"anchor-size"===n?n:null}matches(e,t){if("VariableName"===e.name){let n=e.parent;return n&&"ArgList"===n.name?(n=n.parent,n&&this.anchorFunction(n,t)?new rt(t.ast.text(e),e,null):null):null}const n=this.anchorFunction(e,t);if(!n)return null;const r=Pt.children(e.getChild("ArgList"));return"anchor"===n&&r.length<=2||r.find((e=>"VariableName"===e.name))?null:new rt(t.ast.text(e),e,n)}}class it{text;matching;node;constructor(e,t,n){this.text=e,this.matching=t,this.node=n}}class ot extends(kt(it)){accepts(e){return"position-anchor"===e}matches(e,t){if("VariableName"!==e.name)return null;const n=t.ast.text(e);return new it(n,t,e)}}class at{text;node;property;matchedStyles;constructor(e,t,n,r){this.text=e,this.node=t,this.property=n,this.matchedStyles=r}resolveProperty(){return this.matchedStyles.resolveGlobalKeyword(this.property,this.text)}computedText(){return this.resolveProperty()?.value??null}}class lt extends(kt(at)){property;matchedStyles;constructor(e,t){super(),this.property=e,this.matchedStyles=t}matches(e,t){const n=e.parent;if("ValueName"!==e.name||"Declaration"!==n?.name)return null;if(Array.from(Pt.stripComments(Pt.siblings(Pt.declValue(n)))).some((t=>!Pt.equals(t,e))))return null;const r=t.ast.text(e);return f.isCSSWideKeyword(r)?new at(r,e,this.property,this.matchedStyles):null}}class dt{text;node;preamble;fallbacks;constructor(e,t,n,r){this.text=e,this.node=t,this.preamble=n,this.fallbacks=r}}class ct extends(kt(dt)){accepts(e){return"position-try"===e||"position-try-fallbacks"===e}matches(e,t){if("Declaration"!==e.name)return null;let n=[];const r=Pt.siblings(Pt.declValue(e)),s=Pt.split(r);if("position-try"===t.ast.propertyName)for(const[e,r]of s[0].entries()){const i=t.getComputedText(r);if(f.isCSSWideKeyword(i))return null;if(f.isPositionTryOrderKeyword(i)){n=s[0].splice(0,e+1);break}}const i=t.ast.textRange(r[0],r[r.length-1]);return new dt(i,e,n,s)}}var ht=Object.freeze({__proto__:null,AnchorFunctionMatch:rt,AnchorFunctionMatcher:st,AngleMatch:Ce,AngleMatcher:xe,AutoBaseMatch:Be,AutoBaseMatcher:_e,BaseVariableMatch:fe,BaseVariableMatcher:be,BezierMatch:qe,BezierMatcher:ze,BinOpMatch:Ie,BinOpMatcher:we,CSSWideKeywordMatch:at,CSSWideKeywordMatcher:lt,ColorMatch:Oe,ColorMatcher:De,ColorMixMatch:Te,ColorMixMatcher:Me,FlexGridMatch:Ze,FlexGridMatcher:et,FontMatch:Ke,FontMatcher:Qe,GridTemplateMatch:tt,GridTemplateMatcher:nt,LengthMatch:$e,LengthMatcher:Xe,LightDarkColorMatch:Ne,LightDarkColorMatcher:Fe,LinearGradientMatch:Le,LinearGradientMatcher:Ae,LinkableNameMatch:He,LinkableNameMatcher:Ue,MathFunctionMatch:Je,MathFunctionMatcher:Ye,PositionAnchorMatch:it,PositionAnchorMatcher:ot,PositionTryMatch:dt,PositionTryMatcher:ct,ShadowMatch:We,ShadowMatcher:Ge,StringMatch:je,StringMatcher:Ve,TextMatch:Se,TextMatcher:ke,URLMatch:Pe,URLMatcher:Ee,VariableMatch:ye,VariableMatcher:ve});const ut=new Set(["inherit","initial","unset"]),gt=/[\x20-\x7E]{4}/,pt=new RegExp(`(?:'(${gt.source})')|(?:"(${gt.source})")\\s+(${/[+-]?(?:\d*\.)?\d+(?:[eE]\d+)?/.source})`);const mt=/^"(.+)"|'(.+)'$/;function ft(e){return e.split(",").map((e=>e.trim()))}function bt(e){return e.replaceAll(/(\/\*(?:.|\s)*?\*\/)/g,"")}const yt=d.css.cssLanguage.parser;function vt(e,t){return It(e,e,t)}function It(e,t,n){return n.substring(e.from,t.to)}class wt{propertyValue;rule;tree;trailingNodes;propertyName;constructor(e,t,n,r,s=[]){this.propertyName=r,this.propertyValue=e,this.rule=t,this.tree=n,this.trailingNodes=s}text(e){return null===e?"":vt(e??this.tree,this.rule)}textRange(e,t){return It(e,t,this.rule)}subtree(e){return new wt(this.propertyValue,this.rule,e)}}class St{ast;constructor(e){this.ast=e}static walkExcludingSuccessors(e,...t){const n=new this(e,...t);return"Declaration"===e.tree.name?n.iterateDeclaration(e.tree):n.iterateExcludingSuccessors(e.tree),n}static walk(e,...t){const n=new this(e,...t);return"Declaration"===e.tree.name?n.iterateDeclaration(e.tree):n.iterate(e.tree),n}iterateDeclaration(e){if("Declaration"===e.name){if(this.enter(e))for(const t of Pt.siblings(Pt.declValue(e)))t.cursor().iterate(this.enter.bind(this),this.leave.bind(this));this.leave(e)}}iterate(e){for(const t of Pt.siblings(e))t.cursor().iterate(this.enter.bind(this),this.leave.bind(this))}iterateExcludingSuccessors(e){e.cursor().iterate(this.enter.bind(this),this.leave.bind(this))}enter(e){return!0}leave(e){}}function kt(e){return class{matchType=e;accepts(e){return!0}matches(e,t){return null}}}class Ct extends St{#Se=[];#ke=new Map;computedText;#Ce(e){return`${e.from}:${e.to}`}constructor(e,t){super(e),this.computedText=new Rt(e.rule.substring(e.tree.from)),this.#Se.push(...t.filter((t=>!e.propertyName||t.accepts(e.propertyName)))),this.#Se.push(new ke)}leave({node:e}){for(const t of this.#Se){const n=t.matches(e,this);if(n){this.computedText.push(n,e.from-this.ast.tree.from),this.#ke.set(this.#Ce(e),n);break}}}matchText(e){const t=this.#Se.splice(0);this.#Se.push(new ke),this.iterateExcludingSuccessors(e),this.#Se.push(...t)}hasMatches(...e){return Boolean(this.#ke.values().find((t=>e.some((e=>t instanceof e)))))}getMatch(e){return this.#ke.get(this.#Ce(e))}hasUnresolvedVars(e){return this.hasUnresolvedVarsRange(e,e)}hasUnresolvedVarsRange(e,t){return this.computedText.hasUnresolvedVars(e.from-this.ast.tree.from,t.to-this.ast.tree.from)}getComputedText(e,t){return this.getComputedTextRange(e,e,t)}getComputedPropertyValueText(){const[e,t]=Pt.range(Pt.siblings(Pt.declValue(this.ast.tree)));return this.getComputedTextRange(e??this.ast.tree,t??this.ast.tree)}getComputedTextRange(e,t,n){return this.computedText.get(e.from-this.ast.tree.from,t.to-this.ast.tree.from,n)}}class xt{match;offset;#xe=null;constructor(e,t){this.match=e,this.offset=t}get end(){return this.offset+this.length}get length(){return this.match.text.length}get computedText(){return null===this.#xe&&(this.#xe=this.match.computedText()),this.#xe}}class Rt{#Re=[];text;#Te=!0;constructor(e){this.text=e}clear(){this.#Re.splice(0)}get chunkCount(){return this.#Re.length}#Me(){this.#Te||(this.#Re.sort(((e,t)=>e.offsett.end?-1:e.end=this.text.length)return;const n=new xt(e,t);n.end>this.text.length||(this.#Te=!1,this.#Re.push(n))}*#Pe(e,t){this.#Me();let n=this.#Re.findIndex((t=>t.offset>=e));for(;n>=0&&ne&&et)n++;else for(yield this.#Re[n],e=this.#Re[n].end;e=n.end&&(yield n),e=n.end}if(e{if("string"==typeof e)return e;const t=n?.get(e.match);return t?s(t):e.computedText??e.match.text};for(const n of this.#Ee(e,t)){const e=s(n);0!==e.length&&(r.length>0&&Tt(r[r.length-1],e)&&r.push(" "),r.push(e))}return r.join("")}}function Tt(e,t){const n=Array.isArray(e)?e.findLast((e=>e.textContent))?.textContent:e,r=Array.isArray(t)?t.find((e=>e.textContent))?.textContent:t,s=n?n[n.length-1]:"",i=r?r[0]:"";return!(/\s/.test(s)||/\s/.test(i)||["","(","{","}",";","["].includes(s)||["","(",")",",",":","*","{",";","]"].includes(i))}const Mt=Map;var Pt;function Et(e){return yt.parse(e).topNode.getChild("RuleSet")?.getChild("Block")?.getChild("Declaration")??null}function Lt(e,t){const n=At(e);if(!n)return null;const r=`*{${n}: ${t};}`,s=Et(r);if(!s||s.type.isError)return null;const i=Pt.children(s);if(i.length<2)return null;const[o,a,l]=i;if(!o||o.type.isError||!a||a.type.isError||l?.type.isError)return null;const d=Pt.siblings(s).slice(1),[c,h]=d.splice(d.length-2,2);if(";"!==c?.name&&"}"!==h?.name)return null;const u=new wt(t,r,s,n,d);return u.text(o)!==n||":"!==a.name?null:u}function At(e){const t=`*{${e}: inherit;}`,n=Et(t);if(!n||n.type.isError)return null;const r=n.getChild("PropertyName")??n.getChild("VariableName");return r?vt(r,t):null}function Ot(e,t,n){const r=Lt(e,t),s=r&&Ct.walk(r,n);return r?.trailingNodes.forEach((e=>s?.matchText(e))),s}!function(e){function t(e){const t=[];for(;e;)t.push(e),e=e.nextSibling;return t}function n(e){return t(e?.firstChild??null)}function r(e){const t=[];let n=[];for(const r of e)","===r.name?(t.push(n),n=[]):n.push(r);return t.push(n),t}e.siblings=t,e.children=n,e.range=function(e){return[e[0],e[e.length-1]]},e.declValue=function(e){return"Declaration"!==e.name?null:n(e).find((e=>":"===e.name))?.nextSibling??null},e.stripComments=function*(e){for(const t of e)"Comment"!==t.type.name&&(yield t)},e.split=r,e.callArgs=function(e){const t=n(e.getChild("ArgList")),s=t.splice(0,1)[0],i=t.pop();return"("!==s?.name||")"!==i?.name?[]:r(t)},e.equals=function(e,t){return e.name===t.name&&e.from===t.from&&e.to===t.to}}(Pt||(Pt={}));class Dt extends St{#Le=null;#Ae;constructor(e,t){super(e),this.#Ae=t}enter({node:e}){return!this.#Le&&(!this.#Ae(e)||(this.#Le=this.#Le??e,!1))}static find(e,t){return Dt.walk(e,t).#Le}static findAll(e,t){const n=[];return Dt.walk(e,(e=>(t(e)&&n.push(e),!1))),n}}var Nt=Object.freeze({__proto__:null,get ASTUtils(){return Pt},BottomUpTreeMatching:Ct,CSSControlMap:Mt,ComputedText:Rt,SyntaxTree:wt,TreeSearch:Dt,TreeWalker:St,matchDeclaration:Ot,matcherBase:kt,parseFontFamily:function(e){if(ut.has(e.trim()))return[];const t=[];for(const n of ft(bt(e))){const e=n.match(mt);e?t.push(e[1]||e[2]):t.push(n)}return t},parseFontVariationSettings:function(e){if(ut.has(e.trim())||"normal"===e.trim())return[];const t=[];for(const n of ft(bt(e))){const e=n.match(pt);e&&t.push({tag:e[1]||e[2],value:parseFloat(e[3])})}return t},requiresSpace:Tt,splitByComma:ft,stripComments:bt,tokenizeDeclaration:Lt,tokenizePropertyName:At});class Ft extends e.ObjectWrapper.ObjectWrapper{ownerStyle;index;name;value;important;disabled;parsedOk;implicit;text;range;#Oe;#De;#Ne;#Fe;#Be=[];constructor(e,n,r,s,i,o,a,l,d,c,h){if(super(),this.ownerStyle=e,this.index=n,this.name=r,this.value=s,this.important=i,this.disabled=o,this.parsedOk=a,this.implicit=l,this.text=d,this.range=c?t.TextRange.TextRange.fromObject(c):null,this.#Oe=!0,this.#De=null,this.#Ne=null,h&&h.length>0)for(const t of h)this.#Be.push(new Ft(e,++n,t.name,t.value,i,o,a,!0));else{const t=S().getLonghands(r);for(const r of t||[])this.#Be.push(new Ft(e,++n,r,"",i,o,a,!0))}}static parsePayload(e,t,n){return new Ft(e,t,n.name,n.value,n.important||!1,n.disabled||!1,!("parsedOk"in n)||Boolean(n.parsedOk),Boolean(n.implicit),n.text,n.range,n.longhandProperties)}parseExpression(e,t,n){return this.parsedOk?Ot(this.name,e,this.#Se(t,n)):null}parseValue(e,t){return this.parsedOk?Ot(this.name,this.value,this.#Se(e,t)):null}#Se(e,t){const n=e.propertyMatchers(this.ownerStyle,t);return n.push(new lt(this,e)),o.Runtime.experiments.isEnabled("font-editor")&&n.push(new Qe),n}ensureRanges(){if(this.#De&&this.#Ne)return;const e=this.range,n=this.text?new t.Text.Text(this.text):null;if(!e||!n)return;const r=n.value().indexOf(this.name),s=n.value().lastIndexOf(this.value);if(-1===r||-1===s||r>s)return;const i=new t.TextRange.SourceRange(r,this.name.length),o=new t.TextRange.SourceRange(s,this.value.length);function a(e,t,n){return 0===e.startLine&&(e.startColumn+=n,e.endColumn+=n),e.startLine+=t,e.endLine+=t,e}this.#De=a(n.toTextRange(i),e.startLine,e.startColumn),this.#Ne=a(n.toTextRange(o),e.startLine,e.startColumn)}nameRange(){return this.ensureRanges(),this.#De}valueRange(){return this.ensureRanges(),this.#Ne}rebase(e){this.ownerStyle.styleSheetId===e.styleSheetId&&this.range&&(this.range=this.range.rebaseAfterTextEdit(e.oldRange,e.newRange))}setActive(e){this.#Oe=e}get propertyText(){return void 0!==this.text?this.text:""===this.name?"":this.name+": "+this.value+(this.important?" !important":"")+";"}activeInStyle(){return this.#Oe}async setText(n,s,i){if(!this.ownerStyle)throw new Error("No ownerStyle for property");if(!this.ownerStyle.styleSheetId)throw new Error("No owner style id");if(!this.range||!this.ownerStyle.range)throw new Error("Style not editable");if(s&&(a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited),this.ownerStyle.parentRule?.isKeyframeRule()&&a.userMetrics.actionTaken(a.UserMetrics.Action.StylePropertyInsideKeyframeEdited),this.name.startsWith("--")&&a.userMetrics.actionTaken(a.UserMetrics.Action.CustomPropertyEdited)),i&&n===this.propertyText)return this.ownerStyle.cssModel().domModel().markUndoableState(!s),!0;const o=this.range.relativeTo(this.ownerStyle.range.startLine,this.ownerStyle.range.startColumn),l=this.ownerStyle.cssText?this.detectIndentation(this.ownerStyle.cssText):e.Settings.Settings.instance().moduleSetting("text-editor-indent").get(),d=this.ownerStyle.cssText?l.substring(0,this.ownerStyle.range.endColumn):"",c=new t.Text.Text(this.ownerStyle.cssText||"").replaceRange(o,r.StringUtilities.sprintf(";%s;",n)),h=await Ft.formatStyle(c,l,d);return await this.ownerStyle.setText(h,s)}static async formatStyle(e,n,r){const s=n.substring(r.length)+n;n&&(n="\n"+n);let i="",o="",a="",l=!1,d=!1;const c=t.CodeMirrorUtils.createCssTokenizer();return await c("*{"+e+"}",(function(e,t){if(!l){const r=t?.includes("comment")&&function(e){const t=e.indexOf(":");if(-1===t)return!1;const n=e.substring(2,t).trim();return S().isCSSPropertyName(n)}(e),s=t?.includes("def")||t?.includes("string")||t?.includes("meta")||t?.includes("property")||t?.includes("variableName")&&"variableName.function"!==t;return r?i=i.trimEnd()+n+e:s?(l=!0,a=e):(";"!==e||d)&&(i+=e,e.trim()&&!t?.includes("comment")&&(d=";"!==e)),void("{"!==e||t||(d=!1))}if("}"===e||";"===e){const t=a.trim();return i=i.trimEnd()+n+t+(t.endsWith(":")?" ":"")+e,d=!1,l=!1,void(o="")}if(S().isGridAreaDefiningProperty(o)){const t=I.exec(e);t&&0===t.index&&!a.trimEnd().endsWith("]")&&(a=a.trimEnd()+"\n"+s)}o||":"!==e||(o=a);a+=e})),l&&(i+=a),i=i.substring(2,i.length-1).trimEnd(),i+(n?"\n"+r:"")}detectIndentation(e){const n=e.split("\n");return n.length<2?"":t.TextUtils.Utils.lineIndent(n[1])}setValue(e,t,n,r){const s=this.name+": "+e+(this.important?" !important":"")+";";this.setText(s,t,n).then(r)}setLocalValue(e){this.value=e,this.dispatchEventToListeners("localValueUpdated")}async setDisabled(e){if(!this.ownerStyle)return!1;if(e===this.disabled)return!0;if(!this.text)return!0;const t=this.text.trim(),n=e=>e+(e.endsWith(";")?"":";");let r;return r=e?"/* "+n(bt(t))+" */":n(this.text.substring(2,t.length-2).trim()),await this.setText(r,!0,!0)}setDisplayedStringForInvalidProperty(e){this.#Fe=e}getInvalidStringForInvalidProperty(){return this.#Fe}getLonghandProperties(){return this.#Be}}var Bt=Object.freeze({__proto__:null,CSSProperty:Ft});class _t{text="";range;styleSheetId;cssModel;constructor(e){this.cssModel=e}rebase(e){this.styleSheetId===e.styleSheetId&&this.range&&(e.oldRange.equal(this.range)?this.reinitialize(e.payload):this.range=this.range.rebaseAfterTextEdit(e.oldRange,e.newRange))}equal(e){return!!(this.styleSheetId&&this.range&&e.range)&&(this.styleSheetId===e.styleSheetId&&this.range.equal(e.range))}lineNumberInSource(){if(this.range)return this.header()?.lineNumberInSource(this.range.startLine)}columnNumberInSource(){if(this.range)return this.header()?.columnNumberInSource(this.range.startLine,this.range.startColumn)}header(){return this.styleSheetId?this.cssModel.styleSheetHeaderForId(this.styleSheetId):null}rawLocation(){const e=this.header();if(!e||void 0===this.lineNumberInSource())return null;const t=Number(this.lineNumberInSource());return new Ur(e,t,this.columnNumberInSource())}}var Ht=Object.freeze({__proto__:null,CSSQuery:_t});class Ut extends _t{name;physicalAxes;logicalAxes;queriesScrollState;static parseContainerQueriesPayload(e,t){return t.map((t=>new Ut(e,t)))}constructor(e,t){super(e),this.reinitialize(t)}reinitialize(e){this.text=e.text,this.range=e.range?t.TextRange.TextRange.fromObject(e.range):null,this.styleSheetId=e.styleSheetId,this.name=e.name,this.physicalAxes=e.physicalAxes,this.logicalAxes=e.logicalAxes,this.queriesScrollState=e.queriesScrollState}active(){return!0}async getContainerForNode(e){const t=await this.cssModel.domModel().getContainerForNode(e,this.name,this.physicalAxes,this.logicalAxes,this.queriesScrollState);if(t)return new qt(t)}}class qt{containerNode;constructor(e){this.containerNode=e}async getContainerSizeDetails(){const e=await this.containerNode.domModel().cssModel().getComputedStyle(this.containerNode.id);if(!e)return;const t=e.get("container-type"),n=e.get("writing-mode");if(!t||!n)return;const r=zt(`${t}`),s=jt(r,n);let i,o;return"Both"!==s&&"Horizontal"!==s||(i=e.get("width")),"Both"!==s&&"Vertical"!==s||(o=e.get("height")),{queryAxis:r,physicalAxis:s,width:i,height:o}}}const zt=e=>{const t=e.split(" ");let n=!1;for(const e of t){if("size"===e)return"size";n=n||"inline-size"===e}return n?"inline-size":""},jt=(e,t)=>{const n=t.startsWith("vertical");switch(e){case"":return"";case"size":return"Both";case"inline-size":return n?"Vertical":"Horizontal";case"block-size":return n?"Horizontal":"Vertical"}};var Vt=Object.freeze({__proto__:null,CSSContainerQuery:Ut,CSSContainerQueryContainer:qt,getPhysicalAxisFromQueryAxis:jt,getQueryAxisFromContainerType:zt});class Wt extends _t{static parseLayerPayload(e,t){return t.map((t=>new Wt(e,t)))}constructor(e,t){super(e),this.reinitialize(t)}reinitialize(e){this.text=e.text,this.range=e.range?t.TextRange.TextRange.fromObject(e.range):null,this.styleSheetId=e.styleSheetId}active(){return!0}}var Gt=Object.freeze({__proto__:null,CSSLayer:Wt});class Kt{#_e;#He;constructor(e){this.#_e=e.active,this.#He=[];for(let t=0;tnew $t(e,t)))}constructor(e,t){super(e),this.reinitialize(t)}reinitialize(e){if(this.text=e.text,this.source=e.source,this.sourceURL=e.sourceURL||"",this.range=e.range?t.TextRange.TextRange.fromObject(e.range):null,this.styleSheetId=e.styleSheetId,this.mediaList=null,e.mediaList){this.mediaList=[];for(let t=0;tnew Jt(e,t)))}constructor(e,t){super(e),this.reinitialize(t)}reinitialize(e){this.text=e.text,this.range=e.range?t.TextRange.TextRange.fromObject(e.range):null,this.styleSheetId=e.styleSheetId}active(){return!0}}var Yt,Zt=Object.freeze({__proto__:null,CSSScope:Jt});class en{#je;parentRule;#Ve;styleSheetId;range;cssText;#We=new Map;#Ge=new Set;#Ke=new Map;#Qe;type;#$e;constructor(e,t,n,r,s){this.#je=e,this.parentRule=t,this.#Xe(n),this.type=r,this.#$e=s}rebase(e){if(this.styleSheetId===e.styleSheetId&&this.range)if(e.oldRange.equal(this.range))this.#Xe(e.payload);else{this.range=this.range.rebaseAfterTextEdit(e.oldRange,e.newRange);for(let t=0;t=0;--e)if(this.allProperties()[e].range)return e+1;return 0}#et(e){const t=this.propertyAt(e);if(t?.range)return t.range.collapseToStart();if(!this.range)throw new Error("CSSStyleDeclaration.range is null");return this.range.collapseToEnd()}newBlankProperty(e){e=void 0===e?this.pastLastSourcePropertyIndex():e;return new Ft(this,e,"","",!1,!1,!0,!1,"",this.#et(e))}setText(e,t){return this.range&&this.styleSheetId?this.#je.setStyleText(this.styleSheetId,this.range,e,t):Promise.resolve(!1)}insertPropertyAt(e,t,n,r){this.newBlankProperty(e).setText(t+": "+n+";",!1,!0).then(r)}appendProperty(e,t,n){this.insertPropertyAt(this.allProperties().length,e,t,n)}}!function(e){e.Regular="Regular",e.Inline="Inline",e.Attributes="Attributes",e.Pseudo="Pseudo",e.Transition="Transition",e.Animation="Animation"}(Yt||(Yt={}));var tn=Object.freeze({__proto__:null,CSSStyleDeclaration:en,get Type(){return Yt}});class nn extends _t{static parseSupportsPayload(e,t){return t.map((t=>new nn(e,t)))}#Oe=!0;constructor(e,t){super(e),this.reinitialize(t)}reinitialize(e){this.text=e.text,this.range=e.range?t.TextRange.TextRange.fromObject(e.range):null,this.styleSheetId=e.styleSheetId,this.#Oe=e.active}active(){return this.#Oe}}var rn=Object.freeze({__proto__:null,CSSSupports:nn});class sn{cssModelInternal;styleSheetId;sourceURL;origin;style;constructor(e,t){if(this.cssModelInternal=e,this.styleSheetId=t.styleSheetId,this.styleSheetId){const e=this.getStyleSheetHeader(this.styleSheetId);this.sourceURL=e.sourceURL}this.origin=t.origin,this.style=new en(this.cssModelInternal,this,t.style,Yt.Regular)}rebase(e){this.styleSheetId===e.styleSheetId&&this.style.rebase(e)}resourceURL(){if(!this.styleSheetId)return r.DevToolsPath.EmptyUrlString;return this.getStyleSheetHeader(this.styleSheetId).resourceURL()}isUserAgent(){return"user-agent"===this.origin}isInjected(){return"injected"===this.origin}isViaInspector(){return"inspector"===this.origin}isRegular(){return"regular"===this.origin}isKeyframeRule(){return!1}cssModel(){return this.cssModelInternal}getStyleSheetHeader(e){const t=this.cssModelInternal.styleSheetHeaderForId(e);return console.assert(null!==t),t}}class on{text;range;specificity;constructor(e){this.text=e.text,e.range&&(this.range=t.TextRange.TextRange.fromObject(e.range)),e.specificity&&(this.specificity=e.specificity)}rebase(e){this.range&&(this.range=this.range.rebaseAfterTextEdit(e.oldRange,e.newRange))}}class an extends sn{selectors;nestingSelectors;media;containerQueries;supports;scopes;layers;ruleTypes;wasUsed;constructor(e,t,n){super(e,{origin:t.origin,style:t.style,styleSheetId:t.styleSheetId}),this.reinitializeSelectors(t.selectorList),this.nestingSelectors=t.nestingSelectors,this.media=t.media?$t.parseMediaArrayPayload(e,t.media):[],this.containerQueries=t.containerQueries?Ut.parseContainerQueriesPayload(e,t.containerQueries):[],this.scopes=t.scopes?Jt.parseScopesPayload(e,t.scopes):[],this.supports=t.supports?nn.parseSupportsPayload(e,t.supports):[],this.layers=t.layers?Wt.parseLayerPayload(e,t.layers):[],this.ruleTypes=t.ruleTypes||[],this.wasUsed=n||!1}static createDummyRule(e,n){const r={selectorList:{text:"",selectors:[{text:n,value:void 0}]},style:{styleSheetId:"0",range:new t.TextRange.TextRange(0,0,0,0),shorthandEntries:[],cssProperties:[]},origin:"inspector"};return new an(e,r)}reinitializeSelectors(e){this.selectors=[];for(let t=0;te.text)).join(", ")}selectorRange(){if(0===this.selectors.length)return null;const e=this.selectors[0].range,n=this.selectors[this.selectors.length-1].range;return e&&n?new t.TextRange.TextRange(e.startLine,e.startColumn,n.endLine,n.endColumn):null}lineNumberInSource(e){const t=this.selectors[e];if(!t?.range||!this.styleSheetId)return 0;return this.getStyleSheetHeader(this.styleSheetId).lineNumberInSource(t.range.startLine)}columnNumberInSource(e){const t=this.selectors[e];if(!t?.range||!this.styleSheetId)return;return this.getStyleSheetHeader(this.styleSheetId).columnNumberInSource(t.range.startLine,t.range.startColumn)}rebase(e){if(this.styleSheetId!==e.styleSheetId)return;const t=this.selectorRange();if(t?.equal(e.oldRange))this.reinitializeSelectors(e.payload);else for(let t=0;tt.rebase(e))),this.containerQueries.forEach((t=>t.rebase(e))),this.scopes.forEach((t=>t.rebase(e))),this.supports.forEach((t=>t.rebase(e))),super.rebase(e)}}class ln extends sn{#tt;constructor(e,t){super(e,{origin:t.origin,style:t.style,styleSheetId:t.styleSheetId}),this.#tt=new on(t.propertyName)}propertyName(){return this.#tt}initialValue(){return this.style.hasActiveProperty("initial-value")?this.style.getPropertyValue("initial-value"):null}syntax(){return this.style.getPropertyValue("syntax")}inherits(){return"true"===this.style.getPropertyValue("inherits")}setPropertyName(e){const t=this.styleSheetId;if(!t)throw new Error("No rule stylesheet id");const n=this.#tt.range;if(!n)throw new Error("Property name is not editable");return this.cssModelInternal.setPropertyRulePropertyName(t,n,e)}}class dn extends sn{#nt;constructor(e,t){super(e,{origin:t.origin,style:t.style,styleSheetId:t.styleSheetId}),this.#nt=new on(t.fontPaletteName)}name(){return this.#nt}}class cn{#$e;#rt;constructor(e,t){this.#$e=new on(t.animationName),this.#rt=t.keyframes.map((t=>new hn(e,t)))}name(){return this.#$e}keyframes(){return this.#rt}}class hn extends sn{#st;constructor(e,t){super(e,{origin:t.origin,style:t.style,styleSheetId:t.styleSheetId}),this.reinitializeKey(t.keyText)}key(){return this.#st}reinitializeKey(e){this.#st=new on(e)}rebase(e){this.styleSheetId===e.styleSheetId&&this.#st.range&&(e.oldRange.equal(this.#st.range)?this.reinitializeKey(e.payload):this.#st.rebase(e),super.rebase(e))}isKeyframeRule(){return!0}setKeyText(e){const t=this.styleSheetId;if(!t)throw new Error("No rule stylesheet id");const n=this.#st.range;if(!n)throw new Error("Keyframe key is not editable");return this.cssModelInternal.setKeyframeKey(t,n,e)}}class un extends sn{#tt;#Oe;constructor(e,t){super(e,{origin:t.origin,style:t.style,styleSheetId:t.styleSheetId}),this.#tt=new on(t.name),this.#Oe=t.active}name(){return this.#tt}active(){return this.#Oe}}class gn extends sn{#tt;#it;#ot;constructor(e,t){super(e,{origin:t.origin,style:{cssProperties:[],shorthandEntries:[]},styleSheetId:t.styleSheetId}),this.#tt=new on(t.name),this.#it=t.parameters.map((({name:e})=>e)),this.#ot=this.protocolNodesToNestedStyles(t.children)}functionName(){return this.#tt}parameters(){return this.#it}children(){return this.#ot}protocolNodesToNestedStyles(e){const t=[];for(const n of e){const e=this.protocolNodeToNestedStyle(n);e&&t.push(e)}return t}protocolNodeToNestedStyle(e){if(e.style)return{style:new en(this.cssModelInternal,this,e.style,Yt.Regular)};if(e.condition){const t=this.protocolNodesToNestedStyles(e.condition.children);return e.condition.media?{children:t,media:new $t(this.cssModelInternal,e.condition.media)}:e.condition.containerQueries?{children:t,container:new Ut(this.cssModelInternal,e.condition.containerQueries)}:e.condition.supports?{children:t,supports:new nn(this.cssModelInternal,e.condition.supports)}:void console.error("A function rule condition must have a media, container, or supports")}console.error("A function rule node must have a style or condition")}}var pn=Object.freeze({__proto__:null,CSSFontPaletteValuesRule:dn,CSSFunctionRule:gn,CSSKeyframeRule:hn,CSSKeyframesRule:cn,CSSPositionTryRule:un,CSSPropertyRule:ln,CSSRule:sn,CSSStyleRule:an});function mn(e,t){if(!t.styleSheetId||!t.range)return!1;for(const n of e)if(t.styleSheetId===n.styleSheetId&&n.range&&t.range.equal(n.range))return!0;return!1}function fn(e){const t=e.allProperties();for(let e=0;e({name:e,value:t}))),t.rule.style.cssProperties=[...r.entries()].map((([e,t])=>({name:e,value:t})))}function r(e){return e.rule.media?e.rule.media.map((e=>e.text)).join(", "):null}function s(e){const{matchingSelectors:t,rule:n}=e;"user-agent"===n.origin&&t.length&&(n.selectorList.selectors=n.selectorList.selectors.filter(((e,n)=>t.includes(n))),n.selectorList.text=n.selectorList.selectors.map((e=>e.text)).join(", "),e.matchingSelectors=t.map(((e,t)=>t)))}}function yn(e){const t=new Map;for(let n=0;nnew ln(e,t))),...o].map((t=>new vn(e,t))),n&&(this.#rt=n.map((t=>new cn(e,t)))),this.#It=s.map((t=>new un(e,t))),this.#vt=r,this.#Rt=a?new dn(e,a):void 0,this.#wt=l,this.#xt=d.map((t=>new gn(e,t)))}async init({matchedPayload:e,inheritedPayload:t,inlinePayload:n,attributesPayload:r,pseudoPayload:s,inheritedPseudoPayload:i,animationStylesPayload:o,transitionsStylePayload:a,inheritedAnimatedPayload:l}){e=bn(e);for(const e of t)e.matchedCSSRules=bn(e.matchedCSSRules);this.#St=await this.buildMainCascade(n,r,e,t,o,a,l),[this.#kt,this.#Ct]=this.buildPseudoCascades(s,i);for(const e of Array.from(this.#Ct.values()).concat(Array.from(this.#kt.values())).concat(this.#St))for(const t of e.styles())this.#yt.set(t,e);for(const e of this.#pt)this.#mt.set(e.propertyName(),e)}async buildMainCascade(e,t,n,r,s,i,o){const a=[],l=[];function d(){if(!t)return;const e=new en(this.#je,null,t,Yt.Attributes);this.#ft.set(e,this.#ht),l.push(e)}if(i){const e=new en(this.#je,null,i,Yt.Transition);this.#ft.set(e,this.#ht),l.push(e)}for(const e of s){const t=new en(this.#je,null,e.style,Yt.Animation,e.name);this.#ft.set(t,this.#ht),l.push(t)}if(e&&this.#ht.nodeType()===Node.ELEMENT_NODE){const t=new en(this.#je,null,e,Yt.Inline);this.#ft.set(t,this.#ht),l.push(t)}let c;for(let e=n.length-1;e>=0;--e){const t=new an(this.#je,n[e].rule);!t.isInjected()&&!t.isUserAgent()||c||(c=!0,d.call(this)),this.#ft.set(t.style,this.#ht),l.push(t.style),this.addMatchingSelectors(this.#ht,t,n[e].matchingSelectors)}c||d.call(this),a.push(new wn(this,l,!1));let h=this.#ht.parentNode;const u=async e=>e.hasAssignedSlot()?await(e.assignedSlot?.deferredNode.resolvePromise())??null:e.parentNode;for(let e=0;h&&r&&enew en(this.#je,null,e.style,Yt.Animation,e.name)))??[];d&&fn(d)&&(this.#ft.set(d,h),t.push(d),this.#bt.add(d));for(const e of c)fn(e)&&(this.#ft.set(e,h),t.push(e),this.#bt.add(e));i&&fn(i)&&(this.#ft.set(i,h),t.push(i),this.#bt.add(i));const g=n.matchedCSSRules||[];for(let e=g.length-1;e>=0;--e){const n=new an(this.#je,g[e].rule);this.addMatchingSelectors(h,n,g[e].matchingSelectors),fn(n.style)&&((n.style.allProperties().some((e=>S().isCustomProperty(e.name)))||!mn(l,n.style)&&!mn(this.#bt,n.style))&&(this.#ft.set(n.style,h),t.push(n.style),this.#bt.add(n.style)))}h=await u(h),a.push(new wn(this,t,!0))}return new Tn(a,this.#pt)}buildSplitCustomHighlightCascades(e,t,n,r){const s=new Map;for(let r=e.length-1;r>=0;--r){const i=yn(e[r]);for(const[o,a]of i){const i=new an(this.#je,e[r].rule);this.#ft.set(i.style,t),n&&this.#bt.add(i.style),this.addMatchingSelectors(t,i,a);const l=s.get(o);l?l.push(i.style):s.set(o,[i.style])}}for(const[e,t]of s){const s=new wn(this,t,n,!0),i=r.get(e);i?i.push(s):r.set(e,[s])}}buildPseudoCascades(e,t){const n=new Map,r=new Map;if(!e)return[n,r];const s=new Map,i=new Map;for(let t=0;t=0;--e){const t=new an(this.#je,a[e].rule);o.push(t.style);const s=S().isHighlightPseudoType(n.pseudoType)?this.#ht:r;this.#ft.set(t.style,s),s&&this.addMatchingSelectors(s,t,a[e].matchingSelectors)}const e=S().isHighlightPseudoType(n.pseudoType),t=new wn(this,o,!1,e);s.set(n.pseudoType,[t])}}if(t){let e=this.#ht.parentNode;for(let n=0;e&&n=0;--n){const r=new an(this.#je,o[n].rule);t.push(r.style),this.#ft.set(r.style,e),this.#bt.add(r.style),this.addMatchingSelectors(e,r,o[n].matchingSelectors)}const r=S().isHighlightPseudoType(n.pseudoType),i=new wn(this,t,!0,r),a=s.get(n.pseudoType);a?a.push(i):s.set(n.pseudoType,[i])}}e=e.parentNode}}for(const[e,t]of s.entries())n.set(e,new Tn(t,this.#pt));for(const[e,t]of i.entries())r.set(e,new Tn(t,this.#pt));return[n,r]}addMatchingSelectors(e,t,n){for(const r of n){const n=t.selectors[r];n&&this.setSelectorMatches(e,n.text,!0)}}node(){return this.#ht}cssModel(){return this.#je}hasMatchingSelectors(e){return(0===e.selectors.length||this.getMatchingSelectors(e).length>0)&&function(e){if(!e.parentRule)return!0;const t=e.parentRule,n=[...t.media,...t.containerQueries,...t.supports,...t.scopes];for(const e of n)if(!e.active())return!1;return!0}(e.style)}getParentLayoutNodeId(){return this.#vt}getMatchingSelectors(e){const t=this.nodeForStyle(e.style);if(!t||"number"!=typeof t.id)return[];const n=this.#gt.get(t.id);if(!n)return[];const r=[];for(let t=0;tthis.isInherited(e)))??[]}animationStyles(){return this.#St?.styles().filter((e=>!this.isInherited(e)&&e.type===Yt.Animation))??[]}transitionsStyle(){return this.#St?.styles().find((e=>!this.isInherited(e)&&e.type===Yt.Transition))??null}registeredProperties(){return this.#pt}getRegisteredProperty(e){return this.#mt.get(e)}functionRules(){return this.#xt}fontPaletteValuesRule(){return this.#Rt}keyframes(){return this.#rt}positionTryRules(){return this.#It}activePositionFallbackIndex(){return this.#wt}pseudoStyles(e){r.assertNotNullOrUndefined(this.#kt);const t=this.#kt.get(e);return t?t.styles():[]}pseudoTypes(){return r.assertNotNullOrUndefined(this.#kt),new Set(this.#kt.keys())}customHighlightPseudoStyles(e){r.assertNotNullOrUndefined(this.#Ct);const t=this.#Ct.get(e);return t?t.styles():[]}customHighlightPseudoNames(){return r.assertNotNullOrUndefined(this.#Ct),new Set(this.#Ct.keys())}nodeForStyle(e){return this.#ut.get(e)||this.#ft.get(e)||null}availableCSSVariables(e){const t=this.#yt.get(e);return t?t.findAvailableCSSVariables(e):[]}computeCSSVariable(e,t){const n=this.#yt.get(e);return n?n.computeCSSVariable(e,t):null}resolveProperty(e,t){return this.#yt.get(t)?.resolveProperty(e,t)??null}resolveGlobalKeyword(e,t){const n=this.#yt.get(e.ownerStyle)?.resolveGlobalKeyword(e,t);return n?new kn(n):null}isInherited(e){return this.#bt.has(e)}propertyState(e){const t=this.#yt.get(e.ownerStyle);return t?t.propertyState(e):null}resetActiveProperties(){r.assertNotNullOrUndefined(this.#St),r.assertNotNullOrUndefined(this.#kt),r.assertNotNullOrUndefined(this.#Ct),this.#St.reset();for(const e of this.#kt.values())e.reset();for(const e of this.#Ct.values())e.reset()}propertyMatchers(e,t){return[new ve(this,e),new De((()=>t?.get("color")??null)),new Me,new Ee,new xe,new Ue,new ze,new Ve,new Ge,new Fe(e),new nt,new Ae,new st,new ot,new et,new ct,new Xe,new Ye,new _e,new we]}}class wn{#Tt;styles;#Mt;#Pt;propertiesState=new Map;activeProperties=new Map;constructor(e,t,n,r=!1){this.#Tt=e,this.styles=t,this.#Mt=n,this.#Pt=r}computeActiveProperties(){this.propertiesState.clear(),this.activeProperties.clear();for(let e=this.styles.length-1;e>=0;e--){const t=this.styles[e],n=t.parentRule;if((!n||n instanceof an)&&(!n||this.#Tt.hasMatchingSelectors(n)))for(const e of t.allProperties()){const n=S();if(this.#Mt&&!this.#Pt&&!n.isPropertyInherited(e.name))continue;if(t.range&&!e.range)continue;if(!e.activeInStyle()){this.propertiesState.set(e,"Overloaded");continue}if(this.#Mt){const t=this.#Tt.getRegisteredProperty(e.name);if(t&&!t.inherits()){this.propertiesState.set(e,"Overloaded");continue}}const r=n.canonicalPropertyName(e.name);this.updatePropertyState(e,r);for(const t of e.getLonghandProperties())n.isCSSPropertyName(t.name)&&this.updatePropertyState(t,t.name)}}}updatePropertyState(e,t){const n=this.activeProperties.get(t);!n?.important||e.important?(n&&this.propertiesState.set(n,"Overloaded"),this.propertiesState.set(e,"Active"),this.activeProperties.set(t,e)):this.propertiesState.set(e,"Overloaded")}}function Sn(e){return"ownerStyle"in e}class kn{declaration;constructor(e){this.declaration=e}get value(){return Sn(this.declaration)?this.declaration.value:this.declaration.initialValue()}get style(){return Sn(this.declaration)?this.declaration.ownerStyle:this.declaration.style()}get name(){return Sn(this.declaration)?this.declaration.name:this.declaration.propertyName()}}class Cn{nodeCascade;name;discoveryTime;rootDiscoveryTime;get isRootEntry(){return this.rootDiscoveryTime===this.discoveryTime}updateRoot(e){this.rootDiscoveryTime=Math.min(this.rootDiscoveryTime,e.rootDiscoveryTime)}constructor(e,t,n){this.nodeCascade=e,this.name=t,this.discoveryTime=n,this.rootDiscoveryTime=n}}class xn{#Et=0;#Lt=[];#At=new Map;get(e,t){return this.#At.get(e)?.get(t)}add(e,t){const n=this.get(e,t);if(n)return n;const r=new Cn(e,t,this.#Et++);this.#Lt.push(r);let s=this.#At.get(e);return s||(s=new Map,this.#At.set(e,s)),s.set(t,r),r}isInInProgressSCC(e){return this.#Lt.includes(e)}finishSCC(e){const t=this.#Lt.lastIndexOf(e);return console.assert(t>=0,"Root is not an in-progress scc"),this.#Lt.splice(t)}}function*Rn(e,t){for(let n=void 0!==t?e.indexOf(t)+1:0;nn.name===e.name&&t(n)));if(n)return n}return null}resolveProperty(e,t){const n=this.#Ft.get(t);if(!n)return null;for(const r of function*(e,t){(void 0===t||e.includes(t))&&(void 0!==t&&(yield t),yield*Rn(e,t))}(n.styles,t)){const t=r.allProperties().findLast((t=>t.name===e));if(t)return t}return this.#Ut({name:e,ownerStyle:t})}#qt(e){const t=this.#Ft.get(e.ownerStyle);if(!t)return null;for(const n of Rn(this.#_t,t))for(const t of n.styles){const n=t.allProperties().findLast((t=>t.name===e.name));if(n)return n}return null}#Ut(e){return S().isPropertyInherited(e.name)&&(this.#zt(e.name)?.inherits()??1)?this.#qt(e):null}#zt(e){const t=this.#pt.find((t=>t.propertyName()===e));return t||null}resolveGlobalKeyword(e,t){const n=t=>t.ownerStyle.parentRule instanceof an&&(e.ownerStyle.type===Yt.Inline||e.ownerStyle.parentRule instanceof an&&"regular"===t.ownerStyle.parentRule?.origin&&JSON.stringify(t.ownerStyle.parentRule.layers)!==JSON.stringify(e.ownerStyle.parentRule.layers));switch(t){case"initial":return this.#zt(e.name);case"inherit":return this.#qt(e)??this.#zt(e.name);case"revert":return this.#Ht(e,(t=>null!==t.ownerStyle.parentRule&&t.ownerStyle.parentRule.origin!==(e.ownerStyle.parentRule?.origin??"regular")))??this.resolveGlobalKeyword(e,"unset");case"revert-layer":return this.#Ht(e,n)??this.resolveGlobalKeyword(e,"revert");case"unset":return this.#Ut(e)??this.#zt(e.name)}}computeCSSVariable(e,t){const n=this.#Ft.get(e);return n?(this.ensureInitialized(),this.innerComputeCSSVariable(n,t)):null}innerComputeCSSVariable(e,t,n=new xn){const r=this.#Dt.get(e),s=this.#Nt.get(e);if(!s||!r?.has(t))return null;if(s?.has(t))return s.get(t)||null;let i=r.get(t);if(null==i)return null;if(i.declaration.declaration instanceof Ft&&i.declaration.value&&f.isCSSWideKeyword(i.declaration.value)){const e=this.resolveGlobalKeyword(i.declaration.declaration,i.declaration.value);if(!e)return i;const t=new kn(e),{value:n}=t;if(!n)return i;i={declaration:t,value:n}}const o=Lt(`--${t}`,i.value);if(!o)return null;const a=n.add(e,t),l=Ct.walk(o,[new be((e=>{const t=i.declaration.style,r=this.#Ft.get(t);if(!r)return null;const s=n.get(r,e.name);if(s)return n.isInInProgressSCC(s)?(a.updateRoot(s),null):this.#Nt.get(r)?.get(e.name)?.value??null;const o=this.innerComputeCSSVariable(r,e.name,n),l=n.get(r,e.name);return l&&a.updateRoot(l),void 0!==o?.value?o.value:0===e.fallback.length||e.matching.hasUnresolvedVarsRange(e.fallback[0],e.fallback[e.fallback.length-1])?null:e.matching.getComputedTextRange(e.fallback[0],e.fallback[e.fallback.length-1])}))]),d=Pt.siblings(Pt.declValue(l.ast.tree)),c=d.length>0?l.getComputedTextRange(d[0],d[d.length-1]):"";if(a.isRootEntry){const t=n.finishSCC(a);if(t.length>1){for(const n of t)console.assert(n.nodeCascade===e,"Circles should be within the cascade"),s.set(n.name,null);return null}}if(d.length>0&&l.hasUnresolvedVarsRange(d[0],d[d.length-1]))return s.set(t,null),null;const h={value:c,declaration:i.declaration};return s.set(t,h),h}styles(){return Array.from(this.#Ft.keys())}propertyState(e){return this.ensureInitialized(),this.#Ot.get(e)||null}reset(){this.#Bt=!1,this.#Ot.clear(),this.#Dt.clear(),this.#Nt.clear()}ensureInitialized(){if(this.#Bt)return;this.#Bt=!0;const e=new Map;for(const t of this.#_t){t.computeActiveProperties();for(const[n,r]of t.propertiesState){if("Overloaded"===r){this.#Ot.set(n,"Overloaded");continue}const t=S().canonicalPropertyName(n.name);e.has(t)?this.#Ot.set(n,"Overloaded"):(e.set(t,n),this.#Ot.set(n,"Active"))}}for(const[t,n]of e){const r=n.ownerStyle,s=n.getLonghandProperties();if(!s.length)continue;let i=!1;for(const t of s){const n=S().canonicalPropertyName(t.name),s=e.get(n);if(s&&s.ownerStyle===r){i=!0;break}}i||(e.delete(t),this.#Ot.set(n,"Overloaded"))}const t=new Map;for(const e of this.#pt){const n=e.initialValue();t.set(e.propertyName(),null!==n?{value:n,declaration:new kn(e)}:null)}for(let e=this.#_t.length-1;e>=0;--e){const n=this.#_t[e],r=[];for(const e of n.activeProperties.entries()){const n=e[0],s=e[1];n.startsWith("--")&&(t.set(n,{value:s.value,declaration:new kn(s)}),r.push(n))}const s=new Map(t),i=new Map;this.#Dt.set(n,s),this.#Nt.set(n,i);for(const e of r){const r=t.get(e);t.delete(e);const s=this.innerComputeCSSVariable(n,e);r&&s?.value===r.value&&(s.declaration=r.declaration),t.set(e,s)}}}}var Mn=Object.freeze({__proto__:null,CSSMatchedStyles:In,CSSRegisteredProperty:vn,CSSValueSource:kn});const Pn={couldNotFindTheOriginalStyle:"Could not find the original style sheet.",thereWasAnErrorRetrievingThe:"There was an error retrieving the source styles."},En=n.i18n.registerUIStrings("core/sdk/CSSStyleSheetHeader.ts",Pn),Ln=n.i18n.getLocalizedString.bind(void 0,En);class An{#je;id;frameId;sourceURL;hasSourceURL;origin;title;disabled;isInline;isMutable;isConstructed;startLine;startColumn;endLine;endColumn;contentLength;ownerNode;sourceMapURL;loadingFailed;#jt;constructor(e,t){this.#je=e,this.id=t.styleSheetId,this.frameId=t.frameId,this.sourceURL=t.sourceURL,this.hasSourceURL=Boolean(t.hasSourceURL),this.origin=t.origin,this.title=t.title,this.disabled=t.disabled,this.isInline=t.isInline,this.isMutable=t.isMutable,this.isConstructed=t.isConstructed,this.startLine=t.startLine,this.startColumn=t.startColumn,this.endLine=t.endLine,this.endColumn=t.endColumn,this.contentLength=t.length,t.ownerNode&&(this.ownerNode=new js(e.target(),t.ownerNode)),this.sourceMapURL=t.sourceMapURL,this.loadingFailed=t.loadingFailed??!1,this.#jt=null}originalContentProvider(){if(!this.#jt){const e=async()=>{const e=await this.#je.originalStyleSheetText(this);return null===e?{error:Ln(Pn.couldNotFindTheOriginalStyle)}:new t.ContentData.ContentData(e,!1,"text/css")};this.#jt=new t.StaticContentProvider.StaticContentProvider(this.contentURL(),this.contentType(),e)}return this.#jt}setSourceMapURL(e){this.sourceMapURL=e}cssModel(){return this.#je}isAnonymousInlineStyleSheet(){return!this.resourceURL()&&!this.#je.sourceMapManager().sourceMapForClient(this)}isConstructedByNew(){return this.isConstructed&&0===this.sourceURL.length}resourceURL(){return this.isViaInspector()?this.viaInspectorResourceURL():this.sourceURL}getFrameURLPath(){const t=this.#je.target().model(ii);if(console.assert(Boolean(t)),!t)return"";const n=t.frameForId(this.frameId);if(!n)return"";console.assert(Boolean(n));const r=new e.ParsedURL.ParsedURL(n.url);let s=r.host+r.folderPathComponents;return s.endsWith("/")||(s+="/"),s}viaInspectorResourceURL(){return`inspector:///inspector-stylesheet#${this.id}`}lineNumberInSource(e){return this.startLine+e}columnNumberInSource(e,t){return(e?0:this.startColumn)+t}containsLocation(e,t){const n=e===this.startLine&&t>=this.startColumn||e>this.startLine,r=ee.isOutermostFrame()));this.#Kt=e.length>0?e[0]:null}getFrame(e){const t=this.#Wt.get(e);return t?t.frame:null}getAllFrames(){return Array.from(this.#Wt.values(),(e=>e.frame))}getOutermostFrame(){return this.#Kt}async getOrWaitForFrame(e,t){const n=this.getFrame(e);return!n||t&&t===n.resourceTreeModel().target()?await new Promise((n=>{const r=this.#$t.get(e);r?r.push({notInTarget:t,resolve:n}):this.#$t.set(e,[{notInTarget:t,resolve:n}])})):n}resolveAwaitedFrame(e){const t=this.#$t.get(e.id);if(!t)return;const n=t.filter((({notInTarget:t,resolve:n})=>!(!t||t!==e.resourceTreeModel().target())||(n(e),!1)));n.length>0?this.#$t.set(e.id,n):this.#$t.delete(e.id)}}var Fn=Object.freeze({__proto__:null,FrameManager:Nn});class Bn{static fromLocalObject(e){return new zn(e)}static type(e){if(null===e)return"null";const t=typeof e;return"object"!==t&&"function"!==t?t:e.type}static isNullOrUndefined(e){if(void 0===e)return!0;switch(e.type){case"object":return"null"===e.subtype;case"undefined":return!0;default:return!1}}static arrayNameFromDescription(e){return e.replace(Gn,"").replace(Kn,"")}static arrayLength(e){if("array"!==e.subtype&&"typedarray"!==e.subtype)return 0;const t=e.description?.match(Gn),n=e.description?.match(Kn);return t?parseInt(t[1],10):n?parseInt(n[1],10):0}static arrayBufferByteLength(e){if("arraybuffer"!==e.subtype)return 0;const t=e.description?.match(Gn);return t?parseInt(t[1],10):0}static unserializableDescription(e){if("number"==typeof e){const t=String(e);if(0===e&&1/e<0)return"-0";if("NaN"===t||"Infinity"===t||"-Infinity"===t)return t}return"bigint"==typeof e?e+"n":null}static toCallArgument(e){const t=typeof e;if("undefined"===t)return{};const n=Bn.unserializableDescription(e);if("number"===t)return null!==n?{unserializableValue:n}:{value:e};if("bigint"===t)return{unserializableValue:n};if("string"===t||"boolean"===t)return{value:e};if(!e)return{value:null};const r=e;if(e instanceof Bn){const t=e.unserializableValue();if(void 0!==t)return{unserializableValue:t}}else if(void 0!==r.unserializableValue)return{unserializableValue:r.unserializableValue};return void 0!==r.objectId?{objectId:r.objectId}:{value:r.value}}static async loadFromObjectPerProto(e,t,n=!1){const r=await Promise.all([e.getAllProperties(!0,t,n),e.getOwnProperties(t,n)]),s=r[0].properties,i=r[1].properties,o=r[1].internalProperties;if(!i||!s)return{properties:null,internalProperties:null};const a=new Map,l=[];for(let e=0;e100){r+=",…";break}e&&(r+=", "),r+=t}return r+=t,r}get type(){return typeof this.valueInternal}get subtype(){return null===this.valueInternal?"null":Array.isArray(this.valueInternal)?"array":this.valueInternal instanceof Date?"date":void 0}get hasChildren(){return"object"==typeof this.valueInternal&&null!==this.valueInternal&&Boolean(Object.keys(this.valueInternal).length)}async getOwnProperties(e,t=!1){let n=this.children();return t&&(n=n.filter((e=>!function(e){const t=Number(e)>>>0;return String(t)===e}(e.name)))),{properties:n,internalProperties:null}}async getAllProperties(e,t,n=!1){return e?{properties:[],internalProperties:null}:await this.getOwnProperties(t,n)}children(){return this.hasChildren?(this.#an||(this.#an=Object.entries(this.valueInternal).map((([e,t])=>new qn(e,t instanceof Bn?t:Bn.fromLocalObject(t))))),this.#an):[]}arrayLength(){return Array.isArray(this.valueInternal)?this.valueInternal.length:0}async callFunction(e,t){const n=this.valueInternal,r=t?t.map((e=>e.value)):[];let s,i=!1;try{s=e.apply(n,r)}catch{i=!0}return{object:Bn.fromLocalObject(s),wasThrown:i}}async callFunctionJSON(e,t){const n=this.valueInternal,r=t?t.map((e=>e.value)):[];let s;try{s=e.apply(n,r)}catch{s=null}return s}}class jn{#ln;constructor(e){this.#ln=e}static objectAsArray(e){if(!e||"object"!==e.type||"array"!==e.subtype&&"typedarray"!==e.subtype)throw new Error("Object is empty or not an array");return new jn(e)}static async createFromRemoteObjects(e){if(!e.length)throw new Error("Input array is empty");const t=await e[0].callFunction((function(...e){return e}),e.map(Bn.toCallArgument));if(t.wasThrown||!t.object)throw new Error("Call function throws exceptions or returns empty value");return jn.objectAsArray(t.object)}async at(e){if(e<0||e>this.#ln.arrayLength())throw new Error("Out of range");const t=await this.#ln.callFunction((function(e){return this[e]}),[Bn.toCallArgument(e)]);if(t.wasThrown||!t.object)throw new Error("Exception in callFunction or result value is empty");return t.object}length(){return this.#ln.arrayLength()}map(e){const t=[];for(let n=0;n"[[TargetFunction]]"===e));return t?.value??this.#dn}async targetFunctionDetails(){const e=await this.targetFunction(),t=await e.debuggerModel().functionDetailsPromise(e);return this.#dn!==e&&e.release(),t}}class Wn{#dn;#cn;#hn;constructor(e){this.#dn=e}static objectAsError(e){if("error"!==e.subtype)throw new Error(`Object of type ${e.subtype} is not an error`);return new Wn(e)}get errorStack(){return this.#dn.description??""}exceptionDetails(){return this.#cn||(this.#cn=this.#un()),this.#cn}#un(){return this.#dn.objectId?this.#dn.runtimeModel().getExceptionDetails(this.#dn.objectId):Promise.resolve(void 0)}cause(){return this.#hn||(this.#hn=this.#gn()),this.#hn}async#gn(){const e=await this.#dn.getAllProperties(!1,!1),t=e.properties?.find((e=>"cause"===e.name));return t?.value}}const Gn=/\(([0-9]+)\)/,Kn=/\[([0-9]+)\]/;var Qn=Object.freeze({__proto__:null,LinearMemoryInspectable:class{object;expression;constructor(e,t){if(!e.isLinearMemoryInspectable())throw new Error("object must be linear memory inspectable");this.object=e,this.expression=t}},LocalJSONObject:zn,RemoteArray:jn,RemoteArrayBuffer:class{#ln;constructor(e){if("object"!==e.type||"arraybuffer"!==e.subtype)throw new Error("Object is not an arraybuffer");this.#ln=e}byteLength(){return this.#ln.arrayBufferByteLength()}async bytes(e=0,t=this.byteLength()){if(e<0||e>=this.byteLength())throw new RangeError("start is out of range");if(tthis.byteLength())throw new RangeError("end is out of range");return await this.#ln.callFunctionJSON((function(e,t){return[...new Uint8Array(this,e,t)]}),[{value:e},{value:t-e}])}object(){return this.#ln}},RemoteError:Wn,RemoteFunction:Vn,RemoteObject:Bn,RemoteObjectImpl:_n,RemoteObjectProperty:qn,ScopeRef:Un,ScopeRemoteObject:Hn});class $n extends h{constructor(e){super(e)}async read(t,n,r){const s=await this.target().ioAgent().invoke_read({handle:t,offset:r,size:n});if(s.getError())throw new Error(s.getError());return s.eof?null:s.base64Encoded?e.Base64.decode(s.data):s.data}async close(e){(await this.target().ioAgent().invoke_close({handle:e})).getError()&&console.error("Could not close stream.")}async resolveBlob(e){const t=e instanceof Bn?e.objectId:e;if(!t)throw new Error("Remote object has undefined objectId");const n=await this.target().ioAgent().invoke_resolveBlob({objectId:t});if(n.getError())throw new Error(n.getError());return`blob:${n.uuid}`}async readToString(e){const t=[],n=new TextDecoder;for(;;){const r=await this.read(e,4194304);if(null===r){t.push(n.decode());break}r instanceof ArrayBuffer?t.push(n.decode(r,{stream:!0})):t.push(r)}return t.join("")}}h.register($n,{capabilities:131072,autostart:!0});var Xn=Object.freeze({__proto__:null,IOModel:$n});const Jn={loadCanceledDueToReloadOf:"Load canceled due to reload of inspected page"},Yn=n.i18n.registerUIStrings("core/sdk/PageResourceLoader.ts",Jn),Zn=n.i18n.getLocalizedString.bind(void 0,Yn);function er(e){return"extensionId"in e}let tr=null;class nr extends e.ObjectWrapper.ObjectWrapper{#pn=0;#mn=!1;#fn=void 0;#bn=new Map;#yn;#vn=new Map;#In=[];#wn;constructor(e,t){super(),this.#yn=t,W.instance().addModelListener(ii,ri.PrimaryPageChanged,this.onPrimaryPageChanged,this),this.#wn=e}static instance({forceNew:e,loadOverride:t,maxConcurrentLoads:n}={forceNew:!1,loadOverride:null,maxConcurrentLoads:500}){return tr&&!e||(tr=new nr(t,n)),tr}static removeInstance(){tr=null}onPrimaryPageChanged(e){const{frame:t,type:n}=e.data;if(!t.isOutermostFrame())return;for(const{reject:e}of this.#In)e(new Error(Zn(Jn.loadCanceledDueToReloadOf)));this.#In=[];const r=t.resourceTreeModel().target(),s=new Map;for(const[e,t]of this.#vn.entries())"Activation"===n&&r===t.initiator.target&&s.set(e,t);this.#vn=s,this.dispatchEventToListeners("Update")}getResourcesLoaded(){return this.#vn}getScopedResourcesLoaded(){return new Map([...this.#vn].filter((([e,t])=>W.instance().isInScope(t.initiator.target)||er(t.initiator))))}getNumberOfResources(){return{loading:this.#pn,queued:this.#In.length,resources:this.#vn.size}}getScopedNumberOfResources(){const e=W.instance();let t=0;for(const[n,r]of this.#bn){const s=e.targetById(n);e.isInScope(s)&&(t+=r)}return{loading:t,resources:this.getScopedResourcesLoaded().size}}async acquireLoadSlot(e){if(this.#pn++,e){const t=this.#bn.get(e.id())||0;this.#bn.set(e.id(),t+1)}if(this.#pn>this.#yn){const{promise:e,resolve:t,reject:n}=Promise.withResolvers();this.#In.push({resolve:t,reject:n}),await e}}releaseLoadSlot(e){if(this.#pn--,e){const t=this.#bn.get(e.id());t&&this.#bn.set(e.id(),t-1)}const t=this.#In.shift();t&&t.resolve()}static makeExtensionKey(e,t){if(er(t)&&t.extensionId)return`${e}-${t.extensionId}`;throw new Error("Invalid initiator")}static makeKey(e,t){if(t.frameId)return`${e}-${t.frameId}`;if(t.target)return`${e}-${t.target.id()}`;throw new Error("Invalid initiator")}resourceLoadedThroughExtension(e){const t=nr.makeExtensionKey(e.url,e.initiator);this.#vn.set(t,e),this.dispatchEventToListeners("Update")}async loadResource(e,t){if(er(t))throw new Error("Invalid initiator");const n=nr.makeKey(e,t),r={success:null,size:null,duration:null,errorMessage:void 0,url:e,initiator:t};this.#vn.set(n,r),this.dispatchEventToListeners("Update");const s=performance.now();try{await this.acquireLoadSlot(t.target);const n=this.dispatchLoad(e,t),s=await n;if(this.#mn||(window.clearTimeout(this.#fn),this.#fn=window.setTimeout((()=>{this.#mn||0!==this.#pn||(a.rnPerfMetrics.developerResourcesStartupLoadingFinishedEvent(this.getNumberOfResources().resources,performance.now()-3e3),this.#mn=!0)}),3e3)),r.errorMessage=s.errorDescription.message,r.success=s.success,s.success)return r.size=s.content.length,{content:s.content};throw new Error(s.errorDescription.message)}catch(e){throw void 0===r.errorMessage&&(r.errorMessage=e.message),null===r.success&&(r.success=!1),e}finally{r.duration=performance.now()-s,this.releaseLoadSlot(t.target),this.dispatchEventToListeners("Update")}}async dispatchLoad(t,n){if(er(n))throw new Error("Invalid initiator");let r=null;if(this.#wn)return await this.#wn(t);const s=new e.ParsedURL.ParsedURL(t),i=rr().get()&&s&&"file"!==s.scheme&&"data"!==s.scheme&&"devtools"!==s.scheme;if(a.userMetrics.developerResourceScheme(this.getDeveloperResourceScheme(s)),i){try{if(n.target){a.userMetrics.developerResourceLoaded(0),a.rnPerfMetrics.developerResourceLoadingStarted(s,0);const e=await this.loadFromTarget(n.target,n.frameId,t);return a.rnPerfMetrics.developerResourceLoadingFinished(s,0,e),e}const e=Nn.instance().getFrame(n.frameId);if(e){a.userMetrics.developerResourceLoaded(1),a.rnPerfMetrics.developerResourceLoadingStarted(s,1);const r=await this.loadFromTarget(e.resourceTreeModel().target(),n.frameId,t);return a.rnPerfMetrics.developerResourceLoadingFinished(s,0,r),r}}catch(e){e instanceof Error&&(a.userMetrics.developerResourceLoaded(2),r=e.message),a.rnPerfMetrics.developerResourceLoadingFinished(s,2,{success:!1,errorDescription:{message:r}})}a.userMetrics.developerResourceLoaded(3),a.rnPerfMetrics.developerResourceLoadingStarted(s,3)}else{const e=rr().get()?6:5;a.userMetrics.developerResourceLoaded(e),a.rnPerfMetrics.developerResourceLoadingStarted(s,e)}const o=await ce.instance().loadResource(t);return i&&!o.success&&a.userMetrics.developerResourceLoaded(7),r&&(o.errorDescription.message=`Fetch through target failed: ${r}; Fallback: ${o.errorDescription.message}`),a.rnPerfMetrics.developerResourceLoadingFinished(s,4,o),o}getDeveloperResourceScheme(e){if(!e||""===e.scheme)return 1;const t="localhost"===e.host||e.host.endsWith(".localhost");switch(e.scheme){case"file":return 7;case"data":return 6;case"blob":return 8;case"http":return t?4:2;case"https":return t?5:3}return 0}async loadFromTarget(t,n,r){const s=t.model(Z),i=t.model($n),o=e.Settings.Settings.instance().moduleSetting("cache-disabled").get(),l=await s.loadNetworkResource(n,r,{disableCache:o,includeCredentials:!0});try{const e=l.stream?await i.readToString(l.stream):"";return{success:l.success,content:e,errorDescription:{statusCode:l.httpStatusCode||0,netError:l.netError,netErrorName:l.netErrorName,message:a.ResourceLoader.netErrorToMessage(l.netError,l.httpStatusCode,l.netErrorName)||"",urlValid:void 0}}}finally{l.stream&&i.close(l.stream)}}}function rr(){return e.Settings.Settings.instance().createSetting("load-through-target",!0)}var sr=Object.freeze({__proto__:null,PageResourceLoader:nr,ResourceKey:class{key;constructor(e){this.key=e}},getLoadThroughTargetSetting:rr});function ir(e,t){return e.line-t.line||e.column-t.column}function or(e,t={line:0,column:0}){if(!e.originalScopes||void 0===e.generatedRanges)throw new Error('Cant decode scopes without "originalScopes" or "generatedRanges"');const n=ar(e.originalScopes,e.names??[]);return{originalScopes:n.map((e=>e.root)),generatedRanges:dr(e.generatedRanges,n,e.names??[],t)}}function ar(e,t){return e.map((e=>function(e,t){const n=new Map,r=[];let s=0,i=0;for(const[o,a]of function*(e){const t=new Er(e);let n=0,r=0;for(;t.hasNext();){","===t.peek()&&t.next();const[e,s]=[t.nextVLQ(),t.nextVLQ()];if(0===e&&st[e])),h={start:{line:s,column:e},end:{line:s,column:e},kind:l,name:d,isStackFrame:Boolean(4&a.flags),variables:c,children:[]};r.push(h),n.set(o,h)}else{const t=r.pop();if(!t)throw new Error('Scope items not nested properly: encountered "end" item without "start" item');if(t.end={line:s,column:e},0===r.length)return{root:t,scopeForItemIndex:n};t.parent=r[r.length-1],r[r.length-1].children.push(t)}}throw new Error("Malformed original scope encoding")}(e,t)))}function lr(e){return"flags"in e}function dr(e,t,n,r={line:0,column:0}){const s=[{start:{line:0,column:0},end:{line:0,column:0},isStackFrame:!1,isHidden:!1,children:[],values:[]}],i=new Map;for(const o of function*(e,t){const n=new Er(e);let r=t.line;const s={line:t.line,column:t.column,defSourceIdx:0,defScopeIdx:0,callsiteSourceIdx:0,callsiteLine:0,callsiteColumn:0};for(;n.hasNext();){if(";"===n.peek()){n.next(),++r;continue}if(","===n.peek()){n.next();continue}if(s.column=n.nextVLQ()+(r===s.line?s.column:0),s.line=r,null===n.peekVLQ()){yield{line:r,column:s.column};continue}const e={line:r,column:s.column,flags:n.nextVLQ(),bindings:[]};if(1&e.flags){const t=n.nextVLQ(),r=n.nextVLQ();s.defScopeIdx=r+(0===t?s.defScopeIdx:0),s.defSourceIdx+=t,e.definition={sourceIdx:s.defSourceIdx,scopeIdx:s.defScopeIdx}}if(2&e.flags){const t=n.nextVLQ(),r=n.nextVLQ(),i=n.nextVLQ();s.callsiteColumn=i+(0===r&&0===t?s.callsiteColumn:0),s.callsiteLine=r+(0===t?s.callsiteLine:0),s.callsiteSourceIdx+=t,e.callsite={sourceIdx:s.callsiteSourceIdx,line:s.callsiteLine,column:s.callsiteColumn}}for(;n.hasNext()&&";"!==n.peek()&&","!==n.peek();){const t=[];e.bindings.push(t);const r=n.nextVLQ();if(r>=-1){t.push({line:e.line,column:e.column,nameIdx:r});continue}t.push({line:e.line,column:e.column,nameIdx:n.nextVLQ()});const s=-r;for(let e=0;e{if(1===n.length)return ur(n[0].nameIdx,t);const r=n.map((e=>({from:{line:e.line,column:e.column},to:{line:e.line,column:e.column},value:ur(e.nameIdx,t)})));for(let e=1;e=0)throw new Error(`Invalid range. End before start: ${JSON.stringify(t)}`)}(e),e.sort(((e,t)=>ir(e.start,t.start)||ir(t.end,e.end)));const t={start:{line:0,column:0},end:{line:Number.POSITIVE_INFINITY,column:Number.POSITIVE_INFINITY},kind:"Global",isStackFrame:!1,children:[],variables:[]},n=[t];for(const t of e){let e=n.at(-1);for(;ir(e.end,t.start)<=0;)n.pop(),e=n.at(-1);if(ir(t.start,e.end)<0&&ir(e.end,t.end)<0)throw new Error(`Range ${JSON.stringify(t)} and ${JSON.stringify(e)} partially overlap.`);const r=mr(t);e.children.push(r),n.push(r)}const r=t.children.at(-1);return r&&(t.end=r.end),t}function mr(e){return{...e,kind:"Function",isStackFrame:!0,children:[],variables:[]}}function fr(e,t){const n=[];let r=0,s=0,i=0,o=0,a=0;const l=new Er(e);let d=!0;for(;l.hasNext();){if(d)d=!1;else{if(","!==l.peek())break;l.next()}r+=l.nextVLQ(),s=o+l.nextVLQ(),i+=l.nextVLQ(),o=s+l.nextVLQ(),a+=l.nextVLQ();const e=t[r];void 0!==e&&n.push({start:{line:s,column:i},end:{line:o,column:a},name:e})}return n}var br=Object.freeze({__proto__:null,buildOriginalScopes:pr,decodePastaRanges:fr});const yr={local:"Local",closure:"Closure",block:"Block",global:"Global",returnValue:"Return value"},vr=n.i18n.registerUIStrings("core/sdk/SourceMapScopeChainEntry.ts",yr),Ir=n.i18n.getLocalizedString.bind(void 0,vr);class wr{#Sn;#kn;#Pe;#Cn;#xn;constructor(e,t,n,r,s){this.#Sn=e,this.#kn=t,this.#Pe=n,this.#Cn=r,this.#xn=s}extraProperties(){return this.#xn?[new qn(Ir(yr.returnValue),this.#xn,void 0,void 0,void 0,void 0,void 0,!0)]:[]}callFrame(){return this.#Sn}type(){switch(this.#kn.kind){case"global":return"global";case"function":return this.#Cn?"local":"closure";case"block":return"block"}return this.#kn.kind??""}typeName(){switch(this.#kn.kind){case"global":return Ir(yr.global);case"function":return this.#Cn?Ir(yr.local):Ir(yr.closure);case"block":return Ir(yr.block)}return this.#kn.kind??""}name(){return this.#kn.name}range(){return null}object(){return new Sr(this.#Sn,this.#kn,this.#Pe)}description(){return""}icon(){}}class Sr extends _n{#Sn;#kn;#Pe;constructor(e,t,n){super(e.debuggerModel.runtimeModel(),void 0,"object",void 0,null),this.#Sn=e,this.#kn=t,this.#Pe=n}async doGetProperties(e,t,n){if(t)return{properties:[],internalProperties:[]};const r=[];for(const[e,t]of this.#kn.variables.entries()){const s=this.#Rn(e);if(null===s){r.push(Sr.#Tn(t));continue}const i=await this.#Sn.evaluate({expression:s,generatePreview:n});"error"in i||i.exceptionDetails?r.push(Sr.#Tn(t)):r.push(new qn(t,i.object,!1,!1,!0,!1))}return{properties:r,internalProperties:[]}}#Rn(e){if(!this.#Pe)return null;const t=this.#Pe.values[e];if("string"==typeof t)return t;if(void 0===t)return null;const n=this.#Sn.location();for(const e of t)if(xr({start:e.from,end:e.to},n.lineNumber,n.columnNumber))return e.value??null;return null}static#Tn(e){return new qn(e,null,!1,!1,!0,!1)}}var kr=Object.freeze({__proto__:null,SourceMapScopeChainEntry:wr});class Cr{#Mn;#Pn;#En;#Ln=null;constructor(e,t,n){this.#Mn=e,this.#Pn=t,this.#En=n}addOriginalScopes(e){for(const t of e)this.#Pn.push(t)}addGeneratedRanges(e){for(const t of e)this.#En.push(t)}hasOriginalScopes(e){return Boolean(this.#Pn[e])}addOriginalScopesAtIndex(e,t){if(this.#Pn[e])throw new Error(`Trying to re-augment existing scopes for source at index: ${e}`);this.#Pn[e]=t}findInlinedFunctions(e,t){const n=this.#An(e,t),r={inlinedFunctions:[],originalFunctionName:""};for(let e=n.length-1;e>=0;--e){const t=n[e];if(t.callsite&&r.inlinedFunctions.push({name:t.originalScope?.name??"",callsite:t.callsite}),t.isStackFrame){r.originalFunctionName=t.originalScope?.name??"";break}}return r}expandCallFrame(e){const{originalFunctionName:t,inlinedFunctions:n}=this.findInlinedFunctions(e.location().lineNumber,e.location().columnNumber),r=[];for(const[t,s]of n.entries())r.push(e.createVirtualCallFrame(t,s.name));return r.push(e.createVirtualCallFrame(r.length,t)),r}#An(e,t){const n=[];return function r(s){for(const i of s)xr(i,e,t)&&(n.push(i),r(i.children))}(this.#En),n}hasVariablesAndBindings(){return null===this.#Ln&&(this.#Ln=this.#On()),this.#Ln}#On(){function e(t){for(const n of t)if(n){if("variables"in n&&n.variables.length>0)return!0;if("values"in n&&n.values.some((e=>void 0!==e)))return!0;if(e(n.children))return!0}return!1}return e(this.#Pn)&&e(this.#En)}resolveMappedScopeChain(e){const t=this.#Dn(e),n=t.at(-1)?.originalScope;if(void 0===n)return null;let r=!1;const s=[];for(let n=t.at(-1)?.originalScope;n;n=n.parent){const i=t.findLast((e=>e.originalScope===n)),o="function"===n.kind,a=o&&!r,l=a?e.returnValue():null;s.push(new wr(e,n,i,a,l??void 0)),r||=o}if(null!==e.returnValue())for(;s.length&&"local"!==s[0].type();)s.shift();return s}#Dn(e){const t=this.#An(e.location().lineNumber,e.location().columnNumber);if(0===e.inlineFrameIndex)return t;for(let n=0;n0){const r=this.#An(e,t);n=r.at(-1)?.originalScope}else{const r=this.#Mn.findEntry(e,t);if(void 0===r?.sourceIndex)return null;n=this.#Nn({sourceIndex:r.sourceIndex,line:r.sourceLineNumber,column:r.sourceColumnNumber}).at(-1)}for(let e=n;e;e=e.parent)if(e.isStackFrame)return e.name??"";return null}#Nn({sourceIndex:e,line:t,column:n}){const r=this.#Pn[e];if(!r)return[];const s=[];return function e(r){for(const i of r)xr(i,t,n)&&(s.push(i),e(i.children))}([r]),s}}function xr(e,t,n){return!(e.start.line>t||e.start.line===t&&e.start.column>n)&&!(e.end.line"url"in e))&&e.Console.Console.instance().warn(`SourceMap "${n}" contains unsupported "URL" field in one of its sections.`),this.eachSection(this.parseSources.bind(this))}json(){return this.#Fn}augmentWithScopes(e,t){if(this.#Vn(),this.#Fn&&this.#Fn.version>3)throw new Error("Only support augmenting source maps up to version 3.");const n=this.#Wn(e);if(!(n>=0))throw new Error(`Could not find sourceURL ${e} in sourceMap`);if(this.#jn||(this.#jn=new Cr(this,[],[])),!this.#jn.hasOriginalScopes(n)){const e=pr(t);this.#jn.addOriginalScopesAtIndex(n,e)}}#Wn(e){return this.#qn.findIndex((t=>t.sourceURL===e))}compiledURL(){return this.#Bn}url(){return this.#_n}sourceURLs(){return[...this.#zn.keys()]}embeddedContentByURL(e){const t=this.#zn.get(e);return t?t.content:null}hasScopeInfo(){return this.#Vn(),null!==this.#jn}findEntry(e,t,n){if(this.#Vn(),n&&null!==this.#jn){const{inlinedFunctions:r}=this.#jn.findInlinedFunctions(e,t),{callsite:s}=r[n-1];return s?{lineNumber:e,columnNumber:t,sourceIndex:s.sourceIndex,sourceURL:this.sourceURLs()[s.sourceIndex],sourceLineNumber:s.line,sourceColumnNumber:s.column,name:void 0}:(console.error("Malformed source map. Expected to have a callsite info for index",n),null)}const s=this.mappings(),i=r.ArrayUtilities.upperBound(s,void 0,((n,r)=>e-r.lineNumber||t-r.columnNumber));return i?s[i-1]:null}findEntryRanges(e,n){const s=this.mappings(),i=r.ArrayUtilities.upperBound(s,void 0,((t,r)=>e-r.lineNumber||n-r.columnNumber));if(!i)return null;const o=i-1,a=s[o].sourceURL;if(!a)return null;const l=iu-s[t].sourceLineNumber||g-s[t].sourceColumnNumber));if(!p)return null;const m=p=i.length||s[i[o]].sourceLineNumber!==t)return null;const l=i.slice(o,a);if(!l.length)return null;const d=r.ArrayUtilities.lowerBound(l,n,((e,t)=>e-s[t].sourceColumnNumber));return d>=l.length?s[l[l.length-1]]:s[l[d]];function c(e,t){return e-s[t].sourceLineNumber}}findReverseIndices(e,t,n){const s=this.mappings(),i=this.reversedMappings(e),o=r.ArrayUtilities.upperBound(i,void 0,((e,r)=>t-s[r].sourceLineNumber||n-s[r].sourceColumnNumber));let a=o;for(;a>0&&s[i[a-1]].sourceLineNumber===s[i[o-1]].sourceLineNumber&&s[i[a-1]].sourceColumnNumber===s[i[o-1]].sourceColumnNumber;)--a;return i.slice(a,o)}findReverseEntries(e,t,n){const r=this.mappings();return this.findReverseIndices(e,t,n).map((e=>r[e]))}findReverseRanges(e,n,r){const s=this.mappings(),i=this.findReverseIndices(e,n,r),o=[];for(let e=0;e{if(!e)return;return pr(fr(e,n))}))}isSeparator(e){return","===e||";"===e}reverseMapTextRanges(e,n){const s=this.reversedMappings(e),i=this.mappings();if(0===s.length)return[];let o=r.ArrayUtilities.lowerBound(s,n,(({startLine:e,startColumn:t},n)=>{const{sourceLineNumber:r,sourceColumnNumber:s}=i[n];return e-r||t-s}));for(;o===s.length||o>0&&(i[s[o]].sourceLineNumber>n.startLine||i[s[o]].sourceColumnNumber>n.startColumn);)o--;let a=o+1;for(;a0){const t=e[0];return 0===t?.lineNumber||0===t.columnNumber}return!1}hasIgnoreListHint(e){return this.#zn.get(e)?.ignoreListHint??!1}findRanges(e,n){const r=this.mappings(),s=[];if(!r.length)return[];let i=null;0===r[0].lineNumber&&0===r[0].columnNumber||!n?.isStartMatching||(i=t.TextRange.TextRange.createUnboundedFromLocation(0,0),s.push(i));for(const{sourceURL:n,lineNumber:o,columnNumber:a}of r){const r=n&&e(n);i||!r?i&&!r&&(i.endLine=o,i.endColumn=a,i=null):(i=t.TextRange.TextRange.createUnboundedFromLocation(o,a),s.push(i))}return s}compatibleForURL(e,t){return this.embeddedContentByURL(e)===t.embeddedContentByURL(e)&&this.hasIgnoreListHint(e)===t.hasIgnoreListHint(e)}expandCallFrame(e){return this.#Vn(),null===this.#jn?[e]:this.#jn.expandCallFrame(e)}resolveScopeChain(e){return this.#Vn(),null===this.#jn?null:this.#jn.resolveMappedScopeChain(e)}findOriginalFunctionName(e){return this.#Vn(),this.#jn?.findOriginalFunctionName(e)??null}}class Er{#Kn;#Qn;constructor(e){this.#Kn=e,this.#Qn=0}next(){return this.#Kn.charAt(this.#Qn++)}nextCharCode(){return this.#Kn.charCodeAt(this.#Qn++)}peek(){return this.#Kn.charAt(this.#Qn)}hasNext(){return this.#Qn>=1,s?-t:t}peekVLQ(){const e=this.#Qn;try{return this.nextVLQ()}catch{return null}finally{this.#Qn=e}}}var Lr,Ar=Object.freeze({__proto__:null,SourceMap:Pr,SourceMapEntry:Mr,TokenIterator:Er,parseSourceMap:Tr});class Or extends e.ObjectWrapper.ObjectWrapper{#$n;#Xn=!0;#Jn=new Map;#Yn=new Map;#Zn=null;constructor(e){super(),this.#$n=e}setEnabled(e){if(e===this.#Xn)return;const t=[...this.#Jn.entries()];for(const[e]of t)this.detachSourceMap(e);this.#Xn=e;for(const[e,{relativeSourceURL:n,relativeSourceMapURL:r}]of t)this.attachSourceMap(e,n,r)}static getBaseUrl(e){for(;e&&e.type()!==U.FRAME;)e=e.parentTarget();return e?.inspectedURL()??r.DevToolsPath.EmptyUrlString}static resolveRelativeSourceURL(t,n){return n=e.ParsedURL.ParsedURL.completeURL(Or.getBaseUrl(t),n)??n}sourceMapForClient(e){return this.#Jn.get(e)?.sourceMap}sourceMapForClientPromise(e){const t=this.#Jn.get(e);return t?t.sourceMapPromise:Promise.resolve(void 0)}clientForSourceMap(e){return this.#Yn.get(e)}attachSourceMap(t,n,r){if(this.#Jn.has(t))throw new Error("SourceMap is already attached or being attached to client");if(!r)return;let s={relativeSourceURL:n,relativeSourceMapURL:r,sourceMap:void 0,sourceMapPromise:Promise.resolve(void 0)};if(this.#Xn){const i=Or.resolveRelativeSourceURL(this.#$n,n),o=e.ParsedURL.ParsedURL.completeURL(i,r);if(o)if(this.#Zn&&console.error("Attaching source map may cancel previously attaching source map"),this.#Zn=t,this.dispatchEventToListeners(Lr.SourceMapWillAttach,{client:t}),this.#Zn===t){this.#Zn=null;const e=t.createPageResourceLoadInitiator();s.sourceMapPromise=Dr(o,e).then((e=>{const n=new Pr(i,o,e);return this.#Jn.get(t)===s&&(s.sourceMap=n,this.#Yn.set(n,t),this.dispatchEventToListeners(Lr.SourceMapAttached,{client:t,sourceMap:n})),n}),(()=>{this.#Jn.get(t)===s&&this.dispatchEventToListeners(Lr.SourceMapFailedToAttach,{client:t})}))}else this.#Zn&&console.error("Cancelling source map attach because another source map is attaching"),s=null,this.dispatchEventToListeners(Lr.SourceMapFailedToAttach,{client:t})}s&&this.#Jn.set(t,s)}cancelAttachSourceMap(e){e===this.#Zn?this.#Zn=null:this.#Zn?console.error("cancel attach source map requested but a different source map was being attached"):console.error("cancel attach source map requested but no source map was being attached")}detachSourceMap(e){const t=this.#Jn.get(e);if(!t)return;if(this.#Jn.delete(e),!this.#Xn)return;const{sourceMap:n}=t;n?(this.#Yn.delete(n),this.dispatchEventToListeners(Lr.SourceMapDetached,{client:e,sourceMap:n})):this.dispatchEventToListeners(Lr.SourceMapFailedToAttach,{client:e})}}async function Dr(e,t){try{const{content:n}=await nr.instance().loadResource(e,t);return Tr(n)}catch(t){throw new Error(`Could not load content for ${e}: ${t.message}`,{cause:t})}}!function(e){e.SourceMapWillAttach="SourceMapWillAttach",e.SourceMapFailedToAttach="SourceMapFailedToAttach",e.SourceMapAttached="SourceMapAttached",e.SourceMapDetached="SourceMapDetached"}(Lr||(Lr={}));var Nr,Fr=Object.freeze({__proto__:null,get Events(){return Lr},SourceMapManager:Or,loadSourceMap:Dr,tryLoadSourceMap:async function(e,t){try{const{content:n}=await nr.instance().loadResource(e,t);return Tr(n)}catch(t){return console.error(`Could not load content for ${e}: ${t.message}`,{cause:t}),null}}});class Br extends h{agent;#er;#tr=new Map;#nr=new Map;#rr;#sr;#ir;#or=new e.Throttler.Throttler(Wr);#ar=new Map;#lr=new Map;#dr=null;#cr=null;#hr=null;#ur=!1;#Xn=!1;#gr=!1;#pr=!1;#mr;constructor(t){super(t),this.#er=t.model(Gs),this.#sr=new Or(t),this.agent=t.cssAgent(),this.#ir=new zr(this),this.#rr=t.model(ii),this.#rr&&this.#rr.addEventListener(ri.PrimaryPageChanged,this.onPrimaryPageChanged,this),t.registerCSSDispatcher(new qr(this)),t.suspended()||this.enable(),this.#sr.setEnabled(e.Settings.Settings.instance().moduleSetting("css-source-maps-enabled").get()),e.Settings.Settings.instance().moduleSetting("css-source-maps-enabled").addChangeListener((e=>this.#sr.setEnabled(e.data)))}async colorScheme(){if(!this.#mr){const e=await(this.domModel()?.target().runtimeAgent().invoke_evaluate({expression:'window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches'}));!e||e.exceptionDetails||e.getError()||(this.#mr=e.result.value?"dark":"light")}return this.#mr}async resolveValues(e,...t){const n=await this.agent.invoke_resolveValues({values:t,nodeId:e});return n.getError()?null:n.results}headersForSourceURL(e){const t=[];for(const n of this.getStyleSheetIdsForURL(e)){const e=this.styleSheetHeaderForId(n);e&&t.push(e)}return t}createRawLocationsByURL(e,t,n=0){const s=this.headersForSourceURL(e);s.sort((function(e,t){return e.startLine-t.startLine||e.startColumn-t.startColumn||e.id.localeCompare(t.id)}));const i=r.ArrayUtilities.upperBound(s,void 0,((e,r)=>t-r.startLine||n-r.startColumn));if(!i)return[];const o=[],a=s[i-1];for(let e=i-1;e>=0&&s[e].startLine===a.startLine&&s[e].startColumn===a.startColumn;--e)s[e].containsLocation(t,n)&&o.push(new Ur(s[e],t,n));return o}sourceMapManager(){return this.#sr}static readableLayerName(e){return e||""}static trimSourceURL(e){let t=e.lastIndexOf("/*# sourceURL=");if(-1===t&&(t=e.lastIndexOf("/*@ sourceURL="),-1===t))return e;const n=e.lastIndexOf("\n",t);if(-1===n)return e;const r=e.substr(n+1).split("\n",1)[0];return-1===r.search(/[\x20\t]*\/\*[#@] sourceURL=[\x20\t]*([^\s]*)[\x20\t]*\*\/[\x20\t]*$/)?e:e.substr(0,n)+e.substr(n+r.length+1)}domModel(){return this.#er}async trackComputedStyleUpdatesForNode(e){await this.agent.invoke_trackComputedStyleUpdatesForNode({nodeId:e})}async setStyleText(e,t,n,r){try{await this.ensureOriginalStyleSheetText(e);const{styles:s}=await this.agent.invoke_setStyleTexts({edits:[{styleSheetId:e,range:t.serializeToObject(),text:n}]});if(!s||1!==s.length)return!1;this.#er.markUndoableState(!r);const i=new Hr(e,t,n,s[0]);return this.fireStyleSheetChanged(e,i),!0}catch(e){return console.error(e),!1}}async setSelectorText(e,t,n){a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{selectorList:r}=await this.agent.invoke_setRuleSelector({styleSheetId:e,range:t,selector:n});if(!r)return!1;this.#er.markUndoableState();const s=new Hr(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return console.error(e),!1}}async setPropertyRulePropertyName(e,t,n){a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{propertyName:r}=await this.agent.invoke_setPropertyRulePropertyName({styleSheetId:e,range:t,propertyName:n});if(!r)return!1;this.#er.markUndoableState();const s=new Hr(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return console.error(e),!1}}async setKeyframeKey(e,t,n){a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{keyText:r}=await this.agent.invoke_setKeyframeKey({styleSheetId:e,range:t,keyText:n});if(!r)return!1;this.#er.markUndoableState();const s=new Hr(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return console.error(e),!1}}startCoverage(){return this.#gr=!0,this.agent.invoke_startRuleUsageTracking()}async takeCoverageDelta(){const e=await this.agent.invoke_takeCoverageDelta();return{timestamp:e?.timestamp||0,coverage:e?.coverage||[]}}setLocalFontsEnabled(e){return this.agent.invoke_setLocalFontsEnabled({enabled:e})}async stopCoverage(){this.#gr=!1,await this.agent.invoke_stopRuleUsageTracking()}async getMediaQueries(){const{medias:e}=await this.agent.invoke_getMediaQueries();return e?$t.parseMediaArrayPayload(this,e):[]}async getRootLayer(e){const{rootLayer:t}=await this.agent.invoke_getLayersForNode({nodeId:e});return t}isEnabled(){return this.#Xn}async enable(){await this.agent.invoke_enable(),this.#Xn=!0,this.#gr&&await this.startCoverage(),this.dispatchEventToListeners(Nr.ModelWasEnabled)}async getAnimatedStylesForNode(e){const t=await this.agent.invoke_getAnimatedStylesForNode({nodeId:e});return t.getError()?null:t}async getMatchedStyles(e){const t=this.#er.nodeForId(e);if(!t)return null;const n=o.Runtime.hostConfig.devToolsAnimationStylesInStylesTab?.enabled,[r,s]=await Promise.all([this.agent.invoke_getMatchedStylesForNode({nodeId:e}),n?this.agent.invoke_getAnimatedStylesForNode({nodeId:e}):void 0]);if(r.getError())return null;const i={cssModel:this,node:t,inlinePayload:r.inlineStyle||null,attributesPayload:r.attributesStyle||null,matchedPayload:r.matchedCSSRules||[],pseudoPayload:r.pseudoElements||[],inheritedPayload:r.inherited||[],inheritedPseudoPayload:r.inheritedPseudoElements||[],animationsPayload:r.cssKeyframesRules||[],parentLayoutNodeId:r.parentLayoutNodeId,positionTryRules:r.cssPositionTryRules||[],propertyRules:r.cssPropertyRules??[],functionRules:r.cssFunctionRules??[],cssPropertyRegistrations:r.cssPropertyRegistrations??[],fontPaletteValuesRule:r.cssFontPaletteValuesRule,activePositionFallbackIndex:r.activePositionFallbackIndex??-1,animationStylesPayload:s?.animationStyles||[],inheritedAnimatedPayload:s?.inherited||[],transitionsStylePayload:s?.transitionsStyle||null};return await In.create(i)}async getClassNames(e){const{classNames:t}=await this.agent.invoke_collectClassNames({styleSheetId:e});return t||[]}async getComputedStyle(e){return this.isEnabled()||await this.enable(),await this.#ir.computedStylePromise(e)}async getLayoutPropertiesFromComputedStyle(e){const t=await this.getComputedStyle(e);if(!t)return null;const n=t.get("display"),r="flex"===n||"inline-flex"===n,s="grid"===n||"inline-grid"===n,i=(s&&(t.get("grid-template-columns")?.startsWith("subgrid")||t.get("grid-template-rows")?.startsWith("subgrid")))??!1,o=t.get("container-type");return{isFlex:r,isGrid:s,isSubgrid:i,isContainer:Boolean(o)&&""!==o&&"normal"!==o,hasScroll:Boolean(t.get("scroll-snap-type"))&&"none"!==t.get("scroll-snap-type")}}async getBackgroundColors(e){const t=await this.agent.invoke_getBackgroundColors({nodeId:e});return t.getError()?null:{backgroundColors:t.backgroundColors||null,computedFontSize:t.computedFontSize||"",computedFontWeight:t.computedFontWeight||""}}async getPlatformFonts(e){const{fonts:t}=await this.agent.invoke_getPlatformFontsForNode({nodeId:e});return t}allStyleSheets(){const e=[...this.#lr.values()];return e.sort((function(e,t){return e.sourceURLt.sourceURL?1:e.startLine-t.startLine||e.startColumn-t.startColumn})),e}async getInlineStyles(e){const t=await this.agent.invoke_getInlineStylesForNode({nodeId:e});if(t.getError()||!t.inlineStyle)return null;const n=new en(this,null,t.inlineStyle,Yt.Inline),r=t.attributesStyle?new en(this,null,t.attributesStyle,Yt.Attributes):null;return new jr(n,r)}forcePseudoState(e,t,n){const s=e.marker(_r)||[],i=s.includes(t);if(n){if(i)return!1;s.push(t),e.setMarker(_r,s)}else{if(!i)return!1;r.ArrayUtilities.removeElement(s,t),s.length?e.setMarker(_r,s):e.setMarker(_r,null)}return void 0!==e.id&&(this.agent.invoke_forcePseudoState({nodeId:e.id,forcedPseudoClasses:s}),this.dispatchEventToListeners(Nr.PseudoStateForced,{node:e,pseudoClass:t,enable:n}),!0)}pseudoState(e){return e.marker(_r)||[]}async setMediaText(e,t,n){a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{media:r}=await this.agent.invoke_setMediaText({styleSheetId:e,range:t,text:n});if(!r)return!1;this.#er.markUndoableState();const s=new Hr(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return console.error(e),!1}}async setContainerQueryText(e,t,n){a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{containerQuery:r}=await this.agent.invoke_setContainerQueryText({styleSheetId:e,range:t,text:n});if(!r)return!1;this.#er.markUndoableState();const s=new Hr(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return console.error(e),!1}}async setSupportsText(e,t,n){a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{supports:r}=await this.agent.invoke_setSupportsText({styleSheetId:e,range:t,text:n});if(!r)return!1;this.#er.markUndoableState();const s=new Hr(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return console.error(e),!1}}async setScopeText(e,t,n){a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{scope:r}=await this.agent.invoke_setScopeText({styleSheetId:e,range:t,text:n});if(!r)return!1;this.#er.markUndoableState();const s=new Hr(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return console.error(e),!1}}async addRule(e,t,n){try{await this.ensureOriginalStyleSheetText(e);const{rule:r}=await this.agent.invoke_addRule({styleSheetId:e,ruleText:t,location:n});if(!r)return null;this.#er.markUndoableState();const s=new Hr(e,n,t,r);return this.fireStyleSheetChanged(e,s),new an(this,r)}catch(e){return console.error(e),null}}async requestViaInspectorStylesheet(e){const t=e||(this.#rr&&this.#rr.mainFrame?this.#rr.mainFrame.id:null),n=[...this.#lr.values()].find((e=>e.frameId===t&&e.isViaInspector()));if(n)return n;if(!t)return null;try{return await this.createInspectorStylesheet(t)}catch(e){return console.error(e),null}}async createInspectorStylesheet(e,t=!1){const n=await this.agent.invoke_createStyleSheet({frameId:e,force:t});if(n.getError())throw new Error(n.getError());return this.#lr.get(n.styleSheetId)||null}mediaQueryResultChanged(){this.#mr=void 0,this.dispatchEventToListeners(Nr.MediaQueryResultChanged)}fontsUpdated(e){e&&this.#tr.set(e.src,new pe(e)),this.dispatchEventToListeners(Nr.FontsUpdated)}fontFaces(){return[...this.#tr.values()]}fontFaceForSource(e){return this.#tr.get(e)}styleSheetHeaderForId(e){return this.#lr.get(e)||null}styleSheetHeaders(){return[...this.#lr.values()]}fireStyleSheetChanged(e,t){this.dispatchEventToListeners(Nr.StyleSheetChanged,{styleSheetId:e,edit:t})}ensureOriginalStyleSheetText(e){const t=this.styleSheetHeaderForId(e);if(!t)return Promise.resolve(null);let n=this.#nr.get(t);return n||(n=this.getStyleSheetText(t.id),this.#nr.set(t,n),this.originalContentRequestedForTest(t)),n}originalContentRequestedForTest(e){}originalStyleSheetText(e){return this.ensureOriginalStyleSheetText(e.id)}getAllStyleSheetHeaders(){return this.#lr.values()}computedStyleUpdated(e){this.dispatchEventToListeners(Nr.ComputedStyleUpdated,{nodeId:e})}styleSheetAdded(e){console.assert(!this.#lr.get(e.styleSheetId)),e.loadingFailed&&(e.hasSourceURL=!1,e.isConstructed=!0,e.isInline=!1,e.isMutable=!1,e.sourceURL="",e.sourceMapURL=void 0);const t=new An(this,e);this.#lr.set(e.styleSheetId,t);const n=t.resourceURL();let r=this.#ar.get(n);if(r||(r=new Map,this.#ar.set(n,r)),r){let e=r.get(t.frameId);e||(e=new Set,r.set(t.frameId,e)),e.add(t.id)}this.#sr.attachSourceMap(t,t.sourceURL,t.sourceMapURL),this.dispatchEventToListeners(Nr.StyleSheetAdded,t)}styleSheetRemoved(e){const t=this.#lr.get(e);if(console.assert(Boolean(t)),!t)return;this.#lr.delete(e);const n=t.resourceURL(),r=this.#ar.get(n);if(console.assert(Boolean(r),"No frameId to styleSheetId map is available for given style sheet URL."),r){const s=r.get(t.frameId);s&&(s.delete(e),s.size||(r.delete(t.frameId),r.size||this.#ar.delete(n)))}this.#nr.delete(t),this.#sr.detachSourceMap(t),this.dispatchEventToListeners(Nr.StyleSheetRemoved,t)}getStyleSheetIdsForURL(e){const t=this.#ar.get(e);if(!t)return[];const n=[];for(const e of t.values())n.push(...e);return n}async setStyleSheetText(e,t,n){const r=this.#lr.get(e);if(!r)return"Unknown stylesheet in CSS.setStyleSheetText";t=Br.trimSourceURL(t),r.hasSourceURL&&(t+="\n/*# sourceURL="+r.sourceURL+" */"),await this.ensureOriginalStyleSheetText(e);const s=(await this.agent.invoke_setStyleSheetText({styleSheetId:r.id,text:t})).sourceMapURL;return this.#sr.detachSourceMap(r),r.setSourceMapURL(s),this.#sr.attachSourceMap(r,r.sourceURL,r.sourceMapURL),null===s?"Error in CSS.setStyleSheetText":(this.#er.markUndoableState(!n),this.fireStyleSheetChanged(e),null)}async getStyleSheetText(e){const t=await this.agent.invoke_getStyleSheetText({styleSheetId:e});if(t.getError())return null;const{text:n}=t;return n&&Br.trimSourceURL(n)}async onPrimaryPageChanged(e){e.data.frame.backForwardCacheDetails.restoredFromCache?(await this.suspendModel(),await this.resumeModel()):"Activation"!==e.data.type&&(this.resetStyleSheets(),this.resetFontFaces())}resetStyleSheets(){const e=[...this.#lr.values()];this.#ar.clear(),this.#lr.clear();for(const t of e)this.#sr.detachSourceMap(t),this.dispatchEventToListeners(Nr.StyleSheetRemoved,t)}resetFontFaces(){this.#tr.clear()}async suspendModel(){this.#Xn=!1,await this.agent.invoke_disable(),this.resetStyleSheets(),this.resetFontFaces()}async resumeModel(){return await this.enable()}setEffectivePropertyValueForNode(e,t,n){this.agent.invoke_setEffectivePropertyValueForNode({nodeId:e,propertyName:t,value:n})}cachedMatchedCascadeForNode(e){if(this.#dr!==e&&this.discardCachedMatchedCascade(),this.#dr=e,!this.#cr){if(!e.id)return Promise.resolve(null);this.#cr=this.getMatchedStyles(e.id)}return this.#cr}discardCachedMatchedCascade(){this.#dr=null,this.#cr=null}createCSSPropertyTracker(e){return new Vr(this,e)}enableCSSPropertyTracker(e){const t=e.getTrackedProperties();0!==t.length&&(this.agent.invoke_trackComputedStyleUpdates({propertiesToTrack:t}),this.#ur=!0,this.#hr=e,this.pollComputedStyleUpdates())}disableCSSPropertyTracker(){this.#ur=!1,this.#hr=null,this.agent.invoke_trackComputedStyleUpdates({propertiesToTrack:[]})}async pollComputedStyleUpdates(){if(!this.#pr){if(this.#ur){this.#pr=!0;const e=await this.agent.invoke_takeComputedStyleUpdates();if(this.#pr=!1,e.getError()||!e.nodeIds||!this.#ur)return;this.#hr&&this.#hr.dispatchEventToListeners("TrackedCSSPropertiesUpdated",e.nodeIds.map((e=>this.#er.nodeForId(e))))}this.#ur&&this.#or.schedule(this.pollComputedStyleUpdates.bind(this))}}dispose(){this.disableCSSPropertyTracker(),super.dispose(),this.dispatchEventToListeners(Nr.ModelDisposed,this)}getAgent(){return this.agent}}!function(e){e.FontsUpdated="FontsUpdated",e.MediaQueryResultChanged="MediaQueryResultChanged",e.ModelWasEnabled="ModelWasEnabled",e.ModelDisposed="ModelDisposed",e.PseudoStateForced="PseudoStateForced",e.StyleSheetAdded="StyleSheetAdded",e.StyleSheetChanged="StyleSheetChanged",e.StyleSheetRemoved="StyleSheetRemoved",e.ComputedStyleUpdated="ComputedStyleUpdated"}(Nr||(Nr={}));const _r="pseudo-state-marker";class Hr{styleSheetId;oldRange;newRange;newText;payload;constructor(e,n,r,s){this.styleSheetId=e,this.oldRange=n,this.newRange=t.TextRange.TextRange.fromEdit(n,r),this.newText=r,this.payload=s}}class Ur{#je;styleSheetId;url;lineNumber;columnNumber;constructor(e,t,n){this.#je=e.cssModel(),this.styleSheetId=e.id,this.url=e.resourceURL(),this.lineNumber=t,this.columnNumber=n||0}cssModel(){return this.#je}header(){return this.#je.styleSheetHeaderForId(this.styleSheetId)}}class qr{#lt;constructor(e){this.#lt=e}mediaQueryResultChanged(){this.#lt.mediaQueryResultChanged()}fontsUpdated({font:e}){this.#lt.fontsUpdated(e)}styleSheetChanged({styleSheetId:e}){this.#lt.fireStyleSheetChanged(e)}styleSheetAdded({header:e}){this.#lt.styleSheetAdded(e)}styleSheetRemoved({styleSheetId:e}){this.#lt.styleSheetRemoved(e)}computedStyleUpdated({nodeId:e}){this.#lt.computedStyleUpdated(e)}}class zr{#lt;#fr=new Map;constructor(e){this.#lt=e}computedStylePromise(e){let t=this.#fr.get(e);return t||(t=this.#lt.getAgent().invoke_getComputedStyleForNode({nodeId:e}).then((({computedStyle:t})=>{if(this.#fr.delete(e),!t?.length)return null;const n=new Map;for(const e of t)n.set(e.name,e.value);return n})),this.#fr.set(e,t),t)}}class jr{inlineStyle;attributesStyle;constructor(e,t){this.inlineStyle=e,this.attributesStyle=t}}class Vr extends e.ObjectWrapper.ObjectWrapper{#lt;#br;constructor(e,t){super(),this.#lt=e,this.#br=t}start(){this.#lt.enableCSSPropertyTracker(this)}stop(){this.#lt.disableCSSPropertyTracker()}getTrackedProperties(){return this.#br}}const Wr=1e3;h.register(Br,{capabilities:2,autostart:!0});var Gr=Object.freeze({__proto__:null,CSSLocation:Ur,CSSModel:Br,CSSPropertyTracker:Vr,Edit:Hr,get Events(){return Nr},InlineStyleResult:jr});class Kr extends h{#yr;#vr;#Ir;#wr;constructor(e){super(e),e.registerHeapProfilerDispatcher(new Qr(this)),this.#yr=!1,this.#vr=e.heapProfilerAgent(),this.#Ir=e.model(Jr),this.#wr=0}debuggerModel(){return this.#Ir.debuggerModel()}runtimeModel(){return this.#Ir}async enable(){this.#yr||(this.#yr=!0,await this.#vr.invoke_enable())}async startSampling(e){if(this.#wr++)return!1;const t=await this.#vr.invoke_startSampling({samplingInterval:e||16384});return Boolean(t.getError())}async stopSampling(){if(!this.#wr)throw new Error("Sampling profiler is not running.");if(--this.#wr)return await this.getSamplingProfile();const e=await this.#vr.invoke_stopSampling();return e.getError()?null:e.profile}async getSamplingProfile(){const e=await this.#vr.invoke_getSamplingProfile();return e.getError()?null:e.profile}async collectGarbage(){const e=await this.#vr.invoke_collectGarbage();return Boolean(e.getError())}async snapshotObjectIdForObjectId(e){const t=await this.#vr.invoke_getHeapObjectId({objectId:e});return t.getError()?null:t.heapSnapshotObjectId}async objectForSnapshotObjectId(e,t){const n=await this.#vr.invoke_getObjectByHeapObjectId({objectId:e,objectGroup:t});return n.getError()?null:this.#Ir.createRemoteObject(n.result)}async addInspectedHeapObject(e){const t=await this.#vr.invoke_addInspectedHeapObject({heapObjectId:e});return Boolean(t.getError())}async takeHeapSnapshot(e){const t=await this.#vr.invoke_takeHeapSnapshot(e);return Boolean(t.getError())}async startTrackingHeapObjects(e){const t=await this.#vr.invoke_startTrackingHeapObjects({trackAllocations:e});return Boolean(t.getError())}async stopTrackingHeapObjects(e){const t=await this.#vr.invoke_stopTrackingHeapObjects({reportProgress:e});return Boolean(t.getError())}heapStatsUpdate(e){this.dispatchEventToListeners("HeapStatsUpdate",e)}lastSeenObjectId(e,t){this.dispatchEventToListeners("LastSeenObjectId",{lastSeenObjectId:e,timestamp:t})}addHeapSnapshotChunk(e){this.dispatchEventToListeners("AddHeapSnapshotChunk",e)}reportHeapSnapshotProgress(e,t,n){this.dispatchEventToListeners("ReportHeapSnapshotProgress",{done:e,total:t,finished:n})}resetProfiles(){this.dispatchEventToListeners("ResetProfiles",this)}}class Qr{#Sr;constructor(e){this.#Sr=e}heapStatsUpdate({statsUpdate:e}){this.#Sr.heapStatsUpdate(e)}lastSeenObjectId({lastSeenObjectId:e,timestamp:t}){this.#Sr.lastSeenObjectId(e,t)}addHeapSnapshotChunk({chunk:e}){this.#Sr.addHeapSnapshotChunk(e)}reportHeapSnapshotProgress({done:e,total:t,finished:n}){this.#Sr.reportHeapSnapshotProgress(e,t,n)}resetProfiles(){this.#Sr.resetProfiles()}}h.register(Kr,{capabilities:4,autostart:!1});var $r,Xr=Object.freeze({__proto__:null,HeapProfilerModel:Kr});class Jr extends h{agent;#kr=new Map;#Cr=Zr.comparator;constructor(t){super(t),this.agent=t.runtimeAgent(),this.target().registerRuntimeDispatcher(new Yr(this)),this.agent.invoke_enable(),e.Settings.Settings.instance().moduleSetting("custom-formatters").get()&&this.agent.invoke_setCustomObjectFormatterEnabled({enabled:!0}),e.Settings.Settings.instance().moduleSetting("custom-formatters").addChangeListener(this.customFormattersStateChanged.bind(this))}static isSideEffectFailure(e){const t="exceptionDetails"in e&&e.exceptionDetails;return Boolean(t&&t.exception?.description?.startsWith("EvalError: Possible side-effect in debug-evaluate"))}debuggerModel(){return this.target().model(ms)}heapProfilerModel(){return this.target().model(Kr)}executionContexts(){return[...this.#kr.values()].sort(this.executionContextComparator())}setExecutionContextComparator(e){this.#Cr=e}executionContextComparator(){return this.#Cr}defaultExecutionContext(){for(const e of this.executionContexts())if(e.isDefault)return e;return null}executionContext(e){return this.#kr.get(e)||null}executionContextCreated(e){const t=e.auxData||{isDefault:!0},n=new Zr(this,e.id,e.uniqueId,e.name,e.origin,t.isDefault,t.frameId);this.#kr.set(n.id,n),this.dispatchEventToListeners($r.ExecutionContextCreated,n)}executionContextDestroyed(e){const t=this.#kr.get(e);t&&(this.debuggerModel().executionContextDestroyed(t),this.#kr.delete(e),this.dispatchEventToListeners($r.ExecutionContextDestroyed,t))}fireExecutionContextOrderChanged(){this.dispatchEventToListeners($r.ExecutionContextOrderChanged,this)}executionContextsCleared(){this.debuggerModel().globalObjectCleared();const e=this.executionContexts();this.#kr.clear();for(let t=0;te+t.length+1),0);const d="";if(n)for(;;){const e=await this.debuggerModel.target().debuggerAgent().invoke_nextWasmDisassemblyChunk({streamId:n});if(e.getError())throw new Error(e.getError());const{chunk:{lines:t,bytecodeOffsets:r}}=e;if(l+=t.reduce(((e,t)=>e+t.length+1),0),0===t.length)break;if(l>=999999989){o.push([d]),a.push([0]);break}o.push(t),a.push(r)}const c=[];for(let e=0;ee){ss||(ss={cache:new Map,registry:new FinalizationRegistry((e=>ss?.cache.delete(e)))});const e=[this.#Er,this.contentLength,this.lineOffset,this.columnOffset,this.endLine,this.endColumn,this.#Pr,this.hash].join(":"),t=ss.cache.get(e)?.deref();t?this.#Lr=t:(this.#Lr=this.requestContentInternal(),ss.cache.set(e,new WeakRef(this.#Lr)),ss.registry.register(this.#Lr,e))}else this.#Lr=this.requestContentInternal()}return this.#Lr}async requestContent(){const e=await this.requestContentData();return t.ContentData.ContentData.asDeferredContent(e)}async requestContentInternal(){if(!this.scriptId)return{error:rs(ts.scriptRemovedOrDeleted)};try{return this.isWasm()?await this.loadWasmContent():await this.loadTextContent()}catch{return{error:rs(ts.unableToFetchScriptSource)}}}async getWasmBytecode(){const e=await this.debuggerModel.target().debuggerAgent().invoke_getWasmBytecode({scriptId:this.scriptId}),t=await fetch(`data:application/wasm;base64,${e.bytecode}`);return await t.arrayBuffer()}originalContentProvider(){return new t.StaticContentProvider.StaticContentProvider(this.contentURL(),this.contentType(),(()=>this.requestContentData()))}async searchInContent(e,n,r){if(!this.scriptId)return[];const s=await this.debuggerModel.target().debuggerAgent().invoke_searchInContent({scriptId:this.scriptId,query:e,caseSensitive:n,isRegex:r});return t.TextUtils.performSearchInSearchMatches(s.result||[],e,n,r)}appendSourceURLCommentIfNeeded(e){return this.hasSourceURL?e+"\n //# sourceURL="+this.sourceURL:e}async editSource(e){e=is.trimSourceURLComment(e),e=this.appendSourceURLCommentIfNeeded(e);if(t.ContentData.ContentData.textOr(await this.requestContentData(),null)===e)return{changed:!1,status:"Ok"};const n=await this.debuggerModel.target().debuggerAgent().invoke_setScriptSource({scriptId:this.scriptId,scriptSource:e,allowTopFrameEditing:!0});if(n.getError())throw new Error(`Script#editSource failed for script with id ${this.scriptId}: ${n.getError()}`);return n.getError()||"Ok"!==n.status||(this.#Lr=Promise.resolve(new t.ContentData.ContentData(e,!1,"text/javascript"))),this.debuggerModel.dispatchEventToListeners(ys.ScriptSourceWasEdited,{script:this,status:n.status}),{changed:!0,status:n.status,exceptionDetails:n.exceptionDetails}}rawLocation(e,t){return this.containsLocation(e,t)?new Is(this.debuggerModel,this.scriptId,e,t):null}isInlineScript(){const e=!this.lineOffset&&!this.columnOffset;return!this.isWasm()&&Boolean(this.sourceURL)&&!e}isAnonymousScript(){return!this.sourceURL}async setBlackboxedRanges(e){return!(await this.debuggerModel.target().debuggerAgent().invoke_setBlackboxedRanges({scriptId:this.scriptId,positions:e})).getError()}containsLocation(e,t){const n=e===this.lineOffset&&t>=this.columnOffset||e>this.lineOffset,r=e{r.onmessage=({data:r})=>{if("method"in r&&"disassemble"===r.method)if("error"in r)n(r.error);else if("result"in r){const{lines:n,offsets:s,functionBodyOffsets:i}=r.result;e(new t.WasmDisassembly.WasmDisassembly(n,s,i))}},r.onerror=n}));r.postMessage({method:"disassemble",params:{content:n}});try{return await s}finally{r.terminate()}}var ds=Object.freeze({__proto__:null,Script:is,disassembleWasm:ls,sourceURLRegex:as});const cs={local:"Local",closure:"Closure",block:"Block",script:"Script",withBlock:"`With` block",catchBlock:"`Catch` block",global:"Global",module:"Module",expression:"Expression",exception:"Exception",returnValue:"Return value"},hs=n.i18n.registerUIStrings("core/sdk/DebuggerModel.ts",cs),us=n.i18n.getLocalizedString.bind(void 0,hs);function gs(e){function t(e,t){return e.lineNumber-t.lineNumber||e.columnNumber-t.columnNumber}function n(e,n){if(e.scriptId!==n.scriptId)return!1;const r=t(e.start,n.start);return r<0?t(e.end,n.start)>=0:!(r>0)||t(e.start,n.end)<=0}if(0===e.length)return[];e.sort(((e,n)=>e.scriptIdn.scriptId?1:t(e.start,n.start)||t(e.end,n.end)));let r=e[0];const s=[];for(let i=1;ithis.#Or.setEnabled(e.data)));const n=t.model(ii);n&&n.addEventListener(ri.FrameNavigated,this.onFrameNavigated,this)}static selectSymbolSource(t){if(!t||0===t.length)return null;if("type"in t)return"None"===t.type?null:t;let n=null;const r=new Map(t.map((e=>[e.type,e])));for(const e of ps)if(r.has(e)){n=r.get(e)||null;break}return console.assert(null!==n,"Unknown symbol types. Front-end and back-end should be kept in sync regarding Protocol.Debugger.DebugSymbolTypes"),n&&t.length>1&&e.Console.Console.instance().warn(`Multiple debug symbols for script were found. Using ${n.type}`),n}sourceMapManager(){return this.#Or}runtimeModel(){return this.runtimeModelInternal}debuggerEnabled(){return Boolean(this.#Hr)}debuggerId(){return this.#Ur}async enableDebugger(){if(this.#Hr)return;this.#Hr=!0;const t=o.Runtime.Runtime.queryParam("remoteFrontend")||o.Runtime.Runtime.queryParam("ws")?1e7:1e8,n=this.agent.invoke_enable({maxScriptsCacheSize:t});let r;o.Runtime.experiments.isEnabled("instrumentation-breakpoints")&&(r=this.agent.invoke_setInstrumentationBreakpoint({instrumentation:"beforeScriptExecution"})),this.pauseOnExceptionStateChanged(),this.asyncStackTracesStateChanged(),e.Settings.Settings.instance().moduleSetting("breakpoints-active").get()||this.breakpointsActiveChanged(),this.dispatchEventToListeners(ys.DebuggerWasEnabled,this);const[s]=await Promise.all([n,r]);this.registerDebugger(s)}async syncDebuggerId(){const e=o.Runtime.Runtime.queryParam("remoteFrontend")||o.Runtime.Runtime.queryParam("ws")?1e7:1e8,t=this.agent.invoke_enable({maxScriptsCacheSize:e});return t.then(this.registerDebugger.bind(this)),await t}onFrameNavigated(){ms.shouldResyncDebuggerId||(ms.shouldResyncDebuggerId=!0)}registerDebugger(e){if(e.getError())return void(this.#Hr=!1);const{debuggerId:t}=e;fs.set(t,this),this.#Ur=t,this.dispatchEventToListeners(ys.DebuggerIsReadyToPause,this)}isReadyToPause(){return Boolean(this.#Ur)}static async modelForDebuggerId(e){return ms.shouldResyncDebuggerId&&(await ms.resyncDebuggerIdForModels(),ms.shouldResyncDebuggerId=!1),fs.get(e)||null}static async resyncDebuggerIdForModels(){const e=fs.values();for(const t of e)t.debuggerEnabled()&&await t.syncDebuggerId()}async disableDebugger(){this.#Hr&&(this.#Hr=!1,await this.asyncStackTracesStateChanged(),await this.agent.invoke_disable(),this.#Qr=!1,this.globalObjectCleared(),this.dispatchEventToListeners(ys.DebuggerWasDisabled,this),"string"==typeof this.#Ur&&fs.delete(this.#Ur),this.#Ur=null)}skipAllPauses(e){this.#qr&&(clearTimeout(this.#qr),this.#qr=0),this.agent.invoke_setSkipAllPauses({skip:e})}skipAllPausesUntilReloadOrTimeout(e){this.#qr&&clearTimeout(this.#qr),this.agent.invoke_setSkipAllPauses({skip:!0}),this.#qr=window.setTimeout(this.skipAllPauses.bind(this,!1),e)}pauseOnExceptionStateChanged(){const t=e.Settings.Settings.instance().moduleSetting("pause-on-caught-exception").get();let n;const r=e.Settings.Settings.instance().moduleSetting("pause-on-uncaught-exception").get();n=t&&r?"all":t?"caught":r?"uncaught":"none",this.agent.invoke_setPauseOnExceptions({state:n})}asyncStackTracesStateChanged(){const t=!e.Settings.Settings.instance().moduleSetting("disable-async-stack-traces").get()&&this.#Hr?32:0;return this.agent.invoke_setAsyncCallStackDepth({maxDepth:t})}breakpointsActiveChanged(){this.agent.invoke_setBreakpointsActive({active:e.Settings.Settings.instance().moduleSetting("breakpoints-active").get()})}setComputeAutoStepRangesCallback(e){this.#jr=e}async computeAutoStepSkipList(e){let t=[];if(this.#jr&&this.#Dr&&this.#Dr.callFrames.length>0){const[n]=this.#Dr.callFrames;t=await this.#jr.call(null,e,n)}return gs(t.map((({start:e,end:t})=>({scriptId:e.scriptId,start:{lineNumber:e.lineNumber,columnNumber:e.columnNumber},end:{lineNumber:t.lineNumber,columnNumber:t.columnNumber}}))))}async stepInto(){const e=await this.computeAutoStepSkipList("StepInto");this.agent.invoke_stepInto({breakOnAsyncCall:!1,skipList:e})}async stepOver(){this.#Kr=this.#Dr?.callFrames[0]?.functionLocation()??null;const e=await this.computeAutoStepSkipList("StepOver");this.agent.invoke_stepOver({skipList:e})}async stepOut(){const e=await this.computeAutoStepSkipList("StepOut");0!==e.length?this.agent.invoke_stepOver({skipList:e}):this.agent.invoke_stepOut()}scheduleStepIntoAsync(){this.computeAutoStepSkipList("StepInto").then((e=>{this.agent.invoke_stepInto({breakOnAsyncCall:!0,skipList:e})}))}resume(){this.agent.invoke_resume({terminateOnResume:!1}),this.#Qr=!1}pause(){this.#Qr=!0,this.skipAllPauses(!1),this.agent.invoke_pause()}async setBreakpointByURL(t,n,s,i){let o;if(this.target().type()===U.NODE&&e.ParsedURL.schemeIs(t,"file:")){const n=e.ParsedURL.ParsedURL.urlToRawPathString(t,a.Platform.isWin());o=`${r.StringUtilities.escapeForRegExp(n)}|${r.StringUtilities.escapeForRegExp(t)}`,a.Platform.isWin()&&n.match(/^.:\\/)&&(o=`[${n[0].toUpperCase()}${n[0].toLowerCase()}]`+o.substr(1))}let l=0;const d=this.#Fr.get(t)||[];for(let e=0,t=d.length;eIs.fromPayload(this,e)))),{locations:h,breakpointId:c.breakpointId}}async setBreakpointInAnonymousScript(e,t,n,r){const s=await this.agent.invoke_setBreakpointByUrl({lineNumber:t,scriptHash:e,columnNumber:n,condition:r});if(s.getError())return{locations:[],breakpointId:null};let i=[];return s.locations&&(i=s.locations.map((e=>Is.fromPayload(this,e)))),{locations:i,breakpointId:s.breakpointId}}async removeBreakpoint(e){await this.agent.invoke_removeBreakpoint({breakpointId:e})}async getPossibleBreakpoints(e,t,n){const r=await this.agent.invoke_getPossibleBreakpoints({start:e.payload(),end:t?t.payload():void 0,restrictToFunction:n});return r.getError()||!r.locations?[]:r.locations.map((e=>ws.fromPayload(this,e)))}async fetchAsyncStackTrace(e){const t=await this.agent.invoke_getStackTrace({stackTraceId:e});return t.getError()?null:t.stackTrace}breakpointResolved(e,t){this.#Gr.dispatchEventToListeners(e,Is.fromPayload(this,t))}globalObjectCleared(){this.resetDebuggerPausedDetails(),this.reset(),this.dispatchEventToListeners(ys.GlobalObjectCleared,this)}reset(){for(const e of this.#Nr.values())this.#Or.detachSourceMap(e);this.#Nr.clear(),this.#Fr.clear(),this.#Br=[],this.#Kr=null}scripts(){return Array.from(this.#Nr.values())}scriptForId(e){return this.#Nr.get(e)||null}scriptsForSourceURL(e){return this.#Fr.get(e)||[]}scriptsForExecutionContext(e){const t=[];for(const n of this.#Nr.values())n.executionContextId===e.id&&t.push(n);return t}get callFrames(){return this.#Dr?this.#Dr.callFrames:null}debuggerPausedDetails(){return this.#Dr}async setDebuggerPausedDetails(e){return this.#Qr=!1,this.#Dr=e,!(this.#zr&&!await this.#zr.call(null,e,this.#Kr))&&(this.#Kr=null,this.dispatchEventToListeners(ys.DebuggerPaused,this),this.setSelectedCallFrame(e.callFrames[0]),!0)}resetDebuggerPausedDetails(){this.#Qr=!1,this.#Dr=null,this.setSelectedCallFrame(null)}setBeforePausedCallback(e){this.#zr=e}setExpandCallFramesCallback(e){this.#Vr=e}setEvaluateOnCallFrameCallback(e){this.evaluateOnCallFrameCallback=e}setSynchronizeBreakpointsCallback(e){this.#Wr=e}async pausedScript(t,n,r,s,i,o){if("instrumentation"===n){const e=this.scriptForId(r.scriptId);return this.#Wr&&e&&await this.#Wr(e),void this.resume()}const a=new Cs(this,t,n,r,s,i,o);if(await this.#$r(a),this.continueToLocationCallback){const e=this.continueToLocationCallback;if(this.continueToLocationCallback=null,e(a))return}await this.setDebuggerPausedDetails(a)?e.EventTarget.fireEvent("DevTools.DebuggerPaused"):this.#Kr?this.stepOver():this.stepInto()}async#$r(e){if(this.#Vr&&(e.callFrames=await this.#Vr.call(null,e.callFrames)),!o.Runtime.experiments.isEnabled("use-source-map-scopes"))return;const t=[];for(const n of e.callFrames){const e=await this.sourceMapManager().sourceMapForClientPromise(n.script);e?.hasScopeInfo()?t.push(...e.expandCallFrame(n)):t.push(n)}e.callFrames=t}resumedScript(){this.resetDebuggerPausedDetails(),this.dispatchEventToListeners(ys.DebuggerResumed,this)}parsedScriptSource(e,t,n,r,s,i,o,a,l,d,c,h,u,g,p,m,f,b,y,v){const I=this.#Nr.get(e);if(I)return I;let w=!1;l&&"isDefault"in l&&(w=!l.isDefault);const S=ms.selectSymbolSource(y),k=new is(this,e,t,n,r,s,i,o,a,w,d,c,h,g,p,m,f,b,S,v);this.registerScript(k),this.dispatchEventToListeners(ys.ParsedScriptSource,k),k.sourceMapURL&&!u&&this.#Or.attachSourceMap(k,k.sourceURL,k.sourceMapURL);return u&&k.isAnonymousScript()&&(this.#Br.push(k),this.collectDiscardedScripts()),k}setSourceMapURL(e,t){this.#Or.detachSourceMap(e),e.sourceMapURL=t,this.#Or.attachSourceMap(e,e.sourceURL,e.sourceMapURL)}async setDebugInfoURL(e,t){this.#Vr&&this.#Dr&&(this.#Dr.callFrames=await this.#Vr.call(null,this.#Dr.callFrames)),this.dispatchEventToListeners(ys.DebugInfoAttached,e)}executionContextDestroyed(e){for(const t of this.#Nr.values())t.executionContextId===e.id&&this.#Or.detachSourceMap(t)}registerScript(e){if(this.#Nr.set(e.scriptId,e),e.isAnonymousScript())return;let t=this.#Fr.get(e.sourceURL);t||(t=[],this.#Fr.set(e.sourceURL,t)),t.unshift(e)}unregisterScript(e){console.assert(e.isAnonymousScript()),this.#Nr.delete(e.scriptId)}collectDiscardedScripts(){if(this.#Br.length<1e3)return;const e=this.#Br.splice(0,100);for(const t of e)this.unregisterScript(t),this.dispatchEventToListeners(ys.DiscardedAnonymousScriptSource,t)}createRawLocation(e,t,n,r){return this.createRawLocationByScriptId(e.scriptId,t,n,r)}createRawLocationByURL(e,t,n,r,s){for(const i of this.#Fr.get(e)||[]){if(!s){if(i.lineOffset>t||i.lineOffset===t&&void 0!==n&&i.columnOffset>n)continue;if(i.endLine=this.#os.length&&(this.#as=0),e}}var Ps=Object.freeze({__proto__:null,OverlayColorGenerator:Ms});class Es{#ls;#os=new Map;#ds=e.Settings.Settings.instance().createLocalSetting("persistent-highlight-setting",[]);#cs=new Map;#hs=new Map;#us=new Map;#gs=new Map;#ps=new Map;#ms=new Ms;#fs=new Ms;#bs=e.Settings.Settings.instance().moduleSetting("show-grid-line-labels");#ys=e.Settings.Settings.instance().moduleSetting("extend-grid-lines");#vs=e.Settings.Settings.instance().moduleSetting("show-grid-areas");#Is=e.Settings.Settings.instance().moduleSetting("show-grid-track-sizes");#ws;constructor(e,t){this.#ls=e,this.#ws=t,this.#bs.addChangeListener(this.onSettingChange,this),this.#ys.addChangeListener(this.onSettingChange,this),this.#vs.addChangeListener(this.onSettingChange,this),this.#Is.addChangeListener(this.onSettingChange,this)}onSettingChange(){this.resetOverlay()}buildGridHighlightConfig(e){const t=this.colorOfGrid(e).asLegacyColor(),n=t.setAlpha(.1).asLegacyColor(),r=t.setAlpha(.3).asLegacyColor(),s=t.setAlpha(.8).asLegacyColor(),i=this.#ys.get(),o="lineNumbers"===this.#bs.get(),a=o,l="lineNames"===this.#bs.get();return{rowGapColor:r.toProtocolRGBA(),rowHatchColor:s.toProtocolRGBA(),columnGapColor:r.toProtocolRGBA(),columnHatchColor:s.toProtocolRGBA(),gridBorderColor:t.toProtocolRGBA(),gridBorderDash:!1,rowLineColor:t.toProtocolRGBA(),columnLineColor:t.toProtocolRGBA(),rowLineDash:!0,columnLineDash:!0,showGridExtensionLines:i,showPositiveLineNumbers:o,showNegativeLineNumbers:a,showLineNames:l,showAreaNames:this.#vs.get(),showTrackSizes:this.#Is.get(),areaBorderColor:t.toProtocolRGBA(),gridBackgroundColor:n.toProtocolRGBA()}}buildFlexContainerHighlightConfig(e){const t=this.colorOfFlex(e).asLegacyColor();return{containerBorder:{color:t.toProtocolRGBA(),pattern:"dashed"},itemSeparator:{color:t.toProtocolRGBA(),pattern:"dotted"},lineSeparator:{color:t.toProtocolRGBA(),pattern:"dashed"},mainDistributedSpace:{hatchColor:t.toProtocolRGBA()},crossDistributedSpace:{hatchColor:t.toProtocolRGBA()}}}buildScrollSnapContainerHighlightConfig(t){return{snapAreaBorder:{color:e.Color.PageHighlight.GridBorder.toProtocolRGBA(),pattern:"dashed"},snapportBorder:{color:e.Color.PageHighlight.GridBorder.toProtocolRGBA()},scrollMarginColor:e.Color.PageHighlight.Margin.toProtocolRGBA(),scrollPaddingColor:e.Color.PageHighlight.Padding.toProtocolRGBA()}}highlightGridInOverlay(e){this.#cs.set(e,this.buildGridHighlightConfig(e)),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting(),this.#ws.onGridOverlayStateChanged({nodeId:e,enabled:!0})}isGridHighlighted(e){return this.#cs.has(e)}colorOfGrid(e){let t=this.#os.get(e);return t||(t=this.#ms.next(),this.#os.set(e,t)),t}setColorOfGrid(e,t){this.#os.set(e,t)}hideGridInOverlay(e){this.#cs.has(e)&&(this.#cs.delete(e),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting(),this.#ws.onGridOverlayStateChanged({nodeId:e,enabled:!1}))}highlightScrollSnapInOverlay(e){this.#hs.set(e,this.buildScrollSnapContainerHighlightConfig(e)),this.updateHighlightsInOverlay(),this.#ws.onScrollSnapOverlayStateChanged({nodeId:e,enabled:!0}),this.savePersistentHighlightSetting()}isScrollSnapHighlighted(e){return this.#hs.has(e)}hideScrollSnapInOverlay(e){this.#hs.has(e)&&(this.#hs.delete(e),this.updateHighlightsInOverlay(),this.#ws.onScrollSnapOverlayStateChanged({nodeId:e,enabled:!1}),this.savePersistentHighlightSetting())}highlightFlexInOverlay(e){this.#us.set(e,this.buildFlexContainerHighlightConfig(e)),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting(),this.#ws.onFlexOverlayStateChanged({nodeId:e,enabled:!0})}isFlexHighlighted(e){return this.#us.has(e)}colorOfFlex(e){let t=this.#os.get(e);return t||(t=this.#fs.next(),this.#os.set(e,t)),t}setColorOfFlex(e,t){this.#os.set(e,t)}hideFlexInOverlay(e){this.#us.has(e)&&(this.#us.delete(e),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting(),this.#ws.onFlexOverlayStateChanged({nodeId:e,enabled:!1}))}highlightContainerQueryInOverlay(e){this.#gs.set(e,this.buildContainerQueryContainerHighlightConfig()),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting(),this.#ws.onContainerQueryOverlayStateChanged({nodeId:e,enabled:!0})}hideContainerQueryInOverlay(e){this.#gs.has(e)&&(this.#gs.delete(e),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting(),this.#ws.onContainerQueryOverlayStateChanged({nodeId:e,enabled:!1}))}isContainerQueryHighlighted(e){return this.#gs.has(e)}buildContainerQueryContainerHighlightConfig(){return{containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},descendantBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"}}}highlightIsolatedElementInOverlay(e){this.#ps.set(e,this.buildIsolationModeHighlightConfig()),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting()}hideIsolatedElementInOverlay(e){this.#ps.has(e)&&(this.#ps.delete(e),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting())}isIsolatedElementHighlighted(e){return this.#ps.has(e)}buildIsolationModeHighlightConfig(){return{resizerColor:e.Color.IsolationModeHighlight.Resizer.toProtocolRGBA(),resizerHandleColor:e.Color.IsolationModeHighlight.ResizerHandle.toProtocolRGBA(),maskColor:e.Color.IsolationModeHighlight.Mask.toProtocolRGBA()}}hideAllInOverlayWithoutSave(){this.#us.clear(),this.#cs.clear(),this.#hs.clear(),this.#gs.clear(),this.#ps.clear(),this.updateHighlightsInOverlay()}refreshHighlights(){const e=this.updateHighlightsForDeletedNodes(this.#cs),t=this.updateHighlightsForDeletedNodes(this.#us),n=this.updateHighlightsForDeletedNodes(this.#hs),r=this.updateHighlightsForDeletedNodes(this.#gs),s=this.updateHighlightsForDeletedNodes(this.#ps);(t||e||n||r||s)&&(this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting())}updateHighlightsForDeletedNodes(e){let t=!1;for(const n of e.keys())null===this.#ls.getDOMModel().nodeForId(n)&&(e.delete(n),t=!0);return t}resetOverlay(){for(const e of this.#cs.keys())this.#cs.set(e,this.buildGridHighlightConfig(e));for(const e of this.#us.keys())this.#us.set(e,this.buildFlexContainerHighlightConfig(e));for(const e of this.#hs.keys())this.#hs.set(e,this.buildScrollSnapContainerHighlightConfig(e));for(const e of this.#gs.keys())this.#gs.set(e,this.buildContainerQueryContainerHighlightConfig());for(const e of this.#ps.keys())this.#ps.set(e,this.buildIsolationModeHighlightConfig());this.updateHighlightsInOverlay()}updateHighlightsInOverlay(){const e=this.#cs.size>0||this.#us.size>0||this.#gs.size>0||this.#ps.size>0;this.#ls.setShowViewportSizeOnResize(!e),this.updateGridHighlightsInOverlay(),this.updateFlexHighlightsInOverlay(),this.updateScrollSnapHighlightsInOverlay(),this.updateContainerQueryHighlightsInOverlay(),this.updateIsolatedElementHighlightsInOverlay()}updateGridHighlightsInOverlay(){const e=this.#ls,t=[];for(const[e,n]of this.#cs.entries())t.push({nodeId:e,gridHighlightConfig:n});e.target().overlayAgent().invoke_setShowGridOverlays({gridNodeHighlightConfigs:t})}updateFlexHighlightsInOverlay(){const e=this.#ls,t=[];for(const[e,n]of this.#us.entries())t.push({nodeId:e,flexContainerHighlightConfig:n});e.target().overlayAgent().invoke_setShowFlexOverlays({flexNodeHighlightConfigs:t})}updateScrollSnapHighlightsInOverlay(){const e=this.#ls,t=[];for(const[e,n]of this.#hs.entries())t.push({nodeId:e,scrollSnapContainerHighlightConfig:n});e.target().overlayAgent().invoke_setShowScrollSnapOverlays({scrollSnapHighlightConfigs:t})}updateContainerQueryHighlightsInOverlay(){const e=this.#ls,t=[];for(const[e,n]of this.#gs.entries())t.push({nodeId:e,containerQueryContainerHighlightConfig:n});e.target().overlayAgent().invoke_setShowContainerQueryOverlays({containerQueryHighlightConfigs:t})}updateIsolatedElementHighlightsInOverlay(){const e=this.#ls,t=[];for(const[e,n]of this.#ps.entries())t.push({nodeId:e,isolationModeHighlightConfig:n});e.target().overlayAgent().invoke_setShowIsolatedElements({isolatedElementHighlightConfigs:t})}async restoreHighlightsForDocument(){this.#us=new Map,this.#cs=new Map,this.#hs=new Map,this.#gs=new Map,this.#ps=new Map;const e=await this.#ls.getDOMModel().requestDocument(),t=e?e.documentURL:r.DevToolsPath.EmptyUrlString;await Promise.all(this.#ds.get().map((async e=>{if(e.url===t)return await this.#ls.getDOMModel().pushNodeByPathToFrontend(e.path).then((t=>{const n=this.#ls.getDOMModel().nodeForId(t);if(n)switch(e.type){case"GRID":this.#cs.set(n.id,this.buildGridHighlightConfig(n.id)),this.#ws.onGridOverlayStateChanged({nodeId:n.id,enabled:!0});break;case"FLEX":this.#us.set(n.id,this.buildFlexContainerHighlightConfig(n.id)),this.#ws.onFlexOverlayStateChanged({nodeId:n.id,enabled:!0});break;case"CONTAINER_QUERY":this.#gs.set(n.id,this.buildContainerQueryContainerHighlightConfig()),this.#ws.onContainerQueryOverlayStateChanged({nodeId:n.id,enabled:!0});break;case"SCROLL_SNAP":this.#hs.set(n.id,this.buildScrollSnapContainerHighlightConfig(n.id)),this.#ws.onScrollSnapOverlayStateChanged({nodeId:n.id,enabled:!0});break;case"ISOLATED_ELEMENT":this.#ps.set(n.id,this.buildIsolationModeHighlightConfig())}}))}))),this.updateHighlightsInOverlay()}currentUrl(){const e=this.#ls.getDOMModel().existingDocument();return e?e.documentURL:r.DevToolsPath.EmptyUrlString}getPersistentHighlightSettingForOneType(e,t){const n=[];for(const r of e.keys()){const e=this.#ls.getDOMModel().nodeForId(r);e&&n.push({url:this.currentUrl(),path:e.path(),type:t})}return n}savePersistentHighlightSetting(){const e=this.currentUrl(),t=[...this.#ds.get().filter((t=>t.url!==e)),...this.getPersistentHighlightSettingForOneType(this.#cs,"GRID"),...this.getPersistentHighlightSettingForOneType(this.#us,"FLEX"),...this.getPersistentHighlightSettingForOneType(this.#gs,"CONTAINER_QUERY"),...this.getPersistentHighlightSettingForOneType(this.#hs,"SCROLL_SNAP"),...this.getPersistentHighlightSettingForOneType(this.#ps,"ISOLATED_ELEMENT")];this.#ds.set(t)}}var Ls=Object.freeze({__proto__:null,OverlayPersistentHighlighter:Es});const As={pausedInDebugger:"Paused in debugger"},Os=n.i18n.registerUIStrings("core/sdk/OverlayModel.ts",As),Ds=n.i18n.getLocalizedString.bind(void 0,Os),Ns={mac:{x:85,y:0,width:185,height:40},linux:{x:0,y:0,width:196,height:34},windows:{x:0,y:0,width:238,height:33}};class Fs extends h{#er;overlayAgent;#Xr;#Ss=!1;#ks=null;#Cs;#xs;#Rs;#Ts;#Ms;#Ps;#Es;#Ls;#As=[];#Os=!0;#Ds;#Ns;#Fs=!1;#Bs;constructor(t){super(t),this.#er=t.model(Gs),t.registerOverlayDispatcher(this),this.overlayAgent=t.overlayAgent(),this.#Xr=t.model(ms),this.#Xr&&(e.Settings.Settings.instance().moduleSetting("disable-paused-state-overlay").addChangeListener(this.updatePausedInDebuggerMessage,this),this.#Xr.addEventListener(ys.DebuggerPaused,this.updatePausedInDebuggerMessage,this),this.#Xr.addEventListener(ys.DebuggerResumed,this.updatePausedInDebuggerMessage,this),this.#Xr.addEventListener(ys.GlobalObjectCleared,this.updatePausedInDebuggerMessage,this)),this.#Cs=new _s(this),this.#xs=this.#Cs,this.#Rs=e.Settings.Settings.instance().moduleSetting("show-paint-rects"),this.#Ts=e.Settings.Settings.instance().moduleSetting("show-layout-shift-regions"),this.#Ms=e.Settings.Settings.instance().moduleSetting("show-ad-highlights"),this.#Ps=e.Settings.Settings.instance().moduleSetting("show-debug-borders"),this.#Es=e.Settings.Settings.instance().moduleSetting("show-fps-counter"),this.#Ls=e.Settings.Settings.instance().moduleSetting("show-scroll-bottleneck-rects"),t.suspended()||(this.overlayAgent.invoke_enable(),this.wireAgentToSettings()),this.#Ds=new Es(this,{onGridOverlayStateChanged:({nodeId:e,enabled:t})=>this.dispatchEventToListeners("PersistentGridOverlayStateChanged",{nodeId:e,enabled:t}),onFlexOverlayStateChanged:({nodeId:e,enabled:t})=>this.dispatchEventToListeners("PersistentFlexContainerOverlayStateChanged",{nodeId:e,enabled:t}),onContainerQueryOverlayStateChanged:({nodeId:e,enabled:t})=>this.dispatchEventToListeners("PersistentContainerQueryOverlayStateChanged",{nodeId:e,enabled:t}),onScrollSnapOverlayStateChanged:({nodeId:e,enabled:t})=>this.dispatchEventToListeners("PersistentScrollSnapOverlayStateChanged",{nodeId:e,enabled:t})}),this.#er.addEventListener(Us.NodeRemoved,(()=>{this.#Ds&&this.#Ds.refreshHighlights()})),this.#er.addEventListener(Us.DocumentUpdated,(()=>{this.#Ds&&(this.#Ds.hideAllInOverlayWithoutSave(),t.suspended()||this.#Ds.restoreHighlightsForDocument())})),this.#Ns=new Hs(this),this.#Bs=new Bs(this.#er.cssModel())}static highlightObjectAsDOMNode(e){const t=e.runtimeModel().target().model(Gs);t&&t.overlayModel().highlightInOverlay({object:e,selectorList:void 0})}static hideDOMNodeHighlight(){for(const e of W.instance().models(Fs))e.delayedHideHighlight(0)}static async muteHighlight(){return await Promise.all(W.instance().models(Fs).map((e=>e.suspendModel())))}static async unmuteHighlight(){return await Promise.all(W.instance().models(Fs).map((e=>e.resumeModel())))}static highlightRect(e){for(const t of W.instance().models(Fs))t.highlightRect(e)}static clearHighlight(){for(const e of W.instance().models(Fs))e.clearHighlight()}getDOMModel(){return this.#er}highlightRect({x:e,y:t,width:n,height:r,color:s,outlineColor:i}){const o=s||{r:255,g:0,b:255,a:.3},a=i||{r:255,g:0,b:255,a:.5};return this.overlayAgent.invoke_highlightRect({x:e,y:t,width:n,height:r,color:o,outlineColor:a})}clearHighlight(){return this.overlayAgent.invoke_hideHighlight()}async wireAgentToSettings(){this.#As=[this.#Rs.addChangeListener((()=>this.overlayAgent.invoke_setShowPaintRects({result:this.#Rs.get()}))),this.#Ts.addChangeListener((()=>this.overlayAgent.invoke_setShowLayoutShiftRegions({result:this.#Ts.get()}))),this.#Ms.addChangeListener((()=>this.overlayAgent.invoke_setShowAdHighlights({show:this.#Ms.get()}))),this.#Ps.addChangeListener((()=>this.overlayAgent.invoke_setShowDebugBorders({show:this.#Ps.get()}))),this.#Es.addChangeListener((()=>this.overlayAgent.invoke_setShowFPSCounter({show:this.#Es.get()}))),this.#Ls.addChangeListener((()=>this.overlayAgent.invoke_setShowScrollBottleneckRects({show:this.#Ls.get()})))],this.#Rs.get()&&this.overlayAgent.invoke_setShowPaintRects({result:!0}),this.#Ts.get()&&this.overlayAgent.invoke_setShowLayoutShiftRegions({result:!0}),this.#Ms.get()&&this.overlayAgent.invoke_setShowAdHighlights({show:!0}),this.#Ps.get()&&this.overlayAgent.invoke_setShowDebugBorders({show:!0}),this.#Es.get()&&this.overlayAgent.invoke_setShowFPSCounter({show:!0}),this.#Ls.get()&&this.overlayAgent.invoke_setShowScrollBottleneckRects({show:!0}),this.#Xr&&this.#Xr.isPaused()&&this.updatePausedInDebuggerMessage(),await this.overlayAgent.invoke_setShowViewportSizeOnResize({show:this.#Os}),this.#Ds?.resetOverlay()}async suspendModel(){e.EventTarget.removeEventListeners(this.#As),await this.overlayAgent.invoke_disable()}async resumeModel(){await Promise.all([this.overlayAgent.invoke_enable(),this.wireAgentToSettings()])}setShowViewportSizeOnResize(e){this.#Os!==e&&(this.#Os=e,this.target().suspended()||this.overlayAgent.invoke_setShowViewportSizeOnResize({show:e}))}updatePausedInDebuggerMessage(){if(this.target().suspended())return;const t=this.#Xr&&this.#Xr.isPaused()&&!e.Settings.Settings.instance().moduleSetting("disable-paused-state-overlay").get()?Ds(As.pausedInDebugger):void 0;this.overlayAgent.invoke_setPausedInDebuggerMessage({message:t})}setHighlighter(e){this.#xs=e||this.#Cs}async setInspectMode(e,t=!0){await this.#er.requestDocument(),this.#Ss="none"!==e,this.dispatchEventToListeners("InspectModeWillBeToggled",this),this.#xs.setInspectMode(e,this.buildHighlightConfig("all",t))}inspectModeEnabled(){return this.#Ss}highlightInOverlay(e,t,n){if(this.#Fs)return;this.#ks&&(clearTimeout(this.#ks),this.#ks=null);const r=this.buildHighlightConfig(t);void 0!==n&&(r.showInfo=n),this.#xs.highlightInOverlay(e,r)}highlightInOverlayForTwoSeconds(e){this.highlightInOverlay(e),this.delayedHideHighlight(2e3)}highlightGridInPersistentOverlay(e){this.#Ds&&this.#Ds.highlightGridInOverlay(e)}isHighlightedGridInPersistentOverlay(e){return!!this.#Ds&&this.#Ds.isGridHighlighted(e)}hideGridInPersistentOverlay(e){this.#Ds&&this.#Ds.hideGridInOverlay(e)}highlightScrollSnapInPersistentOverlay(e){this.#Ds&&this.#Ds.highlightScrollSnapInOverlay(e)}isHighlightedScrollSnapInPersistentOverlay(e){return!!this.#Ds&&this.#Ds.isScrollSnapHighlighted(e)}hideScrollSnapInPersistentOverlay(e){this.#Ds&&this.#Ds.hideScrollSnapInOverlay(e)}highlightFlexContainerInPersistentOverlay(e){this.#Ds&&this.#Ds.highlightFlexInOverlay(e)}isHighlightedFlexContainerInPersistentOverlay(e){return!!this.#Ds&&this.#Ds.isFlexHighlighted(e)}hideFlexContainerInPersistentOverlay(e){this.#Ds&&this.#Ds.hideFlexInOverlay(e)}highlightContainerQueryInPersistentOverlay(e){this.#Ds&&this.#Ds.highlightContainerQueryInOverlay(e)}isHighlightedContainerQueryInPersistentOverlay(e){return!!this.#Ds&&this.#Ds.isContainerQueryHighlighted(e)}hideContainerQueryInPersistentOverlay(e){this.#Ds&&this.#Ds.hideContainerQueryInOverlay(e)}highlightSourceOrderInOverlay(t){const n={parentOutlineColor:e.Color.SourceOrderHighlight.ParentOutline.toProtocolRGBA(),childOutlineColor:e.Color.SourceOrderHighlight.ChildOutline.toProtocolRGBA()};this.#Ns.highlightSourceOrderInOverlay(t,n)}colorOfGridInPersistentOverlay(e){return this.#Ds?this.#Ds.colorOfGrid(e).asString("hex"):null}setColorOfGridInPersistentOverlay(t,n){if(!this.#Ds)return;const r=e.Color.parse(n);r&&(this.#Ds.setColorOfGrid(t,r),this.#Ds.resetOverlay())}colorOfFlexInPersistentOverlay(e){return this.#Ds?this.#Ds.colorOfFlex(e).asString("hex"):null}setColorOfFlexInPersistentOverlay(t,n){if(!this.#Ds)return;const r=e.Color.parse(n);r&&(this.#Ds.setColorOfFlex(t,r),this.#Ds.resetOverlay())}hideSourceOrderInOverlay(){this.#Ns.hideSourceOrderHighlight()}setSourceOrderActive(e){this.#Fs=e}sourceOrderModeActive(){return this.#Fs}delayedHideHighlight(e){null===this.#ks&&(this.#ks=window.setTimeout((()=>this.highlightInOverlay({clear:!0})),e))}highlightFrame(e){this.#ks&&(clearTimeout(this.#ks),this.#ks=null),this.#xs.highlightFrame(e)}showHingeForDualScreen(e){if(e){const{x:t,y:n,width:r,height:s,contentColor:i,outlineColor:o}=e;this.overlayAgent.invoke_setShowHinge({hingeConfig:{rect:{x:t,y:n,width:r,height:s},contentColor:i,outlineColor:o}})}else this.overlayAgent.invoke_setShowHinge({})}setWindowControlsPlatform(e){this.#Bs.selectedPlatform=e}setWindowControlsThemeColor(e){this.#Bs.themeColor=e}getWindowControlsConfig(){return this.#Bs.config}async toggleWindowControlsToolbar(e){const t=e?{windowControlsOverlayConfig:this.#Bs.config}:{},n=this.overlayAgent.invoke_setShowWindowControlsOverlay(t),r=this.#Bs.toggleEmulatedOverlay(e);await Promise.all([n,r]),this.setShowViewportSizeOnResize(!e)}buildHighlightConfig(t="all",n=!1){const r=e.Settings.Settings.instance().moduleSetting("show-metrics-rulers").get(),s={showInfo:"all"===t||"container-outline"===t,showRulers:r,showStyles:n,showAccessibilityInfo:n,showExtensionLines:r,gridHighlightConfig:{},flexContainerHighlightConfig:{},flexItemHighlightConfig:{},contrastAlgorithm:o.Runtime.experiments.isEnabled("apca")?"apca":"aa"};return"all"!==t&&"content"!==t||(s.contentColor=e.Color.PageHighlight.Content.toProtocolRGBA()),"all"!==t&&"padding"!==t||(s.paddingColor=e.Color.PageHighlight.Padding.toProtocolRGBA()),"all"!==t&&"border"!==t||(s.borderColor=e.Color.PageHighlight.Border.toProtocolRGBA()),"all"!==t&&"margin"!==t||(s.marginColor=e.Color.PageHighlight.Margin.toProtocolRGBA()),"all"===t&&(s.eventTargetColor=e.Color.PageHighlight.EventTarget.toProtocolRGBA(),s.shapeColor=e.Color.PageHighlight.Shape.toProtocolRGBA(),s.shapeMarginColor=e.Color.PageHighlight.ShapeMargin.toProtocolRGBA(),s.gridHighlightConfig={rowGapColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA(),rowHatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),columnGapColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA(),columnHatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),rowLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),columnLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),rowLineDash:!0,columnLineDash:!0},s.flexContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},itemSeparator:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dotted"},lineSeparator:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},mainDistributedSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()},crossDistributedSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()},rowGapSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()},columnGapSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()}},s.flexItemHighlightConfig={baseSizeBox:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA()},baseSizeBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dotted"},flexibilityArrow:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA()}}),t.endsWith("gap")&&(s.gridHighlightConfig={gridBorderColor:e.Color.PageHighlight.GridBorder.toProtocolRGBA(),gridBorderDash:!0},"gap"!==t&&"row-gap"!==t||(s.gridHighlightConfig.rowGapColor=e.Color.PageHighlight.GapBackground.toProtocolRGBA(),s.gridHighlightConfig.rowHatchColor=e.Color.PageHighlight.GapHatch.toProtocolRGBA()),"gap"!==t&&"column-gap"!==t||(s.gridHighlightConfig.columnGapColor=e.Color.PageHighlight.GapBackground.toProtocolRGBA(),s.gridHighlightConfig.columnHatchColor=e.Color.PageHighlight.GapHatch.toProtocolRGBA())),t.endsWith("gap")&&(s.flexContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"}},"gap"!==t&&"row-gap"!==t||(s.flexContainerHighlightConfig.rowGapSpace={hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()}),"gap"!==t&&"column-gap"!==t||(s.flexContainerHighlightConfig.columnGapSpace={hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()})),"grid-areas"===t&&(s.gridHighlightConfig={rowLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),columnLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),rowLineDash:!0,columnLineDash:!0,showAreaNames:!0,areaBorderColor:e.Color.PageHighlight.GridAreaBorder.toProtocolRGBA()}),"grid-template-columns"===t&&(s.contentColor=e.Color.PageHighlight.Content.toProtocolRGBA(),s.gridHighlightConfig={columnLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),columnLineDash:!0}),"grid-template-rows"===t&&(s.contentColor=e.Color.PageHighlight.Content.toProtocolRGBA(),s.gridHighlightConfig={rowLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),rowLineDash:!0}),"justify-content"===t&&(s.flexContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},mainDistributedSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()}}),"align-content"===t&&(s.flexContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},crossDistributedSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()}}),"align-items"===t&&(s.flexContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},lineSeparator:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},crossAlignment:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA()}}),"flexibility"===t&&(s.flexItemHighlightConfig={baseSizeBox:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA()},baseSizeBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dotted"},flexibilityArrow:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA()}}),"container-outline"===t&&(s.containerQueryContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"}}),s}nodeHighlightRequested({nodeId:e}){const t=this.#er.nodeForId(e);t&&this.dispatchEventToListeners("HighlightNodeRequested",t)}static setInspectNodeHandler(e){Fs.inspectNodeHandler=e}inspectNodeRequested({backendNodeId:t}){const n=new js(this.target(),t);Fs.inspectNodeHandler?n.resolvePromise().then((e=>{e&&Fs.inspectNodeHandler&&Fs.inspectNodeHandler(e)})):e.Revealer.reveal(n),this.dispatchEventToListeners("InspectModeExited")}screenshotRequested({viewport:e}){this.dispatchEventToListeners("ScreenshotRequested",e),this.dispatchEventToListeners("InspectModeExited")}inspectModeCanceled(){this.dispatchEventToListeners("InspectModeExited")}static inspectNodeHandler=null;getOverlayAgent(){return this.overlayAgent}async hasStyleSheetText(e){return await this.#Bs.initializeStyleSheetText(e)}}class Bs{#lt;#_s;#Hs;#Us;#qs={showCSS:!1,selectedPlatform:"Windows",themeColor:"#ffffff"};constructor(e){this.#lt=e}get selectedPlatform(){return this.#qs.selectedPlatform}set selectedPlatform(e){this.#qs.selectedPlatform=e}get themeColor(){return this.#qs.themeColor}set themeColor(e){this.#qs.themeColor=e}get config(){return this.#qs}async initializeStyleSheetText(e){if(this.#_s&&e===this.#Us)return!0;const t=this.#zs(e);if(!t)return!1;if(this.#Hs=this.#js(t),!this.#Hs)return!1;const n=await this.#lt.getStyleSheetText(this.#Hs);return!!n&&(this.#_s=n,this.#Us=e,!0)}async toggleEmulatedOverlay(e){if(this.#Hs&&this.#_s)if(e){const e=Bs.#Vs(this.#qs.selectedPlatform.toLowerCase(),this.#_s);e&&await this.#lt.setStyleSheetText(this.#Hs,e,!1)}else await this.#lt.setStyleSheetText(this.#Hs,this.#_s,!1)}static#Vs(e,t){const n=Ns[e];return Bs.#Ws(n.x,n.y,n.width,n.height,t)}#zs(t){const n=e.ParsedURL.ParsedURL.extractOrigin(t),r=this.#lt.styleSheetHeaders().find((e=>e.sourceURL&&e.sourceURL.includes(n)));return r?.sourceURL}#js(e){const t=this.#lt.getStyleSheetIdsForURL(e);return t.length>0?t[0]:void 0}static#Ws(e,t,n,r,s){if(!s)return;return s.replace(/: env\(titlebar-area-x(?:,[^)]*)?\);/g,`: env(titlebar-area-x, ${e}px);`).replace(/: env\(titlebar-area-y(?:,[^)]*)?\);/g,`: env(titlebar-area-y, ${t}px);`).replace(/: env\(titlebar-area-width(?:,[^)]*)?\);/g,`: env(titlebar-area-width, calc(100% - ${n}px));`).replace(/: env\(titlebar-area-height(?:,[^)]*)?\);/g,`: env(titlebar-area-height, ${r}px);`)}transformStyleSheetforTesting(e,t,n,r,s){return Bs.#Ws(e,t,n,r,s)}}class _s{#ls;constructor(e){this.#ls=e}highlightInOverlay(e,t){const{node:n,deferredNode:r,object:s,selectorList:i}={node:void 0,deferredNode:void 0,object:void 0,selectorList:void 0,...e},o=n?n.id:void 0,a=r?r.backendNodeId():void 0,l=s?s.objectId:void 0;o||a||l?this.#ls.target().overlayAgent().invoke_highlightNode({highlightConfig:t,nodeId:o,backendNodeId:a,objectId:l,selector:i}):this.#ls.target().overlayAgent().invoke_hideHighlight()}async setInspectMode(e,t){await this.#ls.target().overlayAgent().invoke_setInspectMode({mode:e,highlightConfig:t})}highlightFrame(t){this.#ls.target().overlayAgent().invoke_highlightFrame({frameId:t,contentColor:e.Color.PageHighlight.Content.toProtocolRGBA(),contentOutlineColor:e.Color.PageHighlight.ContentOutline.toProtocolRGBA()})}}class Hs{#ls;constructor(e){this.#ls=e}highlightSourceOrderInOverlay(e,t){this.#ls.setSourceOrderActive(!0),this.#ls.setShowViewportSizeOnResize(!1),this.#ls.getOverlayAgent().invoke_highlightSourceOrder({sourceOrderConfig:t,nodeId:e.id})}hideSourceOrderHighlight(){this.#ls.setSourceOrderActive(!1),this.#ls.setShowViewportSizeOnResize(!0),this.#ls.clearHighlight()}}h.register(Fs,{capabilities:2,autostart:!0});var Us,qs=Object.freeze({__proto__:null,OverlayModel:Fs,SourceOrderHighlighter:Hs,WindowControls:Bs});class zs{#Gs;#Ks;ownerDocument;#Qs;id;index=void 0;#$s;#Xs;#Js;#Ys;nodeValueInternal;#Zs;#ei;#ti;#ni;#ri;#si;#ii;#oi=null;#ai=new Map;#li=[];assignedSlot=null;shadowRootsInternal=[];#di=new Map;#ci=new Map;#hi=0;childNodeCountInternal;childrenInternal=null;nextSibling=null;previousSibling=null;firstChild=null;lastChild=null;parentNode=null;templateContentInternal;contentDocumentInternal;childDocumentPromiseForTesting;#ui;publicId;systemId;internalSubset;name;value;constructor(e){this.#Gs=e,this.#Ks=this.#Gs.getAgent()}static create(e,t,n,r){const s=new zs(e);return s.init(t,n,r),s}init(e,t,n){if(this.#Ks=this.#Gs.getAgent(),this.ownerDocument=e,this.#Qs=t,this.id=n.nodeId,this.#$s=n.backendNodeId,this.#Gs.registerNode(this),this.#Xs=n.nodeType,this.#Js=n.nodeName,this.#Ys=n.localName,this.nodeValueInternal=n.nodeValue,this.#Zs=n.pseudoType,this.#ei=n.pseudoIdentifier,this.#ti=n.shadowRootType,this.#ni=n.frameId||null,this.#ri=n.xmlVersion,this.#si=Boolean(n.isSVG),this.#ii=Boolean(n.isScrollable),n.attributes&&this.setAttributesPayload(n.attributes),this.childNodeCountInternal=n.childNodeCount||0,n.shadowRoots)for(let e=0;ee.creation||null)),this.#oi}get subtreeMarkerCount(){return this.#hi}domModel(){return this.#Gs}backendNodeId(){return this.#$s}children(){return this.childrenInternal?this.childrenInternal.slice():null}setChildren(e){this.childrenInternal=e}setIsScrollable(e){this.#ii=e}hasAttributes(){return this.#di.size>0}childNodeCount(){return this.childNodeCountInternal}setChildNodeCount(e){this.childNodeCountInternal=e}shadowRoots(){return this.shadowRootsInternal.slice()}templateContent(){return this.templateContentInternal||null}contentDocument(){return this.contentDocumentInternal||null}setContentDocument(e){this.contentDocumentInternal=e}isIframe(){return"IFRAME"===this.#Js}importedDocument(){return this.#ui||null}nodeType(){return this.#Xs}nodeName(){return this.#Js}pseudoType(){return this.#Zs}pseudoIdentifier(){return this.#ei}hasPseudoElements(){return this.#ai.size>0}pseudoElements(){return this.#ai}checkmarkPseudoElement(){return this.#ai.get("checkmark")?.at(-1)}beforePseudoElement(){return this.#ai.get("before")?.at(-1)}afterPseudoElement(){return this.#ai.get("after")?.at(-1)}pickerIconPseudoElement(){return this.#ai.get("picker-icon")?.at(-1)}markerPseudoElement(){return this.#ai.get("marker")?.at(-1)}backdropPseudoElement(){return this.#ai.get("backdrop")?.at(-1)}viewTransitionPseudoElements(){return[...this.#ai.get("view-transition")||[],...this.#ai.get("view-transition-group")||[],...this.#ai.get("view-transition-image-pair")||[],...this.#ai.get("view-transition-old")||[],...this.#ai.get("view-transition-new")||[]]}carouselPseudoElements(){return[...this.#ai.get("scroll-button")||[],...this.#ai.get("column")||[],...this.#ai.get("scroll-marker")||[],...this.#ai.get("scroll-marker-group")||[]]}hasAssignedSlot(){return null!==this.assignedSlot}isInsertionPoint(){return!this.isXMLNode()&&("SHADOW"===this.#Js||"CONTENT"===this.#Js||"SLOT"===this.#Js)}distributedNodes(){return this.#li}isInShadowTree(){return this.#Qs}ancestorShadowHost(){const e=this.ancestorShadowRoot();return e?e.parentNode:null}ancestorShadowRoot(){if(!this.#Qs)return null;let e=this;for(;e&&!e.isShadowRoot();)e=e.parentNode;return e}ancestorUserAgentShadowRoot(){const e=this.ancestorShadowRoot();return e&&e.shadowRootType()===zs.ShadowRootTypes.UserAgent?e:null}isShadowRoot(){return Boolean(this.#ti)}shadowRootType(){return this.#ti||null}nodeNameInCorrectCase(){const e=this.shadowRootType();return e?"#shadow-root ("+e+")":this.localName()?this.localName().length!==this.nodeName().length?this.nodeName():this.localName():this.nodeName()}setNodeName(e,t){this.#Ks.invoke_setNodeName({nodeId:this.id,name:e}).then((e=>{e.getError()||this.#Gs.markUndoableState(),t&&t(e.getError()||null,this.#Gs.nodeForId(e.nodeId))}))}localName(){return this.#Ys}nodeValue(){return this.nodeValueInternal}setNodeValueInternal(e){this.nodeValueInternal=e}setNodeValue(e,t){this.#Ks.invoke_setNodeValue({nodeId:this.id,value:e}).then((e=>{e.getError()||this.#Gs.markUndoableState(),t&&t(e.getError()||null)}))}getAttribute(e){const t=this.#di.get(e);return t?t.value:void 0}setAttribute(e,t,n){this.#Ks.invoke_setAttributesAsText({nodeId:this.id,text:t,name:e}).then((e=>{e.getError()||this.#Gs.markUndoableState(),n&&n(e.getError()||null)}))}setAttributeValue(e,t,n){this.#Ks.invoke_setAttributeValue({nodeId:this.id,name:e,value:t}).then((e=>{e.getError()||this.#Gs.markUndoableState(),n&&n(e.getError()||null)}))}setAttributeValuePromise(e,t){return new Promise((n=>this.setAttributeValue(e,t,n)))}attributes(){return[...this.#di.values()]}async removeAttribute(e){(await this.#Ks.invoke_removeAttribute({nodeId:this.id,name:e})).getError()||(this.#di.delete(e),this.#Gs.markUndoableState())}getChildNodesPromise(){return new Promise((e=>this.getChildNodes((t=>e(t)))))}getChildNodes(e){this.childrenInternal?e(this.children()):this.#Ks.invoke_requestChildNodes({nodeId:this.id}).then((t=>{e(t.getError()?null:this.children())}))}async getSubtree(e,t){return(await this.#Ks.invoke_requestChildNodes({nodeId:this.id,depth:e,pierce:t})).getError()?null:this.childrenInternal}async getOuterHTML(){const{outerHTML:e}=await this.#Ks.invoke_getOuterHTML({nodeId:this.id});return e}setOuterHTML(e,t){this.#Ks.invoke_setOuterHTML({nodeId:this.id,outerHTML:e}).then((e=>{e.getError()||this.#Gs.markUndoableState(),t&&t(e.getError()||null)}))}removeNode(e){return this.#Ks.invoke_removeNode({nodeId:this.id}).then((t=>{t.getError()||this.#Gs.markUndoableState(),e&&e(t.getError()||null)}))}async copyNode(){const{outerHTML:e}=await this.#Ks.invoke_getOuterHTML({nodeId:this.id});return null!==e&&a.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(e),e}path(){function e(e){return e.#Js.length?void 0!==e.index?e.index:e.parentNode?e.isShadowRoot()?e.shadowRootType()===zs.ShadowRootTypes.UserAgent?"u":"a":e.nodeType()===Node.DOCUMENT_NODE?"d":null:null:null}const t=[];let n=this;for(;n;){const r=e(n);if(null===r)break;t.push([r,n.#Js]),n=n.parentNode}return t.reverse(),t.join(",")}isAncestor(e){if(!e)return!1;let t=e.parentNode;for(;t;){if(this===t)return!0;t=t.parentNode}return!1}isDescendant(e){return e.isAncestor(this)}frameOwnerFrameId(){return this.#ni}frameId(){let e=this.parentNode||this;for(;!e.#ni&&e.parentNode;)e=e.parentNode;return e.#ni}setAttributesPayload(e){let t=!this.#di||e.length!==2*this.#di.size;const n=this.#di||new Map;this.#di=new Map;for(let r=0;rt!==e));n&&n.length>0?this.#ai.set(t,n):this.#ai.delete(t)}else{const t=this.shadowRootsInternal.indexOf(e);if(-1!==t)this.shadowRootsInternal.splice(t,1);else{if(!this.childrenInternal)throw new Error("DOMNode._children is expected to not be null.");if(-1===this.childrenInternal.indexOf(e))throw new Error("DOMNode._children is expected to contain the node to be removed.");this.childrenInternal.splice(this.childrenInternal.indexOf(e),1)}}e.parentNode=null,this.#hi-=e.#hi,e.#hi&&this.#Gs.dispatchEventToListeners(Us.MarkersChanged,this),this.renumber()}setChildrenPayload(e){this.childrenInternal=[];for(let t=0;t=0?this.childrenInternal[e-1]:null,t.parentNode=this}}addAttribute(e,t){const n={name:e,value:t,_node:this};this.#di.set(e,n)}setAttributeInternal(e,t){const n=this.#di.get(e);n?n.value=t:this.addAttribute(e,t)}removeAttributeInternal(e){this.#di.delete(e)}copyTo(e,t,n){this.#Ks.invoke_copyTo({nodeId:this.id,targetNodeId:e.id,insertBeforeNodeId:t?t.id:void 0}).then((e=>{e.getError()||this.#Gs.markUndoableState(),n&&n(e.getError()||null,this.#Gs.nodeForId(e.nodeId))}))}moveTo(e,t,n){this.#Ks.invoke_moveTo({nodeId:this.id,targetNodeId:e.id,insertBeforeNodeId:t?t.id:void 0}).then((e=>{e.getError()||this.#Gs.markUndoableState(),n&&n(e.getError()||null,this.#Gs.nodeForId(e.nodeId))}))}isXMLNode(){return Boolean(this.#ri)}setMarker(e,t){if(null!==t){if(this.parentNode&&!this.#ci.has(e))for(let e=this;e;e=e.parentNode)++e.#hi;this.#ci.set(e,t);for(let e=this;e;e=e.parentNode)this.#Gs.dispatchEventToListeners(Us.MarkersChanged,e)}else{if(!this.#ci.has(e))return;this.#ci.delete(e);for(let e=this;e;e=e.parentNode)--e.#hi;for(let e=this;e;e=e.parentNode)this.#Gs.dispatchEventToListeners(Us.MarkersChanged,e)}}marker(e){return this.#ci.get(e)||null}getMarkerKeysForTest(){return[...this.#ci.keys()]}traverseMarkers(e){!function t(n){if(n.#hi){for(const t of n.#ci.keys())e(n,t);if(n.childrenInternal)for(const e of n.childrenInternal)t(e)}}(this)}resolveURL(t){if(!t)return t;for(let n=this;n;n=n.parentNode)if(n instanceof Ws&&n.baseURL)return e.ParsedURL.ParsedURL.completeURL(n.baseURL,t);return null}highlight(e){this.#Gs.overlayModel().highlightInOverlay({node:this,selectorList:void 0},e)}highlightForTwoSeconds(){this.#Gs.overlayModel().highlightInOverlayForTwoSeconds({node:this,selectorList:void 0})}async resolveToObject(e,t){const{object:n}=await this.#Ks.invoke_resolveNode({nodeId:this.id,backendNodeId:void 0,executionContextId:t,objectGroup:e});return n&&this.#Gs.runtimeModelInternal.createRemoteObject(n)||null}async boxModel(){const{model:e}=await this.#Ks.invoke_getBoxModel({nodeId:this.id});return e}async setAsInspectedNode(){let e=this;for(e?.pseudoType()&&(e=e.parentNode);e;){let t=e.ancestorUserAgentShadowRoot();if(!t)break;if(t=e.ancestorShadowHost(),!t)break;e=t}if(!e)throw new Error("In DOMNode.setAsInspectedNode: node is expected to not be null.");await this.#Ks.invoke_setInspectedNode({nodeId:e.id})}enclosingElementOrSelf(){let e=this;return e&&e.nodeType()===Node.TEXT_NODE&&e.parentNode&&(e=e.parentNode),e&&e.nodeType()!==Node.ELEMENT_NODE&&(e=null),e}async callFunction(e,t=[]){const n=await this.resolveToObject();if(!n)return null;const r=await n.callFunction(e,t.map((e=>Bn.toCallArgument(e))));return n.release(),r.wasThrown||!r.object?null:{value:r.object.value}}async scrollIntoView(){const e=this.enclosingElementOrSelf();if(!e)return;await e.callFunction((function(){this.scrollIntoViewIfNeeded(!0)}))&&e.highlightForTwoSeconds()}async focus(){const e=this.enclosingElementOrSelf();if(!e)throw new Error("DOMNode.focus expects node to not be null.");await e.callFunction((function(){this.focus()}))&&(e.highlightForTwoSeconds(),await this.#Gs.target().pageAgent().invoke_bringToFront())}simpleSelector(){const e=this.localName()||this.nodeName().toLowerCase();if(this.nodeType()!==Node.ELEMENT_NODE)return e;const t=this.getAttribute("type"),n=this.getAttribute("id"),r=this.getAttribute("class");if("input"===e&&t&&!n&&!r)return e+'[type="'+CSS.escape(t)+'"]';if(n)return e+"#"+CSS.escape(n);if(r){return("div"===e?"":e)+"."+r.trim().split(/\s+/g).map((e=>CSS.escape(e))).join(".")}return this.pseudoIdentifier()?`${e}(${this.pseudoIdentifier()})`:e}async getAnchorBySpecifier(e){const t=await this.#Ks.invoke_getAnchorElement({nodeId:this.id,anchorSpecifier:e});return t.getError()?null:this.domModel().nodeForId(t.nodeId)}classNames(){const e=this.getAttribute("class");return e?e.split(/\s+/):[]}}!function(e){let t;!function(e){e.UserAgent="user-agent",e.Open="open",e.Closed="closed"}(t=e.ShadowRootTypes||(e.ShadowRootTypes={}))}(zs||(zs={}));class js{#Gs;#$s;constructor(e,t){this.#Gs=e.model(Gs),this.#$s=t}resolve(e){this.resolvePromise().then(e)}async resolvePromise(){const e=await this.#Gs.pushNodesByBackendIdsToFrontend(new Set([this.#$s]));return e?.get(this.#$s)||null}backendNodeId(){return this.#$s}domModel(){return this.#Gs}highlight(){this.#Gs.overlayModel().highlightInOverlay({deferredNode:this,selectorList:void 0})}}class Vs{nodeType;nodeName;deferredNode;constructor(e,t,n,r){this.nodeType=n,this.nodeName=r,this.deferredNode=new js(e,t)}}class Ws extends zs{body;documentElement;documentURL;baseURL;constructor(e,t){super(e),this.body=null,this.documentElement=null,this.init(this,!1,t),this.documentURL=t.documentURL||"",this.baseURL=t.baseURL||""}}class Gs extends h{agent;idToDOMNode=new Map;#gi=null;#pi=new Set;runtimeModelInternal;#mi;#fi=null;#bi;#yi;#vi;constructor(e){super(e),this.agent=e.domAgent(),e.registerDOMDispatcher(new Ks(this)),this.runtimeModelInternal=e.model(Jr),e.suspended()||this.agent.invoke_enable({}),o.Runtime.experiments.isEnabled("capture-node-creation-stacks")&&this.agent.invoke_setNodeStackTracesEnabled({enable:!0})}runtimeModel(){return this.runtimeModelInternal}cssModel(){return this.target().model(Br)}overlayModel(){return this.target().model(Fs)}static cancelSearch(){for(const e of W.instance().models(Gs))e.cancelSearch()}scheduleMutationEvent(e){this.hasEventListeners(Us.DOMMutated)&&(this.#mi=(this.#mi||0)+1,Promise.resolve().then(function(e,t){if(!this.hasEventListeners(Us.DOMMutated)||this.#mi!==t)return;this.dispatchEventToListeners(Us.DOMMutated,e)}.bind(this,e,this.#mi)))}requestDocument(){return this.#gi?Promise.resolve(this.#gi):(this.#fi||(this.#fi=this.requestDocumentInternal()),this.#fi)}async getOwnerNodeForFrame(e){const t=await this.agent.invoke_getFrameOwner({frameId:e});return t.getError()?null:new js(this.target(),t.backendNodeId)}async requestDocumentInternal(){const e=await this.agent.invoke_getDocument({});if(e.getError())return null;const{root:t}=e;if(this.#fi=null,t&&this.setDocument(t),!this.#gi)return console.error("No document"),null;const n=this.parentModel();if(n&&!this.#bi){await n.requestDocument();const e=this.target().model(ii)?.mainFrame;if(e){const t=await n.agent.invoke_getFrameOwner({frameId:e.id});!t.getError()&&t.nodeId&&(this.#bi=n.nodeForId(t.nodeId))}}if(this.#bi){const e=this.#bi.contentDocument();this.#bi.setContentDocument(this.#gi),this.#bi.setChildren([]),this.#gi?(this.#gi.parentNode=this.#bi,this.dispatchEventToListeners(Us.NodeInserted,this.#gi)):e&&this.dispatchEventToListeners(Us.NodeRemoved,{node:e,parent:this.#bi})}return this.#gi}existingDocument(){return this.#gi}async pushNodeToFrontend(e){await this.requestDocument();const{nodeId:t}=await this.agent.invoke_requestNode({objectId:e});return this.nodeForId(t)}pushNodeByPathToFrontend(e){return this.requestDocument().then((()=>this.agent.invoke_pushNodeByPathToFrontend({path:e}))).then((({nodeId:e})=>e))}async pushNodesByBackendIdsToFrontend(e){await this.requestDocument();const t=[...e],{nodeIds:n}=await this.agent.invoke_pushNodesByBackendIdsToFrontend({backendNodeIds:t});if(!n)return null;const r=new Map;for(let e=0;ethis.#pi.add(e))),this.#yi||(this.#yi=window.setTimeout(this.loadNodeAttributes.bind(this),20))}loadNodeAttributes(){this.#yi=void 0;for(const e of this.#pi)this.agent.invoke_getAttributes({nodeId:e}).then((({attributes:t})=>{if(!t)return;const n=this.idToDOMNode.get(e);n&&n.setAttributesPayload(t)&&(this.dispatchEventToListeners(Us.AttrModified,{node:n,name:"style"}),this.scheduleMutationEvent(n))}));this.#pi.clear()}characterDataModified(e,t){const n=this.idToDOMNode.get(e);n?(n.setNodeValueInternal(t),this.dispatchEventToListeners(Us.CharacterDataModified,n),this.scheduleMutationEvent(n)):console.error("nodeId could not be resolved to a node")}nodeForId(e){return e&&this.idToDOMNode.get(e)||null}documentUpdated(){const e=Boolean(this.#gi);this.setDocument(null),this.parentModel()&&e&&!this.#fi&&this.requestDocument()}setDocument(e){this.idToDOMNode=new Map,this.#gi=e&&"nodeId"in e?new Ws(this,e):null,$s.instance().dispose(this),this.parentModel()||this.dispatchEventToListeners(Us.DocumentUpdated,this)}setDocumentForTest(e){this.setDocument(e)}setDetachedRoot(e){"#document"===e.nodeName?new Ws(this,e):zs.create(this,null,!1,e)}setChildNodes(e,t){if(!e&&t.length)return void this.setDetachedRoot(t[0]);const n=this.idToDOMNode.get(e);n?.setChildrenPayload(t)}childNodeCountUpdated(e,t){const n=this.idToDOMNode.get(e);n?(n.setChildNodeCount(t),this.dispatchEventToListeners(Us.ChildNodeCountUpdated,n),this.scheduleMutationEvent(n)):console.error("nodeId could not be resolved to a node")}childNodeInserted(e,t,n){const r=this.idToDOMNode.get(e),s=this.idToDOMNode.get(t);if(!r)return void console.error("parentId could not be resolved to a node");const i=r.insertChild(s,n);this.idToDOMNode.set(i.id,i),this.dispatchEventToListeners(Us.NodeInserted,i),this.scheduleMutationEvent(i)}childNodeRemoved(e,t){const n=this.idToDOMNode.get(e),r=this.idToDOMNode.get(t);n&&r?(n.removeChild(r),this.unbind(r),this.dispatchEventToListeners(Us.NodeRemoved,{node:r,parent:n}),this.scheduleMutationEvent(r)):console.error("parentId or nodeId could not be resolved to a node")}shadowRootPushed(e,t){const n=this.idToDOMNode.get(e);if(!n)return;const r=zs.create(this,n.ownerDocument,!0,t);r.parentNode=n,this.idToDOMNode.set(r.id,r),n.shadowRootsInternal.unshift(r),this.dispatchEventToListeners(Us.NodeInserted,r),this.scheduleMutationEvent(r)}shadowRootPopped(e,t){const n=this.idToDOMNode.get(e);if(!n)return;const r=this.idToDOMNode.get(t);r&&(n.removeChild(r),this.unbind(r),this.dispatchEventToListeners(Us.NodeRemoved,{node:r,parent:n}),this.scheduleMutationEvent(r))}pseudoElementAdded(e,t){const n=this.idToDOMNode.get(e);if(!n)return;const r=zs.create(this,n.ownerDocument,!1,t);r.parentNode=n,this.idToDOMNode.set(r.id,r);const s=r.pseudoType();if(!s)throw new Error("DOMModel._pseudoElementAdded expects pseudoType to be defined.");const i=n.pseudoElements().get(s);if(i&&i.length>0){if(!s.startsWith("view-transition")&&!s.startsWith("scroll-")&&"column"!==s)throw new Error(`DOMModel.pseudoElementAdded expects parent to not already have this pseudo type added; only view-transition* and scrolling pseudo elements can coexist under the same parent. ${i.length} elements of type ${s} already exist on parent.`);i.push(r)}else n.pseudoElements().set(s,[r]);this.dispatchEventToListeners(Us.NodeInserted,r),this.scheduleMutationEvent(r)}scrollableFlagUpdated(e,t){const n=this.nodeForId(e);n&&n.isScrollable()!==t&&(n.setIsScrollable(t),this.dispatchEventToListeners(Us.ScrollableFlagUpdated,{node:n}))}topLayerElementsUpdated(){this.dispatchEventToListeners(Us.TopLayerElementsChanged)}pseudoElementRemoved(e,t){const n=this.idToDOMNode.get(e);if(!n)return;const r=this.idToDOMNode.get(t);r&&(n.removeChild(r),this.unbind(r),this.dispatchEventToListeners(Us.NodeRemoved,{node:r,parent:n}),this.scheduleMutationEvent(r))}distributedNodesUpdated(e,t){const n=this.idToDOMNode.get(e);n&&(n.setDistributedNodePayloads(t),this.dispatchEventToListeners(Us.DistributedNodesChanged,n),this.scheduleMutationEvent(n))}unbind(e){this.idToDOMNode.delete(e.id);const t=e.children();for(let e=0;t&&ee||[]))}querySelector(e,t){return this.agent.invoke_querySelector({nodeId:e,selector:t}).then((({nodeId:e})=>e))}querySelectorAll(e,t){return this.agent.invoke_querySelectorAll({nodeId:e,selector:t}).then((({nodeIds:e})=>e))}getTopLayerElements(){return this.agent.invoke_getTopLayerElements().then((({nodeIds:e})=>e))}getDetachedDOMNodes(){return this.agent.invoke_getDetachedDomNodes().then((({detachedNodes:e})=>e))}getElementByRelation(e,t){return this.agent.invoke_getElementByRelation({nodeId:e,relation:t}).then((({nodeId:e})=>e))}markUndoableState(e){$s.instance().markUndoableState(this,e||!1)}async nodeForLocation(e,t,n){const r=await this.agent.invoke_getNodeForLocation({x:e,y:t,includeUserAgentShadowDOM:n});return r.getError()||!r.nodeId?null:this.nodeForId(r.nodeId)}async getContainerForNode(e,t,n,r,s){const{nodeId:i}=await this.agent.invoke_getContainerForNode({nodeId:e,containerName:t,physicalAxes:n,logicalAxes:r,queriesScrollState:s});return i?this.nodeForId(i):null}pushObjectAsNodeToFrontend(e){return e.isNode()&&e.objectId?this.pushNodeToFrontend(e.objectId):Promise.resolve(null)}suspendModel(){return this.agent.invoke_disable().then((()=>this.setDocument(null)))}async resumeModel(){await this.agent.invoke_enable({})}dispose(){$s.instance().dispose(this)}parentModel(){const e=this.target().parentTarget();return e?e.model(Gs):null}getAgent(){return this.agent}registerNode(e){this.idToDOMNode.set(e.id,e)}}!function(e){e.AttrModified="AttrModified",e.AttrRemoved="AttrRemoved",e.CharacterDataModified="CharacterDataModified",e.DOMMutated="DOMMutated",e.NodeInserted="NodeInserted",e.NodeRemoved="NodeRemoved",e.DocumentUpdated="DocumentUpdated",e.ChildNodeCountUpdated="ChildNodeCountUpdated",e.DistributedNodesChanged="DistributedNodesChanged",e.MarkersChanged="MarkersChanged",e.TopLayerElementsChanged="TopLayerElementsChanged",e.ScrollableFlagUpdated="ScrollableFlagUpdated"}(Us||(Us={}));class Ks{#er;constructor(e){this.#er=e}documentUpdated(){this.#er.documentUpdated()}attributeModified({nodeId:e,name:t,value:n}){this.#er.attributeModified(e,t,n)}attributeRemoved({nodeId:e,name:t}){this.#er.attributeRemoved(e,t)}inlineStyleInvalidated({nodeIds:e}){this.#er.inlineStyleInvalidated(e)}characterDataModified({nodeId:e,characterData:t}){this.#er.characterDataModified(e,t)}setChildNodes({parentId:e,nodes:t}){this.#er.setChildNodes(e,t)}childNodeCountUpdated({nodeId:e,childNodeCount:t}){this.#er.childNodeCountUpdated(e,t)}childNodeInserted({parentNodeId:e,previousNodeId:t,node:n}){this.#er.childNodeInserted(e,t,n)}childNodeRemoved({parentNodeId:e,nodeId:t}){this.#er.childNodeRemoved(e,t)}shadowRootPushed({hostId:e,root:t}){this.#er.shadowRootPushed(e,t)}shadowRootPopped({hostId:e,rootId:t}){this.#er.shadowRootPopped(e,t)}pseudoElementAdded({parentId:e,pseudoElement:t}){this.#er.pseudoElementAdded(e,t)}pseudoElementRemoved({parentId:e,pseudoElementId:t}){this.#er.pseudoElementRemoved(e,t)}distributedNodesUpdated({insertionPointId:e,distributedNodes:t}){this.#er.distributedNodesUpdated(e,t)}topLayerElementsUpdated(){this.#er.topLayerElementsUpdated()}scrollableFlagUpdated({nodeId:e,isScrollable:t}){this.#er.scrollableFlagUpdated(e,t)}}let Qs=null;class $s{#Lt;#as;#Ii;constructor(){this.#Lt=[],this.#as=0,this.#Ii=null}static instance(e={forceNew:null}){const{forceNew:t}=e;return Qs&&!t||(Qs=new $s),Qs}async markUndoableState(e,t){this.#Ii&&e!==this.#Ii&&(this.#Ii.markUndoableState(),this.#Ii=null),t&&this.#Ii===e||(this.#Lt=this.#Lt.slice(0,this.#as),this.#Lt.push(e),this.#as=this.#Lt.length,t?this.#Ii=e:(await e.getAgent().invoke_markUndoableState(),this.#Ii=null))}async undo(){if(0===this.#as)return await Promise.resolve();--this.#as,this.#Ii=null,await this.#Lt[this.#as].getAgent().invoke_undo()}async redo(){if(this.#as>=this.#Lt.length)return await Promise.resolve();++this.#as,this.#Ii=null,await this.#Lt[this.#as-1].getAgent().invoke_redo()}dispose(e){let t=0;for(let n=0;n(t.ContentData.ContentData.isError(e)||(this.#Ai=e),this.#Oi=null,e)))),await this.#Oi)}canonicalMimeType(){return this.contentType().canonicalMimeType()||this.mimeType}async searchInContent(e,n,r){if(!this.frameId)return[];if(this.request)return await this.request.searchInContent(e,n,r);const s=await this.#rr.target().pageAgent().invoke_searchInResource({frameId:this.frameId,url:this.url,query:e,caseSensitive:n,isRegex:r});return t.TextUtils.performSearchInSearchMatches(s.result||[],e,n,r)}async populateImageSource(e){const n=await this.requestContentData();t.ContentData.ContentData.isError(n)||(e.src=n.asDataUrl()??this.#Si)}async innerRequestContent(){if(this.request)return await this.request.requestContentData();const e=await this.#rr.target().pageAgent().invoke_getResourceContent({frameId:this.frameId,url:this.url}),n=e.getError();return n?{error:n}:new t.ContentData.ContentData(e.content,e.base64Encoded,this.mimeType)}frame(){return this.#Ci?this.#rr.frameForId(this.#Ci):null}statusCode(){return this.#wi?this.#wi.statusCode:0}}var Ys,Zs=Object.freeze({__proto__:null,Resource:Js});class ei extends h{#Di="";#Ni="";#Fi=new Set;constructor(e){super(e)}updateSecurityOrigins(e){const t=this.#Fi;this.#Fi=e;for(const e of t)this.#Fi.has(e)||this.dispatchEventToListeners(Ys.SecurityOriginRemoved,e);for(const e of this.#Fi)t.has(e)||this.dispatchEventToListeners(Ys.SecurityOriginAdded,e)}securityOrigins(){return[...this.#Fi]}mainSecurityOrigin(){return this.#Di}unreachableMainSecurityOrigin(){return this.#Ni}setMainSecurityOrigin(e,t){this.#Di=e,this.#Ni=t||null,this.dispatchEventToListeners(Ys.MainSecurityOriginChanged,{mainSecurityOrigin:this.#Di,unreachableMainSecurityOrigin:this.#Ni})}}!function(e){e.SecurityOriginAdded="SecurityOriginAdded",e.SecurityOriginRemoved="SecurityOriginRemoved",e.MainSecurityOriginChanged="MainSecurityOriginChanged"}(Ys||(Ys={})),h.register(ei,{capabilities:0,autostart:!1});var ti=Object.freeze({__proto__:null,get Events(){return Ys},SecurityOriginManager:ei});class ni extends h{#Bi;#_i;constructor(e){super(e),this.#Bi="",this.#_i=new Set}updateStorageKeys(e){const t=this.#_i;this.#_i=e;for(const e of t)this.#_i.has(e)||this.dispatchEventToListeners("StorageKeyRemoved",e);for(const e of this.#_i)t.has(e)||this.dispatchEventToListeners("StorageKeyAdded",e)}storageKeys(){return[...this.#_i]}mainStorageKey(){return this.#Bi}setMainStorageKey(e){this.#Bi=e,this.dispatchEventToListeners("MainStorageKeyChanged",{mainStorageKey:this.#Bi})}}h.register(ni,{capabilities:0,autostart:!1});var ri,si=Object.freeze({__proto__:null,StorageKeyManager:ni,parseStorageKey:function(t){const n=t.split("^"),r={origin:e.ParsedURL.ParsedURL.extractOrigin(n[0]),components:new Map};for(let e=1;e{this.processCachedResources(e.getError()?null:e.frameTree),this.mainFrame&&this.processPendingEvents(this.mainFrame)}))}static frameForRequest(e){const t=Z.forRequest(e),n=t?t.target().model(ii):null;return n&&e.frameId?n.frameForId(e.frameId):null}static frames(){const e=[];for(const t of W.instance().models(ii))e.push(...t.frames());return e}static resourceForURL(e){for(const t of W.instance().models(ii)){const n=t.mainFrame,r=n?n.resourceForURL(e):null;if(r)return r}return null}static reloadAllPages(e,t){for(const n of W.instance().models(ii))n.target().parentTarget()?.type()!==U.FRAME&&n.reloadPage(e,t)}async storageKeyForFrame(e){if(!this.framesInternal.has(e))return null;const t=await this.storageAgent.invoke_getStorageKeyForFrame({frameId:e});return"Frame tree node for given frame not found"===t.getError()?null:t.storageKey}domModel(){return this.target().model(Gs)}processCachedResources(e){e&&":"!==e.frame.url&&(this.dispatchEventToListeners(ri.WillLoadCachedResources),this.addFramesRecursively(null,e),this.target().setInspectedURL(e.frame.url)),this.#qi=!0;const t=this.target().model(Jr);t&&(t.setExecutionContextComparator(this.executionContextComparator.bind(this)),t.fireExecutionContextOrderChanged()),this.dispatchEventToListeners(ri.CachedResourcesLoaded,this)}cachedResourcesLoaded(){return this.#qi}addFrame(e,t){this.framesInternal.set(e.id,e),e.isMainFrame()&&(this.mainFrame=e),this.dispatchEventToListeners(ri.FrameAdded,e),this.updateSecurityOrigins(),this.updateStorageKeys()}frameAttached(e,t,n){const r=t&&this.framesInternal.get(t)||null;if(!this.#qi&&r)return null;if(this.framesInternal.has(e))return null;const s=new oi(this,r,e,null,n||null);return t&&!r&&(s.crossTargetParentFrameId=t),s.isMainFrame()&&this.mainFrame&&this.frameDetached(this.mainFrame.id,!1),this.addFrame(s,!0),s}frameNavigated(e,t){const n=e.parentId&&this.framesInternal.get(e.parentId)||null;if(!this.#qi&&n)return;let r=this.framesInternal.get(e.id)||null;if(!r&&(r=this.frameAttached(e.id,e.parentId||null),console.assert(Boolean(r)),!r))return;this.dispatchEventToListeners(ri.FrameWillNavigate,r),r.navigate(e),t&&(r.backForwardCacheDetails.restoredFromCache="BackForwardCacheRestore"===t),r.isMainFrame()&&this.target().setInspectedURL(r.url),this.dispatchEventToListeners(ri.FrameNavigated,r),r.isPrimaryFrame()&&this.primaryPageChanged(r,"Navigation");const s=r.resources();for(let e=0;e=0,"Unbalanced call to ResourceTreeModel.resumeReload()"),!this.#ji&&this.#zi){const{ignoreCache:e,scriptToEvaluateOnLoad:t}=this.#zi;this.reloadPage(e,t)}}reloadPage(e,t){const n=this.mainFrame?.loaderId;if(!n)return;if(this.#zi||this.dispatchEventToListeners(ri.PageReloadRequested,this),this.#ji)return void(this.#zi={ignoreCache:e,scriptToEvaluateOnLoad:t});this.#zi=null;const r=this.target().model(Z);r&&r.clearRequests(),this.dispatchEventToListeners(ri.WillReloadPage),this.agent.invoke_reload({ignoreCache:e,scriptToEvaluateOnLoad:t,loaderId:n})}navigate(e){return this.agent.invoke_navigate({url:e})}async navigationHistory(){const e=await this.agent.invoke_getNavigationHistory();return e.getError()?null:{currentIndex:e.currentIndex,entries:e.entries}}navigateToHistoryEntry(e){this.agent.invoke_navigateToHistoryEntry({entryId:e.id})}setLifecycleEventsEnabled(e){return this.agent.invoke_setLifecycleEventsEnabled({enabled:e})}async fetchAppManifest(){const e=await this.agent.invoke_getAppManifest({});return e.getError()?{url:e.url,data:null,errors:[]}:{url:e.url,data:e.data||null,errors:e.errors}}async getInstallabilityErrors(){return(await this.agent.invoke_getInstallabilityErrors()).installabilityErrors||[]}async getAppId(){return await this.agent.invoke_getAppId()}executionContextComparator(e,t){function n(e){let t=e;const n=[];for(;t;)n.push(t),t=t.sameTargetParentFrame();return n.reverse()}if(e.target()!==t.target())return Zr.comparator(e,t);const r=e.frameId?n(this.frameForId(e.frameId)):[],s=t.frameId?n(this.frameForId(t.frameId)):[];let i,o;for(let e=0;;e++)if(!r[e]||!s[e]||r[e]!==s[e]){i=r[e],o=s[e];break}return!i&&o?-1:!o&&i?1:i&&o?i.id.localeCompare(o.id):Zr.comparator(e,t)}getSecurityOriginData(){const t=new Set;let n=null,r=null;for(const s of this.framesInternal.values()){const i=s.securityOrigin;if(i&&(t.add(i),s.isMainFrame()&&(n=i,s.unreachableUrl()))){r=new e.ParsedURL.ParsedURL(s.unreachableUrl()).securityOrigin()}}return{securityOrigins:t,mainSecurityOrigin:n,unreachableMainSecurityOrigin:r}}async getStorageKeyData(){const e=new Set;let t=null;for(const{isMainFrame:n,storageKey:r}of await Promise.all([...this.framesInternal.values()].map((e=>e.getStorageKey(!1).then((t=>({isMainFrame:e.isMainFrame(),storageKey:t})))))))n&&(t=r),r&&e.add(r);return{storageKeys:e,mainStorageKey:t}}updateSecurityOrigins(){const e=this.getSecurityOriginData();this.#Hi.setMainSecurityOrigin(e.mainSecurityOrigin||"",e.unreachableMainSecurityOrigin||""),this.#Hi.updateSecurityOrigins(e.securityOrigins)}async updateStorageKeys(){const e=await this.getStorageKeyData();this.#Ui.setMainStorageKey(e.mainStorageKey||""),this.#Ui.updateStorageKeys(e.storageKeys)}async getMainStorageKey(){return this.mainFrame?await this.mainFrame.getStorageKey(!1):null}getMainSecurityOrigin(){const e=this.getSecurityOriginData();return e.mainSecurityOrigin||e.unreachableMainSecurityOrigin}onBackForwardCacheNotUsed(e){this.mainFrame&&this.mainFrame.id===e.frameId&&this.mainFrame.loaderId===e.loaderId?(this.mainFrame.setBackForwardCacheDetails(e),this.dispatchEventToListeners(ri.BackForwardCacheDetailsUpdated,this.mainFrame)):this.#Vi.add(e)}processPendingEvents(e){if(e.isMainFrame())for(const t of this.#Vi)if(e.id===t.frameId&&e.loaderId===t.loaderId){e.setBackForwardCacheDetails(t),this.#Vi.delete(t);break}}}!function(e){e.FrameAdded="FrameAdded",e.FrameNavigated="FrameNavigated",e.FrameDetached="FrameDetached",e.FrameResized="FrameResized",e.FrameWillNavigate="FrameWillNavigate",e.PrimaryPageChanged="PrimaryPageChanged",e.ResourceAdded="ResourceAdded",e.WillLoadCachedResources="WillLoadCachedResources",e.CachedResourcesLoaded="CachedResourcesLoaded",e.DOMContentLoaded="DOMContentLoaded",e.LifecycleEvent="LifecycleEvent",e.Load="Load",e.PageReloadRequested="PageReloadRequested",e.WillReloadPage="WillReloadPage",e.InterstitialShown="InterstitialShown",e.InterstitialHidden="InterstitialHidden",e.BackForwardCacheDetailsUpdated="BackForwardCacheDetailsUpdated",e.JavaScriptDialogOpening="JavaScriptDialogOpening"}(ri||(ri={}));class oi{#ls;#Gi;#C;crossTargetParentFrameId=null;#xi;#h;#Si;#Ki;#Qi;#$i;#Xi;#Ji;#Yi;#Zi;#eo;#to;#no;#ro=null;#so=new Set;resourcesMap=new Map;backForwardCacheDetails={restoredFromCache:void 0,explanations:[],explanationsTree:void 0};constructor(e,t,n,s,i){this.#ls=e,this.#Gi=t,this.#C=n,this.#xi=s?.loaderId??"",this.#h=s?.name,this.#Si=s&&s.url||r.DevToolsPath.EmptyUrlString,this.#Ki=s?.domainAndRegistry||"",this.#Qi=s?.securityOrigin??null,this.#$i=s?.securityOriginDetails,this.#Ji=s&&s.unreachableUrl||r.DevToolsPath.EmptyUrlString,this.#Yi=s?.adFrameStatus,this.#Zi=s?.secureContextType??null,this.#eo=s?.crossOriginIsolatedContextType??null,this.#to=s?.gatedAPIFeatures??null,this.#no=i,this.#Gi&&this.#Gi.#so.add(this)}isSecureContext(){return null!==this.#Zi&&this.#Zi.startsWith("Secure")}getSecureContextType(){return this.#Zi}isCrossOriginIsolated(){return null!==this.#eo&&this.#eo.startsWith("Isolated")}getCrossOriginIsolatedContextType(){return this.#eo}getGatedAPIFeatures(){return this.#to}getCreationStackTraceData(){return{creationStackTrace:this.#no,creationStackTraceTarget:this.#ro||this.resourceTreeModel().target()}}navigate(e){this.#xi=e.loaderId,this.#h=e.name,this.#Si=e.url,this.#Ki=e.domainAndRegistry,this.#Qi=e.securityOrigin,this.#$i=e.securityOriginDetails,this.getStorageKey(!0),this.#Ji=e.unreachableUrl||r.DevToolsPath.EmptyUrlString,this.#Yi=e?.adFrameStatus,this.#Zi=e.secureContextType,this.#eo=e.crossOriginIsolatedContextType,this.#to=e.gatedAPIFeatures,this.backForwardCacheDetails={restoredFromCache:void 0,explanations:[],explanationsTree:void 0};const t=this.resourcesMap.get(this.#Si);this.resourcesMap.clear(),this.removeChildFrames(),t&&t.loaderId===this.#xi&&this.addResource(t)}resourceTreeModel(){return this.#ls}get id(){return this.#C}get name(){return this.#h||""}get url(){return this.#Si}domainAndRegistry(){return this.#Ki}async getAdScriptId(e){return(await this.#ls.agent.invoke_getAdScriptId({frameId:e})).adScriptId||null}get securityOrigin(){return this.#Qi}get securityOriginDetails(){return this.#$i??null}getStorageKey(e){return this.#Xi&&!e||(this.#Xi=this.#ls.storageKeyForFrame(this.#C)),this.#Xi}unreachableUrl(){return this.#Ji}get loaderId(){return this.#xi}adFrameType(){return this.#Yi?.adFrameType||"none"}adFrameStatus(){return this.#Yi}get childFrames(){return[...this.#so]}sameTargetParentFrame(){return this.#Gi}crossTargetParentFrame(){if(!this.crossTargetParentFrameId)return null;const e=this.#ls.target().parentTarget();if(e?.type()!==U.FRAME)return null;const t=e.model(ii);return t&&t.framesInternal.get(this.crossTargetParentFrameId)||null}parentFrame(){return this.sameTargetParentFrame()||this.crossTargetParentFrame()}isMainFrame(){return!this.#Gi}isOutermostFrame(){return this.#ls.target().parentTarget()?.type()!==U.FRAME&&!this.#Gi&&!this.crossTargetParentFrameId}isPrimaryFrame(){return!this.#Gi&&this.#ls.target()===W.instance().primaryPageTarget()}removeChildFrame(e,t){this.#so.delete(e),e.remove(t)}removeChildFrames(){const e=this.#so;this.#so=new Set;for(const t of e)t.remove(!1)}remove(e){this.removeChildFrames(),this.#ls.framesInternal.delete(this.id),this.#ls.dispatchEventToListeners(ri.FrameDetached,{frame:this,isSwap:e})}addResource(e){this.resourcesMap.get(e.url)!==e&&(this.resourcesMap.set(e.url,e),this.#ls.dispatchEventToListeners(ri.ResourceAdded,e))}addRequest(e){let t=this.resourcesMap.get(e.url());t&&t.request===e||(t=new Js(this.#ls,e,e.url(),e.documentURL,e.frameId,e.loaderId,e.resourceType(),e.mimeType,null,null),this.resourcesMap.set(t.url,t),this.#ls.dispatchEventToListeners(ri.ResourceAdded,t))}resources(){return Array.from(this.resourcesMap.values())}resourceForURL(e){const t=this.resourcesMap.get(e);if(t)return t;for(const t of this.#so){const n=t.resourceForURL(e);if(n)return n}return null}callForFrameResources(e){for(const t of this.resourcesMap.values())if(e(t))return!0;for(const t of this.#so)if(t.callForFrameResources(e))return!0;return!1}displayName(){if(this.isOutermostFrame())return n.i18n.lockedString("top");const t=new e.ParsedURL.ParsedURL(this.#Si).displayName;return t?this.#h?this.#h+" ("+t+")":t:n.i18n.lockedString("iframe")}async getOwnerDeferredDOMNode(){const e=this.parentFrame();return e?await e.resourceTreeModel().domModel().getOwnerNodeForFrame(this.#C):null}async getOwnerDOMNodeOrDocument(){const e=await this.getOwnerDeferredDOMNode();return e?await e.resolvePromise():this.isOutermostFrame()?await this.resourceTreeModel().domModel().requestDocument():null}async highlight(){const e=this.parentFrame(),t=this.resourceTreeModel().target().parentTarget(),n=async e=>{const t=await e.getOwnerNodeForFrame(this.#C);t&&e.overlayModel().highlightInOverlay({deferredNode:t,selectorList:""},"all",!0)};if(e)return await n(e.resourceTreeModel().domModel());if(t?.type()===U.FRAME){const e=t.model(Gs);if(e)return await n(e)}const r=await this.resourceTreeModel().domModel().requestDocument();r&&this.resourceTreeModel().domModel().overlayModel().highlightInOverlay({node:r,selectorList:""},"all",!0)}async getPermissionsPolicyState(){const e=await this.resourceTreeModel().target().pageAgent().invoke_getPermissionsPolicyState({frameId:this.#C});return e.getError()?null:e.states}async getOriginTrials(){const e=await this.resourceTreeModel().target().pageAgent().invoke_getOriginTrials({frameId:this.#C});return e.getError()?[]:e.originTrials}setCreationStackTrace(e){this.#no=e.creationStackTrace,this.#ro=e.creationStackTraceTarget}setBackForwardCacheDetails(e){this.backForwardCacheDetails.restoredFromCache=!1,this.backForwardCacheDetails.explanations=e.notRestoredExplanations,this.backForwardCacheDetails.explanationsTree=e.notRestoredExplanationsTree}getResourcesMap(){return this.resourcesMap}}class ai{#rr;constructor(e){this.#rr=e}backForwardCacheNotUsed(e){this.#rr.onBackForwardCacheNotUsed(e)}domContentEventFired({timestamp:e}){this.#rr.dispatchEventToListeners(ri.DOMContentLoaded,e)}loadEventFired({timestamp:e}){this.#rr.dispatchEventToListeners(ri.Load,{resourceTreeModel:this.#rr,loadTime:e})}lifecycleEvent({frameId:e,name:t}){this.#rr.dispatchEventToListeners(ri.LifecycleEvent,{frameId:e,name:t})}frameAttached({frameId:e,parentFrameId:t,stack:n}){this.#rr.frameAttached(e,t,n)}frameNavigated({frame:e,type:t}){this.#rr.frameNavigated(e,t)}documentOpened({frame:e}){this.#rr.documentOpened(e)}frameDetached({frameId:e,reason:t}){this.#rr.frameDetached(e,"swap"===t)}frameSubtreeWillBeDetached(e){}frameStartedLoading({}){}frameStoppedLoading({}){}frameRequestedNavigation({}){}frameScheduledNavigation({}){}frameClearedScheduledNavigation({}){}frameStartedNavigating({}){}navigatedWithinDocument({}){}frameResized(){this.#rr.dispatchEventToListeners(ri.FrameResized)}javascriptDialogOpening(e){this.#rr.dispatchEventToListeners(ri.JavaScriptDialogOpening,e),e.hasBrowserHandler||this.#rr.agent.invoke_handleJavaScriptDialog({accept:!1})}javascriptDialogClosed({}){}screencastFrame({}){}screencastVisibilityChanged({}){}interstitialShown(){this.#rr.isInterstitialShowing=!0,this.#rr.dispatchEventToListeners(ri.InterstitialShown)}interstitialHidden(){this.#rr.isInterstitialShowing=!1,this.#rr.dispatchEventToListeners(ri.InterstitialHidden)}windowOpen({}){}compilationCacheProduced({}){}fileChooserOpened({}){}downloadWillBegin({}){}downloadProgress(){}}h.register(ii,{capabilities:2,autostart:!0,early:!0});var li=Object.freeze({__proto__:null,get Events(){return ri},PageDispatcher:ai,ResourceTreeFrame:oi,ResourceTreeModel:ii});class di extends h{#io=new Map;#oo=new Map;#ao=new e.Throttler.Throttler(300);#lo=new Map;constructor(e){super(e),e.model(ii)?.addEventListener(ri.PrimaryPageChanged,this.#do,this),e.model(Z)?.addEventListener(ee.ResponseReceived,this.#co,this),e.model(Z)?.addEventListener(ee.LoadingFinished,this.#ho,this)}addBlockedCookie(e,t){const n=e.key(),r=this.#io.get(n);this.#io.set(n,e),t?this.#oo.set(e,t):this.#oo.delete(e),r&&this.#oo.delete(r)}removeBlockedCookie(e){this.#io.delete(e.key())}async#do(){this.#io.clear(),this.#oo.clear(),await this.#uo()}getCookieToBlockedReasonsMap(){return this.#oo}async#go(e){const t=this.target().networkAgent(),n=new Map(await Promise.all(e.keysArray().map((n=>t.invoke_getCookies({urls:[...e.get(n).values()]}).then((({cookies:e})=>[n,e.map(H.fromProtocolCookie)])))))),r=this.#po(n);this.#lo=n,r&&this.dispatchEventToListeners("CookieListUpdated")}async deleteCookie(e){await this.deleteCookies([e])}async clear(e,t){this.#mo()||await this.#fo();const n=e?this.#lo.get(e)||[]:[...this.#lo.values()].flat();if(n.push(...this.#io.values()),t){const e=n.filter((e=>e.matchesSecurityOrigin(t)));await this.deleteCookies(e)}else await this.deleteCookies(n)}async saveCookie(e){let t,n=e.domain();n.startsWith(".")||(n=""),e.expires()&&(t=Math.floor(Date.parse(`${e.expires()}`)/1e3));const r=o.Runtime.experiments.isEnabled("experimental-cookie-features"),s={name:e.name(),value:e.value(),url:e.url()||void 0,domain:n,path:e.path(),secure:e.secure(),httpOnly:e.httpOnly(),sameSite:e.sameSite(),expires:t,priority:e.priority(),partitionKey:e.partitionKey(),sourceScheme:r?e.sourceScheme():(i=e.sourceScheme(),"Unset"===i?i:void 0),sourcePort:r?e.sourcePort():void 0};var i;const a=await this.target().networkAgent().invoke_setCookie(s);return!(a.getError()||!a.success)&&(await this.#fo(),a.success)}async getCookiesForDomain(e,t){this.#mo()&&!t||await this.#fo();return(this.#lo.get(e)||[]).concat(Array.from(this.#io.values()))}async deleteCookies(e){const t=this.target().networkAgent();this.#io.clear(),this.#oo.clear(),await Promise.all(e.map((e=>t.invoke_deleteCookies({name:e.name(),url:void 0,domain:e.domain(),path:e.path(),partitionKey:e.partitionKey()})))),await this.#fo()}#mo(){return Boolean(this.listeners?.size)}#po(e){if(e.size!==this.#lo.size)return!0;for(const[t,n]of e){if(!this.#lo.has(t))return!0;const e=this.#lo.get(t)||[];if(n.length!==e.length)return!0;const r=e=>e.key()+" "+e.value(),s=new Set(e.map(r));for(const e of n)if(!s.has(r(e)))return!0}return!1}#fo(){return this.#ao.schedule((()=>this.#uo()))}#uo(){const t=new r.MapUtilities.Multimap;const n=this.target().model(ii);if(n){const r=n.mainFrame?.unreachableUrl();if(r){const n=e.ParsedURL.ParsedURL.fromString(r);n&&t.set(n.securityOrigin(),r)}n.forAllResources((function(n){const r=e.ParsedURL.ParsedURL.fromString(n.documentURL);return r&&t.set(r.securityOrigin(),n.url),!1}))}return this.#go(t)}#co(){this.#mo()&&this.#fo()}#ho(){this.#mo()&&this.#fo()}}h.register(di,{capabilities:16,autostart:!1});var ci=Object.freeze({__proto__:null,CookieModel:di});class hi{#bo;#yo;#vo;#Io;#wo;#So;#ko;constructor(e){e&&(this.#bo=e.toLowerCase().replace(/^\./,"")),this.#yo=[],this.#Io=0}static parseSetCookie(e,t){return new hi(t).parseSetCookie(e)}getCookieAttribute(e){if(!e)return null;switch(e.toLowerCase()){case"domain":return"domain";case"expires":return"expires";case"max-age":return"max-age";case"httponly":return"http-only";case"name":return"name";case"path":return"path";case"samesite":return"same-site";case"secure":return"secure";case"value":return"value";case"priority":return"priority";case"sourceport":return"source-port";case"sourcescheme":return"source-scheme";case"partitioned":return"partitioned";default:return console.error("Failed getting cookie attribute: "+e),null}}cookies(){return this.#yo}parseSetCookie(e){if(!this.initialize(e))return null;for(let e=this.extractKeyValue();e;e=this.extractKeyValue())this.#wo?this.#wo.addAttribute(this.getCookieAttribute(e.key),e.value):this.addCookie(e,1),this.advanceAndCheckCookieDelimiter()&&this.flushCookie();return this.flushCookie(),this.#yo}initialize(e){return this.#vo=e,"string"==typeof e&&(this.#yo=[],this.#wo=null,this.#So="",this.#Io=this.#vo.length,!0)}flushCookie(){this.#wo&&(this.#wo.setSize(this.#Io-this.#vo.length-this.#ko),this.#wo.setCookieLine(this.#So.replace("\n",""))),this.#wo=null,this.#So=""}extractKeyValue(){if(!this.#vo||!this.#vo.length)return null;const e=/^[ \t]*([^=;\n]+)[ \t]*(?:=[ \t]*([^;\n]*))?/.exec(this.#vo);if(!e)return console.error("Failed parsing cookie header before: "+this.#vo),null;const t=new ui(e[1]?.trim(),e[2]?.trim(),this.#Io-this.#vo.length);return this.#So+=e[0],this.#vo=this.#vo.slice(e[0].length),t}advanceAndCheckCookieDelimiter(){if(!this.#vo)return!1;const e=/^\s*[\n;]\s*/.exec(this.#vo);return!!e&&(this.#So+=e[0],this.#vo=this.#vo.slice(e[0].length),null!==e[0].match("\n"))}addCookie(e,t){this.#wo&&this.#wo.setSize(e.position-this.#ko),this.#wo="string"==typeof e.value?new H(e.key,e.value,t):new H("",e.key,t),this.#bo&&this.#wo.addAttribute("domain",this.#bo),this.#ko=e.position,this.#yo.push(this.#wo)}}class ui{key;value;position;constructor(e,t,n){this.key=e,this.value=t,this.position=n}}var gi=Object.freeze({__proto__:null,CookieParser:hi});class pi{#Co;#xo;#Ro=!1;#To="";#Mo="";#Po="";#Eo="";constructor(e,t){this.#Co=e,this.#xo=new mi(this.#Lo.bind(this),t)}async addBase64Chunk(e){await this.#xo.addBase64Chunk(e)}#Lo(e){let t=0;for(let n=0;n0){const e=this.#Po.slice(0,-1);this.#Co(this.#Eo||"message",e,this.#Mo),this.#Po=""}return void(this.#Eo="")}let e,t=this.#To.indexOf(":");t<0?(t=this.#To.length,e=t):(e=t+1,ee.codePointAt(0)));await this.#Oo.ready,await this.#Oo.write(n)}}var fi=Object.freeze({__proto__:null,ServerSentEventsParser:pi});class bi{#Do;#No;#Fo=0;#Bo=[];constructor(e,n){this.#Do=e,n&&(this.#Fo=e.pseudoWallTime(e.startTime),this.#No=new pi(this.#_o.bind(this),e.charset()??void 0),this.#Do.requestStreamingContent().then((n=>{t.StreamingContentData.isError(n)||(this.#No?.addBase64Chunk(n.content().base64),n.addEventListener("ChunkAdded",(({data:{chunk:t}})=>{this.#Fo=e.pseudoWallTime(e.endTime),this.#No?.addBase64Chunk(t)})))})))}get eventSourceMessages(){return this.#Bo}onProtocolEventSourceMessageReceived(e,t,n,r){this.#Ho({eventName:e,eventId:n,data:t,time:r})}#_o(e,t,n){this.#Ho({eventName:e,eventId:n,data:t,time:this.#Fo})}#Ho(e){this.#Bo.push(e),this.#Do.dispatchEventToListeners(Ti.EVENT_SOURCE_MESSAGE_ADDED,e)}}const yi={deprecatedSyntaxFoundPleaseUse:"Deprecated syntax found. Please use: ;dur=;desc=",duplicateParameterSIgnored:'Duplicate parameter "{PH1}" ignored.',noValueFoundForParameterS:'No value found for parameter "{PH1}".',unrecognizedParameterS:'Unrecognized parameter "{PH1}".',extraneousTrailingCharacters:"Extraneous trailing characters.",unableToParseSValueS:'Unable to parse "{PH1}" value "{PH2}".'},vi=n.i18n.registerUIStrings("core/sdk/ServerTiming.ts",yi),Ii=n.i18n.getLocalizedString.bind(void 0,vi);class wi{metric;value;description;constructor(e,t,n){this.metric=e,this.value=t,this.description=n}static parseHeaders(e){const t=e.filter((e=>"server-timing"===e.name.toLowerCase()));if(!t.length)return null;const n=t.reduce(((e,t)=>{const n=this.createFromHeaderValue(t.value);return e.push(...n.map((function(e){return new wi(e.name,e.hasOwnProperty("dur")?e.dur:null,e.hasOwnProperty("desc")?e.desc:"")}))),e}),[]);return n.sort(((e,t)=>r.StringUtilities.compare(e.metric.toLowerCase(),t.metric.toLowerCase()))),n}static createFromHeaderValue(e){function t(){e=e.replace(/^\s*/,"")}function n(n){return console.assert(1===n.length),t(),e.charAt(0)===n&&(e=e.substring(1),!0)}function r(){const t=/^(?:\s*)([\w!#$%&'*+\-.^`|~]+)(?:\s*)(.*)/.exec(e);return t?(e=t[2],t[1]):null}function s(){return t(),'"'===e.charAt(0)?function(){console.assert('"'===e.charAt(0)),e=e.substring(1);let t="";for(;e.length;){const n=/^([^"\\]*)(.*)/.exec(e);if(!n)return null;if(t+=n[1],'"'===n[2].charAt(0))return e=n[2].substring(1),t;console.assert("\\"===n[2].charAt(0)),t+=n[2].charAt(1),e=n[2].substring(2)}return null}():r()}function i(){const t=/([,;].*)/.exec(e);t&&(e=t[1])}const o=[];let a;for(;null!==(a=r());){const t={name:a};for("="===e.charAt(0)&&this.showWarning(Ii(yi.deprecatedSyntaxFoundPleaseUse));n(";");){let e;if(null===(e=r()))continue;e=e.toLowerCase();const o=this.getParserForParameter(e);let a=null;if(n("=")&&(a=s(),i()),o){if(t.hasOwnProperty(e)){this.showWarning(Ii(yi.duplicateParameterSIgnored,{PH1:e}));continue}null===a&&this.showWarning(Ii(yi.noValueFoundForParameterS,{PH1:e})),o.call(this,t,a)}else this.showWarning(Ii(yi.unrecognizedParameterS,{PH1:e}))}if(o.push(t),!n(","))break}return e.length&&this.showWarning(Ii(yi.extraneousTrailingCharacters)),o}static getParserForParameter(e){switch(e){case"dur":{function t(t,n){if(t.dur=0,null!==n){const r=parseFloat(n);if(isNaN(r))return void wi.showWarning(Ii(yi.unableToParseSValueS,{PH1:e,PH2:n}));t.dur=r}}return t}case"desc":{function n(e,t){e.desc=t||""}return n}default:return null}}static showWarning(t){e.Console.Console.instance().warn(`ServerTiming: ${t}`)}}var Si=Object.freeze({__proto__:null,ServerTiming:wi});const ki={binary:"(binary)",secureOnly:'This cookie was blocked because it had the "`Secure`" attribute and the connection was not secure.',notOnPath:"This cookie was blocked because its path was not an exact match for or a superdirectory of the request url's path.",domainMismatch:"This cookie was blocked because neither did the request URL's domain exactly match the cookie's domain, nor was the request URL's domain a subdomain of the cookie's Domain attribute value.",sameSiteStrict:'This cookie was blocked because it had the "`SameSite=Strict`" attribute and the request was made from a different site. This includes top-level navigation requests initiated by other sites.',sameSiteLax:'This cookie was blocked because it had the "`SameSite=Lax`" attribute and the request was made from a different site and was not initiated by a top-level navigation.',sameSiteUnspecifiedTreatedAsLax:'This cookie didn\'t specify a "`SameSite`" attribute when it was stored and was defaulted to "SameSite=Lax," and was blocked because the request was made from a different site and was not initiated by a top-level navigation. The cookie had to have been set with "`SameSite=None`" to enable cross-site usage.',sameSiteNoneInsecure:'This cookie was blocked because it had the "`SameSite=None`" attribute but was not marked "Secure". Cookies without SameSite restrictions must be marked "Secure" and sent over a secure connection.',userPreferences:"This cookie was blocked due to user preferences.",thirdPartyPhaseout:"This cookie was blocked either because of Chrome flags or browser configuration. Learn more in the Issues panel.",unknownError:"An unknown error was encountered when trying to send this cookie.",schemefulSameSiteStrict:'This cookie was blocked because it had the "`SameSite=Strict`" attribute but the request was cross-site. This includes top-level navigation requests initiated by other sites. This request is considered cross-site because the URL has a different scheme than the current site.',schemefulSameSiteLax:'This cookie was blocked because it had the "`SameSite=Lax`" attribute but the request was cross-site and was not initiated by a top-level navigation. This request is considered cross-site because the URL has a different scheme than the current site.',schemefulSameSiteUnspecifiedTreatedAsLax:'This cookie didn\'t specify a "`SameSite`" attribute when it was stored, was defaulted to "`SameSite=Lax"`, and was blocked because the request was cross-site and was not initiated by a top-level navigation. This request is considered cross-site because the URL has a different scheme than the current site.',samePartyFromCrossPartyContext:"This cookie was blocked because it had the \"`SameParty`\" attribute but the request was cross-party. The request was considered cross-party because the domain of the resource's URL and the domains of the resource's enclosing frames/documents are neither owners nor members in the same First-Party Set.",nameValuePairExceedsMaxSize:"This cookie was blocked because it was too large. The combined size of the name and value must be less than or equal to 4096 characters.",thisSetcookieWasBlockedDueToUser:"This attempt to set a cookie via a `Set-Cookie` header was blocked due to user preferences.",thisSetcookieWasBlockedDueThirdPartyPhaseout:"Setting this cookie was blocked either because of Chrome flags or browser configuration. Learn more in the Issues panel.",thisSetcookieHadInvalidSyntax:"This `Set-Cookie` header had invalid syntax.",thisSetcookieHadADisallowedCharacter:"This `Set-Cookie` header contained a disallowed character (a forbidden ASCII control character, or the tab character if it appears in the middle of the cookie name, value, an attribute name, or an attribute value).",theSchemeOfThisConnectionIsNot:"The scheme of this connection is not allowed to store cookies.",anUnknownErrorWasEncounteredWhenTrying:"An unknown error was encountered when trying to store this cookie.",thisSetcookieWasBlockedBecauseItHadTheSamesiteStrictLax:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "{PH1}" attribute but came from a cross-site response which was not the response to a top-level navigation. This response is considered cross-site because the URL has a different scheme than the current site.',thisSetcookieDidntSpecifyASamesite:'This `Set-Cookie` header didn\'t specify a "`SameSite`" attribute, was defaulted to "`SameSite=Lax"`, and was blocked because it came from a cross-site response which was not the response to a top-level navigation. This response is considered cross-site because the URL has a different scheme than the current site.',thisSetcookieWasBlockedBecauseItHadTheSameparty:"This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the \"`SameParty`\" attribute but the request was cross-party. The request was considered cross-party because the domain of the resource's URL and the domains of the resource's enclosing frames/documents are neither owners nor members in the same First-Party Set.",thisSetcookieWasBlockedBecauseItHadTheSamepartyAttribute:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "`SameParty`" attribute but also had other conflicting attributes. Chrome requires cookies that use the "`SameParty`" attribute to also have the "Secure" attribute, and to not be restricted to "`SameSite=Strict`".',blockedReasonSecureOnly:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "Secure" attribute but was not received over a secure connection.',blockedReasonSameSiteStrictLax:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "{PH1}" attribute but came from a cross-site response which was not the response to a top-level navigation.',blockedReasonSameSiteUnspecifiedTreatedAsLax:'This `Set-Cookie` header didn\'t specify a "`SameSite`" attribute and was defaulted to "`SameSite=Lax,`" and was blocked because it came from a cross-site response which was not the response to a top-level navigation. The `Set-Cookie` had to have been set with "`SameSite=None`" to enable cross-site usage.',blockedReasonSameSiteNoneInsecure:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "`SameSite=None`" attribute but did not have the "Secure" attribute, which is required in order to use "`SameSite=None`".',blockedReasonOverwriteSecure:"This attempt to set a cookie via a `Set-Cookie` header was blocked because it was not sent over a secure connection and would have overwritten a cookie with the Secure attribute.",blockedReasonInvalidDomain:"This attempt to set a cookie via a `Set-Cookie` header was blocked because its Domain attribute was invalid with regards to the current host url.",blockedReasonInvalidPrefix:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it used the "`__Secure-`" or "`__Host-`" prefix in its name and broke the additional rules applied to cookies with these prefixes as defined in `https://tools.ietf.org/html/draft-west-cookie-prefixes-05`.',thisSetcookieWasBlockedBecauseTheNameValuePairExceedsMaxSize:"This attempt to set a cookie via a `Set-Cookie` header was blocked because the cookie was too large. The combined size of the name and value must be less than or equal to 4096 characters.",setcookieHeaderIsIgnoredIn:"Set-Cookie header is ignored in response from url: {PH1}. The combined size of the name and value must be less than or equal to 4096 characters.",exemptionReasonUserSetting:"This cookie is allowed by user preference.",exemptionReasonTPCDMetadata:"This cookie is allowed by a third-party cookie deprecation trial grace period. Learn more: goo.gle/dt-grace.",exemptionReasonTPCDDeprecationTrial:"This cookie is allowed by third-party cookie deprecation trial. Learn more: goo.gle/ps-dt.",exemptionReasonTopLevelTPCDDeprecationTrial:"This cookie is allowed by top-level third-party cookie deprecation trial. Learn more: goo.gle/ps-dt.",exemptionReasonTPCDHeuristics:"This cookie is allowed by third-party cookie heuristics. Learn more: goo.gle/hbe",exemptionReasonEnterprisePolicy:"This cookie is allowed by Chrome Enterprise policy. Learn more: goo.gle/ce-3pc",exemptionReasonStorageAccessAPI:"This cookie is allowed by the Storage Access API. Learn more: goo.gle/saa",exemptionReasonTopLevelStorageAccessAPI:"This cookie is allowed by the top-level Storage Access API. Learn more: goo.gle/saa-top",exemptionReasonScheme:"This cookie is allowed by the top-level url scheme"},Ci=n.i18n.registerUIStrings("core/sdk/NetworkRequest.ts",ki),xi=n.i18n.getLocalizedString.bind(void 0,Ci);class Ri extends e.ObjectWrapper.ObjectWrapper{#Uo;#qo;#ki;#Ci;#xi;#zo;#jo;#Vo;#Wo;#Go;#Ko;#Qo;#$o;#Xo;#Jo;#Yo;#Zo;statusCode;statusText;requestMethod;requestTime;protocol;alternateProtocolUsage;mixedContentType;#ea;#ta;#na;#ra;#sa;#ia;#oa;#aa;#la;#da;#ca;#ha;#ua;#ga;#pa;#ma;#fa;#ba;#ya;#va;#Ia;connectionId;connectionReused;hasNetworkData;#wa;#Sa;#ka;#Ca;#xa;#Ra;#Ta;#Ma;#Pa;#Ea;#La;localizedFailDescription;#Si;#Aa;#Oa;#ge;#Da;#Na;#Fa;#Ti;#Ba;#Li;#h;#_a;#Ha;#Ua;#qa;#za;#ja;#Va;#Wa;#Ga;#Ka;#Qa;#$a;#Xa;#Ja;#Ya;#Za;#el;#tl;#nl;#rl;#sl;#il;#ol;#al;#ll;#dl;#cl;#hl=new Map;#ul;#gl;#pl;responseReceivedPromise;responseReceivedPromiseResolve;directSocketInfo;constructor(t,n,r,s,i,o,a,l){super(),this.#Uo=t,this.#qo=n,this.setUrl(r),this.#ki=s,this.#Ci=i,this.#xi=o,this.#jo=a,this.#zo=l,this.#Vo=null,this.#Wo=null,this.#Go=null,this.#Ko=!1,this.#Qo=null,this.#$o=-1,this.#Xo=-1,this.#Jo=-1,this.#Yo=void 0,this.#Zo=void 0,this.statusCode=0,this.statusText="",this.requestMethod="",this.requestTime=0,this.protocol="",this.alternateProtocolUsage=void 0,this.mixedContentType="none",this.#ea=null,this.#ta=null,this.#na=null,this.#ra=null,this.#sa=null,this.#ia=e.ResourceType.resourceTypes.Other,this.#oa=null,this.#aa=null,this.#la=[],this.#da={},this.#ca="",this.#ha=[],this.#ga=[],this.#pa=[],this.#ma={},this.#fa="",this.#ba="Unknown",this.#ya=null,this.#va="unknown",this.#Ia=null,this.connectionId="0",this.connectionReused=!1,this.hasNetworkData=!1,this.#wa=null,this.#Sa=Promise.resolve(null),this.#ka=!1,this.#Ca=!1,this.#xa=[],this.#Ra=[],this.#Ta=[],this.#Ma=[],this.#La=!1,this.#Pa=null,this.#Ea=null,this.localizedFailDescription=null,this.#dl=null,this.#cl=!1,this.#ul=!1,this.#gl=!1}static create(e,t,n,r,s,i,o){return new Ri(e,e,t,n,r,s,i,o)}static createForWebSocket(e,t,n){return new Ri(e,e,t,r.DevToolsPath.EmptyUrlString,null,null,n||null)}static createWithoutBackendRequest(e,t,n,r){return new Ri(e,void 0,t,n,null,null,r)}identityCompare(e){const t=this.requestId(),n=e.requestId();return t>n?1:te&&(this.#Aa=e)),this.dispatchEventToListeners(Ti.TIMING_CHANGED,this)}get duration(){return-1===this.#Jo||-1===this.#Xo?-1:this.#Jo-this.#Xo}get latency(){return-1===this.#Aa||-1===this.#Xo?-1:this.#Aa-this.#Xo}get resourceSize(){return this.#Ga||0}set resourceSize(e){this.#Ga=e}get transferSize(){return this.#Oa||0}increaseTransferSize(e){this.#Oa=(this.#Oa||0)+e}setTransferSize(e){this.#Oa=e}get finished(){return this.#ge}set finished(e){this.#ge!==e&&(this.#ge=e,e&&this.dispatchEventToListeners(Ti.FINISHED_LOADING,this))}get failed(){return this.#Da}set failed(e){this.#Da=e}get canceled(){return this.#Na}set canceled(e){this.#Na=e}get preserved(){return this.#Fa}set preserved(e){this.#Fa=e}blockedReason(){return this.#Yo}setBlockedReason(e){this.#Yo=e}corsErrorStatus(){return this.#Zo}setCorsErrorStatus(e){this.#Zo=e}wasBlocked(){return Boolean(this.#Yo)}cached(){return(Boolean(this.#Ka)||Boolean(this.#Qa))&&!this.#Oa}cachedInMemory(){return Boolean(this.#Ka)&&!this.#Oa}fromPrefetchCache(){return Boolean(this.#$a)}setFromMemoryCache(){this.#Ka=!0,this.#Za=void 0}get fromDiskCache(){return this.#Qa}setFromDiskCache(){this.#Qa=!0}setFromPrefetchCache(){this.#$a=!0}fromEarlyHints(){return Boolean(this.#Xa)}setFromEarlyHints(){this.#Xa=!0}get fetchedViaServiceWorker(){return Boolean(this.#Ja)}set fetchedViaServiceWorker(e){this.#Ja=e}get serviceWorkerRouterInfo(){return this.#Ya}set serviceWorkerRouterInfo(e){this.#Ya=e}initiatedByServiceWorker(){const e=Z.forRequest(this);return!!e&&e.target().type()===U.ServiceWorker}get timing(){return this.#Za}set timing(e){if(!e||this.#Ka)return;this.#Xo=e.requestTime;const t=e.requestTime+e.receiveHeadersEnd/1e3;((this.#Aa||-1)<0||this.#Aa>t)&&(this.#Aa=t),this.#Xo>this.#Aa&&(this.#Aa=this.#Xo),this.#Za=e,this.dispatchEventToListeners(Ti.TIMING_CHANGED,this)}setConnectTimingFromExtraInfo(e){this.#Xo=e.requestTime,this.dispatchEventToListeners(Ti.TIMING_CHANGED,this)}get mimeType(){return this.#Ti}set mimeType(t){if(this.#Ti=t,"text/event-stream"===t&&!this.#pl){const t=this.resourceType()!==e.ResourceType.resourceTypes.EventSource;this.#pl=new bi(this,t)}}get displayName(){return this.#Li.displayName}name(){return this.#h||this.parseNameAndPathFromURL(),this.#h}path(){return this.#_a||this.parseNameAndPathFromURL(),this.#_a}parseNameAndPathFromURL(){if(this.#Li.isDataURL())this.#h=this.#Li.dataURLDisplayName(),this.#_a="";else if(this.#Li.isBlobURL())this.#h=this.#Li.url,this.#_a="";else if(this.#Li.isAboutBlank())this.#h=this.#Li.url,this.#_a="";else{this.#_a=this.#Li.host+this.#Li.folderPathComponents;const t=Z.forRequest(this),n=t?e.ParsedURL.ParsedURL.fromString(t.target().inspectedURL()):null;this.#_a=r.StringUtilities.trimURL(this.#_a,n?n.host:""),this.#Li.lastPathComponent||this.#Li.queryParams?this.#h=this.#Li.lastPathComponent+(this.#Li.queryParams?"?"+this.#Li.queryParams:""):this.#Li.folderPathComponents?(this.#h=this.#Li.folderPathComponents.substring(this.#Li.folderPathComponents.lastIndexOf("/")+1)+"/",this.#_a=this.#_a.substring(0,this.#_a.lastIndexOf("/"))):(this.#h=this.#Li.host,this.#_a="")}}get folder(){let e=this.#Li.path;const t=e.indexOf("?");-1!==t&&(e=e.substring(0,t));const n=e.lastIndexOf("/");return-1!==n?e.substring(0,n):""}get pathname(){return this.#Li.path}resourceType(){return this.#ia}setResourceType(e){this.#ia=e}get domain(){return this.#Li.host}get scheme(){return this.#Li.scheme}getInferredStatusText(){return this.statusText||(e=this.statusCode,n.i18n.lockedString({100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Content Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Content",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"}[e]??""));var e}redirectSource(){return this.#Vo}setRedirectSource(e){this.#Vo=e}preflightRequest(){return this.#Wo}setPreflightRequest(e){this.#Wo=e}preflightInitiatorRequest(){return this.#Go}setPreflightInitiatorRequest(e){this.#Go=e}isPreflightRequest(){return null!==this.#jo&&void 0!==this.#jo&&"preflight"===this.#jo.type}redirectDestination(){return this.#Qo}setRedirectDestination(e){this.#Qo=e}requestHeaders(){return this.#pa}setRequestHeaders(e){this.#pa=e,this.dispatchEventToListeners(Ti.REQUEST_HEADERS_CHANGED)}requestHeadersText(){return this.#el}setRequestHeadersText(e){this.#el=e,this.dispatchEventToListeners(Ti.REQUEST_HEADERS_CHANGED)}requestHeaderValue(e){return this.#ma[e]||(this.#ma[e]=this.computeHeaderValue(this.requestHeaders(),e)),this.#ma[e]}requestFormData(){return this.#Sa||(this.#Sa=Z.requestPostData(this)),this.#Sa}setRequestFormData(e,t){this.#Sa=e&&null===t?null:Promise.resolve(t),this.#wa=null}filteredProtocolName(){const e=this.protocol.toLowerCase();return"h2"===e?"http/2.0":e.replace(/^http\/2(\.0)?\+/,"http/2.0+")}requestHttpVersion(){const e=this.requestHeadersText();if(!e){const e=this.requestHeaderValue("version")||this.requestHeaderValue(":version");return e||this.filteredProtocolName()}const t=e.split(/\r\n/)[0].match(/(HTTP\/\d+\.\d+)$/);return t?t[1]:"HTTP/0.9"}get responseHeaders(){return this.#tl||[]}set responseHeaders(e){this.#tl=e,this.#rl=void 0,this.#il=void 0,this.#sl=void 0,this.#da={},this.dispatchEventToListeners(Ti.RESPONSE_HEADERS_CHANGED)}get earlyHintsHeaders(){return this.#nl||[]}set earlyHintsHeaders(e){this.#nl=e}get originalResponseHeaders(){return this.#ha}set originalResponseHeaders(e){this.#ha=e,this.#ua=void 0}get setCookieHeaders(){return this.#ga}set setCookieHeaders(e){this.#ga=e}get responseHeadersText(){return this.#ca}set responseHeadersText(e){this.#ca=e,this.dispatchEventToListeners(Ti.RESPONSE_HEADERS_CHANGED)}get sortedResponseHeaders(){return void 0!==this.#rl?this.#rl:(this.#rl=this.responseHeaders.slice(),this.#rl.sort((function(e,t){return r.StringUtilities.compare(e.name.toLowerCase(),t.name.toLowerCase())})))}get sortedOriginalResponseHeaders(){return void 0!==this.#ua?this.#ua:(this.#ua=this.originalResponseHeaders.slice(),this.#ua.sort((function(e,t){return r.StringUtilities.compare(e.name.toLowerCase(),t.name.toLowerCase())})))}get overrideTypes(){const e=[];return this.hasOverriddenContent&&e.push("content"),this.hasOverriddenHeaders()&&e.push("headers"),e}get hasOverriddenContent(){return this.#ul}set hasOverriddenContent(e){this.#ul=e}#ml(e){const t=[];for(const n of e)t.length&&t[t.length-1].name===n.name?t[t.length-1].value+=`, ${n.value}`:t.push({name:n.name,value:n.value});return t}hasOverriddenHeaders(){if(!this.#ha.length)return!1;const e=this.#ml(this.sortedResponseHeaders),t=this.#ml(this.sortedOriginalResponseHeaders);if(e.length!==t.length)return!0;for(let n=0;ne.cookie)),...this.responseCookies,...this.blockedRequestCookies().map((e=>e.cookie)),...this.blockedResponseCookies().map((e=>e.cookie))].filter((e=>!!e))}get serverTimings(){return void 0===this.#il&&(this.#il=wi.parseHeaders(this.responseHeaders)),this.#il}queryString(){if(void 0!==this.#ol)return this.#ol;let e=null;const t=this.url(),n=t.indexOf("?");if(-1!==n){e=t.substring(n+1);const r=e.indexOf("#");-1!==r&&(e=e.substring(0,r))}return this.#ol=e,this.#ol}get queryParameters(){if(this.#al)return this.#al;const e=this.queryString();return e?(this.#al=this.parseParameters(e),this.#al):null}async parseFormParameters(){const e=this.requestContentType();if(!e)return null;if(e.match(/^application\/x-www-form-urlencoded\s*(;.*)?$/i)){const e=await this.requestFormData();return e?this.parseParameters(e):null}const t=e.match(/^multipart\/form-data\s*;\s*boundary\s*=\s*(\S+)\s*$/);if(!t)return null;const n=t[1];if(!n)return null;const r=await this.requestFormData();return r?this.parseMultipartFormDataParameters(r,n):null}formParameters(){return this.#wa||(this.#wa=this.parseFormParameters()),this.#wa}responseHttpVersion(){const e=this.#ca;if(!e){const e=this.responseHeaderValue("version")||this.responseHeaderValue(":version");return e||this.filteredProtocolName()}const t=e.split(/\r\n/)[0].match(/^(HTTP\/\d+\.\d+)/);return t?t[1]:"HTTP/0.9"}parseParameters(e){return e.split("&").map((function(e){const t=e.indexOf("=");return-1===t?{name:e,value:""}:{name:e.substring(0,t),value:e.substring(t+1)}}))}parseMultipartFormDataParameters(e,t){const n=r.StringUtilities.escapeForRegExp(t),s=new RegExp('^\\r\\ncontent-disposition\\s*:\\s*form-data\\s*;\\s*name="([^"]*)"(?:\\s*;\\s*filename="([^"]*)")?(?:\\r\\ncontent-type\\s*:\\s*([^\\r\\n]*))?\\r\\n\\r\\n(.*)\\r\\n$',"is");return e.split(new RegExp(`--${n}(?:--s*$)?`,"g")).reduce((function(e,t){const[n,r,i,o,a]=t.match(s)||[];if(!n)return e;const l=i||o?xi(ki.binary):a;return e.push({name:r,value:l}),e}),[])}computeHeaderValue(e,t){t=t.toLowerCase();const n=[];for(let r=0;rt.ContentData.ContentData.isError(e)?e:t.StreamingContentData.StreamingContentData.from(e))),this.#aa}contentURL(){return this.#Si}contentType(){return this.#ia}async requestContent(){return t.ContentData.ContentData.asDeferredContent(await this.requestContentData())}async searchInContent(e,n,r){if(!this.#ll)return await Z.searchInRequest(this,e,n,r);const s=await this.requestContentData();return t.ContentData.ContentData.isError(s)||!s.isTextContent?[]:t.TextUtils.performSearchInContentData(s,e,n,r)}requestContentType(){return this.requestHeaderValue("Content-Type")}hasErrorStatusCode(){return this.statusCode>=400}setInitialPriority(e){this.#ea=e}initialPriority(){return this.#ea}setPriority(e){this.#ta=e}priority(){return this.#ta||this.#ea||null}setSignedExchangeInfo(e){this.#na=e}signedExchangeInfo(){return this.#na}setWebBundleInfo(e){this.#ra=e}webBundleInfo(){return this.#ra}setWebBundleInnerRequestInfo(e){this.#sa=e}webBundleInnerRequestInfo(){return this.#sa}async populateImageSource(e){const n=await this.requestContentData();if(t.ContentData.ContentData.isError(n))return;let r=n.asDataUrl();if(null===r&&!this.#Da){(this.responseHeaderValue("cache-control")||"").includes("no-cache")||(r=this.#Si)}null!==r&&(e.src=r)}initiator(){return this.#jo||null}hasUserGesture(){return this.#zo??null}frames(){return this.#la}addProtocolFrameError(e,t){this.addFrame({type:Mi.Error,text:e,time:this.pseudoWallTime(t),opCode:-1,mask:!1})}addProtocolFrame(e,t,n){const r=n?Mi.Send:Mi.Receive;this.addFrame({type:r,text:e.payloadData,time:this.pseudoWallTime(t),opCode:e.opcode,mask:e.mask})}addFrame(e){this.#la.push(e),this.dispatchEventToListeners(Ti.WEBSOCKET_FRAME_ADDED,e)}eventSourceMessages(){return this.#pl?.eventSourceMessages??[]}addEventSourceMessage(e,t,n,r){this.#pl?.onProtocolEventSourceMessageReceived(t,r,n,this.pseudoWallTime(e))}markAsRedirect(e){this.#Ko=!0,this.#Uo=`${this.#qo}:redirected.${e}`}isRedirect(){return this.#Ko}setRequestIdForTest(e){this.#qo=e,this.#Uo=e}charset(){return this.#Ba??null}setCharset(e){this.#Ba=e}addExtraRequestInfo(e){this.#xa=e.blockedRequestCookies,this.#Ra=e.includedRequestCookies,this.setRequestHeaders(e.requestHeaders),this.#ka=!0,this.setRequestHeadersText(""),this.#Ha=e.clientSecurityState,this.setConnectTimingFromExtraInfo(e.connectTiming),this.#La=e.siteHasCookieInOtherPartition??!1,this.#gl=this.#xa.some((e=>e.blockedReasons.includes("ThirdPartyPhaseout")))}hasExtraRequestInfo(){return this.#ka}blockedRequestCookies(){return this.#xa}includedRequestCookies(){return this.#Ra}hasRequestCookies(){return this.#Ra.length>0||this.#xa.length>0}siteHasCookieInOtherPartition(){return this.#La}static parseStatusTextFromResponseHeadersText(e){return e.split("\r")[0].split(" ").slice(2).join(" ")}addExtraResponseInfo(e){if(this.#Ta=e.blockedResponseCookies,e.exemptedResponseCookies&&(this.#Ma=e.exemptedResponseCookies),this.#Pa=e.cookiePartitionKey?e.cookiePartitionKey:null,this.#Ea=e.cookiePartitionKeyOpaque||null,this.responseHeaders=e.responseHeaders,this.originalResponseHeaders=e.responseHeaders.map((e=>({...e}))),e.responseHeadersText){if(this.responseHeadersText=e.responseHeadersText,!this.requestHeadersText()){let e=`${this.requestMethod} ${this.parsedURL.path}`;this.parsedURL.queryParams&&(e+=`?${this.parsedURL.queryParams}`),e+=" HTTP/1.1\r\n";for(const{name:t,value:n}of this.requestHeaders())e+=`${t}: ${n}\r\n`;this.setRequestHeadersText(e)}this.statusText=Ri.parseStatusTextFromResponseHeadersText(e.responseHeadersText)}this.#ba=e.resourceIPAddressSpace,e.statusCode&&(this.statusCode=e.statusCode),this.#Ca=!0;const t=Z.forRequest(this);if(!t)return;for(const e of this.#Ta)if(e.blockedReasons.includes("NameValuePairExceedsMaxSize")){const e=xi(ki.setcookieHeaderIsIgnoredIn,{PH1:this.url()});t.dispatchEventToListeners(ee.MessageGenerated,{message:e,requestId:this.#Uo,warning:!0})}const n=t.target().model(di);if(n){for(const e of this.#Ma)n.removeBlockedCookie(e.cookie);for(const e of this.#Ta){const t=e.cookie;t&&(e.blockedReasons.includes("ThirdPartyPhaseout")&&(this.#gl=!0),n.addBlockedCookie(t,e.blockedReasons.map((e=>({attribute:Ei(e),uiString:Pi(e)})))))}}}hasExtraResponseInfo(){return this.#Ca}blockedResponseCookies(){return this.#Ta}exemptedResponseCookies(){return this.#Ma}nonBlockedResponseCookies(){const e=this.blockedResponseCookies().map((e=>e.cookieLine));return this.responseCookies.filter((t=>{const n=e.indexOf(t.getCookieLine());return-1===n||(e[n]=null,!1)}))}responseCookiesPartitionKey(){return this.#Pa}responseCookiesPartitionKeyOpaque(){return this.#Ea}redirectSourceSignedExchangeInfoHasNoErrors(){return null!==this.#Vo&&null!==this.#Vo.#na&&!this.#Vo.#na.errors}clientSecurityState(){return this.#Ha}setTrustTokenParams(e){this.#Ua=e}trustTokenParams(){return this.#Ua}setTrustTokenOperationDoneEvent(e){this.#qa=e,this.dispatchEventToListeners(Ti.TRUST_TOKEN_RESULT_ADDED)}trustTokenOperationDoneEvent(){return this.#qa}setIsSameSite(e){this.#dl=e}isSameSite(){return this.#dl}getAssociatedData(e){return this.#hl.get(e)||null}setAssociatedData(e,t){this.#hl.set(e,t)}deleteAssociatedData(e){this.#hl.delete(e)}hasThirdPartyCookiePhaseoutIssue(){return this.#gl}addDataReceivedEvent({timestamp:e,dataLength:n,encodedDataLength:r,data:s}){this.resourceSize+=n,-1!==r&&this.increaseTransferSize(r),this.endTime=e,s&&this.#aa?.then((e=>{t.StreamingContentData.isError(e)||e.addChunk(s)}))}waitForResponseReceived(){if(this.responseReceivedPromise)return this.responseReceivedPromise;const{promise:e,resolve:t}=Promise.withResolvers();return this.responseReceivedPromise=e,this.responseReceivedPromiseResolve=t,this.responseReceivedPromise}}var Ti,Mi;!function(e){e.FINISHED_LOADING="FinishedLoading",e.TIMING_CHANGED="TimingChanged",e.REMOTE_ADDRESS_CHANGED="RemoteAddressChanged",e.REQUEST_HEADERS_CHANGED="RequestHeadersChanged",e.RESPONSE_HEADERS_CHANGED="ResponseHeadersChanged",e.WEBSOCKET_FRAME_ADDED="WebsocketFrameAdded",e.EVENT_SOURCE_MESSAGE_ADDED="EventSourceMessageAdded",e.TRUST_TOKEN_RESULT_ADDED="TrustTokenResultAdded"}(Ti||(Ti={})),function(e){e.Send="send",e.Receive="receive",e.Error="error"}(Mi||(Mi={}));const Pi=function(e){switch(e){case"SecureOnly":return xi(ki.blockedReasonSecureOnly);case"SameSiteStrict":return xi(ki.blockedReasonSameSiteStrictLax,{PH1:"SameSite=Strict"});case"SameSiteLax":return xi(ki.blockedReasonSameSiteStrictLax,{PH1:"SameSite=Lax"});case"SameSiteUnspecifiedTreatedAsLax":return xi(ki.blockedReasonSameSiteUnspecifiedTreatedAsLax);case"SameSiteNoneInsecure":return xi(ki.blockedReasonSameSiteNoneInsecure);case"UserPreferences":return xi(ki.thisSetcookieWasBlockedDueToUser);case"SyntaxError":return xi(ki.thisSetcookieHadInvalidSyntax);case"SchemeNotSupported":return xi(ki.theSchemeOfThisConnectionIsNot);case"OverwriteSecure":return xi(ki.blockedReasonOverwriteSecure);case"InvalidDomain":return xi(ki.blockedReasonInvalidDomain);case"InvalidPrefix":return xi(ki.blockedReasonInvalidPrefix);case"UnknownError":return xi(ki.anUnknownErrorWasEncounteredWhenTrying);case"SchemefulSameSiteStrict":return xi(ki.thisSetcookieWasBlockedBecauseItHadTheSamesiteStrictLax,{PH1:"SameSite=Strict"});case"SchemefulSameSiteLax":return xi(ki.thisSetcookieWasBlockedBecauseItHadTheSamesiteStrictLax,{PH1:"SameSite=Lax"});case"SchemefulSameSiteUnspecifiedTreatedAsLax":return xi(ki.thisSetcookieDidntSpecifyASamesite);case"SamePartyFromCrossPartyContext":return xi(ki.thisSetcookieWasBlockedBecauseItHadTheSameparty);case"SamePartyConflictsWithOtherAttributes":return xi(ki.thisSetcookieWasBlockedBecauseItHadTheSamepartyAttribute);case"NameValuePairExceedsMaxSize":return xi(ki.thisSetcookieWasBlockedBecauseTheNameValuePairExceedsMaxSize);case"DisallowedCharacter":return xi(ki.thisSetcookieHadADisallowedCharacter);case"ThirdPartyPhaseout":return xi(ki.thisSetcookieWasBlockedDueThirdPartyPhaseout)}return""},Ei=function(e){switch(e){case"SecureOnly":case"OverwriteSecure":return"secure";case"SameSiteStrict":case"SameSiteLax":case"SameSiteUnspecifiedTreatedAsLax":case"SameSiteNoneInsecure":case"SchemefulSameSiteStrict":case"SchemefulSameSiteLax":case"SchemefulSameSiteUnspecifiedTreatedAsLax":return"same-site";case"InvalidDomain":return"domain";case"InvalidPrefix":return"name";case"SamePartyConflictsWithOtherAttributes":case"SamePartyFromCrossPartyContext":case"NameValuePairExceedsMaxSize":case"UserPreferences":case"ThirdPartyPhaseout":case"SyntaxError":case"SchemeNotSupported":case"UnknownError":case"DisallowedCharacter":return null}return null};var Li,Ai;!function(e){e[e.TCP=1]="TCP",e[e.UDP_BOUND=2]="UDP_BOUND",e[e.UDP_CONNECTED=3]="UDP_CONNECTED"}(Li||(Li={})),function(e){e[e.OPENING=1]="OPENING",e[e.OPEN=2]="OPEN",e[e.CLOSED=3]="CLOSED",e[e.ABORTED=4]="ABORTED"}(Ai||(Ai={}));var Oi=Object.freeze({__proto__:null,get DirectSocketStatus(){return Ai},get DirectSocketType(){return Li},get Events(){return Ti},NetworkRequest:Ri,get WebSocketFrameType(){return Mi},cookieBlockedReasonToAttribute:function(e){switch(e){case"SecureOnly":return"secure";case"NotOnPath":return"path";case"DomainMismatch":return"domain";case"SameSiteStrict":case"SameSiteLax":case"SameSiteUnspecifiedTreatedAsLax":case"SameSiteNoneInsecure":case"SchemefulSameSiteStrict":case"SchemefulSameSiteLax":case"SchemefulSameSiteUnspecifiedTreatedAsLax":return"same-site";case"SamePartyFromCrossPartyContext":case"NameValuePairExceedsMaxSize":case"UserPreferences":case"ThirdPartyPhaseout":case"UnknownError":return null}return null},cookieBlockedReasonToUiString:function(e){switch(e){case"SecureOnly":return xi(ki.secureOnly);case"NotOnPath":return xi(ki.notOnPath);case"DomainMismatch":return xi(ki.domainMismatch);case"SameSiteStrict":return xi(ki.sameSiteStrict);case"SameSiteLax":return xi(ki.sameSiteLax);case"SameSiteUnspecifiedTreatedAsLax":return xi(ki.sameSiteUnspecifiedTreatedAsLax);case"SameSiteNoneInsecure":return xi(ki.sameSiteNoneInsecure);case"UserPreferences":return xi(ki.userPreferences);case"UnknownError":return xi(ki.unknownError);case"SchemefulSameSiteStrict":return xi(ki.schemefulSameSiteStrict);case"SchemefulSameSiteLax":return xi(ki.schemefulSameSiteLax);case"SchemefulSameSiteUnspecifiedTreatedAsLax":return xi(ki.schemefulSameSiteUnspecifiedTreatedAsLax);case"SamePartyFromCrossPartyContext":return xi(ki.samePartyFromCrossPartyContext);case"NameValuePairExceedsMaxSize":return xi(ki.nameValuePairExceedsMaxSize);case"ThirdPartyPhaseout":return xi(ki.thirdPartyPhaseout)}return""},cookieExemptionReasonToUiString:function(e){switch(e){case"UserSetting":return xi(ki.exemptionReasonUserSetting);case"TPCDMetadata":return xi(ki.exemptionReasonTPCDMetadata);case"TopLevelTPCDDeprecationTrial":return xi(ki.exemptionReasonTopLevelTPCDDeprecationTrial);case"TPCDDeprecationTrial":return xi(ki.exemptionReasonTPCDDeprecationTrial);case"TPCDHeuristics":return xi(ki.exemptionReasonTPCDHeuristics);case"EnterprisePolicy":return xi(ki.exemptionReasonEnterprisePolicy);case"StorageAccess":return xi(ki.exemptionReasonStorageAccessAPI);case"TopLevelStorageAccess":return xi(ki.exemptionReasonTopLevelStorageAccessAPI);case"Scheme":return xi(ki.exemptionReasonScheme)}return""},setCookieBlockedReasonToAttribute:Ei,setCookieBlockedReasonToUiString:Pi});class Di{#fl;#C;#bl;#yl;#vl;#Il;#wl;#h;#Zt;#u;#Sl;#kl;#Cl;#xl;constructor(e,t){this.#fl=e,this.#C=t.nodeId,e.setAXNodeForAXId(this.#C,this),t.backendDOMNodeId?(e.setAXNodeForBackendDOMNodeId(t.backendDOMNodeId,this),this.#bl=t.backendDOMNodeId,this.#yl=new js(e.target(),t.backendDOMNodeId)):(this.#bl=null,this.#yl=null),this.#vl=t.ignored,this.#vl&&"ignoredReasons"in t&&(this.#Il=t.ignoredReasons),this.#wl=t.role||null,this.#h=t.name||null,this.#Zt=t.description||null,this.#u=t.value||null,this.#Sl=t.properties||null,this.#xl=[...new Set(t.childIds)],this.#kl=t.parentId||null,t.frameId&&!t.parentId?(this.#Cl=t.frameId,e.setRootAXNodeForFrameId(t.frameId,this)):this.#Cl=null}id(){return this.#C}accessibilityModel(){return this.#fl}ignored(){return this.#vl}ignoredReasons(){return this.#Il||null}role(){return this.#wl||null}coreProperties(){const e=[];return this.#h&&e.push({name:"name",value:this.#h}),this.#Zt&&e.push({name:"description",value:this.#Zt}),this.#u&&e.push({name:"value",value:this.#u}),e}name(){return this.#h||null}description(){return this.#Zt||null}value(){return this.#u||null}properties(){return this.#Sl||null}parentNode(){return this.#kl?this.#fl.axNodeForId(this.#kl):null}isDOMNode(){return Boolean(this.#bl)}backendDOMNodeId(){return this.#bl}deferredDOMNode(){return this.#yl}highlightDOMNode(){const e=this.deferredDOMNode();e&&e.highlight()}children(){if(!this.#xl)return[];const e=[];for(const t of this.#xl){const n=this.#fl.axNodeForId(t);n&&e.push(n)}return e}numChildren(){return this.#xl?this.#xl.length:0}hasOnlyUnloadedChildren(){return!(!this.#xl||!this.#xl.length)&&this.#xl.every((e=>null===this.#fl.axNodeForId(e)))}hasUnloadedChildren(){return!(!this.#xl||!this.#xl.length)&&this.#xl.some((e=>null===this.#fl.axNodeForId(e)))}getFrameId(){return this.#Cl||this.parentNode()?.getFrameId()||null}}class Ni extends h{agent;#Rl=new Map;#Tl=new Map;#Ml=new Map;#Pl=new Map;#El=null;constructor(e){super(e),e.registerAccessibilityDispatcher(this),this.agent=e.accessibilityAgent(),this.resumeModel()}clear(){this.#El=null,this.#Rl.clear(),this.#Tl.clear(),this.#Ml.clear()}async resumeModel(){await this.agent.invoke_enable()}async suspendModel(){await this.agent.invoke_disable()}async requestPartialAXTree(e){const{nodes:t}=await this.agent.invoke_getPartialAXTree({nodeId:e.id,fetchRelatives:!0});if(!t)return;const n=[];for(const e of t)n.push(new Di(this,e))}loadComplete({root:e}){this.clear(),this.#El=new Di(this,e),this.dispatchEventToListeners("TreeUpdated",{root:this.#El})}nodesUpdated({nodes:e}){this.createNodesFromPayload(e),this.dispatchEventToListeners("TreeUpdated",{})}createNodesFromPayload(e){return e.map((e=>new Di(this,e)))}async requestRootNode(e){if(e&&this.#Ml.has(e))return this.#Ml.get(e);if(!e&&this.#El)return this.#El;const{node:t}=await this.agent.invoke_getRootAXNode({frameId:e});return t?this.createNodesFromPayload([t])[0]:void 0}async requestAXChildren(e,t){const n=this.#Rl.get(e);if(!n)throw new Error("Cannot request children before parent");if(!n.hasUnloadedChildren())return n.children();const r=this.#Pl.get(e);if(r)await r;else{const n=this.agent.invoke_getChildAXNodes({id:e,frameId:t});this.#Pl.set(e,n);const r=await n;r.getError()||(this.createNodesFromPayload(r.nodes),this.#Pl.delete(e))}return n.children()}async requestAndLoadSubTreeToNode(e){const t=[];let n=this.axNodeForDOMNode(e);for(;n;){t.push(n);const e=n.parentNode();if(!e)return t;n=e}const{nodes:r}=await this.agent.invoke_getAXNodeAndAncestors({backendNodeId:e.backendNodeId()});if(!r)return null;return this.createNodesFromPayload(r)}axNodeForId(e){return this.#Rl.get(e)||null}setRootAXNodeForFrameId(e,t){this.#Ml.set(e,t)}setAXNodeForAXId(e,t){this.#Rl.set(e,t)}axNodeForDOMNode(e){return e?this.#Tl.get(e.backendNodeId())??null:null}setAXNodeForBackendDOMNodeId(e,t){this.#Tl.set(e,t)}getAgent(){return this.agent}}h.register(Ni,{capabilities:2,autostart:!1});var Fi=Object.freeze({__proto__:null,AccessibilityModel:Ni,AccessibilityNode:Di});class Bi extends h{#Ks;#Ll=1;#Al=[];constructor(e){super(e),this.#Ks=e.pageAgent(),e.registerPageDispatcher(this)}async startScreencast(e,t,n,r,s,i,o){this.#Al.at(-1)&&await this.#Ks.invoke_stopScreencast();const a={id:this.#Ll++,request:{format:e,quality:t,maxWidth:n,maxHeight:r,everyNthFrame:s},callbacks:{onScreencastFrame:i,onScreencastVisibilityChanged:o}};return this.#Al.push(a),this.#Ks.invoke_startScreencast({format:e,quality:t,maxWidth:n,maxHeight:r,everyNthFrame:s}),a.id}stopScreencast(e){const t=this.#Al.pop();if(!t)throw new Error("There is no screencast operation to stop.");if(t.id!==e)throw new Error("Trying to stop a screencast operation that is not being served right now.");this.#Ks.invoke_stopScreencast();const n=this.#Al.at(-1);n&&this.#Ks.invoke_startScreencast({format:n.request.format,quality:n.request.quality,maxWidth:n.request.maxWidth,maxHeight:n.request.maxHeight,everyNthFrame:n.request.everyNthFrame})}async captureScreenshot(e,t,n,r){const s={format:e,quality:t,fromSurface:!0};switch(n){case"fromClip":s.captureBeyondViewport=!0,s.clip=r;break;case"fullpage":s.captureBeyondViewport=!0;break;case"fromViewport":s.captureBeyondViewport=!1;break;default:throw new Error("Unexpected or unspecified screnshotMode")}await Fs.muteHighlight();const i=await this.#Ks.invoke_captureScreenshot(s);return await Fs.unmuteHighlight(),i.data}screencastFrame({data:e,metadata:t,sessionId:n}){this.#Ks.invoke_screencastFrameAck({sessionId:n});const r=this.#Al.at(-1);r&&r.callbacks.onScreencastFrame.call(null,e,t)}screencastVisibilityChanged({visible:e}){const t=this.#Al.at(-1);t&&t.callbacks.onScreencastVisibilityChanged.call(null,e)}backForwardCacheNotUsed(e){}domContentEventFired(e){}loadEventFired(e){}lifecycleEvent(e){}navigatedWithinDocument(e){}frameAttached(e){}frameNavigated(e){}documentOpened(e){}frameDetached(e){}frameStartedLoading(e){}frameStoppedLoading(e){}frameRequestedNavigation(e){}frameStartedNavigating(e){}frameSubtreeWillBeDetached(e){}frameScheduledNavigation(e){}frameClearedScheduledNavigation(e){}frameResized(){}javascriptDialogOpening(e){}javascriptDialogClosed(e){}interstitialShown(){}interstitialHidden(){}windowOpen(e){}fileChooserOpened(e){}compilationCacheProduced(e){}downloadWillBegin(e){}downloadProgress(){}prefetchStatusUpdated(e){}prerenderStatusUpdated(e){}}h.register(Bi,{capabilities:64,autostart:!1});var _i=Object.freeze({__proto__:null,ScreenCaptureModel:Bi});const Hi="devtools_animations",Ui="__devtools_report_scroll_position__",qi=e=>`__devtools_scroll_listener_${e}__`;async function zi(e,t){const n=e.domModel().target().model(ii),r=e.domModel().target().pageAgent();for(const s of n.frames()){const{executionContextId:n}=await r.invoke_createIsolatedWorld({frameId:s.id,worldName:t}),i=await e.resolveToObject(void 0,n);if(i)return i}return null}class ji{#Ol;#Dl=new Map;#Nl;static lastAddedListenerId=0;constructor(e){this.#Ol=e}async#Fl(){if(this.#Nl)return;this.#Nl=e=>{const{name:t,payload:n}=e.data;if(t!==Ui)return;const{scrollTop:r,scrollLeft:s,id:i}=JSON.parse(n),o=this.#Dl.get(i);o&&o({scrollTop:r,scrollLeft:s})};const e=this.#Ol.domModel().target().model(Jr);await e.addBinding({name:Ui,executionContextName:Hi}),e.addEventListener($r.BindingCalled,this.#Nl)}async#Bl(){if(!this.#Nl)return;const e=this.#Ol.domModel().target().model(Jr);await e.removeBinding({name:Ui}),e.removeEventListener($r.BindingCalled,this.#Nl),this.#Nl=void 0}async addScrollEventListener(e){ji.lastAddedListenerId++;const t=ji.lastAddedListenerId;this.#Dl.set(t,e),this.#Nl||await this.#Fl();const n=await zi(this.#Ol,Hi);return n?(await n.callFunction((function(e,t,n){if("scrollingElement"in this&&!this.scrollingElement)return;const r="scrollingElement"in this?this.scrollingElement:this;this[n]=()=>{globalThis[t](JSON.stringify({scrollTop:r.scrollTop,scrollLeft:r.scrollLeft,id:e}))},this.addEventListener("scroll",this[n],!0)}),[t,Ui,qi(t)].map((e=>Bn.toCallArgument(e)))),n.release(),t):null}async removeScrollEventListener(e){const t=await zi(this.#Ol,Hi);t&&(await t.callFunction((function(e){this.removeEventListener("scroll",this[e]),delete this[e]}),[qi(e)].map((e=>Bn.toCallArgument(e)))),t.release(),this.#Dl.delete(e),0===this.#Dl.size&&await this.#Bl())}async scrollTop(){return await this.#Ol.callFunction((function(){if("scrollingElement"in this)return this.scrollingElement?this.scrollingElement.scrollTop:0;return this.scrollTop})).then((e=>e?.value??null))}async scrollLeft(){return await this.#Ol.callFunction((function(){if("scrollingElement"in this)return this.scrollingElement?this.scrollingElement.scrollLeft:0;return this.scrollLeft})).then((e=>e?.value??null))}async setScrollTop(e){await this.#Ol.callFunction((function(e){if("scrollingElement"in this){if(!this.scrollingElement)return;this.scrollingElement.scrollTop=e}else this.scrollTop=e}),[e])}async setScrollLeft(e){await this.#Ol.callFunction((function(e){if("scrollingElement"in this){if(!this.scrollingElement)return;this.scrollingElement.scrollLeft=e}else this.scrollLeft=e}),[e])}async verticalScrollRange(){return await this.#Ol.callFunction((function(){if("scrollingElement"in this)return this.scrollingElement?this.scrollingElement.scrollHeight-this.scrollingElement.clientHeight:0;return this.scrollHeight-this.clientHeight})).then((e=>e?.value??null))}async horizontalScrollRange(){return await this.#Ol.callFunction((function(){if("scrollingElement"in this)return this.scrollingElement?this.scrollingElement.scrollWidth-this.scrollingElement.clientWidth:0;return this.scrollWidth-this.clientWidth})).then((e=>e?.value??null))}}function Vi(e,t){const n=e.viewOrScrollTimeline(),r=t.viewOrScrollTimeline();return n?Boolean(r&&n.sourceNodeId===r.sourceNodeId&&n.axis===r.axis):!r&&e.startTime()===t.startTime()}class Wi extends h{runtimeModel;agent;#_l=new Map;animationGroups=new Map;#Hl=new Set;playbackRate=1;#Ul;#ql;constructor(t){super(t),this.runtimeModel=t.model(Jr),this.agent=t.animationAgent(),t.registerAnimationDispatcher(new Yi(this)),t.suspended()||this.agent.invoke_enable();t.model(ii).addEventListener(ri.PrimaryPageChanged,this.reset,this);const n=t.model(Bi);n&&(this.#Ul=new Zi(this,n)),this.#ql=e.Debouncer.debounce((()=>{for(;this.#Hl.size;)this.matchExistingGroups(this.createGroupFromPendingAnimations())}),100)}reset(){this.#_l.clear(),this.animationGroups.clear(),this.#Hl.clear(),this.dispatchEventToListeners(Gi.ModelReset)}async devicePixelRatio(){const e=await this.target().runtimeAgent().invoke_evaluate({expression:"window.devicePixelRatio"});return"number"===e?.result.type?e?.result.value??1:1}async getAnimationGroupForAnimation(e,t){for(const n of this.animationGroups.values())for(const r of n.animations())if(r.name()===e){const e=await r.source().node();if(e?.id===t)return n}return null}animationCanceled(e){this.#Hl.delete(e)}async animationUpdated(e){let t,n;for(const r of this.animationGroups.values())if(n=r.animations().find((t=>t.id()===e.id)),n){t=r;break}n&&t&&(await n.setPayload(e),this.dispatchEventToListeners(Gi.AnimationGroupUpdated,t))}async animationStarted(e){if(!e.source||!e.source.backendNodeId)return;const t=await Ki.parsePayload(this,e),n=t.source().keyframesRule();"WebAnimation"===t.type()&&n&&0===n.keyframes().length?this.#Hl.delete(t.id()):(this.#_l.set(t.id(),t),this.#Hl.add(t.id())),this.#ql()}matchExistingGroups(e){let t=null;for(const n of this.animationGroups.values()){if(n.matches(e)){t=n,n.rebaseTo(e);break}if(n.shouldInclude(e)){t=n,n.appendAnimations(e.animations());break}}return t?this.dispatchEventToListeners(Gi.AnimationGroupUpdated,t):(this.animationGroups.set(e.id(),e),this.#Ul&&this.#Ul.captureScreenshots(e.finiteDuration(),e.screenshotsInternal),this.dispatchEventToListeners(Gi.AnimationGroupStarted,e)),Boolean(t)}createGroupFromPendingAnimations(){console.assert(this.#Hl.size>0);const e=this.#Hl.values().next().value;this.#Hl.delete(e);const t=this.#_l.get(e);if(!t)throw new Error("Unable to locate first animation");const n=[t],r=new Set;for(const e of this.#Hl){const s=this.#_l.get(e);Vi(t,s)?n.push(s):r.add(e)}return this.#Hl=r,n.sort(((e,t)=>e.startTime()-t.startTime())),new Ji(this,e,n)}setPlaybackRate(e){this.playbackRate=e,this.agent.invoke_setPlaybackRate({playbackRate:e})}async releaseAllAnimations(){const e=[...this.animationGroups.values()].flatMap((e=>e.animations().map((e=>e.id()))));await this.agent.invoke_releaseAnimations({animations:e})}releaseAnimations(e){this.agent.invoke_releaseAnimations({animations:e})}async suspendModel(){await this.agent.invoke_disable().then((()=>this.reset()))}async resumeModel(){await this.agent.invoke_enable()}}var Gi;!function(e){e.AnimationGroupStarted="AnimationGroupStarted",e.AnimationGroupUpdated="AnimationGroupUpdated",e.ModelReset="ModelReset"}(Gi||(Gi={}));class Ki{#zl;#jl;#Vl;#Wl;constructor(e){this.#zl=e}static async parsePayload(e,t){const n=new Ki(e);return await n.setPayload(t),n}async setPayload(e){if(e.viewOrScrollTimeline){const t=await this.#zl.devicePixelRatio();e.viewOrScrollTimeline.startOffset&&(e.viewOrScrollTimeline.startOffset/=t),e.viewOrScrollTimeline.endOffset&&(e.viewOrScrollTimeline.endOffset/=t)}this.#jl=e,this.#Vl&&e.source?this.#Vl.setPayload(e.source):!this.#Vl&&e.source&&(this.#Vl=new Qi(this.#zl,e.source))}percentageToPixels(e,t){const{startOffset:n,endOffset:r}=t;if(void 0===n||void 0===r)throw new Error("startOffset or endOffset does not exist in viewOrScrollTimeline");return e/100*(r-n)}viewOrScrollTimeline(){return this.#jl.viewOrScrollTimeline}id(){return this.#jl.id}name(){return this.#jl.name}paused(){return this.#jl.pausedState}playState(){return this.#Wl||this.#jl.playState}playbackRate(){return this.#jl.playbackRate}startTime(){const e=this.viewOrScrollTimeline();return e?this.percentageToPixels(this.playbackRate()>0?this.#jl.startTime:100-this.#jl.startTime,e)+(this.viewOrScrollTimeline()?.startOffset??0):this.#jl.startTime}iterationDuration(){const e=this.viewOrScrollTimeline();return e?this.percentageToPixels(this.source().duration(),e):this.source().duration()}endTime(){return this.source().iterations?this.viewOrScrollTimeline()?this.startTime()+this.iterationDuration()*this.source().iterations():this.startTime()+this.source().delay()+this.source().duration()*this.source().iterations()+this.source().endDelay():1/0}finiteDuration(){const e=Math.min(this.source().iterations(),3);return this.viewOrScrollTimeline()?this.iterationDuration()*e:this.source().delay()+this.source().duration()*e}currentTime(){const e=this.viewOrScrollTimeline();return e?this.percentageToPixels(this.#jl.currentTime,e):this.#jl.currentTime}source(){return this.#Vl}type(){return this.#jl.type}overlaps(e){if(!this.source().iterations()||!e.source().iterations())return!0;const t=this.startTime()=n.startTime()}delayOrStartTime(){return this.viewOrScrollTimeline()?this.startTime():this.source().delay()}setTiming(e,t){this.#Vl.node().then((n=>{if(!n)throw new Error("Unable to find node");this.updateNodeStyle(e,t,n)})),this.#Vl.durationInternal=e,this.#Vl.delayInternal=t,this.#zl.agent.invoke_setTiming({animationId:this.id(),duration:e,delay:t})}updateNodeStyle(e,t,n){let r;if("CSSTransition"===this.type())r="transition-";else{if("CSSAnimation"!==this.type())return;r="animation-"}if(!n.id)throw new Error("Node has no id");const s=n.domModel().cssModel();s.setEffectivePropertyValueForNode(n.id,r+"duration",e+"ms"),s.setEffectivePropertyValueForNode(n.id,r+"delay",t+"ms")}async remoteObjectPromise(){const e=await this.#zl.agent.invoke_resolveAnimation({animationId:this.id()});return e?this.#zl.runtimeModel.createRemoteObject(e.remoteObject):null}cssId(){return this.#jl.cssId||""}}class Qi{#zl;#rs;delayInternal;durationInternal;#Gl;#Kl;constructor(e,t){this.#zl=e,this.setPayload(t)}setPayload(e){this.#rs=e,!this.#Gl&&e.keyframesRule?this.#Gl=new $i(e.keyframesRule):this.#Gl&&e.keyframesRule&&this.#Gl.setPayload(e.keyframesRule),this.delayInternal=e.delay,this.durationInternal=e.duration}delay(){return this.delayInternal}endDelay(){return this.#rs.endDelay}iterations(){return this.delay()||this.endDelay()||this.duration()?this.#rs.iterations||1/0:0}duration(){return this.durationInternal}direction(){return this.#rs.direction}fill(){return this.#rs.fill}node(){return this.#Kl||(this.#Kl=new js(this.#zl.target(),this.backendNodeId())),this.#Kl.resolvePromise()}deferredNode(){return new js(this.#zl.target(),this.backendNodeId())}backendNodeId(){return this.#rs.backendNodeId}keyframesRule(){return this.#Gl||null}easing(){return this.#rs.easing}}class $i{#rs;#rt;constructor(e){this.setPayload(e)}setPayload(e){this.#rs=e,this.#rt?this.#rs.keyframes.forEach(((e,t)=>{this.#rt[t]?.setPayload(e)})):this.#rt=this.#rs.keyframes.map((e=>new Xi(e)))}name(){return this.#rs.name}keyframes(){return this.#rt}}class Xi{#rs;#Ql;constructor(e){this.setPayload(e)}setPayload(e){this.#rs=e,this.#Ql=e.offset}offset(){return this.#Ql}setOffset(e){this.#Ql=100*e+"%"}offsetAsNumber(){return parseFloat(this.#Ql)/100}easing(){return this.#rs.easing}}class Ji{#zl;#C;#$l;#Xl;#Jl;screenshotsInternal;#Yl;constructor(e,t,n){this.#zl=e,this.#C=t,this.#Xl=n,this.#Jl=!1,this.screenshotsInternal=[],this.#Yl=[]}isScrollDriven(){return Boolean(this.#Xl[0]?.viewOrScrollTimeline())}id(){return this.#C}animations(){return this.#Xl}release(){this.#zl.animationGroups.delete(this.id()),this.#zl.releaseAnimations(this.animationIds())}animationIds(){return this.#Xl.map((function(e){return e.id()}))}startTime(){return this.#Xl[0].startTime()}groupDuration(){let e=0;for(const t of this.#Xl)e=Math.max(e,t.delayOrStartTime()+t.iterationDuration());return e}finiteDuration(){let e=0;for(let t=0;te.endTime())&&(e=t);if(!e)throw new Error("No longest animation found");return this.#zl.agent.invoke_getCurrentTime({id:e.id()}).then((({currentTime:e})=>e||0))}matches(e){function t(e){const t=(e.viewOrScrollTimeline()?.sourceNodeId??"")+(e.viewOrScrollTimeline()?.axis??"");return("WebAnimation"===e.type()?e.type()+e.id():e.cssId())+t}if(this.#Xl.length!==e.#Xl.length)return!1;const n=this.#Xl.map(t).sort(),r=e.#Xl.map(t).sort();for(let e=0;ethis.#rd)&&(clearTimeout(this.#nd),this.#nd=window.setTimeout(this.stopScreencast.bind(this),n),this.#rd=r),this.#ed||(this.#ed=!0,this.#td=await this.#Zl.startScreencast("jpeg",80,void 0,300,2,this.screencastFrame.bind(this),(e=>{})))}screencastFrame(e,t){if(!this.#ed)return;const n=window.performance.now();this.#de=this.#de.filter((function(e){return e.endTime>=n}));for(const t of this.#de)t.screenshots.push(e)}stopScreencast(){this.#td&&(this.#Zl.stopScreencast(this.#td),this.#nd=void 0,this.#rd=void 0,this.#de=[],this.#ed=!1,this.#td=void 0)}}h.register(Wi,{capabilities:2,autostart:!0});var eo=Object.freeze({__proto__:null,AnimationDOMNode:ji,AnimationDispatcher:Yi,AnimationEffect:Qi,AnimationGroup:Ji,AnimationImpl:Ki,AnimationModel:Wi,get Events(){return Gi},KeyframeStyle:Xi,KeyframesRule:$i,ScreenshotCapture:Zi});class to extends h{agent;#yr;#sd;constructor(t){super(t),this.agent=t.autofillAgent(),this.#sd=e.Settings.Settings.instance().createSetting("show-test-addresses-in-autofill-menu-on-event",!1),t.registerAutofillDispatcher(this),this.enable()}setTestAddresses(){this.agent.invoke_setAddresses({addresses:this.#sd.get()?[{fields:[{name:"ADDRESS_HOME_COUNTRY",value:"US"},{name:"NAME_FULL",value:"Jon Stewart Doe"},{name:"NAME_FIRST",value:"Jon"},{name:"NAME_MIDDLE",value:"Stewart"},{name:"NAME_LAST",value:"Doe"},{name:"COMPANY_NAME",value:"Fake Company"},{name:"ADDRESS_HOME_LINE1",value:"1600 Fake Street"},{name:"ADDRESS_HOME_LINE2",value:"Apartment 1"},{name:"ADDRESS_HOME_ZIP",value:"94043"},{name:"ADDRESS_HOME_CITY",value:"Mountain View"},{name:"ADDRESS_HOME_STATE",value:"CA"},{name:"EMAIL_ADDRESS",value:"test@example.us"},{name:"PHONE_HOME_WHOLE_NUMBER",value:"+16019521325"}]},{fields:[{name:"ADDRESS_HOME_COUNTRY",value:"BR"},{name:"NAME_FULL",value:"João Souza Silva"},{name:"NAME_FIRST",value:"João"},{name:"NAME_LAST",value:"Souza Silva"},{name:"NAME_LAST_FIRST",value:"Souza"},{name:"NAME_LAST_SECOND",value:"Silva"},{name:"COMPANY_NAME",value:"Empresa Falsa"},{name:"ADDRESS_HOME_STREET_ADDRESS",value:"Rua Inexistente, 2000\nAndar 2, Apartamento 1"},{name:"ADDRESS_HOME_STREET_LOCATION",value:"Rua Inexistente, 2000"},{name:"ADDRESS_HOME_STREET_NAME",value:"Rua Inexistente"},{name:"ADDRESS_HOME_HOUSE_NUMBER",value:"2000"},{name:"ADDRESS_HOME_SUBPREMISE",value:"Andar 2, Apartamento 1"},{name:"ADDRESS_HOME_APT_NUM",value:"1"},{name:"ADDRESS_HOME_FLOOR",value:"2"},{name:"ADDRESS_HOME_APT",value:"Apartamento 1"},{name:"ADDRESS_HOME_APT_TYPE",value:"Apartamento"},{name:"ADDRESS_HOME_APT_NUM",value:"1"},{name:"ADDRESS_HOME_DEPENDENT_LOCALITY",value:"Santa Efigênia"},{name:"ADDRESS_HOME_LANDMARK",value:"Próximo à estação Santa Efigênia"},{name:"ADDRESS_HOME_OVERFLOW",value:"Andar 2, Apartamento 1"},{name:"ADDRESS_HOME_ZIP",value:"30260-080"},{name:"ADDRESS_HOME_CITY",value:"Belo Horizonte"},{name:"ADDRESS_HOME_STATE",value:"MG"},{name:"EMAIL_ADDRESS",value:"teste@exemplo.us"},{name:"PHONE_HOME_WHOLE_NUMBER",value:"+553121286800"}]},{fields:[{name:"ADDRESS_HOME_COUNTRY",value:"MX"},{name:"NAME_FULL",value:"Juan Francisco García Flores"},{name:"NAME_FIRST",value:"Juan Francisco"},{name:"NAME_LAST",value:"García Flores"},{name:"NAME_LAST_FIRST",value:"García"},{name:"NAME_LAST_SECOND",value:"Flores"},{name:"COMPANY_NAME",value:"Empresa Falsa"},{name:"ADDRESS_HOME_STREET_ADDRESS",value:"C. Falsa 445\nPiso 2, Apartamento 1\nEntre calle Volcán y calle Montes Blancos, cerca de la estación de metro"},{name:"ADDRESS_HOME_STREET_LOCATION",value:"C. Falsa 445"},{name:"ADDRESS_HOME_STREET_NAME",value:"C. Falsa"},{name:"ADDRESS_HOME_HOUSE_NUMBER",value:"445"},{name:"ADDRESS_HOME_SUBPREMISE",value:"Piso 2, Apartamento 1"},{name:"ADDRESS_HOME_FLOOR",value:"2"},{name:"ADDRESS_HOME_APT",value:"Apartamento 1"},{name:"ADDRESS_HOME_APT_TYPE",value:"Apartamento"},{name:"ADDRESS_HOME_APT_NUM",value:"1"},{name:"ADDRESS_HOME_DEPENDENT_LOCALITY",value:"Lomas de Chapultepec"},{name:"ADDRESS_HOME_OVERFLOW",value:"Entre calle Volcán y calle Montes Celestes, cerca de la estación de metro"},{name:"ADDRESS_HOME_BETWEEN_STREETS_OR_LANDMARK",value:"Entre calle Volcán y calle Montes Blancos, cerca de la estación de metro"},{name:"ADDRESS_HOME_LANDMARK",value:"Cerca de la estación de metro"},{name:"ADDRESS_HOME_BETWEEN_STREETS",value:"Entre calle Volcán y calle Montes Blancos"},{name:"ADDRESS_HOME_BETWEEN_STREETS_1",value:"calle Volcán"},{name:"ADDRESS_HOME_BETWEEN_STREETS_2",value:"calle Montes Blancos"},{name:"ADDRESS_HOME_ADMIN_LEVEL2",value:"Miguel Hidalgo"},{name:"ADDRESS_HOME_ZIP",value:"11001"},{name:"ADDRESS_HOME_CITY",value:"Ciudad de México"},{name:"ADDRESS_HOME_STATE",value:"Distrito Federal"},{name:"EMAIL_ADDRESS",value:"ejemplo@ejemplo.mx"},{name:"PHONE_HOME_WHOLE_NUMBER",value:"+525553428400"}]},{fields:[{name:"ADDRESS_HOME_COUNTRY",value:"DE"},{name:"NAME_FULL",value:"Gottfried Wilhelm Leibniz"},{name:"NAME_FIRST",value:"Gottfried"},{name:"NAME_MIDDLE",value:"Wilhelm"},{name:"NAME_LAST",value:"Leibniz"},{name:"COMPANY_NAME",value:"Erfundenes Unternehmen"},{name:"ADDRESS_HOME_LINE1",value:"Erfundene Straße 33"},{name:"ADDRESS_HOME_LINE2",value:"Wohnung 1"},{name:"ADDRESS_HOME_ZIP",value:"80732"},{name:"ADDRESS_HOME_CITY",value:"München"},{name:"EMAIL_ADDRESS",value:"test@beispiel.de"},{name:"PHONE_HOME_WHOLE_NUMBER",value:"+4930303986300"}]}]:[]})}enable(){this.#yr||a.InspectorFrontendHost.isUnderTest()||(this.agent.invoke_enable(),this.setTestAddresses(),this.#yr=!0)}disable(){this.#yr&&!a.InspectorFrontendHost.isUnderTest()&&(this.#yr=!1,this.agent.invoke_disable())}addressFormFilled(e){this.dispatchEventToListeners("AddressFormFilled",{autofillModel:this,event:e})}}h.register(to,{capabilities:2,autostart:!0});var no=Object.freeze({__proto__:null,AutofillModel:to});class ro{name;#id;enabledInternal;constructor(e,t){this.#id=e,this.name=t,this.enabledInternal=!1}category(){return this.#id}enabled(){return this.enabledInternal}setEnabled(e){this.enabledInternal=e}}var so=Object.freeze({__proto__:null,CategorizedBreakpoint:ro});class io{#od;#ad=[];#ld=new Map;#dd=new Map;#cd=new Map;#hd=new Map;#ud=new Map;#gd=[];#pd=[];#md=[];static enhancedTraceVersion=1;constructor(e){this.#od=e;try{this.parseEnhancedTrace()}catch(e){throw new i.UserVisibleError(e)}}parseEnhancedTrace(){for(const e of this.#od.traceEvents)if(this.isTargetRundownEvent(e)){const t=e.args?.data;this.#ld.set(this.getScriptIsolateId(t.isolate,t.scriptId),t.v8context),this.#dd.set(this.getScriptIsolateId(t.isolate,t.scriptId),t.frame),this.#gd.find((e=>e.targetId===t.frame))||this.#gd.push({targetId:t.frame,type:t.frameType,isolate:t.isolate,pid:e.pid,url:t.url}),this.#pd.find((e=>e.v8Context===t.v8context))||this.#pd.push({id:-1,origin:t.origin,v8Context:t.v8context,auxData:{frameId:t.frame,isDefault:t.isDefault,type:t.contextType},isolate:t.isolate})}else if(this.isScriptRundownEvent(e)){this.#ad.push(e);const t=e.args.data;this.#md.find((e=>e.scriptId===t.scriptId&&e.isolate===t.isolate))||this.#md.push({scriptId:t.scriptId,isolate:t.isolate,executionContextId:t.executionContextId,startLine:t.startLine,startColumn:t.startColumn,endLine:t.endLine,endColumn:t.endColumn,hash:t.hash,isModule:t.isModule,url:t.url,hasSourceURL:t.hasSourceUrl,sourceURL:t.sourceUrl,sourceMapURL:t.sourceMapUrl})}else if(this.isScriptRundownSourceEvent(e)){const t=e.args.data,n=this.getScriptIsolateId(t.isolate,t.scriptId);if("splitIndex"in t&&"splitCount"in t){this.#hd.has(n)||this.#hd.set(n,new Array(t.splitCount).fill(""));const e=this.#hd.get(n);e&&t.sourceText&&(e[t.splitIndex]=t.sourceText)}else t.sourceText&&this.#cd.set(n,t.sourceText),t.length&&this.#ud.set(n,t.length)}}data(){const e=new Map;this.#ad.forEach((t=>{const n=t.args.data,r=this.#ld.get(this.getScriptIsolateId(n.isolate,n.scriptId));r&&e.set(r,n.executionContextId)})),this.#pd.forEach((t=>{if(t.v8Context){const n=e.get(t.v8Context);n&&(t.id=n)}})),this.#md.forEach((e=>{const t=this.getScriptIsolateId(e.isolate,e.scriptId);if(this.#cd.has(t))e.sourceText=this.#cd.get(t),e.length=this.#ud.get(t);else if(this.#hd.has(t)){const n=this.#hd.get(t);n&&(e.sourceText=n.join(""),e.length=e.sourceText.length)}e.auxData=this.#pd.find((t=>t.id===e.executionContextId&&t.isolate===e.isolate))?.auxData}));for(const e of this.#md)e.sourceMapURL=this.getEncodedSourceMapUrl(e);const t=new Map;for(const e of this.#gd)t.set(e,this.groupContextsAndScriptsUnderTarget(e,this.#pd,this.#md));return t}getEncodedSourceMapUrl(e){if(e.sourceMapURL?.startsWith("data:"))return e.sourceMapURL;const t=this.getSourceMapFromMetadata(e);if(t)try{return`data:text/plain;base64,${btoa(JSON.stringify(t))}`}catch{return}}getSourceMapFromMetadata(t){const{hasSourceURL:n,sourceURL:r,url:s,sourceMapURL:i,isolate:o,scriptId:a}=t;if(!i||!this.#od.metadata.sourceMaps)return;const l=this.#dd.get(this.getScriptIsolateId(o,a));if(!l)return;const d=this.#gd.find((e=>e.targetId===l));if(!d)return;let c=s;if(n&&r){const t=d.url;c=e.ParsedURL.ParsedURL.completeURL(t,r)??r}const h=e.ParsedURL.ParsedURL.completeURL(c,i);if(!h)return;const{sourceMap:u}=this.#od.metadata.sourceMaps.find((e=>e.sourceMapUrl===h))??{};return u}getScriptIsolateId(e,t){return t+"@"+e}isTraceEvent(e){return"cat"in e&&"pid"in e&&"args"in e&&"data"in e.args}isTargetRundownEvent(e){return this.isTraceEvent(e)&&"disabled-by-default-devtools.target-rundown"===e.cat}isScriptRundownEvent(e){return this.isTraceEvent(e)&&"disabled-by-default-devtools.v8-source-rundown"===e.cat}isScriptRundownSourceEvent(e){return this.isTraceEvent(e)&&"disabled-by-default-devtools.v8-source-rundown-sources"===e.cat}groupContextsAndScriptsUnderTarget(e,t,n){const r=[],s=[];for(const n of t)n.auxData?.frameId===e.targetId&&r.push(n);for(const t of n)null===t.auxData&&console.error(t+" missing aux data"),t.auxData?.frameId===e.targetId&&s.push(t);return[r,s]}}var oo=Object.freeze({__proto__:null,EnhancedTracesParser:io});class ao{traceEvents;metadata;constructor(e,t={}){this.traceEvents=e,this.metadata=t}}class lo{networkRequest;constructor(e){this.networkRequest=e}static create(t){const n=t.args.data.url,r=e.ParsedURL.ParsedURL.urlWithoutHash(n),s=ii.resourceForURL(n)??ii.resourceForURL(r),i=s?.request;return i?new lo(i):null}}var co=Object.freeze({__proto__:null,RevealableEvent:class{event;constructor(e){this.event=e}},RevealableNetworkRequest:lo,TraceObject:ao});const ho={noSourceText:"No source text available",noHostWindow:"Can not find host window",errorLoadingLog:"Error loading log"},uo=n.i18n.registerUIStrings("core/sdk/RehydratingConnection.ts",ho),go=n.i18n.getLocalizedString.bind(void 0,uo);class po{rehydratingConnectionState=1;onDisconnect=null;onMessage=null;trace=null;sessions=new Map;#fd;#bd;#yd=this.#vd.bind(this);constructor(e){this.#fd=e,this.#bd=window,this.#Id()}#Id(){this.#bd.addEventListener("message",this.#yd),this.#bd.opener||this.#fd({reason:go(ho.noHostWindow)}),this.#bd.opener.postMessage({type:"REHYDRATING_WINDOW_READY"})}#vd(e){if("REHYDRATING_TRACE_FILE"===e.data.type){const{traceFile:t}=e.data,n=new FileReader;n.onload=async()=>{await this.startHydration(n.result)},n.onerror=()=>{this.#fd({reason:go(ho.errorLoadingLog)})},n.readAsText(t)}this.#bd.removeEventListener("message",this.#yd)}async startHydration(e){if(!this.onMessage||2!==this.rehydratingConnectionState)return!1;const t=JSON.parse(e);if(!("traceEvents"in t))return console.error("RehydratingConnection failed to initialize due to missing trace events in payload"),!1;this.trace=t;const n=new io(t).data();let r=0;this.sessions.set(r,new mo(this));for(const[e,[t,s]]of n.entries())this.postToFrontend({method:"Target.targetCreated",params:{targetInfo:{targetId:e.targetId,type:e.type,title:e.url,url:e.url,attached:!1,canAccessOpener:!1}}}),r+=1,this.sessions.set(r,new fo(r,e,t,s,this));return await this.#wd(),!0}async#wd(){if(!this.trace)return;this.rehydratingConnectionState=3;const t=new ao(this.trace.traceEvents,this.trace.metadata);await e.Revealer.reveal(t)}setOnMessage(e){this.onMessage=e,this.rehydratingConnectionState=2}setOnDisconnect(e){this.onDisconnect=e}sendRawMessage(e){"string"==typeof e&&(e=JSON.parse(e));const t=e;if(void 0!==t.sessionId){const e=this.sessions.get(t.sessionId);e?e.handleFrontendMessageAsFakeCDPAgent(t):console.error("Invalid SessionId: "+t.sessionId)}else this.sessions.get(0)?.handleFrontendMessageAsFakeCDPAgent(t)}postToFrontend(e){this.onMessage?this.onMessage(e):console.error("onMessage was not initialized")}disconnect(){return Promise.reject()}}class mo{connection=null;constructor(e){this.connection=e}sendMessageToFrontend(e){requestAnimationFrame((()=>{this.connection&&this.connection.postToFrontend(e)}))}handleFrontendMessageAsFakeCDPAgent(e){this.sendMessageToFrontend({id:e.id,result:{}})}}class fo extends mo{sessionId;target;executionContexts=[];scripts=[];constructor(e,t,n,r,s){super(s),this.sessionId=e,this.target=t,this.executionContexts=n,this.scripts=r,this.sessionAttachToTarget()}sendMessageToFrontend(e,t=!0){0!==this.sessionId&&t&&(e.sessionId=this.sessionId),super.sendMessageToFrontend(e)}handleFrontendMessageAsFakeCDPAgent(e){switch(e.method){case"Runtime.enable":this.handleRuntimeEnabled(e.id);break;case"Debugger.enable":this.handleDebuggerEnable(e.id);break;case"Debugger.getScriptSource":if(e.params){const t=e.params;this.handleDebuggerGetScriptSource(e.id,t.scriptId)}break;default:this.sendMessageToFrontend({id:e.id,result:{}})}}sessionAttachToTarget(){this.sendMessageToFrontend({method:"Target.attachedToTarget",params:{sessionId:this.sessionId,waitingForDebugger:!1,targetInfo:{targetId:this.target.targetId,type:this.target.type,title:this.target.url,url:this.target.url,attached:!0,canAccessOpener:!1}}},!1)}handleRuntimeEnabled(e){for(const e of this.executionContexts)e.name=e.origin,this.sendMessageToFrontend({method:"Runtime.executionContextCreated",params:{context:e}});this.sendMessageToFrontend({id:e,result:{}})}handleDebuggerGetScriptSource(e,t){const n=this.scripts.find((e=>e.scriptId===t));n?this.sendMessageToFrontend({id:e,result:{scriptSource:void 0===n.sourceText?go(ho.noSourceText):n.sourceText}}):console.error("No script for id: "+t)}handleDebuggerEnable(e){for(const e of this.scripts)this.sendMessageToFrontend({method:"Debugger.scriptParsed",params:e});this.sendMessageToFrontend({id:e,result:{debuggerId:"7777777777777777777.8888888888888888888"}})}}const bo={websocketDisconnected:"WebSocket disconnected"},yo=n.i18n.registerUIStrings("core/sdk/Connections.ts",bo),vo=n.i18n.getLocalizedString.bind(void 0,yo);class Io{onMessage;#Sd;#kd;#Cd;#Vt;constructor(){this.onMessage=null,this.#Sd=null,this.#kd="",this.#Cd=0,this.#Vt=[a.InspectorFrontendHost.InspectorFrontendHostInstance.events.addEventListener(a.InspectorFrontendHostAPI.Events.DispatchMessage,this.dispatchMessage,this),a.InspectorFrontendHost.InspectorFrontendHostInstance.events.addEventListener(a.InspectorFrontendHostAPI.Events.DispatchMessageChunk,this.dispatchMessageChunk,this)]}setOnMessage(e){this.onMessage=e}setOnDisconnect(e){this.#Sd=e}sendRawMessage(e){this.onMessage&&a.InspectorFrontendHost.InspectorFrontendHostInstance.sendMessageToBackend(e)}dispatchMessage(e){this.onMessage&&this.onMessage.call(null,e.data)}dispatchMessageChunk(e){const{messageChunk:t,messageSize:n}=e.data;n&&(this.#kd="",this.#Cd=n),this.#kd+=t,this.#kd.length===this.#Cd&&this.onMessage&&(this.onMessage.call(null,this.#kd),this.#kd="",this.#Cd=0)}async disconnect(){const t=this.#Sd;e.EventTarget.removeEventListeners(this.#Vt),this.#Sd=null,this.onMessage=null,t&&t.call(null,"force disconnect")}}class wo{#xd;onMessage;#Sd;#Rd;#Td;#Md;constructor(e,t){this.#xd=new WebSocket(e),this.#xd.onerror=this.onError.bind(this),this.#xd.onopen=this.onOpen.bind(this),this.#xd.onmessage=e=>{this.onMessage&&this.onMessage.call(null,e.data)},this.#xd.onclose=this.onClose.bind(this),this.onMessage=null,this.#Sd=null,this.#Rd=t,this.#Td=!1,this.#Md=[]}setOnMessage(e){this.onMessage=e}setOnDisconnect(e){this.#Sd=e}onError(e){this.#Rd&&this.#Rd.call(null,{reason:vo(bo.websocketDisconnected),errorType:e.type}),this.#Sd&&this.#Sd.call(null,"connection failed"),this.close()}onOpen(){if(this.#Td=!0,this.#xd){this.#xd.onerror=console.error;for(const e of this.#Md)this.#xd.send(e)}this.#Md=[]}onClose(e){this.#Rd&&this.#Rd.call(null,{reason:e.reason,code:String(e.code||0)}),this.#Sd&&this.#Sd.call(null,"websocket closed"),this.close()}close(e){this.#xd&&(this.#xd.onerror=null,this.#xd.onopen=null,this.#xd.onclose=e||null,this.#xd.onmessage=null,this.#xd.close(),this.#xd=null),this.#Rd=null}sendRawMessage(e){this.#Td&&this.#xd?this.#xd.send(e):this.#Md.push(e)}disconnect(){return new Promise((e=>{this.close((()=>{this.#Sd&&this.#Sd.call(null,"force disconnect"),e()}))}))}}class So{onMessage;#Sd;constructor(){this.onMessage=null,this.#Sd=null}setOnMessage(e){this.onMessage=e}setOnDisconnect(e){this.#Sd=e}sendRawMessage(e){window.setTimeout(this.respondWithError.bind(this,e),0)}respondWithError(e){const t=JSON.parse(e),n={message:"This is a stub connection, can't dispatch message.",code:l.InspectorBackend.DevToolsStubErrorCode,data:t};this.onMessage&&this.onMessage.call(null,{id:t.id,error:n})}async disconnect(){this.#Sd&&this.#Sd.call(null,"force disconnect"),this.#Sd=null,this.onMessage=null}}class ko{#Pd;#Ed;onMessage;#Sd;constructor(e,t){this.#Pd=e,this.#Ed=t,this.onMessage=null,this.#Sd=null}setOnMessage(e){this.onMessage=e}setOnDisconnect(e){this.#Sd=e}getOnDisconnect(){return this.#Sd}sendRawMessage(e){const t=JSON.parse(e);t.sessionId||(t.sessionId=this.#Ed),this.#Pd.sendRawMessage(JSON.stringify(t))}getSessionId(){return this.#Ed}async disconnect(){this.#Sd&&this.#Sd.call(null,"force disconnect"),this.#Sd=null,this.onMessage=null}}function Co(e){if(o.Runtime.getPathName().includes("rehydrated_devtools_app"))return new po(e);const t=o.Runtime.Runtime.queryParam("ws"),n=o.Runtime.Runtime.queryParam("wss");if(t||n){const r=t?"ws":"wss";let s=t||n;a.InspectorFrontendHost.InspectorFrontendHostInstance.isHostedMode()&&s.startsWith("/")&&(s=`${window.location.host}${s}`);return new wo(`${r}://${s}`,e)}return a.InspectorFrontendHost.InspectorFrontendHostInstance.isHostedMode()?new So:new Io}var xo=Object.freeze({__proto__:null,MainConnection:Io,ParallelConnection:ko,StubConnection:So,WebSocketConnection:wo,initMainConnection:async function(e,t){l.InspectorBackend.Connection.setFactory(Co.bind(null,t)),await e(),a.InspectorFrontendHost.InspectorFrontendHostInstance.connectionReady()}});const Ro={main:"Main"},To=n.i18n.registerUIStrings("core/sdk/ChildTargetManager.ts",Ro),Mo=n.i18n.getLocalizedString.bind(void 0,To);class Po extends h{#Ld;#Ad;#Od;#Dd=new Map;#Nd=new Map;#Fd=new Map;#Bd=new Map;#_d=null;constructor(e){super(e),this.#Ld=e.targetManager(),this.#Ad=e,this.#Od=e.targetAgent(),e.registerTargetDispatcher(this);const t=this.#Ld.browserTarget();t?t!==e&&t.targetAgent().invoke_autoAttachRelated({targetId:e.id(),waitForDebuggerOnStart:!0}):this.#Od.invoke_setAutoAttach({autoAttach:!0,waitForDebuggerOnStart:!0,flatten:!0}),e.parentTarget()?.type()===U.FRAME||a.InspectorFrontendHost.isUnderTest()||(this.#Od.invoke_setDiscoverTargets({discover:!0}),this.#Od.invoke_setRemoteLocations({locations:[{host:"localhost",port:9229}]}))}static install(e){Po.attachCallback=e,h.register(Po,{capabilities:32,autostart:!0})}childTargets(){return Array.from(this.#Nd.values())}async suspendModel(){await this.#Od.invoke_setAutoAttach({autoAttach:!0,waitForDebuggerOnStart:!1,flatten:!0})}async resumeModel(){await this.#Od.invoke_setAutoAttach({autoAttach:!0,waitForDebuggerOnStart:!0,flatten:!0})}dispose(){for(const e of this.#Nd.keys())this.detachedFromTarget({sessionId:e,targetId:void 0})}targetCreated({targetInfo:e}){this.#Dd.set(e.targetId,e),this.fireAvailableTargetsChanged(),this.dispatchEventToListeners("TargetCreated",e)}targetInfoChanged({targetInfo:e}){this.#Dd.set(e.targetId,e);const t=this.#Fd.get(e.targetId);if(t)if(t.setHasCrashed(!1),"prerender"!==t.targetInfo()?.subtype||e.subtype)t.updateTargetInfo(e);else{const n=t.model(ii);t.updateTargetInfo(e),n?.mainFrame&&n.primaryPageChanged(n.mainFrame,"Activation"),t.setName(Mo(Ro.main))}this.fireAvailableTargetsChanged(),this.dispatchEventToListeners("TargetInfoChanged",e)}targetDestroyed({targetId:e}){this.#Dd.delete(e),this.fireAvailableTargetsChanged(),this.dispatchEventToListeners("TargetDestroyed",e)}targetCrashed({targetId:e}){const t=this.#Fd.get(e);t&&t.setHasCrashed(!0)}fireAvailableTargetsChanged(){W.instance().dispatchEventToListeners("AvailableTargetsChanged",[...this.#Dd.values()])}async getParentTargetId(){return this.#_d||(this.#_d=(await this.#Ad.targetAgent().invoke_getTargetInfo({})).targetInfo.targetId),this.#_d}async getTargetInfo(){return(await this.#Ad.targetAgent().invoke_getTargetInfo({})).targetInfo}async attachedToTarget({sessionId:t,targetInfo:n,waitingForDebugger:r}){if(this.#_d===n.targetId)return;let s=U.BROWSER,i="";if("worker"===n.type&&n.title&&n.title!==n.url)i=n.title;else if(!["page","iframe","webview"].includes(n.type)){if(["^chrome://print/$","^chrome://file-manager/","^chrome://feedback/","^chrome://.*\\.top-chrome/$","^chrome://view-cert/$","^devtools://"].some((e=>n.url.match(e))))s=U.FRAME;else{const t=e.ParsedURL.ParsedURL.fromString(n.url);i=t?t.lastPathComponentWithFragment():"#"+ ++Po.lastAnonymousTargetId}}"iframe"===n.type||"webview"===n.type||"background_page"===n.type||"app"===n.type||"popup_page"===n.type||"page"===n.type?s=U.FRAME:"worker"===n.type?s=U.Worker:"worklet"===n.type?s=U.WORKLET:"shared_worker"===n.type?s=U.SHARED_WORKER:"shared_storage_worklet"===n.type?s=U.SHARED_STORAGE_WORKLET:"service_worker"===n.type?s=U.ServiceWorker:"auction_worklet"===n.type&&(s=U.AUCTION_WORKLET);const o=this.#Ld.createTarget(n.targetId,i,s,this.#Ad,t,void 0,void 0,n);this.#Nd.set(t,o),this.#Fd.set(o.id(),o),Po.attachCallback&&await Po.attachCallback({target:o,waitingForDebugger:r}),r&&o.runtimeAgent().invoke_runIfWaitingForDebugger()}detachedFromTarget({sessionId:e}){if(this.#Bd.has(e))this.#Bd.delete(e);else{const t=this.#Nd.get(e);t&&(t.dispose("target terminated"),this.#Nd.delete(e),this.#Fd.delete(t.id()))}}receivedMessageFromTarget({}){}async createParallelConnection(e){const t=await this.getParentTargetId(),{connection:n,sessionId:r}=await this.createParallelConnectionAndSessionForTarget(this.#Ad,t);return n.setOnMessage(e),this.#Bd.set(r,n),{connection:n,sessionId:r}}async createParallelConnectionAndSessionForTarget(e,t){const n=e.targetAgent(),r=e.router(),s=(await n.invoke_attachToTarget({targetId:t,flatten:!0})).sessionId,i=new ko(r.connection(),s);return r.registerSession(e,s,i),i.setOnDisconnect((()=>{r.unregisterSession(s),n.invoke_detachFromTarget({sessionId:s})})),{connection:i,sessionId:s}}targetInfos(){return Array.from(this.#Dd.values())}static lastAnonymousTargetId=0;static attachCallback}var Eo=Object.freeze({__proto__:null,ChildTargetManager:Po});const Lo={couldNotLoadContentForSS:"Could not load content for {PH1} ({PH2})"},Ao=n.i18n.registerUIStrings("core/sdk/CompilerSourceMappingContentProvider.ts",Lo),Oo=n.i18n.getLocalizedString.bind(void 0,Ao);var Do,No=Object.freeze({__proto__:null,CompilerSourceMappingContentProvider:class{#Hd;#Ud;#qd;constructor(e,t,n){this.#Hd=e,this.#Ud=t,this.#qd=n}contentURL(){return this.#Hd}contentType(){return this.#Ud}async requestContent(){const e=await this.requestContentData();return t.ContentData.ContentData.asDeferredContent(e)}async requestContentData(){try{const{content:e}=await nr.instance().loadResource(this.#Hd,this.#qd);return new t.ContentData.ContentData(e,!1,this.#Ud.canonicalMimeType())}catch(e){const t=Oo(Lo.couldNotLoadContentForSS,{PH1:this.#Hd,PH2:e.message});return console.error(t),{error:t}}}async searchInContent(e,n,r){const s=await this.requestContentData();return t.TextUtils.performSearchInContentData(s,e,n,r)}}});!function(e){e.Result="result",e.Command="command",e.System="system",e.QueryObjectResult="queryObjectResult"}(Do||(Do={}));const Fo={profileD:"Profile {PH1}"},Bo=n.i18n.registerUIStrings("core/sdk/CPUProfilerModel.ts",Fo),_o=n.i18n.getLocalizedString.bind(void 0,Bo);class Ho extends h{#zd;#jd;#Vd;#Wd;#Gd;registeredConsoleProfileMessages=[];constructor(e){super(e),this.#zd=1,this.#jd=new Map,this.#Vd=e.profilerAgent(),this.#Wd=null,e.registerProfilerDispatcher(this),this.#Vd.invoke_enable(),this.#Gd=e.model(ms)}runtimeModel(){return this.#Gd.runtimeModel()}debuggerModel(){return this.#Gd}consoleProfileStarted({id:e,location:t,title:n}){n||(n=_o(Fo.profileD,{PH1:this.#zd++}),this.#jd.set(e,n));const r=this.createEventDataFrom(e,t,n);this.dispatchEventToListeners("ConsoleProfileStarted",r)}consoleProfileFinished({id:e,location:t,profile:n,title:r}){r||(r=this.#jd.get(e),this.#jd.delete(e));const s={...this.createEventDataFrom(e,t,r),cpuProfile:n};this.registeredConsoleProfileMessages.push(s),this.dispatchEventToListeners("ConsoleProfileFinished",s)}createEventDataFrom(e,t,n){const r=Is.fromPayload(this.#Gd,t);return{id:this.target().id()+"."+e,scriptLocation:r,title:n||"",cpuProfilerModel:this}}startRecording(){return this.#Vd.invoke_setSamplingInterval({interval:100}),this.#Vd.invoke_start()}stopRecording(){return this.#Vd.invoke_stop().then((e=>e.profile||null))}startPreciseCoverage(e,t){this.#Wd=t;return this.#Vd.invoke_startPreciseCoverage({callCount:!1,detailed:e,allowTriggeredUpdates:!0})}async takePreciseCoverage(){const e=await this.#Vd.invoke_takePreciseCoverage();return{timestamp:e?.timestamp||0,coverage:e?.result||[]}}stopPreciseCoverage(){return this.#Wd=null,this.#Vd.invoke_stopPreciseCoverage()}preciseCoverageDeltaUpdate({timestamp:e,occasion:t,result:n}){this.#Wd&&this.#Wd(e,t,n)}}h.register(Ho,{capabilities:4,autostart:!0});var Uo=Object.freeze({__proto__:null,CPUProfilerModel:Ho});class qo extends h{#Kd;constructor(e){super(e),e.registerLogDispatcher(this),this.#Kd=e.logAgent(),this.#Kd.invoke_enable(),a.InspectorFrontendHost.isUnderTest()||this.#Kd.invoke_startViolationsReport({config:[{name:"longTask",threshold:200},{name:"longLayout",threshold:30},{name:"blockedEvent",threshold:100},{name:"blockedParser",threshold:-1},{name:"handler",threshold:150},{name:"recurringHandler",threshold:50},{name:"discouragedAPIUse",threshold:-1}]})}entryAdded({entry:e}){this.dispatchEventToListeners("EntryAdded",{logModel:this,entry:e})}requestClear(){this.#Kd.invoke_clear()}}h.register(qo,{capabilities:8,autostart:!0});var zo=Object.freeze({__proto__:null,LogModel:qo});const jo={navigatedToS:"Navigated to {PH1}",bfcacheNavigation:"Navigation to {PH1} was restored from back/forward cache (see https://web.dev/bfcache/)",profileSStarted:"Profile ''{PH1}'' started.",profileSFinished:"Profile ''{PH1}'' finished.",failedToSaveToTempVariable:"Failed to save to temp variable."},Vo=n.i18n.registerUIStrings("core/sdk/ConsoleModel.ts",jo),Wo=n.i18n.getLocalizedString.bind(void 0,Vo);class Go extends h{#Qd=[];#$d=new r.MapUtilities.Multimap;#Xd=new Map;#Jd=0;#Yd=0;#Zd=0;#ec=0;#tc=new WeakMap;constructor(t){super(t);const n=t.model(ii);if(!n||n.cachedResourcesLoaded())return void this.initTarget(t);const r=n.addEventListener(ri.CachedResourcesLoaded,(()=>{e.EventTarget.removeEventListeners([r]),this.initTarget(t)}))}initTarget(e){const t=[],n=e.model(Ho);n&&(t.push(n.addEventListener("ConsoleProfileStarted",this.consoleProfileStarted.bind(this,n))),t.push(n.addEventListener("ConsoleProfileFinished",this.consoleProfileFinished.bind(this,n))));const r=e.model(ii);r&&e.parentTarget()?.type()!==U.FRAME&&t.push(r.addEventListener(ri.PrimaryPageChanged,this.primaryPageChanged,this));const s=e.model(Jr);s&&(t.push(s.addEventListener($r.ExceptionThrown,this.exceptionThrown.bind(this,s))),t.push(s.addEventListener($r.ExceptionRevoked,this.exceptionRevoked.bind(this,s))),t.push(s.addEventListener($r.ConsoleAPICalled,this.consoleAPICalled.bind(this,s))),e.parentTarget()?.type()!==U.FRAME&&t.push(s.debuggerModel().addEventListener(ys.GlobalObjectCleared,this.clearIfNecessary,this)),t.push(s.addEventListener($r.QueryObjectRequested,this.queryObjectRequested.bind(this,s)))),this.#tc.set(e,t)}targetRemoved(t){const n=t.model(Jr);n&&this.#Xd.delete(n),e.EventTarget.removeEventListeners(this.#tc.get(t)||[])}async evaluateCommandInConsole(t,n,r,s){const i=await t.evaluate({expression:r,objectGroup:"console",includeCommandLineAPI:s,silent:!1,returnByValue:!1,generatePreview:!0,replMode:!0,allowUnsafeEvalBlockedByCSP:!1},e.Settings.Settings.instance().moduleSetting("console-user-activation-eval").get(),!1);a.userMetrics.actionTaken(a.UserMetrics.Action.ConsoleEvaluated),"error"in i||(await e.Console.Console.instance().showPromise(),this.dispatchEventToListeners(Ko.CommandEvaluated,{result:i.object,commandMessage:n,exceptionDetails:i.exceptionDetails}))}addCommandMessage(e,t){const n=new $o(e.runtimeModel,"javascript",null,t,{type:Do.Command});return n.setExecutionContextId(e.id),this.addMessage(n),n}addMessage(t){t.setPageLoadSequenceNumber(this.#ec),t.source===e.Console.FrontendMessageSource.ConsoleAPI&&"clear"===t.type&&this.clearIfNecessary(),this.#Qd.push(t),this.#$d.set(t.timestamp,t);const n=t.runtimeModel(),r=t.getExceptionId();if(r&&n){let e=this.#Xd.get(n);e||(e=new Map,this.#Xd.set(n,e)),e.set(r,t)}this.incrementErrorWarningCount(t),this.dispatchEventToListeners(Ko.MessageAdded,t)}exceptionThrown(e,t){const n=t.data,r=function(e){if(!e)return;return{requestId:e.requestId||void 0,issueId:e.issueId||void 0}}(n.details.exceptionMetaData),s=$o.fromException(e,n.details,void 0,n.timestamp,void 0,r);s.setExceptionId(n.details.exceptionId),this.addMessage(s)}exceptionRevoked(e,t){const n=t.data,r=this.#Xd.get(e),s=r?r.get(n):null;s&&(this.#Yd--,s.level="verbose",this.dispatchEventToListeners(Ko.MessageUpdated,s))}consoleAPICalled(t,n){const r=n.data;let s="info";"debug"===r.type?s="verbose":"error"===r.type||"assert"===r.type?s="error":"warning"===r.type?s="warning":"info"!==r.type&&"log"!==r.type||(s="info");let i="";r.args.length&&r.args[0].unserializableValue?i=r.args[0].unserializableValue:r.args.length&&("object"!=typeof r.args[0].value&&void 0!==r.args[0].value||null===r.args[0].value)?i=String(r.args[0].value):r.args.length&&r.args[0].description&&(i=r.args[0].description);const o=r.stackTrace?.callFrames.length?r.stackTrace.callFrames[0]:null,a={type:r.type,url:o?.url,line:o?.lineNumber,column:o?.columnNumber,parameters:r.args,stackTrace:r.stackTrace,timestamp:r.timestamp,executionContextId:r.executionContextId,context:r.context},l=new $o(t,e.Console.FrontendMessageSource.ConsoleAPI,s,i,a);for(const e of this.#$d.get(l.timestamp).values())if(l.isEqual(e))return;this.addMessage(l)}queryObjectRequested(t,n){const{objects:r,executionContextId:s}=n.data,i={type:Do.QueryObjectResult,parameters:[r],executionContextId:s},o=new $o(t,e.Console.FrontendMessageSource.ConsoleAPI,"info","",i);this.addMessage(o)}clearIfNecessary(){e.Settings.Settings.instance().moduleSetting("preserve-console-log").get()||this.clear(),++this.#ec}primaryPageChanged(t){if(e.Settings.Settings.instance().moduleSetting("preserve-console-log").get()){const{frame:n}=t.data;n.backForwardCacheDetails.restoredFromCache?e.Console.Console.instance().log(Wo(jo.bfcacheNavigation,{PH1:n.url})):e.Console.Console.instance().log(Wo(jo.navigatedToS,{PH1:n.url}))}}consoleProfileStarted(e,t){const{data:n}=t;this.addConsoleProfileMessage(e,"profile",n.scriptLocation,Wo(jo.profileSStarted,{PH1:n.title}))}consoleProfileFinished(e,t){const{data:n}=t;this.addConsoleProfileMessage(e,"profileEnd",n.scriptLocation,Wo(jo.profileSFinished,{PH1:n.title}))}addConsoleProfileMessage(t,n,r,s){const i=r.script(),o=[{functionName:"",scriptId:r.scriptId,url:i?i.contentURL():"",lineNumber:r.lineNumber,columnNumber:r.columnNumber||0}];this.addMessage(new $o(t.runtimeModel(),e.Console.FrontendMessageSource.ConsoleAPI,"info",s,{type:n,stackTrace:{callFrames:o}}))}incrementErrorWarningCount(e){if("violation"!==e.source)switch(e.level){case"warning":this.#Jd++;break;case"error":this.#Yd++}else this.#Zd++}messages(){return this.#Qd}static allMessagesUnordered(){const e=[];for(const t of W.instance().targets()){const n=t.model(Go)?.messages()||[];e.push(...n)}return e}static requestClearMessages(){for(const e of W.instance().models(qo))e.requestClear();for(const e of W.instance().models(Jr))e.discardConsoleEntries(),e.releaseObjectGroup("live-expression");for(const e of W.instance().targets())e.model(Go)?.clear()}clear(){this.#Qd=[],this.#$d.clear(),this.#Xd.clear(),this.#Yd=0,this.#Jd=0,this.#Zd=0,this.dispatchEventToListeners(Ko.ConsoleCleared)}errors(){return this.#Yd}static allErrors(){let e=0;for(const t of W.instance().targets())e+=t.model(Go)?.errors()||0;return e}warnings(){return this.#Jd}static allWarnings(){let e=0;for(const t of W.instance().targets())e+=t.model(Go)?.warnings()||0;return e}violations(){return this.#Zd}async saveToTempVariable(t,n){if(!n||!t)return void a(null);const r=t,s=await r.globalObject("",!1);if("error"in s||Boolean(s.exceptionDetails)||!s.object)return void a("object"in s&&s.object||null);const i=s.object,o=await i.callFunction((function(e){const t="temp";let n=1;for(;t+n in this;)++n;const r=t+n;return this[r]=e,r}),[Bn.toCallArgument(n)]);if(i.release(),o.wasThrown||!o.object||"string"!==o.object.type)a(o.object||null);else{const e=o.object.value,t=this.addCommandMessage(r,e);this.evaluateCommandInConsole(r,t,e,!1)}function a(t){let n=Wo(jo.failedToSaveToTempVariable);t&&(n=n+" "+t.description),e.Console.Console.instance().error(n)}o.object&&o.object.release()}}var Ko;function Qo(e,t){if(!e!=!t)return!1;if(!e||!t)return!0;const n=e.callFrames,r=t.callFrames;if(n.length!==r.length)return!1;for(let e=0,t=n.length;et.includes(e)));if(-1===n||n===e.length-1)return{callFrame:null,type:null};const r=e[n].url===xs?"LOGPOINT":"CONDITIONAL_BREAKPOINT";return{callFrame:e[n+1],type:r}}}h.register(Go,{capabilities:4,autostart:!0});const Xo=new Map([["xml","xml"],["javascript","javascript"],["network","network"],[e.Console.FrontendMessageSource.ConsoleAPI,"console-api"],["storage","storage"],["appcache","appcache"],["rendering","rendering"],[e.Console.FrontendMessageSource.CSS,"css"],["security","security"],["deprecation","deprecation"],["worker","worker"],["violation","violation"],["intervention","intervention"],["recommendation","recommendation"],["other","other"],[e.Console.FrontendMessageSource.ISSUE_PANEL,"issue-panel"]]);var Jo=Object.freeze({__proto__:null,ConsoleMessage:$o,ConsoleModel:Go,get Events(){return Ko},get FrontendMessageType(){return Do},MessageSourceDisplayName:Xo});class Yo extends h{#lc;#dc;#lt;#cc;#hc;#uc;#gc;#pc;#mc;#fc;#bc;constructor(t){super(t),this.#lc=t.emulationAgent(),this.#dc=t.deviceOrientationAgent(),this.#lt=t.model(Br),this.#cc=t.model(Fs),this.#cc&&this.#cc.addEventListener("InspectModeWillBeToggled",(()=>{this.updateTouch()}),this);const n=e.Settings.Settings.instance().moduleSetting("java-script-disabled");n.addChangeListener((async()=>await this.#lc.invoke_setScriptExecutionDisabled({value:n.get()}))),n.get()&&this.#lc.invoke_setScriptExecutionDisabled({value:!0});const r=e.Settings.Settings.instance().moduleSetting("emulation.touch");r.addChangeListener((()=>{const e=r.get();this.overrideEmulateTouch("force"===e)}));const s=e.Settings.Settings.instance().moduleSetting("emulation.idle-detection");s.addChangeListener((async()=>{const e=s.get();if("none"===e)return void await this.clearIdleOverride();const t=JSON.parse(e);await this.setIdleOverride(t)}));const i=e.Settings.Settings.instance().moduleSetting("emulation.cpu-pressure");i.addChangeListener((async()=>{const e=i.get();if("none"===e)return await this.setPressureSourceOverrideEnabled(!1),void(this.#uc=!1);this.#uc||(this.#uc=!0,await this.setPressureSourceOverrideEnabled(!0)),await this.setPressureStateOverride(e)}));const o=e.Settings.Settings.instance().moduleSetting("emulated-css-media"),a=e.Settings.Settings.instance().moduleSetting("emulated-css-media-feature-color-gamut"),l=e.Settings.Settings.instance().moduleSetting("emulated-css-media-feature-prefers-color-scheme"),d=e.Settings.Settings.instance().moduleSetting("emulated-css-media-feature-forced-colors"),c=e.Settings.Settings.instance().moduleSetting("emulated-css-media-feature-prefers-contrast"),h=e.Settings.Settings.instance().moduleSetting("emulated-css-media-feature-prefers-reduced-data"),u=e.Settings.Settings.instance().moduleSetting("emulated-css-media-feature-prefers-reduced-transparency"),g=e.Settings.Settings.instance().moduleSetting("emulated-css-media-feature-prefers-reduced-motion");this.#hc=new Map([["type",o.get()],["color-gamut",a.get()],["prefers-color-scheme",l.get()],["forced-colors",d.get()],["prefers-contrast",c.get()],["prefers-reduced-data",h.get()],["prefers-reduced-motion",g.get()],["prefers-reduced-transparency",u.get()]]),o.addChangeListener((()=>{this.#hc.set("type",o.get()),this.updateCssMedia()})),a.addChangeListener((()=>{this.#hc.set("color-gamut",a.get()),this.updateCssMedia()})),l.addChangeListener((()=>{this.#hc.set("prefers-color-scheme",l.get()),this.updateCssMedia()})),d.addChangeListener((()=>{this.#hc.set("forced-colors",d.get()),this.updateCssMedia()})),c.addChangeListener((()=>{this.#hc.set("prefers-contrast",c.get()),this.updateCssMedia()})),h.addChangeListener((()=>{this.#hc.set("prefers-reduced-data",h.get()),this.updateCssMedia()})),g.addChangeListener((()=>{this.#hc.set("prefers-reduced-motion",g.get()),this.updateCssMedia()})),u.addChangeListener((()=>{this.#hc.set("prefers-reduced-transparency",u.get()),this.updateCssMedia()})),this.updateCssMedia();const p=e.Settings.Settings.instance().moduleSetting("emulate-auto-dark-mode");p.addChangeListener((()=>{const e=p.get();l.setDisabled(e),l.set(e?"dark":""),this.emulateAutoDarkMode(e)})),p.get()&&(l.setDisabled(!0),l.set("dark"),this.emulateAutoDarkMode(!0));const m=e.Settings.Settings.instance().moduleSetting("emulated-vision-deficiency");m.addChangeListener((()=>this.emulateVisionDeficiency(m.get()))),m.get()&&this.emulateVisionDeficiency(m.get());const f=e.Settings.Settings.instance().moduleSetting("local-fonts-disabled");f.addChangeListener((()=>this.setLocalFontsDisabled(f.get()))),f.get()&&this.setLocalFontsDisabled(f.get());const b=e.Settings.Settings.instance().moduleSetting("avif-format-disabled"),y=e.Settings.Settings.instance().moduleSetting("webp-format-disabled"),v=()=>{const e=[];b.get()&&e.push("avif"),y.get()&&e.push("webp"),this.setDisabledImageTypes(e)};b.addChangeListener(v),y.addChangeListener(v),(b.get()||y.get())&&v(),this.#uc=!1,this.#mc=!0,this.#gc=!1,this.#pc=!1,this.#fc=!1,this.#bc={enabled:!1,configuration:"mobile"}}setTouchEmulationAllowed(e){this.#mc=e}supportsDeviceEmulation(){return this.target().hasAllCapabilities(4096)}async resetPageScaleFactor(){await this.#lc.invoke_resetPageScaleFactor()}async emulateDevice(e){e?await this.#lc.invoke_setDeviceMetricsOverride(e):await this.#lc.invoke_clearDeviceMetricsOverride()}overlayModel(){return this.#cc}async setPressureSourceOverrideEnabled(e){await this.#lc.invoke_setPressureSourceOverrideEnabled({source:"cpu",enabled:e})}async setPressureStateOverride(e){await this.#lc.invoke_setPressureStateOverride({source:"cpu",state:e})}async emulateLocation(e){if(e)if(e.unavailable)await Promise.all([this.#lc.invoke_setGeolocationOverride({}),this.#lc.invoke_setTimezoneOverride({timezoneId:""}),this.#lc.invoke_setLocaleOverride({locale:""}),this.#lc.invoke_setUserAgentOverride({userAgent:ce.instance().currentUserAgent()})]);else{function t(e,t){const n=t.getError();return n?Promise.reject({type:e,message:n}):Promise.resolve()}await Promise.all([this.#lc.invoke_setGeolocationOverride({latitude:e.latitude,longitude:e.longitude,accuracy:Zo.defaultGeoMockAccuracy}).then((e=>t("emulation-set-location",e))),this.#lc.invoke_setTimezoneOverride({timezoneId:e.timezoneId}).then((e=>t("emulation-set-timezone",e))),this.#lc.invoke_setLocaleOverride({locale:e.locale}).then((e=>t("emulation-set-locale",e))),this.#lc.invoke_setUserAgentOverride({userAgent:ce.instance().currentUserAgent(),acceptLanguage:e.locale}).then((e=>t("emulation-set-user-agent",e)))])}else await Promise.all([this.#lc.invoke_clearGeolocationOverride(),this.#lc.invoke_setTimezoneOverride({timezoneId:""}),this.#lc.invoke_setLocaleOverride({locale:""}),this.#lc.invoke_setUserAgentOverride({userAgent:ce.instance().currentUserAgent()})])}async emulateDeviceOrientation(e){e?await this.#dc.invoke_setDeviceOrientationOverride({alpha:e.alpha,beta:e.beta,gamma:e.gamma}):await this.#dc.invoke_clearDeviceOrientationOverride()}async setIdleOverride(e){await this.#lc.invoke_setIdleOverride(e)}async clearIdleOverride(){await this.#lc.invoke_clearIdleOverride()}async emulateCSSMedia(e,t){await this.#lc.invoke_setEmulatedMedia({media:e,features:t}),this.#lt&&this.#lt.mediaQueryResultChanged()}async emulateAutoDarkMode(e){e&&(this.#hc.set("prefers-color-scheme","dark"),await this.updateCssMedia()),await this.#lc.invoke_setAutoDarkModeOverride({enabled:e||void 0})}async emulateVisionDeficiency(e){await this.#lc.invoke_setEmulatedVisionDeficiency({type:e})}setLocalFontsDisabled(e){this.#lt&&this.#lt.setLocalFontsEnabled(!e)}setDisabledImageTypes(e){this.#lc.invoke_setDisabledImageTypes({imageTypes:e})}async setCPUThrottlingRate(e){await this.#lc.invoke_setCPUThrottlingRate({rate:e})}async setHardwareConcurrency(e){if(e<1)throw new Error("hardwareConcurrency must be a positive value");await this.#lc.invoke_setHardwareConcurrencyOverride({hardwareConcurrency:e})}async emulateTouch(e,t){this.#gc=e&&this.#mc,this.#pc=t&&this.#mc,await this.updateTouch()}async overrideEmulateTouch(e){this.#fc=e&&this.#mc,await this.updateTouch()}async updateTouch(){let e={enabled:this.#gc,configuration:this.#pc?"mobile":"desktop"};this.#fc&&(e={enabled:!0,configuration:"mobile"}),this.#cc&&this.#cc.inspectModeEnabled()&&(e={enabled:!1,configuration:"mobile"}),(this.#bc.enabled||e.enabled)&&(this.#bc.enabled&&e.enabled&&this.#bc.configuration===e.configuration||(this.#bc=e,await this.#lc.invoke_setTouchEmulationEnabled({enabled:e.enabled,maxTouchPoints:1}),await this.#lc.invoke_setEmitTouchEventsForMouse({enabled:e.enabled,configuration:e.configuration})))}async updateCssMedia(){const e=this.#hc.get("type")??"",t=[{name:"color-gamut",value:this.#hc.get("color-gamut")??""},{name:"prefers-color-scheme",value:this.#hc.get("prefers-color-scheme")??""},{name:"forced-colors",value:this.#hc.get("forced-colors")??""},{name:"prefers-contrast",value:this.#hc.get("prefers-contrast")??""},{name:"prefers-reduced-data",value:this.#hc.get("prefers-reduced-data")??""},{name:"prefers-reduced-motion",value:this.#hc.get("prefers-reduced-motion")??""},{name:"prefers-reduced-transparency",value:this.#hc.get("prefers-reduced-transparency")??""}];return await this.emulateCSSMedia(e,t)}}class Zo{latitude;longitude;timezoneId;locale;unavailable;constructor(e,t,n,r,s){this.latitude=e,this.longitude=t,this.timezoneId=n,this.locale=r,this.unavailable=s}static parseSetting(e){if(e){const[t,n,r,s]=e.split(":"),[i,o]=t.split("@");return new Zo(parseFloat(i),parseFloat(o),n,r,Boolean(s))}return new Zo(0,0,"","",!1)}static parseUserInput(e,t,n,r){if(!e&&!t)return null;const{valid:s}=Zo.latitudeValidator(e),{valid:i}=Zo.longitudeValidator(t);if(!s&&!i)return null;const o=s?parseFloat(e):-1,a=i?parseFloat(t):-1;return new Zo(o,a,n,r,!1)}static latitudeValidator(e){const t=parseFloat(e);return{valid:/^([+-]?[\d]+(\.\d+)?|[+-]?\.\d+)$/.test(e)&&t>=-90&&t<=90,errorMessage:void 0}}static longitudeValidator(e){const t=parseFloat(e);return{valid:/^([+-]?[\d]+(\.\d+)?|[+-]?\.\d+)$/.test(e)&&t>=-180&&t<=180,errorMessage:void 0}}static timezoneIdValidator(e){return{valid:""===e||/[a-zA-Z]/.test(e),errorMessage:void 0}}static localeValidator(e){return{valid:""===e||/[a-zA-Z]{2}/.test(e),errorMessage:void 0}}toSetting(){return`${this.latitude}@${this.longitude}:${this.timezoneId}:${this.locale}:${this.unavailable||""}`}static defaultGeoMockAccuracy=150}class ea{alpha;beta;gamma;constructor(e,t,n){this.alpha=e,this.beta=t,this.gamma=n}static parseSetting(e){if(e){const t=JSON.parse(e);return new ea(t.alpha,t.beta,t.gamma)}return new ea(0,0,0)}static parseUserInput(e,t,n){if(!e&&!t&&!n)return null;const{valid:r}=ea.alphaAngleValidator(e),{valid:s}=ea.betaAngleValidator(t),{valid:i}=ea.gammaAngleValidator(n);if(!r&&!s&&!i)return null;const o=r?parseFloat(e):-1,a=s?parseFloat(t):-1,l=i?parseFloat(n):-1;return new ea(o,a,l)}static angleRangeValidator(e,t){const n=parseFloat(e);return{valid:/^([+-]?[\d]+(\.\d+)?|[+-]?\.\d+)$/.test(e)&&n>=t.minimum&&n{this.#wc=n=>{e(n),t(n)}})):await new Promise((e=>{this.#wc=e}));const n=await e.runtimeAgent().invoke_evaluate({expression:"navigator.hardwareConcurrency",returnByValue:!0,silent:!0,throwOnSideEffect:!0}),r=n.getError();if(r)throw new Error(r);const{result:s,exceptionDetails:i}=n;if(i)throw new Error(i.text);return s.value}modelAdded(e){if(this.#yc!==ca&&e.setCPUThrottlingRate(this.#yc.rate()),void 0!==this.#Ic&&e.setHardwareConcurrency(this.#Ic),this.#wc){const e=this.#wc;this.#wc=void 0,this.getHardwareConcurrency().then(e)}}modelRemoved(e){}}var la;function da(e){return{title:1===e?ia(na.noThrottling):ia(na.dSlowdown,{PH1:e}),rate:()=>e,jslogContext:1===e?"cpu-no-throttling":`cpu-throttled-${e}`}}!function(e){e[e.NO_THROTTLING=1]="NO_THROTTLING",e[e.MID_TIER_MOBILE=4]="MID_TIER_MOBILE",e[e.LOW_TIER_MOBILE=6]="LOW_TIER_MOBILE",e[e.EXTRA_SLOW=20]="EXTRA_SLOW",e[e.MidTierMobile=4]="MidTierMobile",e[e.LowEndMobile=6]="LowEndMobile"}(la||(la={}));const ca=da(la.NO_THROTTLING),ha=da(la.MID_TIER_MOBILE),ua=da(la.LOW_TIER_MOBILE),ga=da(la.EXTRA_SLOW);function pa(t){const n=()=>{const n=e.Settings.Settings.instance().createSetting("calibrated-cpu-throttling",{},"Global").get();return"low-tier-mobile"===t?n.low??null:"mid-tier-mobile"===t?n.mid??null:null};return{title(){const e=sa("low-tier-mobile"===t?na.calibratedLowTierMobile:na.calibratedMidTierMobile),r=n();return"number"==typeof r?`${e} – ${r.toFixed(1)}×`:e},rate(){const e=n();return"number"==typeof e?e:0},calibratedDeviceType:t,jslogContext:`cpu-throttled-calibrated-${t}`}}const ma=pa("low-tier-mobile"),fa=pa("mid-tier-mobile");var ba;!function(e){e.DEVICE_TOO_WEAK="DEVICE_TOO_WEAK"}(ba||(ba={}));var ya=Object.freeze({__proto__:null,CPUThrottlingManager:aa,get CPUThrottlingRates(){return la},CalibratedLowTierMobileThrottlingOption:ma,CalibratedMidTierMobileThrottlingOption:fa,get CalibrationError(){return ba},ExtraSlowThrottlingOption:ga,LowTierThrottlingOption:ua,MidTierThrottlingOption:ha,NoThrottlingOption:ca,calibrationErrorToString:function(e){return e===ba.DEVICE_TOO_WEAK?sa(na.calibrationErrorDeviceTooWeak):e},throttlingManager:function(){return aa.instance()}});class va extends h{agent;#Ir;#er;#kc;#Cc;suspended=!1;constructor(t){super(t),this.agent=t.domdebuggerAgent(),this.#Ir=t.model(Jr),this.#er=t.model(Gs),this.#er.addEventListener(Us.DocumentUpdated,this.documentUpdated,this),this.#er.addEventListener(Us.NodeRemoved,this.nodeRemoved,this),this.#kc=[],this.#Cc=e.Settings.Settings.instance().createLocalSetting("dom-breakpoints",[]),this.#er.existingDocument()&&this.documentUpdated()}runtimeModel(){return this.#Ir}async suspendModel(){this.suspended=!0}async resumeModel(){this.suspended=!1}async eventListeners(e){if(console.assert(e.runtimeModel()===this.#Ir),!e.objectId)return[];const t=await this.agent.invoke_getEventListeners({objectId:e.objectId}),n=[];for(const r of t.listeners||[]){const t=this.#Ir.debuggerModel().createRawLocationByScriptId(r.scriptId,r.lineNumber,r.columnNumber);t&&n.push(new Sa(this,e,r.type,r.useCapture,r.passive,r.once,r.handler?this.#Ir.createRemoteObject(r.handler):null,r.originalHandler?this.#Ir.createRemoteObject(r.originalHandler):null,t,null))}return n}retrieveDOMBreakpoints(){this.#er.requestDocument()}domBreakpoints(){return this.#kc.slice()}hasDOMBreakpoint(e,t){return this.#kc.some((n=>n.node===e&&n.type===t))}setDOMBreakpoint(e,t){for(const n of this.#kc)if(n.node===e&&n.type===t)return this.toggleDOMBreakpoint(n,!0),n;const n=new wa(this,e,t,!0);return this.#kc.push(n),this.saveDOMBreakpoints(),this.enableDOMBreakpoint(n),this.dispatchEventToListeners("DOMBreakpointAdded",n),n}removeDOMBreakpoint(e,t){this.removeDOMBreakpoints((n=>n.node===e&&n.type===t))}removeAllDOMBreakpoints(){this.removeDOMBreakpoints((e=>!0))}toggleDOMBreakpoint(e,t){t!==e.enabled&&(e.enabled=t,t?this.enableDOMBreakpoint(e):this.disableDOMBreakpoint(e),this.dispatchEventToListeners("DOMBreakpointToggled",e))}enableDOMBreakpoint(e){e.node.id&&(this.agent.invoke_setDOMBreakpoint({nodeId:e.node.id,type:e.type}),e.node.setMarker(Ia,!0))}disableDOMBreakpoint(e){e.node.id&&(this.agent.invoke_removeDOMBreakpoint({nodeId:e.node.id,type:e.type}),e.node.setMarker(Ia,!!this.nodeHasBreakpoints(e.node)||null))}nodeHasBreakpoints(e){for(const t of this.#kc)if(t.node===e&&t.enabled)return!0;return!1}resolveDOMBreakpointData(e){const t=e.type,n=this.#er.nodeForId(e.nodeId);if(!t||!n)return null;let r=null,s=!1;return"subtree-modified"===t&&(s=e.insertion||!1,r=this.#er.nodeForId(e.targetNodeId)),{type:t,node:n,targetNode:r,insertion:s}}currentURL(){const e=this.#er.existingDocument();return e?e.documentURL:r.DevToolsPath.EmptyUrlString}async documentUpdated(){if(this.suspended)return;const e=this.#kc;this.#kc=[],this.dispatchEventToListeners("DOMBreakpointsRemoved",e);const t=await this.#er.requestDocument(),n=t?t.documentURL:r.DevToolsPath.EmptyUrlString;for(const e of this.#Cc.get())e.url===n&&this.#er.pushNodeByPathToFrontend(e.path).then(s.bind(this,e));function s(e,t){const n=t?this.#er.nodeForId(t):null;if(!n)return;const r=new wa(this,n,e.type,e.enabled);this.#kc.push(r),e.enabled&&this.enableDOMBreakpoint(r),this.dispatchEventToListeners("DOMBreakpointAdded",r)}}removeDOMBreakpoints(e){const t=[],n=[];for(const r of this.#kc)e(r)?(t.push(r),r.enabled&&(r.enabled=!1,this.disableDOMBreakpoint(r))):n.push(r);t.length&&(this.#kc=n,this.saveDOMBreakpoints(),this.dispatchEventToListeners("DOMBreakpointsRemoved",t))}nodeRemoved(e){if(this.suspended)return;const{node:t}=e.data,n=t.children()||[];this.removeDOMBreakpoints((e=>e.node===t||-1!==n.indexOf(e.node)))}saveDOMBreakpoints(){const e=this.currentURL(),t=this.#Cc.get().filter((t=>t.url!==e));for(const n of this.#kc)t.push({url:e,path:n.node.path(),type:n.type,enabled:n.enabled});this.#Cc.set(t)}}const Ia="breakpoint-marker";class wa{domDebuggerModel;node;type;enabled;constructor(e,t,n,r){this.domDebuggerModel=e,this.node=t,this.type=n,this.enabled=r}}class Sa{#xc;#Rc;#g;#Tc;#Mc;#Pc;#Ec;#Lc;#Jr;#Ac;#Oc;#Dc;constructor(e,t,n,s,i,o,a,l,d,c,h){this.#xc=e,this.#Rc=t,this.#g=n,this.#Tc=s,this.#Mc=i,this.#Pc=o,this.#Ec=a,this.#Lc=l||a,this.#Jr=d;const u=d.script();this.#Ac=u?u.contentURL():r.DevToolsPath.EmptyUrlString,this.#Oc=c,this.#Dc=h||"Raw"}domDebuggerModel(){return this.#xc}type(){return this.#g}useCapture(){return this.#Tc}passive(){return this.#Mc}once(){return this.#Pc}handler(){return this.#Ec}location(){return this.#Jr}sourceURL(){return this.#Ac}originalHandler(){return this.#Lc}canRemove(){return Boolean(this.#Oc)||"FrameworkUser"!==this.#Dc}remove(){if(!this.canRemove())return Promise.resolve(void 0);if("FrameworkUser"!==this.#Dc){function e(e,t,n){this.removeEventListener(e,t,n),this["on"+e]&&(this["on"+e]=void 0)}return this.#Rc.callFunction(e,[Bn.toCallArgument(this.#g),Bn.toCallArgument(this.#Lc),Bn.toCallArgument(this.#Tc)]).then((()=>{}))}if(this.#Oc){function t(e,t,n,r){this.call(null,e,t,n,r)}return this.#Oc.callFunction(t,[Bn.toCallArgument(this.#g),Bn.toCallArgument(this.#Lc),Bn.toCallArgument(this.#Tc),Bn.toCallArgument(this.#Mc)]).then((()=>{}))}return Promise.resolve(void 0)}canTogglePassive(){return"FrameworkUser"!==this.#Dc}togglePassive(){return this.#Rc.callFunction((function(e,t,n,r){this.removeEventListener(e,t,{capture:n}),this.addEventListener(e,t,{capture:n,passive:!r})}),[Bn.toCallArgument(this.#g),Bn.toCallArgument(this.#Lc),Bn.toCallArgument(this.#Tc),Bn.toCallArgument(this.#Mc)]).then((()=>{}))}origin(){return this.#Dc}markAsFramework(){this.#Dc="Framework"}isScrollBlockingType(){return"touchstart"===this.#g||"touchmove"===this.#g||"mousewheel"===this.#g||"wheel"===this.#g}}class ka extends ro{#g;constructor(e,t){super(e,t),this.#g=t}type(){return this.#g}}class Ca extends ro{eventTargetNames;constructor(e,t,n){super(n,e),this.eventTargetNames=t}setEnabled(e){if(this.enabled()!==e){super.setEnabled(e);for(const e of W.instance().models(va))this.updateOnModel(e)}}updateOnModel(e){for(const t of this.eventTargetNames)this.enabled()?e.agent.invoke_setEventListenerBreakpoint({eventName:this.name,targetName:t}):e.agent.invoke_removeEventListenerBreakpoint({eventName:this.name,targetName:t})}static listener="listener:"}let xa;class Ra{#Nc;#Fc=new Map;#Bc=[];#_c=[];constructor(){this.#Nc=e.Settings.Settings.instance().createLocalSetting("xhr-breakpoints",[]);for(const e of this.#Nc.get())this.#Fc.set(e.url,e.enabled);this.#Bc.push(new ka("trusted-type-violation","trustedtype-sink-violation")),this.#Bc.push(new ka("trusted-type-violation","trustedtype-policy-violation")),this.createEventListenerBreakpoints("media",["play","pause","playing","canplay","canplaythrough","seeking","seeked","timeupdate","ended","ratechange","durationchange","volumechange","loadstart","progress","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","waiting"],["audio","video"]),this.createEventListenerBreakpoints("picture-in-picture",["enterpictureinpicture","leavepictureinpicture"],["video"]),this.createEventListenerBreakpoints("picture-in-picture",["resize"],["PictureInPictureWindow"]),this.createEventListenerBreakpoints("picture-in-picture",["enter"],["documentPictureInPicture"]),this.createEventListenerBreakpoints("clipboard",["copy","cut","paste","beforecopy","beforecut","beforepaste"],["*"]),this.createEventListenerBreakpoints("control",["resize","scroll","scrollend","scrollsnapchange","scrollsnapchanging","zoom","focus","blur","select","change","submit","reset"],["*"]),this.createEventListenerBreakpoints("device",["deviceorientation","devicemotion"],["*"]),this.createEventListenerBreakpoints("dom-mutation",["DOMActivate","DOMFocusIn","DOMFocusOut","DOMAttrModified","DOMCharacterDataModified","DOMNodeInserted","DOMNodeInsertedIntoDocument","DOMNodeRemoved","DOMNodeRemovedFromDocument","DOMSubtreeModified","DOMContentLoaded"],["*"]),this.createEventListenerBreakpoints("drag-drop",["drag","dragstart","dragend","dragenter","dragover","dragleave","drop"],["*"]),this.createEventListenerBreakpoints("keyboard",["keydown","keyup","keypress","input"],["*"]),this.createEventListenerBreakpoints("load",["load","beforeunload","unload","abort","error","hashchange","popstate","navigate","navigatesuccess","navigateerror","currentchange","navigateto","navigatefrom","finish","dispose"],["*"]),this.createEventListenerBreakpoints("mouse",["auxclick","click","dblclick","mousedown","mouseup","mouseover","mousemove","mouseout","mouseenter","mouseleave","mousewheel","wheel","contextmenu"],["*"]),this.createEventListenerBreakpoints("pointer",["pointerover","pointerout","pointerenter","pointerleave","pointerdown","pointerup","pointermove","pointercancel","gotpointercapture","lostpointercapture","pointerrawupdate"],["*"]),this.createEventListenerBreakpoints("touch",["touchstart","touchmove","touchend","touchcancel"],["*"]),this.createEventListenerBreakpoints("worker",["message","messageerror"],["*"]),this.createEventListenerBreakpoints("xhr",["readystatechange","load","loadstart","loadend","abort","error","progress","timeout"],["xmlhttprequest","xmlhttprequestupload"]),W.instance().observeModels(va,this)}static instance(e={forceNew:null}){const{forceNew:t}=e;return xa&&!t||(xa=new Ra),xa}cspViolationBreakpoints(){return this.#Bc.slice()}createEventListenerBreakpoints(e,t,n){for(const r of t)this.#_c.push(new Ca(r,n,e))}resolveEventListenerBreakpoint({eventName:e,targetName:t}){const n="listener:";if(!e.startsWith(n))return null;e=e.substring(9),t=(t||"*").toLowerCase();let r=null;for(const n of this.#_c)e&&n.name===e&&-1!==n.eventTargetNames.indexOf(t)&&(r=n),!r&&e&&n.name===e&&-1!==n.eventTargetNames.indexOf("*")&&(r=n);return r}eventListenerBreakpoints(){return this.#_c.slice()}updateCSPViolationBreakpoints(){const e=this.#Bc.filter((e=>e.enabled())).map((e=>e.type()));for(const t of W.instance().models(va))this.updateCSPViolationBreakpointsForModel(t,e)}updateCSPViolationBreakpointsForModel(e,t){e.agent.invoke_setBreakOnCSPViolation({violationTypes:t})}xhrBreakpoints(){return this.#Fc}saveXHRBreakpoints(){const e=[];for(const t of this.#Fc.keys())e.push({url:t,enabled:this.#Fc.get(t)||!1});this.#Nc.set(e)}addXHRBreakpoint(e,t){if(this.#Fc.set(e,t),t)for(const t of W.instance().models(va))t.agent.invoke_setXHRBreakpoint({url:e});this.saveXHRBreakpoints()}removeXHRBreakpoint(e){const t=this.#Fc.get(e);if(this.#Fc.delete(e),t)for(const t of W.instance().models(va))t.agent.invoke_removeXHRBreakpoint({url:e});this.saveXHRBreakpoints()}toggleXHRBreakpoint(e,t){this.#Fc.set(e,t);for(const n of W.instance().models(va))t?n.agent.invoke_setXHRBreakpoint({url:e}):n.agent.invoke_removeXHRBreakpoint({url:e});this.saveXHRBreakpoints()}modelAdded(e){for(const t of this.#Fc.keys())this.#Fc.get(t)&&e.agent.invoke_setXHRBreakpoint({url:t});for(const t of this.#_c)t.enabled()&&t.updateOnModel(e);const t=this.#Bc.filter((e=>e.enabled())).map((e=>e.type()));this.updateCSPViolationBreakpointsForModel(e,t)}modelRemoved(e){}}h.register(va,{capabilities:2,autostart:!1});var Ta=Object.freeze({__proto__:null,CSPViolationBreakpoint:ka,DOMBreakpoint:wa,DOMDebuggerManager:Ra,DOMDebuggerModel:va,DOMEventListenerBreakpoint:Ca,EventListener:Sa});class Ma extends h{agent;constructor(e){super(e),this.agent=e.eventBreakpointsAgent()}}class Pa extends ro{setEnabled(e){if(this.enabled()!==e){super.setEnabled(e);for(const e of W.instance().models(Ma))this.updateOnModel(e)}}updateOnModel(e){this.enabled()?e.agent.invoke_setInstrumentationBreakpoint({eventName:this.name}):e.agent.invoke_removeInstrumentationBreakpoint({eventName:this.name})}static instrumentationPrefix="instrumentation:"}let Ea;class La{#_c=[];constructor(){this.createInstrumentationBreakpoints("auction-worklet",["beforeBidderWorkletBiddingStart","beforeBidderWorkletReportingStart","beforeSellerWorkletScoringStart","beforeSellerWorkletReportingStart"]),this.createInstrumentationBreakpoints("animation",["requestAnimationFrame","cancelAnimationFrame","requestAnimationFrame.callback"]),this.createInstrumentationBreakpoints("canvas",["canvasContextCreated","webglErrorFired","webglWarningFired"]),this.createInstrumentationBreakpoints("geolocation",["Geolocation.getCurrentPosition","Geolocation.watchPosition"]),this.createInstrumentationBreakpoints("notification",["Notification.requestPermission"]),this.createInstrumentationBreakpoints("parse",["Element.setInnerHTML","Document.write"]),this.createInstrumentationBreakpoints("script",["scriptFirstStatement","scriptBlockedByCSP"]),this.createInstrumentationBreakpoints("shared-storage-worklet",["sharedStorageWorkletScriptFirstStatement"]),this.createInstrumentationBreakpoints("timer",["setTimeout","clearTimeout","setTimeout.callback","setInterval","clearInterval","setInterval.callback"]),this.createInstrumentationBreakpoints("window",["DOMWindow.close"]),this.createInstrumentationBreakpoints("web-audio",["audioContextCreated","audioContextClosed","audioContextResumed","audioContextSuspended"]),W.instance().observeModels(Ma,this)}static instance(e={forceNew:null}){const{forceNew:t}=e;return Ea&&!t||(Ea=new La),Ea}createInstrumentationBreakpoints(e,t){for(const n of t)this.#_c.push(new Pa(e,n))}eventListenerBreakpoints(){return this.#_c.slice()}resolveEventListenerBreakpoint({eventName:e}){if(!e.startsWith(Pa.instrumentationPrefix))return null;const t=e.substring(Pa.instrumentationPrefix.length);return this.#_c.find((e=>e.name===t))||null}modelAdded(e){for(const t of this.#_c)t.enabled()&&t.updateOnModel(e)}modelRemoved(e){}}h.register(Ma,{capabilities:524288,autostart:!1});var Aa=Object.freeze({__proto__:null,EventBreakpointsManager:La,EventBreakpointsModel:Ma}),Oa=Object.freeze({__proto__:null});let Da;class Na extends e.ObjectWrapper.ObjectWrapper{#Hc=new Map;#Uc=new Map;#L=new Set;#qc=0;constructor(){super(),W.instance().observeModels(Jr,this)}static instance({forceNew:e}={forceNew:!1}){return Da&&!e||(Da=new Na),Da}observeIsolates(e){if(this.#L.has(e))throw new Error("Observer can only be registered once");this.#L.size||this.poll(),this.#L.add(e);for(const t of this.#Hc.values())e.isolateAdded(t)}modelAdded(e){this.modelAddedInternal(e)}async modelAddedInternal(e){this.#Uc.set(e,null);const t=await e.isolateId();if(!this.#Uc.has(e))return;if(!t)return void this.#Uc.delete(e);this.#Uc.set(e,t);let n=this.#Hc.get(t);if(n||(n=new _a(t),this.#Hc.set(t,n)),n.modelsInternal.add(e),1===n.modelsInternal.size)for(const e of this.#L)e.isolateAdded(n);else for(const e of this.#L)e.isolateChanged(n)}modelRemoved(e){const t=this.#Uc.get(e);if(this.#Uc.delete(e),!t)return;const n=this.#Hc.get(t);if(n)if(n.modelsInternal.delete(e),n.modelsInternal.size)for(const e of this.#L)e.isolateChanged(n);else{for(const e of this.#L)e.isolateRemoved(n);this.#Hc.delete(t)}}isolateByModel(e){return this.#Hc.get(this.#Uc.get(e)||"")||null}isolates(){return this.#Hc.values()}async poll(){const e=this.#qc;for(;e===this.#qc;)await Promise.all(Array.from(this.isolates(),(e=>e.update()))),await new Promise((e=>window.setTimeout(e,Ba)))}}const Fa=12e4,Ba=2e3;class _a{#C;modelsInternal;#zc;#jc;constructor(e){this.#C=e,this.modelsInternal=new Set,this.#zc=0;const t=Fa/Ba;this.#jc=new Ha(t)}id(){return this.#C}models(){return this.modelsInternal}runtimeModel(){return this.modelsInternal.values().next().value||null}heapProfilerModel(){const e=this.runtimeModel();return e?.heapProfilerModel()??null}async update(){const e=this.runtimeModel(),t=e&&await e.heapUsage();t&&(this.#zc=t.usedSize+(t.embedderHeapUsedSize??0)+(t.backingStorageSize??0),this.#jc.add(this.#zc),Na.instance().dispatchEventToListeners("MemoryChanged",this))}samplesCount(){return this.#jc.count()}usedHeapSize(){return this.#zc}usedHeapSizeGrowRate(){return this.#jc.fitSlope()}}class Ha{#Vc;#Wc;#as;#Gc;#Kc;#Qc;#$c;#Xc;#Jc;constructor(e){this.#Vc=0|e,this.reset()}reset(){this.#Wc=Date.now(),this.#as=0,this.#Gc=[],this.#Kc=[],this.#Qc=0,this.#$c=0,this.#Xc=0,this.#Jc=0}count(){return this.#Gc.length}add(e,t){const n="number"==typeof t?t:Date.now()-this.#Wc,r=e;if(this.#Gc.length===this.#Vc){const e=this.#Gc[this.#as],t=this.#Kc[this.#as];this.#Qc-=e,this.#$c-=t,this.#Xc-=e*e,this.#Jc-=e*t}this.#Qc+=n,this.#$c+=r,this.#Xc+=n*n,this.#Jc+=n*r,this.#Gc[this.#as]=n,this.#Kc[this.#as]=r,this.#as=(this.#as+1)%this.#Vc}fitSlope(){const e=this.count();return e<2?0:(this.#Jc-this.#Qc*this.#$c/e)/(this.#Xc-this.#Qc*this.#Qc/e)}}var Ua=Object.freeze({__proto__:null,Isolate:_a,IsolateManager:Na,MemoryTrend:Ha,MemoryTrendWindowMs:Fa});class qa extends h{#Yc=!1;#yr=!1;constructor(e){super(e),this.ensureEnabled()}async ensureEnabled(){if(this.#yr)return;this.#yr=!0,this.target().registerAuditsDispatcher(this);const e=this.target().auditsAgent();await e.invoke_enable()}issueAdded(e){this.dispatchEventToListeners("IssueAdded",{issuesModel:this,inspectorIssue:e.issue})}dispose(){super.dispose(),this.#Yc=!0}getTargetIfNotDisposed(){return this.#Yc?null:this.target()}}h.register(qa,{capabilities:32768,autostart:!0});var za=Object.freeze({__proto__:null,IssuesModel:qa});var ja=Object.freeze({__proto__:null,LayerTreeBase:class{#e;#er;layersById=new Map;#Zc=null;#eh=null;#th=new Map;#nh;constructor(e){this.#e=e,this.#er=e?e.model(Gs):null}target(){return this.#e}root(){return this.#Zc}setRoot(e){this.#Zc=e}contentRoot(){return this.#eh}setContentRoot(e){this.#eh=e}forEachLayer(e,t){return!(!t&&!(t=this.root()))&&(e(t)||t.children().some(this.forEachLayer.bind(this,e)))}layerById(e){return this.layersById.get(e)||null}async resolveBackendNodeIds(e){if(!e.size||!this.#er)return;const t=await this.#er.pushNodesByBackendIdsToFrontend(e);if(t)for(const e of t.keys())this.#th.set(e,t.get(e)||null)}backendNodeIdToNode(){return this.#th}setViewportSize(e){this.#nh=e}viewportSize(){return this.#nh}nodeForId(e){return this.#er?this.#er.nodeForId(e):null}},StickyPositionConstraint:class{#rh;#sh;#ih;#oh;constructor(e,t){this.#rh=t.stickyBoxRect,this.#sh=t.containingBlockRect,this.#ih=null,e&&t.nearestLayerShiftingStickyBox&&(this.#ih=e.layerById(t.nearestLayerShiftingStickyBox)),this.#oh=null,e&&t.nearestLayerShiftingContainingBlock&&(this.#oh=e.layerById(t.nearestLayerShiftingContainingBlock))}stickyBoxRect(){return this.#rh}containingBlockRect(){return this.#sh}nearestLayerShiftingStickyBox(){return this.#ih}nearestLayerShiftingContainingBlock(){return this.#oh}}});class Va{id;url;startTime;loadTime;contentLoadTime;mainRequest;constructor(e){this.id=++Va.lastIdentifier,this.url=e.url(),this.startTime=e.startTime,this.mainRequest=e}static forRequest(e){return Wa.get(e)||null}bindRequest(e){Wa.set(e,this)}static lastIdentifier=0}const Wa=new WeakMap;var Ga=Object.freeze({__proto__:null,PageLoad:Va});class Ka extends h{layerTreeAgent;constructor(e){super(e),this.layerTreeAgent=e.layerTreeAgent()}async loadSnapshotFromFragments(e){const{snapshotId:t}=await this.layerTreeAgent.invoke_loadSnapshot({tiles:e});return t?new Qa(this,t):null}loadSnapshot(e){const t={x:0,y:0,picture:e};return this.loadSnapshotFromFragments([t])}async makeSnapshot(e){const{snapshotId:t}=await this.layerTreeAgent.invoke_makeSnapshot({layerId:e});return t?new Qa(this,t):null}}class Qa{#ah;#Mo;#lh;constructor(e,t){this.#ah=e,this.#Mo=t,this.#lh=1}release(){console.assert(this.#lh>0,"release is already called on the object"),--this.#lh||this.#ah.layerTreeAgent.invoke_releaseSnapshot({snapshotId:this.#Mo})}addReference(){++this.#lh,console.assert(this.#lh>0,"Referencing a dead object")}async replay(e,t,n){return(await this.#ah.layerTreeAgent.invoke_replaySnapshot({snapshotId:this.#Mo,fromStep:t,toStep:n,scale:e||1})).dataURL}async profile(e){return(await this.#ah.layerTreeAgent.invoke_profileSnapshot({snapshotId:this.#Mo,minRepeatCount:5,minDuration:1,clipRect:e||void 0})).timings}async commandLog(){const e=await this.#ah.layerTreeAgent.invoke_snapshotCommandLog({snapshotId:this.#Mo});return e.commandLog?e.commandLog.map(((e,t)=>new $a(e,t))):null}}class $a{method;params;commandIndex;constructor(e,t){this.method=e.method,this.params=e.params,this.commandIndex=t}}h.register(Ka,{capabilities:2,autostart:!1});var Xa=Object.freeze({__proto__:null,PaintProfilerLogItem:$a,PaintProfilerModel:Ka,PaintProfilerSnapshot:Qa});class Ja extends h{#Ks;#dh=new Map([["TaskDuration","CumulativeTime"],["ScriptDuration","CumulativeTime"],["LayoutDuration","CumulativeTime"],["RecalcStyleDuration","CumulativeTime"],["LayoutCount","CumulativeCount"],["RecalcStyleCount","CumulativeCount"]]);#ch=new Map;constructor(e){super(e),this.#Ks=e.performanceAgent()}enable(){return this.#Ks.invoke_enable({})}disable(){return this.#Ks.invoke_disable()}async requestMetrics(){const e=await this.#Ks.invoke_getMetrics()||[],t=new Map,n=performance.now();for(const s of e.metrics){let e,i=this.#ch.get(s.name);switch(i||(i={lastValue:void 0,lastTimestamp:void 0},this.#ch.set(s.name,i)),this.#dh.get(s.name)){case"CumulativeTime":e=i.lastTimestamp&&i.lastValue?r.NumberUtilities.clamp(1e3*(s.value-i.lastValue)/(n-i.lastTimestamp),0,1):0,i.lastValue=s.value,i.lastTimestamp=n;break;case"CumulativeCount":e=i.lastTimestamp&&i.lastValue?Math.max(0,1e3*(s.value-i.lastValue)/(n-i.lastTimestamp)):0,i.lastValue=s.value,i.lastTimestamp=n;break;default:e=s.value}t.set(s.name,e)}return{metrics:t,timestamp:n}}}h.register(Ja,{capabilities:2,autostart:!1});var Ya=Object.freeze({__proto__:null,PerformanceMetricsModel:Ja});class Za extends Map{getOrInsert(e,t){return this.has(e)||this.set(e,t),this.get(e)}getOrInsertComputed(e,t){return this.has(e)||this.set(e,t(e)),this.get(e)}}class el extends h{agent;loaderIds=[];targetJustAttached=!0;lastPrimaryPageModel=null;documents=new Map;constructor(e){super(e),e.registerPreloadDispatcher(new tl(this)),this.agent=e.preloadAgent(),this.agent.invoke_enable();const t=e.targetInfo();void 0!==t&&"prerender"===t.subtype&&(this.lastPrimaryPageModel=W.instance().primaryPageTarget()?.model(el)||null),W.instance().addModelListener(ii,ri.PrimaryPageChanged,this.onPrimaryPageChanged,this)}dispose(){super.dispose(),W.instance().removeModelListener(ii,ri.PrimaryPageChanged,this.onPrimaryPageChanged,this),this.agent.invoke_disable()}ensureDocumentPreloadingData(e){void 0===this.documents.get(e)&&this.documents.set(e,new nl)}currentLoaderId(){if(this.targetJustAttached)return null;if(0===this.loaderIds.length)throw new Error("unreachable");return this.loaderIds[this.loaderIds.length-1]}currentDocument(){const e=this.currentLoaderId();return null===e?null:this.documents.get(e)||null}getRuleSetById(e){return this.currentDocument()?.ruleSets.getById(e)||null}getAllRuleSets(){return this.currentDocument()?.ruleSets.getAll()||[]}getPreloadCountsByRuleSetId(){const e=new Map;for(const{value:t}of this.getRepresentativePreloadingAttempts(null))for(const n of[null,...t.ruleSetIds]){void 0===e.get(n)&&e.set(n,new Map);const r=e.get(n);s(r);const i=r.get(t.status)||0;r.set(t.status,i+1)}return e}getPreloadingAttemptById(e){const t=this.currentDocument();return null===t?null:t.preloadingAttempts.getById(e,t.sources)||null}getRepresentativePreloadingAttempts(e){const t=this.currentDocument();return null===t?[]:t.preloadingAttempts.getAllRepresentative(e,t.sources)}getRepresentativePreloadingAttemptsOfPreviousPage(){if(this.loaderIds.length<=1)return[];const e=this.documents.get(this.loaderIds[this.loaderIds.length-2]);return void 0===e?[]:e.preloadingAttempts.getAllRepresentative(null,e.sources)}getPipelineById(e){const t=this.currentDocument();return null===t?null:t.preloadingAttempts.getPipeline(e,t.sources)}getPipeline(e){let t=null;if(null!==e.pipelineId&&(t=this.getPipelineById(e.pipelineId)),null===t){const t=new Map;return t.set(e.action,e),new ol(t)}return new ol(t)}onPrimaryPageChanged(e){const{frame:t,type:n}=e.data;if(null===this.lastPrimaryPageModel&&"Activation"===n)return;if(null!==this.lastPrimaryPageModel&&"Activation"!==n)return;if(null!==this.lastPrimaryPageModel&&"Activation"===n){this.loaderIds=this.lastPrimaryPageModel.loaderIds;for(const[e,t]of this.lastPrimaryPageModel.documents.entries())this.ensureDocumentPreloadingData(e),this.documents.get(e)?.mergePrevious(t)}this.lastPrimaryPageModel=null;const r=t.loaderId;this.loaderIds.push(r),this.loaderIds=this.loaderIds.slice(-2),this.ensureDocumentPreloadingData(r);for(const e of this.documents.keys())this.loaderIds.includes(e)||this.documents.delete(e);this.dispatchEventToListeners("ModelUpdated")}onRuleSetUpdated(e){const t=e.ruleSet,n=t.loaderId;null===this.currentLoaderId()&&(this.loaderIds=[n],this.targetJustAttached=!1),this.ensureDocumentPreloadingData(n),this.documents.get(n)?.ruleSets.upsert(t),this.dispatchEventToListeners("ModelUpdated")}onRuleSetRemoved(e){const t=e.id;for(const e of this.documents.values())e.ruleSets.delete(t);this.dispatchEventToListeners("ModelUpdated")}onPreloadingAttemptSourcesUpdated(e){const t=e.loaderId;this.ensureDocumentPreloadingData(t);const n=this.documents.get(t);void 0!==n&&(n.sources.update(e.preloadingAttemptSources),n.preloadingAttempts.maybeRegisterNotTriggered(n.sources),n.preloadingAttempts.cleanUpRemovedAttempts(n.sources),this.dispatchEventToListeners("ModelUpdated"))}onPrefetchStatusUpdated(e){if("PrefetchEvictedAfterCandidateRemoved"===e.prefetchStatus)return;const t=e.key.loaderId;this.ensureDocumentPreloadingData(t);const n={action:"Prefetch",key:e.key,pipelineId:e.pipelineId,status:sl(e.status),prefetchStatus:e.prefetchStatus||null,requestId:e.requestId};this.documents.get(t)?.preloadingAttempts.upsert(n),this.dispatchEventToListeners("ModelUpdated")}onPrerenderStatusUpdated(e){const t=e.key.loaderId;this.ensureDocumentPreloadingData(t);const n={action:"Prerender",key:e.key,pipelineId:e.pipelineId,status:sl(e.status),prerenderStatus:e.prerenderStatus||null,disallowedMojoInterface:e.disallowedMojoInterface||null,mismatchedHeaders:e.mismatchedHeaders||null};this.documents.get(t)?.preloadingAttempts.upsert(n),this.dispatchEventToListeners("ModelUpdated")}onPreloadEnabledStateUpdated(e){this.dispatchEventToListeners("WarningsUpdated",e)}}h.register(el,{capabilities:2,autostart:!1});class tl{model;constructor(e){this.model=e}ruleSetUpdated(e){this.model.onRuleSetUpdated(e)}ruleSetRemoved(e){this.model.onRuleSetRemoved(e)}preloadingAttemptSourcesUpdated(e){this.model.onPreloadingAttemptSourcesUpdated(e)}prefetchStatusUpdated(e){this.model.onPrefetchStatusUpdated(e)}prerenderStatusUpdated(e){this.model.onPrerenderStatusUpdated(e)}preloadEnabledStateUpdated(e){this.model.onPreloadEnabledStateUpdated(e)}}class nl{ruleSets=new rl;preloadingAttempts=new al;sources=new ll;mergePrevious(e){if(!this.ruleSets.isEmpty()||!this.sources.isEmpty())throw new Error("unreachable");this.ruleSets=e.ruleSets,this.preloadingAttempts.mergePrevious(e.preloadingAttempts),this.sources=e.sources}}class rl{map=new Map;isEmpty(){return 0===this.map.size}getById(e){return this.map.get(e)||null}getAll(){return Array.from(this.map.entries()).map((([e,t])=>({id:e,value:t})))}upsert(e){this.map.set(e.id,e)}delete(e){this.map.delete(e)}}function sl(e){switch(e){case"Pending":return"Pending";case"Running":return"Running";case"Ready":return"Ready";case"Success":return"Success";case"Failure":return"Failure";case"NotSupported":return"NotSupported"}throw new Error("unreachable")}function il(e){let t,n;switch(e.action){case"Prefetch":t="Prefetch";break;case"Prerender":t="Prerender"}switch(e.targetHint){case void 0:n="undefined";break;case"Blank":n="Blank";break;case"Self":n="Self"}return`${e.loaderId}:${t}:${e.url}:${n}`}class ol{inner;constructor(e){if(0===e.size)throw new Error("unreachable");this.inner=e}static newFromAttemptsForTesting(e){const t=new Map;for(const n of e)t.set(n.action,n);return new ol(t)}getOriginallyTriggered(){const e=this.getPrerender()||this.getPrefetch();return s(e),e}getPrefetch(){return this.inner.get("Prefetch")||null}getPrerender(){return this.inner.get("Prerender")||null}getAttempts(){const e=[],t=this.getPrefetch();null!==t&&e.push(t);const n=this.getPrerender();if(null!==n&&e.push(n),0===e.length)throw new Error("unreachable");return e}}class al{map=new Map;pipelines=new Za;enrich(e,t){let n=[],r=[];return null!==t&&(n=t.ruleSetIds,r=t.nodeIds),{...e,ruleSetIds:n,nodeIds:r}}isAttemptRepresentative(e){function t(e){switch(e){case"Prefetch":return 0;case"Prerender":return 1}}if(null===e.pipelineId)return!0;const n=this.pipelines.get(e.pipelineId);if(s(n),0===n.size)throw new Error("unreachable");return[...n.keys()].every((n=>t(n)<=t(e.action)))}getById(e,t){const n=this.map.get(e)||null;return null===n?null:this.enrich(n,t.getById(e))}getAllRepresentative(e,t){return[...this.map.entries()].map((([e,n])=>({id:e,value:this.enrich(n,t.getById(e))}))).filter((({value:t})=>!e||t.ruleSetIds.includes(e))).filter((({value:e})=>this.isAttemptRepresentative(e)))}getPipeline(e,t){const n=this.pipelines.get(e);if(void 0===n||0===n.size)return null;const r={};for(const[e,t]of this.map.entries())r[e]=t;return new Map(n.entries().map((([e,n])=>{const r=this.getById(n,t);return s(r),[e,r]})))}upsert(e){const t=il(e.key);this.map.set(t,e),null!==e.pipelineId&&this.pipelines.getOrInsertComputed(e.pipelineId,(()=>new Map)).set(e.action,t)}reconstructPipelines(){this.pipelines.clear();for(const[e,t]of this.map.entries()){if(null===t.pipelineId)continue;this.pipelines.getOrInsertComputed(t.pipelineId,(()=>new Map)).set(t.action,e)}}maybeRegisterNotTriggered(e){for(const[t,{key:n}]of e.entries()){if(void 0!==this.map.get(t))continue;let e;switch(n.action){case"Prefetch":e={action:"Prefetch",key:n,pipelineId:null,status:"NotTriggered",prefetchStatus:null,requestId:""};break;case"Prerender":e={action:"Prerender",key:n,pipelineId:null,status:"NotTriggered",prerenderStatus:null,disallowedMojoInterface:null,mismatchedHeaders:null}}this.map.set(t,e)}}cleanUpRemovedAttempts(e){const t=Array.from(this.map.keys()).filter((t=>!e.getById(t)));for(const e of t)this.map.delete(e);this.reconstructPipelines()}mergePrevious(e){for(const[t,n]of this.map.entries())e.map.set(t,n);this.map=e.map,this.reconstructPipelines()}}class ll{map=new Map;entries(){return this.map.entries()}isEmpty(){return 0===this.map.size}getById(e){return this.map.get(e)||null}update(e){this.map=new Map(e.map((e=>[il(e.key),e])))}}var dl=Object.freeze({__proto__:null,PreloadPipeline:ol,PreloadingModel:el});var cl=Object.freeze({__proto__:null,ReactNativeApplicationModel:class extends h{#yr;#Ks;metadataCached=null;constructor(e){super(e),a.rnPerfMetrics.fuseboxSetClientMetadataStarted(),this.#yr=!1,this.#Ks=e.reactNativeApplicationAgent(),e.registerReactNativeApplicationDispatcher(this),this.ensureEnabled()}ensureEnabled(){this.#yr||(this.#Ks.invoke_enable().then((e=>{const t=e.getError(),n=!t;a.rnPerfMetrics.fuseboxSetClientMetadataFinished(n,t)})).catch((e=>{a.rnPerfMetrics.fuseboxSetClientMetadataFinished(!1,e)})),this.#yr=!0)}metadataUpdated(e){this.metadataCached=e,this.dispatchEventToListeners("MetadataUpdated",e)}traceRequested(){this.dispatchEventToListeners("TraceRequested")}}});class hl extends h{enabled=!1;storageAgent;storageKeyManager;bucketsById=new Map;trackedStorageKeys=new Set;constructor(e){super(e),e.registerStorageDispatcher(this),this.storageAgent=e.storageAgent(),this.storageKeyManager=e.model(ni)}getBuckets(){return new Set(this.bucketsById.values())}getBucketsForStorageKey(e){const t=[...this.bucketsById.values()];return new Set(t.filter((({bucket:t})=>t.storageKey===e)))}getDefaultBucketForStorageKey(e){return[...this.bucketsById.values()].find((({bucket:t})=>t.storageKey===e&&void 0===t.name))??null}getBucketById(e){return this.bucketsById.get(e)??null}getBucketByName(e,t){if(!t)return this.getDefaultBucketForStorageKey(e);return[...this.bucketsById.values()].find((({bucket:n})=>n.storageKey===e&&n.name===t))??null}deleteBucket(e){this.storageAgent.invoke_deleteStorageBucket({bucket:e})}enable(){if(!this.enabled){if(this.storageKeyManager){this.storageKeyManager.addEventListener("StorageKeyAdded",this.storageKeyAdded,this),this.storageKeyManager.addEventListener("StorageKeyRemoved",this.storageKeyRemoved,this);for(const e of this.storageKeyManager.storageKeys())this.addStorageKey(e)}this.enabled=!0}}storageKeyAdded(e){this.addStorageKey(e.data)}storageKeyRemoved(e){this.removeStorageKey(e.data)}addStorageKey(e){if(this.trackedStorageKeys.has(e))throw new Error("Can't call addStorageKey for a storage key if it has already been added.");this.trackedStorageKeys.add(e),this.storageAgent.invoke_setStorageBucketTracking({storageKey:e,enable:!0})}removeStorageKey(e){if(!this.trackedStorageKeys.has(e))throw new Error("Can't call removeStorageKey for a storage key if it hasn't already been added.");const t=this.getBucketsForStorageKey(e);for(const e of t)this.bucketRemoved(e);this.trackedStorageKeys.delete(e),this.storageAgent.invoke_setStorageBucketTracking({storageKey:e,enable:!1})}bucketAdded(e){this.bucketsById.set(e.id,e),this.dispatchEventToListeners("BucketAdded",{model:this,bucketInfo:e})}bucketRemoved(e){this.bucketsById.delete(e.id),this.dispatchEventToListeners("BucketRemoved",{model:this,bucketInfo:e})}bucketChanged(e){this.dispatchEventToListeners("BucketChanged",{model:this,bucketInfo:e})}bucketInfosAreEqual(e,t){return e.bucket.storageKey===t.bucket.storageKey&&e.id===t.id&&e.bucket.name===t.bucket.name&&e.expiration===t.expiration&&e.quota===t.quota&&e.persistent===t.persistent&&e.durability===t.durability}storageBucketCreatedOrUpdated({bucketInfo:e}){const t=this.getBucketById(e.id);t?this.bucketInfosAreEqual(t,e)||this.bucketChanged(e):this.bucketAdded(e)}storageBucketDeleted({bucketId:e}){const t=this.getBucketById(e);if(!t)throw new Error(`Received an event that Storage Bucket '${e}' was deleted, but it wasn't in the StorageBucketsModel.`);this.bucketRemoved(t)}attributionReportingTriggerRegistered(e){}interestGroupAccessed(e){}interestGroupAuctionEventOccurred(e){}interestGroupAuctionNetworkRequestCreated(e){}indexedDBListUpdated(e){}indexedDBContentUpdated(e){}cacheStorageListUpdated(e){}cacheStorageContentUpdated(e){}sharedStorageAccessed(e){}attributionReportingSourceRegistered(e){}}h.register(hl,{capabilities:8192,autostart:!1});var ul=Object.freeze({__proto__:null,StorageBucketsModel:hl});const gl={serviceworkercacheagentError:"`ServiceWorkerCacheAgent` error deleting cache entry {PH1} in cache: {PH2}"},pl=n.i18n.registerUIStrings("core/sdk/ServiceWorkerCacheModel.ts",gl),ml=n.i18n.getLocalizedString.bind(void 0,pl);class fl extends h{cacheAgent;#hh;#uh;#gh=new Map;#ph=new Set;#mh=new Set;#fh=new e.Throttler.Throttler(2e3);#yr=!1;#bh=!1;constructor(e){super(e),e.registerStorageDispatcher(this),this.cacheAgent=e.cacheStorageAgent(),this.#hh=e.storageAgent(),this.#uh=e.model(hl)}enable(){if(!this.#yr){this.#uh.addEventListener("BucketAdded",this.storageBucketAdded,this),this.#uh.addEventListener("BucketRemoved",this.storageBucketRemoved,this);for(const e of this.#uh.getBuckets())this.addStorageBucket(e.bucket);this.#yr=!0}}clearForStorageKey(e){for(const[t,n]of this.#gh.entries())n.storageKey===e&&(this.#gh.delete(t),this.cacheRemoved(n));for(const t of this.#uh.getBucketsForStorageKey(e))this.loadCacheNames(t.bucket)}refreshCacheNames(){for(const e of this.#gh.values())this.cacheRemoved(e);this.#gh.clear();const e=this.#uh.getBuckets();for(const t of e)this.loadCacheNames(t.bucket)}async deleteCache(e){const t=await this.cacheAgent.invoke_deleteCache({cacheId:e.cacheId});t.getError()?console.error(`ServiceWorkerCacheAgent error deleting cache ${e.toString()}: ${t.getError()}`):(this.#gh.delete(e.cacheId),this.cacheRemoved(e))}async deleteCacheEntry(t,n){const r=await this.cacheAgent.invoke_deleteEntry({cacheId:t.cacheId,request:n});r.getError()&&e.Console.Console.instance().error(ml(gl.serviceworkercacheagentError,{PH1:t.toString(),PH2:String(r.getError())}))}loadCacheData(e,t,n,r,s){this.requestEntries(e,t,n,r,s)}loadAllCacheData(e,t,n){this.requestAllEntries(e,t,n)}caches(){return[...this.#gh.values()]}dispose(){for(const e of this.#gh.values())this.cacheRemoved(e);this.#gh.clear(),this.#yr&&(this.#uh.removeEventListener("BucketAdded",this.storageBucketAdded,this),this.#uh.removeEventListener("BucketRemoved",this.storageBucketRemoved,this))}addStorageBucket(e){this.loadCacheNames(e),this.#ph.has(e.storageKey)||(this.#ph.add(e.storageKey),this.#hh.invoke_trackCacheStorageForStorageKey({storageKey:e.storageKey}))}removeStorageBucket(e){let t=0;for(const[n,r]of this.#gh.entries())e.storageKey===r.storageKey&&t++,r.inBucket(e)&&(t--,this.#gh.delete(n),this.cacheRemoved(r));0===t&&(this.#ph.delete(e.storageKey),this.#hh.invoke_untrackCacheStorageForStorageKey({storageKey:e.storageKey}))}async loadCacheNames(e){const t=await this.cacheAgent.invoke_requestCacheNames({storageBucket:e});t.getError()||this.updateCacheNames(e,t.caches)}updateCacheNames(e,t){const n=new Set,r=new Map,s=new Map;for(const e of t){const t=e.storageBucket??this.#uh.getDefaultBucketForStorageKey(e.storageKey)?.bucket;if(!t)continue;const s=new bl(this,t,e.cacheName,e.cacheId);n.add(s.cacheId),this.#gh.has(s.cacheId)||(r.set(s.cacheId,s),this.#gh.set(s.cacheId,s))}this.#gh.forEach((function(t){t.inBucket(e)&&!n.has(t.cacheId)&&(s.set(t.cacheId,t),this.#gh.delete(t.cacheId))}),this),r.forEach(this.cacheAdded,this),s.forEach(this.cacheRemoved,this)}storageBucketAdded({data:{bucketInfo:{bucket:e}}}){this.addStorageBucket(e)}storageBucketRemoved({data:{bucketInfo:{bucket:e}}}){this.removeStorageBucket(e)}cacheAdded(e){this.dispatchEventToListeners("CacheAdded",{model:this,cache:e})}cacheRemoved(e){this.dispatchEventToListeners("CacheRemoved",{model:this,cache:e})}async requestEntries(e,t,n,r,s){const i=await this.cacheAgent.invoke_requestEntries({cacheId:e.cacheId,skipCount:t,pageSize:n,pathFilter:r});i.getError()?console.error("ServiceWorkerCacheAgent error while requesting entries: ",i.getError()):s(i.cacheDataEntries,i.returnCount)}async requestAllEntries(e,t,n){const r=await this.cacheAgent.invoke_requestEntries({cacheId:e.cacheId,pathFilter:t});r.getError()?console.error("ServiceWorkerCacheAgent error while requesting entries: ",r.getError()):n(r.cacheDataEntries,r.returnCount)}cacheStorageListUpdated({bucketId:e}){const t=this.#uh.getBucketById(e)?.bucket;t&&(this.#mh.add(t),this.#fh.schedule((()=>{const e=Array.from(this.#mh,(e=>this.loadCacheNames(e)));return this.#mh.clear(),Promise.all(e)}),this.#bh?"AsSoonAsPossible":"Default"))}cacheStorageContentUpdated({bucketId:e,cacheName:t}){const n=this.#uh.getBucketById(e)?.bucket;n&&this.dispatchEventToListeners("CacheStorageContentUpdated",{storageBucket:n,cacheName:t})}attributionReportingTriggerRegistered(e){}indexedDBListUpdated(e){}indexedDBContentUpdated(e){}interestGroupAuctionEventOccurred(e){}interestGroupAccessed(e){}interestGroupAuctionNetworkRequestCreated(e){}sharedStorageAccessed(e){}storageBucketCreatedOrUpdated(e){}storageBucketDeleted(e){}setThrottlerSchedulesAsSoonAsPossibleForTest(){this.#bh=!0}attributionReportingSourceRegistered(e){}}class bl{#ls;storageKey;storageBucket;cacheName;cacheId;constructor(e,t,n,r){this.#ls=e,this.storageBucket=t,this.storageKey=t.storageKey,this.cacheName=n,this.cacheId=r}inBucket(e){return this.storageKey===e.storageKey&&this.storageBucket.name===e.name}equals(e){return this.cacheId===e.cacheId}toString(){return this.storageKey+this.cacheName}async requestCachedResponse(e,t){const n=await this.#ls.cacheAgent.invoke_requestCachedResponse({cacheId:this.cacheId,requestURL:e,requestHeaders:t});return n.getError()?null:n.response}}h.register(fl,{capabilities:8192,autostart:!1});var yl=Object.freeze({__proto__:null,Cache:bl,ServiceWorkerCacheModel:fl});const vl={running:"running",starting:"starting",stopped:"stopped",stopping:"stopping",activated:"activated",activating:"activating",installed:"installed",installing:"installing",new:"new",redundant:"redundant",sSS:"{PH1} #{PH2} ({PH3})"},Il=n.i18n.registerUIStrings("core/sdk/ServiceWorkerManager.ts",vl),wl=n.i18n.getLocalizedString.bind(void 0,Il),Sl=n.i18n.getLazilyComputedLocalizedString.bind(void 0,Il);class kl extends h{#Ks;#yh=new Map;#yr=!1;#vh;serviceWorkerNetworkRequestsPanelStatus={isOpen:!1,openedAt:0};constructor(t){super(t),t.registerServiceWorkerDispatcher(new Cl(this)),this.#Ks=t.serviceWorkerAgent(),this.enable(),this.#vh=e.Settings.Settings.instance().createSetting("service-worker-update-on-reload",!1),this.#vh.get()&&this.forceUpdateSettingChanged(),this.#vh.addChangeListener(this.forceUpdateSettingChanged,this),new Pl(t,this)}async enable(){this.#yr||(this.#yr=!0,await this.#Ks.invoke_enable())}async disable(){this.#yr&&(this.#yr=!1,this.#yh.clear(),await this.#Ks.invoke_enable())}registrations(){return this.#yh}findVersion(e){for(const t of this.registrations().values()){const n=t.versions.get(e);if(n)return n}return null}deleteRegistration(e){const t=this.#yh.get(e);if(t){if(t.isRedundant())return this.#yh.delete(e),void this.dispatchEventToListeners("RegistrationDeleted",t);t.deleting=!0;for(const e of t.versions.values())this.stopWorker(e.id);this.unregister(t.scopeURL)}}async updateRegistration(e){const t=this.#yh.get(e);t&&await this.#Ks.invoke_updateRegistration({scopeURL:t.scopeURL})}async deliverPushMessage(t,n){const r=this.#yh.get(t);if(!r)return;const s=e.ParsedURL.ParsedURL.extractOrigin(r.scopeURL);await this.#Ks.invoke_deliverPushMessage({origin:s,registrationId:t,data:n})}async dispatchSyncEvent(t,n,r){const s=this.#yh.get(t);if(!s)return;const i=e.ParsedURL.ParsedURL.extractOrigin(s.scopeURL);await this.#Ks.invoke_dispatchSyncEvent({origin:i,registrationId:t,tag:n,lastChance:r})}async dispatchPeriodicSyncEvent(t,n){const r=this.#yh.get(t);if(!r)return;const s=e.ParsedURL.ParsedURL.extractOrigin(r.scopeURL);await this.#Ks.invoke_dispatchPeriodicSyncEvent({origin:s,registrationId:t,tag:n})}async unregister(e){await this.#Ks.invoke_unregister({scopeURL:e})}async startWorker(e){await this.#Ks.invoke_startWorker({scopeURL:e})}async skipWaiting(e){await this.#Ks.invoke_skipWaiting({scopeURL:e})}async stopWorker(e){await this.#Ks.invoke_stopWorker({versionId:e})}async inspectWorker(e){await this.#Ks.invoke_inspectWorker({versionId:e})}workerRegistrationUpdated(e){for(const t of e){let e=this.#yh.get(t.registrationId);e?(e.update(t),e.shouldBeRemoved()?(this.#yh.delete(e.id),this.dispatchEventToListeners("RegistrationDeleted",e)):this.dispatchEventToListeners("RegistrationUpdated",e)):(e=new Ml(t),this.#yh.set(t.registrationId,e),this.dispatchEventToListeners("RegistrationUpdated",e))}}workerVersionUpdated(e){const t=new Set;for(const n of e){const e=this.#yh.get(n.registrationId);e&&(e.updateVersion(n),t.add(e))}for(const e of t)e.shouldBeRemoved()?(this.#yh.delete(e.id),this.dispatchEventToListeners("RegistrationDeleted",e)):this.dispatchEventToListeners("RegistrationUpdated",e)}workerErrorReported(e){const t=this.#yh.get(e.registrationId);t&&(t.errors.push(e),this.dispatchEventToListeners("RegistrationErrorAdded",{registration:t,error:e}))}forceUpdateSettingChanged(){const e=this.#vh.get();this.#Ks.invoke_setForceUpdateOnPageLoad({forceUpdateOnPageLoad:e})}}class Cl{#z;constructor(e){this.#z=e}workerRegistrationUpdated({registrations:e}){this.#z.workerRegistrationUpdated(e)}workerVersionUpdated({versions:e}){this.#z.workerVersionUpdated(e)}workerErrorReported({errorMessage:e}){this.#z.workerErrorReported(e)}}class xl{runningStatus;status;lastUpdatedTimestamp;previousState;constructor(e,t,n,r){this.runningStatus=e,this.status=t,this.lastUpdatedTimestamp=r,this.previousState=n}}class Rl{condition;source;id;constructor(e,t,n){this.condition=e,this.source=t,this.id=n}}class Tl{id;scriptURL;parsedURL;securityOrigin;scriptLastModified;scriptResponseTime;controlledClients;targetId;routerRules;currentState;registration;constructor(e,t){this.registration=e,this.update(t)}update(t){this.id=t.versionId,this.scriptURL=t.scriptURL;const n=new e.ParsedURL.ParsedURL(t.scriptURL);this.securityOrigin=n.securityOrigin(),this.currentState=new xl(t.runningStatus,t.status,this.currentState,Date.now()),this.scriptLastModified=t.scriptLastModified,this.scriptResponseTime=t.scriptResponseTime,t.controlledClients?this.controlledClients=t.controlledClients.slice():this.controlledClients=[],this.targetId=t.targetId||null,this.routerRules=null,t.routerRules&&(this.routerRules=this.parseJSONRules(t.routerRules))}isStartable(){return!this.registration.isDeleted&&this.isActivated()&&this.isStopped()}isStoppedAndRedundant(){return"stopped"===this.runningStatus&&"redundant"===this.status}isStopped(){return"stopped"===this.runningStatus}isStarting(){return"starting"===this.runningStatus}isRunning(){return"running"===this.runningStatus}isStopping(){return"stopping"===this.runningStatus}isNew(){return"new"===this.status}isInstalling(){return"installing"===this.status}isInstalled(){return"installed"===this.status}isActivating(){return"activating"===this.status}isActivated(){return"activated"===this.status}isRedundant(){return"redundant"===this.status}get status(){return this.currentState.status}get runningStatus(){return this.currentState.runningStatus}mode(){return this.isNew()||this.isInstalling()?"installing":this.isInstalled()?"waiting":this.isActivating()||this.isActivated()?"active":"redundant"}parseJSONRules(e){try{const t=JSON.parse(e);if(!Array.isArray(t))return console.error("Parse error: `routerRules` in ServiceWorkerVersion should be an array"),null;const n=[];for(const e of t){const{condition:t,source:r,id:s}=e;if(void 0===t||void 0===r||void 0===s)return console.error("Parse error: Missing some fields of `routerRules` in ServiceWorkerVersion"),null;n.push(new Rl(JSON.stringify(t),JSON.stringify(r),s))}return n}catch{return console.error("Parse error: Invalid `routerRules` in ServiceWorkerVersion"),null}}}!function(e){e.RunningStatus={running:Sl(vl.running),starting:Sl(vl.starting),stopped:Sl(vl.stopped),stopping:Sl(vl.stopping)},e.Status={activated:Sl(vl.activated),activating:Sl(vl.activating),installed:Sl(vl.installed),installing:Sl(vl.installing),new:Sl(vl.new),redundant:Sl(vl.redundant)}}(Tl||(Tl={}));class Ml{#Ih;id;scopeURL;securityOrigin;isDeleted;versions=new Map;deleting=!1;errors=[];constructor(e){this.update(e)}update(t){this.#Ih=Symbol("fingerprint"),this.id=t.registrationId,this.scopeURL=t.scopeURL;const n=new e.ParsedURL.ParsedURL(t.scopeURL);this.securityOrigin=n.securityOrigin(),this.isDeleted=t.isDeleted}fingerprint(){return this.#Ih}versionsByMode(){const e=new Map;for(const t of this.versions.values())e.set(t.mode(),t);return e}updateVersion(e){this.#Ih=Symbol("fingerprint");let t=this.versions.get(e.versionId);return t?(t.update(e),t):(t=new Tl(this,e),this.versions.set(e.versionId,t),t)}isRedundant(){for(const e of this.versions.values())if(!e.isStoppedAndRedundant())return!1;return!0}shouldBeRemoved(){return this.isRedundant()&&(!this.errors.length||this.deleting)}canBeRemoved(){return this.isDeleted||this.deleting}}class Pl{#$n;#wh;#Sh=new Map;constructor(e,t){this.#$n=e,this.#wh=t,t.addEventListener("RegistrationUpdated",this.registrationsUpdated,this),t.addEventListener("RegistrationDeleted",this.registrationsUpdated,this),W.instance().addModelListener(Jr,$r.ExecutionContextCreated,this.executionContextCreated,this)}registrationsUpdated(){this.#Sh.clear();const e=this.#wh.registrations().values();for(const t of e)for(const e of t.versions.values())e.targetId&&this.#Sh.set(e.targetId,e);this.updateAllContextLabels()}executionContextCreated(e){const t=e.data,n=this.serviceWorkerTargetId(t.target());n&&this.updateContextLabel(t,this.#Sh.get(n)||null)}serviceWorkerTargetId(e){return e.parentTarget()!==this.#$n||e.type()!==U.ServiceWorker?null:e.id()}updateAllContextLabels(){for(const e of W.instance().targets()){const t=this.serviceWorkerTargetId(e);if(!t)continue;const n=this.#Sh.get(t)||null,r=e.model(Jr),s=r?r.executionContexts():[];for(const e of s)this.updateContextLabel(e,n)}}updateContextLabel(t,n){if(!n)return void t.setLabel("");const r=e.ParsedURL.ParsedURL.fromString(t.origin),s=r?r.lastPathComponentWithFragment():t.name,i=Tl.Status[n.status];t.setLabel(wl(vl.sSS,{PH1:s,PH2:n.id,PH3:i()}))}}h.register(kl,{capabilities:16384,autostart:!0});var El=Object.freeze({__proto__:null,ServiceWorkerManager:kl,ServiceWorkerRegistration:Ml,ServiceWorkerRouterRule:Rl,get ServiceWorkerVersion(){return Tl},ServiceWorkerVersionState:xl});class Ll extends h{#Ks;constructor(e){super(e),this.#Ks=e.webAuthnAgent(),e.registerWebAuthnDispatcher(new Al(this))}setVirtualAuthEnvEnabled(e){return e?this.#Ks.invoke_enable({enableUI:!0}):this.#Ks.invoke_disable()}async addAuthenticator(e){return(await this.#Ks.invoke_addVirtualAuthenticator({options:e})).authenticatorId}async removeAuthenticator(e){await this.#Ks.invoke_removeVirtualAuthenticator({authenticatorId:e})}async setAutomaticPresenceSimulation(e,t){await this.#Ks.invoke_setAutomaticPresenceSimulation({authenticatorId:e,enabled:t})}async getCredentials(e){return(await this.#Ks.invoke_getCredentials({authenticatorId:e})).credentials}async removeCredential(e,t){await this.#Ks.invoke_removeCredential({authenticatorId:e,credentialId:t})}credentialAdded(e){this.dispatchEventToListeners("CredentialAdded",e)}credentialAsserted(e){this.dispatchEventToListeners("CredentialAsserted",e)}credentialDeleted(e){this.dispatchEventToListeners("CredentialDeleted",e)}credentialUpdated(e){this.dispatchEventToListeners("CredentialUpdated",e)}}class Al{#ls;constructor(e){this.#ls=e}credentialAdded(e){this.#ls.credentialAdded(e)}credentialAsserted(e){this.#ls.credentialAsserted(e)}credentialDeleted(e){this.#ls.credentialDeleted(e)}credentialUpdated(e){this.#ls.credentialUpdated(e)}}h.register(Ll,{capabilities:65536,autostart:!1});var Ol=Object.freeze({__proto__:null,WebAuthnModel:Ll});export{Fi as AccessibilityModel,eo as AnimationModel,no as AutofillModel,Uo as CPUProfilerModel,ya as CPUThrottlingManager,Vt as CSSContainerQuery,me as CSSFontFace,Gt as CSSLayer,Mn as CSSMatchedStyles,Xt as CSSMedia,B as CSSMetadata,Gr as CSSModel,Bt as CSSProperty,Nt as CSSPropertyParser,ht as CSSPropertyParserMatchers,Ht as CSSQuery,pn as CSSRule,Zt as CSSScope,tn as CSSStyleDeclaration,On as CSSStyleSheetHeader,rn as CSSSupports,so as CategorizedBreakpoint,Eo as ChildTargetManager,No as CompilerSourceMappingContentProvider,xo as Connections,Jo as ConsoleModel,q as Cookie,ci as CookieModel,gi as CookieParser,Ta as DOMDebuggerModel,Xs as DOMModel,Ts as DebuggerModel,ta as EmulationModel,oo as EnhancedTracesParser,Aa as EventBreakpointsModel,Oa as FrameAssociated,Fn as FrameManager,Xr as HeapProfilerModel,Xn as IOModel,Ua as IsolateManager,za as IssuesModel,ja as LayerTreeBase,zo as LogModel,ge as NetworkManager,Oi as NetworkRequest,Ps as OverlayColorGenerator,qs as OverlayModel,Ls as OverlayPersistentHighlighter,Ga as PageLoad,sr as PageResourceLoader,Xa as PaintProfiler,Ya as PerformanceMetricsModel,dl as PreloadingModel,cl as ReactNativeApplicationModel,Qn as RemoteObject,Zs as Resource,li as ResourceTreeModel,es as RuntimeModel,u as SDKModel,_i as ScreenCaptureModel,ds as Script,ti as SecurityOriginManager,fi as ServerSentEventProtocol,Si as ServerTiming,yl as ServiceWorkerCacheModel,El as ServiceWorkerManager,Ar as SourceMap,br as SourceMapFunctionRanges,Fr as SourceMapManager,kr as SourceMapScopeChainEntry,gr as SourceMapScopes,Rr as SourceMapScopesInfo,ul as StorageBucketsModel,si as StorageKeyManager,j as Target,G as TargetManager,co as TraceObject,Ol as WebAuthnModel}; +import*as e from"../common/common.js";import*as t from"../../models/text_utils/text_utils.js";import*as n from"../i18n/i18n.js";import*as r from"../platform/platform.js";import{assertNotNullOrUndefined as s,UserVisibleError as i}from"../platform/platform.js";import*as o from"../root/root.js";import*as a from"../host/host.js";import*as l from"../protocol_client/protocol_client.js";import*as d from"../../third_party/codemirror.next/codemirror.next.js";const c=new Map;class h extends e.ObjectWrapper.ObjectWrapper{#e;constructor(e){super(),this.#e=e}target(){return this.#e}async preSuspendModel(e){}async suspendModel(e){}async resumeModel(){}async postResumeModel(){}dispose(){}static register(e,t){if(t.early&&!t.autostart)throw new Error(`Error registering model ${e.name}: early models must be autostarted.`);c.set(e,t)}static get registeredModels(){return c}}var u=Object.freeze({__proto__:null,SDKModel:h});const g=[{inherited:!0,name:"-webkit-border-horizontal-spacing"},{name:"-webkit-border-image"},{inherited:!0,name:"-webkit-border-vertical-spacing"},{keywords:["stretch","start","center","end","baseline"],name:"-webkit-box-align"},{keywords:["slice","clone"],name:"-webkit-box-decoration-break"},{keywords:["normal","reverse"],name:"-webkit-box-direction"},{name:"-webkit-box-flex"},{name:"-webkit-box-ordinal-group"},{keywords:["horizontal","vertical"],name:"-webkit-box-orient"},{keywords:["start","center","end","justify"],name:"-webkit-box-pack"},{name:"-webkit-box-reflect"},{longhands:["break-after"],name:"-webkit-column-break-after"},{longhands:["break-before"],name:"-webkit-column-break-before"},{longhands:["break-inside"],name:"-webkit-column-break-inside"},{inherited:!0,name:"-webkit-font-smoothing"},{inherited:!0,keywords:["auto","loose","normal","strict","after-white-space","anywhere"],name:"-webkit-line-break"},{keywords:["none"],name:"-webkit-line-clamp"},{inherited:!0,name:"-webkit-locale"},{longhands:["-webkit-mask-box-image-source","-webkit-mask-box-image-slice","-webkit-mask-box-image-width","-webkit-mask-box-image-outset","-webkit-mask-box-image-repeat"],name:"-webkit-mask-box-image"},{name:"-webkit-mask-box-image-outset"},{name:"-webkit-mask-box-image-repeat"},{name:"-webkit-mask-box-image-slice"},{name:"-webkit-mask-box-image-source"},{name:"-webkit-mask-box-image-width"},{name:"-webkit-mask-position-x"},{name:"-webkit-mask-position-y"},{name:"-webkit-perspective-origin-x"},{name:"-webkit-perspective-origin-y"},{inherited:!0,keywords:["logical","visual"],name:"-webkit-rtl-ordering"},{inherited:!0,name:"-webkit-ruby-position"},{inherited:!0,name:"-webkit-tap-highlight-color"},{inherited:!0,name:"-webkit-text-combine"},{inherited:!0,name:"-webkit-text-decorations-in-effect"},{inherited:!0,name:"-webkit-text-fill-color"},{inherited:!0,name:"-webkit-text-orientation"},{inherited:!0,keywords:["none","disc","circle","square"],name:"-webkit-text-security"},{inherited:!0,longhands:["-webkit-text-stroke-width","-webkit-text-stroke-color"],name:"-webkit-text-stroke"},{inherited:!0,name:"-webkit-text-stroke-color"},{inherited:!0,name:"-webkit-text-stroke-width"},{name:"-webkit-transform-origin-x"},{name:"-webkit-transform-origin-y"},{name:"-webkit-transform-origin-z"},{keywords:["auto","none","element"],name:"-webkit-user-drag"},{inherited:!0,keywords:["read-only","read-write","read-write-plaintext-only"],name:"-webkit-user-modify"},{inherited:!0,name:"-webkit-writing-mode"},{inherited:!0,keywords:["auto","currentcolor"],name:"accent-color"},{name:"additive-symbols"},{name:"align-content"},{name:"align-items"},{name:"align-self"},{keywords:["auto","baseline","alphabetic","ideographic","middle","central","mathematical","before-edge","text-before-edge","after-edge","text-after-edge","hanging"],name:"alignment-baseline"},{longhands:["-webkit-border-horizontal-spacing","-webkit-border-vertical-spacing","-webkit-box-align","-webkit-box-decoration-break","-webkit-box-direction","-webkit-box-flex","-webkit-box-ordinal-group","-webkit-box-orient","-webkit-box-pack","-webkit-box-reflect","-webkit-font-smoothing","-webkit-line-break","-webkit-line-clamp","-webkit-locale","-webkit-mask-box-image-outset","-webkit-mask-box-image-repeat","-webkit-mask-box-image-slice","-webkit-mask-box-image-source","-webkit-mask-box-image-width","-webkit-mask-position-x","-webkit-mask-position-y","-webkit-rtl-ordering","-webkit-ruby-position","-webkit-tap-highlight-color","-webkit-text-combine","-webkit-text-decorations-in-effect","-webkit-text-fill-color","-webkit-text-orientation","-webkit-text-security","-webkit-text-stroke-color","-webkit-text-stroke-width","-webkit-user-drag","-webkit-writing-mode","accent-color","additive-symbols","align-content","align-items","align-self","alignment-baseline","anchor-name","anchor-scope","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","animation-trigger-exit-range-end","animation-trigger-exit-range-start","animation-trigger-range-end","animation-trigger-range-start","animation-trigger-timeline","animation-trigger-type","app-region","appearance","ascent-override","aspect-ratio","backdrop-filter","backface-visibility","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position-x","background-position-y","background-repeat","background-size","base-palette","baseline-shift","baseline-source","block-size","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start-color","border-block-start-style","border-block-start-width","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-end-end-radius","border-end-start-radius","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-left-color","border-left-style","border-left-width","border-right-color","border-right-style","border-right-width","border-start-end-radius","border-start-start-radius","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","buffered-rendering","caption-side","caret-animation","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-rendering","color-scheme","column-count","column-fill","column-gap","column-height","column-rule-break","column-rule-color","column-rule-outset","column-rule-style","column-rule-width","column-span","column-width","column-wrap","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-width","container-name","container-type","content","content-visibility","corner-bottom-left-shape","corner-bottom-right-shape","corner-end-end-shape","corner-end-start-shape","corner-start-end-shape","corner-start-start-shape","corner-top-left-shape","corner-top-right-shape","counter-increment","counter-reset","counter-set","cursor","cx","cy","d","descent-override","display","dominant-baseline","dynamic-range-limit","empty-cells","fallback","field-sizing","fill","fill-opacity","fill-rule","filter","flex-basis","flex-direction","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","font-display","font-family","font-feature-settings","font-kerning","font-optical-sizing","font-palette","font-size","font-size-adjust","font-stretch","font-style","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap-rule-paint-order","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column-end","grid-column-start","grid-row-end","grid-row-start","grid-template-areas","grid-template-columns","grid-template-rows","height","hyphenate-character","hyphenate-limit-chars","hyphens","image-orientation","image-rendering","inherits","initial-letter","initial-value","inline-size","inset-block-end","inset-block-start","inset-inline-end","inset-inline-start","interactivity","interest-target-hide-delay","interest-target-show-delay","interpolate-size","isolation","justify-content","justify-items","justify-self","left","letter-spacing","lighting-color","line-break","line-clamp","line-gap-override","line-height","list-style-image","list-style-position","list-style-type","margin-block-end","margin-block-start","margin-bottom","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marker-end","marker-mid","marker-start","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-repeat","mask-size","mask-type","masonry-auto-tracks","masonry-direction","masonry-fill","masonry-slack","masonry-template-tracks","masonry-track-end","masonry-track-start","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","navigation","negative","object-fit","object-position","object-view-box","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","origin-trial-test-property","orphans","outline-color","outline-offset","outline-style","outline-width","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","override-colors","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","pad","padding-block-end","padding-block-start","padding-bottom","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-orientation","paint-order","perspective","perspective-origin","pointer-events","position","position-anchor","position-area","position-try-fallbacks","position-try-order","position-visibility","prefix","print-color-adjust","quotes","r","range","reading-flow","reading-order","resize","result","right","rotate","row-gap","row-rule-break","row-rule-color","row-rule-outset","row-rule-style","row-rule-width","ruby-align","ruby-position","rx","ry","scale","scroll-behavior","scroll-initial-target","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-marker-contain","scroll-marker-group","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-start-block","scroll-start-inline","scroll-start-x","scroll-start-y","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","size","size-adjust","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","suffix","symbols","syntax","system","tab-size","table-layout","text-align","text-align-last","text-anchor","text-autospace","text-box-edge","text-box-trim","text-combine-upright","text-decoration-color","text-decoration-line","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-spacing-trim","text-transform","text-underline-offset","text-underline-position","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","types","unicode-range","user-select","vector-effect","vertical-align","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-class","view-transition-group","view-transition-name","visibility","white-space-collapse","widows","width","will-change","word-break","word-spacing","writing-mode","x","y","z-index","zoom"],name:"all"},{keywords:["none"],name:"anchor-name"},{keywords:["none","all"],name:"anchor-scope"},{longhands:["animation-duration","animation-timing-function","animation-delay","animation-iteration-count","animation-direction","animation-fill-mode","animation-play-state","animation-name","animation-timeline","animation-range-start","animation-range-end"],name:"animation"},{keywords:["replace","add","accumulate"],name:"animation-composition"},{name:"animation-delay"},{keywords:["normal","reverse","alternate","alternate-reverse"],name:"animation-direction"},{name:"animation-duration"},{keywords:["none","forwards","backwards","both"],name:"animation-fill-mode"},{keywords:["infinite"],name:"animation-iteration-count"},{keywords:["none"],name:"animation-name"},{keywords:["running","paused"],name:"animation-play-state"},{longhands:["animation-range-start","animation-range-end"],name:"animation-range"},{name:"animation-range-end"},{name:"animation-range-start"},{keywords:["none","auto"],name:"animation-timeline"},{keywords:["linear","ease","ease-in","ease-out","ease-in-out","jump-both","jump-end","jump-none","jump-start","step-start","step-end"],name:"animation-timing-function"},{longhands:["animation-trigger-timeline","animation-trigger-type","animation-trigger-range-start","animation-trigger-range-end","animation-trigger-exit-range-start","animation-trigger-exit-range-end"],name:"animation-trigger"},{longhands:["animation-trigger-exit-range-start","animation-trigger-exit-range-end"],name:"animation-trigger-exit-range"},{name:"animation-trigger-exit-range-end"},{name:"animation-trigger-exit-range-start"},{longhands:["animation-trigger-range-start","animation-trigger-range-end"],name:"animation-trigger-range"},{name:"animation-trigger-range-end"},{name:"animation-trigger-range-start"},{keywords:["none","auto"],name:"animation-trigger-timeline"},{keywords:["once","repeat","alternate","state"],name:"animation-trigger-type"},{keywords:["none","drag","no-drag"],name:"app-region"},{name:"appearance"},{name:"ascent-override"},{keywords:["auto"],name:"aspect-ratio"},{keywords:["none"],name:"backdrop-filter"},{keywords:["visible","hidden"],name:"backface-visibility"},{longhands:["background-image","background-position-x","background-position-y","background-size","background-repeat","background-attachment","background-origin","background-clip","background-color"],name:"background"},{keywords:["scroll","fixed","local"],name:"background-attachment"},{keywords:["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],name:"background-blend-mode"},{keywords:["border-box","padding-box","content-box","text"],name:"background-clip"},{keywords:["currentcolor"],name:"background-color"},{keywords:["auto","none"],name:"background-image"},{keywords:["border-box","padding-box","content-box"],name:"background-origin"},{longhands:["background-position-x","background-position-y"],name:"background-position"},{name:"background-position-x"},{name:"background-position-y"},{name:"background-repeat"},{keywords:["auto","cover","contain"],name:"background-size"},{name:"base-palette"},{keywords:["baseline","sub","super"],name:"baseline-shift"},{keywords:["auto","first","last"],name:"baseline-source"},{keywords:["auto"],name:"block-size"},{longhands:["border-top-color","border-top-style","border-top-width","border-right-color","border-right-style","border-right-width","border-bottom-color","border-bottom-style","border-bottom-width","border-left-color","border-left-style","border-left-width","border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat"],name:"border"},{longhands:["border-block-start-color","border-block-start-style","border-block-start-width","border-block-end-color","border-block-end-style","border-block-end-width"],name:"border-block"},{longhands:["border-block-start-color","border-block-end-color"],name:"border-block-color"},{longhands:["border-block-end-width","border-block-end-style","border-block-end-color"],name:"border-block-end"},{name:"border-block-end-color"},{name:"border-block-end-style"},{name:"border-block-end-width"},{longhands:["border-block-start-width","border-block-start-style","border-block-start-color"],name:"border-block-start"},{name:"border-block-start-color"},{name:"border-block-start-style"},{name:"border-block-start-width"},{longhands:["border-block-start-style","border-block-end-style"],name:"border-block-style"},{longhands:["border-block-start-width","border-block-end-width"],name:"border-block-width"},{longhands:["border-bottom-width","border-bottom-style","border-bottom-color"],name:"border-bottom"},{keywords:["currentcolor"],name:"border-bottom-color"},{name:"border-bottom-left-radius"},{name:"border-bottom-right-radius"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"border-bottom-style"},{keywords:["thin","medium","thick"],name:"border-bottom-width"},{inherited:!0,keywords:["separate","collapse"],name:"border-collapse"},{longhands:["border-top-color","border-right-color","border-bottom-color","border-left-color"],name:"border-color"},{name:"border-end-end-radius"},{name:"border-end-start-radius"},{longhands:["border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat"],name:"border-image"},{name:"border-image-outset"},{keywords:["stretch","repeat","round","space"],name:"border-image-repeat"},{name:"border-image-slice"},{keywords:["none"],name:"border-image-source"},{keywords:["auto"],name:"border-image-width"},{longhands:["border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-end-color","border-inline-end-style","border-inline-end-width"],name:"border-inline"},{longhands:["border-inline-start-color","border-inline-end-color"],name:"border-inline-color"},{longhands:["border-inline-end-width","border-inline-end-style","border-inline-end-color"],name:"border-inline-end"},{name:"border-inline-end-color"},{name:"border-inline-end-style"},{name:"border-inline-end-width"},{longhands:["border-inline-start-width","border-inline-start-style","border-inline-start-color"],name:"border-inline-start"},{name:"border-inline-start-color"},{name:"border-inline-start-style"},{name:"border-inline-start-width"},{longhands:["border-inline-start-style","border-inline-end-style"],name:"border-inline-style"},{longhands:["border-inline-start-width","border-inline-end-width"],name:"border-inline-width"},{longhands:["border-left-width","border-left-style","border-left-color"],name:"border-left"},{keywords:["currentcolor"],name:"border-left-color"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"border-left-style"},{keywords:["thin","medium","thick"],name:"border-left-width"},{longhands:["border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius"],name:"border-radius"},{longhands:["border-right-width","border-right-style","border-right-color"],name:"border-right"},{keywords:["currentcolor"],name:"border-right-color"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"border-right-style"},{keywords:["thin","medium","thick"],name:"border-right-width"},{inherited:!0,longhands:["-webkit-border-horizontal-spacing","-webkit-border-vertical-spacing"],name:"border-spacing"},{name:"border-start-end-radius"},{name:"border-start-start-radius"},{keywords:["none"],longhands:["border-top-style","border-right-style","border-bottom-style","border-left-style"],name:"border-style"},{longhands:["border-top-width","border-top-style","border-top-color"],name:"border-top"},{keywords:["currentcolor"],name:"border-top-color"},{name:"border-top-left-radius"},{name:"border-top-right-radius"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"border-top-style"},{keywords:["thin","medium","thick"],name:"border-top-width"},{longhands:["border-top-width","border-right-width","border-bottom-width","border-left-width"],name:"border-width"},{keywords:["auto"],name:"bottom"},{keywords:["slice","clone"],name:"box-decoration-break"},{keywords:["none"],name:"box-shadow"},{keywords:["content-box","border-box"],name:"box-sizing"},{keywords:["auto","avoid","avoid-column","avoid-page","column","left","page","recto","right","verso"],name:"break-after"},{keywords:["auto","avoid","avoid-column","avoid-page","column","left","page","recto","right","verso"],name:"break-before"},{keywords:["auto","avoid","avoid-column","avoid-page"],name:"break-inside"},{keywords:["auto","dynamic","static"],name:"buffered-rendering"},{inherited:!0,keywords:["top","bottom"],name:"caption-side"},{inherited:!0,keywords:["auto","manual"],name:"caret-animation"},{inherited:!0,keywords:["auto","currentcolor"],name:"caret-color"},{keywords:["none","left","right","both","inline-start","inline-end"],name:"clear"},{keywords:["auto"],name:"clip"},{keywords:["border-box","padding-box","content-box","margin-box","fill-box","stroke-box","view-box","none"],name:"clip-path"},{inherited:!0,keywords:["nonzero","evenodd"],name:"clip-rule"},{inherited:!0,keywords:["currentcolor"],name:"color"},{inherited:!0,keywords:["auto","srgb","linearrgb"],name:"color-interpolation"},{inherited:!0,keywords:["auto","srgb","linearrgb"],name:"color-interpolation-filters"},{inherited:!0,keywords:["auto","optimizespeed","optimizequality"],name:"color-rendering"},{inherited:!0,name:"color-scheme"},{keywords:["auto"],name:"column-count"},{keywords:["balance","auto"],name:"column-fill"},{keywords:["normal"],name:"column-gap"},{keywords:["auto"],name:"column-height"},{longhands:["column-rule-width","column-rule-style","column-rule-color"],name:"column-rule"},{inherited:!1,keywords:["none","spanning-item","intersection"],name:"column-rule-break"},{keywords:["currentcolor"],name:"column-rule-color"},{inherited:!1,name:"column-rule-outset"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"column-rule-style"},{keywords:["thin","medium","thick"],name:"column-rule-width"},{keywords:["none","all"],name:"column-span"},{keywords:["auto"],name:"column-width"},{keywords:["nowrap","wrap"],name:"column-wrap"},{longhands:["column-width","column-count"],name:"columns"},{keywords:["none","strict","content","size","layout","style","paint","inline-size","block-size"],name:"contain"},{name:"contain-intrinsic-block-size"},{keywords:["none"],name:"contain-intrinsic-height"},{name:"contain-intrinsic-inline-size"},{longhands:["contain-intrinsic-width","contain-intrinsic-height"],name:"contain-intrinsic-size"},{keywords:["none"],name:"contain-intrinsic-width"},{longhands:["container-name","container-type"],name:"container"},{keywords:["none"],name:"container-name"},{keywords:["normal","inline-size","size","scroll-state"],name:"container-type"},{name:"content"},{keywords:["visible","auto","hidden"],name:"content-visibility"},{name:"corner-bottom-left-shape"},{name:"corner-bottom-right-shape"},{name:"corner-end-end-shape"},{name:"corner-end-start-shape"},{longhands:["corner-top-left-shape","corner-top-right-shape","corner-bottom-right-shape","corner-bottom-left-shape"],name:"corner-shape"},{name:"corner-start-end-shape"},{name:"corner-start-start-shape"},{name:"corner-top-left-shape"},{name:"corner-top-right-shape"},{keywords:["none"],name:"counter-increment"},{keywords:["none"],name:"counter-reset"},{keywords:["none"],name:"counter-set"},{inherited:!0,keywords:["auto","default","none","context-menu","help","pointer","progress","wait","cell","crosshair","text","vertical-text","alias","copy","move","no-drop","not-allowed","e-resize","n-resize","ne-resize","nw-resize","s-resize","se-resize","sw-resize","w-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","col-resize","row-resize","all-scroll","zoom-in","zoom-out","grab","grabbing"],name:"cursor"},{name:"cx"},{name:"cy"},{keywords:["none"],name:"d"},{name:"descent-override"},{inherited:!0,keywords:["ltr","rtl"],name:"direction"},{keywords:["inline","block","list-item","inline-block","table","inline-table","table-row-group","table-header-group","table-footer-group","table-row","table-column-group","table-column","table-cell","table-caption","-webkit-box","-webkit-inline-box","flex","inline-flex","grid","inline-grid","contents","flow-root","none","flow","math","ruby","ruby-text","masonry","inline-masonry"],name:"display"},{inherited:!0,keywords:["auto","alphabetic","ideographic","middle","central","mathematical","hanging","use-script","no-change","reset-size","text-after-edge","text-before-edge"],name:"dominant-baseline"},{inherited:!0,keywords:["standard","no-limit","constrained"],name:"dynamic-range-limit"},{inherited:!0,keywords:["show","hide"],name:"empty-cells"},{name:"fallback"},{keywords:["fixed","content"],name:"field-sizing"},{inherited:!0,name:"fill"},{inherited:!0,name:"fill-opacity"},{inherited:!0,keywords:["nonzero","evenodd"],name:"fill-rule"},{keywords:["none"],name:"filter"},{longhands:["flex-grow","flex-shrink","flex-basis"],name:"flex"},{keywords:["auto","fit-content","min-content","max-content","content"],name:"flex-basis"},{keywords:["row","row-reverse","column","column-reverse"],name:"flex-direction"},{longhands:["flex-direction","flex-wrap"],name:"flex-flow"},{name:"flex-grow"},{name:"flex-shrink"},{keywords:["nowrap","wrap","wrap-reverse"],name:"flex-wrap"},{keywords:["none","left","right","inline-start","inline-end"],name:"float"},{keywords:["currentcolor"],name:"flood-color"},{name:"flood-opacity"},{inherited:!0,longhands:["font-style","font-variant-ligatures","font-variant-caps","font-variant-numeric","font-variant-east-asian","font-variant-alternates","font-variant-position","font-variant-emoji","font-weight","font-stretch","font-size","line-height","font-family","font-optical-sizing","font-size-adjust","font-kerning","font-feature-settings","font-variation-settings"],name:"font"},{name:"font-display"},{inherited:!0,name:"font-family"},{inherited:!0,keywords:["normal"],name:"font-feature-settings"},{inherited:!0,keywords:["auto","normal","none"],name:"font-kerning"},{inherited:!0,keywords:["auto","none"],name:"font-optical-sizing"},{inherited:!0,keywords:["normal","light","dark"],name:"font-palette"},{inherited:!0,keywords:["xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","larger","smaller","-webkit-xxx-large"],name:"font-size"},{inherited:!0,keywords:["none","ex-height","cap-height","ch-width","ic-width","ic-height","from-font"],name:"font-size-adjust"},{inherited:!0,keywords:["normal","ultra-condensed","extra-condensed","condensed","semi-condensed","semi-expanded","expanded","extra-expanded","ultra-expanded"],name:"font-stretch"},{inherited:!0,keywords:["normal","italic","oblique"],name:"font-style"},{inherited:!0,longhands:["font-synthesis-weight","font-synthesis-style","font-synthesis-small-caps"],name:"font-synthesis"},{inherited:!0,keywords:["auto","none"],name:"font-synthesis-small-caps"},{inherited:!0,keywords:["auto","none"],name:"font-synthesis-style"},{inherited:!0,keywords:["auto","none"],name:"font-synthesis-weight"},{inherited:!0,longhands:["font-variant-ligatures","font-variant-caps","font-variant-alternates","font-variant-numeric","font-variant-east-asian","font-variant-position","font-variant-emoji"],name:"font-variant"},{inherited:!0,keywords:["normal"],name:"font-variant-alternates"},{inherited:!0,keywords:["normal","small-caps","all-small-caps","petite-caps","all-petite-caps","unicase","titling-caps"],name:"font-variant-caps"},{inherited:!0,keywords:["normal","jis78","jis83","jis90","jis04","simplified","traditional","full-width","proportional-width","ruby"],name:"font-variant-east-asian"},{inherited:!0,keywords:["normal","text","emoji","unicode"],name:"font-variant-emoji"},{inherited:!0,keywords:["normal","none","common-ligatures","no-common-ligatures","discretionary-ligatures","no-discretionary-ligatures","historical-ligatures","no-historical-ligatures","contextual","no-contextual"],name:"font-variant-ligatures"},{inherited:!0,keywords:["normal","lining-nums","oldstyle-nums","proportional-nums","tabular-nums","diagonal-fractions","stacked-fractions","ordinal","slashed-zero"],name:"font-variant-numeric"},{inherited:!0,keywords:["normal","sub","super"],name:"font-variant-position"},{inherited:!0,keywords:["normal"],name:"font-variation-settings"},{inherited:!0,keywords:["normal","bold","bolder","lighter"],name:"font-weight"},{inherited:!0,keywords:["auto","none","preserve-parent-color"],name:"forced-color-adjust"},{longhands:["row-gap","column-gap"],name:"gap"},{inherited:!1,keywords:["row-over-column","column-over-row"],name:"gap-rule-paint-order"},{longhands:["grid-template-rows","grid-template-columns","grid-template-areas","grid-auto-flow","grid-auto-rows","grid-auto-columns"],name:"grid"},{longhands:["grid-row-start","grid-column-start","grid-row-end","grid-column-end"],name:"grid-area"},{keywords:["auto","min-content","max-content"],name:"grid-auto-columns"},{keywords:["row","column"],name:"grid-auto-flow"},{keywords:["auto","min-content","max-content"],name:"grid-auto-rows"},{longhands:["grid-column-start","grid-column-end"],name:"grid-column"},{keywords:["auto"],name:"grid-column-end"},{keywords:["auto"],name:"grid-column-start"},{longhands:["grid-row-start","grid-row-end"],name:"grid-row"},{keywords:["auto"],name:"grid-row-end"},{keywords:["auto"],name:"grid-row-start"},{longhands:["grid-template-rows","grid-template-columns","grid-template-areas"],name:"grid-template"},{keywords:["none"],name:"grid-template-areas"},{keywords:["none"],name:"grid-template-columns"},{keywords:["none"],name:"grid-template-rows"},{keywords:["auto","fit-content","min-content","max-content"],name:"height"},{inherited:!0,name:"hyphenate-character"},{inherited:!0,keywords:["auto"],name:"hyphenate-limit-chars"},{inherited:!0,keywords:["none","manual","auto"],name:"hyphens"},{inherited:!0,name:"image-orientation"},{inherited:!0,keywords:["auto","optimizespeed","optimizequality","-webkit-optimize-contrast","pixelated"],name:"image-rendering"},{name:"inherits"},{inherited:!1,keywords:["drop","normal","raise"],name:"initial-letter"},{name:"initial-value"},{keywords:["auto"],name:"inline-size"},{longhands:["top","right","bottom","left"],name:"inset"},{longhands:["inset-block-start","inset-block-end"],name:"inset-block"},{name:"inset-block-end"},{name:"inset-block-start"},{longhands:["inset-inline-start","inset-inline-end"],name:"inset-inline"},{name:"inset-inline-end"},{name:"inset-inline-start"},{inherited:!0,keywords:["auto","inert"],name:"interactivity"},{longhands:["interest-target-show-delay","interest-target-hide-delay"],name:"interest-target-delay"},{name:"interest-target-hide-delay"},{name:"interest-target-show-delay"},{inherited:!0,keywords:["numeric-only","allow-keywords"],name:"interpolate-size"},{keywords:["auto","isolate"],name:"isolation"},{name:"justify-content"},{name:"justify-items"},{name:"justify-self"},{keywords:["auto"],name:"left"},{inherited:!0,keywords:["normal"],name:"letter-spacing"},{keywords:["currentcolor"],name:"lighting-color"},{inherited:!0,keywords:["auto","loose","normal","strict","anywhere"],name:"line-break"},{keywords:["none","auto"],name:"line-clamp"},{name:"line-gap-override"},{inherited:!0,keywords:["normal"],name:"line-height"},{inherited:!0,longhands:["list-style-position","list-style-image","list-style-type"],name:"list-style"},{inherited:!0,keywords:["none"],name:"list-style-image"},{inherited:!0,keywords:["outside","inside"],name:"list-style-position"},{inherited:!0,keywords:["disc","circle","square","disclosure-open","disclosure-closed","decimal","none"],name:"list-style-type"},{longhands:["margin-top","margin-right","margin-bottom","margin-left"],name:"margin"},{longhands:["margin-block-start","margin-block-end"],name:"margin-block"},{keywords:["auto"],name:"margin-block-end"},{keywords:["auto"],name:"margin-block-start"},{keywords:["auto"],name:"margin-bottom"},{longhands:["margin-inline-start","margin-inline-end"],name:"margin-inline"},{keywords:["auto"],name:"margin-inline-end"},{keywords:["auto"],name:"margin-inline-start"},{keywords:["auto"],name:"margin-left"},{keywords:["auto"],name:"margin-right"},{keywords:["auto"],name:"margin-top"},{inherited:!0,longhands:["marker-start","marker-mid","marker-end"],name:"marker"},{inherited:!0,keywords:["none"],name:"marker-end"},{inherited:!0,keywords:["none"],name:"marker-mid"},{inherited:!0,keywords:["none"],name:"marker-start"},{longhands:["mask-image","-webkit-mask-position-x","-webkit-mask-position-y","mask-size","mask-repeat","mask-origin","mask-clip","mask-composite","mask-mode"],name:"mask"},{name:"mask-clip"},{name:"mask-composite"},{name:"mask-image"},{name:"mask-mode"},{name:"mask-origin"},{longhands:["-webkit-mask-position-x","-webkit-mask-position-y"],name:"mask-position"},{name:"mask-repeat"},{name:"mask-size"},{keywords:["luminance","alpha"],name:"mask-type"},{keywords:["auto","min-content","max-content"],name:"masonry-auto-tracks"},{keywords:["row","row-reverse","column","column-reverse"],name:"masonry-direction"},{keywords:["normal","reverse"],name:"masonry-fill"},{longhands:["masonry-direction","masonry-fill"],name:"masonry-flow"},{keywords:["normal"],name:"masonry-slack"},{name:"masonry-template-tracks"},{longhands:["masonry-track-start","masonry-track-end"],name:"masonry-track"},{keywords:["auto"],name:"masonry-track-end"},{keywords:["auto"],name:"masonry-track-start"},{inherited:!0,name:"math-depth"},{inherited:!0,keywords:["normal","compact"],name:"math-shift"},{inherited:!0,keywords:["normal","compact"],name:"math-style"},{keywords:["none"],name:"max-block-size"},{keywords:["none"],name:"max-height"},{keywords:["none"],name:"max-inline-size"},{keywords:["none"],name:"max-width"},{name:"min-block-size"},{name:"min-height"},{name:"min-inline-size"},{name:"min-width"},{keywords:["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],name:"mix-blend-mode"},{name:"navigation"},{name:"negative"},{keywords:["fill","contain","cover","none","scale-down"],name:"object-fit"},{name:"object-position"},{keywords:["none"],name:"object-view-box"},{longhands:["offset-position","offset-path","offset-distance","offset-rotate","offset-anchor"],name:"offset"},{keywords:["auto"],name:"offset-anchor"},{name:"offset-distance"},{keywords:["none"],name:"offset-path"},{keywords:["auto","normal"],name:"offset-position"},{keywords:["auto","reverse"],name:"offset-rotate"},{name:"opacity"},{name:"order"},{keywords:["normal","none"],name:"origin-trial-test-property"},{inherited:!0,name:"orphans"},{longhands:["outline-color","outline-style","outline-width"],name:"outline"},{keywords:["currentcolor"],name:"outline-color"},{name:"outline-offset"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"outline-style"},{keywords:["thin","medium","thick"],name:"outline-width"},{longhands:["overflow-x","overflow-y"],name:"overflow"},{inherited:!1,keywords:["visible","none","auto"],name:"overflow-anchor"},{name:"overflow-block"},{keywords:["border-box","content-box","padding-box"],name:"overflow-clip-margin"},{name:"overflow-inline"},{inherited:!0,keywords:["normal","break-word","anywhere"],name:"overflow-wrap"},{keywords:["visible","hidden","scroll","auto","overlay","clip"],name:"overflow-x"},{keywords:["visible","hidden","scroll","auto","overlay","clip"],name:"overflow-y"},{keywords:["none","auto"],name:"overlay"},{name:"override-colors"},{longhands:["overscroll-behavior-x","overscroll-behavior-y"],name:"overscroll-behavior"},{name:"overscroll-behavior-block"},{name:"overscroll-behavior-inline"},{keywords:["auto","contain","none"],name:"overscroll-behavior-x"},{keywords:["auto","contain","none"],name:"overscroll-behavior-y"},{name:"pad"},{longhands:["padding-top","padding-right","padding-bottom","padding-left"],name:"padding"},{longhands:["padding-block-start","padding-block-end"],name:"padding-block"},{name:"padding-block-end"},{name:"padding-block-start"},{name:"padding-bottom"},{longhands:["padding-inline-start","padding-inline-end"],name:"padding-inline"},{name:"padding-inline-end"},{name:"padding-inline-start"},{name:"padding-left"},{name:"padding-right"},{name:"padding-top"},{keywords:["auto"],name:"page"},{longhands:["break-after"],name:"page-break-after"},{longhands:["break-before"],name:"page-break-before"},{longhands:["break-inside"],name:"page-break-inside"},{name:"page-orientation"},{inherited:!0,keywords:["normal","fill","stroke","markers"],name:"paint-order"},{keywords:["none"],name:"perspective"},{name:"perspective-origin"},{longhands:["align-content","justify-content"],name:"place-content"},{longhands:["align-items","justify-items"],name:"place-items"},{longhands:["align-self","justify-self"],name:"place-self"},{inherited:!0,keywords:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","bounding-box","all"],name:"pointer-events"},{keywords:["static","relative","absolute","fixed","sticky"],name:"position"},{keywords:["auto"],name:"position-anchor"},{keywords:["none","top","bottom","center","left","right","x-start","x-end","y-start","y-end","start","end","self-start","self-end","all"],name:"position-area"},{longhands:["position-try-order","position-try-fallbacks"],name:"position-try"},{keywords:["none","flip-block","flip-inline","flip-start"],name:"position-try-fallbacks"},{keywords:["normal","most-width","most-height","most-block-size","most-inline-size"],name:"position-try-order"},{keywords:["always","anchors-visible","no-overflow"],name:"position-visibility"},{name:"prefix"},{inherited:!0,keywords:["economy","exact"],name:"print-color-adjust"},{inherited:!0,keywords:["auto","none"],name:"quotes"},{name:"r"},{name:"range"},{keywords:["normal","flex-visual","flex-flow","grid-rows","grid-columns","grid-order","source-order"],name:"reading-flow"},{name:"reading-order"},{keywords:["none","both","horizontal","vertical","block","inline"],name:"resize"},{name:"result"},{keywords:["auto"],name:"right"},{name:"rotate"},{keywords:["normal"],name:"row-gap"},{inherited:!1,keywords:["none","spanning-item","intersection"],name:"row-rule-break"},{keywords:["currentcolor"],name:"row-rule-color"},{inherited:!1,name:"row-rule-outset"},{keywords:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"],name:"row-rule-style"},{keywords:["thin","medium","thick"],name:"row-rule-width"},{inherited:!0,keywords:["space-around","start","center","space-between"],name:"ruby-align"},{inherited:!0,keywords:["over","under"],name:"ruby-position"},{keywords:["auto"],name:"rx"},{keywords:["auto"],name:"ry"},{name:"scale"},{keywords:["auto","smooth"],name:"scroll-behavior"},{keywords:["none","nearest"],name:"scroll-initial-target"},{longhands:["scroll-margin-top","scroll-margin-right","scroll-margin-bottom","scroll-margin-left"],name:"scroll-margin"},{longhands:["scroll-margin-block-start","scroll-margin-block-end"],name:"scroll-margin-block"},{name:"scroll-margin-block-end"},{name:"scroll-margin-block-start"},{name:"scroll-margin-bottom"},{longhands:["scroll-margin-inline-start","scroll-margin-inline-end"],name:"scroll-margin-inline"},{name:"scroll-margin-inline-end"},{name:"scroll-margin-inline-start"},{name:"scroll-margin-left"},{name:"scroll-margin-right"},{name:"scroll-margin-top"},{keywords:["none","auto"],name:"scroll-marker-contain"},{keywords:["none","after","before"],name:"scroll-marker-group"},{longhands:["scroll-padding-top","scroll-padding-right","scroll-padding-bottom","scroll-padding-left"],name:"scroll-padding"},{longhands:["scroll-padding-block-start","scroll-padding-block-end"],name:"scroll-padding-block"},{keywords:["auto"],name:"scroll-padding-block-end"},{keywords:["auto"],name:"scroll-padding-block-start"},{keywords:["auto"],name:"scroll-padding-bottom"},{longhands:["scroll-padding-inline-start","scroll-padding-inline-end"],name:"scroll-padding-inline"},{keywords:["auto"],name:"scroll-padding-inline-end"},{keywords:["auto"],name:"scroll-padding-inline-start"},{keywords:["auto"],name:"scroll-padding-left"},{keywords:["auto"],name:"scroll-padding-right"},{keywords:["auto"],name:"scroll-padding-top"},{keywords:["none","start","end","center"],name:"scroll-snap-align"},{keywords:["normal","always"],name:"scroll-snap-stop"},{keywords:["none","x","y","block","inline","both","mandatory","proximity"],name:"scroll-snap-type"},{longhands:["scroll-start-block","scroll-start-inline"],name:"scroll-start"},{name:"scroll-start-block"},{name:"scroll-start-inline"},{name:"scroll-start-x"},{name:"scroll-start-y"},{longhands:["scroll-timeline-name","scroll-timeline-axis"],name:"scroll-timeline"},{name:"scroll-timeline-axis"},{name:"scroll-timeline-name"},{inherited:!0,keywords:["auto"],name:"scrollbar-color"},{inherited:!1,keywords:["auto","stable","both-edges"],name:"scrollbar-gutter"},{inherited:!1,keywords:["auto","thin","none"],name:"scrollbar-width"},{name:"shape-image-threshold"},{keywords:["none"],name:"shape-margin"},{keywords:["none"],name:"shape-outside"},{inherited:!0,keywords:["auto","optimizespeed","crispedges","geometricprecision"],name:"shape-rendering"},{name:"size"},{name:"size-adjust"},{inherited:!0,keywords:["none","normal","spell-out","digits","literal-punctuation","no-punctuation"],name:"speak"},{name:"speak-as"},{name:"src"},{keywords:["currentcolor"],name:"stop-color"},{name:"stop-opacity"},{inherited:!0,name:"stroke"},{inherited:!0,keywords:["none"],name:"stroke-dasharray"},{inherited:!0,name:"stroke-dashoffset"},{inherited:!0,keywords:["butt","round","square"],name:"stroke-linecap"},{inherited:!0,keywords:["miter","bevel","round"],name:"stroke-linejoin"},{inherited:!0,name:"stroke-miterlimit"},{inherited:!0,name:"stroke-opacity"},{inherited:!0,name:"stroke-width"},{name:"suffix"},{name:"symbols"},{name:"syntax"},{name:"system"},{inherited:!0,name:"tab-size"},{keywords:["auto","fixed"],name:"table-layout"},{inherited:!0,keywords:["left","right","center","justify","-webkit-left","-webkit-right","-webkit-center","start","end"],name:"text-align"},{inherited:!0,keywords:["auto","start","end","left","right","center","justify"],name:"text-align-last"},{inherited:!0,keywords:["start","middle","end"],name:"text-anchor"},{inherited:!0,keywords:["normal","no-autospace"],name:"text-autospace"},{longhands:["text-box-trim","text-box-edge"],name:"text-box"},{inherited:!0,name:"text-box-edge"},{keywords:["none","trim-start","trim-end","trim-both"],name:"text-box-trim"},{inherited:!0,keywords:["none","all"],name:"text-combine-upright"},{longhands:["text-decoration-line","text-decoration-thickness","text-decoration-style","text-decoration-color"],name:"text-decoration"},{keywords:["currentcolor"],name:"text-decoration-color"},{keywords:["none","underline","overline","line-through","blink","spelling-error","grammar-error"],name:"text-decoration-line"},{inherited:!0,keywords:["none","auto"],name:"text-decoration-skip-ink"},{keywords:["solid","double","dotted","dashed","wavy"],name:"text-decoration-style"},{inherited:!1,keywords:["auto","from-font"],name:"text-decoration-thickness"},{inherited:!0,longhands:["text-emphasis-style","text-emphasis-color"],name:"text-emphasis"},{inherited:!0,keywords:["currentcolor"],name:"text-emphasis-color"},{inherited:!0,name:"text-emphasis-position"},{inherited:!0,name:"text-emphasis-style"},{inherited:!0,name:"text-indent"},{inherited:!0,keywords:["sideways","mixed","upright"],name:"text-orientation"},{keywords:["clip","ellipsis"],name:"text-overflow"},{inherited:!0,keywords:["auto","optimizespeed","optimizelegibility","geometricprecision"],name:"text-rendering"},{inherited:!0,keywords:["none"],name:"text-shadow"},{inherited:!0,keywords:["none","auto"],name:"text-size-adjust"},{inherited:!0,longhands:["text-autospace","text-spacing-trim"],name:"text-spacing"},{inherited:!0,keywords:["normal","space-all","space-first","trim-start"],name:"text-spacing-trim"},{inherited:!0,keywords:["capitalize","uppercase","lowercase","none","math-auto"],name:"text-transform"},{inherited:!0,keywords:["auto"],name:"text-underline-offset"},{inherited:!0,keywords:["auto","from-font","under","left","right"],name:"text-underline-position"},{inherited:!0,longhands:["text-wrap-mode","text-wrap-style"],name:"text-wrap"},{inherited:!0,keywords:["wrap","nowrap"],name:"text-wrap-mode"},{inherited:!0,keywords:["auto","balance","pretty","stable"],name:"text-wrap-style"},{name:"timeline-scope"},{keywords:["auto"],name:"top"},{keywords:["auto","none","pan-x","pan-left","pan-right","pan-y","pan-up","pan-down","pinch-zoom","manipulation"],name:"touch-action"},{keywords:["none"],name:"transform"},{keywords:["content-box","border-box","fill-box","stroke-box","view-box"],name:"transform-box"},{name:"transform-origin"},{keywords:["flat","preserve-3d"],name:"transform-style"},{longhands:["transition-property","transition-duration","transition-timing-function","transition-delay","transition-behavior"],name:"transition"},{keywords:["normal","allow-discrete"],name:"transition-behavior"},{name:"transition-delay"},{name:"transition-duration"},{keywords:["none"],name:"transition-property"},{keywords:["linear","ease","ease-in","ease-out","ease-in-out","jump-both","jump-end","jump-none","jump-start","step-start","step-end"],name:"transition-timing-function"},{name:"translate"},{name:"types"},{keywords:["normal","embed","bidi-override","isolate","plaintext","isolate-override"],name:"unicode-bidi"},{name:"unicode-range"},{inherited:!0,keywords:["auto","none","text","all","contain"],name:"user-select"},{keywords:["none","non-scaling-stroke"],name:"vector-effect"},{keywords:["baseline","sub","super","text-top","text-bottom","middle"],name:"vertical-align"},{longhands:["view-timeline-name","view-timeline-axis","view-timeline-inset"],name:"view-timeline"},{name:"view-timeline-axis"},{name:"view-timeline-inset"},{name:"view-timeline-name"},{keywords:["none"],name:"view-transition-class"},{keywords:["normal","contain","nearest"],name:"view-transition-group"},{keywords:["none","auto"],name:"view-transition-name"},{inherited:!0,keywords:["visible","hidden","collapse"],name:"visibility"},{inherited:!0,longhands:["white-space-collapse","text-wrap-mode"],name:"white-space"},{inherited:!0,keywords:["collapse","preserve","preserve-breaks","break-spaces"],name:"white-space-collapse"},{inherited:!0,name:"widows"},{keywords:["auto","fit-content","min-content","max-content"],name:"width"},{keywords:["auto"],name:"will-change"},{inherited:!0,keywords:["normal","break-all","keep-all","break-word","auto-phrase"],name:"word-break"},{inherited:!0,keywords:["normal"],name:"word-spacing"},{inherited:!0,keywords:["horizontal-tb","vertical-rl","vertical-lr","sideways-rl","sideways-lr"],name:"writing-mode"},{name:"x"},{name:"y"},{keywords:["auto"],name:"z-index"},{name:"zoom"}],p={"-webkit-box-align":{values:["stretch","start","center","end","baseline"]},"-webkit-box-decoration-break":{values:["slice","clone"]},"-webkit-box-direction":{values:["normal","reverse"]},"-webkit-box-orient":{values:["horizontal","vertical"]},"-webkit-box-pack":{values:["start","center","end","justify"]},"-webkit-line-break":{values:["auto","loose","normal","strict","after-white-space","anywhere"]},"-webkit-line-clamp":{values:["none"]},"-webkit-rtl-ordering":{values:["logical","visual"]},"-webkit-text-security":{values:["none","disc","circle","square"]},"-webkit-user-drag":{values:["auto","none","element"]},"-webkit-user-modify":{values:["read-only","read-write","read-write-plaintext-only"]},"accent-color":{values:["auto","currentcolor"]},"alignment-baseline":{values:["auto","baseline","alphabetic","ideographic","middle","central","mathematical","before-edge","text-before-edge","after-edge","text-after-edge","hanging"]},"anchor-name":{values:["none"]},"anchor-scope":{values:["none","all"]},"animation-composition":{values:["replace","add","accumulate"]},"animation-direction":{values:["normal","reverse","alternate","alternate-reverse"]},"animation-fill-mode":{values:["none","forwards","backwards","both"]},"animation-iteration-count":{values:["infinite"]},"animation-name":{values:["none"]},"animation-play-state":{values:["running","paused"]},"animation-timeline":{values:["none","auto"]},"animation-timing-function":{values:["linear","ease","ease-in","ease-out","ease-in-out","jump-both","jump-end","jump-none","jump-start","step-start","step-end"]},"animation-trigger-timeline":{values:["none","auto"]},"animation-trigger-type":{values:["once","repeat","alternate","state"]},"app-region":{values:["none","drag","no-drag"]},"aspect-ratio":{values:["auto"]},"backdrop-filter":{values:["none"]},"backface-visibility":{values:["visible","hidden"]},"background-attachment":{values:["scroll","fixed","local"]},"background-blend-mode":{values:["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},"background-clip":{values:["border-box","padding-box","content-box","text"]},"background-color":{values:["currentcolor"]},"background-image":{values:["auto","none"]},"background-origin":{values:["border-box","padding-box","content-box"]},"background-size":{values:["auto","cover","contain"]},"baseline-shift":{values:["baseline","sub","super"]},"baseline-source":{values:["auto","first","last"]},"block-size":{values:["auto"]},"border-bottom-color":{values:["currentcolor"]},"border-bottom-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"border-bottom-width":{values:["thin","medium","thick"]},"border-collapse":{values:["separate","collapse"]},"border-image-repeat":{values:["stretch","repeat","round","space"]},"border-image-source":{values:["none"]},"border-image-width":{values:["auto"]},"border-left-color":{values:["currentcolor"]},"border-left-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"border-left-width":{values:["thin","medium","thick"]},"border-right-color":{values:["currentcolor"]},"border-right-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"border-right-width":{values:["thin","medium","thick"]},"border-style":{values:["none"]},"border-top-color":{values:["currentcolor"]},"border-top-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"border-top-width":{values:["thin","medium","thick"]},bottom:{values:["auto"]},"box-decoration-break":{values:["slice","clone"]},"box-shadow":{values:["none"]},"box-sizing":{values:["content-box","border-box"]},"break-after":{values:["auto","avoid","avoid-column","avoid-page","column","left","page","recto","right","verso"]},"break-before":{values:["auto","avoid","avoid-column","avoid-page","column","left","page","recto","right","verso"]},"break-inside":{values:["auto","avoid","avoid-column","avoid-page"]},"buffered-rendering":{values:["auto","dynamic","static"]},"caption-side":{values:["top","bottom"]},"caret-animation":{values:["auto","manual"]},"caret-color":{values:["auto","currentcolor"]},clear:{values:["none","left","right","both","inline-start","inline-end"]},clip:{values:["auto"]},"clip-path":{values:["border-box","padding-box","content-box","margin-box","fill-box","stroke-box","view-box","none"]},"clip-rule":{values:["nonzero","evenodd"]},color:{values:["currentcolor"]},"color-interpolation":{values:["auto","srgb","linearrgb"]},"color-interpolation-filters":{values:["auto","srgb","linearrgb"]},"color-rendering":{values:["auto","optimizespeed","optimizequality"]},"column-count":{values:["auto"]},"column-fill":{values:["balance","auto"]},"column-gap":{values:["normal"]},"column-height":{values:["auto"]},"column-rule-break":{values:["none","spanning-item","intersection"]},"column-rule-color":{values:["currentcolor"]},"column-rule-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"column-rule-width":{values:["thin","medium","thick"]},"column-span":{values:["none","all"]},"column-width":{values:["auto"]},"column-wrap":{values:["nowrap","wrap"]},contain:{values:["none","strict","content","size","layout","style","paint","inline-size","block-size"]},"contain-intrinsic-height":{values:["none"]},"contain-intrinsic-width":{values:["none"]},"container-name":{values:["none"]},"container-type":{values:["normal","inline-size","size","scroll-state"]},"content-visibility":{values:["visible","auto","hidden"]},"counter-increment":{values:["none"]},"counter-reset":{values:["none"]},"counter-set":{values:["none"]},cursor:{values:["auto","default","none","context-menu","help","pointer","progress","wait","cell","crosshair","text","vertical-text","alias","copy","move","no-drop","not-allowed","e-resize","n-resize","ne-resize","nw-resize","s-resize","se-resize","sw-resize","w-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","col-resize","row-resize","all-scroll","zoom-in","zoom-out","grab","grabbing"]},d:{values:["none"]},direction:{values:["ltr","rtl"]},display:{values:["inline","block","list-item","inline-block","table","inline-table","table-row-group","table-header-group","table-footer-group","table-row","table-column-group","table-column","table-cell","table-caption","-webkit-box","-webkit-inline-box","flex","inline-flex","grid","inline-grid","contents","flow-root","none","flow","math","ruby","ruby-text","masonry","inline-masonry"]},"dominant-baseline":{values:["auto","alphabetic","ideographic","middle","central","mathematical","hanging","use-script","no-change","reset-size","text-after-edge","text-before-edge"]},"dynamic-range-limit":{values:["standard","no-limit","constrained"]},"empty-cells":{values:["show","hide"]},"field-sizing":{values:["fixed","content"]},"fill-rule":{values:["nonzero","evenodd"]},filter:{values:["none"]},"flex-basis":{values:["auto","fit-content","min-content","max-content","content"]},"flex-direction":{values:["row","row-reverse","column","column-reverse"]},"flex-wrap":{values:["nowrap","wrap","wrap-reverse"]},float:{values:["none","left","right","inline-start","inline-end"]},"flood-color":{values:["currentcolor"]},"font-feature-settings":{values:["normal"]},"font-kerning":{values:["auto","normal","none"]},"font-optical-sizing":{values:["auto","none"]},"font-palette":{values:["normal","light","dark"]},"font-size":{values:["xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","larger","smaller","-webkit-xxx-large"]},"font-size-adjust":{values:["none","ex-height","cap-height","ch-width","ic-width","ic-height","from-font"]},"font-stretch":{values:["normal","ultra-condensed","extra-condensed","condensed","semi-condensed","semi-expanded","expanded","extra-expanded","ultra-expanded"]},"font-style":{values:["normal","italic","oblique"]},"font-synthesis-small-caps":{values:["auto","none"]},"font-synthesis-style":{values:["auto","none"]},"font-synthesis-weight":{values:["auto","none"]},"font-variant-alternates":{values:["normal"]},"font-variant-caps":{values:["normal","small-caps","all-small-caps","petite-caps","all-petite-caps","unicase","titling-caps"]},"font-variant-east-asian":{values:["normal","jis78","jis83","jis90","jis04","simplified","traditional","full-width","proportional-width","ruby"]},"font-variant-emoji":{values:["normal","text","emoji","unicode"]},"font-variant-ligatures":{values:["normal","none","common-ligatures","no-common-ligatures","discretionary-ligatures","no-discretionary-ligatures","historical-ligatures","no-historical-ligatures","contextual","no-contextual"]},"font-variant-numeric":{values:["normal","lining-nums","oldstyle-nums","proportional-nums","tabular-nums","diagonal-fractions","stacked-fractions","ordinal","slashed-zero"]},"font-variant-position":{values:["normal","sub","super"]},"font-variation-settings":{values:["normal"]},"font-weight":{values:["normal","bold","bolder","lighter"]},"forced-color-adjust":{values:["auto","none","preserve-parent-color"]},"gap-rule-paint-order":{values:["row-over-column","column-over-row"]},"grid-auto-columns":{values:["auto","min-content","max-content"]},"grid-auto-flow":{values:["row","column"]},"grid-auto-rows":{values:["auto","min-content","max-content"]},"grid-column-end":{values:["auto"]},"grid-column-start":{values:["auto"]},"grid-row-end":{values:["auto"]},"grid-row-start":{values:["auto"]},"grid-template-areas":{values:["none"]},"grid-template-columns":{values:["none"]},"grid-template-rows":{values:["none"]},height:{values:["auto","fit-content","min-content","max-content"]},"hyphenate-limit-chars":{values:["auto"]},hyphens:{values:["none","manual","auto"]},"image-rendering":{values:["auto","optimizespeed","optimizequality","-webkit-optimize-contrast","pixelated"]},"initial-letter":{values:["drop","normal","raise"]},"inline-size":{values:["auto"]},interactivity:{values:["auto","inert"]},"interpolate-size":{values:["numeric-only","allow-keywords"]},isolation:{values:["auto","isolate"]},left:{values:["auto"]},"letter-spacing":{values:["normal"]},"lighting-color":{values:["currentcolor"]},"line-break":{values:["auto","loose","normal","strict","anywhere"]},"line-clamp":{values:["none","auto"]},"line-height":{values:["normal"]},"list-style-image":{values:["none"]},"list-style-position":{values:["outside","inside"]},"list-style-type":{values:["disc","circle","square","disclosure-open","disclosure-closed","decimal","none"]},"margin-block-end":{values:["auto"]},"margin-block-start":{values:["auto"]},"margin-bottom":{values:["auto"]},"margin-inline-end":{values:["auto"]},"margin-inline-start":{values:["auto"]},"margin-left":{values:["auto"]},"margin-right":{values:["auto"]},"margin-top":{values:["auto"]},"marker-end":{values:["none"]},"marker-mid":{values:["none"]},"marker-start":{values:["none"]},"mask-type":{values:["luminance","alpha"]},"masonry-auto-tracks":{values:["auto","min-content","max-content"]},"masonry-direction":{values:["row","row-reverse","column","column-reverse"]},"masonry-fill":{values:["normal","reverse"]},"masonry-slack":{values:["normal"]},"masonry-track-end":{values:["auto"]},"masonry-track-start":{values:["auto"]},"math-shift":{values:["normal","compact"]},"math-style":{values:["normal","compact"]},"max-block-size":{values:["none"]},"max-height":{values:["none"]},"max-inline-size":{values:["none"]},"max-width":{values:["none"]},"mix-blend-mode":{values:["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"]},"object-fit":{values:["fill","contain","cover","none","scale-down"]},"object-view-box":{values:["none"]},"offset-anchor":{values:["auto"]},"offset-path":{values:["none"]},"offset-position":{values:["auto","normal"]},"offset-rotate":{values:["auto","reverse"]},"origin-trial-test-property":{values:["normal","none"]},"outline-color":{values:["currentcolor"]},"outline-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"outline-width":{values:["thin","medium","thick"]},"overflow-anchor":{values:["visible","none","auto"]},"overflow-clip-margin":{values:["border-box","content-box","padding-box"]},"overflow-wrap":{values:["normal","break-word","anywhere"]},"overflow-x":{values:["visible","hidden","scroll","auto","overlay","clip"]},"overflow-y":{values:["visible","hidden","scroll","auto","overlay","clip"]},overlay:{values:["none","auto"]},"overscroll-behavior-x":{values:["auto","contain","none"]},"overscroll-behavior-y":{values:["auto","contain","none"]},page:{values:["auto"]},"paint-order":{values:["normal","fill","stroke","markers"]},perspective:{values:["none"]},"pointer-events":{values:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","bounding-box","all"]},position:{values:["static","relative","absolute","fixed","sticky"]},"position-anchor":{values:["auto"]},"position-area":{values:["none","top","bottom","center","left","right","x-start","x-end","y-start","y-end","start","end","self-start","self-end","all"]},"position-try-fallbacks":{values:["none","flip-block","flip-inline","flip-start"]},"position-try-order":{values:["normal","most-width","most-height","most-block-size","most-inline-size"]},"position-visibility":{values:["always","anchors-visible","no-overflow"]},"print-color-adjust":{values:["economy","exact"]},quotes:{values:["auto","none"]},"reading-flow":{values:["normal","flex-visual","flex-flow","grid-rows","grid-columns","grid-order","source-order"]},resize:{values:["none","both","horizontal","vertical","block","inline"]},right:{values:["auto"]},"row-gap":{values:["normal"]},"row-rule-break":{values:["none","spanning-item","intersection"]},"row-rule-color":{values:["currentcolor"]},"row-rule-style":{values:["none","hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"]},"row-rule-width":{values:["thin","medium","thick"]},"ruby-align":{values:["space-around","start","center","space-between"]},"ruby-position":{values:["over","under"]},rx:{values:["auto"]},ry:{values:["auto"]},"scroll-behavior":{values:["auto","smooth"]},"scroll-initial-target":{values:["none","nearest"]},"scroll-marker-contain":{values:["none","auto"]},"scroll-marker-group":{values:["none","after","before"]},"scroll-padding-block-end":{values:["auto"]},"scroll-padding-block-start":{values:["auto"]},"scroll-padding-bottom":{values:["auto"]},"scroll-padding-inline-end":{values:["auto"]},"scroll-padding-inline-start":{values:["auto"]},"scroll-padding-left":{values:["auto"]},"scroll-padding-right":{values:["auto"]},"scroll-padding-top":{values:["auto"]},"scroll-snap-align":{values:["none","start","end","center"]},"scroll-snap-stop":{values:["normal","always"]},"scroll-snap-type":{values:["none","x","y","block","inline","both","mandatory","proximity"]},"scrollbar-color":{values:["auto"]},"scrollbar-gutter":{values:["auto","stable","both-edges"]},"scrollbar-width":{values:["auto","thin","none"]},"shape-margin":{values:["none"]},"shape-outside":{values:["none"]},"shape-rendering":{values:["auto","optimizespeed","crispedges","geometricprecision"]},speak:{values:["none","normal","spell-out","digits","literal-punctuation","no-punctuation"]},"stop-color":{values:["currentcolor"]},"stroke-dasharray":{values:["none"]},"stroke-linecap":{values:["butt","round","square"]},"stroke-linejoin":{values:["miter","bevel","round"]},"table-layout":{values:["auto","fixed"]},"text-align":{values:["left","right","center","justify","-webkit-left","-webkit-right","-webkit-center","start","end"]},"text-align-last":{values:["auto","start","end","left","right","center","justify"]},"text-anchor":{values:["start","middle","end"]},"text-autospace":{values:["normal","no-autospace"]},"text-box-trim":{values:["none","trim-start","trim-end","trim-both"]},"text-combine-upright":{values:["none","all"]},"text-decoration-color":{values:["currentcolor"]},"text-decoration-line":{values:["none","underline","overline","line-through","blink","spelling-error","grammar-error"]},"text-decoration-skip-ink":{values:["none","auto"]},"text-decoration-style":{values:["solid","double","dotted","dashed","wavy"]},"text-decoration-thickness":{values:["auto","from-font"]},"text-emphasis-color":{values:["currentcolor"]},"text-orientation":{values:["sideways","mixed","upright"]},"text-overflow":{values:["clip","ellipsis"]},"text-rendering":{values:["auto","optimizespeed","optimizelegibility","geometricprecision"]},"text-shadow":{values:["none"]},"text-size-adjust":{values:["none","auto"]},"text-spacing-trim":{values:["normal","space-all","space-first","trim-start"]},"text-transform":{values:["capitalize","uppercase","lowercase","none","math-auto"]},"text-underline-offset":{values:["auto"]},"text-underline-position":{values:["auto","from-font","under","left","right"]},"text-wrap-mode":{values:["wrap","nowrap"]},"text-wrap-style":{values:["auto","balance","pretty","stable"]},top:{values:["auto"]},"touch-action":{values:["auto","none","pan-x","pan-left","pan-right","pan-y","pan-up","pan-down","pinch-zoom","manipulation"]},transform:{values:["none"]},"transform-box":{values:["content-box","border-box","fill-box","stroke-box","view-box"]},"transform-style":{values:["flat","preserve-3d"]},"transition-behavior":{values:["normal","allow-discrete"]},"transition-property":{values:["none"]},"transition-timing-function":{values:["linear","ease","ease-in","ease-out","ease-in-out","jump-both","jump-end","jump-none","jump-start","step-start","step-end"]},"unicode-bidi":{values:["normal","embed","bidi-override","isolate","plaintext","isolate-override"]},"user-select":{values:["auto","none","text","all","contain"]},"vector-effect":{values:["none","non-scaling-stroke"]},"vertical-align":{values:["baseline","sub","super","text-top","text-bottom","middle"]},"view-transition-class":{values:["none"]},"view-transition-group":{values:["normal","contain","nearest"]},"view-transition-name":{values:["none","auto"]},visibility:{values:["visible","hidden","collapse"]},"white-space-collapse":{values:["collapse","preserve","preserve-breaks","break-spaces"]},width:{values:["auto","fit-content","min-content","max-content"]},"will-change":{values:["auto"]},"word-break":{values:["normal","break-all","keep-all","break-word","auto-phrase"]},"word-spacing":{values:["normal"]},"writing-mode":{values:["horizontal-tb","vertical-rl","vertical-lr","sideways-rl","sideways-lr"]},"z-index":{values:["auto"]}},m=new Map([["-epub-caption-side","caption-side"],["-epub-text-combine","-webkit-text-combine"],["-epub-text-emphasis","text-emphasis"],["-epub-text-emphasis-color","text-emphasis-color"],["-epub-text-emphasis-style","text-emphasis-style"],["-epub-text-orientation","-webkit-text-orientation"],["-epub-text-transform","text-transform"],["-epub-word-break","word-break"],["-epub-writing-mode","-webkit-writing-mode"],["-webkit-align-content","align-content"],["-webkit-align-items","align-items"],["-webkit-align-self","align-self"],["-webkit-animation","animation"],["-webkit-animation-delay","animation-delay"],["-webkit-animation-direction","animation-direction"],["-webkit-animation-duration","animation-duration"],["-webkit-animation-fill-mode","animation-fill-mode"],["-webkit-animation-iteration-count","animation-iteration-count"],["-webkit-animation-name","animation-name"],["-webkit-animation-play-state","animation-play-state"],["-webkit-animation-timing-function","animation-timing-function"],["-webkit-app-region","app-region"],["-webkit-appearance","appearance"],["-webkit-backface-visibility","backface-visibility"],["-webkit-background-clip","background-clip"],["-webkit-background-origin","background-origin"],["-webkit-background-size","background-size"],["-webkit-border-after","border-block-end"],["-webkit-border-after-color","border-block-end-color"],["-webkit-border-after-style","border-block-end-style"],["-webkit-border-after-width","border-block-end-width"],["-webkit-border-before","border-block-start"],["-webkit-border-before-color","border-block-start-color"],["-webkit-border-before-style","border-block-start-style"],["-webkit-border-before-width","border-block-start-width"],["-webkit-border-bottom-left-radius","border-bottom-left-radius"],["-webkit-border-bottom-right-radius","border-bottom-right-radius"],["-webkit-border-end","border-inline-end"],["-webkit-border-end-color","border-inline-end-color"],["-webkit-border-end-style","border-inline-end-style"],["-webkit-border-end-width","border-inline-end-width"],["-webkit-border-radius","border-radius"],["-webkit-border-start","border-inline-start"],["-webkit-border-start-color","border-inline-start-color"],["-webkit-border-start-style","border-inline-start-style"],["-webkit-border-start-width","border-inline-start-width"],["-webkit-border-top-left-radius","border-top-left-radius"],["-webkit-border-top-right-radius","border-top-right-radius"],["-webkit-box-shadow","box-shadow"],["-webkit-box-sizing","box-sizing"],["-webkit-clip-path","clip-path"],["-webkit-column-count","column-count"],["-webkit-column-gap","column-gap"],["-webkit-column-rule","column-rule"],["-webkit-column-rule-color","column-rule-color"],["-webkit-column-rule-style","column-rule-style"],["-webkit-column-rule-width","column-rule-width"],["-webkit-column-span","column-span"],["-webkit-column-width","column-width"],["-webkit-columns","columns"],["-webkit-filter","filter"],["-webkit-flex","flex"],["-webkit-flex-basis","flex-basis"],["-webkit-flex-direction","flex-direction"],["-webkit-flex-flow","flex-flow"],["-webkit-flex-grow","flex-grow"],["-webkit-flex-shrink","flex-shrink"],["-webkit-flex-wrap","flex-wrap"],["-webkit-font-feature-settings","font-feature-settings"],["-webkit-hyphenate-character","hyphenate-character"],["-webkit-justify-content","justify-content"],["-webkit-logical-height","block-size"],["-webkit-logical-width","inline-size"],["-webkit-margin-after","margin-block-end"],["-webkit-margin-before","margin-block-start"],["-webkit-margin-end","margin-inline-end"],["-webkit-margin-start","margin-inline-start"],["-webkit-mask","mask"],["-webkit-mask-clip","mask-clip"],["-webkit-mask-composite","mask-composite"],["-webkit-mask-image","mask-image"],["-webkit-mask-origin","mask-origin"],["-webkit-mask-position","mask-position"],["-webkit-mask-repeat","mask-repeat"],["-webkit-mask-size","mask-size"],["-webkit-max-logical-height","max-block-size"],["-webkit-max-logical-width","max-inline-size"],["-webkit-min-logical-height","min-block-size"],["-webkit-min-logical-width","min-inline-size"],["-webkit-opacity","opacity"],["-webkit-order","order"],["-webkit-padding-after","padding-block-end"],["-webkit-padding-before","padding-block-start"],["-webkit-padding-end","padding-inline-end"],["-webkit-padding-start","padding-inline-start"],["-webkit-perspective","perspective"],["-webkit-perspective-origin","perspective-origin"],["-webkit-print-color-adjust","print-color-adjust"],["-webkit-shape-image-threshold","shape-image-threshold"],["-webkit-shape-margin","shape-margin"],["-webkit-shape-outside","shape-outside"],["-webkit-text-emphasis","text-emphasis"],["-webkit-text-emphasis-color","text-emphasis-color"],["-webkit-text-emphasis-position","text-emphasis-position"],["-webkit-text-emphasis-style","text-emphasis-style"],["-webkit-text-size-adjust","text-size-adjust"],["-webkit-transform","transform"],["-webkit-transform-origin","transform-origin"],["-webkit-transform-style","transform-style"],["-webkit-transition","transition"],["-webkit-transition-delay","transition-delay"],["-webkit-transition-duration","transition-duration"],["-webkit-transition-property","transition-property"],["-webkit-transition-timing-function","transition-timing-function"],["-webkit-user-select","user-select"],["grid-column-gap","column-gap"],["grid-gap","gap"],["grid-row-gap","row-gap"],["word-wrap","overflow-wrap"]]);class f{#t=[];#n=new Map;#r=new Map;#s=new Set;#i=new Set;#o=new Map;#a=new Map;#l=[];#d=[];#c;constructor(e,t){this.#a=t;for(let t=0;tCSS.supports(e,t))).sort(f.sortPrefixesAndCSSWideKeywordsToEnd).map((t=>`${e}: ${t}`));this.isSVGProperty(e)||this.#l.push(...t),this.#d.push(...t)}}static isCSSWideKeyword(e){return y.includes(e)}static isPositionTryOrderKeyword(e){return v.includes(e)}static sortPrefixesAndCSSWideKeywordsToEnd(e,t){const n=f.isCSSWideKeyword(e),r=f.isCSSWideKeyword(t);if(n&&!r)return 1;if(!n&&r)return-1;const s=e.startsWith("-webkit-"),i=t.startsWith("-webkit-");return s&&!i?1:!s&&i||et?1:0}allProperties(){return this.#t}aliasesFor(){return this.#a}nameValuePresets(e){return e?this.#d:this.#l}isSVGProperty(e){return e=e.toLowerCase(),this.#i.has(e)}getLonghands(e){return this.#n.get(e)||null}getShorthands(e){return this.#r.get(e)||null}isColorAwareProperty(e){return E.has(e.toLowerCase())||this.isCustomProperty(e.toLowerCase())}isFontFamilyProperty(e){return"font-family"===e.toLowerCase()}isAngleAwareProperty(e){const t=e.toLowerCase();return E.has(t)||L.has(t)}isGridAreaDefiningProperty(e){return"grid"===(e=e.toLowerCase())||"grid-template"===e||"grid-template-areas"===e}isGridColumnNameAwareProperty(e){return e=e.toLowerCase(),["grid-column","grid-column-start","grid-column-end"].includes(e)}isGridRowNameAwareProperty(e){return e=e.toLowerCase(),["grid-row","grid-row-start","grid-row-end"].includes(e)}isGridAreaNameAwareProperty(e){return"grid-area"===(e=e.toLowerCase())}isGridNameAwareProperty(e){return this.isGridAreaNameAwareProperty(e)||this.isGridColumnNameAwareProperty(e)||this.isGridRowNameAwareProperty(e)}isLengthProperty(e){return"line-height"!==(e=e.toLowerCase())&&(T.has(e)||e.startsWith("margin")||e.startsWith("padding")||-1!==e.indexOf("width")||-1!==e.indexOf("height"))}isBezierAwareProperty(e){return e=e.toLowerCase(),M.has(e)||this.isCustomProperty(e)}isFontAwareProperty(e){return e=e.toLowerCase(),P.has(e)||this.isCustomProperty(e)}isCustomProperty(e){return e.startsWith("--")}isShadowProperty(e){return"box-shadow"===(e=e.toLowerCase())||"text-shadow"===e||"-webkit-box-shadow"===e}isStringProperty(e){return"content"===(e=e.toLowerCase())}canonicalPropertyName(e){if(this.isCustomProperty(e))return e;e=e.toLowerCase();const t=this.#a.get(e);if(t)return t;if(!e||e.length<9||"-"!==e.charAt(0))return e;const n=e.match(/(?:-webkit-)(.+)/);return n&&this.#c.has(n[1])?n[1]:e}isCSSPropertyName(e){return!!((e=e.toLowerCase()).startsWith("--")&&e.length>2||e.startsWith("-moz-")||e.startsWith("-ms-")||e.startsWith("-o-")||e.startsWith("-webkit-"))||this.#c.has(e)}isPropertyInherited(e){return(e=e.toLowerCase()).startsWith("--")||this.#s.has(this.canonicalPropertyName(e))||this.#s.has(e)}specificPropertyValues(e){const t=e.replace(/^-webkit-/,""),n=this.#o;let r=n.get(e)||n.get(t);if(!r){r=[];for(const t of F)CSS.supports(e,t)&&r.push(t);n.set(e,r)}return r}getPropertyValues(t){t=t.toLowerCase();const n=[...this.specificPropertyValues(t),...y];if(this.isColorAwareProperty(t)){n.push("currentColor");for(const t of e.Color.Nicknames.keys())n.push(t)}return n.sort(f.sortPrefixesAndCSSWideKeywordsToEnd)}propertyUsageWeight(e){return N.get(e)||N.get(this.canonicalPropertyName(e))||0}getValuePreset(e,t){const n=R.get(e);let r=n?n.get(t):null;if(!r)return null;let s=r.length,i=r.length;return r&&(s=r.indexOf("|"),i=r.lastIndexOf("|"),i=s===i?i:i-1,r=r.replace(/\|/g,"")),{text:r,startColumn:s,endColumn:i}}isHighlightPseudoType(e){return"highlight"===e||"selection"===e||"target-text"===e||"grammar-error"===e||"spelling-error"===e}}const b=new Map([["linear","cubic-bezier(0, 0, 1, 1)"],["ease","cubic-bezier(0.25, 0.1, 0.25, 1)"],["ease-in","cubic-bezier(0.42, 0, 1, 1)"],["ease-in-out","cubic-bezier(0.42, 0, 0.58, 1)"],["ease-out","cubic-bezier(0, 0, 0.58, 1)"]]),y=["inherit","initial","revert","revert-layer","unset"],v=["normal","most-height","most-width","most-block-size","most-inline-size"],I=/((?:\[[\w\- ]+\]\s*)*(?:"[^"]+"|'[^']+'))[^'"\[]*\[?[^'"\[]*/;let w=null;function S(){if(!w){w=new f(g,m)}return w}const k=new Map([["linear-gradient","linear-gradient(|45deg, black, transparent|)"],["radial-gradient","radial-gradient(|black, transparent|)"],["repeating-linear-gradient","repeating-linear-gradient(|45deg, black, transparent 100px|)"],["repeating-radial-gradient","repeating-radial-gradient(|black, transparent 100px|)"],["url","url(||)"]]),C=new Map([["blur","blur(|1px|)"],["brightness","brightness(|0.5|)"],["contrast","contrast(|0.5|)"],["drop-shadow","drop-shadow(|2px 4px 6px black|)"],["grayscale","grayscale(|1|)"],["hue-rotate","hue-rotate(|45deg|)"],["invert","invert(|1|)"],["opacity","opacity(|0.5|)"],["saturate","saturate(|0.5|)"],["sepia","sepia(|1|)"],["url","url(||)"]]),x=new Map([["superellipse(0.5)","superellipse(|0.5|)"],["superellipse(infinity)","superellipse(|infinity|)"]]),R=new Map([["filter",C],["backdrop-filter",C],["background",k],["background-image",k],["-webkit-mask-image",k],["transform",new Map([["scale","scale(|1.5|)"],["scaleX","scaleX(|1.5|)"],["scaleY","scaleY(|1.5|)"],["scale3d","scale3d(|1.5, 1.5, 1.5|)"],["rotate","rotate(|45deg|)"],["rotateX","rotateX(|45deg|)"],["rotateY","rotateY(|45deg|)"],["rotateZ","rotateZ(|45deg|)"],["rotate3d","rotate3d(|1, 1, 1, 45deg|)"],["skew","skew(|10deg, 10deg|)"],["skewX","skewX(|10deg|)"],["skewY","skewY(|10deg|)"],["translate","translate(|10px, 10px|)"],["translateX","translateX(|10px|)"],["translateY","translateY(|10px|)"],["translateZ","translateZ(|10px|)"],["translate3d","translate3d(|10px, 10px, 10px|)"],["matrix","matrix(|1, 0, 0, 1, 0, 0|)"],["matrix3d","matrix3d(|1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1|)"],["perspective","perspective(|10px|)"]])],["corner-shape",x]]),T=new Set(["background-position","border-spacing","bottom","font-size","height","left","letter-spacing","max-height","max-width","min-height","min-width","right","text-indent","top","width","word-spacing","grid-row-gap","grid-column-gap","row-gap"]),M=new Set(["animation","animation-timing-function","transition","transition-timing-function","-webkit-animation","-webkit-animation-timing-function","-webkit-transition","-webkit-transition-timing-function"]),P=new Set(["font-size","line-height","font-weight","font-family","letter-spacing"]),E=new Set(["accent-color","background","background-color","background-image","border","border-color","border-image","border-image-source","border-bottom","border-bottom-color","border-left","border-left-color","border-right","border-right-color","border-top","border-top-color","border-block","border-block-color","border-block-end","border-block-end-color","border-block-start","border-block-start-color","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-start","border-inline-start-color","box-shadow","caret-color","color","column-rule","column-rule-color","content","fill","list-style-image","mask","mask-image","mask-border","mask-border-source","outline","outline-color","scrollbar-color","stop-color","stroke","text-decoration-color","text-shadow","text-emphasis","text-emphasis-color","-webkit-border-after","-webkit-border-after-color","-webkit-border-before","-webkit-border-before-color","-webkit-border-end","-webkit-border-end-color","-webkit-border-start","-webkit-border-start-color","-webkit-box-reflect","-webkit-box-shadow","-webkit-column-rule-color","-webkit-mask","-webkit-mask-box-image","-webkit-mask-box-image-source","-webkit-mask-image","-webkit-tap-highlight-color","-webkit-text-emphasis","-webkit-text-emphasis-color","-webkit-text-fill-color","-webkit-text-stroke","-webkit-text-stroke-color","flood-color","lighting-color","stop-color"]),L=new Set(["-webkit-border-image","transform","-webkit-transform","rotate","filter","-webkit-filter","backdrop-filter","offset","offset-rotate","font-style"]),A=new Set(["over","under","over right","over left","under right","under left"]),O=new Set(["none","dot","circle","double-circle","triangle","sesame","filled","open","dot open","circle open","double-circle open","triangle open","sesame open",'"❤️"']),D=new Map([["background-repeat",new Set(["repeat","repeat-x","repeat-y","no-repeat","space","round"])],["content",new Set(["normal","close-quote","no-close-quote","no-open-quote","open-quote"])],["baseline-shift",new Set(["baseline"])],["max-height",new Set(["min-content","max-content","-webkit-fill-available","fit-content"])],["color",new Set(["black"])],["background-color",new Set(["white"])],["box-shadow",new Set(["inset"])],["text-shadow",new Set(["0 0 black"])],["-webkit-writing-mode",new Set(["horizontal-tb","vertical-rl","vertical-lr"])],["writing-mode",new Set(["lr","rl","tb","lr-tb","rl-tb","tb-rl"])],["page-break-inside",new Set(["avoid"])],["cursor",new Set(["-webkit-zoom-in","-webkit-zoom-out","-webkit-grab","-webkit-grabbing"])],["border-width",new Set(["medium","thick","thin"])],["border-style",new Set(["hidden","inset","groove","ridge","outset","dotted","dashed","solid","double"])],["size",new Set(["a3","a4","a5","b4","b5","landscape","ledger","legal","letter","portrait"])],["overflow",new Set(["hidden","visible","overlay","scroll"])],["overscroll-behavior",new Set(["contain"])],["text-rendering",new Set(["optimizeSpeed","optimizeLegibility","geometricPrecision"])],["text-align",new Set(["-webkit-auto","-webkit-match-parent"])],["clip-path",new Set(["circle","ellipse","inset","polygon","url"])],["color-interpolation",new Set(["sRGB","linearRGB"])],["word-wrap",new Set(["normal","break-word"])],["font-weight",new Set(["100","200","300","400","500","600","700","800","900"])],["text-emphasis",O],["-webkit-text-emphasis",O],["color-rendering",new Set(["optimizeSpeed","optimizeQuality"])],["-webkit-text-combine",new Set(["horizontal"])],["text-orientation",new Set(["sideways-right"])],["outline",new Set(["inset","groove","ridge","outset","dotted","dashed","solid","double","medium","thick","thin"])],["font",new Set(["caption","icon","menu","message-box","small-caption","-webkit-mini-control","-webkit-small-control","-webkit-control","status-bar"])],["dominant-baseline",new Set(["text-before-edge","text-after-edge","use-script","no-change","reset-size"])],["text-emphasis-position",A],["-webkit-text-emphasis-position",A],["alignment-baseline",new Set(["before-edge","after-edge","text-before-edge","text-after-edge","hanging"])],["page-break-before",new Set(["left","right","always","avoid"])],["border-image",new Set(["repeat","stretch","space","round"])],["text-decoration",new Set(["blink","line-through","overline","underline","wavy","double","solid","dashed","dotted"])],["font-family",new Set(["serif","sans-serif","cursive","fantasy","monospace","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","-webkit-body"])],["zoom",new Set(["normal"])],["max-width",new Set(["min-content","max-content","-webkit-fill-available","fit-content"])],["-webkit-font-smoothing",new Set(["antialiased","subpixel-antialiased"])],["border",new Set(["hidden","inset","groove","ridge","outset","dotted","dashed","solid","double","medium","thick","thin"])],["font-variant",new Set(["small-caps","normal","common-ligatures","no-common-ligatures","discretionary-ligatures","no-discretionary-ligatures","historical-ligatures","no-historical-ligatures","contextual","no-contextual","all-small-caps","petite-caps","all-petite-caps","unicase","titling-caps","lining-nums","oldstyle-nums","proportional-nums","tabular-nums","diagonal-fractions","stacked-fractions","ordinal","slashed-zero","jis78","jis83","jis90","jis04","simplified","traditional","full-width","proportional-width","ruby"])],["vertical-align",new Set(["top","bottom","-webkit-baseline-middle"])],["page-break-after",new Set(["left","right","always","avoid"])],["text-emphasis-style",O],["-webkit-text-emphasis-style",O],["transform",new Set(["scale","scaleX","scaleY","scale3d","rotate","rotateX","rotateY","rotateZ","rotate3d","skew","skewX","skewY","translate","translateX","translateY","translateZ","translate3d","matrix","matrix3d","perspective"])],["align-content",new Set(["normal","baseline","space-between","space-around","space-evenly","stretch","center","start","end","flex-start","flex-end"])],["justify-content",new Set(["normal","space-between","space-around","space-evenly","stretch","center","start","end","flex-start","flex-end","left","right"])],["place-content",new Set(["normal","space-between","space-around","space-evenly","stretch","center","start","end","flex-start","flex-end","baseline"])],["align-items",new Set(["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end","anchor-center"])],["justify-items",new Set(["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end","left","right","legacy","anchor-center"])],["place-items",new Set(["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end","anchor-center"])],["align-self",new Set(["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end","anchor-center"])],["justify-self",new Set(["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end","left","right","anchor-center"])],["place-self",new Set(["normal","stretch","baseline","center","start","end","self-start","self-end","flex-start","flex-end","anchor-center"])],["perspective-origin",new Set(["left","center","right","top","bottom"])],["transform-origin",new Set(["left","center","right","top","bottom"])],["transition-timing-function",new Set(["cubic-bezier","steps"])],["animation-timing-function",new Set(["cubic-bezier","steps"])],["-webkit-backface-visibility",new Set(["visible","hidden"])],["-webkit-column-break-after",new Set(["always","avoid"])],["-webkit-column-break-before",new Set(["always","avoid"])],["-webkit-column-break-inside",new Set(["avoid"])],["-webkit-column-span",new Set(["all"])],["-webkit-column-gap",new Set(["normal"])],["filter",new Set(["url","blur","brightness","contrast","drop-shadow","grayscale","hue-rotate","invert","opacity","saturate","sepia"])],["backdrop-filter",new Set(["url","blur","brightness","contrast","drop-shadow","grayscale","hue-rotate","invert","opacity","saturate","sepia"])],["grid-template-columns",new Set(["min-content","max-content"])],["grid-template-rows",new Set(["min-content","max-content"])],["grid-auto-flow",new Set(["dense"])],["background",new Set(["repeat","repeat-x","repeat-y","no-repeat","top","bottom","left","right","center","fixed","local","scroll","space","round","border-box","content-box","padding-box","linear-gradient","radial-gradient","repeating-linear-gradient","repeating-radial-gradient","url"])],["background-image",new Set(["linear-gradient","radial-gradient","repeating-linear-gradient","repeating-radial-gradient","url"])],["background-position",new Set(["top","bottom","left","right","center"])],["background-position-x",new Set(["left","right","center"])],["background-position-y",new Set(["top","bottom","center"])],["background-repeat-x",new Set(["repeat","no-repeat"])],["background-repeat-y",new Set(["repeat","no-repeat"])],["border-bottom",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["border-left",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["border-right",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["border-top",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["buffered-rendering",new Set(["static","dynamic"])],["color-interpolation-filters",new Set(["srgb","linearrgb"])],["column-rule",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["flex-flow",new Set(["nowrap","row","row-reverse","column","column-reverse","wrap","wrap-reverse"])],["height",new Set(["-webkit-fill-available"])],["inline-size",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["list-style",new Set(["outside","inside","disc","circle","square","decimal","decimal-leading-zero","arabic-indic","bengali","cambodian","khmer","devanagari","gujarati","gurmukhi","kannada","lao","malayalam","mongolian","myanmar","oriya","persian","urdu","telugu","tibetan","thai","lower-roman","upper-roman","lower-greek","lower-alpha","lower-latin","upper-alpha","upper-latin","cjk-earthly-branch","cjk-heavenly-stem","ethiopic-halehame","ethiopic-halehame-am","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","hangul","hangul-consonant","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","hebrew","armenian","lower-armenian","upper-armenian","georgian","cjk-ideographic","simp-chinese-formal","simp-chinese-informal","trad-chinese-formal","trad-chinese-informal","hiragana","katakana","hiragana-iroha","katakana-iroha"])],["max-block-size",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["max-inline-size",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["min-block-size",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["min-height",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["min-inline-size",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["min-width",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["object-position",new Set(["top","bottom","left","right","center"])],["shape-outside",new Set(["border-box","content-box","padding-box","margin-box"])],["-webkit-appearance",new Set(["checkbox","radio","push-button","square-button","button","inner-spin-button","listbox","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","menulist","menulist-button","meter","progress-bar","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","searchfield","searchfield-cancel-button","textfield","textarea"])],["-webkit-border-after",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["-webkit-border-after-style",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"])],["-webkit-border-after-width",new Set(["medium","thick","thin"])],["-webkit-border-before",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["-webkit-border-before-style",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"])],["-webkit-border-before-width",new Set(["medium","thick","thin"])],["-webkit-border-end",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["-webkit-border-end-style",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"])],["-webkit-border-end-width",new Set(["medium","thick","thin"])],["-webkit-border-start",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double","medium","thick","thin"])],["-webkit-border-start-style",new Set(["hidden","inset","groove","outset","ridge","dotted","dashed","solid","double"])],["-webkit-border-start-width",new Set(["medium","thick","thin"])],["-webkit-logical-height",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["-webkit-logical-width",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["-webkit-mask-box-image",new Set(["repeat","stretch","space","round"])],["-webkit-mask-box-image-repeat",new Set(["repeat","stretch","space","round"])],["-webkit-mask-clip",new Set(["text","border","border-box","content","content-box","padding","padding-box"])],["-webkit-mask-composite",new Set(["clear","copy","source-over","source-in","source-out","source-atop","destination-over","destination-in","destination-out","destination-atop","xor","plus-lighter"])],["-webkit-mask-image",new Set(["linear-gradient","radial-gradient","repeating-linear-gradient","repeating-radial-gradient","url"])],["-webkit-mask-origin",new Set(["border","border-box","content","content-box","padding","padding-box"])],["-webkit-mask-position",new Set(["top","bottom","left","right","center"])],["-webkit-mask-position-x",new Set(["left","right","center"])],["-webkit-mask-position-y",new Set(["top","bottom","center"])],["-webkit-mask-repeat",new Set(["repeat","repeat-x","repeat-y","no-repeat","space","round"])],["-webkit-mask-size",new Set(["contain","cover"])],["-webkit-max-logical-height",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["-webkit-max-logical-width",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["-webkit-min-logical-height",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["-webkit-min-logical-width",new Set(["-webkit-fill-available","min-content","max-content","fit-content"])],["-webkit-perspective-origin-x",new Set(["left","right","center"])],["-webkit-perspective-origin-y",new Set(["top","bottom","center"])],["-webkit-text-decorations-in-effect",new Set(["blink","line-through","overline","underline"])],["-webkit-text-stroke",new Set(["medium","thick","thin"])],["-webkit-text-stroke-width",new Set(["medium","thick","thin"])],["-webkit-transform-origin-x",new Set(["left","right","center"])],["-webkit-transform-origin-y",new Set(["top","bottom","center"])],["width",new Set(["-webkit-fill-available"])],["contain-intrinsic-width",new Set(["auto none","auto 100px"])],["contain-intrinsic-height",new Set(["auto none","auto 100px"])],["contain-intrinsic-size",new Set(["auto none","auto 100px"])],["contain-intrinsic-inline-size",new Set(["auto none","auto 100px"])],["contain-intrinsic-block-size",new Set(["auto none","auto 100px"])],["white-space",new Set(["normal","pre","pre-wrap","pre-line","nowrap","break-spaces"])],["text-box-edge",new Set(["auto","text","cap","ex","text alphabetic","cap alphabetic","ex alphabetic"])],["corner-shape",new Set(["round","scoop","bevel","notch","straight","squircle","superellipse(0.5)","superellipse(infinity)"])]]),N=new Map([["align-content",57],["align-items",129],["align-self",55],["animation",175],["animation-delay",114],["animation-direction",113],["animation-duration",137],["animation-fill-mode",132],["animation-iteration-count",124],["animation-name",139],["animation-play-state",104],["animation-timing-function",141],["backface-visibility",123],["background",260],["background-attachment",119],["background-clip",165],["background-color",259],["background-image",246],["background-origin",107],["background-position",237],["background-position-x",108],["background-position-y",93],["background-repeat",234],["background-size",203],["border",263],["border-bottom",233],["border-bottom-color",190],["border-bottom-left-radius",186],["border-bottom-right-radius",185],["border-bottom-style",150],["border-bottom-width",179],["border-collapse",209],["border-color",226],["border-image",89],["border-image-outset",50],["border-image-repeat",49],["border-image-slice",58],["border-image-source",32],["border-image-width",52],["border-left",221],["border-left-color",174],["border-left-style",142],["border-left-width",172],["border-radius",224],["border-right",223],["border-right-color",182],["border-right-style",130],["border-right-width",178],["border-spacing",198],["border-style",206],["border-top",231],["border-top-color",192],["border-top-left-radius",187],["border-top-right-radius",189],["border-top-style",152],["border-top-width",180],["border-width",214],["bottom",227],["box-shadow",213],["box-sizing",216],["caption-side",96],["clear",229],["clip",173],["clip-rule",5],["color",256],["content",219],["counter-increment",111],["counter-reset",110],["cursor",250],["direction",176],["display",262],["empty-cells",99],["fill",140],["fill-opacity",82],["fill-rule",22],["filter",160],["flex",133],["flex-basis",66],["flex-direction",85],["flex-flow",94],["flex-grow",112],["flex-shrink",61],["flex-wrap",68],["float",252],["font",211],["font-family",254],["font-kerning",18],["font-size",264],["font-stretch",77],["font-style",220],["font-variant",161],["font-weight",257],["height",266],["image-rendering",90],["justify-content",127],["left",248],["letter-spacing",188],["line-height",244],["list-style",215],["list-style-image",145],["list-style-position",149],["list-style-type",199],["margin",267],["margin-bottom",241],["margin-left",243],["margin-right",238],["margin-top",253],["mask",20],["max-height",205],["max-width",225],["min-height",217],["min-width",218],["object-fit",33],["opacity",251],["order",117],["orphans",146],["outline",222],["outline-color",153],["outline-offset",147],["outline-style",151],["outline-width",148],["overflow",255],["overflow-wrap",105],["overflow-x",184],["overflow-y",196],["padding",265],["padding-bottom",230],["padding-left",235],["padding-right",232],["padding-top",240],["page",8],["page-break-after",120],["page-break-before",69],["page-break-inside",121],["perspective",92],["perspective-origin",103],["pointer-events",183],["position",261],["quotes",158],["resize",168],["right",245],["shape-rendering",38],["size",64],["speak",118],["src",170],["stop-color",42],["stop-opacity",31],["stroke",98],["stroke-dasharray",36],["stroke-dashoffset",3],["stroke-linecap",30],["stroke-linejoin",21],["stroke-miterlimit",12],["stroke-opacity",34],["stroke-width",87],["table-layout",171],["tab-size",46],["text-align",260],["text-anchor",35],["text-decoration",247],["text-indent",207],["text-overflow",204],["text-rendering",155],["text-shadow",208],["text-transform",202],["top",258],["touch-action",80],["transform",181],["transform-origin",162],["transform-style",86],["transition",193],["transition-delay",134],["transition-duration",135],["transition-property",131],["transition-timing-function",122],["unicode-bidi",156],["unicode-range",136],["vertical-align",236],["visibility",242],["-webkit-appearance",191],["-webkit-backface-visibility",154],["-webkit-background-clip",164],["-webkit-background-origin",40],["-webkit-background-size",163],["-webkit-border-end",9],["-webkit-border-horizontal-spacing",81],["-webkit-border-image",75],["-webkit-border-radius",212],["-webkit-border-start",10],["-webkit-border-start-color",16],["-webkit-border-start-width",13],["-webkit-border-vertical-spacing",43],["-webkit-box-align",101],["-webkit-box-direction",51],["-webkit-box-flex",128],["-webkit-box-ordinal-group",91],["-webkit-box-orient",144],["-webkit-box-pack",106],["-webkit-box-reflect",39],["-webkit-box-shadow",210],["-webkit-column-break-inside",60],["-webkit-column-count",84],["-webkit-column-gap",76],["-webkit-column-rule",25],["-webkit-column-rule-color",23],["-webkit-columns",44],["-webkit-column-span",29],["-webkit-column-width",47],["-webkit-filter",159],["-webkit-font-feature-settings",59],["-webkit-font-smoothing",177],["-webkit-line-break",45],["-webkit-line-clamp",126],["-webkit-margin-after",67],["-webkit-margin-before",70],["-webkit-margin-collapse",14],["-webkit-margin-end",65],["-webkit-margin-start",100],["-webkit-mask",19],["-webkit-mask-box-image",72],["-webkit-mask-image",88],["-webkit-mask-position",54],["-webkit-mask-repeat",63],["-webkit-mask-size",79],["-webkit-padding-after",15],["-webkit-padding-before",28],["-webkit-padding-end",48],["-webkit-padding-start",73],["-webkit-print-color-adjust",83],["-webkit-rtl-ordering",7],["-webkit-tap-highlight-color",169],["-webkit-text-emphasis-color",11],["-webkit-text-fill-color",71],["-webkit-text-security",17],["-webkit-text-stroke",56],["-webkit-text-stroke-color",37],["-webkit-text-stroke-width",53],["-webkit-user-drag",95],["-webkit-user-modify",62],["-webkit-user-select",194],["-webkit-writing-mode",4],["white-space",228],["widows",115],["width",268],["will-change",74],["word-break",166],["word-spacing",157],["word-wrap",197],["writing-mode",41],["z-index",239],["zoom",200]]),F=["auto","none"];var B=Object.freeze({__proto__:null,CSSMetadata:f,CSSWideKeywords:y,CubicBezierKeywordValues:b,CustomVariableRegex:/(var\(*--[\w\d]+-([\w]+-[\w]+)\))/g,GridAreaRowRegex:I,PositionTryOrderKeywords:v,URLRegex:/url\(\s*('.+?'|".+?"|[^)]+)\s*\)/g,VariableNameRegex:/(\s*--.*?)/gs,VariableRegex:/(var\(\s*--.*?\))/gs,cssMetadata:S});const _="";class H{#h;#u;#g;#p=new Map;#m=0;#f;#b=null;#y;constructor(e,t,n,r,s){this.#h=e,this.#u=t,this.#g=n,this.#f=r||"Medium",this.#y=s}static fromProtocolCookie(e){const t=new H(e.name,e.value,null,e.priority);return t.addAttribute("domain",e.domain),t.addAttribute("path",e.path),e.expires&&t.addAttribute("expires",1e3*e.expires),e.httpOnly&&t.addAttribute("http-only"),e.secure&&t.addAttribute("secure"),e.sameSite&&t.addAttribute("same-site",e.sameSite),"sourcePort"in e&&t.addAttribute("source-port",e.sourcePort),"sourceScheme"in e&&t.addAttribute("source-scheme",e.sourceScheme),"partitionKey"in e&&e.partitionKey&&t.setPartitionKey(e.partitionKey.topLevelSite,e.partitionKey.hasCrossSiteAncestor),"partitionKeyOpaque"in e&&e.partitionKeyOpaque&&t.addAttribute("partition-key",_),t.setSize(e.size),t}key(){return(this.domain()||"-")+" "+this.name()+" "+(this.path()||"-")+" "+(this.partitionKey()?this.topLevelSite()+" "+(this.hasCrossSiteAncestor()?"cross_site":"same_site"):"-")}name(){return this.#h}value(){return this.#u}type(){return this.#g}httpOnly(){return this.#p.has("http-only")}secure(){return this.#p.has("secure")}partitioned(){return this.#p.has("partitioned")||Boolean(this.partitionKey())||this.partitionKeyOpaque()}sameSite(){return this.#p.get("same-site")}partitionKey(){return this.#y}setPartitionKey(e,t){this.#y={topLevelSite:e,hasCrossSiteAncestor:t},this.#p.has("partitioned")||this.addAttribute("partitioned")}topLevelSite(){return this.#y?this.#y?.topLevelSite:""}setTopLevelSite(e,t){this.setPartitionKey(e,t)}hasCrossSiteAncestor(){return!!this.#y&&this.#y?.hasCrossSiteAncestor}setHasCrossSiteAncestor(e){this.partitionKey()&&Boolean(this.topLevelSite())&&this.setPartitionKey(this.topLevelSite(),e)}partitionKeyOpaque(){return!!this.#y&&this.topLevelSite()===_}setPartitionKeyOpaque(){this.addAttribute("partition-key",_),this.setPartitionKey(_,!1)}priority(){return this.#f}session(){return!(this.#p.has("expires")||this.#p.has("max-age"))}path(){return this.#p.get("path")}domain(){return this.#p.get("domain")}expires(){return this.#p.get("expires")}maxAge(){return this.#p.get("max-age")}sourcePort(){return this.#p.get("source-port")}sourceScheme(){return this.#p.get("source-scheme")}size(){return this.#m}url(){if(!this.domain()||!this.path())return null;let e="";const t=this.sourcePort();return t&&80!==t&&443!==t&&(e=`:${this.sourcePort()}`),(this.secure()?"https://":"http://")+this.domain()+e+this.path()}setSize(e){this.#m=e}expiresDate(e){return this.maxAge()?new Date(e.getTime()+1e3*this.maxAge()):this.expires()?new Date(this.expires()):null}addAttribute(e,t){if(e)if("priority"===e)this.#f=t;else this.#p.set(e,t)}hasAttribute(e){return this.#p.has(e)}getAttribute(e){return this.#p.get(e)}setCookieLine(e){this.#b=e}getCookieLine(){return this.#b}matchesSecurityOrigin(e){const t=new URL(e).hostname;return H.isDomainMatch(this.domain(),t)}static isDomainMatch(e,t){return t===e||!(!e||"."!==e[0])&&(e.substr(1)===t||t.length>e.length&&t.endsWith(e))}}var U,q=Object.freeze({__proto__:null,Cookie:H});class z extends l.InspectorBackend.TargetBase{#v;#h;#I=r.DevToolsPath.EmptyUrlString;#w="";#S;#g;#k;#C;#x=new Map;#R;#T=!1;#M;#P;constructor(t,n,r,s,i,o,a,l,d){switch(super(s===U.NODE,i,o,l),this.#v=t,this.#h=r,this.#S=0,s){case U.FRAME:this.#S=1027519,i?.type()!==U.FRAME&&(this.#S|=21056,e.ParsedURL.schemeIs(d?.url,"chrome-extension:")&&(this.#S&=-513));break;case U.ServiceWorker:this.#S=657468,i?.type()!==U.FRAME&&(this.#S|=1);break;case U.SHARED_WORKER:this.#S=919612;break;case U.SHARED_STORAGE_WORKLET:this.#S=526348;break;case U.Worker:this.#S=917820;break;case U.WORKLET:this.#S=524316;break;case U.NODE:this.#S=20;break;case U.AUCTION_WORKLET:this.#S=524292;break;case U.BROWSER:this.#S=131104;break;case U.TAB:this.#S=160}this.#g=s,this.#k=i,this.#C=n,this.#R=a,this.#M=d}createModels(e){this.#P=!0;const t=Array.from(h.registeredModels.entries());for(const[e,n]of t)n.early&&this.model(e);for(const[n,r]of t)(r.autostart||e.has(n))&&this.model(n);this.#P=!1}id(){return this.#C}name(){return this.#h||this.#w}setName(e){this.#h!==e&&(this.#h=e,this.#v.onNameChange(this))}type(){return this.#g}markAsNodeJSForTest(){super.markAsNodeJSForTest(),this.#g=U.NODE}targetManager(){return this.#v}hasAllCapabilities(e){return(this.#S&e)===e}decorateLabel(e){return this.#g===U.Worker||this.#g===U.ServiceWorker?"⚙ "+e:e}parentTarget(){return this.#k}outermostTarget(){let e=null,t=this;do{t.type()!==U.TAB&&t.type()!==U.BROWSER&&(e=t),t=t.parentTarget()}while(t);return e}dispose(e){super.dispose(e),this.#v.removeTarget(this);for(const e of this.#x.values())e.dispose()}model(e){if(!this.#x.get(e)){const t=h.registeredModels.get(e);if(void 0===t)throw new Error("Model class is not registered");if((this.#S&t.capabilities)===t.capabilities){const t=new e(this);this.#x.set(e,t),this.#P||this.#v.modelAdded(this,e,t,this.#v.isInScope(this))}}return this.#x.get(e)||null}models(){return this.#x}inspectedURL(){return this.#I}setInspectedURL(t){this.#I=t;const n=e.ParsedURL.ParsedURL.fromString(t);this.#w=n?n.lastPathComponentWithFragment():"#"+this.#C,this.#v.onInspectedURLChange(this),this.#h||this.#v.onNameChange(this)}hasCrashed(){return this.#T}setHasCrashed(e){const t=this.#T;this.#T=e,t&&!e&&this.resume()}async suspend(e){this.#R||(this.#R=!0,this.#T||(await Promise.all(Array.from(this.models().values(),(t=>t.preSuspendModel(e)))),await Promise.all(Array.from(this.models().values(),(t=>t.suspendModel(e))))))}async resume(){this.#R&&(this.#R=!1,this.#T||(await Promise.all(Array.from(this.models().values(),(e=>e.resumeModel()))),await Promise.all(Array.from(this.models().values(),(e=>e.postResumeModel())))))}suspended(){return this.#R}updateTargetInfo(e){this.#M=e}targetInfo(){return this.#M}}!function(e){e.FRAME="frame",e.ServiceWorker="service-worker",e.Worker="worker",e.SHARED_WORKER="shared-worker",e.SHARED_STORAGE_WORKLET="shared-storage-worklet",e.NODE="node",e.BROWSER="browser",e.AUCTION_WORKLET="auction-worklet",e.WORKLET="worklet",e.TAB="tab"}(U||(U={}));var j=Object.freeze({__proto__:null,Target:z,get Type(){return U}});let V;class W extends e.ObjectWrapper.ObjectWrapper{#E;#L;#A;#O;#D;#R;#N;#F;#B;#_;constructor(){super(),this.#E=new Set,this.#L=new Set,this.#A=new r.MapUtilities.Multimap,this.#O=new r.MapUtilities.Multimap,this.#R=!1,this.#N=null,this.#F=null,this.#D=new WeakSet,this.#B=!1,this.#_=new Set}static instance({forceNew:e}={forceNew:!1}){return V&&!e||(V=new W),V}static removeInstance(){V=void 0}onInspectedURLChange(e){e===this.#F&&(a.InspectorFrontendHost.InspectorFrontendHostInstance.inspectedURLChanged(e.inspectedURL()||r.DevToolsPath.EmptyUrlString),this.dispatchEventToListeners("InspectedURLChanged",e))}onNameChange(e){this.dispatchEventToListeners("NameChanged",e)}async suspendAllTargets(e){if(this.#R)return;this.#R=!0,this.dispatchEventToListeners("SuspendStateChanged");const t=Array.from(this.#E.values(),(t=>t.suspend(e)));await Promise.all(t)}async resumeAllTargets(){if(!this.#R)return;this.#R=!1,this.dispatchEventToListeners("SuspendStateChanged");const e=Array.from(this.#E.values(),(e=>e.resume()));await Promise.all(e)}allTargetsSuspended(){return this.#R}models(e,t){const n=[];for(const r of this.#E){if(t?.scoped&&!this.isInScope(r))continue;const s=r.model(e);s&&n.push(s)}return n}inspectedURL(){const e=this.primaryPageTarget();return e?e.inspectedURL():""}observeModels(e,t,n){const r=this.models(e,n);this.#O.set(e,t),n?.scoped&&this.#D.add(t);for(const e of r)t.modelAdded(e)}unobserveModels(e,t){this.#O.delete(e,t),this.#D.delete(t)}modelAdded(e,t,n,r){for(const e of this.#O.get(t).values())this.#D.has(e)&&!r||e.modelAdded(n)}modelRemoved(e,t,n,r){for(const e of this.#O.get(t).values())this.#D.has(e)&&!r||e.modelRemoved(n)}addModelListener(e,t,n,r,s){const i=e=>{s?.scoped&&!this.isInScope(e)||n.call(r,e)};for(const n of this.models(e))n.addEventListener(t,i);this.#A.set(t,{modelClass:e,thisObject:r,listener:n,wrappedListener:i})}removeModelListener(e,t,n,r){if(!this.#A.has(t))return;let s=null;for(const i of this.#A.get(t))i.modelClass===e&&i.listener===n&&i.thisObject===r&&(s=i.wrappedListener,this.#A.delete(t,i));if(s)for(const n of this.models(e))n.removeEventListener(t,s)}observeTargets(e,t){if(this.#L.has(e))throw new Error("Observer can only be registered once");t?.scoped&&this.#D.add(e);for(const n of this.#E)t?.scoped&&!this.isInScope(n)||e.targetAdded(n);this.#L.add(e)}unobserveTargets(e){this.#L.delete(e),this.#D.delete(e)}createTarget(e,t,n,r,s,i,o,a){const l=new z(this,e,t,n,r,s||"",this.#R,o||null,a);i&&l.pageAgent().invoke_waitForDebugger(),l.createModels(new Set(this.#O.keysArray())),this.#E.add(l);const d=this.isInScope(l);for(const e of[...this.#L])this.#D.has(e)&&!d||e.targetAdded(l);for(const[e,t]of l.models().entries())this.modelAdded(l,e,t,d);for(const e of this.#A.keysArray())for(const t of this.#A.get(e)){const n=l.model(t.modelClass);n&&n.addEventListener(e,t.wrappedListener)}return l!==l.outermostTarget()||l.type()===U.FRAME&&l!==this.primaryPageTarget()||this.#B||this.setScopeTarget(l),l}removeTarget(e){if(!this.#E.has(e))return;const t=this.isInScope(e);this.#E.delete(e);for(const n of e.models().keys()){const r=e.models().get(n);s(r),this.modelRemoved(e,n,r,t)}for(const n of[...this.#L])this.#D.has(n)&&!t||n.targetRemoved(e);for(const t of this.#A.keysArray())for(const n of this.#A.get(t)){const r=e.model(n.modelClass);r&&r.removeEventListener(t,n.wrappedListener)}}targets(){return[...this.#E]}targetById(e){return this.targets().find((t=>t.id()===e))||null}rootTarget(){return 0===this.#E.size?null:this.#E.values().next().value??null}primaryPageTarget(){let e=this.rootTarget();return e?.type()===U.TAB&&(e=this.targets().find((t=>t.parentTarget()===e&&t.type()===U.FRAME&&!t.targetInfo()?.subtype?.length))||null),e}browserTarget(){return this.#N}async maybeAttachInitialTarget(){if(!Boolean(o.Runtime.Runtime.queryParam("browserConnection")))return!1;this.#N||(this.#N=new z(this,"main","browser",U.BROWSER,null,"",!1,null,void 0),this.#N.createModels(new Set(this.#O.keysArray())));const e=await a.InspectorFrontendHost.InspectorFrontendHostInstance.initialTargetId();return this.#N.targetAgent().invoke_autoAttachRelated({targetId:e,waitForDebuggerOnStart:!0}),!0}clearAllTargetsForTest(){this.#E.clear()}isInScope(e){if(!e)return!1;for(function(e){return"source"in e&&e.source instanceof h}(e)&&(e=e.source),e instanceof h&&(e=e.target());e&&e!==this.#F;)e=e.parentTarget();return Boolean(e)&&e===this.#F}setScopeTarget(e){if(e!==this.#F){for(const e of this.targets())if(this.isInScope(e)){for(const t of this.#O.keysArray()){const n=e.models().get(t);if(n)for(const e of[...this.#O.get(t)].filter((e=>this.#D.has(e))))e.modelRemoved(n)}for(const t of[...this.#L].filter((e=>this.#D.has(e))))t.targetRemoved(e)}this.#F=e;for(const e of this.targets())if(this.isInScope(e)){for(const t of[...this.#L].filter((e=>this.#D.has(e))))t.targetAdded(e);for(const[t,n]of e.models().entries())for(const e of[...this.#O.get(t)].filter((e=>this.#D.has(e))))e.modelAdded(n)}for(const e of this.#_)e();e&&e.inspectedURL()&&this.onInspectedURLChange(e)}}addScopeChangeListener(e){this.#_.add(e)}scopeTarget(){return this.#F}}var G=Object.freeze({__proto__:null,Observer:class{targetAdded(e){}targetRemoved(e){}},SDKModelObserver:class{modelAdded(e){}modelRemoved(e){}},TargetManager:W});const K={noContentForWebSocket:"Content for WebSockets is currently not supported",noContentForRedirect:"No content available because this request was redirected",noContentForPreflight:"No content available for preflight request",noThrottling:"No throttling",offline:"Offline",slowG:"3G",fastG:"Slow 4G",fast4G:"Fast 4G",requestWasBlockedByDevtoolsS:'Request was blocked by DevTools: "{PH1}"',sFailedLoadingSS:'{PH1} failed loading: {PH2} "{PH3}".',sFinishedLoadingSS:'{PH1} finished loading: {PH2} "{PH3}".',directSocketStatusOpening:"Opening",directSocketStatusOpen:"Open",directSocketStatusClosed:"Closed",directSocketStatusAborted:"Aborted"},Q=n.i18n.registerUIStrings("core/sdk/NetworkManager.ts",K),$=n.i18n.getLocalizedString.bind(void 0,Q),X=n.i18n.getLazilyComputedLocalizedString.bind(void 0,Q),J=new WeakMap,Y=new Map([["2g","cellular2g"],["3g","cellular3g"],["4g","cellular4g"],["bluetooth","bluetooth"],["wifi","wifi"],["wimax","wimax"]]);class Z extends h{dispatcher;fetchDispatcher;#H;#U;constructor(t){super(t),this.dispatcher=new le(this),this.fetchDispatcher=new ae(t.fetchAgent(),this),this.#H=t.networkAgent(),t.registerNetworkDispatcher(this.dispatcher),t.registerFetchDispatcher(this.fetchDispatcher),e.Settings.Settings.instance().moduleSetting("cache-disabled").get()&&this.#H.invoke_setCacheDisabled({cacheDisabled:!0}),o.Runtime.hostConfig.devToolsPrivacyUI?.enabled&&!0!==o.Runtime.hostConfig.thirdPartyCookieControls?.managedBlockThirdPartyCookies&&(e.Settings.Settings.instance().createSetting("cookie-control-override-enabled",void 0).get()||e.Settings.Settings.instance().createSetting("grace-period-mitigation-disabled",void 0).get()||e.Settings.Settings.instance().createSetting("heuristic-mitigation-disabled",void 0).get())&&this.cookieControlFlagsSettingChanged(),this.#H.invoke_enable({maxPostDataSize:oe}),this.#H.invoke_setAttachDebugStack({enabled:!0}),this.#U=e.Settings.Settings.instance().createSetting("bypass-service-worker",!1),this.#U.get()&&this.bypassServiceWorkerChanged(),this.#U.addChangeListener(this.bypassServiceWorkerChanged,this),e.Settings.Settings.instance().moduleSetting("cache-disabled").addChangeListener(this.cacheDisabledSettingChanged,this),e.Settings.Settings.instance().createSetting("cookie-control-override-enabled",void 0).addChangeListener(this.cookieControlFlagsSettingChanged,this),e.Settings.Settings.instance().createSetting("grace-period-mitigation-disabled",void 0).addChangeListener(this.cookieControlFlagsSettingChanged,this),e.Settings.Settings.instance().createSetting("heuristic-mitigation-disabled",void 0).addChangeListener(this.cookieControlFlagsSettingChanged,this)}static forRequest(e){return J.get(e)||null}static canReplayRequest(t){return Boolean(J.get(t))&&Boolean(t.backendRequestId())&&!t.isRedirect()&&t.resourceType()===e.ResourceType.resourceTypes.XHR}static replayRequest(e){const t=J.get(e),n=e.backendRequestId();t&&n&&!e.isRedirect()&&t.#H.invoke_replayXHR({requestId:n})}static async searchInRequest(e,n,r,s){const i=Z.forRequest(e),o=e.backendRequestId();if(!i||!o||e.isRedirect())return[];const a=await i.#H.invoke_searchInResponseBody({requestId:o,query:n,caseSensitive:r,isRegex:s});return t.TextUtils.performSearchInSearchMatches(a.result||[],n,r,s)}static async requestContentData(n){if(n.resourceType()===e.ResourceType.resourceTypes.WebSocket)return{error:$(K.noContentForWebSocket)};if(n.finished||await n.once(Ti.FINISHED_LOADING),n.isRedirect())return{error:$(K.noContentForRedirect)};if(n.isPreflightRequest())return{error:$(K.noContentForPreflight)};const r=Z.forRequest(n);if(!r)return{error:"No network manager for request"};const s=n.backendRequestId();if(!s)return{error:"No backend request id for request"};const i=await r.#H.invoke_getResponseBody({requestId:s}),o=i.getError();return o?{error:o}:new t.ContentData.ContentData(i.body,i.base64Encoded,n.mimeType,n.charset()??void 0)}static async streamResponseBody(e){if(e.finished)return{error:"Streaming the response body is only available for in-flight requests."};const n=Z.forRequest(e);if(!n)return{error:"No network manager for request"};const r=e.backendRequestId();if(!r)return{error:"No backend request id for request"};const s=await n.#H.invoke_streamResourceContent({requestId:r}),i=s.getError();return i?{error:i}:(await e.waitForResponseReceived(),new t.ContentData.ContentData(s.bufferedData,!0,e.mimeType,e.charset()??void 0))}static async requestPostData(e){const t=Z.forRequest(e);if(!t)return console.error("No network manager for request"),null;const n=e.backendRequestId();if(!n)return console.error("No backend request id for request"),null;try{const{postData:e}=await t.#H.invoke_getRequestPostData({requestId:n});return e}catch(e){return e.message}}static connectionType(e){if(!e.download&&!e.upload)return"none";try{const t="function"==typeof e.title?e.title().toLowerCase():e.title.toLowerCase();for(const[e,n]of Y)if(t.includes(e))return n}catch{return"none"}return"other"}static lowercaseHeaders(e){const t={};for(const n in e)t[n.toLowerCase()]=e[n];return t}requestForURL(e){return this.dispatcher.requestForURL(e)}requestForId(e){return this.dispatcher.requestForId(e)}requestForLoaderId(e){return this.dispatcher.requestForLoaderId(e)}cacheDisabledSettingChanged({data:e}){this.#H.invoke_setCacheDisabled({cacheDisabled:e})}cookieControlFlagsSettingChanged(){const t=Boolean(e.Settings.Settings.instance().createSetting("cookie-control-override-enabled",void 0).get()),n=!!t&&Boolean(e.Settings.Settings.instance().createSetting("grace-period-mitigation-disabled",void 0).get()),r=!!t&&Boolean(e.Settings.Settings.instance().createSetting("heuristic-mitigation-disabled",void 0).get());this.#H.invoke_setCookieControls({enableThirdPartyCookieRestriction:t,disableThirdPartyCookieMetadata:n,disableThirdPartyCookieHeuristics:r})}dispose(){e.Settings.Settings.instance().moduleSetting("cache-disabled").removeChangeListener(this.cacheDisabledSettingChanged,this)}bypassServiceWorkerChanged(){this.#H.invoke_setBypassServiceWorker({bypass:this.#U.get()})}async getSecurityIsolationStatus(e){const t=await this.#H.invoke_getSecurityIsolationStatus({frameId:e??void 0});return t.getError()?null:t.status}async enableReportingApi(e=!0){return await this.#H.invoke_enableReportingApi({enable:e})}async loadNetworkResource(e,t,n){const r=await this.#H.invoke_loadNetworkResource({frameId:e??void 0,url:t,options:n});if(r.getError())throw new Error(r.getError());return r.resource}clearRequests(){this.dispatcher.clearRequests()}}var ee;!function(e){e.RequestStarted="RequestStarted",e.RequestUpdated="RequestUpdated",e.RequestFinished="RequestFinished",e.RequestUpdateDropped="RequestUpdateDropped",e.ResponseReceived="ResponseReceived",e.MessageGenerated="MessageGenerated",e.RequestRedirected="RequestRedirected",e.LoadingFinished="LoadingFinished",e.ReportingApiReportAdded="ReportingApiReportAdded",e.ReportingApiReportUpdated="ReportingApiReportUpdated",e.ReportingApiEndpointsChangedForOrigin="ReportingApiEndpointsChangedForOrigin"}(ee||(ee={}));const te={title:X(K.noThrottling),i18nTitleKey:K.noThrottling,download:-1,upload:-1,latency:0},ne={title:X(K.offline),i18nTitleKey:K.offline,download:0,upload:0,latency:0},re={title:X(K.slowG),i18nTitleKey:K.slowG,download:5e4,upload:5e4,latency:2e3,targetLatency:400},se={title:X(K.fastG),i18nTitleKey:K.fastG,download:18e4,upload:84375,latency:562.5,targetLatency:150},ie={title:X(K.fast4G),i18nTitleKey:K.fast4G,download:1012500,upload:168750,latency:165,targetLatency:60},oe=65536;class ae{#q;#z;constructor(e,t){this.#q=e,this.#z=t}requestPaused({requestId:e,request:t,resourceType:n,responseStatusCode:r,responseHeaders:s,networkId:i}){const o=i?this.#z.requestForId(i):null;0===o?.originalResponseHeaders.length&&s&&(o.originalResponseHeaders=s),ce.instance().requestIntercepted(new he(this.#q,t,n,e,o,r,s))}authRequired({}){}}class le{#z;#j=new Map;#V=new Map;#W=new Map;#G=new Map;#K=new Map;constructor(e){this.#z=e,ce.instance().addEventListener("RequestIntercepted",this.#Q.bind(this))}#Q(e){const t=this.requestForId(e.data);t&&t.setWasIntercepted(!0)}headersMapToHeadersArray(e){const t=[];for(const n in e){const r=e[n].split("\n");for(let e=0;e=0&&t.setTransferSize(n.encodedDataLength),n.requestHeaders&&!t.hasExtraRequestInfo()&&(t.setRequestHeaders(this.headersMapToHeadersArray(n.requestHeaders)),t.setRequestHeadersText(n.requestHeadersText||"")),t.connectionReused=n.connectionReused,t.connectionId=String(n.connectionId),n.remoteIPAddress&&t.setRemoteAddress(n.remoteIPAddress,n.remotePort||-1),n.fromServiceWorker&&(t.fetchedViaServiceWorker=!0),n.fromDiskCache&&t.setFromDiskCache(),n.fromPrefetchCache&&t.setFromPrefetchCache(),n.fromEarlyHints&&t.setFromEarlyHints(),n.cacheStorageCacheName&&t.setResponseCacheStorageCacheName(n.cacheStorageCacheName),n.serviceWorkerRouterInfo&&(t.serviceWorkerRouterInfo=n.serviceWorkerRouterInfo),n.responseTime&&t.setResponseRetrievalTime(new Date(n.responseTime)),t.timing=n.timing,t.protocol=n.protocol||"",t.alternateProtocolUsage=n.alternateProtocolUsage,n.serviceWorkerResponseSource&&t.setServiceWorkerResponseSource(n.serviceWorkerResponseSource),t.setSecurityState(n.securityState),n.securityDetails&&t.setSecurityDetails(n.securityDetails);const r=e.ResourceType.ResourceType.fromMimeTypeOverride(t.mimeType);r&&t.setResourceType(r),t.responseReceivedPromiseResolve?t.responseReceivedPromiseResolve():t.responseReceivedPromise=Promise.resolve()}requestForId(e){return this.#j.get(e)||null}requestForURL(e){return this.#V.get(e)||null}requestForLoaderId(e){return this.#W.get(e)||null}resourceChangedPriority({requestId:e,newPriority:t}){const n=this.#j.get(e);n&&n.setPriority(t)}signedExchangeReceived({requestId:t,info:n}){let r=this.#j.get(t);(r||(r=this.#V.get(n.outerResponse.url),r))&&(r.setSignedExchangeInfo(n),r.setResourceType(e.ResourceType.resourceTypes.SignedExchange),this.updateNetworkRequestWithResponse(r,n.outerResponse),this.updateNetworkRequest(r),this.#z.dispatchEventToListeners(ee.ResponseReceived,{request:r,response:n.outerResponse}))}requestWillBeSent({requestId:t,loaderId:n,documentURL:r,request:s,timestamp:i,wallTime:o,initiator:a,redirectResponse:l,type:d,frameId:c,hasUserGesture:h}){let u=this.#j.get(t);if(u){if(!l)return;u.signedExchangeInfo()||this.responseReceived({requestId:t,loaderId:n,timestamp:i,type:d||"Other",response:l,hasExtraInfo:!1,frameId:c}),u=this.appendRedirect(t,i,s.url),this.#z.dispatchEventToListeners(ee.RequestRedirected,u)}else u=Ri.create(t,s.url,r,c??null,n,a,h),J.set(u,this.#z);u.hasNetworkData=!0,this.updateNetworkRequestWithRequest(u,s),u.setIssueTime(i,o),u.setResourceType(d?e.ResourceType.resourceTypes[d]:e.ResourceType.resourceTypes.Other),s.trustTokenParams&&u.setTrustTokenParams(s.trustTokenParams);const g=this.#K.get(t);g&&(u.setTrustTokenOperationDoneEvent(g),this.#K.delete(t)),this.getExtraInfoBuilder(t).addRequest(u),this.startNetworkRequest(u,s)}requestServedFromCache({requestId:e}){const t=this.#j.get(e);t&&t.setFromMemoryCache()}responseReceived({requestId:t,loaderId:n,timestamp:r,type:s,response:i,frameId:o}){const a=this.#j.get(t),l=Z.lowercaseHeaders(i.headers);if(a)a.responseReceivedTime=r,a.setResourceType(e.ResourceType.resourceTypes[s]),this.updateNetworkRequestWithResponse(a,i),this.updateNetworkRequest(a),this.#z.dispatchEventToListeners(ee.ResponseReceived,{request:a,response:i});else{const e=l["last-modified"],t={url:i.url,frameId:o??null,loaderId:n,resourceType:s,mimeType:i.mimeType,lastModified:e?new Date(e):null};this.#z.dispatchEventToListeners(ee.RequestUpdateDropped,t)}}dataReceived(e){let t=this.#j.get(e.requestId);t||(t=this.maybeAdoptMainResourceRequest(e.requestId)),t&&(t.addDataReceivedEvent(e),this.updateNetworkRequest(t))}loadingFinished({requestId:e,timestamp:t,encodedDataLength:n}){let r=this.#j.get(e);r||(r=this.maybeAdoptMainResourceRequest(e)),r&&(this.getExtraInfoBuilder(e).finished(),this.finishNetworkRequest(r,t,n),this.#z.dispatchEventToListeners(ee.LoadingFinished,r))}loadingFailed({requestId:t,timestamp:n,type:r,errorText:s,canceled:i,blockedReason:o,corsErrorStatus:a}){const l=this.#j.get(t);if(l){if(l.failed=!0,l.setResourceType(e.ResourceType.resourceTypes[r]),l.canceled=Boolean(i),o&&(l.setBlockedReason(o),"inspector"===o)){const e=$(K.requestWasBlockedByDevtoolsS,{PH1:l.url()});this.#z.dispatchEventToListeners(ee.MessageGenerated,{message:e,requestId:t,warning:!0})}a&&l.setCorsErrorStatus(a),l.localizedFailDescription=s,this.getExtraInfoBuilder(t).finished(),this.finishNetworkRequest(l,n,-1)}}webSocketCreated({requestId:t,url:n,initiator:r}){const s=Ri.createForWebSocket(t,n,r);J.set(s,this.#z),s.setResourceType(e.ResourceType.resourceTypes.WebSocket),this.startNetworkRequest(s,null)}webSocketWillSendHandshakeRequest({requestId:e,timestamp:t,wallTime:n,request:r}){const s=this.#j.get(e);s&&(s.requestMethod="GET",s.setRequestHeaders(this.headersMapToHeadersArray(r.headers)),s.setIssueTime(t,n),this.updateNetworkRequest(s))}webSocketHandshakeResponseReceived({requestId:e,timestamp:t,response:n}){const r=this.#j.get(e);r&&(r.statusCode=n.status,r.statusText=n.statusText,r.responseHeaders=this.headersMapToHeadersArray(n.headers),r.responseHeadersText=n.headersText||"",n.requestHeaders&&r.setRequestHeaders(this.headersMapToHeadersArray(n.requestHeaders)),n.requestHeadersText&&r.setRequestHeadersText(n.requestHeadersText),r.responseReceivedTime=t,r.protocol="websocket",this.updateNetworkRequest(r))}webSocketFrameReceived({requestId:e,timestamp:t,response:n}){const r=this.#j.get(e);r&&(r.addProtocolFrame(n,t,!1),r.responseReceivedTime=t,this.updateNetworkRequest(r))}webSocketFrameSent({requestId:e,timestamp:t,response:n}){const r=this.#j.get(e);r&&(r.addProtocolFrame(n,t,!0),r.responseReceivedTime=t,this.updateNetworkRequest(r))}webSocketFrameError({requestId:e,timestamp:t,errorMessage:n}){const r=this.#j.get(e);r&&(r.addProtocolFrameError(n,t),r.responseReceivedTime=t,this.updateNetworkRequest(r))}webSocketClosed({requestId:e,timestamp:t}){const n=this.#j.get(e);n&&this.finishNetworkRequest(n,t,-1)}eventSourceMessageReceived({requestId:e,timestamp:t,eventName:n,eventId:r,data:s}){const i=this.#j.get(e);i&&i.addEventSourceMessage(t,n,r,s)}requestIntercepted({}){}requestWillBeSentExtraInfo({requestId:e,associatedCookies:t,headers:n,clientSecurityState:r,connectTiming:s,siteHasCookieInOtherPartition:i}){const o=[],a=[];for(const{blockedReasons:e,exemptionReason:n,cookie:r}of t)0===e.length?a.push({exemptionReason:n,cookie:H.fromProtocolCookie(r)}):o.push({blockedReasons:e,cookie:H.fromProtocolCookie(r)});const l={blockedRequestCookies:o,includedRequestCookies:a,requestHeaders:this.headersMapToHeadersArray(n),clientSecurityState:r,connectTiming:s,siteHasCookieInOtherPartition:i};this.getExtraInfoBuilder(e).addRequestExtraInfo(l)}responseReceivedEarlyHints({requestId:e,headers:t}){this.getExtraInfoBuilder(e).setEarlyHintsHeaders(this.headersMapToHeadersArray(t))}responseReceivedExtraInfo({requestId:e,blockedCookies:t,headers:n,headersText:r,resourceIPAddressSpace:s,statusCode:i,cookiePartitionKey:o,cookiePartitionKeyOpaque:a,exemptedCookies:l}){const d={blockedResponseCookies:t.map((e=>({blockedReasons:e.blockedReasons,cookieLine:e.cookieLine,cookie:e.cookie?H.fromProtocolCookie(e.cookie):null}))),responseHeaders:this.headersMapToHeadersArray(n),responseHeadersText:r,resourceIPAddressSpace:s,statusCode:i,cookiePartitionKey:o,cookiePartitionKeyOpaque:a,exemptedResponseCookies:l?.map((e=>({cookie:H.fromProtocolCookie(e.cookie),cookieLine:e.cookieLine,exemptionReason:e.exemptionReason})))};this.getExtraInfoBuilder(e).addResponseExtraInfo(d)}getExtraInfoBuilder(e){let t;return this.#G.has(e)?t=this.#G.get(e):(t=new ue,this.#G.set(e,t)),t}appendRedirect(e,t,n){const r=this.#j.get(e);if(!r)throw new Error(`Could not find original network request for ${e}`);let s=0;for(let e=r.redirectSource();e;e=e.redirectSource())s++;r.markAsRedirect(s),this.finishNetworkRequest(r,t,-1);const i=Ri.create(e,n,r.documentURL,r.frameId,r.loaderId,r.initiator(),r.hasUserGesture()??void 0);return J.set(i,this.#z),i.setRedirectSource(r),r.setRedirectDestination(i),i}maybeAdoptMainResourceRequest(e){const t=ce.instance().inflightMainResourceRequests.get(e);if(!t)return null;const n=Z.forRequest(t).dispatcher;n.#j.delete(e),n.#V.delete(t.url());const r=t.loaderId;r&&n.#W.delete(r);const s=n.#G.get(e);return n.#G.delete(e),this.#j.set(e,t),this.#V.set(t.url(),t),r&&this.#W.set(r,t),s&&this.#G.set(e,s),J.set(t,this.#z),t}startNetworkRequest(e,t){this.#j.set(e.requestId(),e),this.#V.set(e.url(),e);const n=e.loaderId;n&&this.#W.set(n,e),e.loaderId!==e.requestId()&&""!==e.loaderId||ce.instance().inflightMainResourceRequests.set(e.requestId(),e),this.#z.dispatchEventToListeners(ee.RequestStarted,{request:e,originalRequest:t})}updateNetworkRequest(e){this.#z.dispatchEventToListeners(ee.RequestUpdated,e)}finishNetworkRequest(t,n,r){if(t.endTime=n,t.finished=!0,r>=0){const e=t.redirectSource();e?.signedExchangeInfo()?(t.setTransferSize(0),e.setTransferSize(r),this.updateNetworkRequest(e)):t.setTransferSize(r)}if(this.#z.dispatchEventToListeners(ee.RequestFinished,t),ce.instance().inflightMainResourceRequests.delete(t.requestId()),e.Settings.Settings.instance().moduleSetting("monitoring-xhr-enabled").get()&&t.resourceType().category()===e.ResourceType.resourceCategories.XHR){let e;const n=t.failed||t.hasErrorStatusCode();e=$(n?K.sFailedLoadingSS:K.sFinishedLoadingSS,{PH1:t.resourceType().title(),PH2:t.requestMethod,PH3:t.url()}),this.#z.dispatchEventToListeners(ee.MessageGenerated,{message:e,requestId:t.requestId(),warning:!1})}}clearRequests(){for(const[e,t]of this.#j)t.finished&&this.#j.delete(e);for(const[e,t]of this.#V)t.finished&&this.#V.delete(e);for(const[e,t]of this.#W)t.finished&&this.#W.delete(e);for(const[e,t]of this.#G)t.isFinished()&&this.#G.delete(e)}webTransportCreated({transportId:t,url:n,timestamp:r,initiator:s}){const i=Ri.createForWebSocket(t,n,s);i.hasNetworkData=!0,J.set(i,this.#z),i.setResourceType(e.ResourceType.resourceTypes.WebTransport),i.setIssueTime(r,0),this.startNetworkRequest(i,null)}webTransportConnectionEstablished({transportId:e,timestamp:t}){const n=this.#j.get(e);n&&(n.responseReceivedTime=t,n.endTime=t+.001,this.updateNetworkRequest(n))}webTransportClosed({transportId:e,timestamp:t}){const n=this.#j.get(e);n&&(n.endTime=t,this.finishNetworkRequest(n,t,0))}directTCPSocketCreated(t){const r=0===t.remotePort?t.remoteAddr:`${t.remoteAddr}:${t.remotePort}`,s=Ri.createForWebSocket(t.identifier,r,t.initiator);s.hasNetworkData=!0,s.setRemoteAddress(t.remoteAddr,t.remotePort),s.protocol=n.i18n.lockedString("tcp"),s.statusText=$(K.directSocketStatusOpening),s.directSocketInfo={type:Li.TCP,status:Ai.OPENING,createOptions:{remoteAddr:t.remoteAddr,remotePort:t.remotePort,noDelay:t.options.noDelay,keepAliveDelay:t.options.keepAliveDelay,sendBufferSize:t.options.sendBufferSize,receiveBufferSize:t.options.receiveBufferSize,dnsQueryType:t.options.dnsQueryType}},s.setResourceType(e.ResourceType.resourceTypes.DirectSocket),s.setIssueTime(t.timestamp,t.timestamp),J.set(s,this.#z),this.startNetworkRequest(s,null)}directTCPSocketOpened(e){const t=this.#j.get(e.identifier);if(!t?.directSocketInfo)return;t.responseReceivedTime=e.timestamp,t.directSocketInfo.status=Ai.OPEN,t.statusText=$(K.directSocketStatusOpen),t.directSocketInfo.openInfo={remoteAddr:e.remoteAddr,remotePort:e.remotePort,localAddr:e.localAddr,localPort:e.localPort},t.setRemoteAddress(e.remoteAddr,e.remotePort);const n=0===e.remotePort?e.remoteAddr:`${e.remoteAddr}:${e.remotePort}`;t.setUrl(n),this.updateNetworkRequest(t)}directTCPSocketAborted(e){const t=this.#j.get(e.identifier);t?.directSocketInfo&&(t.failed=!0,t.directSocketInfo.status=Ai.ABORTED,t.statusText=$(K.directSocketStatusAborted),t.directSocketInfo.errorMessage=e.errorMessage,this.finishNetworkRequest(t,e.timestamp,0))}directTCPSocketClosed(e){const t=this.#j.get(e.identifier);t?.directSocketInfo&&(t.statusText=$(K.directSocketStatusClosed),t.directSocketInfo.status=Ai.CLOSED,this.finishNetworkRequest(t,e.timestamp,0))}trustTokenOperationDone(e){const t=this.#j.get(e.requestId);t?t.setTrustTokenOperationDoneEvent(e):this.#K.set(e.requestId,e)}subresourceWebBundleMetadataReceived({requestId:e,urls:t}){const n=this.getExtraInfoBuilder(e);n.setWebBundleInfo({resourceUrls:t});const r=n.finalRequest();r&&this.updateNetworkRequest(r)}subresourceWebBundleMetadataError({requestId:e,errorMessage:t}){const n=this.getExtraInfoBuilder(e);n.setWebBundleInfo({errorMessage:t});const r=n.finalRequest();r&&this.updateNetworkRequest(r)}subresourceWebBundleInnerResponseParsed({innerRequestId:e,bundleRequestId:t}){const n=this.getExtraInfoBuilder(e);n.setWebBundleInnerRequestInfo({bundleRequestId:t});const r=n.finalRequest();r&&this.updateNetworkRequest(r)}subresourceWebBundleInnerResponseError({innerRequestId:e,errorMessage:t}){const n=this.getExtraInfoBuilder(e);n.setWebBundleInnerRequestInfo({errorMessage:t});const r=n.finalRequest();r&&this.updateNetworkRequest(r)}reportingApiReportAdded(e){this.#z.dispatchEventToListeners(ee.ReportingApiReportAdded,e.report)}reportingApiReportUpdated(e){this.#z.dispatchEventToListeners(ee.ReportingApiReportUpdated,e.report)}reportingApiEndpointsChangedForOrigin(e){this.#z.dispatchEventToListeners(ee.ReportingApiEndpointsChangedForOrigin,e)}policyUpdated(){}createNetworkRequest(e,t,n,r,s,i){const o=Ri.create(e,r,s,t,n,i);return J.set(o,this.#z),o}}let de;class ce extends e.ObjectWrapper.ObjectWrapper{#$="";#X=null;#J=null;#Y=new Set;#Z=new Set;inflightMainResourceRequests=new Map;#ee=te;#te=null;#ne=e.Settings.Settings.instance().moduleSetting("request-blocking-enabled");#re=e.Settings.Settings.instance().createSetting("network-blocked-patterns",[]);#se=[];#ie=new r.MapUtilities.Multimap;#oe;#ae;constructor(){super();const e=()=>{this.updateBlockedPatterns(),this.dispatchEventToListeners("BlockedPatternsChanged")};this.#ne.addChangeListener(e),this.#re.addChangeListener(e),this.updateBlockedPatterns(),W.instance().observeModels(Z,this)}static instance(e={forceNew:null}){const{forceNew:t}=e;return de&&!t||(de=new ce),de}static dispose(){de=null}static patchUserAgentWithChromeVersion(e){const t=o.Runtime.getChromeVersion();if(t.length>0){const n=t.split(".",1)[0]+".0.100.0";return r.StringUtilities.sprintf(e,t,n)}return e}static patchUserAgentMetadataWithChromeVersion(e){if(!e.brands)return;const t=o.Runtime.getChromeVersion();if(0===t.length)return;const n=t.split(".",1)[0];for(const t of e.brands)t.version.includes("%s")&&(t.version=r.StringUtilities.sprintf(t.version,n));e.fullVersion&&e.fullVersion.includes("%s")&&(e.fullVersion=r.StringUtilities.sprintf(e.fullVersion,t))}modelAdded(e){const t=e.target().networkAgent(),n=e.target().fetchAgent();this.#oe&&t.invoke_setExtraHTTPHeaders({headers:this.#oe}),this.currentUserAgent()&&t.invoke_setUserAgentOverride({userAgent:this.currentUserAgent(),userAgentMetadata:this.#X||void 0}),this.#se.length&&t.invoke_setBlockedURLs({urls:this.#se}),this.isIntercepting()&&n.invoke_enable({patterns:this.#ie.valuesArray()}),null===this.#J?t.invoke_clearAcceptedEncodingsOverride():t.invoke_setAcceptedEncodings({encodings:this.#J}),this.#Y.add(t),this.#Z.add(n),this.isThrottling()&&this.updateNetworkConditions(t)}modelRemoved(e){for(const t of this.inflightMainResourceRequests){Z.forRequest(t[1])===e&&this.inflightMainResourceRequests.delete(t[0])}this.#Y.delete(e.target().networkAgent()),this.#Z.delete(e.target().fetchAgent())}isThrottling(){return this.#ee.download>=0||this.#ee.upload>=0||this.#ee.latency>0}isOffline(){return!this.#ee.download&&!this.#ee.upload}setNetworkConditions(e){this.#ee=e;for(const e of this.#Y)this.updateNetworkConditions(e);this.dispatchEventToListeners("ConditionsChanged")}networkConditions(){return this.#ee}updateNetworkConditions(e){const t=this.#ee;this.isThrottling()?e.invoke_emulateNetworkConditions({offline:this.isOffline(),latency:t.latency,downloadThroughput:t.download<0?0:t.download,uploadThroughput:t.upload<0?0:t.upload,packetLoss:(t.packetLoss??0)<0?0:t.packetLoss,packetQueueLength:t.packetQueueLength,packetReordering:t.packetReordering,connectionType:Z.connectionType(t)}):e.invoke_emulateNetworkConditions({offline:!1,latency:0,downloadThroughput:0,uploadThroughput:0})}setExtraHTTPHeaders(e){this.#oe=e;for(const e of this.#Y)e.invoke_setExtraHTTPHeaders({headers:this.#oe})}currentUserAgent(){return this.#ae?this.#ae:this.#$}updateUserAgentOverride(){const e=this.currentUserAgent();for(const t of this.#Y)t.invoke_setUserAgentOverride({userAgent:e,userAgentMetadata:this.#X||void 0})}setUserAgentOverride(e,t){const n=this.#$!==e;this.#$=e,this.#ae?this.#X=null:(this.#X=t,this.updateUserAgentOverride()),n&&this.dispatchEventToListeners("UserAgentChanged")}userAgentOverride(){return this.#$}setCustomUserAgentOverride(e,t=null){this.#ae=e,this.#X=t,this.updateUserAgentOverride()}setCustomAcceptedEncodingsOverride(e){this.#J=e,this.updateAcceptedEncodingsOverride(),this.dispatchEventToListeners("AcceptedEncodingsChanged")}clearCustomAcceptedEncodingsOverride(){this.#J=null,this.updateAcceptedEncodingsOverride(),this.dispatchEventToListeners("AcceptedEncodingsChanged")}isAcceptedEncodingOverrideSet(){return null!==this.#J}updateAcceptedEncodingsOverride(){const e=this.#J;for(const t of this.#Y)null===e?t.invoke_clearAcceptedEncodingsOverride():t.invoke_setAcceptedEncodings({encodings:e})}blockedPatterns(){return this.#re.get().slice()}blockingEnabled(){return this.#ne.get()}isBlocking(){return Boolean(this.#se.length)}setBlockedPatterns(e){this.#re.set(e)}setBlockingEnabled(e){this.#ne.get()!==e&&this.#ne.set(e)}updateBlockedPatterns(){const e=[];if(this.#ne.get())for(const t of this.#re.get())t.enabled&&e.push(t.url);if(e.length||this.#se.length){this.#se=e;for(const e of this.#Y)e.invoke_setBlockedURLs({urls:this.#se})}}isIntercepting(){return Boolean(this.#ie.size)}setInterceptionHandlerForPatterns(e,t){this.#ie.deleteAll(t);for(const n of e)this.#ie.set(t,n);return this.updateInterceptionPatternsOnNextTick()}updateInterceptionPatternsOnNextTick(){return this.#te||(this.#te=Promise.resolve().then(this.updateInterceptionPatterns.bind(this))),this.#te}async updateInterceptionPatterns(){e.Settings.Settings.instance().moduleSetting("cache-disabled").get()||e.Settings.Settings.instance().moduleSetting("cache-disabled").set(!0),this.#te=null;const t=[];for(const e of this.#Z)t.push(e.invoke_enable({patterns:this.#ie.valuesArray()}));this.dispatchEventToListeners("InterceptorsChanged"),await Promise.all(t)}async requestIntercepted(e){for(const t of this.#ie.keysArray())if(await t(e),e.hasResponded()&&e.networkRequest)return void this.dispatchEventToListeners("RequestIntercepted",e.networkRequest.requestId());e.hasResponded()||e.continueRequestWithoutChange()}clearBrowserCache(){for(const e of this.#Y)e.invoke_clearBrowserCache()}clearBrowserCookies(){for(const e of this.#Y)e.invoke_clearBrowserCookies()}async getCertificate(e){const t=W.instance().primaryPageTarget();if(!t)return[];const n=await t.networkAgent().invoke_getCertificate({origin:e});return n?n.tableNames:[]}async loadResource(t){const n={},r=this.currentUserAgent();r&&(n["User-Agent"]=r),e.Settings.Settings.instance().moduleSetting("cache-disabled").get()&&(n["Cache-Control"]="no-cache");const s=e.Settings.Settings.instance().moduleSetting("network.enable-remote-file-loading").get();return await new Promise((e=>a.ResourceLoader.load(t,n,((t,n,r,s)=>{e({success:t,content:r,errorDescription:s})}),s)))}}class he{#q;#le;request;resourceType;responseStatusCode;responseHeaders;requestId;networkRequest;constructor(e,t,n,r,s,i,o){this.#q=e,this.#le=!1,this.request=t,this.resourceType=n,this.responseStatusCode=i,this.responseHeaders=o,this.requestId=r,this.networkRequest=s}hasResponded(){return this.#le}static mergeSetCookieHeaders(e,t){const n=e=>{const t=new Map;for(const n of e){const e=n.value.match(/^([a-zA-Z0-9!#$%&'*+.^_`|~-]+=)(.*)$/);e?t.has(e[1])?t.get(e[1])?.push(n.value):t.set(e[1],[n.value]):t.has(n.value)?t.get(n.value)?.push(n.value):t.set(n.value,[n.value])}return t},r=n(e),s=n(t),i=[];for(const[e,t]of r)if(s.has(e))for(const t of s.get(e)||[])i.push({name:"set-cookie",value:t});else for(const e of t)i.push({name:"set-cookie",value:e});for(const[e,t]of s)if(!r.has(e))for(const e of t)i.push({name:"set-cookie",value:e});return i}async continueRequestWithContent(t,n,r,s){this.#le=!0;const i=n?await t.text():await e.Base64.encode(t).catch((e=>(console.error(e),""))),o=s?200:this.responseStatusCode||200;if(this.networkRequest){const e=this.networkRequest?.originalResponseHeaders.filter((e=>"set-cookie"===e.name))||[],t=r.filter((e=>"set-cookie"===e.name));this.networkRequest.setCookieHeaders=he.mergeSetCookieHeaders(e,t),this.networkRequest.hasOverriddenContent=s}this.#q.invoke_fulfillRequest({requestId:this.requestId,responseCode:o,body:i,responseHeaders:r}),ce.instance().dispatchEventToListeners("RequestFulfilled",this.request.url)}continueRequestWithoutChange(){console.assert(!this.#le),this.#le=!0,this.#q.invoke_continueRequest({requestId:this.requestId})}continueRequestWithError(e){console.assert(!this.#le),this.#le=!0,this.#q.invoke_failRequest({requestId:this.requestId,errorReason:e})}async responseBody(){const e=await this.#q.invoke_getResponseBody({requestId:this.requestId}),n=e.getError();if(n)return{error:n};const{mimeType:r,charset:s}=this.getMimeTypeAndCharset();return new t.ContentData.ContentData(e.body,e.base64Encoded,r??"application/octet-stream",s??void 0)}isRedirect(){return void 0!==this.responseStatusCode&&this.responseStatusCode>=300&&this.responseStatusCode<400}getMimeTypeAndCharset(){for(const e of this.responseHeaders??[])if("content-type"===e.name.toLowerCase())return r.MimeType.parseContentType(e.value);return{mimeType:this.networkRequest?.mimeType??null,charset:this.networkRequest?.charset()??null}}}class ue{#de;#ce;#he;#ue;#ge;#pe;#me;constructor(){this.#de=[],this.#ce=[],this.#ue=[],this.#he=[],this.#ge=!1,this.#pe=null,this.#me=null}addRequest(e){this.#de.push(e),this.sync(this.#de.length-1)}addRequestExtraInfo(e){this.#ce.push(e),this.sync(this.#ce.length-1)}addResponseExtraInfo(e){this.#he.push(e),this.sync(this.#he.length-1)}setEarlyHintsHeaders(e){this.#ue=e,this.updateFinalRequest()}setWebBundleInfo(e){this.#pe=e,this.updateFinalRequest()}setWebBundleInnerRequestInfo(e){this.#me=e,this.updateFinalRequest()}finished(){this.#ge=!0,this.updateFinalRequest()}isFinished(){return this.#ge}sync(e){const t=this.#de[e];if(!t)return;const n=this.#ce[e];n&&(t.addExtraRequestInfo(n),this.#ce[e]=null);const r=this.#he[e];r&&(t.addExtraResponseInfo(r),this.#he[e]=null)}finalRequest(){return this.#ge&&this.#de[this.#de.length-1]||null}updateFinalRequest(){if(!this.#ge)return;const e=this.finalRequest();e?.setWebBundleInfo(this.#pe),e?.setWebBundleInnerRequestInfo(this.#me),e?.setEarlyHintsHeaders(this.#ue)}}h.register(Z,{capabilities:16,autostart:!0});var ge=Object.freeze({__proto__:null,ConditionsSerializer:class{stringify(e){const t=e;return JSON.stringify({...t,title:"function"==typeof t.title?t.title():t.title})}parse(e){const t=JSON.parse(e);return{...t,title:t.i18nTitleKey?X(t.i18nTitleKey):t.title}}},get Events(){return ee},Fast4GConditions:ie,FetchDispatcher:ae,InterceptedRequest:he,MultitargetNetworkManager:ce,NetworkDispatcher:le,NetworkManager:Z,NoThrottlingConditions:te,OfflineConditions:ne,Slow3GConditions:re,Slow4GConditions:se,networkConditionsEqual:function(e,t){const n=e.i18nTitleKey||("function"==typeof e.title?e.title():e.title),r=t.i18nTitleKey||("function"==typeof t.title?t.title():t.title);return t.download===e.download&&t.upload===e.upload&&t.latency===e.latency&&e.packetLoss===t.packetLoss&&e.packetQueueLength===t.packetQueueLength&&e.packetReordering===t.packetReordering&&r===n}});class pe{#fe;#be;#ye=new Map;#ve;#Ie;constructor(e){this.#fe=e.fontFamily,this.#be=e.fontVariationAxes||[],this.#ve=e.src,this.#Ie=e.fontDisplay;for(const e of this.#be)this.#ye.set(e.tag,e)}getFontFamily(){return this.#fe}getSrc(){return this.#ve}getFontDisplay(){return this.#Ie}getVariationAxisByTag(e){return this.#ye.get(e)}}var me=Object.freeze({__proto__:null,CSSFontFace:pe});class fe{text;node;name;fallback;matching;computedTextCallback;constructor(e,t,n,r,s,i){this.text=e,this.node=t,this.name=n,this.fallback=r,this.matching=s,this.computedTextCallback=i}computedText(){return this.computedTextCallback(this,this.matching)}}class be extends(kt(fe)){#we;constructor(e){super(),this.#we=e}matches(e,t){const n=e.getChild("Callee"),r=e.getChild("ArgList");if("CallExpression"!==e.name||!n||"var"!==t.ast.text(n)||!r)return null;const[s,i,...o]=Pt.children(r);if("("!==s?.name||"VariableName"!==i?.name)return null;if(o.length<=1&&")"!==o[0]?.name)return null;let a=[];if(o.length>1){if(","!==o.shift()?.name)return null;if(")"!==o.pop()?.name)return null;if(a=o,0===a.length)return null;if(a.some((e=>","===e.name)))return null}const l=t.ast.text(i);return l.startsWith("--")?new fe(t.ast.text(e),e,l,a,t,this.#we):null}}class ye extends fe{matchedStyles;style;constructor(e,t,n,r,s,i,o){super(e,t,n,r,s,(()=>this.resolveVariable()?.value??this.fallbackValue())),this.matchedStyles=i,this.style=o}resolveVariable(){return this.matchedStyles.computeCSSVariable(this.style,this.name)}fallbackValue(){return 0===this.fallback.length||this.matching.hasUnresolvedVarsRange(this.fallback[0],this.fallback[this.fallback.length-1])?null:this.matching.getComputedTextRange(this.fallback[0],this.fallback[this.fallback.length-1])}}class ve extends(kt(ye)){matchedStyles;style;constructor(e,t){super(),this.matchedStyles=e,this.style=t}matches(e,t){const n=new be((()=>null)).matches(e,t);return n?new ye(n.text,n.node,n.name,n.fallback,n.matching,this.matchedStyles,this.style):null}}class Ie{text;node;constructor(e,t){this.text=e,this.node=t}}class we extends(kt(Ie)){accepts(){return!0}matches(e,t){return"BinaryExpression"===e.name?new Ie(t.ast.text(e),e):null}}class Se{text;node;computedText;constructor(e,t){this.text=e,this.node=t,"Comment"===t.name&&(this.computedText=()=>"")}render(){const e=document.createElement("span");return e.appendChild(document.createTextNode(this.text)),[e]}}class ke extends(kt(Se)){accepts(){return!0}matches(e,t){if(!e.firstChild||"NumberLiteral"===e.name){const n=t.ast.text(e);if(n.length)return new Se(n,e)}return null}}class Ce{text;node;constructor(e,t){this.text=e,this.node=t}computedText(){return this.text}}class xe extends(kt(Ce)){accepts(e){return S().isAngleAwareProperty(e)}matches(e,t){if("NumberLiteral"!==e.name)return null;const n=e.getChild("Unit");return n&&["deg","grad","rad","turn"].includes(t.ast.text(n))?new Ce(t.ast.text(e),e):null}}function Re(e,t){if("NumberLiteral"!==e.type.name)return null;const n=t.text(e);return Number(n.substring(0,n.length-t.text(e.getChild("Unit")).length))}class Te{text;node;space;color1;color2;constructor(e,t,n,r,s){this.text=e,this.node=t,this.space=n,this.color1=r,this.color2=s}}class Me extends(kt(Te)){accepts(e){return S().isColorAwareProperty(e)}matches(e,t){if("CallExpression"!==e.name||"color-mix"!==t.ast.text(e.getChild("Callee")))return null;const n=Lt("--property",t.getComputedText(e));if(!n)return null;const r=Pt.declValue(n.tree);if(!r)return null;const s=Pt.callArgs(r);if(3!==s.length)return null;const[i,o,a]=s;if(i.length<2||"in"!==n.text(Pt.stripComments(i).next().value)||o.length<1||a.length<1)return null;const l=o.filter((e=>"NumberLiteral"===e.type.name&&"%"===n.text(e.getChild("Unit")))),d=a.filter((e=>"NumberLiteral"===e.type.name&&"%"===n.text(e.getChild("Unit"))));if(l.length>1||d.length>1)return null;if(l[0]&&d[0]&&0===(Re(l[0],n)??0)&&0===(Re(d[0],n)??0))return null;const c=Pt.callArgs(e);return 3!==c.length?null:new Te(t.ast.text(e),e,c[0],c[1],c[2])}}class Pe{url;text;node;constructor(e,t,n){this.url=e,this.text=t,this.node=n}}class Ee extends(kt(Pe)){matches(e,t){if("CallLiteral"!==e.name)return null;const n=e.getChild("CallTag");if(!n||"url"!==t.ast.text(n))return null;const[,r,s,i]=Pt.siblings(n);if("("!==t.ast.text(r)||"ParenthesizedContent"!==s.name&&"StringLiteral"!==s.name||")"!==t.ast.text(i))return null;const o=t.ast.text(s),a="StringLiteral"===s.name?o.substr(1,o.length-2):o.trim();return new Pe(a,t.ast.text(e),e)}}class Le{text;node;constructor(e,t){this.text=e,this.node=t}}class Ae extends(kt(Le)){matches(e,t){const n=t.ast.text(e);return"CallExpression"===e.name&&"linear-gradient"===t.ast.text(e.getChild("Callee"))?new Le(n,e):null}accepts(e){return["background","background-image","-webkit-mask-image"].includes(e)}}class Oe{text;node;currentColorCallback;computedText;constructor(e,t,n){this.text=e,this.node=t,this.currentColorCallback=n,this.computedText=n}}class De extends(kt(Oe)){currentColorCallback;constructor(e){super(),this.currentColorCallback=e}accepts(e){return S().isColorAwareProperty(e)}matches(t,n){const r=n.ast.text(t);if("ColorLiteral"===t.name)return new Oe(r,t);if("ValueName"===t.name){if(e.Color.Nicknames.has(r))return new Oe(r,t);if("currentcolor"===r.toLowerCase()&&this.currentColorCallback){const e=this.currentColorCallback;return new Oe(r,t,(()=>e()??r))}}if("CallExpression"===t.name){const e=t.getChild("Callee");if(e&&n.ast.text(e).match(/^(rgba?|hsla?|hwba?|lab|lch|oklab|oklch|color)$/))return new Oe(r,t)}return null}}class Ne{text;node;light;dark;style;constructor(e,t,n,r,s){this.text=e,this.node=t,this.light=n,this.dark=r,this.style=s}}class Fe extends(kt(Ne)){style;constructor(e){super(),this.style=e}accepts(e){return S().isColorAwareProperty(e)}matches(e,t){if("CallExpression"!==e.name||"light-dark"!==t.ast.text(e.getChild("Callee")))return null;const n=Pt.callArgs(e);return 2!==n.length||0===n[0].length||0===n[1].length?null:new Ne(t.ast.text(e),e,n[0],n[1],this.style)}}class Be{text;node;auto;base;constructor(e,t,n,r){this.text=e,this.node=t,this.auto=n,this.base=r}}class _e extends(kt(Be)){matches(e,t){if("CallExpression"!==e.name||"-internal-auto-base"!==t.ast.text(e.getChild("Callee")))return null;const n=Pt.callArgs(e);return 2!==n.length||0===n[0].length||0===n[1].length?null:new Be(t.ast.text(e),e,n[0],n[1])}}class He{text;node;propertyName;constructor(e,t,n){this.text=e,this.node=t,this.propertyName=n}}class Ue extends(kt(He)){static isLinkableNameProperty(e){return["animation","animation-name","font-palette","position-try-fallbacks","position-try"].includes(e)}static identifierAnimationLonghandMap=new Map(Object.entries({normal:"direction",alternate:"direction",reverse:"direction","alternate-reverse":"direction",none:"fill-mode",forwards:"fill-mode",backwards:"fill-mode",both:"fill-mode",running:"play-state",paused:"play-state",infinite:"iteration-count",linear:"easing-function",ease:"easing-function","ease-in":"easing-function","ease-out":"easing-function","ease-in-out":"easing-function",steps:"easing-function","step-start":"easing-function","step-end":"easing-function"}));matchAnimationNameInShorthand(e,t){const n=t.ast.text(e);if(!Ue.identifierAnimationLonghandMap.has(n))return new He(n,e,"animation");const r=Pt.split(Pt.siblings(Pt.declValue(t.ast.tree))).find((t=>t[0].from<=e.from&&t[t.length-1].to>=e.to));if(!r)return null;const s=Lt("--p",t.getComputedTextRange(r[0],e));if(!s)return null;const i=Ue.identifierAnimationLonghandMap.get(n);for(let t=Pt.declValue(s.tree);t?.nextSibling;t=t.nextSibling)if("ValueName"===t.name){const r=Ue.identifierAnimationLonghandMap.get(s.text(t));if(r&&r===i)return new He(n,e,"animation")}return null}accepts(e){return Ue.isLinkableNameProperty(e)}matches(e,t){const{propertyName:n}=t.ast,r=t.ast.text(e),s=e.parent;if(!s)return null;const i="Declaration"===s.name,o="ArgList"===s.name&&"Callee"===s.prevSibling?.name&&"var"===t.ast.text(s.prevSibling),a=i||o,l="position-try"===n||"position-try-fallbacks"===n;return!n||"ValueName"!==e.name&&"VariableName"!==e.name||!a||"ValueName"===e.name&&l?null:"animation"===n?this.matchAnimationNameInShorthand(e,t):new He(r,e,n)}}class qe{text;node;constructor(e,t){this.text=e,this.node=t}}class ze extends(kt(qe)){accepts(e){return S().isBezierAwareProperty(e)}matches(e,t){const n=t.ast.text(e),r="ValueName"===e.name&&b.has(n),s="CallExpression"===e.name&&["cubic-bezier","linear"].includes(t.ast.text(e.getChild("Callee")));return r||s?new qe(n,e):null}}class je{text;node;constructor(e,t){this.text=e,this.node=t}}class Ve extends(kt(je)){matches(e,t){return"StringLiteral"===e.name?new je(t.ast.text(e),e):null}}class We{text;node;shadowType;constructor(e,t,n){this.text=e,this.node=t,this.shadowType=n}}class Ge extends(kt(We)){accepts(e){return S().isShadowProperty(e)}matches(e,t){if("Declaration"!==e.name)return null;const n=Pt.siblings(Pt.declValue(e));if(0===n.length)return null;const r=t.ast.textRange(n[0],n[n.length-1]);return new We(r,e,"text-shadow"===t.ast.propertyName?"textShadow":"boxShadow")}}class Ke{text;node;constructor(e,t){this.text=e,this.node=t}}class Qe extends(kt(Ke)){accepts(e){return S().isFontAwareProperty(e)}matches(e,t){if("Declaration"!==e.name)return null;const n=Pt.siblings(Pt.declValue(e));if(0===n.length)return null;const r="font-family"===t.ast.propertyName?["ValueName","StringLiteral","Comment",","]:["Comment","ValueName","NumberLiteral"];if(n.some((e=>!r.includes(e.name))))return null;const s=t.ast.textRange(n[0],n[n.length-1]);return new Ke(s,e)}}class $e{text;node;unit;constructor(e,t,n){this.text=e,this.node=t,this.unit=n}}class Xe extends(kt($e)){static LENGTH_UNITS=new Set(["em","ex","ch","cap","ic","lh","rem","rex","rch","rlh","ric","rcap","pt","pc","in","cm","mm","Q","vw","vh","vi","vb","vmin","vmax","dvw","dvh","dvi","dvb","dvmin","dvmax","svw","svh","svi","svb","svmin","svmax","lvw","lvh","lvi","lvb","lvmin","lvmax","cqw","cqh","cqi","cqb","cqmin","cqmax","cqem","cqlh","cqex","cqch"]);matches(e,t){if("NumberLiteral"!==e.name)return null;const n=t.ast.text(e.getChild("Unit"));if(!Xe.LENGTH_UNITS.has(n))return null;const r=t.ast.text(e);return new $e(r,e,n)}}class Je{text;node;func;args;constructor(e,t,n,r){this.text=e,this.node=t,this.func=n,this.args=r}}class Ye extends(kt(Je)){matches(e,t){if("CallExpression"!==e.name)return null;const n=t.ast.text(e.getChild("Callee"));if(!["min","max","clamp","calc"].includes(n))return null;const r=Pt.callArgs(e);if(r.some((e=>0===e.length||t.hasUnresolvedVarsRange(e[0],e[e.length-1]))))return null;const s=t.ast.text(e);return new Je(s,e,n,r)}}class Ze{text;node;isFlex;constructor(e,t,n){this.text=e,this.node=t,this.isFlex=n}}class et extends(kt(Ze)){static FLEX=["flex","inline-flex","block flex","inline flex"];static GRID=["grid","inline-grid","block grid","inline grid"];accepts(e){return"display"===e}matches(e,t){if("Declaration"!==e.name)return null;const n=Pt.siblings(Pt.declValue(e));if(n.length<1)return null;const r=n.filter((e=>"Important"!==e.name)).map((e=>t.getComputedText(e).trim())).filter((e=>e)),s=r.join(" ");return et.FLEX.includes(s)?new Ze(t.ast.text(e),e,!0):et.GRID.includes(s)?new Ze(t.ast.text(e),e,!1):null}}class tt{text;node;lines;constructor(e,t,n){this.text=e,this.node=t,this.lines=n}}class nt extends(kt(tt)){accepts(e){return S().isGridAreaDefiningProperty(e)}matches(e,t){if("Declaration"!==e.name||t.hasUnresolvedVars(e))return null;const n=[];let r=[],s=!1,i=!1;const o=Pt.siblings(Pt.declValue(e));!function e(o,a=!1){for(const l of o)if(t.getMatch(l)instanceof fe){const o=Lt("--property",t.getComputedText(l));if(!o)continue;const a=Pt.siblings(Pt.declValue(o.tree));if(0===a.length)continue;"StringLiteral"===a[0].name&&!s||"LineNames"===a[0].name&&!i?(n.push(r),r=[l]):r.push(l),e(a,!0)}else"BinaryExpression"===l.name?e(Pt.siblings(l.firstChild)):"StringLiteral"===l.name?(a||(s?r.push(l):(n.push(r),r=[l])),i=!0,s=!1):"LineNames"===l.name?(a||(i?r.push(l):(n.push(r),r=[l])),s=!i,i=!i):a||r.push(l)}(o),n.push(r);const a=t.ast.textRange(o[0],o[o.length-1]);return new tt(a,e,n.filter((e=>e.length>0)))}}class rt{text;node;functionName;constructor(e,t,n){this.text=e,this.node=t,this.functionName=n}}class st extends(kt(rt)){anchorFunction(e,t){if("CallExpression"!==e.name)return null;const n=t.ast.text(e.getChild("Callee"));return"anchor"===n||"anchor-size"===n?n:null}matches(e,t){if("VariableName"===e.name){let n=e.parent;return n&&"ArgList"===n.name?(n=n.parent,n&&this.anchorFunction(n,t)?new rt(t.ast.text(e),e,null):null):null}const n=this.anchorFunction(e,t);if(!n)return null;const r=Pt.children(e.getChild("ArgList"));return"anchor"===n&&r.length<=2||r.find((e=>"VariableName"===e.name))?null:new rt(t.ast.text(e),e,n)}}class it{text;matching;node;constructor(e,t,n){this.text=e,this.matching=t,this.node=n}}class ot extends(kt(it)){accepts(e){return"position-anchor"===e}matches(e,t){if("VariableName"!==e.name)return null;const n=t.ast.text(e);return new it(n,t,e)}}class at{text;node;property;matchedStyles;constructor(e,t,n,r){this.text=e,this.node=t,this.property=n,this.matchedStyles=r}resolveProperty(){return this.matchedStyles.resolveGlobalKeyword(this.property,this.text)}computedText(){return this.resolveProperty()?.value??null}}class lt extends(kt(at)){property;matchedStyles;constructor(e,t){super(),this.property=e,this.matchedStyles=t}matches(e,t){const n=e.parent;if("ValueName"!==e.name||"Declaration"!==n?.name)return null;if(Array.from(Pt.stripComments(Pt.siblings(Pt.declValue(n)))).some((t=>!Pt.equals(t,e))))return null;const r=t.ast.text(e);return f.isCSSWideKeyword(r)?new at(r,e,this.property,this.matchedStyles):null}}class dt{text;node;preamble;fallbacks;constructor(e,t,n,r){this.text=e,this.node=t,this.preamble=n,this.fallbacks=r}}class ct extends(kt(dt)){accepts(e){return"position-try"===e||"position-try-fallbacks"===e}matches(e,t){if("Declaration"!==e.name)return null;let n=[];const r=Pt.siblings(Pt.declValue(e)),s=Pt.split(r);if("position-try"===t.ast.propertyName)for(const[e,r]of s[0].entries()){const i=t.getComputedText(r);if(f.isCSSWideKeyword(i))return null;if(f.isPositionTryOrderKeyword(i)){n=s[0].splice(0,e+1);break}}const i=t.ast.textRange(r[0],r[r.length-1]);return new dt(i,e,n,s)}}var ht=Object.freeze({__proto__:null,AnchorFunctionMatch:rt,AnchorFunctionMatcher:st,AngleMatch:Ce,AngleMatcher:xe,AutoBaseMatch:Be,AutoBaseMatcher:_e,BaseVariableMatch:fe,BaseVariableMatcher:be,BezierMatch:qe,BezierMatcher:ze,BinOpMatch:Ie,BinOpMatcher:we,CSSWideKeywordMatch:at,CSSWideKeywordMatcher:lt,ColorMatch:Oe,ColorMatcher:De,ColorMixMatch:Te,ColorMixMatcher:Me,FlexGridMatch:Ze,FlexGridMatcher:et,FontMatch:Ke,FontMatcher:Qe,GridTemplateMatch:tt,GridTemplateMatcher:nt,LengthMatch:$e,LengthMatcher:Xe,LightDarkColorMatch:Ne,LightDarkColorMatcher:Fe,LinearGradientMatch:Le,LinearGradientMatcher:Ae,LinkableNameMatch:He,LinkableNameMatcher:Ue,MathFunctionMatch:Je,MathFunctionMatcher:Ye,PositionAnchorMatch:it,PositionAnchorMatcher:ot,PositionTryMatch:dt,PositionTryMatcher:ct,ShadowMatch:We,ShadowMatcher:Ge,StringMatch:je,StringMatcher:Ve,TextMatch:Se,TextMatcher:ke,URLMatch:Pe,URLMatcher:Ee,VariableMatch:ye,VariableMatcher:ve});const ut=new Set(["inherit","initial","unset"]),gt=/[\x20-\x7E]{4}/,pt=new RegExp(`(?:'(${gt.source})')|(?:"(${gt.source})")\\s+(${/[+-]?(?:\d*\.)?\d+(?:[eE]\d+)?/.source})`);const mt=/^"(.+)"|'(.+)'$/;function ft(e){return e.split(",").map((e=>e.trim()))}function bt(e){return e.replaceAll(/(\/\*(?:.|\s)*?\*\/)/g,"")}const yt=d.css.cssLanguage.parser;function vt(e,t){return It(e,e,t)}function It(e,t,n){return n.substring(e.from,t.to)}class wt{propertyValue;rule;tree;trailingNodes;propertyName;constructor(e,t,n,r,s=[]){this.propertyName=r,this.propertyValue=e,this.rule=t,this.tree=n,this.trailingNodes=s}text(e){return null===e?"":vt(e??this.tree,this.rule)}textRange(e,t){return It(e,t,this.rule)}subtree(e){return new wt(this.propertyValue,this.rule,e)}}class St{ast;constructor(e){this.ast=e}static walkExcludingSuccessors(e,...t){const n=new this(e,...t);return"Declaration"===e.tree.name?n.iterateDeclaration(e.tree):n.iterateExcludingSuccessors(e.tree),n}static walk(e,...t){const n=new this(e,...t);return"Declaration"===e.tree.name?n.iterateDeclaration(e.tree):n.iterate(e.tree),n}iterateDeclaration(e){if("Declaration"===e.name){if(this.enter(e))for(const t of Pt.siblings(Pt.declValue(e)))t.cursor().iterate(this.enter.bind(this),this.leave.bind(this));this.leave(e)}}iterate(e){for(const t of Pt.siblings(e))t.cursor().iterate(this.enter.bind(this),this.leave.bind(this))}iterateExcludingSuccessors(e){e.cursor().iterate(this.enter.bind(this),this.leave.bind(this))}enter(e){return!0}leave(e){}}function kt(e){return class{matchType=e;accepts(e){return!0}matches(e,t){return null}}}class Ct extends St{#Se=[];#ke=new Map;computedText;#Ce(e){return`${e.from}:${e.to}`}constructor(e,t){super(e),this.computedText=new Rt(e.rule.substring(e.tree.from)),this.#Se.push(...t.filter((t=>!e.propertyName||t.accepts(e.propertyName)))),this.#Se.push(new ke)}leave({node:e}){for(const t of this.#Se){const n=t.matches(e,this);if(n){this.computedText.push(n,e.from-this.ast.tree.from),this.#ke.set(this.#Ce(e),n);break}}}matchText(e){const t=this.#Se.splice(0);this.#Se.push(new ke),this.iterateExcludingSuccessors(e),this.#Se.push(...t)}hasMatches(...e){return Boolean(this.#ke.values().find((t=>e.some((e=>t instanceof e)))))}getMatch(e){return this.#ke.get(this.#Ce(e))}hasUnresolvedVars(e){return this.hasUnresolvedVarsRange(e,e)}hasUnresolvedVarsRange(e,t){return this.computedText.hasUnresolvedVars(e.from-this.ast.tree.from,t.to-this.ast.tree.from)}getComputedText(e,t){return this.getComputedTextRange(e,e,t)}getComputedPropertyValueText(){const[e,t]=Pt.range(Pt.siblings(Pt.declValue(this.ast.tree)));return this.getComputedTextRange(e??this.ast.tree,t??this.ast.tree)}getComputedTextRange(e,t,n){return this.computedText.get(e.from-this.ast.tree.from,t.to-this.ast.tree.from,n)}}class xt{match;offset;#xe=null;constructor(e,t){this.match=e,this.offset=t}get end(){return this.offset+this.length}get length(){return this.match.text.length}get computedText(){return null===this.#xe&&(this.#xe=this.match.computedText()),this.#xe}}class Rt{#Re=[];text;#Te=!0;constructor(e){this.text=e}clear(){this.#Re.splice(0)}get chunkCount(){return this.#Re.length}#Me(){this.#Te||(this.#Re.sort(((e,t)=>e.offsett.end?-1:e.end=this.text.length)return;const n=new xt(e,t);n.end>this.text.length||(this.#Te=!1,this.#Re.push(n))}*#Pe(e,t){this.#Me();let n=this.#Re.findIndex((t=>t.offset>=e));for(;n>=0&&ne&&et)n++;else for(yield this.#Re[n],e=this.#Re[n].end;e=n.end&&(yield n),e=n.end}if(e{if("string"==typeof e)return e;const t=n?.get(e.match);return t?s(t):e.computedText??e.match.text};for(const n of this.#Ee(e,t)){const e=s(n);0!==e.length&&(r.length>0&&Tt(r[r.length-1],e)&&r.push(" "),r.push(e))}return r.join("")}}function Tt(e,t){const n=Array.isArray(e)?e.findLast((e=>e.textContent))?.textContent:e,r=Array.isArray(t)?t.find((e=>e.textContent))?.textContent:t,s=n?n[n.length-1]:"",i=r?r[0]:"";return!(/\s/.test(s)||/\s/.test(i)||["","(","{","}",";","["].includes(s)||["","(",")",",",":","*","{",";","]"].includes(i))}const Mt=Map;var Pt;function Et(e){return yt.parse(e).topNode.getChild("RuleSet")?.getChild("Block")?.getChild("Declaration")??null}function Lt(e,t){const n=At(e);if(!n)return null;const r=`*{${n}: ${t};}`,s=Et(r);if(!s||s.type.isError)return null;const i=Pt.children(s);if(i.length<2)return null;const[o,a,l]=i;if(!o||o.type.isError||!a||a.type.isError||l?.type.isError)return null;const d=Pt.siblings(s).slice(1),[c,h]=d.splice(d.length-2,2);if(";"!==c?.name&&"}"!==h?.name)return null;const u=new wt(t,r,s,n,d);return u.text(o)!==n||":"!==a.name?null:u}function At(e){const t=`*{${e}: inherit;}`,n=Et(t);if(!n||n.type.isError)return null;const r=n.getChild("PropertyName")??n.getChild("VariableName");return r?vt(r,t):null}function Ot(e,t,n){const r=Lt(e,t),s=r&&Ct.walk(r,n);return r?.trailingNodes.forEach((e=>s?.matchText(e))),s}!function(e){function t(e){const t=[];for(;e;)t.push(e),e=e.nextSibling;return t}function n(e){return t(e?.firstChild??null)}function r(e){const t=[];let n=[];for(const r of e)","===r.name?(t.push(n),n=[]):n.push(r);return t.push(n),t}e.siblings=t,e.children=n,e.range=function(e){return[e[0],e[e.length-1]]},e.declValue=function(e){return"Declaration"!==e.name?null:n(e).find((e=>":"===e.name))?.nextSibling??null},e.stripComments=function*(e){for(const t of e)"Comment"!==t.type.name&&(yield t)},e.split=r,e.callArgs=function(e){const t=n(e.getChild("ArgList")),s=t.splice(0,1)[0],i=t.pop();return"("!==s?.name||")"!==i?.name?[]:r(t)},e.equals=function(e,t){return e.name===t.name&&e.from===t.from&&e.to===t.to}}(Pt||(Pt={}));class Dt extends St{#Le=null;#Ae;constructor(e,t){super(e),this.#Ae=t}enter({node:e}){return!this.#Le&&(!this.#Ae(e)||(this.#Le=this.#Le??e,!1))}static find(e,t){return Dt.walk(e,t).#Le}static findAll(e,t){const n=[];return Dt.walk(e,(e=>(t(e)&&n.push(e),!1))),n}}var Nt=Object.freeze({__proto__:null,get ASTUtils(){return Pt},BottomUpTreeMatching:Ct,CSSControlMap:Mt,ComputedText:Rt,SyntaxTree:wt,TreeSearch:Dt,TreeWalker:St,matchDeclaration:Ot,matcherBase:kt,parseFontFamily:function(e){if(ut.has(e.trim()))return[];const t=[];for(const n of ft(bt(e))){const e=n.match(mt);e?t.push(e[1]||e[2]):t.push(n)}return t},parseFontVariationSettings:function(e){if(ut.has(e.trim())||"normal"===e.trim())return[];const t=[];for(const n of ft(bt(e))){const e=n.match(pt);e&&t.push({tag:e[1]||e[2],value:parseFloat(e[3])})}return t},requiresSpace:Tt,splitByComma:ft,stripComments:bt,tokenizeDeclaration:Lt,tokenizePropertyName:At});class Ft extends e.ObjectWrapper.ObjectWrapper{ownerStyle;index;name;value;important;disabled;parsedOk;implicit;text;range;#Oe;#De;#Ne;#Fe;#Be=[];constructor(e,n,r,s,i,o,a,l,d,c,h){if(super(),this.ownerStyle=e,this.index=n,this.name=r,this.value=s,this.important=i,this.disabled=o,this.parsedOk=a,this.implicit=l,this.text=d,this.range=c?t.TextRange.TextRange.fromObject(c):null,this.#Oe=!0,this.#De=null,this.#Ne=null,h&&h.length>0)for(const t of h)this.#Be.push(new Ft(e,++n,t.name,t.value,i,o,a,!0));else{const t=S().getLonghands(r);for(const r of t||[])this.#Be.push(new Ft(e,++n,r,"",i,o,a,!0))}}static parsePayload(e,t,n){return new Ft(e,t,n.name,n.value,n.important||!1,n.disabled||!1,!("parsedOk"in n)||Boolean(n.parsedOk),Boolean(n.implicit),n.text,n.range,n.longhandProperties)}parseExpression(e,t,n){return this.parsedOk?Ot(this.name,e,this.#Se(t,n)):null}parseValue(e,t){return this.parsedOk?Ot(this.name,this.value,this.#Se(e,t)):null}#Se(e,t){const n=e.propertyMatchers(this.ownerStyle,t);return n.push(new lt(this,e)),o.Runtime.experiments.isEnabled("font-editor")&&n.push(new Qe),n}ensureRanges(){if(this.#De&&this.#Ne)return;const e=this.range,n=this.text?new t.Text.Text(this.text):null;if(!e||!n)return;const r=n.value().indexOf(this.name),s=n.value().lastIndexOf(this.value);if(-1===r||-1===s||r>s)return;const i=new t.TextRange.SourceRange(r,this.name.length),o=new t.TextRange.SourceRange(s,this.value.length);function a(e,t,n){return 0===e.startLine&&(e.startColumn+=n,e.endColumn+=n),e.startLine+=t,e.endLine+=t,e}this.#De=a(n.toTextRange(i),e.startLine,e.startColumn),this.#Ne=a(n.toTextRange(o),e.startLine,e.startColumn)}nameRange(){return this.ensureRanges(),this.#De}valueRange(){return this.ensureRanges(),this.#Ne}rebase(e){this.ownerStyle.styleSheetId===e.styleSheetId&&this.range&&(this.range=this.range.rebaseAfterTextEdit(e.oldRange,e.newRange))}setActive(e){this.#Oe=e}get propertyText(){return void 0!==this.text?this.text:""===this.name?"":this.name+": "+this.value+(this.important?" !important":"")+";"}activeInStyle(){return this.#Oe}async setText(n,s,i){if(!this.ownerStyle)throw new Error("No ownerStyle for property");if(!this.ownerStyle.styleSheetId)throw new Error("No owner style id");if(!this.range||!this.ownerStyle.range)throw new Error("Style not editable");if(s&&(a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited),this.ownerStyle.parentRule?.isKeyframeRule()&&a.userMetrics.actionTaken(a.UserMetrics.Action.StylePropertyInsideKeyframeEdited),this.name.startsWith("--")&&a.userMetrics.actionTaken(a.UserMetrics.Action.CustomPropertyEdited)),i&&n===this.propertyText)return this.ownerStyle.cssModel().domModel().markUndoableState(!s),!0;const o=this.range.relativeTo(this.ownerStyle.range.startLine,this.ownerStyle.range.startColumn),l=this.ownerStyle.cssText?this.detectIndentation(this.ownerStyle.cssText):e.Settings.Settings.instance().moduleSetting("text-editor-indent").get(),d=this.ownerStyle.cssText?l.substring(0,this.ownerStyle.range.endColumn):"",c=new t.Text.Text(this.ownerStyle.cssText||"").replaceRange(o,r.StringUtilities.sprintf(";%s;",n)),h=await Ft.formatStyle(c,l,d);return await this.ownerStyle.setText(h,s)}static async formatStyle(e,n,r){const s=n.substring(r.length)+n;n&&(n="\n"+n);let i="",o="",a="",l=!1,d=!1;const c=t.CodeMirrorUtils.createCssTokenizer();return await c("*{"+e+"}",(function(e,t){if(!l){const r=t?.includes("comment")&&function(e){const t=e.indexOf(":");if(-1===t)return!1;const n=e.substring(2,t).trim();return S().isCSSPropertyName(n)}(e),s=t?.includes("def")||t?.includes("string")||t?.includes("meta")||t?.includes("property")||t?.includes("variableName")&&"variableName.function"!==t;return r?i=i.trimEnd()+n+e:s?(l=!0,a=e):(";"!==e||d)&&(i+=e,e.trim()&&!t?.includes("comment")&&(d=";"!==e)),void("{"!==e||t||(d=!1))}if("}"===e||";"===e){const t=a.trim();return i=i.trimEnd()+n+t+(t.endsWith(":")?" ":"")+e,d=!1,l=!1,void(o="")}if(S().isGridAreaDefiningProperty(o)){const t=I.exec(e);t&&0===t.index&&!a.trimEnd().endsWith("]")&&(a=a.trimEnd()+"\n"+s)}o||":"!==e||(o=a);a+=e})),l&&(i+=a),i=i.substring(2,i.length-1).trimEnd(),i+(n?"\n"+r:"")}detectIndentation(e){const n=e.split("\n");return n.length<2?"":t.TextUtils.Utils.lineIndent(n[1])}setValue(e,t,n,r){const s=this.name+": "+e+(this.important?" !important":"")+";";this.setText(s,t,n).then(r)}setLocalValue(e){this.value=e,this.dispatchEventToListeners("localValueUpdated")}async setDisabled(e){if(!this.ownerStyle)return!1;if(e===this.disabled)return!0;if(!this.text)return!0;const t=this.text.trim(),n=e=>e+(e.endsWith(";")?"":";");let r;return r=e?"/* "+n(bt(t))+" */":n(this.text.substring(2,t.length-2).trim()),await this.setText(r,!0,!0)}setDisplayedStringForInvalidProperty(e){this.#Fe=e}getInvalidStringForInvalidProperty(){return this.#Fe}getLonghandProperties(){return this.#Be}}var Bt=Object.freeze({__proto__:null,CSSProperty:Ft});class _t{text="";range;styleSheetId;cssModel;constructor(e){this.cssModel=e}rebase(e){this.styleSheetId===e.styleSheetId&&this.range&&(e.oldRange.equal(this.range)?this.reinitialize(e.payload):this.range=this.range.rebaseAfterTextEdit(e.oldRange,e.newRange))}equal(e){return!!(this.styleSheetId&&this.range&&e.range)&&(this.styleSheetId===e.styleSheetId&&this.range.equal(e.range))}lineNumberInSource(){if(this.range)return this.header()?.lineNumberInSource(this.range.startLine)}columnNumberInSource(){if(this.range)return this.header()?.columnNumberInSource(this.range.startLine,this.range.startColumn)}header(){return this.styleSheetId?this.cssModel.styleSheetHeaderForId(this.styleSheetId):null}rawLocation(){const e=this.header();if(!e||void 0===this.lineNumberInSource())return null;const t=Number(this.lineNumberInSource());return new Ur(e,t,this.columnNumberInSource())}}var Ht=Object.freeze({__proto__:null,CSSQuery:_t});class Ut extends _t{name;physicalAxes;logicalAxes;queriesScrollState;static parseContainerQueriesPayload(e,t){return t.map((t=>new Ut(e,t)))}constructor(e,t){super(e),this.reinitialize(t)}reinitialize(e){this.text=e.text,this.range=e.range?t.TextRange.TextRange.fromObject(e.range):null,this.styleSheetId=e.styleSheetId,this.name=e.name,this.physicalAxes=e.physicalAxes,this.logicalAxes=e.logicalAxes,this.queriesScrollState=e.queriesScrollState}active(){return!0}async getContainerForNode(e){const t=await this.cssModel.domModel().getContainerForNode(e,this.name,this.physicalAxes,this.logicalAxes,this.queriesScrollState);if(t)return new qt(t)}}class qt{containerNode;constructor(e){this.containerNode=e}async getContainerSizeDetails(){const e=await this.containerNode.domModel().cssModel().getComputedStyle(this.containerNode.id);if(!e)return;const t=e.get("container-type"),n=e.get("writing-mode");if(!t||!n)return;const r=zt(`${t}`),s=jt(r,n);let i,o;return"Both"!==s&&"Horizontal"!==s||(i=e.get("width")),"Both"!==s&&"Vertical"!==s||(o=e.get("height")),{queryAxis:r,physicalAxis:s,width:i,height:o}}}const zt=e=>{const t=e.split(" ");let n=!1;for(const e of t){if("size"===e)return"size";n=n||"inline-size"===e}return n?"inline-size":""},jt=(e,t)=>{const n=t.startsWith("vertical");switch(e){case"":return"";case"size":return"Both";case"inline-size":return n?"Vertical":"Horizontal";case"block-size":return n?"Horizontal":"Vertical"}};var Vt=Object.freeze({__proto__:null,CSSContainerQuery:Ut,CSSContainerQueryContainer:qt,getPhysicalAxisFromQueryAxis:jt,getQueryAxisFromContainerType:zt});class Wt extends _t{static parseLayerPayload(e,t){return t.map((t=>new Wt(e,t)))}constructor(e,t){super(e),this.reinitialize(t)}reinitialize(e){this.text=e.text,this.range=e.range?t.TextRange.TextRange.fromObject(e.range):null,this.styleSheetId=e.styleSheetId}active(){return!0}}var Gt=Object.freeze({__proto__:null,CSSLayer:Wt});class Kt{#_e;#He;constructor(e){this.#_e=e.active,this.#He=[];for(let t=0;tnew $t(e,t)))}constructor(e,t){super(e),this.reinitialize(t)}reinitialize(e){if(this.text=e.text,this.source=e.source,this.sourceURL=e.sourceURL||"",this.range=e.range?t.TextRange.TextRange.fromObject(e.range):null,this.styleSheetId=e.styleSheetId,this.mediaList=null,e.mediaList){this.mediaList=[];for(let t=0;tnew Jt(e,t)))}constructor(e,t){super(e),this.reinitialize(t)}reinitialize(e){this.text=e.text,this.range=e.range?t.TextRange.TextRange.fromObject(e.range):null,this.styleSheetId=e.styleSheetId}active(){return!0}}var Yt,Zt=Object.freeze({__proto__:null,CSSScope:Jt});class en{#je;parentRule;#Ve;styleSheetId;range;cssText;#We=new Map;#Ge=new Set;#Ke=new Map;#Qe;type;#$e;constructor(e,t,n,r,s){this.#je=e,this.parentRule=t,this.#Xe(n),this.type=r,this.#$e=s}rebase(e){if(this.styleSheetId===e.styleSheetId&&this.range)if(e.oldRange.equal(this.range))this.#Xe(e.payload);else{this.range=this.range.rebaseAfterTextEdit(e.oldRange,e.newRange);for(let t=0;t=0;--e)if(this.allProperties()[e].range)return e+1;return 0}#et(e){const t=this.propertyAt(e);if(t?.range)return t.range.collapseToStart();if(!this.range)throw new Error("CSSStyleDeclaration.range is null");return this.range.collapseToEnd()}newBlankProperty(e){e=void 0===e?this.pastLastSourcePropertyIndex():e;return new Ft(this,e,"","",!1,!1,!0,!1,"",this.#et(e))}setText(e,t){return this.range&&this.styleSheetId?this.#je.setStyleText(this.styleSheetId,this.range,e,t):Promise.resolve(!1)}insertPropertyAt(e,t,n,r){this.newBlankProperty(e).setText(t+": "+n+";",!1,!0).then(r)}appendProperty(e,t,n){this.insertPropertyAt(this.allProperties().length,e,t,n)}}!function(e){e.Regular="Regular",e.Inline="Inline",e.Attributes="Attributes",e.Pseudo="Pseudo",e.Transition="Transition",e.Animation="Animation"}(Yt||(Yt={}));var tn=Object.freeze({__proto__:null,CSSStyleDeclaration:en,get Type(){return Yt}});class nn extends _t{static parseSupportsPayload(e,t){return t.map((t=>new nn(e,t)))}#Oe=!0;constructor(e,t){super(e),this.reinitialize(t)}reinitialize(e){this.text=e.text,this.range=e.range?t.TextRange.TextRange.fromObject(e.range):null,this.styleSheetId=e.styleSheetId,this.#Oe=e.active}active(){return this.#Oe}}var rn=Object.freeze({__proto__:null,CSSSupports:nn});class sn{cssModelInternal;styleSheetId;sourceURL;origin;style;constructor(e,t){if(this.cssModelInternal=e,this.styleSheetId=t.styleSheetId,this.styleSheetId){const e=this.getStyleSheetHeader(this.styleSheetId);this.sourceURL=e.sourceURL}this.origin=t.origin,this.style=new en(this.cssModelInternal,this,t.style,Yt.Regular)}rebase(e){this.styleSheetId===e.styleSheetId&&this.style.rebase(e)}resourceURL(){if(!this.styleSheetId)return r.DevToolsPath.EmptyUrlString;return this.getStyleSheetHeader(this.styleSheetId).resourceURL()}isUserAgent(){return"user-agent"===this.origin}isInjected(){return"injected"===this.origin}isViaInspector(){return"inspector"===this.origin}isRegular(){return"regular"===this.origin}isKeyframeRule(){return!1}cssModel(){return this.cssModelInternal}getStyleSheetHeader(e){const t=this.cssModelInternal.styleSheetHeaderForId(e);return console.assert(null!==t),t}}class on{text;range;specificity;constructor(e){this.text=e.text,e.range&&(this.range=t.TextRange.TextRange.fromObject(e.range)),e.specificity&&(this.specificity=e.specificity)}rebase(e){this.range&&(this.range=this.range.rebaseAfterTextEdit(e.oldRange,e.newRange))}}class an extends sn{selectors;nestingSelectors;media;containerQueries;supports;scopes;layers;ruleTypes;wasUsed;constructor(e,t,n){super(e,{origin:t.origin,style:t.style,styleSheetId:t.styleSheetId}),this.reinitializeSelectors(t.selectorList),this.nestingSelectors=t.nestingSelectors,this.media=t.media?$t.parseMediaArrayPayload(e,t.media):[],this.containerQueries=t.containerQueries?Ut.parseContainerQueriesPayload(e,t.containerQueries):[],this.scopes=t.scopes?Jt.parseScopesPayload(e,t.scopes):[],this.supports=t.supports?nn.parseSupportsPayload(e,t.supports):[],this.layers=t.layers?Wt.parseLayerPayload(e,t.layers):[],this.ruleTypes=t.ruleTypes||[],this.wasUsed=n||!1}static createDummyRule(e,n){const r={selectorList:{text:"",selectors:[{text:n,value:void 0}]},style:{styleSheetId:"0",range:new t.TextRange.TextRange(0,0,0,0),shorthandEntries:[],cssProperties:[]},origin:"inspector"};return new an(e,r)}reinitializeSelectors(e){this.selectors=[];for(let t=0;te.text)).join(", ")}selectorRange(){if(0===this.selectors.length)return null;const e=this.selectors[0].range,n=this.selectors[this.selectors.length-1].range;return e&&n?new t.TextRange.TextRange(e.startLine,e.startColumn,n.endLine,n.endColumn):null}lineNumberInSource(e){const t=this.selectors[e];if(!t?.range||!this.styleSheetId)return 0;return this.getStyleSheetHeader(this.styleSheetId).lineNumberInSource(t.range.startLine)}columnNumberInSource(e){const t=this.selectors[e];if(!t?.range||!this.styleSheetId)return;return this.getStyleSheetHeader(this.styleSheetId).columnNumberInSource(t.range.startLine,t.range.startColumn)}rebase(e){if(this.styleSheetId!==e.styleSheetId)return;const t=this.selectorRange();if(t?.equal(e.oldRange))this.reinitializeSelectors(e.payload);else for(let t=0;tt.rebase(e))),this.containerQueries.forEach((t=>t.rebase(e))),this.scopes.forEach((t=>t.rebase(e))),this.supports.forEach((t=>t.rebase(e))),super.rebase(e)}}class ln extends sn{#tt;constructor(e,t){super(e,{origin:t.origin,style:t.style,styleSheetId:t.styleSheetId}),this.#tt=new on(t.propertyName)}propertyName(){return this.#tt}initialValue(){return this.style.hasActiveProperty("initial-value")?this.style.getPropertyValue("initial-value"):null}syntax(){return this.style.getPropertyValue("syntax")}inherits(){return"true"===this.style.getPropertyValue("inherits")}setPropertyName(e){const t=this.styleSheetId;if(!t)throw new Error("No rule stylesheet id");const n=this.#tt.range;if(!n)throw new Error("Property name is not editable");return this.cssModelInternal.setPropertyRulePropertyName(t,n,e)}}class dn extends sn{#nt;constructor(e,t){super(e,{origin:t.origin,style:t.style,styleSheetId:t.styleSheetId}),this.#nt=new on(t.fontPaletteName)}name(){return this.#nt}}class cn{#$e;#rt;constructor(e,t){this.#$e=new on(t.animationName),this.#rt=t.keyframes.map((t=>new hn(e,t)))}name(){return this.#$e}keyframes(){return this.#rt}}class hn extends sn{#st;constructor(e,t){super(e,{origin:t.origin,style:t.style,styleSheetId:t.styleSheetId}),this.reinitializeKey(t.keyText)}key(){return this.#st}reinitializeKey(e){this.#st=new on(e)}rebase(e){this.styleSheetId===e.styleSheetId&&this.#st.range&&(e.oldRange.equal(this.#st.range)?this.reinitializeKey(e.payload):this.#st.rebase(e),super.rebase(e))}isKeyframeRule(){return!0}setKeyText(e){const t=this.styleSheetId;if(!t)throw new Error("No rule stylesheet id");const n=this.#st.range;if(!n)throw new Error("Keyframe key is not editable");return this.cssModelInternal.setKeyframeKey(t,n,e)}}class un extends sn{#tt;#Oe;constructor(e,t){super(e,{origin:t.origin,style:t.style,styleSheetId:t.styleSheetId}),this.#tt=new on(t.name),this.#Oe=t.active}name(){return this.#tt}active(){return this.#Oe}}class gn extends sn{#tt;#it;#ot;constructor(e,t){super(e,{origin:t.origin,style:{cssProperties:[],shorthandEntries:[]},styleSheetId:t.styleSheetId}),this.#tt=new on(t.name),this.#it=t.parameters.map((({name:e})=>e)),this.#ot=this.protocolNodesToNestedStyles(t.children)}functionName(){return this.#tt}parameters(){return this.#it}children(){return this.#ot}protocolNodesToNestedStyles(e){const t=[];for(const n of e){const e=this.protocolNodeToNestedStyle(n);e&&t.push(e)}return t}protocolNodeToNestedStyle(e){if(e.style)return{style:new en(this.cssModelInternal,this,e.style,Yt.Regular)};if(e.condition){const t=this.protocolNodesToNestedStyles(e.condition.children);return e.condition.media?{children:t,media:new $t(this.cssModelInternal,e.condition.media)}:e.condition.containerQueries?{children:t,container:new Ut(this.cssModelInternal,e.condition.containerQueries)}:e.condition.supports?{children:t,supports:new nn(this.cssModelInternal,e.condition.supports)}:void console.error("A function rule condition must have a media, container, or supports")}console.error("A function rule node must have a style or condition")}}var pn=Object.freeze({__proto__:null,CSSFontPaletteValuesRule:dn,CSSFunctionRule:gn,CSSKeyframeRule:hn,CSSKeyframesRule:cn,CSSPositionTryRule:un,CSSPropertyRule:ln,CSSRule:sn,CSSStyleRule:an});function mn(e,t){if(!t.styleSheetId||!t.range)return!1;for(const n of e)if(t.styleSheetId===n.styleSheetId&&n.range&&t.range.equal(n.range))return!0;return!1}function fn(e){const t=e.allProperties();for(let e=0;e({name:e,value:t}))),t.rule.style.cssProperties=[...r.entries()].map((([e,t])=>({name:e,value:t})))}function r(e){return e.rule.media?e.rule.media.map((e=>e.text)).join(", "):null}function s(e){const{matchingSelectors:t,rule:n}=e;"user-agent"===n.origin&&t.length&&(n.selectorList.selectors=n.selectorList.selectors.filter(((e,n)=>t.includes(n))),n.selectorList.text=n.selectorList.selectors.map((e=>e.text)).join(", "),e.matchingSelectors=t.map(((e,t)=>t)))}}function yn(e){const t=new Map;for(let n=0;nnew ln(e,t))),...o].map((t=>new vn(e,t))),n&&(this.#rt=n.map((t=>new cn(e,t)))),this.#It=s.map((t=>new un(e,t))),this.#vt=r,this.#Rt=a?new dn(e,a):void 0,this.#wt=l,this.#xt=d.map((t=>new gn(e,t)))}async init({matchedPayload:e,inheritedPayload:t,inlinePayload:n,attributesPayload:r,pseudoPayload:s,inheritedPseudoPayload:i,animationStylesPayload:o,transitionsStylePayload:a,inheritedAnimatedPayload:l}){e=bn(e);for(const e of t)e.matchedCSSRules=bn(e.matchedCSSRules);this.#St=await this.buildMainCascade(n,r,e,t,o,a,l),[this.#kt,this.#Ct]=this.buildPseudoCascades(s,i);for(const e of Array.from(this.#Ct.values()).concat(Array.from(this.#kt.values())).concat(this.#St))for(const t of e.styles())this.#yt.set(t,e);for(const e of this.#pt)this.#mt.set(e.propertyName(),e)}async buildMainCascade(e,t,n,r,s,i,o){const a=[],l=[];function d(){if(!t)return;const e=new en(this.#je,null,t,Yt.Attributes);this.#ft.set(e,this.#ht),l.push(e)}if(i){const e=new en(this.#je,null,i,Yt.Transition);this.#ft.set(e,this.#ht),l.push(e)}for(const e of s){const t=new en(this.#je,null,e.style,Yt.Animation,e.name);this.#ft.set(t,this.#ht),l.push(t)}if(e&&this.#ht.nodeType()===Node.ELEMENT_NODE){const t=new en(this.#je,null,e,Yt.Inline);this.#ft.set(t,this.#ht),l.push(t)}let c;for(let e=n.length-1;e>=0;--e){const t=new an(this.#je,n[e].rule);!t.isInjected()&&!t.isUserAgent()||c||(c=!0,d.call(this)),this.#ft.set(t.style,this.#ht),l.push(t.style),this.addMatchingSelectors(this.#ht,t,n[e].matchingSelectors)}c||d.call(this),a.push(new wn(this,l,!1));let h=this.#ht.parentNode;const u=async e=>e.hasAssignedSlot()?await(e.assignedSlot?.deferredNode.resolvePromise())??null:e.parentNode;for(let e=0;h&&r&&enew en(this.#je,null,e.style,Yt.Animation,e.name)))??[];d&&fn(d)&&(this.#ft.set(d,h),t.push(d),this.#bt.add(d));for(const e of c)fn(e)&&(this.#ft.set(e,h),t.push(e),this.#bt.add(e));i&&fn(i)&&(this.#ft.set(i,h),t.push(i),this.#bt.add(i));const g=n.matchedCSSRules||[];for(let e=g.length-1;e>=0;--e){const n=new an(this.#je,g[e].rule);this.addMatchingSelectors(h,n,g[e].matchingSelectors),fn(n.style)&&((n.style.allProperties().some((e=>S().isCustomProperty(e.name)))||!mn(l,n.style)&&!mn(this.#bt,n.style))&&(this.#ft.set(n.style,h),t.push(n.style),this.#bt.add(n.style)))}h=await u(h),a.push(new wn(this,t,!0))}return new Tn(a,this.#pt)}buildSplitCustomHighlightCascades(e,t,n,r){const s=new Map;for(let r=e.length-1;r>=0;--r){const i=yn(e[r]);for(const[o,a]of i){const i=new an(this.#je,e[r].rule);this.#ft.set(i.style,t),n&&this.#bt.add(i.style),this.addMatchingSelectors(t,i,a);const l=s.get(o);l?l.push(i.style):s.set(o,[i.style])}}for(const[e,t]of s){const s=new wn(this,t,n,!0),i=r.get(e);i?i.push(s):r.set(e,[s])}}buildPseudoCascades(e,t){const n=new Map,r=new Map;if(!e)return[n,r];const s=new Map,i=new Map;for(let t=0;t=0;--e){const t=new an(this.#je,a[e].rule);o.push(t.style);const s=S().isHighlightPseudoType(n.pseudoType)?this.#ht:r;this.#ft.set(t.style,s),s&&this.addMatchingSelectors(s,t,a[e].matchingSelectors)}const e=S().isHighlightPseudoType(n.pseudoType),t=new wn(this,o,!1,e);s.set(n.pseudoType,[t])}}if(t){let e=this.#ht.parentNode;for(let n=0;e&&n=0;--n){const r=new an(this.#je,o[n].rule);t.push(r.style),this.#ft.set(r.style,e),this.#bt.add(r.style),this.addMatchingSelectors(e,r,o[n].matchingSelectors)}const r=S().isHighlightPseudoType(n.pseudoType),i=new wn(this,t,!0,r),a=s.get(n.pseudoType);a?a.push(i):s.set(n.pseudoType,[i])}}e=e.parentNode}}for(const[e,t]of s.entries())n.set(e,new Tn(t,this.#pt));for(const[e,t]of i.entries())r.set(e,new Tn(t,this.#pt));return[n,r]}addMatchingSelectors(e,t,n){for(const r of n){const n=t.selectors[r];n&&this.setSelectorMatches(e,n.text,!0)}}node(){return this.#ht}cssModel(){return this.#je}hasMatchingSelectors(e){return(0===e.selectors.length||this.getMatchingSelectors(e).length>0)&&function(e){if(!e.parentRule)return!0;const t=e.parentRule,n=[...t.media,...t.containerQueries,...t.supports,...t.scopes];for(const e of n)if(!e.active())return!1;return!0}(e.style)}getParentLayoutNodeId(){return this.#vt}getMatchingSelectors(e){const t=this.nodeForStyle(e.style);if(!t||"number"!=typeof t.id)return[];const n=this.#gt.get(t.id);if(!n)return[];const r=[];for(let t=0;tthis.isInherited(e)))??[]}animationStyles(){return this.#St?.styles().filter((e=>!this.isInherited(e)&&e.type===Yt.Animation))??[]}transitionsStyle(){return this.#St?.styles().find((e=>!this.isInherited(e)&&e.type===Yt.Transition))??null}registeredProperties(){return this.#pt}getRegisteredProperty(e){return this.#mt.get(e)}functionRules(){return this.#xt}fontPaletteValuesRule(){return this.#Rt}keyframes(){return this.#rt}positionTryRules(){return this.#It}activePositionFallbackIndex(){return this.#wt}pseudoStyles(e){r.assertNotNullOrUndefined(this.#kt);const t=this.#kt.get(e);return t?t.styles():[]}pseudoTypes(){return r.assertNotNullOrUndefined(this.#kt),new Set(this.#kt.keys())}customHighlightPseudoStyles(e){r.assertNotNullOrUndefined(this.#Ct);const t=this.#Ct.get(e);return t?t.styles():[]}customHighlightPseudoNames(){return r.assertNotNullOrUndefined(this.#Ct),new Set(this.#Ct.keys())}nodeForStyle(e){return this.#ut.get(e)||this.#ft.get(e)||null}availableCSSVariables(e){const t=this.#yt.get(e);return t?t.findAvailableCSSVariables(e):[]}computeCSSVariable(e,t){const n=this.#yt.get(e);return n?n.computeCSSVariable(e,t):null}resolveProperty(e,t){return this.#yt.get(t)?.resolveProperty(e,t)??null}resolveGlobalKeyword(e,t){const n=this.#yt.get(e.ownerStyle)?.resolveGlobalKeyword(e,t);return n?new kn(n):null}isInherited(e){return this.#bt.has(e)}propertyState(e){const t=this.#yt.get(e.ownerStyle);return t?t.propertyState(e):null}resetActiveProperties(){r.assertNotNullOrUndefined(this.#St),r.assertNotNullOrUndefined(this.#kt),r.assertNotNullOrUndefined(this.#Ct),this.#St.reset();for(const e of this.#kt.values())e.reset();for(const e of this.#Ct.values())e.reset()}propertyMatchers(e,t){return[new ve(this,e),new De((()=>t?.get("color")??null)),new Me,new Ee,new xe,new Ue,new ze,new Ve,new Ge,new Fe(e),new nt,new Ae,new st,new ot,new et,new ct,new Xe,new Ye,new _e,new we]}}class wn{#Tt;styles;#Mt;#Pt;propertiesState=new Map;activeProperties=new Map;constructor(e,t,n,r=!1){this.#Tt=e,this.styles=t,this.#Mt=n,this.#Pt=r}computeActiveProperties(){this.propertiesState.clear(),this.activeProperties.clear();for(let e=this.styles.length-1;e>=0;e--){const t=this.styles[e],n=t.parentRule;if((!n||n instanceof an)&&(!n||this.#Tt.hasMatchingSelectors(n)))for(const e of t.allProperties()){const n=S();if(this.#Mt&&!this.#Pt&&!n.isPropertyInherited(e.name))continue;if(t.range&&!e.range)continue;if(!e.activeInStyle()){this.propertiesState.set(e,"Overloaded");continue}if(this.#Mt){const t=this.#Tt.getRegisteredProperty(e.name);if(t&&!t.inherits()){this.propertiesState.set(e,"Overloaded");continue}}const r=n.canonicalPropertyName(e.name);this.updatePropertyState(e,r);for(const t of e.getLonghandProperties())n.isCSSPropertyName(t.name)&&this.updatePropertyState(t,t.name)}}}updatePropertyState(e,t){const n=this.activeProperties.get(t);!n?.important||e.important?(n&&this.propertiesState.set(n,"Overloaded"),this.propertiesState.set(e,"Active"),this.activeProperties.set(t,e)):this.propertiesState.set(e,"Overloaded")}}function Sn(e){return"ownerStyle"in e}class kn{declaration;constructor(e){this.declaration=e}get value(){return Sn(this.declaration)?this.declaration.value:this.declaration.initialValue()}get style(){return Sn(this.declaration)?this.declaration.ownerStyle:this.declaration.style()}get name(){return Sn(this.declaration)?this.declaration.name:this.declaration.propertyName()}}class Cn{nodeCascade;name;discoveryTime;rootDiscoveryTime;get isRootEntry(){return this.rootDiscoveryTime===this.discoveryTime}updateRoot(e){this.rootDiscoveryTime=Math.min(this.rootDiscoveryTime,e.rootDiscoveryTime)}constructor(e,t,n){this.nodeCascade=e,this.name=t,this.discoveryTime=n,this.rootDiscoveryTime=n}}class xn{#Et=0;#Lt=[];#At=new Map;get(e,t){return this.#At.get(e)?.get(t)}add(e,t){const n=this.get(e,t);if(n)return n;const r=new Cn(e,t,this.#Et++);this.#Lt.push(r);let s=this.#At.get(e);return s||(s=new Map,this.#At.set(e,s)),s.set(t,r),r}isInInProgressSCC(e){return this.#Lt.includes(e)}finishSCC(e){const t=this.#Lt.lastIndexOf(e);return console.assert(t>=0,"Root is not an in-progress scc"),this.#Lt.splice(t)}}function*Rn(e,t){for(let n=void 0!==t?e.indexOf(t)+1:0;nn.name===e.name&&t(n)));if(n)return n}return null}resolveProperty(e,t){const n=this.#Ft.get(t);if(!n)return null;for(const r of function*(e,t){(void 0===t||e.includes(t))&&(void 0!==t&&(yield t),yield*Rn(e,t))}(n.styles,t)){const t=r.allProperties().findLast((t=>t.name===e));if(t)return t}return this.#Ut({name:e,ownerStyle:t})}#qt(e){const t=this.#Ft.get(e.ownerStyle);if(!t)return null;for(const n of Rn(this.#_t,t))for(const t of n.styles){const n=t.allProperties().findLast((t=>t.name===e.name));if(n)return n}return null}#Ut(e){return S().isPropertyInherited(e.name)&&(this.#zt(e.name)?.inherits()??1)?this.#qt(e):null}#zt(e){const t=this.#pt.find((t=>t.propertyName()===e));return t||null}resolveGlobalKeyword(e,t){const n=t=>t.ownerStyle.parentRule instanceof an&&(e.ownerStyle.type===Yt.Inline||e.ownerStyle.parentRule instanceof an&&"regular"===t.ownerStyle.parentRule?.origin&&JSON.stringify(t.ownerStyle.parentRule.layers)!==JSON.stringify(e.ownerStyle.parentRule.layers));switch(t){case"initial":return this.#zt(e.name);case"inherit":return this.#qt(e)??this.#zt(e.name);case"revert":return this.#Ht(e,(t=>null!==t.ownerStyle.parentRule&&t.ownerStyle.parentRule.origin!==(e.ownerStyle.parentRule?.origin??"regular")))??this.resolveGlobalKeyword(e,"unset");case"revert-layer":return this.#Ht(e,n)??this.resolveGlobalKeyword(e,"revert");case"unset":return this.#Ut(e)??this.#zt(e.name)}}computeCSSVariable(e,t){const n=this.#Ft.get(e);return n?(this.ensureInitialized(),this.innerComputeCSSVariable(n,t)):null}innerComputeCSSVariable(e,t,n=new xn){const r=this.#Dt.get(e),s=this.#Nt.get(e);if(!s||!r?.has(t))return null;if(s?.has(t))return s.get(t)||null;let i=r.get(t);if(null==i)return null;if(i.declaration.declaration instanceof Ft&&i.declaration.value&&f.isCSSWideKeyword(i.declaration.value)){const e=this.resolveGlobalKeyword(i.declaration.declaration,i.declaration.value);if(!e)return i;const t=new kn(e),{value:n}=t;if(!n)return i;i={declaration:t,value:n}}const o=Lt(`--${t}`,i.value);if(!o)return null;const a=n.add(e,t),l=Ct.walk(o,[new be((e=>{const t=i.declaration.style,r=this.#Ft.get(t);if(!r)return null;const s=n.get(r,e.name);if(s)return n.isInInProgressSCC(s)?(a.updateRoot(s),null):this.#Nt.get(r)?.get(e.name)?.value??null;const o=this.innerComputeCSSVariable(r,e.name,n),l=n.get(r,e.name);return l&&a.updateRoot(l),void 0!==o?.value?o.value:0===e.fallback.length||e.matching.hasUnresolvedVarsRange(e.fallback[0],e.fallback[e.fallback.length-1])?null:e.matching.getComputedTextRange(e.fallback[0],e.fallback[e.fallback.length-1])}))]),d=Pt.siblings(Pt.declValue(l.ast.tree)),c=d.length>0?l.getComputedTextRange(d[0],d[d.length-1]):"";if(a.isRootEntry){const t=n.finishSCC(a);if(t.length>1){for(const n of t)console.assert(n.nodeCascade===e,"Circles should be within the cascade"),s.set(n.name,null);return null}}if(d.length>0&&l.hasUnresolvedVarsRange(d[0],d[d.length-1]))return s.set(t,null),null;const h={value:c,declaration:i.declaration};return s.set(t,h),h}styles(){return Array.from(this.#Ft.keys())}propertyState(e){return this.ensureInitialized(),this.#Ot.get(e)||null}reset(){this.#Bt=!1,this.#Ot.clear(),this.#Dt.clear(),this.#Nt.clear()}ensureInitialized(){if(this.#Bt)return;this.#Bt=!0;const e=new Map;for(const t of this.#_t){t.computeActiveProperties();for(const[n,r]of t.propertiesState){if("Overloaded"===r){this.#Ot.set(n,"Overloaded");continue}const t=S().canonicalPropertyName(n.name);e.has(t)?this.#Ot.set(n,"Overloaded"):(e.set(t,n),this.#Ot.set(n,"Active"))}}for(const[t,n]of e){const r=n.ownerStyle,s=n.getLonghandProperties();if(!s.length)continue;let i=!1;for(const t of s){const n=S().canonicalPropertyName(t.name),s=e.get(n);if(s&&s.ownerStyle===r){i=!0;break}}i||(e.delete(t),this.#Ot.set(n,"Overloaded"))}const t=new Map;for(const e of this.#pt){const n=e.initialValue();t.set(e.propertyName(),null!==n?{value:n,declaration:new kn(e)}:null)}for(let e=this.#_t.length-1;e>=0;--e){const n=this.#_t[e],r=[];for(const e of n.activeProperties.entries()){const n=e[0],s=e[1];n.startsWith("--")&&(t.set(n,{value:s.value,declaration:new kn(s)}),r.push(n))}const s=new Map(t),i=new Map;this.#Dt.set(n,s),this.#Nt.set(n,i);for(const e of r){const r=t.get(e);t.delete(e);const s=this.innerComputeCSSVariable(n,e);r&&s?.value===r.value&&(s.declaration=r.declaration),t.set(e,s)}}}}var Mn=Object.freeze({__proto__:null,CSSMatchedStyles:In,CSSRegisteredProperty:vn,CSSValueSource:kn});const Pn={couldNotFindTheOriginalStyle:"Could not find the original style sheet.",thereWasAnErrorRetrievingThe:"There was an error retrieving the source styles."},En=n.i18n.registerUIStrings("core/sdk/CSSStyleSheetHeader.ts",Pn),Ln=n.i18n.getLocalizedString.bind(void 0,En);class An{#je;id;frameId;sourceURL;hasSourceURL;origin;title;disabled;isInline;isMutable;isConstructed;startLine;startColumn;endLine;endColumn;contentLength;ownerNode;sourceMapURL;loadingFailed;#jt;constructor(e,t){this.#je=e,this.id=t.styleSheetId,this.frameId=t.frameId,this.sourceURL=t.sourceURL,this.hasSourceURL=Boolean(t.hasSourceURL),this.origin=t.origin,this.title=t.title,this.disabled=t.disabled,this.isInline=t.isInline,this.isMutable=t.isMutable,this.isConstructed=t.isConstructed,this.startLine=t.startLine,this.startColumn=t.startColumn,this.endLine=t.endLine,this.endColumn=t.endColumn,this.contentLength=t.length,t.ownerNode&&(this.ownerNode=new js(e.target(),t.ownerNode)),this.sourceMapURL=t.sourceMapURL,this.loadingFailed=t.loadingFailed??!1,this.#jt=null}originalContentProvider(){if(!this.#jt){const e=async()=>{const e=await this.#je.originalStyleSheetText(this);return null===e?{error:Ln(Pn.couldNotFindTheOriginalStyle)}:new t.ContentData.ContentData(e,!1,"text/css")};this.#jt=new t.StaticContentProvider.StaticContentProvider(this.contentURL(),this.contentType(),e)}return this.#jt}setSourceMapURL(e){this.sourceMapURL=e}cssModel(){return this.#je}isAnonymousInlineStyleSheet(){return!this.resourceURL()&&!this.#je.sourceMapManager().sourceMapForClient(this)}isConstructedByNew(){return this.isConstructed&&0===this.sourceURL.length}resourceURL(){return this.isViaInspector()?this.viaInspectorResourceURL():this.sourceURL}getFrameURLPath(){const t=this.#je.target().model(ii);if(console.assert(Boolean(t)),!t)return"";const n=t.frameForId(this.frameId);if(!n)return"";console.assert(Boolean(n));const r=new e.ParsedURL.ParsedURL(n.url);let s=r.host+r.folderPathComponents;return s.endsWith("/")||(s+="/"),s}viaInspectorResourceURL(){return`inspector:///inspector-stylesheet#${this.id}`}lineNumberInSource(e){return this.startLine+e}columnNumberInSource(e,t){return(e?0:this.startColumn)+t}containsLocation(e,t){const n=e===this.startLine&&t>=this.startColumn||e>this.startLine,r=ee.isOutermostFrame()));this.#Kt=e.length>0?e[0]:null}getFrame(e){const t=this.#Wt.get(e);return t?t.frame:null}getAllFrames(){return Array.from(this.#Wt.values(),(e=>e.frame))}getOutermostFrame(){return this.#Kt}async getOrWaitForFrame(e,t){const n=this.getFrame(e);return!n||t&&t===n.resourceTreeModel().target()?await new Promise((n=>{const r=this.#$t.get(e);r?r.push({notInTarget:t,resolve:n}):this.#$t.set(e,[{notInTarget:t,resolve:n}])})):n}resolveAwaitedFrame(e){const t=this.#$t.get(e.id);if(!t)return;const n=t.filter((({notInTarget:t,resolve:n})=>!(!t||t!==e.resourceTreeModel().target())||(n(e),!1)));n.length>0?this.#$t.set(e.id,n):this.#$t.delete(e.id)}}var Fn=Object.freeze({__proto__:null,FrameManager:Nn});class Bn{static fromLocalObject(e){return new zn(e)}static type(e){if(null===e)return"null";const t=typeof e;return"object"!==t&&"function"!==t?t:e.type}static isNullOrUndefined(e){if(void 0===e)return!0;switch(e.type){case"object":return"null"===e.subtype;case"undefined":return!0;default:return!1}}static arrayNameFromDescription(e){return e.replace(Gn,"").replace(Kn,"")}static arrayLength(e){if("array"!==e.subtype&&"typedarray"!==e.subtype)return 0;const t=e.description?.match(Gn),n=e.description?.match(Kn);return t?parseInt(t[1],10):n?parseInt(n[1],10):0}static arrayBufferByteLength(e){if("arraybuffer"!==e.subtype)return 0;const t=e.description?.match(Gn);return t?parseInt(t[1],10):0}static unserializableDescription(e){if("number"==typeof e){const t=String(e);if(0===e&&1/e<0)return"-0";if("NaN"===t||"Infinity"===t||"-Infinity"===t)return t}return"bigint"==typeof e?e+"n":null}static toCallArgument(e){const t=typeof e;if("undefined"===t)return{};const n=Bn.unserializableDescription(e);if("number"===t)return null!==n?{unserializableValue:n}:{value:e};if("bigint"===t)return{unserializableValue:n};if("string"===t||"boolean"===t)return{value:e};if(!e)return{value:null};const r=e;if(e instanceof Bn){const t=e.unserializableValue();if(void 0!==t)return{unserializableValue:t}}else if(void 0!==r.unserializableValue)return{unserializableValue:r.unserializableValue};return void 0!==r.objectId?{objectId:r.objectId}:{value:r.value}}static async loadFromObjectPerProto(e,t,n=!1){const r=await Promise.all([e.getAllProperties(!0,t,n),e.getOwnProperties(t,n)]),s=r[0].properties,i=r[1].properties,o=r[1].internalProperties;if(!i||!s)return{properties:null,internalProperties:null};const a=new Map,l=[];for(let e=0;e100){r+=",…";break}e&&(r+=", "),r+=t}return r+=t,r}get type(){return typeof this.valueInternal}get subtype(){return null===this.valueInternal?"null":Array.isArray(this.valueInternal)?"array":this.valueInternal instanceof Date?"date":void 0}get hasChildren(){return"object"==typeof this.valueInternal&&null!==this.valueInternal&&Boolean(Object.keys(this.valueInternal).length)}async getOwnProperties(e,t=!1){let n=this.children();return t&&(n=n.filter((e=>!function(e){const t=Number(e)>>>0;return String(t)===e}(e.name)))),{properties:n,internalProperties:null}}async getAllProperties(e,t,n=!1){return e?{properties:[],internalProperties:null}:await this.getOwnProperties(t,n)}children(){return this.hasChildren?(this.#an||(this.#an=Object.entries(this.valueInternal).map((([e,t])=>new qn(e,t instanceof Bn?t:Bn.fromLocalObject(t))))),this.#an):[]}arrayLength(){return Array.isArray(this.valueInternal)?this.valueInternal.length:0}async callFunction(e,t){const n=this.valueInternal,r=t?t.map((e=>e.value)):[];let s,i=!1;try{s=e.apply(n,r)}catch{i=!0}return{object:Bn.fromLocalObject(s),wasThrown:i}}async callFunctionJSON(e,t){const n=this.valueInternal,r=t?t.map((e=>e.value)):[];let s;try{s=e.apply(n,r)}catch{s=null}return s}}class jn{#ln;constructor(e){this.#ln=e}static objectAsArray(e){if(!e||"object"!==e.type||"array"!==e.subtype&&"typedarray"!==e.subtype)throw new Error("Object is empty or not an array");return new jn(e)}static async createFromRemoteObjects(e){if(!e.length)throw new Error("Input array is empty");const t=await e[0].callFunction((function(...e){return e}),e.map(Bn.toCallArgument));if(t.wasThrown||!t.object)throw new Error("Call function throws exceptions or returns empty value");return jn.objectAsArray(t.object)}async at(e){if(e<0||e>this.#ln.arrayLength())throw new Error("Out of range");const t=await this.#ln.callFunction((function(e){return this[e]}),[Bn.toCallArgument(e)]);if(t.wasThrown||!t.object)throw new Error("Exception in callFunction or result value is empty");return t.object}length(){return this.#ln.arrayLength()}map(e){const t=[];for(let n=0;n"[[TargetFunction]]"===e));return t?.value??this.#dn}async targetFunctionDetails(){const e=await this.targetFunction(),t=await e.debuggerModel().functionDetailsPromise(e);return this.#dn!==e&&e.release(),t}}class Wn{#dn;#cn;#hn;constructor(e){this.#dn=e}static objectAsError(e){if("error"!==e.subtype)throw new Error(`Object of type ${e.subtype} is not an error`);return new Wn(e)}get errorStack(){return this.#dn.description??""}exceptionDetails(){return this.#cn||(this.#cn=this.#un()),this.#cn}#un(){return this.#dn.objectId?this.#dn.runtimeModel().getExceptionDetails(this.#dn.objectId):Promise.resolve(void 0)}cause(){return this.#hn||(this.#hn=this.#gn()),this.#hn}async#gn(){const e=await this.#dn.getAllProperties(!1,!1),t=e.properties?.find((e=>"cause"===e.name));return t?.value}}const Gn=/\(([0-9]+)\)/,Kn=/\[([0-9]+)\]/;var Qn=Object.freeze({__proto__:null,LinearMemoryInspectable:class{object;expression;constructor(e,t){if(!e.isLinearMemoryInspectable())throw new Error("object must be linear memory inspectable");this.object=e,this.expression=t}},LocalJSONObject:zn,RemoteArray:jn,RemoteArrayBuffer:class{#ln;constructor(e){if("object"!==e.type||"arraybuffer"!==e.subtype)throw new Error("Object is not an arraybuffer");this.#ln=e}byteLength(){return this.#ln.arrayBufferByteLength()}async bytes(e=0,t=this.byteLength()){if(e<0||e>=this.byteLength())throw new RangeError("start is out of range");if(tthis.byteLength())throw new RangeError("end is out of range");return await this.#ln.callFunctionJSON((function(e,t){return[...new Uint8Array(this,e,t)]}),[{value:e},{value:t-e}])}object(){return this.#ln}},RemoteError:Wn,RemoteFunction:Vn,RemoteObject:Bn,RemoteObjectImpl:_n,RemoteObjectProperty:qn,ScopeRef:Un,ScopeRemoteObject:Hn});class $n extends h{constructor(e){super(e)}async read(t,n,r){const s=await this.target().ioAgent().invoke_read({handle:t,offset:r,size:n});if(s.getError())throw new Error(s.getError());return s.eof?null:s.base64Encoded?e.Base64.decode(s.data):s.data}async close(e){(await this.target().ioAgent().invoke_close({handle:e})).getError()&&console.error("Could not close stream.")}async resolveBlob(e){const t=e instanceof Bn?e.objectId:e;if(!t)throw new Error("Remote object has undefined objectId");const n=await this.target().ioAgent().invoke_resolveBlob({objectId:t});if(n.getError())throw new Error(n.getError());return`blob:${n.uuid}`}async readToString(e){const t=[],n=new TextDecoder;for(;;){const r=await this.read(e,4194304);if(null===r){t.push(n.decode());break}r instanceof ArrayBuffer?t.push(n.decode(r,{stream:!0})):t.push(r)}return t.join("")}}h.register($n,{capabilities:131072,autostart:!0});var Xn=Object.freeze({__proto__:null,IOModel:$n});const Jn={loadCanceledDueToReloadOf:"Load canceled due to reload of inspected page"},Yn=n.i18n.registerUIStrings("core/sdk/PageResourceLoader.ts",Jn),Zn=n.i18n.getLocalizedString.bind(void 0,Yn);function er(e){return"extensionId"in e}let tr=null;class nr extends e.ObjectWrapper.ObjectWrapper{#pn=0;#mn=!1;#fn=void 0;#bn=new Map;#yn;#vn=new Map;#In=[];#wn;constructor(e,t){super(),this.#yn=t,W.instance().addModelListener(ii,ri.PrimaryPageChanged,this.onPrimaryPageChanged,this),this.#wn=e}static instance({forceNew:e,loadOverride:t,maxConcurrentLoads:n}={forceNew:!1,loadOverride:null,maxConcurrentLoads:500}){return tr&&!e||(tr=new nr(t,n)),tr}static removeInstance(){tr=null}onPrimaryPageChanged(e){const{frame:t,type:n}=e.data;if(!t.isOutermostFrame())return;for(const{reject:e}of this.#In)e(new Error(Zn(Jn.loadCanceledDueToReloadOf)));this.#In=[];const r=t.resourceTreeModel().target(),s=new Map;for(const[e,t]of this.#vn.entries())"Activation"===n&&r===t.initiator.target&&s.set(e,t);this.#vn=s,this.dispatchEventToListeners("Update")}getResourcesLoaded(){return this.#vn}getScopedResourcesLoaded(){return new Map([...this.#vn].filter((([e,t])=>W.instance().isInScope(t.initiator.target)||er(t.initiator))))}getNumberOfResources(){return{loading:this.#pn,queued:this.#In.length,resources:this.#vn.size}}getScopedNumberOfResources(){const e=W.instance();let t=0;for(const[n,r]of this.#bn){const s=e.targetById(n);e.isInScope(s)&&(t+=r)}return{loading:t,resources:this.getScopedResourcesLoaded().size}}async acquireLoadSlot(e){if(this.#pn++,e){const t=this.#bn.get(e.id())||0;this.#bn.set(e.id(),t+1)}if(this.#pn>this.#yn){const{promise:e,resolve:t,reject:n}=Promise.withResolvers();this.#In.push({resolve:t,reject:n}),await e}}releaseLoadSlot(e){if(this.#pn--,e){const t=this.#bn.get(e.id());t&&this.#bn.set(e.id(),t-1)}const t=this.#In.shift();t&&t.resolve()}static makeExtensionKey(e,t){if(er(t)&&t.extensionId)return`${e}-${t.extensionId}`;throw new Error("Invalid initiator")}static makeKey(e,t){if(t.frameId)return`${e}-${t.frameId}`;if(t.target)return`${e}-${t.target.id()}`;throw new Error("Invalid initiator")}resourceLoadedThroughExtension(e){const t=nr.makeExtensionKey(e.url,e.initiator);this.#vn.set(t,e),this.dispatchEventToListeners("Update")}async loadResource(e,t){if(er(t))throw new Error("Invalid initiator");const n=nr.makeKey(e,t),r={success:null,size:null,duration:null,errorMessage:void 0,url:e,initiator:t};this.#vn.set(n,r),this.dispatchEventToListeners("Update");const s=performance.now();try{await this.acquireLoadSlot(t.target);const n=this.dispatchLoad(e,t),s=await n;if(this.#mn||(window.clearTimeout(this.#fn),this.#fn=window.setTimeout((()=>{this.#mn||0!==this.#pn||(a.rnPerfMetrics.developerResourcesStartupLoadingFinishedEvent(this.getNumberOfResources().resources,performance.now()-3e3),this.#mn=!0)}),3e3)),r.errorMessage=s.errorDescription.message,r.success=s.success,s.success)return r.size=s.content.length,{content:s.content};throw new Error(s.errorDescription.message)}catch(e){throw void 0===r.errorMessage&&(r.errorMessage=e.message),null===r.success&&(r.success=!1),e}finally{r.duration=performance.now()-s,this.releaseLoadSlot(t.target),this.dispatchEventToListeners("Update")}}async dispatchLoad(t,n){if(er(n))throw new Error("Invalid initiator");let r=null;if(this.#wn)return await this.#wn(t);const s=new e.ParsedURL.ParsedURL(t),i=rr().get()&&s&&"file"!==s.scheme&&"data"!==s.scheme&&"devtools"!==s.scheme;if(a.userMetrics.developerResourceScheme(this.getDeveloperResourceScheme(s)),i){try{if(n.target){a.userMetrics.developerResourceLoaded(0),a.rnPerfMetrics.developerResourceLoadingStarted(s,0);const e=await this.loadFromTarget(n.target,n.frameId,t);return a.rnPerfMetrics.developerResourceLoadingFinished(s,0,e),e}const e=Nn.instance().getFrame(n.frameId);if(e){a.userMetrics.developerResourceLoaded(1),a.rnPerfMetrics.developerResourceLoadingStarted(s,1);const r=await this.loadFromTarget(e.resourceTreeModel().target(),n.frameId,t);return a.rnPerfMetrics.developerResourceLoadingFinished(s,0,r),r}}catch(e){e instanceof Error&&(a.userMetrics.developerResourceLoaded(2),r=e.message),a.rnPerfMetrics.developerResourceLoadingFinished(s,2,{success:!1,errorDescription:{message:r}})}a.userMetrics.developerResourceLoaded(3),a.rnPerfMetrics.developerResourceLoadingStarted(s,3)}else{const e=rr().get()?6:5;a.userMetrics.developerResourceLoaded(e),a.rnPerfMetrics.developerResourceLoadingStarted(s,e)}const o=await ce.instance().loadResource(t);return i&&!o.success&&a.userMetrics.developerResourceLoaded(7),r&&(o.errorDescription.message=`Fetch through target failed: ${r}; Fallback: ${o.errorDescription.message}`),a.rnPerfMetrics.developerResourceLoadingFinished(s,4,o),o}getDeveloperResourceScheme(e){if(!e||""===e.scheme)return 1;const t="localhost"===e.host||e.host.endsWith(".localhost");switch(e.scheme){case"file":return 7;case"data":return 6;case"blob":return 8;case"http":return t?4:2;case"https":return t?5:3}return 0}async loadFromTarget(t,n,r){const s=t.model(Z),i=t.model($n),o=e.Settings.Settings.instance().moduleSetting("cache-disabled").get(),l=await s.loadNetworkResource(n,r,{disableCache:o,includeCredentials:!0});try{const e=l.stream?await i.readToString(l.stream):"";return{success:l.success,content:e,errorDescription:{statusCode:l.httpStatusCode||0,netError:l.netError,netErrorName:l.netErrorName,message:a.ResourceLoader.netErrorToMessage(l.netError,l.httpStatusCode,l.netErrorName)||"",urlValid:void 0}}}finally{l.stream&&i.close(l.stream)}}}function rr(){return e.Settings.Settings.instance().createSetting("load-through-target",!0)}var sr=Object.freeze({__proto__:null,PageResourceLoader:nr,ResourceKey:class{key;constructor(e){this.key=e}},getLoadThroughTargetSetting:rr});function ir(e,t){return e.line-t.line||e.column-t.column}function or(e,t={line:0,column:0}){if(!e.originalScopes||void 0===e.generatedRanges)throw new Error('Cant decode scopes without "originalScopes" or "generatedRanges"');const n=ar(e.originalScopes,e.names??[]);return{originalScopes:n.map((e=>e.root)),generatedRanges:dr(e.generatedRanges,n,e.names??[],t)}}function ar(e,t){return e.map((e=>function(e,t){const n=new Map,r=[];let s=0,i=0;for(const[o,a]of function*(e){const t=new Er(e);let n=0,r=0;for(;t.hasNext();){","===t.peek()&&t.next();const[e,s]=[t.nextVLQ(),t.nextVLQ()];if(0===e&&st[e])),h={start:{line:s,column:e},end:{line:s,column:e},kind:l,name:d,isStackFrame:Boolean(4&a.flags),variables:c,children:[]};r.push(h),n.set(o,h)}else{const t=r.pop();if(!t)throw new Error('Scope items not nested properly: encountered "end" item without "start" item');if(t.end={line:s,column:e},0===r.length)return{root:t,scopeForItemIndex:n};t.parent=r[r.length-1],r[r.length-1].children.push(t)}}throw new Error("Malformed original scope encoding")}(e,t)))}function lr(e){return"flags"in e}function dr(e,t,n,r={line:0,column:0}){const s=[{start:{line:0,column:0},end:{line:0,column:0},isStackFrame:!1,isHidden:!1,children:[],values:[]}],i=new Map;for(const o of function*(e,t){const n=new Er(e);let r=t.line;const s={line:t.line,column:t.column,defSourceIdx:0,defScopeIdx:0,callsiteSourceIdx:0,callsiteLine:0,callsiteColumn:0};for(;n.hasNext();){if(";"===n.peek()){n.next(),++r;continue}if(","===n.peek()){n.next();continue}if(s.column=n.nextVLQ()+(r===s.line?s.column:0),s.line=r,null===n.peekVLQ()){yield{line:r,column:s.column};continue}const e={line:r,column:s.column,flags:n.nextVLQ(),bindings:[]};if(1&e.flags){const t=n.nextVLQ(),r=n.nextVLQ();s.defScopeIdx=r+(0===t?s.defScopeIdx:0),s.defSourceIdx+=t,e.definition={sourceIdx:s.defSourceIdx,scopeIdx:s.defScopeIdx}}if(2&e.flags){const t=n.nextVLQ(),r=n.nextVLQ(),i=n.nextVLQ();s.callsiteColumn=i+(0===r&&0===t?s.callsiteColumn:0),s.callsiteLine=r+(0===t?s.callsiteLine:0),s.callsiteSourceIdx+=t,e.callsite={sourceIdx:s.callsiteSourceIdx,line:s.callsiteLine,column:s.callsiteColumn}}for(;n.hasNext()&&";"!==n.peek()&&","!==n.peek();){const t=[];e.bindings.push(t);const r=n.nextVLQ();if(r>=-1){t.push({line:e.line,column:e.column,nameIdx:r});continue}t.push({line:e.line,column:e.column,nameIdx:n.nextVLQ()});const s=-r;for(let e=0;e{if(1===n.length)return ur(n[0].nameIdx,t);const r=n.map((e=>({from:{line:e.line,column:e.column},to:{line:e.line,column:e.column},value:ur(e.nameIdx,t)})));for(let e=1;e=0)throw new Error(`Invalid range. End before start: ${JSON.stringify(t)}`)}(e),e.sort(((e,t)=>ir(e.start,t.start)||ir(t.end,e.end)));const t={start:{line:0,column:0},end:{line:Number.POSITIVE_INFINITY,column:Number.POSITIVE_INFINITY},kind:"Global",isStackFrame:!1,children:[],variables:[]},n=[t];for(const t of e){let e=n.at(-1);for(;ir(e.end,t.start)<=0;)n.pop(),e=n.at(-1);if(ir(t.start,e.end)<0&&ir(e.end,t.end)<0)throw new Error(`Range ${JSON.stringify(t)} and ${JSON.stringify(e)} partially overlap.`);const r=mr(t);e.children.push(r),n.push(r)}const r=t.children.at(-1);return r&&(t.end=r.end),t}function mr(e){return{...e,kind:"Function",isStackFrame:!0,children:[],variables:[]}}function fr(e,t){const n=[];let r=0,s=0,i=0,o=0,a=0;const l=new Er(e);let d=!0;for(;l.hasNext();){if(d)d=!1;else{if(","!==l.peek())break;l.next()}r+=l.nextVLQ(),s=o+l.nextVLQ(),i+=l.nextVLQ(),o=s+l.nextVLQ(),a+=l.nextVLQ();const e=t[r];void 0!==e&&n.push({start:{line:s,column:i},end:{line:o,column:a},name:e})}return n}var br=Object.freeze({__proto__:null,buildOriginalScopes:pr,decodePastaRanges:fr});const yr={local:"Local",closure:"Closure",block:"Block",global:"Global",returnValue:"Return value"},vr=n.i18n.registerUIStrings("core/sdk/SourceMapScopeChainEntry.ts",yr),Ir=n.i18n.getLocalizedString.bind(void 0,vr);class wr{#Sn;#kn;#Pe;#Cn;#xn;constructor(e,t,n,r,s){this.#Sn=e,this.#kn=t,this.#Pe=n,this.#Cn=r,this.#xn=s}extraProperties(){return this.#xn?[new qn(Ir(yr.returnValue),this.#xn,void 0,void 0,void 0,void 0,void 0,!0)]:[]}callFrame(){return this.#Sn}type(){switch(this.#kn.kind){case"global":return"global";case"function":return this.#Cn?"local":"closure";case"block":return"block"}return this.#kn.kind??""}typeName(){switch(this.#kn.kind){case"global":return Ir(yr.global);case"function":return this.#Cn?Ir(yr.local):Ir(yr.closure);case"block":return Ir(yr.block)}return this.#kn.kind??""}name(){return this.#kn.name}range(){return null}object(){return new Sr(this.#Sn,this.#kn,this.#Pe)}description(){return""}icon(){}}class Sr extends _n{#Sn;#kn;#Pe;constructor(e,t,n){super(e.debuggerModel.runtimeModel(),void 0,"object",void 0,null),this.#Sn=e,this.#kn=t,this.#Pe=n}async doGetProperties(e,t,n){if(t)return{properties:[],internalProperties:[]};const r=[];for(const[e,t]of this.#kn.variables.entries()){const s=this.#Rn(e);if(null===s){r.push(Sr.#Tn(t));continue}const i=await this.#Sn.evaluate({expression:s,generatePreview:n});"error"in i||i.exceptionDetails?r.push(Sr.#Tn(t)):r.push(new qn(t,i.object,!1,!1,!0,!1))}return{properties:r,internalProperties:[]}}#Rn(e){if(!this.#Pe)return null;const t=this.#Pe.values[e];if("string"==typeof t)return t;if(void 0===t)return null;const n=this.#Sn.location();for(const e of t)if(xr({start:e.from,end:e.to},n.lineNumber,n.columnNumber))return e.value??null;return null}static#Tn(e){return new qn(e,null,!1,!1,!0,!1)}}var kr=Object.freeze({__proto__:null,SourceMapScopeChainEntry:wr});class Cr{#Mn;#Pn;#En;#Ln=null;constructor(e,t,n){this.#Mn=e,this.#Pn=t,this.#En=n}addOriginalScopes(e){for(const t of e)this.#Pn.push(t)}addGeneratedRanges(e){for(const t of e)this.#En.push(t)}hasOriginalScopes(e){return Boolean(this.#Pn[e])}addOriginalScopesAtIndex(e,t){if(this.#Pn[e])throw new Error(`Trying to re-augment existing scopes for source at index: ${e}`);this.#Pn[e]=t}findInlinedFunctions(e,t){const n=this.#An(e,t),r={inlinedFunctions:[],originalFunctionName:""};for(let e=n.length-1;e>=0;--e){const t=n[e];if(t.callsite&&r.inlinedFunctions.push({name:t.originalScope?.name??"",callsite:t.callsite}),t.isStackFrame){r.originalFunctionName=t.originalScope?.name??"";break}}return r}expandCallFrame(e){const{originalFunctionName:t,inlinedFunctions:n}=this.findInlinedFunctions(e.location().lineNumber,e.location().columnNumber),r=[];for(const[t,s]of n.entries())r.push(e.createVirtualCallFrame(t,s.name));return r.push(e.createVirtualCallFrame(r.length,t)),r}#An(e,t){const n=[];return function r(s){for(const i of s)xr(i,e,t)&&(n.push(i),r(i.children))}(this.#En),n}hasVariablesAndBindings(){return null===this.#Ln&&(this.#Ln=this.#On()),this.#Ln}#On(){function e(t){for(const n of t)if(n){if("variables"in n&&n.variables.length>0)return!0;if("values"in n&&n.values.some((e=>void 0!==e)))return!0;if(e(n.children))return!0}return!1}return e(this.#Pn)&&e(this.#En)}resolveMappedScopeChain(e){const t=this.#Dn(e),n=t.at(-1)?.originalScope;if(void 0===n)return null;let r=!1;const s=[];for(let n=t.at(-1)?.originalScope;n;n=n.parent){const i=t.findLast((e=>e.originalScope===n)),o="function"===n.kind,a=o&&!r,l=a?e.returnValue():null;s.push(new wr(e,n,i,a,l??void 0)),r||=o}if(null!==e.returnValue())for(;s.length&&"local"!==s[0].type();)s.shift();return s}#Dn(e){const t=this.#An(e.location().lineNumber,e.location().columnNumber);if(0===e.inlineFrameIndex)return t;for(let n=0;n0){const r=this.#An(e,t);n=r.at(-1)?.originalScope}else{const r=this.#Mn.findEntry(e,t);if(void 0===r?.sourceIndex)return null;n=this.#Nn({sourceIndex:r.sourceIndex,line:r.sourceLineNumber,column:r.sourceColumnNumber}).at(-1)}for(let e=n;e;e=e.parent)if(e.isStackFrame)return e.name??"";return null}#Nn({sourceIndex:e,line:t,column:n}){const r=this.#Pn[e];if(!r)return[];const s=[];return function e(r){for(const i of r)xr(i,t,n)&&(s.push(i),e(i.children))}([r]),s}}function xr(e,t,n){return!(e.start.line>t||e.start.line===t&&e.start.column>n)&&!(e.end.line"url"in e))&&e.Console.Console.instance().warn(`SourceMap "${n}" contains unsupported "URL" field in one of its sections.`),this.eachSection(this.parseSources.bind(this))}json(){return this.#Fn}augmentWithScopes(e,t){if(this.#Vn(),this.#Fn&&this.#Fn.version>3)throw new Error("Only support augmenting source maps up to version 3.");const n=this.#Wn(e);if(!(n>=0))throw new Error(`Could not find sourceURL ${e} in sourceMap`);if(this.#jn||(this.#jn=new Cr(this,[],[])),!this.#jn.hasOriginalScopes(n)){const e=pr(t);this.#jn.addOriginalScopesAtIndex(n,e)}}#Wn(e){return this.#qn.findIndex((t=>t.sourceURL===e))}compiledURL(){return this.#Bn}url(){return this.#_n}sourceURLs(){return[...this.#zn.keys()]}embeddedContentByURL(e){const t=this.#zn.get(e);return t?t.content:null}hasScopeInfo(){return this.#Vn(),null!==this.#jn}findEntry(e,t,n){if(this.#Vn(),n&&null!==this.#jn){const{inlinedFunctions:r}=this.#jn.findInlinedFunctions(e,t),{callsite:s}=r[n-1];return s?{lineNumber:e,columnNumber:t,sourceIndex:s.sourceIndex,sourceURL:this.sourceURLs()[s.sourceIndex],sourceLineNumber:s.line,sourceColumnNumber:s.column,name:void 0}:(console.error("Malformed source map. Expected to have a callsite info for index",n),null)}const s=this.mappings(),i=r.ArrayUtilities.upperBound(s,void 0,((n,r)=>e-r.lineNumber||t-r.columnNumber));return i?s[i-1]:null}findEntryRanges(e,n){const s=this.mappings(),i=r.ArrayUtilities.upperBound(s,void 0,((t,r)=>e-r.lineNumber||n-r.columnNumber));if(!i)return null;const o=i-1,a=s[o].sourceURL;if(!a)return null;const l=iu-s[t].sourceLineNumber||g-s[t].sourceColumnNumber));if(!p)return null;const m=p=i.length||s[i[o]].sourceLineNumber!==t)return null;const l=i.slice(o,a);if(!l.length)return null;const d=r.ArrayUtilities.lowerBound(l,n,((e,t)=>e-s[t].sourceColumnNumber));return d>=l.length?s[l[l.length-1]]:s[l[d]];function c(e,t){return e-s[t].sourceLineNumber}}findReverseIndices(e,t,n){const s=this.mappings(),i=this.reversedMappings(e),o=r.ArrayUtilities.upperBound(i,void 0,((e,r)=>t-s[r].sourceLineNumber||n-s[r].sourceColumnNumber));let a=o;for(;a>0&&s[i[a-1]].sourceLineNumber===s[i[o-1]].sourceLineNumber&&s[i[a-1]].sourceColumnNumber===s[i[o-1]].sourceColumnNumber;)--a;return i.slice(a,o)}findReverseEntries(e,t,n){const r=this.mappings();return this.findReverseIndices(e,t,n).map((e=>r[e]))}findReverseRanges(e,n,r){const s=this.mappings(),i=this.findReverseIndices(e,n,r),o=[];for(let e=0;e{if(!e)return;return pr(fr(e,n))}))}isSeparator(e){return","===e||";"===e}reverseMapTextRanges(e,n){const s=this.reversedMappings(e),i=this.mappings();if(0===s.length)return[];let o=r.ArrayUtilities.lowerBound(s,n,(({startLine:e,startColumn:t},n)=>{const{sourceLineNumber:r,sourceColumnNumber:s}=i[n];return e-r||t-s}));for(;o===s.length||o>0&&(i[s[o]].sourceLineNumber>n.startLine||i[s[o]].sourceColumnNumber>n.startColumn);)o--;let a=o+1;for(;a0){const t=e[0];return 0===t?.lineNumber||0===t.columnNumber}return!1}hasIgnoreListHint(e){return this.#zn.get(e)?.ignoreListHint??!1}findRanges(e,n){const r=this.mappings(),s=[];if(!r.length)return[];let i=null;0===r[0].lineNumber&&0===r[0].columnNumber||!n?.isStartMatching||(i=t.TextRange.TextRange.createUnboundedFromLocation(0,0),s.push(i));for(const{sourceURL:n,lineNumber:o,columnNumber:a}of r){const r=n&&e(n);i||!r?i&&!r&&(i.endLine=o,i.endColumn=a,i=null):(i=t.TextRange.TextRange.createUnboundedFromLocation(o,a),s.push(i))}return s}compatibleForURL(e,t){return this.embeddedContentByURL(e)===t.embeddedContentByURL(e)&&this.hasIgnoreListHint(e)===t.hasIgnoreListHint(e)}expandCallFrame(e){return this.#Vn(),null===this.#jn?[e]:this.#jn.expandCallFrame(e)}resolveScopeChain(e){return this.#Vn(),null===this.#jn?null:this.#jn.resolveMappedScopeChain(e)}findOriginalFunctionName(e){return this.#Vn(),this.#jn?.findOriginalFunctionName(e)??null}}class Er{#Kn;#Qn;constructor(e){this.#Kn=e,this.#Qn=0}next(){return this.#Kn.charAt(this.#Qn++)}nextCharCode(){return this.#Kn.charCodeAt(this.#Qn++)}peek(){return this.#Kn.charAt(this.#Qn)}hasNext(){return this.#Qn>=1,s?-t:t}peekVLQ(){const e=this.#Qn;try{return this.nextVLQ()}catch{return null}finally{this.#Qn=e}}}var Lr,Ar=Object.freeze({__proto__:null,SourceMap:Pr,SourceMapEntry:Mr,TokenIterator:Er,parseSourceMap:Tr});class Or extends e.ObjectWrapper.ObjectWrapper{#$n;#Xn=!0;#Jn=new Map;#Yn=new Map;#Zn=null;constructor(e){super(),this.#$n=e}setEnabled(e){if(e===this.#Xn)return;const t=[...this.#Jn.entries()];for(const[e]of t)this.detachSourceMap(e);this.#Xn=e;for(const[e,{relativeSourceURL:n,relativeSourceMapURL:r}]of t)this.attachSourceMap(e,n,r)}static getBaseUrl(e){for(;e&&e.type()!==U.FRAME;)e=e.parentTarget();return e?.inspectedURL()??r.DevToolsPath.EmptyUrlString}static resolveRelativeSourceURL(t,n){return n=e.ParsedURL.ParsedURL.completeURL(Or.getBaseUrl(t),n)??n}sourceMapForClient(e){return this.#Jn.get(e)?.sourceMap}sourceMapForClientPromise(e){const t=this.#Jn.get(e);return t?t.sourceMapPromise:Promise.resolve(void 0)}clientForSourceMap(e){return this.#Yn.get(e)}attachSourceMap(t,n,r){if(this.#Jn.has(t))throw new Error("SourceMap is already attached or being attached to client");if(!r)return;let s={relativeSourceURL:n,relativeSourceMapURL:r,sourceMap:void 0,sourceMapPromise:Promise.resolve(void 0)};if(this.#Xn){const i=Or.resolveRelativeSourceURL(this.#$n,n),o=e.ParsedURL.ParsedURL.completeURL(i,r);if(o)if(this.#Zn&&console.error("Attaching source map may cancel previously attaching source map"),this.#Zn=t,this.dispatchEventToListeners(Lr.SourceMapWillAttach,{client:t}),this.#Zn===t){this.#Zn=null;const e=t.createPageResourceLoadInitiator();s.sourceMapPromise=Dr(o,e).then((e=>{const n=new Pr(i,o,e);return this.#Jn.get(t)===s&&(s.sourceMap=n,this.#Yn.set(n,t),this.dispatchEventToListeners(Lr.SourceMapAttached,{client:t,sourceMap:n})),n}),(()=>{this.#Jn.get(t)===s&&this.dispatchEventToListeners(Lr.SourceMapFailedToAttach,{client:t})}))}else this.#Zn&&console.error("Cancelling source map attach because another source map is attaching"),s=null,this.dispatchEventToListeners(Lr.SourceMapFailedToAttach,{client:t})}s&&this.#Jn.set(t,s)}cancelAttachSourceMap(e){e===this.#Zn?this.#Zn=null:this.#Zn?console.error("cancel attach source map requested but a different source map was being attached"):console.error("cancel attach source map requested but no source map was being attached")}detachSourceMap(e){const t=this.#Jn.get(e);if(!t)return;if(this.#Jn.delete(e),!this.#Xn)return;const{sourceMap:n}=t;n?(this.#Yn.delete(n),this.dispatchEventToListeners(Lr.SourceMapDetached,{client:e,sourceMap:n})):this.dispatchEventToListeners(Lr.SourceMapFailedToAttach,{client:e})}}async function Dr(e,t){try{const{content:n}=await nr.instance().loadResource(e,t);return Tr(n)}catch(t){throw new Error(`Could not load content for ${e}: ${t.message}`,{cause:t})}}!function(e){e.SourceMapWillAttach="SourceMapWillAttach",e.SourceMapFailedToAttach="SourceMapFailedToAttach",e.SourceMapAttached="SourceMapAttached",e.SourceMapDetached="SourceMapDetached"}(Lr||(Lr={}));var Nr,Fr=Object.freeze({__proto__:null,get Events(){return Lr},SourceMapManager:Or,loadSourceMap:Dr,tryLoadSourceMap:async function(e,t){try{const{content:n}=await nr.instance().loadResource(e,t);return Tr(n)}catch(t){return console.error(`Could not load content for ${e}: ${t.message}`,{cause:t}),null}}});class Br extends h{agent;#er;#tr=new Map;#nr=new Map;#rr;#sr;#ir;#or=new e.Throttler.Throttler(Wr);#ar=new Map;#lr=new Map;#dr=null;#cr=null;#hr=null;#ur=!1;#Xn=!1;#gr=!1;#pr=!1;#mr;constructor(t){super(t),this.#er=t.model(Gs),this.#sr=new Or(t),this.agent=t.cssAgent(),this.#ir=new zr(this),this.#rr=t.model(ii),this.#rr&&this.#rr.addEventListener(ri.PrimaryPageChanged,this.onPrimaryPageChanged,this),t.registerCSSDispatcher(new qr(this)),t.suspended()||this.enable(),this.#sr.setEnabled(e.Settings.Settings.instance().moduleSetting("css-source-maps-enabled").get()),e.Settings.Settings.instance().moduleSetting("css-source-maps-enabled").addChangeListener((e=>this.#sr.setEnabled(e.data)))}async colorScheme(){if(!this.#mr){const e=await(this.domModel()?.target().runtimeAgent().invoke_evaluate({expression:'window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches'}));!e||e.exceptionDetails||e.getError()||(this.#mr=e.result.value?"dark":"light")}return this.#mr}async resolveValues(e,...t){const n=await this.agent.invoke_resolveValues({values:t,nodeId:e});return n.getError()?null:n.results}headersForSourceURL(e){const t=[];for(const n of this.getStyleSheetIdsForURL(e)){const e=this.styleSheetHeaderForId(n);e&&t.push(e)}return t}createRawLocationsByURL(e,t,n=0){const s=this.headersForSourceURL(e);s.sort((function(e,t){return e.startLine-t.startLine||e.startColumn-t.startColumn||e.id.localeCompare(t.id)}));const i=r.ArrayUtilities.upperBound(s,void 0,((e,r)=>t-r.startLine||n-r.startColumn));if(!i)return[];const o=[],a=s[i-1];for(let e=i-1;e>=0&&s[e].startLine===a.startLine&&s[e].startColumn===a.startColumn;--e)s[e].containsLocation(t,n)&&o.push(new Ur(s[e],t,n));return o}sourceMapManager(){return this.#sr}static readableLayerName(e){return e||""}static trimSourceURL(e){let t=e.lastIndexOf("/*# sourceURL=");if(-1===t&&(t=e.lastIndexOf("/*@ sourceURL="),-1===t))return e;const n=e.lastIndexOf("\n",t);if(-1===n)return e;const r=e.substr(n+1).split("\n",1)[0];return-1===r.search(/[\x20\t]*\/\*[#@] sourceURL=[\x20\t]*([^\s]*)[\x20\t]*\*\/[\x20\t]*$/)?e:e.substr(0,n)+e.substr(n+r.length+1)}domModel(){return this.#er}async trackComputedStyleUpdatesForNode(e){await this.agent.invoke_trackComputedStyleUpdatesForNode({nodeId:e})}async setStyleText(e,t,n,r){try{await this.ensureOriginalStyleSheetText(e);const{styles:s}=await this.agent.invoke_setStyleTexts({edits:[{styleSheetId:e,range:t.serializeToObject(),text:n}]});if(!s||1!==s.length)return!1;this.#er.markUndoableState(!r);const i=new Hr(e,t,n,s[0]);return this.fireStyleSheetChanged(e,i),!0}catch(e){return console.error(e),!1}}async setSelectorText(e,t,n){a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{selectorList:r}=await this.agent.invoke_setRuleSelector({styleSheetId:e,range:t,selector:n});if(!r)return!1;this.#er.markUndoableState();const s=new Hr(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return console.error(e),!1}}async setPropertyRulePropertyName(e,t,n){a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{propertyName:r}=await this.agent.invoke_setPropertyRulePropertyName({styleSheetId:e,range:t,propertyName:n});if(!r)return!1;this.#er.markUndoableState();const s=new Hr(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return console.error(e),!1}}async setKeyframeKey(e,t,n){a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{keyText:r}=await this.agent.invoke_setKeyframeKey({styleSheetId:e,range:t,keyText:n});if(!r)return!1;this.#er.markUndoableState();const s=new Hr(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return console.error(e),!1}}startCoverage(){return this.#gr=!0,this.agent.invoke_startRuleUsageTracking()}async takeCoverageDelta(){const e=await this.agent.invoke_takeCoverageDelta();return{timestamp:e?.timestamp||0,coverage:e?.coverage||[]}}setLocalFontsEnabled(e){return this.agent.invoke_setLocalFontsEnabled({enabled:e})}async stopCoverage(){this.#gr=!1,await this.agent.invoke_stopRuleUsageTracking()}async getMediaQueries(){const{medias:e}=await this.agent.invoke_getMediaQueries();return e?$t.parseMediaArrayPayload(this,e):[]}async getRootLayer(e){const{rootLayer:t}=await this.agent.invoke_getLayersForNode({nodeId:e});return t}isEnabled(){return this.#Xn}async enable(){await this.agent.invoke_enable(),this.#Xn=!0,this.#gr&&await this.startCoverage(),this.dispatchEventToListeners(Nr.ModelWasEnabled)}async getAnimatedStylesForNode(e){const t=await this.agent.invoke_getAnimatedStylesForNode({nodeId:e});return t.getError()?null:t}async getMatchedStyles(e){const t=this.#er.nodeForId(e);if(!t)return null;const n=o.Runtime.hostConfig.devToolsAnimationStylesInStylesTab?.enabled,[r,s]=await Promise.all([this.agent.invoke_getMatchedStylesForNode({nodeId:e}),n?this.agent.invoke_getAnimatedStylesForNode({nodeId:e}):void 0]);if(r.getError())return null;const i={cssModel:this,node:t,inlinePayload:r.inlineStyle||null,attributesPayload:r.attributesStyle||null,matchedPayload:r.matchedCSSRules||[],pseudoPayload:r.pseudoElements||[],inheritedPayload:r.inherited||[],inheritedPseudoPayload:r.inheritedPseudoElements||[],animationsPayload:r.cssKeyframesRules||[],parentLayoutNodeId:r.parentLayoutNodeId,positionTryRules:r.cssPositionTryRules||[],propertyRules:r.cssPropertyRules??[],functionRules:r.cssFunctionRules??[],cssPropertyRegistrations:r.cssPropertyRegistrations??[],fontPaletteValuesRule:r.cssFontPaletteValuesRule,activePositionFallbackIndex:r.activePositionFallbackIndex??-1,animationStylesPayload:s?.animationStyles||[],inheritedAnimatedPayload:s?.inherited||[],transitionsStylePayload:s?.transitionsStyle||null};return await In.create(i)}async getClassNames(e){const{classNames:t}=await this.agent.invoke_collectClassNames({styleSheetId:e});return t||[]}async getComputedStyle(e){return this.isEnabled()||await this.enable(),await this.#ir.computedStylePromise(e)}async getLayoutPropertiesFromComputedStyle(e){const t=await this.getComputedStyle(e);if(!t)return null;const n=t.get("display"),r="flex"===n||"inline-flex"===n,s="grid"===n||"inline-grid"===n,i=(s&&(t.get("grid-template-columns")?.startsWith("subgrid")||t.get("grid-template-rows")?.startsWith("subgrid")))??!1,o=t.get("container-type");return{isFlex:r,isGrid:s,isSubgrid:i,isContainer:Boolean(o)&&""!==o&&"normal"!==o,hasScroll:Boolean(t.get("scroll-snap-type"))&&"none"!==t.get("scroll-snap-type")}}async getBackgroundColors(e){const t=await this.agent.invoke_getBackgroundColors({nodeId:e});return t.getError()?null:{backgroundColors:t.backgroundColors||null,computedFontSize:t.computedFontSize||"",computedFontWeight:t.computedFontWeight||""}}async getPlatformFonts(e){const{fonts:t}=await this.agent.invoke_getPlatformFontsForNode({nodeId:e});return t}allStyleSheets(){const e=[...this.#lr.values()];return e.sort((function(e,t){return e.sourceURLt.sourceURL?1:e.startLine-t.startLine||e.startColumn-t.startColumn})),e}async getInlineStyles(e){const t=await this.agent.invoke_getInlineStylesForNode({nodeId:e});if(t.getError()||!t.inlineStyle)return null;const n=new en(this,null,t.inlineStyle,Yt.Inline),r=t.attributesStyle?new en(this,null,t.attributesStyle,Yt.Attributes):null;return new jr(n,r)}forcePseudoState(e,t,n){const s=e.marker(_r)||[],i=s.includes(t);if(n){if(i)return!1;s.push(t),e.setMarker(_r,s)}else{if(!i)return!1;r.ArrayUtilities.removeElement(s,t),s.length?e.setMarker(_r,s):e.setMarker(_r,null)}return void 0!==e.id&&(this.agent.invoke_forcePseudoState({nodeId:e.id,forcedPseudoClasses:s}),this.dispatchEventToListeners(Nr.PseudoStateForced,{node:e,pseudoClass:t,enable:n}),!0)}pseudoState(e){return e.marker(_r)||[]}async setMediaText(e,t,n){a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{media:r}=await this.agent.invoke_setMediaText({styleSheetId:e,range:t,text:n});if(!r)return!1;this.#er.markUndoableState();const s=new Hr(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return console.error(e),!1}}async setContainerQueryText(e,t,n){a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{containerQuery:r}=await this.agent.invoke_setContainerQueryText({styleSheetId:e,range:t,text:n});if(!r)return!1;this.#er.markUndoableState();const s=new Hr(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return console.error(e),!1}}async setSupportsText(e,t,n){a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{supports:r}=await this.agent.invoke_setSupportsText({styleSheetId:e,range:t,text:n});if(!r)return!1;this.#er.markUndoableState();const s=new Hr(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return console.error(e),!1}}async setScopeText(e,t,n){a.userMetrics.actionTaken(a.UserMetrics.Action.StyleRuleEdited);try{await this.ensureOriginalStyleSheetText(e);const{scope:r}=await this.agent.invoke_setScopeText({styleSheetId:e,range:t,text:n});if(!r)return!1;this.#er.markUndoableState();const s=new Hr(e,t,n,r);return this.fireStyleSheetChanged(e,s),!0}catch(e){return console.error(e),!1}}async addRule(e,t,n){try{await this.ensureOriginalStyleSheetText(e);const{rule:r}=await this.agent.invoke_addRule({styleSheetId:e,ruleText:t,location:n});if(!r)return null;this.#er.markUndoableState();const s=new Hr(e,n,t,r);return this.fireStyleSheetChanged(e,s),new an(this,r)}catch(e){return console.error(e),null}}async requestViaInspectorStylesheet(e){const t=e||(this.#rr&&this.#rr.mainFrame?this.#rr.mainFrame.id:null),n=[...this.#lr.values()].find((e=>e.frameId===t&&e.isViaInspector()));if(n)return n;if(!t)return null;try{return await this.createInspectorStylesheet(t)}catch(e){return console.error(e),null}}async createInspectorStylesheet(e,t=!1){const n=await this.agent.invoke_createStyleSheet({frameId:e,force:t});if(n.getError())throw new Error(n.getError());return this.#lr.get(n.styleSheetId)||null}mediaQueryResultChanged(){this.#mr=void 0,this.dispatchEventToListeners(Nr.MediaQueryResultChanged)}fontsUpdated(e){e&&this.#tr.set(e.src,new pe(e)),this.dispatchEventToListeners(Nr.FontsUpdated)}fontFaces(){return[...this.#tr.values()]}fontFaceForSource(e){return this.#tr.get(e)}styleSheetHeaderForId(e){return this.#lr.get(e)||null}styleSheetHeaders(){return[...this.#lr.values()]}fireStyleSheetChanged(e,t){this.dispatchEventToListeners(Nr.StyleSheetChanged,{styleSheetId:e,edit:t})}ensureOriginalStyleSheetText(e){const t=this.styleSheetHeaderForId(e);if(!t)return Promise.resolve(null);let n=this.#nr.get(t);return n||(n=this.getStyleSheetText(t.id),this.#nr.set(t,n),this.originalContentRequestedForTest(t)),n}originalContentRequestedForTest(e){}originalStyleSheetText(e){return this.ensureOriginalStyleSheetText(e.id)}getAllStyleSheetHeaders(){return this.#lr.values()}computedStyleUpdated(e){this.dispatchEventToListeners(Nr.ComputedStyleUpdated,{nodeId:e})}styleSheetAdded(e){console.assert(!this.#lr.get(e.styleSheetId)),e.loadingFailed&&(e.hasSourceURL=!1,e.isConstructed=!0,e.isInline=!1,e.isMutable=!1,e.sourceURL="",e.sourceMapURL=void 0);const t=new An(this,e);this.#lr.set(e.styleSheetId,t);const n=t.resourceURL();let r=this.#ar.get(n);if(r||(r=new Map,this.#ar.set(n,r)),r){let e=r.get(t.frameId);e||(e=new Set,r.set(t.frameId,e)),e.add(t.id)}this.#sr.attachSourceMap(t,t.sourceURL,t.sourceMapURL),this.dispatchEventToListeners(Nr.StyleSheetAdded,t)}styleSheetRemoved(e){const t=this.#lr.get(e);if(console.assert(Boolean(t)),!t)return;this.#lr.delete(e);const n=t.resourceURL(),r=this.#ar.get(n);if(console.assert(Boolean(r),"No frameId to styleSheetId map is available for given style sheet URL."),r){const s=r.get(t.frameId);s&&(s.delete(e),s.size||(r.delete(t.frameId),r.size||this.#ar.delete(n)))}this.#nr.delete(t),this.#sr.detachSourceMap(t),this.dispatchEventToListeners(Nr.StyleSheetRemoved,t)}getStyleSheetIdsForURL(e){const t=this.#ar.get(e);if(!t)return[];const n=[];for(const e of t.values())n.push(...e);return n}async setStyleSheetText(e,t,n){const r=this.#lr.get(e);if(!r)return"Unknown stylesheet in CSS.setStyleSheetText";t=Br.trimSourceURL(t),r.hasSourceURL&&(t+="\n/*# sourceURL="+r.sourceURL+" */"),await this.ensureOriginalStyleSheetText(e);const s=(await this.agent.invoke_setStyleSheetText({styleSheetId:r.id,text:t})).sourceMapURL;return this.#sr.detachSourceMap(r),r.setSourceMapURL(s),this.#sr.attachSourceMap(r,r.sourceURL,r.sourceMapURL),null===s?"Error in CSS.setStyleSheetText":(this.#er.markUndoableState(!n),this.fireStyleSheetChanged(e),null)}async getStyleSheetText(e){const t=await this.agent.invoke_getStyleSheetText({styleSheetId:e});if(t.getError())return null;const{text:n}=t;return n&&Br.trimSourceURL(n)}async onPrimaryPageChanged(e){e.data.frame.backForwardCacheDetails.restoredFromCache?(await this.suspendModel(),await this.resumeModel()):"Activation"!==e.data.type&&(this.resetStyleSheets(),this.resetFontFaces())}resetStyleSheets(){const e=[...this.#lr.values()];this.#ar.clear(),this.#lr.clear();for(const t of e)this.#sr.detachSourceMap(t),this.dispatchEventToListeners(Nr.StyleSheetRemoved,t)}resetFontFaces(){this.#tr.clear()}async suspendModel(){this.#Xn=!1,await this.agent.invoke_disable(),this.resetStyleSheets(),this.resetFontFaces()}async resumeModel(){return await this.enable()}setEffectivePropertyValueForNode(e,t,n){this.agent.invoke_setEffectivePropertyValueForNode({nodeId:e,propertyName:t,value:n})}cachedMatchedCascadeForNode(e){if(this.#dr!==e&&this.discardCachedMatchedCascade(),this.#dr=e,!this.#cr){if(!e.id)return Promise.resolve(null);this.#cr=this.getMatchedStyles(e.id)}return this.#cr}discardCachedMatchedCascade(){this.#dr=null,this.#cr=null}createCSSPropertyTracker(e){return new Vr(this,e)}enableCSSPropertyTracker(e){const t=e.getTrackedProperties();0!==t.length&&(this.agent.invoke_trackComputedStyleUpdates({propertiesToTrack:t}),this.#ur=!0,this.#hr=e,this.pollComputedStyleUpdates())}disableCSSPropertyTracker(){this.#ur=!1,this.#hr=null,this.agent.invoke_trackComputedStyleUpdates({propertiesToTrack:[]})}async pollComputedStyleUpdates(){if(!this.#pr){if(this.#ur){this.#pr=!0;const e=await this.agent.invoke_takeComputedStyleUpdates();if(this.#pr=!1,e.getError()||!e.nodeIds||!this.#ur)return;this.#hr&&this.#hr.dispatchEventToListeners("TrackedCSSPropertiesUpdated",e.nodeIds.map((e=>this.#er.nodeForId(e))))}this.#ur&&this.#or.schedule(this.pollComputedStyleUpdates.bind(this))}}dispose(){this.disableCSSPropertyTracker(),super.dispose(),this.dispatchEventToListeners(Nr.ModelDisposed,this)}getAgent(){return this.agent}}!function(e){e.FontsUpdated="FontsUpdated",e.MediaQueryResultChanged="MediaQueryResultChanged",e.ModelWasEnabled="ModelWasEnabled",e.ModelDisposed="ModelDisposed",e.PseudoStateForced="PseudoStateForced",e.StyleSheetAdded="StyleSheetAdded",e.StyleSheetChanged="StyleSheetChanged",e.StyleSheetRemoved="StyleSheetRemoved",e.ComputedStyleUpdated="ComputedStyleUpdated"}(Nr||(Nr={}));const _r="pseudo-state-marker";class Hr{styleSheetId;oldRange;newRange;newText;payload;constructor(e,n,r,s){this.styleSheetId=e,this.oldRange=n,this.newRange=t.TextRange.TextRange.fromEdit(n,r),this.newText=r,this.payload=s}}class Ur{#je;styleSheetId;url;lineNumber;columnNumber;constructor(e,t,n){this.#je=e.cssModel(),this.styleSheetId=e.id,this.url=e.resourceURL(),this.lineNumber=t,this.columnNumber=n||0}cssModel(){return this.#je}header(){return this.#je.styleSheetHeaderForId(this.styleSheetId)}}class qr{#lt;constructor(e){this.#lt=e}mediaQueryResultChanged(){this.#lt.mediaQueryResultChanged()}fontsUpdated({font:e}){this.#lt.fontsUpdated(e)}styleSheetChanged({styleSheetId:e}){this.#lt.fireStyleSheetChanged(e)}styleSheetAdded({header:e}){this.#lt.styleSheetAdded(e)}styleSheetRemoved({styleSheetId:e}){this.#lt.styleSheetRemoved(e)}computedStyleUpdated({nodeId:e}){this.#lt.computedStyleUpdated(e)}}class zr{#lt;#fr=new Map;constructor(e){this.#lt=e}computedStylePromise(e){let t=this.#fr.get(e);return t||(t=this.#lt.getAgent().invoke_getComputedStyleForNode({nodeId:e}).then((({computedStyle:t})=>{if(this.#fr.delete(e),!t?.length)return null;const n=new Map;for(const e of t)n.set(e.name,e.value);return n})),this.#fr.set(e,t),t)}}class jr{inlineStyle;attributesStyle;constructor(e,t){this.inlineStyle=e,this.attributesStyle=t}}class Vr extends e.ObjectWrapper.ObjectWrapper{#lt;#br;constructor(e,t){super(),this.#lt=e,this.#br=t}start(){this.#lt.enableCSSPropertyTracker(this)}stop(){this.#lt.disableCSSPropertyTracker()}getTrackedProperties(){return this.#br}}const Wr=1e3;h.register(Br,{capabilities:2,autostart:!0});var Gr=Object.freeze({__proto__:null,CSSLocation:Ur,CSSModel:Br,CSSPropertyTracker:Vr,Edit:Hr,get Events(){return Nr},InlineStyleResult:jr});class Kr extends h{#yr;#vr;#Ir;#wr;constructor(e){super(e),e.registerHeapProfilerDispatcher(new Qr(this)),this.#yr=!1,this.#vr=e.heapProfilerAgent(),this.#Ir=e.model(Jr),this.#wr=0}debuggerModel(){return this.#Ir.debuggerModel()}runtimeModel(){return this.#Ir}async enable(){this.#yr||(this.#yr=!0,await this.#vr.invoke_enable())}async startSampling(e){if(this.#wr++)return!1;const t=await this.#vr.invoke_startSampling({samplingInterval:e||16384});return Boolean(t.getError())}async stopSampling(){if(!this.#wr)throw new Error("Sampling profiler is not running.");if(--this.#wr)return await this.getSamplingProfile();const e=await this.#vr.invoke_stopSampling();return e.getError()?null:e.profile}async getSamplingProfile(){const e=await this.#vr.invoke_getSamplingProfile();return e.getError()?null:e.profile}async collectGarbage(){const e=await this.#vr.invoke_collectGarbage();return Boolean(e.getError())}async snapshotObjectIdForObjectId(e){const t=await this.#vr.invoke_getHeapObjectId({objectId:e});return t.getError()?null:t.heapSnapshotObjectId}async objectForSnapshotObjectId(e,t){const n=await this.#vr.invoke_getObjectByHeapObjectId({objectId:e,objectGroup:t});return n.getError()?null:this.#Ir.createRemoteObject(n.result)}async addInspectedHeapObject(e){const t=await this.#vr.invoke_addInspectedHeapObject({heapObjectId:e});return Boolean(t.getError())}async takeHeapSnapshot(e){const t=await this.#vr.invoke_takeHeapSnapshot(e);return Boolean(t.getError())}async startTrackingHeapObjects(e){const t=await this.#vr.invoke_startTrackingHeapObjects({trackAllocations:e});return Boolean(t.getError())}async stopTrackingHeapObjects(e){const t=await this.#vr.invoke_stopTrackingHeapObjects({reportProgress:e});return Boolean(t.getError())}heapStatsUpdate(e){this.dispatchEventToListeners("HeapStatsUpdate",e)}lastSeenObjectId(e,t){this.dispatchEventToListeners("LastSeenObjectId",{lastSeenObjectId:e,timestamp:t})}addHeapSnapshotChunk(e){this.dispatchEventToListeners("AddHeapSnapshotChunk",e)}reportHeapSnapshotProgress(e,t,n){this.dispatchEventToListeners("ReportHeapSnapshotProgress",{done:e,total:t,finished:n})}resetProfiles(){this.dispatchEventToListeners("ResetProfiles",this)}}class Qr{#Sr;constructor(e){this.#Sr=e}heapStatsUpdate({statsUpdate:e}){this.#Sr.heapStatsUpdate(e)}lastSeenObjectId({lastSeenObjectId:e,timestamp:t}){this.#Sr.lastSeenObjectId(e,t)}addHeapSnapshotChunk({chunk:e}){this.#Sr.addHeapSnapshotChunk(e)}reportHeapSnapshotProgress({done:e,total:t,finished:n}){this.#Sr.reportHeapSnapshotProgress(e,t,n)}resetProfiles(){this.#Sr.resetProfiles()}}h.register(Kr,{capabilities:4,autostart:!1});var $r,Xr=Object.freeze({__proto__:null,HeapProfilerModel:Kr});class Jr extends h{agent;#kr=new Map;#Cr=Zr.comparator;constructor(t){super(t),this.agent=t.runtimeAgent(),this.target().registerRuntimeDispatcher(new Yr(this)),this.agent.invoke_enable(),e.Settings.Settings.instance().moduleSetting("custom-formatters").get()&&this.agent.invoke_setCustomObjectFormatterEnabled({enabled:!0}),e.Settings.Settings.instance().moduleSetting("custom-formatters").addChangeListener(this.customFormattersStateChanged.bind(this))}static isSideEffectFailure(e){const t="exceptionDetails"in e&&e.exceptionDetails;return Boolean(t&&t.exception?.description?.startsWith("EvalError: Possible side-effect in debug-evaluate"))}debuggerModel(){return this.target().model(ms)}heapProfilerModel(){return this.target().model(Kr)}executionContexts(){return[...this.#kr.values()].sort(this.executionContextComparator())}setExecutionContextComparator(e){this.#Cr=e}executionContextComparator(){return this.#Cr}defaultExecutionContext(){for(const e of this.executionContexts())if(e.isDefault)return e;return null}executionContext(e){return this.#kr.get(e)||null}executionContextCreated(e){const t=e.auxData||{isDefault:!0},n=new Zr(this,e.id,e.uniqueId,e.name,e.origin,t.isDefault,t.frameId);this.#kr.set(n.id,n),this.dispatchEventToListeners($r.ExecutionContextCreated,n)}executionContextDestroyed(e){const t=this.#kr.get(e);t&&(this.debuggerModel().executionContextDestroyed(t),this.#kr.delete(e),this.dispatchEventToListeners($r.ExecutionContextDestroyed,t))}fireExecutionContextOrderChanged(){this.dispatchEventToListeners($r.ExecutionContextOrderChanged,this)}executionContextsCleared(){this.debuggerModel().globalObjectCleared();const e=this.executionContexts();this.#kr.clear();for(let t=0;te+t.length+1),0);const d="";if(n)for(;;){const e=await this.debuggerModel.target().debuggerAgent().invoke_nextWasmDisassemblyChunk({streamId:n});if(e.getError())throw new Error(e.getError());const{chunk:{lines:t,bytecodeOffsets:r}}=e;if(l+=t.reduce(((e,t)=>e+t.length+1),0),0===t.length)break;if(l>=999999989){o.push([d]),a.push([0]);break}o.push(t),a.push(r)}const c=[];for(let e=0;ee){ss||(ss={cache:new Map,registry:new FinalizationRegistry((e=>ss?.cache.delete(e)))});const e=[this.#Er,this.contentLength,this.lineOffset,this.columnOffset,this.endLine,this.endColumn,this.#Pr,this.hash].join(":"),t=ss.cache.get(e)?.deref();t?this.#Lr=t:(this.#Lr=this.requestContentInternal(),ss.cache.set(e,new WeakRef(this.#Lr)),ss.registry.register(this.#Lr,e))}else this.#Lr=this.requestContentInternal()}return this.#Lr}async requestContent(){const e=await this.requestContentData();return t.ContentData.ContentData.asDeferredContent(e)}async requestContentInternal(){if(!this.scriptId)return{error:rs(ts.scriptRemovedOrDeleted)};try{return this.isWasm()?await this.loadWasmContent():await this.loadTextContent()}catch{return{error:rs(ts.unableToFetchScriptSource)}}}async getWasmBytecode(){const e=await this.debuggerModel.target().debuggerAgent().invoke_getWasmBytecode({scriptId:this.scriptId}),t=await fetch(`data:application/wasm;base64,${e.bytecode}`);return await t.arrayBuffer()}originalContentProvider(){return new t.StaticContentProvider.StaticContentProvider(this.contentURL(),this.contentType(),(()=>this.requestContentData()))}async searchInContent(e,n,r){if(!this.scriptId)return[];const s=await this.debuggerModel.target().debuggerAgent().invoke_searchInContent({scriptId:this.scriptId,query:e,caseSensitive:n,isRegex:r});return t.TextUtils.performSearchInSearchMatches(s.result||[],e,n,r)}appendSourceURLCommentIfNeeded(e){return this.hasSourceURL?e+"\n //# sourceURL="+this.sourceURL:e}async editSource(e){e=is.trimSourceURLComment(e),e=this.appendSourceURLCommentIfNeeded(e);if(t.ContentData.ContentData.textOr(await this.requestContentData(),null)===e)return{changed:!1,status:"Ok"};const n=await this.debuggerModel.target().debuggerAgent().invoke_setScriptSource({scriptId:this.scriptId,scriptSource:e,allowTopFrameEditing:!0});if(n.getError())throw new Error(`Script#editSource failed for script with id ${this.scriptId}: ${n.getError()}`);return n.getError()||"Ok"!==n.status||(this.#Lr=Promise.resolve(new t.ContentData.ContentData(e,!1,"text/javascript"))),this.debuggerModel.dispatchEventToListeners(ys.ScriptSourceWasEdited,{script:this,status:n.status}),{changed:!0,status:n.status,exceptionDetails:n.exceptionDetails}}rawLocation(e,t){return this.containsLocation(e,t)?new Is(this.debuggerModel,this.scriptId,e,t):null}isInlineScript(){const e=!this.lineOffset&&!this.columnOffset;return!this.isWasm()&&Boolean(this.sourceURL)&&!e}isAnonymousScript(){return!this.sourceURL}async setBlackboxedRanges(e){return!(await this.debuggerModel.target().debuggerAgent().invoke_setBlackboxedRanges({scriptId:this.scriptId,positions:e})).getError()}containsLocation(e,t){const n=e===this.lineOffset&&t>=this.columnOffset||e>this.lineOffset,r=e{r.onmessage=({data:r})=>{if("method"in r&&"disassemble"===r.method)if("error"in r)n(r.error);else if("result"in r){const{lines:n,offsets:s,functionBodyOffsets:i}=r.result;e(new t.WasmDisassembly.WasmDisassembly(n,s,i))}},r.onerror=n}));r.postMessage({method:"disassemble",params:{content:n}});try{return await s}finally{r.terminate()}}var ds=Object.freeze({__proto__:null,Script:is,disassembleWasm:ls,sourceURLRegex:as});const cs={local:"Local",closure:"Closure",block:"Block",script:"Script",withBlock:"`With` block",catchBlock:"`Catch` block",global:"Global",module:"Module",expression:"Expression",exception:"Exception",returnValue:"Return value"},hs=n.i18n.registerUIStrings("core/sdk/DebuggerModel.ts",cs),us=n.i18n.getLocalizedString.bind(void 0,hs);function gs(e){function t(e,t){return e.lineNumber-t.lineNumber||e.columnNumber-t.columnNumber}function n(e,n){if(e.scriptId!==n.scriptId)return!1;const r=t(e.start,n.start);return r<0?t(e.end,n.start)>=0:!(r>0)||t(e.start,n.end)<=0}if(0===e.length)return[];e.sort(((e,n)=>e.scriptIdn.scriptId?1:t(e.start,n.start)||t(e.end,n.end)));let r=e[0];const s=[];for(let i=1;ithis.#Or.setEnabled(e.data)));const n=t.model(ii);n&&n.addEventListener(ri.FrameNavigated,this.onFrameNavigated,this)}static selectSymbolSource(t){if(!t||0===t.length)return null;if("type"in t)return"None"===t.type?null:t;let n=null;const r=new Map(t.map((e=>[e.type,e])));for(const e of ps)if(r.has(e)){n=r.get(e)||null;break}return console.assert(null!==n,"Unknown symbol types. Front-end and back-end should be kept in sync regarding Protocol.Debugger.DebugSymbolTypes"),n&&t.length>1&&e.Console.Console.instance().warn(`Multiple debug symbols for script were found. Using ${n.type}`),n}sourceMapManager(){return this.#Or}runtimeModel(){return this.runtimeModelInternal}debuggerEnabled(){return Boolean(this.#Hr)}debuggerId(){return this.#Ur}async enableDebugger(){if(this.#Hr)return;this.#Hr=!0;const t=o.Runtime.Runtime.queryParam("remoteFrontend")||o.Runtime.Runtime.queryParam("ws")?1e7:1e8,n=this.agent.invoke_enable({maxScriptsCacheSize:t});let r;o.Runtime.experiments.isEnabled("instrumentation-breakpoints")&&(r=this.agent.invoke_setInstrumentationBreakpoint({instrumentation:"beforeScriptExecution"})),this.pauseOnExceptionStateChanged(),this.asyncStackTracesStateChanged(),e.Settings.Settings.instance().moduleSetting("breakpoints-active").get()||this.breakpointsActiveChanged(),this.dispatchEventToListeners(ys.DebuggerWasEnabled,this);const[s]=await Promise.all([n,r]);this.registerDebugger(s)}async syncDebuggerId(){const e=o.Runtime.Runtime.queryParam("remoteFrontend")||o.Runtime.Runtime.queryParam("ws")?1e7:1e8,t=this.agent.invoke_enable({maxScriptsCacheSize:e});return t.then(this.registerDebugger.bind(this)),await t}onFrameNavigated(){ms.shouldResyncDebuggerId||(ms.shouldResyncDebuggerId=!0)}registerDebugger(e){if(e.getError())return void(this.#Hr=!1);const{debuggerId:t}=e;fs.set(t,this),this.#Ur=t,this.dispatchEventToListeners(ys.DebuggerIsReadyToPause,this)}isReadyToPause(){return Boolean(this.#Ur)}static async modelForDebuggerId(e){return ms.shouldResyncDebuggerId&&(await ms.resyncDebuggerIdForModels(),ms.shouldResyncDebuggerId=!1),fs.get(e)||null}static async resyncDebuggerIdForModels(){const e=fs.values();for(const t of e)t.debuggerEnabled()&&await t.syncDebuggerId()}async disableDebugger(){this.#Hr&&(this.#Hr=!1,await this.asyncStackTracesStateChanged(),await this.agent.invoke_disable(),this.#Qr=!1,this.globalObjectCleared(),this.dispatchEventToListeners(ys.DebuggerWasDisabled,this),"string"==typeof this.#Ur&&fs.delete(this.#Ur),this.#Ur=null)}skipAllPauses(e){this.#qr&&(clearTimeout(this.#qr),this.#qr=0),this.agent.invoke_setSkipAllPauses({skip:e})}skipAllPausesUntilReloadOrTimeout(e){this.#qr&&clearTimeout(this.#qr),this.agent.invoke_setSkipAllPauses({skip:!0}),this.#qr=window.setTimeout(this.skipAllPauses.bind(this,!1),e)}pauseOnExceptionStateChanged(){const t=e.Settings.Settings.instance().moduleSetting("pause-on-caught-exception").get();let n;const r=e.Settings.Settings.instance().moduleSetting("pause-on-uncaught-exception").get();n=t&&r?"all":t?"caught":r?"uncaught":"none",this.agent.invoke_setPauseOnExceptions({state:n})}asyncStackTracesStateChanged(){const t=!e.Settings.Settings.instance().moduleSetting("disable-async-stack-traces").get()&&this.#Hr?32:0;return this.agent.invoke_setAsyncCallStackDepth({maxDepth:t})}breakpointsActiveChanged(){this.agent.invoke_setBreakpointsActive({active:e.Settings.Settings.instance().moduleSetting("breakpoints-active").get()})}setComputeAutoStepRangesCallback(e){this.#jr=e}async computeAutoStepSkipList(e){let t=[];if(this.#jr&&this.#Dr&&this.#Dr.callFrames.length>0){const[n]=this.#Dr.callFrames;t=await this.#jr.call(null,e,n)}return gs(t.map((({start:e,end:t})=>({scriptId:e.scriptId,start:{lineNumber:e.lineNumber,columnNumber:e.columnNumber},end:{lineNumber:t.lineNumber,columnNumber:t.columnNumber}}))))}async stepInto(){const e=await this.computeAutoStepSkipList("StepInto");this.agent.invoke_stepInto({breakOnAsyncCall:!1,skipList:e})}async stepOver(){this.#Kr=this.#Dr?.callFrames[0]?.functionLocation()??null;const e=await this.computeAutoStepSkipList("StepOver");this.agent.invoke_stepOver({skipList:e})}async stepOut(){const e=await this.computeAutoStepSkipList("StepOut");0!==e.length?this.agent.invoke_stepOver({skipList:e}):this.agent.invoke_stepOut()}scheduleStepIntoAsync(){this.computeAutoStepSkipList("StepInto").then((e=>{this.agent.invoke_stepInto({breakOnAsyncCall:!0,skipList:e})}))}resume(){this.agent.invoke_resume({terminateOnResume:!1}),this.#Qr=!1}pause(){this.#Qr=!0,this.skipAllPauses(!1),this.agent.invoke_pause()}async setBreakpointByURL(t,n,s,i){let o;if(this.target().type()===U.NODE&&e.ParsedURL.schemeIs(t,"file:")){const n=e.ParsedURL.ParsedURL.urlToRawPathString(t,a.Platform.isWin());o=`${r.StringUtilities.escapeForRegExp(n)}|${r.StringUtilities.escapeForRegExp(t)}`,a.Platform.isWin()&&n.match(/^.:\\/)&&(o=`[${n[0].toUpperCase()}${n[0].toLowerCase()}]`+o.substr(1))}let l=0;const d=this.#Fr.get(t)||[];for(let e=0,t=d.length;eIs.fromPayload(this,e)))),{locations:h,breakpointId:c.breakpointId}}async setBreakpointInAnonymousScript(e,t,n,r){const s=await this.agent.invoke_setBreakpointByUrl({lineNumber:t,scriptHash:e,columnNumber:n,condition:r});if(s.getError())return{locations:[],breakpointId:null};let i=[];return s.locations&&(i=s.locations.map((e=>Is.fromPayload(this,e)))),{locations:i,breakpointId:s.breakpointId}}async removeBreakpoint(e){await this.agent.invoke_removeBreakpoint({breakpointId:e})}async getPossibleBreakpoints(e,t,n){const r=await this.agent.invoke_getPossibleBreakpoints({start:e.payload(),end:t?t.payload():void 0,restrictToFunction:n});return r.getError()||!r.locations?[]:r.locations.map((e=>ws.fromPayload(this,e)))}async fetchAsyncStackTrace(e){const t=await this.agent.invoke_getStackTrace({stackTraceId:e});return t.getError()?null:t.stackTrace}breakpointResolved(e,t){this.#Gr.dispatchEventToListeners(e,Is.fromPayload(this,t))}globalObjectCleared(){this.resetDebuggerPausedDetails(),this.reset(),this.dispatchEventToListeners(ys.GlobalObjectCleared,this)}reset(){for(const e of this.#Nr.values())this.#Or.detachSourceMap(e);this.#Nr.clear(),this.#Fr.clear(),this.#Br=[],this.#Kr=null}scripts(){return Array.from(this.#Nr.values())}scriptForId(e){return this.#Nr.get(e)||null}scriptsForSourceURL(e){return this.#Fr.get(e)||[]}scriptsForExecutionContext(e){const t=[];for(const n of this.#Nr.values())n.executionContextId===e.id&&t.push(n);return t}get callFrames(){return this.#Dr?this.#Dr.callFrames:null}debuggerPausedDetails(){return this.#Dr}async setDebuggerPausedDetails(e){return this.#Qr=!1,this.#Dr=e,!(this.#zr&&!await this.#zr.call(null,e,this.#Kr))&&(this.#Kr=null,this.dispatchEventToListeners(ys.DebuggerPaused,this),this.setSelectedCallFrame(e.callFrames[0]),!0)}resetDebuggerPausedDetails(){this.#Qr=!1,this.#Dr=null,this.setSelectedCallFrame(null)}setBeforePausedCallback(e){this.#zr=e}setExpandCallFramesCallback(e){this.#Vr=e}setEvaluateOnCallFrameCallback(e){this.evaluateOnCallFrameCallback=e}setSynchronizeBreakpointsCallback(e){this.#Wr=e}async pausedScript(t,n,r,s,i,o){if("instrumentation"===n){const e=this.scriptForId(r.scriptId);return this.#Wr&&e&&await this.#Wr(e),void this.resume()}const a=new Cs(this,t,n,r,s,i,o);if(await this.#$r(a),this.continueToLocationCallback){const e=this.continueToLocationCallback;if(this.continueToLocationCallback=null,e(a))return}await this.setDebuggerPausedDetails(a)?e.EventTarget.fireEvent("DevTools.DebuggerPaused"):this.#Kr?this.stepOver():this.stepInto()}async#$r(e){if(this.#Vr&&(e.callFrames=await this.#Vr.call(null,e.callFrames)),!o.Runtime.experiments.isEnabled("use-source-map-scopes"))return;const t=[];for(const n of e.callFrames){const e=await this.sourceMapManager().sourceMapForClientPromise(n.script);e?.hasScopeInfo()?t.push(...e.expandCallFrame(n)):t.push(n)}e.callFrames=t}resumedScript(){this.resetDebuggerPausedDetails(),this.dispatchEventToListeners(ys.DebuggerResumed,this)}parsedScriptSource(e,t,n,r,s,i,o,a,l,d,c,h,u,g,p,m,f,b,y,v){const I=this.#Nr.get(e);if(I)return I;let w=!1;l&&"isDefault"in l&&(w=!l.isDefault);const S=ms.selectSymbolSource(y),k=new is(this,e,t,n,r,s,i,o,a,w,d,c,h,g,p,m,f,b,S,v);this.registerScript(k),this.dispatchEventToListeners(ys.ParsedScriptSource,k),k.sourceMapURL&&!u&&this.#Or.attachSourceMap(k,k.sourceURL,k.sourceMapURL);return u&&k.isAnonymousScript()&&(this.#Br.push(k),this.collectDiscardedScripts()),k}setSourceMapURL(e,t){this.#Or.detachSourceMap(e),e.sourceMapURL=t,this.#Or.attachSourceMap(e,e.sourceURL,e.sourceMapURL)}async setDebugInfoURL(e,t){this.#Vr&&this.#Dr&&(this.#Dr.callFrames=await this.#Vr.call(null,this.#Dr.callFrames)),this.dispatchEventToListeners(ys.DebugInfoAttached,e)}executionContextDestroyed(e){for(const t of this.#Nr.values())t.executionContextId===e.id&&this.#Or.detachSourceMap(t)}registerScript(e){if(this.#Nr.set(e.scriptId,e),e.isAnonymousScript())return;let t=this.#Fr.get(e.sourceURL);t||(t=[],this.#Fr.set(e.sourceURL,t)),t.unshift(e)}unregisterScript(e){console.assert(e.isAnonymousScript()),this.#Nr.delete(e.scriptId)}collectDiscardedScripts(){if(this.#Br.length<1e3)return;const e=this.#Br.splice(0,100);for(const t of e)this.unregisterScript(t),this.dispatchEventToListeners(ys.DiscardedAnonymousScriptSource,t)}createRawLocation(e,t,n,r){return this.createRawLocationByScriptId(e.scriptId,t,n,r)}createRawLocationByURL(e,t,n,r,s){for(const i of this.#Fr.get(e)||[]){if(!s){if(i.lineOffset>t||i.lineOffset===t&&void 0!==n&&i.columnOffset>n)continue;if(i.endLine=this.#os.length&&(this.#as=0),e}}var Ps=Object.freeze({__proto__:null,OverlayColorGenerator:Ms});class Es{#ls;#os=new Map;#ds=e.Settings.Settings.instance().createLocalSetting("persistent-highlight-setting",[]);#cs=new Map;#hs=new Map;#us=new Map;#gs=new Map;#ps=new Map;#ms=new Ms;#fs=new Ms;#bs=e.Settings.Settings.instance().moduleSetting("show-grid-line-labels");#ys=e.Settings.Settings.instance().moduleSetting("extend-grid-lines");#vs=e.Settings.Settings.instance().moduleSetting("show-grid-areas");#Is=e.Settings.Settings.instance().moduleSetting("show-grid-track-sizes");#ws;constructor(e,t){this.#ls=e,this.#ws=t,this.#bs.addChangeListener(this.onSettingChange,this),this.#ys.addChangeListener(this.onSettingChange,this),this.#vs.addChangeListener(this.onSettingChange,this),this.#Is.addChangeListener(this.onSettingChange,this)}onSettingChange(){this.resetOverlay()}buildGridHighlightConfig(e){const t=this.colorOfGrid(e).asLegacyColor(),n=t.setAlpha(.1).asLegacyColor(),r=t.setAlpha(.3).asLegacyColor(),s=t.setAlpha(.8).asLegacyColor(),i=this.#ys.get(),o="lineNumbers"===this.#bs.get(),a=o,l="lineNames"===this.#bs.get();return{rowGapColor:r.toProtocolRGBA(),rowHatchColor:s.toProtocolRGBA(),columnGapColor:r.toProtocolRGBA(),columnHatchColor:s.toProtocolRGBA(),gridBorderColor:t.toProtocolRGBA(),gridBorderDash:!1,rowLineColor:t.toProtocolRGBA(),columnLineColor:t.toProtocolRGBA(),rowLineDash:!0,columnLineDash:!0,showGridExtensionLines:i,showPositiveLineNumbers:o,showNegativeLineNumbers:a,showLineNames:l,showAreaNames:this.#vs.get(),showTrackSizes:this.#Is.get(),areaBorderColor:t.toProtocolRGBA(),gridBackgroundColor:n.toProtocolRGBA()}}buildFlexContainerHighlightConfig(e){const t=this.colorOfFlex(e).asLegacyColor();return{containerBorder:{color:t.toProtocolRGBA(),pattern:"dashed"},itemSeparator:{color:t.toProtocolRGBA(),pattern:"dotted"},lineSeparator:{color:t.toProtocolRGBA(),pattern:"dashed"},mainDistributedSpace:{hatchColor:t.toProtocolRGBA()},crossDistributedSpace:{hatchColor:t.toProtocolRGBA()}}}buildScrollSnapContainerHighlightConfig(t){return{snapAreaBorder:{color:e.Color.PageHighlight.GridBorder.toProtocolRGBA(),pattern:"dashed"},snapportBorder:{color:e.Color.PageHighlight.GridBorder.toProtocolRGBA()},scrollMarginColor:e.Color.PageHighlight.Margin.toProtocolRGBA(),scrollPaddingColor:e.Color.PageHighlight.Padding.toProtocolRGBA()}}highlightGridInOverlay(e){this.#cs.set(e,this.buildGridHighlightConfig(e)),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting(),this.#ws.onGridOverlayStateChanged({nodeId:e,enabled:!0})}isGridHighlighted(e){return this.#cs.has(e)}colorOfGrid(e){let t=this.#os.get(e);return t||(t=this.#ms.next(),this.#os.set(e,t)),t}setColorOfGrid(e,t){this.#os.set(e,t)}hideGridInOverlay(e){this.#cs.has(e)&&(this.#cs.delete(e),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting(),this.#ws.onGridOverlayStateChanged({nodeId:e,enabled:!1}))}highlightScrollSnapInOverlay(e){this.#hs.set(e,this.buildScrollSnapContainerHighlightConfig(e)),this.updateHighlightsInOverlay(),this.#ws.onScrollSnapOverlayStateChanged({nodeId:e,enabled:!0}),this.savePersistentHighlightSetting()}isScrollSnapHighlighted(e){return this.#hs.has(e)}hideScrollSnapInOverlay(e){this.#hs.has(e)&&(this.#hs.delete(e),this.updateHighlightsInOverlay(),this.#ws.onScrollSnapOverlayStateChanged({nodeId:e,enabled:!1}),this.savePersistentHighlightSetting())}highlightFlexInOverlay(e){this.#us.set(e,this.buildFlexContainerHighlightConfig(e)),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting(),this.#ws.onFlexOverlayStateChanged({nodeId:e,enabled:!0})}isFlexHighlighted(e){return this.#us.has(e)}colorOfFlex(e){let t=this.#os.get(e);return t||(t=this.#fs.next(),this.#os.set(e,t)),t}setColorOfFlex(e,t){this.#os.set(e,t)}hideFlexInOverlay(e){this.#us.has(e)&&(this.#us.delete(e),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting(),this.#ws.onFlexOverlayStateChanged({nodeId:e,enabled:!1}))}highlightContainerQueryInOverlay(e){this.#gs.set(e,this.buildContainerQueryContainerHighlightConfig()),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting(),this.#ws.onContainerQueryOverlayStateChanged({nodeId:e,enabled:!0})}hideContainerQueryInOverlay(e){this.#gs.has(e)&&(this.#gs.delete(e),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting(),this.#ws.onContainerQueryOverlayStateChanged({nodeId:e,enabled:!1}))}isContainerQueryHighlighted(e){return this.#gs.has(e)}buildContainerQueryContainerHighlightConfig(){return{containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},descendantBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"}}}highlightIsolatedElementInOverlay(e){this.#ps.set(e,this.buildIsolationModeHighlightConfig()),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting()}hideIsolatedElementInOverlay(e){this.#ps.has(e)&&(this.#ps.delete(e),this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting())}isIsolatedElementHighlighted(e){return this.#ps.has(e)}buildIsolationModeHighlightConfig(){return{resizerColor:e.Color.IsolationModeHighlight.Resizer.toProtocolRGBA(),resizerHandleColor:e.Color.IsolationModeHighlight.ResizerHandle.toProtocolRGBA(),maskColor:e.Color.IsolationModeHighlight.Mask.toProtocolRGBA()}}hideAllInOverlayWithoutSave(){this.#us.clear(),this.#cs.clear(),this.#hs.clear(),this.#gs.clear(),this.#ps.clear(),this.updateHighlightsInOverlay()}refreshHighlights(){const e=this.updateHighlightsForDeletedNodes(this.#cs),t=this.updateHighlightsForDeletedNodes(this.#us),n=this.updateHighlightsForDeletedNodes(this.#hs),r=this.updateHighlightsForDeletedNodes(this.#gs),s=this.updateHighlightsForDeletedNodes(this.#ps);(t||e||n||r||s)&&(this.updateHighlightsInOverlay(),this.savePersistentHighlightSetting())}updateHighlightsForDeletedNodes(e){let t=!1;for(const n of e.keys())null===this.#ls.getDOMModel().nodeForId(n)&&(e.delete(n),t=!0);return t}resetOverlay(){for(const e of this.#cs.keys())this.#cs.set(e,this.buildGridHighlightConfig(e));for(const e of this.#us.keys())this.#us.set(e,this.buildFlexContainerHighlightConfig(e));for(const e of this.#hs.keys())this.#hs.set(e,this.buildScrollSnapContainerHighlightConfig(e));for(const e of this.#gs.keys())this.#gs.set(e,this.buildContainerQueryContainerHighlightConfig());for(const e of this.#ps.keys())this.#ps.set(e,this.buildIsolationModeHighlightConfig());this.updateHighlightsInOverlay()}updateHighlightsInOverlay(){const e=this.#cs.size>0||this.#us.size>0||this.#gs.size>0||this.#ps.size>0;this.#ls.setShowViewportSizeOnResize(!e),this.updateGridHighlightsInOverlay(),this.updateFlexHighlightsInOverlay(),this.updateScrollSnapHighlightsInOverlay(),this.updateContainerQueryHighlightsInOverlay(),this.updateIsolatedElementHighlightsInOverlay()}updateGridHighlightsInOverlay(){const e=this.#ls,t=[];for(const[e,n]of this.#cs.entries())t.push({nodeId:e,gridHighlightConfig:n});e.target().overlayAgent().invoke_setShowGridOverlays({gridNodeHighlightConfigs:t})}updateFlexHighlightsInOverlay(){const e=this.#ls,t=[];for(const[e,n]of this.#us.entries())t.push({nodeId:e,flexContainerHighlightConfig:n});e.target().overlayAgent().invoke_setShowFlexOverlays({flexNodeHighlightConfigs:t})}updateScrollSnapHighlightsInOverlay(){const e=this.#ls,t=[];for(const[e,n]of this.#hs.entries())t.push({nodeId:e,scrollSnapContainerHighlightConfig:n});e.target().overlayAgent().invoke_setShowScrollSnapOverlays({scrollSnapHighlightConfigs:t})}updateContainerQueryHighlightsInOverlay(){const e=this.#ls,t=[];for(const[e,n]of this.#gs.entries())t.push({nodeId:e,containerQueryContainerHighlightConfig:n});e.target().overlayAgent().invoke_setShowContainerQueryOverlays({containerQueryHighlightConfigs:t})}updateIsolatedElementHighlightsInOverlay(){const e=this.#ls,t=[];for(const[e,n]of this.#ps.entries())t.push({nodeId:e,isolationModeHighlightConfig:n});e.target().overlayAgent().invoke_setShowIsolatedElements({isolatedElementHighlightConfigs:t})}async restoreHighlightsForDocument(){this.#us=new Map,this.#cs=new Map,this.#hs=new Map,this.#gs=new Map,this.#ps=new Map;const e=await this.#ls.getDOMModel().requestDocument(),t=e?e.documentURL:r.DevToolsPath.EmptyUrlString;await Promise.all(this.#ds.get().map((async e=>{if(e.url===t)return await this.#ls.getDOMModel().pushNodeByPathToFrontend(e.path).then((t=>{const n=this.#ls.getDOMModel().nodeForId(t);if(n)switch(e.type){case"GRID":this.#cs.set(n.id,this.buildGridHighlightConfig(n.id)),this.#ws.onGridOverlayStateChanged({nodeId:n.id,enabled:!0});break;case"FLEX":this.#us.set(n.id,this.buildFlexContainerHighlightConfig(n.id)),this.#ws.onFlexOverlayStateChanged({nodeId:n.id,enabled:!0});break;case"CONTAINER_QUERY":this.#gs.set(n.id,this.buildContainerQueryContainerHighlightConfig()),this.#ws.onContainerQueryOverlayStateChanged({nodeId:n.id,enabled:!0});break;case"SCROLL_SNAP":this.#hs.set(n.id,this.buildScrollSnapContainerHighlightConfig(n.id)),this.#ws.onScrollSnapOverlayStateChanged({nodeId:n.id,enabled:!0});break;case"ISOLATED_ELEMENT":this.#ps.set(n.id,this.buildIsolationModeHighlightConfig())}}))}))),this.updateHighlightsInOverlay()}currentUrl(){const e=this.#ls.getDOMModel().existingDocument();return e?e.documentURL:r.DevToolsPath.EmptyUrlString}getPersistentHighlightSettingForOneType(e,t){const n=[];for(const r of e.keys()){const e=this.#ls.getDOMModel().nodeForId(r);e&&n.push({url:this.currentUrl(),path:e.path(),type:t})}return n}savePersistentHighlightSetting(){const e=this.currentUrl(),t=[...this.#ds.get().filter((t=>t.url!==e)),...this.getPersistentHighlightSettingForOneType(this.#cs,"GRID"),...this.getPersistentHighlightSettingForOneType(this.#us,"FLEX"),...this.getPersistentHighlightSettingForOneType(this.#gs,"CONTAINER_QUERY"),...this.getPersistentHighlightSettingForOneType(this.#hs,"SCROLL_SNAP"),...this.getPersistentHighlightSettingForOneType(this.#ps,"ISOLATED_ELEMENT")];this.#ds.set(t)}}var Ls=Object.freeze({__proto__:null,OverlayPersistentHighlighter:Es});const As={pausedInDebugger:"Paused in debugger"},Os=n.i18n.registerUIStrings("core/sdk/OverlayModel.ts",As),Ds=n.i18n.getLocalizedString.bind(void 0,Os),Ns={mac:{x:85,y:0,width:185,height:40},linux:{x:0,y:0,width:196,height:34},windows:{x:0,y:0,width:238,height:33}};class Fs extends h{#er;overlayAgent;#Xr;#Ss=!1;#ks=null;#Cs;#xs;#Rs;#Ts;#Ms;#Ps;#Es;#Ls;#As=[];#Os=!0;#Ds;#Ns;#Fs=!1;#Bs;constructor(t){super(t),this.#er=t.model(Gs),t.registerOverlayDispatcher(this),this.overlayAgent=t.overlayAgent(),this.#Xr=t.model(ms),this.#Xr&&(e.Settings.Settings.instance().moduleSetting("disable-paused-state-overlay").addChangeListener(this.updatePausedInDebuggerMessage,this),this.#Xr.addEventListener(ys.DebuggerPaused,this.updatePausedInDebuggerMessage,this),this.#Xr.addEventListener(ys.DebuggerResumed,this.updatePausedInDebuggerMessage,this),this.#Xr.addEventListener(ys.GlobalObjectCleared,this.updatePausedInDebuggerMessage,this)),this.#Cs=new _s(this),this.#xs=this.#Cs,this.#Rs=e.Settings.Settings.instance().moduleSetting("show-paint-rects"),this.#Ts=e.Settings.Settings.instance().moduleSetting("show-layout-shift-regions"),this.#Ms=e.Settings.Settings.instance().moduleSetting("show-ad-highlights"),this.#Ps=e.Settings.Settings.instance().moduleSetting("show-debug-borders"),this.#Es=e.Settings.Settings.instance().moduleSetting("show-fps-counter"),this.#Ls=e.Settings.Settings.instance().moduleSetting("show-scroll-bottleneck-rects"),t.suspended()||(this.overlayAgent.invoke_enable(),this.wireAgentToSettings()),this.#Ds=new Es(this,{onGridOverlayStateChanged:({nodeId:e,enabled:t})=>this.dispatchEventToListeners("PersistentGridOverlayStateChanged",{nodeId:e,enabled:t}),onFlexOverlayStateChanged:({nodeId:e,enabled:t})=>this.dispatchEventToListeners("PersistentFlexContainerOverlayStateChanged",{nodeId:e,enabled:t}),onContainerQueryOverlayStateChanged:({nodeId:e,enabled:t})=>this.dispatchEventToListeners("PersistentContainerQueryOverlayStateChanged",{nodeId:e,enabled:t}),onScrollSnapOverlayStateChanged:({nodeId:e,enabled:t})=>this.dispatchEventToListeners("PersistentScrollSnapOverlayStateChanged",{nodeId:e,enabled:t})}),this.#er.addEventListener(Us.NodeRemoved,(()=>{this.#Ds&&this.#Ds.refreshHighlights()})),this.#er.addEventListener(Us.DocumentUpdated,(()=>{this.#Ds&&(this.#Ds.hideAllInOverlayWithoutSave(),t.suspended()||this.#Ds.restoreHighlightsForDocument())})),this.#Ns=new Hs(this),this.#Bs=new Bs(this.#er.cssModel())}static highlightObjectAsDOMNode(e){const t=e.runtimeModel().target().model(Gs);t&&t.overlayModel().highlightInOverlay({object:e,selectorList:void 0})}static hideDOMNodeHighlight(){for(const e of W.instance().models(Fs))e.delayedHideHighlight(0)}static async muteHighlight(){return await Promise.all(W.instance().models(Fs).map((e=>e.suspendModel())))}static async unmuteHighlight(){return await Promise.all(W.instance().models(Fs).map((e=>e.resumeModel())))}static highlightRect(e){for(const t of W.instance().models(Fs))t.highlightRect(e)}static clearHighlight(){for(const e of W.instance().models(Fs))e.clearHighlight()}getDOMModel(){return this.#er}highlightRect({x:e,y:t,width:n,height:r,color:s,outlineColor:i}){const o=s||{r:255,g:0,b:255,a:.3},a=i||{r:255,g:0,b:255,a:.5};return this.overlayAgent.invoke_highlightRect({x:e,y:t,width:n,height:r,color:o,outlineColor:a})}clearHighlight(){return this.overlayAgent.invoke_hideHighlight()}async wireAgentToSettings(){this.#As=[this.#Rs.addChangeListener((()=>this.overlayAgent.invoke_setShowPaintRects({result:this.#Rs.get()}))),this.#Ts.addChangeListener((()=>this.overlayAgent.invoke_setShowLayoutShiftRegions({result:this.#Ts.get()}))),this.#Ms.addChangeListener((()=>this.overlayAgent.invoke_setShowAdHighlights({show:this.#Ms.get()}))),this.#Ps.addChangeListener((()=>this.overlayAgent.invoke_setShowDebugBorders({show:this.#Ps.get()}))),this.#Es.addChangeListener((()=>this.overlayAgent.invoke_setShowFPSCounter({show:this.#Es.get()}))),this.#Ls.addChangeListener((()=>this.overlayAgent.invoke_setShowScrollBottleneckRects({show:this.#Ls.get()})))],this.#Rs.get()&&this.overlayAgent.invoke_setShowPaintRects({result:!0}),this.#Ts.get()&&this.overlayAgent.invoke_setShowLayoutShiftRegions({result:!0}),this.#Ms.get()&&this.overlayAgent.invoke_setShowAdHighlights({show:!0}),this.#Ps.get()&&this.overlayAgent.invoke_setShowDebugBorders({show:!0}),this.#Es.get()&&this.overlayAgent.invoke_setShowFPSCounter({show:!0}),this.#Ls.get()&&this.overlayAgent.invoke_setShowScrollBottleneckRects({show:!0}),this.#Xr&&this.#Xr.isPaused()&&this.updatePausedInDebuggerMessage(),await this.overlayAgent.invoke_setShowViewportSizeOnResize({show:this.#Os}),this.#Ds?.resetOverlay()}async suspendModel(){e.EventTarget.removeEventListeners(this.#As),await this.overlayAgent.invoke_disable()}async resumeModel(){await Promise.all([this.overlayAgent.invoke_enable(),this.wireAgentToSettings()])}setShowViewportSizeOnResize(e){this.#Os!==e&&(this.#Os=e,this.target().suspended()||this.overlayAgent.invoke_setShowViewportSizeOnResize({show:e}))}updatePausedInDebuggerMessage(){if(this.target().suspended())return;const t=this.#Xr&&this.#Xr.isPaused()&&!e.Settings.Settings.instance().moduleSetting("disable-paused-state-overlay").get()?Ds(As.pausedInDebugger):void 0;this.overlayAgent.invoke_setPausedInDebuggerMessage({message:t})}setHighlighter(e){this.#xs=e||this.#Cs}async setInspectMode(e,t=!0){await this.#er.requestDocument(),this.#Ss="none"!==e,this.dispatchEventToListeners("InspectModeWillBeToggled",this),this.#xs.setInspectMode(e,this.buildHighlightConfig("all",t))}inspectModeEnabled(){return this.#Ss}highlightInOverlay(e,t,n){if(this.#Fs)return;this.#ks&&(clearTimeout(this.#ks),this.#ks=null);const r=this.buildHighlightConfig(t);void 0!==n&&(r.showInfo=n),this.#xs.highlightInOverlay(e,r)}highlightInOverlayForTwoSeconds(e){this.highlightInOverlay(e),this.delayedHideHighlight(2e3)}highlightGridInPersistentOverlay(e){this.#Ds&&this.#Ds.highlightGridInOverlay(e)}isHighlightedGridInPersistentOverlay(e){return!!this.#Ds&&this.#Ds.isGridHighlighted(e)}hideGridInPersistentOverlay(e){this.#Ds&&this.#Ds.hideGridInOverlay(e)}highlightScrollSnapInPersistentOverlay(e){this.#Ds&&this.#Ds.highlightScrollSnapInOverlay(e)}isHighlightedScrollSnapInPersistentOverlay(e){return!!this.#Ds&&this.#Ds.isScrollSnapHighlighted(e)}hideScrollSnapInPersistentOverlay(e){this.#Ds&&this.#Ds.hideScrollSnapInOverlay(e)}highlightFlexContainerInPersistentOverlay(e){this.#Ds&&this.#Ds.highlightFlexInOverlay(e)}isHighlightedFlexContainerInPersistentOverlay(e){return!!this.#Ds&&this.#Ds.isFlexHighlighted(e)}hideFlexContainerInPersistentOverlay(e){this.#Ds&&this.#Ds.hideFlexInOverlay(e)}highlightContainerQueryInPersistentOverlay(e){this.#Ds&&this.#Ds.highlightContainerQueryInOverlay(e)}isHighlightedContainerQueryInPersistentOverlay(e){return!!this.#Ds&&this.#Ds.isContainerQueryHighlighted(e)}hideContainerQueryInPersistentOverlay(e){this.#Ds&&this.#Ds.hideContainerQueryInOverlay(e)}highlightSourceOrderInOverlay(t){const n={parentOutlineColor:e.Color.SourceOrderHighlight.ParentOutline.toProtocolRGBA(),childOutlineColor:e.Color.SourceOrderHighlight.ChildOutline.toProtocolRGBA()};this.#Ns.highlightSourceOrderInOverlay(t,n)}colorOfGridInPersistentOverlay(e){return this.#Ds?this.#Ds.colorOfGrid(e).asString("hex"):null}setColorOfGridInPersistentOverlay(t,n){if(!this.#Ds)return;const r=e.Color.parse(n);r&&(this.#Ds.setColorOfGrid(t,r),this.#Ds.resetOverlay())}colorOfFlexInPersistentOverlay(e){return this.#Ds?this.#Ds.colorOfFlex(e).asString("hex"):null}setColorOfFlexInPersistentOverlay(t,n){if(!this.#Ds)return;const r=e.Color.parse(n);r&&(this.#Ds.setColorOfFlex(t,r),this.#Ds.resetOverlay())}hideSourceOrderInOverlay(){this.#Ns.hideSourceOrderHighlight()}setSourceOrderActive(e){this.#Fs=e}sourceOrderModeActive(){return this.#Fs}delayedHideHighlight(e){null===this.#ks&&(this.#ks=window.setTimeout((()=>this.highlightInOverlay({clear:!0})),e))}highlightFrame(e){this.#ks&&(clearTimeout(this.#ks),this.#ks=null),this.#xs.highlightFrame(e)}showHingeForDualScreen(e){if(e){const{x:t,y:n,width:r,height:s,contentColor:i,outlineColor:o}=e;this.overlayAgent.invoke_setShowHinge({hingeConfig:{rect:{x:t,y:n,width:r,height:s},contentColor:i,outlineColor:o}})}else this.overlayAgent.invoke_setShowHinge({})}setWindowControlsPlatform(e){this.#Bs.selectedPlatform=e}setWindowControlsThemeColor(e){this.#Bs.themeColor=e}getWindowControlsConfig(){return this.#Bs.config}async toggleWindowControlsToolbar(e){const t=e?{windowControlsOverlayConfig:this.#Bs.config}:{},n=this.overlayAgent.invoke_setShowWindowControlsOverlay(t),r=this.#Bs.toggleEmulatedOverlay(e);await Promise.all([n,r]),this.setShowViewportSizeOnResize(!e)}buildHighlightConfig(t="all",n=!1){const r=e.Settings.Settings.instance().moduleSetting("show-metrics-rulers").get(),s={showInfo:"all"===t||"container-outline"===t,showRulers:r,showStyles:n,showAccessibilityInfo:n,showExtensionLines:r,gridHighlightConfig:{},flexContainerHighlightConfig:{},flexItemHighlightConfig:{},contrastAlgorithm:o.Runtime.experiments.isEnabled("apca")?"apca":"aa"};return"all"!==t&&"content"!==t||(s.contentColor=e.Color.PageHighlight.Content.toProtocolRGBA()),"all"!==t&&"padding"!==t||(s.paddingColor=e.Color.PageHighlight.Padding.toProtocolRGBA()),"all"!==t&&"border"!==t||(s.borderColor=e.Color.PageHighlight.Border.toProtocolRGBA()),"all"!==t&&"margin"!==t||(s.marginColor=e.Color.PageHighlight.Margin.toProtocolRGBA()),"all"===t&&(s.eventTargetColor=e.Color.PageHighlight.EventTarget.toProtocolRGBA(),s.shapeColor=e.Color.PageHighlight.Shape.toProtocolRGBA(),s.shapeMarginColor=e.Color.PageHighlight.ShapeMargin.toProtocolRGBA(),s.gridHighlightConfig={rowGapColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA(),rowHatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),columnGapColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA(),columnHatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),rowLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),columnLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),rowLineDash:!0,columnLineDash:!0},s.flexContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},itemSeparator:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dotted"},lineSeparator:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},mainDistributedSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()},crossDistributedSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()},rowGapSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()},columnGapSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()}},s.flexItemHighlightConfig={baseSizeBox:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA()},baseSizeBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dotted"},flexibilityArrow:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA()}}),t.endsWith("gap")&&(s.gridHighlightConfig={gridBorderColor:e.Color.PageHighlight.GridBorder.toProtocolRGBA(),gridBorderDash:!0},"gap"!==t&&"row-gap"!==t||(s.gridHighlightConfig.rowGapColor=e.Color.PageHighlight.GapBackground.toProtocolRGBA(),s.gridHighlightConfig.rowHatchColor=e.Color.PageHighlight.GapHatch.toProtocolRGBA()),"gap"!==t&&"column-gap"!==t||(s.gridHighlightConfig.columnGapColor=e.Color.PageHighlight.GapBackground.toProtocolRGBA(),s.gridHighlightConfig.columnHatchColor=e.Color.PageHighlight.GapHatch.toProtocolRGBA())),t.endsWith("gap")&&(s.flexContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"}},"gap"!==t&&"row-gap"!==t||(s.flexContainerHighlightConfig.rowGapSpace={hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()}),"gap"!==t&&"column-gap"!==t||(s.flexContainerHighlightConfig.columnGapSpace={hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()})),"grid-areas"===t&&(s.gridHighlightConfig={rowLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),columnLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),rowLineDash:!0,columnLineDash:!0,showAreaNames:!0,areaBorderColor:e.Color.PageHighlight.GridAreaBorder.toProtocolRGBA()}),"grid-template-columns"===t&&(s.contentColor=e.Color.PageHighlight.Content.toProtocolRGBA(),s.gridHighlightConfig={columnLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),columnLineDash:!0}),"grid-template-rows"===t&&(s.contentColor=e.Color.PageHighlight.Content.toProtocolRGBA(),s.gridHighlightConfig={rowLineColor:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),rowLineDash:!0}),"justify-content"===t&&(s.flexContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},mainDistributedSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()}}),"align-content"===t&&(s.flexContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},crossDistributedSpace:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA(),fillColor:e.Color.PageHighlight.GapBackground.toProtocolRGBA()}}),"align-items"===t&&(s.flexContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},lineSeparator:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"},crossAlignment:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA()}}),"flexibility"===t&&(s.flexItemHighlightConfig={baseSizeBox:{hatchColor:e.Color.PageHighlight.GapHatch.toProtocolRGBA()},baseSizeBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dotted"},flexibilityArrow:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA()}}),"container-outline"===t&&(s.containerQueryContainerHighlightConfig={containerBorder:{color:e.Color.PageHighlight.LayoutLine.toProtocolRGBA(),pattern:"dashed"}}),s}nodeHighlightRequested({nodeId:e}){const t=this.#er.nodeForId(e);t&&this.dispatchEventToListeners("HighlightNodeRequested",t)}static setInspectNodeHandler(e){Fs.inspectNodeHandler=e}inspectNodeRequested({backendNodeId:t}){const n=new js(this.target(),t);Fs.inspectNodeHandler?n.resolvePromise().then((e=>{e&&Fs.inspectNodeHandler&&Fs.inspectNodeHandler(e)})):e.Revealer.reveal(n),this.dispatchEventToListeners("InspectModeExited")}screenshotRequested({viewport:e}){this.dispatchEventToListeners("ScreenshotRequested",e),this.dispatchEventToListeners("InspectModeExited")}inspectModeCanceled(){this.dispatchEventToListeners("InspectModeExited")}static inspectNodeHandler=null;getOverlayAgent(){return this.overlayAgent}async hasStyleSheetText(e){return await this.#Bs.initializeStyleSheetText(e)}}class Bs{#lt;#_s;#Hs;#Us;#qs={showCSS:!1,selectedPlatform:"Windows",themeColor:"#ffffff"};constructor(e){this.#lt=e}get selectedPlatform(){return this.#qs.selectedPlatform}set selectedPlatform(e){this.#qs.selectedPlatform=e}get themeColor(){return this.#qs.themeColor}set themeColor(e){this.#qs.themeColor=e}get config(){return this.#qs}async initializeStyleSheetText(e){if(this.#_s&&e===this.#Us)return!0;const t=this.#zs(e);if(!t)return!1;if(this.#Hs=this.#js(t),!this.#Hs)return!1;const n=await this.#lt.getStyleSheetText(this.#Hs);return!!n&&(this.#_s=n,this.#Us=e,!0)}async toggleEmulatedOverlay(e){if(this.#Hs&&this.#_s)if(e){const e=Bs.#Vs(this.#qs.selectedPlatform.toLowerCase(),this.#_s);e&&await this.#lt.setStyleSheetText(this.#Hs,e,!1)}else await this.#lt.setStyleSheetText(this.#Hs,this.#_s,!1)}static#Vs(e,t){const n=Ns[e];return Bs.#Ws(n.x,n.y,n.width,n.height,t)}#zs(t){const n=e.ParsedURL.ParsedURL.extractOrigin(t),r=this.#lt.styleSheetHeaders().find((e=>e.sourceURL&&e.sourceURL.includes(n)));return r?.sourceURL}#js(e){const t=this.#lt.getStyleSheetIdsForURL(e);return t.length>0?t[0]:void 0}static#Ws(e,t,n,r,s){if(!s)return;return s.replace(/: env\(titlebar-area-x(?:,[^)]*)?\);/g,`: env(titlebar-area-x, ${e}px);`).replace(/: env\(titlebar-area-y(?:,[^)]*)?\);/g,`: env(titlebar-area-y, ${t}px);`).replace(/: env\(titlebar-area-width(?:,[^)]*)?\);/g,`: env(titlebar-area-width, calc(100% - ${n}px));`).replace(/: env\(titlebar-area-height(?:,[^)]*)?\);/g,`: env(titlebar-area-height, ${r}px);`)}transformStyleSheetforTesting(e,t,n,r,s){return Bs.#Ws(e,t,n,r,s)}}class _s{#ls;constructor(e){this.#ls=e}highlightInOverlay(e,t){const{node:n,deferredNode:r,object:s,selectorList:i}={node:void 0,deferredNode:void 0,object:void 0,selectorList:void 0,...e},o=n?n.id:void 0,a=r?r.backendNodeId():void 0,l=s?s.objectId:void 0;o||a||l?this.#ls.target().overlayAgent().invoke_highlightNode({highlightConfig:t,nodeId:o,backendNodeId:a,objectId:l,selector:i}):this.#ls.target().overlayAgent().invoke_hideHighlight()}async setInspectMode(e,t){await this.#ls.target().overlayAgent().invoke_setInspectMode({mode:e,highlightConfig:t})}highlightFrame(t){this.#ls.target().overlayAgent().invoke_highlightFrame({frameId:t,contentColor:e.Color.PageHighlight.Content.toProtocolRGBA(),contentOutlineColor:e.Color.PageHighlight.ContentOutline.toProtocolRGBA()})}}class Hs{#ls;constructor(e){this.#ls=e}highlightSourceOrderInOverlay(e,t){this.#ls.setSourceOrderActive(!0),this.#ls.setShowViewportSizeOnResize(!1),this.#ls.getOverlayAgent().invoke_highlightSourceOrder({sourceOrderConfig:t,nodeId:e.id})}hideSourceOrderHighlight(){this.#ls.setSourceOrderActive(!1),this.#ls.setShowViewportSizeOnResize(!0),this.#ls.clearHighlight()}}h.register(Fs,{capabilities:2,autostart:!0});var Us,qs=Object.freeze({__proto__:null,OverlayModel:Fs,SourceOrderHighlighter:Hs,WindowControls:Bs});class zs{#Gs;#Ks;ownerDocument;#Qs;id;index=void 0;#$s;#Xs;#Js;#Ys;nodeValueInternal;#Zs;#ei;#ti;#ni;#ri;#si;#ii;#oi=null;#ai=new Map;#li=[];assignedSlot=null;shadowRootsInternal=[];#di=new Map;#ci=new Map;#hi=0;childNodeCountInternal;childrenInternal=null;nextSibling=null;previousSibling=null;firstChild=null;lastChild=null;parentNode=null;templateContentInternal;contentDocumentInternal;childDocumentPromiseForTesting;#ui;publicId;systemId;internalSubset;name;value;constructor(e){this.#Gs=e,this.#Ks=this.#Gs.getAgent()}static create(e,t,n,r){const s=new zs(e);return s.init(t,n,r),s}init(e,t,n){if(this.#Ks=this.#Gs.getAgent(),this.ownerDocument=e,this.#Qs=t,this.id=n.nodeId,this.#$s=n.backendNodeId,this.#Gs.registerNode(this),this.#Xs=n.nodeType,this.#Js=n.nodeName,this.#Ys=n.localName,this.nodeValueInternal=n.nodeValue,this.#Zs=n.pseudoType,this.#ei=n.pseudoIdentifier,this.#ti=n.shadowRootType,this.#ni=n.frameId||null,this.#ri=n.xmlVersion,this.#si=Boolean(n.isSVG),this.#ii=Boolean(n.isScrollable),n.attributes&&this.setAttributesPayload(n.attributes),this.childNodeCountInternal=n.childNodeCount||0,n.shadowRoots)for(let e=0;ee.creation||null)),this.#oi}get subtreeMarkerCount(){return this.#hi}domModel(){return this.#Gs}backendNodeId(){return this.#$s}children(){return this.childrenInternal?this.childrenInternal.slice():null}setChildren(e){this.childrenInternal=e}setIsScrollable(e){this.#ii=e}hasAttributes(){return this.#di.size>0}childNodeCount(){return this.childNodeCountInternal}setChildNodeCount(e){this.childNodeCountInternal=e}shadowRoots(){return this.shadowRootsInternal.slice()}templateContent(){return this.templateContentInternal||null}contentDocument(){return this.contentDocumentInternal||null}setContentDocument(e){this.contentDocumentInternal=e}isIframe(){return"IFRAME"===this.#Js}importedDocument(){return this.#ui||null}nodeType(){return this.#Xs}nodeName(){return this.#Js}pseudoType(){return this.#Zs}pseudoIdentifier(){return this.#ei}hasPseudoElements(){return this.#ai.size>0}pseudoElements(){return this.#ai}checkmarkPseudoElement(){return this.#ai.get("checkmark")?.at(-1)}beforePseudoElement(){return this.#ai.get("before")?.at(-1)}afterPseudoElement(){return this.#ai.get("after")?.at(-1)}pickerIconPseudoElement(){return this.#ai.get("picker-icon")?.at(-1)}markerPseudoElement(){return this.#ai.get("marker")?.at(-1)}backdropPseudoElement(){return this.#ai.get("backdrop")?.at(-1)}viewTransitionPseudoElements(){return[...this.#ai.get("view-transition")||[],...this.#ai.get("view-transition-group")||[],...this.#ai.get("view-transition-image-pair")||[],...this.#ai.get("view-transition-old")||[],...this.#ai.get("view-transition-new")||[]]}carouselPseudoElements(){return[...this.#ai.get("scroll-button")||[],...this.#ai.get("column")||[],...this.#ai.get("scroll-marker")||[],...this.#ai.get("scroll-marker-group")||[]]}hasAssignedSlot(){return null!==this.assignedSlot}isInsertionPoint(){return!this.isXMLNode()&&("SHADOW"===this.#Js||"CONTENT"===this.#Js||"SLOT"===this.#Js)}distributedNodes(){return this.#li}isInShadowTree(){return this.#Qs}ancestorShadowHost(){const e=this.ancestorShadowRoot();return e?e.parentNode:null}ancestorShadowRoot(){if(!this.#Qs)return null;let e=this;for(;e&&!e.isShadowRoot();)e=e.parentNode;return e}ancestorUserAgentShadowRoot(){const e=this.ancestorShadowRoot();return e&&e.shadowRootType()===zs.ShadowRootTypes.UserAgent?e:null}isShadowRoot(){return Boolean(this.#ti)}shadowRootType(){return this.#ti||null}nodeNameInCorrectCase(){const e=this.shadowRootType();return e?"#shadow-root ("+e+")":this.localName()?this.localName().length!==this.nodeName().length?this.nodeName():this.localName():this.nodeName()}setNodeName(e,t){this.#Ks.invoke_setNodeName({nodeId:this.id,name:e}).then((e=>{e.getError()||this.#Gs.markUndoableState(),t&&t(e.getError()||null,this.#Gs.nodeForId(e.nodeId))}))}localName(){return this.#Ys}nodeValue(){return this.nodeValueInternal}setNodeValueInternal(e){this.nodeValueInternal=e}setNodeValue(e,t){this.#Ks.invoke_setNodeValue({nodeId:this.id,value:e}).then((e=>{e.getError()||this.#Gs.markUndoableState(),t&&t(e.getError()||null)}))}getAttribute(e){const t=this.#di.get(e);return t?t.value:void 0}setAttribute(e,t,n){this.#Ks.invoke_setAttributesAsText({nodeId:this.id,text:t,name:e}).then((e=>{e.getError()||this.#Gs.markUndoableState(),n&&n(e.getError()||null)}))}setAttributeValue(e,t,n){this.#Ks.invoke_setAttributeValue({nodeId:this.id,name:e,value:t}).then((e=>{e.getError()||this.#Gs.markUndoableState(),n&&n(e.getError()||null)}))}setAttributeValuePromise(e,t){return new Promise((n=>this.setAttributeValue(e,t,n)))}attributes(){return[...this.#di.values()]}async removeAttribute(e){(await this.#Ks.invoke_removeAttribute({nodeId:this.id,name:e})).getError()||(this.#di.delete(e),this.#Gs.markUndoableState())}getChildNodesPromise(){return new Promise((e=>this.getChildNodes((t=>e(t)))))}getChildNodes(e){this.childrenInternal?e(this.children()):this.#Ks.invoke_requestChildNodes({nodeId:this.id}).then((t=>{e(t.getError()?null:this.children())}))}async getSubtree(e,t){return(await this.#Ks.invoke_requestChildNodes({nodeId:this.id,depth:e,pierce:t})).getError()?null:this.childrenInternal}async getOuterHTML(){const{outerHTML:e}=await this.#Ks.invoke_getOuterHTML({nodeId:this.id});return e}setOuterHTML(e,t){this.#Ks.invoke_setOuterHTML({nodeId:this.id,outerHTML:e}).then((e=>{e.getError()||this.#Gs.markUndoableState(),t&&t(e.getError()||null)}))}removeNode(e){return this.#Ks.invoke_removeNode({nodeId:this.id}).then((t=>{t.getError()||this.#Gs.markUndoableState(),e&&e(t.getError()||null)}))}async copyNode(){const{outerHTML:e}=await this.#Ks.invoke_getOuterHTML({nodeId:this.id});return null!==e&&a.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(e),e}path(){function e(e){return e.#Js.length?void 0!==e.index?e.index:e.parentNode?e.isShadowRoot()?e.shadowRootType()===zs.ShadowRootTypes.UserAgent?"u":"a":e.nodeType()===Node.DOCUMENT_NODE?"d":null:null:null}const t=[];let n=this;for(;n;){const r=e(n);if(null===r)break;t.push([r,n.#Js]),n=n.parentNode}return t.reverse(),t.join(",")}isAncestor(e){if(!e)return!1;let t=e.parentNode;for(;t;){if(this===t)return!0;t=t.parentNode}return!1}isDescendant(e){return e.isAncestor(this)}frameOwnerFrameId(){return this.#ni}frameId(){let e=this.parentNode||this;for(;!e.#ni&&e.parentNode;)e=e.parentNode;return e.#ni}setAttributesPayload(e){let t=!this.#di||e.length!==2*this.#di.size;const n=this.#di||new Map;this.#di=new Map;for(let r=0;rt!==e));n&&n.length>0?this.#ai.set(t,n):this.#ai.delete(t)}else{const t=this.shadowRootsInternal.indexOf(e);if(-1!==t)this.shadowRootsInternal.splice(t,1);else{if(!this.childrenInternal)throw new Error("DOMNode._children is expected to not be null.");if(-1===this.childrenInternal.indexOf(e))throw new Error("DOMNode._children is expected to contain the node to be removed.");this.childrenInternal.splice(this.childrenInternal.indexOf(e),1)}}e.parentNode=null,this.#hi-=e.#hi,e.#hi&&this.#Gs.dispatchEventToListeners(Us.MarkersChanged,this),this.renumber()}setChildrenPayload(e){this.childrenInternal=[];for(let t=0;t=0?this.childrenInternal[e-1]:null,t.parentNode=this}}addAttribute(e,t){const n={name:e,value:t,_node:this};this.#di.set(e,n)}setAttributeInternal(e,t){const n=this.#di.get(e);n?n.value=t:this.addAttribute(e,t)}removeAttributeInternal(e){this.#di.delete(e)}copyTo(e,t,n){this.#Ks.invoke_copyTo({nodeId:this.id,targetNodeId:e.id,insertBeforeNodeId:t?t.id:void 0}).then((e=>{e.getError()||this.#Gs.markUndoableState(),n&&n(e.getError()||null,this.#Gs.nodeForId(e.nodeId))}))}moveTo(e,t,n){this.#Ks.invoke_moveTo({nodeId:this.id,targetNodeId:e.id,insertBeforeNodeId:t?t.id:void 0}).then((e=>{e.getError()||this.#Gs.markUndoableState(),n&&n(e.getError()||null,this.#Gs.nodeForId(e.nodeId))}))}isXMLNode(){return Boolean(this.#ri)}setMarker(e,t){if(null!==t){if(this.parentNode&&!this.#ci.has(e))for(let e=this;e;e=e.parentNode)++e.#hi;this.#ci.set(e,t);for(let e=this;e;e=e.parentNode)this.#Gs.dispatchEventToListeners(Us.MarkersChanged,e)}else{if(!this.#ci.has(e))return;this.#ci.delete(e);for(let e=this;e;e=e.parentNode)--e.#hi;for(let e=this;e;e=e.parentNode)this.#Gs.dispatchEventToListeners(Us.MarkersChanged,e)}}marker(e){return this.#ci.get(e)||null}getMarkerKeysForTest(){return[...this.#ci.keys()]}traverseMarkers(e){!function t(n){if(n.#hi){for(const t of n.#ci.keys())e(n,t);if(n.childrenInternal)for(const e of n.childrenInternal)t(e)}}(this)}resolveURL(t){if(!t)return t;for(let n=this;n;n=n.parentNode)if(n instanceof Ws&&n.baseURL)return e.ParsedURL.ParsedURL.completeURL(n.baseURL,t);return null}highlight(e){this.#Gs.overlayModel().highlightInOverlay({node:this,selectorList:void 0},e)}highlightForTwoSeconds(){this.#Gs.overlayModel().highlightInOverlayForTwoSeconds({node:this,selectorList:void 0})}async resolveToObject(e,t){const{object:n}=await this.#Ks.invoke_resolveNode({nodeId:this.id,backendNodeId:void 0,executionContextId:t,objectGroup:e});return n&&this.#Gs.runtimeModelInternal.createRemoteObject(n)||null}async boxModel(){const{model:e}=await this.#Ks.invoke_getBoxModel({nodeId:this.id});return e}async setAsInspectedNode(){let e=this;for(e?.pseudoType()&&(e=e.parentNode);e;){let t=e.ancestorUserAgentShadowRoot();if(!t)break;if(t=e.ancestorShadowHost(),!t)break;e=t}if(!e)throw new Error("In DOMNode.setAsInspectedNode: node is expected to not be null.");await this.#Ks.invoke_setInspectedNode({nodeId:e.id})}enclosingElementOrSelf(){let e=this;return e&&e.nodeType()===Node.TEXT_NODE&&e.parentNode&&(e=e.parentNode),e&&e.nodeType()!==Node.ELEMENT_NODE&&(e=null),e}async callFunction(e,t=[]){const n=await this.resolveToObject();if(!n)return null;const r=await n.callFunction(e,t.map((e=>Bn.toCallArgument(e))));return n.release(),r.wasThrown||!r.object?null:{value:r.object.value}}async scrollIntoView(){const e=this.enclosingElementOrSelf();if(!e)return;await e.callFunction((function(){this.scrollIntoViewIfNeeded(!0)}))&&e.highlightForTwoSeconds()}async focus(){const e=this.enclosingElementOrSelf();if(!e)throw new Error("DOMNode.focus expects node to not be null.");await e.callFunction((function(){this.focus()}))&&(e.highlightForTwoSeconds(),await this.#Gs.target().pageAgent().invoke_bringToFront())}simpleSelector(){const e=this.localName()||this.nodeName().toLowerCase();if(this.nodeType()!==Node.ELEMENT_NODE)return e;const t=this.getAttribute("type"),n=this.getAttribute("id"),r=this.getAttribute("class");if("input"===e&&t&&!n&&!r)return e+'[type="'+CSS.escape(t)+'"]';if(n)return e+"#"+CSS.escape(n);if(r){return("div"===e?"":e)+"."+r.trim().split(/\s+/g).map((e=>CSS.escape(e))).join(".")}return this.pseudoIdentifier()?`${e}(${this.pseudoIdentifier()})`:e}async getAnchorBySpecifier(e){const t=await this.#Ks.invoke_getAnchorElement({nodeId:this.id,anchorSpecifier:e});return t.getError()?null:this.domModel().nodeForId(t.nodeId)}classNames(){const e=this.getAttribute("class");return e?e.split(/\s+/):[]}}!function(e){let t;!function(e){e.UserAgent="user-agent",e.Open="open",e.Closed="closed"}(t=e.ShadowRootTypes||(e.ShadowRootTypes={}))}(zs||(zs={}));class js{#Gs;#$s;constructor(e,t){this.#Gs=e.model(Gs),this.#$s=t}resolve(e){this.resolvePromise().then(e)}async resolvePromise(){const e=await this.#Gs.pushNodesByBackendIdsToFrontend(new Set([this.#$s]));return e?.get(this.#$s)||null}backendNodeId(){return this.#$s}domModel(){return this.#Gs}highlight(){this.#Gs.overlayModel().highlightInOverlay({deferredNode:this,selectorList:void 0})}}class Vs{nodeType;nodeName;deferredNode;constructor(e,t,n,r){this.nodeType=n,this.nodeName=r,this.deferredNode=new js(e,t)}}class Ws extends zs{body;documentElement;documentURL;baseURL;constructor(e,t){super(e),this.body=null,this.documentElement=null,this.init(this,!1,t),this.documentURL=t.documentURL||"",this.baseURL=t.baseURL||""}}class Gs extends h{agent;idToDOMNode=new Map;#gi=null;#pi=new Set;runtimeModelInternal;#mi;#fi=null;#bi;#yi;#vi;constructor(e){super(e),this.agent=e.domAgent(),e.registerDOMDispatcher(new Ks(this)),this.runtimeModelInternal=e.model(Jr),e.suspended()||this.agent.invoke_enable({}),o.Runtime.experiments.isEnabled("capture-node-creation-stacks")&&this.agent.invoke_setNodeStackTracesEnabled({enable:!0})}runtimeModel(){return this.runtimeModelInternal}cssModel(){return this.target().model(Br)}overlayModel(){return this.target().model(Fs)}static cancelSearch(){for(const e of W.instance().models(Gs))e.cancelSearch()}scheduleMutationEvent(e){this.hasEventListeners(Us.DOMMutated)&&(this.#mi=(this.#mi||0)+1,Promise.resolve().then(function(e,t){if(!this.hasEventListeners(Us.DOMMutated)||this.#mi!==t)return;this.dispatchEventToListeners(Us.DOMMutated,e)}.bind(this,e,this.#mi)))}requestDocument(){return this.#gi?Promise.resolve(this.#gi):(this.#fi||(this.#fi=this.requestDocumentInternal()),this.#fi)}async getOwnerNodeForFrame(e){const t=await this.agent.invoke_getFrameOwner({frameId:e});return t.getError()?null:new js(this.target(),t.backendNodeId)}async requestDocumentInternal(){const e=await this.agent.invoke_getDocument({});if(e.getError())return null;const{root:t}=e;if(this.#fi=null,t&&this.setDocument(t),!this.#gi)return console.error("No document"),null;const n=this.parentModel();if(n&&!this.#bi){await n.requestDocument();const e=this.target().model(ii)?.mainFrame;if(e){const t=await n.agent.invoke_getFrameOwner({frameId:e.id});!t.getError()&&t.nodeId&&(this.#bi=n.nodeForId(t.nodeId))}}if(this.#bi){const e=this.#bi.contentDocument();this.#bi.setContentDocument(this.#gi),this.#bi.setChildren([]),this.#gi?(this.#gi.parentNode=this.#bi,this.dispatchEventToListeners(Us.NodeInserted,this.#gi)):e&&this.dispatchEventToListeners(Us.NodeRemoved,{node:e,parent:this.#bi})}return this.#gi}existingDocument(){return this.#gi}async pushNodeToFrontend(e){await this.requestDocument();const{nodeId:t}=await this.agent.invoke_requestNode({objectId:e});return this.nodeForId(t)}pushNodeByPathToFrontend(e){return this.requestDocument().then((()=>this.agent.invoke_pushNodeByPathToFrontend({path:e}))).then((({nodeId:e})=>e))}async pushNodesByBackendIdsToFrontend(e){await this.requestDocument();const t=[...e],{nodeIds:n}=await this.agent.invoke_pushNodesByBackendIdsToFrontend({backendNodeIds:t});if(!n)return null;const r=new Map;for(let e=0;ethis.#pi.add(e))),this.#yi||(this.#yi=window.setTimeout(this.loadNodeAttributes.bind(this),20))}loadNodeAttributes(){this.#yi=void 0;for(const e of this.#pi)this.agent.invoke_getAttributes({nodeId:e}).then((({attributes:t})=>{if(!t)return;const n=this.idToDOMNode.get(e);n&&n.setAttributesPayload(t)&&(this.dispatchEventToListeners(Us.AttrModified,{node:n,name:"style"}),this.scheduleMutationEvent(n))}));this.#pi.clear()}characterDataModified(e,t){const n=this.idToDOMNode.get(e);n?(n.setNodeValueInternal(t),this.dispatchEventToListeners(Us.CharacterDataModified,n),this.scheduleMutationEvent(n)):console.error("nodeId could not be resolved to a node")}nodeForId(e){return e&&this.idToDOMNode.get(e)||null}documentUpdated(){const e=Boolean(this.#gi);this.setDocument(null),this.parentModel()&&e&&!this.#fi&&this.requestDocument()}setDocument(e){this.idToDOMNode=new Map,this.#gi=e&&"nodeId"in e?new Ws(this,e):null,$s.instance().dispose(this),this.parentModel()||this.dispatchEventToListeners(Us.DocumentUpdated,this)}setDocumentForTest(e){this.setDocument(e)}setDetachedRoot(e){"#document"===e.nodeName?new Ws(this,e):zs.create(this,null,!1,e)}setChildNodes(e,t){if(!e&&t.length)return void this.setDetachedRoot(t[0]);const n=this.idToDOMNode.get(e);n?.setChildrenPayload(t)}childNodeCountUpdated(e,t){const n=this.idToDOMNode.get(e);n?(n.setChildNodeCount(t),this.dispatchEventToListeners(Us.ChildNodeCountUpdated,n),this.scheduleMutationEvent(n)):console.error("nodeId could not be resolved to a node")}childNodeInserted(e,t,n){const r=this.idToDOMNode.get(e),s=this.idToDOMNode.get(t);if(!r)return void console.error("parentId could not be resolved to a node");const i=r.insertChild(s,n);this.idToDOMNode.set(i.id,i),this.dispatchEventToListeners(Us.NodeInserted,i),this.scheduleMutationEvent(i)}childNodeRemoved(e,t){const n=this.idToDOMNode.get(e),r=this.idToDOMNode.get(t);n&&r?(n.removeChild(r),this.unbind(r),this.dispatchEventToListeners(Us.NodeRemoved,{node:r,parent:n}),this.scheduleMutationEvent(r)):console.error("parentId or nodeId could not be resolved to a node")}shadowRootPushed(e,t){const n=this.idToDOMNode.get(e);if(!n)return;const r=zs.create(this,n.ownerDocument,!0,t);r.parentNode=n,this.idToDOMNode.set(r.id,r),n.shadowRootsInternal.unshift(r),this.dispatchEventToListeners(Us.NodeInserted,r),this.scheduleMutationEvent(r)}shadowRootPopped(e,t){const n=this.idToDOMNode.get(e);if(!n)return;const r=this.idToDOMNode.get(t);r&&(n.removeChild(r),this.unbind(r),this.dispatchEventToListeners(Us.NodeRemoved,{node:r,parent:n}),this.scheduleMutationEvent(r))}pseudoElementAdded(e,t){const n=this.idToDOMNode.get(e);if(!n)return;const r=zs.create(this,n.ownerDocument,!1,t);r.parentNode=n,this.idToDOMNode.set(r.id,r);const s=r.pseudoType();if(!s)throw new Error("DOMModel._pseudoElementAdded expects pseudoType to be defined.");const i=n.pseudoElements().get(s);if(i&&i.length>0){if(!s.startsWith("view-transition")&&!s.startsWith("scroll-")&&"column"!==s)throw new Error(`DOMModel.pseudoElementAdded expects parent to not already have this pseudo type added; only view-transition* and scrolling pseudo elements can coexist under the same parent. ${i.length} elements of type ${s} already exist on parent.`);i.push(r)}else n.pseudoElements().set(s,[r]);this.dispatchEventToListeners(Us.NodeInserted,r),this.scheduleMutationEvent(r)}scrollableFlagUpdated(e,t){const n=this.nodeForId(e);n&&n.isScrollable()!==t&&(n.setIsScrollable(t),this.dispatchEventToListeners(Us.ScrollableFlagUpdated,{node:n}))}topLayerElementsUpdated(){this.dispatchEventToListeners(Us.TopLayerElementsChanged)}pseudoElementRemoved(e,t){const n=this.idToDOMNode.get(e);if(!n)return;const r=this.idToDOMNode.get(t);r&&(n.removeChild(r),this.unbind(r),this.dispatchEventToListeners(Us.NodeRemoved,{node:r,parent:n}),this.scheduleMutationEvent(r))}distributedNodesUpdated(e,t){const n=this.idToDOMNode.get(e);n&&(n.setDistributedNodePayloads(t),this.dispatchEventToListeners(Us.DistributedNodesChanged,n),this.scheduleMutationEvent(n))}unbind(e){this.idToDOMNode.delete(e.id);const t=e.children();for(let e=0;t&&ee||[]))}querySelector(e,t){return this.agent.invoke_querySelector({nodeId:e,selector:t}).then((({nodeId:e})=>e))}querySelectorAll(e,t){return this.agent.invoke_querySelectorAll({nodeId:e,selector:t}).then((({nodeIds:e})=>e))}getTopLayerElements(){return this.agent.invoke_getTopLayerElements().then((({nodeIds:e})=>e))}getDetachedDOMNodes(){return this.agent.invoke_getDetachedDomNodes().then((({detachedNodes:e})=>e))}getElementByRelation(e,t){return this.agent.invoke_getElementByRelation({nodeId:e,relation:t}).then((({nodeId:e})=>e))}markUndoableState(e){$s.instance().markUndoableState(this,e||!1)}async nodeForLocation(e,t,n){const r=await this.agent.invoke_getNodeForLocation({x:e,y:t,includeUserAgentShadowDOM:n});return r.getError()||!r.nodeId?null:this.nodeForId(r.nodeId)}async getContainerForNode(e,t,n,r,s){const{nodeId:i}=await this.agent.invoke_getContainerForNode({nodeId:e,containerName:t,physicalAxes:n,logicalAxes:r,queriesScrollState:s});return i?this.nodeForId(i):null}pushObjectAsNodeToFrontend(e){return e.isNode()&&e.objectId?this.pushNodeToFrontend(e.objectId):Promise.resolve(null)}suspendModel(){return this.agent.invoke_disable().then((()=>this.setDocument(null)))}async resumeModel(){await this.agent.invoke_enable({})}dispose(){$s.instance().dispose(this)}parentModel(){const e=this.target().parentTarget();return e?e.model(Gs):null}getAgent(){return this.agent}registerNode(e){this.idToDOMNode.set(e.id,e)}}!function(e){e.AttrModified="AttrModified",e.AttrRemoved="AttrRemoved",e.CharacterDataModified="CharacterDataModified",e.DOMMutated="DOMMutated",e.NodeInserted="NodeInserted",e.NodeRemoved="NodeRemoved",e.DocumentUpdated="DocumentUpdated",e.ChildNodeCountUpdated="ChildNodeCountUpdated",e.DistributedNodesChanged="DistributedNodesChanged",e.MarkersChanged="MarkersChanged",e.TopLayerElementsChanged="TopLayerElementsChanged",e.ScrollableFlagUpdated="ScrollableFlagUpdated"}(Us||(Us={}));class Ks{#er;constructor(e){this.#er=e}documentUpdated(){this.#er.documentUpdated()}attributeModified({nodeId:e,name:t,value:n}){this.#er.attributeModified(e,t,n)}attributeRemoved({nodeId:e,name:t}){this.#er.attributeRemoved(e,t)}inlineStyleInvalidated({nodeIds:e}){this.#er.inlineStyleInvalidated(e)}characterDataModified({nodeId:e,characterData:t}){this.#er.characterDataModified(e,t)}setChildNodes({parentId:e,nodes:t}){this.#er.setChildNodes(e,t)}childNodeCountUpdated({nodeId:e,childNodeCount:t}){this.#er.childNodeCountUpdated(e,t)}childNodeInserted({parentNodeId:e,previousNodeId:t,node:n}){this.#er.childNodeInserted(e,t,n)}childNodeRemoved({parentNodeId:e,nodeId:t}){this.#er.childNodeRemoved(e,t)}shadowRootPushed({hostId:e,root:t}){this.#er.shadowRootPushed(e,t)}shadowRootPopped({hostId:e,rootId:t}){this.#er.shadowRootPopped(e,t)}pseudoElementAdded({parentId:e,pseudoElement:t}){this.#er.pseudoElementAdded(e,t)}pseudoElementRemoved({parentId:e,pseudoElementId:t}){this.#er.pseudoElementRemoved(e,t)}distributedNodesUpdated({insertionPointId:e,distributedNodes:t}){this.#er.distributedNodesUpdated(e,t)}topLayerElementsUpdated(){this.#er.topLayerElementsUpdated()}scrollableFlagUpdated({nodeId:e,isScrollable:t}){this.#er.scrollableFlagUpdated(e,t)}}let Qs=null;class $s{#Lt;#as;#Ii;constructor(){this.#Lt=[],this.#as=0,this.#Ii=null}static instance(e={forceNew:null}){const{forceNew:t}=e;return Qs&&!t||(Qs=new $s),Qs}async markUndoableState(e,t){this.#Ii&&e!==this.#Ii&&(this.#Ii.markUndoableState(),this.#Ii=null),t&&this.#Ii===e||(this.#Lt=this.#Lt.slice(0,this.#as),this.#Lt.push(e),this.#as=this.#Lt.length,t?this.#Ii=e:(await e.getAgent().invoke_markUndoableState(),this.#Ii=null))}async undo(){if(0===this.#as)return await Promise.resolve();--this.#as,this.#Ii=null,await this.#Lt[this.#as].getAgent().invoke_undo()}async redo(){if(this.#as>=this.#Lt.length)return await Promise.resolve();++this.#as,this.#Ii=null,await this.#Lt[this.#as-1].getAgent().invoke_redo()}dispose(e){let t=0;for(let n=0;n(t.ContentData.ContentData.isError(e)||(this.#Ai=e),this.#Oi=null,e)))),await this.#Oi)}canonicalMimeType(){return this.contentType().canonicalMimeType()||this.mimeType}async searchInContent(e,n,r){if(!this.frameId)return[];if(this.request)return await this.request.searchInContent(e,n,r);const s=await this.#rr.target().pageAgent().invoke_searchInResource({frameId:this.frameId,url:this.url,query:e,caseSensitive:n,isRegex:r});return t.TextUtils.performSearchInSearchMatches(s.result||[],e,n,r)}async populateImageSource(e){const n=await this.requestContentData();t.ContentData.ContentData.isError(n)||(e.src=n.asDataUrl()??this.#Si)}async innerRequestContent(){if(this.request)return await this.request.requestContentData();const e=await this.#rr.target().pageAgent().invoke_getResourceContent({frameId:this.frameId,url:this.url}),n=e.getError();return n?{error:n}:new t.ContentData.ContentData(e.content,e.base64Encoded,this.mimeType)}frame(){return this.#Ci?this.#rr.frameForId(this.#Ci):null}statusCode(){return this.#wi?this.#wi.statusCode:0}}var Ys,Zs=Object.freeze({__proto__:null,Resource:Js});class ei extends h{#Di="";#Ni="";#Fi=new Set;constructor(e){super(e)}updateSecurityOrigins(e){const t=this.#Fi;this.#Fi=e;for(const e of t)this.#Fi.has(e)||this.dispatchEventToListeners(Ys.SecurityOriginRemoved,e);for(const e of this.#Fi)t.has(e)||this.dispatchEventToListeners(Ys.SecurityOriginAdded,e)}securityOrigins(){return[...this.#Fi]}mainSecurityOrigin(){return this.#Di}unreachableMainSecurityOrigin(){return this.#Ni}setMainSecurityOrigin(e,t){this.#Di=e,this.#Ni=t||null,this.dispatchEventToListeners(Ys.MainSecurityOriginChanged,{mainSecurityOrigin:this.#Di,unreachableMainSecurityOrigin:this.#Ni})}}!function(e){e.SecurityOriginAdded="SecurityOriginAdded",e.SecurityOriginRemoved="SecurityOriginRemoved",e.MainSecurityOriginChanged="MainSecurityOriginChanged"}(Ys||(Ys={})),h.register(ei,{capabilities:0,autostart:!1});var ti=Object.freeze({__proto__:null,get Events(){return Ys},SecurityOriginManager:ei});class ni extends h{#Bi;#_i;constructor(e){super(e),this.#Bi="",this.#_i=new Set}updateStorageKeys(e){const t=this.#_i;this.#_i=e;for(const e of t)this.#_i.has(e)||this.dispatchEventToListeners("StorageKeyRemoved",e);for(const e of this.#_i)t.has(e)||this.dispatchEventToListeners("StorageKeyAdded",e)}storageKeys(){return[...this.#_i]}mainStorageKey(){return this.#Bi}setMainStorageKey(e){this.#Bi=e,this.dispatchEventToListeners("MainStorageKeyChanged",{mainStorageKey:this.#Bi})}}h.register(ni,{capabilities:0,autostart:!1});var ri,si=Object.freeze({__proto__:null,StorageKeyManager:ni,parseStorageKey:function(t){const n=t.split("^"),r={origin:e.ParsedURL.ParsedURL.extractOrigin(n[0]),components:new Map};for(let e=1;e{this.processCachedResources(e.getError()?null:e.frameTree),this.mainFrame&&this.processPendingEvents(this.mainFrame)}))}static frameForRequest(e){const t=Z.forRequest(e),n=t?t.target().model(ii):null;return n&&e.frameId?n.frameForId(e.frameId):null}static frames(){const e=[];for(const t of W.instance().models(ii))e.push(...t.frames());return e}static resourceForURL(e){for(const t of W.instance().models(ii)){const n=t.mainFrame,r=n?n.resourceForURL(e):null;if(r)return r}return null}static reloadAllPages(e,t){for(const n of W.instance().models(ii))n.target().parentTarget()?.type()!==U.FRAME&&n.reloadPage(e,t)}async storageKeyForFrame(e){if(!this.framesInternal.has(e))return null;const t=await this.storageAgent.invoke_getStorageKeyForFrame({frameId:e});return"Frame tree node for given frame not found"===t.getError()?null:t.storageKey}domModel(){return this.target().model(Gs)}processCachedResources(e){e&&":"!==e.frame.url&&(this.dispatchEventToListeners(ri.WillLoadCachedResources),this.addFramesRecursively(null,e),this.target().setInspectedURL(e.frame.url)),this.#qi=!0;const t=this.target().model(Jr);t&&(t.setExecutionContextComparator(this.executionContextComparator.bind(this)),t.fireExecutionContextOrderChanged()),this.dispatchEventToListeners(ri.CachedResourcesLoaded,this)}cachedResourcesLoaded(){return this.#qi}addFrame(e,t){this.framesInternal.set(e.id,e),e.isMainFrame()&&(this.mainFrame=e),this.dispatchEventToListeners(ri.FrameAdded,e),this.updateSecurityOrigins(),this.updateStorageKeys()}frameAttached(e,t,n){const r=t&&this.framesInternal.get(t)||null;if(!this.#qi&&r)return null;if(this.framesInternal.has(e))return null;const s=new oi(this,r,e,null,n||null);return t&&!r&&(s.crossTargetParentFrameId=t),s.isMainFrame()&&this.mainFrame&&this.frameDetached(this.mainFrame.id,!1),this.addFrame(s,!0),s}frameNavigated(e,t){const n=e.parentId&&this.framesInternal.get(e.parentId)||null;if(!this.#qi&&n)return;let r=this.framesInternal.get(e.id)||null;if(!r&&(r=this.frameAttached(e.id,e.parentId||null),console.assert(Boolean(r)),!r))return;this.dispatchEventToListeners(ri.FrameWillNavigate,r),r.navigate(e),t&&(r.backForwardCacheDetails.restoredFromCache="BackForwardCacheRestore"===t),r.isMainFrame()&&this.target().setInspectedURL(r.url),this.dispatchEventToListeners(ri.FrameNavigated,r),r.isPrimaryFrame()&&this.primaryPageChanged(r,"Navigation");const s=r.resources();for(let e=0;e=0,"Unbalanced call to ResourceTreeModel.resumeReload()"),!this.#ji&&this.#zi){const{ignoreCache:e,scriptToEvaluateOnLoad:t}=this.#zi;this.reloadPage(e,t)}}reloadPage(e,t){const n=this.mainFrame?.loaderId;if(!n)return;if(this.#zi||this.dispatchEventToListeners(ri.PageReloadRequested,this),this.#ji)return void(this.#zi={ignoreCache:e,scriptToEvaluateOnLoad:t});this.#zi=null;const r=this.target().model(Z);r&&r.clearRequests(),this.dispatchEventToListeners(ri.WillReloadPage),this.agent.invoke_reload({ignoreCache:e,scriptToEvaluateOnLoad:t,loaderId:n})}navigate(e){return this.agent.invoke_navigate({url:e})}async navigationHistory(){const e=await this.agent.invoke_getNavigationHistory();return e.getError()?null:{currentIndex:e.currentIndex,entries:e.entries}}navigateToHistoryEntry(e){this.agent.invoke_navigateToHistoryEntry({entryId:e.id})}setLifecycleEventsEnabled(e){return this.agent.invoke_setLifecycleEventsEnabled({enabled:e})}async fetchAppManifest(){const e=await this.agent.invoke_getAppManifest({});return e.getError()?{url:e.url,data:null,errors:[]}:{url:e.url,data:e.data||null,errors:e.errors}}async getInstallabilityErrors(){return(await this.agent.invoke_getInstallabilityErrors()).installabilityErrors||[]}async getAppId(){return await this.agent.invoke_getAppId()}executionContextComparator(e,t){function n(e){let t=e;const n=[];for(;t;)n.push(t),t=t.sameTargetParentFrame();return n.reverse()}if(e.target()!==t.target())return Zr.comparator(e,t);const r=e.frameId?n(this.frameForId(e.frameId)):[],s=t.frameId?n(this.frameForId(t.frameId)):[];let i,o;for(let e=0;;e++)if(!r[e]||!s[e]||r[e]!==s[e]){i=r[e],o=s[e];break}return!i&&o?-1:!o&&i?1:i&&o?i.id.localeCompare(o.id):Zr.comparator(e,t)}getSecurityOriginData(){const t=new Set;let n=null,r=null;for(const s of this.framesInternal.values()){const i=s.securityOrigin;if(i&&(t.add(i),s.isMainFrame()&&(n=i,s.unreachableUrl()))){r=new e.ParsedURL.ParsedURL(s.unreachableUrl()).securityOrigin()}}return{securityOrigins:t,mainSecurityOrigin:n,unreachableMainSecurityOrigin:r}}async getStorageKeyData(){const e=new Set;let t=null;for(const{isMainFrame:n,storageKey:r}of await Promise.all([...this.framesInternal.values()].map((e=>e.getStorageKey(!1).then((t=>({isMainFrame:e.isMainFrame(),storageKey:t})))))))n&&(t=r),r&&e.add(r);return{storageKeys:e,mainStorageKey:t}}updateSecurityOrigins(){const e=this.getSecurityOriginData();this.#Hi.setMainSecurityOrigin(e.mainSecurityOrigin||"",e.unreachableMainSecurityOrigin||""),this.#Hi.updateSecurityOrigins(e.securityOrigins)}async updateStorageKeys(){const e=await this.getStorageKeyData();this.#Ui.setMainStorageKey(e.mainStorageKey||""),this.#Ui.updateStorageKeys(e.storageKeys)}async getMainStorageKey(){return this.mainFrame?await this.mainFrame.getStorageKey(!1):null}getMainSecurityOrigin(){const e=this.getSecurityOriginData();return e.mainSecurityOrigin||e.unreachableMainSecurityOrigin}onBackForwardCacheNotUsed(e){this.mainFrame&&this.mainFrame.id===e.frameId&&this.mainFrame.loaderId===e.loaderId?(this.mainFrame.setBackForwardCacheDetails(e),this.dispatchEventToListeners(ri.BackForwardCacheDetailsUpdated,this.mainFrame)):this.#Vi.add(e)}processPendingEvents(e){if(e.isMainFrame())for(const t of this.#Vi)if(e.id===t.frameId&&e.loaderId===t.loaderId){e.setBackForwardCacheDetails(t),this.#Vi.delete(t);break}}}!function(e){e.FrameAdded="FrameAdded",e.FrameNavigated="FrameNavigated",e.FrameDetached="FrameDetached",e.FrameResized="FrameResized",e.FrameWillNavigate="FrameWillNavigate",e.PrimaryPageChanged="PrimaryPageChanged",e.ResourceAdded="ResourceAdded",e.WillLoadCachedResources="WillLoadCachedResources",e.CachedResourcesLoaded="CachedResourcesLoaded",e.DOMContentLoaded="DOMContentLoaded",e.LifecycleEvent="LifecycleEvent",e.Load="Load",e.PageReloadRequested="PageReloadRequested",e.WillReloadPage="WillReloadPage",e.InterstitialShown="InterstitialShown",e.InterstitialHidden="InterstitialHidden",e.BackForwardCacheDetailsUpdated="BackForwardCacheDetailsUpdated",e.JavaScriptDialogOpening="JavaScriptDialogOpening"}(ri||(ri={}));class oi{#ls;#Gi;#C;crossTargetParentFrameId=null;#xi;#h;#Si;#Ki;#Qi;#$i;#Xi;#Ji;#Yi;#Zi;#eo;#to;#no;#ro=null;#so=new Set;resourcesMap=new Map;backForwardCacheDetails={restoredFromCache:void 0,explanations:[],explanationsTree:void 0};constructor(e,t,n,s,i){this.#ls=e,this.#Gi=t,this.#C=n,this.#xi=s?.loaderId??"",this.#h=s?.name,this.#Si=s&&s.url||r.DevToolsPath.EmptyUrlString,this.#Ki=s?.domainAndRegistry||"",this.#Qi=s?.securityOrigin??null,this.#$i=s?.securityOriginDetails,this.#Ji=s&&s.unreachableUrl||r.DevToolsPath.EmptyUrlString,this.#Yi=s?.adFrameStatus,this.#Zi=s?.secureContextType??null,this.#eo=s?.crossOriginIsolatedContextType??null,this.#to=s?.gatedAPIFeatures??null,this.#no=i,this.#Gi&&this.#Gi.#so.add(this)}isSecureContext(){return null!==this.#Zi&&this.#Zi.startsWith("Secure")}getSecureContextType(){return this.#Zi}isCrossOriginIsolated(){return null!==this.#eo&&this.#eo.startsWith("Isolated")}getCrossOriginIsolatedContextType(){return this.#eo}getGatedAPIFeatures(){return this.#to}getCreationStackTraceData(){return{creationStackTrace:this.#no,creationStackTraceTarget:this.#ro||this.resourceTreeModel().target()}}navigate(e){this.#xi=e.loaderId,this.#h=e.name,this.#Si=e.url,this.#Ki=e.domainAndRegistry,this.#Qi=e.securityOrigin,this.#$i=e.securityOriginDetails,this.getStorageKey(!0),this.#Ji=e.unreachableUrl||r.DevToolsPath.EmptyUrlString,this.#Yi=e?.adFrameStatus,this.#Zi=e.secureContextType,this.#eo=e.crossOriginIsolatedContextType,this.#to=e.gatedAPIFeatures,this.backForwardCacheDetails={restoredFromCache:void 0,explanations:[],explanationsTree:void 0};const t=this.resourcesMap.get(this.#Si);this.resourcesMap.clear(),this.removeChildFrames(),t&&t.loaderId===this.#xi&&this.addResource(t)}resourceTreeModel(){return this.#ls}get id(){return this.#C}get name(){return this.#h||""}get url(){return this.#Si}domainAndRegistry(){return this.#Ki}async getAdScriptId(e){return(await this.#ls.agent.invoke_getAdScriptId({frameId:e})).adScriptId||null}get securityOrigin(){return this.#Qi}get securityOriginDetails(){return this.#$i??null}getStorageKey(e){return this.#Xi&&!e||(this.#Xi=this.#ls.storageKeyForFrame(this.#C)),this.#Xi}unreachableUrl(){return this.#Ji}get loaderId(){return this.#xi}adFrameType(){return this.#Yi?.adFrameType||"none"}adFrameStatus(){return this.#Yi}get childFrames(){return[...this.#so]}sameTargetParentFrame(){return this.#Gi}crossTargetParentFrame(){if(!this.crossTargetParentFrameId)return null;const e=this.#ls.target().parentTarget();if(e?.type()!==U.FRAME)return null;const t=e.model(ii);return t&&t.framesInternal.get(this.crossTargetParentFrameId)||null}parentFrame(){return this.sameTargetParentFrame()||this.crossTargetParentFrame()}isMainFrame(){return!this.#Gi}isOutermostFrame(){return this.#ls.target().parentTarget()?.type()!==U.FRAME&&!this.#Gi&&!this.crossTargetParentFrameId}isPrimaryFrame(){return!this.#Gi&&this.#ls.target()===W.instance().primaryPageTarget()}removeChildFrame(e,t){this.#so.delete(e),e.remove(t)}removeChildFrames(){const e=this.#so;this.#so=new Set;for(const t of e)t.remove(!1)}remove(e){this.removeChildFrames(),this.#ls.framesInternal.delete(this.id),this.#ls.dispatchEventToListeners(ri.FrameDetached,{frame:this,isSwap:e})}addResource(e){this.resourcesMap.get(e.url)!==e&&(this.resourcesMap.set(e.url,e),this.#ls.dispatchEventToListeners(ri.ResourceAdded,e))}addRequest(e){let t=this.resourcesMap.get(e.url());t&&t.request===e||(t=new Js(this.#ls,e,e.url(),e.documentURL,e.frameId,e.loaderId,e.resourceType(),e.mimeType,null,null),this.resourcesMap.set(t.url,t),this.#ls.dispatchEventToListeners(ri.ResourceAdded,t))}resources(){return Array.from(this.resourcesMap.values())}resourceForURL(e){const t=this.resourcesMap.get(e);if(t)return t;for(const t of this.#so){const n=t.resourceForURL(e);if(n)return n}return null}callForFrameResources(e){for(const t of this.resourcesMap.values())if(e(t))return!0;for(const t of this.#so)if(t.callForFrameResources(e))return!0;return!1}displayName(){if(this.isOutermostFrame())return n.i18n.lockedString("top");const t=new e.ParsedURL.ParsedURL(this.#Si).displayName;return t?this.#h?this.#h+" ("+t+")":t:n.i18n.lockedString("iframe")}async getOwnerDeferredDOMNode(){const e=this.parentFrame();return e?await e.resourceTreeModel().domModel().getOwnerNodeForFrame(this.#C):null}async getOwnerDOMNodeOrDocument(){const e=await this.getOwnerDeferredDOMNode();return e?await e.resolvePromise():this.isOutermostFrame()?await this.resourceTreeModel().domModel().requestDocument():null}async highlight(){const e=this.parentFrame(),t=this.resourceTreeModel().target().parentTarget(),n=async e=>{const t=await e.getOwnerNodeForFrame(this.#C);t&&e.overlayModel().highlightInOverlay({deferredNode:t,selectorList:""},"all",!0)};if(e)return await n(e.resourceTreeModel().domModel());if(t?.type()===U.FRAME){const e=t.model(Gs);if(e)return await n(e)}const r=await this.resourceTreeModel().domModel().requestDocument();r&&this.resourceTreeModel().domModel().overlayModel().highlightInOverlay({node:r,selectorList:""},"all",!0)}async getPermissionsPolicyState(){const e=await this.resourceTreeModel().target().pageAgent().invoke_getPermissionsPolicyState({frameId:this.#C});return e.getError()?null:e.states}async getOriginTrials(){const e=await this.resourceTreeModel().target().pageAgent().invoke_getOriginTrials({frameId:this.#C});return e.getError()?[]:e.originTrials}setCreationStackTrace(e){this.#no=e.creationStackTrace,this.#ro=e.creationStackTraceTarget}setBackForwardCacheDetails(e){this.backForwardCacheDetails.restoredFromCache=!1,this.backForwardCacheDetails.explanations=e.notRestoredExplanations,this.backForwardCacheDetails.explanationsTree=e.notRestoredExplanationsTree}getResourcesMap(){return this.resourcesMap}}class ai{#rr;constructor(e){this.#rr=e}backForwardCacheNotUsed(e){this.#rr.onBackForwardCacheNotUsed(e)}domContentEventFired({timestamp:e}){this.#rr.dispatchEventToListeners(ri.DOMContentLoaded,e)}loadEventFired({timestamp:e}){this.#rr.dispatchEventToListeners(ri.Load,{resourceTreeModel:this.#rr,loadTime:e})}lifecycleEvent({frameId:e,name:t}){this.#rr.dispatchEventToListeners(ri.LifecycleEvent,{frameId:e,name:t})}frameAttached({frameId:e,parentFrameId:t,stack:n}){this.#rr.frameAttached(e,t,n)}frameNavigated({frame:e,type:t}){this.#rr.frameNavigated(e,t)}documentOpened({frame:e}){this.#rr.documentOpened(e)}frameDetached({frameId:e,reason:t}){this.#rr.frameDetached(e,"swap"===t)}frameSubtreeWillBeDetached(e){}frameStartedLoading({}){}frameStoppedLoading({}){}frameRequestedNavigation({}){}frameScheduledNavigation({}){}frameClearedScheduledNavigation({}){}frameStartedNavigating({}){}navigatedWithinDocument({}){}frameResized(){this.#rr.dispatchEventToListeners(ri.FrameResized)}javascriptDialogOpening(e){this.#rr.dispatchEventToListeners(ri.JavaScriptDialogOpening,e),e.hasBrowserHandler||this.#rr.agent.invoke_handleJavaScriptDialog({accept:!1})}javascriptDialogClosed({}){}screencastFrame({}){}screencastVisibilityChanged({}){}interstitialShown(){this.#rr.isInterstitialShowing=!0,this.#rr.dispatchEventToListeners(ri.InterstitialShown)}interstitialHidden(){this.#rr.isInterstitialShowing=!1,this.#rr.dispatchEventToListeners(ri.InterstitialHidden)}windowOpen({}){}compilationCacheProduced({}){}fileChooserOpened({}){}downloadWillBegin({}){}downloadProgress(){}}h.register(ii,{capabilities:2,autostart:!0,early:!0});var li=Object.freeze({__proto__:null,get Events(){return ri},PageDispatcher:ai,ResourceTreeFrame:oi,ResourceTreeModel:ii});class di extends h{#io=new Map;#oo=new Map;#ao=new e.Throttler.Throttler(300);#lo=new Map;constructor(e){super(e),e.model(ii)?.addEventListener(ri.PrimaryPageChanged,this.#do,this),e.model(Z)?.addEventListener(ee.ResponseReceived,this.#co,this),e.model(Z)?.addEventListener(ee.LoadingFinished,this.#ho,this)}addBlockedCookie(e,t){const n=e.key(),r=this.#io.get(n);this.#io.set(n,e),t?this.#oo.set(e,t):this.#oo.delete(e),r&&this.#oo.delete(r)}removeBlockedCookie(e){this.#io.delete(e.key())}async#do(){this.#io.clear(),this.#oo.clear(),await this.#uo()}getCookieToBlockedReasonsMap(){return this.#oo}async#go(e){const t=this.target().networkAgent(),n=new Map(await Promise.all(e.keysArray().map((n=>t.invoke_getCookies({urls:[...e.get(n).values()]}).then((({cookies:e})=>[n,e.map(H.fromProtocolCookie)])))))),r=this.#po(n);this.#lo=n,r&&this.dispatchEventToListeners("CookieListUpdated")}async deleteCookie(e){await this.deleteCookies([e])}async clear(e,t){this.#mo()||await this.#fo();const n=e?this.#lo.get(e)||[]:[...this.#lo.values()].flat();if(n.push(...this.#io.values()),t){const e=n.filter((e=>e.matchesSecurityOrigin(t)));await this.deleteCookies(e)}else await this.deleteCookies(n)}async saveCookie(e){let t,n=e.domain();n.startsWith(".")||(n=""),e.expires()&&(t=Math.floor(Date.parse(`${e.expires()}`)/1e3));const r=o.Runtime.experiments.isEnabled("experimental-cookie-features"),s={name:e.name(),value:e.value(),url:e.url()||void 0,domain:n,path:e.path(),secure:e.secure(),httpOnly:e.httpOnly(),sameSite:e.sameSite(),expires:t,priority:e.priority(),partitionKey:e.partitionKey(),sourceScheme:r?e.sourceScheme():(i=e.sourceScheme(),"Unset"===i?i:void 0),sourcePort:r?e.sourcePort():void 0};var i;const a=await this.target().networkAgent().invoke_setCookie(s);return!(a.getError()||!a.success)&&(await this.#fo(),a.success)}async getCookiesForDomain(e,t){this.#mo()&&!t||await this.#fo();return(this.#lo.get(e)||[]).concat(Array.from(this.#io.values()))}async deleteCookies(e){const t=this.target().networkAgent();this.#io.clear(),this.#oo.clear(),await Promise.all(e.map((e=>t.invoke_deleteCookies({name:e.name(),url:void 0,domain:e.domain(),path:e.path(),partitionKey:e.partitionKey()})))),await this.#fo()}#mo(){return Boolean(this.listeners?.size)}#po(e){if(e.size!==this.#lo.size)return!0;for(const[t,n]of e){if(!this.#lo.has(t))return!0;const e=this.#lo.get(t)||[];if(n.length!==e.length)return!0;const r=e=>e.key()+" "+e.value(),s=new Set(e.map(r));for(const e of n)if(!s.has(r(e)))return!0}return!1}#fo(){return this.#ao.schedule((()=>this.#uo()))}#uo(){const t=new r.MapUtilities.Multimap;const n=this.target().model(ii);if(n){const r=n.mainFrame?.unreachableUrl();if(r){const n=e.ParsedURL.ParsedURL.fromString(r);n&&t.set(n.securityOrigin(),r)}n.forAllResources((function(n){const r=e.ParsedURL.ParsedURL.fromString(n.documentURL);return r&&t.set(r.securityOrigin(),n.url),!1}))}return this.#go(t)}#co(){this.#mo()&&this.#fo()}#ho(){this.#mo()&&this.#fo()}}h.register(di,{capabilities:16,autostart:!1});var ci=Object.freeze({__proto__:null,CookieModel:di});class hi{#bo;#yo;#vo;#Io;#wo;#So;#ko;constructor(e){e&&(this.#bo=e.toLowerCase().replace(/^\./,"")),this.#yo=[],this.#Io=0}static parseSetCookie(e,t){return new hi(t).parseSetCookie(e)}getCookieAttribute(e){if(!e)return null;switch(e.toLowerCase()){case"domain":return"domain";case"expires":return"expires";case"max-age":return"max-age";case"httponly":return"http-only";case"name":return"name";case"path":return"path";case"samesite":return"same-site";case"secure":return"secure";case"value":return"value";case"priority":return"priority";case"sourceport":return"source-port";case"sourcescheme":return"source-scheme";case"partitioned":return"partitioned";default:return console.error("Failed getting cookie attribute: "+e),null}}cookies(){return this.#yo}parseSetCookie(e){if(!this.initialize(e))return null;for(let e=this.extractKeyValue();e;e=this.extractKeyValue())this.#wo?this.#wo.addAttribute(this.getCookieAttribute(e.key),e.value):this.addCookie(e,1),this.advanceAndCheckCookieDelimiter()&&this.flushCookie();return this.flushCookie(),this.#yo}initialize(e){return this.#vo=e,"string"==typeof e&&(this.#yo=[],this.#wo=null,this.#So="",this.#Io=this.#vo.length,!0)}flushCookie(){this.#wo&&(this.#wo.setSize(this.#Io-this.#vo.length-this.#ko),this.#wo.setCookieLine(this.#So.replace("\n",""))),this.#wo=null,this.#So=""}extractKeyValue(){if(!this.#vo||!this.#vo.length)return null;const e=/^[ \t]*([^=;\n]+)[ \t]*(?:=[ \t]*([^;\n]*))?/.exec(this.#vo);if(!e)return console.error("Failed parsing cookie header before: "+this.#vo),null;const t=new ui(e[1]?.trim(),e[2]?.trim(),this.#Io-this.#vo.length);return this.#So+=e[0],this.#vo=this.#vo.slice(e[0].length),t}advanceAndCheckCookieDelimiter(){if(!this.#vo)return!1;const e=/^\s*[\n;]\s*/.exec(this.#vo);return!!e&&(this.#So+=e[0],this.#vo=this.#vo.slice(e[0].length),null!==e[0].match("\n"))}addCookie(e,t){this.#wo&&this.#wo.setSize(e.position-this.#ko),this.#wo="string"==typeof e.value?new H(e.key,e.value,t):new H("",e.key,t),this.#bo&&this.#wo.addAttribute("domain",this.#bo),this.#ko=e.position,this.#yo.push(this.#wo)}}class ui{key;value;position;constructor(e,t,n){this.key=e,this.value=t,this.position=n}}var gi=Object.freeze({__proto__:null,CookieParser:hi});class pi{#Co;#xo;#Ro=!1;#To="";#Mo="";#Po="";#Eo="";constructor(e,t){this.#Co=e,this.#xo=new mi(this.#Lo.bind(this),t)}async addBase64Chunk(e){await this.#xo.addBase64Chunk(e)}#Lo(e){let t=0;for(let n=0;n0){const e=this.#Po.slice(0,-1);this.#Co(this.#Eo||"message",e,this.#Mo),this.#Po=""}return void(this.#Eo="")}let e,t=this.#To.indexOf(":");t<0?(t=this.#To.length,e=t):(e=t+1,ee.codePointAt(0)));await this.#Oo.ready,await this.#Oo.write(n)}}var fi=Object.freeze({__proto__:null,ServerSentEventsParser:pi});class bi{#Do;#No;#Fo=0;#Bo=[];constructor(e,n){this.#Do=e,n&&(this.#Fo=e.pseudoWallTime(e.startTime),this.#No=new pi(this.#_o.bind(this),e.charset()??void 0),this.#Do.requestStreamingContent().then((n=>{t.StreamingContentData.isError(n)||(this.#No?.addBase64Chunk(n.content().base64),n.addEventListener("ChunkAdded",(({data:{chunk:t}})=>{this.#Fo=e.pseudoWallTime(e.endTime),this.#No?.addBase64Chunk(t)})))})))}get eventSourceMessages(){return this.#Bo}onProtocolEventSourceMessageReceived(e,t,n,r){this.#Ho({eventName:e,eventId:n,data:t,time:r})}#_o(e,t,n){this.#Ho({eventName:e,eventId:n,data:t,time:this.#Fo})}#Ho(e){this.#Bo.push(e),this.#Do.dispatchEventToListeners(Ti.EVENT_SOURCE_MESSAGE_ADDED,e)}}const yi={deprecatedSyntaxFoundPleaseUse:"Deprecated syntax found. Please use: ;dur=;desc=",duplicateParameterSIgnored:'Duplicate parameter "{PH1}" ignored.',noValueFoundForParameterS:'No value found for parameter "{PH1}".',unrecognizedParameterS:'Unrecognized parameter "{PH1}".',extraneousTrailingCharacters:"Extraneous trailing characters.",unableToParseSValueS:'Unable to parse "{PH1}" value "{PH2}".'},vi=n.i18n.registerUIStrings("core/sdk/ServerTiming.ts",yi),Ii=n.i18n.getLocalizedString.bind(void 0,vi);class wi{metric;value;description;constructor(e,t,n){this.metric=e,this.value=t,this.description=n}static parseHeaders(e){const t=e.filter((e=>"server-timing"===e.name.toLowerCase()));if(!t.length)return null;const n=t.reduce(((e,t)=>{const n=this.createFromHeaderValue(t.value);return e.push(...n.map((function(e){return new wi(e.name,e.hasOwnProperty("dur")?e.dur:null,e.hasOwnProperty("desc")?e.desc:"")}))),e}),[]);return n.sort(((e,t)=>r.StringUtilities.compare(e.metric.toLowerCase(),t.metric.toLowerCase()))),n}static createFromHeaderValue(e){function t(){e=e.replace(/^\s*/,"")}function n(n){return console.assert(1===n.length),t(),e.charAt(0)===n&&(e=e.substring(1),!0)}function r(){const t=/^(?:\s*)([\w!#$%&'*+\-.^`|~]+)(?:\s*)(.*)/.exec(e);return t?(e=t[2],t[1]):null}function s(){return t(),'"'===e.charAt(0)?function(){console.assert('"'===e.charAt(0)),e=e.substring(1);let t="";for(;e.length;){const n=/^([^"\\]*)(.*)/.exec(e);if(!n)return null;if(t+=n[1],'"'===n[2].charAt(0))return e=n[2].substring(1),t;console.assert("\\"===n[2].charAt(0)),t+=n[2].charAt(1),e=n[2].substring(2)}return null}():r()}function i(){const t=/([,;].*)/.exec(e);t&&(e=t[1])}const o=[];let a;for(;null!==(a=r());){const t={name:a};for("="===e.charAt(0)&&this.showWarning(Ii(yi.deprecatedSyntaxFoundPleaseUse));n(";");){let e;if(null===(e=r()))continue;e=e.toLowerCase();const o=this.getParserForParameter(e);let a=null;if(n("=")&&(a=s(),i()),o){if(t.hasOwnProperty(e)){this.showWarning(Ii(yi.duplicateParameterSIgnored,{PH1:e}));continue}null===a&&this.showWarning(Ii(yi.noValueFoundForParameterS,{PH1:e})),o.call(this,t,a)}else this.showWarning(Ii(yi.unrecognizedParameterS,{PH1:e}))}if(o.push(t),!n(","))break}return e.length&&this.showWarning(Ii(yi.extraneousTrailingCharacters)),o}static getParserForParameter(e){switch(e){case"dur":{function t(t,n){if(t.dur=0,null!==n){const r=parseFloat(n);if(isNaN(r))return void wi.showWarning(Ii(yi.unableToParseSValueS,{PH1:e,PH2:n}));t.dur=r}}return t}case"desc":{function n(e,t){e.desc=t||""}return n}default:return null}}static showWarning(t){e.Console.Console.instance().warn(`ServerTiming: ${t}`)}}var Si=Object.freeze({__proto__:null,ServerTiming:wi});const ki={binary:"(binary)",secureOnly:'This cookie was blocked because it had the "`Secure`" attribute and the connection was not secure.',notOnPath:"This cookie was blocked because its path was not an exact match for or a superdirectory of the request url's path.",domainMismatch:"This cookie was blocked because neither did the request URL's domain exactly match the cookie's domain, nor was the request URL's domain a subdomain of the cookie's Domain attribute value.",sameSiteStrict:'This cookie was blocked because it had the "`SameSite=Strict`" attribute and the request was made from a different site. This includes top-level navigation requests initiated by other sites.',sameSiteLax:'This cookie was blocked because it had the "`SameSite=Lax`" attribute and the request was made from a different site and was not initiated by a top-level navigation.',sameSiteUnspecifiedTreatedAsLax:'This cookie didn\'t specify a "`SameSite`" attribute when it was stored and was defaulted to "SameSite=Lax," and was blocked because the request was made from a different site and was not initiated by a top-level navigation. The cookie had to have been set with "`SameSite=None`" to enable cross-site usage.',sameSiteNoneInsecure:'This cookie was blocked because it had the "`SameSite=None`" attribute but was not marked "Secure". Cookies without SameSite restrictions must be marked "Secure" and sent over a secure connection.',userPreferences:"This cookie was blocked due to user preferences.",thirdPartyPhaseout:"This cookie was blocked either because of Chrome flags or browser configuration. Learn more in the Issues panel.",unknownError:"An unknown error was encountered when trying to send this cookie.",schemefulSameSiteStrict:'This cookie was blocked because it had the "`SameSite=Strict`" attribute but the request was cross-site. This includes top-level navigation requests initiated by other sites. This request is considered cross-site because the URL has a different scheme than the current site.',schemefulSameSiteLax:'This cookie was blocked because it had the "`SameSite=Lax`" attribute but the request was cross-site and was not initiated by a top-level navigation. This request is considered cross-site because the URL has a different scheme than the current site.',schemefulSameSiteUnspecifiedTreatedAsLax:'This cookie didn\'t specify a "`SameSite`" attribute when it was stored, was defaulted to "`SameSite=Lax"`, and was blocked because the request was cross-site and was not initiated by a top-level navigation. This request is considered cross-site because the URL has a different scheme than the current site.',samePartyFromCrossPartyContext:"This cookie was blocked because it had the \"`SameParty`\" attribute but the request was cross-party. The request was considered cross-party because the domain of the resource's URL and the domains of the resource's enclosing frames/documents are neither owners nor members in the same First-Party Set.",nameValuePairExceedsMaxSize:"This cookie was blocked because it was too large. The combined size of the name and value must be less than or equal to 4096 characters.",thisSetcookieWasBlockedDueToUser:"This attempt to set a cookie via a `Set-Cookie` header was blocked due to user preferences.",thisSetcookieWasBlockedDueThirdPartyPhaseout:"Setting this cookie was blocked either because of Chrome flags or browser configuration. Learn more in the Issues panel.",thisSetcookieHadInvalidSyntax:"This `Set-Cookie` header had invalid syntax.",thisSetcookieHadADisallowedCharacter:"This `Set-Cookie` header contained a disallowed character (a forbidden ASCII control character, or the tab character if it appears in the middle of the cookie name, value, an attribute name, or an attribute value).",theSchemeOfThisConnectionIsNot:"The scheme of this connection is not allowed to store cookies.",anUnknownErrorWasEncounteredWhenTrying:"An unknown error was encountered when trying to store this cookie.",thisSetcookieWasBlockedBecauseItHadTheSamesiteStrictLax:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "{PH1}" attribute but came from a cross-site response which was not the response to a top-level navigation. This response is considered cross-site because the URL has a different scheme than the current site.',thisSetcookieDidntSpecifyASamesite:'This `Set-Cookie` header didn\'t specify a "`SameSite`" attribute, was defaulted to "`SameSite=Lax"`, and was blocked because it came from a cross-site response which was not the response to a top-level navigation. This response is considered cross-site because the URL has a different scheme than the current site.',thisSetcookieWasBlockedBecauseItHadTheSameparty:"This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the \"`SameParty`\" attribute but the request was cross-party. The request was considered cross-party because the domain of the resource's URL and the domains of the resource's enclosing frames/documents are neither owners nor members in the same First-Party Set.",thisSetcookieWasBlockedBecauseItHadTheSamepartyAttribute:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "`SameParty`" attribute but also had other conflicting attributes. Chrome requires cookies that use the "`SameParty`" attribute to also have the "Secure" attribute, and to not be restricted to "`SameSite=Strict`".',blockedReasonSecureOnly:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "Secure" attribute but was not received over a secure connection.',blockedReasonSameSiteStrictLax:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "{PH1}" attribute but came from a cross-site response which was not the response to a top-level navigation.',blockedReasonSameSiteUnspecifiedTreatedAsLax:'This `Set-Cookie` header didn\'t specify a "`SameSite`" attribute and was defaulted to "`SameSite=Lax,`" and was blocked because it came from a cross-site response which was not the response to a top-level navigation. The `Set-Cookie` had to have been set with "`SameSite=None`" to enable cross-site usage.',blockedReasonSameSiteNoneInsecure:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it had the "`SameSite=None`" attribute but did not have the "Secure" attribute, which is required in order to use "`SameSite=None`".',blockedReasonOverwriteSecure:"This attempt to set a cookie via a `Set-Cookie` header was blocked because it was not sent over a secure connection and would have overwritten a cookie with the Secure attribute.",blockedReasonInvalidDomain:"This attempt to set a cookie via a `Set-Cookie` header was blocked because its Domain attribute was invalid with regards to the current host url.",blockedReasonInvalidPrefix:'This attempt to set a cookie via a `Set-Cookie` header was blocked because it used the "`__Secure-`" or "`__Host-`" prefix in its name and broke the additional rules applied to cookies with these prefixes as defined in `https://tools.ietf.org/html/draft-west-cookie-prefixes-05`.',thisSetcookieWasBlockedBecauseTheNameValuePairExceedsMaxSize:"This attempt to set a cookie via a `Set-Cookie` header was blocked because the cookie was too large. The combined size of the name and value must be less than or equal to 4096 characters.",setcookieHeaderIsIgnoredIn:"Set-Cookie header is ignored in response from url: {PH1}. The combined size of the name and value must be less than or equal to 4096 characters.",exemptionReasonUserSetting:"This cookie is allowed by user preference.",exemptionReasonTPCDMetadata:"This cookie is allowed by a third-party cookie deprecation trial grace period. Learn more: goo.gle/dt-grace.",exemptionReasonTPCDDeprecationTrial:"This cookie is allowed by third-party cookie deprecation trial. Learn more: goo.gle/ps-dt.",exemptionReasonTopLevelTPCDDeprecationTrial:"This cookie is allowed by top-level third-party cookie deprecation trial. Learn more: goo.gle/ps-dt.",exemptionReasonTPCDHeuristics:"This cookie is allowed by third-party cookie heuristics. Learn more: goo.gle/hbe",exemptionReasonEnterprisePolicy:"This cookie is allowed by Chrome Enterprise policy. Learn more: goo.gle/ce-3pc",exemptionReasonStorageAccessAPI:"This cookie is allowed by the Storage Access API. Learn more: goo.gle/saa",exemptionReasonTopLevelStorageAccessAPI:"This cookie is allowed by the top-level Storage Access API. Learn more: goo.gle/saa-top",exemptionReasonScheme:"This cookie is allowed by the top-level url scheme"},Ci=n.i18n.registerUIStrings("core/sdk/NetworkRequest.ts",ki),xi=n.i18n.getLocalizedString.bind(void 0,Ci);class Ri extends e.ObjectWrapper.ObjectWrapper{#Uo;#qo;#ki;#Ci;#xi;#zo;#jo;#Vo;#Wo;#Go;#Ko;#Qo;#$o;#Xo;#Jo;#Yo;#Zo;statusCode;statusText;requestMethod;requestTime;protocol;alternateProtocolUsage;mixedContentType;#ea;#ta;#na;#ra;#sa;#ia;#oa;#aa;#la;#da;#ca;#ha;#ua;#ga;#pa;#ma;#fa;#ba;#ya;#va;#Ia;connectionId;connectionReused;hasNetworkData;#wa;#Sa;#ka;#Ca;#xa;#Ra;#Ta;#Ma;#Pa;#Ea;#La;localizedFailDescription;#Si;#Aa;#Oa;#ge;#Da;#Na;#Fa;#Ti;#Ba;#Li;#h;#_a;#Ha;#Ua;#qa;#za;#ja;#Va;#Wa;#Ga;#Ka;#Qa;#$a;#Xa;#Ja;#Ya;#Za;#el;#tl;#nl;#rl;#sl;#il;#ol;#al;#ll;#dl;#cl;#hl=new Map;#ul;#gl;#pl;responseReceivedPromise;responseReceivedPromiseResolve;directSocketInfo;constructor(t,n,r,s,i,o,a,l){super(),this.#Uo=t,this.#qo=n,this.setUrl(r),this.#ki=s,this.#Ci=i,this.#xi=o,this.#jo=a,this.#zo=l,this.#Vo=null,this.#Wo=null,this.#Go=null,this.#Ko=!1,this.#Qo=null,this.#$o=-1,this.#Xo=-1,this.#Jo=-1,this.#Yo=void 0,this.#Zo=void 0,this.statusCode=0,this.statusText="",this.requestMethod="",this.requestTime=0,this.protocol="",this.alternateProtocolUsage=void 0,this.mixedContentType="none",this.#ea=null,this.#ta=null,this.#na=null,this.#ra=null,this.#sa=null,this.#ia=e.ResourceType.resourceTypes.Other,this.#oa=null,this.#aa=null,this.#la=[],this.#da={},this.#ca="",this.#ha=[],this.#ga=[],this.#pa=[],this.#ma={},this.#fa="",this.#ba="Unknown",this.#ya=null,this.#va="unknown",this.#Ia=null,this.connectionId="0",this.connectionReused=!1,this.hasNetworkData=!1,this.#wa=null,this.#Sa=Promise.resolve(null),this.#ka=!1,this.#Ca=!1,this.#xa=[],this.#Ra=[],this.#Ta=[],this.#Ma=[],this.#La=!1,this.#Pa=null,this.#Ea=null,this.localizedFailDescription=null,this.#dl=null,this.#cl=!1,this.#ul=!1,this.#gl=!1}static create(e,t,n,r,s,i,o){return new Ri(e,e,t,n,r,s,i,o)}static createForWebSocket(e,t,n){return new Ri(e,e,t,r.DevToolsPath.EmptyUrlString,null,null,n||null)}static createWithoutBackendRequest(e,t,n,r){return new Ri(e,void 0,t,n,null,null,r)}identityCompare(e){const t=this.requestId(),n=e.requestId();return t>n?1:te&&(this.#Aa=e)),this.dispatchEventToListeners(Ti.TIMING_CHANGED,this)}get duration(){return-1===this.#Jo||-1===this.#Xo?-1:this.#Jo-this.#Xo}get latency(){return-1===this.#Aa||-1===this.#Xo?-1:this.#Aa-this.#Xo}get resourceSize(){return this.#Ga||0}set resourceSize(e){this.#Ga=e}get transferSize(){return this.#Oa||0}increaseTransferSize(e){this.#Oa=(this.#Oa||0)+e}setTransferSize(e){this.#Oa=e}get finished(){return this.#ge}set finished(e){this.#ge!==e&&(this.#ge=e,e&&this.dispatchEventToListeners(Ti.FINISHED_LOADING,this))}get failed(){return this.#Da}set failed(e){this.#Da=e}get canceled(){return this.#Na}set canceled(e){this.#Na=e}get preserved(){return this.#Fa}set preserved(e){this.#Fa=e}blockedReason(){return this.#Yo}setBlockedReason(e){this.#Yo=e}corsErrorStatus(){return this.#Zo}setCorsErrorStatus(e){this.#Zo=e}wasBlocked(){return Boolean(this.#Yo)}cached(){return(Boolean(this.#Ka)||Boolean(this.#Qa))&&!this.#Oa}cachedInMemory(){return Boolean(this.#Ka)&&!this.#Oa}fromPrefetchCache(){return Boolean(this.#$a)}setFromMemoryCache(){this.#Ka=!0,this.#Za=void 0}get fromDiskCache(){return this.#Qa}setFromDiskCache(){this.#Qa=!0}setFromPrefetchCache(){this.#$a=!0}fromEarlyHints(){return Boolean(this.#Xa)}setFromEarlyHints(){this.#Xa=!0}get fetchedViaServiceWorker(){return Boolean(this.#Ja)}set fetchedViaServiceWorker(e){this.#Ja=e}get serviceWorkerRouterInfo(){return this.#Ya}set serviceWorkerRouterInfo(e){this.#Ya=e}initiatedByServiceWorker(){const e=Z.forRequest(this);return!!e&&e.target().type()===U.ServiceWorker}get timing(){return this.#Za}set timing(e){if(!e||this.#Ka)return;this.#Xo=e.requestTime;const t=e.requestTime+e.receiveHeadersEnd/1e3;((this.#Aa||-1)<0||this.#Aa>t)&&(this.#Aa=t),this.#Xo>this.#Aa&&(this.#Aa=this.#Xo),this.#Za=e,this.dispatchEventToListeners(Ti.TIMING_CHANGED,this)}setConnectTimingFromExtraInfo(e){this.#Xo=e.requestTime,this.dispatchEventToListeners(Ti.TIMING_CHANGED,this)}get mimeType(){return this.#Ti}set mimeType(t){if(this.#Ti=t,"text/event-stream"===t&&!this.#pl){const t=this.resourceType()!==e.ResourceType.resourceTypes.EventSource;this.#pl=new bi(this,t)}}get displayName(){return this.#Li.displayName}name(){return this.#h||this.parseNameAndPathFromURL(),this.#h}path(){return this.#_a||this.parseNameAndPathFromURL(),this.#_a}parseNameAndPathFromURL(){if(this.#Li.isDataURL())this.#h=this.#Li.dataURLDisplayName(),this.#_a="";else if(this.#Li.isBlobURL())this.#h=this.#Li.url,this.#_a="";else if(this.#Li.isAboutBlank())this.#h=this.#Li.url,this.#_a="";else{this.#_a=this.#Li.host+this.#Li.folderPathComponents;const t=Z.forRequest(this),n=t?e.ParsedURL.ParsedURL.fromString(t.target().inspectedURL()):null;this.#_a=r.StringUtilities.trimURL(this.#_a,n?n.host:""),this.#Li.lastPathComponent||this.#Li.queryParams?this.#h=this.#Li.lastPathComponent+(this.#Li.queryParams?"?"+this.#Li.queryParams:""):this.#Li.folderPathComponents?(this.#h=this.#Li.folderPathComponents.substring(this.#Li.folderPathComponents.lastIndexOf("/")+1)+"/",this.#_a=this.#_a.substring(0,this.#_a.lastIndexOf("/"))):(this.#h=this.#Li.host,this.#_a="")}}get folder(){let e=this.#Li.path;const t=e.indexOf("?");-1!==t&&(e=e.substring(0,t));const n=e.lastIndexOf("/");return-1!==n?e.substring(0,n):""}get pathname(){return this.#Li.path}resourceType(){return this.#ia}setResourceType(e){this.#ia=e}get domain(){return this.#Li.host}get scheme(){return this.#Li.scheme}getInferredStatusText(){return this.statusText||(e=this.statusCode,n.i18n.lockedString({100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Content Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Content",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"}[e]??""));var e}redirectSource(){return this.#Vo}setRedirectSource(e){this.#Vo=e}preflightRequest(){return this.#Wo}setPreflightRequest(e){this.#Wo=e}preflightInitiatorRequest(){return this.#Go}setPreflightInitiatorRequest(e){this.#Go=e}isPreflightRequest(){return null!==this.#jo&&void 0!==this.#jo&&"preflight"===this.#jo.type}redirectDestination(){return this.#Qo}setRedirectDestination(e){this.#Qo=e}requestHeaders(){return this.#pa}setRequestHeaders(e){this.#pa=e,this.dispatchEventToListeners(Ti.REQUEST_HEADERS_CHANGED)}requestHeadersText(){return this.#el}setRequestHeadersText(e){this.#el=e,this.dispatchEventToListeners(Ti.REQUEST_HEADERS_CHANGED)}requestHeaderValue(e){return this.#ma[e]||(this.#ma[e]=this.computeHeaderValue(this.requestHeaders(),e)),this.#ma[e]}requestFormData(){return this.#Sa||(this.#Sa=Z.requestPostData(this)),this.#Sa}setRequestFormData(e,t){this.#Sa=e&&null===t?null:Promise.resolve(t),this.#wa=null}filteredProtocolName(){const e=this.protocol.toLowerCase();return"h2"===e?"http/2.0":e.replace(/^http\/2(\.0)?\+/,"http/2.0+")}requestHttpVersion(){const e=this.requestHeadersText();if(!e){const e=this.requestHeaderValue("version")||this.requestHeaderValue(":version");return e||this.filteredProtocolName()}const t=e.split(/\r\n/)[0].match(/(HTTP\/\d+\.\d+)$/);return t?t[1]:"HTTP/0.9"}get responseHeaders(){return this.#tl||[]}set responseHeaders(e){this.#tl=e,this.#rl=void 0,this.#il=void 0,this.#sl=void 0,this.#da={},this.dispatchEventToListeners(Ti.RESPONSE_HEADERS_CHANGED)}get earlyHintsHeaders(){return this.#nl||[]}set earlyHintsHeaders(e){this.#nl=e}get originalResponseHeaders(){return this.#ha}set originalResponseHeaders(e){this.#ha=e,this.#ua=void 0}get setCookieHeaders(){return this.#ga}set setCookieHeaders(e){this.#ga=e}get responseHeadersText(){return this.#ca}set responseHeadersText(e){this.#ca=e,this.dispatchEventToListeners(Ti.RESPONSE_HEADERS_CHANGED)}get sortedResponseHeaders(){return void 0!==this.#rl?this.#rl:(this.#rl=this.responseHeaders.slice(),this.#rl.sort((function(e,t){return r.StringUtilities.compare(e.name.toLowerCase(),t.name.toLowerCase())})))}get sortedOriginalResponseHeaders(){return void 0!==this.#ua?this.#ua:(this.#ua=this.originalResponseHeaders.slice(),this.#ua.sort((function(e,t){return r.StringUtilities.compare(e.name.toLowerCase(),t.name.toLowerCase())})))}get overrideTypes(){const e=[];return this.hasOverriddenContent&&e.push("content"),this.hasOverriddenHeaders()&&e.push("headers"),e}get hasOverriddenContent(){return this.#ul}set hasOverriddenContent(e){this.#ul=e}#ml(e){const t=[];for(const n of e)t.length&&t[t.length-1].name===n.name?t[t.length-1].value+=`, ${n.value}`:t.push({name:n.name,value:n.value});return t}hasOverriddenHeaders(){if(!this.#ha.length)return!1;const e=this.#ml(this.sortedResponseHeaders),t=this.#ml(this.sortedOriginalResponseHeaders);if(e.length!==t.length)return!0;for(let n=0;ne.cookie)),...this.responseCookies,...this.blockedRequestCookies().map((e=>e.cookie)),...this.blockedResponseCookies().map((e=>e.cookie))].filter((e=>!!e))}get serverTimings(){return void 0===this.#il&&(this.#il=wi.parseHeaders(this.responseHeaders)),this.#il}queryString(){if(void 0!==this.#ol)return this.#ol;let e=null;const t=this.url(),n=t.indexOf("?");if(-1!==n){e=t.substring(n+1);const r=e.indexOf("#");-1!==r&&(e=e.substring(0,r))}return this.#ol=e,this.#ol}get queryParameters(){if(this.#al)return this.#al;const e=this.queryString();return e?(this.#al=this.parseParameters(e),this.#al):null}async parseFormParameters(){const e=this.requestContentType();if(!e)return null;if(e.match(/^application\/x-www-form-urlencoded\s*(;.*)?$/i)){const e=await this.requestFormData();return e?this.parseParameters(e):null}const t=e.match(/^multipart\/form-data\s*;\s*boundary\s*=\s*(\S+)\s*$/);if(!t)return null;const n=t[1];if(!n)return null;const r=await this.requestFormData();return r?this.parseMultipartFormDataParameters(r,n):null}formParameters(){return this.#wa||(this.#wa=this.parseFormParameters()),this.#wa}responseHttpVersion(){const e=this.#ca;if(!e){const e=this.responseHeaderValue("version")||this.responseHeaderValue(":version");return e||this.filteredProtocolName()}const t=e.split(/\r\n/)[0].match(/^(HTTP\/\d+\.\d+)/);return t?t[1]:"HTTP/0.9"}parseParameters(e){return e.split("&").map((function(e){const t=e.indexOf("=");return-1===t?{name:e,value:""}:{name:e.substring(0,t),value:e.substring(t+1)}}))}parseMultipartFormDataParameters(e,t){const n=r.StringUtilities.escapeForRegExp(t),s=new RegExp('^\\r\\ncontent-disposition\\s*:\\s*form-data\\s*;\\s*name="([^"]*)"(?:\\s*;\\s*filename="([^"]*)")?(?:\\r\\ncontent-type\\s*:\\s*([^\\r\\n]*))?\\r\\n\\r\\n(.*)\\r\\n$',"is");return e.split(new RegExp(`--${n}(?:--s*$)?`,"g")).reduce((function(e,t){const[n,r,i,o,a]=t.match(s)||[];if(!n)return e;const l=i||o?xi(ki.binary):a;return e.push({name:r,value:l}),e}),[])}computeHeaderValue(e,t){t=t.toLowerCase();const n=[];for(let r=0;rt.ContentData.ContentData.isError(e)?e:t.StreamingContentData.StreamingContentData.from(e))),this.#aa}contentURL(){return this.#Si}contentType(){return this.#ia}async requestContent(){return t.ContentData.ContentData.asDeferredContent(await this.requestContentData())}async searchInContent(e,n,r){if(!this.#ll)return await Z.searchInRequest(this,e,n,r);const s=await this.requestContentData();return t.ContentData.ContentData.isError(s)||!s.isTextContent?[]:t.TextUtils.performSearchInContentData(s,e,n,r)}requestContentType(){return this.requestHeaderValue("Content-Type")}hasErrorStatusCode(){return this.statusCode>=400}setInitialPriority(e){this.#ea=e}initialPriority(){return this.#ea}setPriority(e){this.#ta=e}priority(){return this.#ta||this.#ea||null}setSignedExchangeInfo(e){this.#na=e}signedExchangeInfo(){return this.#na}setWebBundleInfo(e){this.#ra=e}webBundleInfo(){return this.#ra}setWebBundleInnerRequestInfo(e){this.#sa=e}webBundleInnerRequestInfo(){return this.#sa}async populateImageSource(e){const n=await this.requestContentData();if(t.ContentData.ContentData.isError(n))return;let r=n.asDataUrl();if(null===r&&!this.#Da){(this.responseHeaderValue("cache-control")||"").includes("no-cache")||(r=this.#Si)}null!==r&&(e.src=r)}initiator(){return this.#jo||null}hasUserGesture(){return this.#zo??null}frames(){return this.#la}addProtocolFrameError(e,t){this.addFrame({type:Mi.Error,text:e,time:this.pseudoWallTime(t),opCode:-1,mask:!1})}addProtocolFrame(e,t,n){const r=n?Mi.Send:Mi.Receive;this.addFrame({type:r,text:e.payloadData,time:this.pseudoWallTime(t),opCode:e.opcode,mask:e.mask})}addFrame(e){this.#la.push(e),this.dispatchEventToListeners(Ti.WEBSOCKET_FRAME_ADDED,e)}eventSourceMessages(){return this.#pl?.eventSourceMessages??[]}addEventSourceMessage(e,t,n,r){this.#pl?.onProtocolEventSourceMessageReceived(t,r,n,this.pseudoWallTime(e))}markAsRedirect(e){this.#Ko=!0,this.#Uo=`${this.#qo}:redirected.${e}`}isRedirect(){return this.#Ko}setRequestIdForTest(e){this.#qo=e,this.#Uo=e}charset(){return this.#Ba??null}setCharset(e){this.#Ba=e}addExtraRequestInfo(e){this.#xa=e.blockedRequestCookies,this.#Ra=e.includedRequestCookies,this.setRequestHeaders(e.requestHeaders),this.#ka=!0,this.setRequestHeadersText(""),this.#Ha=e.clientSecurityState,this.setConnectTimingFromExtraInfo(e.connectTiming),this.#La=e.siteHasCookieInOtherPartition??!1,this.#gl=this.#xa.some((e=>e.blockedReasons.includes("ThirdPartyPhaseout")))}hasExtraRequestInfo(){return this.#ka}blockedRequestCookies(){return this.#xa}includedRequestCookies(){return this.#Ra}hasRequestCookies(){return this.#Ra.length>0||this.#xa.length>0}siteHasCookieInOtherPartition(){return this.#La}static parseStatusTextFromResponseHeadersText(e){return e.split("\r")[0].split(" ").slice(2).join(" ")}addExtraResponseInfo(e){if(this.#Ta=e.blockedResponseCookies,e.exemptedResponseCookies&&(this.#Ma=e.exemptedResponseCookies),this.#Pa=e.cookiePartitionKey?e.cookiePartitionKey:null,this.#Ea=e.cookiePartitionKeyOpaque||null,this.responseHeaders=e.responseHeaders,this.originalResponseHeaders=e.responseHeaders.map((e=>({...e}))),e.responseHeadersText){if(this.responseHeadersText=e.responseHeadersText,!this.requestHeadersText()){let e=`${this.requestMethod} ${this.parsedURL.path}`;this.parsedURL.queryParams&&(e+=`?${this.parsedURL.queryParams}`),e+=" HTTP/1.1\r\n";for(const{name:t,value:n}of this.requestHeaders())e+=`${t}: ${n}\r\n`;this.setRequestHeadersText(e)}this.statusText=Ri.parseStatusTextFromResponseHeadersText(e.responseHeadersText)}this.#ba=e.resourceIPAddressSpace,e.statusCode&&(this.statusCode=e.statusCode),this.#Ca=!0;const t=Z.forRequest(this);if(!t)return;for(const e of this.#Ta)if(e.blockedReasons.includes("NameValuePairExceedsMaxSize")){const e=xi(ki.setcookieHeaderIsIgnoredIn,{PH1:this.url()});t.dispatchEventToListeners(ee.MessageGenerated,{message:e,requestId:this.#Uo,warning:!0})}const n=t.target().model(di);if(n){for(const e of this.#Ma)n.removeBlockedCookie(e.cookie);for(const e of this.#Ta){const t=e.cookie;t&&(e.blockedReasons.includes("ThirdPartyPhaseout")&&(this.#gl=!0),n.addBlockedCookie(t,e.blockedReasons.map((e=>({attribute:Ei(e),uiString:Pi(e)})))))}}}hasExtraResponseInfo(){return this.#Ca}blockedResponseCookies(){return this.#Ta}exemptedResponseCookies(){return this.#Ma}nonBlockedResponseCookies(){const e=this.blockedResponseCookies().map((e=>e.cookieLine));return this.responseCookies.filter((t=>{const n=e.indexOf(t.getCookieLine());return-1===n||(e[n]=null,!1)}))}responseCookiesPartitionKey(){return this.#Pa}responseCookiesPartitionKeyOpaque(){return this.#Ea}redirectSourceSignedExchangeInfoHasNoErrors(){return null!==this.#Vo&&null!==this.#Vo.#na&&!this.#Vo.#na.errors}clientSecurityState(){return this.#Ha}setTrustTokenParams(e){this.#Ua=e}trustTokenParams(){return this.#Ua}setTrustTokenOperationDoneEvent(e){this.#qa=e,this.dispatchEventToListeners(Ti.TRUST_TOKEN_RESULT_ADDED)}trustTokenOperationDoneEvent(){return this.#qa}setIsSameSite(e){this.#dl=e}isSameSite(){return this.#dl}getAssociatedData(e){return this.#hl.get(e)||null}setAssociatedData(e,t){this.#hl.set(e,t)}deleteAssociatedData(e){this.#hl.delete(e)}hasThirdPartyCookiePhaseoutIssue(){return this.#gl}addDataReceivedEvent({timestamp:e,dataLength:n,encodedDataLength:r,data:s}){this.resourceSize+=n,-1!==r&&this.increaseTransferSize(r),this.endTime=e,s&&this.#aa?.then((e=>{t.StreamingContentData.isError(e)||e.addChunk(s)}))}waitForResponseReceived(){if(this.responseReceivedPromise)return this.responseReceivedPromise;const{promise:e,resolve:t}=Promise.withResolvers();return this.responseReceivedPromise=e,this.responseReceivedPromiseResolve=t,this.responseReceivedPromise}}var Ti,Mi;!function(e){e.FINISHED_LOADING="FinishedLoading",e.TIMING_CHANGED="TimingChanged",e.REMOTE_ADDRESS_CHANGED="RemoteAddressChanged",e.REQUEST_HEADERS_CHANGED="RequestHeadersChanged",e.RESPONSE_HEADERS_CHANGED="ResponseHeadersChanged",e.WEBSOCKET_FRAME_ADDED="WebsocketFrameAdded",e.EVENT_SOURCE_MESSAGE_ADDED="EventSourceMessageAdded",e.TRUST_TOKEN_RESULT_ADDED="TrustTokenResultAdded"}(Ti||(Ti={})),function(e){e.Send="send",e.Receive="receive",e.Error="error"}(Mi||(Mi={}));const Pi=function(e){switch(e){case"SecureOnly":return xi(ki.blockedReasonSecureOnly);case"SameSiteStrict":return xi(ki.blockedReasonSameSiteStrictLax,{PH1:"SameSite=Strict"});case"SameSiteLax":return xi(ki.blockedReasonSameSiteStrictLax,{PH1:"SameSite=Lax"});case"SameSiteUnspecifiedTreatedAsLax":return xi(ki.blockedReasonSameSiteUnspecifiedTreatedAsLax);case"SameSiteNoneInsecure":return xi(ki.blockedReasonSameSiteNoneInsecure);case"UserPreferences":return xi(ki.thisSetcookieWasBlockedDueToUser);case"SyntaxError":return xi(ki.thisSetcookieHadInvalidSyntax);case"SchemeNotSupported":return xi(ki.theSchemeOfThisConnectionIsNot);case"OverwriteSecure":return xi(ki.blockedReasonOverwriteSecure);case"InvalidDomain":return xi(ki.blockedReasonInvalidDomain);case"InvalidPrefix":return xi(ki.blockedReasonInvalidPrefix);case"UnknownError":return xi(ki.anUnknownErrorWasEncounteredWhenTrying);case"SchemefulSameSiteStrict":return xi(ki.thisSetcookieWasBlockedBecauseItHadTheSamesiteStrictLax,{PH1:"SameSite=Strict"});case"SchemefulSameSiteLax":return xi(ki.thisSetcookieWasBlockedBecauseItHadTheSamesiteStrictLax,{PH1:"SameSite=Lax"});case"SchemefulSameSiteUnspecifiedTreatedAsLax":return xi(ki.thisSetcookieDidntSpecifyASamesite);case"SamePartyFromCrossPartyContext":return xi(ki.thisSetcookieWasBlockedBecauseItHadTheSameparty);case"SamePartyConflictsWithOtherAttributes":return xi(ki.thisSetcookieWasBlockedBecauseItHadTheSamepartyAttribute);case"NameValuePairExceedsMaxSize":return xi(ki.thisSetcookieWasBlockedBecauseTheNameValuePairExceedsMaxSize);case"DisallowedCharacter":return xi(ki.thisSetcookieHadADisallowedCharacter);case"ThirdPartyPhaseout":return xi(ki.thisSetcookieWasBlockedDueThirdPartyPhaseout)}return""},Ei=function(e){switch(e){case"SecureOnly":case"OverwriteSecure":return"secure";case"SameSiteStrict":case"SameSiteLax":case"SameSiteUnspecifiedTreatedAsLax":case"SameSiteNoneInsecure":case"SchemefulSameSiteStrict":case"SchemefulSameSiteLax":case"SchemefulSameSiteUnspecifiedTreatedAsLax":return"same-site";case"InvalidDomain":return"domain";case"InvalidPrefix":return"name";case"SamePartyConflictsWithOtherAttributes":case"SamePartyFromCrossPartyContext":case"NameValuePairExceedsMaxSize":case"UserPreferences":case"ThirdPartyPhaseout":case"SyntaxError":case"SchemeNotSupported":case"UnknownError":case"DisallowedCharacter":return null}return null};var Li,Ai;!function(e){e[e.TCP=1]="TCP",e[e.UDP_BOUND=2]="UDP_BOUND",e[e.UDP_CONNECTED=3]="UDP_CONNECTED"}(Li||(Li={})),function(e){e[e.OPENING=1]="OPENING",e[e.OPEN=2]="OPEN",e[e.CLOSED=3]="CLOSED",e[e.ABORTED=4]="ABORTED"}(Ai||(Ai={}));var Oi=Object.freeze({__proto__:null,get DirectSocketStatus(){return Ai},get DirectSocketType(){return Li},get Events(){return Ti},NetworkRequest:Ri,get WebSocketFrameType(){return Mi},cookieBlockedReasonToAttribute:function(e){switch(e){case"SecureOnly":return"secure";case"NotOnPath":return"path";case"DomainMismatch":return"domain";case"SameSiteStrict":case"SameSiteLax":case"SameSiteUnspecifiedTreatedAsLax":case"SameSiteNoneInsecure":case"SchemefulSameSiteStrict":case"SchemefulSameSiteLax":case"SchemefulSameSiteUnspecifiedTreatedAsLax":return"same-site";case"SamePartyFromCrossPartyContext":case"NameValuePairExceedsMaxSize":case"UserPreferences":case"ThirdPartyPhaseout":case"UnknownError":return null}return null},cookieBlockedReasonToUiString:function(e){switch(e){case"SecureOnly":return xi(ki.secureOnly);case"NotOnPath":return xi(ki.notOnPath);case"DomainMismatch":return xi(ki.domainMismatch);case"SameSiteStrict":return xi(ki.sameSiteStrict);case"SameSiteLax":return xi(ki.sameSiteLax);case"SameSiteUnspecifiedTreatedAsLax":return xi(ki.sameSiteUnspecifiedTreatedAsLax);case"SameSiteNoneInsecure":return xi(ki.sameSiteNoneInsecure);case"UserPreferences":return xi(ki.userPreferences);case"UnknownError":return xi(ki.unknownError);case"SchemefulSameSiteStrict":return xi(ki.schemefulSameSiteStrict);case"SchemefulSameSiteLax":return xi(ki.schemefulSameSiteLax);case"SchemefulSameSiteUnspecifiedTreatedAsLax":return xi(ki.schemefulSameSiteUnspecifiedTreatedAsLax);case"SamePartyFromCrossPartyContext":return xi(ki.samePartyFromCrossPartyContext);case"NameValuePairExceedsMaxSize":return xi(ki.nameValuePairExceedsMaxSize);case"ThirdPartyPhaseout":return xi(ki.thirdPartyPhaseout)}return""},cookieExemptionReasonToUiString:function(e){switch(e){case"UserSetting":return xi(ki.exemptionReasonUserSetting);case"TPCDMetadata":return xi(ki.exemptionReasonTPCDMetadata);case"TopLevelTPCDDeprecationTrial":return xi(ki.exemptionReasonTopLevelTPCDDeprecationTrial);case"TPCDDeprecationTrial":return xi(ki.exemptionReasonTPCDDeprecationTrial);case"TPCDHeuristics":return xi(ki.exemptionReasonTPCDHeuristics);case"EnterprisePolicy":return xi(ki.exemptionReasonEnterprisePolicy);case"StorageAccess":return xi(ki.exemptionReasonStorageAccessAPI);case"TopLevelStorageAccess":return xi(ki.exemptionReasonTopLevelStorageAccessAPI);case"Scheme":return xi(ki.exemptionReasonScheme)}return""},setCookieBlockedReasonToAttribute:Ei,setCookieBlockedReasonToUiString:Pi});class Di{#fl;#C;#bl;#yl;#vl;#Il;#wl;#h;#Zt;#u;#Sl;#kl;#Cl;#xl;constructor(e,t){this.#fl=e,this.#C=t.nodeId,e.setAXNodeForAXId(this.#C,this),t.backendDOMNodeId?(e.setAXNodeForBackendDOMNodeId(t.backendDOMNodeId,this),this.#bl=t.backendDOMNodeId,this.#yl=new js(e.target(),t.backendDOMNodeId)):(this.#bl=null,this.#yl=null),this.#vl=t.ignored,this.#vl&&"ignoredReasons"in t&&(this.#Il=t.ignoredReasons),this.#wl=t.role||null,this.#h=t.name||null,this.#Zt=t.description||null,this.#u=t.value||null,this.#Sl=t.properties||null,this.#xl=[...new Set(t.childIds)],this.#kl=t.parentId||null,t.frameId&&!t.parentId?(this.#Cl=t.frameId,e.setRootAXNodeForFrameId(t.frameId,this)):this.#Cl=null}id(){return this.#C}accessibilityModel(){return this.#fl}ignored(){return this.#vl}ignoredReasons(){return this.#Il||null}role(){return this.#wl||null}coreProperties(){const e=[];return this.#h&&e.push({name:"name",value:this.#h}),this.#Zt&&e.push({name:"description",value:this.#Zt}),this.#u&&e.push({name:"value",value:this.#u}),e}name(){return this.#h||null}description(){return this.#Zt||null}value(){return this.#u||null}properties(){return this.#Sl||null}parentNode(){return this.#kl?this.#fl.axNodeForId(this.#kl):null}isDOMNode(){return Boolean(this.#bl)}backendDOMNodeId(){return this.#bl}deferredDOMNode(){return this.#yl}highlightDOMNode(){const e=this.deferredDOMNode();e&&e.highlight()}children(){if(!this.#xl)return[];const e=[];for(const t of this.#xl){const n=this.#fl.axNodeForId(t);n&&e.push(n)}return e}numChildren(){return this.#xl?this.#xl.length:0}hasOnlyUnloadedChildren(){return!(!this.#xl||!this.#xl.length)&&this.#xl.every((e=>null===this.#fl.axNodeForId(e)))}hasUnloadedChildren(){return!(!this.#xl||!this.#xl.length)&&this.#xl.some((e=>null===this.#fl.axNodeForId(e)))}getFrameId(){return this.#Cl||this.parentNode()?.getFrameId()||null}}class Ni extends h{agent;#Rl=new Map;#Tl=new Map;#Ml=new Map;#Pl=new Map;#El=null;constructor(e){super(e),e.registerAccessibilityDispatcher(this),this.agent=e.accessibilityAgent(),this.resumeModel()}clear(){this.#El=null,this.#Rl.clear(),this.#Tl.clear(),this.#Ml.clear()}async resumeModel(){await this.agent.invoke_enable()}async suspendModel(){await this.agent.invoke_disable()}async requestPartialAXTree(e){const{nodes:t}=await this.agent.invoke_getPartialAXTree({nodeId:e.id,fetchRelatives:!0});if(!t)return;const n=[];for(const e of t)n.push(new Di(this,e))}loadComplete({root:e}){this.clear(),this.#El=new Di(this,e),this.dispatchEventToListeners("TreeUpdated",{root:this.#El})}nodesUpdated({nodes:e}){this.createNodesFromPayload(e),this.dispatchEventToListeners("TreeUpdated",{})}createNodesFromPayload(e){return e.map((e=>new Di(this,e)))}async requestRootNode(e){if(e&&this.#Ml.has(e))return this.#Ml.get(e);if(!e&&this.#El)return this.#El;const{node:t}=await this.agent.invoke_getRootAXNode({frameId:e});return t?this.createNodesFromPayload([t])[0]:void 0}async requestAXChildren(e,t){const n=this.#Rl.get(e);if(!n)throw new Error("Cannot request children before parent");if(!n.hasUnloadedChildren())return n.children();const r=this.#Pl.get(e);if(r)await r;else{const n=this.agent.invoke_getChildAXNodes({id:e,frameId:t});this.#Pl.set(e,n);const r=await n;r.getError()||(this.createNodesFromPayload(r.nodes),this.#Pl.delete(e))}return n.children()}async requestAndLoadSubTreeToNode(e){const t=[];let n=this.axNodeForDOMNode(e);for(;n;){t.push(n);const e=n.parentNode();if(!e)return t;n=e}const{nodes:r}=await this.agent.invoke_getAXNodeAndAncestors({backendNodeId:e.backendNodeId()});if(!r)return null;return this.createNodesFromPayload(r)}axNodeForId(e){return this.#Rl.get(e)||null}setRootAXNodeForFrameId(e,t){this.#Ml.set(e,t)}setAXNodeForAXId(e,t){this.#Rl.set(e,t)}axNodeForDOMNode(e){return e?this.#Tl.get(e.backendNodeId())??null:null}setAXNodeForBackendDOMNodeId(e,t){this.#Tl.set(e,t)}getAgent(){return this.agent}}h.register(Ni,{capabilities:2,autostart:!1});var Fi=Object.freeze({__proto__:null,AccessibilityModel:Ni,AccessibilityNode:Di});class Bi extends h{#Ks;#Ll=1;#Al=[];constructor(e){super(e),this.#Ks=e.pageAgent(),e.registerPageDispatcher(this)}async startScreencast(e,t,n,r,s,i,o){this.#Al.at(-1)&&await this.#Ks.invoke_stopScreencast();const a={id:this.#Ll++,request:{format:e,quality:t,maxWidth:n,maxHeight:r,everyNthFrame:s},callbacks:{onScreencastFrame:i,onScreencastVisibilityChanged:o}};return this.#Al.push(a),this.#Ks.invoke_startScreencast({format:e,quality:t,maxWidth:n,maxHeight:r,everyNthFrame:s}),a.id}stopScreencast(e){const t=this.#Al.pop();if(!t)throw new Error("There is no screencast operation to stop.");if(t.id!==e)throw new Error("Trying to stop a screencast operation that is not being served right now.");this.#Ks.invoke_stopScreencast();const n=this.#Al.at(-1);n&&this.#Ks.invoke_startScreencast({format:n.request.format,quality:n.request.quality,maxWidth:n.request.maxWidth,maxHeight:n.request.maxHeight,everyNthFrame:n.request.everyNthFrame})}async captureScreenshot(e,t,n,r){const s={format:e,quality:t,fromSurface:!0};switch(n){case"fromClip":s.captureBeyondViewport=!0,s.clip=r;break;case"fullpage":s.captureBeyondViewport=!0;break;case"fromViewport":s.captureBeyondViewport=!1;break;default:throw new Error("Unexpected or unspecified screnshotMode")}await Fs.muteHighlight();const i=await this.#Ks.invoke_captureScreenshot(s);return await Fs.unmuteHighlight(),i.data}screencastFrame({data:e,metadata:t,sessionId:n}){this.#Ks.invoke_screencastFrameAck({sessionId:n});const r=this.#Al.at(-1);r&&r.callbacks.onScreencastFrame.call(null,e,t)}screencastVisibilityChanged({visible:e}){const t=this.#Al.at(-1);t&&t.callbacks.onScreencastVisibilityChanged.call(null,e)}backForwardCacheNotUsed(e){}domContentEventFired(e){}loadEventFired(e){}lifecycleEvent(e){}navigatedWithinDocument(e){}frameAttached(e){}frameNavigated(e){}documentOpened(e){}frameDetached(e){}frameStartedLoading(e){}frameStoppedLoading(e){}frameRequestedNavigation(e){}frameStartedNavigating(e){}frameSubtreeWillBeDetached(e){}frameScheduledNavigation(e){}frameClearedScheduledNavigation(e){}frameResized(){}javascriptDialogOpening(e){}javascriptDialogClosed(e){}interstitialShown(){}interstitialHidden(){}windowOpen(e){}fileChooserOpened(e){}compilationCacheProduced(e){}downloadWillBegin(e){}downloadProgress(){}prefetchStatusUpdated(e){}prerenderStatusUpdated(e){}}h.register(Bi,{capabilities:64,autostart:!1});var _i=Object.freeze({__proto__:null,ScreenCaptureModel:Bi});const Hi="devtools_animations",Ui="__devtools_report_scroll_position__",qi=e=>`__devtools_scroll_listener_${e}__`;async function zi(e,t){const n=e.domModel().target().model(ii),r=e.domModel().target().pageAgent();for(const s of n.frames()){const{executionContextId:n}=await r.invoke_createIsolatedWorld({frameId:s.id,worldName:t}),i=await e.resolveToObject(void 0,n);if(i)return i}return null}class ji{#Ol;#Dl=new Map;#Nl;static lastAddedListenerId=0;constructor(e){this.#Ol=e}async#Fl(){if(this.#Nl)return;this.#Nl=e=>{const{name:t,payload:n}=e.data;if(t!==Ui)return;const{scrollTop:r,scrollLeft:s,id:i}=JSON.parse(n),o=this.#Dl.get(i);o&&o({scrollTop:r,scrollLeft:s})};const e=this.#Ol.domModel().target().model(Jr);await e.addBinding({name:Ui,executionContextName:Hi}),e.addEventListener($r.BindingCalled,this.#Nl)}async#Bl(){if(!this.#Nl)return;const e=this.#Ol.domModel().target().model(Jr);await e.removeBinding({name:Ui}),e.removeEventListener($r.BindingCalled,this.#Nl),this.#Nl=void 0}async addScrollEventListener(e){ji.lastAddedListenerId++;const t=ji.lastAddedListenerId;this.#Dl.set(t,e),this.#Nl||await this.#Fl();const n=await zi(this.#Ol,Hi);return n?(await n.callFunction((function(e,t,n){if("scrollingElement"in this&&!this.scrollingElement)return;const r="scrollingElement"in this?this.scrollingElement:this;this[n]=()=>{globalThis[t](JSON.stringify({scrollTop:r.scrollTop,scrollLeft:r.scrollLeft,id:e}))},this.addEventListener("scroll",this[n],!0)}),[t,Ui,qi(t)].map((e=>Bn.toCallArgument(e)))),n.release(),t):null}async removeScrollEventListener(e){const t=await zi(this.#Ol,Hi);t&&(await t.callFunction((function(e){this.removeEventListener("scroll",this[e]),delete this[e]}),[qi(e)].map((e=>Bn.toCallArgument(e)))),t.release(),this.#Dl.delete(e),0===this.#Dl.size&&await this.#Bl())}async scrollTop(){return await this.#Ol.callFunction((function(){if("scrollingElement"in this)return this.scrollingElement?this.scrollingElement.scrollTop:0;return this.scrollTop})).then((e=>e?.value??null))}async scrollLeft(){return await this.#Ol.callFunction((function(){if("scrollingElement"in this)return this.scrollingElement?this.scrollingElement.scrollLeft:0;return this.scrollLeft})).then((e=>e?.value??null))}async setScrollTop(e){await this.#Ol.callFunction((function(e){if("scrollingElement"in this){if(!this.scrollingElement)return;this.scrollingElement.scrollTop=e}else this.scrollTop=e}),[e])}async setScrollLeft(e){await this.#Ol.callFunction((function(e){if("scrollingElement"in this){if(!this.scrollingElement)return;this.scrollingElement.scrollLeft=e}else this.scrollLeft=e}),[e])}async verticalScrollRange(){return await this.#Ol.callFunction((function(){if("scrollingElement"in this)return this.scrollingElement?this.scrollingElement.scrollHeight-this.scrollingElement.clientHeight:0;return this.scrollHeight-this.clientHeight})).then((e=>e?.value??null))}async horizontalScrollRange(){return await this.#Ol.callFunction((function(){if("scrollingElement"in this)return this.scrollingElement?this.scrollingElement.scrollWidth-this.scrollingElement.clientWidth:0;return this.scrollWidth-this.clientWidth})).then((e=>e?.value??null))}}function Vi(e,t){const n=e.viewOrScrollTimeline(),r=t.viewOrScrollTimeline();return n?Boolean(r&&n.sourceNodeId===r.sourceNodeId&&n.axis===r.axis):!r&&e.startTime()===t.startTime()}class Wi extends h{runtimeModel;agent;#_l=new Map;animationGroups=new Map;#Hl=new Set;playbackRate=1;#Ul;#ql;constructor(t){super(t),this.runtimeModel=t.model(Jr),this.agent=t.animationAgent(),t.registerAnimationDispatcher(new Yi(this)),t.suspended()||this.agent.invoke_enable();t.model(ii).addEventListener(ri.PrimaryPageChanged,this.reset,this);const n=t.model(Bi);n&&(this.#Ul=new Zi(this,n)),this.#ql=e.Debouncer.debounce((()=>{for(;this.#Hl.size;)this.matchExistingGroups(this.createGroupFromPendingAnimations())}),100)}reset(){this.#_l.clear(),this.animationGroups.clear(),this.#Hl.clear(),this.dispatchEventToListeners(Gi.ModelReset)}async devicePixelRatio(){const e=await this.target().runtimeAgent().invoke_evaluate({expression:"window.devicePixelRatio"});return"number"===e?.result.type?e?.result.value??1:1}async getAnimationGroupForAnimation(e,t){for(const n of this.animationGroups.values())for(const r of n.animations())if(r.name()===e){const e=await r.source().node();if(e?.id===t)return n}return null}animationCanceled(e){this.#Hl.delete(e)}async animationUpdated(e){let t,n;for(const r of this.animationGroups.values())if(n=r.animations().find((t=>t.id()===e.id)),n){t=r;break}n&&t&&(await n.setPayload(e),this.dispatchEventToListeners(Gi.AnimationGroupUpdated,t))}async animationStarted(e){if(!e.source||!e.source.backendNodeId)return;const t=await Ki.parsePayload(this,e),n=t.source().keyframesRule();"WebAnimation"===t.type()&&n&&0===n.keyframes().length?this.#Hl.delete(t.id()):(this.#_l.set(t.id(),t),this.#Hl.add(t.id())),this.#ql()}matchExistingGroups(e){let t=null;for(const n of this.animationGroups.values()){if(n.matches(e)){t=n,n.rebaseTo(e);break}if(n.shouldInclude(e)){t=n,n.appendAnimations(e.animations());break}}return t?this.dispatchEventToListeners(Gi.AnimationGroupUpdated,t):(this.animationGroups.set(e.id(),e),this.#Ul&&this.#Ul.captureScreenshots(e.finiteDuration(),e.screenshotsInternal),this.dispatchEventToListeners(Gi.AnimationGroupStarted,e)),Boolean(t)}createGroupFromPendingAnimations(){console.assert(this.#Hl.size>0);const e=this.#Hl.values().next().value;this.#Hl.delete(e);const t=this.#_l.get(e);if(!t)throw new Error("Unable to locate first animation");const n=[t],r=new Set;for(const e of this.#Hl){const s=this.#_l.get(e);Vi(t,s)?n.push(s):r.add(e)}return this.#Hl=r,n.sort(((e,t)=>e.startTime()-t.startTime())),new Ji(this,e,n)}setPlaybackRate(e){this.playbackRate=e,this.agent.invoke_setPlaybackRate({playbackRate:e})}async releaseAllAnimations(){const e=[...this.animationGroups.values()].flatMap((e=>e.animations().map((e=>e.id()))));await this.agent.invoke_releaseAnimations({animations:e})}releaseAnimations(e){this.agent.invoke_releaseAnimations({animations:e})}async suspendModel(){await this.agent.invoke_disable().then((()=>this.reset()))}async resumeModel(){await this.agent.invoke_enable()}}var Gi;!function(e){e.AnimationGroupStarted="AnimationGroupStarted",e.AnimationGroupUpdated="AnimationGroupUpdated",e.ModelReset="ModelReset"}(Gi||(Gi={}));class Ki{#zl;#jl;#Vl;#Wl;constructor(e){this.#zl=e}static async parsePayload(e,t){const n=new Ki(e);return await n.setPayload(t),n}async setPayload(e){if(e.viewOrScrollTimeline){const t=await this.#zl.devicePixelRatio();e.viewOrScrollTimeline.startOffset&&(e.viewOrScrollTimeline.startOffset/=t),e.viewOrScrollTimeline.endOffset&&(e.viewOrScrollTimeline.endOffset/=t)}this.#jl=e,this.#Vl&&e.source?this.#Vl.setPayload(e.source):!this.#Vl&&e.source&&(this.#Vl=new Qi(this.#zl,e.source))}percentageToPixels(e,t){const{startOffset:n,endOffset:r}=t;if(void 0===n||void 0===r)throw new Error("startOffset or endOffset does not exist in viewOrScrollTimeline");return e/100*(r-n)}viewOrScrollTimeline(){return this.#jl.viewOrScrollTimeline}id(){return this.#jl.id}name(){return this.#jl.name}paused(){return this.#jl.pausedState}playState(){return this.#Wl||this.#jl.playState}playbackRate(){return this.#jl.playbackRate}startTime(){const e=this.viewOrScrollTimeline();return e?this.percentageToPixels(this.playbackRate()>0?this.#jl.startTime:100-this.#jl.startTime,e)+(this.viewOrScrollTimeline()?.startOffset??0):this.#jl.startTime}iterationDuration(){const e=this.viewOrScrollTimeline();return e?this.percentageToPixels(this.source().duration(),e):this.source().duration()}endTime(){return this.source().iterations?this.viewOrScrollTimeline()?this.startTime()+this.iterationDuration()*this.source().iterations():this.startTime()+this.source().delay()+this.source().duration()*this.source().iterations()+this.source().endDelay():1/0}finiteDuration(){const e=Math.min(this.source().iterations(),3);return this.viewOrScrollTimeline()?this.iterationDuration()*e:this.source().delay()+this.source().duration()*e}currentTime(){const e=this.viewOrScrollTimeline();return e?this.percentageToPixels(this.#jl.currentTime,e):this.#jl.currentTime}source(){return this.#Vl}type(){return this.#jl.type}overlaps(e){if(!this.source().iterations()||!e.source().iterations())return!0;const t=this.startTime()=n.startTime()}delayOrStartTime(){return this.viewOrScrollTimeline()?this.startTime():this.source().delay()}setTiming(e,t){this.#Vl.node().then((n=>{if(!n)throw new Error("Unable to find node");this.updateNodeStyle(e,t,n)})),this.#Vl.durationInternal=e,this.#Vl.delayInternal=t,this.#zl.agent.invoke_setTiming({animationId:this.id(),duration:e,delay:t})}updateNodeStyle(e,t,n){let r;if("CSSTransition"===this.type())r="transition-";else{if("CSSAnimation"!==this.type())return;r="animation-"}if(!n.id)throw new Error("Node has no id");const s=n.domModel().cssModel();s.setEffectivePropertyValueForNode(n.id,r+"duration",e+"ms"),s.setEffectivePropertyValueForNode(n.id,r+"delay",t+"ms")}async remoteObjectPromise(){const e=await this.#zl.agent.invoke_resolveAnimation({animationId:this.id()});return e?this.#zl.runtimeModel.createRemoteObject(e.remoteObject):null}cssId(){return this.#jl.cssId||""}}class Qi{#zl;#rs;delayInternal;durationInternal;#Gl;#Kl;constructor(e,t){this.#zl=e,this.setPayload(t)}setPayload(e){this.#rs=e,!this.#Gl&&e.keyframesRule?this.#Gl=new $i(e.keyframesRule):this.#Gl&&e.keyframesRule&&this.#Gl.setPayload(e.keyframesRule),this.delayInternal=e.delay,this.durationInternal=e.duration}delay(){return this.delayInternal}endDelay(){return this.#rs.endDelay}iterations(){return this.delay()||this.endDelay()||this.duration()?this.#rs.iterations||1/0:0}duration(){return this.durationInternal}direction(){return this.#rs.direction}fill(){return this.#rs.fill}node(){return this.#Kl||(this.#Kl=new js(this.#zl.target(),this.backendNodeId())),this.#Kl.resolvePromise()}deferredNode(){return new js(this.#zl.target(),this.backendNodeId())}backendNodeId(){return this.#rs.backendNodeId}keyframesRule(){return this.#Gl||null}easing(){return this.#rs.easing}}class $i{#rs;#rt;constructor(e){this.setPayload(e)}setPayload(e){this.#rs=e,this.#rt?this.#rs.keyframes.forEach(((e,t)=>{this.#rt[t]?.setPayload(e)})):this.#rt=this.#rs.keyframes.map((e=>new Xi(e)))}name(){return this.#rs.name}keyframes(){return this.#rt}}class Xi{#rs;#Ql;constructor(e){this.setPayload(e)}setPayload(e){this.#rs=e,this.#Ql=e.offset}offset(){return this.#Ql}setOffset(e){this.#Ql=100*e+"%"}offsetAsNumber(){return parseFloat(this.#Ql)/100}easing(){return this.#rs.easing}}class Ji{#zl;#C;#$l;#Xl;#Jl;screenshotsInternal;#Yl;constructor(e,t,n){this.#zl=e,this.#C=t,this.#Xl=n,this.#Jl=!1,this.screenshotsInternal=[],this.#Yl=[]}isScrollDriven(){return Boolean(this.#Xl[0]?.viewOrScrollTimeline())}id(){return this.#C}animations(){return this.#Xl}release(){this.#zl.animationGroups.delete(this.id()),this.#zl.releaseAnimations(this.animationIds())}animationIds(){return this.#Xl.map((function(e){return e.id()}))}startTime(){return this.#Xl[0].startTime()}groupDuration(){let e=0;for(const t of this.#Xl)e=Math.max(e,t.delayOrStartTime()+t.iterationDuration());return e}finiteDuration(){let e=0;for(let t=0;te.endTime())&&(e=t);if(!e)throw new Error("No longest animation found");return this.#zl.agent.invoke_getCurrentTime({id:e.id()}).then((({currentTime:e})=>e||0))}matches(e){function t(e){const t=(e.viewOrScrollTimeline()?.sourceNodeId??"")+(e.viewOrScrollTimeline()?.axis??"");return("WebAnimation"===e.type()?e.type()+e.id():e.cssId())+t}if(this.#Xl.length!==e.#Xl.length)return!1;const n=this.#Xl.map(t).sort(),r=e.#Xl.map(t).sort();for(let e=0;ethis.#rd)&&(clearTimeout(this.#nd),this.#nd=window.setTimeout(this.stopScreencast.bind(this),n),this.#rd=r),this.#ed||(this.#ed=!0,this.#td=await this.#Zl.startScreencast("jpeg",80,void 0,300,2,this.screencastFrame.bind(this),(e=>{})))}screencastFrame(e,t){if(!this.#ed)return;const n=window.performance.now();this.#de=this.#de.filter((function(e){return e.endTime>=n}));for(const t of this.#de)t.screenshots.push(e)}stopScreencast(){this.#td&&(this.#Zl.stopScreencast(this.#td),this.#nd=void 0,this.#rd=void 0,this.#de=[],this.#ed=!1,this.#td=void 0)}}h.register(Wi,{capabilities:2,autostart:!0});var eo=Object.freeze({__proto__:null,AnimationDOMNode:ji,AnimationDispatcher:Yi,AnimationEffect:Qi,AnimationGroup:Ji,AnimationImpl:Ki,AnimationModel:Wi,get Events(){return Gi},KeyframeStyle:Xi,KeyframesRule:$i,ScreenshotCapture:Zi});class to extends h{agent;#yr;#sd;constructor(t){super(t),this.agent=t.autofillAgent(),this.#sd=e.Settings.Settings.instance().createSetting("show-test-addresses-in-autofill-menu-on-event",!1),t.registerAutofillDispatcher(this),this.enable()}setTestAddresses(){this.agent.invoke_setAddresses({addresses:this.#sd.get()?[{fields:[{name:"ADDRESS_HOME_COUNTRY",value:"US"},{name:"NAME_FULL",value:"Jon Stewart Doe"},{name:"NAME_FIRST",value:"Jon"},{name:"NAME_MIDDLE",value:"Stewart"},{name:"NAME_LAST",value:"Doe"},{name:"COMPANY_NAME",value:"Fake Company"},{name:"ADDRESS_HOME_LINE1",value:"1600 Fake Street"},{name:"ADDRESS_HOME_LINE2",value:"Apartment 1"},{name:"ADDRESS_HOME_ZIP",value:"94043"},{name:"ADDRESS_HOME_CITY",value:"Mountain View"},{name:"ADDRESS_HOME_STATE",value:"CA"},{name:"EMAIL_ADDRESS",value:"test@example.us"},{name:"PHONE_HOME_WHOLE_NUMBER",value:"+16019521325"}]},{fields:[{name:"ADDRESS_HOME_COUNTRY",value:"BR"},{name:"NAME_FULL",value:"João Souza Silva"},{name:"NAME_FIRST",value:"João"},{name:"NAME_LAST",value:"Souza Silva"},{name:"NAME_LAST_FIRST",value:"Souza"},{name:"NAME_LAST_SECOND",value:"Silva"},{name:"COMPANY_NAME",value:"Empresa Falsa"},{name:"ADDRESS_HOME_STREET_ADDRESS",value:"Rua Inexistente, 2000\nAndar 2, Apartamento 1"},{name:"ADDRESS_HOME_STREET_LOCATION",value:"Rua Inexistente, 2000"},{name:"ADDRESS_HOME_STREET_NAME",value:"Rua Inexistente"},{name:"ADDRESS_HOME_HOUSE_NUMBER",value:"2000"},{name:"ADDRESS_HOME_SUBPREMISE",value:"Andar 2, Apartamento 1"},{name:"ADDRESS_HOME_APT_NUM",value:"1"},{name:"ADDRESS_HOME_FLOOR",value:"2"},{name:"ADDRESS_HOME_APT",value:"Apartamento 1"},{name:"ADDRESS_HOME_APT_TYPE",value:"Apartamento"},{name:"ADDRESS_HOME_APT_NUM",value:"1"},{name:"ADDRESS_HOME_DEPENDENT_LOCALITY",value:"Santa Efigênia"},{name:"ADDRESS_HOME_LANDMARK",value:"Próximo à estação Santa Efigênia"},{name:"ADDRESS_HOME_OVERFLOW",value:"Andar 2, Apartamento 1"},{name:"ADDRESS_HOME_ZIP",value:"30260-080"},{name:"ADDRESS_HOME_CITY",value:"Belo Horizonte"},{name:"ADDRESS_HOME_STATE",value:"MG"},{name:"EMAIL_ADDRESS",value:"teste@exemplo.us"},{name:"PHONE_HOME_WHOLE_NUMBER",value:"+553121286800"}]},{fields:[{name:"ADDRESS_HOME_COUNTRY",value:"MX"},{name:"NAME_FULL",value:"Juan Francisco García Flores"},{name:"NAME_FIRST",value:"Juan Francisco"},{name:"NAME_LAST",value:"García Flores"},{name:"NAME_LAST_FIRST",value:"García"},{name:"NAME_LAST_SECOND",value:"Flores"},{name:"COMPANY_NAME",value:"Empresa Falsa"},{name:"ADDRESS_HOME_STREET_ADDRESS",value:"C. Falsa 445\nPiso 2, Apartamento 1\nEntre calle Volcán y calle Montes Blancos, cerca de la estación de metro"},{name:"ADDRESS_HOME_STREET_LOCATION",value:"C. Falsa 445"},{name:"ADDRESS_HOME_STREET_NAME",value:"C. Falsa"},{name:"ADDRESS_HOME_HOUSE_NUMBER",value:"445"},{name:"ADDRESS_HOME_SUBPREMISE",value:"Piso 2, Apartamento 1"},{name:"ADDRESS_HOME_FLOOR",value:"2"},{name:"ADDRESS_HOME_APT",value:"Apartamento 1"},{name:"ADDRESS_HOME_APT_TYPE",value:"Apartamento"},{name:"ADDRESS_HOME_APT_NUM",value:"1"},{name:"ADDRESS_HOME_DEPENDENT_LOCALITY",value:"Lomas de Chapultepec"},{name:"ADDRESS_HOME_OVERFLOW",value:"Entre calle Volcán y calle Montes Celestes, cerca de la estación de metro"},{name:"ADDRESS_HOME_BETWEEN_STREETS_OR_LANDMARK",value:"Entre calle Volcán y calle Montes Blancos, cerca de la estación de metro"},{name:"ADDRESS_HOME_LANDMARK",value:"Cerca de la estación de metro"},{name:"ADDRESS_HOME_BETWEEN_STREETS",value:"Entre calle Volcán y calle Montes Blancos"},{name:"ADDRESS_HOME_BETWEEN_STREETS_1",value:"calle Volcán"},{name:"ADDRESS_HOME_BETWEEN_STREETS_2",value:"calle Montes Blancos"},{name:"ADDRESS_HOME_ADMIN_LEVEL2",value:"Miguel Hidalgo"},{name:"ADDRESS_HOME_ZIP",value:"11001"},{name:"ADDRESS_HOME_CITY",value:"Ciudad de México"},{name:"ADDRESS_HOME_STATE",value:"Distrito Federal"},{name:"EMAIL_ADDRESS",value:"ejemplo@ejemplo.mx"},{name:"PHONE_HOME_WHOLE_NUMBER",value:"+525553428400"}]},{fields:[{name:"ADDRESS_HOME_COUNTRY",value:"DE"},{name:"NAME_FULL",value:"Gottfried Wilhelm Leibniz"},{name:"NAME_FIRST",value:"Gottfried"},{name:"NAME_MIDDLE",value:"Wilhelm"},{name:"NAME_LAST",value:"Leibniz"},{name:"COMPANY_NAME",value:"Erfundenes Unternehmen"},{name:"ADDRESS_HOME_LINE1",value:"Erfundene Straße 33"},{name:"ADDRESS_HOME_LINE2",value:"Wohnung 1"},{name:"ADDRESS_HOME_ZIP",value:"80732"},{name:"ADDRESS_HOME_CITY",value:"München"},{name:"EMAIL_ADDRESS",value:"test@beispiel.de"},{name:"PHONE_HOME_WHOLE_NUMBER",value:"+4930303986300"}]}]:[]})}enable(){this.#yr||a.InspectorFrontendHost.isUnderTest()||(this.agent.invoke_enable(),this.setTestAddresses(),this.#yr=!0)}disable(){this.#yr&&!a.InspectorFrontendHost.isUnderTest()&&(this.#yr=!1,this.agent.invoke_disable())}addressFormFilled(e){this.dispatchEventToListeners("AddressFormFilled",{autofillModel:this,event:e})}}h.register(to,{capabilities:2,autostart:!0});var no=Object.freeze({__proto__:null,AutofillModel:to});class ro{name;#id;enabledInternal;constructor(e,t){this.#id=e,this.name=t,this.enabledInternal=!1}category(){return this.#id}enabled(){return this.enabledInternal}setEnabled(e){this.enabledInternal=e}}var so=Object.freeze({__proto__:null,CategorizedBreakpoint:ro});class io{#od;#ad=[];#ld=new Map;#dd=new Map;#cd=new Map;#hd=new Map;#ud=new Map;#gd=[];#pd=[];#md=[];static enhancedTraceVersion=1;constructor(e){this.#od=e;try{this.parseEnhancedTrace()}catch(e){throw new i.UserVisibleError(e)}}parseEnhancedTrace(){for(const e of this.#od.traceEvents)if(this.isTargetRundownEvent(e)){const t=e.args?.data;this.#ld.set(this.getScriptIsolateId(t.isolate,t.scriptId),t.v8context),this.#dd.set(this.getScriptIsolateId(t.isolate,t.scriptId),t.frame),this.#gd.find((e=>e.targetId===t.frame))||this.#gd.push({targetId:t.frame,type:t.frameType,isolate:t.isolate,pid:e.pid,url:t.url}),this.#pd.find((e=>e.v8Context===t.v8context))||this.#pd.push({id:-1,origin:t.origin,v8Context:t.v8context,auxData:{frameId:t.frame,isDefault:t.isDefault,type:t.contextType},isolate:t.isolate})}else if(this.isScriptRundownEvent(e)){this.#ad.push(e);const t=e.args.data;this.#md.find((e=>e.scriptId===t.scriptId&&e.isolate===t.isolate))||this.#md.push({scriptId:t.scriptId,isolate:t.isolate,executionContextId:t.executionContextId,startLine:t.startLine,startColumn:t.startColumn,endLine:t.endLine,endColumn:t.endColumn,hash:t.hash,isModule:t.isModule,url:t.url,hasSourceURL:t.hasSourceUrl,sourceURL:t.sourceUrl,sourceMapURL:t.sourceMapUrl})}else if(this.isScriptRundownSourceEvent(e)){const t=e.args.data,n=this.getScriptIsolateId(t.isolate,t.scriptId);if("splitIndex"in t&&"splitCount"in t){this.#hd.has(n)||this.#hd.set(n,new Array(t.splitCount).fill(""));const e=this.#hd.get(n);e&&t.sourceText&&(e[t.splitIndex]=t.sourceText)}else t.sourceText&&this.#cd.set(n,t.sourceText),t.length&&this.#ud.set(n,t.length)}}data(){const e=new Map;this.#ad.forEach((t=>{const n=t.args.data,r=this.#ld.get(this.getScriptIsolateId(n.isolate,n.scriptId));r&&e.set(r,n.executionContextId)})),this.#pd.forEach((t=>{if(t.v8Context){const n=e.get(t.v8Context);n&&(t.id=n)}})),this.#md.forEach((e=>{const t=this.getScriptIsolateId(e.isolate,e.scriptId);if(this.#cd.has(t))e.sourceText=this.#cd.get(t),e.length=this.#ud.get(t);else if(this.#hd.has(t)){const n=this.#hd.get(t);n&&(e.sourceText=n.join(""),e.length=e.sourceText.length)}e.auxData=this.#pd.find((t=>t.id===e.executionContextId&&t.isolate===e.isolate))?.auxData}));for(const e of this.#md)e.sourceMapURL=this.getEncodedSourceMapUrl(e);const t=new Map;for(const e of this.#gd)t.set(e,this.groupContextsAndScriptsUnderTarget(e,this.#pd,this.#md));return t}getEncodedSourceMapUrl(e){if(e.sourceMapURL?.startsWith("data:"))return e.sourceMapURL;const t=this.getSourceMapFromMetadata(e);if(t)try{return`data:text/plain;base64,${btoa(JSON.stringify(t))}`}catch{return}}getSourceMapFromMetadata(t){const{hasSourceURL:n,sourceURL:r,url:s,sourceMapURL:i,isolate:o,scriptId:a}=t;if(!i||!this.#od.metadata.sourceMaps)return;const l=this.#dd.get(this.getScriptIsolateId(o,a));if(!l)return;const d=this.#gd.find((e=>e.targetId===l));if(!d)return;let c=s;if(n&&r){const t=d.url;c=e.ParsedURL.ParsedURL.completeURL(t,r)??r}const h=e.ParsedURL.ParsedURL.completeURL(c,i);if(!h)return;const{sourceMap:u}=this.#od.metadata.sourceMaps.find((e=>e.sourceMapUrl===h))??{};return u}getScriptIsolateId(e,t){return t+"@"+e}isTraceEvent(e){return"cat"in e&&"pid"in e&&"args"in e&&"data"in e.args}isTargetRundownEvent(e){return this.isTraceEvent(e)&&"disabled-by-default-devtools.target-rundown"===e.cat}isScriptRundownEvent(e){return this.isTraceEvent(e)&&"disabled-by-default-devtools.v8-source-rundown"===e.cat}isScriptRundownSourceEvent(e){return this.isTraceEvent(e)&&"disabled-by-default-devtools.v8-source-rundown-sources"===e.cat}groupContextsAndScriptsUnderTarget(e,t,n){const r=[],s=[];for(const n of t)n.auxData?.frameId===e.targetId&&r.push(n);for(const t of n)null===t.auxData&&console.error(t+" missing aux data"),t.auxData?.frameId===e.targetId&&s.push(t);return[r,s]}}var oo=Object.freeze({__proto__:null,EnhancedTracesParser:io});class ao{traceEvents;metadata;constructor(e,t={}){this.traceEvents=e,this.metadata=t}}class lo{networkRequest;constructor(e){this.networkRequest=e}static create(t){const n=t.args.data.url,r=e.ParsedURL.ParsedURL.urlWithoutHash(n),s=ii.resourceForURL(n)??ii.resourceForURL(r),i=s?.request;return i?new lo(i):null}}var co=Object.freeze({__proto__:null,RevealableEvent:class{event;constructor(e){this.event=e}},RevealableNetworkRequest:lo,TraceObject:ao});const ho={noSourceText:"No source text available",noHostWindow:"Can not find host window",errorLoadingLog:"Error loading log"},uo=n.i18n.registerUIStrings("core/sdk/RehydratingConnection.ts",ho),go=n.i18n.getLocalizedString.bind(void 0,uo);class po{rehydratingConnectionState=1;onDisconnect=null;onMessage=null;trace=null;sessions=new Map;#fd;#bd;#yd=this.#vd.bind(this);constructor(e){this.#fd=e,this.#bd=window,this.#Id()}#Id(){this.#bd.addEventListener("message",this.#yd),this.#bd.opener||this.#fd({reason:go(ho.noHostWindow)}),this.#bd.opener.postMessage({type:"REHYDRATING_WINDOW_READY"})}#vd(e){if("REHYDRATING_TRACE_FILE"===e.data.type){const{traceFile:t}=e.data,n=new FileReader;n.onload=async()=>{await this.startHydration(n.result)},n.onerror=()=>{this.#fd({reason:go(ho.errorLoadingLog)})},n.readAsText(t)}this.#bd.removeEventListener("message",this.#yd)}async startHydration(e){if(!this.onMessage||2!==this.rehydratingConnectionState)return!1;const t=JSON.parse(e);if(!("traceEvents"in t))return console.error("RehydratingConnection failed to initialize due to missing trace events in payload"),!1;this.trace=t;const n=new io(t).data();let r=0;this.sessions.set(r,new mo(this));for(const[e,[t,s]]of n.entries())this.postToFrontend({method:"Target.targetCreated",params:{targetInfo:{targetId:e.targetId,type:e.type,title:e.url,url:e.url,attached:!1,canAccessOpener:!1}}}),r+=1,this.sessions.set(r,new fo(r,e,t,s,this));return await this.#wd(),!0}async#wd(){if(!this.trace)return;this.rehydratingConnectionState=3;const t=new ao(this.trace.traceEvents,this.trace.metadata);await e.Revealer.reveal(t)}setOnMessage(e){this.onMessage=e,this.rehydratingConnectionState=2}setOnDisconnect(e){this.onDisconnect=e}sendRawMessage(e){"string"==typeof e&&(e=JSON.parse(e));const t=e;if(void 0!==t.sessionId){const e=this.sessions.get(t.sessionId);e?e.handleFrontendMessageAsFakeCDPAgent(t):console.error("Invalid SessionId: "+t.sessionId)}else this.sessions.get(0)?.handleFrontendMessageAsFakeCDPAgent(t)}postToFrontend(e){this.onMessage?this.onMessage(e):console.error("onMessage was not initialized")}disconnect(){return Promise.reject()}}class mo{connection=null;constructor(e){this.connection=e}sendMessageToFrontend(e){requestAnimationFrame((()=>{this.connection&&this.connection.postToFrontend(e)}))}handleFrontendMessageAsFakeCDPAgent(e){this.sendMessageToFrontend({id:e.id,result:{}})}}class fo extends mo{sessionId;target;executionContexts=[];scripts=[];constructor(e,t,n,r,s){super(s),this.sessionId=e,this.target=t,this.executionContexts=n,this.scripts=r,this.sessionAttachToTarget()}sendMessageToFrontend(e,t=!0){0!==this.sessionId&&t&&(e.sessionId=this.sessionId),super.sendMessageToFrontend(e)}handleFrontendMessageAsFakeCDPAgent(e){switch(e.method){case"Runtime.enable":this.handleRuntimeEnabled(e.id);break;case"Debugger.enable":this.handleDebuggerEnable(e.id);break;case"Debugger.getScriptSource":if(e.params){const t=e.params;this.handleDebuggerGetScriptSource(e.id,t.scriptId)}break;default:this.sendMessageToFrontend({id:e.id,result:{}})}}sessionAttachToTarget(){this.sendMessageToFrontend({method:"Target.attachedToTarget",params:{sessionId:this.sessionId,waitingForDebugger:!1,targetInfo:{targetId:this.target.targetId,type:this.target.type,title:this.target.url,url:this.target.url,attached:!0,canAccessOpener:!1}}},!1)}handleRuntimeEnabled(e){for(const e of this.executionContexts)e.name=e.origin,this.sendMessageToFrontend({method:"Runtime.executionContextCreated",params:{context:e}});this.sendMessageToFrontend({id:e,result:{}})}handleDebuggerGetScriptSource(e,t){const n=this.scripts.find((e=>e.scriptId===t));n?this.sendMessageToFrontend({id:e,result:{scriptSource:void 0===n.sourceText?go(ho.noSourceText):n.sourceText}}):console.error("No script for id: "+t)}handleDebuggerEnable(e){for(const e of this.scripts)this.sendMessageToFrontend({method:"Debugger.scriptParsed",params:e});this.sendMessageToFrontend({id:e,result:{debuggerId:"7777777777777777777.8888888888888888888"}})}}const bo={websocketDisconnected:"WebSocket disconnected"},yo=n.i18n.registerUIStrings("core/sdk/Connections.ts",bo),vo=n.i18n.getLocalizedString.bind(void 0,yo);class Io{onMessage;#Sd;#kd;#Cd;#Vt;constructor(){this.onMessage=null,this.#Sd=null,this.#kd="",this.#Cd=0,this.#Vt=[a.InspectorFrontendHost.InspectorFrontendHostInstance.events.addEventListener(a.InspectorFrontendHostAPI.Events.DispatchMessage,this.dispatchMessage,this),a.InspectorFrontendHost.InspectorFrontendHostInstance.events.addEventListener(a.InspectorFrontendHostAPI.Events.DispatchMessageChunk,this.dispatchMessageChunk,this)]}setOnMessage(e){this.onMessage=e}setOnDisconnect(e){this.#Sd=e}sendRawMessage(e){this.onMessage&&a.InspectorFrontendHost.InspectorFrontendHostInstance.sendMessageToBackend(e)}dispatchMessage(e){this.onMessage&&this.onMessage.call(null,e.data)}dispatchMessageChunk(e){const{messageChunk:t,messageSize:n}=e.data;n&&(this.#kd="",this.#Cd=n),this.#kd+=t,this.#kd.length===this.#Cd&&this.onMessage&&(this.onMessage.call(null,this.#kd),this.#kd="",this.#Cd=0)}async disconnect(){const t=this.#Sd;e.EventTarget.removeEventListeners(this.#Vt),this.#Sd=null,this.onMessage=null,t&&t.call(null,"force disconnect")}}class wo{#xd;onMessage;#Sd;#Rd;#Td;#Md;constructor(e,t){this.#xd=new WebSocket(e),this.#xd.onerror=this.onError.bind(this),this.#xd.onopen=this.onOpen.bind(this),this.#xd.onmessage=e=>{this.onMessage&&this.onMessage.call(null,e.data)},this.#xd.onclose=this.onClose.bind(this),this.onMessage=null,this.#Sd=null,this.#Rd=t,this.#Td=!1,this.#Md=[]}setOnMessage(e){this.onMessage=e}setOnDisconnect(e){this.#Sd=e}onError(e){this.#Rd&&this.#Rd.call(null,{reason:vo(bo.websocketDisconnected),errorType:e.type}),this.#Sd&&this.#Sd.call(null,"connection failed"),this.close()}onOpen(){if(this.#Td=!0,this.#xd){this.#xd.onerror=console.error;for(const e of this.#Md)this.#xd.send(e)}this.#Md=[]}onClose(e){this.#Rd&&this.#Rd.call(null,{reason:e.reason,code:String(e.code||0)}),this.#Sd&&this.#Sd.call(null,"websocket closed"),this.close()}close(e){this.#xd&&(this.#xd.onerror=null,this.#xd.onopen=null,this.#xd.onclose=e||null,this.#xd.onmessage=null,this.#xd.close(),this.#xd=null),this.#Rd=null}sendRawMessage(e){this.#Td&&this.#xd?this.#xd.send(e):this.#Md.push(e)}disconnect(){return new Promise((e=>{this.close((()=>{this.#Sd&&this.#Sd.call(null,"force disconnect"),e()}))}))}}class So{onMessage;#Sd;constructor(){this.onMessage=null,this.#Sd=null}setOnMessage(e){this.onMessage=e}setOnDisconnect(e){this.#Sd=e}sendRawMessage(e){window.setTimeout(this.respondWithError.bind(this,e),0)}respondWithError(e){const t=JSON.parse(e),n={message:"This is a stub connection, can't dispatch message.",code:l.InspectorBackend.DevToolsStubErrorCode,data:t};this.onMessage&&this.onMessage.call(null,{id:t.id,error:n})}async disconnect(){this.#Sd&&this.#Sd.call(null,"force disconnect"),this.#Sd=null,this.onMessage=null}}class ko{#Pd;#Ed;onMessage;#Sd;constructor(e,t){this.#Pd=e,this.#Ed=t,this.onMessage=null,this.#Sd=null}setOnMessage(e){this.onMessage=e}setOnDisconnect(e){this.#Sd=e}getOnDisconnect(){return this.#Sd}sendRawMessage(e){const t=JSON.parse(e);t.sessionId||(t.sessionId=this.#Ed),this.#Pd.sendRawMessage(JSON.stringify(t))}getSessionId(){return this.#Ed}async disconnect(){this.#Sd&&this.#Sd.call(null,"force disconnect"),this.#Sd=null,this.onMessage=null}}function Co(e){if(o.Runtime.getPathName().includes("rehydrated_devtools_app"))return new po(e);const t=o.Runtime.Runtime.queryParam("ws"),n=o.Runtime.Runtime.queryParam("wss");if(t||n){const r=t?"ws":"wss";let s=t||n;a.InspectorFrontendHost.InspectorFrontendHostInstance.isHostedMode()&&s.startsWith("/")&&(s=`${window.location.host}${s}`);return new wo(`${r}://${s}`,e)}return a.InspectorFrontendHost.InspectorFrontendHostInstance.isHostedMode()?new So:new Io}var xo=Object.freeze({__proto__:null,MainConnection:Io,ParallelConnection:ko,StubConnection:So,WebSocketConnection:wo,initMainConnection:async function(e,t){l.InspectorBackend.Connection.setFactory(Co.bind(null,t)),await e(),a.InspectorFrontendHost.InspectorFrontendHostInstance.connectionReady()}});const Ro={main:"Main"},To=n.i18n.registerUIStrings("core/sdk/ChildTargetManager.ts",Ro),Mo=n.i18n.getLocalizedString.bind(void 0,To);class Po extends h{#Ld;#Ad;#Od;#Dd=new Map;#Nd=new Map;#Fd=new Map;#Bd=new Map;#_d=null;constructor(e){super(e),this.#Ld=e.targetManager(),this.#Ad=e,this.#Od=e.targetAgent(),e.registerTargetDispatcher(this);const t=this.#Ld.browserTarget();t?t!==e&&t.targetAgent().invoke_autoAttachRelated({targetId:e.id(),waitForDebuggerOnStart:!0}):this.#Od.invoke_setAutoAttach({autoAttach:!0,waitForDebuggerOnStart:!0,flatten:!0}),e.parentTarget()?.type()===U.FRAME||a.InspectorFrontendHost.isUnderTest()||(this.#Od.invoke_setDiscoverTargets({discover:!0}),this.#Od.invoke_setRemoteLocations({locations:[{host:"localhost",port:9229}]}))}static install(e){Po.attachCallback=e,h.register(Po,{capabilities:32,autostart:!0})}childTargets(){return Array.from(this.#Nd.values())}async suspendModel(){await this.#Od.invoke_setAutoAttach({autoAttach:!0,waitForDebuggerOnStart:!1,flatten:!0})}async resumeModel(){await this.#Od.invoke_setAutoAttach({autoAttach:!0,waitForDebuggerOnStart:!0,flatten:!0})}dispose(){for(const e of this.#Nd.keys())this.detachedFromTarget({sessionId:e,targetId:void 0})}targetCreated({targetInfo:e}){this.#Dd.set(e.targetId,e),this.fireAvailableTargetsChanged(),this.dispatchEventToListeners("TargetCreated",e)}targetInfoChanged({targetInfo:e}){this.#Dd.set(e.targetId,e);const t=this.#Fd.get(e.targetId);if(t)if(t.setHasCrashed(!1),"prerender"!==t.targetInfo()?.subtype||e.subtype)t.updateTargetInfo(e);else{const n=t.model(ii);t.updateTargetInfo(e),n?.mainFrame&&n.primaryPageChanged(n.mainFrame,"Activation"),t.setName(Mo(Ro.main))}this.fireAvailableTargetsChanged(),this.dispatchEventToListeners("TargetInfoChanged",e)}targetDestroyed({targetId:e}){this.#Dd.delete(e),this.fireAvailableTargetsChanged(),this.dispatchEventToListeners("TargetDestroyed",e)}targetCrashed({targetId:e}){const t=this.#Fd.get(e);t&&t.setHasCrashed(!0)}fireAvailableTargetsChanged(){W.instance().dispatchEventToListeners("AvailableTargetsChanged",[...this.#Dd.values()])}async getParentTargetId(){return this.#_d||(this.#_d=(await this.#Ad.targetAgent().invoke_getTargetInfo({})).targetInfo.targetId),this.#_d}async getTargetInfo(){return(await this.#Ad.targetAgent().invoke_getTargetInfo({})).targetInfo}async attachedToTarget({sessionId:t,targetInfo:n,waitingForDebugger:r}){if(this.#_d===n.targetId)return;let s=U.BROWSER,i="";if("worker"===n.type&&n.title&&n.title!==n.url)i=n.title;else if(!["page","iframe","webview"].includes(n.type)){if(["^chrome://print/$","^chrome://file-manager/","^chrome://feedback/","^chrome://.*\\.top-chrome/$","^chrome://view-cert/$","^devtools://"].some((e=>n.url.match(e))))s=U.FRAME;else{const t=e.ParsedURL.ParsedURL.fromString(n.url);i=t?t.lastPathComponentWithFragment():"#"+ ++Po.lastAnonymousTargetId}}"iframe"===n.type||"webview"===n.type||"background_page"===n.type||"app"===n.type||"popup_page"===n.type||"page"===n.type?s=U.FRAME:"worker"===n.type?s=U.Worker:"worklet"===n.type?s=U.WORKLET:"shared_worker"===n.type?s=U.SHARED_WORKER:"shared_storage_worklet"===n.type?s=U.SHARED_STORAGE_WORKLET:"service_worker"===n.type?s=U.ServiceWorker:"auction_worklet"===n.type&&(s=U.AUCTION_WORKLET);const o=this.#Ld.createTarget(n.targetId,i,s,this.#Ad,t,void 0,void 0,n);this.#Nd.set(t,o),this.#Fd.set(o.id(),o),Po.attachCallback&&await Po.attachCallback({target:o,waitingForDebugger:r}),r&&o.runtimeAgent().invoke_runIfWaitingForDebugger()}detachedFromTarget({sessionId:e}){if(this.#Bd.has(e))this.#Bd.delete(e);else{const t=this.#Nd.get(e);t&&(t.dispose("target terminated"),this.#Nd.delete(e),this.#Fd.delete(t.id()))}}receivedMessageFromTarget({}){}async createParallelConnection(e){const t=await this.getParentTargetId(),{connection:n,sessionId:r}=await this.createParallelConnectionAndSessionForTarget(this.#Ad,t);return n.setOnMessage(e),this.#Bd.set(r,n),{connection:n,sessionId:r}}async createParallelConnectionAndSessionForTarget(e,t){const n=e.targetAgent(),r=e.router(),s=(await n.invoke_attachToTarget({targetId:t,flatten:!0})).sessionId,i=new ko(r.connection(),s);return r.registerSession(e,s,i),i.setOnDisconnect((()=>{r.unregisterSession(s),n.invoke_detachFromTarget({sessionId:s})})),{connection:i,sessionId:s}}targetInfos(){return Array.from(this.#Dd.values())}static lastAnonymousTargetId=0;static attachCallback}var Eo=Object.freeze({__proto__:null,ChildTargetManager:Po});const Lo={couldNotLoadContentForSS:"Could not load content for {PH1} ({PH2})"},Ao=n.i18n.registerUIStrings("core/sdk/CompilerSourceMappingContentProvider.ts",Lo),Oo=n.i18n.getLocalizedString.bind(void 0,Ao);var Do,No=Object.freeze({__proto__:null,CompilerSourceMappingContentProvider:class{#Hd;#Ud;#qd;constructor(e,t,n){this.#Hd=e,this.#Ud=t,this.#qd=n}contentURL(){return this.#Hd}contentType(){return this.#Ud}async requestContent(){const e=await this.requestContentData();return t.ContentData.ContentData.asDeferredContent(e)}async requestContentData(){try{const{content:e}=await nr.instance().loadResource(this.#Hd,this.#qd);return new t.ContentData.ContentData(e,!1,this.#Ud.canonicalMimeType())}catch(e){const t=Oo(Lo.couldNotLoadContentForSS,{PH1:this.#Hd,PH2:e.message});return console.error(t),{error:t}}}async searchInContent(e,n,r){const s=await this.requestContentData();return t.TextUtils.performSearchInContentData(s,e,n,r)}}});!function(e){e.Result="result",e.Command="command",e.System="system",e.QueryObjectResult="queryObjectResult"}(Do||(Do={}));const Fo={profileD:"Profile {PH1}"},Bo=n.i18n.registerUIStrings("core/sdk/CPUProfilerModel.ts",Fo),_o=n.i18n.getLocalizedString.bind(void 0,Bo);class Ho extends h{#zd;#jd;#Vd;#Wd;#Gd;registeredConsoleProfileMessages=[];constructor(e){super(e),this.#zd=1,this.#jd=new Map,this.#Vd=e.profilerAgent(),this.#Wd=null,e.registerProfilerDispatcher(this),this.#Vd.invoke_enable(),this.#Gd=e.model(ms)}runtimeModel(){return this.#Gd.runtimeModel()}debuggerModel(){return this.#Gd}consoleProfileStarted({id:e,location:t,title:n}){n||(n=_o(Fo.profileD,{PH1:this.#zd++}),this.#jd.set(e,n));const r=this.createEventDataFrom(e,t,n);this.dispatchEventToListeners("ConsoleProfileStarted",r)}consoleProfileFinished({id:e,location:t,profile:n,title:r}){r||(r=this.#jd.get(e),this.#jd.delete(e));const s={...this.createEventDataFrom(e,t,r),cpuProfile:n};this.registeredConsoleProfileMessages.push(s),this.dispatchEventToListeners("ConsoleProfileFinished",s)}createEventDataFrom(e,t,n){const r=Is.fromPayload(this.#Gd,t);return{id:this.target().id()+"."+e,scriptLocation:r,title:n||"",cpuProfilerModel:this}}startRecording(){return this.#Vd.invoke_setSamplingInterval({interval:100}),this.#Vd.invoke_start()}stopRecording(){return this.#Vd.invoke_stop().then((e=>e.profile||null))}startPreciseCoverage(e,t){this.#Wd=t;return this.#Vd.invoke_startPreciseCoverage({callCount:!1,detailed:e,allowTriggeredUpdates:!0})}async takePreciseCoverage(){const e=await this.#Vd.invoke_takePreciseCoverage();return{timestamp:e?.timestamp||0,coverage:e?.result||[]}}stopPreciseCoverage(){return this.#Wd=null,this.#Vd.invoke_stopPreciseCoverage()}preciseCoverageDeltaUpdate({timestamp:e,occasion:t,result:n}){this.#Wd&&this.#Wd(e,t,n)}}h.register(Ho,{capabilities:4,autostart:!0});var Uo=Object.freeze({__proto__:null,CPUProfilerModel:Ho});class qo extends h{#Kd;constructor(e){super(e),e.registerLogDispatcher(this),this.#Kd=e.logAgent(),this.#Kd.invoke_enable(),a.InspectorFrontendHost.isUnderTest()||this.#Kd.invoke_startViolationsReport({config:[{name:"longTask",threshold:200},{name:"longLayout",threshold:30},{name:"blockedEvent",threshold:100},{name:"blockedParser",threshold:-1},{name:"handler",threshold:150},{name:"recurringHandler",threshold:50},{name:"discouragedAPIUse",threshold:-1}]})}entryAdded({entry:e}){this.dispatchEventToListeners("EntryAdded",{logModel:this,entry:e})}requestClear(){this.#Kd.invoke_clear()}}h.register(qo,{capabilities:8,autostart:!0});var zo=Object.freeze({__proto__:null,LogModel:qo});const jo={navigatedToS:"Navigated to {PH1}",bfcacheNavigation:"Navigation to {PH1} was restored from back/forward cache (see https://web.dev/bfcache/)",profileSStarted:"Profile ''{PH1}'' started.",profileSFinished:"Profile ''{PH1}'' finished.",failedToSaveToTempVariable:"Failed to save to temp variable."},Vo=n.i18n.registerUIStrings("core/sdk/ConsoleModel.ts",jo),Wo=n.i18n.getLocalizedString.bind(void 0,Vo);class Go extends h{#Qd=[];#$d=new r.MapUtilities.Multimap;#Xd=new Map;#Jd=0;#Yd=0;#Zd=0;#ec=0;#tc=new WeakMap;constructor(t){super(t);const n=t.model(ii);if(!n||n.cachedResourcesLoaded())return void this.initTarget(t);const r=n.addEventListener(ri.CachedResourcesLoaded,(()=>{e.EventTarget.removeEventListeners([r]),this.initTarget(t)}))}initTarget(e){const t=[],n=e.model(Ho);n&&(t.push(n.addEventListener("ConsoleProfileStarted",this.consoleProfileStarted.bind(this,n))),t.push(n.addEventListener("ConsoleProfileFinished",this.consoleProfileFinished.bind(this,n))));const r=e.model(ii);r&&e.parentTarget()?.type()!==U.FRAME&&t.push(r.addEventListener(ri.PrimaryPageChanged,this.primaryPageChanged,this));const s=e.model(Jr);s&&(t.push(s.addEventListener($r.ExceptionThrown,this.exceptionThrown.bind(this,s))),t.push(s.addEventListener($r.ExceptionRevoked,this.exceptionRevoked.bind(this,s))),t.push(s.addEventListener($r.ConsoleAPICalled,this.consoleAPICalled.bind(this,s))),e.parentTarget()?.type()!==U.FRAME&&t.push(s.debuggerModel().addEventListener(ys.GlobalObjectCleared,this.clearIfNecessary,this)),t.push(s.addEventListener($r.QueryObjectRequested,this.queryObjectRequested.bind(this,s)))),this.#tc.set(e,t)}targetRemoved(t){const n=t.model(Jr);n&&this.#Xd.delete(n),e.EventTarget.removeEventListeners(this.#tc.get(t)||[])}async evaluateCommandInConsole(t,n,r,s){const i=await t.evaluate({expression:r,objectGroup:"console",includeCommandLineAPI:s,silent:!1,returnByValue:!1,generatePreview:!0,replMode:!0,allowUnsafeEvalBlockedByCSP:!1},e.Settings.Settings.instance().moduleSetting("console-user-activation-eval").get(),!1);a.userMetrics.actionTaken(a.UserMetrics.Action.ConsoleEvaluated),"error"in i||(await e.Console.Console.instance().showPromise(),this.dispatchEventToListeners(Ko.CommandEvaluated,{result:i.object,commandMessage:n,exceptionDetails:i.exceptionDetails}))}addCommandMessage(e,t){const n=new $o(e.runtimeModel,"javascript",null,t,{type:Do.Command});return n.setExecutionContextId(e.id),this.addMessage(n),n}addMessage(t){t.setPageLoadSequenceNumber(this.#ec),t.source===e.Console.FrontendMessageSource.ConsoleAPI&&"clear"===t.type&&this.clearIfNecessary(),this.#Qd.push(t),this.#$d.set(t.timestamp,t);const n=t.runtimeModel(),r=t.getExceptionId();if(r&&n){let e=this.#Xd.get(n);e||(e=new Map,this.#Xd.set(n,e)),e.set(r,t)}this.incrementErrorWarningCount(t),this.dispatchEventToListeners(Ko.MessageAdded,t)}exceptionThrown(e,t){const n=t.data,r=function(e){if(!e)return;return{requestId:e.requestId||void 0,issueId:e.issueId||void 0}}(n.details.exceptionMetaData),s=$o.fromException(e,n.details,void 0,n.timestamp,void 0,r);s.setExceptionId(n.details.exceptionId),this.addMessage(s)}exceptionRevoked(e,t){const n=t.data,r=this.#Xd.get(e),s=r?r.get(n):null;s&&(this.#Yd--,s.level="verbose",this.dispatchEventToListeners(Ko.MessageUpdated,s))}consoleAPICalled(t,n){const r=n.data;let s="info";"debug"===r.type?s="verbose":"error"===r.type||"assert"===r.type?s="error":"warning"===r.type?s="warning":"info"!==r.type&&"log"!==r.type||(s="info");let i="";r.args.length&&r.args[0].unserializableValue?i=r.args[0].unserializableValue:r.args.length&&("object"!=typeof r.args[0].value&&void 0!==r.args[0].value||null===r.args[0].value)?i=String(r.args[0].value):r.args.length&&r.args[0].description&&(i=r.args[0].description);const o=r.stackTrace?.callFrames.length?r.stackTrace.callFrames[0]:null,a={type:r.type,url:o?.url,line:o?.lineNumber,column:o?.columnNumber,parameters:r.args,stackTrace:r.stackTrace,timestamp:r.timestamp,executionContextId:r.executionContextId,context:r.context},l=new $o(t,e.Console.FrontendMessageSource.ConsoleAPI,s,i,a);for(const e of this.#$d.get(l.timestamp).values())if(l.isEqual(e))return;this.addMessage(l)}queryObjectRequested(t,n){const{objects:r,executionContextId:s}=n.data,i={type:Do.QueryObjectResult,parameters:[r],executionContextId:s},o=new $o(t,e.Console.FrontendMessageSource.ConsoleAPI,"info","",i);this.addMessage(o)}clearIfNecessary(){e.Settings.Settings.instance().moduleSetting("preserve-console-log").get()||this.clear(),++this.#ec}primaryPageChanged(t){if(e.Settings.Settings.instance().moduleSetting("preserve-console-log").get()){const{frame:n}=t.data;n.backForwardCacheDetails.restoredFromCache?e.Console.Console.instance().log(Wo(jo.bfcacheNavigation,{PH1:n.url})):e.Console.Console.instance().log(Wo(jo.navigatedToS,{PH1:n.url}))}}consoleProfileStarted(e,t){const{data:n}=t;this.addConsoleProfileMessage(e,"profile",n.scriptLocation,Wo(jo.profileSStarted,{PH1:n.title}))}consoleProfileFinished(e,t){const{data:n}=t;this.addConsoleProfileMessage(e,"profileEnd",n.scriptLocation,Wo(jo.profileSFinished,{PH1:n.title}))}addConsoleProfileMessage(t,n,r,s){const i=r.script(),o=[{functionName:"",scriptId:r.scriptId,url:i?i.contentURL():"",lineNumber:r.lineNumber,columnNumber:r.columnNumber||0}];this.addMessage(new $o(t.runtimeModel(),e.Console.FrontendMessageSource.ConsoleAPI,"info",s,{type:n,stackTrace:{callFrames:o}}))}incrementErrorWarningCount(e){if("violation"!==e.source)switch(e.level){case"warning":this.#Jd++;break;case"error":this.#Yd++}else this.#Zd++}messages(){return this.#Qd}static allMessagesUnordered(){const e=[];for(const t of W.instance().targets()){const n=t.model(Go)?.messages()||[];e.push(...n)}return e}static requestClearMessages(){for(const e of W.instance().models(qo))e.requestClear();for(const e of W.instance().models(Jr))e.discardConsoleEntries(),e.releaseObjectGroup("live-expression");for(const e of W.instance().targets())e.model(Go)?.clear()}clear(){this.#Qd=[],this.#$d.clear(),this.#Xd.clear(),this.#Yd=0,this.#Jd=0,this.#Zd=0,this.dispatchEventToListeners(Ko.ConsoleCleared)}errors(){return this.#Yd}static allErrors(){let e=0;for(const t of W.instance().targets())e+=t.model(Go)?.errors()||0;return e}warnings(){return this.#Jd}static allWarnings(){let e=0;for(const t of W.instance().targets())e+=t.model(Go)?.warnings()||0;return e}violations(){return this.#Zd}async saveToTempVariable(t,n){if(!n||!t)return void a(null);const r=t,s=await r.globalObject("",!1);if("error"in s||Boolean(s.exceptionDetails)||!s.object)return void a("object"in s&&s.object||null);const i=s.object,o=await i.callFunction((function(e){const t="temp";let n=1;for(;t+n in this;)++n;const r=t+n;return this[r]=e,r}),[Bn.toCallArgument(n)]);if(i.release(),o.wasThrown||!o.object||"string"!==o.object.type)a(o.object||null);else{const e=o.object.value,t=this.addCommandMessage(r,e);this.evaluateCommandInConsole(r,t,e,!1)}function a(t){let n=Wo(jo.failedToSaveToTempVariable);t&&(n=n+" "+t.description),e.Console.Console.instance().error(n)}o.object&&o.object.release()}}var Ko;function Qo(e,t){if(!e!=!t)return!1;if(!e||!t)return!0;const n=e.callFrames,r=t.callFrames;if(n.length!==r.length)return!1;for(let e=0,t=n.length;et.includes(e)));if(-1===n||n===e.length-1)return{callFrame:null,type:null};const r=e[n].url===xs?"LOGPOINT":"CONDITIONAL_BREAKPOINT";return{callFrame:e[n+1],type:r}}}h.register(Go,{capabilities:4,autostart:!0});const Xo=new Map([["xml","xml"],["javascript","javascript"],["network","network"],[e.Console.FrontendMessageSource.ConsoleAPI,"console-api"],["storage","storage"],["appcache","appcache"],["rendering","rendering"],[e.Console.FrontendMessageSource.CSS,"css"],["security","security"],["deprecation","deprecation"],["worker","worker"],["violation","violation"],["intervention","intervention"],["recommendation","recommendation"],["other","other"],[e.Console.FrontendMessageSource.ISSUE_PANEL,"issue-panel"]]);var Jo=Object.freeze({__proto__:null,ConsoleMessage:$o,ConsoleModel:Go,get Events(){return Ko},get FrontendMessageType(){return Do},MessageSourceDisplayName:Xo});class Yo extends h{#lc;#dc;#lt;#cc;#hc;#uc;#gc;#pc;#mc;#fc;#bc;constructor(t){super(t),this.#lc=t.emulationAgent(),this.#dc=t.deviceOrientationAgent(),this.#lt=t.model(Br),this.#cc=t.model(Fs),this.#cc&&this.#cc.addEventListener("InspectModeWillBeToggled",(()=>{this.updateTouch()}),this);const n=e.Settings.Settings.instance().moduleSetting("java-script-disabled");n.addChangeListener((async()=>await this.#lc.invoke_setScriptExecutionDisabled({value:n.get()}))),n.get()&&this.#lc.invoke_setScriptExecutionDisabled({value:!0});const r=e.Settings.Settings.instance().moduleSetting("emulation.touch");r.addChangeListener((()=>{const e=r.get();this.overrideEmulateTouch("force"===e)}));const s=e.Settings.Settings.instance().moduleSetting("emulation.idle-detection");s.addChangeListener((async()=>{const e=s.get();if("none"===e)return void await this.clearIdleOverride();const t=JSON.parse(e);await this.setIdleOverride(t)}));const i=e.Settings.Settings.instance().moduleSetting("emulation.cpu-pressure");i.addChangeListener((async()=>{const e=i.get();if("none"===e)return await this.setPressureSourceOverrideEnabled(!1),void(this.#uc=!1);this.#uc||(this.#uc=!0,await this.setPressureSourceOverrideEnabled(!0)),await this.setPressureStateOverride(e)}));const o=e.Settings.Settings.instance().moduleSetting("emulated-css-media"),a=e.Settings.Settings.instance().moduleSetting("emulated-css-media-feature-color-gamut"),l=e.Settings.Settings.instance().moduleSetting("emulated-css-media-feature-prefers-color-scheme"),d=e.Settings.Settings.instance().moduleSetting("emulated-css-media-feature-forced-colors"),c=e.Settings.Settings.instance().moduleSetting("emulated-css-media-feature-prefers-contrast"),h=e.Settings.Settings.instance().moduleSetting("emulated-css-media-feature-prefers-reduced-data"),u=e.Settings.Settings.instance().moduleSetting("emulated-css-media-feature-prefers-reduced-transparency"),g=e.Settings.Settings.instance().moduleSetting("emulated-css-media-feature-prefers-reduced-motion");this.#hc=new Map([["type",o.get()],["color-gamut",a.get()],["prefers-color-scheme",l.get()],["forced-colors",d.get()],["prefers-contrast",c.get()],["prefers-reduced-data",h.get()],["prefers-reduced-motion",g.get()],["prefers-reduced-transparency",u.get()]]),o.addChangeListener((()=>{this.#hc.set("type",o.get()),this.updateCssMedia()})),a.addChangeListener((()=>{this.#hc.set("color-gamut",a.get()),this.updateCssMedia()})),l.addChangeListener((()=>{this.#hc.set("prefers-color-scheme",l.get()),this.updateCssMedia()})),d.addChangeListener((()=>{this.#hc.set("forced-colors",d.get()),this.updateCssMedia()})),c.addChangeListener((()=>{this.#hc.set("prefers-contrast",c.get()),this.updateCssMedia()})),h.addChangeListener((()=>{this.#hc.set("prefers-reduced-data",h.get()),this.updateCssMedia()})),g.addChangeListener((()=>{this.#hc.set("prefers-reduced-motion",g.get()),this.updateCssMedia()})),u.addChangeListener((()=>{this.#hc.set("prefers-reduced-transparency",u.get()),this.updateCssMedia()})),this.updateCssMedia();const p=e.Settings.Settings.instance().moduleSetting("emulate-auto-dark-mode");p.addChangeListener((()=>{const e=p.get();l.setDisabled(e),l.set(e?"dark":""),this.emulateAutoDarkMode(e)})),p.get()&&(l.setDisabled(!0),l.set("dark"),this.emulateAutoDarkMode(!0));const m=e.Settings.Settings.instance().moduleSetting("emulated-vision-deficiency");m.addChangeListener((()=>this.emulateVisionDeficiency(m.get()))),m.get()&&this.emulateVisionDeficiency(m.get());const f=e.Settings.Settings.instance().moduleSetting("local-fonts-disabled");f.addChangeListener((()=>this.setLocalFontsDisabled(f.get()))),f.get()&&this.setLocalFontsDisabled(f.get());const b=e.Settings.Settings.instance().moduleSetting("avif-format-disabled"),y=e.Settings.Settings.instance().moduleSetting("webp-format-disabled"),v=()=>{const e=[];b.get()&&e.push("avif"),y.get()&&e.push("webp"),this.setDisabledImageTypes(e)};b.addChangeListener(v),y.addChangeListener(v),(b.get()||y.get())&&v(),this.#uc=!1,this.#mc=!0,this.#gc=!1,this.#pc=!1,this.#fc=!1,this.#bc={enabled:!1,configuration:"mobile"}}setTouchEmulationAllowed(e){this.#mc=e}supportsDeviceEmulation(){return this.target().hasAllCapabilities(4096)}async resetPageScaleFactor(){await this.#lc.invoke_resetPageScaleFactor()}async emulateDevice(e){e?await this.#lc.invoke_setDeviceMetricsOverride(e):await this.#lc.invoke_clearDeviceMetricsOverride()}overlayModel(){return this.#cc}async setPressureSourceOverrideEnabled(e){await this.#lc.invoke_setPressureSourceOverrideEnabled({source:"cpu",enabled:e})}async setPressureStateOverride(e){await this.#lc.invoke_setPressureStateOverride({source:"cpu",state:e})}async emulateLocation(e){if(e)if(e.unavailable)await Promise.all([this.#lc.invoke_setGeolocationOverride({}),this.#lc.invoke_setTimezoneOverride({timezoneId:""}),this.#lc.invoke_setLocaleOverride({locale:""}),this.#lc.invoke_setUserAgentOverride({userAgent:ce.instance().currentUserAgent()})]);else{function t(e,t){const n=t.getError();return n?Promise.reject({type:e,message:n}):Promise.resolve()}await Promise.all([this.#lc.invoke_setGeolocationOverride({latitude:e.latitude,longitude:e.longitude,accuracy:Zo.defaultGeoMockAccuracy}).then((e=>t("emulation-set-location",e))),this.#lc.invoke_setTimezoneOverride({timezoneId:e.timezoneId}).then((e=>t("emulation-set-timezone",e))),this.#lc.invoke_setLocaleOverride({locale:e.locale}).then((e=>t("emulation-set-locale",e))),this.#lc.invoke_setUserAgentOverride({userAgent:ce.instance().currentUserAgent(),acceptLanguage:e.locale}).then((e=>t("emulation-set-user-agent",e)))])}else await Promise.all([this.#lc.invoke_clearGeolocationOverride(),this.#lc.invoke_setTimezoneOverride({timezoneId:""}),this.#lc.invoke_setLocaleOverride({locale:""}),this.#lc.invoke_setUserAgentOverride({userAgent:ce.instance().currentUserAgent()})])}async emulateDeviceOrientation(e){e?await this.#dc.invoke_setDeviceOrientationOverride({alpha:e.alpha,beta:e.beta,gamma:e.gamma}):await this.#dc.invoke_clearDeviceOrientationOverride()}async setIdleOverride(e){await this.#lc.invoke_setIdleOverride(e)}async clearIdleOverride(){await this.#lc.invoke_clearIdleOverride()}async emulateCSSMedia(e,t){await this.#lc.invoke_setEmulatedMedia({media:e,features:t}),this.#lt&&this.#lt.mediaQueryResultChanged()}async emulateAutoDarkMode(e){e&&(this.#hc.set("prefers-color-scheme","dark"),await this.updateCssMedia()),await this.#lc.invoke_setAutoDarkModeOverride({enabled:e||void 0})}async emulateVisionDeficiency(e){await this.#lc.invoke_setEmulatedVisionDeficiency({type:e})}setLocalFontsDisabled(e){this.#lt&&this.#lt.setLocalFontsEnabled(!e)}setDisabledImageTypes(e){this.#lc.invoke_setDisabledImageTypes({imageTypes:e})}async setCPUThrottlingRate(e){await this.#lc.invoke_setCPUThrottlingRate({rate:e})}async setHardwareConcurrency(e){if(e<1)throw new Error("hardwareConcurrency must be a positive value");await this.#lc.invoke_setHardwareConcurrencyOverride({hardwareConcurrency:e})}async emulateTouch(e,t){this.#gc=e&&this.#mc,this.#pc=t&&this.#mc,await this.updateTouch()}async overrideEmulateTouch(e){this.#fc=e&&this.#mc,await this.updateTouch()}async updateTouch(){let e={enabled:this.#gc,configuration:this.#pc?"mobile":"desktop"};this.#fc&&(e={enabled:!0,configuration:"mobile"}),this.#cc&&this.#cc.inspectModeEnabled()&&(e={enabled:!1,configuration:"mobile"}),(this.#bc.enabled||e.enabled)&&(this.#bc.enabled&&e.enabled&&this.#bc.configuration===e.configuration||(this.#bc=e,await this.#lc.invoke_setTouchEmulationEnabled({enabled:e.enabled,maxTouchPoints:1}),await this.#lc.invoke_setEmitTouchEventsForMouse({enabled:e.enabled,configuration:e.configuration})))}async updateCssMedia(){const e=this.#hc.get("type")??"",t=[{name:"color-gamut",value:this.#hc.get("color-gamut")??""},{name:"prefers-color-scheme",value:this.#hc.get("prefers-color-scheme")??""},{name:"forced-colors",value:this.#hc.get("forced-colors")??""},{name:"prefers-contrast",value:this.#hc.get("prefers-contrast")??""},{name:"prefers-reduced-data",value:this.#hc.get("prefers-reduced-data")??""},{name:"prefers-reduced-motion",value:this.#hc.get("prefers-reduced-motion")??""},{name:"prefers-reduced-transparency",value:this.#hc.get("prefers-reduced-transparency")??""}];return await this.emulateCSSMedia(e,t)}}class Zo{latitude;longitude;timezoneId;locale;unavailable;constructor(e,t,n,r,s){this.latitude=e,this.longitude=t,this.timezoneId=n,this.locale=r,this.unavailable=s}static parseSetting(e){if(e){const[t,n,r,s]=e.split(":"),[i,o]=t.split("@");return new Zo(parseFloat(i),parseFloat(o),n,r,Boolean(s))}return new Zo(0,0,"","",!1)}static parseUserInput(e,t,n,r){if(!e&&!t)return null;const{valid:s}=Zo.latitudeValidator(e),{valid:i}=Zo.longitudeValidator(t);if(!s&&!i)return null;const o=s?parseFloat(e):-1,a=i?parseFloat(t):-1;return new Zo(o,a,n,r,!1)}static latitudeValidator(e){const t=parseFloat(e);return{valid:/^([+-]?[\d]+(\.\d+)?|[+-]?\.\d+)$/.test(e)&&t>=-90&&t<=90,errorMessage:void 0}}static longitudeValidator(e){const t=parseFloat(e);return{valid:/^([+-]?[\d]+(\.\d+)?|[+-]?\.\d+)$/.test(e)&&t>=-180&&t<=180,errorMessage:void 0}}static timezoneIdValidator(e){return{valid:""===e||/[a-zA-Z]/.test(e),errorMessage:void 0}}static localeValidator(e){return{valid:""===e||/[a-zA-Z]{2}/.test(e),errorMessage:void 0}}toSetting(){return`${this.latitude}@${this.longitude}:${this.timezoneId}:${this.locale}:${this.unavailable||""}`}static defaultGeoMockAccuracy=150}class ea{alpha;beta;gamma;constructor(e,t,n){this.alpha=e,this.beta=t,this.gamma=n}static parseSetting(e){if(e){const t=JSON.parse(e);return new ea(t.alpha,t.beta,t.gamma)}return new ea(0,0,0)}static parseUserInput(e,t,n){if(!e&&!t&&!n)return null;const{valid:r}=ea.alphaAngleValidator(e),{valid:s}=ea.betaAngleValidator(t),{valid:i}=ea.gammaAngleValidator(n);if(!r&&!s&&!i)return null;const o=r?parseFloat(e):-1,a=s?parseFloat(t):-1,l=i?parseFloat(n):-1;return new ea(o,a,l)}static angleRangeValidator(e,t){const n=parseFloat(e);return{valid:/^([+-]?[\d]+(\.\d+)?|[+-]?\.\d+)$/.test(e)&&n>=t.minimum&&n{this.#wc=n=>{e(n),t(n)}})):await new Promise((e=>{this.#wc=e}));const n=await e.runtimeAgent().invoke_evaluate({expression:"navigator.hardwareConcurrency",returnByValue:!0,silent:!0,throwOnSideEffect:!0}),r=n.getError();if(r)throw new Error(r);const{result:s,exceptionDetails:i}=n;if(i)throw new Error(i.text);return s.value}modelAdded(e){if(this.#yc!==ca&&e.setCPUThrottlingRate(this.#yc.rate()),void 0!==this.#Ic&&e.setHardwareConcurrency(this.#Ic),this.#wc){const e=this.#wc;this.#wc=void 0,this.getHardwareConcurrency().then(e)}}modelRemoved(e){}}var la;function da(e){return{title:1===e?ia(na.noThrottling):ia(na.dSlowdown,{PH1:e}),rate:()=>e,jslogContext:1===e?"cpu-no-throttling":`cpu-throttled-${e}`}}!function(e){e[e.NO_THROTTLING=1]="NO_THROTTLING",e[e.MID_TIER_MOBILE=4]="MID_TIER_MOBILE",e[e.LOW_TIER_MOBILE=6]="LOW_TIER_MOBILE",e[e.EXTRA_SLOW=20]="EXTRA_SLOW",e[e.MidTierMobile=4]="MidTierMobile",e[e.LowEndMobile=6]="LowEndMobile"}(la||(la={}));const ca=da(la.NO_THROTTLING),ha=da(la.MID_TIER_MOBILE),ua=da(la.LOW_TIER_MOBILE),ga=da(la.EXTRA_SLOW);function pa(t){const n=()=>{const n=e.Settings.Settings.instance().createSetting("calibrated-cpu-throttling",{},"Global").get();return"low-tier-mobile"===t?n.low??null:"mid-tier-mobile"===t?n.mid??null:null};return{title(){const e=sa("low-tier-mobile"===t?na.calibratedLowTierMobile:na.calibratedMidTierMobile),r=n();return"number"==typeof r?`${e} – ${r.toFixed(1)}×`:e},rate(){const e=n();return"number"==typeof e?e:0},calibratedDeviceType:t,jslogContext:`cpu-throttled-calibrated-${t}`}}const ma=pa("low-tier-mobile"),fa=pa("mid-tier-mobile");var ba;!function(e){e.DEVICE_TOO_WEAK="DEVICE_TOO_WEAK"}(ba||(ba={}));var ya=Object.freeze({__proto__:null,CPUThrottlingManager:aa,get CPUThrottlingRates(){return la},CalibratedLowTierMobileThrottlingOption:ma,CalibratedMidTierMobileThrottlingOption:fa,get CalibrationError(){return ba},ExtraSlowThrottlingOption:ga,LowTierThrottlingOption:ua,MidTierThrottlingOption:ha,NoThrottlingOption:ca,calibrationErrorToString:function(e){return e===ba.DEVICE_TOO_WEAK?sa(na.calibrationErrorDeviceTooWeak):e},throttlingManager:function(){return aa.instance()}});class va extends h{agent;#Ir;#er;#kc;#Cc;suspended=!1;constructor(t){super(t),this.agent=t.domdebuggerAgent(),this.#Ir=t.model(Jr),this.#er=t.model(Gs),this.#er.addEventListener(Us.DocumentUpdated,this.documentUpdated,this),this.#er.addEventListener(Us.NodeRemoved,this.nodeRemoved,this),this.#kc=[],this.#Cc=e.Settings.Settings.instance().createLocalSetting("dom-breakpoints",[]),this.#er.existingDocument()&&this.documentUpdated()}runtimeModel(){return this.#Ir}async suspendModel(){this.suspended=!0}async resumeModel(){this.suspended=!1}async eventListeners(e){if(console.assert(e.runtimeModel()===this.#Ir),!e.objectId)return[];const t=await this.agent.invoke_getEventListeners({objectId:e.objectId}),n=[];for(const r of t.listeners||[]){const t=this.#Ir.debuggerModel().createRawLocationByScriptId(r.scriptId,r.lineNumber,r.columnNumber);t&&n.push(new Sa(this,e,r.type,r.useCapture,r.passive,r.once,r.handler?this.#Ir.createRemoteObject(r.handler):null,r.originalHandler?this.#Ir.createRemoteObject(r.originalHandler):null,t,null))}return n}retrieveDOMBreakpoints(){this.#er.requestDocument()}domBreakpoints(){return this.#kc.slice()}hasDOMBreakpoint(e,t){return this.#kc.some((n=>n.node===e&&n.type===t))}setDOMBreakpoint(e,t){for(const n of this.#kc)if(n.node===e&&n.type===t)return this.toggleDOMBreakpoint(n,!0),n;const n=new wa(this,e,t,!0);return this.#kc.push(n),this.saveDOMBreakpoints(),this.enableDOMBreakpoint(n),this.dispatchEventToListeners("DOMBreakpointAdded",n),n}removeDOMBreakpoint(e,t){this.removeDOMBreakpoints((n=>n.node===e&&n.type===t))}removeAllDOMBreakpoints(){this.removeDOMBreakpoints((e=>!0))}toggleDOMBreakpoint(e,t){t!==e.enabled&&(e.enabled=t,t?this.enableDOMBreakpoint(e):this.disableDOMBreakpoint(e),this.dispatchEventToListeners("DOMBreakpointToggled",e))}enableDOMBreakpoint(e){e.node.id&&(this.agent.invoke_setDOMBreakpoint({nodeId:e.node.id,type:e.type}),e.node.setMarker(Ia,!0))}disableDOMBreakpoint(e){e.node.id&&(this.agent.invoke_removeDOMBreakpoint({nodeId:e.node.id,type:e.type}),e.node.setMarker(Ia,!!this.nodeHasBreakpoints(e.node)||null))}nodeHasBreakpoints(e){for(const t of this.#kc)if(t.node===e&&t.enabled)return!0;return!1}resolveDOMBreakpointData(e){const t=e.type,n=this.#er.nodeForId(e.nodeId);if(!t||!n)return null;let r=null,s=!1;return"subtree-modified"===t&&(s=e.insertion||!1,r=this.#er.nodeForId(e.targetNodeId)),{type:t,node:n,targetNode:r,insertion:s}}currentURL(){const e=this.#er.existingDocument();return e?e.documentURL:r.DevToolsPath.EmptyUrlString}async documentUpdated(){if(this.suspended)return;const e=this.#kc;this.#kc=[],this.dispatchEventToListeners("DOMBreakpointsRemoved",e);const t=await this.#er.requestDocument(),n=t?t.documentURL:r.DevToolsPath.EmptyUrlString;for(const e of this.#Cc.get())e.url===n&&this.#er.pushNodeByPathToFrontend(e.path).then(s.bind(this,e));function s(e,t){const n=t?this.#er.nodeForId(t):null;if(!n)return;const r=new wa(this,n,e.type,e.enabled);this.#kc.push(r),e.enabled&&this.enableDOMBreakpoint(r),this.dispatchEventToListeners("DOMBreakpointAdded",r)}}removeDOMBreakpoints(e){const t=[],n=[];for(const r of this.#kc)e(r)?(t.push(r),r.enabled&&(r.enabled=!1,this.disableDOMBreakpoint(r))):n.push(r);t.length&&(this.#kc=n,this.saveDOMBreakpoints(),this.dispatchEventToListeners("DOMBreakpointsRemoved",t))}nodeRemoved(e){if(this.suspended)return;const{node:t}=e.data,n=t.children()||[];this.removeDOMBreakpoints((e=>e.node===t||-1!==n.indexOf(e.node)))}saveDOMBreakpoints(){const e=this.currentURL(),t=this.#Cc.get().filter((t=>t.url!==e));for(const n of this.#kc)t.push({url:e,path:n.node.path(),type:n.type,enabled:n.enabled});this.#Cc.set(t)}}const Ia="breakpoint-marker";class wa{domDebuggerModel;node;type;enabled;constructor(e,t,n,r){this.domDebuggerModel=e,this.node=t,this.type=n,this.enabled=r}}class Sa{#xc;#Rc;#g;#Tc;#Mc;#Pc;#Ec;#Lc;#Jr;#Ac;#Oc;#Dc;constructor(e,t,n,s,i,o,a,l,d,c,h){this.#xc=e,this.#Rc=t,this.#g=n,this.#Tc=s,this.#Mc=i,this.#Pc=o,this.#Ec=a,this.#Lc=l||a,this.#Jr=d;const u=d.script();this.#Ac=u?u.contentURL():r.DevToolsPath.EmptyUrlString,this.#Oc=c,this.#Dc=h||"Raw"}domDebuggerModel(){return this.#xc}type(){return this.#g}useCapture(){return this.#Tc}passive(){return this.#Mc}once(){return this.#Pc}handler(){return this.#Ec}location(){return this.#Jr}sourceURL(){return this.#Ac}originalHandler(){return this.#Lc}canRemove(){return Boolean(this.#Oc)||"FrameworkUser"!==this.#Dc}remove(){if(!this.canRemove())return Promise.resolve(void 0);if("FrameworkUser"!==this.#Dc){function e(e,t,n){this.removeEventListener(e,t,n),this["on"+e]&&(this["on"+e]=void 0)}return this.#Rc.callFunction(e,[Bn.toCallArgument(this.#g),Bn.toCallArgument(this.#Lc),Bn.toCallArgument(this.#Tc)]).then((()=>{}))}if(this.#Oc){function t(e,t,n,r){this.call(null,e,t,n,r)}return this.#Oc.callFunction(t,[Bn.toCallArgument(this.#g),Bn.toCallArgument(this.#Lc),Bn.toCallArgument(this.#Tc),Bn.toCallArgument(this.#Mc)]).then((()=>{}))}return Promise.resolve(void 0)}canTogglePassive(){return"FrameworkUser"!==this.#Dc}togglePassive(){return this.#Rc.callFunction((function(e,t,n,r){this.removeEventListener(e,t,{capture:n}),this.addEventListener(e,t,{capture:n,passive:!r})}),[Bn.toCallArgument(this.#g),Bn.toCallArgument(this.#Lc),Bn.toCallArgument(this.#Tc),Bn.toCallArgument(this.#Mc)]).then((()=>{}))}origin(){return this.#Dc}markAsFramework(){this.#Dc="Framework"}isScrollBlockingType(){return"touchstart"===this.#g||"touchmove"===this.#g||"mousewheel"===this.#g||"wheel"===this.#g}}class ka extends ro{#g;constructor(e,t){super(e,t),this.#g=t}type(){return this.#g}}class Ca extends ro{eventTargetNames;constructor(e,t,n){super(n,e),this.eventTargetNames=t}setEnabled(e){if(this.enabled()!==e){super.setEnabled(e);for(const e of W.instance().models(va))this.updateOnModel(e)}}updateOnModel(e){for(const t of this.eventTargetNames)this.enabled()?e.agent.invoke_setEventListenerBreakpoint({eventName:this.name,targetName:t}):e.agent.invoke_removeEventListenerBreakpoint({eventName:this.name,targetName:t})}static listener="listener:"}let xa;class Ra{#Nc;#Fc=new Map;#Bc=[];#_c=[];constructor(){this.#Nc=e.Settings.Settings.instance().createLocalSetting("xhr-breakpoints",[]);for(const e of this.#Nc.get())this.#Fc.set(e.url,e.enabled);this.#Bc.push(new ka("trusted-type-violation","trustedtype-sink-violation")),this.#Bc.push(new ka("trusted-type-violation","trustedtype-policy-violation")),this.createEventListenerBreakpoints("media",["play","pause","playing","canplay","canplaythrough","seeking","seeked","timeupdate","ended","ratechange","durationchange","volumechange","loadstart","progress","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","waiting"],["audio","video"]),this.createEventListenerBreakpoints("picture-in-picture",["enterpictureinpicture","leavepictureinpicture"],["video"]),this.createEventListenerBreakpoints("picture-in-picture",["resize"],["PictureInPictureWindow"]),this.createEventListenerBreakpoints("picture-in-picture",["enter"],["documentPictureInPicture"]),this.createEventListenerBreakpoints("clipboard",["copy","cut","paste","beforecopy","beforecut","beforepaste"],["*"]),this.createEventListenerBreakpoints("control",["resize","scroll","scrollend","scrollsnapchange","scrollsnapchanging","zoom","focus","blur","select","change","submit","reset"],["*"]),this.createEventListenerBreakpoints("device",["deviceorientation","devicemotion"],["*"]),this.createEventListenerBreakpoints("dom-mutation",["DOMActivate","DOMFocusIn","DOMFocusOut","DOMAttrModified","DOMCharacterDataModified","DOMNodeInserted","DOMNodeInsertedIntoDocument","DOMNodeRemoved","DOMNodeRemovedFromDocument","DOMSubtreeModified","DOMContentLoaded"],["*"]),this.createEventListenerBreakpoints("drag-drop",["drag","dragstart","dragend","dragenter","dragover","dragleave","drop"],["*"]),this.createEventListenerBreakpoints("keyboard",["keydown","keyup","keypress","input"],["*"]),this.createEventListenerBreakpoints("load",["load","beforeunload","unload","abort","error","hashchange","popstate","navigate","navigatesuccess","navigateerror","currentchange","navigateto","navigatefrom","finish","dispose"],["*"]),this.createEventListenerBreakpoints("mouse",["auxclick","click","dblclick","mousedown","mouseup","mouseover","mousemove","mouseout","mouseenter","mouseleave","mousewheel","wheel","contextmenu"],["*"]),this.createEventListenerBreakpoints("pointer",["pointerover","pointerout","pointerenter","pointerleave","pointerdown","pointerup","pointermove","pointercancel","gotpointercapture","lostpointercapture","pointerrawupdate"],["*"]),this.createEventListenerBreakpoints("touch",["touchstart","touchmove","touchend","touchcancel"],["*"]),this.createEventListenerBreakpoints("worker",["message","messageerror"],["*"]),this.createEventListenerBreakpoints("xhr",["readystatechange","load","loadstart","loadend","abort","error","progress","timeout"],["xmlhttprequest","xmlhttprequestupload"]),W.instance().observeModels(va,this)}static instance(e={forceNew:null}){const{forceNew:t}=e;return xa&&!t||(xa=new Ra),xa}cspViolationBreakpoints(){return this.#Bc.slice()}createEventListenerBreakpoints(e,t,n){for(const r of t)this.#_c.push(new Ca(r,n,e))}resolveEventListenerBreakpoint({eventName:e,targetName:t}){const n="listener:";if(!e.startsWith(n))return null;e=e.substring(9),t=(t||"*").toLowerCase();let r=null;for(const n of this.#_c)e&&n.name===e&&-1!==n.eventTargetNames.indexOf(t)&&(r=n),!r&&e&&n.name===e&&-1!==n.eventTargetNames.indexOf("*")&&(r=n);return r}eventListenerBreakpoints(){return this.#_c.slice()}updateCSPViolationBreakpoints(){const e=this.#Bc.filter((e=>e.enabled())).map((e=>e.type()));for(const t of W.instance().models(va))this.updateCSPViolationBreakpointsForModel(t,e)}updateCSPViolationBreakpointsForModel(e,t){e.agent.invoke_setBreakOnCSPViolation({violationTypes:t})}xhrBreakpoints(){return this.#Fc}saveXHRBreakpoints(){const e=[];for(const t of this.#Fc.keys())e.push({url:t,enabled:this.#Fc.get(t)||!1});this.#Nc.set(e)}addXHRBreakpoint(e,t){if(this.#Fc.set(e,t),t)for(const t of W.instance().models(va))t.agent.invoke_setXHRBreakpoint({url:e});this.saveXHRBreakpoints()}removeXHRBreakpoint(e){const t=this.#Fc.get(e);if(this.#Fc.delete(e),t)for(const t of W.instance().models(va))t.agent.invoke_removeXHRBreakpoint({url:e});this.saveXHRBreakpoints()}toggleXHRBreakpoint(e,t){this.#Fc.set(e,t);for(const n of W.instance().models(va))t?n.agent.invoke_setXHRBreakpoint({url:e}):n.agent.invoke_removeXHRBreakpoint({url:e});this.saveXHRBreakpoints()}modelAdded(e){for(const t of this.#Fc.keys())this.#Fc.get(t)&&e.agent.invoke_setXHRBreakpoint({url:t});for(const t of this.#_c)t.enabled()&&t.updateOnModel(e);const t=this.#Bc.filter((e=>e.enabled())).map((e=>e.type()));this.updateCSPViolationBreakpointsForModel(e,t)}modelRemoved(e){}}h.register(va,{capabilities:2,autostart:!1});var Ta=Object.freeze({__proto__:null,CSPViolationBreakpoint:ka,DOMBreakpoint:wa,DOMDebuggerManager:Ra,DOMDebuggerModel:va,DOMEventListenerBreakpoint:Ca,EventListener:Sa});class Ma extends h{agent;constructor(e){super(e),this.agent=e.eventBreakpointsAgent()}}class Pa extends ro{setEnabled(e){if(this.enabled()!==e){super.setEnabled(e);for(const e of W.instance().models(Ma))this.updateOnModel(e)}}updateOnModel(e){this.enabled()?e.agent.invoke_setInstrumentationBreakpoint({eventName:this.name}):e.agent.invoke_removeInstrumentationBreakpoint({eventName:this.name})}static instrumentationPrefix="instrumentation:"}let Ea;class La{#_c=[];constructor(){this.createInstrumentationBreakpoints("auction-worklet",["beforeBidderWorkletBiddingStart","beforeBidderWorkletReportingStart","beforeSellerWorkletScoringStart","beforeSellerWorkletReportingStart"]),this.createInstrumentationBreakpoints("animation",["requestAnimationFrame","cancelAnimationFrame","requestAnimationFrame.callback"]),this.createInstrumentationBreakpoints("canvas",["canvasContextCreated","webglErrorFired","webglWarningFired"]),this.createInstrumentationBreakpoints("geolocation",["Geolocation.getCurrentPosition","Geolocation.watchPosition"]),this.createInstrumentationBreakpoints("notification",["Notification.requestPermission"]),this.createInstrumentationBreakpoints("parse",["Element.setInnerHTML","Document.write"]),this.createInstrumentationBreakpoints("script",["scriptFirstStatement","scriptBlockedByCSP"]),this.createInstrumentationBreakpoints("shared-storage-worklet",["sharedStorageWorkletScriptFirstStatement"]),this.createInstrumentationBreakpoints("timer",["setTimeout","clearTimeout","setTimeout.callback","setInterval","clearInterval","setInterval.callback"]),this.createInstrumentationBreakpoints("window",["DOMWindow.close"]),this.createInstrumentationBreakpoints("web-audio",["audioContextCreated","audioContextClosed","audioContextResumed","audioContextSuspended"]),W.instance().observeModels(Ma,this)}static instance(e={forceNew:null}){const{forceNew:t}=e;return Ea&&!t||(Ea=new La),Ea}createInstrumentationBreakpoints(e,t){for(const n of t)this.#_c.push(new Pa(e,n))}eventListenerBreakpoints(){return this.#_c.slice()}resolveEventListenerBreakpoint({eventName:e}){if(!e.startsWith(Pa.instrumentationPrefix))return null;const t=e.substring(Pa.instrumentationPrefix.length);return this.#_c.find((e=>e.name===t))||null}modelAdded(e){for(const t of this.#_c)t.enabled()&&t.updateOnModel(e)}modelRemoved(e){}}h.register(Ma,{capabilities:524288,autostart:!1});var Aa=Object.freeze({__proto__:null,EventBreakpointsManager:La,EventBreakpointsModel:Ma}),Oa=Object.freeze({__proto__:null});let Da;class Na extends e.ObjectWrapper.ObjectWrapper{#Hc=new Map;#Uc=new Map;#L=new Set;#qc=0;constructor(){super(),W.instance().observeModels(Jr,this)}static instance({forceNew:e}={forceNew:!1}){return Da&&!e||(Da=new Na),Da}observeIsolates(e){if(this.#L.has(e))throw new Error("Observer can only be registered once");this.#L.size||this.poll(),this.#L.add(e);for(const t of this.#Hc.values())e.isolateAdded(t)}modelAdded(e){this.modelAddedInternal(e)}async modelAddedInternal(e){this.#Uc.set(e,null);const t=await e.isolateId();if(!this.#Uc.has(e))return;if(!t)return void this.#Uc.delete(e);this.#Uc.set(e,t);let n=this.#Hc.get(t);if(n||(n=new _a(t),this.#Hc.set(t,n)),n.modelsInternal.add(e),1===n.modelsInternal.size)for(const e of this.#L)e.isolateAdded(n);else for(const e of this.#L)e.isolateChanged(n)}modelRemoved(e){const t=this.#Uc.get(e);if(this.#Uc.delete(e),!t)return;const n=this.#Hc.get(t);if(n)if(n.modelsInternal.delete(e),n.modelsInternal.size)for(const e of this.#L)e.isolateChanged(n);else{for(const e of this.#L)e.isolateRemoved(n);this.#Hc.delete(t)}}isolateByModel(e){return this.#Hc.get(this.#Uc.get(e)||"")||null}isolates(){return this.#Hc.values()}async poll(){const e=this.#qc;for(;e===this.#qc;)await Promise.all(Array.from(this.isolates(),(e=>e.update()))),await new Promise((e=>window.setTimeout(e,Ba)))}}const Fa=12e4,Ba=2e3;class _a{#C;modelsInternal;#zc;#jc;constructor(e){this.#C=e,this.modelsInternal=new Set,this.#zc=0;const t=Fa/Ba;this.#jc=new Ha(t)}id(){return this.#C}models(){return this.modelsInternal}runtimeModel(){return this.modelsInternal.values().next().value||null}heapProfilerModel(){const e=this.runtimeModel();return e?.heapProfilerModel()??null}async update(){const e=this.runtimeModel(),t=e&&await e.heapUsage();t&&(this.#zc=t.usedSize+(t.embedderHeapUsedSize??0)+(t.backingStorageSize??0),this.#jc.add(this.#zc),Na.instance().dispatchEventToListeners("MemoryChanged",this))}samplesCount(){return this.#jc.count()}usedHeapSize(){return this.#zc}usedHeapSizeGrowRate(){return this.#jc.fitSlope()}}class Ha{#Vc;#Wc;#as;#Gc;#Kc;#Qc;#$c;#Xc;#Jc;constructor(e){this.#Vc=0|e,this.reset()}reset(){this.#Wc=Date.now(),this.#as=0,this.#Gc=[],this.#Kc=[],this.#Qc=0,this.#$c=0,this.#Xc=0,this.#Jc=0}count(){return this.#Gc.length}add(e,t){const n="number"==typeof t?t:Date.now()-this.#Wc,r=e;if(this.#Gc.length===this.#Vc){const e=this.#Gc[this.#as],t=this.#Kc[this.#as];this.#Qc-=e,this.#$c-=t,this.#Xc-=e*e,this.#Jc-=e*t}this.#Qc+=n,this.#$c+=r,this.#Xc+=n*n,this.#Jc+=n*r,this.#Gc[this.#as]=n,this.#Kc[this.#as]=r,this.#as=(this.#as+1)%this.#Vc}fitSlope(){const e=this.count();return e<2?0:(this.#Jc-this.#Qc*this.#$c/e)/(this.#Xc-this.#Qc*this.#Qc/e)}}var Ua=Object.freeze({__proto__:null,Isolate:_a,IsolateManager:Na,MemoryTrend:Ha,MemoryTrendWindowMs:Fa});class qa extends h{#Yc=!1;#yr=!1;constructor(e){super(e),this.ensureEnabled()}async ensureEnabled(){if(this.#yr)return;this.#yr=!0,this.target().registerAuditsDispatcher(this);const e=this.target().auditsAgent();await e.invoke_enable()}issueAdded(e){this.dispatchEventToListeners("IssueAdded",{issuesModel:this,inspectorIssue:e.issue})}dispose(){super.dispose(),this.#Yc=!0}getTargetIfNotDisposed(){return this.#Yc?null:this.target()}}h.register(qa,{capabilities:32768,autostart:!0});var za=Object.freeze({__proto__:null,IssuesModel:qa});var ja=Object.freeze({__proto__:null,LayerTreeBase:class{#e;#er;layersById=new Map;#Zc=null;#eh=null;#th=new Map;#nh;constructor(e){this.#e=e,this.#er=e?e.model(Gs):null}target(){return this.#e}root(){return this.#Zc}setRoot(e){this.#Zc=e}contentRoot(){return this.#eh}setContentRoot(e){this.#eh=e}forEachLayer(e,t){return!(!t&&!(t=this.root()))&&(e(t)||t.children().some(this.forEachLayer.bind(this,e)))}layerById(e){return this.layersById.get(e)||null}async resolveBackendNodeIds(e){if(!e.size||!this.#er)return;const t=await this.#er.pushNodesByBackendIdsToFrontend(e);if(t)for(const e of t.keys())this.#th.set(e,t.get(e)||null)}backendNodeIdToNode(){return this.#th}setViewportSize(e){this.#nh=e}viewportSize(){return this.#nh}nodeForId(e){return this.#er?this.#er.nodeForId(e):null}},StickyPositionConstraint:class{#rh;#sh;#ih;#oh;constructor(e,t){this.#rh=t.stickyBoxRect,this.#sh=t.containingBlockRect,this.#ih=null,e&&t.nearestLayerShiftingStickyBox&&(this.#ih=e.layerById(t.nearestLayerShiftingStickyBox)),this.#oh=null,e&&t.nearestLayerShiftingContainingBlock&&(this.#oh=e.layerById(t.nearestLayerShiftingContainingBlock))}stickyBoxRect(){return this.#rh}containingBlockRect(){return this.#sh}nearestLayerShiftingStickyBox(){return this.#ih}nearestLayerShiftingContainingBlock(){return this.#oh}}});class Va{id;url;startTime;loadTime;contentLoadTime;mainRequest;constructor(e){this.id=++Va.lastIdentifier,this.url=e.url(),this.startTime=e.startTime,this.mainRequest=e}static forRequest(e){return Wa.get(e)||null}bindRequest(e){Wa.set(e,this)}static lastIdentifier=0}const Wa=new WeakMap;var Ga=Object.freeze({__proto__:null,PageLoad:Va});class Ka extends h{layerTreeAgent;constructor(e){super(e),this.layerTreeAgent=e.layerTreeAgent()}async loadSnapshotFromFragments(e){const{snapshotId:t}=await this.layerTreeAgent.invoke_loadSnapshot({tiles:e});return t?new Qa(this,t):null}loadSnapshot(e){const t={x:0,y:0,picture:e};return this.loadSnapshotFromFragments([t])}async makeSnapshot(e){const{snapshotId:t}=await this.layerTreeAgent.invoke_makeSnapshot({layerId:e});return t?new Qa(this,t):null}}class Qa{#ah;#Mo;#lh;constructor(e,t){this.#ah=e,this.#Mo=t,this.#lh=1}release(){console.assert(this.#lh>0,"release is already called on the object"),--this.#lh||this.#ah.layerTreeAgent.invoke_releaseSnapshot({snapshotId:this.#Mo})}addReference(){++this.#lh,console.assert(this.#lh>0,"Referencing a dead object")}async replay(e,t,n){return(await this.#ah.layerTreeAgent.invoke_replaySnapshot({snapshotId:this.#Mo,fromStep:t,toStep:n,scale:e||1})).dataURL}async profile(e){return(await this.#ah.layerTreeAgent.invoke_profileSnapshot({snapshotId:this.#Mo,minRepeatCount:5,minDuration:1,clipRect:e||void 0})).timings}async commandLog(){const e=await this.#ah.layerTreeAgent.invoke_snapshotCommandLog({snapshotId:this.#Mo});return e.commandLog?e.commandLog.map(((e,t)=>new $a(e,t))):null}}class $a{method;params;commandIndex;constructor(e,t){this.method=e.method,this.params=e.params,this.commandIndex=t}}h.register(Ka,{capabilities:2,autostart:!1});var Xa=Object.freeze({__proto__:null,PaintProfilerLogItem:$a,PaintProfilerModel:Ka,PaintProfilerSnapshot:Qa});class Ja extends h{#Ks;#dh=new Map([["TaskDuration","CumulativeTime"],["ScriptDuration","CumulativeTime"],["LayoutDuration","CumulativeTime"],["RecalcStyleDuration","CumulativeTime"],["LayoutCount","CumulativeCount"],["RecalcStyleCount","CumulativeCount"]]);#ch=new Map;constructor(e){super(e),this.#Ks=e.performanceAgent()}enable(){return this.#Ks.invoke_enable({})}disable(){return this.#Ks.invoke_disable()}async requestMetrics(){const e=await this.#Ks.invoke_getMetrics()||[],t=new Map,n=performance.now();for(const s of e.metrics){let e,i=this.#ch.get(s.name);switch(i||(i={lastValue:void 0,lastTimestamp:void 0},this.#ch.set(s.name,i)),this.#dh.get(s.name)){case"CumulativeTime":e=i.lastTimestamp&&i.lastValue?r.NumberUtilities.clamp(1e3*(s.value-i.lastValue)/(n-i.lastTimestamp),0,1):0,i.lastValue=s.value,i.lastTimestamp=n;break;case"CumulativeCount":e=i.lastTimestamp&&i.lastValue?Math.max(0,1e3*(s.value-i.lastValue)/(n-i.lastTimestamp)):0,i.lastValue=s.value,i.lastTimestamp=n;break;default:e=s.value}t.set(s.name,e)}return{metrics:t,timestamp:n}}}h.register(Ja,{capabilities:2,autostart:!1});var Ya=Object.freeze({__proto__:null,PerformanceMetricsModel:Ja});class Za extends Map{getOrInsert(e,t){return this.has(e)||this.set(e,t),this.get(e)}getOrInsertComputed(e,t){return this.has(e)||this.set(e,t(e)),this.get(e)}}class el extends h{agent;loaderIds=[];targetJustAttached=!0;lastPrimaryPageModel=null;documents=new Map;constructor(e){super(e),e.registerPreloadDispatcher(new tl(this)),this.agent=e.preloadAgent(),this.agent.invoke_enable();const t=e.targetInfo();void 0!==t&&"prerender"===t.subtype&&(this.lastPrimaryPageModel=W.instance().primaryPageTarget()?.model(el)||null),W.instance().addModelListener(ii,ri.PrimaryPageChanged,this.onPrimaryPageChanged,this)}dispose(){super.dispose(),W.instance().removeModelListener(ii,ri.PrimaryPageChanged,this.onPrimaryPageChanged,this),this.agent.invoke_disable()}ensureDocumentPreloadingData(e){void 0===this.documents.get(e)&&this.documents.set(e,new nl)}currentLoaderId(){if(this.targetJustAttached)return null;if(0===this.loaderIds.length)throw new Error("unreachable");return this.loaderIds[this.loaderIds.length-1]}currentDocument(){const e=this.currentLoaderId();return null===e?null:this.documents.get(e)||null}getRuleSetById(e){return this.currentDocument()?.ruleSets.getById(e)||null}getAllRuleSets(){return this.currentDocument()?.ruleSets.getAll()||[]}getPreloadCountsByRuleSetId(){const e=new Map;for(const{value:t}of this.getRepresentativePreloadingAttempts(null))for(const n of[null,...t.ruleSetIds]){void 0===e.get(n)&&e.set(n,new Map);const r=e.get(n);s(r);const i=r.get(t.status)||0;r.set(t.status,i+1)}return e}getPreloadingAttemptById(e){const t=this.currentDocument();return null===t?null:t.preloadingAttempts.getById(e,t.sources)||null}getRepresentativePreloadingAttempts(e){const t=this.currentDocument();return null===t?[]:t.preloadingAttempts.getAllRepresentative(e,t.sources)}getRepresentativePreloadingAttemptsOfPreviousPage(){if(this.loaderIds.length<=1)return[];const e=this.documents.get(this.loaderIds[this.loaderIds.length-2]);return void 0===e?[]:e.preloadingAttempts.getAllRepresentative(null,e.sources)}getPipelineById(e){const t=this.currentDocument();return null===t?null:t.preloadingAttempts.getPipeline(e,t.sources)}getPipeline(e){let t=null;if(null!==e.pipelineId&&(t=this.getPipelineById(e.pipelineId)),null===t){const t=new Map;return t.set(e.action,e),new ol(t)}return new ol(t)}onPrimaryPageChanged(e){const{frame:t,type:n}=e.data;if(null===this.lastPrimaryPageModel&&"Activation"===n)return;if(null!==this.lastPrimaryPageModel&&"Activation"!==n)return;if(null!==this.lastPrimaryPageModel&&"Activation"===n){this.loaderIds=this.lastPrimaryPageModel.loaderIds;for(const[e,t]of this.lastPrimaryPageModel.documents.entries())this.ensureDocumentPreloadingData(e),this.documents.get(e)?.mergePrevious(t)}this.lastPrimaryPageModel=null;const r=t.loaderId;this.loaderIds.push(r),this.loaderIds=this.loaderIds.slice(-2),this.ensureDocumentPreloadingData(r);for(const e of this.documents.keys())this.loaderIds.includes(e)||this.documents.delete(e);this.dispatchEventToListeners("ModelUpdated")}onRuleSetUpdated(e){const t=e.ruleSet,n=t.loaderId;null===this.currentLoaderId()&&(this.loaderIds=[n],this.targetJustAttached=!1),this.ensureDocumentPreloadingData(n),this.documents.get(n)?.ruleSets.upsert(t),this.dispatchEventToListeners("ModelUpdated")}onRuleSetRemoved(e){const t=e.id;for(const e of this.documents.values())e.ruleSets.delete(t);this.dispatchEventToListeners("ModelUpdated")}onPreloadingAttemptSourcesUpdated(e){const t=e.loaderId;this.ensureDocumentPreloadingData(t);const n=this.documents.get(t);void 0!==n&&(n.sources.update(e.preloadingAttemptSources),n.preloadingAttempts.maybeRegisterNotTriggered(n.sources),n.preloadingAttempts.cleanUpRemovedAttempts(n.sources),this.dispatchEventToListeners("ModelUpdated"))}onPrefetchStatusUpdated(e){if("PrefetchEvictedAfterCandidateRemoved"===e.prefetchStatus)return;const t=e.key.loaderId;this.ensureDocumentPreloadingData(t);const n={action:"Prefetch",key:e.key,pipelineId:e.pipelineId,status:sl(e.status),prefetchStatus:e.prefetchStatus||null,requestId:e.requestId};this.documents.get(t)?.preloadingAttempts.upsert(n),this.dispatchEventToListeners("ModelUpdated")}onPrerenderStatusUpdated(e){const t=e.key.loaderId;this.ensureDocumentPreloadingData(t);const n={action:"Prerender",key:e.key,pipelineId:e.pipelineId,status:sl(e.status),prerenderStatus:e.prerenderStatus||null,disallowedMojoInterface:e.disallowedMojoInterface||null,mismatchedHeaders:e.mismatchedHeaders||null};this.documents.get(t)?.preloadingAttempts.upsert(n),this.dispatchEventToListeners("ModelUpdated")}onPreloadEnabledStateUpdated(e){this.dispatchEventToListeners("WarningsUpdated",e)}}h.register(el,{capabilities:2,autostart:!1});class tl{model;constructor(e){this.model=e}ruleSetUpdated(e){this.model.onRuleSetUpdated(e)}ruleSetRemoved(e){this.model.onRuleSetRemoved(e)}preloadingAttemptSourcesUpdated(e){this.model.onPreloadingAttemptSourcesUpdated(e)}prefetchStatusUpdated(e){this.model.onPrefetchStatusUpdated(e)}prerenderStatusUpdated(e){this.model.onPrerenderStatusUpdated(e)}preloadEnabledStateUpdated(e){this.model.onPreloadEnabledStateUpdated(e)}}class nl{ruleSets=new rl;preloadingAttempts=new al;sources=new ll;mergePrevious(e){if(!this.ruleSets.isEmpty()||!this.sources.isEmpty())throw new Error("unreachable");this.ruleSets=e.ruleSets,this.preloadingAttempts.mergePrevious(e.preloadingAttempts),this.sources=e.sources}}class rl{map=new Map;isEmpty(){return 0===this.map.size}getById(e){return this.map.get(e)||null}getAll(){return Array.from(this.map.entries()).map((([e,t])=>({id:e,value:t})))}upsert(e){this.map.set(e.id,e)}delete(e){this.map.delete(e)}}function sl(e){switch(e){case"Pending":return"Pending";case"Running":return"Running";case"Ready":return"Ready";case"Success":return"Success";case"Failure":return"Failure";case"NotSupported":return"NotSupported"}throw new Error("unreachable")}function il(e){let t,n;switch(e.action){case"Prefetch":t="Prefetch";break;case"Prerender":t="Prerender"}switch(e.targetHint){case void 0:n="undefined";break;case"Blank":n="Blank";break;case"Self":n="Self"}return`${e.loaderId}:${t}:${e.url}:${n}`}class ol{inner;constructor(e){if(0===e.size)throw new Error("unreachable");this.inner=e}static newFromAttemptsForTesting(e){const t=new Map;for(const n of e)t.set(n.action,n);return new ol(t)}getOriginallyTriggered(){const e=this.getPrerender()||this.getPrefetch();return s(e),e}getPrefetch(){return this.inner.get("Prefetch")||null}getPrerender(){return this.inner.get("Prerender")||null}getAttempts(){const e=[],t=this.getPrefetch();null!==t&&e.push(t);const n=this.getPrerender();if(null!==n&&e.push(n),0===e.length)throw new Error("unreachable");return e}}class al{map=new Map;pipelines=new Za;enrich(e,t){let n=[],r=[];return null!==t&&(n=t.ruleSetIds,r=t.nodeIds),{...e,ruleSetIds:n,nodeIds:r}}isAttemptRepresentative(e){function t(e){switch(e){case"Prefetch":return 0;case"Prerender":return 1}}if(null===e.pipelineId)return!0;const n=this.pipelines.get(e.pipelineId);if(s(n),0===n.size)throw new Error("unreachable");return[...n.keys()].every((n=>t(n)<=t(e.action)))}getById(e,t){const n=this.map.get(e)||null;return null===n?null:this.enrich(n,t.getById(e))}getAllRepresentative(e,t){return[...this.map.entries()].map((([e,n])=>({id:e,value:this.enrich(n,t.getById(e))}))).filter((({value:t})=>!e||t.ruleSetIds.includes(e))).filter((({value:e})=>this.isAttemptRepresentative(e)))}getPipeline(e,t){const n=this.pipelines.get(e);if(void 0===n||0===n.size)return null;const r={};for(const[e,t]of this.map.entries())r[e]=t;return new Map(n.entries().map((([e,n])=>{const r=this.getById(n,t);return s(r),[e,r]})))}upsert(e){const t=il(e.key);this.map.set(t,e),null!==e.pipelineId&&this.pipelines.getOrInsertComputed(e.pipelineId,(()=>new Map)).set(e.action,t)}reconstructPipelines(){this.pipelines.clear();for(const[e,t]of this.map.entries()){if(null===t.pipelineId)continue;this.pipelines.getOrInsertComputed(t.pipelineId,(()=>new Map)).set(t.action,e)}}maybeRegisterNotTriggered(e){for(const[t,{key:n}]of e.entries()){if(void 0!==this.map.get(t))continue;let e;switch(n.action){case"Prefetch":e={action:"Prefetch",key:n,pipelineId:null,status:"NotTriggered",prefetchStatus:null,requestId:""};break;case"Prerender":e={action:"Prerender",key:n,pipelineId:null,status:"NotTriggered",prerenderStatus:null,disallowedMojoInterface:null,mismatchedHeaders:null}}this.map.set(t,e)}}cleanUpRemovedAttempts(e){const t=Array.from(this.map.keys()).filter((t=>!e.getById(t)));for(const e of t)this.map.delete(e);this.reconstructPipelines()}mergePrevious(e){for(const[t,n]of this.map.entries())e.map.set(t,n);this.map=e.map,this.reconstructPipelines()}}class ll{map=new Map;entries(){return this.map.entries()}isEmpty(){return 0===this.map.size}getById(e){return this.map.get(e)||null}update(e){this.map=new Map(e.map((e=>[il(e.key),e])))}}var dl=Object.freeze({__proto__:null,PreloadPipeline:ol,PreloadingModel:el});var cl=Object.freeze({__proto__:null,ReactNativeApplicationModel:class extends h{#yr;#Ks;metadataCached=null;constructor(e){super(e),a.rnPerfMetrics.fuseboxSetClientMetadataStarted(),this.#yr=!1,this.#Ks=e.reactNativeApplicationAgent(),e.registerReactNativeApplicationDispatcher(this),this.ensureEnabled()}ensureEnabled(){this.#yr||(this.#Ks.invoke_enable().then((e=>{const t=e.getError(),n=!t;a.rnPerfMetrics.fuseboxSetClientMetadataFinished(n,t)})).catch((e=>{a.rnPerfMetrics.fuseboxSetClientMetadataFinished(!1,e)})),this.#yr=!0)}metadataUpdated(e){this.metadataCached=e,this.dispatchEventToListeners("MetadataUpdated",e)}traceRequested(){a.rnPerfMetrics.traceRequested(),this.dispatchEventToListeners("TraceRequested")}}});class hl extends h{enabled=!1;storageAgent;storageKeyManager;bucketsById=new Map;trackedStorageKeys=new Set;constructor(e){super(e),e.registerStorageDispatcher(this),this.storageAgent=e.storageAgent(),this.storageKeyManager=e.model(ni)}getBuckets(){return new Set(this.bucketsById.values())}getBucketsForStorageKey(e){const t=[...this.bucketsById.values()];return new Set(t.filter((({bucket:t})=>t.storageKey===e)))}getDefaultBucketForStorageKey(e){return[...this.bucketsById.values()].find((({bucket:t})=>t.storageKey===e&&void 0===t.name))??null}getBucketById(e){return this.bucketsById.get(e)??null}getBucketByName(e,t){if(!t)return this.getDefaultBucketForStorageKey(e);return[...this.bucketsById.values()].find((({bucket:n})=>n.storageKey===e&&n.name===t))??null}deleteBucket(e){this.storageAgent.invoke_deleteStorageBucket({bucket:e})}enable(){if(!this.enabled){if(this.storageKeyManager){this.storageKeyManager.addEventListener("StorageKeyAdded",this.storageKeyAdded,this),this.storageKeyManager.addEventListener("StorageKeyRemoved",this.storageKeyRemoved,this);for(const e of this.storageKeyManager.storageKeys())this.addStorageKey(e)}this.enabled=!0}}storageKeyAdded(e){this.addStorageKey(e.data)}storageKeyRemoved(e){this.removeStorageKey(e.data)}addStorageKey(e){if(this.trackedStorageKeys.has(e))throw new Error("Can't call addStorageKey for a storage key if it has already been added.");this.trackedStorageKeys.add(e),this.storageAgent.invoke_setStorageBucketTracking({storageKey:e,enable:!0})}removeStorageKey(e){if(!this.trackedStorageKeys.has(e))throw new Error("Can't call removeStorageKey for a storage key if it hasn't already been added.");const t=this.getBucketsForStorageKey(e);for(const e of t)this.bucketRemoved(e);this.trackedStorageKeys.delete(e),this.storageAgent.invoke_setStorageBucketTracking({storageKey:e,enable:!1})}bucketAdded(e){this.bucketsById.set(e.id,e),this.dispatchEventToListeners("BucketAdded",{model:this,bucketInfo:e})}bucketRemoved(e){this.bucketsById.delete(e.id),this.dispatchEventToListeners("BucketRemoved",{model:this,bucketInfo:e})}bucketChanged(e){this.dispatchEventToListeners("BucketChanged",{model:this,bucketInfo:e})}bucketInfosAreEqual(e,t){return e.bucket.storageKey===t.bucket.storageKey&&e.id===t.id&&e.bucket.name===t.bucket.name&&e.expiration===t.expiration&&e.quota===t.quota&&e.persistent===t.persistent&&e.durability===t.durability}storageBucketCreatedOrUpdated({bucketInfo:e}){const t=this.getBucketById(e.id);t?this.bucketInfosAreEqual(t,e)||this.bucketChanged(e):this.bucketAdded(e)}storageBucketDeleted({bucketId:e}){const t=this.getBucketById(e);if(!t)throw new Error(`Received an event that Storage Bucket '${e}' was deleted, but it wasn't in the StorageBucketsModel.`);this.bucketRemoved(t)}attributionReportingTriggerRegistered(e){}interestGroupAccessed(e){}interestGroupAuctionEventOccurred(e){}interestGroupAuctionNetworkRequestCreated(e){}indexedDBListUpdated(e){}indexedDBContentUpdated(e){}cacheStorageListUpdated(e){}cacheStorageContentUpdated(e){}sharedStorageAccessed(e){}attributionReportingSourceRegistered(e){}}h.register(hl,{capabilities:8192,autostart:!1});var ul=Object.freeze({__proto__:null,StorageBucketsModel:hl});const gl={serviceworkercacheagentError:"`ServiceWorkerCacheAgent` error deleting cache entry {PH1} in cache: {PH2}"},pl=n.i18n.registerUIStrings("core/sdk/ServiceWorkerCacheModel.ts",gl),ml=n.i18n.getLocalizedString.bind(void 0,pl);class fl extends h{cacheAgent;#hh;#uh;#gh=new Map;#ph=new Set;#mh=new Set;#fh=new e.Throttler.Throttler(2e3);#yr=!1;#bh=!1;constructor(e){super(e),e.registerStorageDispatcher(this),this.cacheAgent=e.cacheStorageAgent(),this.#hh=e.storageAgent(),this.#uh=e.model(hl)}enable(){if(!this.#yr){this.#uh.addEventListener("BucketAdded",this.storageBucketAdded,this),this.#uh.addEventListener("BucketRemoved",this.storageBucketRemoved,this);for(const e of this.#uh.getBuckets())this.addStorageBucket(e.bucket);this.#yr=!0}}clearForStorageKey(e){for(const[t,n]of this.#gh.entries())n.storageKey===e&&(this.#gh.delete(t),this.cacheRemoved(n));for(const t of this.#uh.getBucketsForStorageKey(e))this.loadCacheNames(t.bucket)}refreshCacheNames(){for(const e of this.#gh.values())this.cacheRemoved(e);this.#gh.clear();const e=this.#uh.getBuckets();for(const t of e)this.loadCacheNames(t.bucket)}async deleteCache(e){const t=await this.cacheAgent.invoke_deleteCache({cacheId:e.cacheId});t.getError()?console.error(`ServiceWorkerCacheAgent error deleting cache ${e.toString()}: ${t.getError()}`):(this.#gh.delete(e.cacheId),this.cacheRemoved(e))}async deleteCacheEntry(t,n){const r=await this.cacheAgent.invoke_deleteEntry({cacheId:t.cacheId,request:n});r.getError()&&e.Console.Console.instance().error(ml(gl.serviceworkercacheagentError,{PH1:t.toString(),PH2:String(r.getError())}))}loadCacheData(e,t,n,r,s){this.requestEntries(e,t,n,r,s)}loadAllCacheData(e,t,n){this.requestAllEntries(e,t,n)}caches(){return[...this.#gh.values()]}dispose(){for(const e of this.#gh.values())this.cacheRemoved(e);this.#gh.clear(),this.#yr&&(this.#uh.removeEventListener("BucketAdded",this.storageBucketAdded,this),this.#uh.removeEventListener("BucketRemoved",this.storageBucketRemoved,this))}addStorageBucket(e){this.loadCacheNames(e),this.#ph.has(e.storageKey)||(this.#ph.add(e.storageKey),this.#hh.invoke_trackCacheStorageForStorageKey({storageKey:e.storageKey}))}removeStorageBucket(e){let t=0;for(const[n,r]of this.#gh.entries())e.storageKey===r.storageKey&&t++,r.inBucket(e)&&(t--,this.#gh.delete(n),this.cacheRemoved(r));0===t&&(this.#ph.delete(e.storageKey),this.#hh.invoke_untrackCacheStorageForStorageKey({storageKey:e.storageKey}))}async loadCacheNames(e){const t=await this.cacheAgent.invoke_requestCacheNames({storageBucket:e});t.getError()||this.updateCacheNames(e,t.caches)}updateCacheNames(e,t){const n=new Set,r=new Map,s=new Map;for(const e of t){const t=e.storageBucket??this.#uh.getDefaultBucketForStorageKey(e.storageKey)?.bucket;if(!t)continue;const s=new bl(this,t,e.cacheName,e.cacheId);n.add(s.cacheId),this.#gh.has(s.cacheId)||(r.set(s.cacheId,s),this.#gh.set(s.cacheId,s))}this.#gh.forEach((function(t){t.inBucket(e)&&!n.has(t.cacheId)&&(s.set(t.cacheId,t),this.#gh.delete(t.cacheId))}),this),r.forEach(this.cacheAdded,this),s.forEach(this.cacheRemoved,this)}storageBucketAdded({data:{bucketInfo:{bucket:e}}}){this.addStorageBucket(e)}storageBucketRemoved({data:{bucketInfo:{bucket:e}}}){this.removeStorageBucket(e)}cacheAdded(e){this.dispatchEventToListeners("CacheAdded",{model:this,cache:e})}cacheRemoved(e){this.dispatchEventToListeners("CacheRemoved",{model:this,cache:e})}async requestEntries(e,t,n,r,s){const i=await this.cacheAgent.invoke_requestEntries({cacheId:e.cacheId,skipCount:t,pageSize:n,pathFilter:r});i.getError()?console.error("ServiceWorkerCacheAgent error while requesting entries: ",i.getError()):s(i.cacheDataEntries,i.returnCount)}async requestAllEntries(e,t,n){const r=await this.cacheAgent.invoke_requestEntries({cacheId:e.cacheId,pathFilter:t});r.getError()?console.error("ServiceWorkerCacheAgent error while requesting entries: ",r.getError()):n(r.cacheDataEntries,r.returnCount)}cacheStorageListUpdated({bucketId:e}){const t=this.#uh.getBucketById(e)?.bucket;t&&(this.#mh.add(t),this.#fh.schedule((()=>{const e=Array.from(this.#mh,(e=>this.loadCacheNames(e)));return this.#mh.clear(),Promise.all(e)}),this.#bh?"AsSoonAsPossible":"Default"))}cacheStorageContentUpdated({bucketId:e,cacheName:t}){const n=this.#uh.getBucketById(e)?.bucket;n&&this.dispatchEventToListeners("CacheStorageContentUpdated",{storageBucket:n,cacheName:t})}attributionReportingTriggerRegistered(e){}indexedDBListUpdated(e){}indexedDBContentUpdated(e){}interestGroupAuctionEventOccurred(e){}interestGroupAccessed(e){}interestGroupAuctionNetworkRequestCreated(e){}sharedStorageAccessed(e){}storageBucketCreatedOrUpdated(e){}storageBucketDeleted(e){}setThrottlerSchedulesAsSoonAsPossibleForTest(){this.#bh=!0}attributionReportingSourceRegistered(e){}}class bl{#ls;storageKey;storageBucket;cacheName;cacheId;constructor(e,t,n,r){this.#ls=e,this.storageBucket=t,this.storageKey=t.storageKey,this.cacheName=n,this.cacheId=r}inBucket(e){return this.storageKey===e.storageKey&&this.storageBucket.name===e.name}equals(e){return this.cacheId===e.cacheId}toString(){return this.storageKey+this.cacheName}async requestCachedResponse(e,t){const n=await this.#ls.cacheAgent.invoke_requestCachedResponse({cacheId:this.cacheId,requestURL:e,requestHeaders:t});return n.getError()?null:n.response}}h.register(fl,{capabilities:8192,autostart:!1});var yl=Object.freeze({__proto__:null,Cache:bl,ServiceWorkerCacheModel:fl});const vl={running:"running",starting:"starting",stopped:"stopped",stopping:"stopping",activated:"activated",activating:"activating",installed:"installed",installing:"installing",new:"new",redundant:"redundant",sSS:"{PH1} #{PH2} ({PH3})"},Il=n.i18n.registerUIStrings("core/sdk/ServiceWorkerManager.ts",vl),wl=n.i18n.getLocalizedString.bind(void 0,Il),Sl=n.i18n.getLazilyComputedLocalizedString.bind(void 0,Il);class kl extends h{#Ks;#yh=new Map;#yr=!1;#vh;serviceWorkerNetworkRequestsPanelStatus={isOpen:!1,openedAt:0};constructor(t){super(t),t.registerServiceWorkerDispatcher(new Cl(this)),this.#Ks=t.serviceWorkerAgent(),this.enable(),this.#vh=e.Settings.Settings.instance().createSetting("service-worker-update-on-reload",!1),this.#vh.get()&&this.forceUpdateSettingChanged(),this.#vh.addChangeListener(this.forceUpdateSettingChanged,this),new Pl(t,this)}async enable(){this.#yr||(this.#yr=!0,await this.#Ks.invoke_enable())}async disable(){this.#yr&&(this.#yr=!1,this.#yh.clear(),await this.#Ks.invoke_enable())}registrations(){return this.#yh}findVersion(e){for(const t of this.registrations().values()){const n=t.versions.get(e);if(n)return n}return null}deleteRegistration(e){const t=this.#yh.get(e);if(t){if(t.isRedundant())return this.#yh.delete(e),void this.dispatchEventToListeners("RegistrationDeleted",t);t.deleting=!0;for(const e of t.versions.values())this.stopWorker(e.id);this.unregister(t.scopeURL)}}async updateRegistration(e){const t=this.#yh.get(e);t&&await this.#Ks.invoke_updateRegistration({scopeURL:t.scopeURL})}async deliverPushMessage(t,n){const r=this.#yh.get(t);if(!r)return;const s=e.ParsedURL.ParsedURL.extractOrigin(r.scopeURL);await this.#Ks.invoke_deliverPushMessage({origin:s,registrationId:t,data:n})}async dispatchSyncEvent(t,n,r){const s=this.#yh.get(t);if(!s)return;const i=e.ParsedURL.ParsedURL.extractOrigin(s.scopeURL);await this.#Ks.invoke_dispatchSyncEvent({origin:i,registrationId:t,tag:n,lastChance:r})}async dispatchPeriodicSyncEvent(t,n){const r=this.#yh.get(t);if(!r)return;const s=e.ParsedURL.ParsedURL.extractOrigin(r.scopeURL);await this.#Ks.invoke_dispatchPeriodicSyncEvent({origin:s,registrationId:t,tag:n})}async unregister(e){await this.#Ks.invoke_unregister({scopeURL:e})}async startWorker(e){await this.#Ks.invoke_startWorker({scopeURL:e})}async skipWaiting(e){await this.#Ks.invoke_skipWaiting({scopeURL:e})}async stopWorker(e){await this.#Ks.invoke_stopWorker({versionId:e})}async inspectWorker(e){await this.#Ks.invoke_inspectWorker({versionId:e})}workerRegistrationUpdated(e){for(const t of e){let e=this.#yh.get(t.registrationId);e?(e.update(t),e.shouldBeRemoved()?(this.#yh.delete(e.id),this.dispatchEventToListeners("RegistrationDeleted",e)):this.dispatchEventToListeners("RegistrationUpdated",e)):(e=new Ml(t),this.#yh.set(t.registrationId,e),this.dispatchEventToListeners("RegistrationUpdated",e))}}workerVersionUpdated(e){const t=new Set;for(const n of e){const e=this.#yh.get(n.registrationId);e&&(e.updateVersion(n),t.add(e))}for(const e of t)e.shouldBeRemoved()?(this.#yh.delete(e.id),this.dispatchEventToListeners("RegistrationDeleted",e)):this.dispatchEventToListeners("RegistrationUpdated",e)}workerErrorReported(e){const t=this.#yh.get(e.registrationId);t&&(t.errors.push(e),this.dispatchEventToListeners("RegistrationErrorAdded",{registration:t,error:e}))}forceUpdateSettingChanged(){const e=this.#vh.get();this.#Ks.invoke_setForceUpdateOnPageLoad({forceUpdateOnPageLoad:e})}}class Cl{#z;constructor(e){this.#z=e}workerRegistrationUpdated({registrations:e}){this.#z.workerRegistrationUpdated(e)}workerVersionUpdated({versions:e}){this.#z.workerVersionUpdated(e)}workerErrorReported({errorMessage:e}){this.#z.workerErrorReported(e)}}class xl{runningStatus;status;lastUpdatedTimestamp;previousState;constructor(e,t,n,r){this.runningStatus=e,this.status=t,this.lastUpdatedTimestamp=r,this.previousState=n}}class Rl{condition;source;id;constructor(e,t,n){this.condition=e,this.source=t,this.id=n}}class Tl{id;scriptURL;parsedURL;securityOrigin;scriptLastModified;scriptResponseTime;controlledClients;targetId;routerRules;currentState;registration;constructor(e,t){this.registration=e,this.update(t)}update(t){this.id=t.versionId,this.scriptURL=t.scriptURL;const n=new e.ParsedURL.ParsedURL(t.scriptURL);this.securityOrigin=n.securityOrigin(),this.currentState=new xl(t.runningStatus,t.status,this.currentState,Date.now()),this.scriptLastModified=t.scriptLastModified,this.scriptResponseTime=t.scriptResponseTime,t.controlledClients?this.controlledClients=t.controlledClients.slice():this.controlledClients=[],this.targetId=t.targetId||null,this.routerRules=null,t.routerRules&&(this.routerRules=this.parseJSONRules(t.routerRules))}isStartable(){return!this.registration.isDeleted&&this.isActivated()&&this.isStopped()}isStoppedAndRedundant(){return"stopped"===this.runningStatus&&"redundant"===this.status}isStopped(){return"stopped"===this.runningStatus}isStarting(){return"starting"===this.runningStatus}isRunning(){return"running"===this.runningStatus}isStopping(){return"stopping"===this.runningStatus}isNew(){return"new"===this.status}isInstalling(){return"installing"===this.status}isInstalled(){return"installed"===this.status}isActivating(){return"activating"===this.status}isActivated(){return"activated"===this.status}isRedundant(){return"redundant"===this.status}get status(){return this.currentState.status}get runningStatus(){return this.currentState.runningStatus}mode(){return this.isNew()||this.isInstalling()?"installing":this.isInstalled()?"waiting":this.isActivating()||this.isActivated()?"active":"redundant"}parseJSONRules(e){try{const t=JSON.parse(e);if(!Array.isArray(t))return console.error("Parse error: `routerRules` in ServiceWorkerVersion should be an array"),null;const n=[];for(const e of t){const{condition:t,source:r,id:s}=e;if(void 0===t||void 0===r||void 0===s)return console.error("Parse error: Missing some fields of `routerRules` in ServiceWorkerVersion"),null;n.push(new Rl(JSON.stringify(t),JSON.stringify(r),s))}return n}catch{return console.error("Parse error: Invalid `routerRules` in ServiceWorkerVersion"),null}}}!function(e){e.RunningStatus={running:Sl(vl.running),starting:Sl(vl.starting),stopped:Sl(vl.stopped),stopping:Sl(vl.stopping)},e.Status={activated:Sl(vl.activated),activating:Sl(vl.activating),installed:Sl(vl.installed),installing:Sl(vl.installing),new:Sl(vl.new),redundant:Sl(vl.redundant)}}(Tl||(Tl={}));class Ml{#Ih;id;scopeURL;securityOrigin;isDeleted;versions=new Map;deleting=!1;errors=[];constructor(e){this.update(e)}update(t){this.#Ih=Symbol("fingerprint"),this.id=t.registrationId,this.scopeURL=t.scopeURL;const n=new e.ParsedURL.ParsedURL(t.scopeURL);this.securityOrigin=n.securityOrigin(),this.isDeleted=t.isDeleted}fingerprint(){return this.#Ih}versionsByMode(){const e=new Map;for(const t of this.versions.values())e.set(t.mode(),t);return e}updateVersion(e){this.#Ih=Symbol("fingerprint");let t=this.versions.get(e.versionId);return t?(t.update(e),t):(t=new Tl(this,e),this.versions.set(e.versionId,t),t)}isRedundant(){for(const e of this.versions.values())if(!e.isStoppedAndRedundant())return!1;return!0}shouldBeRemoved(){return this.isRedundant()&&(!this.errors.length||this.deleting)}canBeRemoved(){return this.isDeleted||this.deleting}}class Pl{#$n;#wh;#Sh=new Map;constructor(e,t){this.#$n=e,this.#wh=t,t.addEventListener("RegistrationUpdated",this.registrationsUpdated,this),t.addEventListener("RegistrationDeleted",this.registrationsUpdated,this),W.instance().addModelListener(Jr,$r.ExecutionContextCreated,this.executionContextCreated,this)}registrationsUpdated(){this.#Sh.clear();const e=this.#wh.registrations().values();for(const t of e)for(const e of t.versions.values())e.targetId&&this.#Sh.set(e.targetId,e);this.updateAllContextLabels()}executionContextCreated(e){const t=e.data,n=this.serviceWorkerTargetId(t.target());n&&this.updateContextLabel(t,this.#Sh.get(n)||null)}serviceWorkerTargetId(e){return e.parentTarget()!==this.#$n||e.type()!==U.ServiceWorker?null:e.id()}updateAllContextLabels(){for(const e of W.instance().targets()){const t=this.serviceWorkerTargetId(e);if(!t)continue;const n=this.#Sh.get(t)||null,r=e.model(Jr),s=r?r.executionContexts():[];for(const e of s)this.updateContextLabel(e,n)}}updateContextLabel(t,n){if(!n)return void t.setLabel("");const r=e.ParsedURL.ParsedURL.fromString(t.origin),s=r?r.lastPathComponentWithFragment():t.name,i=Tl.Status[n.status];t.setLabel(wl(vl.sSS,{PH1:s,PH2:n.id,PH3:i()}))}}h.register(kl,{capabilities:16384,autostart:!0});var El=Object.freeze({__proto__:null,ServiceWorkerManager:kl,ServiceWorkerRegistration:Ml,ServiceWorkerRouterRule:Rl,get ServiceWorkerVersion(){return Tl},ServiceWorkerVersionState:xl});class Ll extends h{#Ks;constructor(e){super(e),this.#Ks=e.webAuthnAgent(),e.registerWebAuthnDispatcher(new Al(this))}setVirtualAuthEnvEnabled(e){return e?this.#Ks.invoke_enable({enableUI:!0}):this.#Ks.invoke_disable()}async addAuthenticator(e){return(await this.#Ks.invoke_addVirtualAuthenticator({options:e})).authenticatorId}async removeAuthenticator(e){await this.#Ks.invoke_removeVirtualAuthenticator({authenticatorId:e})}async setAutomaticPresenceSimulation(e,t){await this.#Ks.invoke_setAutomaticPresenceSimulation({authenticatorId:e,enabled:t})}async getCredentials(e){return(await this.#Ks.invoke_getCredentials({authenticatorId:e})).credentials}async removeCredential(e,t){await this.#Ks.invoke_removeCredential({authenticatorId:e,credentialId:t})}credentialAdded(e){this.dispatchEventToListeners("CredentialAdded",e)}credentialAsserted(e){this.dispatchEventToListeners("CredentialAsserted",e)}credentialDeleted(e){this.dispatchEventToListeners("CredentialDeleted",e)}credentialUpdated(e){this.dispatchEventToListeners("CredentialUpdated",e)}}class Al{#ls;constructor(e){this.#ls=e}credentialAdded(e){this.#ls.credentialAdded(e)}credentialAsserted(e){this.#ls.credentialAsserted(e)}credentialDeleted(e){this.#ls.credentialDeleted(e)}credentialUpdated(e){this.#ls.credentialUpdated(e)}}h.register(Ll,{capabilities:65536,autostart:!1});var Ol=Object.freeze({__proto__:null,WebAuthnModel:Ll});export{Fi as AccessibilityModel,eo as AnimationModel,no as AutofillModel,Uo as CPUProfilerModel,ya as CPUThrottlingManager,Vt as CSSContainerQuery,me as CSSFontFace,Gt as CSSLayer,Mn as CSSMatchedStyles,Xt as CSSMedia,B as CSSMetadata,Gr as CSSModel,Bt as CSSProperty,Nt as CSSPropertyParser,ht as CSSPropertyParserMatchers,Ht as CSSQuery,pn as CSSRule,Zt as CSSScope,tn as CSSStyleDeclaration,On as CSSStyleSheetHeader,rn as CSSSupports,so as CategorizedBreakpoint,Eo as ChildTargetManager,No as CompilerSourceMappingContentProvider,xo as Connections,Jo as ConsoleModel,q as Cookie,ci as CookieModel,gi as CookieParser,Ta as DOMDebuggerModel,Xs as DOMModel,Ts as DebuggerModel,ta as EmulationModel,oo as EnhancedTracesParser,Aa as EventBreakpointsModel,Oa as FrameAssociated,Fn as FrameManager,Xr as HeapProfilerModel,Xn as IOModel,Ua as IsolateManager,za as IssuesModel,ja as LayerTreeBase,zo as LogModel,ge as NetworkManager,Oi as NetworkRequest,Ps as OverlayColorGenerator,qs as OverlayModel,Ls as OverlayPersistentHighlighter,Ga as PageLoad,sr as PageResourceLoader,Xa as PaintProfiler,Ya as PerformanceMetricsModel,dl as PreloadingModel,cl as ReactNativeApplicationModel,Qn as RemoteObject,Zs as Resource,li as ResourceTreeModel,es as RuntimeModel,u as SDKModel,_i as ScreenCaptureModel,ds as Script,ti as SecurityOriginManager,fi as ServerSentEventProtocol,Si as ServerTiming,yl as ServiceWorkerCacheModel,El as ServiceWorkerManager,Ar as SourceMap,br as SourceMapFunctionRanges,Fr as SourceMapManager,kr as SourceMapScopeChainEntry,gr as SourceMapScopes,Rr as SourceMapScopesInfo,ul as StorageBucketsModel,si as StorageKeyManager,j as Target,G as TargetManager,co as TraceObject,Ol as WebAuthnModel}; From 8b95fce84ea0a7fef79e78582a8717e403fa7349 Mon Sep 17 00:00:00 2001 From: Bartlomiej Bloniarz Date: Thu, 6 Nov 2025 06:43:09 -0800 Subject: [PATCH 054/562] Start AnimationBackend callbacks once per frame in Animated (#54426) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54426 Withouth the backend, Animated triggers the start function once per frame (by updating an atomic bool). We now do the same with animation backend. # Changelog [General] [Changed] - Move the animation backend callback scheduling, behind the `isRenderCallbackStarted` check. Reviewed By: zeyap Differential Revision: D85234259 fbshipit-source-id: 3aaf5f66de1dce4c5563f85bea22f0aa862801bb --- .../animated/NativeAnimatedNodesManager.cpp | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/packages/react-native/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp b/packages/react-native/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp index bf56e2fee4dd..7d2e25522360 100644 --- a/packages/react-native/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp +++ b/packages/react-native/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp @@ -519,6 +519,17 @@ NativeAnimatedNodesManager::ensureEventEmitterListener() noexcept { } void NativeAnimatedNodesManager::startRenderCallbackIfNeeded(bool isAsync) { + // This method can be called from either the UI thread or JavaScript thread. + // It ensures `startOnRenderCallback_` is called exactly once using atomic + // operations. We use std::atomic_bool rather than std::mutex to avoid + // potential deadlocks that could occur if we called external code while + // holding a mutex. + auto isRenderCallbackStarted = isRenderCallbackStarted_.exchange(true); + if (isRenderCallbackStarted) { + // onRender callback is already started. + return; + } + if (ReactNativeFeatureFlags::useSharedAnimatedBackend()) { #ifdef RN_USE_ANIMATION_BACKEND if (auto animationBackend = animationBackend_.lock()) { @@ -531,16 +542,6 @@ void NativeAnimatedNodesManager::startRenderCallbackIfNeeded(bool isAsync) { return; } - // This method can be called from either the UI thread or JavaScript thread. - // It ensures `startOnRenderCallback_` is called exactly once using atomic - // operations. We use std::atomic_bool rather than std::mutex to avoid - // potential deadlocks that could occur if we called external code while - // holding a mutex. - auto isRenderCallbackStarted = isRenderCallbackStarted_.exchange(true); - if (isRenderCallbackStarted) { - // onRender callback is already started. - return; - } if (startOnRenderCallback_) { startOnRenderCallback_([this]() { onRender(); }, isAsync); @@ -549,18 +550,21 @@ void NativeAnimatedNodesManager::startRenderCallbackIfNeeded(bool isAsync) { void NativeAnimatedNodesManager::stopRenderCallbackIfNeeded( bool isAsync) noexcept { - if (ReactNativeFeatureFlags::useSharedAnimatedBackend()) { - if (auto animationBackend = animationBackend_.lock()) { - animationBackend->stop(isAsync); - } - return; - } // When multiple threads reach this point, only one thread should call // stopOnRenderCallback_. This synchronization is primarily needed during // destruction of NativeAnimatedNodesManager. In normal operation, // stopRenderCallbackIfNeeded is always called from the UI thread. auto isRenderCallbackStarted = isRenderCallbackStarted_.exchange(false); + if (ReactNativeFeatureFlags::useSharedAnimatedBackend()) { + if (isRenderCallbackStarted) { + if (auto animationBackend = animationBackend_.lock()) { + animationBackend->stop(isAsync); + } + } + return; + } + if (isRenderCallbackStarted) { if (stopOnRenderCallback_) { stopOnRenderCallback_(isAsync); From 219c2b84c284f162f2f261a09b5a94d197408357 Mon Sep 17 00:00:00 2001 From: Bartlomiej Bloniarz Date: Thu, 6 Nov 2025 06:43:09 -0800 Subject: [PATCH 055/562] Make android frame updates work with AnimationBackend (#54425) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54425 Animation frames on Android are tiggered from UIManagerNativeAnimatedDelegate::runAnimationFrame, so we implement that for the backend # Changelog [General] [Added] - UIManagerNativeAnimatedDelegateBackendImpl for running animation frame updates on android Reviewed By: zeyap Differential Revision: D84055754 fbshipit-source-id: 57dcf2aa62daf2f72c266228f2adecc4a0085bff --- .../animated/NativeAnimatedNodesManager.cpp | 1 + .../NativeAnimatedNodesManagerProvider.cpp | 14 ++++++--- .../animationbackend/AnimationBackend.cpp | 31 ++++++++++++++----- .../animationbackend/AnimationBackend.h | 12 +++++++ 4 files changed, 46 insertions(+), 12 deletions(-) diff --git a/packages/react-native/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp b/packages/react-native/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp index 7d2e25522360..355e69ac7010 100644 --- a/packages/react-native/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp +++ b/packages/react-native/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp @@ -992,6 +992,7 @@ AnimationMutations NativeAnimatedNodesManager::pullAnimationMutations() { AnimationMutation{tag, nullptr, propsBuilder.get()}); containsChange = true; } + updateViewPropsDirect_.clear(); } if (!containsChange) { diff --git a/packages/react-native/ReactCommon/react/renderer/animated/NativeAnimatedNodesManagerProvider.cpp b/packages/react-native/ReactCommon/react/renderer/animated/NativeAnimatedNodesManagerProvider.cpp index b92bf481d471..ed571e15019b 100644 --- a/packages/react-native/ReactCommon/react/renderer/animated/NativeAnimatedNodesManagerProvider.cpp +++ b/packages/react-native/ReactCommon/react/renderer/animated/NativeAnimatedNodesManagerProvider.cpp @@ -80,12 +80,16 @@ NativeAnimatedNodesManagerProvider::getOrCreate( std::move(directManipulationCallback), std::move(fabricCommitCallback), uiManager); -#endif nativeAnimatedNodesManager_ = std::make_shared(animationBackend_); + nativeAnimatedDelegate_ = + std::make_shared( + animationBackend_); + uiManager->unstable_setAnimationBackend(animationBackend_); +#endif } else { nativeAnimatedNodesManager_ = std::make_shared( @@ -93,6 +97,10 @@ NativeAnimatedNodesManagerProvider::getOrCreate( std::move(fabricCommitCallback), std::move(startOnRenderCallback_), std::move(stopOnRenderCallback_)); + + nativeAnimatedDelegate_ = + std::make_shared( + nativeAnimatedNodesManager_); } addEventEmitterListener( @@ -117,10 +125,6 @@ NativeAnimatedNodesManagerProvider::getOrCreate( return false; })); - nativeAnimatedDelegate_ = - std::make_shared( - nativeAnimatedNodesManager_); - uiManager->setNativeAnimatedDelegate(nativeAnimatedDelegate_); // TODO: remove force casting. diff --git a/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp b/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp index c9a9b062ee32..2aaa449bb05a 100644 --- a/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp +++ b/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp @@ -10,6 +10,18 @@ namespace facebook::react { +UIManagerNativeAnimatedDelegateBackendImpl:: + UIManagerNativeAnimatedDelegateBackendImpl( + std::weak_ptr animationBackend) + : animationBackend_(std::move(animationBackend)) {} + +void UIManagerNativeAnimatedDelegateBackendImpl::runAnimationFrame() { + if (auto animationBackendStrong = animationBackend_.lock()) { + animationBackendStrong->onAnimationFrame( + std::chrono::steady_clock::now().time_since_epoch().count() / 1000); + } +} + static inline Props::Shared cloneProps( AnimatedProps& animatedProps, const ShadowNode& shadowNode) { @@ -108,15 +120,20 @@ void AnimationBackend::onAnimationFrame(double timestamp) { void AnimationBackend::start(const Callback& callback, bool isAsync) { callbacks.push_back(callback); // TODO: startOnRenderCallback_ should provide the timestamp from the platform - startOnRenderCallback_( - [this]() { - onAnimationFrame( - std::chrono::steady_clock::now().time_since_epoch().count() / 1000); - }, - isAsync); + if (startOnRenderCallback_) { + startOnRenderCallback_( + [this]() { + onAnimationFrame( + std::chrono::steady_clock::now().time_since_epoch().count() / + 1000); + }, + isAsync); + } } void AnimationBackend::stop(bool isAsync) { - stopOnRenderCallback_(isAsync); + if (stopOnRenderCallback_) { + stopOnRenderCallback_(isAsync); + } callbacks.clear(); } diff --git a/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimationBackend.h b/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimationBackend.h index 9236370c3829..544beae7b16a 100644 --- a/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimationBackend.h +++ b/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimationBackend.h @@ -18,6 +18,18 @@ namespace facebook::react { +class AnimationBackend; + +class UIManagerNativeAnimatedDelegateBackendImpl : public UIManagerNativeAnimatedDelegate { + public: + explicit UIManagerNativeAnimatedDelegateBackendImpl(std::weak_ptr animationBackend); + + void runAnimationFrame() override; + + private: + std::weak_ptr animationBackend_; +}; + struct AnimationMutation { Tag tag; const ShadowNodeFamily *family; From 5c078bd4905615b0fb3a640e81e53d594f195ca6 Mon Sep 17 00:00:00 2001 From: Bartlomiej Bloniarz Date: Thu, 6 Nov 2025 06:43:09 -0800 Subject: [PATCH 056/562] Split families by surfaceId in Animation Backend (#54424) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54424 AnimationBackend might be handling mulitple surfaces at once, so we need to separate the updates, by `SurfaceId` # Changelog [General] [Changed] - `commitUpdatesWithFamilies` renamed to `commitUpdates` [General] [Changed] - split the families by `SurfaceId` in `onAnimationFrame` Reviewed By: zeyap Differential Revision: D84055753 fbshipit-source-id: c92c237df86d28a5da80d11f8e22035548746776 --- .../animationbackend/AnimationBackend.cpp | 68 ++++++++++++------- .../animationbackend/AnimationBackend.h | 4 +- 2 files changed, 45 insertions(+), 27 deletions(-) diff --git a/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp b/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp index 2aaa449bb05a..6b49decc8cf2 100644 --- a/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp +++ b/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp @@ -99,19 +99,23 @@ AnimationBackend::AnimationBackend( void AnimationBackend::onAnimationFrame(double timestamp) { std::unordered_map updates; - std::unordered_set families; + std::unordered_map> + surfaceToFamilies; bool hasAnyLayoutUpdates = false; for (auto& callback : callbacks) { auto muatations = callback(static_cast(timestamp)); for (auto& mutation : muatations) { hasAnyLayoutUpdates |= mutationHasLayoutUpdates(mutation); - families.insert(mutation.family); + const auto family = mutation.family; + if (family != nullptr) { + surfaceToFamilies[family->getSurfaceId()].insert(family); + } updates[mutation.tag] = std::move(mutation.props); } } if (hasAnyLayoutUpdates) { - commitUpdatesWithFamilies(families, updates); + commitUpdates(surfaceToFamilies, updates); } else { synchronouslyUpdateProps(updates); } @@ -137,29 +141,43 @@ void AnimationBackend::stop(bool isAsync) { callbacks.clear(); } -void AnimationBackend::commitUpdatesWithFamilies( - const std::unordered_set& families, +void AnimationBackend::commitUpdates( + const std::unordered_map< + SurfaceId, + std::unordered_set>& surfaceToFamilies, std::unordered_map& updates) { - uiManager_->getShadowTreeRegistry().enumerate( - [families, &updates](const ShadowTree& shadowTree, bool& /*stop*/) { - shadowTree.commit( - [families, &updates](const RootShadowNode& oldRootShadowNode) { - return std::static_pointer_cast( - oldRootShadowNode.cloneMultiple( - families, - [families, &updates]( - const ShadowNode& shadowNode, - const ShadowNodeFragment& fragment) { - auto& animatedProps = updates.at(shadowNode.getTag()); - auto newProps = cloneProps(animatedProps, shadowNode); - return shadowNode.clone( - {newProps, - fragment.children, - shadowNode.getState()}); - })); - }, - {.mountSynchronously = true}); - }); + for (const auto& surfaceEntry : surfaceToFamilies) { + const auto& surfaceId = surfaceEntry.first; + const auto& surfaceFamilies = surfaceEntry.second; + uiManager_->getShadowTreeRegistry().visit( + surfaceId, [&surfaceFamilies, &updates](const ShadowTree& shadowTree) { + shadowTree.commit( + [&surfaceFamilies, + &updates](const RootShadowNode& oldRootShadowNode) { + return std::static_pointer_cast( + oldRootShadowNode.cloneMultiple( + surfaceFamilies, + [&surfaceFamilies, &updates]( + const ShadowNode& shadowNode, + const ShadowNodeFragment& fragment) { + auto newProps = + ShadowNodeFragment::propsPlaceholder(); + if (surfaceFamilies.contains( + &shadowNode.getFamily())) { + auto& animatedProps = + updates.at(shadowNode.getTag()); + newProps = cloneProps(animatedProps, shadowNode); + } + return shadowNode.clone( + {.props = newProps, + .children = fragment.children, + .state = shadowNode.getState(), + .runtimeShadowNodeReference = false}); + })); + }, + {.mountSynchronously = true}); + }); + } } void AnimationBackend::synchronouslyUpdateProps( diff --git a/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimationBackend.h b/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimationBackend.h index 544beae7b16a..ed19f5a52eed 100644 --- a/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimationBackend.h +++ b/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimationBackend.h @@ -59,8 +59,8 @@ class AnimationBackend : public UIManagerAnimationBackend { DirectManipulationCallback &&directManipulationCallback, FabricCommitCallback &&fabricCommitCallback, UIManager *uiManager); - void commitUpdatesWithFamilies( - const std::unordered_set &families, + void commitUpdates( + const std::unordered_map> &surfaceToFamilies, std::unordered_map &updates); void synchronouslyUpdateProps(const std::unordered_map &updates); From 75a11703a0baa0f3b48f977d5ca861eb177c5ab5 Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Thu, 6 Nov 2025 06:56:43 -0800 Subject: [PATCH 057/562] Remove CxxModule 1/2 Java/Kotlin part (#54270) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54270 Changelog: [General][Breaking] Remove CxxModule 1/2 Java/Kotlin part Reviewed By: javache Differential Revision: D85459212 fbshipit-source-id: 1ca7195e75a7422f4de5839a11356bbf26d75881 --- .../ReactPackageTurboModuleManagerDelegate.kt | 5 +-- .../com/facebook/react/bridge/ModuleHolder.kt | 4 +- .../react/bridge/NativeModuleRegistry.kt | 17 +-------- .../turbomodule/core/TurboModuleManager.kt | 37 +------------------ .../ReactCommon/TurboModuleManager.cpp | 33 ----------------- 5 files changed, 7 insertions(+), 89 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackageTurboModuleManagerDelegate.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackageTurboModuleManagerDelegate.kt index 805d065743b0..f3f838fdd352 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackageTurboModuleManagerDelegate.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackageTurboModuleManagerDelegate.kt @@ -8,7 +8,6 @@ package com.facebook.react import com.facebook.jni.HybridData -import com.facebook.react.bridge.CxxModuleWrapper import com.facebook.react.bridge.ModuleSpec import com.facebook.react.bridge.NativeModule import com.facebook.react.bridge.ReactApplicationContext @@ -103,7 +102,7 @@ public abstract class ReactPackageTurboModuleManagerDelegate : TurboModuleManage moduleClass.name, reactModule.canOverrideExistingModule, true, - reactModule.isCxxModule, + false, ReactModuleInfo.classIsTurboModule(moduleClass), ) else @@ -112,7 +111,7 @@ public abstract class ReactPackageTurboModuleManagerDelegate : TurboModuleManage moduleClass.name, module.canOverrideExistingModule(), true, - CxxModuleWrapper::class.java.isAssignableFrom(moduleClass), + false, ReactModuleInfo.classIsTurboModule(moduleClass), ) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ModuleHolder.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ModuleHolder.kt index d4315652ebeb..5d5dcc9a303a 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ModuleHolder.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ModuleHolder.kt @@ -60,7 +60,7 @@ public class ModuleHolder { nativeModule.javaClass.simpleName, nativeModule.canOverrideExistingModule(), true, - CxxModuleWrapper::class.java.isAssignableFrom(nativeModule.javaClass), + false, ReactModuleInfo.classIsTurboModule(nativeModule.javaClass), ) @@ -108,7 +108,7 @@ public class ModuleHolder { get() = reactModuleInfo.isTurboModule public val isCxxModule: Boolean - get() = reactModuleInfo.isCxxModule + get() = false public val className: String get() = reactModuleInfo.className diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModuleRegistry.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModuleRegistry.kt index 9cc64c1119af..402379f8f96e 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModuleRegistry.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModuleRegistry.kt @@ -36,25 +36,10 @@ public class NativeModuleRegistry( @JvmName("getJavaModules") // This is needed because this method is accessed by JNI internal fun getJavaModules(jsInstance: JSInstance): List = buildList { for ((_, value) in modules) { - if (!value.isCxxModule) { - add(JavaModuleWrapper(jsInstance, value)) - } + add(JavaModuleWrapper(jsInstance, value)) } } - @get:JvmName( - "getCxxModules" - ) // This is needed till there are Java Consumer of this API inside React - // Native - internal val cxxModules: List - get() = buildList { - for ((_, value) in modules) { - if (value.isCxxModule) { - add(value) - } - } - } - /** Adds any new modules to the current module registry */ @JvmName( "registerModules" diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleManager.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleManager.kt index dc018457ba73..9581196b9f4b 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleManager.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleManager.kt @@ -11,7 +11,6 @@ import androidx.annotation.GuardedBy import com.facebook.common.logging.FLog import com.facebook.jni.HybridData import com.facebook.proguard.annotations.DoNotStrip -import com.facebook.react.bridge.CxxModuleWrapper import com.facebook.react.bridge.NativeModule import com.facebook.react.bridge.RuntimeExecutor import com.facebook.react.common.annotations.FrameworkAPI @@ -110,39 +109,7 @@ public class TurboModuleManager( } val module = getModule(moduleName) - return if (module !is CxxModuleWrapper && module !is TurboModule) module else null - } - - // used from TurboModuleManager.cpp - @Suppress("unused") - @DoNotStrip - private fun getLegacyCxxModule(moduleName: String): CxxModuleWrapper? { - /* - * This API is invoked from global.nativeModuleProxy. - * Only call getModule if the native module is a legacy module. - */ - if (!isLegacyModule(moduleName)) { - return null - } - - val module = getModule(moduleName) - return if (module is CxxModuleWrapper && module !is TurboModule) module else null - } - - // used from TurboModuleManager.cpp - @Suppress("unused") - @DoNotStrip - private fun getTurboLegacyCxxModule(moduleName: String): CxxModuleWrapper? { - /* - * This API is invoked from global.__turboModuleProxy. - * Only call getModule if the native module is a turbo module. - */ - if (!isTurboModule(moduleName)) { - return null - } - - val module = getModule(moduleName) - return if (module is CxxModuleWrapper && module is TurboModule) module else null + return if (module !is TurboModule) module else null } // used from TurboModuleManager.cpp @@ -158,7 +125,7 @@ public class TurboModuleManager( } val module = getModule(moduleName) - return if (module !is CxxModuleWrapper && module is TurboModule) module else null + return if (module is TurboModule) module else null } /** diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/TurboModuleManager.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/TurboModuleManager.cpp index d1a8e5e447f8..c7ed15bde6a9 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/TurboModuleManager.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/TurboModuleManager.cpp @@ -208,22 +208,6 @@ std::shared_ptr TurboModuleManager::getTurboModule( return turboModule; } - static auto getTurboLegacyCxxModule = - javaPart->getClass() - ->getMethod( - const std::string&)>("getTurboLegacyCxxModule"); - auto legacyCxxModule = getTurboLegacyCxxModule(javaPart.get(), name); - if (legacyCxxModule) { - TurboModulePerfLogger::moduleJSRequireEndingStart(moduleName); - - auto turboModule = std::make_shared( - legacyCxxModule->cthis()->getModule(), jsCallInvoker_); - turboModuleCache_.insert({name, turboModule}); - - TurboModulePerfLogger::moduleJSRequireEndingEnd(moduleName); - return turboModule; - } - return nullptr; } @@ -260,23 +244,6 @@ std::shared_ptr TurboModuleManager::getLegacyModule( TurboModulePerfLogger::moduleJSRequireBeginningEnd(moduleName); - static auto getLegacyCxxModule = - javaPart->getClass() - ->getMethod( - const std::string&)>("getLegacyCxxModule"); - auto legacyCxxModule = getLegacyCxxModule(javaPart.get(), name); - - if (legacyCxxModule) { - TurboModulePerfLogger::moduleJSRequireEndingStart(moduleName); - - auto turboModule = std::make_shared( - legacyCxxModule->cthis()->getModule(), jsCallInvoker_); - legacyModuleCache_.insert({name, turboModule}); - - TurboModulePerfLogger::moduleJSRequireEndingEnd(moduleName); - return turboModule; - } - static auto getLegacyJavaModule = javaPart->getClass() ->getMethod(const std::string&)>( From dbb7498bbf405e7711ec840bad57381911dd20ea Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Thu, 6 Nov 2025 08:26:01 -0800 Subject: [PATCH 058/562] Move common JSI binding utils to jsitooling (#54406) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54406 Refactor some dependencies to avoid pulling in `jsireact` (which is deprecated) in new environments which are binary-size constrained. Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D86200983 fbshipit-source-id: 398c37d77a3bfe7798d52059c9f56eb5143784cf --- packages/react-native/Package.swift | 15 +++--- .../jni/react/runtime/jni/JReactInstance.cpp | 3 +- .../ReactCommon/cxxreact/ReactMarker.cpp | 1 - .../ReactCommon/jsiexecutor/CMakeLists.txt | 4 +- .../jsiexecutor/React-jsiexecutor.podspec | 2 + .../jsiexecutor/jsireact/JSIExecutor.cpp | 40 -------------- .../jsiexecutor/jsireact/JSIExecutor.h | 7 +-- .../tests/ReactInstanceIntegrationTest.cpp | 1 + .../react/runtime/JSRuntimeBindings.cpp | 54 +++++++++++++++++++ .../react/runtime/JSRuntimeBindings.h | 20 +++++++ .../react/renderer/core/EventDispatcher.cpp | 2 +- .../renderer/core/EventQueueProcessor.cpp | 6 +-- .../react/runtime/ReactInstance.cpp | 14 ++--- .../ReactCommon/react/runtime/ReactInstance.h | 1 - .../react/runtime/ReactHost.cpp | 1 + 15 files changed, 103 insertions(+), 68 deletions(-) create mode 100644 packages/react-native/ReactCommon/jsitooling/react/runtime/JSRuntimeBindings.cpp create mode 100644 packages/react-native/ReactCommon/jsitooling/react/runtime/JSRuntimeBindings.h diff --git a/packages/react-native/Package.swift b/packages/react-native/Package.swift index db484e886d4e..9e23bf7a25f9 100644 --- a/packages/react-native/Package.swift +++ b/packages/react-native/Package.swift @@ -199,21 +199,20 @@ let reactCxxReact = RNTarget( searchPaths: [CallInvokerPath], excludedPaths: ["tests"], dependencies: [.reactNativeDependencies, .jsi, .reactPerfLogger, .logger, .reactDebug, .reactJsInspector] +) +/// React-jsitooling.podspec +let reactJsiTooling = RNTarget( + name: .reactJsiTooling, + path: "ReactCommon/jsitooling", + dependencies: [.reactNativeDependencies, .jsi, .reactJsInspector, .reactJsInspectorTracing, .reactCxxReact] ) /// React-jsiexecutor.podspec let reactJsiExecutor = RNTarget( name: .reactJsiExecutor, path: "ReactCommon/jsiexecutor", - dependencies: [.reactNativeDependencies, .jsi, .reactPerfLogger, .reactCxxReact, .reactJsInspector] -) - -/// React-jsitooling.podspec -let reactJsiTooling = RNTarget( - name: .reactJsiTooling, - path: "ReactCommon/jsitooling", - dependencies: [.reactNativeDependencies, .reactJsInspector, .reactJsInspectorTracing, .reactCxxReact, .jsi, .reactRuntimeExecutor] + dependencies: [.reactNativeDependencies, .jsi, .reactCxxReact, .reactJsiTooling] ) /// React-hermes.podspec diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/runtime/jni/JReactInstance.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/runtime/jni/JReactInstance.cpp index 5d123a5d1b80..b2911f092b5f 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/runtime/jni/JReactInstance.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/runtime/jni/JReactInstance.cpp @@ -13,11 +13,12 @@ #include #include #include -#include #include #include #include #include +#include + #include "JavaTimerRegistry.h" namespace facebook::react { diff --git a/packages/react-native/ReactCommon/cxxreact/ReactMarker.cpp b/packages/react-native/ReactCommon/cxxreact/ReactMarker.cpp index df845915f882..e605de535554 100644 --- a/packages/react-native/ReactCommon/cxxreact/ReactMarker.cpp +++ b/packages/react-native/ReactCommon/cxxreact/ReactMarker.cpp @@ -6,7 +6,6 @@ */ #include "ReactMarker.h" -#include namespace facebook::react::ReactMarker { diff --git a/packages/react-native/ReactCommon/jsiexecutor/CMakeLists.txt b/packages/react-native/ReactCommon/jsiexecutor/CMakeLists.txt index 85f67b32d155..4ba0d44f3f26 100644 --- a/packages/react-native/ReactCommon/jsiexecutor/CMakeLists.txt +++ b/packages/react-native/ReactCommon/jsiexecutor/CMakeLists.txt @@ -20,7 +20,9 @@ target_link_libraries(jsireact reactperflogger folly_runtime glog - jsi) + jserrorhandler + jsi + jsitooling) target_compile_reactnative_options(jsireact PRIVATE) target_compile_options(jsireact PRIVATE -O3) diff --git a/packages/react-native/ReactCommon/jsiexecutor/React-jsiexecutor.podspec b/packages/react-native/ReactCommon/jsiexecutor/React-jsiexecutor.podspec index 03497f2e1463..a0cc74783b04 100644 --- a/packages/react-native/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +++ b/packages/react-native/ReactCommon/jsiexecutor/React-jsiexecutor.podspec @@ -30,7 +30,9 @@ Pod::Spec.new do |s| s.header_dir = "jsireact" s.dependency "React-cxxreact" + s.dependency "React-jserrorhandler" s.dependency "React-jsi" + s.dependency "React-jsitooling" s.dependency "React-perflogger" add_dependency(s, "React-debug") add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"]) diff --git a/packages/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp b/packages/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp index 183b148c635a..5c16909b002c 100644 --- a/packages/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp +++ b/packages/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp @@ -576,44 +576,4 @@ void JSIExecutor::flush() {} #endif // RCT_REMOVE_LEGACY_ARCH -void bindNativeLogger(Runtime& runtime, Logger logger) { - runtime.global().setProperty( - runtime, - "nativeLoggingHook", - Function::createFromHostFunction( - runtime, - PropNameID::forAscii(runtime, "nativeLoggingHook"), - 2, - [logger = std::move(logger)]( - jsi::Runtime& runtime, - const jsi::Value&, - const jsi::Value* args, - size_t count) { - if (count != 2) { - throw std::invalid_argument( - "nativeLoggingHook takes 2 arguments"); - } - logger( - args[0].asString(runtime).utf8(runtime), - static_cast(args[1].asNumber())); - return Value::undefined(); - })); -} - -void bindNativePerformanceNow(Runtime& runtime) { - runtime.global().setProperty( - runtime, - "nativePerformanceNow", - Function::createFromHostFunction( - runtime, - PropNameID::forAscii(runtime, "nativePerformanceNow"), - 0, - [](jsi::Runtime& runtime, - const jsi::Value&, - const jsi::Value* args, - size_t /*count*/) { - return HighResTimeStamp::now().toDOMHighResTimeStamp(); - })); -} - } // namespace facebook::react diff --git a/packages/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.h b/packages/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.h index ad088e873bce..b1a09bd61414 100644 --- a/packages/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.h +++ b/packages/react-native/ReactCommon/jsiexecutor/jsireact/JSIExecutor.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -127,10 +128,4 @@ class [[deprecated("This API will be removed along with the legacy architecture. #endif // RCT_REMOVE_LEGACY_ARCH }; -using Logger = std::function; -void bindNativeLogger(jsi::Runtime &runtime, Logger logger); - -void bindNativePerformanceNow(jsi::Runtime &runtime); - -double performanceNow(); } // namespace facebook::react diff --git a/packages/react-native/ReactCommon/jsinspector-modern/tests/ReactInstanceIntegrationTest.cpp b/packages/react-native/ReactCommon/jsinspector-modern/tests/ReactInstanceIntegrationTest.cpp index 8cc8dc3c5089..de1770495282 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/tests/ReactInstanceIntegrationTest.cpp +++ b/packages/react-native/ReactCommon/jsinspector-modern/tests/ReactInstanceIntegrationTest.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include using namespace ::testing; diff --git a/packages/react-native/ReactCommon/jsitooling/react/runtime/JSRuntimeBindings.cpp b/packages/react-native/ReactCommon/jsitooling/react/runtime/JSRuntimeBindings.cpp new file mode 100644 index 000000000000..f44f9633deab --- /dev/null +++ b/packages/react-native/ReactCommon/jsitooling/react/runtime/JSRuntimeBindings.cpp @@ -0,0 +1,54 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#include "JSRuntimeBindings.h" + +#include + +namespace facebook::react { + +void bindNativeLogger(jsi::Runtime& runtime, Logger logger) { + runtime.global().setProperty( + runtime, + "nativeLoggingHook", + jsi::Function::createFromHostFunction( + runtime, + jsi::PropNameID::forAscii(runtime, "nativeLoggingHook"), + 2, + [logger = std::move(logger)]( + jsi::Runtime& runtime, + const jsi::Value& /* this */, + const jsi::Value* args, + size_t count) { + if (count != 2) { + throw std::invalid_argument( + "nativeLoggingHook takes 2 arguments"); + } + logger( + args[0].asString(runtime).utf8(runtime), + static_cast(args[1].asNumber())); + return jsi::Value::undefined(); + })); +} + +void bindNativePerformanceNow(jsi::Runtime& runtime) { + runtime.global().setProperty( + runtime, + "nativePerformanceNow", + jsi::Function::createFromHostFunction( + runtime, + jsi::PropNameID::forAscii(runtime, "nativePerformanceNow"), + 0, + [](jsi::Runtime& /* runtime */, + const jsi::Value& /* this */, + const jsi::Value* /* args */, + size_t /*count*/) { + return HighResTimeStamp::now().toDOMHighResTimeStamp(); + })); +} + +} // namespace facebook::react diff --git a/packages/react-native/ReactCommon/jsitooling/react/runtime/JSRuntimeBindings.h b/packages/react-native/ReactCommon/jsitooling/react/runtime/JSRuntimeBindings.h new file mode 100644 index 000000000000..720ef82ed853 --- /dev/null +++ b/packages/react-native/ReactCommon/jsitooling/react/runtime/JSRuntimeBindings.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +namespace facebook::react { + +using Logger = std::function; +void bindNativeLogger(jsi::Runtime &runtime, Logger logger); + +void bindNativePerformanceNow(jsi::Runtime &runtime); + +} // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/core/EventDispatcher.cpp b/packages/react-native/ReactCommon/react/renderer/core/EventDispatcher.cpp index 6bc38b94d835..5fa5e6821a51 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/EventDispatcher.cpp +++ b/packages/react-native/ReactCommon/react/renderer/core/EventDispatcher.cpp @@ -6,7 +6,7 @@ */ #include "EventDispatcher.h" -#include + #include #include "EventQueue.h" diff --git a/packages/react-native/ReactCommon/react/renderer/core/EventQueueProcessor.cpp b/packages/react-native/ReactCommon/react/renderer/core/EventQueueProcessor.cpp index 7d268e2c2048..90cdc8f9888a 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/EventQueueProcessor.cpp +++ b/packages/react-native/ReactCommon/react/renderer/core/EventQueueProcessor.cpp @@ -5,13 +5,13 @@ * LICENSE file in the root directory of this source tree. */ -#include +#include "EventQueueProcessor.h" + #include #include + #include "EventEmitter.h" #include "EventLogger.h" -#include "EventQueue.h" -#include "ShadowNodeFamily.h" namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/runtime/ReactInstance.cpp b/packages/react-native/ReactCommon/react/runtime/ReactInstance.cpp index 7b3e6786b463..8e1dfd2fa0ee 100644 --- a/packages/react-native/ReactCommon/react/runtime/ReactInstance.cpp +++ b/packages/react-native/ReactCommon/react/runtime/ReactInstance.cpp @@ -18,10 +18,10 @@ #include #include #include -#include #include #include #include +#include #include #include #include @@ -48,6 +48,12 @@ std::shared_ptr createRuntimeScheduler( return scheduler; } +std::string getSyntheticBundlePath(uint32_t bundleId) { + std::array buffer{}; + std::snprintf(buffer.data(), buffer.size(), "seg-%u.js", bundleId); + return buffer.data(); +} + } // namespace ReactInstance::ReactInstance( @@ -365,12 +371,8 @@ void ReactInstance::registerSegment( } LOG(WARNING) << "Starting to evaluate segment " << segmentId << " in ReactInstance::registerSegment"; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" runtime.evaluateJavaScript( - std::move(script), - JSExecutor::getSyntheticBundlePath(segmentId, segmentPath)); -#pragma clang diagnostic pop + std::move(script), getSyntheticBundlePath(segmentId)); LOG(WARNING) << "Finished evaluating segment " << segmentId << " in ReactInstance::registerSegment"; if (hasLogger) { diff --git a/packages/react-native/ReactCommon/react/runtime/ReactInstance.h b/packages/react-native/ReactCommon/react/runtime/ReactInstance.h index a138c2e1fc5c..84a8b4cc2cb2 100644 --- a/packages/react-native/ReactCommon/react/runtime/ReactInstance.h +++ b/packages/react-native/ReactCommon/react/runtime/ReactInstance.h @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include diff --git a/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp b/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp index d58d0a18692f..896ec4f76790 100644 --- a/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp +++ b/packages/react-native/ReactCxxPlatform/react/runtime/ReactHost.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include From 0892a56db9d8c1fa2bb16be5386f790a0c67852f Mon Sep 17 00:00:00 2001 From: Gijs Weterings Date: Thu, 6 Nov 2025 08:58:25 -0800 Subject: [PATCH 059/562] Button docs cleanup (#54433) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54433 Button links to js.coach, but this domain is up for sale. Let's clean it up Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D86418236 fbshipit-source-id: 7be9782eb13b4fceb7d6439bea89ca7d277b6c69 --- packages/react-native/Libraries/Components/Button.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/react-native/Libraries/Components/Button.js b/packages/react-native/Libraries/Components/Button.js index 875d9b209339..e64d0c362d1f 100644 --- a/packages/react-native/Libraries/Components/Button.js +++ b/packages/react-native/Libraries/Components/Button.js @@ -184,9 +184,6 @@ export type ButtonProps = $ReadOnly<{ [button:source]: https://github.com/facebook/react-native/blob/HEAD/Libraries/Components/Button.js - [button:examples]: - https://js.coach/?menu%5Bcollections%5D=React%20Native&page=1&query=button - ```jsx