From b76459b0f8b2b1fa115abb90a8818c48c691f71e Mon Sep 17 00:00:00 2001 From: xingguangcuican Date: Sat, 25 Jul 2026 20:09:24 +0800 Subject: [PATCH 01/12] fix(app): restore fork signing key downloads (#172) --- app/build.gradle.kts | 1 + .../com/abk/kernel/data/api/NetworkClient.kt | 11 +- .../utils/ForkSigningPublicKeyResolver.kt | 36 ++++++ .../com/abk/kernel/viewmodel/MainViewModel.kt | 76 ++++++----- .../repository/GitHubRepositoryNetworkTest.kt | 120 ++++++++++++++++++ .../utils/ForkSigningPublicKeyResolverTest.kt | 84 ++++++++++++ gradle/libs.versions.toml | 1 + 7 files changed, 287 insertions(+), 42 deletions(-) create mode 100644 app/src/main/java/com/abk/kernel/utils/ForkSigningPublicKeyResolver.kt create mode 100644 app/src/test/java/com/abk/kernel/data/repository/GitHubRepositoryNetworkTest.kt create mode 100644 app/src/test/java/com/abk/kernel/utils/ForkSigningPublicKeyResolverTest.kt diff --git a/app/build.gradle.kts b/app/build.gradle.kts index e5376c51f..cdfd6f9d5 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -204,6 +204,7 @@ dependencies { testImplementation(libs.robolectric) testImplementation(libs.kotlinx.coroutines.test) testImplementation(libs.androidx.test.core) + testImplementation(libs.okhttp.mockwebserver) androidTestImplementation(libs.androidx.junit) androidTestImplementation(libs.androidx.espresso.core) androidTestImplementation(platform(libs.androidx.compose.bom)) diff --git a/app/src/main/java/com/abk/kernel/data/api/NetworkClient.kt b/app/src/main/java/com/abk/kernel/data/api/NetworkClient.kt index 68ff203c5..ed1962c6d 100644 --- a/app/src/main/java/com/abk/kernel/data/api/NetworkClient.kt +++ b/app/src/main/java/com/abk/kernel/data/api/NetworkClient.kt @@ -23,8 +23,10 @@ object NetworkClient { .addInterceptor { chain -> val original = chain.request() val builder = original.newBuilder() - .header("Accept", "application/vnd.github+json") .header("X-GitHub-Api-Version", "2022-11-28") + if (original.header("Accept").isNullOrBlank()) { + builder.header("Accept", "application/vnd.github+json") + } if (!token.isNullOrBlank()) { builder.header("Authorization", "Bearer $token") } @@ -33,9 +35,12 @@ object NetworkClient { .build() } - fun createApiService(token: String? = null): GitHubApiService { + internal fun createApiService( + token: String? = null, + baseUrl: String = GITHUB_API_BASE + ): GitHubApiService { return Retrofit.Builder() - .baseUrl(GITHUB_API_BASE) + .baseUrl(baseUrl) .client(buildOkHttpClient(token)) .addConverterFactory(GsonConverterFactory.create()) .build() diff --git a/app/src/main/java/com/abk/kernel/utils/ForkSigningPublicKeyResolver.kt b/app/src/main/java/com/abk/kernel/utils/ForkSigningPublicKeyResolver.kt new file mode 100644 index 000000000..2c27d6937 --- /dev/null +++ b/app/src/main/java/com/abk/kernel/utils/ForkSigningPublicKeyResolver.kt @@ -0,0 +1,36 @@ +package com.abk.kernel.utils + +import com.abk.kernel.data.repository.Result + +data class ForkSigningPublicKeyValue( + val base64: String, + val pem: String, +) + +internal const val INVALID_FORK_SIGNING_PUBLIC_KEY_MESSAGE = + "Fork signing public key is unavailable or invalid" + +class ForkSigningPublicKeyResolver( + private val assetName: String, + private val downloadReleaseAssetText: suspend ( + owner: String, + repo: String, + releaseId: Long, + assetName: String, + ) -> Result, +) { + fun parse(value: String?): ForkSigningPublicKeyValue? { + val base64 = ForkSigningManager.publicKeyBase64FromStoredValue(value) ?: return null + val pem = runCatching { ForkSigningManager.publicKeyPemFromBase64(base64) }.getOrNull() + ?: return null + return ForkSigningPublicKeyValue(base64 = base64, pem = pem) + } + + suspend fun download(owner: String, repo: String, releaseId: Long): Result = + when (val result = downloadReleaseAssetText(owner, repo, releaseId, assetName)) { + is Result.Success -> parse(result.data)?.let { Result.Success(it) } + ?: Result.Error(INVALID_FORK_SIGNING_PUBLIC_KEY_MESSAGE) + is Result.Error -> Result.Error(result.message, result.code) + Result.Loading -> Result.Loading + } +} diff --git a/app/src/main/java/com/abk/kernel/viewmodel/MainViewModel.kt b/app/src/main/java/com/abk/kernel/viewmodel/MainViewModel.kt index 31cb080f6..71b64a05a 100644 --- a/app/src/main/java/com/abk/kernel/viewmodel/MainViewModel.kt +++ b/app/src/main/java/com/abk/kernel/viewmodel/MainViewModel.kt @@ -32,8 +32,11 @@ import com.abk.kernel.utils.ForkSigningImportError import com.abk.kernel.utils.ForkSigningImportException import com.abk.kernel.utils.ForkSigningMaterial import com.abk.kernel.utils.ForkSigningManager +import com.abk.kernel.utils.ForkSigningPublicKeyResolver +import com.abk.kernel.utils.ForkSigningPublicKeyValue import com.abk.kernel.utils.DownloadUtils import com.abk.kernel.utils.FailureLogExtractor +import com.abk.kernel.utils.INVALID_FORK_SIGNING_PUBLIC_KEY_MESSAGE import com.abk.kernel.utils.NotificationUtils import com.abk.kernel.utils.WorkflowStepI18n import com.abk.kernel.utils.BUNDLED_SUSFS_VERSION @@ -274,6 +277,10 @@ class MainViewModel @JvmOverloads constructor( private val prefs = PreferencesRepository(application) val github: GitHubRepository = github + private val forkSigningPublicKeyResolver = ForkSigningPublicKeyResolver( + assetName = FORK_ARTIFACT_SIGNING_PUBLIC_KEY_ASSET_NAME, + downloadReleaseAssetText = this.github::downloadReleaseAssetText + ) private val gson = Gson() private val ksuModuleListType = object : TypeToken>>() {}.type private var hasSavedBuildConfig = false @@ -1231,10 +1238,10 @@ class MainViewModel @JvmOverloads constructor( fork: GitHubRepo, release: GitHubRelease, ): String? { - ForkSigningManager.publicKeyPemFromStoredValue(prefs.forkArtifactSigningPublicKey.first()) - ?.let { return it } - return when (val downloaded = github.downloadReleaseAssetText(owner, fork.name, release.id, FORK_ARTIFACT_SIGNING_PUBLIC_KEY_ASSET_NAME)) { - is Result.Success -> downloaded.data.trim().takeIf { it.isNotBlank() } + forkSigningPublicKeyResolver.parse(prefs.forkArtifactSigningPublicKey.first()) + ?.let { return it.pem } + return when (val resolved = forkSigningPublicKeyResolver.download(owner, fork.name, release.id)) { + is Result.Success -> resolved.data.pem else -> null } } @@ -1404,22 +1411,13 @@ class MainViewModel @JvmOverloads constructor( ) Result.Loading -> return@withLock Result.Loading } - suspend fun readRemotePublicKey(): String? = - when (val result = github.downloadReleaseAssetText( - owner, - fork.name, - release.id, - FORK_ARTIFACT_SIGNING_PUBLIC_KEY_ASSET_NAME, - )) { - is Result.Success -> ForkSigningManager.publicKeyBase64FromStoredValue( - result.data - ) - else -> null - } - val firstPublicKeyBase64 = readRemotePublicKey() - ?: return@withLock Result.Error( - "Fork signing public key is unavailable or invalid" - ) + suspend fun readRemotePublicKey(): Result = + forkSigningPublicKeyResolver.download(owner, fork.name, release.id) + val firstPublicKey = when (val result = readRemotePublicKey()) { + is Result.Success -> result.data + is Result.Error -> return@withLock Result.Error(result.message, result.code) + Result.Loading -> return@withLock Result.Loading + } val secretExists = when (val result = github.listRepositorySecrets(owner, fork.name)) { is Result.Success -> result.data.any { it.name == secretName } is Result.Error -> return@withLock Result.Error( @@ -1430,17 +1428,18 @@ class MainViewModel @JvmOverloads constructor( if (!secretExists) { return@withLock Result.Error("Fork signing Secret is missing") } - val secondPublicKeyBase64 = readRemotePublicKey() - ?: return@withLock Result.Error( - "Fork signing public key is unavailable or invalid" - ) - if (firstPublicKeyBase64 != secondPublicKeyBase64) { + val secondPublicKey = when (val result = readRemotePublicKey()) { + is Result.Success -> result.data + is Result.Error -> return@withLock Result.Error(result.message, result.code) + Result.Loading -> return@withLock Result.Loading + } + if (firstPublicKey.base64 != secondPublicKey.base64) { return@withLock Result.Error( "Fork signing public key changed during refresh" ) } - prefs.saveForkArtifactSigningState(firstPublicKeyBase64, secretName, releaseTag) - Result.Success(ForkSigningManager.publicKeyPemFromBase64(firstPublicKeyBase64)) + prefs.saveForkArtifactSigningState(firstPublicKey.base64, secretName, releaseTag) + Result.Success(firstPublicKey.pem) } private suspend fun ensureForkArtifactSigningReady(owner: String, fork: GitHubRepo) { @@ -1498,23 +1497,22 @@ class MainViewModel @JvmOverloads constructor( } val existingPublicKeyAsset = releaseAssets.firstOrNull { it.name == FORK_ARTIFACT_SIGNING_PUBLIC_KEY_ASSET_NAME } if (secretExists && existingPublicKeyAsset != null) { - when (val downloaded = github.downloadReleaseAssetText(owner, fork.name, release.id, FORK_ARTIFACT_SIGNING_PUBLIC_KEY_ASSET_NAME)) { + when (val resolved = forkSigningPublicKeyResolver.download(owner, fork.name, release.id)) { is Result.Success -> { - val base64 = ForkSigningManager.publicKeyBase64FromStoredValue( - downloaded.data + prefs.saveForkArtifactSigningState( + resolved.data.base64, + secretName, + releaseTag ) - if (base64 == null) { - showSnackbar("Fork signing public key is invalid", longDuration = true) - return - } - prefs.saveForkArtifactSigningState(base64, secretName, releaseTag) return } is Result.Error -> { - showSnackbar( - "Fork signing public key refresh failed: ${downloaded.message}", - longDuration = true - ) + val message = if (resolved.message == INVALID_FORK_SIGNING_PUBLIC_KEY_MESSAGE) { + "Fork signing public key is invalid" + } else { + "Fork signing public key refresh failed: ${resolved.message}" + } + showSnackbar(message, longDuration = true) return } Result.Loading -> return diff --git a/app/src/test/java/com/abk/kernel/data/repository/GitHubRepositoryNetworkTest.kt b/app/src/test/java/com/abk/kernel/data/repository/GitHubRepositoryNetworkTest.kt new file mode 100644 index 000000000..5383cef88 --- /dev/null +++ b/app/src/test/java/com/abk/kernel/data/repository/GitHubRepositoryNetworkTest.kt @@ -0,0 +1,120 @@ +package com.abk.kernel.data.repository + +import com.abk.kernel.data.api.NetworkClient +import okhttp3.mockwebserver.Dispatcher +import okhttp3.mockwebserver.MockResponse +import okhttp3.mockwebserver.MockWebServer +import okhttp3.mockwebserver.RecordedRequest +import org.junit.After +import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue +import org.junit.Before +import org.junit.Test + +class GitHubRepositoryNetworkTest { + + private lateinit var server: MockWebServer + private lateinit var repository: GitHubRepository + + @Before + fun setUp() { + server = MockWebServer() + server.start() + repository = GitHubRepository( + apiService = NetworkClient.createApiService( + token = "test-token", + baseUrl = server.url("/").toString() + ) + ) + } + + @After + fun tearDown() { + server.shutdown() + } + + @Test + fun getRepo_usesGitHubJsonAcceptByDefault() { + server.enqueue( + MockResponse() + .setResponseCode(200) + .setBody( + """ + { + "id": 1, + "name": "repo", + "full_name": "owner/repo", + "fork": false, + "default_branch": "main", + "private": false, + "html_url": "https://github.com/owner/repo" + } + """.trimIndent() + ) + ) + + val result = repository.getRepo("owner", "repo") + + assertTrue(result is Result.Success) + val request = server.takeRequest() + assertEquals("application/vnd.github+json", request.getHeader("Accept")) + assertEquals("Bearer test-token", request.getHeader("Authorization")) + } + + @Test + fun downloadReleaseAssetText_requestsOctetStreamAndReturnsPemBody() { + val pem = """ + -----BEGIN PUBLIC KEY----- + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtestkeytestkeytest + -----END PUBLIC KEY----- + """.trimIndent() + server.dispatcher = object : Dispatcher() { + override fun dispatch(request: RecordedRequest): MockResponse = when (request.path) { + "/repos/owner/repo/releases/1/assets?per_page=100&page=1" -> MockResponse() + .setResponseCode(200) + .setBody( + """ + [ + { + "id": 99, + "name": "abk-artifact-signing-public.pem", + "size": 120, + "content_type": "application/x-pem-file", + "browser_download_url": "https://example.com/key.pem" + } + ] + """.trimIndent() + ) + "/repos/owner/repo/releases/assets/99" -> { + val body = if (request.getHeader("Accept") == "application/octet-stream") { + pem + } else { + """ + { + "id": 99, + "name": "abk-artifact-signing-public.pem", + "browser_download_url": "https://example.com/key.pem" + } + """.trimIndent() + } + MockResponse() + .setResponseCode(200) + .setBody(body) + } + else -> MockResponse().setResponseCode(404) + } + } + + val result = repository.downloadReleaseAssetText( + owner = "owner", + repo = "repo", + releaseId = 1L, + assetName = "abk-artifact-signing-public.pem" + ) + + assertEquals(Result.Success(pem), result) + server.takeRequest() + val downloadRequest = server.takeRequest() + assertEquals("application/octet-stream", downloadRequest.getHeader("Accept")) + } +} diff --git a/app/src/test/java/com/abk/kernel/utils/ForkSigningPublicKeyResolverTest.kt b/app/src/test/java/com/abk/kernel/utils/ForkSigningPublicKeyResolverTest.kt new file mode 100644 index 000000000..140ea718e --- /dev/null +++ b/app/src/test/java/com/abk/kernel/utils/ForkSigningPublicKeyResolverTest.kt @@ -0,0 +1,84 @@ +package com.abk.kernel.utils + +import com.abk.kernel.data.repository.Result +import kotlinx.coroutines.test.runTest +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNotNull +import org.junit.Assert.assertTrue +import org.junit.Test + +class ForkSigningPublicKeyResolverTest { + + private val resolver = ForkSigningPublicKeyResolver( + assetName = "abk-artifact-signing-public.pem", + downloadReleaseAssetText = { _, _, _, _ -> Result.Error("unused") } + ) + + @Test + fun parse_supportsStoredBase64Value() { + val material = ForkSigningManager.generateSigningMaterial() + + val parsed = resolver.parse(material.publicKeyBase64) + + assertNotNull(parsed) + assertEquals(material.publicKeyBase64, parsed?.base64) + assertEquals(material.publicKeyPem, parsed?.pem) + } + + @Test + fun download_returnsPemAndBase64ForValidRemotePem() = runTest { + val material = ForkSigningManager.generateSigningMaterial() + val resolver = ForkSigningPublicKeyResolver( + assetName = "abk-artifact-signing-public.pem", + downloadReleaseAssetText = { _, _, _, _ -> Result.Success(material.publicKeyPem) } + ) + + val result = resolver.download("owner", "repo", 1L) + + assertTrue(result is Result.Success) + val key = (result as Result.Success).data + assertEquals(material.publicKeyBase64, key.base64) + assertEquals(material.publicKeyPem, key.pem) + } + + @Test + fun download_rejectsGitHubAssetMetadataJson() = runTest { + val resolver = ForkSigningPublicKeyResolver( + assetName = "abk-artifact-signing-public.pem", + downloadReleaseAssetText = { _, _, _, _ -> + Result.Success( + """ + { + "id": 99, + "name": "abk-artifact-signing-public.pem", + "browser_download_url": "https://example.com/key.pem" + } + """.trimIndent() + ) + } + ) + + val result = resolver.download("owner", "repo", 1L) + + assertTrue(result is Result.Error) + assertEquals( + INVALID_FORK_SIGNING_PUBLIC_KEY_MESSAGE, + (result as Result.Error).message + ) + } + + @Test + fun download_preservesUnderlyingDownloadError() = runTest { + val resolver = ForkSigningPublicKeyResolver( + assetName = "abk-artifact-signing-public.pem", + downloadReleaseAssetText = { _, _, _, _ -> Result.Error("Download release asset failed: 404", 404) } + ) + + val result = resolver.download("owner", "repo", 1L) + + assertTrue(result is Result.Error) + val error = result as Result.Error + assertEquals("Download release asset failed: 404", error.message) + assertEquals(404, error.code) + } +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 06de54f5f..c35dd33d6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -48,6 +48,7 @@ retrofit = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = converter-gson = { group = "com.squareup.retrofit2", name = "converter-gson", version.ref = "converterGson" } okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp" } okhttp-logging = { group = "com.squareup.okhttp3", name = "logging-interceptor", version.ref = "okhttp" } +okhttp-mockwebserver = { group = "com.squareup.okhttp3", name = "mockwebserver", version.ref = "okhttp" } libsu-core = { group = "com.github.topjohnwu.libsu", name = "core", version.ref = "libsu" } libsu-io = { group = "com.github.topjohnwu.libsu", name = "io", version.ref = "libsu" } coil-compose = { group = "io.coil-kt", name = "coil-compose", version.ref = "coil" } From 7aabb5bcd3c77fa1b8b76f05d631fab9302e119e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 26 Jul 2026 12:14:12 +0800 Subject: [PATCH 02/12] chore(app): update unstable version metadata (#176) Co-authored-by: xingguangcuican6666 <119158495+xingguangcuican6666@users.noreply.github.com> --- version.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/version.json b/version.json index a9dc7602e..8488a0d44 100644 --- a/version.json +++ b/version.json @@ -26,11 +26,11 @@ "versionName": "1.2.6", "versionCode": 10026, "downloadUrl": "https://nightly.link/xingguangcuican6666/ABK/workflows/build-abk-app-dev/dev/abk-apks.zip", - "publishedAt": "2026-07-23T16:58:54Z", - "buildTimestampEpochMillis": 1784825934000, + "publishedAt": "2026-07-25T12:52:26Z", + "buildTimestampEpochMillis": 1784983946000, "sourceWorkflow": "Build ABK App Dev", - "commitSha": "b5c1b0844165464989c35b9f5d2908f9366bfe30", - "runId": 30027424279 + "commitSha": "b76459b0f8b2b1fa115abb90a8818c48c691f71e", + "runId": 30158191733 } } } From 8b9f67d27b44b51540d26dc5d6bdfb4c563320b3 Mon Sep 17 00:00:00 2001 From: fanziyun Date: Sun, 26 Jul 2026 19:00:34 +0800 Subject: [PATCH 03/12] feat(app): open OOBE login from the settings account row (#178) Skipping the OOBE left the settings account section showing a dead "not signed in" row, so there was no way to sign in again without clearing app data. Make that row tappable: it re-enters the OOBE flow at the GitHub device-code login step, and when a token exists but the profile fetch failed it refreshes the session and continues to the fork check before closing the overlay. Extracts the shared entry logic of openBuildOobe() into a private enterOobeFlow() and exposes it as openLoginOobe(); the build-page entry point is unchanged. --- .../java/com/abk/kernel/ui/screens/SettingsScreen.kt | 10 +++++++++- .../com/abk/kernel/viewmodel/AuthOobeCoordinator.kt | 7 ++++++- .../java/com/abk/kernel/viewmodel/MainViewModel.kt | 2 ++ app/src/main/res/values-en/strings.xml | 1 + app/src/main/res/values-ru/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 6 files changed, 20 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/abk/kernel/ui/screens/SettingsScreen.kt b/app/src/main/java/com/abk/kernel/ui/screens/SettingsScreen.kt index 9635e3cae..32a068253 100644 --- a/app/src/main/java/com/abk/kernel/ui/screens/SettingsScreen.kt +++ b/app/src/main/java/com/abk/kernel/ui/screens/SettingsScreen.kt @@ -727,7 +727,15 @@ private fun SettingsMainContent( ) } ?: ExpressiveListItem( title = stringResource(R.string.settings_not_logged_in), - leadingIcon = Icons.Default.AccountCircle + subtitle = stringResource(R.string.settings_login_hint), + leadingIcon = Icons.Default.AccountCircle, + trailingContent = { + Icon( + Icons.Default.ChevronRight, + contentDescription = stringResource(R.string.settings_login_hint) + ) + }, + onClick = { vm.openLoginOobe() } ) } diff --git a/app/src/main/java/com/abk/kernel/viewmodel/AuthOobeCoordinator.kt b/app/src/main/java/com/abk/kernel/viewmodel/AuthOobeCoordinator.kt index 3e710caeb..513d9cc32 100644 --- a/app/src/main/java/com/abk/kernel/viewmodel/AuthOobeCoordinator.kt +++ b/app/src/main/java/com/abk/kernel/viewmodel/AuthOobeCoordinator.kt @@ -35,7 +35,12 @@ class AuthOobeCoordinator( } } - fun openBuildOobe() { + fun openBuildOobe() = enterOobeFlow() + + /** Settings account entry: jump back into the OOBE flow so the user can sign in again. */ + fun openLoginOobe() = enterOobeFlow() + + private fun enterOobeFlow() { val state = readState() val nextStep = if (state.isLoggedIn && state.user != null) AuthStep.FORK_CHECK else AuthStep.LOGIN updateState { diff --git a/app/src/main/java/com/abk/kernel/viewmodel/MainViewModel.kt b/app/src/main/java/com/abk/kernel/viewmodel/MainViewModel.kt index 71b64a05a..70e041c70 100644 --- a/app/src/main/java/com/abk/kernel/viewmodel/MainViewModel.kt +++ b/app/src/main/java/com/abk/kernel/viewmodel/MainViewModel.kt @@ -870,6 +870,8 @@ class MainViewModel @JvmOverloads constructor( fun openBuildOobe() = authOobe.openBuildOobe() + fun openLoginOobe() = authOobe.openLoginOobe() + fun continueOobeToLogin() = authOobe.continueOobeToLogin() fun skipOobe() = authOobe.skipOobe() diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml index 84676a65c..60c699065 100644 --- a/app/src/main/res/values-en/strings.xml +++ b/app/src/main/res/values-en/strings.xml @@ -625,6 +625,7 @@ Sign out Fork repository Not signed in + Tap to sign in with GitHub Applies only to the next newly submitted build. Turning it off will not auto-download. Prebuilt GKI fetch and download Fetch prebuilt GKI from this repository release. Downloads are manual. diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index d9620025f..9ca19c293 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -625,6 +625,7 @@ Выйти Fork-репозиторий Не выполнен вход + Нажмите, чтобы войти через GitHub Применяется только к следующей новой сборке. Если выключить, автозагрузки не будет. Готовые сборки GKI Раздел готовых сборок GKI из Release репозитория. Скачивание вручную. diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 250780a09..45572140d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -654,6 +654,7 @@ 退出登录 Fork 仓库 未登录 + 点击前往登录 GitHub 账户 仅对下一次新提交的构建生效,关闭后不会自动下载 预编译 GKI 获取与下载 从本仓库 Release 获取预编译 GKI,下载需手动触发 From cb98aaede5813e6abf7eb21a29fb16c4f4a21e83 Mon Sep 17 00:00:00 2001 From: xingguangcuican6666 Date: Tue, 28 Jul 2026 17:53:11 +0800 Subject: [PATCH 04/12] fix(workflows): repair kernel build failures --- .github/workflows/build.yml | 156 ++++++++++++++++++++++------ .github/workflows/oneplus-build.yml | 83 ++++++++++----- 2 files changed, 182 insertions(+), 57 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7a7083bdc..355a992b6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1673,6 +1673,42 @@ jobs: fi } + fix_task_mmu_vma_pad_start() { + local file="./fs/proc/task_mmu.c" + [ -f "$file" ] || return 0 + + python3 - <<'PY' + from pathlib import Path + import re + + path = Path("./fs/proc/task_mmu.c") + text = path.read_text() + + if not re.search(r"\bVMA_PAD_START\s*\(", text): + raise SystemExit(0) + if re.search(r"(?m)^\s*#\s*define\s+VMA_PAD_START(?:\s|\()", text): + print("task_mmu.c 已定义 VMA_PAD_START") + raise SystemExit(0) + + anchor_matches = list(re.finditer(r'(?m)^#include\s+"internal\.h"\s*$', text)) + if anchor_matches: + insert_at = anchor_matches[-1].end() + else: + include_matches = list(re.finditer(r"(?m)^#include\s+[<\"].*[>\"]\s*$", text)) + if not include_matches: + raise SystemExit(f"{path} 使用 VMA_PAD_START,但无法定位头文件区域") + insert_at = include_matches[-1].end() + + fallback = """ + + #ifndef VMA_PAD_START + #define VMA_PAD_START(vma) ((vma)->vm_end) + #endif""" + path.write_text(text[:insert_at] + fallback + text[insert_at:]) + print("已为 task_mmu.c 注入 VMA_PAD_START 兼容定义") + PY + } + fix_proc_base_missing_vma_decl() { local file="./fs/proc/base.c" [ -f "$file" ] || return 0 @@ -1788,11 +1824,7 @@ jobs: fi } - fix_sukisu_fdinfo_mask_decl() { - if [ "${{ inputs.ksu_variant }}" != "SukiSU" ]; then - return 0 - fi - + fix_fdinfo_mask_decl() { local file="./fs/notify/fdinfo.c" [ -f "$file" ] || return 0 @@ -1851,9 +1883,9 @@ jobs: if new_lines != lines: path.write_text("".join(new_lines)) - print("已修复 SukiSU fdinfo.c 中 mask 声明作用域") + print("已修复 fdinfo.c 中 mask 声明作用域") else: - print("SukiSU fdinfo.c mask 声明无需修改") + print("fdinfo.c mask 声明无需修改") PY } @@ -1862,7 +1894,7 @@ jobs: if sub_in_range "$CURRENT_SUB" 43 117; then fix_task_mmu_show_pad apply_susfs_optional_patch "Android 12 - 5.10 fdinfo.c" "a12-5.10/fdinfo.c.patch" - fix_sukisu_fdinfo_mask_decl + fix_fdinfo_mask_decl apply_susfs_base_patch "Android 12 - 5.10 base.c" "a12-5.10/base.c.patch" if [[ "${{ inputs.ksu_variant }}" == "SukiSU" && "${{ inputs.use_bbg }}" == "true" ]]; then fix_proc_base_missing_vma_decl @@ -1907,7 +1939,7 @@ jobs: fi fi apply_susfs_optional_patch "Android 13 - 5.15 fdinfo.c" "a13-5.15/fdinfo.c.patch" - fix_sukisu_fdinfo_mask_decl + fix_fdinfo_mask_decl apply_susfs_optional_patch "Android 13 - 5.15 open.c" "a13-5.15/open.c.patch" if [[ "${{ inputs.os_patch_level }}" != "2024-05" ]]; then fix_task_mmu_show_pad @@ -1984,10 +2016,12 @@ jobs: echo "已修复 exec.c 缺少 susfs_def.h 问题" fi fi + + fix_task_mmu_vma_pad_start fi - - name: 注入 SukiSU SUSFS Kconfig - if: inputs.enable_susfs && inputs.ksu_variant == 'SukiSU' + - name: 确保 SUSFS Kconfig 与核心对象 + if: inputs.enable_susfs && inputs.ksu_variant != 'None' working-directory: ${{ env.KERNEL_ROOT }} run: | set -euo pipefail @@ -1999,19 +2033,18 @@ jobs: fi done if [ -z "$KSU_KERNEL_DIR" ]; then - echo "::error::未找到 SukiSU Kconfig,无法注入 SUSFS Kconfig 符号" + echo "::error::未找到 ${{ inputs.ksu_variant }} Kconfig,无法注入 SUSFS Kconfig 符号" exit 1 fi - python3 - "$KSU_KERNEL_DIR/Kconfig" <<'PY' + python3 - "$KSU_KERNEL_DIR/Kconfig" "$KSU_KERNEL_DIR" <<'PY' from pathlib import Path + import re import sys path = Path(sys.argv[1]) + ksu_dir = Path(sys.argv[2]) text = path.read_text() - if "config KSU_SUSFS" in text: - print(f"{path} 已包含 SUSFS Kconfig 符号") - raise SystemExit(0) options = [ ("KSU_SUSFS", "KernelSU addon - SUSFS", ["KSU", "THREAD_INFO_IN_TASK"]), @@ -2026,21 +2059,84 @@ jobs: ("KSU_SUSFS_SUS_MAP", "Enable to hide suspicious maps", ["KSU_SUSFS"]), ] - lines = ["", 'menu "KernelSU - SUSFS"'] - for name, prompt, deps in options: - lines.extend([f"config {name}", f' bool "{prompt}"']) - lines.extend(f" depends on {dep}" for dep in deps) - lines.extend([" default y", ""]) - lines.append("endmenu") - block = "\n".join(lines) - - marker = "\nendmenu\n" - if marker in text: - text = text.rsplit(marker, 1)[0].rstrip() + "\n" + block + marker + def defined_symbols(value): + return set(re.findall( + r"(?m)^[ \t]*(?:menuconfig|config)[ \t]+([A-Za-z0-9_]+)\b", + value, + )) + + missing_options = [option for option in options if option[0] not in defined_symbols(text)] + if missing_options: + lines = ["", 'menu "KernelSU - SUSFS (ABK compatibility)"'] + for name, prompt, deps in missing_options: + lines.extend([f"config {name}", f' bool "{prompt}"']) + lines.extend(f" depends on {dep}" for dep in deps) + lines.extend([" default y", ""]) + lines.append("endmenu") + block = "\n".join(lines) + + marker = "\nendmenu\n" + if marker in text: + text = text.rsplit(marker, 1)[0].rstrip() + "\n" + block + marker + else: + text = text.rstrip() + "\n" + block + "\n" + path.write_text(text) + print(f"已向 {path} 注入缺失的 SUSFS Kconfig 符号: " + f"{', '.join(option[0] for option in missing_options)}") else: - text = text.rstrip() + "\n" + block + "\n" - path.write_text(text) - print(f"已注入 {path} 的 SukiSU SUSFS Kconfig 符号") + print(f"{path} 已包含全部 SUSFS Kconfig 符号") + + required_symbols = {option[0] for option in options} + still_missing = sorted(required_symbols - defined_symbols(path.read_text())) + if still_missing: + raise SystemExit(f"{path} 注入后仍缺少 SUSFS Kconfig 符号: {still_missing}") + + susfs_source = Path("./common/fs/susfs.c") + fs_makefile = Path("./common/fs/Makefile") + if not susfs_source.exists(): + raise SystemExit(f"未找到 {susfs_source},无法提供 SUSFS 核心符号") + if not fs_makefile.exists(): + raise SystemExit(f"未找到 {fs_makefile},无法接入 SUSFS 核心对象") + + makefile_text = fs_makefile.read_text() + susfs_object_rule = re.compile( + r"(?m)^[ \t]*obj-\$\(CONFIG_KSU_SUSFS\)[ \t]*\+=[ \t]*susfs\.o(?:[ \t]|$)" + ) + if not susfs_object_rule.search(makefile_text): + makefile_text = makefile_text.rstrip() + ( + "\n\n# ABK: ensure the SUSFS provider is linked when its Kconfig is enabled.\n" + "obj-$(CONFIG_KSU_SUSFS) += susfs.o\n" + ) + fs_makefile.write_text(makefile_text) + print(f"已补齐 {fs_makefile} 的 SUSFS 核心对象规则") + else: + print(f"{fs_makefile} 已接入 SUSFS 核心对象") + + provider_patterns = { + "susfs_extra_works": r"(?m)^[ \t]*struct[ \t]+work_struct[ \t]+susfs_extra_works[ \t]*;", + "susfs_get_enabled_features": r"(?m)^[ \t]*void[ \t]+susfs_get_enabled_features[ \t]*\(", + "susfs_set_avc_log_spoofing": r"(?m)^[ \t]*void[ \t]+susfs_set_avc_log_spoofing[ \t]*\(", + "susfs_show_version": r"(?m)^[ \t]*void[ \t]+susfs_show_version[ \t]*\(", + "susfs_show_variant": r"(?m)^[ \t]*void[ \t]+susfs_show_variant[ \t]*\(", + "susfs_start_sdcard_monitor_fn": r"(?m)^[ \t]*void[ \t]+susfs_start_sdcard_monitor_fn[ \t]*\(", + } + caller_text = "\n".join( + source.read_text(errors="ignore") + for source in ksu_dir.rglob("*.c") + ) + provider_text = susfs_source.read_text() + missing_providers = [ + symbol for symbol, pattern in provider_patterns.items() + if re.search(rf"\b{re.escape(symbol)}\b", caller_text) + and not re.search(pattern, provider_text) + ] + if missing_providers: + raise SystemExit( + f"{susfs_source} 缺少 KernelSU 已引用的 SUSFS 核心符号: {missing_providers}" + ) + if not susfs_object_rule.search(fs_makefile.read_text()): + raise SystemExit(f"{fs_makefile} 注入后仍未接入 susfs.o") + print("SUSFS Kconfig 与核心链接契约校验通过") PY - name: 注入 SukiSU/ReSukiSU KPM Kconfig diff --git a/.github/workflows/oneplus-build.yml b/.github/workflows/oneplus-build.yml index 52171c4bb..599059267 100644 --- a/.github/workflows/oneplus-build.yml +++ b/.github/workflows/oneplus-build.yml @@ -343,6 +343,7 @@ jobs: cp "$WORKSPACE/kernel_patches/zram_patches/002-zstd.patch" "$COMMON_ROOT/" cd "$KERNEL_ROOT" + MANUAL_HOOK_PATCH_NAME="" if [ "$EFFECTIVE_USE_LZ4KD" = "true" ]; then cp -r "$WORKSPACE"/SukiSU_patch/other/zram/lz4k/include/linux/* "$COMMON_ROOT/include/linux/" || true cp -r "$WORKSPACE"/SukiSU_patch/other/zram/lz4k/lib/* "$COMMON_ROOT/lib/" || true @@ -357,20 +358,31 @@ jobs: cp "$WORKSPACE"/susfs4oki/kernel_patches/fs/* "$COMMON_ROOT/fs/" || true cp "$WORKSPACE"/susfs4oki/kernel_patches/include/linux/* "$COMMON_ROOT/include/linux/" || true elif [ "$KSU_VARIANT" = "SukiSU" ] || [ "$KSU_VARIANT" = "ReSukiSU" ]; then - MANUAL_HOOK_PATCH="" - case "$KERNEL_VERSION" in - 5.10|5.15) - MANUAL_HOOK_PATCH="$WORKSPACE/kernel_patches/sukisu/scope_min_manual_hooks_v1.6.patch" + case "$KSU_VARIANT" in + ReSukiSU) + MANUAL_HOOK_PATCH_NAME="scope_min_manual_hooks_v1.9.patch" ;; - *) - if [ -f "$WORKSPACE/kernel_patches/sukisu/scope_min_manual_hooks_v1.9.patch" ]; then - MANUAL_HOOK_PATCH="$WORKSPACE/kernel_patches/sukisu/scope_min_manual_hooks_v1.9.patch" - else - MANUAL_HOOK_PATCH="$WORKSPACE/kernel_patches/sukisu/scope_min_manual_hooks_v1.6.patch" - fi + SukiSU) + case "$KERNEL_VERSION" in + 5.10|5.15) + MANUAL_HOOK_PATCH_NAME="scope_min_manual_hooks_v1.6.patch" + ;; + *) + if [ -f "$WORKSPACE/kernel_patches/sukisu/scope_min_manual_hooks_v1.9.patch" ]; then + MANUAL_HOOK_PATCH_NAME="scope_min_manual_hooks_v1.9.patch" + else + MANUAL_HOOK_PATCH_NAME="scope_min_manual_hooks_v1.6.patch" + fi + ;; + esac ;; esac - [ -n "$MANUAL_HOOK_PATCH" ] && cp "$MANUAL_HOOK_PATCH" "$COMMON_ROOT/" || true + MANUAL_HOOK_PATCH="$WORKSPACE/kernel_patches/sukisu/$MANUAL_HOOK_PATCH_NAME" + if [ ! -f "$MANUAL_HOOK_PATCH" ]; then + echo "::error::${KSU_VARIANT} ${KERNEL_VERSION} 所需的手动 hook 补丁不存在: $MANUAL_HOOK_PATCH_NAME" + exit 1 + fi + cp "$MANUAL_HOOK_PATCH" "$COMMON_ROOT/$MANUAL_HOOK_PATCH_NAME" fi if [ "$USE_UNICODE_BYPASS" = "true" ]; then @@ -382,9 +394,10 @@ jobs: fi cd "$COMMON_ROOT" - for patch_file in scope_min_manual_hooks_v1.9.patch scope_min_manual_hooks_v1.6.patch unicode_bypass_fix.patch; do - [ -f "$patch_file" ] && patch -p1 < "$patch_file" || true - done + if [ -n "$MANUAL_HOOK_PATCH_NAME" ]; then + patch -p1 < "$MANUAL_HOOK_PATCH_NAME" || true + fi + [ -f unicode_bypass_fix.patch ] && patch -p1 < unicode_bypass_fix.patch || true if [ "$EFFECTIVE_USE_LZ4KD" = "true" ]; then [ -f lz4kd.patch ] && patch -p1 < lz4kd.patch || true [ -f lz4k_oplus.patch ] && patch -p1 < lz4k_oplus.patch || true @@ -559,26 +572,39 @@ jobs: raise SystemExit(0) text = path.read_text() - marker = "builtin SUSFS ksu_sulog_capture() expects argv_user as a pointer" + marker = "SUSFS uses pointer argv_user; non-SUSFS uses struct user_arg_ptr value" new = "\n".join([ - " /* ABK: builtin SUSFS ksu_sulog_capture() expects argv_user as a pointer. */", + " /* ABK: SUSFS uses pointer argv_user; non-SUSFS uses struct user_arg_ptr value. */", "#ifdef CONFIG_KSU_SUSFS", " pending = ksu_sulog_capture(KSU_SULOG_EVENT_IOCTL_GRANT_ROOT, NULL, NULL, gfp);", "#else", - " pending = ksu_sulog_capture(KSU_SULOG_EVENT_IOCTL_GRANT_ROOT, NULL, USER_ARG_NULL, gfp);", + " pending = ksu_sulog_capture(KSU_SULOG_EVENT_IOCTL_GRANT_ROOT, NULL, *USER_ARG_NULL, gfp);", "#endif", ]) changed = False if marker not in text: - for old in ( - " pending = ksu_sulog_capture(KSU_SULOG_EVENT_IOCTL_GRANT_ROOT, NULL, USER_ARG_NULL, gfp);", - " pending = ksu_sulog_capture(KSU_SULOG_EVENT_IOCTL_GRANT_ROOT, NULL, &USER_ARG_NULL, gfp);", - ): - if old in text: - text = text.replace(old, new, 1) - changed = True - break + legacy = re.compile( + r" /\* ABK: builtin SUSFS ksu_sulog_capture\(\) expects argv_user as a pointer\. \*/\n" + r"#ifdef CONFIG_KSU_SUSFS\n" + r" pending = ksu_sulog_capture\(KSU_SULOG_EVENT_IOCTL_GRANT_ROOT, NULL, NULL, gfp\);\n" + r"#else\n" + r" pending = ksu_sulog_capture\(KSU_SULOG_EVENT_IOCTL_GRANT_ROOT, NULL, &?USER_ARG_NULL, gfp\);\n" + r"#endif" + ) + text, replacements = legacy.subn(new, text, count=1) + changed = replacements == 1 + + if not changed: + for old in ( + " pending = ksu_sulog_capture(KSU_SULOG_EVENT_IOCTL_GRANT_ROOT, NULL, USER_ARG_NULL, gfp);", + " pending = ksu_sulog_capture(KSU_SULOG_EVENT_IOCTL_GRANT_ROOT, NULL, &USER_ARG_NULL, gfp);", + " pending = ksu_sulog_capture(KSU_SULOG_EVENT_IOCTL_GRANT_ROOT, NULL, *USER_ARG_NULL, gfp);", + ): + if old in text: + text = text.replace(old, new, 1) + changed = True + break if changed: path.write_text(text) @@ -588,11 +614,14 @@ jobs: final_text = path.read_text() incompatible = re.search( - r"pending = ksu_sulog_capture\(KSU_SULOG_EVENT_IOCTL_GRANT_ROOT, NULL, &?USER_ARG_NULL, gfp\);", + r"pending\s*=\s*ksu_sulog_capture\(\s*KSU_SULOG_EVENT_IOCTL_GRANT_ROOT\s*,\s*" + r"NULL\s*,\s*&?USER_ARG_NULL\s*,\s*gfp\s*\);", final_text, ) - if incompatible and marker not in final_text: + if incompatible: raise SystemExit(f"{path} still contains incompatible ksu_sulog_capture grant_root argv call") + if marker in final_text and new not in final_text: + raise SystemExit(f"{path} contains an incomplete ABK ksu_sulog_capture compatibility block") PY - name: 注入 SukiSU/ReSukiSU KPM Kconfig From 8a2ac21cc7f0318e0e3b3f30ca9182049317589a Mon Sep 17 00:00:00 2001 From: xingguangcuican6666 Date: Tue, 28 Jul 2026 18:05:08 +0800 Subject: [PATCH 05/12] fix(workflows): avoid Actions expression size limit --- .github/workflows/build.yml | 41 ++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 355a992b6..2e56875a5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1497,6 +1497,13 @@ jobs: - name: 应用 SUSFS 补丁 if: inputs.enable_susfs && inputs.ksu_variant != 'None' working-directory: ${{ env.KERNEL_ROOT }} + env: + ABK_ANDROID_VERSION: ${{ inputs.android_version }} + ABK_KERNEL_VERSION: ${{ inputs.kernel_version }} + ABK_KSU_VARIANT: ${{ inputs.ksu_variant }} + ABK_SUB_LEVEL: ${{ inputs.sub_level }} + ABK_OS_PATCH_LEVEL: ${{ inputs.os_patch_level }} + ABK_USE_BBG: ${{ inputs.use_bbg }} run: | echo "应用 SUSFS 补丁..." # 读取 SUSFS 上游版本(例如 v2.1.0),用于匹配修复补丁目录 @@ -1608,11 +1615,11 @@ jobs: return 0 } - cp $SUSFS4KSU/kernel_patches/50_add_susfs_in_gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}.patch ./common/ + cp "$SUSFS4KSU/kernel_patches/50_add_susfs_in_gki-${ABK_ANDROID_VERSION}-${ABK_KERNEL_VERSION}.patch" ./common/ cp $SUSFS4KSU/kernel_patches/fs/* ./common/fs/ cp $SUSFS4KSU/kernel_patches/include/linux/* ./common/include/linux/ - case "${{ inputs.ksu_variant }}" in + case "$ABK_KSU_VARIANT" in "Official") cd ./KernelSU cp $SUSFS4KSU/kernel_patches/KernelSU/10_enable_susfs_for_ksu.patch ./ @@ -1634,9 +1641,9 @@ jobs: esac cd $KERNEL_ROOT/common - patch -p1 < 50_add_susfs_in_gki-${{ inputs.android_version }}-${{ inputs.kernel_version }}.patch || true + patch -p1 < "50_add_susfs_in_gki-${ABK_ANDROID_VERSION}-${ABK_KERNEL_VERSION}.patch" || true - if [ "${{ inputs.ksu_variant }}" == "SukiSU" ] || [ "${{ inputs.ksu_variant }}" == "ReSukiSU" ]; then + if [ "$ABK_KSU_VARIANT" == "SukiSU" ] || [ "$ABK_KSU_VARIANT" == "ReSukiSU" ]; then SUSFS_C="./fs/susfs.c" if [ -f "$SUSFS_C" ] && grep -q '^static void susfs_run_sus_path_loop(' "$SUSFS_C"; then sed -i 's/^static void susfs_run_sus_path_loop(/void susfs_run_sus_path_loop(/' "$SUSFS_C" @@ -1644,8 +1651,8 @@ jobs: fi fi - if [ "${{ inputs.ksu_variant }}" == "Official" ] || [ "${{ inputs.ksu_variant }}" == "SukiSU" ] || [ "${{ inputs.ksu_variant }}" == "ReSukiSU" ]; then - CURRENT_SUB="${{ inputs.sub_level }}" + if [ "$ABK_KSU_VARIANT" == "Official" ] || [ "$ABK_KSU_VARIANT" == "SukiSU" ] || [ "$ABK_KSU_VARIANT" == "ReSukiSU" ]; then + CURRENT_SUB="$ABK_SUB_LEVEL" if [[ ! "$CURRENT_SUB" =~ ^[0-9]+$ ]]; then CURRENT_SUB=99999 fi @@ -1890,26 +1897,26 @@ jobs: } # Android 12 - 5.10 修复 - if [[ "${{ inputs.android_version }}" == "android12" && "${{ inputs.kernel_version }}" == "5.10" ]]; then + if [[ "$ABK_ANDROID_VERSION" == "android12" && "$ABK_KERNEL_VERSION" == "5.10" ]]; then if sub_in_range "$CURRENT_SUB" 43 117; then fix_task_mmu_show_pad apply_susfs_optional_patch "Android 12 - 5.10 fdinfo.c" "a12-5.10/fdinfo.c.patch" fix_fdinfo_mask_decl apply_susfs_base_patch "Android 12 - 5.10 base.c" "a12-5.10/base.c.patch" - if [[ "${{ inputs.ksu_variant }}" == "SukiSU" && "${{ inputs.use_bbg }}" == "true" ]]; then + if [[ "$ABK_KSU_VARIANT" == "SukiSU" && "$ABK_USE_BBG" == "true" ]]; then fix_proc_base_missing_vma_decl fi - if [[ "${{ inputs.ksu_variant }}" == "Official" && "${{ inputs.use_bbg }}" == "true" ]]; then + if [[ "$ABK_KSU_VARIANT" == "Official" && "$ABK_USE_BBG" == "true" ]]; then fix_proc_base_missing_vma_decl fi - if [[ "${{ inputs.ksu_variant }}" == "ReSukiSU" ]]; then + if [[ "$ABK_KSU_VARIANT" == "ReSukiSU" ]]; then fix_proc_base_missing_vma_decl fi fi fi # Android 13 - 5.15 修复 - if [[ "${{ inputs.android_version }}" == "android13" && "${{ inputs.kernel_version }}" == "5.15" ]]; then + if [[ "$ABK_ANDROID_VERSION" == "android13" && "$ABK_KERNEL_VERSION" == "5.15" ]]; then if sub_in_range "$CURRENT_SUB" 41 137; then apply_susfs_optional_patch "Android 13 - 5.15 namespace.c" "a13-5.15/namespace.c.patch" if [[ "$CURRENT_SUB" -eq 41 ]] && grep -qF 'static_branch_unlikely(&susfs_is_sdcard_android_data_not_decrypted)' ./fs/namespace.c; then @@ -1941,14 +1948,14 @@ jobs: apply_susfs_optional_patch "Android 13 - 5.15 fdinfo.c" "a13-5.15/fdinfo.c.patch" fix_fdinfo_mask_decl apply_susfs_optional_patch "Android 13 - 5.15 open.c" "a13-5.15/open.c.patch" - if [[ "${{ inputs.os_patch_level }}" != "2024-05" ]]; then + if [[ "$ABK_OS_PATCH_LEVEL" != "2024-05" ]]; then fix_task_mmu_show_pad fi fi fi # Android 14 - 6.1 修复 - if [[ "${{ inputs.android_version }}" == "android14" && "${{ inputs.kernel_version }}" == "6.1" ]]; then + if [[ "$ABK_ANDROID_VERSION" == "android14" && "$ABK_KERNEL_VERSION" == "6.1" ]]; then if sub_in_range "$CURRENT_SUB" 25 162; then apply_susfs_base_patch "Android 14 - 6.1 base.c" "a14-6.1/base.c.patch" if grep -q 'susfs_is_current_proc_umounted\|SUSFS_IS_INODE_SUS_MAP\|SUSFS_IS_INODE_OPEN_REDIRECT' ./fs/proc/base.c && ! grep -qF '#include ' ./fs/proc/base.c; then @@ -1958,7 +1965,7 @@ jobs: sed -i '/#include /a #if defined(CONFIG_KSU_SUSFS_SUS_MAP) || defined(CONFIG_KSU_SUSFS_OPEN_REDIRECT)\n#include \n#endif' ./fs/proc/base.c fi fi - if [[ "${{ inputs.os_patch_level }}" != "2024-05" ]]; then + if [[ "$ABK_OS_PATCH_LEVEL" != "2024-05" ]]; then fix_task_mmu_show_pad fi # 修复 6.1 LTS: SUSFS 补丁在 namespace.c 头部 hunk 因上下文不匹配而失败, @@ -1974,8 +1981,8 @@ jobs: fi # Android 15 - 6.6 修复 - if [[ "${{ inputs.android_version }}" == "android15" && "${{ inputs.kernel_version }}" == "6.6" ]]; then - if [[ "${{ inputs.ksu_variant }}" == "Official" ]] && { sub_in_range "$CURRENT_SUB" 50 58 || sub_in_range "$CURRENT_SUB" 98 127; }; then + if [[ "$ABK_ANDROID_VERSION" == "android15" && "$ABK_KERNEL_VERSION" == "6.6" ]]; then + if [[ "$ABK_KSU_VARIANT" == "Official" ]] && { sub_in_range "$CURRENT_SUB" 50 58 || sub_in_range "$CURRENT_SUB" 98 127; }; then fix_selinux_extern_static fi if sub_in_range "$CURRENT_SUB" 98 127; then @@ -1998,7 +2005,7 @@ jobs: fi # Android 16 - 6.12 修复 - if [[ "${{ inputs.android_version }}" == "android16" && "${{ inputs.kernel_version }}" == "6.12" ]]; then + if [[ "$ABK_ANDROID_VERSION" == "android16" && "$ABK_KERNEL_VERSION" == "6.12" ]]; then # 修复 setuid_hook.c 重复定义 SETUID_HOOK="$KERNEL_ROOT/common/drivers/kernelsu/setuid_hook.c" if [ -f "$SETUID_HOOK" ]; then From 1205f4ceec4ae42e10bf660ac901c230004c6f11 Mon Sep 17 00:00:00 2001 From: xingguangcuican6666 Date: Wed, 29 Jul 2026 18:32:24 +0800 Subject: [PATCH 06/12] fix(workflows): harden android12 5.10 susfs compatibility --- .github/workflows/build.yml | 166 +++++++++++++++++++++++++++++------- 1 file changed, 136 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2e56875a5..847008583 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1721,29 +1721,142 @@ jobs: [ -f "$file" ] || return 0 grep -qF 'vma = find_vma(mm, addr);' "$file" || return 0 - local assign_line start_line relative_mm_line mm_line - assign_line="$(awk '/vma = find_vma\(mm, addr\);/ { print NR; exit }' "$file")" - [ -n "$assign_line" ] || return 0 - start_line=$(( assign_line > 80 ? assign_line - 80 : 1 )) + python3 - <<'PY' + from pathlib import Path + import re - if sed -n "${start_line},$((assign_line - 1))p" "$file" | grep -qF 'struct vm_area_struct *vma;'; then - return 0 - fi + path = Path("./fs/proc/base.c") + lines = path.read_text().splitlines(keepends=True) + + assign_re = re.compile(r"^\s*vma\s*=\s*find_vma\s*\(\s*mm\s*,\s*addr\s*\)\s*;") + vma_decl_re = re.compile(r"\bstruct\s+vm_area_struct\s*\*\s*vma\s*;") + mm_decl_re = re.compile(r"\bstruct\s+mm_struct\s*\*\s*mm(?:\b|[\s=;])") - relative_mm_line="$(sed -n "${start_line},$((assign_line - 1))p" "$file" | awk '/struct mm_struct \*mm([[:space:]=;]|$)/ { line = NR } END { if (line) print line }')" - [ -n "$relative_mm_line" ] || return 0 - mm_line=$(( start_line + relative_mm_line - 1 )) - - awk -v target="$mm_line" ' - NR == target { - print - match($0, /^[ \t]*/) - print substr($0, RSTART, RLENGTH) "struct vm_area_struct *vma;" - next - } - { print } - ' "$file" > "$file.tmp" && mv "$file.tmp" "$file" - echo "已修复 proc/base.c 缺少 vma 声明" + def sanitize_line(line, in_block_comment): + result = [] + index = 0 + in_string = None + + while index < len(line): + if in_block_comment: + end = line.find("*/", index) + if end == -1: + return "".join(result), True + index = end + 2 + in_block_comment = False + continue + + char = line[index] + next_char = line[index + 1] if index + 1 < len(line) else "" + + if in_string is not None: + if char == "\\" and index + 1 < len(line): + index += 2 + continue + if char == in_string: + in_string = None + index += 1 + continue + + if char == "/" and next_char == "*": + in_block_comment = True + index += 2 + continue + if char == "/" and next_char == "/": + break + if char in ("'", '"'): + in_string = char + index += 1 + continue + + result.append(char) + index += 1 + + return "".join(result), in_block_comment + + def find_function_ranges(source_lines): + depth = 0 + in_block_comment = False + function_start = None + ranges = [] + + for index, line in enumerate(source_lines): + sanitized, in_block_comment = sanitize_line(line, in_block_comment) + opens = sanitized.count("{") + closes = sanitized.count("}") + previous_depth = depth + depth += opens - closes + + if previous_depth == 0 and depth > 0 and opens: + function_start = index + if function_start is not None and previous_depth > 0 and depth == 0: + ranges.append((function_start, index)) + function_start = None + + return ranges + + function_ranges = find_function_ranges(lines) + changed = False + + for start, end in reversed(function_ranges): + body = lines[start:end + 1] + if not any(assign_re.search(line) for line in body): + continue + if any(vma_decl_re.search(line) for line in body): + continue + + mm_offsets = [offset for offset, line in enumerate(body) if mm_decl_re.search(line)] + if not mm_offsets: + raise SystemExit(f"{path} 命中 vma 赋值但未找到同函数 mm 声明") + + mm_index = start + mm_offsets[-1] + indent = re.match(r"^\s*", lines[mm_index]).group(0) + lines.insert(mm_index + 1, f"{indent}struct vm_area_struct *vma;\n") + changed = True + + if changed: + path.write_text("".join(lines)) + print("已修复 proc/base.c 缺少 vma 声明") + + final_lines = path.read_text().splitlines() + final_ranges = find_function_ranges([line + "\n" for line in final_lines]) + for start, end in final_ranges: + body = final_lines[start:end + 1] + if any(assign_re.search(line) for line in body) and not any(vma_decl_re.search(line) for line in body): + raise SystemExit(f"{path} 仍存在未声明 vma 的 find_vma 调用") + PY + } + + fix_namei_set_nameidata_arity() { + local file="./fs/namei.c" + [ -f "$file" ] || return 0 + + python3 - <<'PY' + from pathlib import Path + import re + + path = Path("./fs/namei.c") + text = path.read_text() + + call_re = re.compile(r"set_nameidata\s*\(\s*nd\s*,\s*old_dfd\s*,\s*fake_filename\s*,\s*NULL\s*\)") + if not call_re.search(text): + raise SystemExit(0) + + definition = re.search(r"static\s+void\s+set_nameidata\s*\((.*?)\)\s*\{", text, re.S) + if definition is None: + raise SystemExit(f"{path} 存在四参 set_nameidata 调用,但未找到定义") + + params = [part.strip() for part in definition.group(1).split(",") if part.strip()] + if len(params) == 3: + updated, count = call_re.subn("set_nameidata(nd, old_dfd, fake_filename)", text) + if count: + path.write_text(updated) + print("已修复 namei.c 中 set_nameidata 参数个数") + if call_re.search(path.read_text()): + raise SystemExit(f"{path} 仍残留四参 set_nameidata 调用") + elif len(params) != 4: + raise SystemExit(f"{path} 的 set_nameidata 定义参数个数异常: {len(params)}") + PY } fix_task_mmu_unused_vma_decl() { @@ -1903,16 +2016,9 @@ jobs: apply_susfs_optional_patch "Android 12 - 5.10 fdinfo.c" "a12-5.10/fdinfo.c.patch" fix_fdinfo_mask_decl apply_susfs_base_patch "Android 12 - 5.10 base.c" "a12-5.10/base.c.patch" - if [[ "$ABK_KSU_VARIANT" == "SukiSU" && "$ABK_USE_BBG" == "true" ]]; then - fix_proc_base_missing_vma_decl - fi - if [[ "$ABK_KSU_VARIANT" == "Official" && "$ABK_USE_BBG" == "true" ]]; then - fix_proc_base_missing_vma_decl - fi - if [[ "$ABK_KSU_VARIANT" == "ReSukiSU" ]]; then - fix_proc_base_missing_vma_decl - fi fi + fix_proc_base_missing_vma_decl + fix_namei_set_nameidata_arity fi # Android 13 - 5.15 修复 From 6607254d5bfb39939b18f1d16b55fbc1a50b30c6 Mon Sep 17 00:00:00 2001 From: xingguangcuican Date: Sun, 2 Aug 2026 14:25:00 +0800 Subject: [PATCH 07/12] fix(ci): prioritize user kernel options over stock config (#189) --- .github/workflows/build.yml | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 847008583..237f78913 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3466,7 +3466,18 @@ jobs: from pathlib import Path defconfig = Path(os.environ["DEFCONFIG"]) - text = defconfig.read_text() + config_files = [defconfig] + stock_defconfig = defconfig.parent / "stock_defconfig" + if stock_defconfig.is_file(): + # config_data 指向 stock_defconfig 时,用户配置也必须写入这份 + # 配置,否则 /proc/config.gz 仍会显示 stock 中的旧值。 + config_files.append(stock_defconfig) + print(f"将用户配置覆盖到 stock_defconfig: {stock_defconfig}") + + text_by_path = { + path: path.read_text().splitlines() + for path in config_files + } lines = os.environ["CUSTOM_KERNEL_OPTIONS"].replace("\r", "").splitlines() parsed = [] @@ -3496,7 +3507,7 @@ jobs: ) return result.returncode == 0 - def set_config_value(symbol: str, mode: str, value: str = ""): + def set_config_value(text_lines, symbol: str, mode: str, value: str = ""): clean = symbol.removeprefix("CONFIG_") filtered = [] for line in text_lines: @@ -3550,7 +3561,6 @@ jobs: deduped.append((symbol, mode, value)) deduped.reverse() - text_lines = text.splitlines() applied = 0 skipped = 0 for symbol, mode, value in deduped: @@ -3558,7 +3568,10 @@ jobs: print(f"::warning::{symbol} 未在 Kconfig 中定义,已跳过") skipped += 1 continue - text_lines = set_config_value(symbol, mode, value) + for path in config_files: + text_by_path[path] = set_config_value( + text_by_path[path], symbol, mode, value + ) applied += 1 if mode == "raw": print(f"Applied custom kernel option: {symbol}={value}") @@ -3567,8 +3580,12 @@ jobs: else: print(f"Applied custom kernel option: {symbol}={mode}") - defconfig.write_text("\n".join(text_lines) + "\n") - print(f"自定义内核选项: 应用 {applied} 条,跳过 {skipped} 条") + for path, text_lines in text_by_path.items(): + path.write_text("\n".join(text_lines) + "\n") + print( + f"自定义内核选项: 应用 {applied} 条,跳过 {skipped} 条," + f"目标配置: {', '.join(path.name for path in config_files)}" + ) PY - name: 修复 Official SUSFS 源码兼容 From 538c1909f5d3b6de8bf0fa958c3f780f3e9d7d30 Mon Sep 17 00:00:00 2001 From: xingguangcuican Date: Sun, 2 Aug 2026 14:31:36 +0800 Subject: [PATCH 08/12] fix(app): reset corrupted preferences on startup (#190) --- .../main/java/com/abk/kernel/MainActivity.kt | 47 ++++++++++++++----- .../data/repository/PreferencesRepository.kt | 18 ++++++- .../com/abk/kernel/viewmodel/MainViewModel.kt | 13 +++++ app/src/main/res/values-en/strings.xml | 4 ++ app/src/main/res/values-ru/strings.xml | 4 ++ app/src/main/res/values/strings.xml | 4 ++ 6 files changed, 76 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/com/abk/kernel/MainActivity.kt b/app/src/main/java/com/abk/kernel/MainActivity.kt index 51c4d62f4..c2c2c8dd1 100644 --- a/app/src/main/java/com/abk/kernel/MainActivity.kt +++ b/app/src/main/java/com/abk/kernel/MainActivity.kt @@ -168,6 +168,9 @@ class MainActivity : ComponentActivity() { modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.surface ) {} + state.showPreferencesResetNotice -> PreferencesResetDialog( + onDismiss = vm::dismissPreferencesResetNotice + ) !state.termsAccepted -> TermsAgreementDialog( onAccept = vm::acceptTerms, onDecline = { finishAffinity() } @@ -178,19 +181,21 @@ class MainActivity : ComponentActivity() { pendingModuleInstallUri = pendingModuleInstallUri, onModuleInstallUriConsumed = { pendingModuleInstallUri = null } ) - val rootGrantRecoveryNotice = state.rootGrantRecoveryNotice - if (rootGrantRecoveryNotice != null && !state.showOobe) { - RootGrantRecoveryDialog( - title = rootGrantRecoveryNotice.title, - message = rootGrantRecoveryNotice.message, - onDismiss = vm::dismissRootGrantRecoveryNotice - ) - } else if (state.showSyncPrompt && !state.showOobe) { - SyncPromptDialog( - behindBy = state.behindBy, - onSync = vm::syncFork, - onDismiss = vm::dismissSyncPrompt - ) + if (!state.showOobe) { + val rootGrantRecoveryNotice = state.rootGrantRecoveryNotice + if (rootGrantRecoveryNotice != null) { + RootGrantRecoveryDialog( + title = rootGrantRecoveryNotice.title, + message = rootGrantRecoveryNotice.message, + onDismiss = vm::dismissRootGrantRecoveryNotice + ) + } else if (state.showSyncPrompt) { + SyncPromptDialog( + behindBy = state.behindBy, + onSync = vm::syncFork, + onDismiss = vm::dismissSyncPrompt + ) + } } if (state.showOobe) { CompositionLocalProvider(LocalUiSurfaceAlpha provides 1f) { @@ -218,6 +223,22 @@ class MainActivity : ComponentActivity() { } } +@Composable +private fun PreferencesResetDialog( + onDismiss: () -> Unit +) { + AlertDialog( + onDismissRequest = onDismiss, + title = { Text(stringResource(R.string.preferences_reset_title)) }, + text = { Text(stringResource(R.string.preferences_reset_message)) }, + confirmButton = { + Button(onClick = onDismiss) { + Text(text = stringResource(android.R.string.ok)) + } + } + ) +} + @Composable private fun RootGrantRecoveryDialog( title: String, diff --git a/app/src/main/java/com/abk/kernel/data/repository/PreferencesRepository.kt b/app/src/main/java/com/abk/kernel/data/repository/PreferencesRepository.kt index 2aa2921de..c769d3e03 100644 --- a/app/src/main/java/com/abk/kernel/data/repository/PreferencesRepository.kt +++ b/app/src/main/java/com/abk/kernel/data/repository/PreferencesRepository.kt @@ -2,6 +2,7 @@ package com.abk.kernel.data.repository import android.content.Context import androidx.datastore.core.DataStore +import androidx.datastore.core.handlers.ReplaceFileCorruptionHandler import androidx.datastore.preferences.core.* import androidx.datastore.preferences.preferencesDataStore import com.abk.kernel.data.model.APP_UPDATE_LINE_NORMAL @@ -16,7 +17,16 @@ import kotlinx.coroutines.flow.first import kotlinx.coroutines.flow.map import kotlinx.coroutines.runBlocking -private val Context.dataStore: DataStore by preferencesDataStore(name = "abk_prefs") +private val KEY_PREFERENCES_RESET_NOTICE = booleanPreferencesKey("preferences_reset_notice") + +private val Context.dataStore: DataStore by preferencesDataStore( + name = "abk_prefs", + corruptionHandler = ReplaceFileCorruptionHandler { + // Keep a marker in the replacement file so the next UI session can + // explain why the local preferences disappeared. + preferencesOf(KEY_PREFERENCES_RESET_NOTICE to true) + }, +) class PreferencesRepository(private val context: Context) { @@ -179,6 +189,9 @@ class PreferencesRepository(private val context: Context) { ?.toSet() .orEmpty() } + val preferencesResetNoticePending: Flow = context.dataStore.data.map { + it[KEY_PREFERENCES_RESET_NOTICE] ?: false + } suspend fun saveToken(token: String) = context.dataStore.edit { it[KEY_ACCESS_TOKEN] = token } suspend fun saveUsername(name: String) = context.dataStore.edit { it[KEY_USERNAME] = name } @@ -331,6 +344,9 @@ class PreferencesRepository(private val context: Context) { preferences[KEY_ROOT_GRANT_PROFILE_READ_BLOCKED_PACKAGES] = current + cleanPackage } suspend fun clearPendingAutoDownloadRunId() = context.dataStore.edit { it.remove(KEY_PENDING_AUTO_DOWNLOAD_RUN_ID) } + suspend fun clearPreferencesResetNotice() = context.dataStore.edit { + it.remove(KEY_PREFERENCES_RESET_NOTICE) + } private fun workflowStepsVersionKey(lang: String) = intPreferencesKey("workflow_steps_version_$lang") diff --git a/app/src/main/java/com/abk/kernel/viewmodel/MainViewModel.kt b/app/src/main/java/com/abk/kernel/viewmodel/MainViewModel.kt index 70e041c70..317934c69 100644 --- a/app/src/main/java/com/abk/kernel/viewmodel/MainViewModel.kt +++ b/app/src/main/java/com/abk/kernel/viewmodel/MainViewModel.kt @@ -124,6 +124,7 @@ data class MainUiState( val behindBy: Int = 0, val showSyncPrompt: Boolean = false, val showOobe: Boolean = false, + val showPreferencesResetNotice: Boolean = false, val oobeCompleted: Boolean = false, val isLoading: Boolean = false, val error: String? = null, @@ -549,6 +550,11 @@ class MainViewModel @JvmOverloads constructor( _uiState.update { state -> state.copy(oobeCompleted = completed) } } } + viewModelScope.launch { + prefs.preferencesResetNoticePending.collect { pending -> + _uiState.update { state -> state.copy(showPreferencesResetNotice = pending) } + } + } viewModelScope.launch { combine( prefs.themeMode, @@ -5251,6 +5257,13 @@ class MainViewModel @JvmOverloads constructor( it.copy(snackbarMessage = null, snackbarLongDuration = false) } + fun dismissPreferencesResetNotice() { + _uiState.update { it.copy(showPreferencesResetNotice = false) } + viewModelScope.launch { + prefs.clearPreferencesResetNotice() + } + } + fun clearCustomExternalModuleError() = _uiState.update { it.copy(customExternalModuleError = null) } private fun buildPlanCodecMessages(): BuildPlanCodecMessages = BuildPlanCodecMessages( diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml index 60c699065..679ac94a6 100644 --- a/app/src/main/res/values-en/strings.xml +++ b/app/src/main/res/values-en/strings.xml @@ -60,6 +60,10 @@ Root is used only when flashing, installing modules, or checking root-related capabilities. Kernel version detection does not require root. After authorization, GitHub sign-in and fork checks start automatically. + + Local data was reset + ABK detected corrupted local preferences and reset them automatically. Your saved login state, build configuration, and other local settings may need to be configured again. + Sign in to GitHub ABK needs GitHub authorization to manage the fork repository and trigger kernel build workflows. diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 9ca19c293..ffc062860 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -60,6 +60,10 @@ Root используется только при прошивке, установке модулей и проверке функций, связанных с root. Определение версии ядра не требует root. После авторизации автоматически запустится вход в GitHub и проверка Fork. + + Локальные данные сброшены + ABK обнаружил повреждение локальных настроек и автоматически сбросил их. Сохранённые данные входа, конфигурацию сборки и другие локальные параметры может потребоваться настроить заново. + Вход в GitHub ABK нужна авторизация GitHub, чтобы управлять Fork-репозиторием и запускать workflow-процессы сборки ядра. diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 45572140d..21b13680c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -60,6 +60,10 @@ 只在需要刷写、安装模块和检测 Root 相关能力时调用 Root。内核版本识别不依赖 Root。 授权后会自动进入 GitHub 登录和 fork 检查流程。 + + 本地数据已重置 + 检测到 ABK 本地配置数据库损坏,已自动重置。已保存的登录状态、构建配置和其他本地设置可能需要重新配置。 + 登录 GitHub ABK 需要您的 GitHub 授权以管理 fork 仓库并触发内核构建工作流。 From 4168b2d6044a03e98d0bf24bc905465a4c1268c9 Mon Sep 17 00:00:00 2001 From: xingguangcuican Date: Sun, 2 Aug 2026 15:09:23 +0800 Subject: [PATCH 09/12] feat(all): Add ABK desktop shell and Android agent (#144) * Add ABK desktop shell and Android agent * Polish desktop layout and localization * Fix Android agent compile issues * Fix task handle visibility * chore(app): update unstable version metadata * chore(app): update unstable version metadata * Improve desktop runtime usability * Stabilize agent response field names * chore(app): update unstable version metadata * chore(app): update unstable version metadata * Tighten desktop lists and add app icons * chore(app): update unstable version metadata * chore(app): update unstable version metadata * Move root grants into a dedicated page * Support root grant icon fetches * Split device workspace and isolate desktop WebUI helper * chore(app): update unstable version metadata * chore(app): update unstable version metadata * Fix desktop WebUI bridge and root icon resource usage * Fix agent proxy response status typing * chore(app): update unstable version metadata * chore(app): update unstable version metadata * Fix WebUI sync bridge for module state loading * Allow loopback cleartext for WebUI proxy * chore(app): update unstable version metadata * chore(app): update unstable version metadata * chore(app): update unstable version metadata * chore(app): update unstable version metadata * feat(desktop): add flutter shell and agent-aware diagnostics * fix(agent): avoid nullable health payload map * chore(app): update unstable version metadata * feat(device): split susfs and add kernel feature center * chore(app): update unstable version metadata * fix(device): classify grouped abk runtime modules as sets * fix(device): use sc6-style runtime grouping semantics * fix(device): group abk module_set entries by repo * fix(device): parse abk runtime snake_case grouping fields * fix(desktop): rewrite module webui asset paths * fix(desktop): fall back root webui assets by referer * fix(desktop): resolve webui root asset fallbacks * fix(desktop): inject ksu webui compatibility bridge * feat(desktop): open module webui in native window * feat(desktop): host module webui in flutter subwindows * fix(desktop): register only webview plugin in subwindows * chore(desktop): simplify webui subwindow launch * fix(desktop): restore native webui subwindows * fix(desktop): disable webkit dmabuf on wayland * fix(device): refresh status after kernel feature toggles * Add desktop packaging and local build improvements * Fix desktop packaging build commands * Track Flutter build feature sources * Fix AppImage desktop file layout * Fix Windows launcher and window chrome * Fix Windows desktop build errors * Fix rounded window frame on Windows * Fix Windows home directory fallback * Add Monaco local build backend workflow * Fix WSL backend detection * Fix local backend task visibility and Windows sidecar startup * Fix Windows Flutter bundle install step * Fix bundled Windows sidecar path resolution * Harden Windows sidecar health startup * Pass sidecar base URL explicitly to desktop frontend * Avoid marking sidecar offline on adb errors * Pass sidecar URL to task workspace window * push all * fix: harden CLI JSON redaction and workflow permissions * fix: align repository network test with current API --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/workflows/build-abk-desktop.yml | 82 + .gitignore | 3 + app/build.gradle.kts | 1 + app/src/main/AndroidManifest.xml | 5 + .../com/abk/kernel/agent/AbkAgentFacade.kt | 661 + .../com/abk/kernel/agent/AbkAgentRoutes.kt | 116 + .../com/abk/kernel/agent/AbkAgentServer.kt | 554 + .../com/abk/kernel/agent/AbkAgentService.kt | 110 + .../com/abk/kernel/agent/AbkAgentTaskStore.kt | 197 + .../abk/kernel/ui/screens/RuntimeScreens.kt | 2 - .../main/res/xml/network_security_config.xml | 7 + .../abk/kernel/agent/AbkAgentRoutesTest.kt | 61 + .../abk/kernel/agent/AbkAgentTaskStoreTest.kt | 33 + .../repository/GitHubRepositoryNetworkTest.kt | 7 +- app_dev/build.gradle.kts | 1 + cli/abk.py | 86 +- cli/tests/test_json_contract.py | 18 + cli/tests/test_workflow_contracts.py | 7 + desktop/Cargo.lock | 1527 + desktop/Cargo.toml | 33 + desktop/assets/local_build/init.sh | 600 + desktop/assets/local_build/rebuild.sh | 1747 + desktop/flutter_app/.metadata | 30 + desktop/flutter_app/README.md | 10 + desktop/flutter_app/analysis_options.yaml | 28 + .../assets/images/android_abk_foreground.png | Bin 0 -> 748311 bytes .../assets/monaco/LICENSE-monaco-editor.txt | 21 + .../ThirdPartyNotices-monaco-editor.txt | 448 + desktop/flutter_app/assets/monaco/index.html | 35 + desktop/flutter_app/assets/monaco/shell.js | 230 + .../monaco/vs/_commonjsHelpers-CT9FvmAN.js | 1 + .../assets/monaco/vs/abap-D-t0cyap.js | 1 + .../assets/monaco/vs/apex-CcIm7xu6.js | 1 + .../monaco/vs/assets/css.worker-HnVq6Ewq.js | 93 + .../vs/assets/editor.worker-Be8ye1pW.js | 26 + .../monaco/vs/assets/html.worker-B51mlPHg.js | 470 + .../monaco/vs/assets/json.worker-DKiEKt88.js | 58 + .../monaco/vs/assets/ts.worker-CMbG-7ft.js | 67731 ++++++++++++++++ .../assets/monaco/vs/azcli-BA0tQDCg.js | 1 + .../vs/basic-languages/monaco.contribution.js | 1 + .../assets/monaco/vs/bat-C397hTD6.js | 1 + .../assets/monaco/vs/bicep-DF5aW17k.js | 2 + .../assets/monaco/vs/cameligo-plsz8qhj.js | 1 + .../assets/monaco/vs/clojure-Y2auQMzK.js | 1 + .../assets/monaco/vs/coffee-Bu45yuWE.js | 1 + .../assets/monaco/vs/cpp-CkKPQIni.js | 1 + .../assets/monaco/vs/csharp-CX28MZyh.js | 1 + .../assets/monaco/vs/csp-D8uWnyxW.js | 1 + .../assets/monaco/vs/css-CaeNmE3S.js | 3 + .../assets/monaco/vs/cssMode-CjiAH6dQ.js | 1 + .../assets/monaco/vs/cypher-DVThT8BS.js | 1 + .../assets/monaco/vs/dart-CmGfCvrO.js | 1 + .../assets/monaco/vs/dockerfile-CZqqYdch.js | 1 + .../assets/monaco/vs/ecl-30fUercY.js | 1 + .../assets/monaco/vs/editor.api-CalNCsUg.js | 903 + .../assets/monaco/vs/editor/editor.main.css | 1 + .../assets/monaco/vs/editor/editor.main.js | 5 + .../assets/monaco/vs/elixir-xjPaIfzF.js | 1 + .../assets/monaco/vs/flow9-DqtmStfK.js | 1 + .../assets/monaco/vs/freemarker2-Cz_sV6Md.js | 3 + .../assets/monaco/vs/fsharp-BOMdg4U1.js | 1 + .../assets/monaco/vs/go-D_hbi-Jt.js | 1 + .../assets/monaco/vs/graphql-CKUU4kLG.js | 1 + .../assets/monaco/vs/handlebars-OwglfO-1.js | 1 + .../assets/monaco/vs/hcl-DTaboeZW.js | 1 + .../assets/monaco/vs/html-Pa1xEWsY.js | 1 + .../assets/monaco/vs/htmlMode-Bz67EXwp.js | 1 + .../assets/monaco/vs/ini-CsNwO04R.js | 1 + .../assets/monaco/vs/java-CI4ZMsH9.js | 1 + .../assets/monaco/vs/javascript-PczUCGdz.js | 1 + .../assets/monaco/vs/jsonMode-DULH5oaX.js | 7 + .../assets/monaco/vs/julia-BwzEvaQw.js | 1 + .../assets/monaco/vs/kotlin-IUYPiTV8.js | 1 + .../vs/language/css/monaco.contribution.js | 1 + .../vs/language/html/monaco.contribution.js | 1 + .../vs/language/json/monaco.contribution.js | 1 + .../typescript/monaco.contribution.js | 1 + .../assets/monaco/vs/less-C0eDYdqa.js | 2 + .../assets/monaco/vs/lexon-iON-Kj97.js | 1 + .../assets/monaco/vs/liquid-DqKjdPGy.js | 1 + .../flutter_app/assets/monaco/vs/loader.js | 1368 + .../monaco/vs/lspLanguageFeatures-kM9O9rjY.js | 4 + .../assets/monaco/vs/lua-DtygF91M.js | 1 + .../assets/monaco/vs/m3-CsR4AuFi.js | 1 + .../assets/monaco/vs/markdown-C_rD0bIw.js | 1 + .../assets/monaco/vs/mdx-DEWtB1K5.js | 1 + .../assets/monaco/vs/mips-CiYP61RB.js | 1 + .../monaco/vs/monaco.contribution-D2OdxNBt.js | 1 + .../monaco/vs/monaco.contribution-DO3azKX8.js | 1 + .../monaco/vs/monaco.contribution-EcChJV6a.js | 1 + .../monaco/vs/monaco.contribution-qLAYrEOP.js | 1 + .../assets/monaco/vs/msdax-C38-sJlp.js | 1 + .../assets/monaco/vs/mysql-CdtbpvbG.js | 1 + .../assets/monaco/vs/nls.messages-loader.js | 1 + .../assets/monaco/vs/nls.messages.cs.js.js | 17 + .../assets/monaco/vs/nls.messages.de.js.js | 17 + .../assets/monaco/vs/nls.messages.es.js.js | 17 + .../assets/monaco/vs/nls.messages.fr.js.js | 15 + .../assets/monaco/vs/nls.messages.it.js.js | 15 + .../assets/monaco/vs/nls.messages.ja.js.js | 17 + .../assets/monaco/vs/nls.messages.js.js | 10 + .../assets/monaco/vs/nls.messages.ko.js.js | 25 + .../assets/monaco/vs/nls.messages.pl.js.js | 17 + .../assets/monaco/vs/nls.messages.pt-br.js.js | 6 + .../assets/monaco/vs/nls.messages.ru.js.js | 17 + .../assets/monaco/vs/nls.messages.tr.js.js | 15 + .../assets/monaco/vs/nls.messages.zh-cn.js.js | 17 + .../assets/monaco/vs/nls.messages.zh-tw.js.js | 15 + .../assets/monaco/vs/objective-c-CntZFaHX.js | 1 + .../assets/monaco/vs/pascal-r6kuqfl_.js | 1 + .../assets/monaco/vs/pascaligo-BiXoTmXh.js | 1 + .../assets/monaco/vs/perl-DABw_TcH.js | 1 + .../assets/monaco/vs/pgsql-me_jFXeX.js | 1 + .../assets/monaco/vs/php-D_kh-9LK.js | 1 + .../assets/monaco/vs/pla-VfZjczW0.js | 1 + .../assets/monaco/vs/postiats-BBSzz8Pk.js | 1 + .../assets/monaco/vs/powerquery-Dt-g_2cc.js | 1 + .../assets/monaco/vs/powershell-B-7ap1zc.js | 1 + .../assets/monaco/vs/protobuf-BmtuEB1A.js | 2 + .../assets/monaco/vs/pug-BRpRNeEb.js | 1 + .../assets/monaco/vs/python-Cr0UkIbn.js | 1 + .../assets/monaco/vs/qsharp-BzsFaUU9.js | 1 + .../assets/monaco/vs/r-f8dDdrp4.js | 1 + .../assets/monaco/vs/razor-BYAHOTkz.js | 1 + .../assets/monaco/vs/redis-fvZQY4PI.js | 1 + .../assets/monaco/vs/redshift-45Et0LQi.js | 1 + .../monaco/vs/restructuredtext-C7UUFKFD.js | 1 + .../assets/monaco/vs/ruby-CZO8zYTz.js | 1 + .../assets/monaco/vs/rust-Bfetafyc.js | 1 + .../assets/monaco/vs/sb-3GYllVck.js | 1 + .../assets/monaco/vs/scala-foMgrKo1.js | 1 + .../assets/monaco/vs/scheme-CHdMtr7p.js | 1 + .../assets/monaco/vs/scss-C1cmLt9V.js | 3 + .../assets/monaco/vs/shell-ClXCKCEW.js | 1 + .../assets/monaco/vs/solidity-MZ6ExpPy.js | 1 + .../assets/monaco/vs/sophia-DWkuSsPQ.js | 1 + .../assets/monaco/vs/sparql-AUGFYSyk.js | 1 + .../assets/monaco/vs/sql-32GpJSV2.js | 1 + .../assets/monaco/vs/st-CuDFIVZ_.js | 1 + .../assets/monaco/vs/swift-n-2HociN.js | 3 + .../monaco/vs/systemverilog-Ch4vA8Yt.js | 1 + .../assets/monaco/vs/tcl-D74tq1nH.js | 1 + .../assets/monaco/vs/tsMode-CZz1Umrk.js | 11 + .../assets/monaco/vs/twig-C6taOxMV.js | 1 + .../assets/monaco/vs/typescript-DfOrAzoV.js | 1 + .../assets/monaco/vs/typespec-D-PIh9Xw.js | 1 + .../assets/monaco/vs/vb-Dyb2648j.js | 1 + .../assets/monaco/vs/wgsl-BhLXMOR0.js | 298 + .../assets/monaco/vs/workers-DcJshg-q.js | 1 + .../assets/monaco/vs/xml-CdsdnY8S.js | 1 + .../assets/monaco/vs/yaml-DYGvmE88.js | 1 + desktop/flutter_app/lib/main.dart | 60 + desktop/flutter_app/lib/src/app.dart | 251 + .../lib/src/core/api/abk_sidecar_api.dart | 761 + .../src/core/localization/app_strings.dart | 1145 + .../lib/src/core/models/build_models.dart | 1078 + .../lib/src/core/models/device_models.dart | 919 + .../lib/src/core/models/sidecar_models.dart | 346 + .../core/platform/desktop_code_view_api.dart | 101 + .../core/platform/desktop_wallpaper_api.dart | 26 + .../src/core/platform/desktop_webui_api.dart | 29 + .../src/core/state/dashboard_controller.dart | 343 + .../lib/src/core/theme/app_theme.dart | 97 + .../core/theme/desktop_theme_provider.dart | 51 + .../src/features/build/build_form_state.dart | 361 + .../features/build/build_module_catalog.dart | 839 + .../lib/src/features/build/build_page.dart | 5471 ++ .../features/build/build_page_controller.dart | 2080 + .../src/features/build/kernel_support.dart | 347 + .../src/features/detect/detection_page.dart | 213 + .../lib/src/features/device/device_page.dart | 2998 + .../device/device_page_controller.dart | 918 + .../device/runtime_module_catalog.dart | 378 + .../lib/src/features/device/susfs_form.dart | 1074 + .../lib/src/features/home/home_page.dart | 473 + .../src/features/settings/settings_page.dart | 711 + .../settings/settings_page_controller.dart | 344 + .../lib/src/features/shell/app_shell.dart | 680 + .../lib/src/widgets/monaco_code_view.dart | 563 + .../lib/src/widgets/panel_card.dart | 123 + .../lib/src/widgets/status_pill.dart | 40 + desktop/flutter_app/linux/CMakeLists.txt | 135 + .../flutter_app/linux/flutter/CMakeLists.txt | 88 + .../flutter/generated_plugin_registrant.cc | 19 + .../flutter/generated_plugin_registrant.h | 15 + .../linux/flutter/generated_plugins.cmake | 26 + .../flutter_app/linux/runner/CMakeLists.txt | 27 + desktop/flutter_app/linux/runner/main.cc | 6 + .../linux/runner/my_application.cc | 751 + .../flutter_app/linux/runner/my_application.h | 25 + desktop/flutter_app/pubspec.lock | 535 + desktop/flutter_app/pubspec.yaml | 50 + .../test/abk_sidecar_api_test.dart | 34 + .../flutter_app/test/build_models_test.dart | 71 + .../test/build_module_catalog_test.dart | 122 + .../test/build_page_controller_test.dart | 1200 + .../flutter_app/test/device_models_test.dart | 82 + .../test/monaco_code_view_test.dart | 268 + desktop/flutter_app/test/widget_test.dart | 1144 + desktop/flutter_app/windows/CMakeLists.txt | 108 + .../windows/flutter/CMakeLists.txt | 109 + .../flutter/generated_plugin_registrant.cc | 17 + .../flutter/generated_plugin_registrant.h | 15 + .../windows/flutter/generated_plugins.cmake | 26 + .../flutter_app/windows/runner/CMakeLists.txt | 41 + desktop/flutter_app/windows/runner/Runner.rc | 121 + .../windows/runner/flutter_window.cpp | 71 + .../windows/runner/flutter_window.h | 33 + desktop/flutter_app/windows/runner/main.cpp | 53 + desktop/flutter_app/windows/runner/resource.h | 16 + .../windows/runner/resources/app_icon.ico | Bin 0 -> 33772 bytes .../windows/runner/runner.exe.manifest | 14 + desktop/flutter_app/windows/runner/utils.cpp | 302 + desktop/flutter_app/windows/runner/utils.h | 33 + .../windows/runner/win32_window.cpp | 296 + .../flutter_app/windows/runner/win32_window.h | 102 + desktop/packaging/linux/AppRun | 5 + .../linux/com.abk.abk_desktop.desktop | 9 + desktop/scripts/package-linux-appimage.sh | 81 + desktop/scripts/package-windows-bundle.ps1 | 62 + desktop/scripts/run-dev.sh | 24 + desktop/src/agent.rs | 69 + desktop/src/commands.rs | 427 + desktop/src/desktop_entry.rs | 5 + desktop/src/launcher.rs | 5 + desktop/src/launcher_impl.rs | 247 + desktop/src/local_build.rs | 2981 + desktop/src/local_build_paths.rs | 190 + desktop/src/main.rs | 4947 ++ desktop/src/proxy.rs | 244 + docs/agent-protocol.md | 77 + gradle/libs.versions.toml | 2 + new_test/init.sh | 600 + new_test/rebuild.sh | 1747 + 234 files changed, 118432 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/build-abk-desktop.yml create mode 100644 app/src/main/java/com/abk/kernel/agent/AbkAgentFacade.kt create mode 100644 app/src/main/java/com/abk/kernel/agent/AbkAgentRoutes.kt create mode 100644 app/src/main/java/com/abk/kernel/agent/AbkAgentServer.kt create mode 100644 app/src/main/java/com/abk/kernel/agent/AbkAgentService.kt create mode 100644 app/src/main/java/com/abk/kernel/agent/AbkAgentTaskStore.kt create mode 100644 app/src/test/java/com/abk/kernel/agent/AbkAgentRoutesTest.kt create mode 100644 app/src/test/java/com/abk/kernel/agent/AbkAgentTaskStoreTest.kt create mode 100644 desktop/Cargo.lock create mode 100644 desktop/Cargo.toml create mode 100755 desktop/assets/local_build/init.sh create mode 100755 desktop/assets/local_build/rebuild.sh create mode 100644 desktop/flutter_app/.metadata create mode 100644 desktop/flutter_app/README.md create mode 100644 desktop/flutter_app/analysis_options.yaml create mode 100644 desktop/flutter_app/assets/images/android_abk_foreground.png create mode 100644 desktop/flutter_app/assets/monaco/LICENSE-monaco-editor.txt create mode 100644 desktop/flutter_app/assets/monaco/ThirdPartyNotices-monaco-editor.txt create mode 100644 desktop/flutter_app/assets/monaco/index.html create mode 100644 desktop/flutter_app/assets/monaco/shell.js create mode 100644 desktop/flutter_app/assets/monaco/vs/_commonjsHelpers-CT9FvmAN.js create mode 100644 desktop/flutter_app/assets/monaco/vs/abap-D-t0cyap.js create mode 100644 desktop/flutter_app/assets/monaco/vs/apex-CcIm7xu6.js create mode 100644 desktop/flutter_app/assets/monaco/vs/assets/css.worker-HnVq6Ewq.js create mode 100644 desktop/flutter_app/assets/monaco/vs/assets/editor.worker-Be8ye1pW.js create mode 100644 desktop/flutter_app/assets/monaco/vs/assets/html.worker-B51mlPHg.js create mode 100644 desktop/flutter_app/assets/monaco/vs/assets/json.worker-DKiEKt88.js create mode 100644 desktop/flutter_app/assets/monaco/vs/assets/ts.worker-CMbG-7ft.js create mode 100644 desktop/flutter_app/assets/monaco/vs/azcli-BA0tQDCg.js create mode 100644 desktop/flutter_app/assets/monaco/vs/basic-languages/monaco.contribution.js create mode 100644 desktop/flutter_app/assets/monaco/vs/bat-C397hTD6.js create mode 100644 desktop/flutter_app/assets/monaco/vs/bicep-DF5aW17k.js create mode 100644 desktop/flutter_app/assets/monaco/vs/cameligo-plsz8qhj.js create mode 100644 desktop/flutter_app/assets/monaco/vs/clojure-Y2auQMzK.js create mode 100644 desktop/flutter_app/assets/monaco/vs/coffee-Bu45yuWE.js create mode 100644 desktop/flutter_app/assets/monaco/vs/cpp-CkKPQIni.js create mode 100644 desktop/flutter_app/assets/monaco/vs/csharp-CX28MZyh.js create mode 100644 desktop/flutter_app/assets/monaco/vs/csp-D8uWnyxW.js create mode 100644 desktop/flutter_app/assets/monaco/vs/css-CaeNmE3S.js create mode 100644 desktop/flutter_app/assets/monaco/vs/cssMode-CjiAH6dQ.js create mode 100644 desktop/flutter_app/assets/monaco/vs/cypher-DVThT8BS.js create mode 100644 desktop/flutter_app/assets/monaco/vs/dart-CmGfCvrO.js create mode 100644 desktop/flutter_app/assets/monaco/vs/dockerfile-CZqqYdch.js create mode 100644 desktop/flutter_app/assets/monaco/vs/ecl-30fUercY.js create mode 100644 desktop/flutter_app/assets/monaco/vs/editor.api-CalNCsUg.js create mode 100644 desktop/flutter_app/assets/monaco/vs/editor/editor.main.css create mode 100644 desktop/flutter_app/assets/monaco/vs/editor/editor.main.js create mode 100644 desktop/flutter_app/assets/monaco/vs/elixir-xjPaIfzF.js create mode 100644 desktop/flutter_app/assets/monaco/vs/flow9-DqtmStfK.js create mode 100644 desktop/flutter_app/assets/monaco/vs/freemarker2-Cz_sV6Md.js create mode 100644 desktop/flutter_app/assets/monaco/vs/fsharp-BOMdg4U1.js create mode 100644 desktop/flutter_app/assets/monaco/vs/go-D_hbi-Jt.js create mode 100644 desktop/flutter_app/assets/monaco/vs/graphql-CKUU4kLG.js create mode 100644 desktop/flutter_app/assets/monaco/vs/handlebars-OwglfO-1.js create mode 100644 desktop/flutter_app/assets/monaco/vs/hcl-DTaboeZW.js create mode 100644 desktop/flutter_app/assets/monaco/vs/html-Pa1xEWsY.js create mode 100644 desktop/flutter_app/assets/monaco/vs/htmlMode-Bz67EXwp.js create mode 100644 desktop/flutter_app/assets/monaco/vs/ini-CsNwO04R.js create mode 100644 desktop/flutter_app/assets/monaco/vs/java-CI4ZMsH9.js create mode 100644 desktop/flutter_app/assets/monaco/vs/javascript-PczUCGdz.js create mode 100644 desktop/flutter_app/assets/monaco/vs/jsonMode-DULH5oaX.js create mode 100644 desktop/flutter_app/assets/monaco/vs/julia-BwzEvaQw.js create mode 100644 desktop/flutter_app/assets/monaco/vs/kotlin-IUYPiTV8.js create mode 100644 desktop/flutter_app/assets/monaco/vs/language/css/monaco.contribution.js create mode 100644 desktop/flutter_app/assets/monaco/vs/language/html/monaco.contribution.js create mode 100644 desktop/flutter_app/assets/monaco/vs/language/json/monaco.contribution.js create mode 100644 desktop/flutter_app/assets/monaco/vs/language/typescript/monaco.contribution.js create mode 100644 desktop/flutter_app/assets/monaco/vs/less-C0eDYdqa.js create mode 100644 desktop/flutter_app/assets/monaco/vs/lexon-iON-Kj97.js create mode 100644 desktop/flutter_app/assets/monaco/vs/liquid-DqKjdPGy.js create mode 100644 desktop/flutter_app/assets/monaco/vs/loader.js create mode 100644 desktop/flutter_app/assets/monaco/vs/lspLanguageFeatures-kM9O9rjY.js create mode 100644 desktop/flutter_app/assets/monaco/vs/lua-DtygF91M.js create mode 100644 desktop/flutter_app/assets/monaco/vs/m3-CsR4AuFi.js create mode 100644 desktop/flutter_app/assets/monaco/vs/markdown-C_rD0bIw.js create mode 100644 desktop/flutter_app/assets/monaco/vs/mdx-DEWtB1K5.js create mode 100644 desktop/flutter_app/assets/monaco/vs/mips-CiYP61RB.js create mode 100644 desktop/flutter_app/assets/monaco/vs/monaco.contribution-D2OdxNBt.js create mode 100644 desktop/flutter_app/assets/monaco/vs/monaco.contribution-DO3azKX8.js create mode 100644 desktop/flutter_app/assets/monaco/vs/monaco.contribution-EcChJV6a.js create mode 100644 desktop/flutter_app/assets/monaco/vs/monaco.contribution-qLAYrEOP.js create mode 100644 desktop/flutter_app/assets/monaco/vs/msdax-C38-sJlp.js create mode 100644 desktop/flutter_app/assets/monaco/vs/mysql-CdtbpvbG.js create mode 100644 desktop/flutter_app/assets/monaco/vs/nls.messages-loader.js create mode 100644 desktop/flutter_app/assets/monaco/vs/nls.messages.cs.js.js create mode 100644 desktop/flutter_app/assets/monaco/vs/nls.messages.de.js.js create mode 100644 desktop/flutter_app/assets/monaco/vs/nls.messages.es.js.js create mode 100644 desktop/flutter_app/assets/monaco/vs/nls.messages.fr.js.js create mode 100644 desktop/flutter_app/assets/monaco/vs/nls.messages.it.js.js create mode 100644 desktop/flutter_app/assets/monaco/vs/nls.messages.ja.js.js create mode 100644 desktop/flutter_app/assets/monaco/vs/nls.messages.js.js create mode 100644 desktop/flutter_app/assets/monaco/vs/nls.messages.ko.js.js create mode 100644 desktop/flutter_app/assets/monaco/vs/nls.messages.pl.js.js create mode 100644 desktop/flutter_app/assets/monaco/vs/nls.messages.pt-br.js.js create mode 100644 desktop/flutter_app/assets/monaco/vs/nls.messages.ru.js.js create mode 100644 desktop/flutter_app/assets/monaco/vs/nls.messages.tr.js.js create mode 100644 desktop/flutter_app/assets/monaco/vs/nls.messages.zh-cn.js.js create mode 100644 desktop/flutter_app/assets/monaco/vs/nls.messages.zh-tw.js.js create mode 100644 desktop/flutter_app/assets/monaco/vs/objective-c-CntZFaHX.js create mode 100644 desktop/flutter_app/assets/monaco/vs/pascal-r6kuqfl_.js create mode 100644 desktop/flutter_app/assets/monaco/vs/pascaligo-BiXoTmXh.js create mode 100644 desktop/flutter_app/assets/monaco/vs/perl-DABw_TcH.js create mode 100644 desktop/flutter_app/assets/monaco/vs/pgsql-me_jFXeX.js create mode 100644 desktop/flutter_app/assets/monaco/vs/php-D_kh-9LK.js create mode 100644 desktop/flutter_app/assets/monaco/vs/pla-VfZjczW0.js create mode 100644 desktop/flutter_app/assets/monaco/vs/postiats-BBSzz8Pk.js create mode 100644 desktop/flutter_app/assets/monaco/vs/powerquery-Dt-g_2cc.js create mode 100644 desktop/flutter_app/assets/monaco/vs/powershell-B-7ap1zc.js create mode 100644 desktop/flutter_app/assets/monaco/vs/protobuf-BmtuEB1A.js create mode 100644 desktop/flutter_app/assets/monaco/vs/pug-BRpRNeEb.js create mode 100644 desktop/flutter_app/assets/monaco/vs/python-Cr0UkIbn.js create mode 100644 desktop/flutter_app/assets/monaco/vs/qsharp-BzsFaUU9.js create mode 100644 desktop/flutter_app/assets/monaco/vs/r-f8dDdrp4.js create mode 100644 desktop/flutter_app/assets/monaco/vs/razor-BYAHOTkz.js create mode 100644 desktop/flutter_app/assets/monaco/vs/redis-fvZQY4PI.js create mode 100644 desktop/flutter_app/assets/monaco/vs/redshift-45Et0LQi.js create mode 100644 desktop/flutter_app/assets/monaco/vs/restructuredtext-C7UUFKFD.js create mode 100644 desktop/flutter_app/assets/monaco/vs/ruby-CZO8zYTz.js create mode 100644 desktop/flutter_app/assets/monaco/vs/rust-Bfetafyc.js create mode 100644 desktop/flutter_app/assets/monaco/vs/sb-3GYllVck.js create mode 100644 desktop/flutter_app/assets/monaco/vs/scala-foMgrKo1.js create mode 100644 desktop/flutter_app/assets/monaco/vs/scheme-CHdMtr7p.js create mode 100644 desktop/flutter_app/assets/monaco/vs/scss-C1cmLt9V.js create mode 100644 desktop/flutter_app/assets/monaco/vs/shell-ClXCKCEW.js create mode 100644 desktop/flutter_app/assets/monaco/vs/solidity-MZ6ExpPy.js create mode 100644 desktop/flutter_app/assets/monaco/vs/sophia-DWkuSsPQ.js create mode 100644 desktop/flutter_app/assets/monaco/vs/sparql-AUGFYSyk.js create mode 100644 desktop/flutter_app/assets/monaco/vs/sql-32GpJSV2.js create mode 100644 desktop/flutter_app/assets/monaco/vs/st-CuDFIVZ_.js create mode 100644 desktop/flutter_app/assets/monaco/vs/swift-n-2HociN.js create mode 100644 desktop/flutter_app/assets/monaco/vs/systemverilog-Ch4vA8Yt.js create mode 100644 desktop/flutter_app/assets/monaco/vs/tcl-D74tq1nH.js create mode 100644 desktop/flutter_app/assets/monaco/vs/tsMode-CZz1Umrk.js create mode 100644 desktop/flutter_app/assets/monaco/vs/twig-C6taOxMV.js create mode 100644 desktop/flutter_app/assets/monaco/vs/typescript-DfOrAzoV.js create mode 100644 desktop/flutter_app/assets/monaco/vs/typespec-D-PIh9Xw.js create mode 100644 desktop/flutter_app/assets/monaco/vs/vb-Dyb2648j.js create mode 100644 desktop/flutter_app/assets/monaco/vs/wgsl-BhLXMOR0.js create mode 100644 desktop/flutter_app/assets/monaco/vs/workers-DcJshg-q.js create mode 100644 desktop/flutter_app/assets/monaco/vs/xml-CdsdnY8S.js create mode 100644 desktop/flutter_app/assets/monaco/vs/yaml-DYGvmE88.js create mode 100644 desktop/flutter_app/lib/main.dart create mode 100644 desktop/flutter_app/lib/src/app.dart create mode 100644 desktop/flutter_app/lib/src/core/api/abk_sidecar_api.dart create mode 100644 desktop/flutter_app/lib/src/core/localization/app_strings.dart create mode 100644 desktop/flutter_app/lib/src/core/models/build_models.dart create mode 100644 desktop/flutter_app/lib/src/core/models/device_models.dart create mode 100644 desktop/flutter_app/lib/src/core/models/sidecar_models.dart create mode 100644 desktop/flutter_app/lib/src/core/platform/desktop_code_view_api.dart create mode 100644 desktop/flutter_app/lib/src/core/platform/desktop_wallpaper_api.dart create mode 100644 desktop/flutter_app/lib/src/core/platform/desktop_webui_api.dart create mode 100644 desktop/flutter_app/lib/src/core/state/dashboard_controller.dart create mode 100644 desktop/flutter_app/lib/src/core/theme/app_theme.dart create mode 100644 desktop/flutter_app/lib/src/core/theme/desktop_theme_provider.dart create mode 100644 desktop/flutter_app/lib/src/features/build/build_form_state.dart create mode 100644 desktop/flutter_app/lib/src/features/build/build_module_catalog.dart create mode 100644 desktop/flutter_app/lib/src/features/build/build_page.dart create mode 100644 desktop/flutter_app/lib/src/features/build/build_page_controller.dart create mode 100644 desktop/flutter_app/lib/src/features/build/kernel_support.dart create mode 100644 desktop/flutter_app/lib/src/features/detect/detection_page.dart create mode 100644 desktop/flutter_app/lib/src/features/device/device_page.dart create mode 100644 desktop/flutter_app/lib/src/features/device/device_page_controller.dart create mode 100644 desktop/flutter_app/lib/src/features/device/runtime_module_catalog.dart create mode 100644 desktop/flutter_app/lib/src/features/device/susfs_form.dart create mode 100644 desktop/flutter_app/lib/src/features/home/home_page.dart create mode 100644 desktop/flutter_app/lib/src/features/settings/settings_page.dart create mode 100644 desktop/flutter_app/lib/src/features/settings/settings_page_controller.dart create mode 100644 desktop/flutter_app/lib/src/features/shell/app_shell.dart create mode 100644 desktop/flutter_app/lib/src/widgets/monaco_code_view.dart create mode 100644 desktop/flutter_app/lib/src/widgets/panel_card.dart create mode 100644 desktop/flutter_app/lib/src/widgets/status_pill.dart create mode 100644 desktop/flutter_app/linux/CMakeLists.txt create mode 100644 desktop/flutter_app/linux/flutter/CMakeLists.txt create mode 100644 desktop/flutter_app/linux/flutter/generated_plugin_registrant.cc create mode 100644 desktop/flutter_app/linux/flutter/generated_plugin_registrant.h create mode 100644 desktop/flutter_app/linux/flutter/generated_plugins.cmake create mode 100644 desktop/flutter_app/linux/runner/CMakeLists.txt create mode 100644 desktop/flutter_app/linux/runner/main.cc create mode 100644 desktop/flutter_app/linux/runner/my_application.cc create mode 100644 desktop/flutter_app/linux/runner/my_application.h create mode 100644 desktop/flutter_app/pubspec.lock create mode 100644 desktop/flutter_app/pubspec.yaml create mode 100644 desktop/flutter_app/test/abk_sidecar_api_test.dart create mode 100644 desktop/flutter_app/test/build_models_test.dart create mode 100644 desktop/flutter_app/test/build_module_catalog_test.dart create mode 100644 desktop/flutter_app/test/build_page_controller_test.dart create mode 100644 desktop/flutter_app/test/device_models_test.dart create mode 100644 desktop/flutter_app/test/monaco_code_view_test.dart create mode 100644 desktop/flutter_app/test/widget_test.dart create mode 100644 desktop/flutter_app/windows/CMakeLists.txt create mode 100644 desktop/flutter_app/windows/flutter/CMakeLists.txt create mode 100644 desktop/flutter_app/windows/flutter/generated_plugin_registrant.cc create mode 100644 desktop/flutter_app/windows/flutter/generated_plugin_registrant.h create mode 100644 desktop/flutter_app/windows/flutter/generated_plugins.cmake create mode 100644 desktop/flutter_app/windows/runner/CMakeLists.txt create mode 100644 desktop/flutter_app/windows/runner/Runner.rc create mode 100644 desktop/flutter_app/windows/runner/flutter_window.cpp create mode 100644 desktop/flutter_app/windows/runner/flutter_window.h create mode 100644 desktop/flutter_app/windows/runner/main.cpp create mode 100644 desktop/flutter_app/windows/runner/resource.h create mode 100644 desktop/flutter_app/windows/runner/resources/app_icon.ico create mode 100644 desktop/flutter_app/windows/runner/runner.exe.manifest create mode 100644 desktop/flutter_app/windows/runner/utils.cpp create mode 100644 desktop/flutter_app/windows/runner/utils.h create mode 100644 desktop/flutter_app/windows/runner/win32_window.cpp create mode 100644 desktop/flutter_app/windows/runner/win32_window.h create mode 100644 desktop/packaging/linux/AppRun create mode 100644 desktop/packaging/linux/com.abk.abk_desktop.desktop create mode 100644 desktop/scripts/package-linux-appimage.sh create mode 100644 desktop/scripts/package-windows-bundle.ps1 create mode 100755 desktop/scripts/run-dev.sh create mode 100644 desktop/src/agent.rs create mode 100644 desktop/src/commands.rs create mode 100644 desktop/src/desktop_entry.rs create mode 100644 desktop/src/launcher.rs create mode 100644 desktop/src/launcher_impl.rs create mode 100644 desktop/src/local_build.rs create mode 100644 desktop/src/local_build_paths.rs create mode 100644 desktop/src/main.rs create mode 100644 desktop/src/proxy.rs create mode 100644 docs/agent-protocol.md create mode 100755 new_test/init.sh create mode 100755 new_test/rebuild.sh diff --git a/.github/workflows/build-abk-desktop.yml b/.github/workflows/build-abk-desktop.yml new file mode 100644 index 000000000..18b358b90 --- /dev/null +++ b/.github/workflows/build-abk-desktop.yml @@ -0,0 +1,82 @@ +name: Build ABK Desktop + +on: + workflow_dispatch: + push: + paths: + - "desktop/**" + - "cli/**" + - "zram/**" + - "ddk/**" + - "config/**" + - "app/signing/abk-manager-cert.env" + - "hmbird_patch.c" + - ".github/workflows/build-abk-desktop.yml" + +permissions: + contents: read + +jobs: + linux-appimage: + if: ${{ github.event_name == 'workflow_dispatch' || github.repository == 'xingguangcuican6666/ABK' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable + + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + + - name: Install Linux desktop build dependencies + run: | + sudo apt-get update + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + clang cmake ninja-build pkg-config curl libgtk-3-dev libwebkit2gtk-4.1-dev + + - name: Enable Linux desktop + run: flutter config --enable-linux-desktop + + - name: Build AppImage + run: bash desktop/scripts/package-linux-appimage.sh + + - name: Upload Linux artifact + uses: actions/upload-artifact@v4 + with: + name: abk-linux-appimage + path: desktop/out/linux/ABK-x86_64.AppImage + + windows-bundle: + if: ${{ github.event_name == 'workflow_dispatch' || github.repository == 'xingguangcuican6666/ABK' }} + runs-on: windows-latest + steps: + - uses: actions/checkout@v6 + + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable + + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "3.12" + + - name: Enable Windows desktop + run: flutter config --enable-windows-desktop + + - name: Build Windows bundle + shell: pwsh + run: .\desktop\scripts\package-windows-bundle.ps1 + + - name: Upload Windows artifact + uses: actions/upload-artifact@v4 + with: + name: abk-windows-x64 + path: desktop/out/windows/ABK-windows-x64.zip diff --git a/.gitignore b/.gitignore index 90c9788f3..6594d8c25 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ hympfs-dev.diff ehthumbs.db Thumbs.db desktop.ini +desktop/target/ # Build outputs *.o @@ -77,6 +78,8 @@ action_build_comparison.md # Gradle .gradle/ build/ +!desktop/flutter_app/lib/src/features/build/ +!desktop/flutter_app/lib/src/features/build/*.dart app/.cxx/ app/build/ app/build/generated/ diff --git a/app/build.gradle.kts b/app/build.gradle.kts index cdfd6f9d5..bfccbca0b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -186,6 +186,7 @@ dependencies { implementation(libs.okhttp.logging) implementation(libs.gson) implementation(libs.kotlinx.serialization.json) + implementation(libs.nanohttpd) // Root implementation(libs.libsu.core) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3bce2b64e..6824f6951 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -87,6 +87,11 @@ android:foregroundServiceType="dataSync" android:exported="false" /> + + = emptyList(), +) + +internal data class AbkAgentRuntimeResponse( + @SerializedName("rootGranted") val rootGranted: Boolean, + @SerializedName("managerAccessKind") val managerAccessKind: String, + @SerializedName("managerDiagnostic") val managerDiagnostic: String? = null, + @SerializedName("runtimeStatus") val runtimeStatus: AbkRuntimeStatus? = null, +) + +internal data class AbkAgentRootGrantResponse( + @SerializedName("rootGranted") val rootGranted: Boolean, + @SerializedName("managerAccessKind") val managerAccessKind: String, + @SerializedName("managerDiagnostic") val managerDiagnostic: String? = null, + @SerializedName("apps") val apps: List = emptyList(), +) + +internal data class AbkAgentPackageInfo( + @SerializedName("packageName") val packageName: String, + @SerializedName("versionName") val versionName: String, + @SerializedName("versionCode") val versionCode: Long, + @SerializedName("appLabel") val appLabel: String, + @SerializedName("isSystem") val isSystem: Boolean, + @SerializedName("uid") val uid: Int, +) + +internal data class AbkAgentSusfsResponse( + @SerializedName("rootGranted") val rootGranted: Boolean, + @SerializedName("status") val status: SusfsRuntimeStatus? = null, + @SerializedName("config") val config: SusfsConfig = defaultSusfsConfig(), + @SerializedName("error") val error: String? = null, +) + +internal data class AbkAgentKernelFeaturesResponse( + @SerializedName("rootGranted") val rootGranted: Boolean, + @SerializedName("managerAccessKind") val managerAccessKind: String, + @SerializedName("managerDiagnostic") val managerDiagnostic: String? = null, + @SerializedName("items") val items: List = emptyList(), +) + +internal data class AbkAgentKernelFeatureItem( + @SerializedName("id") val id: String, + @SerializedName("checked") val checked: Boolean, + @SerializedName("enabled") val enabled: Boolean, + @SerializedName("status") val status: String, +) + +internal object AbkAgentFacade { + private val gson = Gson() + private val ksuModuleListType = object : TypeToken>>() {}.type + + fun health(context: Context, port: Int): Map { + val rootGranted = RootUtils.isRootAvailable() + val access = RootUtils.resolveManagerAccess(rootGranted) + val runtime = currentRuntimeSnapshot(rootGranted, access) + return mutableMapOf( + "status" to "ok", + "protocolVersion" to "abk-agent-v1", + "port" to port, + "appVersion" to BuildConfig.VERSION_NAME, + "appVersionCode" to BuildConfig.APP_VERSION_CODE, + "rootGranted" to rootGranted, + "managerAccessKind" to access.kind.name.lowercase(), + "capabilities" to declaredCapabilities(rootGranted, access, runtime), + ).apply { + managerAccessError(context, access, rootGranted)?.let { + put("managerDiagnostic", it) + } + } + } + + fun session(context: Context, host: String, port: Int): AbkAgentSessionResponse { + val rootGranted = RootUtils.isRootAvailable() + val access = RootUtils.resolveManagerAccess(rootGranted) + val runtime = currentRuntimeSnapshot(rootGranted, access) + return AbkAgentSessionResponse( + protocolVersion = "abk-agent-v1", + appVersion = BuildConfig.VERSION_NAME, + appVersionCode = BuildConfig.APP_VERSION_CODE, + packageName = context.packageName, + serviceHost = host, + servicePort = port, + rootGranted = rootGranted, + managerAccessKind = access.kind.name.lowercase(), + managerDiagnostic = managerAccessError(context, access, rootGranted), + capabilities = declaredCapabilities(rootGranted, access, runtime), + ) + } + + fun runtime(context: Context): AbkAgentRuntimeResponse { + val rootGranted = RootUtils.isRootAvailable() + val access = RootUtils.resolveManagerAccess(rootGranted) + val runtimeStatus = currentRuntimeSnapshot(rootGranted, access) + return AbkAgentRuntimeResponse( + rootGranted = rootGranted, + managerAccessKind = access.kind.name.lowercase(), + managerDiagnostic = managerAccessError(context, access, rootGranted), + runtimeStatus = runtimeStatus?.copy( + modules = sortRuntimeModulesForDisplay(runtimeStatus.modules), + ), + ) + } + + fun rootGrants(context: Context): AbkAgentRootGrantResponse { + val rootGranted = RootUtils.isRootAvailable() + val access = RootUtils.resolveManagerAccess(rootGranted) + val apps = if (access.hasNativeManagerPermission) { + RootUtils.listRootGrantApps(context) + } else { + emptyList() + } + return AbkAgentRootGrantResponse( + rootGranted = rootGranted, + managerAccessKind = access.kind.name.lowercase(), + managerDiagnostic = managerAccessError(context, access, rootGranted), + apps = apps, + ) + } + + fun listPackages(context: Context, type: String): List { + val normalizedType = type.trim().lowercase() + val packageManager = context.packageManager + val applications = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + packageManager.getInstalledApplications(android.content.pm.PackageManager.ApplicationInfoFlags.of(0)) + } else { + @Suppress("DEPRECATION") + packageManager.getInstalledApplications(0) + } + return applications + .asSequence() + .filter { application -> + when (normalizedType) { + "user" -> (application.flags and android.content.pm.ApplicationInfo.FLAG_SYSTEM) == 0 + "system" -> (application.flags and android.content.pm.ApplicationInfo.FLAG_SYSTEM) != 0 + else -> true + } + } + .map { it.packageName.orEmpty() } + .filter { it.isNotBlank() } + .sorted() + .toList() + } + + fun packageInfos(context: Context, packages: List): List { + val packageManager = context.packageManager + return packages + .asSequence() + .map { it.trim() } + .filter { it.isNotBlank() } + .mapNotNull { packageName -> + val info = runCatching { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + packageManager.getPackageInfo( + packageName, + android.content.pm.PackageManager.PackageInfoFlags.of(0), + ) + } else { + @Suppress("DEPRECATION") + packageManager.getPackageInfo(packageName, 0) + } + }.getOrNull() ?: return@mapNotNull null + val appInfo = info.applicationInfo ?: return@mapNotNull null + AbkAgentPackageInfo( + packageName = packageName, + versionName = info.versionName.orEmpty(), + versionCode = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + info.longVersionCode + } else { + @Suppress("DEPRECATION") + info.versionCode.toLong() + }, + appLabel = runCatching { + packageManager.getApplicationLabel(appInfo).toString() + }.getOrDefault(packageName), + isSystem = (appInfo.flags and android.content.pm.ApplicationInfo.FLAG_SYSTEM) != 0, + uid = appInfo.uid, + ) + } + .toList() + } + + fun readRootGrantIconPng(context: Context, packageName: String): ByteArray? { + val cleanPackage = packageName.trim() + if (cleanPackage.isBlank()) return null + val packageManager = context.packageManager + val drawable = runCatching { packageManager.getApplicationIcon(cleanPackage) }.getOrNull() + ?: return null + val bitmap = drawable.toBitmap(64) + return ByteArrayOutputStream().use { output -> + if (!bitmap.compress(Bitmap.CompressFormat.PNG, 100, output)) return null + output.toByteArray() + } + } + + fun readRuntimeModuleWebResource(moduleId: String, relativePath: String?): ByteArray? { + val cleanModuleId = moduleId.trim() + if (!RootUtils.isSafeModuleIdForPath(cleanModuleId)) return null + val targetPath = relativePath?.trim().orEmpty().ifBlank { "index.html" } + return RootUtils.readModuleWebResource(cleanModuleId, targetPath) + ?: if (targetPath == "index.html") { + RootUtils.readModuleWebResource(cleanModuleId, "index.htm") + } else { + null + } + } + + fun runtimeModuleWebInfoJson(moduleId: String): String { + val cleanModuleId = moduleId.trim() + if (!RootUtils.isSafeModuleIdForPath(cleanModuleId)) return "{}" + return RootUtils.moduleInfoJson(cleanModuleId) + } + + fun executeRuntimeModuleWebCommand( + moduleId: String, + command: String, + optionsJson: String?, + ): RootUtils.ShellResult { + val moduleDir = moduleDirForWebUi(moduleId) + ?: return RootUtils.ShellResult(false, listOf("module webui unavailable")) + val cleanCommand = command.trim() + if (cleanCommand.isBlank()) { + return RootUtils.ShellResult(false, listOf("command missing")) + } + val finalCommand = commandWithOptions(cleanCommand, optionsJson, moduleDir) + return RootUtils.execRootCommandForWebUi(finalCommand, cwd = moduleDir) + } + + fun spawnRuntimeModuleWebCommand( + moduleId: String, + command: String, + argsJson: String?, + optionsJson: String?, + ): RootUtils.ShellResult { + val moduleDir = moduleDirForWebUi(moduleId) + ?: return RootUtils.ShellResult(false, listOf("module webui unavailable")) + val cleanCommand = command.trim() + if (cleanCommand.isBlank()) { + return RootUtils.ShellResult(false, listOf("command missing")) + } + val argString = runCatching { + val array = JSONArray(argsJson ?: "[]") + buildString { + for (index in 0 until array.length()) { + val item = array.optString(index) + if (item.isBlank()) continue + if (isNotEmpty()) append(' ') + append(shellQuote(item)) + } + } + }.getOrDefault("") + val baseCommand = listOf(cleanCommand, argString) + .filter { it.isNotBlank() } + .joinToString(" ") + val finalCommand = commandWithOptions(baseCommand, optionsJson, moduleDir) + return RootUtils.execRootCommandForWebUi(finalCommand, cwd = moduleDir) + } + + fun setRootGrantAllowed( + context: Context, + packageName: String, + allowed: Boolean, + ): RootUtils.ShellResult { + val cleanPackage = packageName.trim() + if (cleanPackage.isBlank()) { + return RootUtils.ShellResult(false, listOf("package_name missing")) + } + val rootGranted = RootUtils.isRootAvailable() + val access = RootUtils.resolveManagerAccess(rootGranted) + if (!access.hasNativeManagerPermission) { + return RootUtils.ShellResult( + false, + listOf( + managerAccessError(context, access, rootGranted) + ?: "native manager permission unavailable", + ), + ) + } + val app = RootUtils.listRootGrantApps(context).firstOrNull { it.packageName == cleanPackage } + ?: return RootUtils.ShellResult(false, listOf("package not found: $cleanPackage")) + val profile = app.profile.copy( + name = cleanPackage, + currentUid = app.uid, + allowSu = allowed, + rootUseDefault = true, + nonRootUseDefault = true, + ) + return if (RootUtils.setRootGrantProfile(profile)) { + RootUtils.ShellResult(true, listOf("updated $cleanPackage")) + } else { + RootUtils.ShellResult(false, listOf("failed to update $cleanPackage")) + } + } + + fun susfs(context: Context): AbkAgentSusfsResponse { + val rootGranted = RootUtils.isRootAvailable() + if (!rootGranted) { + return AbkAgentSusfsResponse( + rootGranted = false, + config = defaultSusfsConfig(), + ) + } + return runCatching { + AbkAgentSusfsResponse( + rootGranted = true, + status = RootUtils.readSusfsRuntimeStatus(), + config = normalizeSusfsConfig(RootUtils.readSusfsConfig()), + ) + }.getOrElse { error -> + AbkAgentSusfsResponse( + rootGranted = true, + config = defaultSusfsConfig(), + error = error.message ?: "susfs load failed", + ) + } + } + + fun kernelFeatures(context: Context): AbkAgentKernelFeaturesResponse { + val rootGranted = RootUtils.isRootAvailable() + val access = RootUtils.resolveManagerAccess(rootGranted) + return AbkAgentKernelFeaturesResponse( + rootGranted = rootGranted, + managerAccessKind = access.kind.name.lowercase(), + managerDiagnostic = managerAccessError(context, access, rootGranted), + items = buildKernelFeatureItems(), + ) + } + + fun applySusfsConfig( + config: SusfsConfig, + onOutput: (String) -> Unit, + ): RootUtils.ShellResult = RootUtils.applySusfsConfig(normalizeSusfsConfig(config), onOutput) + + fun setRuntimeModuleEnabled(moduleId: String, enabled: Boolean): RootUtils.ShellResult { + val module = findRuntimeModule(moduleId) + ?: return RootUtils.ShellResult(false, listOf("module not found: $moduleId")) + return when { + module.isAbkMetaMount() -> RootUtils.setAbkMetaMountEnabled(enabled) + module.preferredControlBackend() == RuntimeModuleControlBackend.ABK_CONTROL -> { + val command = if (enabled) "enable ${module.id}" else "disable ${module.id}" + val controlResult = RootUtils.writeAbkControlCommand(command) + if (controlResult.success) { + controlResult + } else if (module.isKsuBacked()) { + RootUtils.setKsuModuleEnabled(module.id, enabled) + } else { + controlResult + } + } + module.preferredControlBackend() == RuntimeModuleControlBackend.KSU -> + RootUtils.setKsuModuleEnabled(module.id, enabled) + else -> + RootUtils.writeAbkControlCommand( + if (enabled) "enable ${module.id}" else "disable ${module.id}", + ) + } + } + + fun setRuntimeModulePendingUninstall(moduleId: String, pending: Boolean): RootUtils.ShellResult { + val module = findRuntimeModule(moduleId) + ?: return RootUtils.ShellResult(false, listOf("module not found: $moduleId")) + if (!module.isKsuBacked()) { + return RootUtils.ShellResult(false, listOf("module uninstall unsupported")) + } + return RootUtils.setKsuModulePendingUninstall(module.id, pending) + } + + fun runRuntimeModuleAction( + moduleId: String, + onOutput: (String) -> Unit, + ): RootUtils.ShellResult { + val module = findRuntimeModule(moduleId) + ?: return RootUtils.ShellResult(false, listOf("module not found: $moduleId")) + return when (module.preferredActionBackend()) { + RuntimeModuleActionBackend.ABK_ACTION_SCRIPT -> + RootUtils.runModuleActionScript(module.moduleDir.ifBlank { "/data/adb/modules/${module.id}" }, onOutput) + RuntimeModuleActionBackend.KSU_ACTION -> + RootUtils.runKsuModuleAction(module.id, onOutput) + RuntimeModuleActionBackend.NONE -> + RootUtils.ShellResult(false, listOf("module action unsupported")) + } + } + + fun installModule(zipPath: String, onOutput: (String) -> Unit): RootUtils.ShellResult = + RootUtils.installModule(zipPath, onOutput) + + fun installApk(context: Context, apkPath: String, onOutput: (String) -> Unit): RootUtils.ShellResult = + RootUtils.installApk(context, apkPath, onOutput) + + fun flashImage(imagePath: String, partition: String, onOutput: (String) -> Unit): RootUtils.ShellResult = + RootUtils.flashImage(imagePath, partition, onOutput) + + fun setKernelFeatureEnabled(context: Context, featureId: String, enabled: Boolean): RootUtils.ShellResult { + return when (featureId.trim()) { + "adb_root", "sulog", "kernel_umount", "selinux_hide" -> + RootUtils.setKsuFeatureEnabled(featureId.trim(), enabled) + "default_umount" -> { + if (!RootUtils.isNativeManagerActive()) { + RootUtils.ShellResult( + false, + listOf(context.getString(R.string.vm_setting_native_manager_required)), + ) + } else if (RootUtils.setDefaultUmountModules(enabled)) { + RootUtils.ShellResult( + true, + listOf("updated default_umount"), + ) + } else { + RootUtils.ShellResult(false, listOf("failed to update default_umount")) + } + } + else -> RootUtils.ShellResult(false, listOf("unknown kernel feature: $featureId")) + } + } + + suspend fun exportDiagnostics(context: Context): Pair> { + val rootGranted = RootUtils.isRootAvailable() + val access = RootUtils.resolveManagerAccess(rootGranted) + val state = MainUiState( + rootGranted = rootGranted, + abkRuntimeStatus = currentRuntimeSnapshot(rootGranted, access), + ) + val result = exportDiagnosticBundle(context, state) + return result.zipFile to result.warnings + } + + private fun currentRuntimeSnapshot( + rootGranted: Boolean, + access: RootUtils.ManagerAccessInfo, + ): AbkRuntimeStatus? { + if (!access.hasNativeManagerPermission && !rootGranted) return null + val snapshot = RootUtils.readManagerRuntimeSnapshot() + if (!snapshot.manager.active) return null + return mergeRuntimeStatus( + gson = gson, + ksuModuleListType = ksuModuleListType, + manager = snapshot.manager, + controlJson = snapshot.controlStatusJson, + ksuModulesJson = snapshot.ksuModulesJson, + ) + } + + private fun buildKernelFeatureItems(): List { + val items = mutableListOf() + items += featureItem( + id = "kernel_umount", + state = RootUtils.readKsuFeature("kernel_umount"), + checked = { value != 0L }, + ) + if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) { + items += featureItem( + id = "adb_root", + state = RootUtils.readKsuFeature("adb_root"), + checked = { (configValue ?: value ?: 0L) != 0L }, + ) + } + items += featureItem( + id = "sulog", + state = RootUtils.readKsuFeature("sulog"), + checked = { value != 0L }, + ) + val selinuxHide = RootUtils.readKsuFeature("selinux_hide") + if (selinuxHide.support != RootUtils.KsuFeatureSupport.UNSUPPORTED) { + items += featureItem( + id = "selinux_hide", + state = selinuxHide, + checked = { value != 0L }, + ) + } + if (RootUtils.isNativeManagerActive()) { + items += AbkAgentKernelFeatureItem( + id = "default_umount", + checked = RootUtils.isDefaultUmountModules(), + enabled = true, + status = "supported", + ) + } + return items + } + + private inline fun featureItem( + id: String, + state: RootUtils.KsuFeatureState, + checked: RootUtils.KsuFeatureState.() -> Boolean, + ): AbkAgentKernelFeatureItem { + return AbkAgentKernelFeatureItem( + id = id, + checked = state.checked(), + enabled = state.support == RootUtils.KsuFeatureSupport.SUPPORTED, + status = when (state.support) { + RootUtils.KsuFeatureSupport.SUPPORTED -> "supported" + RootUtils.KsuFeatureSupport.MANAGED -> "managed" + RootUtils.KsuFeatureSupport.UNSUPPORTED -> "unsupported" + }, + ) + } + + private fun declaredCapabilities( + rootGranted: Boolean, + access: RootUtils.ManagerAccessInfo, + runtime: AbkRuntimeStatus?, + ): List { + val capabilities = mutableListOf( + "session.read", + "runtime.read", + "root.refresh", + "diagnostics.export", + "kernel_features.read", + ) + if (rootGranted) { + capabilities += listOf( + "susfs.read", + "susfs.write", + "install.module", + "install.apk", + "flash.image", + "kernel_features.write", + ) + } + if (runtime?.modules?.isNotEmpty() == true) { + capabilities += listOf( + "runtime.module.enable", + "runtime.module.uninstall", + "runtime.module.action", + ) + } + if (access.hasNativeManagerPermission) { + capabilities += listOf( + "root_grants.read", + "root_grants.write", + ) + } + return capabilities.distinct().sorted() + } + + private fun findRuntimeModule(moduleId: String): AbkRuntimeModule? { + val rootGranted = RootUtils.isRootAvailable() + val access = RootUtils.resolveManagerAccess(rootGranted) + return currentRuntimeSnapshot(rootGranted, access) + ?.modules + ?.firstOrNull { it.id == moduleId.trim() } + } + + private fun managerAccessError( + context: Context, + access: RootUtils.ManagerAccessInfo, + rootGranted: Boolean, + ): String? { + access.diagnostic?.takeIf { it.isNotBlank() }?.let { return it } + val message = when (access.kind) { + RootUtils.ManagerAccessKind.NATIVE_MANAGER -> "" + RootUtils.ManagerAccessKind.NO_ROOT -> context.getString(R.string.vm_external_manager_no_root) + RootUtils.ManagerAccessKind.ROOT_ONLY -> context.getString(R.string.vm_external_root_no_native_permission) + RootUtils.ManagerAccessKind.NATIVE_KERNEL_NO_MANAGER -> + context.getString(R.string.vm_native_kernel_no_manager) + } + return message.ifBlank { if (rootGranted) null else null } + } + + private fun android.graphics.drawable.Drawable.toBitmap(sizePx: Int): Bitmap { + if (this is BitmapDrawable && bitmap != null) { + return Bitmap.createScaledBitmap(bitmap, sizePx, sizePx, true) + } + val width = intrinsicWidth.takeIf { it > 0 } ?: sizePx + val height = intrinsicHeight.takeIf { it > 0 } ?: sizePx + val bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888) + val canvas = Canvas(bitmap) + setBounds(0, 0, canvas.width, canvas.height) + draw(canvas) + return if (width == sizePx && height == sizePx) { + bitmap + } else { + Bitmap.createScaledBitmap(bitmap, sizePx, sizePx, true) + } + } + + private fun moduleDirForWebUi(moduleId: String): String? { + val cleanModuleId = moduleId.trim() + if (!RootUtils.isSafeModuleIdForPath(cleanModuleId)) return null + return "/data/adb/modules/$cleanModuleId" + } + + private fun commandWithOptions( + command: String, + optionsJson: String?, + moduleDir: String, + ): String { + if (optionsJson.isNullOrBlank()) return command + val options = runCatching { JSONObject(optionsJson) }.getOrNull() ?: return command + val prefix = buildString { + options.optJSONObject("env")?.let { env -> + val keys = env.keys() + while (keys.hasNext()) { + val key = keys.next() + append("export ") + append(key) + append("=") + append(shellQuote(env.optString(key))) + append('\n') + } + } + options.optString("cwd") + .takeIf { it.isNotBlank() } + ?.let { cwd -> + append("cd ") + append(shellQuote(cwd)) + append(" 2>/dev/null || exit 2\n") + } + ?: append("cd ${shellQuote(moduleDir)} 2>/dev/null || exit 2\n") + } + return prefix + command + } + + private fun shellQuote(value: String): String = + "'${value.replace("'", "'\"'\"'")}'" +} diff --git a/app/src/main/java/com/abk/kernel/agent/AbkAgentRoutes.kt b/app/src/main/java/com/abk/kernel/agent/AbkAgentRoutes.kt new file mode 100644 index 000000000..d798e4fdc --- /dev/null +++ b/app/src/main/java/com/abk/kernel/agent/AbkAgentRoutes.kt @@ -0,0 +1,116 @@ +package com.abk.kernel.agent + +internal sealed interface AbkAgentRoute { + data object Health : AbkAgentRoute + data object Session : AbkAgentRoute + data object Runtime : AbkAgentRoute + data object RootGrants : AbkAgentRoute + data object PackageList : AbkAgentRoute + data object PackageInfo : AbkAgentRoute + data class RootGrantAllow(val packageName: String) : AbkAgentRoute + data class RootGrantIcon(val packageName: String) : AbkAgentRoute + data object KernelFeatures : AbkAgentRoute + data class KernelFeatureSet(val featureId: String) : AbkAgentRoute + data object InternalInsetsCss : AbkAgentRoute + data object Susfs : AbkAgentRoute + data object ApplySusfs : AbkAgentRoute + data class RuntimeModuleEnable(val moduleId: String) : AbkAgentRoute + data class RuntimeModulePendingUninstall(val moduleId: String) : AbkAgentRoute + data class RuntimeModuleAction(val moduleId: String) : AbkAgentRoute + data class RuntimeModuleWebUiFiles(val moduleId: String, val relativePath: String?) : AbkAgentRoute + data class RuntimeModuleWebUiHttpProxy(val moduleId: String) : AbkAgentRoute + data class RuntimeModuleWebUiExec(val moduleId: String) : AbkAgentRoute + data class RuntimeModuleWebUiSpawn(val moduleId: String) : AbkAgentRoute + data class RuntimeModuleWebUiModuleInfo(val moduleId: String) : AbkAgentRoute + data object InstallModule : AbkAgentRoute + data object InstallApk : AbkAgentRoute + data object FlashImage : AbkAgentRoute + data object ExportDiagnostics : AbkAgentRoute + data class Task(val taskId: String) : AbkAgentRoute + data class TaskDownload(val taskId: String) : AbkAgentRoute +} + +internal object AbkAgentRoutes { + private val runtimeEnable = Regex("""^/api/v1/runtime/modules/([^/]+)/enable$""") + private val runtimePendingUninstall = Regex("""^/api/v1/runtime/modules/([^/]+)/pending-uninstall$""") + private val runtimeAction = Regex("""^/api/v1/runtime/modules/([^/]+)/action$""") + private val runtimeWebUiFiles = Regex("""^/api/v1/runtime/modules/([^/]+)/webui/files(?:/(.*))?$""") + private val runtimeWebUiHttpProxy = Regex("""^/api/v1/runtime/modules/([^/]+)/webui/http-proxy$""") + private val runtimeWebUiExec = Regex("""^/api/v1/runtime/modules/([^/]+)/webui/exec$""") + private val runtimeWebUiSpawn = Regex("""^/api/v1/runtime/modules/([^/]+)/webui/spawn$""") + private val runtimeWebUiModuleInfo = Regex("""^/api/v1/runtime/modules/([^/]+)/webui/module-info$""") + private val rootGrantAllow = Regex("""^/api/v1/root-grants/([^/]+)/allow$""") + private val rootGrantIcon = Regex("""^/api/v1/root-grants/([^/]+)/icon$""") + private val kernelFeatureSet = Regex("""^/api/v1/kernel-features/([^/]+)$""") + private val task = Regex("""^/api/v1/tasks/([^/]+)$""") + private val taskDownload = Regex("""^/api/v1/tasks/([^/]+)/download$""") + + fun parse(path: String?): AbkAgentRoute? { + val clean = path.orEmpty() + .substringBefore('?') + .trim() + .trimEnd('/') + .ifBlank { "/" } + return when (clean) { + "/api/v1/health" -> AbkAgentRoute.Health + "/api/v1/session" -> AbkAgentRoute.Session + "/api/v1/runtime" -> AbkAgentRoute.Runtime + "/api/v1/root-grants" -> AbkAgentRoute.RootGrants + "/api/v1/kernel-features" -> AbkAgentRoute.KernelFeatures + "/api/v1/packages" -> AbkAgentRoute.PackageList + "/api/v1/packages/info" -> AbkAgentRoute.PackageInfo + "/internal/insets.css" -> AbkAgentRoute.InternalInsetsCss + "/api/v1/susfs" -> AbkAgentRoute.Susfs + "/api/v1/susfs/apply" -> AbkAgentRoute.ApplySusfs + "/api/v1/install/module" -> AbkAgentRoute.InstallModule + "/api/v1/install/apk" -> AbkAgentRoute.InstallApk + "/api/v1/flash/image" -> AbkAgentRoute.FlashImage + "/api/v1/diagnostics/export" -> AbkAgentRoute.ExportDiagnostics + else -> { + runtimeEnable.matchEntire(clean)?.groupValues?.getOrNull(1)?.let { + return AbkAgentRoute.RuntimeModuleEnable(it) + } + runtimePendingUninstall.matchEntire(clean)?.groupValues?.getOrNull(1)?.let { + return AbkAgentRoute.RuntimeModulePendingUninstall(it) + } + runtimeAction.matchEntire(clean)?.groupValues?.getOrNull(1)?.let { + return AbkAgentRoute.RuntimeModuleAction(it) + } + runtimeWebUiExec.matchEntire(clean)?.groupValues?.getOrNull(1)?.let { + return AbkAgentRoute.RuntimeModuleWebUiExec(it) + } + runtimeWebUiHttpProxy.matchEntire(clean)?.groupValues?.getOrNull(1)?.let { + return AbkAgentRoute.RuntimeModuleWebUiHttpProxy(it) + } + runtimeWebUiSpawn.matchEntire(clean)?.groupValues?.getOrNull(1)?.let { + return AbkAgentRoute.RuntimeModuleWebUiSpawn(it) + } + runtimeWebUiModuleInfo.matchEntire(clean)?.groupValues?.getOrNull(1)?.let { + return AbkAgentRoute.RuntimeModuleWebUiModuleInfo(it) + } + runtimeWebUiFiles.matchEntire(clean)?.let { match -> + return AbkAgentRoute.RuntimeModuleWebUiFiles( + moduleId = match.groupValues.getOrNull(1).orEmpty(), + relativePath = match.groupValues.getOrNull(2)?.takeIf { it.isNotBlank() }, + ) + } + rootGrantAllow.matchEntire(clean)?.groupValues?.getOrNull(1)?.let { + return AbkAgentRoute.RootGrantAllow(it) + } + rootGrantIcon.matchEntire(clean)?.groupValues?.getOrNull(1)?.let { + return AbkAgentRoute.RootGrantIcon(it) + } + kernelFeatureSet.matchEntire(clean)?.groupValues?.getOrNull(1)?.let { + return AbkAgentRoute.KernelFeatureSet(it) + } + taskDownload.matchEntire(clean)?.groupValues?.getOrNull(1)?.let { + return AbkAgentRoute.TaskDownload(it) + } + task.matchEntire(clean)?.groupValues?.getOrNull(1)?.let { + return AbkAgentRoute.Task(it) + } + null + } + } + } +} diff --git a/app/src/main/java/com/abk/kernel/agent/AbkAgentServer.kt b/app/src/main/java/com/abk/kernel/agent/AbkAgentServer.kt new file mode 100644 index 000000000..4019ab32c --- /dev/null +++ b/app/src/main/java/com/abk/kernel/agent/AbkAgentServer.kt @@ -0,0 +1,554 @@ +package com.abk.kernel.agent + +import android.content.Context +import com.abk.kernel.data.model.SusfsConfig +import com.abk.kernel.utils.RootUtils +import com.google.gson.Gson +import com.google.gson.JsonObject +import com.google.gson.JsonParser +import fi.iki.elonen.NanoHTTPD +import java.io.ByteArrayInputStream +import java.io.FileInputStream +import java.net.HttpURLConnection +import java.net.URL +import java.net.URLDecoder +import java.nio.charset.StandardCharsets + +internal class AbkAgentServer( + private val context: Context, + private val host: String, + port: Int, +) : NanoHTTPD(host, port) { + private val gson = Gson() + + override fun serve(session: IHTTPSession): Response { + return try { + val route = AbkAgentRoutes.parse(session.uri) + ?: return jsonResponse( + status = Response.Status.NOT_FOUND, + payload = mapOf("error" to "route not found", "path" to session.uri), + ) + when (route) { + AbkAgentRoute.Health -> requireMethod(session, Method.GET) { + jsonResponse(payload = AbkAgentFacade.health(context, listeningPort)) + } + AbkAgentRoute.Session -> requireMethod(session, Method.GET) { + jsonResponse(payload = AbkAgentFacade.session(context, host, listeningPort)) + } + AbkAgentRoute.Runtime -> requireMethod(session, Method.GET) { + jsonResponse(payload = AbkAgentFacade.runtime(context)) + } + AbkAgentRoute.RootGrants -> requireMethod(session, Method.GET) { + jsonResponse(payload = AbkAgentFacade.rootGrants(context)) + } + AbkAgentRoute.KernelFeatures -> requireMethod(session, Method.GET) { + jsonResponse(payload = AbkAgentFacade.kernelFeatures(context)) + } + AbkAgentRoute.PackageList -> requireMethod(session, Method.GET) { + val packageType = decode(session.parameters["type"]?.firstOrNull().orEmpty()) + jsonResponse(payload = mapOf("packages" to AbkAgentFacade.listPackages(context, packageType))) + } + AbkAgentRoute.PackageInfo -> requireMethod(session, Method.POST) { + val body = readJsonBody(session) + val packages = body?.getAsJsonArray("packages") + ?.mapNotNull { element -> element?.asString?.trim()?.takeIf { it.isNotBlank() } } + .orEmpty() + jsonResponse(payload = mapOf("packages" to AbkAgentFacade.packageInfos(context, packages))) + } + is AbkAgentRoute.RootGrantAllow -> requireMethod(session, Method.POST) { + val body = readJsonBody(session) + val allowed = body?.get("allowed")?.asBoolean ?: false + jsonResponse(payload = shellResultPayload(AbkAgentFacade.setRootGrantAllowed(context, decode(route.packageName), allowed))) + } + is AbkAgentRoute.RootGrantIcon -> requireMethod(session, Method.GET) { + val icon = AbkAgentFacade.readRootGrantIconPng(context, decode(route.packageName)) + ?: return@requireMethod jsonResponse( + Response.Status.NOT_FOUND, + mapOf("error" to "icon not found", "packageName" to route.packageName), + ) + binaryResponse( + bytes = icon, + contentType = "image/png", + fileName = "${decode(route.packageName)}.png", + ) + } + is AbkAgentRoute.KernelFeatureSet -> requireMethod(session, Method.POST) { + val enabled = readJsonBody(session)?.get("enabled")?.asBoolean ?: false + jsonResponse( + payload = shellResultPayload( + AbkAgentFacade.setKernelFeatureEnabled( + context, + decode(route.featureId), + enabled, + ), + ), + ) + } + AbkAgentRoute.InternalInsetsCss -> requireMethod(session, Method.GET) { + binaryResponse( + bytes = """ + :root { + --ksu-safe-area-inset-top: 0px; + --ksu-safe-area-inset-right: 0px; + --ksu-safe-area-inset-bottom: 0px; + --ksu-safe-area-inset-left: 0px; + } + """.trimIndent().toByteArray(StandardCharsets.UTF_8), + contentType = "text/css; charset=utf-8", + fileName = "insets.css", + ) + } + AbkAgentRoute.Susfs -> requireMethod(session, Method.GET) { + jsonResponse(payload = AbkAgentFacade.susfs(context)) + } + AbkAgentRoute.ApplySusfs -> requireMethod(session, Method.POST) { + val body = readBody(session) + if (body.isBlank()) { + return@requireMethod jsonResponse(Response.Status.BAD_REQUEST, mapOf("error" to "request body missing")) + } + val config = runCatching { + gson.fromJson(body, SusfsConfig::class.java) + }.getOrNull() ?: return@requireMethod jsonResponse( + Response.Status.BAD_REQUEST, + mapOf("error" to "invalid susfs config json"), + ) + acceptTask("susfs.apply") { + val result = AbkAgentFacade.applySusfsConfig(config) { line -> log(line) } + if (result.success) { + success( + message = "susfs applied", + result = mapOf( + "shell" to shellResultPayload(result), + "susfs" to AbkAgentFacade.susfs(context), + ), + ) + } else { + fail(result.output.lastOrNull().orEmpty().ifBlank { "susfs apply failed" }, appendMessage = false) + } + } + } + is AbkAgentRoute.RuntimeModuleEnable -> requireMethod(session, Method.POST) { + val enabled = readJsonBody(session)?.get("enabled")?.asBoolean ?: false + jsonResponse(payload = shellResultPayload(AbkAgentFacade.setRuntimeModuleEnabled(decode(route.moduleId), enabled))) + } + is AbkAgentRoute.RuntimeModulePendingUninstall -> requireMethod(session, Method.POST) { + val pending = readJsonBody(session)?.get("pending")?.asBoolean ?: false + jsonResponse(payload = shellResultPayload(AbkAgentFacade.setRuntimeModulePendingUninstall(decode(route.moduleId), pending))) + } + is AbkAgentRoute.RuntimeModuleAction -> requireMethod(session, Method.POST) { + acceptTask("runtime.module.action") { + val result = AbkAgentFacade.runRuntimeModuleAction(decode(route.moduleId)) { line -> log(line) } + if (result.success) { + success( + message = "module action complete", + result = shellResultPayload(result), + ) + } else { + fail(result.output.lastOrNull().orEmpty().ifBlank { "module action failed" }, appendMessage = false) + } + } + } + is AbkAgentRoute.RuntimeModuleWebUiFiles -> requireMethod(session, Method.GET) { + val bytes = AbkAgentFacade.readRuntimeModuleWebResource( + moduleId = decode(route.moduleId), + relativePath = route.relativePath?.let(::decode), + ) + ?: return@requireMethod jsonResponse( + Response.Status.NOT_FOUND, + mapOf( + "error" to "module webui resource not found", + "moduleId" to route.moduleId, + "relativePath" to route.relativePath, + ), + ) + binaryResponse( + bytes = bytes, + contentType = webUiContentType(route.relativePath), + fileName = webUiFileName(route.relativePath), + ) + } + is AbkAgentRoute.RuntimeModuleWebUiHttpProxy -> proxyModuleWebUiRequest( + session = session, + moduleId = decode(route.moduleId), + ) + is AbkAgentRoute.RuntimeModuleWebUiExec -> requireMethod(session, Method.POST) { + val body = readJsonBody(session) + val command = body?.get("command")?.asString.orEmpty() + val optionsJson = body?.get("options")?.toString() + jsonResponse( + payload = webUiShellResultPayload( + AbkAgentFacade.executeRuntimeModuleWebCommand( + moduleId = decode(route.moduleId), + command = command, + optionsJson = optionsJson, + ), + ), + ) + } + is AbkAgentRoute.RuntimeModuleWebUiSpawn -> requireMethod(session, Method.POST) { + val body = readJsonBody(session) + val command = body?.get("command")?.asString.orEmpty() + val argsJson = body?.get("args")?.toString() + val optionsJson = body?.get("options")?.toString() + jsonResponse( + payload = webUiShellResultPayload( + AbkAgentFacade.spawnRuntimeModuleWebCommand( + moduleId = decode(route.moduleId), + command = command, + argsJson = argsJson, + optionsJson = optionsJson, + ), + ), + ) + } + is AbkAgentRoute.RuntimeModuleWebUiModuleInfo -> requireMethod(session, Method.GET) { + jsonResponse( + payload = mapOf( + "raw" to AbkAgentFacade.runtimeModuleWebInfoJson(decode(route.moduleId)), + ), + ) + } + AbkAgentRoute.InstallModule -> requireMethod(session, Method.POST) { + val path = readJsonBody(session)?.get("zipPath")?.asString.orEmpty() + if (path.isBlank()) { + return@requireMethod jsonResponse(Response.Status.BAD_REQUEST, mapOf("error" to "zipPath missing")) + } + acceptTask("install.module") { + val result = AbkAgentFacade.installModule(path) { line -> log(line) } + if (result.success) { + success(message = "module installed", result = shellResultPayload(result)) + } else { + fail(result.output.lastOrNull().orEmpty().ifBlank { "module install failed" }) + } + } + } + AbkAgentRoute.InstallApk -> requireMethod(session, Method.POST) { + val path = readJsonBody(session)?.get("apkPath")?.asString.orEmpty() + if (path.isBlank()) { + return@requireMethod jsonResponse(Response.Status.BAD_REQUEST, mapOf("error" to "apkPath missing")) + } + acceptTask("install.apk") { + val result = AbkAgentFacade.installApk(context, path) { line -> log(line) } + if (result.success) { + success(message = "apk installed", result = shellResultPayload(result)) + } else { + fail(result.output.lastOrNull().orEmpty().ifBlank { "apk install failed" }) + } + } + } + AbkAgentRoute.FlashImage -> requireMethod(session, Method.POST) { + val body = readJsonBody(session) + val imagePath = body?.get("imagePath")?.asString.orEmpty() + val partition = body?.get("partition")?.asString?.ifBlank { "boot" } ?: "boot" + if (imagePath.isBlank()) { + return@requireMethod jsonResponse(Response.Status.BAD_REQUEST, mapOf("error" to "imagePath missing")) + } + acceptTask("flash.image") { + val result = AbkAgentFacade.flashImage(imagePath, partition) { line -> log(line) } + if (result.success) { + success(message = "image flashed", result = shellResultPayload(result)) + } else { + fail(result.output.lastOrNull().orEmpty().ifBlank { "flash failed" }) + } + } + } + AbkAgentRoute.ExportDiagnostics -> requireMethod(session, Method.POST) { + acceptTask("diagnostics.export") { + val (zipFile, warnings) = AbkAgentFacade.exportDiagnostics(context) + success( + message = "diagnostics exported", + result = mapOf("warnings" to warnings), + download = AbkAgentDownload( + file = zipFile, + fileName = zipFile.name, + contentType = "application/zip", + ), + ) + } + } + is AbkAgentRoute.Task -> requireMethod(session, Method.GET) { + val snapshot = AbkAgentTaskStore.get(decode(route.taskId)) + ?: return@requireMethod jsonResponse( + Response.Status.NOT_FOUND, + mapOf("error" to "task not found", "taskId" to route.taskId), + ) + jsonResponse(payload = snapshot) + } + is AbkAgentRoute.TaskDownload -> requireMethod(session, Method.GET) { + val download = AbkAgentTaskStore.getDownload(decode(route.taskId)) + ?: return@requireMethod jsonResponse( + Response.Status.NOT_FOUND, + mapOf("error" to "task download not available", "taskId" to route.taskId), + ) + fileResponse(download) + } + } + } catch (error: Exception) { + jsonResponse( + status = Response.Status.INTERNAL_ERROR, + payload = mapOf( + "error" to (error.message ?: error::class.java.simpleName), + ), + ) + } + } + + private fun requireMethod( + session: IHTTPSession, + method: Method, + handler: () -> Response, + ): Response { + return if (session.method == method) { + handler() + } else { + jsonResponse( + status = Response.Status.METHOD_NOT_ALLOWED, + payload = mapOf("error" to "method not allowed", "expected" to method.name), + ) + } + } + + private fun acceptTask( + kind: String, + operation: suspend AbkAgentTaskStore.AbkAgentTaskHandle.() -> Unit, + ): Response { + val snapshot = AbkAgentTaskStore.submit(kind, operation) + return jsonResponse( + status = Response.Status.ACCEPTED, + payload = snapshot, + ) + } + + private fun readJsonBody(session: IHTTPSession): JsonObject? { + val body = readBody(session) + if (body.isBlank()) return null + return runCatching { + JsonParser.parseString(body).asJsonObject + }.getOrNull() + } + + private fun readBody(session: IHTTPSession): String { + val files = HashMap() + session.parseBody(files) + return files["postData"].orEmpty() + } + + private fun jsonResponse( + status: Response.IStatus = Response.Status.OK, + payload: Any, + ): Response { + val response = newFixedLengthResponse( + status, + "application/json; charset=utf-8", + gson.toJson(payload), + ) + response.addHeader("Cache-Control", "no-store") + return response + } + + private fun fileResponse(download: AbkAgentDownload): Response { + val response = newChunkedResponse( + Response.Status.OK, + download.contentType, + FileInputStream(download.file), + ) + response.addHeader("Content-Disposition", "attachment; filename=\"${download.fileName}\"") + response.addHeader("Cache-Control", "no-store") + return response + } + + private fun binaryResponse( + bytes: ByteArray, + contentType: String, + fileName: String, + ): Response { + val response = newChunkedResponse( + Response.Status.OK, + contentType, + ByteArrayInputStream(bytes), + ) + response.addHeader("Content-Disposition", "inline; filename=\"$fileName\"") + response.addHeader("Cache-Control", "no-store") + return response + } + + private fun proxyModuleWebUiRequest( + session: IHTTPSession, + moduleId: String, + ): Response { + if (!RootUtils.isSafeModuleIdForPath(moduleId)) { + return jsonResponse( + status = Response.Status.BAD_REQUEST, + payload = mapOf("error" to "invalid module id"), + ) + } + val target = decode(session.parameters["target"]?.firstOrNull().orEmpty()) + if (target.isBlank()) { + return jsonResponse( + status = Response.Status.BAD_REQUEST, + payload = mapOf("error" to "target missing"), + ) + } + val url = runCatching { URL(target) }.getOrNull() + ?: return jsonResponse( + status = Response.Status.BAD_REQUEST, + payload = mapOf("error" to "invalid target url", "target" to target), + ) + if (!isAllowedLocalWebUiTarget(url)) { + return jsonResponse( + status = Response.Status.FORBIDDEN, + payload = mapOf("error" to "target host forbidden", "target" to target), + ) + } + + val connection = (url.openConnection() as? HttpURLConnection) + ?: return jsonResponse( + status = Response.Status.BAD_REQUEST, + payload = mapOf("error" to "unsupported target protocol", "target" to target), + ) + return try { + connection.requestMethod = session.method.name + connection.instanceFollowRedirects = false + connection.connectTimeout = 15000 + connection.readTimeout = 30000 + connection.doInput = true + copyProxyRequestHeaders(session, connection) + + val body = if (session.method == Method.POST || session.method == Method.PUT) { + readBody(session) + } else { + "" + } + if (body.isNotEmpty()) { + connection.doOutput = true + connection.outputStream.use { output -> + output.write(body.toByteArray(StandardCharsets.UTF_8)) + } + } + + val statusCode = connection.responseCode.takeIf { it > 0 } ?: 502 + val stream = connection.errorStream ?: connection.inputStream + ?: ByteArrayInputStream(ByteArray(0)) + val response = newChunkedResponse( + proxyStatus(statusCode), + connection.contentType ?: "application/octet-stream", + stream, + ) + response.addHeader("Cache-Control", "no-store") + response.addHeader("Access-Control-Allow-Origin", "*") + connection.headerFields + .filterKeys { key -> !key.isNullOrBlank() } + .forEach { (key, values) -> + values?.forEach { value -> + if (!value.isNullOrBlank() && shouldForwardProxyResponseHeader(key)) { + response.addHeader(key, value) + } + } + } + response + } catch (error: Exception) { + connection.disconnect() + jsonResponse( + status = proxyStatus(502), + payload = mapOf( + "error" to (error.message ?: error::class.java.simpleName), + "target" to target, + ), + ) + } + } + + private fun shellResultPayload(result: RootUtils.ShellResult): Map = mapOf( + "success" to result.success, + "output" to result.output, + ) + + private fun webUiShellResultPayload(result: RootUtils.ShellResult): Map { + val stdout = result.output.joinToString("\n") + return mapOf( + "success" to result.success, + "code" to if (result.success) 0 else 1, + "stdout" to stdout, + "output" to result.output, + ) + } + + private fun webUiContentType(relativePath: String?): String { + val clean = relativePath + ?.substringAfterLast('/') + ?.lowercase() + ?.ifBlank { "index.html" } + ?: "index.html" + return when { + clean.endsWith(".html") || clean.endsWith(".htm") -> "text/html; charset=utf-8" + clean.endsWith(".js") -> "application/javascript; charset=utf-8" + clean.endsWith(".mjs") -> "application/javascript; charset=utf-8" + clean.endsWith(".css") -> "text/css; charset=utf-8" + clean.endsWith(".json") -> "application/json; charset=utf-8" + clean.endsWith(".svg") -> "image/svg+xml" + clean.endsWith(".png") -> "image/png" + clean.endsWith(".jpg") || clean.endsWith(".jpeg") -> "image/jpeg" + clean.endsWith(".gif") -> "image/gif" + clean.endsWith(".webp") -> "image/webp" + clean.endsWith(".ico") -> "image/x-icon" + else -> "application/octet-stream" + } + } + + private fun webUiFileName(relativePath: String?): String = + relativePath + ?.substringAfterLast('/') + ?.takeIf { it.isNotBlank() } + ?: "index.html" + + private fun isAllowedLocalWebUiTarget(url: URL): Boolean { + val protocol = url.protocol?.lowercase().orEmpty() + if (protocol != "http" && protocol != "https") return false + val host = url.host?.trim()?.lowercase().orEmpty() + return host == "127.0.0.1" || + host == "localhost" || + host == "::1" || + host == "[::1]" || + host == "0.0.0.0" + } + + private fun copyProxyRequestHeaders(session: IHTTPSession, connection: HttpURLConnection) { + session.headers.forEach { (key, value) -> + if (key.isNullOrBlank() || value.isNullOrBlank()) return@forEach + if (!shouldForwardProxyRequestHeader(key)) return@forEach + connection.setRequestProperty(key, value) + } + } + + private fun shouldForwardProxyRequestHeader(name: String): Boolean { + val normalized = name.lowercase() + return normalized !in setOf( + "host", + "connection", + "content-length", + "accept-encoding", + "origin", + "referer", + ) + } + + private fun shouldForwardProxyResponseHeader(name: String): Boolean { + val normalized = name.lowercase() + return normalized !in setOf( + "transfer-encoding", + "connection", + "content-length", + "content-encoding", + "access-control-allow-origin", + ) + } + + private fun proxyStatus(code: Int): Response.IStatus = object : Response.IStatus { + override fun getRequestStatus(): Int = code + + override fun getDescription(): String = "$code Proxy" + } + + private fun decode(raw: String): String = + URLDecoder.decode(raw, StandardCharsets.UTF_8.name()) +} diff --git a/app/src/main/java/com/abk/kernel/agent/AbkAgentService.kt b/app/src/main/java/com/abk/kernel/agent/AbkAgentService.kt new file mode 100644 index 000000000..9482ca0f4 --- /dev/null +++ b/app/src/main/java/com/abk/kernel/agent/AbkAgentService.kt @@ -0,0 +1,110 @@ +package com.abk.kernel.agent + +import android.app.Notification +import android.app.NotificationChannel +import android.app.NotificationManager +import android.app.Service +import android.content.Intent +import android.content.pm.ServiceInfo +import android.os.Build +import android.os.IBinder +import androidx.core.app.NotificationCompat +import androidx.core.app.ServiceCompat +import com.abk.kernel.MainActivity + +class AbkAgentService : Service() { + private var server: AbkAgentServer? = null + + override fun onBind(intent: Intent?): IBinder? = null + + override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { + val action = intent?.action ?: ACTION_START + return when (action) { + ACTION_STOP -> { + stopSelf() + START_NOT_STICKY + } + else -> { + val port = intent?.getIntExtra(EXTRA_PORT, DEFAULT_PORT)?.takeIf { it > 0 } ?: DEFAULT_PORT + val host = intent?.getStringExtra(EXTRA_HOST)?.ifBlank { DEFAULT_HOST } ?: DEFAULT_HOST + startForegroundInternal(port) + startOrRestartServer(host = host, port = port) + START_STICKY + } + } + } + + override fun onDestroy() { + server?.stop() + server = null + super.onDestroy() + } + + private fun startOrRestartServer(host: String, port: Int) { + val current = server + if (current != null && current.listeningPort == port) return + current?.stop() + server = AbkAgentServer(applicationContext, host, port).apply { + start(SOCKET_READ_TIMEOUT, false) + } + } + + private fun startForegroundInternal(port: Int) { + ensureNotificationChannel() + val notification = buildNotification(port) + val foregroundType = + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { + ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC + } else { + 0 + } + ServiceCompat.startForeground(this, NOTIFICATION_ID, notification, foregroundType) + } + + private fun buildNotification(port: Int): Notification { + val intent = Intent(this, MainActivity::class.java) + val pendingIntent = android.app.PendingIntent.getActivity( + this, + 0, + intent, + android.app.PendingIntent.FLAG_IMMUTABLE, + ) + return NotificationCompat.Builder(this, CHANNEL_ID) + .setSmallIcon(android.R.drawable.stat_notify_sync) + .setContentTitle("ABK Agent running") + .setContentText("Listening on 127.0.0.1:$port") + .setOngoing(true) + .setContentIntent(pendingIntent) + .setCategory(NotificationCompat.CATEGORY_SERVICE) + .setForegroundServiceBehavior(NotificationCompat.FOREGROUND_SERVICE_IMMEDIATE) + .build() + } + + private fun ensureNotificationChannel() { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) return + val manager = getSystemService(NotificationManager::class.java) + if (manager.getNotificationChannel(CHANNEL_ID) != null) return + manager.createNotificationChannel( + NotificationChannel( + CHANNEL_ID, + "ABK Agent", + NotificationManager.IMPORTANCE_LOW, + ).apply { + description = "Desktop bridge for ABK runtime control" + }, + ) + } + + companion object { + const val ACTION_START = "com.abk.kernel.agent.START" + const val ACTION_STOP = "com.abk.kernel.agent.STOP" + const val EXTRA_HOST = "host" + const val EXTRA_PORT = "port" + const val DEFAULT_HOST = "127.0.0.1" + const val DEFAULT_PORT = 48765 + + private const val CHANNEL_ID = "abk_agent" + private const val NOTIFICATION_ID = 1203 + private const val SOCKET_READ_TIMEOUT = 5_000 + } +} diff --git a/app/src/main/java/com/abk/kernel/agent/AbkAgentTaskStore.kt b/app/src/main/java/com/abk/kernel/agent/AbkAgentTaskStore.kt new file mode 100644 index 000000000..2abc1e178 --- /dev/null +++ b/app/src/main/java/com/abk/kernel/agent/AbkAgentTaskStore.kt @@ -0,0 +1,197 @@ +package com.abk.kernel.agent + +import com.google.gson.Gson +import com.google.gson.JsonElement +import java.io.File +import java.util.UUID +import java.util.concurrent.ConcurrentHashMap +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.SupervisorJob +import kotlinx.coroutines.launch + +internal data class AbkAgentTaskSnapshot( + val id: String, + val kind: String, + val state: String, + val createdAt: Long, + val updatedAt: Long, + val message: String? = null, + val output: List = emptyList(), + val result: JsonElement? = null, + val downloadName: String? = null, + val downloadContentType: String? = null, +) + +internal data class AbkAgentDownload( + val file: File, + val fileName: String, + val contentType: String, +) + +internal object AbkAgentTaskStore { + private val gson = Gson() + private val scope = CoroutineScope(SupervisorJob() + Dispatchers.IO) + private val tasks = ConcurrentHashMap() + + fun submit( + kind: String, + operation: suspend AbkAgentTaskHandle.() -> Unit, + ): AbkAgentTaskSnapshot { + val task = MutableTask( + id = UUID.randomUUID().toString(), + kind = kind, + createdAt = System.currentTimeMillis(), + ) + tasks[task.id] = task + pruneCompletedTasks() + scope.launch { + val handle = AbkAgentTaskHandle(task) + handle.markRunning() + try { + handle.operation() + handle.ensureCompleted() + } catch (error: Throwable) { + handle.fail( + error.message ?: error::class.java.simpleName, + appendMessage = true, + ) + } + } + return task.snapshot() + } + + fun get(taskId: String): AbkAgentTaskSnapshot? = tasks[taskId]?.snapshot() + + fun getDownload(taskId: String): AbkAgentDownload? = tasks[taskId]?.download() + + private fun pruneCompletedTasks(limit: Int = 64) { + val completed = tasks.values + .map { it.snapshot() } + .filter { it.state == TASK_SUCCEEDED || it.state == TASK_FAILED } + .sortedByDescending { it.updatedAt } + if (completed.size <= limit) return + completed.drop(limit).forEach { snapshot -> + tasks.remove(snapshot.id) + } + } + + internal class MutableTask( + val id: String, + val kind: String, + val createdAt: Long, + ) { + private val output = mutableListOf() + private var state: String = TASK_PENDING + private var updatedAt: Long = createdAt + private var message: String? = null + private var result: JsonElement? = null + private var downloadFile: File? = null + private var downloadName: String? = null + private var downloadContentType: String? = null + + @Synchronized + fun setRunning() { + state = TASK_RUNNING + updatedAt = System.currentTimeMillis() + } + + @Synchronized + fun append(line: String) { + if (line.isBlank()) return + output += line + updatedAt = System.currentTimeMillis() + } + + @Synchronized + fun complete( + state: String, + message: String?, + result: JsonElement?, + download: AbkAgentDownload?, + ) { + this.state = state + this.message = message + this.result = result + this.downloadFile = download?.file + this.downloadName = download?.fileName + this.downloadContentType = download?.contentType + this.updatedAt = System.currentTimeMillis() + } + + @Synchronized + fun snapshot(): AbkAgentTaskSnapshot = AbkAgentTaskSnapshot( + id = id, + kind = kind, + state = state, + createdAt = createdAt, + updatedAt = updatedAt, + message = message, + output = output.toList(), + result = result, + downloadName = downloadName, + downloadContentType = downloadContentType, + ) + + @Synchronized + fun download(): AbkAgentDownload? { + val file = downloadFile ?: return null + val name = downloadName ?: file.name + val contentType = downloadContentType ?: "application/octet-stream" + if (!file.isFile) return null + return AbkAgentDownload(file, name, contentType) + } + } + + internal class AbkAgentTaskHandle( + private val task: MutableTask, + ) { + fun markRunning() { + task.setRunning() + } + + fun log(line: String) { + task.append(line) + } + + fun success( + message: String? = null, + result: Any? = null, + download: AbkAgentDownload? = null, + ) { + task.complete( + state = TASK_SUCCEEDED, + message = message, + result = result?.let { gson.toJsonTree(it) }, + download = download, + ) + } + + fun fail( + message: String, + appendMessage: Boolean = false, + ) { + if (appendMessage) { + task.append(message) + } + task.complete( + state = TASK_FAILED, + message = message, + result = null, + download = null, + ) + } + + fun ensureCompleted() { + val snapshot = task.snapshot() + if (snapshot.state == TASK_RUNNING || snapshot.state == TASK_PENDING) { + success() + } + } + } + + private const val TASK_PENDING = "pending" + private const val TASK_RUNNING = "running" + private const val TASK_SUCCEEDED = "succeeded" + private const val TASK_FAILED = "failed" +} diff --git a/app/src/main/java/com/abk/kernel/ui/screens/RuntimeScreens.kt b/app/src/main/java/com/abk/kernel/ui/screens/RuntimeScreens.kt index 058899f83..79c368ee2 100644 --- a/app/src/main/java/com/abk/kernel/ui/screens/RuntimeScreens.kt +++ b/app/src/main/java/com/abk/kernel/ui/screens/RuntimeScreens.kt @@ -1904,5 +1904,3 @@ private fun copyRuntimeModuleUriToCache(context: Context, uri: Uri): File { } return target } - - diff --git a/app/src/main/res/xml/network_security_config.xml b/app/src/main/res/xml/network_security_config.xml index 7fae51698..2266f64cd 100644 --- a/app/src/main/res/xml/network_security_config.xml +++ b/app/src/main/res/xml/network_security_config.xml @@ -1,5 +1,12 @@ + + + + localhost + 127.0.0.1 + + api.github.com github.com diff --git a/app/src/test/java/com/abk/kernel/agent/AbkAgentRoutesTest.kt b/app/src/test/java/com/abk/kernel/agent/AbkAgentRoutesTest.kt new file mode 100644 index 000000000..9efb44f1a --- /dev/null +++ b/app/src/test/java/com/abk/kernel/agent/AbkAgentRoutesTest.kt @@ -0,0 +1,61 @@ +package com.abk.kernel.agent + +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNull +import org.junit.Assert.assertTrue +import org.junit.Test + +class AbkAgentRoutesTest { + @Test + fun parsesRuntimeModuleActionRoute() { + val route = AbkAgentRoutes.parse("/api/v1/runtime/modules/meta-abk-mount/action") + assertTrue(route is AbkAgentRoute.RuntimeModuleAction) + assertEquals("meta-abk-mount", (route as AbkAgentRoute.RuntimeModuleAction).moduleId) + } + + @Test + fun parsesTaskDownloadRoute() { + val route = AbkAgentRoutes.parse("/api/v1/tasks/abc-123/download") + assertTrue(route is AbkAgentRoute.TaskDownload) + assertEquals("abc-123", (route as AbkAgentRoute.TaskDownload).taskId) + } + + @Test + fun parsesRootGrantIconRoute() { + val route = AbkAgentRoutes.parse("/api/v1/root-grants/com.example.app/icon") + assertTrue(route is AbkAgentRoute.RootGrantIcon) + assertEquals("com.example.app", (route as AbkAgentRoute.RootGrantIcon).packageName) + } + + @Test + fun parsesPackageAndInternalRoutes() { + assertTrue(AbkAgentRoutes.parse("/api/v1/packages") is AbkAgentRoute.PackageList) + assertTrue(AbkAgentRoutes.parse("/api/v1/packages/info") is AbkAgentRoute.PackageInfo) + assertTrue(AbkAgentRoutes.parse("/internal/insets.css") is AbkAgentRoute.InternalInsetsCss) + } + + @Test + fun parsesRuntimeModuleWebUiRoutes() { + val files = AbkAgentRoutes.parse("/api/v1/runtime/modules/meta-abk-mount/webui/files/assets/app.js") + assertTrue(files is AbkAgentRoute.RuntimeModuleWebUiFiles) + files as AbkAgentRoute.RuntimeModuleWebUiFiles + assertEquals("meta-abk-mount", files.moduleId) + assertEquals("assets/app.js", files.relativePath) + + val root = AbkAgentRoutes.parse("/api/v1/runtime/modules/meta-abk-mount/webui/files") + assertTrue(root is AbkAgentRoute.RuntimeModuleWebUiFiles) + assertNull((root as AbkAgentRoute.RuntimeModuleWebUiFiles).relativePath) + + val exec = AbkAgentRoutes.parse("/api/v1/runtime/modules/meta-abk-mount/webui/exec") + assertTrue(exec is AbkAgentRoute.RuntimeModuleWebUiExec) + assertEquals("meta-abk-mount", (exec as AbkAgentRoute.RuntimeModuleWebUiExec).moduleId) + + val spawn = AbkAgentRoutes.parse("/api/v1/runtime/modules/meta-abk-mount/webui/spawn") + assertTrue(spawn is AbkAgentRoute.RuntimeModuleWebUiSpawn) + assertEquals("meta-abk-mount", (spawn as AbkAgentRoute.RuntimeModuleWebUiSpawn).moduleId) + + val info = AbkAgentRoutes.parse("/api/v1/runtime/modules/meta-abk-mount/webui/module-info") + assertTrue(info is AbkAgentRoute.RuntimeModuleWebUiModuleInfo) + assertEquals("meta-abk-mount", (info as AbkAgentRoute.RuntimeModuleWebUiModuleInfo).moduleId) + } +} diff --git a/app/src/test/java/com/abk/kernel/agent/AbkAgentTaskStoreTest.kt b/app/src/test/java/com/abk/kernel/agent/AbkAgentTaskStoreTest.kt new file mode 100644 index 000000000..33f5d7512 --- /dev/null +++ b/app/src/test/java/com/abk/kernel/agent/AbkAgentTaskStoreTest.kt @@ -0,0 +1,33 @@ +package com.abk.kernel.agent + +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNotNull +import org.junit.Assert.assertTrue +import org.junit.Test + +class AbkAgentTaskStoreTest { + @Test + fun completesSubmittedTask() { + val snapshot = AbkAgentTaskStore.submit("test.task") { + log("starting") + success(message = "done", result = mapOf("ok" to true)) + } + + val finalSnapshot = waitForTask(snapshot.id) + assertEquals("succeeded", finalSnapshot.state) + assertEquals("done", finalSnapshot.message) + assertTrue(finalSnapshot.output.contains("starting")) + assertNotNull(finalSnapshot.result) + } + + private fun waitForTask(taskId: String, attempts: Int = 40): AbkAgentTaskSnapshot { + repeat(attempts) { + val snapshot = requireNotNull(AbkAgentTaskStore.get(taskId)) + if (snapshot.state == "succeeded" || snapshot.state == "failed") { + return snapshot + } + Thread.sleep(25L) + } + error("task did not complete: $taskId") + } +} diff --git a/app/src/test/java/com/abk/kernel/data/repository/GitHubRepositoryNetworkTest.kt b/app/src/test/java/com/abk/kernel/data/repository/GitHubRepositoryNetworkTest.kt index 5383cef88..709f699d9 100644 --- a/app/src/test/java/com/abk/kernel/data/repository/GitHubRepositoryNetworkTest.kt +++ b/app/src/test/java/com/abk/kernel/data/repository/GitHubRepositoryNetworkTest.kt @@ -5,6 +5,7 @@ import okhttp3.mockwebserver.Dispatcher import okhttp3.mockwebserver.MockResponse import okhttp3.mockwebserver.MockWebServer import okhttp3.mockwebserver.RecordedRequest +import kotlinx.coroutines.runBlocking import org.junit.After import org.junit.Assert.assertEquals import org.junit.Assert.assertTrue @@ -53,16 +54,16 @@ class GitHubRepositoryNetworkTest { ) ) - val result = repository.getRepo("owner", "repo") + val result = repository.getUserFork("owner", "repo", "owner") - assertTrue(result is Result.Success) + assertTrue(result is Result.Success<*>) val request = server.takeRequest() assertEquals("application/vnd.github+json", request.getHeader("Accept")) assertEquals("Bearer test-token", request.getHeader("Authorization")) } @Test - fun downloadReleaseAssetText_requestsOctetStreamAndReturnsPemBody() { + fun downloadReleaseAssetText_requestsOctetStreamAndReturnsPemBody() = runBlocking { val pem = """ -----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtestkeytestkeytest diff --git a/app_dev/build.gradle.kts b/app_dev/build.gradle.kts index 2516d006e..6fe42dafd 100644 --- a/app_dev/build.gradle.kts +++ b/app_dev/build.gradle.kts @@ -186,6 +186,7 @@ dependencies { implementation(libs.okhttp.logging) implementation(libs.gson) implementation(libs.kotlinx.serialization.json) + implementation(libs.nanohttpd) // Root implementation(libs.libsu.core) diff --git a/cli/abk.py b/cli/abk.py index 5a4a36cf6..b7e82c126 100755 --- a/cli/abk.py +++ b/cli/abk.py @@ -4950,24 +4950,61 @@ def _redact_secret_text(value, secrets): return value +_SENSITIVE_JSON_KEYS = frozenset({ + "access_token", + "accesstoken", + "api_key", + "apikey", + "authorization", + "client_secret", + "clientsecret", + "cookie", + "kpm_password", + "kpmpassword", + "password", + "private_key", + "privatekey", + "secret", + "secret_value", + "secretvalue", + "token", +}) + + +def _is_sensitive_json_key(key): + if not isinstance(key, str): + return False + normalized = re.sub(r"[^a-z0-9]", "", key.lower()) + return normalized in { + re.sub(r"[^a-z0-9]", "", item) + for item in _SENSITIVE_JSON_KEYS + } + + def _redact_json_secrets(value, secrets, sensitive_context=False): if isinstance(value, dict): - return { - key: _redact_json_secrets( + redacted = {} + for key, item in value.items(): + if _is_sensitive_json_key(key): + redacted[key] = None if item is None else "***" + continue + redacted[key] = _redact_json_secrets( item, secrets, - sensitive_context or key.lower() in { - "error", - "message", - "detail", - "details", - "stderr", - "stdout", - "output", - }, + sensitive_context or ( + isinstance(key, str) + and key.lower() in { + "error", + "message", + "detail", + "details", + "stderr", + "stdout", + "output", + } + ), ) - for key, item in value.items() - } + return redacted if isinstance(value, list): return [ _redact_json_secrets(item, secrets, sensitive_context) @@ -4975,6 +5012,14 @@ def _redact_json_secrets(value, secrets, sensitive_context=False): ] if isinstance(value, str) and sensitive_context: value = _redact_secret_text(value, secrets) + elif isinstance(value, str): + # Avoid corrupting ordinary fields when a deliberately short password + # is supplied, while still masking normal-length tokens anywhere in a + # machine-readable response. + value = _redact_secret_text( + value, + {secret for secret in secrets if len(secret) >= 3}, + ) return value @@ -5028,14 +5073,15 @@ def _run_json_command(args): payload.setdefault("error", None) payload.setdefault("errorCode", None) secrets = _collect_json_secrets(args) - payload = _redact_json_secrets(payload, secrets) + redacted_payload = _redact_json_secrets(payload, secrets) + json_document = json.dumps( + redacted_payload, + ensure_ascii=False, + separators=(",", ":"), + default=str, + ) sys.stdout.write( - json.dumps( - payload, - ensure_ascii=False, - separators=(",", ":"), - default=str, - ) + "\n" + json_document + "\n" ) sys.stdout.flush() return exit_code diff --git a/cli/tests/test_json_contract.py b/cli/tests/test_json_contract.py index baaffa6c4..d1f8d4784 100644 --- a/cli/tests/test_json_contract.py +++ b/cli/tests/test_json_contract.py @@ -581,6 +581,24 @@ def test_overlapping_secrets_are_fully_redacted(self): self.assertEqual("request exposed ***", payload["error"]) + def test_sensitive_json_keys_are_redacted_without_secret_inventory(self): + payload = abk._redact_json_secrets( + { + "token": "token-not-collected", + "nested": { + "kpm_password": "password-not-collected", + "private_key": "private-key-not-collected", + "safe": "public-value", + }, + }, + set(), + ) + + self.assertEqual("***", payload["token"]) + self.assertEqual("***", payload["nested"]["kpm_password"]) + self.assertEqual("***", payload["nested"]["private_key"]) + self.assertEqual("public-value", payload["nested"]["safe"]) + def test_login_json_never_starts_an_interactive_device_flow(self): with mock.patch.object(abk, "device_flow_login") as login: exit_code, payload, stderr = self._run_main(["abk", "--json", "login"]) diff --git a/cli/tests/test_workflow_contracts.py b/cli/tests/test_workflow_contracts.py index e33ac4f37..db161b469 100644 --- a/cli/tests/test_workflow_contracts.py +++ b/cli/tests/test_workflow_contracts.py @@ -72,6 +72,13 @@ def build_args(**overrides): class WorkflowContractTests(unittest.TestCase): + def test_desktop_workflow_limits_github_token_permissions(self): + workflow = ( + REPO_ROOT / ".github" / "workflows" / "build-abk-desktop.yml" + ).read_text(encoding="utf-8") + + self.assertIn("permissions:\n contents: read", workflow) + def assert_inputs_supported(self, workflow_name, inputs): declared = workflow_dispatch_inputs( REPO_ROOT / ".github" / "workflows" / workflow_name diff --git a/desktop/Cargo.lock b/desktop/Cargo.lock new file mode 100644 index 000000000..b3bd9b8ef --- /dev/null +++ b/desktop/Cargo.lock @@ -0,0 +1,1527 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "abk-desktop" +version = "0.1.0" +dependencies = [ + "anyhow", + "axum", + "futures-util", + "libc", + "mime_guess", + "reqwest", + "serde", + "serde_json", + "shell-words", + "tokio", + "tower-http", + "urlencoding", + "uuid", +] + +[[package]] +name = "anyhow" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3" + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "axum" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31b698c5f9a010f6573133b09e0de5408834d0c82f8d7475a89fc1867a71cd90" +dependencies = [ + "axum-core", + "bytes", + "form_urlencoded", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "serde_core", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "sync_wrapper", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bitflags" +version = "2.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" + +[[package]] +name = "bumpalo" +version = "3.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" + +[[package]] +name = "bytes" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" + +[[package]] +name = "cc" +version = "1.2.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17dd265a7d0f31ef544e1b20e03add05d3b45b491b633b10d67145d2acc1a38" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chacha20" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d524456ba66e72eb8b115ff89e01e497f8e6d11d78b70b1aa13c0fbd97540a81" +dependencies = [ + "cfg-if", + "cpufeatures", + "rand_core", +] + +[[package]] +name = "cpufeatures" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" +dependencies = [ + "libc", +] + +[[package]] +name = "displaydoc" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-macro" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi", + "rand_core", + "wasm-bindgen", +] + +[[package]] +name = "http" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55281c53a1894c864990125767da440a4e630446785086f52523b20033b74498" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "tokio", + "tokio-rustls", + "tower-service", + "webpki-roots", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "base64", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "icu_collections" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" + +[[package]] +name = "icu_properties" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" + +[[package]] +name = "icu_provider" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "ipnet" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "js-sys" +version = "0.3.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102" +dependencies = [ + "cfg-if", + "futures-util", + "wasm-bindgen", +] + +[[package]] +name = "libc" +version = "0.2.186" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" + +[[package]] +name = "litemap" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" + +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + +[[package]] +name = "matchit" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "mio" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02bd0af71c67b473010cbbc60715ee815645a4dc942899111f494b4b737d6fda" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "potential_utf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" +dependencies = [ + "zerovec", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quinn" +version = "0.11.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c1a41e437b6bbd489372cd4971de128e85c855f56c57f283d20ff016cf7c0a8" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f4bfc015262b9df63c8845072ce59068853ff5872180c2ce2f13038b970e560" +dependencies = [ + "bytes", + "getrandom 0.4.3", + "lru-slab", + "rand", + "rand_pcg", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35a133f956daabe89a61a685c2649f13d82d5aa4bd5d12d1277e1072a21c0694" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.61.2", +] + +[[package]] +name = "quote" +version = "1.0.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f5fa3a058cd35567ef9bfa5e75732bee0f9e4c55fa90477bef2dfcdbc4be80" +dependencies = [ + "chacha20", + "getrandom 0.4.3", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" + +[[package]] +name = "rand_pcg" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caa0f4137e1c0a72f4c651489402276c8e8e1cf081f3b0ba156d2cbeef09e86a" +dependencies = [ + "rand_core", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "reqwest" +version = "0.12.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" +dependencies = [ + "base64", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-rustls", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "webpki-roots", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustc-hash" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" + +[[package]] +name = "rustls" +version = "0.23.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b92b125634d9b795e7beca796cc790df15a7fb38323bf3196fda83292d06b1f" +dependencies = [ + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "764899a24af3980067ee14bc143654f297b22eaebfe3c7b6b211920a5a59b046" +dependencies = [ + "web-time", + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.150" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" +dependencies = [ + "itoa", + "serde", + "serde_core", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "shell-words" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc6fe69c597f9c37bfeeeeeb33da3530379845f10be461a66d16d03eca2ded77" + +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" + +[[package]] +name = "socket2" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52d1cfed4120b4d927bf7c0f86d2087a4a7d6027c906d9f9d525a80573b9be51" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tinystr" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb4ebadaa0af04fab11ae01eb5f9fdb5f9c5b875506e210e71c07873528baa7f" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" +dependencies = [ + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" +dependencies = [ + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", + "url", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "log", + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "unicase" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.23.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea5fab0d6c3c01ae70085a09cb03d4c7a1d6314e2b3e075392783396d724ca0a" +dependencies = [ + "getrandom 0.4.3", + "js-sys", + "serde_core", + "wasm-bindgen", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c62df1340f32221cb9c54d6a27b030e3dba64361d4a95bed55f9aacb44da291d" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-streams" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8622dcb61c0bcc9fffa6938bed81210af2da9a7e4a1a834b2e37a59b6dfb6141" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf85cb06032201fa7c6f829d7db5a7e5aa45bcc0655327713065f6f0576731bf" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "writeable" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" + +[[package]] +name = "yoke" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerofrom" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" + +[[package]] +name = "zerotrie" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/desktop/Cargo.toml b/desktop/Cargo.toml new file mode 100644 index 000000000..6771efbc8 --- /dev/null +++ b/desktop/Cargo.toml @@ -0,0 +1,33 @@ +[package] +name = "abk-desktop" +version = "0.1.0" +edition = "2021" +default-run = "abk_sidecar" +autobins = false + +[[bin]] +name = "abk_sidecar" +path = "src/main.rs" + +[[bin]] +name = "abk_launcher" +path = "src/launcher.rs" + +[[bin]] +name = "abk-desktop" +path = "src/desktop_entry.rs" + +[dependencies] +anyhow = "1.0" +axum = "0.8" +futures-util = "0.3" +libc = "0.2" +mime_guess = "2.0" +reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls", "stream"] } +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +shell-words = "1.1" +tokio = { version = "1.48", features = ["full"] } +tower-http = { version = "0.6", features = ["cors"] } +urlencoding = "2.1" +uuid = { version = "1.18", features = ["v4", "serde"] } diff --git a/desktop/assets/local_build/init.sh b/desktop/assets/local_build/init.sh new file mode 100755 index 000000000..1a73edfc7 --- /dev/null +++ b/desktop/assets/local_build/init.sh @@ -0,0 +1,600 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +SOURCE_INSTANCE_ID="${ABK_LOCAL_BUILD_SOURCE_INSTANCE_ID:-}" +STATE_DIR="${ABK_LOCAL_BUILD_STATE_DIR:-$ROOT_DIR/.local-build}" +SOURCES_DIR="${ABK_LOCAL_BUILD_SOURCES_DIR:-$STATE_DIR/sources}" +WORKSPACE_DIR="${ABK_LOCAL_BUILD_WORKSPACE_DIR:-$STATE_DIR/workspace}" +ARTIFACTS_DIR="$WORKSPACE_DIR/artifacts" +LOGS_DIR="$WORKSPACE_DIR/logs" +CACHE_DIR="$WORKSPACE_DIR/cache" +KEYS_DIR="$WORKSPACE_DIR/keys" +STATE_DATA_DIR="$WORKSPACE_DIR/state" +ENV_FILE="$STATE_DIR/env.sh" +KERNEL_ROOT="$WORKSPACE_DIR/kernel" + +ABK_SOURCE_LOCAL="$(realpath "${ABK_LOCAL_BUILD_ABK_SOURCE_DIR:-$ROOT_DIR/../abk}")" +ABK_SOURCE="$ABK_SOURCE_LOCAL" +ANYKERNEL3_SOURCE="$SOURCES_DIR/AnyKernel3" +KERNEL_PATCHES_SOURCE="$SOURCES_DIR/kernel_patches" +SUKISU_PATCHES_SOURCE="$SOURCES_DIR/SukiSU_patch" +ACTION_BUILD_SOURCE="$SOURCES_DIR/Action-Build" +SUSFS_SOURCE="$SOURCES_DIR/susfs4ksu" +GCC_SOURCE="$SOURCES_DIR/gcc" +VIRTUALIZATION_SOURCE="$SOURCES_DIR/Droidspaces-OSS" + +ANYKERNEL3_REPO_URL="https://github.com/WildKernels/AnyKernel3.git" +KERNEL_PATCHES_REPO_URL="https://github.com/WildKernels/kernel_patches.git" +SUKISU_PATCHES_REPO_URL="https://github.com/ShirkNeko/SukiSU_patch.git" +ACTION_BUILD_REPO_URL="https://github.com/Numbersf/Action-Build.git" +SUSFS_REPO_URL="https://gitlab.com/simonpunk/susfs4ksu.git" +GCC_REPO_URL="https://github.com/LineageOS/android_prebuilts_gcc_linux-x86_aarch64_aarch64-linux-gnu-6.4.1.git" +VIRTUALIZATION_REPO_URL="https://github.com/ravindu644/Droidspaces-OSS.git" + +FORCE=0 +SKIP_DEPS=0 +SELECTED_ANDROID_VERSION="" +SELECTED_KERNEL_VERSION="" +SELECTED_BRANCH_MONTH="" +TEMPLATE_ROOT="${ABK_LOCAL_BUILD_TEMPLATE_ROOT:-}" + +usage() { + cat <<'EOF' +Usage: ./init.sh --android --kernel <6.1|6.6|6.12> --branch-month [--force] [--skip-deps] + + --android Android ACK line, for example: android14, android15. + --kernel Kernel version line, for example: 6.1, 6.6, 6.12. + --branch-month Patch month appended to the ACK branch, for example: 2025-05. + --force Recreate .local-build workspace from scratch. + --skip-deps Do not clone or update dependency repositories. +EOF +} + +log_info() { + printf '[init] %s\n' "$*" +} + +log_warn() { + printf '[init][warn] %s\n' "$*" >&2 +} + +log_error() { + printf '[init][error] %s\n' "$*" >&2 + exit 1 +} + +require_dir() { + local path="$1" + [[ -d "$path" ]] || log_error "missing directory: $path" +} + +require_file() { + local path="$1" + [[ -f "$path" ]] || log_error "missing file: $path" +} + +clone_or_update() { + local url="$1" + local dest="$2" + local branch="${3:-}" + + mkdir -p "$(dirname "$dest")" + + if [[ ! -d "$dest/.git" ]]; then + rm -rf "$dest" + if [[ -n "$branch" ]]; then + git clone --depth 1 -b "$branch" "$url" "$dest" + else + git clone --depth 1 "$url" "$dest" + fi + return 0 + fi + + git -C "$dest" remote set-url origin "$url" + if [[ -n "$branch" ]]; then + git -C "$dest" fetch --depth 1 origin "$branch" + git -C "$dest" checkout -B "$branch" FETCH_HEAD + else + git -C "$dest" fetch --depth 1 origin + git -C "$dest" reset --hard FETCH_HEAD + fi +} + +parse_args() { + while (($# > 0)); do + case "$1" in + --android) + shift + (($# > 0)) || log_error "--android requires a value" + SELECTED_ANDROID_VERSION="$1" + ;; + --kernel) + shift + (($# > 0)) || log_error "--kernel requires a value" + SELECTED_KERNEL_VERSION="$1" + ;; + --branch-month) + shift + (($# > 0)) || log_error "--branch-month requires a value" + SELECTED_BRANCH_MONTH="$1" + ;; + --force) + FORCE=1 + ;; + --skip-deps) + SKIP_DEPS=1 + ;; + -h|--help) + usage + exit 0 + ;; + *) + log_error "unknown argument: $1" + ;; + esac + shift + done +} + +validate_selection() { + [[ -n "$SELECTED_ANDROID_VERSION" ]] || log_error "--android is required" + [[ -n "$SELECTED_KERNEL_VERSION" ]] || log_error "--kernel is required" + [[ -n "$SELECTED_BRANCH_MONTH" ]] || log_error "--branch-month is required" + + [[ "$SELECTED_ANDROID_VERSION" =~ ^android[0-9]+$ ]] || \ + log_error "unsupported --android value: $SELECTED_ANDROID_VERSION" + [[ "$SELECTED_KERNEL_VERSION" =~ ^[0-9]+\.[0-9]+$ ]] || \ + log_error "unsupported --kernel value: $SELECTED_KERNEL_VERSION" + [[ "$SELECTED_BRANCH_MONTH" =~ ^[0-9]{4}-[0-9]{2}$ ]] || \ + log_error "unsupported --branch-month value: $SELECTED_BRANCH_MONTH (expected YYYY-MM)" +} + +resolve_template_root() { + local android_suffix candidate + + case "${1}:${2}" in + android14:6.1) printf '%s\n' "$ROOT_DIR/AOSP_Kernel_A14_6.1" ;; + android15:6.6) printf '%s\n' "$ROOT_DIR/AOSP_Kernel_A15_6.6" ;; + *) + android_suffix="${1#android}" + candidate="$ROOT_DIR/AOSP_Kernel_A${android_suffix}_${2}" + printf '%s\n' "$candidate" + ;; + esac +} + +manifest_branch_for() { + printf 'common-%s-%s-%s\n' "$1" "$2" "$3" +} + +susfs_branch_for() { + printf 'gki-%s-%s\n' "$1" "$2" +} + +read_manifest_common_revision() { + local manifest="$1" + sed -n 's#.*path="common".*revision="\([^"]*\)".*#\1#p' "$manifest" | head -n 1 +} + +read_template_patch_level() { + local revision + revision="$(read_manifest_common_revision "$TEMPLATE_ROOT/.repo/manifests/default.xml")" + [[ "$revision" =~ ([0-9]{4}-[0-9]{2})$ ]] || \ + log_error "failed to derive template patch level from $TEMPLATE_ROOT/.repo/manifests/default.xml" + printf '%s\n' "${BASH_REMATCH[1]}" +} + +read_template_sublevel() { + local value + value="$(awk '/^SUBLEVEL = / {print $3}' "$TEMPLATE_ROOT/common/Makefile")" + [[ -n "$value" ]] || log_error "failed to derive template sublevel from $TEMPLATE_ROOT/common/Makefile" + printf '%s\n' "$value" +} + +clean_bazel_artifacts() { + local root="$1" + + rm -rf "$root/out" \ + "$root/bazel-bin" \ + "$root/bazel-out" \ + "$root/bazel-testlogs" + + find "$root" -mindepth 1 -maxdepth 1 -type d -name 'bazel-*' -exec rm -rf {} + 2>/dev/null || true +} + +git_remote_branch_exists() { + local repo_dir="$1" + local remote_name="$2" + local branch_name="$3" + local remote_url + + if git -C "$repo_dir" show-ref --verify --quiet "refs/remotes/$remote_name/$branch_name"; then + return 0 + fi + + remote_url="$(git -C "$repo_dir" remote get-url "$remote_name" 2>/dev/null || true)" + [[ -n "$remote_url" ]] || return 1 + git ls-remote "$remote_url" "refs/heads/$branch_name" 2>/dev/null | grep -Fq "refs/heads/$branch_name" +} + +resolve_common_branch() { + local branch_base="$1-$2-$3" + local common_remote_url="https://android.googlesource.com/kernel/common" + + if [[ -d "$TEMPLATE_ROOT/common/.git" ]] && git_remote_branch_exists "$TEMPLATE_ROOT/common" "aosp" "$branch_base"; then + printf '%s\n' "$branch_base" + return 0 + fi + + if [[ -d "$TEMPLATE_ROOT/common/.git" ]] && git_remote_branch_exists "$TEMPLATE_ROOT/common" "aosp" "deprecated/$branch_base"; then + printf 'deprecated/%s\n' "$branch_base" + return 0 + fi + + if git ls-remote "$common_remote_url" "refs/heads/$branch_base" 2>/dev/null | grep -Fq "refs/heads/$branch_base"; then + printf '%s\n' "$branch_base" + return 0 + fi + + if git ls-remote "$common_remote_url" "refs/heads/deprecated/$branch_base" 2>/dev/null | grep -Fq "refs/heads/deprecated/$branch_base"; then + printf 'deprecated/%s\n' "$branch_base" + return 0 + fi + + log_error "no kernel/common branch matched $branch_base on $common_remote_url" +} + +ensure_repo_launcher() { + local repo_tool="$1" + + if [[ -x "$repo_tool" ]]; then + return 0 + fi + + mkdir -p "$(dirname "$repo_tool")" + log_info "downloading repo launcher to $repo_tool" + curl -fsSL "https://storage.googleapis.com/git-repo-downloads/repo" -o "$repo_tool" + chmod 0755 "$repo_tool" +} + +bootstrap_template_checkout() { + local manifest_branch="$1" + local repo_tool="$TEMPLATE_ROOT/.repo/repo/repo" + local bootstrap_repo_tool="$STATE_DIR/bin/repo" + + if [[ -d "$TEMPLATE_ROOT/.repo/manifests" && -f "$repo_tool" ]]; then + return 0 + fi + + log_info "bootstrapping template checkout in $(basename "$TEMPLATE_ROOT") from Google source" + mkdir -p "$TEMPLATE_ROOT" + ensure_repo_launcher "$bootstrap_repo_tool" + if [[ ! -d "$TEMPLATE_ROOT/.repo/manifests" ]]; then + rm -rf "$TEMPLATE_ROOT/.repo/repo" "$TEMPLATE_ROOT/.repo/repo.tmp" + fi + ( + cd "$TEMPLATE_ROOT" + "$bootstrap_repo_tool" init --depth=1 \ + -u "https://android.googlesource.com/kernel/manifest" \ + -b "$manifest_branch" \ + --repo-rev=v2.16 \ + --quiet + ) +} + +repair_manifest_checkout() { + local manifest_repo="$1" + local manifest_branch="$2" + local needs_repair=0 + + if ! git -C "$manifest_repo" rev-parse --verify HEAD >/dev/null 2>&1; then + needs_repair=1 + fi + + if [[ -n "$(git -C "$manifest_repo" status --porcelain 2>/dev/null || true)" ]]; then + needs_repair=1 + fi + + if (( needs_repair == 0 )); then + return 0 + fi + + log_warn "repairing template manifest checkout in $manifest_repo" + git -C "$manifest_repo" fetch --depth 1 origin "$manifest_branch" + git -C "$manifest_repo" checkout -B default -f "refs/remotes/origin/$manifest_branch" + git -C "$manifest_repo" reset --hard "refs/remotes/origin/$manifest_branch" + git -C "$manifest_repo" clean -fd +} + +rewrite_template_manifest() { + local manifest_file="$1" + local manifest_branch="$2" + local common_branch="$3" + + python3 - "$manifest_file" "$manifest_branch" "$common_branch" <<'PY' +import sys +import xml.etree.ElementTree as ET + +manifest_file, manifest_branch, common_branch = sys.argv[1:] +tree = ET.parse(manifest_file) +root = tree.getroot() + +found_superproject = False +found_common = False + +for superproject in root.findall("superproject"): + if superproject.get("name") == "kernel/superproject": + superproject.set("revision", manifest_branch) + found_superproject = True + +for project in root.findall("project"): + if project.get("name") == "kernel/superproject": + project.set("revision", manifest_branch) + found_superproject = True + if project.get("name") == "kernel/common" and project.get("path") == "common": + project.set("revision", common_branch) + project.set("upstream", common_branch) + project.set("dest-branch", common_branch) + found_common = True + +if not found_superproject: + raise SystemExit(f"missing kernel/superproject entry in {manifest_file}") +if not found_common: + raise SystemExit(f"missing kernel/common entry in {manifest_file}") + +tree.write(manifest_file, encoding="UTF-8", xml_declaration=True) +PY +} + +sync_template_branch() { + local repo_tool manifest_repo manifest_url manifest_branch common_branch actual_common_branch + + manifest_branch="$(manifest_branch_for "$SELECTED_ANDROID_VERSION" "$SELECTED_KERNEL_VERSION" "$SELECTED_BRANCH_MONTH")" + bootstrap_template_checkout "$manifest_branch" + repo_tool="$TEMPLATE_ROOT/.repo/repo/repo" + manifest_repo="$TEMPLATE_ROOT/.repo/manifests" + + require_file "$repo_tool" + require_dir "$manifest_repo" + + manifest_url="$(git -C "$manifest_repo" remote get-url origin 2>/dev/null || true)" + [[ -n "$manifest_url" ]] || manifest_url="https://android.googlesource.com/kernel/manifest" + + common_branch="$(resolve_common_branch "$SELECTED_ANDROID_VERSION" "$SELECTED_KERNEL_VERSION" "$SELECTED_BRANCH_MONTH")" + repair_manifest_checkout "$manifest_repo" "$manifest_branch" + + log_info "syncing template $(basename "$TEMPLATE_ROOT") to $manifest_branch" + ( + cd "$TEMPLATE_ROOT" + "$repo_tool" init -u "$manifest_url" -b "$manifest_branch" -m default.xml --quiet + rewrite_template_manifest "$TEMPLATE_ROOT/.repo/manifests/default.xml" "$manifest_branch" "$common_branch" + "$repo_tool" sync -c -j4 --force-sync --no-clone-bundle --no-tags + ) + + actual_common_branch="$(read_manifest_common_revision "$TEMPLATE_ROOT/.repo/manifests/default.xml")" + [[ "$actual_common_branch" == "$common_branch" ]] || \ + log_error "template manifest mismatch after sync: expected common revision $common_branch, got $actual_common_branch" +} + +seed_workspace() { + log_info "seeding workspace from local template $(basename "$TEMPLATE_ROOT")" + + rm -rf "$KERNEL_ROOT" + mkdir -p "$WORKSPACE_DIR" + + rsync -a --delete \ + --exclude='out/' \ + --exclude='bazel-bin/' \ + --exclude='bazel-out/' \ + --exclude='bazel-testlogs/' \ + --exclude='bazel-*/' \ + "$TEMPLATE_ROOT"/ \ + "$KERNEL_ROOT"/ + + clean_bazel_artifacts "$KERNEL_ROOT" + + if [[ -d "$GCC_SOURCE" ]]; then + rm -rf "$KERNEL_ROOT/gcc" + rsync -a --delete "$GCC_SOURCE"/ "$KERNEL_ROOT/gcc"/ + fi + + mkdir -p "$ARTIFACTS_DIR" "$LOGS_DIR" "$CACHE_DIR" "$KEYS_DIR" "$STATE_DATA_DIR" +} + +write_env_file() { + local template_sublevel="$1" + local template_patch_level="$2" + local template_branch template_common_branch boot_sign_key_path + + template_branch="$(manifest_branch_for "$SELECTED_ANDROID_VERSION" "$SELECTED_KERNEL_VERSION" "$template_patch_level")" + template_common_branch="$(read_manifest_common_revision "$TEMPLATE_ROOT/.repo/manifests/default.xml")" + boot_sign_key_path="$KEYS_DIR/boot_sign_key.pem" + + cat >"$ENV_FILE" <"$key_path" + fi +} + +prepare_dependencies() { + local susfs_branch + + log_info "syncing clean dependency sources" + require_dir "$ABK_SOURCE" + require_dir "$ABK_SOURCE" + require_file "$ABK_SOURCE/cli/abk.py" + require_file "$ABK_SOURCE/hmbird_patch.c" + require_file "$ABK_SOURCE/zram/apply_lz4_neon.sh" + require_file "$ABK_SOURCE/ddk/setup.sh" + + susfs_branch="$(susfs_branch_for "$SELECTED_ANDROID_VERSION" "$SELECTED_KERNEL_VERSION")" + clone_or_update "$ANYKERNEL3_REPO_URL" "$ANYKERNEL3_SOURCE" "gki-2.0" + clone_or_update "$KERNEL_PATCHES_REPO_URL" "$KERNEL_PATCHES_SOURCE" + clone_or_update "$SUKISU_PATCHES_REPO_URL" "$SUKISU_PATCHES_SOURCE" + clone_or_update "$ACTION_BUILD_REPO_URL" "$ACTION_BUILD_SOURCE" + clone_or_update "$SUSFS_REPO_URL" "$SUSFS_SOURCE" "$susfs_branch" + clone_or_update "$GCC_REPO_URL" "$GCC_SOURCE" + clone_or_update "$VIRTUALIZATION_REPO_URL" "$VIRTUALIZATION_SOURCE" +} + +resolve_template_selection() { + validate_selection + if [[ -z "$TEMPLATE_ROOT" ]]; then + TEMPLATE_ROOT="$(resolve_template_root "$SELECTED_ANDROID_VERSION" "$SELECTED_KERNEL_VERSION")" + fi +} + +main() { + local template_sublevel template_patch_level manifest_branch + + parse_args "$@" + resolve_template_selection + manifest_branch="$(manifest_branch_for "$SELECTED_ANDROID_VERSION" "$SELECTED_KERNEL_VERSION" "$SELECTED_BRANCH_MONTH")" + bootstrap_template_checkout "$manifest_branch" + + require_dir "$TEMPLATE_ROOT" + require_dir "$TEMPLATE_ROOT/.repo" + + if [[ -e "$ENV_FILE" || -d "$KERNEL_ROOT" ]]; then + if (( FORCE == 0 )); then + log_error "environment already exists. Re-run with --force to recreate it." + fi + log_warn "recreating existing local build environment" + rm -rf "$STATE_DIR" + fi + + mkdir -p "$SOURCES_DIR" "$WORKSPACE_DIR" "$ARTIFACTS_DIR" "$LOGS_DIR" "$CACHE_DIR" "$KEYS_DIR" "$STATE_DATA_DIR" + + sync_template_branch + + require_dir "$TEMPLATE_ROOT/common" + require_file "$TEMPLATE_ROOT/common/arch/arm64/configs/gki_defconfig" + require_file "$TEMPLATE_ROOT/build/kernel/kleaf/impl/stamp.bzl" + require_file "$TEMPLATE_ROOT/prebuilts/kernel-build-tools/linux-x86/bin/avbtool" + require_file "$TEMPLATE_ROOT/tools/mkbootimg/mkbootimg.py" + + if (( SKIP_DEPS == 0 )); then + prepare_dependencies + else + require_dir "$ABK_SOURCE" + require_dir "$ANYKERNEL3_SOURCE" + require_dir "$KERNEL_PATCHES_SOURCE" + require_dir "$SUKISU_PATCHES_SOURCE" + require_dir "$ACTION_BUILD_SOURCE" + require_dir "$SUSFS_SOURCE" + require_dir "$GCC_SOURCE" + require_dir "$VIRTUALIZATION_SOURCE" + fi + + seed_workspace + + template_sublevel="$(read_template_sublevel)" + template_patch_level="$(read_template_patch_level)" + + prepare_key + write_env_file "$template_sublevel" "$template_patch_level" + + log_info "environment initialized" + if [[ -n "$SOURCE_INSTANCE_ID" ]]; then + log_info "source instance: $SOURCE_INSTANCE_ID" + fi + log_info "template: $(basename "$TEMPLATE_ROOT")" + log_info "branch: $(manifest_branch_for "$SELECTED_ANDROID_VERSION" "$SELECTED_KERNEL_VERSION" "$SELECTED_BRANCH_MONTH")" + log_info "edit $ENV_FILE if you need to change build knobs" + log_info "then run ./rebuild.sh" +} + +main "$@" diff --git a/desktop/assets/local_build/rebuild.sh b/desktop/assets/local_build/rebuild.sh new file mode 100755 index 000000000..11f90e2d3 --- /dev/null +++ b/desktop/assets/local_build/rebuild.sh @@ -0,0 +1,1747 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +STATE_DIR="${ABK_LOCAL_BUILD_STATE_DIR:-$ROOT_DIR/.local-build}" +ENV_FILE="$STATE_DIR/env.sh" +export ABK_LOCAL_BUILD_WORKSPACE_DIR="${ABK_LOCAL_BUILD_WORKSPACE_DIR:-}" + +CLEAN_OUT=0 +RESEED=0 +NO_PACKAGE=0 +PRINT_ENV=0 + +usage() { + cat <<'EOF' +Usage: ./rebuild.sh [--clean-out] [--reseed] [--no-package] [--print-env] + + --clean-out Remove build outputs before compiling. + --reseed Reset the workspace in place back to the template baseline. + --no-package Stop after kernel build, skip AnyKernel3 and boot image packaging. + --print-env Print loaded environment and exit. +EOF +} + +log_info() { + printf '[rebuild] %s\n' "$*" +} + +log_warn() { + printf '[rebuild][warn] %s\n' "$*" >&2 +} + +log_error() { + printf '[rebuild][error] %s\n' "$*" >&2 + exit 1 +} + +require_dir() { + local path="$1" + [[ -d "$path" ]] || log_error "missing directory: $path" +} + +require_file() { + local path="$1" + [[ -f "$path" ]] || log_error "missing file: $path" +} + +read_shell_kv() { + local file="$1" + local key="$2" + + [[ -f "$file" ]] || return 0 + awk -F= -v target="$key" ' + /^[[:space:]]*#/ { next } + $1 == target { + value = substr($0, index($0, "=") + 1) + gsub(/^[[:space:]\042\047]+|[[:space:]\042\047]+$/, "", value) + print value + exit + } + ' "$file" +} + +bool_is_true() { + case "${1,,}" in + 1|true|yes|on) return 0 ;; + *) return 1 ;; + esac +} + +normalize_variant() { + case "${1,,}" in + none) printf 'None\n' ;; + official) printf 'Official\n' ;; + sukisu) printf 'SukiSU\n' ;; + resukisu) printf 'ReSukiSU\n' ;; + *) log_error "unsupported KSU_VARIANT: $1" ;; + esac +} + +normalize_track() { + case "${1,,}" in + stable|"stable(标准)") printf 'Stable(标准)\n' ;; + dev|"dev(开发)") printf 'Dev(开发)\n' ;; + custom|"custom(自定义)") printf 'Custom(自定义)\n' ;; + latest|"latest(最新)") + log_error "KSU_TRACK=Latest(最新) is not supported in local rebuild.sh. Use Stable(标准), Dev(开发), or Custom(自定义)." + ;; + *) log_error "unsupported KSU_TRACK: $1" ;; + esac +} + +parse_args() { + while (($# > 0)); do + case "$1" in + --clean-out) + CLEAN_OUT=1 + ;; + --reseed) + RESEED=1 + ;; + --no-package) + NO_PACKAGE=1 + ;; + --print-env) + PRINT_ENV=1 + ;; + -h|--help) + usage + exit 0 + ;; + *) + log_error "unknown argument: $1" + ;; + esac + shift + done +} + +source_env() { + [[ -f "$ENV_FILE" ]] || log_error "missing $ENV_FILE. Run ./init.sh first." + # shellcheck disable=SC1090 + source "$ENV_FILE" + : "${TEMPLATE_NAME:=$(basename "$TEMPLATE_ROOT")}" + : "${TEMPLATE_BRANCH:=unknown}" + : "${TEMPLATE_COMMON_BRANCH:=unknown}" + : "${USE_CUSTOM_EXTERNAL_MODULES:=false}" + : "${CUSTOM_EXTERNAL_MODULES:=}" + : "${CUSTOM_EXTERNAL_MODULES_MANIFEST:=$STATE_DATA_DIR/custom_external_modules.tsv}" + : "${CUSTOM_EXTERNAL_MODULES_ROOT:=$WORKSPACE_DIR/custom_modules}" + : "${VIRTUALIZATION_SUPPORT:=off}" + : "${VIRTUALIZATION_SOURCE:=$SOURCES_DIR/Droidspaces-OSS}" + : "${VIRTUALIZATION_SUPPORT_PATCHES:=$VIRTUALIZATION_SOURCE/Documentation/resources/kernel-patches/GKI}" + : "${REVISION:=r1}" + : "${ABK_MANAGER_CERT_ENV_FILE:=$ABK_SOURCE/app/signing/abk-manager-cert.env}" + : "${ABK_MANAGER_PACKAGE:=$(read_shell_kv "$ABK_MANAGER_CERT_ENV_FILE" ABK_MANAGER_PACKAGE)}" + : "${ABK_MANAGER_CERT_SIZE:=$(read_shell_kv "$ABK_MANAGER_CERT_ENV_FILE" ABK_MANAGER_CERT_SIZE)}" + : "${ABK_MANAGER_CERT_SHA256:=$(read_shell_kv "$ABK_MANAGER_CERT_ENV_FILE" ABK_MANAGER_CERT_SHA256)}" + : "${ABK_MANAGER_PACKAGE:=com.abk.kernel}" + : "${ABK_MANAGER_CERT_SIZE:=1407}" + : "${ABK_MANAGER_CERT_SHA256:=34e5e843952277759603cd0f949770b24c868530d80d7baeff08776a7e132b16}" +} + +setup_logging() { + mkdir -p "$LOGS_DIR" + BUILD_LOG="$LOGS_DIR/rebuild-$(date -u +%Y%m%d-%H%M%S).log" + exec > >(tee -a "$BUILD_LOG") 2>&1 + log_info "logging to $BUILD_LOG" +} + +assert_supported_template() { + [[ "$ANDROID_VERSION" == "$TEMPLATE_ANDROID_VERSION" ]] || log_error "ANDROID_VERSION=$ANDROID_VERSION does not match template $TEMPLATE_ANDROID_VERSION" + [[ "$KERNEL_VERSION" == "$TEMPLATE_KERNEL_VERSION" ]] || log_error "KERNEL_VERSION=$KERNEL_VERSION does not match template $TEMPLATE_KERNEL_VERSION" + [[ "$SUB_LEVEL" == "$TEMPLATE_SUB_LEVEL" ]] || log_error "SUB_LEVEL=$SUB_LEVEL does not match template $TEMPLATE_SUB_LEVEL" + [[ "$OS_PATCH_LEVEL" == "$TEMPLATE_OS_PATCH_LEVEL" ]] || log_error "OS_PATCH_LEVEL=$OS_PATCH_LEVEL does not match template $TEMPLATE_OS_PATCH_LEVEL" +} + +clean_bazel_artifacts() { + local root="$1" + + rm -rf "$root/out" \ + "$root/bazel-bin" \ + "$root/bazel-out" \ + "$root/bazel-testlogs" + + find "$root" -mindepth 1 -maxdepth 1 -type d -name 'bazel-*' -exec rm -rf {} + 2>/dev/null || true +} + +ensure_layout() { + require_dir "$TEMPLATE_ROOT" + require_dir "$SOURCES_DIR" + require_dir "$ABK_SOURCE" + require_dir "$ANYKERNEL3_SOURCE" + require_dir "$KERNEL_PATCHES_SOURCE" + require_dir "$SUKISU_PATCHES_SOURCE" + require_dir "$ACTION_BUILD_SOURCE" + require_dir "$GCC_SOURCE" + if [[ "${VIRTUALIZATION_SUPPORT:-off}" != "off" ]]; then + require_dir "$VIRTUALIZATION_SOURCE" + fi + + if [[ ! -d "$KERNEL_ROOT" ]]; then + (( RESEED == 1 )) || log_error "missing $KERNEL_ROOT. Run ./init.sh again or use --reseed." + return 0 + fi + + require_dir "$KERNEL_ROOT" + require_file "$DEFCONFIG" + require_file "$KERNEL_ROOT/build/kernel/kleaf/impl/stamp.bzl" + require_file "$AVBTOOL" + require_file "$MKBOOTIMG" + require_file "$UNPACK_BOOTIMG" + require_file "$BOOT_SIGN_KEY_PATH" + mkdir -p "$ARTIFACTS_DIR" "$CACHE_DIR" "$STATE_DATA_DIR" +} + +seed_workspace() { + log_info "re-seeding workspace from template" + + rm -rf "$KERNEL_ROOT" + mkdir -p "$WORKSPACE_DIR" + + rsync -a --delete \ + --exclude='out/' \ + --exclude='bazel-bin/' \ + --exclude='bazel-out/' \ + --exclude='bazel-testlogs/' \ + --exclude='bazel-*/' \ + "$TEMPLATE_ROOT"/ \ + "$KERNEL_ROOT"/ + + clean_bazel_artifacts "$KERNEL_ROOT" + + rm -rf "$KERNEL_ROOT/gcc" + rsync -a --delete "$GCC_SOURCE"/ "$KERNEL_ROOT/gcc"/ + + rm -f "$STATE_DATA_DIR/profile.env" + rm -f "$STATE_DATA_DIR/current-profile.env" +} + +reset_workspace_state() { + local repo_tool="$KERNEL_ROOT/.repo/repo/repo" + local project_list="$KERNEL_ROOT/.repo/project.list" + local -a missing_projects=() + + log_info "resetting workspace repositories in place" + + require_file "$repo_tool" + require_file "$project_list" + + if [[ -d "$KERNEL_ROOT/KernelSU" ]]; then + rm -rf "$KERNEL_ROOT/KernelSU" + fi + if [[ -d "$KERNEL_ROOT/Baseband-guard" ]]; then + rm -rf "$KERNEL_ROOT/Baseband-guard" + fi + if [[ -d "$KERNEL_ROOT/gcc" ]]; then + rm -rf "$KERNEL_ROOT/gcc" + fi + if [[ -d "$CUSTOM_EXTERNAL_MODULES_ROOT" ]]; then + rm -rf "$CUSTOM_EXTERNAL_MODULES_ROOT" + fi + rm -rf "$WORKSPACE_DIR/staging" + rm -f "$CUSTOM_EXTERNAL_MODULES_MANIFEST" + + while IFS= read -r rel_path; do + [[ -n "$rel_path" ]] || continue + if [[ -d "$KERNEL_ROOT/$rel_path/.git" || -L "$KERNEL_ROOT/$rel_path/.git" ]]; then + git -C "$KERNEL_ROOT/$rel_path" reset --hard HEAD >/dev/null + git -C "$KERNEL_ROOT/$rel_path" clean -fdx >/dev/null + else + missing_projects+=("$rel_path") + fi + done <"$project_list" + + if ((${#missing_projects[@]} > 0)); then + log_info "restoring missing repo projects (${#missing_projects[@]})" + ( + cd "$KERNEL_ROOT" + "$repo_tool" sync -c -j4 --force-sync --no-clone-bundle --no-tags "${missing_projects[@]}" + ) + fi + + rsync -a --delete "$GCC_SOURCE"/ "$KERNEL_ROOT/gcc"/ + + clean_bazel_artifacts "$KERNEL_ROOT" + mkdir -p "$ARTIFACTS_DIR" "$CACHE_DIR" "$STATE_DATA_DIR" + rm -f "$STATE_DATA_DIR/profile.env" "$STATE_DATA_DIR/current-profile.env" +} + +clean_outputs() { + log_info "cleaning build outputs" + clean_bazel_artifacts "$KERNEL_ROOT" + rm -rf "$ARTIFACTS_DIR"/* + mkdir -p "$ARTIFACTS_DIR" "$CACHE_DIR" +} + +resolve_ksu_ref() { + local variant track + variant="$(normalize_variant "$KSU_VARIANT")" + track="$(normalize_track "$KSU_TRACK")" + + case "$variant:$track" in + Official:'Stable(标准)') printf '%s\n' '3f388ef137c78e1ca0c92c0ada3b8717cdcc4302' ;; + Official:'Dev(开发)') printf '%s\n' '290609c945728fc93d85735918793567588103c1' ;; + SukiSU:'Stable(标准)') printf '%s\n' 'c5af9eadac43b1f0b9751471be78e6eef681554b' ;; + SukiSU:'Dev(开发)') printf '%s\n' 'aac170bcb86ce45516b3e2c0e2b32b57004b8f73' ;; + ReSukiSU:'Stable(标准)') printf '%s\n' 'b6706363b95525acd4007da19edadb1d41b2ea27' ;; + ReSukiSU:'Dev(开发)') printf '%s\n' 'fb771414f249ab886c09f2cfcbbf91c4b4dab2d1' ;; + None:'Stable(标准)'|None:'Dev(开发)'|None:'Custom(自定义)') printf '%s\n' '' ;; + *:'Custom(自定义)') + [[ -n "$KSU_CUSTOM_REF" ]] || log_error "KSU_CUSTOM_REF must be set when KSU_TRACK=Custom(自定义)" + printf '%s\n' "$KSU_CUSTOM_REF" + ;; + *) + log_error "unsupported KSU variant/track combination: $variant / $track" + ;; + esac +} + +resolve_ksu_setup_url() { + local variant + variant="$(normalize_variant "$KSU_VARIANT")" + case "$variant" in + Official) printf '%s\n' 'https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh' ;; + SukiSU) printf '%s\n' 'https://raw.githubusercontent.com/SukiSU-Ultra/SukiSU-Ultra/main/kernel/setup.sh' ;; + ReSukiSU) printf '%s\n' 'https://raw.githubusercontent.com/ReSukiSU/ReSukiSU/main/kernel/setup.sh' ;; + None) printf '%s\n' '' ;; + *) log_error "unsupported KSU_VARIANT: $variant" ;; + esac +} + +resolve_ksu_repo_url() { + local variant + variant="$(normalize_variant "$KSU_VARIANT")" + case "$variant" in + Official) printf '%s\n' 'https://github.com/tiann/KernelSU.git' ;; + SukiSU) printf '%s\n' 'https://github.com/SukiSU-Ultra/SukiSU-Ultra.git' ;; + ReSukiSU) printf '%s\n' 'https://github.com/ReSukiSU/ReSukiSU.git' ;; + None) printf '%s\n' '' ;; + *) log_error "unsupported KSU_VARIANT: $variant" ;; + esac +} + +render_profile_snapshot() { + cat >"$STATE_DATA_DIR/current-profile.env" <>"$DEFCONFIG" + fi +} + +disable_defconfig_symbol() { + local cfg="$1" + local line="# ${cfg} is not set" + + if grep -qxF "$line" "$DEFCONFIG"; then + return 0 + fi + + if grep -Eq "^${cfg}=|^# ${cfg} is not set$" "$DEFCONFIG"; then + sed -i -E "s|^${cfg}=.*|${line}|; s|^# ${cfg} is not set$|${line}|" "$DEFCONFIG" + else + printf '%s\n' "$line" >>"$DEFCONFIG" + fi +} + +ensure_line_once() { + local file="$1" + local line="$2" + grep -qF "$line" "$file" || printf '%s\n' "$line" >>"$file" +} + +remove_line_if_present() { + local file="$1" + local line="$2" + grep -qF "$line" "$file" || return 0 + python3 - "$file" "$line" <<'PY' +from pathlib import Path +import sys + +path = Path(sys.argv[1]) +line = sys.argv[2] +lines = path.read_text().splitlines() +path.write_text("\n".join([l for l in lines if l != line]) + "\n") +PY +} + +trim_value() { + local value="$1" + value="${value#"${value%%[![:space:]]*}"}" + value="${value%"${value##*[![:space:]]}"}" + printf '%s\n' "$value" +} + +patch_kallsyms_filters() { + local path="$KERNEL_ROOT/common/scripts/kallsyms.c" + require_file "$path" + + python3 - "$path" <<'PY' +import pathlib +import sys + +path = pathlib.Path(sys.argv[1]) +text = path.read_text() +needle = '\t\t".plt_branch.",\t\t/* ppc stub */\n' +insert = needle + '\t\t"__kcfi_typeid_",\t/* CFI type identifiers, including namespaced */\n' +if '"__kcfi_typeid_",\t/* CFI type identifiers, including namespaced */' not in text and needle in text: + text = text.replace(needle, insert, 1) + path.write_text(text) +PY +} + +zram_uses_backend_objects() { + local zram_kconfig="$KERNEL_ROOT/common/drivers/block/zram/Kconfig" + [[ -f "$zram_kconfig" ]] && grep -q '^config ZRAM_BACKEND_ZSTDP$' "$zram_kconfig" +} + +enable_zstdp_config() { + ensure_defconfig_value CONFIG_CRYPTO_ZSTDP y + disable_defconfig_symbol CONFIG_ZRAM_DEF_COMP_ZSTDP + + if zram_uses_backend_objects; then + ensure_defconfig_value CONFIG_ZRAM_BACKEND_ZSTDP y + fi +} + +normalize_custom_stage() { + local raw stage + raw="$1" + stage="$(printf '%s' "$raw" | tr '[:upper:] -' '[:lower:]__')" + case "$stage" in + after_patch) printf '%s\n' "after_patch" ;; + before_build|befor_build) printf '%s\n' "before_build" ;; + *) return 1 ;; + esac +} + +read_actual_sublevel() { + local value + value="$(awk '/^SUBLEVEL = / {print $3}' "$KERNEL_ROOT/common/Makefile" 2>/dev/null || true)" + printf '%s\n' "${value:-$SUB_LEVEL}" +} + +prepare_custom_external_modules() { + local modules_input manifest root index block lhs repo_url stage_raw stage source_type source_path module_name module_dir + local entry_kind group_repo_url child_id descriptor + + bool_is_true "$USE_CUSTOM_EXTERNAL_MODULES" || { + rm -f "$CUSTOM_EXTERNAL_MODULES_MANIFEST" + rm -rf "$CUSTOM_EXTERNAL_MODULES_ROOT" + return 0 + } + + modules_input="$(printf '%s' "$CUSTOM_EXTERNAL_MODULES" | tr -d '\r')" + manifest="$CUSTOM_EXTERNAL_MODULES_MANIFEST" + root="$CUSTOM_EXTERNAL_MODULES_ROOT" + + rm -rf "$root" + mkdir -p "$root" "$(dirname "$manifest")" + : >"$manifest" + + if [[ -z "$(trim_value "$modules_input")" ]]; then + log_warn "USE_CUSTOM_EXTERNAL_MODULES=true but CUSTOM_EXTERNAL_MODULES is empty; skipping module preparation" + return 0 + fi + + IFS='|' read -r -a module_blocks <<<"$modules_input" + index=0 + for block in "${module_blocks[@]}"; do + block="$(trim_value "$block")" + [[ -n "$block" ]] || continue + + [[ "$block" == *";"* ]] || log_error "invalid custom module entry (missing ';'): $block" + + lhs="$(trim_value "${block%%;*}")" + stage_raw="$(trim_value "${block#*;}")" + [[ -n "$lhs" && -n "$stage_raw" ]] || log_error "invalid custom module entry: $block" + + if ! stage="$(normalize_custom_stage "$stage_raw")"; then + log_error "unsupported custom module stage: $stage_raw" + fi + + entry_kind="module" + group_repo_url="" + child_id="" + + case "$lhs" in + module:*) + repo_url="$(trim_value "${lhs#module:}")" + ;; + set:*) + descriptor="$(trim_value "${lhs#set:}")" + [[ "$descriptor" == *"#"* ]] || log_error "invalid module-set entry (missing child id): $block" + group_repo_url="$(trim_value "${descriptor%%#*}")" + child_id="$(trim_value "${descriptor#*#}")" + repo_url="$group_repo_url" + entry_kind="module_set_child" + ;; + *) + repo_url="$lhs" + ;; + esac + + [[ -n "$repo_url" ]] || log_error "invalid custom module repo/path: $block" + if [[ "$entry_kind" == "module_set_child" && -z "$child_id" ]]; then + log_error "module-set child id is empty: $block" + fi + + source_type="remote" + source_path="$repo_url" + case "$repo_url" in + http://*|https://*|git://*|ssh://*|git@*) ;; + *) + source_type="local" + if [[ "$repo_url" = /* ]]; then + source_path="$repo_url" + else + source_path="$ROOT_DIR/$repo_url" + fi + [[ -d "$source_path" ]] || log_error "custom module local path does not exist: $source_path" + ;; + esac + + index=$((index + 1)) + module_name="${repo_url##*/}" + module_name="${module_name%.git}" + module_name="$(printf '%s' "$module_name" | sed 's/[^A-Za-z0-9._-]/_/g')" + [[ -n "$module_name" ]] || module_name="module" + module_dir="$root/$(printf '%02d' "$index")-$module_name" + + log_info "preparing custom module #$index ($stage/$entry_kind): $repo_url" + if [[ "$source_type" == "remote" ]]; then + git clone --depth 1 "$source_path" "$module_dir" + else + rsync -a --delete --exclude='.git' "$source_path"/ "$module_dir"/ + fi + + printf '%s\t%s\t%s\t%s\t%s\t%s\n' \ + "$stage" \ + "$module_dir" \ + "$repo_url" \ + "$entry_kind" \ + "$group_repo_url" \ + "$child_id" >>"$manifest" + done + + if [[ ! -s "$manifest" ]]; then + log_warn "no valid custom modules resolved from CUSTOM_EXTERNAL_MODULES" + fi +} + +run_custom_external_modules() { + local stage="$1" + local manifest="$CUSTOM_EXTERNAL_MODULES_MANIFEST" + local executed=0 entry_stage module_dir repo_or_path entry_kind group_repo_url child_id setup_path + local actual_sublevel + + bool_is_true "$USE_CUSTOM_EXTERNAL_MODULES" || return 0 + [[ -s "$manifest" ]] || { + log_info "no custom module manifest found for stage $stage" + return 0 + } + + actual_sublevel="$(read_actual_sublevel)" + + while IFS=$'\t' read -r entry_stage module_dir repo_or_path entry_kind group_repo_url child_id; do + [[ "$entry_stage" == "$stage" ]] || continue + + setup_path="$module_dir/setup.sh" + [[ -f "$setup_path" ]] || log_error "custom module missing setup.sh: $repo_or_path ($module_dir)" + + chmod +x "$setup_path" + log_info "running custom module [$stage]: $repo_or_path" + ( + export CUSTOM_EXTERNAL_MODULE_STAGE="$stage" + export ABK_BUILD_ANDROID_VERSION="$ANDROID_VERSION" + export ABK_BUILD_KERNEL_VERSION="$KERNEL_VERSION" + export ABK_BUILD_SUB_LEVEL="$SUB_LEVEL" + export ABK_BUILD_OS_PATCH_LEVEL="$OS_PATCH_LEVEL" + export ABK_BUILD_REVISION="$REVISION" + export ABK_BUILD_KSU_VARIANT="$(normalize_variant "$KSU_VARIANT")" + export ABK_BUILD_KSU_BRANCH="$(normalize_track "$KSU_TRACK")" + export ABK_BUILD_KSU_REF="$(resolve_ksu_ref)" + export ABK_BUILD_VERSION="$VERSION_INPUT" + export ABK_BUILD_TIME="$BUILD_TIME" + export ABK_BUILD_VIRTUALIZATION_SUPPORT="$VIRTUALIZATION_SUPPORT" + export ABK_BUILD_ZRAM_EXTRA_ALGOS="$ZRAM_EXTRA_ALGOS" + export ABK_FEATURE_USE_ZRAM="$USE_ZRAM" + export ABK_FEATURE_USE_BBG="$USE_BBG" + export ABK_FEATURE_USE_DDK="$USE_DDK" + export ABK_FEATURE_USE_NTSYNC="$USE_NTSYNC" + export ABK_FEATURE_USE_NETWORKING="$USE_NETWORKING" + export ABK_FEATURE_USE_KPM="$USE_KPM" + export ABK_FEATURE_USE_REKERNEL="$USE_REKERNEL" + export ABK_FEATURE_ENABLE_SUSFS="$ENABLE_SUSFS" + export ABK_FEATURE_SUPP_OP="$SUPP_OP" + export ABK_FEATURE_ZRAM_FULL_ALGO="$ZRAM_FULL_ALGO" + export ABK_MANAGER_PACKAGE="$ABK_MANAGER_PACKAGE" + export ABK_MANAGER_CERT_SIZE="$ABK_MANAGER_CERT_SIZE" + export ABK_MANAGER_CERT_SHA256="$(printf '%s' "$ABK_MANAGER_CERT_SHA256" | tr '[:upper:]' '[:lower:]')" + export REMOTE_BRANCH="${TEMPLATE_COMMON_BRANCH:-}" + export ACTUAL_SUBLEVEL="$actual_sublevel" + export ABK_MODULE_ENTRY_KIND="${entry_kind:-module}" + export ABK_MODULE_GROUP_REPO_URL="${group_repo_url:-}" + export ABK_MODULE_CHILD_ID="${child_id:-}" + export ROOT_DIR STATE_DIR SOURCES_DIR WORKSPACE_DIR ARTIFACTS_DIR LOGS_DIR CACHE_DIR KEYS_DIR STATE_DATA_DIR + export TEMPLATE_ROOT KERNEL_ROOT DEFCONFIG ABK_SOURCE ANYKERNEL3_SOURCE KERNEL_PATCHES_SOURCE SUKISU_PATCHES_SOURCE ACTION_BUILD_SOURCE SUSFS_SOURCE GCC_SOURCE VIRTUALIZATION_SOURCE VIRTUALIZATION_SUPPORT_PATCHES + cd "$module_dir" + bash "$setup_path" + ) + executed=$((executed + 1)) + done <"$manifest" + + if (( executed == 0 )); then + log_info "no custom modules configured for stage $stage" + fi +} + +apply_stock_config() { + local stock_src="$ABK_SOURCE/config/stock_defconfig" + local stock_dst="$KERNEL_ROOT/common/arch/arm64/configs/stock_defconfig" + local target_makefile="$KERNEL_ROOT/common/kernel/Makefile" + + [[ -f "$stock_src" ]] || return 0 + + mkdir -p "$(dirname "$stock_dst")" + cp "$stock_src" "$stock_dst" + + if grep -qF '$(obj)/config_data: $(KCONFIG_CONFIG) FORCE' "$target_makefile"; then + sed -i 's|$(obj)/config_data: $(KCONFIG_CONFIG) FORCE|$(obj)/config_data: arch/arm64/configs/stock_defconfig FORCE|' "$target_makefile" + fi +} + +apply_glibc_fix() { + local current_sub="$SUB_LEVEL" + local glibc_version + + [[ "$current_sub" =~ ^[0-9]+$ ]] || current_sub=99999 + if ! { + [[ "$ANDROID_VERSION" == "android13" && "$KERNEL_VERSION" == "5.10" && "$current_sub" -le 186 ]] || + [[ "$ANDROID_VERSION" == "android13" && "$KERNEL_VERSION" == "5.15" && "$current_sub" -le 119 ]] || + [[ "$ANDROID_VERSION" == "android14" && "$KERNEL_VERSION" == "6.1" && "$current_sub" -le 43 ]] + }; then + return 0 + fi + + glibc_version="$(ldd --version 2>/dev/null | head -n 1 | awk '{print $NF}')" + if [[ "$(printf '%s\n' "2.38" "$glibc_version" | sort -V | head -n 1)" != "2.38" ]]; then + return 0 + fi + + log_info "applying glibc 2.38 compatibility fix" + ( + cd "$KERNEL_ROOT/common" + sed -i '/\$(Q)\$(MAKE) -C \$(SUBCMD_SRC) OUTPUT=\$(abspath \$(dir \$@))\/ \$(abspath \$@)/s//$(Q)$(MAKE) -C $(SUBCMD_SRC) EXTRA_CFLAGS="$(CFLAGS)" OUTPUT=$(abspath $(dir $@))\/ $(abspath $@)/' tools/bpf/resolve_btfids/Makefile || true + ) +} + +apply_supp_op() { + bool_is_true "$SUPP_OP" || return 0 + log_info "injecting OnePlus 8E support" + cp "$ABK_SOURCE/hmbird_patch.c" "$KERNEL_ROOT/common/drivers/hmbird_patch.c" + ensure_line_once "$KERNEL_ROOT/common/drivers/Makefile" 'obj-y += hmbird_patch.o' +} + +inject_kernelsu() { + local variant ref setup_url repo_url actual_head + variant="$(normalize_variant "$KSU_VARIANT")" + [[ "$variant" == "None" ]] && return 0 + + ref="$(resolve_ksu_ref)" + setup_url="$(resolve_ksu_setup_url)" + repo_url="$(resolve_ksu_repo_url)" + + log_info "injecting $variant ($ref)" + ( + cd "$KERNEL_ROOT" + curl -LSs "$setup_url" | bash + ) + + if [[ -d "$KERNEL_ROOT/KernelSU/.git" && -n "$ref" ]]; then + log_info "refreshing KernelSU repository for clean pin" + rm -rf "$KERNEL_ROOT/KernelSU" + git clone --no-checkout "$repo_url" "$KERNEL_ROOT/KernelSU" + log_info "pinning KernelSU repository to $ref" + git -C "$KERNEL_ROOT/KernelSU" fetch origin "$ref" + git -C "$KERNEL_ROOT/KernelSU" checkout --detach "$ref" + actual_head="$(git -C "$KERNEL_ROOT/KernelSU" rev-parse HEAD)" + if [[ "$ref" =~ ^[0-9a-fA-F]{40}$ && "$actual_head" != "$ref" ]]; then + log_error "KernelSU HEAD mismatch after pinning: expected $ref, got $actual_head" + fi + fi + + if [[ "$variant" == "Official" && -f "$KERNEL_ROOT/KernelSU/kernel/Kbuild" ]]; then + local git_version ksu_version + git_version="$(git -C "$KERNEL_ROOT/KernelSU" rev-list --count HEAD)" + ksu_version="$((20000 + git_version))" + sed -i "s/DKSU_VERSION=16/DKSU_VERSION=${ksu_version}/" "$KERNEL_ROOT/KernelSU/kernel/Kbuild" + fi +} + +current_sublevel() { + local value="${SUB_LEVEL:-99999}" + [[ "$value" =~ ^[0-9]+$ ]] || value=99999 + printf '%s\n' "$value" +} + +sub_in_range() { + local value="$1" + local min="$2" + local max="$3" + [[ "$value" =~ ^[0-9]+$ ]] || return 1 + (( value >= min && value <= max )) +} + +fix_task_mmu_show_pad() { + local file="$KERNEL_ROOT/common/fs/proc/task_mmu.c" + [[ -f "$file" ]] || return 0 + + if grep -qF 'goto show_pad;' "$file"; then + sed -i -e 's/goto show_pad;/return 0;/' "$file" + fi + + if grep -q '^[[:space:]]*show_pad:[[:space:]]*$' "$file" && ! grep -qF 'goto show_pad;' "$file"; then + sed -i '/^[[:space:]]*show_pad:[[:space:]]*$/d' "$file" + fi +} + +apply_unicode_bypass_fix() { + bool_is_true "$ENABLE_SUSFS" || return 0 + ( + cd "$KERNEL_ROOT/common" + patch -p1 --forward <"$ACTION_BUILD_SOURCE/patches/unicode_bypass_fix_6.1+.patch" || true + ) +} + +apply_resukisu_susfs_pre_compat() { + [[ "$(normalize_variant "$KSU_VARIANT")" == "ReSukiSU" ]] || return 0 + bool_is_true "$ENABLE_SUSFS" || return 0 + + ( + cd "$KERNEL_ROOT" + python3 - <<'PY' +from pathlib import Path + +roots = [Path("KernelSU/kernel"), Path("common/drivers/kernelsu"), Path("drivers/kernelsu")] +candidates = [] +seen = set() +for base in roots: + if not base.exists(): + continue + resolved = base.resolve() + if resolved in seen: + continue + markers = ["Kbuild", "core/init.c", "feature/sucompat.c", "sulog/event.c"] + if any((base / marker).exists() for marker in markers): + candidates.append(base) + seen.add(resolved) + +if not candidates: + raise SystemExit("未找到实际 ReSukiSU 源码目录,无法应用 SUSFS 兼容修复") + +for kernel_dir in candidates: + tree_text = "\n".join( + path.read_text(errors="ignore") + for path in kernel_dir.rglob("*") + if path.is_file() + ) + ksu_c = kernel_dir / "ksu.c" + if ksu_c.exists(): + text = ksu_c.read_text() + anchor = '#include "infra/kernel_compat.h"\n' + if ( + anchor in text + and "DEFINE_STATIC_KEY_TRUE(ksu_is_init_rc_hook_enabled);" not in tree_text + ): + block = ( + "\n/* ABK: ReSukiSU builtin SUSFS expects these inline hook static keys. */\n" + "#ifdef CONFIG_KSU_SUSFS\n" + "DEFINE_STATIC_KEY_TRUE(ksu_is_init_rc_hook_enabled);\n" + "DEFINE_STATIC_KEY_TRUE(ksu_is_input_hook_enabled);\n" + "#if defined(KSU_COMPAT_USE_STATIC_KEY)\n" + "DEFINE_STATIC_KEY_FALSE(ksu_init_rc_hook_key_false);\n" + "DEFINE_STATIC_KEY_FALSE(ksu_input_hook_key_false);\n" + "#endif\n" + "#endif\n" + ) + ksu_c.write_text(text.replace(anchor, anchor + block, 1)) + + selinux_c = kernel_dir / "selinux/selinux.c" + if selinux_c.exists(): + text = selinux_c.read_text() + compat_symbols = [ + "ksu_selinux_hide_running", + "struct selinux_state fake_state", + "struct selinux_policy *backup_sepolicy", + "security_context_to_sid_with_policy", + "security_sid_to_context_with_policy", + "security_compute_av_user_with_policy", + ] + if not all(symbol in tree_text for symbol in compat_symbols): + anchor = 'u32 ksu_file_sid __read_mostly = 0;\n' + block = ( + "\n/* ABK: simonpunk SUSFS SELinux hooks reference KernelSU selinux_hide globals. */\n" + "#ifdef CONFIG_KSU_SUSFS\n" + "struct selinux_state fake_state;\n" + "bool ksu_selinux_hide_running __read_mostly = false;\n" + "struct selinux_policy *backup_sepolicy;\n" + "#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)\n" + "int security_context_to_sid_with_policy(struct selinux_policy *policy, const char *scontext, u32 scontext_len,\n" + " u32 *sid, u32 def_sid, unsigned int gfp_flags)\n" + "{\n" + " return -22;\n" + "}\n" + "int security_sid_to_context_with_policy(struct selinux_policy *policy, u32 sid, char **scontext,\n" + " u32 *scontext_len)\n" + "{\n" + " return -22;\n" + "}\n" + "void security_compute_av_user_with_policy(struct selinux_policy *policy, u32 ssid, u32 tsid, u16 tclass,\n" + " struct av_decision *avd)\n" + "{\n" + "}\n" + "#endif\n" + "#endif\n" + ) + if anchor in text: + selinux_c.write_text(text.replace(anchor, anchor + block, 1)) + + selinux_hide_c = kernel_dir / "feature/selinux_hide.c" + if selinux_hide_c.exists(): + text = selinux_hide_c.read_text() + + if "#include \n" not in text and "#include \n" in text: + text = text.replace( + "#include \n", + "#include \n#include \n", + 1, + ) + + for old in ( + "__maybe_bool ksu_selinux_hide_enabled __read_mostly = false;\n", + "__maybe_static bool ksu_selinux_hide_enabled __read_mostly = false;\n", + "static bool ksu_selinux_hide_enabled __read_mostly = false;\n", + ): + if old in text: + text = text.replace(old, "bool ksu_selinux_hide_enabled __read_mostly = false;\n", 1) + + old_static_key_block = ( + "#ifdef KSU_COMPAT_USE_STATIC_KEY\n" + "// We should talk to you, susfs\n" + "// Why use manual hook instead of auto hook\n" + "__maybe_static DEFINE_STATIC_KEY_FALSE(fake_status_initialize_key);\n" + "#else\n" + "static bool fake_status_initialize_key __read_mostly = false;\n" + "#endif\n" + ) + if old_static_key_block in text: + text = text.replace( + old_static_key_block, + "DEFINE_STATIC_KEY_FALSE(fake_status_initialize_key);\n", + 1, + ) + + for old in ( + "__maybe_static struct page *fake_status = NULL;\n", + "static struct page *fake_status = NULL;\n", + ): + if old in text: + text = text.replace(old, "struct page *fake_status = NULL;\n", 1) + + for old, new in ( + ("__maybe_static void initialize_fake_status();\n", "void initialize_fake_status(void);\n"), + ("static void initialize_fake_status();\n", "void initialize_fake_status(void);\n"), + ("__maybe_static void initialize_fake_status()\n", "void initialize_fake_status(void)\n"), + ("static void initialize_fake_status()\n", "void initialize_fake_status(void)\n"), + ): + if old in text: + text = text.replace(old, new, 1) + + anchor = "bool ksu_selinux_hide_running __read_mostly = false;\n" + inject = ( + "bool ksu_selinux_hide_running __read_mostly = false;\n" + "DEFINE_STATIC_KEY_FALSE(fake_status_initialize_key);\n" + "struct page *fake_status = NULL;\n" + ) + if anchor in text and "fake_status_initialize_key" not in text: + text = text.replace(anchor, inject, 1) + + if "initialize_fake_status(" not in text: + text += ( + "\nvoid initialize_fake_status(void)\n" + "{\n" + "}\n" + ) + + selinux_hide_c.write_text(text) + + sucompat_c = kernel_dir / "feature/sucompat.c" + if sucompat_c.exists(): + text = sucompat_c.read_text() + marker = "\n// dead code\n" + guard = "#endif /* CONFIG_KSU_SUSFS */\n" + if marker in text and guard not in text: + sucompat_c.write_text(text.replace(marker, "\n" + guard + marker, 1)) + + sulog_event_c = kernel_dir / "sulog/event.c" + if sulog_event_c.exists(): + text = sulog_event_c.read_text() + if "builtin SUSFS ksu_sulog_capture() expects argv_user as a pointer" not in text: + for old in ( + " pending = ksu_sulog_capture(KSU_SULOG_EVENT_IOCTL_GRANT_ROOT, NULL, USER_ARG_NULL, gfp);", + " pending = ksu_sulog_capture(KSU_SULOG_EVENT_IOCTL_GRANT_ROOT, NULL, &USER_ARG_NULL, gfp);", + ): + if old in text: + new = ( + " /* ABK: builtin SUSFS ksu_sulog_capture() expects argv_user as a pointer. */\n" + "#ifdef CONFIG_KSU_SUSFS\n" + " pending = ksu_sulog_capture(KSU_SULOG_EVENT_IOCTL_GRANT_ROOT, NULL, NULL, gfp);\n" + "#else\n" + f"{old}\n" + "#endif" + ) + sulog_event_c.write_text(text.replace(old, new, 1)) + break +PY + ) +} + +apply_susfs_patch_stack() { + local variant current_sub susfs_version susfs_fix_root susfs_ksu_fix_root patch_source + variant="$(normalize_variant "$KSU_VARIANT")" + bool_is_true "$ENABLE_SUSFS" || return 0 + [[ "$variant" != "None" ]] || return 0 + + susfs_version="$( + grep -E '^#define[[:space:]]+SUSFS_VERSION' "$SUSFS_SOURCE/kernel_patches/include/linux/susfs.h" \ + | awk '{print $3}' | tr -d '"' | sed 's/^v//' + )" + [[ -n "$susfs_version" ]] || susfs_version="2.0.0" + + for candidate in \ + "$KERNEL_PATCHES_SOURCE/wild/susfs_fix_patches/v${susfs_version}" \ + "$KERNEL_PATCHES_SOURCE/wild/archived/susfs_fix_patches/v${susfs_version}" \ + "$KERNEL_PATCHES_SOURCE/ksu/susfs_fix_patches/v${susfs_version}" + do + [[ -d "$candidate" ]] || continue + susfs_fix_root="$candidate" + break + done + [[ -n "${susfs_fix_root:-}" ]] || susfs_fix_root="$KERNEL_PATCHES_SOURCE/wild/archived/susfs_fix_patches/v2.0.0" + [[ -d "$KERNEL_PATCHES_SOURCE/ksu/susfs_fix_patches/v${susfs_version}" ]] && susfs_ksu_fix_root="$KERNEL_PATCHES_SOURCE/ksu/susfs_fix_patches/v${susfs_version}" + + cp "$SUSFS_SOURCE/kernel_patches/50_add_susfs_in_gki-${ANDROID_VERSION}-${KERNEL_VERSION}.patch" "$KERNEL_ROOT/common/" + cp "$SUSFS_SOURCE/kernel_patches/fs/"* "$KERNEL_ROOT/common/fs/" + cp "$SUSFS_SOURCE/kernel_patches/include/linux/"* "$KERNEL_ROOT/common/include/linux/" + + ( + cd "$KERNEL_ROOT/common" + patch -p1 <"50_add_susfs_in_gki-${ANDROID_VERSION}-${KERNEL_VERSION}.patch" || true + ) + + if [[ "$variant" == "SukiSU" || "$variant" == "ReSukiSU" ]]; then + [[ -f "$KERNEL_ROOT/common/fs/susfs.c" ]] && \ + sed -i 's/^static void susfs_run_sus_path_loop(/void susfs_run_sus_path_loop(/' "$KERNEL_ROOT/common/fs/susfs.c" + fi + + current_sub="$(current_sublevel)" + if [[ "$ANDROID_VERSION" == "android14" && "$KERNEL_VERSION" == "6.1" ]] && sub_in_range "$current_sub" 25 162; then + patch_source="" + [[ -f "$susfs_fix_root/a14-6.1/base.c.patch" ]] && patch_source="$susfs_fix_root/a14-6.1/base.c.patch" + [[ -z "$patch_source" && -n "${susfs_ksu_fix_root:-}" && -f "$susfs_ksu_fix_root/1_fix_base.c.patch" ]] && patch_source="$susfs_ksu_fix_root/1_fix_base.c.patch" + if [[ -n "$patch_source" ]]; then + ( + cd "$KERNEL_ROOT/common" + patch -p1 <"$patch_source" || true + ) + fi + + if grep -Eq 'susfs_is_current_proc_umounted|SUSFS_IS_INODE_SUS_MAP|SUSFS_IS_INODE_OPEN_REDIRECT' "$KERNEL_ROOT/common/fs/proc/base.c" \ + && ! grep -qF '#include ' "$KERNEL_ROOT/common/fs/proc/base.c"; then + if grep -qF '#include ' "$KERNEL_ROOT/common/fs/proc/base.c"; then + sed -i '/#include /a #if defined(CONFIG_KSU_SUSFS_SUS_MAP) || defined(CONFIG_KSU_SUSFS_OPEN_REDIRECT)\n#include \n#endif' "$KERNEL_ROOT/common/fs/proc/base.c" + else + sed -i '/#include /a #if defined(CONFIG_KSU_SUSFS_SUS_MAP) || defined(CONFIG_KSU_SUSFS_OPEN_REDIRECT)\n#include \n#endif' "$KERNEL_ROOT/common/fs/proc/base.c" + fi + fi + + if [[ "$OS_PATCH_LEVEL" != "2024-05" ]]; then + fix_task_mmu_show_pad + fi + + if grep -Eq 'DEFAULT_KSU_MNT_ID|susfs_mnt_id_ida' "$KERNEL_ROOT/common/fs/namespace.c" \ + && ! grep -qF '#include ' "$KERNEL_ROOT/common/fs/namespace.c"; then + sed -i '/#include /a #ifdef CONFIG_KSU_SUSFS_SUS_MOUNT\n#include \n#endif' "$KERNEL_ROOT/common/fs/namespace.c" + if ! grep -q 'extern bool susfs_is_current_ksu_domain' "$KERNEL_ROOT/common/fs/namespace.c"; then + sed -i '/#include "internal.h"/a \\n#ifdef CONFIG_KSU_SUSFS_SUS_MOUNT\nextern bool susfs_is_current_ksu_domain(void);\nextern struct static_key_true susfs_is_sdcard_android_data_not_decrypted;\n\n#define CL_COPY_MNT_NS BIT(25)\n\n#endif' "$KERNEL_ROOT/common/fs/namespace.c" + fi + fi + fi +} + +finalize_sukisu_resukisu_susfs_compat() { + local variant + variant="$(normalize_variant "$KSU_VARIANT")" + [[ "$variant" == "SukiSU" || "$variant" == "ReSukiSU" ]] || return 0 + + ( + cd "$KERNEL_ROOT" + python3 - <<'PY' +from pathlib import Path +import re + +def repair_sucompat(path: Path): + text = path.read_text() + changed = False + marker = "\n// dead code\n" + guard = "#endif /* CONFIG_KSU_SUSFS */\n" + if marker in text and guard not in text: + text = text.replace(marker, "\n" + guard + marker, 1) + changed = True + depth = 0 + out = [] + for line in text.splitlines(keepends=True): + if re.match(r"^\s*#\s*(if|ifdef|ifndef)\b", line): + depth += 1 + out.append(line) + elif re.match(r"^\s*#\s*endif\b", line): + if depth == 0: + continue + depth -= 1 + out.append(line) + else: + out.append(line) + text = "".join(out) + if changed: + path.write_text(text) + +for base in (Path("common/drivers/kernelsu"), Path("drivers/kernelsu"), Path("KernelSU/kernel")): + if not base.exists(): + continue + sucompat = base / "feature/sucompat.c" + if sucompat.exists(): + repair_sucompat(sucompat) + sulog = base / "sulog/event.c" + if sulog.exists(): + text = sulog.read_text() + if "builtin SUSFS ksu_sulog_capture() expects argv_user as a pointer" not in text: + for old in ( + " pending = ksu_sulog_capture(KSU_SULOG_EVENT_IOCTL_GRANT_ROOT, NULL, USER_ARG_NULL, gfp);", + " pending = ksu_sulog_capture(KSU_SULOG_EVENT_IOCTL_GRANT_ROOT, NULL, &USER_ARG_NULL, gfp);", + ): + if old in text: + new = ( + " /* ABK: builtin SUSFS ksu_sulog_capture() expects argv_user as a pointer. */\n" + "#ifdef CONFIG_KSU_SUSFS\n" + " pending = ksu_sulog_capture(KSU_SULOG_EVENT_IOCTL_GRANT_ROOT, NULL, NULL, gfp);\n" + "#else\n" + f"{old}\n" + "#endif" + ) + sulog.write_text(text.replace(old, new, 1)) + break +PY + ) +} + +prepare_profile() { + prepare_custom_external_modules + apply_stock_config + apply_glibc_fix + apply_supp_op + inject_kernelsu + apply_resukisu_susfs_pre_compat + apply_susfs_patch_stack + + cp "$DEFCONFIG" "$DEFCONFIG.orig" +} + +apply_ntsync() { + bool_is_true "$USE_NTSYNC" || return 0 + log_info "applying NTsync patch stack" + ( + cd "$KERNEL_ROOT/common" + patch -p1 --forward <"$KERNEL_PATCHES_SOURCE/common/ntsync/ntsync_base.patch" || true + patch -p1 --forward <"$KERNEL_PATCHES_SOURCE/common/ntsync/ntsync_compat_${ANDROID_VERSION}-${KERNEL_VERSION}.patch" || true + ) + if [[ -f "$KERNEL_ROOT/common/drivers/misc/Kconfig" ]]; then + sed -i '/^config NTSYNC$/,/^[[:space:]]*help$/{ s/^[[:space:]]*default[[:space:]]\+m$/\tdefault\ty/; }' "$KERNEL_ROOT/common/drivers/misc/Kconfig" + fi + ensure_defconfig_value CONFIG_NTSYNC y +} + +apply_networking() { + bool_is_true "$USE_NETWORKING" || return 0 + log_info "enabling networking enhancements" + + ensure_defconfig_value CONFIG_IP_SET y + ensure_defconfig_value CONFIG_IP_SET_MAX 65534 + ensure_defconfig_value CONFIG_IP_SET_BITMAP_IP y + ensure_defconfig_value CONFIG_IP_SET_BITMAP_IPMAC y + ensure_defconfig_value CONFIG_IP_SET_BITMAP_PORT y + ensure_defconfig_value CONFIG_IP_SET_HASH_IP y + ensure_defconfig_value CONFIG_IP_SET_HASH_IPMARK y + ensure_defconfig_value CONFIG_IP_SET_HASH_IPPORT y + ensure_defconfig_value CONFIG_IP_SET_HASH_IPPORTIP y + ensure_defconfig_value CONFIG_IP_SET_HASH_IPPORTNET y + ensure_defconfig_value CONFIG_IP_SET_HASH_IPMAC y + ensure_defconfig_value CONFIG_IP_SET_HASH_MAC y + ensure_defconfig_value CONFIG_IP_SET_HASH_NETPORTNET y + ensure_defconfig_value CONFIG_IP_SET_HASH_NET y + ensure_defconfig_value CONFIG_IP_SET_HASH_NETNET y + ensure_defconfig_value CONFIG_IP_SET_HASH_NETPORT y + ensure_defconfig_value CONFIG_IP_SET_HASH_NETIFACE y + ensure_defconfig_value CONFIG_IP_SET_LIST_SET y + ensure_defconfig_value CONFIG_NETFILTER_XT_MATCH_ADDRTYPE y + ensure_defconfig_value CONFIG_NETFILTER_XT_SET y + ensure_defconfig_value CONFIG_IP6_NF_NAT y + ensure_defconfig_value CONFIG_IP6_NF_TARGET_MASQUERADE y + ensure_defconfig_value CONFIG_TCP_CONG_ADVANCED y + ensure_defconfig_value CONFIG_TCP_CONG_BIC y + ensure_defconfig_value CONFIG_TCP_CONG_BBR y + ensure_defconfig_value CONFIG_TCP_CONG_CUBIC y + ensure_defconfig_value CONFIG_TCP_CONG_WESTWOOD y + ensure_defconfig_value CONFIG_TCP_CONG_HTCP y + ensure_defconfig_value CONFIG_DEFAULT_BBR y + ensure_defconfig_value CONFIG_DEFAULT_TCP_CONG '"bbr"' + ensure_defconfig_value CONFIG_NET_SCH_FQ y + ensure_defconfig_value CONFIG_NET_SCH_FQ_CODEL y +} + +apply_virtualization_support() { + local slot="${VIRTUALIZATION_SUPPORT:-off}" + local patch_file slot_name + + [[ "$slot" != "off" ]] || return 0 + [[ "$ANDROID_VERSION" == "android14" && "$KERNEL_VERSION" == "6.1" ]] || \ + log_error "virtualization support is currently implemented only for android14-6.1" + + case "$slot" in + 678|123|345) ;; + *) log_error "VIRTUALIZATION_SUPPORT must be one of: off, 678, 123, 345" ;; + esac + + if [[ ! -d "$VIRTUALIZATION_SOURCE/.git" ]]; then + log_info "cloning virtualization support patches" + git clone --depth 1 https://github.com/ravindu644/Droidspaces-OSS.git "$VIRTUALIZATION_SOURCE" + fi + + slot_name="$(sed 's/\(.\)/\1_/g; s/_$//' <<<"$slot")" + patch_file="$VIRTUALIZATION_SUPPORT_PATCHES/below-kernel-6.12/001.GKI-below-6.12-fix_sysvipc_kabi_${slot_name}.patch" + + ( + cd "$KERNEL_ROOT/common" + if patch -p1 --forward --dry-run <"$patch_file" >/dev/null 2>&1; then + patch -p1 --forward <"$patch_file" + elif patch -p1 --reverse --dry-run <"$patch_file" >/dev/null 2>&1; then + : + elif [[ "$slot" == "678" ]]; then + perl -0pi -e 's/#ifdef CONFIG_SYSVIPC\n\tstruct sysv_sem\s+sysvsem;\n\tstruct sysv_shm\s+sysvshm;\n#endif/#ifdef CONFIG_SYSVIPC\n\t\/\/ struct sysv_sem\t\t\tsysvsem;\n\t\/\/ struct sysv_shm\t\t\tsysvshm;\n#endif/s' include/linux/sched.h + perl -0pi -e 's/\tANDROID_KABI_RESERVE\(6\);\n\tANDROID_KABI_RESERVE\(7\);\n\tANDROID_KABI_RESERVE\(8\);/\n#ifdef CONFIG_SYSVIPC\n\tANDROID_KABI_USE(6, struct sysv_sem sysvsem);\n\t_ANDROID_KABI_REPLACE(ANDROID_KABI_RESERVE(7); ANDROID_KABI_RESERVE(8), struct sysv_shm sysvshm);\n#else\n\tANDROID_KABI_RESERVE(6);\n\tANDROID_KABI_RESERVE(7);\n\tANDROID_KABI_RESERVE(8);\n#endif/s' include/linux/sched.h + else + log_error "virtualization SYSVIPC patch failed for slot $slot" + fi + ) + + enable_virtualization_config() { + local cfg="$1" + if grep -q "^${cfg}=y" "$DEFCONFIG"; then + return 0 + elif grep -q "^# ${cfg} is not set" "$DEFCONFIG"; then + sed -i "s/^# ${cfg} is not set$/${cfg}=y/" "$DEFCONFIG" + else + echo "${cfg}=y" >> "$DEFCONFIG" + fi + } + + enable_virtualization_config CONFIG_SYSVIPC + enable_virtualization_config CONFIG_POSIX_MQUEUE + enable_virtualization_config CONFIG_IPC_NS + enable_virtualization_config CONFIG_PID_NS + enable_virtualization_config CONFIG_DEVTMPFS + enable_virtualization_config CONFIG_USER_NS +} + +apply_zram_stack() { + bool_is_true "$USE_ZRAM" || return 0 + [[ "$KERNEL_VERSION" != "6.12" ]] || log_error "ZRAM enhancement is disabled for kernel 6.12" + + log_info "applying ZRAM patch stack" + ( + cd "$KERNEL_ROOT/common" + rm -f lib/lz4/lz4_compress.c lib/lz4/lz4_decompress.c lib/lz4/lz4defs.h lib/lz4/lz4hc_compress.c + cp -r "$ABK_SOURCE/zram/lz4/." ./lib/lz4/ + cp -r "$ABK_SOURCE/zram/include/linux/." ./include/linux/ + bash "$ABK_SOURCE/zram/apply_lz4_neon.sh" + + if [[ -f "fs/f2fs/Makefile" ]] && ! grep -qF 'f2fs-$(CONFIG_F2FS_IOSTAT) += iostat.o' "fs/f2fs/Makefile"; then + printf '%s\n' 'f2fs-$(CONFIG_F2FS_IOSTAT) += iostat.o' >>"fs/f2fs/Makefile" + fi + + cp -r "$SUKISU_PATCHES_SOURCE/other/zram/lz4k/include/linux/." ./include/linux/ + cp -r "$SUKISU_PATCHES_SOURCE/other/zram/lz4k/lib/." ./lib/ + cp -r "$SUKISU_PATCHES_SOURCE/other/zram/lz4k/crypto/." ./crypto/ + cp -r "$SUKISU_PATCHES_SOURCE/other/zram/lz4k_oplus" ./lib/ + + for patch_name in lz4kd.patch lz4k_oplus.patch; do + local_patch="$SUKISU_PATCHES_SOURCE/other/zram/zram_patch/${KERNEL_VERSION}/${patch_name}" + [[ -f "$local_patch" ]] || continue + cp "$local_patch" ./ + patch -p1 -F 3 <"$patch_name" || true + done + + log_info "integrating zstdp support" + mkdir -p "$CACHE_DIR" + export RUNNER_TEMP="$CACHE_DIR" + export ZZH_PATCHES="$ABK_SOURCE" + bash "$ABK_SOURCE/zram/setup_zstdp.sh" integrate "$PWD" + ) +} + +configure_zram_options() { + local modules_bzl="$KERNEL_ROOT/common/modules.bzl" + + bool_is_true "$USE_ZRAM" || return 0 + + if [[ "$KERNEL_VERSION" == "6.1" ]]; then + ensure_defconfig_value CONFIG_ZSMALLOC y + ensure_defconfig_value CONFIG_ZRAM y + fi + + if grep -q '^CONFIG_ZSMALLOC=y$' "$DEFCONFIG" && grep -q '^CONFIG_ZRAM=y$' "$DEFCONFIG"; then + cat "$ABK_SOURCE/config/zram.config" >>"$DEFCONFIG" + fi + + if [[ -f "$modules_bzl" ]]; then + if grep -q '^CONFIG_ZSMALLOC=y$' "$DEFCONFIG" && grep -q '^CONFIG_ZRAM=y$' "$DEFCONFIG"; then + remove_line_if_present "$modules_bzl" ' "drivers/block/zram/zram.ko",' + remove_line_if_present "$modules_bzl" ' "mm/zsmalloc.ko",' + else + ensure_line_once "$modules_bzl" ' "drivers/block/zram/zram.ko",' + ensure_line_once "$modules_bzl" ' "mm/zsmalloc.ko",' + fi + fi + + if bool_is_true "$ZRAM_FULL_ALGO"; then + ensure_defconfig_value CONFIG_CRYPTO_LZO y + ensure_defconfig_value CONFIG_CRYPTO_LZ4 y + ensure_defconfig_value CONFIG_CRYPTO_DEFLATE y + ensure_defconfig_value CONFIG_CRYPTO_ZSTD y + enable_zstdp_config + ensure_defconfig_value CONFIG_ZRAM_DEF_COMP_LZORLE y + ensure_defconfig_value CONFIG_ZRAM_DEF_COMP '"lzo-rle"' + elif [[ -n "$ZRAM_EXTRA_ALGOS" ]]; then + local algo + IFS=',' read -r -a algos <<<"$ZRAM_EXTRA_ALGOS" + for raw_algo in "${algos[@]}"; do + algo="$(trim_value "$raw_algo")" + [[ -n "$algo" ]] || continue + case "${algo,,}" in + lzo) ensure_defconfig_value CONFIG_CRYPTO_LZO y ;; + lz4) ensure_defconfig_value CONFIG_CRYPTO_LZ4 y ;; + lz4hc) ensure_defconfig_value CONFIG_CRYPTO_LZ4HC y ;; + lz4k) ensure_defconfig_value CONFIG_CRYPTO_LZ4K y ;; + lz4k_oplus) ensure_defconfig_value CONFIG_CRYPTO_LZ4K_OPLUS y ;; + lz4kd) ensure_defconfig_value CONFIG_CRYPTO_LZ4KD y ;; + deflate) ensure_defconfig_value CONFIG_CRYPTO_DEFLATE y ;; + 842) ensure_defconfig_value CONFIG_CRYPTO_842 y ;; + zstd) ensure_defconfig_value CONFIG_CRYPTO_ZSTD y ;; + zstdp) enable_zstdp_config ;; + *) log_warn "unknown ZRAM algorithm: $algo" ;; + esac + done + fi +} + +apply_bbg() { + bool_is_true "$USE_BBG" || return 0 + log_info "applying Baseband Guard" + ( + cd "$KERNEL_ROOT" + wget -qO- https://github.com/vc-teahouse/Baseband-guard/raw/main/setup.sh | bash + ) + ensure_defconfig_value CONFIG_BBG y + sed -i '/^config LSM$/,/^help$/{ /^[[:space:]]*default/ { /baseband_guard/! s/selinux/selinux,baseband_guard/ } }' "$KERNEL_ROOT/common/security/Kconfig" +} + +apply_ddk() { + bool_is_true "$USE_DDK" || return 0 + log_info "applying DDK patch stack" + ( + cd "$KERNEL_ROOT" + bash "$ABK_SOURCE/ddk/setup.sh" + ) + require_file "$KERNEL_ROOT/common/include/linux/xingguang_ddk.h" + ensure_defconfig_value CONFIG_XINGGUANG_DDK y +} + +apply_rekernel() { + bool_is_true "$USE_REKERNEL" || return 0 + + local tmp_rekernel="$STATE_DATA_DIR/rekernel" + log_info "integrating Re-Kernel" + rm -rf "$tmp_rekernel" + git clone --depth 1 https://github.com/Sakion-Team/Re-Kernel.git "$tmp_rekernel" + + mkdir -p "$KERNEL_ROOT/common/drivers/rekernel" + cp "$tmp_rekernel/LKM-Source/rekernel.c" "$KERNEL_ROOT/common/drivers/rekernel/" + cp "$tmp_rekernel/LKM-Source/rekernel.h" "$KERNEL_ROOT/common/drivers/rekernel/" + + cat >"$KERNEL_ROOT/common/drivers/rekernel/Kconfig" <<'EOF' +menu "Re:Kernel" +config REKERNEL + bool "Re:Kernel support (GKI Vendor Hooks)" + default y + help + Enable Re-Kernel support via GKI Vendor Hooks. + +config REKERNEL_NETWORK + bool "Re:Kernel NetReceive unfreeze support" + depends on REKERNEL + default n +endmenu +EOF + + cat >"$KERNEL_ROOT/common/drivers/rekernel/Makefile" <<'EOF' +obj-$(CONFIG_REKERNEL) += rekernel.o +ccflags-$(CONFIG_REKERNEL_NETWORK) += -DNETWORK_FILTER +EOF + + if ! grep -qF 'source "drivers/rekernel/Kconfig"' "$KERNEL_ROOT/common/drivers/Kconfig"; then + sed -i '/^endmenu$/i source "drivers/rekernel/Kconfig"' "$KERNEL_ROOT/common/drivers/Kconfig" + fi + ensure_line_once "$KERNEL_ROOT/common/drivers/Makefile" 'obj-$(CONFIG_REKERNEL) += rekernel/' + + sed -i 's|#include <../android/binder_internal.h>|#include "../../drivers/android/binder_internal.h"|g' "$KERNEL_ROOT/common/drivers/rekernel/rekernel.c" + grep -qF '#include ' "$KERNEL_ROOT/common/drivers/rekernel/rekernel.c" \ + || sed -i '/#include /a #include ' "$KERNEL_ROOT/common/drivers/rekernel/rekernel.c" + + ensure_defconfig_value CONFIG_REKERNEL y + ensure_defconfig_value CONFIG_REKERNEL_NETWORK y +} + +configure_kernel_options() { + local variant + variant="$(normalize_variant "$KSU_VARIANT")" + + # zstdp symbol namespacing introduces names like + # abk_zstdp___kcfi_typeid_*, which bypass the stock __kcfi_typeid_ + # prefix filter in scripts/kallsyms.c and break base-relative kallsyms. + patch_kallsyms_filters + + if [[ "$variant" != "None" ]]; then + ensure_defconfig_value CONFIG_KSU y + ensure_defconfig_value CONFIG_TMPFS_XATTR y + ensure_defconfig_value CONFIG_TMPFS_POSIX_ACL y + fi + + if [[ "$variant" == "SukiSU" || "$variant" == "ReSukiSU" ]]; then + if bool_is_true "$USE_KPM"; then + ensure_defconfig_value CONFIG_KPM y + else + disable_defconfig_symbol CONFIG_KPM + fi + fi + + if bool_is_true "$ENABLE_SUSFS" && [[ "$variant" != "None" ]]; then + ensure_defconfig_value CONFIG_KSU_SUSFS y + ensure_defconfig_value CONFIG_KSU_SUSFS_SUS_PATH y + ensure_defconfig_value CONFIG_KSU_SUSFS_SUS_MOUNT y + ensure_defconfig_value CONFIG_KSU_SUSFS_SUS_KSTAT y + ensure_defconfig_value CONFIG_KSU_SUSFS_SPOOF_UNAME y + ensure_defconfig_value CONFIG_KSU_SUSFS_ENABLE_LOG y + ensure_defconfig_value CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS y + ensure_defconfig_value CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG y + ensure_defconfig_value CONFIG_KSU_SUSFS_OPEN_REDIRECT y + ensure_defconfig_value CONFIG_KSU_SUSFS_SUS_MAP y + else + disable_defconfig_symbol CONFIG_KSU_SUSFS + disable_defconfig_symbol CONFIG_KSU_SUSFS_SUS_PATH + disable_defconfig_symbol CONFIG_KSU_SUSFS_SUS_MOUNT + disable_defconfig_symbol CONFIG_KSU_SUSFS_SUS_KSTAT + disable_defconfig_symbol CONFIG_KSU_SUSFS_SPOOF_UNAME + disable_defconfig_symbol CONFIG_KSU_SUSFS_ENABLE_LOG + disable_defconfig_symbol CONFIG_KSU_SUSFS_HIDE_KSU_SUSFS_SYMBOLS + disable_defconfig_symbol CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG + disable_defconfig_symbol CONFIG_KSU_SUSFS_OPEN_REDIRECT + disable_defconfig_symbol CONFIG_KSU_SUSFS_SUS_MAP + fi + + sed -i 's/check_defconfig//' "$KERNEL_ROOT/common/build.config.gki" +} + +configure_kernel_name() { + local clean_version ghash bid kmi_local + + sed -i '/^[[:space:]]*"protected_exports_list"[[:space:]]*:[[:space:]]*"android\/abi_gki_protected_exports_aarch64",$/d' "$KERNEL_ROOT/common/BUILD.bazel" + sed -i '/kmi_symbol_list_strict_mode/d' "$KERNEL_ROOT/common/BUILD.bazel" + rm -rf "$KERNEL_ROOT/common/android/abi_gki_protected_exports_"* + sed -i '/stable_scmversion_cmd/s/-maybe-dirty//g' "$KERNEL_ROOT/build/kernel/kleaf/impl/stamp.bzl" + + clean_version="${VERSION_INPUT//[[:space:]]/}" + if [[ -n "$clean_version" ]]; then + clean_version="$(sed -E 's/^[0-9]+\.[0-9]+\.[0-9]+//' <<<"$clean_version")" + sed -i "\$s|echo \"\$res\"|echo \"${clean_version}\"|" "$KERNEL_ROOT/common/scripts/setlocalversion" || true + sed -i "/^CONFIG_LOCALVERSION=/ s/=\"[^\"]*\"/=\"${clean_version}\"/" "$KERNEL_ROOT/common/arch/arm64/configs/gki_defconfig" || true + return 0 + fi + + ghash="$(git -C "$KERNEL_ROOT/common" rev-parse --verify HEAD | cut -c1-13)" + bid="ab$((RANDOM % 90000000 + 10000000))" + kmi_local="-${ANDROID_VERSION}-11-g${ghash}-${bid}-4k" + sed -i "\$s|echo \"\$res\"|echo \"${kmi_local}\"|" "$KERNEL_ROOT/common/scripts/setlocalversion" || true + sed -i "/^CONFIG_LOCALVERSION=/ s/=\"[^\"]*\"/=\"${kmi_local}\"/" "$KERNEL_ROOT/common/arch/arm64/configs/gki_defconfig" || true +} + +set_build_time_override() { + local datestr + if [[ -n "$BUILD_TIME" && "$BUILD_TIME" != "N" && "$BUILD_TIME" != "n" ]]; then + datestr="$BUILD_TIME" + else + datestr="$(TZ='UTC' date +'%a %b %d %T %Z %Y')" + fi + + BUILD_TIMESTAMP="$datestr" + export KBUILD_BUILD_TIMESTAMP="$datestr" + export KBUILD_BUILD_VERSION=1 + + if grep -q 'UTS_VERSION=' "$KERNEL_ROOT/common/scripts/mkcompile_h"; then + perl -pi -e "s{UTS_VERSION=\"\\\$\\\(.*?\\\)\"}{UTS_VERSION=\"#1 SMP PREEMPT $datestr\"}" "$KERNEL_ROOT/common/scripts/mkcompile_h" + else + perl -0777 -pi -e "s{cat <' | sed 's/^> //; s/^[[:space:]]*//' >"$FRAG_PATH" || true + cp "$DEFCONFIG.orig" "$DEFCONFIG" +} + +kernel_dist_dir() { + case "$ANDROID_VERSION" in + android12|android13) + printf '%s\n' "$KERNEL_ROOT/out/${ANDROID_VERSION}-${KERNEL_VERSION}/dist" + ;; + *) + printf '%s\n' "$KERNEL_ROOT/bazel-bin/common/kernel_aarch64" + ;; + esac +} + +run_kernel_build() { + local frag_flag="" + local lto_flag="--lto=thin" + local bazel_help="" + local -a build_args + local dist_dir="" + + mkdir -p "$CCACHE_DIR" "$BAZEL_DISK_CACHE" + ccache --max-size=15G >/dev/null + ccache --set-config=compression=true >/dev/null + + sed -i 's/BUILD_SYSTEM_DLKM=1/BUILD_SYSTEM_DLKM=0/' "$KERNEL_ROOT/common/build.config.gki.aarch64" + sed -i '/MODULES_ORDER=android\/gki_aarch64_modules/d' "$KERNEL_ROOT/common/build.config.gki.aarch64" + sed -i '/KMI_SYMBOL_LIST_STRICT_MODE/d' "$KERNEL_ROOT/common/build.config.gki.aarch64" + + ( + cd "$KERNEL_ROOT" + if [[ -f "build/build.sh" ]]; then + log_info "building kernel with legacy build/build.sh" + LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh CC="/usr/bin/ccache clang" + else + log_info "building kernel with Bazel" + if [[ -s "$FRAG_PATH" ]]; then + frag_flag="--defconfig_fragment=//common:arch/arm64/configs/ksu.fragment" + fi + if [[ "$KERNEL_VERSION" == "6.12" ]]; then + lto_flag="--lto=none" + fi + bazel_help="$(tools/bazel help build 2>&1 || true)" + build_args=( + "--disk_cache=$BAZEL_DISK_CACHE" + "--config=fast" + "$lto_flag" + ) + if grep -Fq "kmi_symbol_list_strict_mode" <<<"$bazel_help"; then + build_args+=("--nokmi_symbol_list_strict_mode") + else + log_warn "skipping unsupported Bazel flag: --nokmi_symbol_list_strict_mode" + fi + if grep -Fq "kmi_symbol_list_violations_check" <<<"$bazel_help"; then + build_args+=("--nokmi_symbol_list_violations_check") + else + log_warn "skipping unsupported Bazel flag: --nokmi_symbol_list_violations_check" + fi + if [[ -n "$frag_flag" ]]; then + build_args+=("$frag_flag") + fi + build_args+=("//common:kernel_aarch64_dist") + tools/bazel build "${build_args[@]}" + fi + ) + + dist_dir="$(kernel_dist_dir)" + require_file "$dist_dir/Image" +} + +apply_kpm_patch() { + local target_path + bool_is_true "$USE_KPM" || return 0 + + case "$(normalize_variant "$KSU_VARIANT")" in + SukiSU|ReSukiSU) ;; + *) return 0 ;; + esac + + target_path="$(kernel_dist_dir)" + require_dir "$target_path" + cp -r "$SUKISU_PATCHES_SOURCE/kpm/patch_linux" "$target_path/patch" + ( + cd "$target_path" + chmod 0755 patch + if [[ -n "$KPM_PASSWORD" ]]; then + ./patch -s "$KPM_PASSWORD" + else + ./patch + fi + rm -f Image + mv oImage Image + ) +} + +write_metadata() { + local meta="$ARTIFACTS_DIR/build-meta.txt" + local ksu_dir="$KERNEL_ROOT/KernelSU" + local ksu_commit="disabled" + local build_timestamp="${BUILD_TIMESTAMP:-${KBUILD_BUILD_TIMESTAMP:-${BUILD_TIME:-unknown}}}" + + if [[ -d "$ksu_dir/.git" ]]; then + ksu_commit="$(git -C "$ksu_dir" rev-parse HEAD)" + fi + + cat >"$meta" <|kSDVvNApfGHM5fDr0!G@3rQpL5UuzU$m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zlHVBr|5 literal 0 HcmV?d00001 diff --git a/desktop/flutter_app/assets/monaco/LICENSE-monaco-editor.txt b/desktop/flutter_app/assets/monaco/LICENSE-monaco-editor.txt new file mode 100644 index 000000000..76fdc58a0 --- /dev/null +++ b/desktop/flutter_app/assets/monaco/LICENSE-monaco-editor.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 - present Microsoft Corporation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/desktop/flutter_app/assets/monaco/ThirdPartyNotices-monaco-editor.txt b/desktop/flutter_app/assets/monaco/ThirdPartyNotices-monaco-editor.txt new file mode 100644 index 000000000..0e9b56a53 --- /dev/null +++ b/desktop/flutter_app/assets/monaco/ThirdPartyNotices-monaco-editor.txt @@ -0,0 +1,448 @@ +THIRD-PARTY SOFTWARE NOTICES AND INFORMATION +Do Not Translate or Localize + +This project incorporates components from the projects listed below. The original copyright notices and the licenses +under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted +herein, whether by implication, estoppel or otherwise. + + + +%% nodejs path library (https://github.com/nodejs/node/tree/43dd49c9782848c25e5b03448c8a0f923f13c158) +========================================= +Copyright Joyent, Inc. and other Node contributors. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. +========================================= +END OF nodejs path library NOTICES AND INFORMATION + + + + +%% markedjs NOTICES AND INFORMATION BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) 2018+, MarkedJS (https://github.com/markedjs/) +Copyright (c) 2011-2018, Christopher Jeffrey (https://github.com/chjj/) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF markedjs NOTICES AND INFORMATION + + + +%% typescript version 4.4.4 (https://github.com/microsoft/TypeScript) +========================================= +Copyright (c) Microsoft Corporation. All rights reserved. + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + + +The TypeScript software incorporates third party material from the projects listed below. The original copyright notice and the license under which Microsoft received such third party material are set forth below. Microsoft reserves all other rights not expressly granted, whether by implication, estoppel or otherwise. + + +------------------- DefinitelyTyped -------------------- +This file is based on or incorporates material from the projects listed below (collectively "Third Party Code"). Microsoft is not the original author of the Third Party Code. The original copyright notice and the license, under which Microsoft received such Third Party Code, are set forth below. Such licenses and notices are provided for informational purposes only. Microsoft, not the third party, licenses the Third Party Code to you under the terms set forth in the EULA for the Microsoft Product. Microsoft reserves all other rights not expressly granted under this agreement, whether by implication, estoppel or otherwise. +DefinitelyTyped +This project is licensed under the MIT license. Copyrights are respective of each contributor listed at the beginning of each definition file. Provided for Informational Purposes Only + +MIT License +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------------- + +------------------- Unicode -------------------- +UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE + +Unicode Data Files include all data files under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, +http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and +http://www.unicode.org/utility/trac/browser/. + +Unicode Data Files do not include PDF online code charts under the +directory http://www.unicode.org/Public/. + +Software includes any source code published in the Unicode Standard +or under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, +http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and +http://www.unicode.org/utility/trac/browser/. + +NOTICE TO USER: Carefully read the following legal agreement. +BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S +DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), +YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. +IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE +THE DATA FILES OR SOFTWARE. + +COPYRIGHT AND PERMISSION NOTICE + +Copyright (c) 1991-2017 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in http://www.unicode.org/copyright.html. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Unicode data files and any associated documentation +(the "Data Files") or Unicode software and any associated documentation +(the "Software") to deal in the Data Files or Software +without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files +or Software are furnished to do so, provided that either +(a) this copyright and permission notice appear with all copies +of the Data Files or Software, or +(b) this copyright and permission notice appear in associated +Documentation. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT OF THIRD PARTY RIGHTS. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. +------------------------------------------------------------------------------------- + +-------------------Document Object Model----------------------------- +DOM + +W3C License +This work is being provided by the copyright holders under the following license. +By obtaining and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions. +Permission to copy, modify, and distribute this work, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following +on ALL copies of the work or portions thereof, including modifications: +* The full text of this NOTICE in a location viewable to users of the redistributed or derivative work. +* Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software and Document Short Notice should be included. +* Notice of any changes or modifications, through a copyright statement on the new code or document such as "This software or document includes material copied from or derived +from [title and URI of the W3C document]. Copyright © [YEAR] W3C® (MIT, ERCIM, Keio, Beihang)." +Disclaimers +THIS WORK IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR +FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENT WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. +COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENT. +The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the work without specific, written prior permission. +Title to copyright in this work will at all times remain with copyright holders. + +--------- + +DOM +Copyright © 2018 WHATWG (Apple, Google, Mozilla, Microsoft). This work is licensed under a Creative Commons Attribution 4.0 International License: Attribution 4.0 International +======================================================================= +Creative Commons Corporation ("Creative Commons") is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an "as-is" basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible. Using Creative Commons Public Licenses Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses. Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC- licensed material, or material used under an exception or limitation to copyright. More considerations for licensors: + +wiki.creativecommons.org/Considerations_for_licensors Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor's permission is not necessary for any reason--for example, because of any applicable exception or limitation to copyright--then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. More_considerations for the public: wiki.creativecommons.org/Considerations_for_licensees ======================================================================= +Creative Commons Attribution 4.0 International Public License By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. Section 1 -- Definitions. a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. c. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. d. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. e. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. f. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License. g. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. h. Licensor means the individual(s) or entity(ies) granting rights under this Public License. i. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. j. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. k. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. Section 2 -- Scope. a. License grant. 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: a. reproduce and Share the Licensed Material, in whole or in part; and b. produce, reproduce, and Share Adapted Material. 2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. 3. Term. The term of this Public License is specified in Section 6(a). 4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a) (4) never produces Adapted Material. 5. Downstream recipients. a. Offer from the Licensor -- Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. b. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. 6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). b. Other rights. 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. 2. Patent and trademark rights are not licensed under this Public License. 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties. Section 3 -- License Conditions. Your exercise of the Licensed Rights is expressly made subject to the following conditions. a. Attribution. 1. If You Share the Licensed Material (including in modified form), You must: a. retain the following if it is supplied by the Licensor with the Licensed Material: i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); ii. a copyright notice; iii. a notice that refers to this Public License; iv. a notice that refers to the disclaimer of warranties; v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; b. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and c. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. 4. If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License. Section 4 -- Sui Generis Database Rights. Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database; b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. Section 5 -- Disclaimer of Warranties and Limitation of Liability. a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. Section 6 -- Term and Termination. a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or 2. upon express reinstatement by the Licensor. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. c. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. Section 7 -- Other Terms and Conditions. a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. Section 8 -- Interpretation. a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. ======================================================================= Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the "Licensor." Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark "Creative Commons" or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. Creative Commons may be contacted at creativecommons.org. + +-------------------------------------------------------------------------------- + +----------------------Web Background Synchronization------------------------------ + +Web Background Synchronization Specification +Portions of spec © by W3C + +W3C Community Final Specification Agreement +To secure commitments from participants for the full text of a Community or Business Group Report, the group may call for voluntary commitments to the following terms; a "summary" is +available. See also the related "W3C Community Contributor License Agreement". +1. The Purpose of this Agreement. +This Agreement sets forth the terms under which I make certain copyright and patent rights available to you for your implementation of the Specification. +Any other capitalized terms not specifically defined herein have the same meaning as those terms have in the "W3C Patent Policy", and if not defined there, in the "W3C Process Document". +2. Copyrights. +2.1. Copyright Grant. I grant to you a perpetual (for the duration of the applicable copyright), worldwide, non-exclusive, no-charge, royalty-free, copyright license, without any obligation for accounting to me, to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, distribute, and implement the Specification to the full extent of my copyright interest in the Specification. +2.2. Attribution. As a condition of the copyright grant, you must include an attribution to the Specification in any derivative work you make based on the Specification. That attribution must include, at minimum, the Specification name and version number. +3. Patents. +3.1. Patent Licensing Commitment. I agree to license my Essential Claims under the W3C Community RF Licensing Requirements. This requirement includes Essential Claims that I own and any that I have the right to license without obligation of payment or other consideration to an unrelated third party. W3C Community RF Licensing Requirements obligations made concerning the Specification and described in this policy are binding on me for the life of the patents in question and encumber the patents containing Essential Claims, regardless of changes in participation status or W3C Membership. I also agree to license my Essential Claims under the W3C Community RF Licensing Requirements in derivative works of the Specification so long as all normative portions of the Specification are maintained and that this licensing commitment does not extend to any portion of the derivative work that was not included in the Specification. +3.2. Optional, Additional Patent Grant. In addition to the provisions of Section 3.1, I may also, at my option, make certain intellectual property rights infringed by implementations of the Specification, including Essential Claims, available by providing those terms via the W3C Web site. +4. No Other Rights. Except as specifically set forth in this Agreement, no other express or implied patent, trademark, copyright, or other property rights are granted under this Agreement, including by implication, waiver, or estoppel. +5. Antitrust Compliance. I acknowledge that I may compete with other participants, that I am under no obligation to implement the Specification, that each participant is free to develop competing technologies and standards, and that each party is free to license its patent rights to third parties, including for the purpose of enabling competing technologies and standards. +6. Non-Circumvention. I agree that I will not intentionally take or willfully assist any third party to take any action for the purpose of circumventing my obligations under this Agreement. +7. Transition to W3C Recommendation Track. The Specification developed by the Project may transition to the W3C Recommendation Track. The W3C Team is responsible for notifying me that a Corresponding Working Group has been chartered. I have no obligation to join the Corresponding Working Group. If the Specification developed by the Project transitions to the W3C Recommendation Track, the following terms apply: +7.1. If I join the Corresponding Working Group. If I join the Corresponding Working Group, I will be subject to all W3C rules, obligations, licensing commitments, and policies that govern that Corresponding Working Group. +7.2. If I Do Not Join the Corresponding Working Group. +7.2.1. Licensing Obligations to Resulting Specification. If I do not join the Corresponding Working Group, I agree to offer patent licenses according to the W3C Royalty-Free licensing requirements described in Section 5 of the W3C Patent Policy for the portions of the Specification included in the resulting Recommendation. This licensing commitment does not extend to any portion of an implementation of the Recommendation that was not included in the Specification. This licensing commitment may not be revoked but may be modified through the exclusion process defined in Section 4 of the W3C Patent Policy. I am not required to join the Corresponding Working Group to exclude patents from the W3C Royalty-Free licensing commitment, but must otherwise follow the normal exclusion procedures defined by the W3C Patent Policy. The W3C Team will notify me of any Call for Exclusion in the Corresponding Working Group as set forth in Section 4.5 of the W3C Patent Policy. +7.2.2. No Disclosure Obligation. If I do not join the Corresponding Working Group, I have no patent disclosure obligations outside of those set forth in Section 6 of the W3C Patent Policy. +8. Conflict of Interest. I will disclose significant relationships when those relationships might reasonably be perceived as creating a conflict of interest with my role. I will notify W3C of any change in my affiliation using W3C-provided mechanisms. +9. Representations, Warranties and Disclaimers. I represent and warrant that I am legally entitled to grant the rights and promises set forth in this Agreement. IN ALL OTHER RESPECTS THE SPECIFICATION IS PROVIDED “AS IS.” The entire risk as to implementing or otherwise using the Specification is assumed by the implementer and user. Except as stated herein, I expressly disclaim any warranties (express, implied, or otherwise), including implied warranties of merchantability, non-infringement, fitness for a particular purpose, or title, related to the Specification. IN NO EVENT WILL ANY PARTY BE LIABLE TO ANY OTHER PARTY FOR LOST PROFITS OR ANY FORM OF INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER FROM ANY CAUSES OF ACTION OF ANY KIND WITH RESPECT TO THIS AGREEMENT, WHETHER BASED ON BREACH OF CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE, AND WHETHER OR NOT THE OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. All of my obligations under Section 3 regarding the transfer, successors in interest, or assignment of Granted Claims will be satisfied if I notify the transferee or assignee of any patent that I know contains Granted Claims of the obligations under Section 3. Nothing in this Agreement requires me to undertake a patent search. +10. Definitions. +10.1. Agreement. “Agreement” means this W3C Community Final Specification Agreement. +10.2. Corresponding Working Group. “Corresponding Working Group” is a W3C Working Group that is chartered to develop a Recommendation, as defined in the W3C Process Document, that takes the Specification as an input. +10.3. Essential Claims. “Essential Claims” shall mean all claims in any patent or patent application in any jurisdiction in the world that would necessarily be infringed by implementation of the Specification. A claim is necessarily infringed hereunder only when it is not possible to avoid infringing it because there is no non-infringing alternative for implementing the normative portions of the Specification. Existence of a non-infringing alternative shall be judged based on the state of the art at the time of the publication of the Specification. The following are expressly excluded from and shall not be deemed to constitute Essential Claims: +10.3.1. any claims other than as set forth above even if contained in the same patent as Essential Claims; and +10.3.2. claims which would be infringed only by: +portions of an implementation that are not specified in the normative portions of the Specification, or +enabling technologies that may be necessary to make or use any product or portion thereof that complies with the Specification and are not themselves expressly set forth in the Specification (e.g., semiconductor manufacturing technology, compiler technology, object-oriented technology, basic operating system technology, and the like); or +the implementation of technology developed elsewhere and merely incorporated by reference in the body of the Specification. +10.3.3. design patents and design registrations. +For purposes of this definition, the normative portions of the Specification shall be deemed to include only architectural and interoperability requirements. Optional features in the RFC 2119 sense are considered normative unless they are specifically identified as informative. Implementation examples or any other material that merely illustrate the requirements of the Specification are informative, rather than normative. +10.4. I, Me, or My. “I,” “me,” or “my” refers to the signatory. +10.5 Project. “Project” means the W3C Community Group or Business Group for which I executed this Agreement. +10.6. Specification. “Specification” means the Specification identified by the Project as the target of this agreement in a call for Final Specification Commitments. W3C shall provide the authoritative mechanisms for the identification of this Specification. +10.7. W3C Community RF Licensing Requirements. “W3C Community RF Licensing Requirements” license shall mean a non-assignable, non-sublicensable license to make, have made, use, sell, have sold, offer to sell, import, and distribute and dispose of implementations of the Specification that: +10.7.1. shall be available to all, worldwide, whether or not they are W3C Members; +10.7.2. shall extend to all Essential Claims owned or controlled by me; +10.7.3. may be limited to implementations of the Specification, and to what is required by the Specification; +10.7.4. may be conditioned on a grant of a reciprocal RF license (as defined in this policy) to all Essential Claims owned or controlled by the licensee. A reciprocal license may be required to be available to all, and a reciprocal license may itself be conditioned on a further reciprocal license from all. +10.7.5. may not be conditioned on payment of royalties, fees or other consideration; +10.7.6. may be suspended with respect to any licensee when licensor issued by licensee for infringement of claims essential to implement the Specification or any W3C Recommendation; +10.7.7. may not impose any further conditions or restrictions on the use of any technology, intellectual property rights, or other restrictions on behavior of the licensee, but may include reasonable, customary terms relating to operation or maintenance of the license relationship such as the following: choice of law and dispute resolution; +10.7.8. shall not be considered accepted by an implementer who manifests an intent not to accept the terms of the W3C Community RF Licensing Requirements license as offered by the licensor. +10.7.9. The RF license conforming to the requirements in this policy shall be made available by the licensor as long as the Specification is in effect. The term of such license shall be for the life of the patents in question. +I am encouraged to provide a contact from which licensing information can be obtained and other relevant licensing information. Any such information will be made publicly available. +10.8. You or Your. “You,” “you,” or “your” means any person or entity who exercises copyright or patent rights granted under this Agreement, and any person that person or entity controls. + +------------------------------------------------------------------------------------- + +------------------- WebGL ----------------------------- +Copyright (c) 2018 The Khronos Group Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and/or associated documentation files (the +"Materials"), to deal in the Materials without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Materials, and to +permit persons to whom the Materials are furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Materials. + +THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +------------------------------------------------------ + + +========================================= +END OF typescript NOTICES AND INFORMATION + + + + +%% HTML 5.1 W3C Working Draft version 08 October 2015 (http://www.w3.org/TR/2015/WD-html51-20151008/) +========================================= +Copyright © 2015 W3C® (MIT, ERCIM, Keio, Beihang). This software or document includes material copied +from or derived from HTML 5.1 W3C Working Draft (http://www.w3.org/TR/2015/WD-html51-20151008/.) + +THIS DOCUMENT IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT +NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF +THE DOCUMENT ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY +PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. + +COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE +DOCUMENT OR THE PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF. + +The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to this document or its contents +without specific, written prior permission. Title to copyright in this document will at all times remain with copyright holders. +========================================= +END OF HTML 5.1 W3C Working Draft NOTICES AND INFORMATION + + + + +%% JS Beautifier version 1.6.2 (https://github.com/beautify-web/js-beautify) +========================================= +The MIT License (MIT) + +Copyright (c) 2007-2017 Einar Lielmanis, Liam Newman, and contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +========================================= +END OF js-beautify NOTICES AND INFORMATION + + + + +%% Ionic documentation version 1.2.4 (https://github.com/driftyco/ionic-site) +========================================= +Copyright Drifty Co. http://drifty.com/. + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS +========================================= +END OF Ionic documentation NOTICES AND INFORMATION + + + + +%% vscode-swift version 0.0.1 (https://github.com/owensd/vscode-swift) +========================================= +The MIT License (MIT) + +Copyright (c) 2015 David Owens II + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +========================================= +END OF vscode-swift NOTICES AND INFORMATION + diff --git a/desktop/flutter_app/assets/monaco/index.html b/desktop/flutter_app/assets/monaco/index.html new file mode 100644 index 000000000..2ea533d12 --- /dev/null +++ b/desktop/flutter_app/assets/monaco/index.html @@ -0,0 +1,35 @@ + + + + + + ABK Monaco + + + +
+ + + + diff --git a/desktop/flutter_app/assets/monaco/shell.js b/desktop/flutter_app/assets/monaco/shell.js new file mode 100644 index 000000000..d928f57e1 --- /dev/null +++ b/desktop/flutter_app/assets/monaco/shell.js @@ -0,0 +1,230 @@ +(function () { + const hostBridge = + globalThis.webkit && + globalThis.webkit.messageHandlers && + globalThis.webkit.messageHandlers.abk; + const postHostMessage = (message) => { + try { + hostBridge && hostBridge.postMessage(message); + } catch (error) { + console.error("ABK Monaco bridge error", error); + } + }; + + const editorState = { + editor: null, + model: null, + followTail: false, + maxRetainedLines: null, + theme: "light", + language: "plaintext", + themeData: null, + }; + + const defaultThemeData = { + background: "#f6f8fa", + foreground: "#111827", + lineNumber: "#94a3b8", + activeLineNumber: "#334155", + gutterBackground: "#f6f8fa", + widgetBackground: "#ffffff", + selectionBackground: "#bfdbfe", + inactiveSelectionBackground: "#dbeafe", + comment: "#6b7280", + string: "#0f766e", + number: "#b45309", + keyword: "#1d4ed8", + }; + + const isNearBottom = () => { + if (!editorState.editor) { + return false; + } + const editor = editorState.editor; + const layout = editor.getLayoutInfo(); + const distance = + editor.getScrollHeight() - (editor.getScrollTop() + layout.height); + return distance <= 24; + }; + + const scrollToBottom = () => { + if (!editorState.editor) { + return; + } + const editor = editorState.editor; + editor.setScrollTop(editor.getScrollHeight()); + }; + + const trimModelToRetentionLimit = () => { + const { model, maxRetainedLines } = editorState; + if (!model || !maxRetainedLines || maxRetainedLines < 1) { + return; + } + const lineCount = model.getLineCount(); + if (lineCount <= maxRetainedLines) { + return; + } + const deleteThroughLine = lineCount - maxRetainedLines + 1; + model.applyEdits([ + { + range: new monaco.Range(1, 1, deleteThroughLine, 1), + text: "", + }, + ]); + }; + + const ensureModel = (content, language) => { + const nextLanguage = language || "plaintext"; + if (!editorState.model) { + editorState.model = monaco.editor.createModel(content || "", nextLanguage); + editorState.editor.setModel(editorState.model); + return; + } + if (editorState.language !== nextLanguage) { + monaco.editor.setModelLanguage(editorState.model, nextLanguage); + } + editorState.language = nextLanguage; + }; + + const normalizeThemeData = (themeData) => ({ + ...defaultThemeData, + ...(themeData || {}), + }); + + const applyTheme = (theme, themeData) => { + editorState.theme = theme === "dark" ? "dark" : "light"; + editorState.themeData = normalizeThemeData(themeData); + const palette = editorState.themeData; + monaco.editor.defineTheme("abk-theme", { + base: editorState.theme === "dark" ? "vs-dark" : "vs", + inherit: true, + rules: [ + { token: "comment", foreground: palette.comment.slice(1) }, + { token: "string", foreground: palette.string.slice(1) }, + { token: "number", foreground: palette.number.slice(1) }, + { token: "keyword", foreground: palette.keyword.slice(1) }, + ], + colors: { + "editor.background": palette.background, + "editor.foreground": palette.foreground, + "editorLineNumber.foreground": palette.lineNumber, + "editorLineNumber.activeForeground": palette.activeLineNumber, + "editorGutter.background": palette.gutterBackground, + "editorWidget.background": palette.widgetBackground, + "editor.selectionBackground": palette.selectionBackground, + "editor.inactiveSelectionBackground": palette.inactiveSelectionBackground, + }, + }); + document.body.style.background = palette.background; + monaco.editor.setTheme("abk-theme"); + }; + + const replaceContent = (content) => { + ensureModel(content || "", editorState.language); + const shouldFollow = editorState.followTail || isNearBottom(); + editorState.model.setValue(content || ""); + trimModelToRetentionLimit(); + if (shouldFollow) { + requestAnimationFrame(scrollToBottom); + } + }; + + const appendContent = (content) => { + if (!content) { + return; + } + ensureModel("", editorState.language); + const shouldFollow = editorState.followTail || isNearBottom(); + const lineCount = editorState.model.getLineCount(); + const endColumn = editorState.model.getLineMaxColumn(lineCount); + editorState.model.applyEdits([ + { + range: new monaco.Range(lineCount, endColumn, lineCount, endColumn), + text: content, + }, + ]); + trimModelToRetentionLimit(); + if (shouldFollow) { + requestAnimationFrame(scrollToBottom); + } + }; + + const handleHostMessage = (raw) => { + const message = typeof raw === "string" ? JSON.parse(raw) : raw; + switch (message.type) { + case "initialize": + editorState.followTail = message.followTail === true; + editorState.maxRetainedLines = + typeof message.maxRetainedLines === "number" + ? message.maxRetainedLines + : null; + editorState.language = message.language || "plaintext"; + ensureModel(message.content || "", editorState.language); + applyTheme(message.theme, message.themeData); + replaceContent(message.content || ""); + break; + case "replaceContent": + replaceContent(message.content || ""); + break; + case "appendContent": + appendContent(message.content || ""); + break; + case "setLanguage": + editorState.language = message.language || "plaintext"; + ensureModel(editorState.model ? editorState.model.getValue() : "", editorState.language); + break; + case "setTheme": + applyTheme(message.theme, message.themeData); + break; + case "setFollowTail": + editorState.followTail = message.followTail === true; + if (editorState.followTail) { + requestAnimationFrame(scrollToBottom); + } + break; + case "setRetentionLimit": + editorState.maxRetainedLines = + typeof message.maxRetainedLines === "number" + ? message.maxRetainedLines + : null; + trimModelToRetentionLimit(); + break; + default: + console.warn("Unknown Monaco host message", message); + } + }; + + const boot = () => { + const container = document.getElementById("container"); + editorState.editor = monaco.editor.create(container, { + value: "", + language: "plaintext", + automaticLayout: true, + readOnly: true, + lineNumbers: "on", + lineNumbersMinChars: 4, + glyphMargin: false, + folding: true, + scrollBeyondLastLine: false, + minimap: { enabled: false }, + renderLineHighlight: "none", + wordWrap: "off", + stickyScroll: { enabled: false }, + find: { + addExtraSpaceOnTop: false, + }, + }); + editorState.editor.onDidScrollChange(() => { + editorState.followTail = isNearBottom(); + }); + globalThis.abkMonaco = { + handleHostMessage, + }; + postHostMessage("ready"); + }; + + require.config({ paths: { vs: "./vs" } }); + require(["vs/editor/editor.main"], boot, (error) => { + console.error("Failed to boot Monaco", error); + }); +})(); diff --git a/desktop/flutter_app/assets/monaco/vs/_commonjsHelpers-CT9FvmAN.js b/desktop/flutter_app/assets/monaco/vs/_commonjsHelpers-CT9FvmAN.js new file mode 100644 index 000000000..237b3c86f --- /dev/null +++ b/desktop/flutter_app/assets/monaco/vs/_commonjsHelpers-CT9FvmAN.js @@ -0,0 +1 @@ +define("vs/_commonjsHelpers-CT9FvmAN",["exports"],(function(t){"use strict";function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}t.getDefaultExportFromCjs=o})); diff --git a/desktop/flutter_app/assets/monaco/vs/abap-D-t0cyap.js b/desktop/flutter_app/assets/monaco/vs/abap-D-t0cyap.js new file mode 100644 index 000000000..f754d56ce --- /dev/null +++ b/desktop/flutter_app/assets/monaco/vs/abap-D-t0cyap.js @@ -0,0 +1 @@ +define("vs/abap-D-t0cyap",["exports"],(function(e){"use strict";const t={comments:{lineComment:"*"},brackets:[["[","]"],["(",")"]]},n={defaultToken:"invalid",ignoreCase:!0,tokenPostfix:".abap",keywords:["abap-source","abbreviated","abstract","accept","accepting","according","activation","actual","add","add-corresponding","adjacent","after","alias","aliases","align","all","allocate","alpha","analysis","analyzer","and","append","appendage","appending","application","archive","area","arithmetic","as","ascending","aspect","assert","assign","assigned","assigning","association","asynchronous","at","attributes","authority","authority-check","avg","back","background","backup","backward","badi","base","before","begin","between","big","binary","bintohex","bit","black","blank","blanks","blob","block","blocks","blue","bound","boundaries","bounds","boxed","break-point","buffer","by","bypassing","byte","byte-order","call","calling","case","cast","casting","catch","center","centered","chain","chain-input","chain-request","change","changing","channels","character","char-to-hex","check","checkbox","ci_","circular","class","class-coding","class-data","class-events","class-methods","class-pool","cleanup","clear","client","clob","clock","close","coalesce","code","coding","col_background","col_group","col_heading","col_key","col_negative","col_normal","col_positive","col_total","collect","color","column","columns","comment","comments","commit","common","communication","comparing","component","components","compression","compute","concat","concat_with_space","concatenate","cond","condense","condition","connect","connection","constants","context","contexts","continue","control","controls","conv","conversion","convert","copies","copy","corresponding","country","cover","cpi","create","creating","critical","currency","currency_conversion","current","cursor","cursor-selection","customer","customer-function","dangerous","data","database","datainfo","dataset","date","dats_add_days","dats_add_months","dats_days_between","dats_is_valid","daylight","dd/mm/yy","dd/mm/yyyy","ddmmyy","deallocate","decimal_shift","decimals","declarations","deep","default","deferred","define","defining","definition","delete","deleting","demand","department","descending","describe","destination","detail","dialog","directory","disconnect","display","display-mode","distinct","divide","divide-corresponding","division","do","dummy","duplicate","duplicates","duration","during","dynamic","dynpro","edit","editor-call","else","elseif","empty","enabled","enabling","encoding","end","endat","endcase","endcatch","endchain","endclass","enddo","endenhancement","end-enhancement-section","endexec","endform","endfunction","endian","endif","ending","endinterface","end-lines","endloop","endmethod","endmodule","end-of-definition","end-of-editing","end-of-file","end-of-page","end-of-selection","endon","endprovide","endselect","end-test-injection","end-test-seam","endtry","endwhile","endwith","engineering","enhancement","enhancement-point","enhancements","enhancement-section","entries","entry","enum","environment","equiv","errormessage","errors","escaping","event","events","exact","except","exception","exceptions","exception-table","exclude","excluding","exec","execute","exists","exit","exit-command","expand","expanding","expiration","explicit","exponent","export","exporting","extend","extended","extension","extract","fail","fetch","field","field-groups","fields","field-symbol","field-symbols","file","filter","filters","filter-table","final","find","first","first-line","fixed-point","fkeq","fkge","flush","font","for","form","format","forward","found","frame","frames","free","friends","from","function","functionality","function-pool","further","gaps","generate","get","giving","gkeq","gkge","global","grant","green","group","groups","handle","handler","harmless","hashed","having","hdb","header","headers","heading","head-lines","help-id","help-request","hextobin","hide","high","hint","hold","hotspot","icon","id","identification","identifier","ids","if","ignore","ignoring","immediately","implementation","implementations","implemented","implicit","import","importing","in","inactive","incl","include","includes","including","increment","index","index-line","infotypes","inheriting","init","initial","initialization","inner","inout","input","insert","instance","instances","instr","intensified","interface","interface-pool","interfaces","internal","intervals","into","inverse","inverted-date","is","iso","job","join","keep","keeping","kernel","key","keys","keywords","kind","language","last","late","layout","leading","leave","left","left-justified","leftplus","leftspace","legacy","length","let","level","levels","like","line","lines","line-count","linefeed","line-selection","line-size","list","listbox","list-processing","little","llang","load","load-of-program","lob","local","locale","locator","logfile","logical","log-point","long","loop","low","lower","lpad","lpi","ltrim","mail","main","major-id","mapping","margin","mark","mask","match","matchcode","max","maximum","medium","members","memory","mesh","message","message-id","messages","messaging","method","methods","min","minimum","minor-id","mm/dd/yy","mm/dd/yyyy","mmddyy","mode","modif","modifier","modify","module","move","move-corresponding","multiply","multiply-corresponding","name","nametab","native","nested","nesting","new","new-line","new-page","new-section","next","no","no-display","no-extension","no-gap","no-gaps","no-grouping","no-heading","no-scrolling","no-sign","no-title","no-topofpage","no-zero","node","nodes","non-unicode","non-unique","not","null","number","object","objects","obligatory","occurrence","occurrences","occurs","of","off","offset","ole","on","only","open","option","optional","options","or","order","other","others","out","outer","output","output-length","overflow","overlay","pack","package","pad","padding","page","pages","parameter","parameters","parameter-table","part","partially","pattern","percentage","perform","performing","person","pf1","pf10","pf11","pf12","pf13","pf14","pf15","pf2","pf3","pf4","pf5","pf6","pf7","pf8","pf9","pf-status","pink","places","pool","pos_high","pos_low","position","pragmas","precompiled","preferred","preserving","primary","print","print-control","priority","private","procedure","process","program","property","protected","provide","public","push","pushbutton","put","queue-only","quickinfo","radiobutton","raise","raising","range","ranges","read","reader","read-only","receive","received","receiver","receiving","red","redefinition","reduce","reduced","ref","reference","refresh","regex","reject","remote","renaming","replace","replacement","replacing","report","request","requested","reserve","reset","resolution","respecting","responsible","result","results","resumable","resume","retry","return","returncode","returning","returns","right","right-justified","rightplus","rightspace","risk","rmc_communication_failure","rmc_invalid_status","rmc_system_failure","role","rollback","rows","rpad","rtrim","run","sap","sap-spool","saving","scale_preserving","scale_preserving_scientific","scan","scientific","scientific_with_leading_zero","scroll","scroll-boundary","scrolling","search","secondary","seconds","section","select","selection","selections","selection-screen","selection-set","selection-sets","selection-table","select-options","send","separate","separated","set","shared","shift","short","shortdump-id","sign_as_postfix","single","size","skip","skipping","smart","some","sort","sortable","sorted","source","specified","split","spool","spots","sql","sqlscript","stable","stamp","standard","starting","start-of-editing","start-of-selection","state","statement","statements","static","statics","statusinfo","step-loop","stop","structure","structures","style","subkey","submatches","submit","subroutine","subscreen","subtract","subtract-corresponding","suffix","sum","summary","summing","supplied","supply","suppress","switch","switchstates","symbol","syncpoints","syntax","syntax-check","syntax-trace","system-call","system-exceptions","system-exit","tab","tabbed","table","tables","tableview","tabstrip","target","task","tasks","test","testing","test-injection","test-seam","text","textpool","then","throw","time","times","timestamp","timezone","tims_is_valid","title","titlebar","title-lines","to","tokenization","tokens","top-lines","top-of-page","trace-file","trace-table","trailing","transaction","transfer","transformation","translate","transporting","trmac","truncate","truncation","try","tstmp_add_seconds","tstmp_current_utctimestamp","tstmp_is_valid","tstmp_seconds_between","type","type-pool","type-pools","types","uline","unassign","under","unicode","union","unique","unit_conversion","unix","unpack","until","unwind","up","update","upper","user","user-command","using","utf-8","valid","value","value-request","values","vary","varying","verification-message","version","via","view","visible","wait","warning","when","whenever","where","while","width","window","windows","with","with-heading","without","with-title","word","work","write","writer","xml","xsd","yellow","yes","yymmdd","zero","zone","abap_system_timezone","abap_user_timezone","access","action","adabas","adjust_numbers","allow_precision_loss","allowed","amdp","applicationuser","as_geo_json","as400","associations","balance","behavior","breakup","bulk","cds","cds_client","check_before_save","child","clients","corr","corr_spearman","cross","cycles","datn_add_days","datn_add_months","datn_days_between","dats_from_datn","dats_tims_to_tstmp","dats_to_datn","db2","db6","ddl","dense_rank","depth","deterministic","discarding","entities","entity","error","failed","finalize","first_value","fltp_to_dec","following","fractional","full","graph","grouping","hierarchy","hierarchy_ancestors","hierarchy_ancestors_aggregate","hierarchy_descendants","hierarchy_descendants_aggregate","hierarchy_siblings","incremental","indicators","lag","last_value","lead","leaves","like_regexpr","link","locale_sap","lock","locks","many","mapped","matched","measures","median","mssqlnt","multiple","nodetype","ntile","nulls","occurrences_regexpr","one","operations","oracle","orphans","over","parent","parents","partition","pcre","period","pfcg_mapping","preceding","privileged","product","projection","rank","redirected","replace_regexpr","reported","response","responses","root","row","row_number","sap_system_date","save","schema","session","sets","shortdump","siblings","spantree","start","stddev","string_agg","subtotal","sybase","tims_from_timn","tims_to_timn","to_blob","to_clob","total","trace-entry","tstmp_to_dats","tstmp_to_dst","tstmp_to_tims","tstmpl_from_utcl","tstmpl_to_utcl","unbounded","utcl_add_seconds","utcl_current","utcl_seconds_between","uuid","var","verbatim"],builtinFunctions:["abs","acos","asin","atan","bit-set","boolc","boolx","ceil","char_off","charlen","cmax","cmin","concat_lines_of","contains","contains_any_not_of","contains_any_of","cos","cosh","count","count_any_not_of","count_any_of","dbmaxlen","distance","escape","exp","find_any_not_of","find_any_of","find_end","floor","frac","from_mixed","ipow","line_exists","line_index","log","log10","matches","nmax","nmin","numofchar","repeat","rescale","reverse","round","segment","shift_left","shift_right","sign","sin","sinh","sqrt","strlen","substring","substring_after","substring_before","substring_from","substring_to","tan","tanh","to_lower","to_mixed","to_upper","trunc","utclong_add","utclong_current","utclong_diff","xsdbool","xstrlen"],typeKeywords:["b","c","d","decfloat16","decfloat34","f","i","int8","n","p","s","string","t","utclong","x","xstring","any","clike","csequence","decfloat","numeric","simple","xsequence","accp","char","clnt","cuky","curr","datn","dats","d16d","d16n","d16r","d34d","d34n","d34r","dec","df16_dec","df16_raw","df34_dec","df34_raw","fltp","geom_ewkb","int1","int2","int4","lang","lchr","lraw","numc","quan","raw","rawstring","sstring","timn","tims","unit","utcl","df16_scl","df34_scl","prec","varc","abap_bool","abap_false","abap_true","abap_undefined","me","screen","space","super","sy","syst","table_line","*sys*"],builtinMethods:["class_constructor","constructor"],derivedTypes:["%CID","%CID_REF","%CONTROL","%DATA","%ELEMENT","%FAIL","%KEY","%MSG","%PARAM","%PID","%PID_ASSOC","%PID_PARENT","%_HINTS"],cdsLanguage:["@AbapAnnotation","@AbapCatalog","@AccessControl","@API","@ClientDependent","@ClientHandling","@CompatibilityContract","@DataAging","@EndUserText","@Environment","@LanguageDependency","@MappingRole","@Metadata","@MetadataExtension","@ObjectModel","@Scope","@Semantics","$EXTENSION","$SELF"],selectors:["->","->*","=>","~","~*"],operators:[" +"," -","/","*","**","div","mod","=","#","@","+=","-=","*=","/=","**=","&&=","?=","&","&&","bit-and","bit-not","bit-or","bit-xor","m","o","z","<"," >","<=",">=","<>","><","=<","=>","bt","byte-ca","byte-cn","byte-co","byte-cs","byte-na","byte-ns","ca","cn","co","cp","cs","eq","ge","gt","le","lt","na","nb","ne","np","ns","*/","*:","--","/*","//"],symbols:/[=>))*/,{cases:{"@typeKeywords":"type","@keywords":"keyword","@cdsLanguage":"annotation","@derivedTypes":"type","@builtinFunctions":"type","@builtinMethods":"type","@operators":"key","@default":"identifier"}}],[/<[\w]+>/,"identifier"],[/##[\w|_]+/,"comment"],{include:"@whitespace"},[/[:,.]/,"delimiter"],[/[{}()\[\]]/,"@brackets"],[/@symbols/,{cases:{"@selectors":"tag","@operators":"key","@default":""}}],[/'/,{token:"string",bracket:"@open",next:"@stringquote"}],[/`/,{token:"string",bracket:"@open",next:"@stringping"}],[/\|/,{token:"string",bracket:"@open",next:"@stringtemplate"}],[/\d+/,"number"]],stringtemplate:[[/[^\\\|]+/,"string"],[/\\\|/,"string"],[/\|/,{token:"string",bracket:"@close",next:"@pop"}]],stringping:[[/[^\\`]+/,"string"],[/`/,{token:"string",bracket:"@close",next:"@pop"}]],stringquote:[[/[^\\']+/,"string"],[/'/,{token:"string",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[/^\*.*$/,"comment"],[/\".*$/,"comment"]]}};e.conf=t,e.language=n,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})); diff --git a/desktop/flutter_app/assets/monaco/vs/apex-CcIm7xu6.js b/desktop/flutter_app/assets/monaco/vs/apex-CcIm7xu6.js new file mode 100644 index 000000000..11ff90742 --- /dev/null +++ b/desktop/flutter_app/assets/monaco/vs/apex-CcIm7xu6.js @@ -0,0 +1 @@ +define("vs/apex-CcIm7xu6",["exports"],(function(s){"use strict";const o={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:))")}}},n=["abstract","activate","and","any","array","as","asc","assert","autonomous","begin","bigdecimal","blob","boolean","break","bulk","by","case","cast","catch","char","class","collect","commit","const","continue","convertcurrency","decimal","default","delete","desc","do","double","else","end","enum","exception","exit","export","extends","false","final","finally","float","for","from","future","get","global","goto","group","having","hint","if","implements","import","in","inner","insert","instanceof","int","interface","into","join","last_90_days","last_month","last_n_days","last_week","like","limit","list","long","loop","map","merge","native","new","next_90_days","next_month","next_n_days","next_week","not","null","nulls","number","object","of","on","or","outer","override","package","parallel","pragma","private","protected","public","retrieve","return","returning","rollback","savepoint","search","select","set","short","sort","stat","static","strictfp","super","switch","synchronized","system","testmethod","then","this","this_month","this_week","throw","throws","today","tolabel","tomorrow","transaction","transient","trigger","true","try","type","undelete","update","upsert","using","virtual","void","volatile","webservice","when","where","while","yesterday"],i=e=>e.charAt(0).toUpperCase()+e.substr(1);let t=[];n.forEach(e=>{t.push(e),t.push(e.toUpperCase()),t.push(i(e))});const a={defaultToken:"",tokenPostfix:".apex",keywords:t,operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,"annotation"],[/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)[fFdD]/,"number.float"],[/(@digits)[lL]?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@apexdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],apexdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}};s.conf=o,s.language=a,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})})); diff --git a/desktop/flutter_app/assets/monaco/vs/assets/css.worker-HnVq6Ewq.js b/desktop/flutter_app/assets/monaco/vs/assets/css.worker-HnVq6Ewq.js new file mode 100644 index 000000000..2bc0d0481 --- /dev/null +++ b/desktop/flutter_app/assets/monaco/vs/assets/css.worker-HnVq6Ewq.js @@ -0,0 +1,93 @@ +(function(){"use strict";var lt,Ce,ne;class rh{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?It.isErrorNoTelemetry(e)?new It(e.message+` + +`+e.stack):new Error(e.message+` + +`+e.stack):e},0)}}emit(e){this.listeners.forEach(n=>{n(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const ih=new rh;function $n(t){sh(t)||ih.onUnexpectedError(t)}function Tr(t){if(t instanceof Error){const{name:e,message:n,cause:r}=t,i=t.stacktrace||t.stack;return{$isError:!0,name:e,message:n,stack:i,noTelemetry:It.isErrorNoTelemetry(t),cause:r?Tr(r):void 0,code:t.code}}return t}const Or="Canceled";function sh(t){return t instanceof zs?!0:t instanceof Error&&t.name===Or&&t.message===Or}class zs extends Error{constructor(){super(Or),this.name=this.message}}class It extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof It)return e;const n=new It;return n.message=e.message,n.stack=e.stack,n}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class be extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,be.prototype)}}function ah(t,e="Unreachable"){throw new Error(e)}function oh(t,e="unexpected state"){if(!t)throw typeof e=="string"?new be(`Assertion Failed: ${e}`):e}function Un(t){if(!t()){debugger;t(),$n(new be("Assertion Failed"))}}function Ps(t,e){let n=0;for(;n=0;R--)yield I[R]}t.reverse=o;function l(I){return!I||I[Symbol.iterator]().next().done===!0}t.isEmpty=l;function c(I){return I[Symbol.iterator]().next().value}t.first=c;function d(I,R){let z=0;for(const $ of I)if(R($,z++))return!0;return!1}t.some=d;function u(I,R){let z=0;for(const $ of I)if(!R($,z++))return!1;return!0}t.every=u;function m(I,R){for(const z of I)if(R(z))return z}t.find=m;function*f(I,R){for(const z of I)R(z)&&(yield z)}t.filter=f;function*g(I,R){let z=0;for(const $ of I)yield R($,z++)}t.map=g;function*b(I,R){let z=0;for(const $ of I)yield*R($,z++)}t.flatMap=b;function*k(...I){for(const R of I)ch(R)?yield*R:yield R}t.concat=k;function F(I,R,z){let $=z;for(const L of I)$=R($,L);return $}t.reduce=F;function N(I){let R=0;for(const z of I)R++;return R}t.length=N;function*_(I,R,z=I.length){for(R<-I.length&&(R=0),R<0&&(R+=I.length),z<0?z+=I.length:z>I.length&&(z=I.length);R1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function hh(...t){return qn(()=>Ts(t))}class dh{constructor(e){this._isDisposed=!1,this._fn=e}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,this._fn()}}}function qn(t){return new dh(t)}const Dr=class Dr{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Ts(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===wt.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Dr.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}};Dr.DISABLE_DISPOSED_WARNING=!1;let cn=Dr;const Ds=class Ds{constructor(){this._store=new cn,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Ds.None=Object.freeze({dispose(){}});let wt=Ds,le=(lt=class{constructor(e){this.element=e,this.next=lt.Undefined,this.prev=lt.Undefined}},lt.Undefined=new lt(void 0),lt);class uh{constructor(){this._first=le.Undefined,this._last=le.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===le.Undefined}clear(){let e=this._first;for(;e!==le.Undefined;){const n=e.next;e.prev=le.Undefined,e.next=le.Undefined,e=n}this._first=le.Undefined,this._last=le.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,n){const r=new le(e);if(this._first===le.Undefined)this._first=r,this._last=r;else if(n){const s=this._last;this._last=r,r.prev=s,s.next=r}else{const s=this._first;this._first=r,r.next=s,s.prev=r}this._size+=1;let i=!1;return()=>{i||(i=!0,this._remove(r))}}shift(){if(this._first!==le.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==le.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==le.Undefined&&e.next!==le.Undefined){const n=e.prev;n.next=e.next,e.next.prev=n}else e.prev===le.Undefined&&e.next===le.Undefined?(this._first=le.Undefined,this._last=le.Undefined):e.next===le.Undefined?(this._last=this._last.prev,this._last.next=le.Undefined):e.prev===le.Undefined&&(this._first=this._first.next,this._first.prev=le.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==le.Undefined;)yield e.element,e=e.next}}const ph=globalThis.performance.now.bind(globalThis.performance);class jn{static create(e){return new jn(e)}constructor(e){this._now=e===!1?Date.now:ph,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var Wr;(function(t){t.None=()=>wt.None;function e(y,E){return m(y,()=>{},0,void 0,!0,void 0,E)}t.defer=e;function n(y){return(E,D=null,A)=>{let M=!1,P;return P=y(H=>{if(!M)return P?P.dispose():M=!0,E.call(D,H)},null,A),M&&P.dispose(),P}}t.once=n;function r(y,E){return t.once(t.filter(y,E))}t.onceIf=r;function i(y,E,D){return d((A,M=null,P)=>y(H=>A.call(M,E(H)),null,P),D)}t.map=i;function s(y,E,D){return d((A,M=null,P)=>y(H=>{E(H),A.call(M,H)},null,P),D)}t.forEach=s;function a(y,E,D){return d((A,M=null,P)=>y(H=>E(H)&&A.call(M,H),null,P),D)}t.filter=a;function o(y){return y}t.signal=o;function l(...y){return(E,D=null,A)=>{const M=hh(...y.map(P=>P(H=>E.call(D,H))));return u(M,A)}}t.any=l;function c(y,E,D,A){let M=D;return i(y,P=>(M=E(M,P),M),A)}t.reduce=c;function d(y,E){let D;const A={onWillAddFirstListener(){D=y(M.fire,M)},onDidRemoveLastListener(){D?.dispose()}},M=new Ue(A);return E?.add(M),M.event}function u(y,E){return E instanceof Array?E.push(y):E&&E.add(y),y}function m(y,E,D=100,A=!1,M=!1,P,H){let ee,G,xe,on=0,bt;const As={leakWarningThreshold:P,onWillAddFirstListener(){ee=y(Ef=>{on++,G=E(G,Ef),A&&!xe&&(ln.fire(G),G=void 0),bt=()=>{const Ff=G;G=void 0,xe=void 0,(!A||on>1)&&ln.fire(Ff),on=0},typeof D=="number"?(xe&&clearTimeout(xe),xe=setTimeout(bt,D)):xe===void 0&&(xe=null,queueMicrotask(bt))})},onWillRemoveListener(){M&&on>0&&bt?.()},onDidRemoveLastListener(){bt=void 0,ee.dispose()}},ln=new Ue(As);return H?.add(ln),ln.event}t.debounce=m;function f(y,E=0,D){return t.debounce(y,(A,M)=>A?(A.push(M),A):[M],E,void 0,!0,void 0,D)}t.accumulate=f;function g(y,E=(A,M)=>A===M,D){let A=!0,M;return a(y,P=>{const H=A||!E(P,M);return A=!1,M=P,H},D)}t.latch=g;function b(y,E,D){return[t.filter(y,E,D),t.filter(y,A=>!E(A),D)]}t.split=b;function k(y,E=!1,D=[],A){let M=D.slice(),P=y(G=>{M?M.push(G):ee.fire(G)});A&&A.add(P);const H=()=>{M?.forEach(G=>ee.fire(G)),M=null},ee=new Ue({onWillAddFirstListener(){P||(P=y(G=>ee.fire(G)),A&&A.add(P))},onDidAddFirstListener(){M&&(E?setTimeout(H):H())},onDidRemoveLastListener(){P&&P.dispose(),P=null}});return A&&A.add(ee),ee.event}t.buffer=k;function F(y,E){return(A,M,P)=>{const H=E(new _);return y(function(ee){const G=H.evaluate(ee);G!==N&&A.call(M,G)},void 0,P)}}t.chain=F;const N=Symbol("HaltChainable");class _{constructor(){this.steps=[]}map(E){return this.steps.push(E),this}forEach(E){return this.steps.push(D=>(E(D),D)),this}filter(E){return this.steps.push(D=>E(D)?D:N),this}reduce(E,D){let A=D;return this.steps.push(M=>(A=E(A,M),A)),this}latch(E=(D,A)=>D===A){let D=!0,A;return this.steps.push(M=>{const P=D||!E(M,A);return D=!1,A=M,P?M:N}),this}evaluate(E){for(const D of this.steps)if(E=D(E),E===N)break;return E}}function T(y,E,D=A=>A){const A=(...ee)=>H.fire(D(...ee)),M=()=>y.on(E,A),P=()=>y.removeListener(E,A),H=new Ue({onWillAddFirstListener:M,onDidRemoveLastListener:P});return H.event}t.fromNodeEventEmitter=T;function O(y,E,D=A=>A){const A=(...ee)=>H.fire(D(...ee)),M=()=>y.addEventListener(E,A),P=()=>y.removeEventListener(E,A),H=new Ue({onWillAddFirstListener:M,onDidRemoveLastListener:P});return H.event}t.fromDOMEventEmitter=O;function V(y,E){let D;const A=new Promise((M,P)=>{const H=n(y)(M,null,E);D=()=>H.dispose()});return A.cancel=D,A}t.toPromise=V;function I(y,E){return y(D=>E.fire(D))}t.forward=I;function R(y,E,D){return E(D),y(A=>E(A))}t.runAndSubscribe=R;class z{constructor(E,D){this._observable=E,this._counter=0,this._hasChanged=!1;const A={onWillAddFirstListener:()=>{E.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{E.removeObserver(this)}};this.emitter=new Ue(A),D&&D.add(this.emitter)}beginUpdate(E){this._counter++}handlePossibleChange(E){}handleChange(E,D){this._hasChanged=!0}endUpdate(E){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function $(y,E){return new z(y,E).emitter.event}t.fromObservable=$;function L(y){return(E,D,A)=>{let M=0,P=!1;const H={beginUpdate(){M++},endUpdate(){M--,M===0&&(y.reportChanges(),P&&(P=!1,E.call(D)))},handlePossibleChange(){},handleChange(){P=!0}};y.addObserver(H),y.reportChanges();const ee={dispose(){y.removeObserver(H)}};return A instanceof cn?A.add(ee):Array.isArray(A)&&A.push(ee),ee}}t.fromObservableLight=L})(Wr||(Wr={}));const nn=class nn{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${nn._idPool++}`,nn.all.add(this)}start(e){this._stopWatch=new jn,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};nn.all=new Set,nn._idPool=0;let Vr=nn,mh=-1;const Lr=class Lr{constructor(e,n,r=(Lr._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,n){const r=this.threshold;if(r<=0||n{const s=this._stacks.get(e.value)||0;this._stacks.set(e.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,n=0;for(const[r,i]of this._stacks)(!e||n{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const o=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(o);const l=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],c=new gh(`${o}. HINT: Stack shows most frequent listener (${l[1]}-times)`,l[0]);return(this._options?.onListenerError||$n)(c),wt.None}if(this._disposed)return wt.None;n&&(e=e.bind(n));const i=new Br(e);let s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(i.stack=Ur.create(),s=this._leakageMon.check(i.stack,this._size+1)),this._listeners?this._listeners instanceof Br?(this._deliveryQueue??=new wh,this._listeners=[this._listeners,i]):this._listeners.push(i):(this._options?.onWillAddFirstListener?.(this),this._listeners=i,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;const a=qn(()=>{s?.(),this._removeListener(i)});return r instanceof cn?r.add(a):Array.isArray(r)&&r.push(a),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}const n=this._listeners,r=n.indexOf(e);if(r===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[r]=void 0;const i=this._deliveryQueue.current===this;if(this._size*bh<=n.length){let s=0;for(let a=0;a0}}class wh{constructor(){this.i=-1,this.end=0}enqueue(e,n,r){this.i=0,this.end=r,this.current=e,this.value=n}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}function vh(){return globalThis._VSCODE_NLS_MESSAGES}function Os(){return globalThis._VSCODE_NLS_LANGUAGE}const yh=Os()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function Ws(t,e){let n;return e.length===0?n=t:n=t.replace(/\{(\d+)\}/g,(r,i)=>{const s=i[0],a=e[s];let o=r;return typeof a=="string"?o=a:(typeof a=="number"||typeof a=="boolean"||a===void 0||a===null)&&(o=String(a)),o}),yh&&(n="["+n.replace(/[aouei]/g,"$&$&")+"]"),n}function B(t,e,...n){return Ws(typeof t=="number"?xh(t,e):e,n)}function xh(t,e){const n=vh()?.[t];if(typeof n!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return n}const Dt="en";let qr=!1,jr=!1,Hr=!1,Hn,Gr=Dt,Vs=Dt,Sh,Xe;const vt=globalThis;let ke;typeof vt.vscode<"u"&&typeof vt.vscode.process<"u"?ke=vt.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(ke=process);const Ch=typeof ke?.versions?.electron=="string"&&ke?.type==="renderer";if(typeof ke=="object"){qr=ke.platform==="win32",jr=ke.platform==="darwin",Hr=ke.platform==="linux",Hr&&ke.env.SNAP&&ke.env.SNAP_REVISION,ke.env.CI||ke.env.BUILD_ARTIFACTSTAGINGDIRECTORY||ke.env.GITHUB_WORKSPACE,Hn=Dt,Gr=Dt;const t=ke.env.VSCODE_NLS_CONFIG;if(t)try{const e=JSON.parse(t);Hn=e.userLocale,Vs=e.osLocale,Gr=e.resolvedLanguage||Dt,Sh=e.languagePack?.translationsConfigFile}catch{}}else typeof navigator=="object"&&!Ch?(Xe=navigator.userAgent,qr=Xe.indexOf("Windows")>=0,jr=Xe.indexOf("Macintosh")>=0,(Xe.indexOf("Macintosh")>=0||Xe.indexOf("iPad")>=0||Xe.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Hr=Xe.indexOf("Linux")>=0,Xe?.indexOf("Mobi")>=0,Gr=Os()||Dt,Hn=navigator.language.toLowerCase(),Vs=Hn):console.error("Unable to resolve platform.");const hn=qr,kh=jr,Be=Xe,_h=typeof vt.postMessage=="function"&&!vt.importScripts;(()=>{if(_h){const t=[];vt.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let r=0,i=t.length;r{const r=++e;t.push({id:r,callback:n}),vt.postMessage({vscodeScheduleAsyncWork:r},"*")}}return t=>setTimeout(t)})();const Eh=!!(Be&&Be.indexOf("Chrome")>=0);Be&&Be.indexOf("Firefox")>=0,!Eh&&Be&&Be.indexOf("Safari")>=0,Be&&Be.indexOf("Edg/")>=0,Be&&Be.indexOf("Android")>=0;function Fh(t){return t}class Rh{constructor(e,n){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=Fh):(this._fn=n,this._computeKey=e.getCacheKey)}get(e){const n=this._computeKey(e);return this.lastArgKey!==n&&(this.lastArgKey=n,this.lastCache=this._fn(e)),this.lastCache}}var yt;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Running=1]="Running",t[t.Completed=2]="Completed"})(yt||(yt={}));class Jr{constructor(e){this.executor=e,this._state=yt.Uninitialized}get value(){if(this._state===yt.Uninitialized){this._state=yt.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=yt.Completed}}else if(this._state===yt.Running)throw new Error("Cannot read the value of a lazy that is being initialized");if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}function Nh(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function Ih(t){return t.source==="^"||t.source==="^$"||t.source==="$"||t.source==="^\\s*$"?!1:!!(t.exec("")&&t.lastIndex===0)}function Dh(t){return t.split(/\r\n|\r|\n/)}function Lh(t){for(let e=0,n=t.length;e=0;n--){const r=t.charCodeAt(n);if(r!==32&&r!==9)return n}return-1}function $s(t){return t>=65&&t<=90}function Mh(t,e){const n=Math.min(t.length,e.length);let r;for(r=0;rJSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}')),Je.cache=new Rh({getCacheKey:JSON.stringify},e=>{function n(d){const u=new Map;for(let m=0;m!d.startsWith("_")&&Object.hasOwn(s,d));a.length===0&&(a=["_default"]);let o;for(const d of a){const u=n(s[d]);o=i(o,u)}const l=n(s._common),c=r(l,o);return new Je(c)}),Je._locales=new Jr(()=>Object.keys(Je.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")));let dn=Je;const rn=class rn{static getRawData(){return JSON.parse('{"_common":[11,12,13,127,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999],"cs":[173,8203,12288],"de":[173,8203,12288],"es":[8203,12288],"fr":[173,8203,12288],"it":[160,173,12288],"ja":[173],"ko":[173,12288],"pl":[173,8203,12288],"pt-BR":[173,8203,12288],"qps-ploc":[160,173,8203,12288],"ru":[173,12288],"tr":[160,173,8203,12288],"zh-hans":[160,173,8203,12288],"zh-hant":[173,12288]}')}static getData(){return this._data||(this._data=new Set([...Object.values(rn.getRawData())].flat())),this._data}static isInvisibleCharacter(e){return rn.getData().has(e)}static get codePoints(){return rn.getData()}};rn._data=void 0;let un=rn;const Yr="default",$h="$initialize";class Uh{constructor(e,n,r,i,s){this.vsWorker=e,this.req=n,this.channel=r,this.method=i,this.args=s,this.type=0}}class Us{constructor(e,n,r,i){this.vsWorker=e,this.seq=n,this.res=r,this.err=i,this.type=1}}class Bh{constructor(e,n,r,i,s){this.vsWorker=e,this.req=n,this.channel=r,this.eventName=i,this.arg=s,this.type=2}}class qh{constructor(e,n,r){this.vsWorker=e,this.req=n,this.event=r,this.type=3}}class jh{constructor(e,n){this.vsWorker=e,this.req=n,this.type=4}}class Hh{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}async sendMessage(e,n,r){const i=String(++this._lastSentReq);return new Promise((s,a)=>{this._pendingReplies[i]={resolve:s,reject:a},this._send(new Uh(this._workerId,i,e,n,r))})}listen(e,n,r){let i=null;const s=new Ue({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,s),this._send(new Bh(this._workerId,i,e,n,r))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new jh(this._workerId,i)),i=null}});return s.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}createProxyToRemoteChannel(e,n){const r={get:(i,s)=>(typeof s=="string"&&!i[s]&&(qs(s)?i[s]=a=>this.listen(e,s,a):Bs(s)?i[s]=this.listen(e,s,void 0):s.charCodeAt(0)===36&&(i[s]=async(...a)=>(await n?.(),this.sendMessage(e,s,a)))),i[s])};return new Proxy(Object.create(null),r)}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq]){console.warn("Got reply to unknown seq");return}const n=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let r=e.err;if(e.err.$isError){const i=new Error;i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack,r=i}n.reject(r);return}n.resolve(e.res)}_handleRequestMessage(e){const n=e.req;this._handler.handleMessage(e.channel,e.method,e.args).then(i=>{this._send(new Us(this._workerId,n,i,void 0))},i=>{i.detail instanceof Error&&(i.detail=Tr(i.detail)),this._send(new Us(this._workerId,n,void 0,Tr(i)))})}_handleSubscribeEventMessage(e){const n=e.req,r=this._handler.handleEvent(e.channel,e.eventName,e.arg)(i=>{this._send(new qh(this._workerId,n,i))});this._pendingEvents.set(n,r)}_handleEventMessage(e){if(!this._pendingEmitters.has(e.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(e.req).fire(e.event)}_handleUnsubscribeEventMessage(e){if(!this._pendingEvents.has(e.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)}_send(e){const n=[];if(e.type===0)for(let r=0;r{e(r,i)},handleMessage:(r,i,s)=>this._handleMessage(r,i,s),handleEvent:(r,i,s)=>this._handleEvent(r,i,s)}),this.requestHandler=n(this)}onmessage(e){this._protocol.handleMessage(e)}_handleMessage(e,n,r){if(e===Yr&&n===$h)return this.initialize(r[0]);const i=e===Yr?this.requestHandler:this._localChannels.get(e);if(!i)return Promise.reject(new Error(`Missing channel ${e} on worker thread`));const s=i[n];if(typeof s!="function")return Promise.reject(new Error(`Missing method ${n} on worker thread channel ${e}`));try{return Promise.resolve(s.apply(i,r))}catch(a){return Promise.reject(a)}}_handleEvent(e,n,r){const i=e===Yr?this.requestHandler:this._localChannels.get(e);if(!i)throw new Error(`Missing channel ${e} on worker thread`);if(qs(n)){const s=i[n];if(typeof s!="function")throw new Error(`Missing dynamic event ${n} on request handler.`);const a=s.call(i,r);if(typeof a!="function")throw new Error(`Missing dynamic event ${n} on request handler.`);return a}if(Bs(n)){const s=i[n];if(typeof s!="function")throw new Error(`Missing event ${n} on request handler.`);return s}throw new Error(`Malformed event name ${n}`)}getChannel(e){if(!this._remoteChannels.has(e)){const n=this._protocol.createProxyToRemoteChannel(e);this._remoteChannels.set(e,n)}return this._remoteChannels.get(e)}async initialize(e){this._protocol.setWorkerId(e)}}let js=!1;function Jh(t){if(js)throw new Error("WebWorker already initialized!");js=!0;const e=new Gh(n=>globalThis.postMessage(n),n=>t(n));return globalThis.onmessage=n=>{e.onmessage(n.data)},e}class ct{constructor(e,n,r,i){this.originalStart=e,this.originalLength=n,this.modifiedStart=r,this.modifiedLength=i}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}new Jr(()=>new Uint8Array(256));function Hs(t,e){return(e<<5)-e+t|0}function Xh(t,e){e=Hs(149417,e);for(let n=0,r=t.length;n0||this.m_modifiedCount>0)&&this.m_changes.push(new ct(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,n){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,n),this.m_originalCount++}AddModifiedElement(e,n){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,n),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class ht{constructor(e,n,r=null){this.ContinueProcessingPredicate=r,this._originalSequence=e,this._modifiedSequence=n;const[i,s,a]=ht._getElements(e),[o,l,c]=ht._getElements(n);this._hasStrings=a&&c,this._originalStringElements=i,this._originalElementsOrHash=s,this._modifiedStringElements=o,this._modifiedElementsOrHash=l,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]=="string"}static _getElements(e){const n=e.getElements();if(ht._isStringArray(n)){const r=new Int32Array(n.length);for(let i=0,s=n.length;i=e&&i>=r&&this.ElementsAreEqual(n,i);)n--,i--;if(e>n||r>i){let u;return r<=i?(Lt.Assert(e===n+1,"originalStart should only be one more than originalEnd"),u=[new ct(e,0,r,i-r+1)]):e<=n?(Lt.Assert(r===i+1,"modifiedStart should only be one more than modifiedEnd"),u=[new ct(e,n-e+1,r,0)]):(Lt.Assert(e===n+1,"originalStart should only be one more than originalEnd"),Lt.Assert(r===i+1,"modifiedStart should only be one more than modifiedEnd"),u=[]),u}const a=[0],o=[0],l=this.ComputeRecursionPoint(e,n,r,i,a,o,s),c=a[0],d=o[0];if(l!==null)return l;if(!s[0]){const u=this.ComputeDiffRecursive(e,c,r,d,s);let m=[];return s[0]?m=[new ct(c+1,n-(c+1)+1,d+1,i-(d+1)+1)]:m=this.ComputeDiffRecursive(c+1,n,d+1,i,s),this.ConcatenateChanges(u,m)}return[new ct(e,n-e+1,r,i-r+1)]}WALKTRACE(e,n,r,i,s,a,o,l,c,d,u,m,f,g,b,k,F,N){let _=null,T=null,O=new Js,V=n,I=r,R=f[0]-k[0]-i,z=-1073741824,$=this.m_forwardHistory.length-1;do{const L=R+e;L===V||L=0&&(c=this.m_forwardHistory[$],e=c[0],V=1,I=c.length-1)}while(--$>=-1);if(_=O.getReverseChanges(),N[0]){let L=f[0]+1,y=k[0]+1;if(_!==null&&_.length>0){const E=_[_.length-1];L=Math.max(L,E.getOriginalEnd()),y=Math.max(y,E.getModifiedEnd())}T=[new ct(L,m-L+1,y,b-y+1)]}else{O=new Js,V=a,I=o,R=f[0]-k[0]-l,z=1073741824,$=F?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const L=R+s;L===V||L=d[L+1]?(u=d[L+1]-1,g=u-R-l,u>z&&O.MarkNextChange(),z=u+1,O.AddOriginalElement(u+1,g+1),R=L+1-s):(u=d[L-1],g=u-R-l,u>z&&O.MarkNextChange(),z=u,O.AddModifiedElement(u+1,g+1),R=L-1-s),$>=0&&(d=this.m_reverseHistory[$],s=d[0],V=1,I=d.length-1)}while(--$>=-1);T=O.getChanges()}return this.ConcatenateChanges(_,T)}ComputeRecursionPoint(e,n,r,i,s,a,o){let l=0,c=0,d=0,u=0,m=0,f=0;e--,r--,s[0]=0,a[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=n-e+(i-r),b=g+1,k=new Int32Array(b),F=new Int32Array(b),N=i-r,_=n-e,T=e-r,O=n-i,I=(_-N)%2===0;k[N]=e,F[_]=n,o[0]=!1;for(let R=1;R<=g/2+1;R++){let z=0,$=0;d=this.ClipDiagonalBound(N-R,R,N,b),u=this.ClipDiagonalBound(N+R,R,N,b);for(let y=d;y<=u;y+=2){y===d||yz+$&&(z=l,$=c),!I&&Math.abs(y-_)<=R-1&&l>=F[y])return s[0]=l,a[0]=c,E<=F[y]&&R<=1448?this.WALKTRACE(N,d,u,T,_,m,f,O,k,F,l,n,s,c,i,a,I,o):null}const L=(z-e+($-r)-R)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(z,L))return o[0]=!0,s[0]=z,a[0]=$,L>0&&R<=1448?this.WALKTRACE(N,d,u,T,_,m,f,O,k,F,l,n,s,c,i,a,I,o):(e++,r++,[new ct(e,n-e+1,r,i-r+1)]);m=this.ClipDiagonalBound(_-R,R,_,b),f=this.ClipDiagonalBound(_+R,R,_,b);for(let y=m;y<=f;y+=2){y===m||y=F[y+1]?l=F[y+1]-1:l=F[y-1],c=l-(y-_)-O;const E=l;for(;l>e&&c>r&&this.ElementsAreEqual(l,c);)l--,c--;if(F[y]=l,I&&Math.abs(y-N)<=R&&l<=k[y])return s[0]=l,a[0]=c,E>=k[y]&&R<=1448?this.WALKTRACE(N,d,u,T,_,m,f,O,k,F,l,n,s,c,i,a,I,o):null}if(R<=1447){let y=new Int32Array(u-d+2);y[0]=N-d+1,At.Copy2(k,d,y,1,u-d+1),this.m_forwardHistory.push(y),y=new Int32Array(f-m+2),y[0]=_-m+1,At.Copy2(F,m,y,1,f-m+1),this.m_reverseHistory.push(y)}}return this.WALKTRACE(N,d,u,T,_,m,f,O,k,F,l,n,s,c,i,a,I,o)}PrettifyChanges(e){for(let n=0;n0,o=r.modifiedLength>0;for(;r.originalStart+r.originalLength=0;n--){const r=e[n];let i=0,s=0;if(n>0){const u=e[n-1];i=u.originalStart+u.originalLength,s=u.modifiedStart+u.modifiedLength}const a=r.originalLength>0,o=r.modifiedLength>0;let l=0,c=this._boundaryScore(r.originalStart,r.originalLength,r.modifiedStart,r.modifiedLength);for(let u=1;;u++){const m=r.originalStart-u,f=r.modifiedStart-u;if(mc&&(c=b,l=u)}r.originalStart-=l,r.modifiedStart-=l;const d=[null];if(n>0&&this.ChangesOverlap(e[n-1],e[n],d)){e[n-1]=d[0],e.splice(n,1),n++;continue}}if(this._hasStrings)for(let n=1,r=e.length;n0&&f>l&&(l=f,c=u,d=m)}return l>0?[c,d]:null}_contiguousSequenceScore(e,n,r){let i=0;for(let s=0;s=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,n){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(n>0){const r=e+n;if(this._OriginalIsBoundary(r-1)||this._OriginalIsBoundary(r))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,n){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(n>0){const r=e+n;if(this._ModifiedIsBoundary(r-1)||this._ModifiedIsBoundary(r))return!0}return!1}_boundaryScore(e,n,r,i){const s=this._OriginalRegionIsBoundary(e,n)?1:0,a=this._ModifiedRegionIsBoundary(r,i)?1:0;return s+a}ConcatenateChanges(e,n){const r=[];if(e.length===0||n.length===0)return n.length>0?n:e;if(this.ChangesOverlap(e[e.length-1],n[0],r)){const i=new Array(e.length+n.length-1);return At.Copy(e,0,i,0,e.length-1),i[e.length-1]=r[0],At.Copy(n,1,i,e.length,n.length-1),i}else{const i=new Array(e.length+n.length);return At.Copy(e,0,i,0,e.length),At.Copy(n,0,i,e.length,n.length),i}}ChangesOverlap(e,n,r){if(Lt.Assert(e.originalStart<=n.originalStart,"Left change is not less than or equal to right change"),Lt.Assert(e.modifiedStart<=n.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=n.originalStart||e.modifiedStart+e.modifiedLength>=n.modifiedStart){const i=e.originalStart;let s=e.originalLength;const a=e.modifiedStart;let o=e.modifiedLength;return e.originalStart+e.originalLength>=n.originalStart&&(s=n.originalStart+n.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=n.modifiedStart&&(o=n.modifiedStart+n.modifiedLength-e.modifiedStart),r[0]=new ct(i,s,a,o),!0}else return r[0]=null,!1}ClipDiagonalBound(e,n,r,i){if(e>=0&&er||e===r&&n>i?(this.startLineNumber=r,this.startColumn=i,this.endLineNumber=e,this.endColumn=n):(this.startLineNumber=e,this.startColumn=n,this.endLineNumber=r,this.endColumn=i)}isEmpty(){return ue.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return ue.containsPosition(this,e)}static containsPosition(e,n){return!(n.lineNumbere.endLineNumber||n.lineNumber===e.startLineNumber&&n.columne.endColumn)}static strictContainsPosition(e,n){return!(n.lineNumbere.endLineNumber||n.lineNumber===e.startLineNumber&&n.column<=e.startColumn||n.lineNumber===e.endLineNumber&&n.column>=e.endColumn)}containsRange(e){return ue.containsRange(this,e)}static containsRange(e,n){return!(n.startLineNumbere.endLineNumber||n.endLineNumber>e.endLineNumber||n.startLineNumber===e.startLineNumber&&n.startColumne.endColumn)}strictContainsRange(e){return ue.strictContainsRange(this,e)}static strictContainsRange(e,n){return!(n.startLineNumbere.endLineNumber||n.endLineNumber>e.endLineNumber||n.startLineNumber===e.startLineNumber&&n.startColumn<=e.startColumn||n.endLineNumber===e.endLineNumber&&n.endColumn>=e.endColumn)}plusRange(e){return ue.plusRange(this,e)}static plusRange(e,n){let r,i,s,a;return n.startLineNumbere.endLineNumber?(s=n.endLineNumber,a=n.endColumn):n.endLineNumber===e.endLineNumber?(s=n.endLineNumber,a=Math.max(n.endColumn,e.endColumn)):(s=e.endLineNumber,a=e.endColumn),new ue(r,i,s,a)}intersectRanges(e){return ue.intersectRanges(this,e)}static intersectRanges(e,n){let r=e.startLineNumber,i=e.startColumn,s=e.endLineNumber,a=e.endColumn;const o=n.startLineNumber,l=n.startColumn,c=n.endLineNumber,d=n.endColumn;return rc?(s=c,a=d):s===c&&(a=Math.min(a,d)),r>s||r===s&&i>a?null:new ue(r,i,s,a)}equalsRange(e){return ue.equalsRange(this,e)}static equalsRange(e,n){return!e&&!n?!0:!!e&&!!n&&e.startLineNumber===n.startLineNumber&&e.startColumn===n.startColumn&&e.endLineNumber===n.endLineNumber&&e.endColumn===n.endColumn}getEndPosition(){return ue.getEndPosition(this)}static getEndPosition(e){return new re(e.endLineNumber,e.endColumn)}getStartPosition(){return ue.getStartPosition(this)}static getStartPosition(e){return new re(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,n){return new ue(this.startLineNumber,this.startColumn,e,n)}setStartPosition(e,n){return new ue(e,n,this.endLineNumber,this.endColumn)}collapseToStart(){return ue.collapseToStart(this)}static collapseToStart(e){return new ue(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return ue.collapseToEnd(this)}static collapseToEnd(e){return new ue(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new ue(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,n=e){return new ue(e.lineNumber,e.column,n.lineNumber,n.column)}static lift(e){return e?new ue(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return!!e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,n){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}};function Xs(t){return t<0?0:t>255?255:t|0}function Mt(t){return t<0?0:t>4294967295?4294967295:t|0}class Qr{constructor(e){const n=Xs(e);this._defaultValue=n,this._asciiMap=Qr._createAsciiMap(n),this._map=new Map}static _createAsciiMap(e){const n=new Uint8Array(256);return n.fill(e),n}set(e,n){const r=Xs(n);e>=0&&e<256?this._asciiMap[e]=r:this._map.set(e,r)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}class Qh{constructor(e,n,r){const i=new Uint8Array(e*n);for(let s=0,a=e*n;sn&&(n=l),o>r&&(r=o),c>r&&(r=c)}n++,r++;const i=new Qh(r,n,0);for(let s=0,a=e.length;s=this._maxCharCode?0:this._states.get(e,n)}}let Kr=null;function Zh(){return Kr===null&&(Kr=new Kh([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),Kr}let pn=null;function ed(){if(pn===null){pn=new Qr(0);const t=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…|`;for(let n=0;ni);if(i>0){const o=n.charCodeAt(i-1),l=n.charCodeAt(a);(o===40&&l===41||o===91&&l===93||o===123&&l===125)&&a--}return{range:{startLineNumber:r,startColumn:i+1,endLineNumber:r,endColumn:a+2},url:n.substring(i,a+1)}}static computeLinks(e,n=Zh()){const r=ed(),i=[];for(let s=1,a=e.getLineCount();s<=a;s++){const o=e.getLineContent(s),l=o.length;let c=0,d=0,u=0,m=1,f=!1,g=!1,b=!1,k=!1;for(;c=0?(i+=r?1:-1,i<0?i=e.length-1:i%=e.length,e[i]):null}};Ar.INSTANCE=new Ar;let Zr=Ar;const Ys=Object.freeze(function(t,e){const n=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(n)}}});var Jn;(function(t){function e(n){return n===t.None||n===t.Cancelled||n instanceof Xn?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Wr.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Ys})})(Jn||(Jn={}));class Xn{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Ys:(this._emitter||(this._emitter=new Ue),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class nd{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new Xn),this._token}cancel(){this._token?this._token instanceof Xn&&this._token.cancel():this._token=Jn.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof Xn&&this._token.dispose():this._token=Jn.None}}class ei{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,n){this._keyCodeToStr[e]=n,this._strToKeyCode[n.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const Yn=new ei,ti=new ei,ni=new ei,rd=new Array(230),id=Object.create(null),sd=Object.create(null);(function(){const e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN","",""],[1,1,"Hyper",0,"",0,"","",""],[1,2,"Super",0,"",0,"","",""],[1,3,"Fn",0,"",0,"","",""],[1,4,"FnLock",0,"",0,"","",""],[1,5,"Suspend",0,"",0,"","",""],[1,6,"Resume",0,"",0,"","",""],[1,7,"Turbo",0,"",0,"","",""],[1,8,"Sleep",0,"",0,"VK_SLEEP","",""],[1,9,"WakeUp",0,"",0,"","",""],[0,10,"KeyA",31,"A",65,"VK_A","",""],[0,11,"KeyB",32,"B",66,"VK_B","",""],[0,12,"KeyC",33,"C",67,"VK_C","",""],[0,13,"KeyD",34,"D",68,"VK_D","",""],[0,14,"KeyE",35,"E",69,"VK_E","",""],[0,15,"KeyF",36,"F",70,"VK_F","",""],[0,16,"KeyG",37,"G",71,"VK_G","",""],[0,17,"KeyH",38,"H",72,"VK_H","",""],[0,18,"KeyI",39,"I",73,"VK_I","",""],[0,19,"KeyJ",40,"J",74,"VK_J","",""],[0,20,"KeyK",41,"K",75,"VK_K","",""],[0,21,"KeyL",42,"L",76,"VK_L","",""],[0,22,"KeyM",43,"M",77,"VK_M","",""],[0,23,"KeyN",44,"N",78,"VK_N","",""],[0,24,"KeyO",45,"O",79,"VK_O","",""],[0,25,"KeyP",46,"P",80,"VK_P","",""],[0,26,"KeyQ",47,"Q",81,"VK_Q","",""],[0,27,"KeyR",48,"R",82,"VK_R","",""],[0,28,"KeyS",49,"S",83,"VK_S","",""],[0,29,"KeyT",50,"T",84,"VK_T","",""],[0,30,"KeyU",51,"U",85,"VK_U","",""],[0,31,"KeyV",52,"V",86,"VK_V","",""],[0,32,"KeyW",53,"W",87,"VK_W","",""],[0,33,"KeyX",54,"X",88,"VK_X","",""],[0,34,"KeyY",55,"Y",89,"VK_Y","",""],[0,35,"KeyZ",56,"Z",90,"VK_Z","",""],[0,36,"Digit1",22,"1",49,"VK_1","",""],[0,37,"Digit2",23,"2",50,"VK_2","",""],[0,38,"Digit3",24,"3",51,"VK_3","",""],[0,39,"Digit4",25,"4",52,"VK_4","",""],[0,40,"Digit5",26,"5",53,"VK_5","",""],[0,41,"Digit6",27,"6",54,"VK_6","",""],[0,42,"Digit7",28,"7",55,"VK_7","",""],[0,43,"Digit8",29,"8",56,"VK_8","",""],[0,44,"Digit9",30,"9",57,"VK_9","",""],[0,45,"Digit0",21,"0",48,"VK_0","",""],[1,46,"Enter",3,"Enter",13,"VK_RETURN","",""],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE","",""],[1,48,"Backspace",1,"Backspace",8,"VK_BACK","",""],[1,49,"Tab",2,"Tab",9,"VK_TAB","",""],[1,50,"Space",10,"Space",32,"VK_SPACE","",""],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,"",0,"","",""],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL","",""],[1,64,"F1",59,"F1",112,"VK_F1","",""],[1,65,"F2",60,"F2",113,"VK_F2","",""],[1,66,"F3",61,"F3",114,"VK_F3","",""],[1,67,"F4",62,"F4",115,"VK_F4","",""],[1,68,"F5",63,"F5",116,"VK_F5","",""],[1,69,"F6",64,"F6",117,"VK_F6","",""],[1,70,"F7",65,"F7",118,"VK_F7","",""],[1,71,"F8",66,"F8",119,"VK_F8","",""],[1,72,"F9",67,"F9",120,"VK_F9","",""],[1,73,"F10",68,"F10",121,"VK_F10","",""],[1,74,"F11",69,"F11",122,"VK_F11","",""],[1,75,"F12",70,"F12",123,"VK_F12","",""],[1,76,"PrintScreen",0,"",0,"","",""],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL","",""],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE","",""],[1,79,"Insert",19,"Insert",45,"VK_INSERT","",""],[1,80,"Home",14,"Home",36,"VK_HOME","",""],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR","",""],[1,82,"Delete",20,"Delete",46,"VK_DELETE","",""],[1,83,"End",13,"End",35,"VK_END","",""],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT","",""],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",""],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",""],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",""],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",""],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK","",""],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE","",""],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY","",""],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT","",""],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD","",""],[1,94,"NumpadEnter",3,"",0,"","",""],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1","",""],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2","",""],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3","",""],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4","",""],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5","",""],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6","",""],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7","",""],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8","",""],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9","",""],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0","",""],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL","",""],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102","",""],[1,107,"ContextMenu",58,"ContextMenu",93,"","",""],[1,108,"Power",0,"",0,"","",""],[1,109,"NumpadEqual",0,"",0,"","",""],[1,110,"F13",71,"F13",124,"VK_F13","",""],[1,111,"F14",72,"F14",125,"VK_F14","",""],[1,112,"F15",73,"F15",126,"VK_F15","",""],[1,113,"F16",74,"F16",127,"VK_F16","",""],[1,114,"F17",75,"F17",128,"VK_F17","",""],[1,115,"F18",76,"F18",129,"VK_F18","",""],[1,116,"F19",77,"F19",130,"VK_F19","",""],[1,117,"F20",78,"F20",131,"VK_F20","",""],[1,118,"F21",79,"F21",132,"VK_F21","",""],[1,119,"F22",80,"F22",133,"VK_F22","",""],[1,120,"F23",81,"F23",134,"VK_F23","",""],[1,121,"F24",82,"F24",135,"VK_F24","",""],[1,122,"Open",0,"",0,"","",""],[1,123,"Help",0,"",0,"","",""],[1,124,"Select",0,"",0,"","",""],[1,125,"Again",0,"",0,"","",""],[1,126,"Undo",0,"",0,"","",""],[1,127,"Cut",0,"",0,"","",""],[1,128,"Copy",0,"",0,"","",""],[1,129,"Paste",0,"",0,"","",""],[1,130,"Find",0,"",0,"","",""],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE","",""],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP","",""],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN","",""],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR","",""],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1","",""],[1,136,"KanaMode",0,"",0,"","",""],[0,137,"IntlYen",0,"",0,"","",""],[1,138,"Convert",0,"",0,"","",""],[1,139,"NonConvert",0,"",0,"","",""],[1,140,"Lang1",0,"",0,"","",""],[1,141,"Lang2",0,"",0,"","",""],[1,142,"Lang3",0,"",0,"","",""],[1,143,"Lang4",0,"",0,"","",""],[1,144,"Lang5",0,"",0,"","",""],[1,145,"Abort",0,"",0,"","",""],[1,146,"Props",0,"",0,"","",""],[1,147,"NumpadParenLeft",0,"",0,"","",""],[1,148,"NumpadParenRight",0,"",0,"","",""],[1,149,"NumpadBackspace",0,"",0,"","",""],[1,150,"NumpadMemoryStore",0,"",0,"","",""],[1,151,"NumpadMemoryRecall",0,"",0,"","",""],[1,152,"NumpadMemoryClear",0,"",0,"","",""],[1,153,"NumpadMemoryAdd",0,"",0,"","",""],[1,154,"NumpadMemorySubtract",0,"",0,"","",""],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR","",""],[1,156,"NumpadClearEntry",0,"",0,"","",""],[1,0,"",5,"Ctrl",17,"VK_CONTROL","",""],[1,0,"",4,"Shift",16,"VK_SHIFT","",""],[1,0,"",6,"Alt",18,"VK_MENU","",""],[1,0,"",57,"Meta",91,"VK_COMMAND","",""],[1,157,"ControlLeft",5,"",0,"VK_LCONTROL","",""],[1,158,"ShiftLeft",4,"",0,"VK_LSHIFT","",""],[1,159,"AltLeft",6,"",0,"VK_LMENU","",""],[1,160,"MetaLeft",57,"",0,"VK_LWIN","",""],[1,161,"ControlRight",5,"",0,"VK_RCONTROL","",""],[1,162,"ShiftRight",4,"",0,"VK_RSHIFT","",""],[1,163,"AltRight",6,"",0,"VK_RMENU","",""],[1,164,"MetaRight",57,"",0,"VK_RWIN","",""],[1,165,"BrightnessUp",0,"",0,"","",""],[1,166,"BrightnessDown",0,"",0,"","",""],[1,167,"MediaPlay",0,"",0,"","",""],[1,168,"MediaRecord",0,"",0,"","",""],[1,169,"MediaFastForward",0,"",0,"","",""],[1,170,"MediaRewind",0,"",0,"","",""],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK","",""],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK","",""],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP","",""],[1,174,"Eject",0,"",0,"","",""],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE","",""],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT","",""],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL","",""],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2","",""],[1,179,"LaunchApp1",0,"",0,"VK_MEDIA_LAUNCH_APP1","",""],[1,180,"SelectTask",0,"",0,"","",""],[1,181,"LaunchScreenSaver",0,"",0,"","",""],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH","",""],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME","",""],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK","",""],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD","",""],[1,186,"BrowserStop",0,"",0,"VK_BROWSER_STOP","",""],[1,187,"BrowserRefresh",0,"",0,"VK_BROWSER_REFRESH","",""],[1,188,"BrowserFavorites",0,"",0,"VK_BROWSER_FAVORITES","",""],[1,189,"ZoomToggle",0,"",0,"","",""],[1,190,"MailReply",0,"",0,"","",""],[1,191,"MailForward",0,"",0,"","",""],[1,192,"MailSend",0,"",0,"","",""],[1,0,"",114,"KeyInComposition",229,"","",""],[1,0,"",116,"ABNT_C2",194,"VK_ABNT_C2","",""],[1,0,"",96,"OEM_8",223,"VK_OEM_8","",""],[1,0,"",0,"",0,"VK_KANA","",""],[1,0,"",0,"",0,"VK_HANGUL","",""],[1,0,"",0,"",0,"VK_JUNJA","",""],[1,0,"",0,"",0,"VK_FINAL","",""],[1,0,"",0,"",0,"VK_HANJA","",""],[1,0,"",0,"",0,"VK_KANJI","",""],[1,0,"",0,"",0,"VK_CONVERT","",""],[1,0,"",0,"",0,"VK_NONCONVERT","",""],[1,0,"",0,"",0,"VK_ACCEPT","",""],[1,0,"",0,"",0,"VK_MODECHANGE","",""],[1,0,"",0,"",0,"VK_SELECT","",""],[1,0,"",0,"",0,"VK_PRINT","",""],[1,0,"",0,"",0,"VK_EXECUTE","",""],[1,0,"",0,"",0,"VK_SNAPSHOT","",""],[1,0,"",0,"",0,"VK_HELP","",""],[1,0,"",0,"",0,"VK_APPS","",""],[1,0,"",0,"",0,"VK_PROCESSKEY","",""],[1,0,"",0,"",0,"VK_PACKET","",""],[1,0,"",0,"",0,"VK_DBE_SBCSCHAR","",""],[1,0,"",0,"",0,"VK_DBE_DBCSCHAR","",""],[1,0,"",0,"",0,"VK_ATTN","",""],[1,0,"",0,"",0,"VK_CRSEL","",""],[1,0,"",0,"",0,"VK_EXSEL","",""],[1,0,"",0,"",0,"VK_EREOF","",""],[1,0,"",0,"",0,"VK_PLAY","",""],[1,0,"",0,"",0,"VK_ZOOM","",""],[1,0,"",0,"",0,"VK_NONAME","",""],[1,0,"",0,"",0,"VK_PA1","",""],[1,0,"",0,"",0,"VK_OEM_CLEAR","",""]],n=[],r=[];for(const i of e){const[s,a,o,l,c,d,u,m,f]=i;if(r[a]||(r[a]=!0,id[o]=a,sd[o.toLowerCase()]=a),!n[l]){if(n[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${o}`);Yn.define(l,c),ti.define(l,m||c),ni.define(l,f||m||c)}d&&(rd[d]=l)}})();var Qs;(function(t){function e(o){return Yn.keyCodeToStr(o)}t.toString=e;function n(o){return Yn.strToKeyCode(o)}t.fromString=n;function r(o){return ti.keyCodeToStr(o)}t.toUserSettingsUS=r;function i(o){return ni.keyCodeToStr(o)}t.toUserSettingsGeneral=i;function s(o){return ti.strToKeyCode(o)||ni.strToKeyCode(o)}t.fromUserSettings=s;function a(o){if(o>=98&&o<=113)return null;switch(o){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Yn.keyCodeToStr(o)}t.toElectronAccelerator=a})(Qs||(Qs={}));function ad(t,e){const n=(e&65535)<<16>>>0;return(t|n)>>>0}let zt;const ri=globalThis.vscode;if(typeof ri<"u"&&typeof ri.process<"u"){const t=ri.process;zt={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?zt={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:zt={get platform(){return hn?"win32":kh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const Qn=zt.cwd,od=zt.env,ld=zt.platform,cd=65,hd=97,dd=90,ud=122,xt=46,fe=47,_e=92,Ye=58,pd=63;class Ks extends Error{constructor(e,n,r){let i;typeof n=="string"&&n.indexOf("not ")===0?(i="must not be",n=n.replace(/^not /,"")):i="must be";const s=e.indexOf(".")!==-1?"property":"argument";let a=`The "${e}" ${s} ${i} of type ${n}`;a+=`. Received type ${typeof r}`,super(a),this.code="ERR_INVALID_ARG_TYPE"}}function md(t,e){if(t===null||typeof t!="object")throw new Ks(e,"Object",t)}function he(t,e){if(typeof t!="string")throw new Ks(e,"string",t)}const dt=ld==="win32";function X(t){return t===fe||t===_e}function ii(t){return t===fe}function Qe(t){return t>=cd&&t<=dd||t>=hd&&t<=ud}function Kn(t,e,n,r){let i="",s=0,a=-1,o=0,l=0;for(let c=0;c<=t.length;++c){if(c2){const d=i.lastIndexOf(n);d===-1?(i="",s=0):(i=i.slice(0,d),s=i.length-1-i.lastIndexOf(n)),a=c,o=0;continue}else if(i.length!==0){i="",s=0,a=c,o=0;continue}}e&&(i+=i.length>0?`${n}..`:"..",s=2)}else i.length>0?i+=`${n}${t.slice(a+1,c)}`:i=t.slice(a+1,c),s=c-a-1;a=c,o=0}else l===xt&&o!==-1?++o:o=-1}return i}function fd(t){return t?`${t[0]==="."?"":"."}${t}`:""}function Zs(t,e){md(e,"pathObject");const n=e.dir||e.root,r=e.base||`${e.name||""}${fd(e.ext)}`;return n?n===e.root?`${n}${r}`:`${n}${t}${r}`:r}const Se={resolve(...t){let e="",n="",r=!1;for(let i=t.length-1;i>=-1;i--){let s;if(i>=0){if(s=t[i],he(s,`paths[${i}]`),s.length===0)continue}else e.length===0?s=Qn():(s=od[`=${e}`]||Qn(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===_e)&&(s=`${e}\\`));const a=s.length;let o=0,l="",c=!1;const d=s.charCodeAt(0);if(a===1)X(d)&&(o=1,c=!0);else if(X(d))if(c=!0,X(s.charCodeAt(1))){let u=2,m=u;for(;u2&&X(s.charCodeAt(2))&&(c=!0,o=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(r){if(e.length>0)break}else if(n=`${s.slice(o)}\\${n}`,r=c,c&&e.length>0)break}return n=Kn(n,!r,"\\",X),r?`${e}\\${n}`:`${e}${n}`||"."},normalize(t){he(t,"path");const e=t.length;if(e===0)return".";let n=0,r,i=!1;const s=t.charCodeAt(0);if(e===1)return ii(s)?"\\":t;if(X(s))if(i=!0,X(t.charCodeAt(1))){let o=2,l=o;for(;o2&&X(t.charCodeAt(2))&&(i=!0,n=3));let a=n0&&X(t.charCodeAt(e-1))&&(a+="\\"),!i&&r===void 0&&t.includes(":")){if(a.length>=2&&Qe(a.charCodeAt(0))&&a.charCodeAt(1)===Ye)return`.\\${a}`;let o=t.indexOf(":");do if(o===e-1||X(t.charCodeAt(o+1)))return`.\\${a}`;while((o=t.indexOf(":",o+1))!==-1)}return r===void 0?i?`\\${a}`:a:i?`${r}\\${a}`:`${r}${a}`},isAbsolute(t){he(t,"path");const e=t.length;if(e===0)return!1;const n=t.charCodeAt(0);return X(n)||e>2&&Qe(n)&&t.charCodeAt(1)===Ye&&X(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,n;for(let s=0;s0&&(e===void 0?e=n=a:e+=`\\${a}`)}if(e===void 0)return".";let r=!0,i=0;if(typeof n=="string"&&X(n.charCodeAt(0))){++i;const s=n.length;s>1&&X(n.charCodeAt(1))&&(++i,s>2&&(X(n.charCodeAt(2))?++i:r=!1))}if(r){for(;i=2&&(e=`\\${e.slice(i)}`)}return Se.normalize(e)},relative(t,e){if(he(t,"from"),he(e,"to"),t===e)return"";const n=Se.resolve(t),r=Se.resolve(e);if(n===r||(t=n.toLowerCase(),e=r.toLowerCase(),t===e))return"";if(n.length!==t.length||r.length!==e.length){const g=n.split("\\"),b=r.split("\\");g[g.length-1]===""&&g.pop(),b[b.length-1]===""&&b.pop();const k=g.length,F=b.length,N=kN?b.slice(_).join("\\"):k>N?"..\\".repeat(k-1-_)+"..":"":"..\\".repeat(k-_)+b.slice(_).join("\\")}let i=0;for(;ii&&t.charCodeAt(s-1)===_e;)s--;const a=s-i;let o=0;for(;oo&&e.charCodeAt(l-1)===_e;)l--;const c=l-o,d=ad){if(e.charCodeAt(o+m)===_e)return r.slice(o+m+1);if(m===2)return r.slice(o+m)}a>d&&(t.charCodeAt(i+m)===_e?u=m:m===2&&(u=3)),u===-1&&(u=0)}let f="";for(m=i+u+1;m<=s;++m)(m===s||t.charCodeAt(m)===_e)&&(f+=f.length===0?"..":"\\..");return o+=u,f.length>0?`${f}${r.slice(o,l)}`:(r.charCodeAt(o)===_e&&++o,r.slice(o,l))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;const e=Se.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===_e){if(e.charCodeAt(1)===_e){const n=e.charCodeAt(2);if(n!==pd&&n!==xt)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(Qe(e.charCodeAt(0))&&e.charCodeAt(1)===Ye&&e.charCodeAt(2)===_e)return`\\\\?\\${e}`;return e},dirname(t){he(t,"path");const e=t.length;if(e===0)return".";let n=-1,r=0;const i=t.charCodeAt(0);if(e===1)return X(i)?t:".";if(X(i)){if(n=r=1,X(t.charCodeAt(1))){let o=2,l=o;for(;o2&&X(t.charCodeAt(2))?3:2,r=n);let s=-1,a=!0;for(let o=e-1;o>=r;--o)if(X(t.charCodeAt(o))){if(!a){s=o;break}}else a=!1;if(s===-1){if(n===-1)return".";s=n}return t.slice(0,s)},basename(t,e){e!==void 0&&he(e,"suffix"),he(t,"path");let n=0,r=-1,i=!0,s;if(t.length>=2&&Qe(t.charCodeAt(0))&&t.charCodeAt(1)===Ye&&(n=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let a=e.length-1,o=-1;for(s=t.length-1;s>=n;--s){const l=t.charCodeAt(s);if(X(l)){if(!i){n=s+1;break}}else o===-1&&(i=!1,o=s+1),a>=0&&(l===e.charCodeAt(a)?--a===-1&&(r=s):(a=-1,r=o))}return n===r?r=o:r===-1&&(r=t.length),t.slice(n,r)}for(s=t.length-1;s>=n;--s)if(X(t.charCodeAt(s))){if(!i){n=s+1;break}}else r===-1&&(i=!1,r=s+1);return r===-1?"":t.slice(n,r)},extname(t){he(t,"path");let e=0,n=-1,r=0,i=-1,s=!0,a=0;t.length>=2&&t.charCodeAt(1)===Ye&&Qe(t.charCodeAt(0))&&(e=r=2);for(let o=t.length-1;o>=e;--o){const l=t.charCodeAt(o);if(X(l)){if(!s){r=o+1;break}continue}i===-1&&(s=!1,i=o+1),l===xt?n===-1?n=o:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||i===-1||a===0||a===1&&n===i-1&&n===r+1?"":t.slice(n,i)},format:Zs.bind(null,"\\"),parse(t){he(t,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;const n=t.length;let r=0,i=t.charCodeAt(0);if(n===1)return X(i)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(X(i)){if(r=1,X(t.charCodeAt(1))){let u=2,m=u;for(;u0&&(e.root=t.slice(0,r));let s=-1,a=r,o=-1,l=!0,c=t.length-1,d=0;for(;c>=r;--c){if(i=t.charCodeAt(c),X(i)){if(!l){a=c+1;break}continue}o===-1&&(l=!1,o=c+1),i===xt?s===-1?s=c:d!==1&&(d=1):s!==-1&&(d=-1)}return o!==-1&&(s===-1||d===0||d===1&&s===o-1&&s===a+1?e.base=e.name=t.slice(a,o):(e.name=t.slice(a,s),e.base=t.slice(a,o),e.ext=t.slice(s,o))),a>0&&a!==r?e.dir=t.slice(0,a-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},gd=(()=>{if(dt){const t=/\\/g;return()=>{const e=Qn().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>Qn()})(),Ee={resolve(...t){let e="",n=!1;for(let r=t.length-1;r>=0&&!n;r--){const i=t[r];he(i,`paths[${r}]`),i.length!==0&&(e=`${i}/${e}`,n=i.charCodeAt(0)===fe)}if(!n){const r=gd();e=`${r}/${e}`,n=r.charCodeAt(0)===fe}return e=Kn(e,!n,"/",ii),n?`/${e}`:e.length>0?e:"."},normalize(t){if(he(t,"path"),t.length===0)return".";const e=t.charCodeAt(0)===fe,n=t.charCodeAt(t.length-1)===fe;return t=Kn(t,!e,"/",ii),t.length===0?e?"/":n?"./":".":(n&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return he(t,"path"),t.length>0&&t.charCodeAt(0)===fe},join(...t){if(t.length===0)return".";const e=[];for(let n=0;n0&&e.push(r)}return e.length===0?".":Ee.normalize(e.join("/"))},relative(t,e){if(he(t,"from"),he(e,"to"),t===e||(t=Ee.resolve(t),e=Ee.resolve(e),t===e))return"";const n=1,r=t.length,i=r-n,s=1,a=e.length-s,o=io){if(e.charCodeAt(s+c)===fe)return e.slice(s+c+1);if(c===0)return e.slice(s+c)}else i>o&&(t.charCodeAt(n+c)===fe?l=c:c===0&&(l=0));let d="";for(c=n+l+1;c<=r;++c)(c===r||t.charCodeAt(c)===fe)&&(d+=d.length===0?"..":"/..");return`${d}${e.slice(s+l)}`},toNamespacedPath(t){return t},dirname(t){if(he(t,"path"),t.length===0)return".";const e=t.charCodeAt(0)===fe;let n=-1,r=!0;for(let i=t.length-1;i>=1;--i)if(t.charCodeAt(i)===fe){if(!r){n=i;break}}else r=!1;return n===-1?e?"/":".":e&&n===1?"//":t.slice(0,n)},basename(t,e){e!==void 0&&he(e,"suffix"),he(t,"path");let n=0,r=-1,i=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let a=e.length-1,o=-1;for(s=t.length-1;s>=0;--s){const l=t.charCodeAt(s);if(l===fe){if(!i){n=s+1;break}}else o===-1&&(i=!1,o=s+1),a>=0&&(l===e.charCodeAt(a)?--a===-1&&(r=s):(a=-1,r=o))}return n===r?r=o:r===-1&&(r=t.length),t.slice(n,r)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===fe){if(!i){n=s+1;break}}else r===-1&&(i=!1,r=s+1);return r===-1?"":t.slice(n,r)},extname(t){he(t,"path");let e=-1,n=0,r=-1,i=!0,s=0;for(let a=t.length-1;a>=0;--a){const o=t[a];if(o==="/"){if(!i){n=a+1;break}continue}r===-1&&(i=!1,r=a+1),o==="."?e===-1?e=a:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||r===-1||s===0||s===1&&e===r-1&&e===n+1?"":t.slice(e,r)},format:Zs.bind(null,"/"),parse(t){he(t,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;const n=t.charCodeAt(0)===fe;let r;n?(e.root="/",r=1):r=0;let i=-1,s=0,a=-1,o=!0,l=t.length-1,c=0;for(;l>=r;--l){const d=t.charCodeAt(l);if(d===fe){if(!o){s=l+1;break}continue}a===-1&&(o=!1,a=l+1),d===xt?i===-1?i=l:c!==1&&(c=1):i!==-1&&(c=-1)}if(a!==-1){const d=s===0&&n?1:s;i===-1||c===0||c===1&&i===a-1&&i===s+1?e.base=e.name=t.slice(d,a):(e.name=t.slice(d,i),e.base=t.slice(d,a),e.ext=t.slice(i,a))}return s>0?e.dir=t.slice(0,s-1):n&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Ee.win32=Se.win32=Se,Ee.posix=Se.posix=Ee,dt?Se.normalize:Ee.normalize,dt?Se.resolve:Ee.resolve,dt?Se.relative:Ee.relative,dt?Se.dirname:Ee.dirname,dt?Se.basename:Ee.basename,dt?Se.extname:Ee.extname,dt?Se.sep:Ee.sep;const bd=/^\w[\w\d+.-]*$/,wd=/^\//,vd=/^\/\//;function yd(t,e){if(!t.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${t.authority}", path: "${t.path}", query: "${t.query}", fragment: "${t.fragment}"}`);if(t.scheme&&!bd.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!wd.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(vd.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function xd(t,e){return!t&&!e?"file":t}function Sd(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==We&&(e=We+e):e=We;break}return e}const se="",We="/",Cd=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;let si=class Pr{static isUri(e){return e instanceof Pr?!0:!e||typeof e!="object"?!1:typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function"}constructor(e,n,r,i,s,a=!1){typeof e=="object"?(this.scheme=e.scheme||se,this.authority=e.authority||se,this.path=e.path||se,this.query=e.query||se,this.fragment=e.fragment||se):(this.scheme=xd(e,a),this.authority=n||se,this.path=Sd(this.scheme,r||se),this.query=i||se,this.fragment=s||se,yd(this,a))}get fsPath(){return ai(this,!1)}with(e){if(!e)return this;let{scheme:n,authority:r,path:i,query:s,fragment:a}=e;return n===void 0?n=this.scheme:n===null&&(n=se),r===void 0?r=this.authority:r===null&&(r=se),i===void 0?i=this.path:i===null&&(i=se),s===void 0?s=this.query:s===null&&(s=se),a===void 0?a=this.fragment:a===null&&(a=se),n===this.scheme&&r===this.authority&&i===this.path&&s===this.query&&a===this.fragment?this:new Pt(n,r,i,s,a)}static parse(e,n=!1){const r=Cd.exec(e);return r?new Pt(r[2]||se,Zn(r[4]||se),Zn(r[5]||se),Zn(r[7]||se),Zn(r[9]||se),n):new Pt(se,se,se,se,se)}static file(e){let n=se;if(hn&&(e=e.replace(/\\/g,We)),e[0]===We&&e[1]===We){const r=e.indexOf(We,2);r===-1?(n=e.substring(2),e=We):(n=e.substring(2,r),e=e.substring(r)||We)}return new Pt("file",n,e,se,se)}static from(e,n){return new Pt(e.scheme,e.authority,e.path,e.query,e.fragment,n)}static joinPath(e,...n){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let r;return hn&&e.scheme==="file"?r=Pr.file(Se.join(ai(e,!0),...n)).path:r=Ee.join(e.path,...n),e.with({path:r})}toString(e=!1){return oi(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof Pr)return e;{const n=new Pt(e);return n._formatted=e.external??null,n._fsPath=e._sep===ea?e.fsPath??null:null,n}}else return e}};const ea=hn?1:void 0;class Pt extends si{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=ai(this,!1)),this._fsPath}toString(e=!1){return e?oi(this,!0):(this._formatted||(this._formatted=oi(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=ea),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}const ta={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function na(t,e,n){let r,i=-1;for(let s=0;s=97&&a<=122||a>=65&&a<=90||a>=48&&a<=57||a===45||a===46||a===95||a===126||e&&a===47||n&&a===91||n&&a===93||n&&a===58)i!==-1&&(r+=encodeURIComponent(t.substring(i,s)),i=-1),r!==void 0&&(r+=t.charAt(s));else{r===void 0&&(r=t.substr(0,s));const o=ta[a];o!==void 0?(i!==-1&&(r+=encodeURIComponent(t.substring(i,s)),i=-1),r+=o):i===-1&&(i=s)}}return i!==-1&&(r+=encodeURIComponent(t.substring(i))),r!==void 0?r:t}function kd(t){let e;for(let n=0;n1&&t.scheme==="file"?n=`//${t.authority}${t.path}`:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?e?n=t.path.substr(1):n=t.path[1].toLowerCase()+t.path.substr(2):n=t.path,hn&&(n=n.replace(/\//g,"\\")),n}function oi(t,e){const n=e?kd:na;let r="",{scheme:i,authority:s,path:a,query:o,fragment:l}=t;if(i&&(r+=i,r+=":"),(s||i==="file")&&(r+=We,r+=We),s){let c=s.indexOf("@");if(c!==-1){const d=s.substr(0,c);s=s.substr(c+1),c=d.lastIndexOf(":"),c===-1?r+=n(d,!1,!1):(r+=n(d.substr(0,c),!1,!1),r+=":",r+=n(d.substr(c+1),!1,!0)),r+="@"}s=s.toLowerCase(),c=s.lastIndexOf(":"),c===-1?r+=n(s,!1,!0):(r+=n(s.substr(0,c),!1,!0),r+=s.substr(c))}if(a){if(a.length>=3&&a.charCodeAt(0)===47&&a.charCodeAt(2)===58){const c=a.charCodeAt(1);c>=65&&c<=90&&(a=`/${String.fromCharCode(c+32)}:${a.substr(3)}`)}else if(a.length>=2&&a.charCodeAt(1)===58){const c=a.charCodeAt(0);c>=65&&c<=90&&(a=`${String.fromCharCode(c+32)}:${a.substr(2)}`)}r+=n(a,!0,!1)}return o&&(r+="?",r+=n(o,!1,!1)),l&&(r+="#",r+=e?l:na(l,!1,!1)),r}function ra(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+ra(t.substr(3)):t}}const ia=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function Zn(t){return t.match(ia)?t.replace(ia,e=>ra(e)):t}class Re extends J{constructor(e,n,r,i){super(e,n,r,i),this.selectionStartLineNumber=e,this.selectionStartColumn=n,this.positionLineNumber=r,this.positionColumn=i}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return Re.selectionsEqual(this,e)}static selectionsEqual(e,n){return e.selectionStartLineNumber===n.selectionStartLineNumber&&e.selectionStartColumn===n.selectionStartColumn&&e.positionLineNumber===n.positionLineNumber&&e.positionColumn===n.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,n){return this.getDirection()===0?new Re(this.startLineNumber,this.startColumn,e,n):new Re(e,n,this.startLineNumber,this.startColumn)}getPosition(){return new re(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new re(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,n){return this.getDirection()===0?new Re(e,n,this.endLineNumber,this.endColumn):new Re(this.endLineNumber,this.endColumn,e,n)}static fromPositions(e,n=e){return new Re(e.lineNumber,e.column,n.lineNumber,n.column)}static fromRange(e,n){return n===0?new Re(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new Re(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new Re(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,n){if(e&&!n||!e&&n)return!1;if(!e&&!n)return!0;if(e.length!==n.length)return!1;for(let r=0,i=e.length;r{this._tokenizationSupports.get(e)===n&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,n){this._factories.get(e)?.dispose();const r=new Rd(this,e,n);return this._factories.set(e,r),qn(()=>{const i=this._factories.get(e);!i||i!==r||(this._factories.delete(e),i.dispose())})}async getOrCreate(e){const n=this.get(e);if(n)return n;const r=this._factories.get(e);return!r||r.isResolved?null:(await r.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;const r=this._factories.get(e);return!!(!r||r.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}}class Rd extends wt{get isResolved(){return this._isResolved}constructor(e,n,r){super(),this._registry=e,this._languageId=n,this._factory=r,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}async _create(){const e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}}class Nd{constructor(e,n,r){this.offset=e,this.type=n,this.language=r,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}}var aa;(function(t){t[t.Increase=0]="Increase",t[t.Decrease=1]="Decrease"})(aa||(aa={}));var oa;(function(t){const e=new Map;e.set(0,U.symbolMethod),e.set(1,U.symbolFunction),e.set(2,U.symbolConstructor),e.set(3,U.symbolField),e.set(4,U.symbolVariable),e.set(5,U.symbolClass),e.set(6,U.symbolStruct),e.set(7,U.symbolInterface),e.set(8,U.symbolModule),e.set(9,U.symbolProperty),e.set(10,U.symbolEvent),e.set(11,U.symbolOperator),e.set(12,U.symbolUnit),e.set(13,U.symbolValue),e.set(15,U.symbolEnum),e.set(14,U.symbolConstant),e.set(15,U.symbolEnum),e.set(16,U.symbolEnumMember),e.set(17,U.symbolKeyword),e.set(28,U.symbolSnippet),e.set(18,U.symbolText),e.set(19,U.symbolColor),e.set(20,U.symbolFile),e.set(21,U.symbolReference),e.set(22,U.symbolCustomColor),e.set(23,U.symbolFolder),e.set(24,U.symbolTypeParameter),e.set(25,U.account),e.set(26,U.issues),e.set(27,U.tools);function n(a){let o=e.get(a);return o||(console.info("No codicon found for CompletionItemKind "+a),o=U.symbolProperty),o}t.toIcon=n;function r(a){switch(a){case 0:return B(728,"Method");case 1:return B(729,"Function");case 2:return B(730,"Constructor");case 3:return B(731,"Field");case 4:return B(732,"Variable");case 5:return B(733,"Class");case 6:return B(734,"Struct");case 7:return B(735,"Interface");case 8:return B(736,"Module");case 9:return B(737,"Property");case 10:return B(738,"Event");case 11:return B(739,"Operator");case 12:return B(740,"Unit");case 13:return B(741,"Value");case 14:return B(742,"Constant");case 15:return B(743,"Enum");case 16:return B(744,"Enum Member");case 17:return B(745,"Keyword");case 18:return B(746,"Text");case 19:return B(747,"Color");case 20:return B(748,"File");case 21:return B(749,"Reference");case 22:return B(750,"Custom Color");case 23:return B(751,"Folder");case 24:return B(752,"Type Parameter");case 25:return B(753,"User");case 26:return B(754,"Issue");case 27:return B(755,"Tool");case 28:return B(756,"Snippet");default:return""}}t.toLabel=r;const i=new Map;i.set("method",0),i.set("function",1),i.set("constructor",2),i.set("field",3),i.set("variable",4),i.set("class",5),i.set("struct",6),i.set("interface",7),i.set("module",8),i.set("property",9),i.set("event",10),i.set("operator",11),i.set("unit",12),i.set("value",13),i.set("constant",14),i.set("enum",15),i.set("enum-member",16),i.set("enumMember",16),i.set("keyword",17),i.set("snippet",28),i.set("text",18),i.set("color",19),i.set("file",20),i.set("reference",21),i.set("customcolor",22),i.set("folder",23),i.set("type-parameter",24),i.set("typeParameter",24),i.set("account",25),i.set("issue",26),i.set("tool",27);function s(a,o){let l=i.get(a);return typeof l>"u"&&!o&&(l=9),l}t.fromString=s})(oa||(oa={}));var la;(function(t){t[t.Automatic=0]="Automatic",t[t.Explicit=1]="Explicit"})(la||(la={}));var ca;(function(t){t[t.Code=1]="Code",t[t.Label=2]="Label"})(ca||(ca={}));var ha;(function(t){t[t.Accepted=0]="Accepted",t[t.Rejected=1]="Rejected",t[t.Ignored=2]="Ignored"})(ha||(ha={}));var da;(function(t){t[t.Automatic=0]="Automatic",t[t.PasteAs=1]="PasteAs"})(da||(da={}));var ua;(function(t){t[t.Invoke=1]="Invoke",t[t.TriggerCharacter=2]="TriggerCharacter",t[t.ContentChange=3]="ContentChange"})(ua||(ua={}));var pa;(function(t){t[t.Text=0]="Text",t[t.Read=1]="Read",t[t.Write=2]="Write"})(pa||(pa={})),B(757,"array"),B(758,"boolean"),B(759,"class"),B(760,"constant"),B(761,"constructor"),B(762,"enumeration"),B(763,"enumeration member"),B(764,"event"),B(765,"field"),B(766,"file"),B(767,"function"),B(768,"interface"),B(769,"key"),B(770,"method"),B(771,"module"),B(772,"namespace"),B(773,"null"),B(774,"number"),B(775,"object"),B(776,"operator"),B(777,"package"),B(778,"property"),B(779,"string"),B(780,"struct"),B(781,"type parameter"),B(782,"variable");var ma;(function(t){const e=new Map;e.set(0,U.symbolFile),e.set(1,U.symbolModule),e.set(2,U.symbolNamespace),e.set(3,U.symbolPackage),e.set(4,U.symbolClass),e.set(5,U.symbolMethod),e.set(6,U.symbolProperty),e.set(7,U.symbolField),e.set(8,U.symbolConstructor),e.set(9,U.symbolEnum),e.set(10,U.symbolInterface),e.set(11,U.symbolFunction),e.set(12,U.symbolVariable),e.set(13,U.symbolConstant),e.set(14,U.symbolString),e.set(15,U.symbolNumber),e.set(16,U.symbolBoolean),e.set(17,U.symbolArray),e.set(18,U.symbolObject),e.set(19,U.symbolKey),e.set(20,U.symbolNull),e.set(21,U.symbolEnumMember),e.set(22,U.symbolStruct),e.set(23,U.symbolEvent),e.set(24,U.symbolOperator),e.set(25,U.symbolTypeParameter);function n(s){let a=e.get(s);return a||(console.info("No codicon found for SymbolKind "+s),a=U.symbolProperty),a}t.toIcon=n;const r=new Map;r.set(0,20),r.set(1,8),r.set(2,8),r.set(3,8),r.set(4,5),r.set(5,0),r.set(6,9),r.set(7,3),r.set(8,2),r.set(9,15),r.set(10,7),r.set(11,1),r.set(12,4),r.set(13,14),r.set(14,18),r.set(15,13),r.set(16,13),r.set(17,13),r.set(18,13),r.set(19,17),r.set(20,13),r.set(21,16),r.set(22,6),r.set(23,10),r.set(24,11),r.set(25,24);function i(s){let a=r.get(s);return a===void 0&&(console.info("No completion kind found for SymbolKind "+s),a=20),a}t.toCompletionKind=i})(ma||(ma={}));let If=(Ce=class{static fromValue(e){switch(e){case"comment":return Ce.Comment;case"imports":return Ce.Imports;case"region":return Ce.Region}return new Ce(e)}constructor(e){this.value=e}},Ce.Comment=new Ce("comment"),Ce.Imports=new Ce("imports"),Ce.Region=new Ce("region"),Ce);var fa;(function(t){t[t.AIGenerated=1]="AIGenerated"})(fa||(fa={}));var ga;(function(t){t[t.Invoke=0]="Invoke",t[t.Automatic=1]="Automatic"})(ga||(ga={}));var ba;(function(t){function e(n){return!n||typeof n!="object"?!1:typeof n.id=="string"&&typeof n.title=="string"}t.is=e})(ba||(ba={}));var wa;(function(t){t[t.Type=1]="Type",t[t.Parameter=2]="Parameter"})(wa||(wa={})),new Fd;var va;(function(t){t[t.Unknown=0]="Unknown",t[t.Disabled=1]="Disabled",t[t.Enabled=2]="Enabled"})(va||(va={}));var ya;(function(t){t[t.Invoke=1]="Invoke",t[t.Auto=2]="Auto"})(ya||(ya={}));var xa;(function(t){t[t.None=0]="None",t[t.KeepWhitespace=1]="KeepWhitespace",t[t.InsertAsSnippet=4]="InsertAsSnippet"})(xa||(xa={}));var Sa;(function(t){t[t.Method=0]="Method",t[t.Function=1]="Function",t[t.Constructor=2]="Constructor",t[t.Field=3]="Field",t[t.Variable=4]="Variable",t[t.Class=5]="Class",t[t.Struct=6]="Struct",t[t.Interface=7]="Interface",t[t.Module=8]="Module",t[t.Property=9]="Property",t[t.Event=10]="Event",t[t.Operator=11]="Operator",t[t.Unit=12]="Unit",t[t.Value=13]="Value",t[t.Constant=14]="Constant",t[t.Enum=15]="Enum",t[t.EnumMember=16]="EnumMember",t[t.Keyword=17]="Keyword",t[t.Text=18]="Text",t[t.Color=19]="Color",t[t.File=20]="File",t[t.Reference=21]="Reference",t[t.Customcolor=22]="Customcolor",t[t.Folder=23]="Folder",t[t.TypeParameter=24]="TypeParameter",t[t.User=25]="User",t[t.Issue=26]="Issue",t[t.Tool=27]="Tool",t[t.Snippet=28]="Snippet"})(Sa||(Sa={}));var Ca;(function(t){t[t.Deprecated=1]="Deprecated"})(Ca||(Ca={}));var ka;(function(t){t[t.Invoke=0]="Invoke",t[t.TriggerCharacter=1]="TriggerCharacter",t[t.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(ka||(ka={}));var _a;(function(t){t[t.EXACT=0]="EXACT",t[t.ABOVE=1]="ABOVE",t[t.BELOW=2]="BELOW"})(_a||(_a={}));var Ea;(function(t){t[t.NotSet=0]="NotSet",t[t.ContentFlush=1]="ContentFlush",t[t.RecoverFromMarkers=2]="RecoverFromMarkers",t[t.Explicit=3]="Explicit",t[t.Paste=4]="Paste",t[t.Undo=5]="Undo",t[t.Redo=6]="Redo"})(Ea||(Ea={}));var Fa;(function(t){t[t.LF=1]="LF",t[t.CRLF=2]="CRLF"})(Fa||(Fa={}));var Ra;(function(t){t[t.Text=0]="Text",t[t.Read=1]="Read",t[t.Write=2]="Write"})(Ra||(Ra={}));var Na;(function(t){t[t.None=0]="None",t[t.Keep=1]="Keep",t[t.Brackets=2]="Brackets",t[t.Advanced=3]="Advanced",t[t.Full=4]="Full"})(Na||(Na={}));var Ia;(function(t){t[t.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",t[t.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",t[t.accessibilitySupport=2]="accessibilitySupport",t[t.accessibilityPageSize=3]="accessibilityPageSize",t[t.allowOverflow=4]="allowOverflow",t[t.allowVariableLineHeights=5]="allowVariableLineHeights",t[t.allowVariableFonts=6]="allowVariableFonts",t[t.allowVariableFontsInAccessibilityMode=7]="allowVariableFontsInAccessibilityMode",t[t.ariaLabel=8]="ariaLabel",t[t.ariaRequired=9]="ariaRequired",t[t.autoClosingBrackets=10]="autoClosingBrackets",t[t.autoClosingComments=11]="autoClosingComments",t[t.screenReaderAnnounceInlineSuggestion=12]="screenReaderAnnounceInlineSuggestion",t[t.autoClosingDelete=13]="autoClosingDelete",t[t.autoClosingOvertype=14]="autoClosingOvertype",t[t.autoClosingQuotes=15]="autoClosingQuotes",t[t.autoIndent=16]="autoIndent",t[t.autoIndentOnPaste=17]="autoIndentOnPaste",t[t.autoIndentOnPasteWithinString=18]="autoIndentOnPasteWithinString",t[t.automaticLayout=19]="automaticLayout",t[t.autoSurround=20]="autoSurround",t[t.bracketPairColorization=21]="bracketPairColorization",t[t.guides=22]="guides",t[t.codeLens=23]="codeLens",t[t.codeLensFontFamily=24]="codeLensFontFamily",t[t.codeLensFontSize=25]="codeLensFontSize",t[t.colorDecorators=26]="colorDecorators",t[t.colorDecoratorsLimit=27]="colorDecoratorsLimit",t[t.columnSelection=28]="columnSelection",t[t.comments=29]="comments",t[t.contextmenu=30]="contextmenu",t[t.copyWithSyntaxHighlighting=31]="copyWithSyntaxHighlighting",t[t.cursorBlinking=32]="cursorBlinking",t[t.cursorSmoothCaretAnimation=33]="cursorSmoothCaretAnimation",t[t.cursorStyle=34]="cursorStyle",t[t.cursorSurroundingLines=35]="cursorSurroundingLines",t[t.cursorSurroundingLinesStyle=36]="cursorSurroundingLinesStyle",t[t.cursorWidth=37]="cursorWidth",t[t.cursorHeight=38]="cursorHeight",t[t.disableLayerHinting=39]="disableLayerHinting",t[t.disableMonospaceOptimizations=40]="disableMonospaceOptimizations",t[t.domReadOnly=41]="domReadOnly",t[t.dragAndDrop=42]="dragAndDrop",t[t.dropIntoEditor=43]="dropIntoEditor",t[t.editContext=44]="editContext",t[t.emptySelectionClipboard=45]="emptySelectionClipboard",t[t.experimentalGpuAcceleration=46]="experimentalGpuAcceleration",t[t.experimentalWhitespaceRendering=47]="experimentalWhitespaceRendering",t[t.extraEditorClassName=48]="extraEditorClassName",t[t.fastScrollSensitivity=49]="fastScrollSensitivity",t[t.find=50]="find",t[t.fixedOverflowWidgets=51]="fixedOverflowWidgets",t[t.folding=52]="folding",t[t.foldingStrategy=53]="foldingStrategy",t[t.foldingHighlight=54]="foldingHighlight",t[t.foldingImportsByDefault=55]="foldingImportsByDefault",t[t.foldingMaximumRegions=56]="foldingMaximumRegions",t[t.unfoldOnClickAfterEndOfLine=57]="unfoldOnClickAfterEndOfLine",t[t.fontFamily=58]="fontFamily",t[t.fontInfo=59]="fontInfo",t[t.fontLigatures=60]="fontLigatures",t[t.fontSize=61]="fontSize",t[t.fontWeight=62]="fontWeight",t[t.fontVariations=63]="fontVariations",t[t.formatOnPaste=64]="formatOnPaste",t[t.formatOnType=65]="formatOnType",t[t.glyphMargin=66]="glyphMargin",t[t.gotoLocation=67]="gotoLocation",t[t.hideCursorInOverviewRuler=68]="hideCursorInOverviewRuler",t[t.hover=69]="hover",t[t.inDiffEditor=70]="inDiffEditor",t[t.inlineSuggest=71]="inlineSuggest",t[t.letterSpacing=72]="letterSpacing",t[t.lightbulb=73]="lightbulb",t[t.lineDecorationsWidth=74]="lineDecorationsWidth",t[t.lineHeight=75]="lineHeight",t[t.lineNumbers=76]="lineNumbers",t[t.lineNumbersMinChars=77]="lineNumbersMinChars",t[t.linkedEditing=78]="linkedEditing",t[t.links=79]="links",t[t.matchBrackets=80]="matchBrackets",t[t.minimap=81]="minimap",t[t.mouseStyle=82]="mouseStyle",t[t.mouseWheelScrollSensitivity=83]="mouseWheelScrollSensitivity",t[t.mouseWheelZoom=84]="mouseWheelZoom",t[t.multiCursorMergeOverlapping=85]="multiCursorMergeOverlapping",t[t.multiCursorModifier=86]="multiCursorModifier",t[t.mouseMiddleClickAction=87]="mouseMiddleClickAction",t[t.multiCursorPaste=88]="multiCursorPaste",t[t.multiCursorLimit=89]="multiCursorLimit",t[t.occurrencesHighlight=90]="occurrencesHighlight",t[t.occurrencesHighlightDelay=91]="occurrencesHighlightDelay",t[t.overtypeCursorStyle=92]="overtypeCursorStyle",t[t.overtypeOnPaste=93]="overtypeOnPaste",t[t.overviewRulerBorder=94]="overviewRulerBorder",t[t.overviewRulerLanes=95]="overviewRulerLanes",t[t.padding=96]="padding",t[t.pasteAs=97]="pasteAs",t[t.parameterHints=98]="parameterHints",t[t.peekWidgetDefaultFocus=99]="peekWidgetDefaultFocus",t[t.placeholder=100]="placeholder",t[t.definitionLinkOpensInPeek=101]="definitionLinkOpensInPeek",t[t.quickSuggestions=102]="quickSuggestions",t[t.quickSuggestionsDelay=103]="quickSuggestionsDelay",t[t.readOnly=104]="readOnly",t[t.readOnlyMessage=105]="readOnlyMessage",t[t.renameOnType=106]="renameOnType",t[t.renderRichScreenReaderContent=107]="renderRichScreenReaderContent",t[t.renderControlCharacters=108]="renderControlCharacters",t[t.renderFinalNewline=109]="renderFinalNewline",t[t.renderLineHighlight=110]="renderLineHighlight",t[t.renderLineHighlightOnlyWhenFocus=111]="renderLineHighlightOnlyWhenFocus",t[t.renderValidationDecorations=112]="renderValidationDecorations",t[t.renderWhitespace=113]="renderWhitespace",t[t.revealHorizontalRightPadding=114]="revealHorizontalRightPadding",t[t.roundedSelection=115]="roundedSelection",t[t.rulers=116]="rulers",t[t.scrollbar=117]="scrollbar",t[t.scrollBeyondLastColumn=118]="scrollBeyondLastColumn",t[t.scrollBeyondLastLine=119]="scrollBeyondLastLine",t[t.scrollPredominantAxis=120]="scrollPredominantAxis",t[t.selectionClipboard=121]="selectionClipboard",t[t.selectionHighlight=122]="selectionHighlight",t[t.selectionHighlightMaxLength=123]="selectionHighlightMaxLength",t[t.selectionHighlightMultiline=124]="selectionHighlightMultiline",t[t.selectOnLineNumbers=125]="selectOnLineNumbers",t[t.showFoldingControls=126]="showFoldingControls",t[t.showUnused=127]="showUnused",t[t.snippetSuggestions=128]="snippetSuggestions",t[t.smartSelect=129]="smartSelect",t[t.smoothScrolling=130]="smoothScrolling",t[t.stickyScroll=131]="stickyScroll",t[t.stickyTabStops=132]="stickyTabStops",t[t.stopRenderingLineAfter=133]="stopRenderingLineAfter",t[t.suggest=134]="suggest",t[t.suggestFontSize=135]="suggestFontSize",t[t.suggestLineHeight=136]="suggestLineHeight",t[t.suggestOnTriggerCharacters=137]="suggestOnTriggerCharacters",t[t.suggestSelection=138]="suggestSelection",t[t.tabCompletion=139]="tabCompletion",t[t.tabIndex=140]="tabIndex",t[t.trimWhitespaceOnDelete=141]="trimWhitespaceOnDelete",t[t.unicodeHighlighting=142]="unicodeHighlighting",t[t.unusualLineTerminators=143]="unusualLineTerminators",t[t.useShadowDOM=144]="useShadowDOM",t[t.useTabStops=145]="useTabStops",t[t.wordBreak=146]="wordBreak",t[t.wordSegmenterLocales=147]="wordSegmenterLocales",t[t.wordSeparators=148]="wordSeparators",t[t.wordWrap=149]="wordWrap",t[t.wordWrapBreakAfterCharacters=150]="wordWrapBreakAfterCharacters",t[t.wordWrapBreakBeforeCharacters=151]="wordWrapBreakBeforeCharacters",t[t.wordWrapColumn=152]="wordWrapColumn",t[t.wordWrapOverride1=153]="wordWrapOverride1",t[t.wordWrapOverride2=154]="wordWrapOverride2",t[t.wrappingIndent=155]="wrappingIndent",t[t.wrappingStrategy=156]="wrappingStrategy",t[t.showDeprecated=157]="showDeprecated",t[t.inertialScroll=158]="inertialScroll",t[t.inlayHints=159]="inlayHints",t[t.wrapOnEscapedLineFeeds=160]="wrapOnEscapedLineFeeds",t[t.effectiveCursorStyle=161]="effectiveCursorStyle",t[t.editorClassName=162]="editorClassName",t[t.pixelRatio=163]="pixelRatio",t[t.tabFocusMode=164]="tabFocusMode",t[t.layoutInfo=165]="layoutInfo",t[t.wrappingInfo=166]="wrappingInfo",t[t.defaultColorDecorators=167]="defaultColorDecorators",t[t.colorDecoratorsActivatedOn=168]="colorDecoratorsActivatedOn",t[t.inlineCompletionsAccessibilityVerbose=169]="inlineCompletionsAccessibilityVerbose",t[t.effectiveEditContext=170]="effectiveEditContext",t[t.scrollOnMiddleClick=171]="scrollOnMiddleClick",t[t.effectiveAllowVariableFonts=172]="effectiveAllowVariableFonts"})(Ia||(Ia={}));var Da;(function(t){t[t.TextDefined=0]="TextDefined",t[t.LF=1]="LF",t[t.CRLF=2]="CRLF"})(Da||(Da={}));var La;(function(t){t[t.LF=0]="LF",t[t.CRLF=1]="CRLF"})(La||(La={}));var Aa;(function(t){t[t.Left=1]="Left",t[t.Center=2]="Center",t[t.Right=3]="Right"})(Aa||(Aa={}));var Ma;(function(t){t[t.Increase=0]="Increase",t[t.Decrease=1]="Decrease"})(Ma||(Ma={}));var za;(function(t){t[t.None=0]="None",t[t.Indent=1]="Indent",t[t.IndentOutdent=2]="IndentOutdent",t[t.Outdent=3]="Outdent"})(za||(za={}));var Pa;(function(t){t[t.Both=0]="Both",t[t.Right=1]="Right",t[t.Left=2]="Left",t[t.None=3]="None"})(Pa||(Pa={}));var Ta;(function(t){t[t.Type=1]="Type",t[t.Parameter=2]="Parameter"})(Ta||(Ta={}));var Oa;(function(t){t[t.Accepted=0]="Accepted",t[t.Rejected=1]="Rejected",t[t.Ignored=2]="Ignored"})(Oa||(Oa={}));var Wa;(function(t){t[t.Code=1]="Code",t[t.Label=2]="Label"})(Wa||(Wa={}));var Va;(function(t){t[t.Automatic=0]="Automatic",t[t.Explicit=1]="Explicit"})(Va||(Va={}));var li;(function(t){t[t.DependsOnKbLayout=-1]="DependsOnKbLayout",t[t.Unknown=0]="Unknown",t[t.Backspace=1]="Backspace",t[t.Tab=2]="Tab",t[t.Enter=3]="Enter",t[t.Shift=4]="Shift",t[t.Ctrl=5]="Ctrl",t[t.Alt=6]="Alt",t[t.PauseBreak=7]="PauseBreak",t[t.CapsLock=8]="CapsLock",t[t.Escape=9]="Escape",t[t.Space=10]="Space",t[t.PageUp=11]="PageUp",t[t.PageDown=12]="PageDown",t[t.End=13]="End",t[t.Home=14]="Home",t[t.LeftArrow=15]="LeftArrow",t[t.UpArrow=16]="UpArrow",t[t.RightArrow=17]="RightArrow",t[t.DownArrow=18]="DownArrow",t[t.Insert=19]="Insert",t[t.Delete=20]="Delete",t[t.Digit0=21]="Digit0",t[t.Digit1=22]="Digit1",t[t.Digit2=23]="Digit2",t[t.Digit3=24]="Digit3",t[t.Digit4=25]="Digit4",t[t.Digit5=26]="Digit5",t[t.Digit6=27]="Digit6",t[t.Digit7=28]="Digit7",t[t.Digit8=29]="Digit8",t[t.Digit9=30]="Digit9",t[t.KeyA=31]="KeyA",t[t.KeyB=32]="KeyB",t[t.KeyC=33]="KeyC",t[t.KeyD=34]="KeyD",t[t.KeyE=35]="KeyE",t[t.KeyF=36]="KeyF",t[t.KeyG=37]="KeyG",t[t.KeyH=38]="KeyH",t[t.KeyI=39]="KeyI",t[t.KeyJ=40]="KeyJ",t[t.KeyK=41]="KeyK",t[t.KeyL=42]="KeyL",t[t.KeyM=43]="KeyM",t[t.KeyN=44]="KeyN",t[t.KeyO=45]="KeyO",t[t.KeyP=46]="KeyP",t[t.KeyQ=47]="KeyQ",t[t.KeyR=48]="KeyR",t[t.KeyS=49]="KeyS",t[t.KeyT=50]="KeyT",t[t.KeyU=51]="KeyU",t[t.KeyV=52]="KeyV",t[t.KeyW=53]="KeyW",t[t.KeyX=54]="KeyX",t[t.KeyY=55]="KeyY",t[t.KeyZ=56]="KeyZ",t[t.Meta=57]="Meta",t[t.ContextMenu=58]="ContextMenu",t[t.F1=59]="F1",t[t.F2=60]="F2",t[t.F3=61]="F3",t[t.F4=62]="F4",t[t.F5=63]="F5",t[t.F6=64]="F6",t[t.F7=65]="F7",t[t.F8=66]="F8",t[t.F9=67]="F9",t[t.F10=68]="F10",t[t.F11=69]="F11",t[t.F12=70]="F12",t[t.F13=71]="F13",t[t.F14=72]="F14",t[t.F15=73]="F15",t[t.F16=74]="F16",t[t.F17=75]="F17",t[t.F18=76]="F18",t[t.F19=77]="F19",t[t.F20=78]="F20",t[t.F21=79]="F21",t[t.F22=80]="F22",t[t.F23=81]="F23",t[t.F24=82]="F24",t[t.NumLock=83]="NumLock",t[t.ScrollLock=84]="ScrollLock",t[t.Semicolon=85]="Semicolon",t[t.Equal=86]="Equal",t[t.Comma=87]="Comma",t[t.Minus=88]="Minus",t[t.Period=89]="Period",t[t.Slash=90]="Slash",t[t.Backquote=91]="Backquote",t[t.BracketLeft=92]="BracketLeft",t[t.Backslash=93]="Backslash",t[t.BracketRight=94]="BracketRight",t[t.Quote=95]="Quote",t[t.OEM_8=96]="OEM_8",t[t.IntlBackslash=97]="IntlBackslash",t[t.Numpad0=98]="Numpad0",t[t.Numpad1=99]="Numpad1",t[t.Numpad2=100]="Numpad2",t[t.Numpad3=101]="Numpad3",t[t.Numpad4=102]="Numpad4",t[t.Numpad5=103]="Numpad5",t[t.Numpad6=104]="Numpad6",t[t.Numpad7=105]="Numpad7",t[t.Numpad8=106]="Numpad8",t[t.Numpad9=107]="Numpad9",t[t.NumpadMultiply=108]="NumpadMultiply",t[t.NumpadAdd=109]="NumpadAdd",t[t.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",t[t.NumpadSubtract=111]="NumpadSubtract",t[t.NumpadDecimal=112]="NumpadDecimal",t[t.NumpadDivide=113]="NumpadDivide",t[t.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",t[t.ABNT_C1=115]="ABNT_C1",t[t.ABNT_C2=116]="ABNT_C2",t[t.AudioVolumeMute=117]="AudioVolumeMute",t[t.AudioVolumeUp=118]="AudioVolumeUp",t[t.AudioVolumeDown=119]="AudioVolumeDown",t[t.BrowserSearch=120]="BrowserSearch",t[t.BrowserHome=121]="BrowserHome",t[t.BrowserBack=122]="BrowserBack",t[t.BrowserForward=123]="BrowserForward",t[t.MediaTrackNext=124]="MediaTrackNext",t[t.MediaTrackPrevious=125]="MediaTrackPrevious",t[t.MediaStop=126]="MediaStop",t[t.MediaPlayPause=127]="MediaPlayPause",t[t.LaunchMediaPlayer=128]="LaunchMediaPlayer",t[t.LaunchMail=129]="LaunchMail",t[t.LaunchApp2=130]="LaunchApp2",t[t.Clear=131]="Clear",t[t.MAX_VALUE=132]="MAX_VALUE"})(li||(li={}));var ci;(function(t){t[t.Hint=1]="Hint",t[t.Info=2]="Info",t[t.Warning=4]="Warning",t[t.Error=8]="Error"})(ci||(ci={}));var hi;(function(t){t[t.Unnecessary=1]="Unnecessary",t[t.Deprecated=2]="Deprecated"})(hi||(hi={}));var $a;(function(t){t[t.Inline=1]="Inline",t[t.Gutter=2]="Gutter"})($a||($a={}));var Ua;(function(t){t[t.Normal=1]="Normal",t[t.Underlined=2]="Underlined"})(Ua||(Ua={}));var Ba;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.TEXTAREA=1]="TEXTAREA",t[t.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",t[t.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",t[t.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",t[t.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",t[t.CONTENT_TEXT=6]="CONTENT_TEXT",t[t.CONTENT_EMPTY=7]="CONTENT_EMPTY",t[t.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",t[t.CONTENT_WIDGET=9]="CONTENT_WIDGET",t[t.OVERVIEW_RULER=10]="OVERVIEW_RULER",t[t.SCROLLBAR=11]="SCROLLBAR",t[t.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",t[t.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(Ba||(Ba={}));var qa;(function(t){t[t.AIGenerated=1]="AIGenerated"})(qa||(qa={}));var ja;(function(t){t[t.Invoke=0]="Invoke",t[t.Automatic=1]="Automatic"})(ja||(ja={}));var Ha;(function(t){t[t.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",t[t.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",t[t.TOP_CENTER=2]="TOP_CENTER"})(Ha||(Ha={}));var Ga;(function(t){t[t.Left=1]="Left",t[t.Center=2]="Center",t[t.Right=4]="Right",t[t.Full=7]="Full"})(Ga||(Ga={}));var Ja;(function(t){t[t.Word=0]="Word",t[t.Line=1]="Line",t[t.Suggest=2]="Suggest"})(Ja||(Ja={}));var Xa;(function(t){t[t.Left=0]="Left",t[t.Right=1]="Right",t[t.None=2]="None",t[t.LeftOfInjectedText=3]="LeftOfInjectedText",t[t.RightOfInjectedText=4]="RightOfInjectedText"})(Xa||(Xa={}));var Ya;(function(t){t[t.Off=0]="Off",t[t.On=1]="On",t[t.Relative=2]="Relative",t[t.Interval=3]="Interval",t[t.Custom=4]="Custom"})(Ya||(Ya={}));var Qa;(function(t){t[t.None=0]="None",t[t.Text=1]="Text",t[t.Blocks=2]="Blocks"})(Qa||(Qa={}));var Ka;(function(t){t[t.Smooth=0]="Smooth",t[t.Immediate=1]="Immediate"})(Ka||(Ka={}));var Za;(function(t){t[t.Auto=1]="Auto",t[t.Hidden=2]="Hidden",t[t.Visible=3]="Visible"})(Za||(Za={}));var di;(function(t){t[t.LTR=0]="LTR",t[t.RTL=1]="RTL"})(di||(di={}));var eo;(function(t){t.Off="off",t.OnCode="onCode",t.On="on"})(eo||(eo={}));var to;(function(t){t[t.Invoke=1]="Invoke",t[t.TriggerCharacter=2]="TriggerCharacter",t[t.ContentChange=3]="ContentChange"})(to||(to={}));var no;(function(t){t[t.File=0]="File",t[t.Module=1]="Module",t[t.Namespace=2]="Namespace",t[t.Package=3]="Package",t[t.Class=4]="Class",t[t.Method=5]="Method",t[t.Property=6]="Property",t[t.Field=7]="Field",t[t.Constructor=8]="Constructor",t[t.Enum=9]="Enum",t[t.Interface=10]="Interface",t[t.Function=11]="Function",t[t.Variable=12]="Variable",t[t.Constant=13]="Constant",t[t.String=14]="String",t[t.Number=15]="Number",t[t.Boolean=16]="Boolean",t[t.Array=17]="Array",t[t.Object=18]="Object",t[t.Key=19]="Key",t[t.Null=20]="Null",t[t.EnumMember=21]="EnumMember",t[t.Struct=22]="Struct",t[t.Event=23]="Event",t[t.Operator=24]="Operator",t[t.TypeParameter=25]="TypeParameter"})(no||(no={}));var ro;(function(t){t[t.Deprecated=1]="Deprecated"})(ro||(ro={}));var io;(function(t){t[t.LTR=0]="LTR",t[t.RTL=1]="RTL"})(io||(io={}));var so;(function(t){t[t.Hidden=0]="Hidden",t[t.Blink=1]="Blink",t[t.Smooth=2]="Smooth",t[t.Phase=3]="Phase",t[t.Expand=4]="Expand",t[t.Solid=5]="Solid"})(so||(so={}));var ao;(function(t){t[t.Line=1]="Line",t[t.Block=2]="Block",t[t.Underline=3]="Underline",t[t.LineThin=4]="LineThin",t[t.BlockOutline=5]="BlockOutline",t[t.UnderlineThin=6]="UnderlineThin"})(ao||(ao={}));var oo;(function(t){t[t.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",t[t.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",t[t.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",t[t.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(oo||(oo={}));var lo;(function(t){t[t.None=0]="None",t[t.Same=1]="Same",t[t.Indent=2]="Indent",t[t.DeepIndent=3]="DeepIndent"})(lo||(lo={}));const sn=class sn{static chord(e,n){return ad(e,n)}};sn.CtrlCmd=2048,sn.Shift=1024,sn.Alt=512,sn.WinCtrl=256;let ui=sn;function Id(){return{editor:void 0,languages:void 0,CancellationTokenSource:nd,Emitter:Ue,KeyCode:li,KeyMod:ui,Position:re,Range:J,Selection:Re,SelectionDirection:di,MarkerSeverity:ci,MarkerTag:hi,Uri:si,Token:Nd}}var co;class Dd{constructor(){this[co]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,n=0){const r=this._map.get(e);if(r)return n!==0&&this.touch(r,n),r.value}set(e,n,r=0){let i=this._map.get(e);if(i)i.value=n,r!==0&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case 0:this.addItemLast(i);break;case 1:this.addItemFirst(i);break;case 2:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const n=this._map.get(e);if(n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){const r=this._state;let i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){const e=this,n=this._state;let r=this._head;const i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){const s={value:r.key,done:!1};return r=r.next,s}else return{value:void 0,done:!0}}};return i}values(){const e=this,n=this._state;let r=this._head;const i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){const s={value:r.value,done:!1};return r=r.next,s}else return{value:void 0,done:!0}}};return i}entries(){const e=this,n=this._state;let r=this._head;const i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){const s={value:[r.key,r.value],done:!1};return r=r.next,s}else return{value:void 0,done:!0}}};return i}[(co=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._tail,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.previous,r--;this._tail=n,this._size=r,n&&(n.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==1&&n!==2)){if(n===1){if(e===this._head)return;const r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===2){if(e===this._tail)return;const r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(const[n,r]of e)this.set(n,r)}}class Ld extends Dd{constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,n=2){return super.get(e,n)}peek(e){return super.get(e,0)}set(e,n){return super.set(e,n,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}}class Ad extends Ld{constructor(e,n=1){super(e,n)}trim(e){this.trimOld(e)}set(e,n){return super.set(e,n),this.checkTrim(),this}}class Md{constructor(){this.map=new Map}add(e,n){let r=this.map.get(e);r||(r=new Set,this.map.set(e,r)),r.add(n)}delete(e,n){const r=this.map.get(e);r&&(r.delete(n),r.size===0&&this.map.delete(e))}forEach(e,n){const r=this.map.get(e);r&&r.forEach(n)}}new Ad(10);var ho;(function(t){t[t.Left=1]="Left",t[t.Center=2]="Center",t[t.Right=4]="Right",t[t.Full=7]="Full"})(ho||(ho={}));var uo;(function(t){t[t.Left=1]="Left",t[t.Center=2]="Center",t[t.Right=3]="Right"})(uo||(uo={}));var po;(function(t){t[t.LTR=0]="LTR",t[t.RTL=1]="RTL"})(po||(po={}));var mo;(function(t){t[t.Both=0]="Both",t[t.Right=1]="Right",t[t.Left=2]="Left",t[t.None=3]="None"})(mo||(mo={}));function zd(t){if(!t||t.length===0)return!1;for(let e=0,n=t.length;e=n)break;const i=t.charCodeAt(e);if(i===110||i===114||i===87)return!0}}return!1}function Pd(t,e,n,r,i){if(r===0)return!0;const s=e.charCodeAt(r-1);if(t.get(s)!==0||s===13||s===10)return!0;if(i>0){const a=e.charCodeAt(r);if(t.get(a)!==0)return!0}return!1}function Td(t,e,n,r,i){if(r+i===n)return!0;const s=e.charCodeAt(r+i);if(t.get(s)!==0||s===13||s===10)return!0;if(i>0){const a=e.charCodeAt(r+i-1);if(t.get(a)!==0)return!0}return!1}function Od(t,e,n,r,i){return Pd(t,e,n,r,i)&&Td(t,e,n,r,i)}class Wd{constructor(e,n){this._wordSeparators=e,this._searchRegex=n,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const n=e.length;let r;do{if(this._prevMatchStartIndex+this._prevMatchLength===n||(r=this._searchRegex.exec(e),!r))return null;const i=r.index,s=r[0].length;if(i===this._prevMatchStartIndex&&s===this._prevMatchLength){if(s===0){Oh(e,n,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=i,this._prevMatchLength=s,!this._wordSeparators||Od(this._wordSeparators,e,n,i,s))return r}while(r);return null}}const Vd="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function $d(t=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const n of Vd)t.indexOf(n)>=0||(e+="\\"+n);return e+="\\s]+)",new RegExp(e,"g")}const fo=$d();function go(t){let e=fo;if(t&&t instanceof RegExp)if(t.global)e=t;else{let n="g";t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),e=new RegExp(t.source,n)}return e.lastIndex=0,e}const bo=new uh;bo.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function pi(t,e,n,r,i){if(e=go(e),i||(i=Bn.first(bo)),n.length>i.maxLen){let c=t-i.maxLen/2;return c<0?c=0:r+=c,n=n.substring(c,t+i.maxLen/2),pi(t,e,n,r,i)}const s=Date.now(),a=t-1-r;let o=-1,l=null;for(let c=1;!(Date.now()-s>=i.timeBudget);c++){const d=a-i.windowSize*c;e.lastIndex=Math.max(0,d);const u=Ud(e,n,a,o);if(!u&&l||(l=u,d<=0))break;o=d}if(l){const c={word:l[0],startColumn:r+1+l.index,endColumn:r+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function Ud(t,e,n,r){let i;for(;i=t.exec(e);){const s=i.index||0;if(s<=n&&t.lastIndex>=n)return i;if(r>0&&s>r)return null}return null}class Bd{static computeUnicodeHighlights(e,n,r){const i=r?r.startLineNumber:1,s=r?r.endLineNumber:e.getLineCount(),a=new wo(n),o=a.getCandidateCodePoints();let l;o==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${qd(Array.from(o))}`,"g");const c=new Wd(null,l),d=[];let u=!1,m,f=0,g=0,b=0;e:for(let k=i,F=s;k<=F;k++){const N=e.getLineContent(k),_=N.length;c.reset(0);do if(m=c.next(N),m){let T=m.index,O=m.index+m[0].length;if(T>0){const z=N.charCodeAt(T-1);Xr(z)&&T--}if(O+1<_){const z=N.charCodeAt(O-1);Xr(z)&&O++}const V=N.substring(T,O);let I=pi(T+1,fo,N,0);I&&I.endColumn<=T+1&&(I=null);const R=a.shouldHighlightNonBasicASCII(V,I?I.word:null);if(R!==0){if(R===3?f++:R===2?g++:R===1?b++:ah(),d.length>=1e3){u=!0;break e}d.push(new J(k,T+1,k,O+1))}}while(m)}return{ranges:d,hasMore:u,ambiguousCharacterCount:f,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:b}}static computeUnicodeHighlightReason(e,n){const r=new wo(n);switch(r.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const s=e.codePointAt(0),a=r.ambiguousCharacters.getPrimaryConfusable(s),o=dn.getLocales().filter(l=>!dn.getInstance(new Set([...n.allowedLocales,l])).isAmbiguous(s));return{kind:0,confusableWith:String.fromCodePoint(a),notAmbiguousInLocales:o}}case 1:return{kind:2}}}}function qd(t,e){return`[${Nh(t.map(r=>String.fromCodePoint(r)).join(""))}]`}class wo{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=dn.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const n of un.codePoints)vo(String.fromCodePoint(n))||e.add(n);if(this.options.ambiguousCharacters)for(const n of this.ambiguousCharacters.getConfusableCodePoints())e.add(n);for(const n of this.allowedCodePoints)e.delete(n);return e}shouldHighlightNonBasicASCII(e,n){const r=e.codePointAt(0);if(this.allowedCodePoints.has(r))return 0;if(this.options.nonBasicASCII)return 1;let i=!1,s=!1;if(n)for(const a of n){const o=a.codePointAt(0),l=Vh(a);i=i||l,!l&&!this.ambiguousCharacters.isAmbiguous(o)&&!un.isInvisibleCharacter(o)&&(s=!0)}return!i&&s?0:this.options.invisibleCharacters&&!vo(e)&&un.isInvisibleCharacter(r)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(r)?3:0}}function vo(t){return t===" "||t===` +`||t===" "}class er{constructor(e,n,r){this.changes=e,this.moves=n,this.hitTimeout=r}}class jd{constructor(e,n){this.lineRangeMapping=e,this.changes=n}}function Hd(t,e,n=(r,i)=>r===i){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let r=0,i=t.length;r0}t.isGreaterThan=r;function i(s){return s===0}t.isNeitherLessOrGreaterThan=i,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(mi||(mi={}));function mn(t,e){return(n,r)=>e(t(n),t(r))}const fn=(t,e)=>t-e;function Qd(t){return(e,n)=>-t(e,n)}const an=class an{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(n=>(e.push(n),!0)),e}filter(e){return new an(n=>this.iterate(r=>e(r)?n(r):!0))}map(e){return new an(n=>this.iterate(r=>n(e(r))))}findLast(e){let n;return this.iterate(r=>(e(r)&&(n=r),!0)),n}findLastMaxBy(e){let n,r=!0;return this.iterate(i=>((r||mi.isGreaterThan(e(i,n)))&&(r=!1,n=i),!0)),n}};an.empty=new an(e=>{});let yo=an;class Y{static fromTo(e,n){return new Y(e,n)}static addRange(e,n){let r=0;for(;rn))return new Y(e,n)}static ofLength(e){return new Y(0,e)}static ofStartAndLength(e,n){return new Y(e,e+n)}static emptyAt(e){return new Y(e,e)}constructor(e,n){if(this.start=e,this.endExclusive=n,e>n)throw new be(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new Y(this.start+e,this.endExclusive+e)}deltaStart(e){return new Y(this.start+e,this.endExclusive)}deltaEnd(e){return new Y(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new be(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new be(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let n=this.start;nn)throw new be(`startLineNumber ${e} cannot be after endLineNumberExclusive ${n}`);this.startLineNumber=e,this.endLineNumberExclusive=n}contains(e){return this.startLineNumber<=e&&ee.startLineNumber,fn);let Z=De;class qe{constructor(e=[]){this._normalizedRanges=e}get ranges(){return this._normalizedRanges}addRange(e){if(e.length===0)return;const n=fi(this._normalizedRanges,i=>i.endLineNumberExclusive>=e.startLineNumber),r=Ot(this._normalizedRanges,i=>i.startLineNumber<=e.endLineNumberExclusive)+1;if(n===r)this._normalizedRanges.splice(n,0,e);else if(n===r-1){const i=this._normalizedRanges[n];this._normalizedRanges[n]=i.join(e)}else{const i=this._normalizedRanges[n].join(this._normalizedRanges[r-1]).join(e);this._normalizedRanges.splice(n,r-n,i)}}contains(e){const n=Tt(this._normalizedRanges,r=>r.startLineNumber<=e);return!!n&&n.endLineNumberExclusive>e}intersects(e){const n=Tt(this._normalizedRanges,r=>r.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;const n=[];let r=0,i=0,s=null;for(;r=a.startLineNumber?s=new Z(s.startLineNumber,Math.max(s.endLineNumberExclusive,a.endLineNumberExclusive)):(n.push(s),s=a)}return s!==null&&n.push(s),new qe(n)}subtractFrom(e){const n=fi(this._normalizedRanges,a=>a.endLineNumberExclusive>=e.startLineNumber),r=Ot(this._normalizedRanges,a=>a.startLineNumber<=e.endLineNumberExclusive)+1;if(n===r)return new qe([e]);const i=[];let s=e.startLineNumber;for(let a=n;as&&i.push(new Z(s,o.startLineNumber)),s=o.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){const n=[];let r=0,i=0;for(;rn.delta(e)))}}const $e=class $e{static betweenPositions(e,n){return e.lineNumber===n.lineNumber?new $e(0,n.column-e.column):new $e(n.lineNumber-e.lineNumber,n.column-1)}static fromPosition(e){return new $e(e.lineNumber-1,e.column-1)}static ofRange(e){return $e.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let n=0,r=0;for(const i of e)i===` +`?(n++,r=0):r++;return new $e(n,r)}constructor(e,n){this.lineCount=e,this.columnCount=n}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}add(e){return e.lineCount===0?new $e(this.lineCount,this.columnCount+e.columnCount):new $e(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new J(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new J(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new J(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return Z.ofLength(1,this.lineCount+1)}addToPosition(e){return this.lineCount===0?new re(e.lineNumber,e.column+this.columnCount):new re(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}};$e.zero=new $e(0,0);let gn=$e;class Zd{getOffsetRange(e){return new Y(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return J.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringReplacement(e){return new Wt.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new Wt.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){const n=e.replacements.map(r=>this.getTextReplacement(r));return new Wt.deps.TextEdit(n)}}const Ls=class Ls{static get deps(){if(!this._deps)throw new Error("Dependencies not set. Call _setDependencies first.");return this._deps}};Ls._deps=void 0;let Wt=Ls;class eu extends Zd{constructor(e){super(),this.text=e,this.lineStartOffsetByLineIdx=[],this.lineEndOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let n=0;n0&&e.charAt(n-1)==="\r"?this.lineEndOffsetByLineIdx.push(n-1):this.lineEndOffsetByLineIdx.push(n));this.lineEndOffsetByLineIdx.push(e.length)}getOffset(e){const n=this._validatePosition(e);return this.lineStartOffsetByLineIdx[n.lineNumber-1]+n.column-1}_validatePosition(e){if(e.lineNumber<1)return new re(1,1);const n=this.textLength.lineCount+1;if(e.lineNumber>n){const i=this.getLineLength(n);return new re(n,i+1)}if(e.column<1)return new re(e.lineNumber,1);const r=this.getLineLength(e.lineNumber);return e.column-1>r?new re(e.lineNumber,r+1):e}getPosition(e){const n=Ot(this.lineStartOffsetByLineIdx,s=>s<=e),r=n+1,i=e-this.lineStartOffsetByLineIdx[n]+1;return new re(r,i)}get textLength(){const e=this.lineStartOffsetByLineIdx.length-1;return new Wt.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}}class tu{constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new re(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getValueOfOffsetRange(e){return this.getValueOfRange(this.getTransformer().getRange(e))}getLineLength(e){return this.getValueOfRange(new J(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new eu(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new J(e,1,e,Number.MAX_SAFE_INTEGER))}}class nu extends tu{constructor(e,n){oh(n>=1),super(),this._getLineContent=e,this._lineCount=n}getValueOfRange(e){if(e.startLineNumber===e.endLineNumber)return this._getLineContent(e.startLineNumber).substring(e.startColumn-1,e.endColumn-1);let n=this._getLineContent(e.startLineNumber).substring(e.startColumn-1);for(let r=e.startLineNumber+1;re[n-1],e.length)}}class ut{static joinReplacements(e,n){if(e.length===0)throw new be;if(e.length===1)return e[0];const r=e[0].range.getStartPosition(),i=e[e.length-1].range.getEndPosition();let s="";for(let a=0;a ${n.lineNumber},${n.column}): "${this.text}"`}}class Le{static inverse(e,n,r){const i=[];let s=1,a=1;for(const l of e){const c=new Le(new Z(s,l.original.startLineNumber),new Z(a,l.modified.startLineNumber));c.modified.isEmpty||i.push(c),s=l.original.endLineNumberExclusive,a=l.modified.endLineNumberExclusive}const o=new Le(new Z(s,n+1),new Z(a,r+1));return o.modified.isEmpty||i.push(o),i}static clip(e,n,r){const i=[];for(const s of e){const a=s.original.intersect(n),o=s.modified.intersect(r);a&&!a.isEmpty&&o&&!o.isEmpty&&i.push(new Le(a,o))}return i}constructor(e,n){this.original=e,this.modified=n}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new Le(this.modified,this.original)}join(e){return new Le(this.original.join(e.original),this.modified.join(e.modified))}toRangeMapping(){const e=this.original.toInclusiveRange(),n=this.modified.toInclusiveRange();if(e&&n)return new Ae(e,n);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new be("not a valid diff");return new Ae(new J(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new J(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new Ae(new J(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new J(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,n){if(xo(this.original.endLineNumberExclusive,e)&&xo(this.modified.endLineNumberExclusive,n))return new Ae(new J(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new J(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new Ae(J.fromPositions(new re(this.original.startLineNumber,1),Vt(new re(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),J.fromPositions(new re(this.modified.startLineNumber,1),Vt(new re(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),n)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new Ae(J.fromPositions(Vt(new re(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),Vt(new re(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),J.fromPositions(Vt(new re(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),n),Vt(new re(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),n)));throw new be}}function Vt(t,e){if(t.lineNumber<1)return new re(1,1);if(t.lineNumber>e.length)return new re(e.length,e[e.length-1].length+1);const n=e[t.lineNumber-1];return t.column>n.length+1?new re(t.lineNumber,n.length+1):t}function xo(t,e){return t>=1&&t<=e.length}class Ke extends Le{static fromRangeMappings(e){const n=Z.join(e.map(i=>Z.fromRangeInclusive(i.originalRange))),r=Z.join(e.map(i=>Z.fromRangeInclusive(i.modifiedRange)));return new Ke(n,r,e)}constructor(e,n,r){super(e,n),this.innerChanges=r}flip(){return new Ke(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new Ke(this.original,this.modified,[this.toRangeMapping()])}}class Ae{static fromEdit(e){const n=e.getNewRanges();return e.replacements.map((i,s)=>new Ae(i.range,n[s]))}static assertSorted(e){for(let n=1;n${this.modifiedRange.toString()}}`}flip(){return new Ae(this.modifiedRange,this.originalRange)}toTextEdit(e){const n=e.getValueOfRange(this.modifiedRange);return new ut(this.originalRange,n)}}function So(t,e,n,r=!1){const i=[];for(const s of Gd(t.map(a=>ru(a,e,n)),(a,o)=>a.original.intersectsOrTouches(o.original)||a.modified.intersectsOrTouches(o.modified))){const a=s[0],o=s[s.length-1];i.push(new Ke(a.original.join(o.original),a.modified.join(o.modified),s.map(l=>l.innerChanges[0])))}return Un(()=>!r&&i.length>0&&(i[0].modified.startLineNumber!==i[0].original.startLineNumber||n.length.lineCount-i[i.length-1].modified.endLineNumberExclusive!==e.length.lineCount-i[i.length-1].original.endLineNumberExclusive)?!1:Ps(i,(s,a)=>a.original.startLineNumber-s.original.endLineNumberExclusive===a.modified.startLineNumber-s.modified.endLineNumberExclusive&&s.original.endLineNumberExclusive=n.getLineLength(t.modifiedRange.startLineNumber)&&t.originalRange.startColumn-1>=e.getLineLength(t.originalRange.startLineNumber)&&t.originalRange.startLineNumber<=t.originalRange.endLineNumber+i&&t.modifiedRange.startLineNumber<=t.modifiedRange.endLineNumber+i&&(r=1);const s=new Z(t.originalRange.startLineNumber+r,t.originalRange.endLineNumber+1+i),a=new Z(t.modifiedRange.startLineNumber+r,t.modifiedRange.endLineNumber+1+i);return new Ke(s,a,[t])}const iu=3;class su{computeDiff(e,n,r){const s=new lu(e,n,{maxComputationTime:r.maxComputationTimeMs,shouldIgnoreTrimWhitespace:r.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),a=[];let o=null;for(const l of s.changes){let c;l.originalEndLineNumber===0?c=new Z(l.originalStartLineNumber+1,l.originalStartLineNumber+1):c=new Z(l.originalStartLineNumber,l.originalEndLineNumber+1);let d;l.modifiedEndLineNumber===0?d=new Z(l.modifiedStartLineNumber+1,l.modifiedStartLineNumber+1):d=new Z(l.modifiedStartLineNumber,l.modifiedEndLineNumber+1);let u=new Ke(c,d,l.charChanges?.map(m=>new Ae(new J(m.originalStartLineNumber,m.originalStartColumn,m.originalEndLineNumber,m.originalEndColumn),new J(m.modifiedStartLineNumber,m.modifiedStartColumn,m.modifiedEndLineNumber,m.modifiedEndColumn))));o&&(o.modified.endLineNumberExclusive===u.modified.startLineNumber||o.original.endLineNumberExclusive===u.original.startLineNumber)&&(u=new Ke(o.original.join(u.original),o.modified.join(u.modified),o.innerChanges&&u.innerChanges?o.innerChanges.concat(u.innerChanges):void 0),a.pop()),a.push(u),o=u}return Un(()=>Ps(a,(l,c)=>c.original.startLineNumber-l.original.endLineNumberExclusive===c.modified.startLineNumber-l.modified.endLineNumberExclusive&&l.original.endLineNumberExclusive(e===10?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[n]},${this._columns[n]})`).join(", ")+"]"}_assertIndex(e,n){if(e<0||e>=n.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return e===-1?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),this._charCodes[e]===10?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return e===-1?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),this._charCodes[e]===10?1:this._columns[e]+1)}}class $t{constructor(e,n,r,i,s,a,o,l){this.originalStartLineNumber=e,this.originalStartColumn=n,this.originalEndLineNumber=r,this.originalEndColumn=i,this.modifiedStartLineNumber=s,this.modifiedStartColumn=a,this.modifiedEndLineNumber=o,this.modifiedEndColumn=l}static createFromDiffChange(e,n,r){const i=n.getStartLineNumber(e.originalStart),s=n.getStartColumn(e.originalStart),a=n.getEndLineNumber(e.originalStart+e.originalLength-1),o=n.getEndColumn(e.originalStart+e.originalLength-1),l=r.getStartLineNumber(e.modifiedStart),c=r.getStartColumn(e.modifiedStart),d=r.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),u=r.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new $t(i,s,a,o,l,c,d,u)}}function ou(t){if(t.length<=1)return t;const e=[t[0]];let n=e[0];for(let r=1,i=t.length;r0&&n.originalLength<20&&n.modifiedLength>0&&n.modifiedLength<20&&s()){const f=r.createCharSequence(e,n.originalStart,n.originalStart+n.originalLength-1),g=i.createCharSequence(e,n.modifiedStart,n.modifiedStart+n.modifiedLength-1);if(f.getElements().length>0&&g.getElements().length>0){let b=Co(f,g,s,!0).changes;o&&(b=ou(b)),m=[];for(let k=0,F=b.length;k1&&b>1;){const k=m.charCodeAt(g-2),F=f.charCodeAt(b-2);if(k!==F)break;g--,b--}(g>1||b>1)&&this._pushTrimWhitespaceCharChange(i,s+1,1,g,a+1,1,b)}{let g=bi(m,1),b=bi(f,1);const k=m.length+1,F=f.length+1;for(;g!0;const e=Date.now();return()=>Date.now()-e{r.push(ce.fromOffsetPairs(i?i.getEndExclusives():et.zero,s?s.getStarts():new et(n,(i?i.seq2Range.endExclusive-i.seq1Range.endExclusive:0)+n)))}),r}static fromOffsetPairs(e,n){return new ce(new Y(e.offset1,n.offset1),new Y(e.offset2,n.offset2))}static assertSorted(e){let n;for(const r of e){if(n&&!(n.seq1Range.endExclusive<=r.seq1Range.start&&n.seq2Range.endExclusive<=r.seq2Range.start))throw new be("Sequence diffs must be sorted");n=r}}constructor(e,n){this.seq1Range=e,this.seq2Range=n}swap(){return new ce(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new ce(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new ce(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new ce(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new ce(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const n=this.seq1Range.intersect(e.seq1Range),r=this.seq2Range.intersect(e.seq2Range);if(!(!n||!r))return new ce(n,r)}getStarts(){return new et(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new et(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}const Ft=class Ft{constructor(e,n){this.offset1=e,this.offset2=n}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new Ft(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}};Ft.zero=new Ft(0,0),Ft.max=new Ft(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);let et=Ft;const zr=class zr{isValid(){return!0}};zr.instance=new zr;let wn=zr;class cu{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new be("timeout must be positive")}isValid(){return!(Date.now()-this.startTime0&&b>0&&a.get(g-1,b-1)===3&&(N+=o.get(g-1,b-1)),N+=i?i(g,b):1):N=-1;const _=Math.max(k,F,N);if(_===N){const T=g>0&&b>0?o.get(g-1,b-1):0;o.set(g,b,T+1),a.set(g,b,3)}else _===k?(o.set(g,b,0),a.set(g,b,1)):_===F&&(o.set(g,b,0),a.set(g,b,2));s.set(g,b,_)}const l=[];let c=e.length,d=n.length;function u(g,b){(g+1!==c||b+1!==d)&&l.push(new ce(new Y(g+1,c),new Y(b+1,d))),c=g,d=b}let m=e.length-1,f=n.length-1;for(;m>=0&&f>=0;)a.get(m,f)===3?(u(m,f),m--,f--):a.get(m,f)===1?m--:f--;return u(-1,-1),l.reverse(),new Ze(l,!1)}}class Eo{compute(e,n,r=wn.instance){if(e.length===0||n.length===0)return Ze.trivial(e,n);const i=e,s=n;function a(b,k){for(;bi.length||T>s.length)continue;const O=a(_,T);l.set(d,O);const V=_===F?c.get(d+1):c.get(d-1);if(c.set(d,O!==_?new Fo(V,_,T,O-_):V),l.get(d)===i.length&&l.get(d)-d===s.length)break e}}let u=c.get(d);const m=[];let f=i.length,g=s.length;for(;;){const b=u?u.x+u.length:0,k=u?u.y+u.length:0;if((b!==f||k!==g)&&m.push(new ce(new Y(b,f),new Y(k,g))),!u)break;f=u.x,g=u.y,u=u.prev}return m.reverse(),new Ze(m,!1)}}class Fo{constructor(e,n,r,i){this.prev=e,this.x=n,this.y=r,this.length=i}}class du{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,n){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const r=this.negativeArr;this.negativeArr=new Int32Array(r.length*2),this.negativeArr.set(r)}this.negativeArr[e]=n}else{if(e>=this.positiveArr.length){const r=this.positiveArr;this.positiveArr=new Int32Array(r.length*2),this.positiveArr.set(r)}this.positiveArr[e]=n}}}class uu{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,n){e<0?(e=-e-1,this.negativeArr[e]=n):this.positiveArr[e]=n}}class ir{constructor(e,n,r){this.lines=e,this.range=n,this.considerWhitespaceChanges=r,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let i=this.range.startLineNumber;i<=this.range.endLineNumber;i++){let s=e[i-1],a=0;i===this.range.startLineNumber&&this.range.startColumn>1&&(a=this.range.startColumn-1,s=s.substring(a)),this.lineStartOffsets.push(a);let o=0;if(!r){const c=s.trimStart();o=s.length-c.length,s=c.trimEnd()}this.trimmedWsLengthsByLineIdx.push(o);const l=i===this.range.endLineNumber?Math.min(this.range.endColumn-1-a-o,s.length):s.length;for(let c=0;cString.fromCharCode(n)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const n=Io(e>0?this.elements[e-1]:-1),r=Io(es<=e),i=e-this.firstElementOffsetByLineIdx[r];return new re(this.range.startLineNumber+r,1+this.lineStartOffsets[r]+i+(i===0&&n==="left"?0:this.trimmedWsLengthsByLineIdx[r]))}translateRange(e){const n=this.translateOffset(e.start,"right"),r=this.translateOffset(e.endExclusive,"left");return r.isBefore(n)?J.fromPositions(r,r):J.fromPositions(n,r)}findWordContaining(e){if(e<0||e>=this.elements.length||!Ut(this.elements[e]))return;let n=e;for(;n>0&&Ut(this.elements[n-1]);)n--;let r=e;for(;r=this.elements.length||!Ut(this.elements[e]))return;let n=e;for(;n>0&&Ut(this.elements[n-1])&&!Ro(this.elements[n]);)n--;let r=e;for(;ri<=e.start)??0,r=Kd(this.firstElementOffsetByLineIdx,i=>e.endExclusive<=i)??this.elements.length;return new Y(n,r)}}function Ut(t){return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57}function Ro(t){return t>=65&&t<=90}const pu={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function No(t){return pu[t]}function Io(t){return t===10?8:t===13?7:vi(t)?6:t>=97&&t<=122?0:t>=65&&t<=90?1:t>=48&&t<=57?2:t===-1?3:t===44||t===59?5:4}function mu(t,e,n,r,i,s){let{moves:a,excludedChanges:o}=gu(t,e,n,s);if(!s.isValid())return[];const l=t.filter(d=>!o.has(d)),c=bu(l,r,i,e,n,s);return Yd(a,c),a=wu(a),a=a.filter(d=>{const u=d.original.toOffsetRange().slice(e).map(f=>f.trim());return u.join(` +`).length>=15&&fu(u,f=>f.length>=2)>=2}),a=vu(t,a),a}function fu(t,e){let n=0;for(const r of t)e(r)&&n++;return n}function gu(t,e,n,r){const i=[],s=t.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new rr(l.original,e,l)),a=new Set(t.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new rr(l.modified,n,l))),o=new Set;for(const l of s){let c=-1,d;for(const u of a){const m=l.computeSimilarity(u);m>c&&(c=m,d=u)}if(c>.9&&d&&(a.delete(d),i.push(new Le(l.range,d.range)),o.add(l.source),o.add(d.source)),!r.isValid())return{moves:i,excludedChanges:o}}return{moves:i,excludedChanges:o}}function bu(t,e,n,r,i,s){const a=[],o=new Md;for(const m of t)for(let f=m.original.startLineNumber;fm.modified.startLineNumber,fn));for(const m of t){let f=[];for(let g=m.modified.startLineNumber;g{for(const T of f)if(T.originalLineRange.endLineNumberExclusive+1===N.endLineNumberExclusive&&T.modifiedLineRange.endLineNumberExclusive+1===k.endLineNumberExclusive){T.originalLineRange=new Z(T.originalLineRange.startLineNumber,N.endLineNumberExclusive),T.modifiedLineRange=new Z(T.modifiedLineRange.startLineNumber,k.endLineNumberExclusive),F.push(T);return}const _={modifiedLineRange:k,originalLineRange:N};l.push(_),F.push(_)}),f=F}if(!s.isValid())return[]}l.sort(Qd(mn(m=>m.modifiedLineRange.length,fn)));const c=new qe,d=new qe;for(const m of l){const f=m.modifiedLineRange.startLineNumber-m.originalLineRange.startLineNumber,g=c.subtractFrom(m.modifiedLineRange),b=d.subtractFrom(m.originalLineRange).getWithDelta(f),k=g.getIntersection(b);for(const F of k.ranges){if(F.length<3)continue;const N=F,_=F.delta(-f);a.push(new Le(_,N)),c.addRange(N),d.addRange(_)}}a.sort(mn(m=>m.original.startLineNumber,fn));const u=new tr(t);for(let m=0;mV.original.startLineNumber<=f.original.startLineNumber),b=Tt(t,V=>V.modified.startLineNumber<=f.modified.startLineNumber),k=Math.max(f.original.startLineNumber-g.original.startLineNumber,f.modified.startLineNumber-b.modified.startLineNumber),F=u.findLastMonotonous(V=>V.original.startLineNumberV.modified.startLineNumberr.length||I>i.length||c.contains(I)||d.contains(V)||!Do(r[V-1],i[I-1],s))break}T>0&&(d.addRange(new Z(f.original.startLineNumber-T,f.original.startLineNumber)),c.addRange(new Z(f.modified.startLineNumber-T,f.modified.startLineNumber)));let O;for(O=0;O<_;O++){const V=f.original.endLineNumberExclusive+O,I=f.modified.endLineNumberExclusive+O;if(V>r.length||I>i.length||c.contains(I)||d.contains(V)||!Do(r[V-1],i[I-1],s))break}O>0&&(d.addRange(new Z(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+O)),c.addRange(new Z(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+O))),(T>0||O>0)&&(a[m]=new Le(new Z(f.original.startLineNumber-T,f.original.endLineNumberExclusive+O),new Z(f.modified.startLineNumber-T,f.modified.endLineNumberExclusive+O)))}return a}function Do(t,e,n){if(t.trim()===e.trim())return!0;if(t.length>300&&e.length>300)return!1;const i=new Eo().compute(new ir([t],new J(1,1,1,t.length),!1),new ir([e],new J(1,1,1,e.length),!1),n);let s=0;const a=ce.invert(i.diffs,t.length);for(const d of a)d.seq1Range.forEach(u=>{vi(t.charCodeAt(u))||s++});function o(d){let u=0;for(let m=0;me.length?t:e);return s/l>.6&&l>10}function wu(t){if(t.length===0)return t;t.sort(mn(n=>n.original.startLineNumber,fn));const e=[t[0]];for(let n=1;n=0&&a>=0&&s+a<=2){e[e.length-1]=r.join(i);continue}e.push(i)}return e}function vu(t,e){const n=new tr(t);return e=e.filter(r=>{const i=n.findLastMonotonous(o=>o.original.startLineNumbero.modified.startLineNumber0&&(o=o.delta(c))}i.push(o)}return r.length>0&&i.push(r[r.length-1]),i}function yu(t,e,n){if(!t.getBoundaryScore||!e.getBoundaryScore)return n;for(let r=0;r0?n[r-1]:void 0,s=n[r],a=r+1=r.start&&t.seq2Range.start-a>=i.start&&n.isStronglyEqual(t.seq2Range.start-a,t.seq2Range.endExclusive-a)&&a<100;)a++;a--;let o=0;for(;t.seq1Range.start+oc&&(c=g,l=d)}return t.delta(l)}function xu(t,e,n){const r=[];for(const i of n){const s=r[r.length-1];if(!s){r.push(i);continue}i.seq1Range.start-s.seq1Range.endExclusive<=2||i.seq2Range.start-s.seq2Range.endExclusive<=2?r[r.length-1]=new ce(s.seq1Range.join(i.seq1Range),s.seq2Range.join(i.seq2Range)):r.push(i)}return r}function zo(t,e,n,r,i=!1){const s=ce.invert(n,t.length),a=[];let o=new et(0,0);function l(d,u){if(d.offset10;){const N=s[0];if(!(N.seq1Range.intersects(g.seq1Range)||N.seq2Range.intersects(g.seq2Range)))break;const T=r(t,N.seq1Range.start),O=r(e,N.seq2Range.start),V=new ce(T,O),I=V.intersect(N);if(k+=I.seq1Range.length,F+=I.seq2Range.length,g=g.join(V),g.seq1Range.endExclusive>=N.seq1Range.endExclusive)s.shift();else break}(i&&k+F0;){const d=s.shift();d.seq1Range.isEmpty||(l(d.getStarts(),d),l(d.getEndExclusives().delta(-1),d))}return Su(n,a)}function Su(t,e){const n=[];for(;t.length>0||e.length>0;){const r=t[0],i=e[0];let s;r&&(!i||r.seq1Range.start0&&n[n.length-1].seq1Range.endExclusive>=s.seq1Range.start?n[n.length-1]=n[n.length-1].join(s):n.push(s)}return n}function Cu(t,e,n){let r=n;if(r.length===0)return r;let i=0,s;do{s=!1;const a=[r[0]];for(let o=1;o5||f.seq1Range.length+f.seq2Range.length>5)};const l=r[o],c=a[a.length-1];d(c,l)?(s=!0,a[a.length-1]=a[a.length-1].join(l)):a.push(l)}r=a}while(i++<10&&s);return r}function ku(t,e,n){let r=n;if(r.length===0)return r;let i=0,s;do{s=!1;const o=[r[0]];for(let l=1;l5||b.length>500)return!1;const F=t.getText(b).trim();if(F.length>20||F.split(/\r\n|\r|\n/).length>1)return!1;const N=t.countLinesIn(f.seq1Range),_=f.seq1Range.length,T=e.countLinesIn(f.seq2Range),O=f.seq2Range.length,V=t.countLinesIn(g.seq1Range),I=g.seq1Range.length,R=e.countLinesIn(g.seq2Range),z=g.seq2Range.length,$=130;function L(y){return Math.min(y,$)}return Math.pow(Math.pow(L(N*40+_),1.5)+Math.pow(L(T*40+O),1.5),1.5)+Math.pow(Math.pow(L(V*40+I),1.5)+Math.pow(L(R*40+z),1.5),1.5)>($**1.5)**1.5*1.3};const c=r[l],d=o[o.length-1];u(d,c)?(s=!0,o[o.length-1]=o[o.length-1].join(c)):o.push(c)}r=o}while(i++<10&&s);const a=[];return Xd(r,(o,l,c)=>{let d=l;function u(F){return F.length>0&&F.trim().length<=3&&l.seq1Range.length+l.seq2Range.length>100}const m=t.extendToFullLines(l.seq1Range),f=t.getText(new Y(m.start,l.seq1Range.start));u(f)&&(d=d.deltaStart(-f.length));const g=t.getText(new Y(l.seq1Range.endExclusive,m.endExclusive));u(g)&&(d=d.deltaEnd(g.length));const b=ce.fromOffsetPairs(o?o.getEndExclusives():et.zero,c?c.getStarts():et.max),k=d.intersect(b);a.length>0&&k.getStarts().equals(a[a.length-1].getEndExclusives())?a[a.length-1]=a[a.length-1].join(k):a.push(k)}),a}class Po{constructor(e,n){this.trimmedHash=e,this.lines=n}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){const n=e===0?0:To(this.lines[e-1]),r=e===this.lines.length?0:To(this.lines[e]);return 1e3-(n+r)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` +`)}isStronglyEqual(e,n){return this.lines[e]===this.lines[n]}}function To(t){let e=0;for(;eI===R))return new er([],[],!1);if(e.length===1&&e[0].length===0||n.length===1&&n[0].length===0)return new er([new Ke(new Z(1,e.length+1),new Z(1,n.length+1),[new Ae(new J(1,1,e.length,e[e.length-1].length+1),new J(1,1,n.length,n[n.length-1].length+1))])],[],!1);const i=r.maxComputationTimeMs===0?wn.instance:new cu(r.maxComputationTimeMs),s=!r.ignoreTrimWhitespace,a=new Map;function o(I){let R=a.get(I);return R===void 0&&(R=a.size,a.set(I,R)),R}const l=e.map(I=>o(I.trim())),c=n.map(I=>o(I.trim())),d=new Po(l,e),u=new Po(c,n),m=d.length+u.length<1700?this.dynamicProgrammingDiffing.compute(d,u,i,(I,R)=>e[I]===n[R]?n[R].length===0?.1:1+Math.log(1+n[R].length):.99):this.myersDiffingAlgorithm.compute(d,u,i);let f=m.diffs,g=m.hitTimeout;f=Lo(d,u,f),f=Cu(d,u,f);const b=[],k=I=>{if(s)for(let R=0;RI.seq1Range.start-F===I.seq2Range.start-N);const R=I.seq1Range.start-F;k(R),F=I.seq1Range.endExclusive,N=I.seq2Range.endExclusive;const z=this.refineDiff(e,n,I,i,s,r);z.hitTimeout&&(g=!0);for(const $ of z.mappings)b.push($)}k(e.length-F);const _=new nr(e),T=new nr(n),O=So(b,_,T);let V=[];return r.computeMoves&&(V=this.computeMoves(O,e,n,l,c,i,s,r)),Un(()=>{function I(z,$){if(z.lineNumber<1||z.lineNumber>$.length)return!1;const L=$[z.lineNumber-1];return!(z.column<1||z.column>L.length+1)}function R(z,$){return!(z.startLineNumber<1||z.startLineNumber>$.length+1||z.endLineNumberExclusive<1||z.endLineNumberExclusive>$.length+1)}for(const z of O){if(!z.innerChanges)return!1;for(const $ of z.innerChanges)if(!(I($.modifiedRange.getStartPosition(),n)&&I($.modifiedRange.getEndPosition(),n)&&I($.originalRange.getStartPosition(),e)&&I($.originalRange.getEndPosition(),e)))return!1;if(!R(z.modified,n)||!R(z.original,e))return!1}return!0}),new er(O,V,g)}computeMoves(e,n,r,i,s,a,o,l){return mu(e,n,r,i,s,a).map(u=>{const m=this.refineDiff(n,r,new ce(u.original.toOffsetRange(),u.modified.toOffsetRange()),a,o,l),f=So(m.mappings,new nr(n),new nr(r),!0);return new jd(u,f)})}refineDiff(e,n,r,i,s,a){const l=Eu(r).toRangeMapping2(e,n),c=new ir(e,l.originalRange,s),d=new ir(n,l.modifiedRange,s),u=c.length+d.length<500?this.dynamicProgrammingDiffing.compute(c,d,i):this.myersDiffingAlgorithm.compute(c,d,i);let m=u.diffs;return m=Lo(c,d,m),m=zo(c,d,m,(g,b)=>g.findWordContaining(b)),a.extendToSubwords&&(m=zo(c,d,m,(g,b)=>g.findSubWordContaining(b),!0)),m=xu(c,d,m),m=ku(c,d,m),{mappings:m.map(g=>new Ae(c.translateRange(g.seq1Range),d.translateRange(g.seq2Range))),hitTimeout:u.hitTimeout}}}function Eu(t){return new Le(new Z(t.seq1Range.start+1,t.seq1Range.endExclusive+1),new Z(t.seq2Range.start+1,t.seq2Range.endExclusive+1))}const Oo={getLegacy:()=>new su,getDefault:()=>new _u};function pt(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}class x{constructor(e,n,r,i=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,n))|0,this.b=Math.min(255,Math.max(0,r))|0,this.a=pt(Math.max(Math.min(1,i),0),3)}static equals(e,n){return e.r===n.r&&e.g===n.g&&e.b===n.b&&e.a===n.a}}class Me{constructor(e,n,r,i){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=pt(Math.max(Math.min(1,n),0),3),this.l=pt(Math.max(Math.min(1,r),0),3),this.a=pt(Math.max(Math.min(1,i),0),3)}static equals(e,n){return e.h===n.h&&e.s===n.s&&e.l===n.l&&e.a===n.a}static fromRGBA(e){const n=e.r/255,r=e.g/255,i=e.b/255,s=e.a,a=Math.max(n,r,i),o=Math.min(n,r,i);let l=0,c=0;const d=(o+a)/2,u=a-o;if(u>0){switch(c=Math.min(d<=.5?u/(2*d):u/(2-2*d),1),a){case n:l=(r-i)/u+(r1&&(r-=1),r<1/6?e+(n-e)*6*r:r<1/2?n:r<2/3?e+(n-e)*(2/3-r)*6:e}static toRGBA(e){const n=e.h/360,{s:r,l:i,a:s}=e;let a,o,l;if(r===0)a=o=l=i;else{const c=i<.5?i*(1+r):i+r-i*r,d=2*i-c;a=Me._hue2rgb(d,c,n+1/3),o=Me._hue2rgb(d,c,n),l=Me._hue2rgb(d,c,n-1/3)}return new x(Math.round(a*255),Math.round(o*255),Math.round(l*255),s)}}class Bt{constructor(e,n,r,i){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=pt(Math.max(Math.min(1,n),0),3),this.v=pt(Math.max(Math.min(1,r),0),3),this.a=pt(Math.max(Math.min(1,i),0),3)}static equals(e,n){return e.h===n.h&&e.s===n.s&&e.v===n.v&&e.a===n.a}static fromRGBA(e){const n=e.r/255,r=e.g/255,i=e.b/255,s=Math.max(n,r,i),a=Math.min(n,r,i),o=s-a,l=s===0?0:o/s;let c;return o===0?c=0:s===n?c=((r-i)/o%6+6)%6:s===r?c=(i-n)/o+2:c=(n-r)/o+4,new Bt(Math.round(c*60),l,s,e.a)}static toRGBA(e){const{h:n,s:r,v:i,a:s}=e,a=i*r,o=a*(1-Math.abs(n/60%2-1)),l=i-a;let[c,d,u]=[0,0,0];return n<60?(c=a,d=o):n<120?(c=o,d=a):n<180?(d=a,u=o):n<240?(d=o,u=a):n<300?(c=o,u=a):n<=360&&(c=a,u=o),c=Math.round((c+l)*255),d=Math.round((d+l)*255),u=Math.round((u+l)*255),new x(c,d,u,s)}}let sr=(ne=class{static fromHex(e){return ne.Format.CSS.parseHex(e)||ne.red}static equals(e,n){return!e&&!n?!0:!e||!n?!1:e.equals(n)}get hsla(){return this._hsla?this._hsla:Me.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:Bt.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof x)this.rgba=e;else if(e instanceof Me)this._hsla=e,this.rgba=Me.toRGBA(e);else if(e instanceof Bt)this._hsva=e,this.rgba=Bt.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&x.equals(this.rgba,e.rgba)&&Me.equals(this.hsla,e.hsla)&&Bt.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=ne._relativeLuminanceForComponent(this.rgba.r),n=ne._relativeLuminanceForComponent(this.rgba.g),r=ne._relativeLuminanceForComponent(this.rgba.b),i=.2126*e+.7152*n+.0722*r;return pt(i,4)}static _relativeLuminanceForComponent(e){const n=e/255;return n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){const n=this.getRelativeLuminance(),r=e.getRelativeLuminance();return n>r}isDarkerThan(e){const n=this.getRelativeLuminance(),r=e.getRelativeLuminance();return n>>0),this._toNumber32Bit}static getLighterColor(e,n,r){if(e.isLighterThan(n))return e;r=r||.5;const i=e.getRelativeLuminance(),s=n.getRelativeLuminance();return r=r*(s-i)/s,e.lighten(r)}static getDarkerColor(e,n,r){if(e.isDarkerThan(n))return e;r=r||.5;const i=e.getRelativeLuminance(),s=n.getRelativeLuminance();return r=r*(i-s)/i,e.darken(r)}},ne.white=new ne(new x(255,255,255,1)),ne.black=new ne(new x(0,0,0,1)),ne.red=new ne(new x(255,0,0,1)),ne.blue=new ne(new x(0,0,255,1)),ne.green=new ne(new x(0,255,0,1)),ne.cyan=new ne(new x(0,255,255,1)),ne.lightgrey=new ne(new x(211,211,211,1)),ne.transparent=new ne(new x(0,0,0,0)),ne);(function(t){(function(e){(function(n){function r(b){return b.rgba.a===1?`rgb(${b.rgba.r}, ${b.rgba.g}, ${b.rgba.b})`:t.Format.CSS.formatRGBA(b)}n.formatRGB=r;function i(b){return`rgba(${b.rgba.r}, ${b.rgba.g}, ${b.rgba.b}, ${+b.rgba.a.toFixed(2)})`}n.formatRGBA=i;function s(b){return b.hsla.a===1?`hsl(${b.hsla.h}, ${Math.round(b.hsla.s*100)}%, ${Math.round(b.hsla.l*100)}%)`:t.Format.CSS.formatHSLA(b)}n.formatHSL=s;function a(b){return`hsla(${b.hsla.h}, ${Math.round(b.hsla.s*100)}%, ${Math.round(b.hsla.l*100)}%, ${b.hsla.a.toFixed(2)})`}n.formatHSLA=a;function o(b){const k=b.toString(16);return k.length!==2?"0"+k:k}function l(b){return`#${o(b.rgba.r)}${o(b.rgba.g)}${o(b.rgba.b)}`}n.formatHex=l;function c(b,k=!1){return k&&b.rgba.a===1?t.Format.CSS.formatHex(b):`#${o(b.rgba.r)}${o(b.rgba.g)}${o(b.rgba.b)}${o(Math.round(b.rgba.a*255))}`}n.formatHexA=c;function d(b){return b.isOpaque()?t.Format.CSS.formatHex(b):t.Format.CSS.formatRGBA(b)}n.format=d;function u(b){if(b==="transparent")return t.transparent;if(b.startsWith("#"))return f(b);if(b.startsWith("rgba(")){const k=b.match(/rgba\((?(?:\+|-)?\d+), *(?(?:\+|-)?\d+), *(?(?:\+|-)?\d+), *(?(?:\+|-)?\d+(\.\d+)?)\)/);if(!k)throw new Error("Invalid color format "+b);const F=parseInt(k.groups?.r??"0"),N=parseInt(k.groups?.g??"0"),_=parseInt(k.groups?.b??"0"),T=parseFloat(k.groups?.a??"0");return new t(new x(F,N,_,T))}if(b.startsWith("rgb(")){const k=b.match(/rgb\((?(?:\+|-)?\d+), *(?(?:\+|-)?\d+), *(?(?:\+|-)?\d+)\)/);if(!k)throw new Error("Invalid color format "+b);const F=parseInt(k.groups?.r??"0"),N=parseInt(k.groups?.g??"0"),_=parseInt(k.groups?.b??"0");return new t(new x(F,N,_))}return m(b)}n.parse=u;function m(b){switch(b){case"aliceblue":return new t(new x(240,248,255,1));case"antiquewhite":return new t(new x(250,235,215,1));case"aqua":return new t(new x(0,255,255,1));case"aquamarine":return new t(new x(127,255,212,1));case"azure":return new t(new x(240,255,255,1));case"beige":return new t(new x(245,245,220,1));case"bisque":return new t(new x(255,228,196,1));case"black":return new t(new x(0,0,0,1));case"blanchedalmond":return new t(new x(255,235,205,1));case"blue":return new t(new x(0,0,255,1));case"blueviolet":return new t(new x(138,43,226,1));case"brown":return new t(new x(165,42,42,1));case"burlywood":return new t(new x(222,184,135,1));case"cadetblue":return new t(new x(95,158,160,1));case"chartreuse":return new t(new x(127,255,0,1));case"chocolate":return new t(new x(210,105,30,1));case"coral":return new t(new x(255,127,80,1));case"cornflowerblue":return new t(new x(100,149,237,1));case"cornsilk":return new t(new x(255,248,220,1));case"crimson":return new t(new x(220,20,60,1));case"cyan":return new t(new x(0,255,255,1));case"darkblue":return new t(new x(0,0,139,1));case"darkcyan":return new t(new x(0,139,139,1));case"darkgoldenrod":return new t(new x(184,134,11,1));case"darkgray":return new t(new x(169,169,169,1));case"darkgreen":return new t(new x(0,100,0,1));case"darkgrey":return new t(new x(169,169,169,1));case"darkkhaki":return new t(new x(189,183,107,1));case"darkmagenta":return new t(new x(139,0,139,1));case"darkolivegreen":return new t(new x(85,107,47,1));case"darkorange":return new t(new x(255,140,0,1));case"darkorchid":return new t(new x(153,50,204,1));case"darkred":return new t(new x(139,0,0,1));case"darksalmon":return new t(new x(233,150,122,1));case"darkseagreen":return new t(new x(143,188,143,1));case"darkslateblue":return new t(new x(72,61,139,1));case"darkslategray":return new t(new x(47,79,79,1));case"darkslategrey":return new t(new x(47,79,79,1));case"darkturquoise":return new t(new x(0,206,209,1));case"darkviolet":return new t(new x(148,0,211,1));case"deeppink":return new t(new x(255,20,147,1));case"deepskyblue":return new t(new x(0,191,255,1));case"dimgray":return new t(new x(105,105,105,1));case"dimgrey":return new t(new x(105,105,105,1));case"dodgerblue":return new t(new x(30,144,255,1));case"firebrick":return new t(new x(178,34,34,1));case"floralwhite":return new t(new x(255,250,240,1));case"forestgreen":return new t(new x(34,139,34,1));case"fuchsia":return new t(new x(255,0,255,1));case"gainsboro":return new t(new x(220,220,220,1));case"ghostwhite":return new t(new x(248,248,255,1));case"gold":return new t(new x(255,215,0,1));case"goldenrod":return new t(new x(218,165,32,1));case"gray":return new t(new x(128,128,128,1));case"green":return new t(new x(0,128,0,1));case"greenyellow":return new t(new x(173,255,47,1));case"grey":return new t(new x(128,128,128,1));case"honeydew":return new t(new x(240,255,240,1));case"hotpink":return new t(new x(255,105,180,1));case"indianred":return new t(new x(205,92,92,1));case"indigo":return new t(new x(75,0,130,1));case"ivory":return new t(new x(255,255,240,1));case"khaki":return new t(new x(240,230,140,1));case"lavender":return new t(new x(230,230,250,1));case"lavenderblush":return new t(new x(255,240,245,1));case"lawngreen":return new t(new x(124,252,0,1));case"lemonchiffon":return new t(new x(255,250,205,1));case"lightblue":return new t(new x(173,216,230,1));case"lightcoral":return new t(new x(240,128,128,1));case"lightcyan":return new t(new x(224,255,255,1));case"lightgoldenrodyellow":return new t(new x(250,250,210,1));case"lightgray":return new t(new x(211,211,211,1));case"lightgreen":return new t(new x(144,238,144,1));case"lightgrey":return new t(new x(211,211,211,1));case"lightpink":return new t(new x(255,182,193,1));case"lightsalmon":return new t(new x(255,160,122,1));case"lightseagreen":return new t(new x(32,178,170,1));case"lightskyblue":return new t(new x(135,206,250,1));case"lightslategray":return new t(new x(119,136,153,1));case"lightslategrey":return new t(new x(119,136,153,1));case"lightsteelblue":return new t(new x(176,196,222,1));case"lightyellow":return new t(new x(255,255,224,1));case"lime":return new t(new x(0,255,0,1));case"limegreen":return new t(new x(50,205,50,1));case"linen":return new t(new x(250,240,230,1));case"magenta":return new t(new x(255,0,255,1));case"maroon":return new t(new x(128,0,0,1));case"mediumaquamarine":return new t(new x(102,205,170,1));case"mediumblue":return new t(new x(0,0,205,1));case"mediumorchid":return new t(new x(186,85,211,1));case"mediumpurple":return new t(new x(147,112,219,1));case"mediumseagreen":return new t(new x(60,179,113,1));case"mediumslateblue":return new t(new x(123,104,238,1));case"mediumspringgreen":return new t(new x(0,250,154,1));case"mediumturquoise":return new t(new x(72,209,204,1));case"mediumvioletred":return new t(new x(199,21,133,1));case"midnightblue":return new t(new x(25,25,112,1));case"mintcream":return new t(new x(245,255,250,1));case"mistyrose":return new t(new x(255,228,225,1));case"moccasin":return new t(new x(255,228,181,1));case"navajowhite":return new t(new x(255,222,173,1));case"navy":return new t(new x(0,0,128,1));case"oldlace":return new t(new x(253,245,230,1));case"olive":return new t(new x(128,128,0,1));case"olivedrab":return new t(new x(107,142,35,1));case"orange":return new t(new x(255,165,0,1));case"orangered":return new t(new x(255,69,0,1));case"orchid":return new t(new x(218,112,214,1));case"palegoldenrod":return new t(new x(238,232,170,1));case"palegreen":return new t(new x(152,251,152,1));case"paleturquoise":return new t(new x(175,238,238,1));case"palevioletred":return new t(new x(219,112,147,1));case"papayawhip":return new t(new x(255,239,213,1));case"peachpuff":return new t(new x(255,218,185,1));case"peru":return new t(new x(205,133,63,1));case"pink":return new t(new x(255,192,203,1));case"plum":return new t(new x(221,160,221,1));case"powderblue":return new t(new x(176,224,230,1));case"purple":return new t(new x(128,0,128,1));case"rebeccapurple":return new t(new x(102,51,153,1));case"red":return new t(new x(255,0,0,1));case"rosybrown":return new t(new x(188,143,143,1));case"royalblue":return new t(new x(65,105,225,1));case"saddlebrown":return new t(new x(139,69,19,1));case"salmon":return new t(new x(250,128,114,1));case"sandybrown":return new t(new x(244,164,96,1));case"seagreen":return new t(new x(46,139,87,1));case"seashell":return new t(new x(255,245,238,1));case"sienna":return new t(new x(160,82,45,1));case"silver":return new t(new x(192,192,192,1));case"skyblue":return new t(new x(135,206,235,1));case"slateblue":return new t(new x(106,90,205,1));case"slategray":return new t(new x(112,128,144,1));case"slategrey":return new t(new x(112,128,144,1));case"snow":return new t(new x(255,250,250,1));case"springgreen":return new t(new x(0,255,127,1));case"steelblue":return new t(new x(70,130,180,1));case"tan":return new t(new x(210,180,140,1));case"teal":return new t(new x(0,128,128,1));case"thistle":return new t(new x(216,191,216,1));case"tomato":return new t(new x(255,99,71,1));case"turquoise":return new t(new x(64,224,208,1));case"violet":return new t(new x(238,130,238,1));case"wheat":return new t(new x(245,222,179,1));case"white":return new t(new x(255,255,255,1));case"whitesmoke":return new t(new x(245,245,245,1));case"yellow":return new t(new x(255,255,0,1));case"yellowgreen":return new t(new x(154,205,50,1));default:return null}}function f(b){const k=b.length;if(k===0||b.charCodeAt(0)!==35)return null;if(k===7){const F=16*g(b.charCodeAt(1))+g(b.charCodeAt(2)),N=16*g(b.charCodeAt(3))+g(b.charCodeAt(4)),_=16*g(b.charCodeAt(5))+g(b.charCodeAt(6));return new t(new x(F,N,_,1))}if(k===9){const F=16*g(b.charCodeAt(1))+g(b.charCodeAt(2)),N=16*g(b.charCodeAt(3))+g(b.charCodeAt(4)),_=16*g(b.charCodeAt(5))+g(b.charCodeAt(6)),T=16*g(b.charCodeAt(7))+g(b.charCodeAt(8));return new t(new x(F,N,_,T/255))}if(k===4){const F=g(b.charCodeAt(1)),N=g(b.charCodeAt(2)),_=g(b.charCodeAt(3));return new t(new x(16*F+F,16*N+N,16*_+_))}if(k===5){const F=g(b.charCodeAt(1)),N=g(b.charCodeAt(2)),_=g(b.charCodeAt(3)),T=g(b.charCodeAt(4));return new t(new x(16*F+F,16*N+N,16*_+_,(16*T+T)/255))}return null}n.parseHex=f;function g(b){switch(b){case 48:return 0;case 49:return 1;case 50:return 2;case 51:return 3;case 52:return 4;case 53:return 5;case 54:return 6;case 55:return 7;case 56:return 8;case 57:return 9;case 97:return 10;case 65:return 10;case 98:return 11;case 66:return 11;case 99:return 12;case 67:return 12;case 100:return 13;case 68:return 13;case 101:return 14;case 69:return 14;case 102:return 15;case 70:return 15}return 0}})(e.CSS||(e.CSS={}))})(t.Format||(t.Format={}))})(sr||(sr={}));function Wo(t){const e=[];for(const n of t){const r=Number(n);(r||r===0&&n.replace(/\s/g,"")!=="")&&e.push(r)}return e}function yi(t,e,n,r){return{red:t/255,blue:n/255,green:e/255,alpha:r}}function vn(t,e){const n=e.index,r=e[0].length;if(n===void 0)return;const i=t.positionAt(n);return{startLineNumber:i.lineNumber,startColumn:i.column,endLineNumber:i.lineNumber,endColumn:i.column+r}}function Fu(t,e){if(!t)return;const n=sr.Format.CSS.parseHex(e);if(n)return{range:t,color:yi(n.rgba.r,n.rgba.g,n.rgba.b,n.rgba.a)}}function Vo(t,e,n){if(!t||e.length!==1)return;const i=e[0].values(),s=Wo(i);return{range:t,color:yi(s[0],s[1],s[2],n?s[3]:1)}}function $o(t,e,n){if(!t||e.length!==1)return;const i=e[0].values(),s=Wo(i),a=new sr(new Me(s[0],s[1]/100,s[2]/100,n?s[3]:1));return{range:t,color:yi(a.rgba.r,a.rgba.g,a.rgba.b,a.rgba.a)}}function yn(t,e){return typeof t=="string"?[...t.matchAll(e)]:t.findMatches(e)}function Ru(t){const e=[],n=new RegExp(`\\b(rgb|rgba|hsl|hsla)(\\([0-9\\s,.\\%]*\\))|^(#)([A-Fa-f0-9]{3})\\b|^(#)([A-Fa-f0-9]{4})\\b|^(#)([A-Fa-f0-9]{6})\\b|^(#)([A-Fa-f0-9]{8})\\b|(?<=['"\\s])(#)([A-Fa-f0-9]{3})\\b|(?<=['"\\s])(#)([A-Fa-f0-9]{4})\\b|(?<=['"\\s])(#)([A-Fa-f0-9]{6})\\b|(?<=['"\\s])(#)([A-Fa-f0-9]{8})\\b`,"gm"),r=yn(t,n);if(r.length>0)for(const i of r){const s=i.filter(c=>c!==void 0),a=s[1],o=s[2];if(!o)continue;let l;if(a==="rgb"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;l=Vo(vn(t,i),yn(o,c),!1)}else if(a==="rgba"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=Vo(vn(t,i),yn(o,c),!0)}else if(a==="hsl"){const c=/^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;l=$o(vn(t,i),yn(o,c),!1)}else if(a==="hsla"){const c=/^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(0[.][0-9]+|[.][0-9]+|[01][.]0*|[01])\s*\)$/gm;l=$o(vn(t,i),yn(o,c),!0)}else a==="#"&&(l=Fu(vn(t,i),a+o));l&&e.push(l)}return e}function Nu(t){return!t||typeof t.getValue!="function"||typeof t.positionAt!="function"?[]:Ru(t)}const Iu=/^-+|-+$/g,Uo=100,Du=5;function Lu(t,e){let n=[];if(e.findRegionSectionHeaders&&e.foldingRules?.markers){const r=Au(t,e);n=n.concat(r)}if(e.findMarkSectionHeaders){const r=Mu(t,e);n=n.concat(r)}return n}function Au(t,e){const n=[],r=t.getLineCount();for(let i=1;i<=r;i++){const s=t.getLineContent(i),a=s.match(e.foldingRules.markers.start);if(a){const o={startLineNumber:i,startColumn:a[0].length+1,endLineNumber:i,endColumn:s.length+1};if(o.endColumn>o.startColumn){const l={range:o,...zu(s.substring(a[0].length)),shouldBeInComments:!1};(l.text||l.hasSeparatorLine)&&n.push(l)}}}return n}function Mu(t,e){const n=[],r=t.getLineCount();if(!e.markSectionHeaderRegex||e.markSectionHeaderRegex.trim()==="")return n;const i=zd(e.markSectionHeaderRegex),s=new RegExp(e.markSectionHeaderRegex,`gdm${i?"s":""}`);if(Ih(s))return n;for(let a=1;a<=r;a+=Uo-Du){const o=Math.min(a+Uo-1,r),l=[];for(let u=a;u<=o;u++)l.push(t.getLineContent(u));const c=l.join(` +`);s.lastIndex=0;let d;for(;(d=s.exec(c))!==null;){const u=c.substring(0,d.index),m=(u.match(/\n/g)||[]).length,f=a+m,g=d[0].split(` +`),b=g.length,k=f+b-1,F=u.lastIndexOf(` +`)+1,N=d.index-F+1,_=g[g.length-1],T=b===1?N+d[0].length:_.length+1,O={startLineNumber:f,startColumn:N,endLineNumber:k,endColumn:T},V=(d.groups??{}).label??"",I=((d.groups??{}).separator??"")!=="",R={range:O,text:V,hasSeparatorLine:I,shouldBeInComments:!0};(R.text||R.hasSeparatorLine)&&(n.length===0||n[n.length-1].range.endLineNumber{this.completeCallback=e,this.errorCallback=n})}complete(e){return this.isSettled?Promise.resolve():new Promise(n=>{this.completeCallback(e),this.outcome={outcome:0,value:e},n()})}error(e){return this.isSettled?Promise.resolve():new Promise(n=>{this.errorCallback(e),this.outcome={outcome:1,value:e},n()})}cancel(){return this.error(new zs)}}var Bo;(function(t){async function e(r){let i;const s=await Promise.all(r.map(a=>a.then(o=>o,o=>{i||(i=o)})));if(typeof i<"u")throw i;return s}t.settled=e;function n(r){return new Promise(async(i,s)=>{try{await r(i,s)}catch(a){s(a)}})}t.withAsyncBody=n})(Bo||(Bo={}));class Tu{constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){const n=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(n,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(const n of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(n,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new be("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(e,n){n.ok?e.complete(n.value):e.error(n.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){const e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}else{const e=new Pu;return this._unsatisfiedConsumers.push(e),e.p}}}const Fe=class Fe{constructor(e,n){this._onReturn=n,this._producerConsumer=new Tu,this._iterator={next:()=>this._producerConsumer.consume(),return:()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),throw:async r=>(this._finishError(r),{done:!0,value:void 0})},queueMicrotask(async()=>{const r=e({emitOne:i=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:i}}),emitMany:i=>{for(const s of i)this._producerConsumer.produce({ok:!0,value:{done:!1,value:s}})},reject:i=>this._finishError(i)});if(!this._producerConsumer.hasFinalValue)try{await r,this._finishOk()}catch(i){this._finishError(i)}})}static fromArray(e){return new Fe(n=>{n.emitMany(e)})}static fromPromise(e){return new Fe(async n=>{n.emitMany(await e)})}static fromPromisesResolveOrder(e){return new Fe(async n=>{await Promise.all(e.map(async r=>n.emitOne(await r)))})}static merge(e){return new Fe(async n=>{await Promise.all(e.map(async r=>{for await(const i of r)n.emitOne(i)}))})}static map(e,n){return new Fe(async r=>{for await(const i of e)r.emitOne(n(i))})}map(e){return Fe.map(this,e)}static coalesce(e){return Fe.filter(e,n=>!!n)}coalesce(){return Fe.coalesce(this)}static filter(e,n){return new Fe(async r=>{for await(const i of e)n(i)&&r.emitOne(i)})}filter(e){return Fe.filter(this,e)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}};Fe.EMPTY=Fe.fromArray([]);let qo=Fe;class Ou{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,n){e=Mt(e);const r=this.values,i=this.prefixSum,s=n.length;return s===0?!1:(this.values=new Uint32Array(r.length+s),this.values.set(r.subarray(0,e),0),this.values.set(r.subarray(e),e+s),this.values.set(n,e),e-1=0&&this.prefixSum.set(i.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,n){return e=Mt(e),n=Mt(n),this.values[e]===n?!1:(this.values[e]=n,e-1=r.length)return!1;const s=r.length-e;return n>=s&&(n=s),n===0?!1:(this.values=new Uint32Array(r.length-n),this.values.set(r.subarray(0,e),0),this.values.set(r.subarray(e+n),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(i.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=Mt(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let n=this.prefixSumValidIndex[0]+1;n===0&&(this.prefixSum[0]=this.values[0],n++),e>=this.values.length&&(e=this.values.length-1);for(let r=n;r<=e;r++)this.prefixSum[r]=this.prefixSum[r-1]+this.values[r];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let n=0,r=this.values.length-1,i=0,s=0,a=0;for(;n<=r;)if(i=n+(r-n)/2|0,s=this.prefixSum[i],a=s-this.values[i],e=s)n=i+1;else break;return new Wu(i,e-a)}}class Wu{constructor(e,n){this.index=e,this.remainder=n,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=n}}class Vu{constructor(e,n,r,i){this._uri=e,this._lines=n,this._eol=r,this._versionId=i,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}get version(){return this._versionId}getText(){return this._cachedTextValue===null&&(this._cachedTextValue=this._lines.join(this._eol)),this._cachedTextValue}onEvents(e){e.eol&&e.eol!==this._eol&&(this._eol=e.eol,this._lineStarts=null);const n=e.changes;for(const r of n)this._acceptDeleteRange(r.range),this._acceptInsertText(new re(r.range.startLineNumber,r.range.startColumn),r.text);this._versionId=e.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){const e=this._eol.length,n=this._lines.length,r=new Uint32Array(n);for(let i=0;ie.push(this._models[n])),e}$acceptNewModel(e){this._models[e.url]=new Uu(si.parse(e.url),e.lines,e.EOL,e.versionId)}$acceptModelChanged(e,n){if(!this._models[e])return;this._models[e].onEvents(n)}$acceptRemovedModel(e){this._models[e]&&delete this._models[e]}}class Uu extends Vu{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const n=[];for(let r=0;rthis._lines.length)n=this._lines.length,r=this._lines[n-1].length+1,i=!0;else{const s=this._lines[n-1].length+1;r<1?(r=1,i=!0):r>s&&(r=s,i=!0)}return i?{lineNumber:n,column:r}:e}}const Rt=class Rt{constructor(e=null){this._foreignModule=e,this._requestHandlerBrand=void 0,this._workerTextModelSyncServer=new $u}dispose(){}async $ping(){return"pong"}_getModel(e){return this._workerTextModelSyncServer.getModel(e)}getModels(){return this._workerTextModelSyncServer.getModels()}$acceptNewModel(e){this._workerTextModelSyncServer.$acceptNewModel(e)}$acceptModelChanged(e,n){this._workerTextModelSyncServer.$acceptModelChanged(e,n)}$acceptRemovedModel(e){this._workerTextModelSyncServer.$acceptRemovedModel(e)}async $computeUnicodeHighlights(e,n,r){const i=this._getModel(e);return i?Bd.computeUnicodeHighlights(i,n,r):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async $findSectionHeaders(e,n){const r=this._getModel(e);return r?Lu(r,n):[]}async $computeDiff(e,n,r,i){const s=this._getModel(e),a=this._getModel(n);return!s||!a?null:Rt.computeDiff(s,a,r,i)}static computeDiff(e,n,r,i){const s=i==="advanced"?Oo.getDefault():Oo.getLegacy(),a=e.getLinesContent(),o=n.getLinesContent(),l=s.computeDiff(a,o,r),c=l.changes.length>0?!1:this._modelsAreIdentical(e,n);function d(u){return u.map(m=>[m.original.startLineNumber,m.original.endLineNumberExclusive,m.modified.startLineNumber,m.modified.endLineNumberExclusive,m.innerChanges?.map(f=>[f.originalRange.startLineNumber,f.originalRange.startColumn,f.originalRange.endLineNumber,f.originalRange.endColumn,f.modifiedRange.startLineNumber,f.modifiedRange.startColumn,f.modifiedRange.endLineNumber,f.modifiedRange.endColumn])])}return{identical:c,quitEarly:l.hitTimeout,changes:d(l.changes),moves:l.moves.map(u=>[u.lineRangeMapping.original.startLineNumber,u.lineRangeMapping.original.endLineNumberExclusive,u.lineRangeMapping.modified.startLineNumber,u.lineRangeMapping.modified.endLineNumberExclusive,d(u.changes)])}}static _modelsAreIdentical(e,n){const r=e.getLineCount(),i=n.getLineCount();if(r!==i)return!1;for(let s=1;s<=r;s++){const a=e.getLineContent(s),o=n.getLineContent(s);if(a!==o)return!1}return!0}async $computeMoreMinimalEdits(e,n,r){const i=this._getModel(e);if(!i)return n;const s=[];let a;n=n.slice(0).sort((l,c)=>{if(l.range&&c.range)return J.compareRangesUsingStarts(l.range,c.range);const d=l.range?0:1,u=c.range?0:1;return d-u});let o=0;for(let l=1;lRt._diffLimit){s.push({range:l,text:c});continue}const m=Yh(u,c,r),f=i.offsetAt(J.lift(l).getStartPosition());for(const g of m){const b=i.positionAt(f+g.originalStart),k=i.positionAt(f+g.originalStart+g.originalLength),F={text:c.substr(g.modifiedStart,g.modifiedLength),range:{startLineNumber:b.lineNumber,startColumn:b.column,endLineNumber:k.lineNumber,endColumn:k.column}};i.getValueInRange(F.range)!==F.text&&s.push(F)}}return typeof a=="number"&&s.push({eol:a,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),s}async $computeLinks(e){const n=this._getModel(e);return n?td(n):null}async $computeDefaultDocumentColors(e){const n=this._getModel(e);return n?Nu(n):null}async $textualSuggest(e,n,r,i){const s=new jn,a=new RegExp(r,i),o=new Set;e:for(const l of e){const c=this._getModel(l);if(c){for(const d of c.words(a))if(!(d===n||!isNaN(Number(d)))&&(o.add(d),o.size>Rt._suggestionsLimit))break e}}return{words:Array.from(o),duration:s.elapsed()}}async $computeWordRanges(e,n,r,i){const s=this._getModel(e);if(!s)return Object.create(null);const a=new RegExp(r,i),o=Object.create(null);for(let l=n.startLineNumber;l{const i=Si.getChannel(r),a={host:new Proxy({},{get(o,l,c){if(l!=="then"){if(typeof l!="string")throw new Error("Not supported");return(...d)=>i.$fhr(l,d)}}}),getMirrorModels:()=>n.requestHandler.getModels()};return e=t(a),new xi(e)});return e}function qu(t){self.onmessage=e=>{Bu(n=>t(n,e.data))}}var p;(function(t){t[t.Ident=0]="Ident",t[t.AtKeyword=1]="AtKeyword",t[t.String=2]="String",t[t.BadString=3]="BadString",t[t.UnquotedString=4]="UnquotedString",t[t.Hash=5]="Hash",t[t.Num=6]="Num",t[t.Percentage=7]="Percentage",t[t.Dimension=8]="Dimension",t[t.UnicodeRange=9]="UnicodeRange",t[t.CDO=10]="CDO",t[t.CDC=11]="CDC",t[t.Colon=12]="Colon",t[t.SemiColon=13]="SemiColon",t[t.CurlyL=14]="CurlyL",t[t.CurlyR=15]="CurlyR",t[t.ParenthesisL=16]="ParenthesisL",t[t.ParenthesisR=17]="ParenthesisR",t[t.BracketL=18]="BracketL",t[t.BracketR=19]="BracketR",t[t.Whitespace=20]="Whitespace",t[t.Includes=21]="Includes",t[t.Dashmatch=22]="Dashmatch",t[t.SubstringOperator=23]="SubstringOperator",t[t.PrefixOperator=24]="PrefixOperator",t[t.SuffixOperator=25]="SuffixOperator",t[t.Delim=26]="Delim",t[t.EMS=27]="EMS",t[t.EXS=28]="EXS",t[t.Length=29]="Length",t[t.Angle=30]="Angle",t[t.Time=31]="Time",t[t.Freq=32]="Freq",t[t.Exclamation=33]="Exclamation",t[t.Resolution=34]="Resolution",t[t.Comma=35]="Comma",t[t.Charset=36]="Charset",t[t.EscapedJavaScript=37]="EscapedJavaScript",t[t.BadEscapedJavaScript=38]="BadEscapedJavaScript",t[t.Comment=39]="Comment",t[t.SingleLineComment=40]="SingleLineComment",t[t.EOF=41]="EOF",t[t.ContainerQueryLength=42]="ContainerQueryLength",t[t.CustomToken=43]="CustomToken"})(p||(p={}));class jo{constructor(e){this.source=e,this.len=e.length,this.position=0}substring(e,n=this.position){return this.source.substring(e,n)}eos(){return this.len<=this.position}pos(){return this.position}goBackTo(e){this.position=e}goBack(e){this.position-=e}advance(e){this.position+=e}nextChar(){return this.source.charCodeAt(this.position++)||0}peekChar(e=0){return this.source.charCodeAt(this.position+e)||0}lookbackChar(e=0){return this.source.charCodeAt(this.position-e)||0}advanceIfChar(e){return e===this.source.charCodeAt(this.position)?(this.position++,!0):!1}advanceIfChars(e){if(this.position+e.length>this.source.length)return!1;let n=0;for(;nn&&r===Zo?(e=!0,!1):(n=r===Ci,!0)),e&&this.stream.advance(1),!0}return!1}_number(){let e=0,n;return this.stream.peekChar()===nl&&(e=1),n=this.stream.peekChar(e),n>=xn&&n<=Sn?(this.stream.advance(e+1),this.stream.advanceWhileChar(r=>r>=xn&&r<=Sn||e===0&&r===nl),!0):!1}_newline(e){const n=this.stream.peekChar();switch(n){case jt:case kn:case qt:return this.stream.advance(1),e.push(String.fromCharCode(n)),n===jt&&this.stream.advanceIfChar(qt)&&e.push(` +`),!0}return!1}_escape(e,n){let r=this.stream.peekChar();if(r===ki){this.stream.advance(1),r=this.stream.peekChar();let i=0;for(;i<6&&(r>=xn&&r<=Sn||r>=ar&&r<=Ho||r>=or&&r<=Jo);)this.stream.advance(1),r=this.stream.peekChar(),i++;if(i>0){try{const s=parseInt(this.stream.substring(this.stream.pos()-i),16);s&&e.push(String.fromCharCode(s))}catch{}return r===_i||r===Ei?this.stream.advance(1):this._newline([]),!0}if(r!==jt&&r!==kn&&r!==qt)return this.stream.advance(1),e.push(String.fromCharCode(r)),!0;if(n)return this._newline(e)}return!1}_stringChar(e,n){const r=this.stream.peekChar();return r!==0&&r!==e&&r!==ki&&r!==jt&&r!==kn&&r!==qt?(this.stream.advance(1),n.push(String.fromCharCode(r)),!0):!1}_string(e){if(this.stream.peekChar()===tl||this.stream.peekChar()===el){const n=this.stream.nextChar();for(e.push(String.fromCharCode(n));this._stringChar(n,e)||this._escape(e,!0););return this.stream.peekChar()===n?(this.stream.nextChar(),e.push(String.fromCharCode(n)),p.String):p.BadString}return null}_unquotedChar(e){const n=this.stream.peekChar();return n!==0&&n!==ki&&n!==tl&&n!==el&&n!==Qo&&n!==Ko&&n!==_i&&n!==Ei&&n!==qt&&n!==kn&&n!==jt?(this.stream.advance(1),e.push(String.fromCharCode(n)),!0):!1}_unquotedString(e){let n=!1;for(;this._unquotedChar(e)||this._escape(e);)n=!0;return n}_whitespace(){return this.stream.advanceWhileChar(n=>n===_i||n===Ei||n===qt||n===kn||n===jt)>0}_name(e){let n=!1;for(;this._identChar(e)||this._escape(e);)n=!0;return n}ident(e){const n=this.stream.pos();if(this._minus(e)){if(this._minus(e)||this._identFirstChar(e)||this._escape(e)){for(;this._identChar(e)||this._escape(e););return!0}}else if(this._identFirstChar(e)||this._escape(e)){for(;this._identChar(e)||this._escape(e););return!0}return this.stream.goBackTo(n),!1}_identFirstChar(e){const n=this.stream.peekChar();return n===Yo||n>=ar&&n<=Go||n>=or&&n<=Xo||n>=128&&n<=65535?(this.stream.advance(1),e.push(String.fromCharCode(n)),!0):!1}_minus(e){const n=this.stream.peekChar();return n===St?(this.stream.advance(1),e.push(String.fromCharCode(n)),!0):!1}_identChar(e){const n=this.stream.peekChar();return n===Yo||n===St||n>=ar&&n<=Go||n>=or&&n<=Xo||n>=xn&&n<=Sn||n>=128&&n<=65535?(this.stream.advance(1),e.push(String.fromCharCode(n)),!0):!1}_unicodeRange(){if(this.stream.advanceIfChar(lp)){const e=r=>r>=xn&&r<=Sn||r>=ar&&r<=Ho||r>=or&&r<=Jo,n=this.stream.advanceWhileChar(e)+this.stream.advanceWhileChar(r=>r===op);if(n>=1&&n<=6)if(this.stream.advanceIfChar(St)){const r=this.stream.advanceWhileChar(e);if(r>=1&&r<=6)return!0}else return!0}return!1}}function pe(t,e){if(t.length0?t.lastIndexOf(e)===n:n===0?t===e:!1}function cp(t,e,n=4){let r=Math.abs(t.length-e.length);if(r>n)return 0;let i=[],s=[],a,o;for(a=0;a0;)(e&1)===1&&(n+=t),t+=t,e=e>>>1;return n}var v;(function(t){t[t.Undefined=0]="Undefined",t[t.Identifier=1]="Identifier",t[t.Stylesheet=2]="Stylesheet",t[t.Ruleset=3]="Ruleset",t[t.Selector=4]="Selector",t[t.SimpleSelector=5]="SimpleSelector",t[t.SelectorInterpolation=6]="SelectorInterpolation",t[t.SelectorCombinator=7]="SelectorCombinator",t[t.SelectorCombinatorParent=8]="SelectorCombinatorParent",t[t.SelectorCombinatorSibling=9]="SelectorCombinatorSibling",t[t.SelectorCombinatorAllSiblings=10]="SelectorCombinatorAllSiblings",t[t.SelectorCombinatorShadowPiercingDescendant=11]="SelectorCombinatorShadowPiercingDescendant",t[t.Page=12]="Page",t[t.PageBoxMarginBox=13]="PageBoxMarginBox",t[t.ClassSelector=14]="ClassSelector",t[t.IdentifierSelector=15]="IdentifierSelector",t[t.ElementNameSelector=16]="ElementNameSelector",t[t.PseudoSelector=17]="PseudoSelector",t[t.AttributeSelector=18]="AttributeSelector",t[t.Declaration=19]="Declaration",t[t.Declarations=20]="Declarations",t[t.Property=21]="Property",t[t.Expression=22]="Expression",t[t.BinaryExpression=23]="BinaryExpression",t[t.Term=24]="Term",t[t.Operator=25]="Operator",t[t.Value=26]="Value",t[t.StringLiteral=27]="StringLiteral",t[t.URILiteral=28]="URILiteral",t[t.EscapedValue=29]="EscapedValue",t[t.Function=30]="Function",t[t.NumericValue=31]="NumericValue",t[t.HexColorValue=32]="HexColorValue",t[t.RatioValue=33]="RatioValue",t[t.MixinDeclaration=34]="MixinDeclaration",t[t.MixinReference=35]="MixinReference",t[t.VariableName=36]="VariableName",t[t.VariableDeclaration=37]="VariableDeclaration",t[t.Prio=38]="Prio",t[t.Interpolation=39]="Interpolation",t[t.NestedProperties=40]="NestedProperties",t[t.ExtendsReference=41]="ExtendsReference",t[t.SelectorPlaceholder=42]="SelectorPlaceholder",t[t.Debug=43]="Debug",t[t.If=44]="If",t[t.Else=45]="Else",t[t.For=46]="For",t[t.Each=47]="Each",t[t.While=48]="While",t[t.MixinContentReference=49]="MixinContentReference",t[t.MixinContentDeclaration=50]="MixinContentDeclaration",t[t.Media=51]="Media",t[t.Keyframe=52]="Keyframe",t[t.FontFace=53]="FontFace",t[t.Import=54]="Import",t[t.Namespace=55]="Namespace",t[t.Invocation=56]="Invocation",t[t.FunctionDeclaration=57]="FunctionDeclaration",t[t.ReturnStatement=58]="ReturnStatement",t[t.MediaQuery=59]="MediaQuery",t[t.MediaCondition=60]="MediaCondition",t[t.MediaFeature=61]="MediaFeature",t[t.FunctionParameter=62]="FunctionParameter",t[t.FunctionArgument=63]="FunctionArgument",t[t.KeyframeSelector=64]="KeyframeSelector",t[t.ViewPort=65]="ViewPort",t[t.Document=66]="Document",t[t.AtApplyRule=67]="AtApplyRule",t[t.CustomPropertyDeclaration=68]="CustomPropertyDeclaration",t[t.CustomPropertySet=69]="CustomPropertySet",t[t.ListEntry=70]="ListEntry",t[t.Supports=71]="Supports",t[t.SupportsCondition=72]="SupportsCondition",t[t.NamespacePrefix=73]="NamespacePrefix",t[t.GridLine=74]="GridLine",t[t.Plugin=75]="Plugin",t[t.UnknownAtRule=76]="UnknownAtRule",t[t.Use=77]="Use",t[t.ModuleConfiguration=78]="ModuleConfiguration",t[t.Forward=79]="Forward",t[t.ForwardVisibility=80]="ForwardVisibility",t[t.Module=81]="Module",t[t.UnicodeRange=82]="UnicodeRange",t[t.Layer=83]="Layer",t[t.LayerNameList=84]="LayerNameList",t[t.LayerName=85]="LayerName",t[t.PropertyAtRule=86]="PropertyAtRule",t[t.Container=87]="Container"})(v||(v={}));var Q;(function(t){t[t.Mixin=0]="Mixin",t[t.Rule=1]="Rule",t[t.Variable=2]="Variable",t[t.Function=3]="Function",t[t.Keyframe=4]="Keyframe",t[t.Unknown=5]="Unknown",t[t.Module=6]="Module",t[t.Forward=7]="Forward",t[t.ForwardVisibility=8]="ForwardVisibility",t[t.Property=9]="Property"})(Q||(Q={}));function Fi(t,e){let n=null;return!t||et.end?null:(t.accept(r=>r.offset===-1&&r.length===-1?!0:r.offset<=e&&r.end>=e?(n?r.length<=n.length&&(n=r):n=r,!0):!1),n)}function Ri(t,e){let n=Fi(t,e);const r=[];for(;n;)r.unshift(n),n=n.parent;return r}function dp(t){const e=t.findParent(v.Declaration),n=e&&e.getValue();return n&&n.encloses(t)?e:null}class W{get end(){return this.offset+this.length}constructor(e=-1,n=-1,r){this.parent=null,this.offset=e,this.length=n,r&&(this.nodeType=r)}set type(e){this.nodeType=e}get type(){return this.nodeType||v.Undefined}getTextProvider(){let e=this;for(;e&&!e.textProvider;)e=e.parent;return e?e.textProvider:()=>"unknown"}getText(){return this.getTextProvider()(this.offset,this.length)}matches(e){return this.length===e.length&&this.getTextProvider()(this.offset,this.length)===e}startsWith(e){return this.length>=e.length&&this.getTextProvider()(this.offset,e.length)===e}endsWith(e){return this.length>=e.length&&this.getTextProvider()(this.end-e.length,e.length)===e}accept(e){if(e(this)&&this.children)for(const n of this.children)n.accept(e)}acceptVisitor(e){this.accept(e.visitNode.bind(e))}adoptChild(e,n=-1){if(e.parent&&e.parent.children){const i=e.parent.children.indexOf(e);i>=0&&e.parent.children.splice(i,1)}e.parent=this;let r=this.children;return r||(r=this.children=[]),n!==-1?r.splice(n,0,e):r.push(e),e}attachTo(e,n=-1){return e&&e.adoptChild(this,n),this}collectIssues(e){this.issues&&e.push.apply(e,this.issues)}addIssue(e){this.issues||(this.issues=[]),this.issues.push(e)}hasIssue(e){return Array.isArray(this.issues)&&this.issues.some(n=>n.getRule()===e)}isErroneous(e=!1){return this.issues&&this.issues.length>0?!0:e&&Array.isArray(this.children)&&this.children.some(n=>n.isErroneous(!0))}setNode(e,n,r=-1){return n?(n.attachTo(this,r),this[e]=n,!0):!1}addChild(e){return e?(this.children||(this.children=[]),e.attachTo(this),this.updateOffsetAndLength(e),!0):!1}updateOffsetAndLength(e){(e.offsetthis.end||this.length===-1)&&(this.length=n-this.offset)}hasChildren(){return!!this.children&&this.children.length>0}getChildren(){return this.children?this.children.slice(0):[]}getChild(e){return this.children&&e=0;r--)if(n=this.children[r],n.offset<=e)return n}return null}findChildAtOffset(e,n){const r=this.findFirstChildBeforeOffset(e);return r&&r.end>=e?n&&r.findChildAtOffset(e,!0)||r:null}encloses(e){return this.offset<=e.offset&&this.offset+this.length>=e.offset+e.length}getParent(){let e=this.parent;for(;e instanceof ve;)e=e.parent;return e}findParent(e){let n=this;for(;n&&n.type!==e;)n=n.parent;return n}findAParent(...e){let n=this;for(;n&&!e.some(r=>n.type===r);)n=n.parent;return n}setData(e,n){this.options||(this.options={}),this.options[e]=n}getData(e){return!this.options||!this.options.hasOwnProperty(e)?null:this.options[e]}}class ve extends W{constructor(e,n=-1){super(-1,-1),this.attachTo(e,n),this.offset=-1,this.length=-1}}class up extends W{constructor(e,n){super(e,n)}get type(){return v.UnicodeRange}setRangeStart(e){return this.setNode("rangeStart",e)}getRangeStart(){return this.rangeStart}setRangeEnd(e){return this.setNode("rangeEnd",e)}getRangeEnd(){return this.rangeEnd}}class ze extends W{constructor(e,n){super(e,n),this.isCustomProperty=!1}get type(){return v.Identifier}containsInterpolation(){return this.hasChildren()}}class pp extends W{constructor(e,n){super(e,n)}get type(){return v.Stylesheet}}class Ni extends W{constructor(e,n){super(e,n)}get type(){return v.Declarations}}class oe extends W{constructor(e,n){super(e,n)}getDeclarations(){return this.declarations}setDeclarations(e){return this.setNode("declarations",e)}}class Ct extends oe{constructor(e,n){super(e,n)}get type(){return v.Ruleset}getSelectors(){return this.selectors||(this.selectors=new ve(this)),this.selectors}isNested(){return!!this.parent&&this.parent.findParent(v.Declarations)!==null}}class En extends W{constructor(e,n){super(e,n)}get type(){return v.Selector}}class Ht extends W{constructor(e,n){super(e,n)}get type(){return v.SimpleSelector}}class Ii extends W{constructor(e,n){super(e,n)}}class mp extends oe{constructor(e,n){super(e,n)}get type(){return v.CustomPropertySet}}class Pe extends Ii{constructor(e,n){super(e,n),this.property=null}get type(){return v.Declaration}setProperty(e){return this.setNode("property",e)}getProperty(){return this.property}getFullPropertyName(){const e=this.property?this.property.getName():"unknown";if(this.parent instanceof Ni&&this.parent.getParent()instanceof ll){const n=this.parent.getParent().getParent();if(n instanceof Pe)return n.getFullPropertyName()+e}return e}getNonPrefixedPropertyName(){const e=this.getFullPropertyName();if(e&&e.charAt(0)==="-"){const n=e.indexOf("-",1);if(n!==-1)return e.substring(n+1)}return e}setValue(e){return this.setNode("value",e)}getValue(){return this.value}setNestedProperties(e){return this.setNode("nestedProperties",e)}getNestedProperties(){return this.nestedProperties}}class fp extends Pe{constructor(e,n){super(e,n)}get type(){return v.CustomPropertyDeclaration}setPropertySet(e){return this.setNode("propertySet",e)}getPropertySet(){return this.propertySet}}class Di extends W{constructor(e,n){super(e,n)}get type(){return v.Property}setIdentifier(e){return this.setNode("identifier",e)}getIdentifier(){return this.identifier}getName(){return hp(this.getText(),/[_\+]+$/)}isCustomProperty(){return!!this.identifier&&this.identifier.isCustomProperty}}class gp extends W{constructor(e,n){super(e,n)}get type(){return v.Invocation}getArguments(){return this.arguments||(this.arguments=new ve(this)),this.arguments}}class Fn extends gp{constructor(e,n){super(e,n)}get type(){return v.Function}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}}class lr extends W{constructor(e,n){super(e,n)}get type(){return v.FunctionParameter}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}setDefaultValue(e){return this.setNode("defaultValue",e,0)}getDefaultValue(){return this.defaultValue}}class Gt extends W{constructor(e,n){super(e,n)}get type(){return v.FunctionArgument}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}setValue(e){return this.setNode("value",e,0)}getValue(){return this.value}}class bp extends oe{constructor(e,n){super(e,n)}get type(){return v.If}setExpression(e){return this.setNode("expression",e,0)}setElseClause(e){return this.setNode("elseClause",e)}}class wp extends oe{constructor(e,n){super(e,n)}get type(){return v.For}setVariable(e){return this.setNode("variable",e,0)}}class vp extends oe{constructor(e,n){super(e,n)}get type(){return v.Each}getVariables(){return this.variables||(this.variables=new ve(this)),this.variables}}class yp extends oe{constructor(e,n){super(e,n)}get type(){return v.While}}class xp extends oe{constructor(e,n){super(e,n)}get type(){return v.Else}}class cr extends oe{constructor(e,n){super(e,n)}get type(){return v.FunctionDeclaration}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}getParameters(){return this.parameters||(this.parameters=new ve(this)),this.parameters}}class Sp extends oe{constructor(e,n){super(e,n)}get type(){return v.ViewPort}}class ol extends oe{constructor(e,n){super(e,n)}get type(){return v.FontFace}}class ll extends oe{constructor(e,n){super(e,n)}get type(){return v.NestedProperties}}class cl extends oe{constructor(e,n){super(e,n)}get type(){return v.Keyframe}setKeyword(e){return this.setNode("keyword",e,0)}getKeyword(){return this.keyword}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}}class hl extends oe{constructor(e,n){super(e,n)}get type(){return v.KeyframeSelector}}class Li extends W{constructor(e,n){super(e,n)}get type(){return v.Import}setMedialist(e){return e?(e.attachTo(this),!0):!1}}class Cp extends W{get type(){return v.Use}getParameters(){return this.parameters||(this.parameters=new ve(this)),this.parameters}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}}class kp extends W{get type(){return v.ModuleConfiguration}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}setValue(e){return this.setNode("value",e,0)}getValue(){return this.value}}class _p extends W{get type(){return v.Forward}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getMembers(){return this.members||(this.members=new ve(this)),this.members}getParameters(){return this.parameters||(this.parameters=new ve(this)),this.parameters}}class Ep extends W{get type(){return v.ForwardVisibility}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}}class Fp extends W{constructor(e,n){super(e,n)}get type(){return v.Namespace}}class Ai extends oe{constructor(e,n){super(e,n)}get type(){return v.Media}}class Mi extends oe{constructor(e,n){super(e,n)}get type(){return v.Supports}}class Rp extends oe{constructor(e,n){super(e,n)}get type(){return v.Layer}setNames(e){return this.setNode("names",e)}getNames(){return this.names}}class Np extends oe{constructor(e,n){super(e,n)}get type(){return v.PropertyAtRule}setName(e){return e?(e.attachTo(this),this.name=e,!0):!1}getName(){return this.name}}class Ip extends oe{constructor(e,n){super(e,n)}get type(){return v.Document}}class Dp extends oe{constructor(e,n){super(e,n)}get type(){return v.Container}}class dl extends W{constructor(e,n){super(e,n)}}class ul extends W{constructor(e,n){super(e,n)}get type(){return v.MediaQuery}}class Lp extends W{constructor(e,n){super(e,n)}get type(){return v.MediaCondition}}class Ap extends W{constructor(e,n){super(e,n)}get type(){return v.MediaFeature}}class Rn extends W{constructor(e,n){super(e,n)}get type(){return v.SupportsCondition}}class Mp extends oe{constructor(e,n){super(e,n)}get type(){return v.Page}}class zp extends oe{constructor(e,n){super(e,n)}get type(){return v.PageBoxMarginBox}}class pl extends W{constructor(e,n){super(e,n)}get type(){return v.Expression}}class zi extends W{constructor(e,n){super(e,n)}get type(){return v.BinaryExpression}setLeft(e){return this.setNode("left",e)}getLeft(){return this.left}setRight(e){return this.setNode("right",e)}getRight(){return this.right}setOperator(e){return this.setNode("operator",e)}getOperator(){return this.operator}}class Pp extends W{constructor(e,n){super(e,n)}get type(){return v.Term}setOperator(e){return this.setNode("operator",e)}getOperator(){return this.operator}setExpression(e){return this.setNode("expression",e)}getExpression(){return this.expression}}class Tp extends W{constructor(e,n){super(e,n)}get type(){return v.AttributeSelector}setNamespacePrefix(e){return this.setNode("namespacePrefix",e)}getNamespacePrefix(){return this.namespacePrefix}setIdentifier(e){return this.setNode("identifier",e)}getIdentifier(){return this.identifier}setOperator(e){return this.setNode("operator",e)}getOperator(){return this.operator}setValue(e){return this.setNode("value",e)}getValue(){return this.value}}class Pi extends W{constructor(e,n){super(e,n)}get type(){return v.HexColorValue}}class Op extends W{constructor(e,n){super(e,n)}get type(){return v.RatioValue}}const Wp=46,Vp=48,$p=57;class Ti extends W{constructor(e,n){super(e,n)}get type(){return v.NumericValue}getValue(){const e=this.getText();let n=0,r;for(let i=0,s=e.length;i0&&(n+=`/${Array.isArray(e.comment)?e.comment.join(""):e.comment}`),i=e.args??{};return Jp(r,i)}var Gp=/{([^}]+)}/g;function Jp(t,e){return Object.keys(e).length===0?t:t.replace(Gp,(n,r)=>e[r]??n)}class te{constructor(e,n){this.id=e,this.message=n}}const S={NumberExpected:new te("css-numberexpected",w("number expected")),ConditionExpected:new te("css-conditionexpected",w("condition expected")),RuleOrSelectorExpected:new te("css-ruleorselectorexpected",w("at-rule or selector expected")),DotExpected:new te("css-dotexpected",w("dot expected")),ColonExpected:new te("css-colonexpected",w("colon expected")),SemiColonExpected:new te("css-semicolonexpected",w("semi-colon expected")),TermExpected:new te("css-termexpected",w("term expected")),ExpressionExpected:new te("css-expressionexpected",w("expression expected")),OperatorExpected:new te("css-operatorexpected",w("operator expected")),IdentifierExpected:new te("css-identifierexpected",w("identifier expected")),PercentageExpected:new te("css-percentageexpected",w("percentage expected")),URIOrStringExpected:new te("css-uriorstringexpected",w("uri or string expected")),URIExpected:new te("css-uriexpected",w("URI expected")),VariableNameExpected:new te("css-varnameexpected",w("variable name expected")),VariableValueExpected:new te("css-varvalueexpected",w("variable value expected")),PropertyValueExpected:new te("css-propertyvalueexpected",w("property value expected")),LeftCurlyExpected:new te("css-lcurlyexpected",w("{ expected")),RightCurlyExpected:new te("css-rcurlyexpected",w("} expected")),LeftSquareBracketExpected:new te("css-rbracketexpected",w("[ expected")),RightSquareBracketExpected:new te("css-lbracketexpected",w("] expected")),LeftParenthesisExpected:new te("css-lparentexpected",w("( expected")),RightParenthesisExpected:new te("css-rparentexpected",w(") expected")),CommaExpected:new te("css-commaexpected",w("comma expected")),PageDirectiveOrDeclarationExpected:new te("css-pagedirordeclexpected",w("page directive or declaraton expected")),UnknownAtRule:new te("css-unknownatrule",w("at-rule unknown")),UnknownKeyword:new te("css-unknownkeyword",w("unknown keyword")),SelectorExpected:new te("css-selectorexpected",w("selector expected")),StringLiteralExpected:new te("css-stringliteralexpected",w("string literal expected")),WhitespaceExpected:new te("css-whitespaceexpected",w("whitespace expected")),MediaQueryExpected:new te("css-mediaqueryexpected",w("media query expected")),IdentifierOrWildcardExpected:new te("css-idorwildcardexpected",w("identifier or wildcard expected")),WildcardExpected:new te("css-wildcardexpected",w("wildcard expected")),IdentifierOrVariableExpected:new te("css-idorvarexpected",w("identifier or variable expected"))};var bl;(function(t){function e(n){return typeof n=="string"}t.is=e})(bl||(bl={}));var $i;(function(t){function e(n){return typeof n=="string"}t.is=e})($i||($i={}));var wl;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(wl||(wl={}));var ur;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(ur||(ur={}));var ye;(function(t){function e(r,i){return r===Number.MAX_VALUE&&(r=ur.MAX_VALUE),i===Number.MAX_VALUE&&(i=ur.MAX_VALUE),{line:r,character:i}}t.create=e;function n(r){let i=r;return C.objectLiteral(i)&&C.uinteger(i.line)&&C.uinteger(i.character)}t.is=n})(ye||(ye={}));var K;(function(t){function e(r,i,s,a){if(C.uinteger(r)&&C.uinteger(i)&&C.uinteger(s)&&C.uinteger(a))return{start:ye.create(r,i),end:ye.create(s,a)};if(ye.is(r)&&ye.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${s}, ${a}]`)}t.create=e;function n(r){let i=r;return C.objectLiteral(i)&&ye.is(i.start)&&ye.is(i.end)}t.is=n})(K||(K={}));var Dn;(function(t){function e(r,i){return{uri:r,range:i}}t.create=e;function n(r){let i=r;return C.objectLiteral(i)&&K.is(i.range)&&(C.string(i.uri)||C.undefined(i.uri))}t.is=n})(Dn||(Dn={}));var vl;(function(t){function e(r,i,s,a){return{targetUri:r,targetRange:i,targetSelectionRange:s,originSelectionRange:a}}t.create=e;function n(r){let i=r;return C.objectLiteral(i)&&K.is(i.targetRange)&&C.string(i.targetUri)&&K.is(i.targetSelectionRange)&&(K.is(i.originSelectionRange)||C.undefined(i.originSelectionRange))}t.is=n})(vl||(vl={}));var Ui;(function(t){function e(r,i,s,a){return{red:r,green:i,blue:s,alpha:a}}t.create=e;function n(r){const i=r;return C.objectLiteral(i)&&C.numberRange(i.red,0,1)&&C.numberRange(i.green,0,1)&&C.numberRange(i.blue,0,1)&&C.numberRange(i.alpha,0,1)}t.is=n})(Ui||(Ui={}));var yl;(function(t){function e(r,i){return{range:r,color:i}}t.create=e;function n(r){const i=r;return C.objectLiteral(i)&&K.is(i.range)&&Ui.is(i.color)}t.is=n})(yl||(yl={}));var xl;(function(t){function e(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}t.create=e;function n(r){const i=r;return C.objectLiteral(i)&&C.string(i.label)&&(C.undefined(i.textEdit)||j.is(i))&&(C.undefined(i.additionalTextEdits)||C.typedArray(i.additionalTextEdits,j.is))}t.is=n})(xl||(xl={}));var Sl;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Sl||(Sl={}));var Cl;(function(t){function e(r,i,s,a,o,l){const c={startLine:r,endLine:i};return C.defined(s)&&(c.startCharacter=s),C.defined(a)&&(c.endCharacter=a),C.defined(o)&&(c.kind=o),C.defined(l)&&(c.collapsedText=l),c}t.create=e;function n(r){const i=r;return C.objectLiteral(i)&&C.uinteger(i.startLine)&&C.uinteger(i.startLine)&&(C.undefined(i.startCharacter)||C.uinteger(i.startCharacter))&&(C.undefined(i.endCharacter)||C.uinteger(i.endCharacter))&&(C.undefined(i.kind)||C.string(i.kind))}t.is=n})(Cl||(Cl={}));var Bi;(function(t){function e(r,i){return{location:r,message:i}}t.create=e;function n(r){let i=r;return C.defined(i)&&Dn.is(i.location)&&C.string(i.message)}t.is=n})(Bi||(Bi={}));var pr;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(pr||(pr={}));var kl;(function(t){t.Unnecessary=1,t.Deprecated=2})(kl||(kl={}));var _l;(function(t){function e(n){const r=n;return C.objectLiteral(r)&&C.string(r.href)}t.is=e})(_l||(_l={}));var mr;(function(t){function e(r,i,s,a,o,l){let c={range:r,message:i};return C.defined(s)&&(c.severity=s),C.defined(a)&&(c.code=a),C.defined(o)&&(c.source=o),C.defined(l)&&(c.relatedInformation=l),c}t.create=e;function n(r){var i;let s=r;return C.defined(s)&&K.is(s.range)&&C.string(s.message)&&(C.number(s.severity)||C.undefined(s.severity))&&(C.integer(s.code)||C.string(s.code)||C.undefined(s.code))&&(C.undefined(s.codeDescription)||C.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(C.string(s.source)||C.undefined(s.source))&&(C.undefined(s.relatedInformation)||C.typedArray(s.relatedInformation,Bi.is))}t.is=n})(mr||(mr={}));var kt;(function(t){function e(r,i,...s){let a={title:r,command:i};return C.defined(s)&&s.length>0&&(a.arguments=s),a}t.create=e;function n(r){let i=r;return C.defined(i)&&C.string(i.title)&&C.string(i.command)}t.is=n})(kt||(kt={}));var j;(function(t){function e(s,a){return{range:s,newText:a}}t.replace=e;function n(s,a){return{range:{start:s,end:s},newText:a}}t.insert=n;function r(s){return{range:s,newText:""}}t.del=r;function i(s){const a=s;return C.objectLiteral(a)&&C.string(a.newText)&&K.is(a.range)}t.is=i})(j||(j={}));var qi;(function(t){function e(r,i,s){const a={label:r};return i!==void 0&&(a.needsConfirmation=i),s!==void 0&&(a.description=s),a}t.create=e;function n(r){const i=r;return C.objectLiteral(i)&&C.string(i.label)&&(C.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(C.string(i.description)||i.description===void 0)}t.is=n})(qi||(qi={}));var Jt;(function(t){function e(n){const r=n;return C.string(r)}t.is=e})(Jt||(Jt={}));var El;(function(t){function e(s,a,o){return{range:s,newText:a,annotationId:o}}t.replace=e;function n(s,a,o){return{range:{start:s,end:s},newText:a,annotationId:o}}t.insert=n;function r(s,a){return{range:s,newText:"",annotationId:a}}t.del=r;function i(s){const a=s;return j.is(a)&&(qi.is(a.annotationId)||Jt.is(a.annotationId))}t.is=i})(El||(El={}));var fr;(function(t){function e(r,i){return{textDocument:r,edits:i}}t.create=e;function n(r){let i=r;return C.defined(i)&&Yi.is(i.textDocument)&&Array.isArray(i.edits)}t.is=n})(fr||(fr={}));var ji;(function(t){function e(r,i,s){let a={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(a.options=i),s!==void 0&&(a.annotationId=s),a}t.create=e;function n(r){let i=r;return i&&i.kind==="create"&&C.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||C.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||C.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Jt.is(i.annotationId))}t.is=n})(ji||(ji={}));var Hi;(function(t){function e(r,i,s,a){let o={kind:"rename",oldUri:r,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(o.options=s),a!==void 0&&(o.annotationId=a),o}t.create=e;function n(r){let i=r;return i&&i.kind==="rename"&&C.string(i.oldUri)&&C.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||C.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||C.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Jt.is(i.annotationId))}t.is=n})(Hi||(Hi={}));var Gi;(function(t){function e(r,i,s){let a={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(a.options=i),s!==void 0&&(a.annotationId=s),a}t.create=e;function n(r){let i=r;return i&&i.kind==="delete"&&C.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||C.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||C.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Jt.is(i.annotationId))}t.is=n})(Gi||(Gi={}));var Ji;(function(t){function e(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>C.string(i.kind)?ji.is(i)||Hi.is(i)||Gi.is(i):fr.is(i)))}t.is=e})(Ji||(Ji={}));var Fl;(function(t){function e(r){return{uri:r}}t.create=e;function n(r){let i=r;return C.defined(i)&&C.string(i.uri)}t.is=n})(Fl||(Fl={}));var Xi;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return C.defined(i)&&C.string(i.uri)&&C.integer(i.version)}t.is=n})(Xi||(Xi={}));var Yi;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return C.defined(i)&&C.string(i.uri)&&(i.version===null||C.integer(i.version))}t.is=n})(Yi||(Yi={}));var Rl;(function(t){function e(r,i,s,a){return{uri:r,languageId:i,version:s,text:a}}t.create=e;function n(r){let i=r;return C.defined(i)&&C.string(i.uri)&&C.string(i.languageId)&&C.integer(i.version)&&C.string(i.text)}t.is=n})(Rl||(Rl={}));var He;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(n){const r=n;return r===t.PlainText||r===t.Markdown}t.is=e})(He||(He={}));var Ln;(function(t){function e(n){const r=n;return C.objectLiteral(n)&&He.is(r.kind)&&C.string(r.value)}t.is=e})(Ln||(Ln={}));var q;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(q||(q={}));var Ie;(function(t){t.PlainText=1,t.Snippet=2})(Ie||(Ie={}));var _t;(function(t){t.Deprecated=1})(_t||(_t={}));var Nl;(function(t){function e(r,i,s){return{newText:r,insert:i,replace:s}}t.create=e;function n(r){const i=r;return i&&C.string(i.newText)&&K.is(i.insert)&&K.is(i.replace)}t.is=n})(Nl||(Nl={}));var Il;(function(t){t.asIs=1,t.adjustIndentation=2})(Il||(Il={}));var Dl;(function(t){function e(n){const r=n;return r&&(C.string(r.detail)||r.detail===void 0)&&(C.string(r.description)||r.description===void 0)}t.is=e})(Dl||(Dl={}));var Ll;(function(t){function e(n){return{label:n}}t.create=e})(Ll||(Ll={}));var Al;(function(t){function e(n,r){return{items:n||[],isIncomplete:!!r}}t.create=e})(Al||(Al={}));var gr;(function(t){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function n(r){const i=r;return C.string(i)||C.objectLiteral(i)&&C.string(i.language)&&C.string(i.value)}t.is=n})(gr||(gr={}));var Ml;(function(t){function e(n){let r=n;return!!r&&C.objectLiteral(r)&&(Ln.is(r.contents)||gr.is(r.contents)||C.typedArray(r.contents,gr.is))&&(n.range===void 0||K.is(n.range))}t.is=e})(Ml||(Ml={}));var zl;(function(t){function e(n,r){return r?{label:n,documentation:r}:{label:n}}t.create=e})(zl||(zl={}));var Pl;(function(t){function e(n,r,...i){let s={label:n};return C.defined(r)&&(s.documentation=r),C.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})(Pl||(Pl={}));var Xt;(function(t){t.Text=1,t.Read=2,t.Write=3})(Xt||(Xt={}));var Tl;(function(t){function e(n,r){let i={range:n};return C.number(r)&&(i.kind=r),i}t.create=e})(Tl||(Tl={}));var tt;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(tt||(tt={}));var Ol;(function(t){t.Deprecated=1})(Ol||(Ol={}));var Wl;(function(t){function e(n,r,i,s,a){let o={name:n,kind:r,location:{uri:s,range:i}};return a&&(o.containerName=a),o}t.create=e})(Wl||(Wl={}));var Vl;(function(t){function e(n,r,i,s){return s!==void 0?{name:n,kind:r,location:{uri:i,range:s}}:{name:n,kind:r,location:{uri:i}}}t.create=e})(Vl||(Vl={}));var $l;(function(t){function e(r,i,s,a,o,l){let c={name:r,detail:i,kind:s,range:a,selectionRange:o};return l!==void 0&&(c.children=l),c}t.create=e;function n(r){let i=r;return i&&C.string(i.name)&&C.number(i.kind)&&K.is(i.range)&&K.is(i.selectionRange)&&(i.detail===void 0||C.string(i.detail))&&(i.deprecated===void 0||C.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=n})($l||($l={}));var Qi;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(Qi||(Qi={}));var br;(function(t){t.Invoked=1,t.Automatic=2})(br||(br={}));var Ul;(function(t){function e(r,i,s){let a={diagnostics:r};return i!=null&&(a.only=i),s!=null&&(a.triggerKind=s),a}t.create=e;function n(r){let i=r;return C.defined(i)&&C.typedArray(i.diagnostics,mr.is)&&(i.only===void 0||C.typedArray(i.only,C.string))&&(i.triggerKind===void 0||i.triggerKind===br.Invoked||i.triggerKind===br.Automatic)}t.is=n})(Ul||(Ul={}));var Ki;(function(t){function e(r,i,s){let a={title:r},o=!0;return typeof i=="string"?(o=!1,a.kind=i):kt.is(i)?a.command=i:a.edit=i,o&&s!==void 0&&(a.kind=s),a}t.create=e;function n(r){let i=r;return i&&C.string(i.title)&&(i.diagnostics===void 0||C.typedArray(i.diagnostics,mr.is))&&(i.kind===void 0||C.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||kt.is(i.command))&&(i.isPreferred===void 0||C.boolean(i.isPreferred))&&(i.edit===void 0||Ji.is(i.edit))}t.is=n})(Ki||(Ki={}));var Bl;(function(t){function e(r,i){let s={range:r};return C.defined(i)&&(s.data=i),s}t.create=e;function n(r){let i=r;return C.defined(i)&&K.is(i.range)&&(C.undefined(i.command)||kt.is(i.command))}t.is=n})(Bl||(Bl={}));var ql;(function(t){function e(r,i){return{tabSize:r,insertSpaces:i}}t.create=e;function n(r){let i=r;return C.defined(i)&&C.uinteger(i.tabSize)&&C.boolean(i.insertSpaces)}t.is=n})(ql||(ql={}));var jl;(function(t){function e(r,i,s){return{range:r,target:i,data:s}}t.create=e;function n(r){let i=r;return C.defined(i)&&K.is(i.range)&&(C.undefined(i.target)||C.string(i.target))}t.is=n})(jl||(jl={}));var wr;(function(t){function e(r,i){return{range:r,parent:i}}t.create=e;function n(r){let i=r;return C.objectLiteral(i)&&K.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=n})(wr||(wr={}));var Hl;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(Hl||(Hl={}));var Gl;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(Gl||(Gl={}));var Jl;(function(t){function e(n){const r=n;return C.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}t.is=e})(Jl||(Jl={}));var Xl;(function(t){function e(r,i){return{range:r,text:i}}t.create=e;function n(r){const i=r;return i!=null&&K.is(i.range)&&C.string(i.text)}t.is=n})(Xl||(Xl={}));var Yl;(function(t){function e(r,i,s){return{range:r,variableName:i,caseSensitiveLookup:s}}t.create=e;function n(r){const i=r;return i!=null&&K.is(i.range)&&C.boolean(i.caseSensitiveLookup)&&(C.string(i.variableName)||i.variableName===void 0)}t.is=n})(Yl||(Yl={}));var Ql;(function(t){function e(r,i){return{range:r,expression:i}}t.create=e;function n(r){const i=r;return i!=null&&K.is(i.range)&&(C.string(i.expression)||i.expression===void 0)}t.is=n})(Ql||(Ql={}));var Kl;(function(t){function e(r,i){return{frameId:r,stoppedLocation:i}}t.create=e;function n(r){const i=r;return C.defined(i)&&K.is(r.stoppedLocation)}t.is=n})(Kl||(Kl={}));var Zi;(function(t){t.Type=1,t.Parameter=2;function e(n){return n===1||n===2}t.is=e})(Zi||(Zi={}));var es;(function(t){function e(r){return{value:r}}t.create=e;function n(r){const i=r;return C.objectLiteral(i)&&(i.tooltip===void 0||C.string(i.tooltip)||Ln.is(i.tooltip))&&(i.location===void 0||Dn.is(i.location))&&(i.command===void 0||kt.is(i.command))}t.is=n})(es||(es={}));var Zl;(function(t){function e(r,i,s){const a={position:r,label:i};return s!==void 0&&(a.kind=s),a}t.create=e;function n(r){const i=r;return C.objectLiteral(i)&&ye.is(i.position)&&(C.string(i.label)||C.typedArray(i.label,es.is))&&(i.kind===void 0||Zi.is(i.kind))&&i.textEdits===void 0||C.typedArray(i.textEdits,j.is)&&(i.tooltip===void 0||C.string(i.tooltip)||Ln.is(i.tooltip))&&(i.paddingLeft===void 0||C.boolean(i.paddingLeft))&&(i.paddingRight===void 0||C.boolean(i.paddingRight))}t.is=n})(Zl||(Zl={}));var ec;(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e})(ec||(ec={}));var tc;(function(t){function e(n,r,i,s){return{insertText:n,filterText:r,range:i,command:s}}t.create=e})(tc||(tc={}));var nc;(function(t){function e(n){return{items:n}}t.create=e})(nc||(nc={}));var rc;(function(t){t.Invoked=0,t.Automatic=1})(rc||(rc={}));var ic;(function(t){function e(n,r){return{range:n,text:r}}t.create=e})(ic||(ic={}));var sc;(function(t){function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}t.create=e})(sc||(sc={}));var ac;(function(t){function e(n){const r=n;return C.objectLiteral(r)&&$i.is(r.uri)&&C.string(r.name)}t.is=e})(ac||(ac={}));var oc;(function(t){function e(s,a,o,l){return new Xp(s,a,o,l)}t.create=e;function n(s){let a=s;return!!(C.defined(a)&&C.string(a.uri)&&(C.undefined(a.languageId)||C.string(a.languageId))&&C.uinteger(a.lineCount)&&C.func(a.getText)&&C.func(a.positionAt)&&C.func(a.offsetAt))}t.is=n;function r(s,a){let o=s.getText(),l=i(a,(d,u)=>{let m=d.range.start.line-u.range.start.line;return m===0?d.range.start.character-u.range.start.character:m}),c=o.length;for(let d=l.length-1;d>=0;d--){let u=l[d],m=s.offsetAt(u.range.start),f=s.offsetAt(u.range.end);if(f<=c)o=o.substring(0,m)+u.newText+o.substring(f,o.length);else throw new Error("Overlapping edit");c=m}return o}t.applyEdits=r;function i(s,a){if(s.length<=1)return s;const o=s.length/2|0,l=s.slice(0,o),c=s.slice(o);i(l,a),i(c,a);let d=0,u=0,m=0;for(;d0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return ye.create(0,e);for(;re?i=a:r=a+1}let s=r-1;return ye.create(s,e-n[s])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1"u"}t.undefined=r;function i(f){return f===!0||f===!1}t.boolean=i;function s(f){return e.call(f)==="[object String]"}t.string=s;function a(f){return e.call(f)==="[object Number]"}t.number=a;function o(f,g,b){return e.call(f)==="[object Number]"&&g<=f&&f<=b}t.numberRange=o;function l(f){return e.call(f)==="[object Number]"&&-2147483648<=f&&f<=2147483647}t.integer=l;function c(f){return e.call(f)==="[object Number]"&&0<=f&&f<=2147483647}t.uinteger=c;function d(f){return e.call(f)==="[object Function]"}t.func=d;function u(f){return f!==null&&typeof f=="object"}t.objectLiteral=u;function m(f,g){return Array.isArray(f)&&f.every(g)}t.typedArray=m})(C||(C={}));class An{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(let r of e)if(An.isIncremental(r)){const i=cc(r.range),s=this.offsetAt(i.start),a=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(a,this._content.length);const o=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let c=this._lineOffsets;const d=lc(r.text,!1,s);if(l-o===d.length)for(let m=0,f=d.length;me?i=a:r=a+1}let s=r-1;return{line:s,character:e-n[s]}}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1{let m=d.range.start.line-u.range.start.line;return m===0?d.range.start.character-u.range.start.character:m}),l=0;const c=[];for(const d of o){let u=i.offsetAt(d.range.start);if(ul&&c.push(a.substring(l,u)),d.newText.length&&c.push(d.newText),l=i.offsetAt(d.range.end)}return c.push(a.substr(l)),c.join("")}t.applyEdits=r})(ts||(ts={}));function ns(t,e){if(t.length<=1)return t;const n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);ns(r,e),ns(i,e);let s=0,a=0,o=0;for(;sn.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function Yp(t){const e=cc(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var hc;(function(t){t.LATEST={textDocument:{completion:{completionItem:{documentationFormat:[He.Markdown,He.PlainText]}},hover:{contentFormat:[He.Markdown,He.PlainText]}}}})(hc||(hc={}));var Mn;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(Mn||(Mn={}));const dc={E:"Edge",FF:"Firefox",S:"Safari",C:"Chrome",IE:"IE",O:"Opera"};function uc(t){switch(t){case"experimental":return`⚠️ Property is experimental. Be cautious when using it.️ + +`;case"nonstandard":return`🚨️ Property is nonstandard. Avoid using it. + +`;case"obsolete":return`🚨️️️ Property is obsolete. Avoid using it. + +`;default:return""}}function mt(t,e,n){let r;if(e?r={kind:"markdown",value:Kp(t,n)}:r={kind:"plaintext",value:Qp(t,n)},r.value!=="")return r}function vr(t){return t=t.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&"),t.replace(//g,">")}function Qp(t,e){if(!t.description||t.description==="")return"";if(typeof t.description!="string")return t.description.value;let n="";if(e?.documentation!==!1){t.status&&(n+=uc(t.status)),n+=t.description;const r=pc(t.browsers);r&&(n+=` +(`+r+")"),"syntax"in t&&(n+=` + +Syntax: ${t.syntax}`)}return t.references&&t.references.length>0&&e?.references!==!1&&(n.length>0&&(n+=` + +`),n+=t.references.map(r=>`${r.name}: ${r.url}`).join(" | ")),n}function Kp(t,e){if(!t.description||t.description==="")return"";let n="";if(e?.documentation!==!1){t.status&&(n+=uc(t.status)),typeof t.description=="string"?n+=vr(t.description):n+=t.description.kind===He.Markdown?t.description.value:vr(t.description.value);const r=pc(t.browsers);r&&(n+=` + +(`+vr(r)+")"),"syntax"in t&&t.syntax&&(n+=` + +Syntax: ${vr(t.syntax)}`)}return t.references&&t.references.length>0&&e?.references!==!1&&(n.length>0&&(n+=` + +`),n+=t.references.map(r=>`[${r.name}](${r.url})`).join(" | ")),n}function pc(t=[]){return t.length===0?null:t.map(e=>{let n="";const r=e.match(/([A-Z]+)(\d+)?/),i=r[1],s=r[2];return i in dc&&(n+=dc[i]),s&&(n+=" "+s),n}).join(", ")}const Zp=/(^#([0-9A-F]{3}){1,2}$)|(^#([0-9A-F]{4}){1,2}$)/i,em=[{label:"rgb",func:"rgb($red, $green, $blue)",insertText:"rgb(${1:red}, ${2:green}, ${3:blue})",desc:w("Creates a Color from red, green, and blue values.")},{label:"rgba",func:"rgba($red, $green, $blue, $alpha)",insertText:"rgba(${1:red}, ${2:green}, ${3:blue}, ${4:alpha})",desc:w("Creates a Color from red, green, blue, and alpha values.")},{label:"rgb relative",func:"rgb(from $color $red $green $blue)",insertText:"rgb(from ${1:color} ${2:r} ${3:g} ${4:b})",desc:w("Creates a Color from the red, green, and blue values of another Color.")},{label:"hsl",func:"hsl($hue, $saturation, $lightness)",insertText:"hsl(${1:hue}, ${2:saturation}, ${3:lightness})",desc:w("Creates a Color from hue, saturation, and lightness values.")},{label:"hsla",func:"hsla($hue, $saturation, $lightness, $alpha)",insertText:"hsla(${1:hue}, ${2:saturation}, ${3:lightness}, ${4:alpha})",desc:w("Creates a Color from hue, saturation, lightness, and alpha values.")},{label:"hsl relative",func:"hsl(from $color $hue $saturation $lightness)",insertText:"hsl(from ${1:color} ${2:h} ${3:s} ${4:l})",desc:w("Creates a Color from the hue, saturation, and lightness values of another Color.")},{label:"hwb",func:"hwb($hue $white $black)",insertText:"hwb(${1:hue} ${2:white} ${3:black})",desc:w("Creates a Color from hue, white, and black values.")},{label:"hwb relative",func:"hwb(from $color $hue $white $black)",insertText:"hwb(from ${1:color} ${2:h} ${3:w} ${4:b})",desc:w("Creates a Color from the hue, white, and black values of another Color.")},{label:"lab",func:"lab($lightness $a $b)",insertText:"lab(${1:lightness} ${2:a} ${3:b})",desc:w("Creates a Color from lightness, a, and b values.")},{label:"lab relative",func:"lab(from $color $lightness $a $b)",insertText:"lab(from ${1:color} ${2:l} ${3:a} ${4:b})",desc:w("Creates a Color from the lightness, a, and b values of another Color.")},{label:"oklab",func:"oklab($lightness $a $b)",insertText:"oklab(${1:lightness} ${2:a} ${3:b})",desc:w("Creates a Color from lightness, a, and b values.")},{label:"oklab relative",func:"oklab(from $color $lightness $a $b)",insertText:"oklab(from ${1:color} ${2:l} ${3:a} ${4:b})",desc:w("Creates a Color from the lightness, a, and b values of another Color.")},{label:"lch",func:"lch($lightness $chroma $hue)",insertText:"lch(${1:lightness} ${2:chroma} ${3:hue})",desc:w("Creates a Color from lightness, chroma, and hue values.")},{label:"lch relative",func:"lch(from $color $lightness $chroma $hue)",insertText:"lch(from ${1:color} ${2:l} ${3:c} ${4:h})",desc:w("Creates a Color from the lightness, chroma, and hue values of another Color.")},{label:"oklch",func:"oklch($lightness $chroma $hue)",insertText:"oklch(${1:lightness} ${2:chroma} ${3:hue})",desc:w("Creates a Color from lightness, chroma, and hue values.")},{label:"oklch relative",func:"oklch(from $color $lightness $chroma $hue)",insertText:"oklch(from ${1:color} ${2:l} ${3:c} ${4:h})",desc:w("Creates a Color from the lightness, chroma, and hue values of another Color.")},{label:"color",func:"color($color-space $red $green $blue)",insertText:"color(${1|srgb,srgb-linear,display-p3,a98-rgb,prophoto-rgb,rec2020,xyx,xyz-d50,xyz-d65|} ${2:red} ${3:green} ${4:blue})",desc:w("Creates a Color in a specific color space from red, green, and blue values.")},{label:"color relative",func:"color(from $color $color-space $red $green $blue)",insertText:"color(from ${1:color} ${2|srgb,srgb-linear,display-p3,a98-rgb,prophoto-rgb,rec2020,xyx,xyz-d50,xyz-d65|} ${3:r} ${4:g} ${5:b})",desc:w("Creates a Color in a specific color space from the red, green, and blue values of another Color.")},{label:"color-mix",func:"color-mix(in $color-space, $color $percentage, $color $percentage)",insertText:"color-mix(in ${1|srgb,srgb-linear,lab,oklab,xyz,xyz-d50,xyz-d65|}, ${3:color} ${4:percentage}, ${5:color} ${6:percentage})",desc:w("Mix two colors together in a rectangular color space.")},{label:"color-mix hue",func:"color-mix(in $color-space $interpolation-method hue, $color $percentage, $color $percentage)",insertText:"color-mix(in ${1|hsl,hwb,lch,oklch|} ${2|shorter hue,longer hue,increasing hue,decreasing hue|}, ${3:color} ${4:percentage}, ${5:color} ${6:percentage})",desc:w("Mix two colors together in a polar color space.")}],tm=/^(rgb|rgba|hsl|hsla|hwb)$/i,yr={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rebeccapurple:"#663399",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},nm=new RegExp(`^(${Object.keys(yr).join("|")})$`,"i"),rs={currentColor:"The value of the 'color' property. The computed value of the 'currentColor' keyword is the computed value of the 'color' property. If the 'currentColor' keyword is set on the 'color' property itself, it is treated as 'color:inherit' at parse time.",transparent:"Fully transparent. This keyword can be considered a shorthand for rgba(0,0,0,0) which is its computed value."},rm=new RegExp(`^(${Object.keys(rs).join("|")})$`,"i");function ft(t,e){const r=t.getText().match(/^([-+]?[0-9]*\.?[0-9]+)(%?)$/);if(r){r[2]&&(e=100);const i=parseFloat(r[1])/e;if(i>=0&&i<=1)return i}throw new Error}function mc(t){const e=t.getText(),n=e.match(/^([-+]?[0-9]*\.?[0-9]+)(deg|rad|grad|turn)?$/);if(n)switch(n[2]){case"deg":return parseFloat(e)%360;case"rad":return parseFloat(e)*180/Math.PI%360;case"grad":return parseFloat(e)*.9%360;case"turn":return parseFloat(e)*360%360;default:if(typeof n[2]>"u")return parseFloat(e)%360}throw new Error}function im(t){const e=t.getName();return e?tm.test(e):!1}function fc(t){return Zp.test(t)||nm.test(t)||rm.test(t)}const gc=48,sm=57,am=65,xr=97,om=102;function de(t){return t=xr&&t<=om?t-xr+10:0)}function bc(t){if(t[0]!=="#")return null;switch(t.length){case 4:return{red:de(t.charCodeAt(1))*17/255,green:de(t.charCodeAt(2))*17/255,blue:de(t.charCodeAt(3))*17/255,alpha:1};case 5:return{red:de(t.charCodeAt(1))*17/255,green:de(t.charCodeAt(2))*17/255,blue:de(t.charCodeAt(3))*17/255,alpha:de(t.charCodeAt(4))*17/255};case 7:return{red:(de(t.charCodeAt(1))*16+de(t.charCodeAt(2)))/255,green:(de(t.charCodeAt(3))*16+de(t.charCodeAt(4)))/255,blue:(de(t.charCodeAt(5))*16+de(t.charCodeAt(6)))/255,alpha:1};case 9:return{red:(de(t.charCodeAt(1))*16+de(t.charCodeAt(2)))/255,green:(de(t.charCodeAt(3))*16+de(t.charCodeAt(4)))/255,blue:(de(t.charCodeAt(5))*16+de(t.charCodeAt(6)))/255,alpha:(de(t.charCodeAt(7))*16+de(t.charCodeAt(8)))/255}}return null}function wc(t,e,n,r=1){if(t=t/60,e===0)return{red:n,green:n,blue:n,alpha:r};{const i=(o,l,c)=>{for(;c<0;)c+=6;for(;c>=6;)c-=6;return c<1?(l-o)*c+o:c<3?l:c<4?(l-o)*(4-c)+o:o},s=n<=.5?n*(e+1):n+e-n*e,a=n*2-s;return{red:i(a,s,t+2),green:i(a,s,t),blue:i(a,s,t-2),alpha:r}}}function vc(t){const e=t.red,n=t.green,r=t.blue,i=t.alpha,s=Math.max(e,n,r),a=Math.min(e,n,r);let o=0,l=0;const c=(a+s)/2,d=s-a;if(d>0){switch(l=Math.min(c<=.5?d/(2*c):d/(2-2*c),1),s){case e:o=(n-r)/d+(n=1){const l=e/(e+n);return{red:l,green:l,blue:l,alpha:r}}const i=wc(t,1,.5,r);let s=i.red;s*=1-e-n,s+=e;let a=i.green;a*=1-e-n,a+=e;let o=i.blue;return o*=1-e-n,o+=e,{red:s,green:a,blue:o,alpha:r}}function cm(t){const e=vc(t),n=Math.min(t.red,t.green,t.blue),r=1-Math.max(t.red,t.green,t.blue);return{h:e.h,w:n,b:r,a:e.a}}function hm(t){if(t.type===v.HexColorValue){const e=t.getText();return bc(e)}else if(t.type===v.Function){const e=t,n=e.getName();let r=e.getArguments().getChildren();if(r.length===1){const i=r[0].getChildren();if(i.length===1&&i[0].type===v.Expression&&(r=i[0].getChildren(),r.length===3)){const s=r[2];if(s instanceof zi){const a=s.getLeft(),o=s.getRight(),l=s.getOperator();a&&o&&l&&l.matches("/")&&(r=[r[0],r[1],a,o])}}}if(!n||r.length<3||r.length>4)return null;try{const i=r.length===4?ft(r[3],1):1;if(n==="rgb"||n==="rgba")return{red:ft(r[0],255),green:ft(r[1],255),blue:ft(r[2],255),alpha:i};if(n==="hsl"||n==="hsla"){const s=mc(r[0]),a=ft(r[1],100),o=ft(r[2],100);return wc(s,a,o,i)}else if(n==="hwb"){const s=mc(r[0]),a=ft(r[1],100),o=ft(r[2],100);return lm(s,a,o,i)}}catch{return null}}else if(t.type===v.Identifier){if(t.parent&&t.parent.type!==v.Term)return null;const e=t.parent;if(e&&e.parent&&e.parent.type===v.BinaryExpression){const i=e.parent;if(i.parent&&i.parent.type===v.ListEntry&&i.parent.key===i)return null}const n=t.getText().toLowerCase();if(n==="none")return null;const r=yr[n];if(r)return bc(r)}return null}const yc={bottom:"Computes to ‘100%’ for the vertical position if one or two values are given, otherwise specifies the bottom edge as the origin for the next offset.",center:"Computes to ‘50%’ (‘left 50%’) for the horizontal position if the horizontal position is not otherwise specified, or ‘50%’ (‘top 50%’) for the vertical position if it is.",left:"Computes to ‘0%’ for the horizontal position if one or two values are given, otherwise specifies the left edge as the origin for the next offset.",right:"Computes to ‘100%’ for the horizontal position if one or two values are given, otherwise specifies the right edge as the origin for the next offset.",top:"Computes to ‘0%’ for the vertical position if one or two values are given, otherwise specifies the top edge as the origin for the next offset."},xc={"no-repeat":"Placed once and not repeated in this direction.",repeat:"Repeated in this direction as often as needed to cover the background painting area.","repeat-x":"Computes to ‘repeat no-repeat’.","repeat-y":"Computes to ‘no-repeat repeat’.",round:"Repeated as often as will fit within the background positioning area. If it doesn’t fit a whole number of times, it is rescaled so that it does.",space:"Repeated as often as will fit within the background positioning area without being clipped and then the images are spaced out to fill the area."},Sc={dashed:"A series of square-ended dashes.",dotted:"A series of round dots.",double:"Two parallel solid lines with some space between them.",groove:"Looks as if it were carved in the canvas.",hidden:"Same as ‘none’, but has different behavior in the border conflict resolution rules for border-collapsed tables.",inset:"Looks as if the content on the inside of the border is sunken into the canvas.",none:"No border. Color and width are ignored.",outset:"Looks as if the content on the inside of the border is coming out of the canvas.",ridge:"Looks as if it were coming out of the canvas.",solid:"A single line segment."},dm=["medium","thick","thin"],Cc={"border-box":"The background is painted within (clipped to) the border box.","content-box":"The background is painted within (clipped to) the content box.","padding-box":"The background is painted within (clipped to) the padding box."},kc={"margin-box":"Uses the margin box as reference box.","fill-box":"Uses the object bounding box as reference box.","stroke-box":"Uses the stroke bounding box as reference box.","view-box":"Uses the nearest SVG viewport as reference box."},_c={initial:"Represents the value specified as the property’s initial value.",inherit:"Represents the computed value of the property on the element’s parent.",unset:"Acts as either `inherit` or `initial`, depending on whether the property is inherited or not."},Ec={"var()":"Evaluates the value of a custom variable.","calc()":"Evaluates an mathematical expression. The following operators can be used: + - * /."},Fc={"url()":"Reference an image file by URL","image()":"Provide image fallbacks and annotations.","-webkit-image-set()":"Provide multiple resolutions. Remember to use unprefixed image-set() in addition.","image-set()":"Provide multiple resolutions of an image and const the UA decide which is most appropriate in a given situation.","-moz-element()":"Use an element in the document as an image. Remember to use unprefixed element() in addition.","element()":"Use an element in the document as an image.","cross-fade()":"Indicates the two images to be combined and how far along in the transition the combination is.","-webkit-gradient()":"Deprecated. Use modern linear-gradient() or radial-gradient() instead.","-webkit-linear-gradient()":"Linear gradient. Remember to use unprefixed version in addition.","-moz-linear-gradient()":"Linear gradient. Remember to use unprefixed version in addition.","-o-linear-gradient()":"Linear gradient. Remember to use unprefixed version in addition.","linear-gradient()":"A linear gradient is created by specifying a straight gradient line, and then several colors placed along that line.","-webkit-repeating-linear-gradient()":"Repeating Linear gradient. Remember to use unprefixed version in addition.","-moz-repeating-linear-gradient()":"Repeating Linear gradient. Remember to use unprefixed version in addition.","-o-repeating-linear-gradient()":"Repeating Linear gradient. Remember to use unprefixed version in addition.","repeating-linear-gradient()":"Same as linear-gradient, except the color-stops are repeated infinitely in both directions, with their positions shifted by multiples of the difference between the last specified color-stop’s position and the first specified color-stop’s position.","-webkit-radial-gradient()":"Radial gradient. Remember to use unprefixed version in addition.","-moz-radial-gradient()":"Radial gradient. Remember to use unprefixed version in addition.","radial-gradient()":"Colors emerge from a single point and smoothly spread outward in a circular or elliptical shape.","-webkit-repeating-radial-gradient()":"Repeating radial gradient. Remember to use unprefixed version in addition.","-moz-repeating-radial-gradient()":"Repeating radial gradient. Remember to use unprefixed version in addition.","repeating-radial-gradient()":"Same as radial-gradient, except the color-stops are repeated infinitely in both directions, with their positions shifted by multiples of the difference between the last specified color-stop’s position and the first specified color-stop’s position."},Rc={ease:"Equivalent to cubic-bezier(0.25, 0.1, 0.25, 1.0).","ease-in":"Equivalent to cubic-bezier(0.42, 0, 1.0, 1.0).","ease-in-out":"Equivalent to cubic-bezier(0.42, 0, 0.58, 1.0).","ease-out":"Equivalent to cubic-bezier(0, 0, 0.58, 1.0).",linear:"Equivalent to cubic-bezier(0.0, 0.0, 1.0, 1.0).","step-end":"Equivalent to steps(1, end).","step-start":"Equivalent to steps(1, start).","steps()":"The first parameter specifies the number of intervals in the function. The second parameter, which is optional, is either the value “start” or “end”.","cubic-bezier()":"Specifies a cubic-bezier curve. The four values specify points P1 and P2 of the curve as (x1, y1, x2, y2).","cubic-bezier(0.6, -0.28, 0.735, 0.045)":"Ease-in Back. Overshoots.","cubic-bezier(0.68, -0.55, 0.265, 1.55)":"Ease-in-out Back. Overshoots.","cubic-bezier(0.175, 0.885, 0.32, 1.275)":"Ease-out Back. Overshoots.","cubic-bezier(0.6, 0.04, 0.98, 0.335)":"Ease-in Circular. Based on half circle.","cubic-bezier(0.785, 0.135, 0.15, 0.86)":"Ease-in-out Circular. Based on half circle.","cubic-bezier(0.075, 0.82, 0.165, 1)":"Ease-out Circular. Based on half circle.","cubic-bezier(0.55, 0.055, 0.675, 0.19)":"Ease-in Cubic. Based on power of three.","cubic-bezier(0.645, 0.045, 0.355, 1)":"Ease-in-out Cubic. Based on power of three.","cubic-bezier(0.215, 0.610, 0.355, 1)":"Ease-out Cubic. Based on power of three.","cubic-bezier(0.95, 0.05, 0.795, 0.035)":"Ease-in Exponential. Based on two to the power ten.","cubic-bezier(1, 0, 0, 1)":"Ease-in-out Exponential. Based on two to the power ten.","cubic-bezier(0.19, 1, 0.22, 1)":"Ease-out Exponential. Based on two to the power ten.","cubic-bezier(0.47, 0, 0.745, 0.715)":"Ease-in Sine.","cubic-bezier(0.445, 0.05, 0.55, 0.95)":"Ease-in-out Sine.","cubic-bezier(0.39, 0.575, 0.565, 1)":"Ease-out Sine.","cubic-bezier(0.55, 0.085, 0.68, 0.53)":"Ease-in Quadratic. Based on power of two.","cubic-bezier(0.455, 0.03, 0.515, 0.955)":"Ease-in-out Quadratic. Based on power of two.","cubic-bezier(0.25, 0.46, 0.45, 0.94)":"Ease-out Quadratic. Based on power of two.","cubic-bezier(0.895, 0.03, 0.685, 0.22)":"Ease-in Quartic. Based on power of four.","cubic-bezier(0.77, 0, 0.175, 1)":"Ease-in-out Quartic. Based on power of four.","cubic-bezier(0.165, 0.84, 0.44, 1)":"Ease-out Quartic. Based on power of four.","cubic-bezier(0.755, 0.05, 0.855, 0.06)":"Ease-in Quintic. Based on power of five.","cubic-bezier(0.86, 0, 0.07, 1)":"Ease-in-out Quintic. Based on power of five.","cubic-bezier(0.23, 1, 0.320, 1)":"Ease-out Quintic. Based on power of five."},Nc={"circle()":"Defines a circle.","ellipse()":"Defines an ellipse.","inset()":"Defines an inset rectangle.","polygon()":"Defines a polygon."},Ic={length:["cap","ch","cm","cqb","cqh","cqi","cqmax","cqmin","cqw","dvb","dvh","dvi","dvw","em","ex","ic","in","lh","lvb","lvh","lvi","lvw","mm","pc","pt","px","q","rcap","rch","rem","rex","ric","rlh","svb","svh","svi","svw","vb","vh","vi","vmax","vmin","vw"],angle:["deg","rad","grad","turn"],time:["ms","s"],frequency:["Hz","kHz"],resolution:["dpi","dpcm","dppx"],percentage:["%","fr"]},um=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","const","video","wbr"],pm=["circle","clipPath","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","hatch","hatchpath","image","line","linearGradient","marker","mask","mesh","meshpatch","meshrow","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","solidcolor","stop","svg","switch","symbol","text","textPath","tspan","use","view"],mm=["@bottom-center","@bottom-left","@bottom-left-corner","@bottom-right","@bottom-right-corner","@left-bottom","@left-middle","@left-top","@right-bottom","@right-middle","@right-top","@top-center","@top-left","@top-left-corner","@top-right","@top-right-corner"];function Sr(t){return Object.keys(t).map(e=>t[e])}function Te(t){return typeof t<"u"}class Cr{constructor(e=new _n){this.keyframeRegex=/^@(\-(webkit|ms|moz|o)\-)?keyframes$/i,this.scanner=e,this.token={type:p.EOF,offset:-1,len:0,text:""},this.prevToken=void 0}peekIdent(e){return p.Ident===this.token.type&&e.length===this.token.text.length&&e===this.token.text.toLowerCase()}peekKeyword(e){return p.AtKeyword===this.token.type&&e.length===this.token.text.length&&e===this.token.text.toLowerCase()}peekDelim(e){return p.Delim===this.token.type&&e===this.token.text}peek(e){return e===this.token.type}peekOne(...e){return e.indexOf(this.token.type)!==-1}peekRegExp(e,n){return e!==this.token.type?!1:n.test(this.token.text)}hasWhitespace(){return!!this.prevToken&&this.prevToken.offset+this.prevToken.len!==this.token.offset}consumeToken(){this.prevToken=this.token,this.token=this.scanner.scan()}acceptUnicodeRange(){const e=this.scanner.tryScanUnicode();return e?(this.prevToken=e,this.token=this.scanner.scan(),!0):!1}mark(){return{prev:this.prevToken,curr:this.token,pos:this.scanner.pos()}}restoreAtMark(e){this.prevToken=e.prev,this.token=e.curr,this.scanner.goBackTo(e.pos)}try(e){const n=this.mark(),r=e();return r||(this.restoreAtMark(n),null)}acceptOneKeyword(e){if(p.AtKeyword===this.token.type){for(const n of e)if(n.length===this.token.text.length&&n===this.token.text.toLowerCase())return this.consumeToken(),!0}return!1}accept(e){return e===this.token.type?(this.consumeToken(),!0):!1}acceptIdent(e){return this.peekIdent(e)?(this.consumeToken(),!0):!1}acceptKeyword(e){return this.peekKeyword(e)?(this.consumeToken(),!0):!1}acceptDelim(e){return this.peekDelim(e)?(this.consumeToken(),!0):!1}acceptRegexp(e){return e.test(this.token.text)?(this.consumeToken(),!0):!1}_parseRegexp(e){let n=this.createNode(v.Identifier);do;while(this.acceptRegexp(e));return this.finish(n)}acceptUnquotedString(){const e=this.scanner.pos();this.scanner.goBackTo(this.token.offset);const n=this.scanner.scanUnquotedString();return n?(this.token=n,this.consumeToken(),!0):(this.scanner.goBackTo(e),!1)}resync(e,n){for(;;){if(e&&e.indexOf(this.token.type)!==-1)return this.consumeToken(),!0;if(n&&n.indexOf(this.token.type)!==-1)return!0;if(this.token.type===p.EOF)return!1;this.token=this.scanner.scan()}}createNode(e){return new W(this.token.offset,this.token.len,e)}create(e){return new e(this.token.offset,this.token.len)}finish(e,n,r,i){if(!(e instanceof ve)&&(n&&this.markError(e,n,r,i),this.prevToken)){const s=this.prevToken.offset+this.prevToken.len;e.length=s>e.offset?s-e.offset:0}return e}markError(e,n,r,i){this.token!==this.lastErrorToken&&(e.addIssue(new gl(e,n,Ne.Error,void 0,this.token.offset,this.token.len)),this.lastErrorToken=this.token),(r||i)&&this.resync(r,i)}parseStylesheet(e){const n=e.version,r=e.getText(),i=(s,a)=>{if(e.version!==n)throw new Error("Underlying model has changed, AST is no longer valid");return r.substr(s,a)};return this.internalParse(r,this._parseStylesheet,i)}internalParse(e,n,r){this.scanner.setSource(e),this.token=this.scanner.scan();const i=n.bind(this)();return i&&(r?i.textProvider=r:i.textProvider=(s,a)=>e.substr(s,a)),i}_parseStylesheet(){const e=this.create(pp);for(;e.addChild(this._parseStylesheetStart()););let n=!1;do{let r=!1;do{r=!1;const i=this._parseStylesheetStatement();for(i&&(e.addChild(i),r=!0,n=!1,!this.peek(p.EOF)&&this._needsSemicolonAfter(i)&&!this.accept(p.SemiColon)&&this.markError(e,S.SemiColonExpected));this.accept(p.SemiColon)||this.accept(p.CDO)||this.accept(p.CDC);)r=!0,n=!1}while(r);if(this.peek(p.EOF))break;n||(this.peek(p.AtKeyword)?this.markError(e,S.UnknownAtRule):this.markError(e,S.RuleOrSelectorExpected),n=!0),this.consumeToken()}while(!this.peek(p.EOF));return this.finish(e)}_parseStylesheetStart(){return this._parseCharset()}_parseStylesheetStatement(e=!1){return this.peek(p.AtKeyword)?this._parseStylesheetAtStatement(e):this._parseRuleset(e)}_parseStylesheetAtStatement(e=!1){return this._parseImport()||this._parseMedia(e)||this._parsePage()||this._parseFontFace()||this._parseKeyframe()||this._parseSupports(e)||this._parseLayer(e)||this._parsePropertyAtRule()||this._parseViewPort()||this._parseNamespace()||this._parseDocument()||this._parseContainer(e)||this._parseUnknownAtRule()}_tryParseRuleset(e){const n=this.mark();if(this._parseSelector(e)){for(;this.accept(p.Comma)&&this._parseSelector(e););if(this.accept(p.CurlyL))return this.restoreAtMark(n),this._parseRuleset(e)}return this.restoreAtMark(n),null}_parseRuleset(e=!1){const n=this.create(Ct),r=n.getSelectors();if(!r.addChild(this._parseSelector(e)))return null;for(;this.accept(p.Comma);)if(!r.addChild(this._parseSelector(e)))return this.finish(n,S.SelectorExpected);return this._parseBody(n,this._parseRuleSetDeclaration.bind(this))}_parseRuleSetDeclarationAtStatement(){return this._parseMedia(!0)||this._parseSupports(!0)||this._parseLayer(!0)||this._parseContainer(!0)||this._parseUnknownAtRule()}_parseRuleSetDeclaration(){return this.peek(p.AtKeyword)?this._parseRuleSetDeclarationAtStatement():this.peek(p.Ident)?this._tryParseRuleset(!0)||this._parseDeclaration():this._parseRuleset(!0)}_needsSemicolonAfter(e){switch(e.type){case v.Keyframe:case v.ViewPort:case v.Media:case v.Ruleset:case v.Namespace:case v.If:case v.For:case v.Each:case v.While:case v.MixinDeclaration:case v.FunctionDeclaration:case v.MixinContentDeclaration:return!1;case v.ExtendsReference:case v.MixinContentReference:case v.ReturnStatement:case v.MediaQuery:case v.Debug:case v.Import:case v.AtApplyRule:case v.CustomPropertyDeclaration:return!0;case v.VariableDeclaration:return e.needsSemicolon;case v.MixinReference:return!e.getContent();case v.Declaration:return!e.getNestedProperties()}return!1}_parseDeclarations(e){const n=this.create(Ni);if(!this.accept(p.CurlyL))return null;let r=e();for(;n.addChild(r)&&!this.peek(p.CurlyR);){if(this._needsSemicolonAfter(r)&&!this.accept(p.SemiColon))return this.finish(n,S.SemiColonExpected,[p.SemiColon,p.CurlyR]);for(r&&this.prevToken&&this.prevToken.type===p.SemiColon&&(r.semicolonPosition=this.prevToken.offset);this.accept(p.SemiColon););r=e()}return this.accept(p.CurlyR)?this.finish(n):this.finish(n,S.RightCurlyExpected,[p.CurlyR,p.SemiColon])}_parseBody(e,n){return e.setDeclarations(this._parseDeclarations(n))?this.finish(e):this.finish(e,S.LeftCurlyExpected,[p.CurlyR,p.SemiColon])}_parseSelector(e){const n=this.create(En);let r=!1;for(e&&(r=n.addChild(this._parseCombinator()));n.addChild(this._parseSimpleSelector());)r=!0,n.addChild(this._parseCombinator());return r?this.finish(n):null}_parseDeclaration(e){const n=this._tryParseCustomPropertyDeclaration(e);if(n)return n;const r=this.create(Pe);return r.setProperty(this._parseProperty())?this.accept(p.Colon)?(this.prevToken&&(r.colonPosition=this.prevToken.offset),r.setValue(this._parseExpr())?(r.addChild(this._parsePrio()),this.peek(p.SemiColon)&&(r.semicolonPosition=this.token.offset),this.finish(r)):this.finish(r,S.PropertyValueExpected)):this.finish(r,S.ColonExpected,[p.Colon],e||[p.SemiColon]):null}_tryParseCustomPropertyDeclaration(e){if(!this.peekRegExp(p.Ident,/^--/))return null;const n=this.create(fp);if(!n.setProperty(this._parseProperty()))return null;if(!this.accept(p.Colon))return this.finish(n,S.ColonExpected,[p.Colon]);this.prevToken&&(n.colonPosition=this.prevToken.offset);const r=this.mark();if(this.peek(p.CurlyL)){const s=this.create(mp),a=this._parseDeclarations(this._parseRuleSetDeclaration.bind(this));if(s.setDeclarations(a)&&!a.isErroneous(!0)&&(s.addChild(this._parsePrio()),this.peek(p.SemiColon)))return this.finish(s),n.setPropertySet(s),n.semicolonPosition=this.token.offset,this.finish(n);this.restoreAtMark(r)}const i=this._parseExpr();return i&&!i.isErroneous(!0)&&(this._parsePrio(),this.peekOne(...e||[],p.SemiColon,p.EOF))?(n.setValue(i),this.peek(p.SemiColon)&&(n.semicolonPosition=this.token.offset),this.finish(n)):(this.restoreAtMark(r),n.addChild(this._parseCustomPropertyValue(e)),n.addChild(this._parsePrio()),Te(n.colonPosition)&&this.token.offset===n.colonPosition+1?this.finish(n,S.PropertyValueExpected):this.finish(n))}_parseCustomPropertyValue(e=[p.CurlyR]){const n=this.create(W),r=()=>s===0&&a===0&&o===0,i=()=>e.indexOf(this.token.type)!==-1;let s=0,a=0,o=0;e:for(;;){switch(this.token.type){case p.SemiColon:if(r())break e;break;case p.Exclamation:if(r())break e;break;case p.CurlyL:s++;break;case p.CurlyR:if(s--,s<0){if(i()&&a===0&&o===0)break e;return this.finish(n,S.LeftCurlyExpected)}break;case p.ParenthesisL:a++;break;case p.ParenthesisR:if(a--,a<0){if(i()&&o===0&&s===0)break e;return this.finish(n,S.LeftParenthesisExpected)}break;case p.BracketL:o++;break;case p.BracketR:if(o--,o<0)return this.finish(n,S.LeftSquareBracketExpected);break;case p.BadString:break e;case p.EOF:let l=S.RightCurlyExpected;return o>0?l=S.RightSquareBracketExpected:a>0&&(l=S.RightParenthesisExpected),this.finish(n,l)}this.consumeToken()}return this.finish(n)}_tryToParseDeclaration(e){const n=this.mark();return this._parseProperty()&&this.accept(p.Colon)?(this.restoreAtMark(n),this._parseDeclaration(e)):(this.restoreAtMark(n),null)}_parseProperty(){const e=this.create(Di),n=this.mark();return(this.acceptDelim("*")||this.acceptDelim("_"))&&this.hasWhitespace()?(this.restoreAtMark(n),null):e.setIdentifier(this._parsePropertyIdentifier())?this.finish(e):null}_parsePropertyIdentifier(){return this._parseIdent()}_parseCharset(){if(!this.peek(p.Charset))return null;const e=this.create(W);return this.consumeToken(),this.accept(p.String)?this.accept(p.SemiColon)?this.finish(e):this.finish(e,S.SemiColonExpected):this.finish(e,S.IdentifierExpected)}_parseImport(){if(!this.peekKeyword("@import"))return null;const e=this.create(Li);return this.consumeToken(),!e.addChild(this._parseURILiteral())&&!e.addChild(this._parseStringLiteral())?this.finish(e,S.URIOrStringExpected):this._completeParseImport(e)}_completeParseImport(e){if(this.acceptIdent("layer")&&this.accept(p.ParenthesisL)){if(!e.addChild(this._parseLayerName()))return this.finish(e,S.IdentifierExpected,[p.SemiColon]);if(!this.accept(p.ParenthesisR))return this.finish(e,S.RightParenthesisExpected,[p.ParenthesisR],[])}return this.acceptIdent("supports")&&this.accept(p.ParenthesisL)&&(e.addChild(this._tryToParseDeclaration()||this._parseSupportsCondition()),!this.accept(p.ParenthesisR))?this.finish(e,S.RightParenthesisExpected,[p.ParenthesisR],[]):(!this.peek(p.SemiColon)&&!this.peek(p.EOF)&&e.setMedialist(this._parseMediaQueryList()),this.finish(e))}_parseNamespace(){if(!this.peekKeyword("@namespace"))return null;const e=this.create(Fp);return this.consumeToken(),!e.addChild(this._parseURILiteral())&&(e.addChild(this._parseIdent()),!e.addChild(this._parseURILiteral())&&!e.addChild(this._parseStringLiteral()))?this.finish(e,S.URIExpected,[p.SemiColon]):this.accept(p.SemiColon)?this.finish(e):this.finish(e,S.SemiColonExpected)}_parseFontFace(){if(!this.peekKeyword("@font-face"))return null;const e=this.create(ol);return this.consumeToken(),this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_parseViewPort(){if(!this.peekKeyword("@-ms-viewport")&&!this.peekKeyword("@-o-viewport")&&!this.peekKeyword("@viewport"))return null;const e=this.create(Sp);return this.consumeToken(),this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_parseKeyframe(){if(!this.peekRegExp(p.AtKeyword,this.keyframeRegex))return null;const e=this.create(cl),n=this.create(W);return this.consumeToken(),e.setKeyword(this.finish(n)),n.matches("@-ms-keyframes")&&this.markError(n,S.UnknownKeyword),e.setIdentifier(this._parseKeyframeIdent())?this._parseBody(e,this._parseKeyframeSelector.bind(this)):this.finish(e,S.IdentifierExpected,[p.CurlyR])}_parseKeyframeIdent(){return this._parseIdent([Q.Keyframe])}_parseKeyframeSelector(){const e=this.create(hl);let n=!1;if(e.addChild(this._parseIdent())&&(n=!0),this.accept(p.Percentage)&&(n=!0),!n)return null;for(;this.accept(p.Comma);)if(n=!1,e.addChild(this._parseIdent())&&(n=!0),this.accept(p.Percentage)&&(n=!0),!n)return this.finish(e,S.PercentageExpected);return this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_tryParseKeyframeSelector(){const e=this.create(hl),n=this.mark();let r=!1;if(e.addChild(this._parseIdent())&&(r=!0),this.accept(p.Percentage)&&(r=!0),!r)return null;for(;this.accept(p.Comma);)if(r=!1,e.addChild(this._parseIdent())&&(r=!0),this.accept(p.Percentage)&&(r=!0),!r)return this.restoreAtMark(n),null;return this.peek(p.CurlyL)?this._parseBody(e,this._parseRuleSetDeclaration.bind(this)):(this.restoreAtMark(n),null)}_parsePropertyAtRule(){if(!this.peekKeyword("@property"))return null;const e=this.create(Np);return this.consumeToken(),!this.peekRegExp(p.Ident,/^--/)||!e.setName(this._parseIdent([Q.Property]))?this.finish(e,S.IdentifierExpected):this._parseBody(e,this._parseDeclaration.bind(this))}_parseLayer(e=!1){if(!this.peekKeyword("@layer"))return null;const n=this.create(Rp);this.consumeToken();const r=this._parseLayerNameList();return r&&n.setNames(r),(!r||r.getChildren().length===1)&&this.peek(p.CurlyL)?this._parseBody(n,this._parseLayerDeclaration.bind(this,e)):this.accept(p.SemiColon)?this.finish(n):this.finish(n,S.SemiColonExpected)}_parseLayerDeclaration(e=!1){return e?this._tryParseRuleset(!0)||this._tryToParseDeclaration()||this._parseStylesheetStatement(!0):this._parseStylesheetStatement(!1)}_parseLayerNameList(){const e=this.createNode(v.LayerNameList);if(!e.addChild(this._parseLayerName()))return null;for(;this.accept(p.Comma);)if(!e.addChild(this._parseLayerName()))return this.finish(e,S.IdentifierExpected);return this.finish(e)}_parseLayerName(){const e=this.createNode(v.LayerName);if(!e.addChild(this._parseIdent()))return null;for(;!this.hasWhitespace()&&this.acceptDelim(".");)if(this.hasWhitespace()||!e.addChild(this._parseIdent()))return this.finish(e,S.IdentifierExpected);return this.finish(e)}_parseSupports(e=!1){if(!this.peekKeyword("@supports"))return null;const n=this.create(Mi);return this.consumeToken(),n.addChild(this._parseSupportsCondition()),this._parseBody(n,this._parseSupportsDeclaration.bind(this,e))}_parseSupportsDeclaration(e=!1){return e?this._tryParseRuleset(!0)||this._tryToParseDeclaration()||this._parseStylesheetStatement(!0):this._parseStylesheetStatement(!1)}_parseSupportsCondition(){const e=this.create(Rn);if(this.acceptIdent("not"))e.addChild(this._parseSupportsConditionInParens());else if(e.addChild(this._parseSupportsConditionInParens()),this.peekRegExp(p.Ident,/^(and|or)$/i)){const n=this.token.text.toLowerCase();for(;this.acceptIdent(n);)e.addChild(this._parseSupportsConditionInParens())}return this.finish(e)}_parseSupportsConditionInParens(){const e=this.create(Rn);if(this.accept(p.ParenthesisL))return this.prevToken&&(e.lParent=this.prevToken.offset),!e.addChild(this._tryToParseDeclaration([p.ParenthesisR]))&&!this._parseSupportsCondition()?this.finish(e,S.ConditionExpected):this.accept(p.ParenthesisR)?(this.prevToken&&(e.rParent=this.prevToken.offset),this.finish(e)):this.finish(e,S.RightParenthesisExpected,[p.ParenthesisR],[]);if(this.peek(p.Ident)){const n=this.mark();if(this.consumeToken(),!this.hasWhitespace()&&this.accept(p.ParenthesisL)){let r=1;for(;this.token.type!==p.EOF&&r!==0;)this.token.type===p.ParenthesisL?r++:this.token.type===p.ParenthesisR&&r--,this.consumeToken();return this.finish(e)}else this.restoreAtMark(n)}return this.finish(e,S.LeftParenthesisExpected,[],[p.ParenthesisL])}_parseMediaDeclaration(e=!1){return e?this._tryParseRuleset(!0)||this._tryToParseDeclaration()||this._parseStylesheetStatement(!0):this._parseStylesheetStatement(!1)}_parseMedia(e=!1){if(!this.peekKeyword("@media"))return null;const n=this.create(Ai);return this.consumeToken(),n.addChild(this._parseMediaQueryList())?this._parseBody(n,this._parseMediaDeclaration.bind(this,e)):this.finish(n,S.MediaQueryExpected)}_parseMediaQueryList(){const e=this.create(dl);if(!e.addChild(this._parseMediaQuery()))return this.finish(e,S.MediaQueryExpected);for(;this.accept(p.Comma);)if(!e.addChild(this._parseMediaQuery()))return this.finish(e,S.MediaQueryExpected);return this.finish(e)}_parseMediaQuery(){const e=this.create(ul),n=this.mark();if(this.acceptIdent("not"),this.peek(p.ParenthesisL))this.restoreAtMark(n),e.addChild(this._parseMediaCondition());else{if(this.acceptIdent("only"),!e.addChild(this._parseIdent()))return null;this.acceptIdent("and")&&e.addChild(this._parseMediaCondition())}return this.finish(e)}_parseRatio(){const e=this.mark(),n=this.create(Op);return this._parseNumeric()?this.acceptDelim("/")?this._parseNumeric()?this.finish(n):this.finish(n,S.NumberExpected):(this.restoreAtMark(e),null):null}_parseMediaCondition(){const e=this.create(Lp);this.acceptIdent("not");let n=!0;for(;n;){if(!this.accept(p.ParenthesisL))return this.finish(e,S.LeftParenthesisExpected,[],[p.CurlyL]);if(this.peek(p.ParenthesisL)||this.peekIdent("not")?e.addChild(this._parseMediaCondition()):e.addChild(this._parseMediaFeature()),!this.accept(p.ParenthesisR))return this.finish(e,S.RightParenthesisExpected,[],[p.CurlyL]);n=this.acceptIdent("and")||this.acceptIdent("or")}return this.finish(e)}_parseMediaFeature(){const e=[p.ParenthesisR],n=this.create(Ap);if(n.addChild(this._parseMediaFeatureName())){if(this.accept(p.Colon)){if(!n.addChild(this._parseMediaFeatureValue()))return this.finish(n,S.TermExpected,[],e)}else if(this._parseMediaFeatureRangeOperator()){if(!n.addChild(this._parseMediaFeatureValue()))return this.finish(n,S.TermExpected,[],e);if(this._parseMediaFeatureRangeOperator()&&!n.addChild(this._parseMediaFeatureValue()))return this.finish(n,S.TermExpected,[],e)}}else if(n.addChild(this._parseMediaFeatureValue())){if(!this._parseMediaFeatureRangeOperator())return this.finish(n,S.OperatorExpected,[],e);if(!n.addChild(this._parseMediaFeatureName()))return this.finish(n,S.IdentifierExpected,[],e);if(this._parseMediaFeatureRangeOperator()&&!n.addChild(this._parseMediaFeatureValue()))return this.finish(n,S.TermExpected,[],e)}else return this.finish(n,S.IdentifierExpected,[],e);return this.finish(n)}_parseMediaFeatureRangeOperator(){return this.acceptDelim("<")||this.acceptDelim(">")?(this.hasWhitespace()||this.acceptDelim("="),!0):!!this.acceptDelim("=")}_parseMediaFeatureName(){return this._parseIdent()}_parseMediaFeatureValue(){return this._parseRatio()||this._parseTermExpression()}_parseMedium(){const e=this.create(W);return e.addChild(this._parseIdent())?this.finish(e):null}_parsePageDeclaration(){return this._parsePageMarginBox()||this._parseRuleSetDeclaration()}_parsePage(){if(!this.peekKeyword("@page"))return null;const e=this.create(Mp);if(this.consumeToken(),e.addChild(this._parsePageSelector())){for(;this.accept(p.Comma);)if(!e.addChild(this._parsePageSelector()))return this.finish(e,S.IdentifierExpected)}return this._parseBody(e,this._parsePageDeclaration.bind(this))}_parsePageMarginBox(){if(!this.peek(p.AtKeyword))return null;const e=this.create(zp);return this.acceptOneKeyword(mm)||this.markError(e,S.UnknownAtRule,[],[p.CurlyL]),this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_parsePageSelector(){if(!this.peek(p.Ident)&&!this.peek(p.Colon))return null;const e=this.create(W);return e.addChild(this._parseIdent()),this.accept(p.Colon)&&!e.addChild(this._parseIdent())?this.finish(e,S.IdentifierExpected):this.finish(e)}_parseDocument(){if(!this.peekKeyword("@-moz-document"))return null;const e=this.create(Ip);return this.consumeToken(),this.resync([],[p.CurlyL]),this._parseBody(e,this._parseStylesheetStatement.bind(this))}_parseContainerDeclaration(e=!1){return e?this._tryParseRuleset(!0)||this._tryToParseDeclaration()||this._parseStylesheetStatement(!0):this._parseStylesheetStatement(!1)}_parseContainer(e=!1){if(!this.peekKeyword("@container"))return null;const n=this.create(Dp);return this.consumeToken(),n.addChild(this._parseIdent()),n.addChild(this._parseContainerQuery()),this._parseBody(n,this._parseContainerDeclaration.bind(this,e))}_parseContainerQuery(){const e=this.create(W);if(this.acceptIdent("not"))e.addChild(this._parseContainerQueryInParens());else if(e.addChild(this._parseContainerQueryInParens()),this.peekIdent("and"))for(;this.acceptIdent("and");)e.addChild(this._parseContainerQueryInParens());else if(this.peekIdent("or"))for(;this.acceptIdent("or");)e.addChild(this._parseContainerQueryInParens());return this.finish(e)}_parseContainerQueryInParens(){const e=this.create(W);if(this.accept(p.ParenthesisL)){if(this.peekIdent("not")||this.peek(p.ParenthesisL)?e.addChild(this._parseContainerQuery()):e.addChild(this._parseMediaFeature()),!this.accept(p.ParenthesisR))return this.finish(e,S.RightParenthesisExpected,[],[p.CurlyL])}else if(this.acceptIdent("style")){if(this.hasWhitespace()||!this.accept(p.ParenthesisL))return this.finish(e,S.LeftParenthesisExpected,[],[p.CurlyL]);if(e.addChild(this._parseStyleQuery()),!this.accept(p.ParenthesisR))return this.finish(e,S.RightParenthesisExpected,[],[p.CurlyL])}else return this.finish(e,S.LeftParenthesisExpected,[],[p.CurlyL]);return this.finish(e)}_parseStyleQuery(){const e=this.create(W);if(this.acceptIdent("not"))e.addChild(this._parseStyleInParens());else if(this.peek(p.ParenthesisL)){if(e.addChild(this._parseStyleInParens()),this.peekIdent("and"))for(;this.acceptIdent("and");)e.addChild(this._parseStyleInParens());else if(this.peekIdent("or"))for(;this.acceptIdent("or");)e.addChild(this._parseStyleInParens())}else e.addChild(this._parseDeclaration([p.ParenthesisR]));return this.finish(e)}_parseStyleInParens(){const e=this.create(W);if(this.accept(p.ParenthesisL)){if(e.addChild(this._parseStyleQuery()),!this.accept(p.ParenthesisR))return this.finish(e,S.RightParenthesisExpected,[],[p.CurlyL])}else return this.finish(e,S.LeftParenthesisExpected,[],[p.CurlyL]);return this.finish(e)}_parseUnknownAtRule(){if(!this.peek(p.AtKeyword))return null;const e=this.create(ml);e.addChild(this._parseUnknownAtRuleName());const n=()=>i===0&&s===0&&a===0;let r=0,i=0,s=0,a=0;e:for(;;){switch(this.token.type){case p.SemiColon:if(n())break e;break;case p.EOF:return i>0?this.finish(e,S.RightCurlyExpected):a>0?this.finish(e,S.RightSquareBracketExpected):s>0?this.finish(e,S.RightParenthesisExpected):this.finish(e);case p.CurlyL:r++,i++;break;case p.CurlyR:if(i--,r>0&&i===0){if(this.consumeToken(),a>0)return this.finish(e,S.RightSquareBracketExpected);if(s>0)return this.finish(e,S.RightParenthesisExpected);break e}if(i<0){if(s===0&&a===0)break e;return this.finish(e,S.LeftCurlyExpected)}break;case p.ParenthesisL:s++;break;case p.ParenthesisR:if(s--,s<0)return this.finish(e,S.LeftParenthesisExpected);break;case p.BracketL:a++;break;case p.BracketR:if(a--,a<0)return this.finish(e,S.LeftSquareBracketExpected);break}this.consumeToken()}return e}_parseUnknownAtRuleName(){const e=this.create(W);return this.accept(p.AtKeyword)?this.finish(e):e}_parseOperator(){if(this.peekDelim("/")||this.peekDelim("*")||this.peekDelim("+")||this.peekDelim("-")||this.peek(p.Dashmatch)||this.peek(p.Includes)||this.peek(p.SubstringOperator)||this.peek(p.PrefixOperator)||this.peek(p.SuffixOperator)||this.peekDelim("=")){const e=this.createNode(v.Operator);return this.consumeToken(),this.finish(e)}else return null}_parseUnaryOperator(){if(!this.peekDelim("+")&&!this.peekDelim("-"))return null;const e=this.create(W);return this.consumeToken(),this.finish(e)}_parseCombinator(){if(this.peekDelim(">")){const e=this.create(W);this.consumeToken();const n=this.mark();if(!this.hasWhitespace()&&this.acceptDelim(">")){if(!this.hasWhitespace()&&this.acceptDelim(">"))return e.type=v.SelectorCombinatorShadowPiercingDescendant,this.finish(e);this.restoreAtMark(n)}return e.type=v.SelectorCombinatorParent,this.finish(e)}else if(this.peekDelim("+")){const e=this.create(W);return this.consumeToken(),e.type=v.SelectorCombinatorSibling,this.finish(e)}else if(this.peekDelim("~")){const e=this.create(W);return this.consumeToken(),e.type=v.SelectorCombinatorAllSiblings,this.finish(e)}else if(this.peekDelim("/")){const e=this.create(W);this.consumeToken();const n=this.mark();if(!this.hasWhitespace()&&this.acceptIdent("deep")&&!this.hasWhitespace()&&this.acceptDelim("/"))return e.type=v.SelectorCombinatorShadowPiercingDescendant,this.finish(e);this.restoreAtMark(n)}return null}_parseSimpleSelector(){const e=this.create(Ht);let n=0;for(e.addChild(this._parseElementName()||this._parseNestingSelector())&&n++;(n===0||!this.hasWhitespace())&&e.addChild(this._parseSimpleSelectorBody());)n++;return n>0?this.finish(e):null}_parseNestingSelector(){if(this.peekDelim("&")){const e=this.createNode(v.SelectorCombinator);return this.consumeToken(),this.finish(e)}return null}_parseSimpleSelectorBody(){return this._parsePseudo()||this._parseHash()||this._parseClass()||this._parseAttrib()}_parseSelectorIdent(){return this._parseIdent()}_parseHash(){if(!this.peek(p.Hash)&&!this.peekDelim("#"))return null;const e=this.createNode(v.IdentifierSelector);if(this.acceptDelim("#")){if(this.hasWhitespace()||!e.addChild(this._parseSelectorIdent()))return this.finish(e,S.IdentifierExpected)}else this.consumeToken();return this.finish(e)}_parseClass(){if(!this.peekDelim("."))return null;const e=this.createNode(v.ClassSelector);return this.consumeToken(),this.hasWhitespace()||!e.addChild(this._parseSelectorIdent())?this.finish(e,S.IdentifierExpected):this.finish(e)}_parseElementName(){const e=this.mark(),n=this.createNode(v.ElementNameSelector);return n.addChild(this._parseNamespacePrefix()),!n.addChild(this._parseSelectorIdent())&&!this.acceptDelim("*")?(this.restoreAtMark(e),null):this.finish(n)}_parseNamespacePrefix(){const e=this.mark(),n=this.createNode(v.NamespacePrefix);return!n.addChild(this._parseIdent())&&this.acceptDelim("*"),this.acceptDelim("|")?this.finish(n):(this.restoreAtMark(e),null)}_parseAttrib(){if(!this.peek(p.BracketL))return null;const e=this.create(Tp);return this.consumeToken(),e.setNamespacePrefix(this._parseNamespacePrefix()),e.setIdentifier(this._parseIdent())?(e.setOperator(this._parseOperator())&&(e.setValue(this._parseBinaryExpr()),this.acceptIdent("i"),this.acceptIdent("s")),this.accept(p.BracketR)?this.finish(e):this.finish(e,S.RightSquareBracketExpected)):this.finish(e,S.IdentifierExpected)}_parsePseudo(){const e=this._tryParsePseudoIdentifier();if(e){if(!this.hasWhitespace()&&this.accept(p.ParenthesisL)){const n=()=>{const i=this.create(W);if(!i.addChild(this._parseSelector(!0)))return null;for(;this.accept(p.Comma)&&i.addChild(this._parseSelector(!0)););return this.peek(p.ParenthesisR)?this.finish(i):null};if(!e.addChild(this.try(n))&&e.addChild(this._parseBinaryExpr())&&this.acceptIdent("of")&&!e.addChild(this.try(n)))return this.finish(e,S.SelectorExpected);if(!this.accept(p.ParenthesisR))return this.finish(e,S.RightParenthesisExpected)}return this.finish(e)}return null}_tryParsePseudoIdentifier(){if(!this.peek(p.Colon))return null;const e=this.mark(),n=this.createNode(v.PseudoSelector);return this.consumeToken(),this.hasWhitespace()?(this.restoreAtMark(e),null):(this.accept(p.Colon),this.hasWhitespace()||!n.addChild(this._parseIdent())?this.finish(n,S.IdentifierExpected):this.finish(n))}_tryParsePrio(){const e=this.mark(),n=this._parsePrio();return n||(this.restoreAtMark(e),null)}_parsePrio(){if(!this.peek(p.Exclamation))return null;const e=this.createNode(v.Prio);return this.accept(p.Exclamation)&&this.acceptIdent("important")?this.finish(e):null}_parseExpr(e=!1){const n=this.create(pl);if(!n.addChild(this._parseBinaryExpr()))return null;for(;;){if(this.peek(p.Comma)){if(e)return this.finish(n);this.consumeToken()}if(!n.addChild(this._parseBinaryExpr()))break}return this.finish(n)}_parseUnicodeRange(){if(!this.peekIdent("u"))return null;const e=this.create(up);return this.acceptUnicodeRange()?this.finish(e):null}_parseNamedLine(){if(!this.peek(p.BracketL))return null;const e=this.createNode(v.GridLine);for(this.consumeToken();e.addChild(this._parseIdent()););return this.accept(p.BracketR)?this.finish(e):this.finish(e,S.RightSquareBracketExpected)}_parseBinaryExpr(e,n){let r=this.create(zi);if(!r.setLeft(e||this._parseTerm()))return null;if(!r.setOperator(n||this._parseOperator()))return this.finish(r);if(!r.setRight(this._parseTerm()))return this.finish(r,S.TermExpected);r=this.finish(r);const i=this._parseOperator();return i&&(r=this._parseBinaryExpr(r,i)),this.finish(r)}_parseTerm(){let e=this.create(Pp);return e.setOperator(this._parseUnaryOperator()),e.setExpression(this._parseTermExpression())?this.finish(e):null}_parseTermExpression(){return this._parseURILiteral()||this._parseUnicodeRange()||this._parseFunction()||this._parseIdent()||this._parseStringLiteral()||this._parseNumeric()||this._parseHexColor()||this._parseOperation()||this._parseNamedLine()}_parseOperation(){if(!this.peek(p.ParenthesisL))return null;const e=this.create(W);return this.consumeToken(),e.addChild(this._parseExpr()),this.accept(p.ParenthesisR)?this.finish(e):this.finish(e,S.RightParenthesisExpected)}_parseNumeric(){if(this.peek(p.Num)||this.peek(p.Percentage)||this.peek(p.Resolution)||this.peek(p.Length)||this.peek(p.EMS)||this.peek(p.EXS)||this.peek(p.Angle)||this.peek(p.Time)||this.peek(p.Dimension)||this.peek(p.ContainerQueryLength)||this.peek(p.Freq)){const e=this.create(Ti);return this.consumeToken(),this.finish(e)}return null}_parseStringLiteral(){if(!this.peek(p.String)&&!this.peek(p.BadString))return null;const e=this.createNode(v.StringLiteral);return this.consumeToken(),this.finish(e)}_parseURILiteral(){if(!this.peekRegExp(p.Ident,/^url(-prefix)?$/i))return null;const e=this.mark(),n=this.createNode(v.URILiteral);return this.accept(p.Ident),this.hasWhitespace()||!this.peek(p.ParenthesisL)?(this.restoreAtMark(e),null):(this.scanner.inURL=!0,this.consumeToken(),n.addChild(this._parseURLArgument()),this.scanner.inURL=!1,this.accept(p.ParenthesisR)?this.finish(n):this.finish(n,S.RightParenthesisExpected))}_parseURLArgument(){const e=this.create(W);return!this.accept(p.String)&&!this.accept(p.BadString)&&!this.acceptUnquotedString()?null:this.finish(e)}_parseIdent(e){if(!this.peek(p.Ident))return null;const n=this.create(ze);return e&&(n.referenceTypes=e),n.isCustomProperty=this.peekRegExp(p.Ident,/^--/),this.consumeToken(),this.finish(n)}_parseFunction(){const e=this.mark(),n=this.create(Fn);if(!n.setIdentifier(this._parseFunctionIdentifier()))return null;if(this.hasWhitespace()||!this.accept(p.ParenthesisL))return this.restoreAtMark(e),null;if(n.getArguments().addChild(this._parseFunctionArgument()))for(;this.accept(p.Comma)&&!this.peek(p.ParenthesisR);)n.getArguments().addChild(this._parseFunctionArgument())||this.markError(n,S.ExpressionExpected);return this.accept(p.ParenthesisR)?this.finish(n):this.finish(n,S.RightParenthesisExpected)}_parseFunctionIdentifier(){if(!this.peek(p.Ident))return null;const e=this.create(ze);if(e.referenceTypes=[Q.Function],this.acceptIdent("progid")){if(this.accept(p.Colon))for(;this.accept(p.Ident)&&this.acceptDelim("."););return this.finish(e)}return this.consumeToken(),this.finish(e)}_parseFunctionArgument(){const e=this.create(Gt);return e.setValue(this._parseExpr(!0))?this.finish(e):null}_parseHexColor(){if(this.peekRegExp(p.Hash,/^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/g)){const e=this.create(Pi);return this.consumeToken(),this.finish(e)}else return null}}function fm(t,e){let n=0,r=t.length;if(r===0)return 0;for(;ne+n||this.offset===e&&this.length===n?this.findInScope(e,n):null}findInScope(e,n=0){const r=e+n,i=fm(this.children,a=>a.offset>r);if(i===0)return this;const s=this.children[i-1];return s.offset<=e&&s.offset+s.length>=e+n?s.findInScope(e,n):this}addSymbol(e){this.symbols.push(e)}getSymbol(e,n){for(let r=0;r{var t={470:i=>{function s(l){if(typeof l!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(l))}function a(l,c){for(var d,u="",m=0,f=-1,g=0,b=0;b<=l.length;++b){if(b2){var k=u.lastIndexOf("/");if(k!==u.length-1){k===-1?(u="",m=0):m=(u=u.slice(0,k)).length-1-u.lastIndexOf("/"),f=b,g=0;continue}}else if(u.length===2||u.length===1){u="",m=0,f=b,g=0;continue}}c&&(u.length>0?u+="/..":u="..",m=2)}else u.length>0?u+="/"+l.slice(f+1,b):u=l.slice(f+1,b),m=b-f-1;f=b,g=0}else d===46&&g!==-1?++g:g=-1}return u}var o={resolve:function(){for(var l,c="",d=!1,u=arguments.length-1;u>=-1&&!d;u--){var m;u>=0?m=arguments[u]:(l===void 0&&(l=process.cwd()),m=l),s(m),m.length!==0&&(c=m+"/"+c,d=m.charCodeAt(0)===47)}return c=a(c,!d),d?c.length>0?"/"+c:"/":c.length>0?c:"."},normalize:function(l){if(s(l),l.length===0)return".";var c=l.charCodeAt(0)===47,d=l.charCodeAt(l.length-1)===47;return(l=a(l,!c)).length!==0||c||(l="."),l.length>0&&d&&(l+="/"),c?"/"+l:l},isAbsolute:function(l){return s(l),l.length>0&&l.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var l,c=0;c0&&(l===void 0?l=d:l+="/"+d)}return l===void 0?".":o.normalize(l)},relative:function(l,c){if(s(l),s(c),l===c||(l=o.resolve(l))===(c=o.resolve(c)))return"";for(var d=1;db){if(c.charCodeAt(f+F)===47)return c.slice(f+F+1);if(F===0)return c.slice(f+F)}else m>b&&(l.charCodeAt(d+F)===47?k=F:F===0&&(k=0));break}var N=l.charCodeAt(d+F);if(N!==c.charCodeAt(f+F))break;N===47&&(k=F)}var _="";for(F=d+k+1;F<=u;++F)F!==u&&l.charCodeAt(F)!==47||(_.length===0?_+="..":_+="/..");return _.length>0?_+c.slice(f+k):(f+=k,c.charCodeAt(f)===47&&++f,c.slice(f))},_makeLong:function(l){return l},dirname:function(l){if(s(l),l.length===0)return".";for(var c=l.charCodeAt(0),d=c===47,u=-1,m=!0,f=l.length-1;f>=1;--f)if((c=l.charCodeAt(f))===47){if(!m){u=f;break}}else m=!1;return u===-1?d?"/":".":d&&u===1?"//":l.slice(0,u)},basename:function(l,c){if(c!==void 0&&typeof c!="string")throw new TypeError('"ext" argument must be a string');s(l);var d,u=0,m=-1,f=!0;if(c!==void 0&&c.length>0&&c.length<=l.length){if(c.length===l.length&&c===l)return"";var g=c.length-1,b=-1;for(d=l.length-1;d>=0;--d){var k=l.charCodeAt(d);if(k===47){if(!f){u=d+1;break}}else b===-1&&(f=!1,b=d+1),g>=0&&(k===c.charCodeAt(g)?--g==-1&&(m=d):(g=-1,m=b))}return u===m?m=b:m===-1&&(m=l.length),l.slice(u,m)}for(d=l.length-1;d>=0;--d)if(l.charCodeAt(d)===47){if(!f){u=d+1;break}}else m===-1&&(f=!1,m=d+1);return m===-1?"":l.slice(u,m)},extname:function(l){s(l);for(var c=-1,d=0,u=-1,m=!0,f=0,g=l.length-1;g>=0;--g){var b=l.charCodeAt(g);if(b!==47)u===-1&&(m=!1,u=g+1),b===46?c===-1?c=g:f!==1&&(f=1):c!==-1&&(f=-1);else if(!m){d=g+1;break}}return c===-1||u===-1||f===0||f===1&&c===u-1&&c===d+1?"":l.slice(c,u)},format:function(l){if(l===null||typeof l!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof l);return(function(c,d){var u=d.dir||d.root,m=d.base||(d.name||"")+(d.ext||"");return u?u===d.root?u+m:u+"/"+m:m})(0,l)},parse:function(l){s(l);var c={root:"",dir:"",base:"",ext:"",name:""};if(l.length===0)return c;var d,u=l.charCodeAt(0),m=u===47;m?(c.root="/",d=1):d=0;for(var f=-1,g=0,b=-1,k=!0,F=l.length-1,N=0;F>=d;--F)if((u=l.charCodeAt(F))!==47)b===-1&&(k=!1,b=F+1),u===46?f===-1?f=F:N!==1&&(N=1):f!==-1&&(N=-1);else if(!k){g=F+1;break}return f===-1||b===-1||N===0||N===1&&f===b-1&&f===g+1?b!==-1&&(c.base=c.name=g===0&&m?l.slice(1,b):l.slice(g,b)):(g===0&&m?(c.name=l.slice(1,f),c.base=l.slice(1,b)):(c.name=l.slice(g,f),c.base=l.slice(g,b)),c.ext=l.slice(f,b)),g>0?c.dir=l.slice(0,g-1):m&&(c.dir="/"),c},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,i.exports=o}},e={};function n(i){var s=e[i];if(s!==void 0)return s.exports;var a=e[i]={exports:{}};return t[i](a,a.exports,n),a.exports}n.d=(i,s)=>{for(var a in s)n.o(s,a)&&!n.o(i,a)&&Object.defineProperty(i,a,{enumerable:!0,get:s[a]})},n.o=(i,s)=>Object.prototype.hasOwnProperty.call(i,s),n.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var r={};(()=>{let i;n.r(r),n.d(r,{URI:()=>m,Utils:()=>$}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,a=/^\//,o=/^\/\//;function l(L,y){if(!L.scheme&&y)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${L.authority}", path: "${L.path}", query: "${L.query}", fragment: "${L.fragment}"}`);if(L.scheme&&!s.test(L.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(L.path){if(L.authority){if(!a.test(L.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(L.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const c="",d="/",u=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class m{static isUri(y){return y instanceof m||!!y&&typeof y.authority=="string"&&typeof y.fragment=="string"&&typeof y.path=="string"&&typeof y.query=="string"&&typeof y.scheme=="string"&&typeof y.fsPath=="string"&&typeof y.with=="function"&&typeof y.toString=="function"}scheme;authority;path;query;fragment;constructor(y,E,D,A,M,P=!1){typeof y=="object"?(this.scheme=y.scheme||c,this.authority=y.authority||c,this.path=y.path||c,this.query=y.query||c,this.fragment=y.fragment||c):(this.scheme=(function(H,ee){return H||ee?H:"file"})(y,P),this.authority=E||c,this.path=(function(H,ee){switch(H){case"https":case"http":case"file":ee?ee[0]!==d&&(ee=d+ee):ee=d}return ee})(this.scheme,D||c),this.query=A||c,this.fragment=M||c,l(this,P))}get fsPath(){return N(this)}with(y){if(!y)return this;let{scheme:E,authority:D,path:A,query:M,fragment:P}=y;return E===void 0?E=this.scheme:E===null&&(E=c),D===void 0?D=this.authority:D===null&&(D=c),A===void 0?A=this.path:A===null&&(A=c),M===void 0?M=this.query:M===null&&(M=c),P===void 0?P=this.fragment:P===null&&(P=c),E===this.scheme&&D===this.authority&&A===this.path&&M===this.query&&P===this.fragment?this:new g(E,D,A,M,P)}static parse(y,E=!1){const D=u.exec(y);return D?new g(D[2]||c,V(D[4]||c),V(D[5]||c),V(D[7]||c),V(D[9]||c),E):new g(c,c,c,c,c)}static file(y){let E=c;if(i&&(y=y.replace(/\\/g,d)),y[0]===d&&y[1]===d){const D=y.indexOf(d,2);D===-1?(E=y.substring(2),y=d):(E=y.substring(2,D),y=y.substring(D)||d)}return new g("file",E,y,c,c)}static from(y){const E=new g(y.scheme,y.authority,y.path,y.query,y.fragment);return l(E,!0),E}toString(y=!1){return _(this,y)}toJSON(){return this}static revive(y){if(y){if(y instanceof m)return y;{const E=new g(y);return E._formatted=y.external,E._fsPath=y._sep===f?y.fsPath:null,E}}return y}}const f=i?1:void 0;class g extends m{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=N(this)),this._fsPath}toString(y=!1){return y?_(this,!0):(this._formatted||(this._formatted=_(this,!1)),this._formatted)}toJSON(){const y={$mid:1};return this._fsPath&&(y.fsPath=this._fsPath,y._sep=f),this._formatted&&(y.external=this._formatted),this.path&&(y.path=this.path),this.scheme&&(y.scheme=this.scheme),this.authority&&(y.authority=this.authority),this.query&&(y.query=this.query),this.fragment&&(y.fragment=this.fragment),y}}const b={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function k(L,y,E){let D,A=-1;for(let M=0;M=97&&P<=122||P>=65&&P<=90||P>=48&&P<=57||P===45||P===46||P===95||P===126||y&&P===47||E&&P===91||E&&P===93||E&&P===58)A!==-1&&(D+=encodeURIComponent(L.substring(A,M)),A=-1),D!==void 0&&(D+=L.charAt(M));else{D===void 0&&(D=L.substr(0,M));const H=b[P];H!==void 0?(A!==-1&&(D+=encodeURIComponent(L.substring(A,M)),A=-1),D+=H):A===-1&&(A=M)}}return A!==-1&&(D+=encodeURIComponent(L.substring(A))),D!==void 0?D:L}function F(L){let y;for(let E=0;E1&&L.scheme==="file"?`//${L.authority}${L.path}`:L.path.charCodeAt(0)===47&&(L.path.charCodeAt(1)>=65&&L.path.charCodeAt(1)<=90||L.path.charCodeAt(1)>=97&&L.path.charCodeAt(1)<=122)&&L.path.charCodeAt(2)===58?L.path[1].toLowerCase()+L.path.substr(2):L.path,i&&(E=E.replace(/\//g,"\\")),E}function _(L,y){const E=y?F:k;let D="",{scheme:A,authority:M,path:P,query:H,fragment:ee}=L;if(A&&(D+=A,D+=":"),(M||A==="file")&&(D+=d,D+=d),M){let G=M.indexOf("@");if(G!==-1){const xe=M.substr(0,G);M=M.substr(G+1),G=xe.lastIndexOf(":"),G===-1?D+=E(xe,!1,!1):(D+=E(xe.substr(0,G),!1,!1),D+=":",D+=E(xe.substr(G+1),!1,!0)),D+="@"}M=M.toLowerCase(),G=M.lastIndexOf(":"),G===-1?D+=E(M,!1,!0):(D+=E(M.substr(0,G),!1,!0),D+=M.substr(G))}if(P){if(P.length>=3&&P.charCodeAt(0)===47&&P.charCodeAt(2)===58){const G=P.charCodeAt(1);G>=65&&G<=90&&(P=`/${String.fromCharCode(G+32)}:${P.substr(3)}`)}else if(P.length>=2&&P.charCodeAt(1)===58){const G=P.charCodeAt(0);G>=65&&G<=90&&(P=`${String.fromCharCode(G+32)}:${P.substr(2)}`)}D+=E(P,!0,!1)}return H&&(D+="?",D+=E(H,!1,!1)),ee&&(D+="#",D+=y?ee:k(ee,!1,!1)),D}function T(L){try{return decodeURIComponent(L)}catch{return L.length>3?L.substr(0,3)+T(L.substr(3)):L}}const O=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function V(L){return L.match(O)?L.replace(O,(y=>T(y))):L}var I=n(470);const R=I.posix||I,z="/";var $;(function(L){L.joinPath=function(y,...E){return y.with({path:R.join(y.path,...E)})},L.resolvePath=function(y,...E){let D=y.path,A=!1;D[0]!==z&&(D=z+D,A=!0);let M=R.resolve(D,...E);return A&&M[0]===z&&!y.authority&&(M=M.substring(1)),y.with({path:M})},L.dirname=function(y){if(y.path.length===0||y.path===z)return y;let E=R.dirname(y.path);return E.length===1&&E.charCodeAt(0)===46&&(E=""),y.with({path:E})},L.basename=function(y){return R.basename(y.path)},L.extname=function(y){return R.extname(y.path)}})($||($={}))})(),Ac=r})();const{URI:ss,Utils:gt}=Ac;function as(t){return gt.dirname(ss.parse(t)).toString(!0)}function Yt(t,...e){return gt.joinPath(ss.parse(t),...e).toString(!0)}class wm{constructor(e){this.readDirectory=e,this.literalCompletions=[],this.importCompletions=[]}onCssURILiteralValue(e){this.literalCompletions.push(e)}onCssImportPath(e){this.importCompletions.push(e)}async computeCompletions(e,n){const r={items:[],isIncomplete:!1};for(const i of this.literalCompletions){const s=i.uriValue,a=os(s);if(a==="."||a==="..")r.isIncomplete=!0;else{const o=await this.providePathSuggestions(s,i.position,i.range,e,n);for(let l of o)r.items.push(l)}}for(const i of this.importCompletions){const s=i.pathValue,a=os(s);if(a==="."||a==="..")r.isIncomplete=!0;else{let o=await this.providePathSuggestions(s,i.position,i.range,e,n);e.languageId==="scss"&&o.forEach(l=>{pe(l.label,"_")&&il(l.label,".scss")&&(l.textEdit?l.textEdit.newText=l.label.slice(1,-5):l.label=l.label.slice(1,-5))});for(let l of o)r.items.push(l)}}return r}async providePathSuggestions(e,n,r,i,s){const a=os(e),o=pe(e,"'")||pe(e,'"'),l=o?a.slice(0,n.character-(r.start.character+1)):a.slice(0,n.character-r.start.character),c=i.uri,d=o?Sm(r,1,-1):r,u=ym(l,a,d),m=l.substring(0,l.lastIndexOf("/")+1);let f=s.resolveReference(m||".",c);if(f)try{const g=[],b=await this.readDirectory(f);for(const[k,F]of b)k.charCodeAt(0)!==vm&&(F===Mn.Directory||Yt(f,k)!==c)&&g.push(xm(k,F===Mn.Directory,u));return g}catch{}return[]}}const vm=46;function os(t){return pe(t,"'")||pe(t,'"')?t.slice(1,-1):t}function ym(t,e,n){let r;const i=t.lastIndexOf("/");if(i===-1)r=n;else{const s=e.slice(i+1),a=Fr(n.end,-s.length),o=s.indexOf(" ");let l;o!==-1?l=Fr(a,o):l=n.end,r=K.create(a,l)}return r}function xm(t,e,n){return e?(t=t+"/",{label:Er(t),kind:q.Folder,textEdit:j.replace(n,Er(t)),command:{title:"Suggest",command:"editor.action.triggerSuggest"}}):{label:Er(t),kind:q.File,textEdit:j.replace(n,Er(t))}}function Er(t){return t.replace(/(\s|\(|\)|,|"|')/g,"\\$1")}function Fr(t,e){return ye.create(t.line,t.character+e)}function Sm(t,e,n){const r=Fr(t.start,e),i=Fr(t.end,n);return K.create(r,i)}const nt=Ie.Snippet,Mc={title:"Suggest",command:"editor.action.triggerSuggest"};var Ge;(function(t){t.Enums=" ",t.Normal="d",t.VendorPrefixed="x",t.Term="y",t.Variable="z"})(Ge||(Ge={}));class ls{constructor(e=null,n,r){this.variablePrefix=e,this.lsOptions=n,this.cssDataManager=r,this.completionParticipants=[]}configure(e){this.defaultSettings=e}getSymbolContext(){return this.symbolContext||(this.symbolContext=new is(this.styleSheet)),this.symbolContext}setCompletionParticipants(e){this.completionParticipants=e||[]}async doComplete2(e,n,r,i,s=this.defaultSettings){if(!this.lsOptions.fileSystemProvider||!this.lsOptions.fileSystemProvider.readDirectory)return this.doComplete(e,n,r,s);const a=new wm(this.lsOptions.fileSystemProvider.readDirectory),o=this.completionParticipants;this.completionParticipants=[a].concat(o);const l=this.doComplete(e,n,r,s);try{const c=await a.computeCompletions(e,i);return{isIncomplete:l.isIncomplete||c.isIncomplete,itemDefaults:l.itemDefaults,items:c.items.concat(l.items)}}finally{this.completionParticipants=o}}doComplete(e,n,r,i){this.offset=e.offsetAt(n),this.position=n,this.currentWord=Em(e,this.offset),this.defaultReplaceRange=K.create(ye.create(this.position.line,this.position.character-this.currentWord.length),this.position),this.textDocument=e,this.styleSheet=r,this.documentSettings=i;try{const s={isIncomplete:!1,itemDefaults:{editRange:{start:{line:n.line,character:n.character-this.currentWord.length},end:n}},items:[]};this.nodePath=Ri(this.styleSheet,this.offset);for(let a=this.nodePath.length-1;a>=0;a--){const o=this.nodePath[a];if(o instanceof Di)this.getCompletionsForDeclarationProperty(o.getParent(),s);else if(o instanceof pl)o.parent instanceof Oi?this.getVariableProposals(null,s):this.getCompletionsForExpression(o,s);else if(o instanceof Ht){const l=o.findAParent(v.ExtendsReference,v.Ruleset);if(l)if(l.type===v.ExtendsReference)this.getCompletionsForExtendsReference(l,o,s);else{const c=l;this.getCompletionsForSelector(c,c&&c.isNested(),s)}}else if(o instanceof Gt)this.getCompletionsForFunctionArgument(o,o.getParent(),s);else if(o instanceof Ni)this.getCompletionsForDeclarations(o,s);else if(o instanceof hr)this.getCompletionsForVariableDeclaration(o,s);else if(o instanceof Ct)this.getCompletionsForRuleSet(o,s);else if(o instanceof Oi)this.getCompletionsForInterpolation(o,s);else if(o instanceof cr)this.getCompletionsForFunctionDeclaration(o,s);else if(o instanceof dr)this.getCompletionsForMixinReference(o,s);else if(o instanceof Fn)this.getCompletionsForFunctionArgument(null,o,s);else if(o instanceof Mi)this.getCompletionsForSupports(o,s);else if(o instanceof Rn)this.getCompletionsForSupportsCondition(o,s);else if(o instanceof Nn)this.getCompletionsForExtendsReference(o,null,s);else if(o.type===v.URILiteral)this.getCompletionForUriLiteralValue(o,s);else if(o.parent===null)this.getCompletionForTopLevel(s);else if(o.type===v.StringLiteral&&this.isImportPathParent(o.parent.type))this.getCompletionForImportPath(o,s);else continue;if(s.items.length>0||this.offset>o.offset)return this.finalize(s)}return this.getCompletionsForStylesheet(s),s.items.length===0&&this.variablePrefix&&this.currentWord.indexOf(this.variablePrefix)===0&&this.getVariableProposals(null,s),this.finalize(s)}finally{this.position=null,this.currentWord=null,this.textDocument=null,this.styleSheet=null,this.symbolContext=null,this.defaultReplaceRange=null,this.nodePath=null}}isImportPathParent(e){return e===v.Import}finalize(e){return e}findInNodePath(...e){for(let n=this.nodePath.length-1;n>=0;n--){const r=this.nodePath[n];if(e.indexOf(r.type)!==-1)return r}return null}getCompletionsForDeclarationProperty(e,n){return this.getPropertyProposals(e,n)}getPropertyProposals(e,n){const r=this.isTriggerPropertyValueCompletionEnabled,i=this.isCompletePropertyWithSemicolonEnabled;return this.cssDataManager.getProperties().forEach(a=>{let o,l,c=!1;e?(o=this.getCompletionRange(e.getProperty()),l=a.name,Te(e.colonPosition)||(l+=": ",c=!0)):(o=this.getCompletionRange(null),l=a.name+": ",c=!0),!e&&i&&(l+="$0;"),e&&!e.semicolonPosition&&i&&this.offset>=this.textDocument.offsetAt(o.end)&&(l+="$0;");const d={label:a.name,documentation:mt(a,this.doesSupportMarkdown()),tags:zn(a)?[_t.Deprecated]:[],textEdit:j.replace(o,l),insertTextFormat:Ie.Snippet,kind:q.Property};a.restrictions||(c=!1),r&&c&&(d.command=Mc);const m=(255-(typeof a.relevance=="number"?Math.min(Math.max(a.relevance,0),99):50)).toString(16),f=pe(a.name,"-")?Ge.VendorPrefixed:Ge.Normal;d.sortText=f+"_"+m,n.items.push(d)}),this.completionParticipants.forEach(a=>{a.onCssProperty&&a.onCssProperty({propertyName:this.currentWord,range:this.defaultReplaceRange})}),n}get isTriggerPropertyValueCompletionEnabled(){return this.documentSettings?.triggerPropertyValueCompletion??!0}get isCompletePropertyWithSemicolonEnabled(){return this.documentSettings?.completePropertyWithSemicolon??!0}getCompletionsForDeclarationValue(e,n){const r=e.getFullPropertyName(),i=this.cssDataManager.getProperty(r);let s=e.getValue()||null;for(;s&&s.hasChildren();)s=s.findChildAtOffset(this.offset,!1);if(this.completionParticipants.forEach(a=>{a.onCssPropertyValue&&a.onCssPropertyValue({propertyName:r,propertyValue:this.currentWord,range:this.getCompletionRange(s)})}),i){if(i.restrictions)for(const a of i.restrictions)switch(a){case"color":this.getColorProposals(i,s,n);break;case"position":this.getPositionProposals(i,s,n);break;case"repeat":this.getRepeatStyleProposals(i,s,n);break;case"line-style":this.getLineStyleProposals(i,s,n);break;case"line-width":this.getLineWidthProposals(i,s,n);break;case"geometry-box":this.getGeometryBoxProposals(i,s,n);break;case"box":this.getBoxProposals(i,s,n);break;case"image":this.getImageProposals(i,s,n);break;case"timing-function":this.getTimingFunctionProposals(i,s,n);break;case"shape":this.getBasicShapeProposals(i,s,n);break}this.getValueEnumProposals(i,s,n),this.getCSSWideKeywordProposals(i,s,n),this.getUnitProposals(i,s,n)}else{const a=Cm(this.styleSheet,e);for(const o of a.getEntries())n.items.push({label:o,textEdit:j.replace(this.getCompletionRange(s),o),kind:q.Value})}return this.getVariableProposals(s,n),this.getTermProposals(i,s,n),n}getValueEnumProposals(e,n,r){if(e.values)for(const i of e.values){let s=i.name,a;if(il(s,")")){const c=s.lastIndexOf("(");c!==-1&&(s=s.substring(0,c+1)+"$1"+s.substring(c+1),a=nt)}let o=Ge.Enums;pe(i.name,"-")&&(o+=Ge.VendorPrefixed);const l={label:i.name,documentation:mt(i,this.doesSupportMarkdown()),tags:zn(e)?[_t.Deprecated]:[],textEdit:j.replace(this.getCompletionRange(n),s),sortText:o,kind:q.Value,insertTextFormat:a};r.items.push(l)}return r}getCSSWideKeywordProposals(e,n,r){for(const i in _c)r.items.push({label:i,documentation:_c[i],textEdit:j.replace(this.getCompletionRange(n),i),kind:q.Value});for(const i in Ec){const s=Qt(i);r.items.push({label:i,documentation:Ec[i],textEdit:j.replace(this.getCompletionRange(n),s),kind:q.Function,insertTextFormat:nt,command:pe(i,"var")?Mc:void 0})}return r}getCompletionsForInterpolation(e,n){return this.offset>=e.offset+2&&this.getVariableProposals(null,n),n}getVariableProposals(e,n){const r=this.getSymbolContext().findSymbolsAtOffset(this.offset,Q.Variable);for(const i of r){const s=pe(i.name,"--")?`var(${i.name})`:i.name,a={label:i.name,documentation:i.value?sl(i.value):i.value,textEdit:j.replace(this.getCompletionRange(e),s),kind:q.Variable,sortText:Ge.Variable};if(typeof a.documentation=="string"&&fc(a.documentation)&&(a.kind=q.Color),i.node.type===v.FunctionParameter){const o=i.node.getParent();o.type===v.MixinDeclaration&&(a.detail=w("argument from '{0}'",o.getName()))}n.items.push(a)}return n}getVariableProposalsForCSSVarFunction(e){const n=new cs;this.styleSheet.acceptVisitor(new _m(n,this.offset));let r=this.getSymbolContext().findSymbolsAtOffset(this.offset,Q.Variable);for(const i of r){if(pe(i.name,"--")){const s={label:i.name,documentation:i.value?sl(i.value):i.value,textEdit:j.replace(this.getCompletionRange(null),i.name),kind:q.Variable};typeof s.documentation=="string"&&fc(s.documentation)&&(s.kind=q.Color),e.items.push(s)}n.remove(i.name)}for(const i of n.getEntries())if(pe(i,"--")){const s={label:i,textEdit:j.replace(this.getCompletionRange(null),i),kind:q.Variable};e.items.push(s)}return e}getUnitProposals(e,n,r){let i="0";if(this.currentWord.length>0){const s=this.currentWord.match(/^-?\d[\.\d+]*/);s&&(i=s[0],r.isIncomplete=i.length===this.currentWord.length)}else this.currentWord.length===0&&(r.isIncomplete=!0);if(n&&n.parent&&n.parent.type===v.Term&&(n=n.getParent()),e.restrictions)for(const s of e.restrictions){const a=Ic[s];if(a)for(const o of a){const l=i+o;r.items.push({label:l,textEdit:j.replace(this.getCompletionRange(n),l),kind:q.Unit})}}return r}getCompletionRange(e){if(e&&e.offset<=this.offset&&this.offset<=e.end){const n=e.end!==-1?this.textDocument.positionAt(e.end):this.position,r=this.textDocument.positionAt(e.offset);if(r.line===n.line)return K.create(r,n)}return this.defaultReplaceRange}getColorProposals(e,n,r){for(const s in yr)r.items.push({label:s,documentation:yr[s],textEdit:j.replace(this.getCompletionRange(n),s),kind:q.Color});for(const s in rs)r.items.push({label:s,documentation:rs[s],textEdit:j.replace(this.getCompletionRange(n),s),kind:q.Value});const i=new cs;this.styleSheet.acceptVisitor(new km(i,this.offset));for(const s of i.getEntries())r.items.push({label:s,textEdit:j.replace(this.getCompletionRange(n),s),kind:q.Color});for(const s of em)r.items.push({label:s.label,detail:s.func,documentation:s.desc,textEdit:j.replace(this.getCompletionRange(n),s.insertText),insertTextFormat:nt,kind:q.Function});return r}getPositionProposals(e,n,r){for(const i in yc)r.items.push({label:i,documentation:yc[i],textEdit:j.replace(this.getCompletionRange(n),i),kind:q.Value});return r}getRepeatStyleProposals(e,n,r){for(const i in xc)r.items.push({label:i,documentation:xc[i],textEdit:j.replace(this.getCompletionRange(n),i),kind:q.Value});return r}getLineStyleProposals(e,n,r){for(const i in Sc)r.items.push({label:i,documentation:Sc[i],textEdit:j.replace(this.getCompletionRange(n),i),kind:q.Value});return r}getLineWidthProposals(e,n,r){for(const i of dm)r.items.push({label:i,textEdit:j.replace(this.getCompletionRange(n),i),kind:q.Value});return r}getGeometryBoxProposals(e,n,r){for(const i in kc)r.items.push({label:i,documentation:kc[i],textEdit:j.replace(this.getCompletionRange(n),i),kind:q.Value});return r}getBoxProposals(e,n,r){for(const i in Cc)r.items.push({label:i,documentation:Cc[i],textEdit:j.replace(this.getCompletionRange(n),i),kind:q.Value});return r}getImageProposals(e,n,r){for(const i in Fc){const s=Qt(i);r.items.push({label:i,documentation:Fc[i],textEdit:j.replace(this.getCompletionRange(n),s),kind:q.Function,insertTextFormat:i!==s?nt:void 0})}return r}getTimingFunctionProposals(e,n,r){for(const i in Rc){const s=Qt(i);r.items.push({label:i,documentation:Rc[i],textEdit:j.replace(this.getCompletionRange(n),s),kind:q.Function,insertTextFormat:i!==s?nt:void 0})}return r}getBasicShapeProposals(e,n,r){for(const i in Nc){const s=Qt(i);r.items.push({label:i,documentation:Nc[i],textEdit:j.replace(this.getCompletionRange(n),s),kind:q.Function,insertTextFormat:i!==s?nt:void 0})}return r}getCompletionsForStylesheet(e){const n=this.styleSheet.findFirstChildBeforeOffset(this.offset);return n?n instanceof Ct?this.getCompletionsForRuleSet(n,e):n instanceof Mi?this.getCompletionsForSupports(n,e):e:this.getCompletionForTopLevel(e)}getCompletionForTopLevel(e){return this.cssDataManager.getAtDirectives().forEach(n=>{e.items.push({label:n.name,textEdit:j.replace(this.getCompletionRange(null),n.name),documentation:mt(n,this.doesSupportMarkdown()),tags:zn(n)?[_t.Deprecated]:[],kind:q.Keyword})}),this.getCompletionsForSelector(null,!1,e),e}getCompletionsForRuleSet(e,n){const r=e.getDeclarations();return r&&r.endsWith("}")&&this.offset>=r.end?this.getCompletionForTopLevel(n):!r||this.offset<=r.offset?this.getCompletionsForSelector(e,e.isNested(),n):this.getCompletionsForDeclarations(e.getDeclarations(),n)}getCompletionsForSelector(e,n,r){const i=this.findInNodePath(v.PseudoSelector,v.IdentifierSelector,v.ClassSelector,v.ElementNameSelector);if(!i&&this.hasCharacterAtPosition(this.offset-this.currentWord.length-1,":")&&(this.currentWord=":"+this.currentWord,this.hasCharacterAtPosition(this.offset-this.currentWord.length-1,":")&&(this.currentWord=":"+this.currentWord),this.defaultReplaceRange=K.create(ye.create(this.position.line,this.position.character-this.currentWord.length),this.position)),this.cssDataManager.getPseudoClasses().forEach(c=>{const d=Qt(c.name),u={label:c.name,textEdit:j.replace(this.getCompletionRange(i),d),documentation:mt(c,this.doesSupportMarkdown()),tags:zn(c)?[_t.Deprecated]:[],kind:q.Function,insertTextFormat:c.name!==d?nt:void 0};pe(c.name,":-")&&(u.sortText=Ge.VendorPrefixed),r.items.push(u)}),this.cssDataManager.getPseudoElements().forEach(c=>{const d=Qt(c.name),u={label:c.name,textEdit:j.replace(this.getCompletionRange(i),d),documentation:mt(c,this.doesSupportMarkdown()),tags:zn(c)?[_t.Deprecated]:[],kind:q.Function,insertTextFormat:c.name!==d?nt:void 0};pe(c.name,"::-")&&(u.sortText=Ge.VendorPrefixed),r.items.push(u)}),!n){for(const c of um)r.items.push({label:c,textEdit:j.replace(this.getCompletionRange(i),c),kind:q.Keyword});for(const c of pm)r.items.push({label:c,textEdit:j.replace(this.getCompletionRange(i),c),kind:q.Keyword})}const o={};o[this.currentWord]=!0;const l=this.textDocument.getText();if(this.styleSheet.accept(c=>{if(c.type===v.SimpleSelector&&c.length>0){const d=l.substr(c.offset,c.length);return d.charAt(0)==="."&&!o[d]&&(o[d]=!0,r.items.push({label:d,textEdit:j.replace(this.getCompletionRange(i),d),kind:q.Keyword})),!1}return!0}),e&&e.isNested()){const c=e.getSelectors().findFirstChildBeforeOffset(this.offset);c&&e.getSelectors().getChildren().indexOf(c)===0&&this.getPropertyProposals(null,r)}return r}getCompletionsForDeclarations(e,n){if(!e||this.offset===e.offset)return n;const r=e.findFirstChildBeforeOffset(this.offset);if(!r)return this.getCompletionsForDeclarationProperty(null,n);if(r instanceof Ii){const i=r;if(!Te(i.colonPosition)||this.offset<=i.colonPosition)return this.getCompletionsForDeclarationProperty(i,n);if(Te(i.semicolonPosition)&&i.semicolonPositione.colonPosition&&this.getVariableProposals(e.getValue()||null,n),n}getCompletionsForExpression(e,n){const r=e.getParent();if(r instanceof Gt)return this.getCompletionsForFunctionArgument(r,r.getParent(),n),n;const i=e.findParent(v.Declaration);if(!i)return this.getTermProposals(void 0,null,n),n;const s=e.findChildAtOffset(this.offset,!0);return s?s instanceof Ti||s instanceof ze?this.getCompletionsForDeclarationValue(i,n):n:this.getCompletionsForDeclarationValue(i,n)}getCompletionsForFunctionArgument(e,n,r){const i=n.getIdentifier();return i&&i.matches("var")&&(!n.getArguments().hasChildren()||n.getArguments().getChild(0)===e)&&this.getVariableProposalsForCSSVarFunction(r),r}getCompletionsForFunctionDeclaration(e,n){const r=e.getDeclarations();return r&&this.offset>r.offset&&this.offset{s.onCssMixinReference&&s.onCssMixinReference({mixinName:this.currentWord,range:this.getCompletionRange(i)})}),n}getTermProposals(e,n,r){const i=this.getSymbolContext().findSymbolsAtOffset(this.offset,Q.Function);for(const s of i)s.node instanceof cr&&r.items.push(this.makeTermProposal(s,s.node.getParameters(),n));return r}makeTermProposal(e,n,r){e.node;const i=n.getChildren().map(a=>a instanceof lr?a.getName():a.getText()),s=e.name+"("+i.map((a,o)=>"${"+(o+1)+":"+a+"}").join(", ")+")";return{label:e.name,detail:e.name+"("+i.join(", ")+")",textEdit:j.replace(this.getCompletionRange(r),s),insertTextFormat:nt,kind:q.Function,sortText:Ge.Term}}getCompletionsForSupportsCondition(e,n){const r=e.findFirstChildBeforeOffset(this.offset);if(r){if(r instanceof Pe)return!Te(r.colonPosition)||this.offset<=r.colonPosition?this.getCompletionsForDeclarationProperty(r,n):this.getCompletionsForDeclarationValue(r,n);if(r instanceof Rn)return this.getCompletionsForSupportsCondition(r,n)}return Te(e.lParent)&&this.offset>e.lParent&&(!Te(e.rParent)||this.offset<=e.rParent)?this.getCompletionsForDeclarationProperty(null,n):n}getCompletionsForSupports(e,n){const r=e.getDeclarations();if(!r||this.offset<=r.offset){const s=e.findFirstChildBeforeOffset(this.offset);return s instanceof Rn?this.getCompletionsForSupportsCondition(s,n):n}return this.getCompletionForTopLevel(n)}getCompletionsForExtendsReference(e,n,r){return r}getCompletionForUriLiteralValue(e,n){let r,i,s;if(e.hasChildren()){const a=e.getChild(0);r=a.getText(),i=this.position,s=this.getCompletionRange(a)}else{r="",i=this.position;const a=this.textDocument.positionAt(e.offset+4);s=K.create(a,a)}return this.completionParticipants.forEach(a=>{a.onCssURILiteralValue&&a.onCssURILiteralValue({uriValue:r,position:i,range:s})}),n}getCompletionForImportPath(e,n){return this.completionParticipants.forEach(r=>{r.onCssImportPath&&r.onCssImportPath({pathValue:e.getText(),position:this.position,range:this.getCompletionRange(e)})}),n}hasCharacterAtPosition(e,n){const r=this.textDocument.getText();return e>=0&&e=0&&` +\r":{[()]},*>+`.indexOf(r.charAt(n))===-1;)n--;return r.substring(n+1,e)}let hs=class Ms{constructor(){this.parent=null,this.children=null,this.attributes=null}findAttribute(e){if(this.attributes){for(const n of this.attributes)if(n.name===e)return n.value}return null}addChild(e){e instanceof Ms&&(e.parent=this),this.children||(this.children=[]),this.children.push(e)}append(e){if(this.attributes){const n=this.attributes[this.attributes.length-1];n.value=n.value+e}}prepend(e){if(this.attributes){const n=this.attributes[0];n.value=e+n.value}}findRoot(){let e=this;for(;e.parent&&!(e.parent instanceof Kt);)e=e.parent;return e}removeChild(e){if(this.children){const n=this.children.indexOf(e);if(n!==-1)return this.children.splice(n,1),!0}return!1}addAttr(e,n){this.attributes||(this.attributes=[]);for(const r of this.attributes)if(r.name===e){r.value+=" "+n;return}this.attributes.push({name:e,value:n})}clone(e=!0){const n=new Ms;if(this.attributes){n.attributes=[];for(const r of this.attributes)n.addAttr(r.name,r.value)}if(e&&this.children){n.children=[];for(let r=0;r"),this.writeLine(n,i.join(""))}}var rt;(function(t){function e(r,i){return i+n(r)+i}t.ensure=e;function n(r){const i=r.match(/^['"](.*)["']$/);return i?i[1]:r}t.remove=n})(rt||(rt={}));class us{constructor(){this.id=0,this.attr=0,this.tag=0}}function Pc(t,e){let n=new hs;for(const r of t.getChildren())switch(r.type){case v.SelectorCombinator:if(e){const o=r.getText().split("&");if(o.length===1){n.addAttr("name",o[0]);break}n=e.cloneWithParent(),o[0]&&n.findRoot().prepend(o[0]);for(let l=1;l1){const c=e.cloneWithParent();n.addChild(c.findRoot()),n=c}n.append(o[l])}}break;case v.SelectorPlaceholder:if(r.matches("@at-root"))return n;case v.ElementNameSelector:const i=r.getText();n.addAttr("name",i==="*"?"element":Oe(i));break;case v.ClassSelector:n.addAttr("class",Oe(r.getText().substring(1)));break;case v.IdentifierSelector:n.addAttr("id",Oe(r.getText().substring(1)));break;case v.MixinDeclaration:n.addAttr("class",r.getName());break;case v.PseudoSelector:n.addAttr(Oe(r.getText()),"");break;case v.AttributeSelector:const s=r,a=s.getIdentifier();if(a){const o=s.getValue(),l=s.getOperator();let c;if(o&&l)switch(Oe(l.getText())){case"|=":c=`${rt.remove(Oe(o.getText()))}-…`;break;case"^=":c=`${rt.remove(Oe(o.getText()))}…`;break;case"$=":c=`…${rt.remove(Oe(o.getText()))}`;break;case"~=":c=` … ${rt.remove(Oe(o.getText()))} … `;break;case"*=":c=`…${rt.remove(Oe(o.getText()))}…`;break;default:c=rt.remove(Oe(o.getText()));break}n.addAttr(Oe(a.getText()),c)}break}return n}function Oe(t){const e=new _n;e.setSource(t);const n=e.scanUnquotedString();return n?n.text:t}class Fm{constructor(e){this.cssDataManager=e}selectorToMarkedString(e,n){const r=Im(e);if(r){const i=new zc('"').print(r,n);return i.push(this.selectorToSpecificityMarkedString(e)),i}else return[]}simpleSelectorToMarkedString(e){const n=Pc(e),r=new zc('"').print(n);return r.push(this.selectorToSpecificityMarkedString(e)),r}isPseudoElementIdentifier(e){const n=e.match(/^::?([\w-]+)/);return n?!!this.cssDataManager.getPseudoElement("::"+n[1]):!1}selectorToSpecificityMarkedString(e){const n=s=>{const a=new us;let o=new us;for(const l of s)for(const c of l.getChildren()){const d=r(c);if(d.id>o.id){o=d;continue}else if(d.ido.attr){o=d;continue}else if(d.attro.tag){o=d;continue}}return a.id+=o.id,a.attr+=o.attr,a.tag+=o.tag,a},r=s=>{const a=new us;e:for(const o of s.getChildren()){switch(o.type){case v.IdentifierSelector:a.id++;break;case v.ClassSelector:case v.AttributeSelector:a.attr++;break;case v.ElementNameSelector:if(o.matches("*"))break;a.tag++;break;case v.PseudoSelector:const l=o.getText(),c=o.getChildren();if(this.isPseudoElementIdentifier(l)){if(l.match(/^::slotted/i)&&c.length>0){a.tag++;let d=n(c);a.id+=d.id,a.attr+=d.attr,a.tag+=d.tag;continue e}a.tag++;continue e}if(l.match(/^:where/i))continue e;if(l.match(/^:(?:not|has|is)/i)&&c.length>0){let d=n(c);a.id+=d.id,a.attr+=d.attr,a.tag+=d.tag;continue e}if(l.match(/^:(?:host|host-context)/i)&&c.length>0){a.attr++;let d=n(c);a.id+=d.id,a.attr+=d.attr,a.tag+=d.tag;continue e}if(l.match(/^:(?:nth-child|nth-last-child)/i)&&c.length>0){if(a.attr++,c.length===3&&c[1].type===23){let g=n(c[2].getChildren());a.id+=g.id,a.attr+=g.attr,a.tag+=g.tag;continue e}const d=new Cr,u=c[1].getText();d.scanner.setSource(u);const m=d.scanner.scan(),f=d.scanner.scan();if(m.text==="n"||m.text==="-n"&&f.text==="of"){const g=[],k=u.slice(f.offset+2).split(",");for(const N of k){const _=d.internalParse(N,d._parseSelector);_&&g.push(_)}let F=n(g);a.id+=F.id,a.attr+=F.attr,a.tag+=F.tag;continue e}continue e}a.attr++;continue e}if(o.getChildren().length>0){const l=r(o);a.id+=l.id,a.attr+=l.attr,a.tag+=l.tag}}return a},i=r(e);return`[${w("Selector Specificity")}](https://developer.mozilla.org/docs/Web/CSS/Specificity): (${i.id}, ${i.attr}, ${i.tag})`}}class Rm{constructor(e){this.prev=null,this.element=e}processSelector(e){let n=null;if(!(this.element instanceof Kt)&&e.getChildren().some(r=>r.hasChildren()&&r.getChild(0).type===v.SelectorCombinator)){const r=this.element.findRoot();r.parent instanceof Kt&&(n=this.element,this.element=r.parent,this.element.removeChild(r),this.prev=null)}for(const r of e.getChildren()){if(r instanceof Ht){if(this.prev instanceof Ht){const a=new ds("…");this.element.addChild(a),this.element=a}else this.prev&&(this.prev.matches("+")||this.prev.matches("~"))&&this.element.parent&&(this.element=this.element.parent);this.prev&&this.prev.matches("~")&&this.element.addChild(new ds("⋮"));const i=Pc(r,n),s=i.findRoot();this.element.addChild(s),this.element=i}(r instanceof Ht||r.type===v.SelectorCombinatorParent||r.type===v.SelectorCombinatorShadowPiercingDescendant||r.type===v.SelectorCombinatorSibling||r.type===v.SelectorCombinatorAllSiblings)&&(this.prev=r)}}}function Nm(t){switch(t.type){case v.MixinDeclaration:case v.Stylesheet:return!0}return!1}function Im(t){if(t.matches("@at-root"))return null;const e=new Kt,n=[],r=t.getParent();if(r instanceof Ct){let s=r.getParent();for(;s&&!Nm(s);){if(s instanceof Ct){if(s.getSelectors().matches("@at-root"))break;n.push(s)}s=s.getParent()}}const i=new Rm(e);for(let s=n.length-1;s>=0;s--){const a=n[s].getSelectors().getChild(0);a&&i.processSelector(a)}return i.processSelector(t),e}class ps{constructor(e,n){this.clientCapabilities=e,this.cssDataManager=n,this.selectorPrinting=new Fm(n)}configure(e){this.defaultSettings=e}doHover(e,n,r,i=this.defaultSettings){function s(d){return K.create(e.positionAt(d.offset),e.positionAt(d.end))}const a=e.offsetAt(n),o=Ri(r,a);let l=null,c;for(let d=0;dtypeof n=="string"?n:n.value):e.value}doesSupportMarkdown(){if(!Te(this.supportsMarkdown)){if(!Te(this.clientCapabilities))return this.supportsMarkdown=!0,this.supportsMarkdown;const e=this.clientCapabilities.textDocument&&this.clientCapabilities.textDocument.hover;this.supportsMarkdown=e&&e.contentFormat&&Array.isArray(e.contentFormat)&&e.contentFormat.indexOf(He.Markdown)!==-1}return this.supportsMarkdown}}const Tc=/^\w+:\/\//,Oc=/^data:/;class ms{constructor(e,n){this.fileSystemProvider=e,this.resolveModuleReferences=n}configure(e){this.defaultSettings=e}findDefinition(e,n,r){const i=new is(r),s=e.offsetAt(n),a=Fi(r,s);if(!a)return null;const o=i.findSymbolFromNode(a);return o?{uri:e.uri,range:it(o.node,e)}:null}findReferences(e,n,r){return this.findDocumentHighlights(e,n,r).map(s=>({uri:e.uri,range:s.range}))}getHighlightNode(e,n,r){const i=e.offsetAt(n);let s=Fi(r,i);if(!(!s||s.type===v.Stylesheet||s.type===v.Declarations))return s.type===v.Identifier&&s.parent&&s.parent.type===v.ClassSelector&&(s=s.parent),s}findDocumentHighlights(e,n,r){const i=[],s=this.getHighlightNode(e,n,r);if(!s)return i;const a=new is(r),o=a.findSymbolFromNode(s),l=s.getText();return r.accept(c=>{if(o){if(a.matchesSymbol(c,o))return i.push({kind:Vc(c),range:it(c,e)}),!1}else s&&s.type===c.type&&c.matches(l)&&i.push({kind:Vc(c),range:it(c,e)});return!0}),i}isRawStringDocumentLinkNode(e){return e.type===v.Import}findDocumentLinks(e,n,r){const i=this.findUnresolvedLinks(e,n),s=[];for(let a of i){const o=a.link,l=o.target;if(!(!l||Oc.test(l)))if(Tc.test(l))s.push(o);else{const c=r.resolveReference(l,e.uri);c&&(o.target=c),s.push(o)}}return s}async findDocumentLinks2(e,n,r){const i=this.findUnresolvedLinks(e,n),s=[];for(let a of i){const o=a.link,l=o.target;if(!(!l||Oc.test(l)))if(Tc.test(l))s.push(o);else{const c=await this.resolveReference(l,e.uri,r,a.isRawLink);c!==void 0&&(o.target=c,s.push(o))}}return s}findUnresolvedLinks(e,n){const r=[],i=s=>{let a=s.getText();const o=it(s,e);if(o.start.line===o.end.line&&o.start.character===o.end.character)return;(pe(a,"'")||pe(a,'"'))&&(a=a.slice(1,-1));const l=s.parent?this.isRawStringDocumentLinkNode(s.parent):!1;r.push({link:{target:a,range:o},isRawLink:l})};return n.accept(s=>{if(s.type===v.URILiteral){const a=s.getChild(0);return a&&i(a),!1}if(s.parent&&this.isRawStringDocumentLinkNode(s.parent)){const a=s.getText();return(pe(a,"'")||pe(a,'"'))&&i(s),!1}return!0}),r}findSymbolInformations(e,n){const r=[],i=(s,a,o)=>{const l=o instanceof W?it(o,e):o,c={name:s||w(""),kind:a,location:Dn.create(e.uri,l)};r.push(c)};return this.collectDocumentSymbols(e,n,i),r}findDocumentSymbols(e,n){const r=[],i=[],s=(a,o,l,c,d)=>{const u=l instanceof W?it(l,e):l;let m=c instanceof W?it(c,e):c;(!m||!Wc(u,m))&&(m=K.create(u.start,u.start));const f={name:a||w(""),kind:o,range:u,selectionRange:m};let g=i.pop();for(;g&&!Wc(g[1],u);)g=i.pop();if(g){const b=g[0];b.children||(b.children=[]),b.children.push(f),i.push(g)}else r.push(f);d&&i.push([f,it(d,e)])};return this.collectDocumentSymbols(e,n,s),r}collectDocumentSymbols(e,n,r){n.accept(i=>{if(i instanceof Ct){for(const s of i.getSelectors().getChildren())if(s instanceof En){const a=K.create(e.positionAt(s.offset),e.positionAt(i.end));r(s.getText(),tt.Class,a,s,i.getDeclarations())}}else if(i instanceof hr)r(i.getName(),tt.Variable,i,i.getVariable(),void 0);else if(i instanceof In)r(i.getName(),tt.Method,i,i.getIdentifier(),i.getDeclarations());else if(i instanceof cr)r(i.getName(),tt.Function,i,i.getIdentifier(),i.getDeclarations());else if(i instanceof cl){const s=w("@keyframes {0}",i.getName());r(s,tt.Class,i,i.getIdentifier(),i.getDeclarations())}else if(i instanceof ol){const s=w("@font-face");r(s,tt.Class,i,void 0,i.getDeclarations())}else if(i instanceof Ai){const s=i.getChild(0);if(s instanceof dl){const a="@media "+s.getText();r(a,tt.Module,i,s,i.getDeclarations())}}return!0})}findDocumentColors(e,n){const r=[];return n.accept(i=>{const s=Dm(i,e);return s&&r.push(s),!0}),r}getColorPresentations(e,n,r,i){const s=[],a=Math.round(r.red*255),o=Math.round(r.green*255),l=Math.round(r.blue*255);let c;r.alpha===1?c=`rgb(${a}, ${o}, ${l})`:c=`rgba(${a}, ${o}, ${l}, ${r.alpha})`,s.push({label:c,textEdit:j.replace(i,c)}),r.alpha===1?c=`#${Et(a)}${Et(o)}${Et(l)}`:c=`#${Et(a)}${Et(o)}${Et(l)}${Et(Math.round(r.alpha*255))}`,s.push({label:c,textEdit:j.replace(i,c)});const d=vc(r);d.a===1?c=`hsl(${d.h}, ${Math.round(d.s*100)}%, ${Math.round(d.l*100)}%)`:c=`hsla(${d.h}, ${Math.round(d.s*100)}%, ${Math.round(d.l*100)}%, ${d.a})`,s.push({label:c,textEdit:j.replace(i,c)});const u=cm(r);return u.a===1?c=`hwb(${u.h} ${Math.round(u.w*100)}% ${Math.round(u.b*100)}%)`:c=`hwb(${u.h} ${Math.round(u.w*100)}% ${Math.round(u.b*100)}% / ${u.a})`,s.push({label:c,textEdit:j.replace(i,c)}),s}prepareRename(e,n,r){const i=this.getHighlightNode(e,n,r);if(i)return K.create(e.positionAt(i.offset),e.positionAt(i.end))}doRename(e,n,r,i){const a=this.findDocumentHighlights(e,n,i).map(o=>j.replace(o.range,r));return{changes:{[e.uri]:a}}}async resolveModuleReference(e,n,r){if(pe(n,"file://")){const i=Lm(e);if(i&&i!=="."&&i!==".."){const s=r.resolveReference("/",n),a=as(n),o=await this.resolvePathToModule(i,a,s);if(o){const l=e.substring(i.length+1);return Yt(o,l)}}}}async mapReference(e,n){return e}async resolveReference(e,n,r,i=!1,s=this.defaultSettings){if(e[0]==="~"&&e[1]!=="/"&&this.fileSystemProvider)return e=e.substring(1),this.mapReference(await this.resolveModuleReference(e,n,r),i);const a=await this.mapReference(r.resolveReference(e,n),i);if(this.resolveModuleReferences){if(a&&await this.fileExists(a))return a;const o=await this.mapReference(await this.resolveModuleReference(e,n,r),i);if(o)return o}if(a&&!await this.fileExists(a)){const o=r.resolveReference("/",n);if(s&&o){if(e in s)return this.mapReference(Yt(o,s[e]),i);const l=e.indexOf("/"),c=`${e.substring(0,l)}/`;if(c in s){const d=s[c].slice(0,-1);let u=Yt(o,d);return this.mapReference(u=Yt(u,e.substring(c.length-1)),i)}}}return a}async resolvePathToModule(e,n,r){const i=Yt(n,"node_modules",e,"package.json");if(await this.fileExists(i))return as(i);if(r&&n.startsWith(r)&&n.length!==r.length)return this.resolvePathToModule(e,as(n),r)}async fileExists(e){if(!this.fileSystemProvider)return!1;try{const n=await this.fileSystemProvider.stat(e);return!(n.type===Mn.Unknown&&n.size===-1)}catch{return!1}}}function Dm(t,e){const n=hm(t);if(n){const r=it(t,e);return{color:n,range:r}}return null}function it(t,e){return K.create(e.positionAt(t.offset),e.positionAt(t.end))}function Wc(t,e){const n=e.start.line,r=e.end.line,i=t.start.line,s=t.end.line;return!(ns||r>s||n===i&&e.start.charactert.end.character)}function Vc(t){if(t.type===v.Selector||t instanceof ze&&t.parent&&t.parent instanceof Di&&t.isCustomProperty)return Xt.Write;if(t.parent)switch(t.parent.type){case v.FunctionDeclaration:case v.MixinDeclaration:case v.Keyframe:case v.VariableDeclaration:case v.FunctionParameter:return Xt.Write}return Xt.Read}function Et(t){const e=t.toString(16);return e.length!==2?"0"+e:e}function Lm(t){const e=t.indexOf("/");if(e===-1)return"";if(t[0]==="@"){const n=t.indexOf("/",e+1);return n===-1?t:t.substring(0,n)}return t.substring(0,e)}const Zt=Ne.Warning,$c=Ne.Error,Ve=Ne.Ignore;class me{constructor(e,n,r){this.id=e,this.message=n,this.defaultValue=r}}class Am{constructor(e,n,r){this.id=e,this.message=n,this.defaultValue=r}}const ie={AllVendorPrefixes:new me("compatibleVendorPrefixes",w("When using a vendor-specific prefix make sure to also include all other vendor-specific properties"),Ve),IncludeStandardPropertyWhenUsingVendorPrefix:new me("vendorPrefix",w("When using a vendor-specific prefix also include the standard property"),Zt),DuplicateDeclarations:new me("duplicateProperties",w("Do not use duplicate style definitions"),Ve),EmptyRuleSet:new me("emptyRules",w("Do not use empty rulesets"),Zt),ImportStatemement:new me("importStatement",w("Import statements do not load in parallel"),Ve),BewareOfBoxModelSize:new me("boxModel",w("Do not use width or height when using padding or border"),Ve),UniversalSelector:new me("universalSelector",w("The universal selector (*) is known to be slow"),Ve),ZeroWithUnit:new me("zeroUnits",w("No unit for zero needed"),Ve),RequiredPropertiesForFontFace:new me("fontFaceProperties",w("@font-face rule must define 'src' and 'font-family' properties"),Zt),HexColorLength:new me("hexColorLength",w("Hex colors must consist of three, four, six or eight hex numbers"),$c),ArgsInColorFunction:new me("argumentsInColorFunction",w("Invalid number of parameters"),$c),UnknownProperty:new me("unknownProperties",w("Unknown property."),Zt),UnknownAtRules:new me("unknownAtRules",w("Unknown at-rule."),Zt),IEStarHack:new me("ieHack",w("IE hacks are only necessary when supporting IE7 and older"),Ve),UnknownVendorSpecificProperty:new me("unknownVendorSpecificProperties",w("Unknown vendor specific property."),Ve),PropertyIgnoredDueToDisplay:new me("propertyIgnoredDueToDisplay",w("Property is ignored due to the display."),Zt),AvoidImportant:new me("important",w("Avoid using !important. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored."),Ve),AvoidFloat:new me("float",w("Avoid using 'float'. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes."),Ve),AvoidIdSelector:new me("idSelector",w("Selectors should not contain IDs because these rules are too tightly coupled with the HTML."),Ve)},Mm={ValidProperties:new Am("validProperties",w("A list of properties that are not validated against the `unknownProperties` rule."),[])};class zm{constructor(e={}){this.conf=e}getRule(e){if(this.conf.hasOwnProperty(e.id)){const n=Pm(this.conf[e.id]);if(n)return n}return e.defaultValue}getSetting(e){return this.conf[e.id]}}function Pm(t){switch(t){case"ignore":return Ne.Ignore;case"warning":return Ne.Warning;case"error":return Ne.Error}return null}class fs{constructor(e){this.cssDataManager=e}doCodeActions(e,n,r,i){return this.doCodeActions2(e,n,r,i).map(s=>{const a=s.edit&&s.edit.documentChanges&&s.edit.documentChanges[0];return kt.create(s.title,"_css.applyCodeAction",e.uri,e.version,a&&a.edits)})}doCodeActions2(e,n,r,i){const s=[];if(r.diagnostics)for(const a of r.diagnostics)this.appendFixesForMarker(e,i,a,s);return s}getFixesForUnknownProperty(e,n,r,i){const s=n.getName(),a=[];this.cssDataManager.getProperties().forEach(l=>{const c=cp(s,l.name);c>=s.length/2&&a.push({property:l.name,score:c})}),a.sort((l,c)=>c.score-l.score||l.property.localeCompare(c.property));let o=3;for(const l of a){const c=l.property,d=w("Rename to '{0}'",c),u=j.replace(r.range,c),m=Xi.create(e.uri,e.version),f={documentChanges:[fr.create(m,[u])]},g=Ki.create(d,f,Qi.QuickFix);if(g.diagnostics=[r],i.push(g),--o<=0)return}}appendFixesForMarker(e,n,r,i){if(r.code!==ie.UnknownProperty.id)return;const s=e.offsetAt(r.range.start),a=e.offsetAt(r.range.end),o=Ri(n,s);for(let l=o.length-1;l>=0;l--){const c=o[l];if(c instanceof Pe){const d=c.getProperty();if(d&&d.offset===s&&d.end===a){this.getFixesForUnknownProperty(e,d,r,i);return}}}}}class Tm{constructor(e){this.fullPropertyName=e.getFullPropertyName().toLowerCase(),this.node=e}}function Pn(t,e,n,r){const i=t[e];i.value=n,n&&(Dc(i.properties,r)||i.properties.push(r))}function Om(t,e,n){Pn(t,"top",e,n),Pn(t,"right",e,n),Pn(t,"bottom",e,n),Pn(t,"left",e,n)}function we(t,e,n,r){e==="top"||e==="right"||e==="bottom"||e==="left"?Pn(t,e,n,r):Om(t,n,r)}function gs(t,e,n){switch(e.length){case 1:we(t,void 0,e[0],n);break;case 2:we(t,"top",e[0],n),we(t,"bottom",e[0],n),we(t,"right",e[1],n),we(t,"left",e[1],n);break;case 3:we(t,"top",e[0],n),we(t,"right",e[1],n),we(t,"left",e[1],n),we(t,"bottom",e[2],n);break;case 4:we(t,"top",e[0],n),we(t,"right",e[1],n),we(t,"bottom",e[2],n),we(t,"left",e[3],n);break}}function bs(t,e){for(let n of e)if(t.matches(n))return!0;return!1}function Tn(t,e=!0){return e&&bs(t,["initial","unset"])?!1:parseFloat(t.getText())!==0}function Uc(t,e=!0){return t.map(n=>Tn(n,e))}function Rr(t,e=!0){return!(bs(t,["none","hidden"])||e&&bs(t,["initial","unset"]))}function Wm(t,e=!0){return t.map(n=>Rr(n,e))}function Vm(t){const e=t.getChildren();if(e.length===1){const n=e[0];return Tn(n)&&Rr(n)}for(const n of e){const r=n;if(!Tn(r,!1)||!Rr(r,!1))return!1}return!0}function $m(t){const e={top:{value:!1,properties:[]},right:{value:!1,properties:[]},bottom:{value:!1,properties:[]},left:{value:!1,properties:[]}};for(const n of t){const r=n.node.value;if(!(typeof r>"u"))switch(n.fullPropertyName){case"box-sizing":return{top:{value:!1,properties:[]},right:{value:!1,properties:[]},bottom:{value:!1,properties:[]},left:{value:!1,properties:[]}};case"width":e.width=n;break;case"height":e.height=n;break;default:const i=n.fullPropertyName.split("-");switch(i[0]){case"border":switch(i[1]){case void 0:case"top":case"right":case"bottom":case"left":switch(i[2]){case void 0:we(e,i[1],Vm(r),n);break;case"width":we(e,i[1],Tn(r,!1),n);break;case"style":we(e,i[1],Rr(r,!0),n);break}break;case"width":gs(e,Uc(r.getChildren(),!1),n);break;case"style":gs(e,Wm(r.getChildren(),!0),n);break}break;case"padding":i.length===1?gs(e,Uc(r.getChildren(),!0),n):we(e,i[1],Tn(r,!0),n);break}break}}return e}class Bc{constructor(){this.data={}}add(e,n,r){let i=this.data[e];i||(i={nodes:[],names:[]},this.data[e]=i),i.names.push(n),r&&i.nodes.push(r)}}class en{static entries(e,n,r,i,s){const a=new en(n,r,i);return e.acceptVisitor(a),a.completeValidations(),a.getEntries(s)}constructor(e,n,r){this.cssDataManager=r,this.warnings=[],this.settings=n,this.documentText=e.getText(),this.keyframes=new Bc,this.validProperties={};const i=n.getSetting(Mm.ValidProperties);Array.isArray(i)&&i.forEach(s=>{if(typeof s=="string"){const a=s.trim().toLowerCase();a.length&&(this.validProperties[a]=!0)}})}isValidPropertyDeclaration(e){const n=e.fullPropertyName;return this.validProperties[n]}fetch(e,n){const r=[];for(const i of e)i.fullPropertyName===n&&r.push(i);return r}fetchWithValue(e,n,r){const i=[];for(const s of e)if(s.fullPropertyName===n){const a=s.node.getValue();a&&this.findValueInExpression(a,r)&&i.push(s)}return i}findValueInExpression(e,n){let r=!1;return e.accept(i=>(i.type===v.Identifier&&i.matches(n)&&(r=!0),!r)),r}getEntries(e=Ne.Warning|Ne.Error){return this.warnings.filter(n=>(n.getLevel()&e)!==0)}addEntry(e,n,r){const i=new gl(e,n,this.settings.getRule(n),r);this.warnings.push(i)}getMissingNames(e,n){const r=e.slice(0);for(let s=0;s0){const l=this.fetch(r,"float");for(let c=0;c0){const l=this.fetch(r,"vertical-align");for(let c=0;c1)for(let m=0;mO.startsWith(T))&&g.delete(N)}}const b=[];for(let F=0,N=en.prefixes.length;Fs instanceof zi?(i+=1,!1):!0),i!==r&&this.addEntry(e,ie.ArgsInColorFunction)),!0}}en.prefixes=["-ms-","-moz-","-o-","-webkit-"];class ws{constructor(e){this.cssDataManager=e}configure(e){this.settings=e}doValidation(e,n,r=this.settings){if(r&&r.validate===!1)return[];const i=[];i.push.apply(i,Vi.entries(n)),i.push.apply(i,en.entries(n,e,new zm(r&&r.lint),this.cssDataManager));const s=[];for(const o in ie)s.push(ie[o].id);function a(o){const l=K.create(e.positionAt(o.getOffset()),e.positionAt(o.getOffset()+o.getLength())),c=e.languageId;return{code:o.getRule().id,source:c,message:o.getMessage(),severity:o.getLevel()===Ne.Warning?pr.Warning:pr.Error,range:l}}return i.filter(o=>o.getLevel()!==Ne.Ignore).map(a)}}const qc=47,Um=10,Bm=13,qm=12,jm=36,Hm=35,Gm=123,On=61,Jm=33,Xm=60,Ym=62,vs=46;let st=p.CustomToken;const ys=st++,Nr=st++;st++;const jc=st++,Hc=st++,xs=st++,Ss=st++,Ir=st++;st++;class Gc extends _n{scanNext(e){if(this.stream.advanceIfChar(jm)){const n=["$"];if(this.ident(n))return this.finishToken(e,ys,n.join(""));this.stream.goBackTo(e)}return this.stream.advanceIfChars([Hm,Gm])?this.finishToken(e,Nr):this.stream.advanceIfChars([On,On])?this.finishToken(e,jc):this.stream.advanceIfChars([Jm,On])?this.finishToken(e,Hc):this.stream.advanceIfChar(Xm)?this.stream.advanceIfChar(On)?this.finishToken(e,Ss):this.finishToken(e,p.Delim):this.stream.advanceIfChar(Ym)?this.stream.advanceIfChar(On)?this.finishToken(e,xs):this.finishToken(e,p.Delim):this.stream.advanceIfChars([vs,vs,vs])?this.finishToken(e,Ir):super.scanNext(e)}comment(){return super.comment()?!0:!this.inURL&&this.stream.advanceIfChars([qc,qc])?(this.stream.advanceWhileChar(e=>{switch(e){case Um:case Bm:case qm:return!1;default:return!0}}),!0):!1}}class Cs{constructor(e,n){this.id=e,this.message=n}}const ks={FromExpected:new Cs("scss-fromexpected",w("'from' expected")),ThroughOrToExpected:new Cs("scss-throughexpected",w("'through' or 'to' expected")),InExpected:new Cs("scss-fromexpected",w("'in' expected"))};class Qm extends Cr{constructor(){super(new Gc)}_parseStylesheetStatement(e=!1){return this.peek(p.AtKeyword)?this._parseWarnAndDebug()||this._parseControlStatement()||this._parseMixinDeclaration()||this._parseMixinContent()||this._parseMixinReference()||this._parseFunctionDeclaration()||this._parseForward()||this._parseUse()||this._parseRuleset(e)||super._parseStylesheetAtStatement(e):this._parseRuleset(!0)||this._parseVariableDeclaration()}_parseImport(){if(!this.peekKeyword("@import"))return null;const e=this.create(Li);if(this.consumeToken(),!e.addChild(this._parseURILiteral())&&!e.addChild(this._parseStringLiteral()))return this.finish(e,S.URIOrStringExpected);for(;this.accept(p.Comma);)if(!e.addChild(this._parseURILiteral())&&!e.addChild(this._parseStringLiteral()))return this.finish(e,S.URIOrStringExpected);return this._completeParseImport(e)}_parseVariableDeclaration(e=[]){if(!this.peek(ys))return null;const n=this.create(hr);if(!n.setVariable(this._parseVariable()))return null;if(!this.accept(p.Colon))return this.finish(n,S.ColonExpected);if(this.prevToken&&(n.colonPosition=this.prevToken.offset),!n.setValue(this._parseExpr()))return this.finish(n,S.VariableValueExpected,[],e);for(;this.peek(p.Exclamation);)if(!n.addChild(this._tryParsePrio())){if(this.consumeToken(),!this.peekRegExp(p.Ident,/^(default|global)$/))return this.finish(n,S.UnknownKeyword);this.consumeToken()}return this.peek(p.SemiColon)&&(n.semicolonPosition=this.token.offset),this.finish(n)}_parseMediaCondition(){return this._parseInterpolation()||super._parseMediaCondition()}_parseMediaFeatureRangeOperator(){return this.accept(Ss)||this.accept(xs)||super._parseMediaFeatureRangeOperator()}_parseMediaFeatureName(){return this._parseModuleMember()||this._parseFunction()||this._parseIdent()||this._parseVariable()}_parseKeyframeSelector(){return this._tryParseKeyframeSelector()||this._parseControlStatement(this._parseKeyframeSelector.bind(this))||this._parseWarnAndDebug()||this._parseMixinReference()||this._parseFunctionDeclaration()||this._parseVariableDeclaration()||this._parseMixinContent()}_parseVariable(){if(!this.peek(ys))return null;const e=this.create(Wi);return this.consumeToken(),e}_parseModuleMember(){const e=this.mark(),n=this.create(fl);return n.setIdentifier(this._parseIdent([Q.Module]))?this.hasWhitespace()||!this.acceptDelim(".")||this.hasWhitespace()?(this.restoreAtMark(e),null):n.addChild(this._parseVariable()||this._parseFunction())?n:this.finish(n,S.IdentifierOrVariableExpected):null}_parseIdent(e){if(!this.peek(p.Ident)&&!this.peek(Nr)&&!this.peekDelim("-"))return null;const n=this.create(ze);n.referenceTypes=e,n.isCustomProperty=this.peekRegExp(p.Ident,/^--/);let r=!1;const i=()=>{const s=this.mark();return this.acceptDelim("-")&&(this.hasWhitespace()||this.acceptDelim("-"),this.hasWhitespace())?(this.restoreAtMark(s),null):this._parseInterpolation()};for(;(this.accept(p.Ident)||n.addChild(i())||r&&this.acceptRegexp(/^[\w-]/))&&(r=!0,!this.hasWhitespace()););return r?this.finish(n):null}_parseTermExpression(){return this._parseModuleMember()||this._parseVariable()||this._parseNestingSelector()||super._parseTermExpression()}_parseInterpolation(){if(this.peek(Nr)){const e=this.create(Oi);return this.consumeToken(),!e.addChild(this._parseExpr())&&!this._parseNestingSelector()?this.accept(p.CurlyR)?this.finish(e):this.finish(e,S.ExpressionExpected):this.accept(p.CurlyR)?this.finish(e):this.finish(e,S.RightCurlyExpected)}return null}_parseOperator(){if(this.peek(jc)||this.peek(Hc)||this.peek(xs)||this.peek(Ss)||this.peekDelim(">")||this.peekDelim("<")||this.peekIdent("and")||this.peekIdent("or")||this.peekDelim("%")){const e=this.createNode(v.Operator);return this.consumeToken(),this.finish(e)}return super._parseOperator()}_parseUnaryOperator(){if(this.peekIdent("not")){const e=this.create(W);return this.consumeToken(),this.finish(e)}return super._parseUnaryOperator()}_parseRuleSetDeclaration(){return this.peek(p.AtKeyword)?this._parseKeyframe()||this._parseImport()||this._parseMedia(!0)||this._parseFontFace()||this._parseWarnAndDebug()||this._parseControlStatement()||this._parseFunctionDeclaration()||this._parseExtends()||this._parseMixinReference()||this._parseMixinContent()||this._parseMixinDeclaration()||this._parseRuleset(!0)||this._parseSupports(!0)||this._parseLayer()||this._parsePropertyAtRule()||this._parseContainer(!0)||this._parseRuleSetDeclarationAtStatement():this._parseVariableDeclaration()||this._tryParseRuleset(!0)||this._parseDeclaration()}_parseDeclaration(e){const n=this._tryParseCustomPropertyDeclaration(e);if(n)return n;const r=this.create(Pe);if(!r.setProperty(this._parseProperty()))return null;if(!this.accept(p.Colon))return this.finish(r,S.ColonExpected,[p.Colon],e||[p.SemiColon]);this.prevToken&&(r.colonPosition=this.prevToken.offset);let i=!1;if(r.setValue(this._parseExpr())&&(i=!0,r.addChild(this._parsePrio())),this.peek(p.CurlyL))r.setNestedProperties(this._parseNestedProperties());else if(!i)return this.finish(r,S.PropertyValueExpected);return this.peek(p.SemiColon)&&(r.semicolonPosition=this.token.offset),this.finish(r)}_parseNestedProperties(){const e=this.create(ll);return this._parseBody(e,this._parseDeclaration.bind(this))}_parseExtends(){if(this.peekKeyword("@extend")){const e=this.create(Nn);if(this.consumeToken(),!e.getSelectors().addChild(this._parseSimpleSelector()))return this.finish(e,S.SelectorExpected);for(;this.accept(p.Comma);)e.getSelectors().addChild(this._parseSimpleSelector());return this.accept(p.Exclamation)&&!this.acceptIdent("optional")?this.finish(e,S.UnknownKeyword):this.finish(e)}return null}_parseSimpleSelectorBody(){return this._parseSelectorPlaceholder()||super._parseSimpleSelectorBody()}_parseNestingSelector(){if(this.peekDelim("&")){const e=this.createNode(v.SelectorCombinator);for(this.consumeToken();!this.hasWhitespace()&&(this.acceptDelim("-")||this.accept(p.Num)||this.accept(p.Dimension)||e.addChild(this._parseIdent())||this.acceptDelim("&")););return this.finish(e)}return null}_parseSelectorPlaceholder(){if(this.peekDelim("%")){const e=this.createNode(v.SelectorPlaceholder);return this.consumeToken(),this._parseIdent(),this.finish(e)}else if(this.peekKeyword("@at-root")){const e=this.createNode(v.SelectorPlaceholder);if(this.consumeToken(),this.accept(p.ParenthesisL)){if(!this.acceptIdent("with")&&!this.acceptIdent("without"))return this.finish(e,S.IdentifierExpected);if(!this.accept(p.Colon))return this.finish(e,S.ColonExpected);if(!e.addChild(this._parseIdent()))return this.finish(e,S.IdentifierExpected);if(!this.accept(p.ParenthesisR))return this.finish(e,S.RightParenthesisExpected,[p.CurlyR])}return this.finish(e)}return null}_parseElementName(){const e=this.mark(),n=super._parseElementName();return n&&!this.hasWhitespace()&&this.peek(p.ParenthesisL)?(this.restoreAtMark(e),null):n}_tryParsePseudoIdentifier(){return this._parseInterpolation()||super._tryParsePseudoIdentifier()}_parseWarnAndDebug(){if(!this.peekKeyword("@debug")&&!this.peekKeyword("@warn")&&!this.peekKeyword("@error"))return null;const e=this.createNode(v.Debug);return this.consumeToken(),e.addChild(this._parseExpr()),this.finish(e)}_parseControlStatement(e=this._parseRuleSetDeclaration.bind(this)){return this.peek(p.AtKeyword)?this._parseIfStatement(e)||this._parseForStatement(e)||this._parseEachStatement(e)||this._parseWhileStatement(e):null}_parseIfStatement(e){return this.peekKeyword("@if")?this._internalParseIfStatement(e):null}_internalParseIfStatement(e){const n=this.create(bp);if(this.consumeToken(),!n.setExpression(this._parseExpr(!0)))return this.finish(n,S.ExpressionExpected);if(this._parseBody(n,e),this.acceptKeyword("@else")){if(this.peekIdent("if"))n.setElseClause(this._internalParseIfStatement(e));else if(this.peek(p.CurlyL)){const r=this.create(xp);this._parseBody(r,e),n.setElseClause(r)}}return this.finish(n)}_parseForStatement(e){if(!this.peekKeyword("@for"))return null;const n=this.create(wp);return this.consumeToken(),n.setVariable(this._parseVariable())?this.acceptIdent("from")?n.addChild(this._parseBinaryExpr())?!this.acceptIdent("to")&&!this.acceptIdent("through")?this.finish(n,ks.ThroughOrToExpected,[p.CurlyR]):n.addChild(this._parseBinaryExpr())?this._parseBody(n,e):this.finish(n,S.ExpressionExpected,[p.CurlyR]):this.finish(n,S.ExpressionExpected,[p.CurlyR]):this.finish(n,ks.FromExpected,[p.CurlyR]):this.finish(n,S.VariableNameExpected,[p.CurlyR])}_parseEachStatement(e){if(!this.peekKeyword("@each"))return null;const n=this.create(vp);this.consumeToken();const r=n.getVariables();if(!r.addChild(this._parseVariable()))return this.finish(n,S.VariableNameExpected,[p.CurlyR]);for(;this.accept(p.Comma);)if(!r.addChild(this._parseVariable()))return this.finish(n,S.VariableNameExpected,[p.CurlyR]);return this.finish(r),this.acceptIdent("in")?n.addChild(this._parseExpr())?this._parseBody(n,e):this.finish(n,S.ExpressionExpected,[p.CurlyR]):this.finish(n,ks.InExpected,[p.CurlyR])}_parseWhileStatement(e){if(!this.peekKeyword("@while"))return null;const n=this.create(yp);return this.consumeToken(),n.addChild(this._parseBinaryExpr())?this._parseBody(n,e):this.finish(n,S.ExpressionExpected,[p.CurlyR])}_parseFunctionBodyDeclaration(){return this._parseVariableDeclaration()||this._parseReturnStatement()||this._parseWarnAndDebug()||this._parseControlStatement(this._parseFunctionBodyDeclaration.bind(this))}_parseFunctionDeclaration(){if(!this.peekKeyword("@function"))return null;const e=this.create(cr);if(this.consumeToken(),!e.setIdentifier(this._parseIdent([Q.Function])))return this.finish(e,S.IdentifierExpected,[p.CurlyR]);if(!this.accept(p.ParenthesisL))return this.finish(e,S.LeftParenthesisExpected,[p.CurlyR]);if(e.getParameters().addChild(this._parseParameterDeclaration())){for(;this.accept(p.Comma)&&!this.peek(p.ParenthesisR);)if(!e.getParameters().addChild(this._parseParameterDeclaration()))return this.finish(e,S.VariableNameExpected)}return this.accept(p.ParenthesisR)?this._parseBody(e,this._parseFunctionBodyDeclaration.bind(this)):this.finish(e,S.RightParenthesisExpected,[p.CurlyR])}_parseReturnStatement(){if(!this.peekKeyword("@return"))return null;const e=this.createNode(v.ReturnStatement);return this.consumeToken(),e.addChild(this._parseExpr())?this.finish(e):this.finish(e,S.ExpressionExpected)}_parseMixinDeclaration(){if(!this.peekKeyword("@mixin"))return null;const e=this.create(In);if(this.consumeToken(),!e.setIdentifier(this._parseIdent([Q.Mixin])))return this.finish(e,S.IdentifierExpected,[p.CurlyR]);if(this.accept(p.ParenthesisL)){if(e.getParameters().addChild(this._parseParameterDeclaration())){for(;this.accept(p.Comma)&&!this.peek(p.ParenthesisR);)if(!e.getParameters().addChild(this._parseParameterDeclaration()))return this.finish(e,S.VariableNameExpected)}if(!this.accept(p.ParenthesisR))return this.finish(e,S.RightParenthesisExpected,[p.CurlyR])}return this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_parseParameterDeclaration(){const e=this.create(lr);return e.setIdentifier(this._parseVariable())?(this.accept(Ir),this.accept(p.Colon)&&!e.setDefaultValue(this._parseExpr(!0))?this.finish(e,S.VariableValueExpected,[],[p.Comma,p.ParenthesisR]):this.finish(e)):null}_parseMixinContent(){if(!this.peekKeyword("@content"))return null;const e=this.create(Up);if(this.consumeToken(),this.accept(p.ParenthesisL)){if(e.getArguments().addChild(this._parseFunctionArgument())){for(;this.accept(p.Comma)&&!this.peek(p.ParenthesisR);)if(!e.getArguments().addChild(this._parseFunctionArgument()))return this.finish(e,S.ExpressionExpected)}if(!this.accept(p.ParenthesisR))return this.finish(e,S.RightParenthesisExpected)}return this.finish(e)}_parseMixinReference(){if(!this.peekKeyword("@include"))return null;const e=this.create(dr);this.consumeToken();const n=this._parseIdent([Q.Mixin]);if(!e.setIdentifier(n))return this.finish(e,S.IdentifierExpected,[p.CurlyR]);if(!this.hasWhitespace()&&this.acceptDelim(".")&&!this.hasWhitespace()){const r=this._parseIdent([Q.Mixin]);if(!r)return this.finish(e,S.IdentifierExpected,[p.CurlyR]);const i=this.create(fl);n.referenceTypes=[Q.Module],i.setIdentifier(n),e.setIdentifier(r),e.addChild(i)}if(this.accept(p.ParenthesisL)){if(e.getArguments().addChild(this._parseFunctionArgument())){for(;this.accept(p.Comma)&&!this.peek(p.ParenthesisR);)if(!e.getArguments().addChild(this._parseFunctionArgument()))return this.finish(e,S.ExpressionExpected)}if(!this.accept(p.ParenthesisR))return this.finish(e,S.RightParenthesisExpected)}return(this.peekIdent("using")||this.peek(p.CurlyL))&&e.setContent(this._parseMixinContentDeclaration()),this.finish(e)}_parseMixinContentDeclaration(){const e=this.create(Bp);if(this.acceptIdent("using")){if(!this.accept(p.ParenthesisL))return this.finish(e,S.LeftParenthesisExpected,[p.CurlyL]);if(e.getParameters().addChild(this._parseParameterDeclaration())){for(;this.accept(p.Comma)&&!this.peek(p.ParenthesisR);)if(!e.getParameters().addChild(this._parseParameterDeclaration()))return this.finish(e,S.VariableNameExpected)}if(!this.accept(p.ParenthesisR))return this.finish(e,S.RightParenthesisExpected,[p.CurlyL])}return this.peek(p.CurlyL)&&this._parseBody(e,this._parseMixinReferenceBodyStatement.bind(this)),this.finish(e)}_parseMixinReferenceBodyStatement(){return this._tryParseKeyframeSelector()||this._parseRuleSetDeclaration()}_parseFunctionArgument(){const e=this.create(Gt),n=this.mark(),r=this._parseVariable();if(r)if(this.accept(p.Colon))e.setIdentifier(r);else{if(this.accept(Ir))return e.setValue(r),this.finish(e);this.restoreAtMark(n)}return e.setValue(this._parseExpr(!0))?(this.accept(Ir),e.addChild(this._parsePrio()),this.finish(e)):e.setValue(this._tryParsePrio())?this.finish(e):null}_parseURLArgument(){const e=this.mark(),n=super._parseURLArgument();if(!n||!this.peek(p.ParenthesisR)){this.restoreAtMark(e);const r=this.create(W);return r.addChild(this._parseBinaryExpr()),this.finish(r)}return n}_parseOperation(){if(!this.peek(p.ParenthesisL))return null;const e=this.create(W);for(this.consumeToken();e.addChild(this._parseListElement());)this.accept(p.Comma);return this.accept(p.ParenthesisR)?this.finish(e):this.finish(e,S.RightParenthesisExpected)}_parseListElement(){const e=this.create(qp),n=this._parseBinaryExpr();if(!n)return null;if(this.accept(p.Colon)){if(e.setKey(n),!e.setValue(this._parseBinaryExpr()))return this.finish(e,S.ExpressionExpected)}else e.setValue(n);return this.finish(e)}_parseUse(){if(!this.peekKeyword("@use"))return null;const e=this.create(Cp);if(this.consumeToken(),!e.addChild(this._parseStringLiteral()))return this.finish(e,S.StringLiteralExpected);if(!this.peek(p.SemiColon)&&!this.peek(p.EOF)){if(!this.peekRegExp(p.Ident,/as|with/))return this.finish(e,S.UnknownKeyword);if(this.acceptIdent("as")&&!e.setIdentifier(this._parseIdent([Q.Module]))&&!this.acceptDelim("*"))return this.finish(e,S.IdentifierOrWildcardExpected);if(this.acceptIdent("with")){if(!this.accept(p.ParenthesisL))return this.finish(e,S.LeftParenthesisExpected,[p.ParenthesisR]);if(!e.getParameters().addChild(this._parseModuleConfigDeclaration()))return this.finish(e,S.VariableNameExpected);for(;this.accept(p.Comma)&&!this.peek(p.ParenthesisR);)if(!e.getParameters().addChild(this._parseModuleConfigDeclaration()))return this.finish(e,S.VariableNameExpected);if(!this.accept(p.ParenthesisR))return this.finish(e,S.RightParenthesisExpected)}}return!this.accept(p.SemiColon)&&!this.accept(p.EOF)?this.finish(e,S.SemiColonExpected):this.finish(e)}_parseModuleConfigDeclaration(){const e=this.create(kp);return e.setIdentifier(this._parseVariable())?!this.accept(p.Colon)||!e.setValue(this._parseExpr(!0))?this.finish(e,S.VariableValueExpected,[],[p.Comma,p.ParenthesisR]):this.accept(p.Exclamation)&&(this.hasWhitespace()||!this.acceptIdent("default"))?this.finish(e,S.UnknownKeyword):this.finish(e):null}_parseForward(){if(!this.peekKeyword("@forward"))return null;const e=this.create(_p);if(this.consumeToken(),!e.addChild(this._parseStringLiteral()))return this.finish(e,S.StringLiteralExpected);if(this.acceptIdent("as")){const n=this._parseIdent([Q.Forward]);if(!e.setIdentifier(n))return this.finish(e,S.IdentifierExpected);if(this.hasWhitespace()||!this.acceptDelim("*"))return this.finish(e,S.WildcardExpected)}if(this.acceptIdent("with")){if(!this.accept(p.ParenthesisL))return this.finish(e,S.LeftParenthesisExpected,[p.ParenthesisR]);if(!e.getParameters().addChild(this._parseModuleConfigDeclaration()))return this.finish(e,S.VariableNameExpected);for(;this.accept(p.Comma)&&!this.peek(p.ParenthesisR);)if(!e.getParameters().addChild(this._parseModuleConfigDeclaration()))return this.finish(e,S.VariableNameExpected);if(!this.accept(p.ParenthesisR))return this.finish(e,S.RightParenthesisExpected)}else if((this.peekIdent("hide")||this.peekIdent("show"))&&!e.addChild(this._parseForwardVisibility()))return this.finish(e,S.IdentifierOrVariableExpected);return!this.accept(p.SemiColon)&&!this.accept(p.EOF)?this.finish(e,S.SemiColonExpected):this.finish(e)}_parseForwardVisibility(){const e=this.create(Ep);for(e.setIdentifier(this._parseIdent());e.addChild(this._parseVariable()||this._parseIdent());)this.accept(p.Comma);return e.getChildren().length>1?e:null}_parseSupportsCondition(){return this._parseInterpolation()||super._parseSupportsCondition()}}const at=w("Sass documentation");class ge extends ls{constructor(e,n){super("$",e,n),Jc(ge.scssModuleLoaders),Jc(ge.scssModuleBuiltIns)}isImportPathParent(e){return e===v.Forward||e===v.Use||super.isImportPathParent(e)}getCompletionForImportPath(e,n){const r=e.getParent().type;if(r===v.Forward||r===v.Use)for(let i of ge.scssModuleBuiltIns){const s={label:i.label,documentation:i.documentation,textEdit:j.replace(this.getCompletionRange(e),`'${i.label}'`),kind:q.Module};n.items.push(s)}return super.getCompletionForImportPath(e,n)}createReplaceFunction(){let e=1;return(n,r)=>"\\"+r+": ${"+e+++":"+(ge.variableDefaults[r]||"")+"}"}createFunctionProposals(e,n,r,i){for(const s of e){const a=s.func.replace(/\[?(\$\w+)\]?/g,this.createReplaceFunction()),l={label:s.func.substr(0,s.func.indexOf("(")),detail:s.func,documentation:s.desc,textEdit:j.replace(this.getCompletionRange(n),a),insertTextFormat:Ie.Snippet,kind:q.Function};r&&(l.sortText="z"),i.items.push(l)}return i}getCompletionsForSelector(e,n,r){return this.createFunctionProposals(ge.selectorFuncs,null,!0,r),super.getCompletionsForSelector(e,n,r)}getTermProposals(e,n,r){let i=ge.builtInFuncs;return e&&(i=i.filter(s=>!s.type||!e.restrictions||e.restrictions.indexOf(s.type)!==-1)),this.createFunctionProposals(i,n,!0,r),super.getTermProposals(e,n,r)}getColorProposals(e,n,r){return this.createFunctionProposals(ge.colorProposals,n,!1,r),super.getColorProposals(e,n,r)}getCompletionsForDeclarationProperty(e,n){return this.getCompletionForAtDirectives(n),this.getCompletionsForSelector(null,!0,n),super.getCompletionsForDeclarationProperty(e,n)}getCompletionsForExtendsReference(e,n,r){const i=this.getSymbolContext().findSymbolsAtOffset(this.offset,Q.Rule);for(const s of i){const a={label:s.name,textEdit:j.replace(this.getCompletionRange(n),s.name),kind:q.Function};r.items.push(a)}return r}getCompletionForAtDirectives(e){return e.items.push(...ge.scssAtDirectives),e}getCompletionForTopLevel(e){return this.getCompletionForAtDirectives(e),this.getCompletionForModuleLoaders(e),super.getCompletionForTopLevel(e),e}getCompletionForModuleLoaders(e){return e.items.push(...ge.scssModuleLoaders),e}}ge.variableDefaults={$red:"1",$green:"2",$blue:"3",$alpha:"1.0",$color:"#000000",$weight:"0.5",$hue:"0",$saturation:"0%",$lightness:"0%",$degrees:"0",$amount:"0",$string:'""',$substring:'"s"',$number:"0",$limit:"1"},ge.colorProposals=[{func:"red($color)",desc:w("Gets the red component of a color.")},{func:"green($color)",desc:w("Gets the green component of a color.")},{func:"blue($color)",desc:w("Gets the blue component of a color.")},{func:"mix($color, $color, [$weight])",desc:w("Mixes two colors together.")},{func:"hue($color)",desc:w("Gets the hue component of a color.")},{func:"saturation($color)",desc:w("Gets the saturation component of a color.")},{func:"lightness($color)",desc:w("Gets the lightness component of a color.")},{func:"adjust-hue($color, $degrees)",desc:w("Changes the hue of a color.")},{func:"lighten($color, $amount)",desc:w("Makes a color lighter.")},{func:"darken($color, $amount)",desc:w("Makes a color darker.")},{func:"saturate($color, $amount)",desc:w("Makes a color more saturated.")},{func:"desaturate($color, $amount)",desc:w("Makes a color less saturated.")},{func:"grayscale($color)",desc:w("Converts a color to grayscale.")},{func:"complement($color)",desc:w("Returns the complement of a color.")},{func:"invert($color)",desc:w("Returns the inverse of a color.")},{func:"alpha($color)",desc:w("Gets the opacity component of a color.")},{func:"opacity($color)",desc:"Gets the alpha component (opacity) of a color."},{func:"rgba($color, $alpha)",desc:w("Changes the alpha component for a color.")},{func:"opacify($color, $amount)",desc:w("Makes a color more opaque.")},{func:"fade-in($color, $amount)",desc:w("Makes a color more opaque.")},{func:"transparentize($color, $amount)",desc:w("Makes a color more transparent.")},{func:"fade-out($color, $amount)",desc:w("Makes a color more transparent.")},{func:"adjust-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])",desc:w("Increases or decreases one or more components of a color.")},{func:"scale-color($color, [$red], [$green], [$blue], [$saturation], [$lightness], [$alpha])",desc:w("Fluidly scales one or more properties of a color.")},{func:"change-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])",desc:w("Changes one or more properties of a color.")},{func:"ie-hex-str($color)",desc:w("Converts a color into the format understood by IE filters.")}],ge.selectorFuncs=[{func:"selector-nest($selectors…)",desc:w("Nests selector beneath one another like they would be nested in the stylesheet.")},{func:"selector-append($selectors…)",desc:w("Appends selectors to one another without spaces in between.")},{func:"selector-extend($selector, $extendee, $extender)",desc:w("Extends $extendee with $extender within $selector.")},{func:"selector-replace($selector, $original, $replacement)",desc:w("Replaces $original with $replacement within $selector.")},{func:"selector-unify($selector1, $selector2)",desc:w("Unifies two selectors to produce a selector that matches elements matched by both.")},{func:"is-superselector($super, $sub)",desc:w("Returns whether $super matches all the elements $sub does, and possibly more.")},{func:"simple-selectors($selector)",desc:w("Returns the simple selectors that comprise a compound selector.")},{func:"selector-parse($selector)",desc:w("Parses a selector into the format returned by &.")}],ge.builtInFuncs=[{func:"unquote($string)",desc:w("Removes quotes from a string.")},{func:"quote($string)",desc:w("Adds quotes to a string.")},{func:"str-length($string)",desc:w("Returns the number of characters in a string.")},{func:"str-insert($string, $insert, $index)",desc:w("Inserts $insert into $string at $index.")},{func:"str-index($string, $substring)",desc:w("Returns the index of the first occurance of $substring in $string.")},{func:"str-slice($string, $start-at, [$end-at])",desc:w("Extracts a substring from $string.")},{func:"to-upper-case($string)",desc:w("Converts a string to upper case.")},{func:"to-lower-case($string)",desc:w("Converts a string to lower case.")},{func:"percentage($number)",desc:w("Converts a unitless number to a percentage."),type:"percentage"},{func:"round($number)",desc:w("Rounds a number to the nearest whole number.")},{func:"ceil($number)",desc:w("Rounds a number up to the next whole number.")},{func:"floor($number)",desc:w("Rounds a number down to the previous whole number.")},{func:"abs($number)",desc:w("Returns the absolute value of a number.")},{func:"min($numbers)",desc:w("Finds the minimum of several numbers.")},{func:"max($numbers)",desc:w("Finds the maximum of several numbers.")},{func:"random([$limit])",desc:w("Returns a random number.")},{func:"length($list)",desc:w("Returns the length of a list.")},{func:"nth($list, $n)",desc:w("Returns a specific item in a list.")},{func:"set-nth($list, $n, $value)",desc:w("Replaces the nth item in a list.")},{func:"join($list1, $list2, [$separator])",desc:w("Joins together two lists into one.")},{func:"append($list1, $val, [$separator])",desc:w("Appends a single value onto the end of a list.")},{func:"zip($lists)",desc:w("Combines several lists into a single multidimensional list.")},{func:"index($list, $value)",desc:w("Returns the position of a value within a list.")},{func:"list-separator(#list)",desc:w("Returns the separator of a list.")},{func:"map-get($map, $key)",desc:w("Returns the value in a map associated with a given key.")},{func:"map-merge($map1, $map2)",desc:w("Merges two maps together into a new map.")},{func:"map-remove($map, $keys)",desc:w("Returns a new map with keys removed.")},{func:"map-keys($map)",desc:w("Returns a list of all keys in a map.")},{func:"map-values($map)",desc:w("Returns a list of all values in a map.")},{func:"map-has-key($map, $key)",desc:w("Returns whether a map has a value associated with a given key.")},{func:"keywords($args)",desc:w("Returns the keywords passed to a function that takes variable arguments.")},{func:"feature-exists($feature)",desc:w("Returns whether a feature exists in the current Sass runtime.")},{func:"variable-exists($name)",desc:w("Returns whether a variable with the given name exists in the current scope.")},{func:"global-variable-exists($name)",desc:w("Returns whether a variable with the given name exists in the global scope.")},{func:"function-exists($name)",desc:w("Returns whether a function with the given name exists.")},{func:"mixin-exists($name)",desc:w("Returns whether a mixin with the given name exists.")},{func:"inspect($value)",desc:w("Returns the string representation of a value as it would be represented in Sass.")},{func:"type-of($value)",desc:w("Returns the type of a value.")},{func:"unit($number)",desc:w("Returns the unit(s) associated with a number.")},{func:"unitless($number)",desc:w("Returns whether a number has units.")},{func:"comparable($number1, $number2)",desc:w("Returns whether two numbers can be added, subtracted, or compared.")},{func:"call($name, $args…)",desc:w("Dynamically calls a Sass function.")}],ge.scssAtDirectives=[{label:"@extend",documentation:w("Inherits the styles of another selector."),kind:q.Keyword},{label:"@at-root",documentation:w("Causes one or more rules to be emitted at the root of the document."),kind:q.Keyword},{label:"@debug",documentation:w("Prints the value of an expression to the standard error output stream. Useful for debugging complicated Sass files."),kind:q.Keyword},{label:"@warn",documentation:w("Prints the value of an expression to the standard error output stream. Useful for libraries that need to warn users of deprecations or recovering from minor mixin usage mistakes. Warnings can be turned off with the `--quiet` command-line option or the `:quiet` Sass option."),kind:q.Keyword},{label:"@error",documentation:w("Throws the value of an expression as a fatal error with stack trace. Useful for validating arguments to mixins and functions."),kind:q.Keyword},{label:"@if",documentation:w("Includes the body if the expression does not evaluate to `false` or `null`."),insertText:`@if \${1:expr} { + $0 +}`,insertTextFormat:Ie.Snippet,kind:q.Keyword},{label:"@for",documentation:w("For loop that repeatedly outputs a set of styles for each `$var` in the `from/through` or `from/to` clause."),insertText:"@for \\$${1:var} from ${2:start} ${3|to,through|} ${4:end} {\n $0\n}",insertTextFormat:Ie.Snippet,kind:q.Keyword},{label:"@each",documentation:w("Each loop that sets `$var` to each item in the list or map, then outputs the styles it contains using that value of `$var`."),insertText:"@each \\$${1:var} in ${2:list} {\n $0\n}",insertTextFormat:Ie.Snippet,kind:q.Keyword},{label:"@while",documentation:w("While loop that takes an expression and repeatedly outputs the nested styles until the statement evaluates to `false`."),insertText:`@while \${1:condition} { + $0 +}`,insertTextFormat:Ie.Snippet,kind:q.Keyword},{label:"@mixin",documentation:w("Defines styles that can be re-used throughout the stylesheet with `@include`."),insertText:`@mixin \${1:name} { + $0 +}`,insertTextFormat:Ie.Snippet,kind:q.Keyword},{label:"@include",documentation:w("Includes the styles defined by another mixin into the current rule."),kind:q.Keyword},{label:"@function",documentation:w("Defines complex operations that can be re-used throughout stylesheets."),kind:q.Keyword}],ge.scssModuleLoaders=[{label:"@use",documentation:w("Loads mixins, functions, and variables from other Sass stylesheets as 'modules', and combines CSS from multiple stylesheets together."),references:[{name:at,url:"https://sass-lang.com/documentation/at-rules/use"}],insertText:"@use $0;",insertTextFormat:Ie.Snippet,kind:q.Keyword},{label:"@forward",documentation:w("Loads a Sass stylesheet and makes its mixins, functions, and variables available when this stylesheet is loaded with the @use rule."),references:[{name:at,url:"https://sass-lang.com/documentation/at-rules/forward"}],insertText:"@forward $0;",insertTextFormat:Ie.Snippet,kind:q.Keyword}],ge.scssModuleBuiltIns=[{label:"sass:math",documentation:w("Provides functions that operate on numbers."),references:[{name:at,url:"https://sass-lang.com/documentation/modules/math"}]},{label:"sass:string",documentation:w("Makes it easy to combine, search, or split apart strings."),references:[{name:at,url:"https://sass-lang.com/documentation/modules/string"}]},{label:"sass:color",documentation:w("Generates new colors based on existing ones, making it easy to build color themes."),references:[{name:at,url:"https://sass-lang.com/documentation/modules/color"}]},{label:"sass:list",documentation:w("Lets you access and modify values in lists."),references:[{name:at,url:"https://sass-lang.com/documentation/modules/list"}]},{label:"sass:map",documentation:w("Makes it possible to look up the value associated with a key in a map, and much more."),references:[{name:at,url:"https://sass-lang.com/documentation/modules/map"}]},{label:"sass:selector",documentation:w("Provides access to Sass’s powerful selector engine."),references:[{name:at,url:"https://sass-lang.com/documentation/modules/selector"}]},{label:"sass:meta",documentation:w("Exposes the details of Sass’s inner workings."),references:[{name:at,url:"https://sass-lang.com/documentation/modules/meta"}]}];function Jc(t){t.forEach(e=>{if(e.documentation&&e.references&&e.references.length>0){const n=typeof e.documentation=="string"?{kind:"markdown",value:e.documentation}:{kind:"markdown",value:e.documentation.value};n.value+=` + +`,n.value+=e.references.map(r=>`[${r.name}](${r.url})`).join(" | "),e.documentation=n}})}const Xc=47,Km=10,Zm=13,ef=12,_s=96,Es=46;let tf=p.CustomToken;const Fs=tf++;class Yc extends _n{scanNext(e){const n=this.escapedJavaScript();return n!==null?this.finishToken(e,n):this.stream.advanceIfChars([Es,Es,Es])?this.finishToken(e,Fs):super.scanNext(e)}comment(){return super.comment()?!0:!this.inURL&&this.stream.advanceIfChars([Xc,Xc])?(this.stream.advanceWhileChar(e=>{switch(e){case Km:case Zm:case ef:return!1;default:return!0}}),!0):!1}escapedJavaScript(){return this.stream.peekChar()===_s?(this.stream.advance(1),this.stream.advanceWhileChar(n=>n!==_s),this.stream.advanceIfChar(_s)?p.EscapedJavaScript:p.BadEscapedJavaScript):null}}class nf extends Cr{constructor(){super(new Yc)}_parseStylesheetStatement(e=!1){return this.peek(p.AtKeyword)?this._parseVariableDeclaration()||this._parsePlugin()||super._parseStylesheetAtStatement(e):this._tryParseMixinDeclaration()||this._tryParseMixinReference()||this._parseFunction()||this._parseRuleset(!0)}_parseImport(){if(!this.peekKeyword("@import")&&!this.peekKeyword("@import-once"))return null;const e=this.create(Li);if(this.consumeToken(),this.accept(p.ParenthesisL)){if(!this.accept(p.Ident))return this.finish(e,S.IdentifierExpected,[p.SemiColon]);do if(!this.accept(p.Comma))break;while(this.accept(p.Ident));if(!this.accept(p.ParenthesisR))return this.finish(e,S.RightParenthesisExpected,[p.SemiColon])}return!e.addChild(this._parseURILiteral())&&!e.addChild(this._parseStringLiteral())?this.finish(e,S.URIOrStringExpected,[p.SemiColon]):(!this.peek(p.SemiColon)&&!this.peek(p.EOF)&&e.setMedialist(this._parseMediaQueryList()),this._completeParseImport(e))}_parsePlugin(){if(!this.peekKeyword("@plugin"))return null;const e=this.createNode(v.Plugin);return this.consumeToken(),e.addChild(this._parseStringLiteral())?this.accept(p.SemiColon)?this.finish(e):this.finish(e,S.SemiColonExpected):this.finish(e,S.StringLiteralExpected)}_parseMediaQuery(){const e=super._parseMediaQuery();if(!e){const n=this.create(ul);return n.addChild(this._parseVariable())?this.finish(n):null}return e}_parseMediaDeclaration(e=!1){return this._tryParseRuleset(e)||this._tryToParseDeclaration()||this._tryParseMixinDeclaration()||this._tryParseMixinReference()||this._parseDetachedRuleSetMixin()||this._parseStylesheetStatement(e)}_parseMediaFeatureName(){return this._parseIdent()||this._parseVariable()}_parseVariableDeclaration(e=[]){const n=this.create(hr),r=this.mark();if(!n.setVariable(this._parseVariable(!0)))return null;if(this.accept(p.Colon)){if(this.prevToken&&(n.colonPosition=this.prevToken.offset),n.setValue(this._parseDetachedRuleSet()))n.needsSemicolon=!1;else if(!n.setValue(this._parseExpr()))return this.finish(n,S.VariableValueExpected,[],e);n.addChild(this._parsePrio())}else return this.restoreAtMark(r),null;return this.peek(p.SemiColon)&&(n.semicolonPosition=this.token.offset),this.finish(n)}_parseDetachedRuleSet(){let e=this.mark();if(this.peekDelim("#")||this.peekDelim("."))if(this.consumeToken(),!this.hasWhitespace()&&this.accept(p.ParenthesisL)){let r=this.create(In);if(r.getParameters().addChild(this._parseMixinParameter()))for(;(this.accept(p.Comma)||this.accept(p.SemiColon))&&!this.peek(p.ParenthesisR);)r.getParameters().addChild(this._parseMixinParameter())||this.markError(r,S.IdentifierExpected,[],[p.ParenthesisR]);if(!this.accept(p.ParenthesisR))return this.restoreAtMark(e),null}else return this.restoreAtMark(e),null;if(!this.peek(p.CurlyL))return null;const n=this.create(oe);return this._parseBody(n,this._parseDetachedRuleSetBody.bind(this)),this.finish(n)}_parseDetachedRuleSetBody(){return this._tryParseKeyframeSelector()||this._parseRuleSetDeclaration()}_addLookupChildren(e){if(!e.addChild(this._parseLookupValue()))return!1;let n=!1;for(;this.peek(p.BracketL)&&(n=!0),!!e.addChild(this._parseLookupValue());)n=!1;return!n}_parseLookupValue(){const e=this.create(W),n=this.mark();return this.accept(p.BracketL)?(e.addChild(this._parseVariable(!1,!0))||e.addChild(this._parsePropertyIdentifier()))&&this.accept(p.BracketR)||this.accept(p.BracketR)?e:(this.restoreAtMark(n),null):(this.restoreAtMark(n),null)}_parseVariable(e=!1,n=!1){const r=!e&&this.peekDelim("$");if(!this.peekDelim("@")&&!r&&!this.peek(p.AtKeyword))return null;const i=this.create(Wi),s=this.mark();for(;this.acceptDelim("@")||!e&&this.acceptDelim("$");)if(this.hasWhitespace())return this.restoreAtMark(s),null;return!this.accept(p.AtKeyword)&&!this.accept(p.Ident)?(this.restoreAtMark(s),null):!n&&this.peek(p.BracketL)&&!this._addLookupChildren(i)?(this.restoreAtMark(s),null):i}_parseTermExpression(){return this._parseVariable()||this._parseEscaped()||super._parseTermExpression()||this._tryParseMixinReference(!1)}_parseEscaped(){if(this.peek(p.EscapedJavaScript)||this.peek(p.BadEscapedJavaScript)){const e=this.createNode(v.EscapedValue);return this.consumeToken(),this.finish(e)}if(this.peekDelim("~")){const e=this.createNode(v.EscapedValue);return this.consumeToken(),this.accept(p.String)||this.accept(p.EscapedJavaScript)?this.finish(e):this.finish(e,S.TermExpected)}return null}_parseOperator(){const e=this._parseGuardOperator();return e||super._parseOperator()}_parseGuardOperator(){if(this.peekDelim(">")){const e=this.createNode(v.Operator);return this.consumeToken(),this.acceptDelim("="),e}else if(this.peekDelim("=")){const e=this.createNode(v.Operator);return this.consumeToken(),this.acceptDelim("<"),e}else if(this.peekDelim("<")){const e=this.createNode(v.Operator);return this.consumeToken(),this.acceptDelim("="),e}return null}_parseRuleSetDeclaration(){return this.peek(p.AtKeyword)?this._parseKeyframe()||this._parseMedia(!0)||this._parseImport()||this._parseSupports(!0)||this._parseLayer()||this._parsePropertyAtRule()||this._parseContainer(!0)||this._parseDetachedRuleSetMixin()||this._parseVariableDeclaration()||this._parseRuleSetDeclarationAtStatement():this._tryParseMixinDeclaration()||this._tryParseRuleset(!0)||this._tryParseMixinReference()||this._parseFunction()||this._parseExtend()||this._parseDeclaration()}_parseKeyframeIdent(){return this._parseIdent([Q.Keyframe])||this._parseVariable()}_parseKeyframeSelector(){return this._parseDetachedRuleSetMixin()||super._parseKeyframeSelector()}_parseSelector(e){const n=this.create(En);let r=!1;for(e&&(r=n.addChild(this._parseCombinator()));n.addChild(this._parseSimpleSelector());){r=!0;const i=this.mark();if(n.addChild(this._parseGuard())&&this.peek(p.CurlyL))break;this.restoreAtMark(i),n.addChild(this._parseCombinator())}return r?this.finish(n):null}_parseNestingSelector(){if(this.peekDelim("&")){const e=this.createNode(v.SelectorCombinator);for(this.consumeToken();!this.hasWhitespace()&&(this.acceptDelim("-")||this.accept(p.Num)||this.accept(p.Dimension)||e.addChild(this._parseIdent())||this.acceptDelim("&")););return this.finish(e)}return null}_parseSelectorIdent(){if(!this.peekInterpolatedIdent())return null;const e=this.createNode(v.SelectorInterpolation);return this._acceptInterpolatedIdent(e)?this.finish(e):null}_parsePropertyIdentifier(e=!1){const n=/^[\w-]+/;if(!this.peekInterpolatedIdent()&&!this.peekRegExp(this.token.type,n))return null;const r=this.mark(),i=this.create(ze);i.isCustomProperty=this.acceptDelim("-")&&this.acceptDelim("-");let s=!1;return e?i.isCustomProperty?s=i.addChild(this._parseIdent()):s=i.addChild(this._parseRegexp(n)):i.isCustomProperty?s=this._acceptInterpolatedIdent(i):s=this._acceptInterpolatedIdent(i,n),s?(!e&&!this.hasWhitespace()&&(this.acceptDelim("+"),this.hasWhitespace()||this.acceptIdent("_")),this.finish(i)):(this.restoreAtMark(r),null)}peekInterpolatedIdent(){return this.peek(p.Ident)||this.peekDelim("@")||this.peekDelim("$")||this.peekDelim("-")}_acceptInterpolatedIdent(e,n){let r=!1;const i=()=>{const a=this.mark();return this.acceptDelim("-")&&(this.hasWhitespace()||this.acceptDelim("-"),this.hasWhitespace())?(this.restoreAtMark(a),null):this._parseInterpolation()},s=n?()=>this.acceptRegexp(n):()=>this.accept(p.Ident);for(;(s()||e.addChild(this._parseInterpolation()||this.try(i)))&&(r=!0,!this.hasWhitespace()););return r}_parseInterpolation(){const e=this.mark();if(this.peekDelim("@")||this.peekDelim("$")){const n=this.createNode(v.Interpolation);return this.consumeToken(),this.hasWhitespace()||!this.accept(p.CurlyL)?(this.restoreAtMark(e),null):n.addChild(this._parseIdent())?this.accept(p.CurlyR)?this.finish(n):this.finish(n,S.RightCurlyExpected):this.finish(n,S.IdentifierExpected)}return null}_tryParseMixinDeclaration(){const e=this.mark(),n=this.create(In);if(!n.setIdentifier(this._parseMixinDeclarationIdentifier())||!this.accept(p.ParenthesisL))return this.restoreAtMark(e),null;if(n.getParameters().addChild(this._parseMixinParameter()))for(;(this.accept(p.Comma)||this.accept(p.SemiColon))&&!this.peek(p.ParenthesisR);)n.getParameters().addChild(this._parseMixinParameter())||this.markError(n,S.IdentifierExpected,[],[p.ParenthesisR]);return this.accept(p.ParenthesisR)?(n.setGuard(this._parseGuard()),this.peek(p.CurlyL)?this._parseBody(n,this._parseMixInBodyDeclaration.bind(this)):(this.restoreAtMark(e),null)):(this.restoreAtMark(e),null)}_parseMixInBodyDeclaration(){return this._parseFontFace()||this._parseRuleSetDeclaration()}_parseMixinDeclarationIdentifier(){let e;if(this.peekDelim("#")||this.peekDelim(".")){if(e=this.create(ze),this.consumeToken(),this.hasWhitespace()||!e.addChild(this._parseIdent()))return null}else if(this.peek(p.Hash))e=this.create(ze),this.consumeToken();else return null;return e.referenceTypes=[Q.Mixin],this.finish(e)}_parsePseudo(){if(!this.peek(p.Colon))return null;const e=this.mark(),n=this.create(Nn);return this.consumeToken(),this.acceptIdent("extend")?this._completeExtends(n):(this.restoreAtMark(e),super._parsePseudo())}_parseExtend(){if(!this.peekDelim("&"))return null;const e=this.mark(),n=this.create(Nn);return this.consumeToken(),this.hasWhitespace()||!this.accept(p.Colon)||!this.acceptIdent("extend")?(this.restoreAtMark(e),null):this._completeExtends(n)}_completeExtends(e){if(!this.accept(p.ParenthesisL))return this.finish(e,S.LeftParenthesisExpected);const n=e.getSelectors();if(!n.addChild(this._parseSelector(!0)))return this.finish(e,S.SelectorExpected);for(;this.accept(p.Comma);)if(!n.addChild(this._parseSelector(!0)))return this.finish(e,S.SelectorExpected);return this.accept(p.ParenthesisR)?this.finish(e):this.finish(e,S.RightParenthesisExpected)}_parseDetachedRuleSetMixin(){if(!this.peek(p.AtKeyword))return null;const e=this.mark(),n=this.create(dr);return n.addChild(this._parseVariable(!0))&&(this.hasWhitespace()||!this.accept(p.ParenthesisL))?(this.restoreAtMark(e),null):this.accept(p.ParenthesisR)?this.finish(n):this.finish(n,S.RightParenthesisExpected)}_tryParseMixinReference(e=!0){const n=this.mark(),r=this.create(dr);let i=this._parseMixinDeclarationIdentifier();for(;i;){this.acceptDelim(">");const a=this._parseMixinDeclarationIdentifier();if(a)r.getNamespaces().addChild(i),i=a;else break}if(!r.setIdentifier(i))return this.restoreAtMark(n),null;let s=!1;if(this.accept(p.ParenthesisL)){if(s=!0,r.getArguments().addChild(this._parseMixinArgument())){for(;(this.accept(p.Comma)||this.accept(p.SemiColon))&&!this.peek(p.ParenthesisR);)if(!r.getArguments().addChild(this._parseMixinArgument()))return this.finish(r,S.ExpressionExpected)}if(!this.accept(p.ParenthesisR))return this.finish(r,S.RightParenthesisExpected);i.referenceTypes=[Q.Mixin]}else i.referenceTypes=[Q.Mixin,Q.Rule];return this.peek(p.BracketL)?e||this._addLookupChildren(r):r.addChild(this._parsePrio()),!s&&!this.peek(p.SemiColon)&&!this.peek(p.CurlyR)&&!this.peek(p.EOF)?(this.restoreAtMark(n),null):this.finish(r)}_parseMixinArgument(){const e=this.create(Gt),n=this.mark(),r=this._parseVariable();return r&&(this.accept(p.Colon)?e.setIdentifier(r):this.restoreAtMark(n)),e.setValue(this._parseDetachedRuleSet()||this._parseExpr(!0))?this.finish(e):(this.restoreAtMark(n),null)}_parseMixinParameter(){const e=this.create(lr);if(this.peekKeyword("@rest")){const r=this.create(W);return this.consumeToken(),this.accept(Fs)?(e.setIdentifier(this.finish(r)),this.finish(e)):this.finish(e,S.DotExpected,[],[p.Comma,p.ParenthesisR])}if(this.peek(Fs)){const r=this.create(W);return this.consumeToken(),e.setIdentifier(this.finish(r)),this.finish(e)}let n=!1;return e.setIdentifier(this._parseVariable())&&(this.accept(p.Colon),n=!0),!e.setDefaultValue(this._parseDetachedRuleSet()||this._parseExpr(!0))&&!n?null:this.finish(e)}_parseGuard(){if(!this.peekIdent("when"))return null;const e=this.create(jp);if(this.consumeToken(),!e.getConditions().addChild(this._parseGuardCondition()))return this.finish(e,S.ConditionExpected);for(;this.acceptIdent("and")||this.accept(p.Comma);)if(!e.getConditions().addChild(this._parseGuardCondition()))return this.finish(e,S.ConditionExpected);return this.finish(e)}_parseGuardCondition(){const e=this.create(Hp);return e.isNegated=this.acceptIdent("not"),this.accept(p.ParenthesisL)?(e.addChild(this._parseExpr()),this.accept(p.ParenthesisR)?this.finish(e):this.finish(e,S.RightParenthesisExpected)):e.isNegated?this.finish(e,S.LeftParenthesisExpected):null}_parseFunction(){const e=this.mark(),n=this.create(Fn);if(!n.setIdentifier(this._parseFunctionIdentifier()))return null;if(this.hasWhitespace()||!this.accept(p.ParenthesisL))return this.restoreAtMark(e),null;if(n.getArguments().addChild(this._parseMixinArgument())){for(;(this.accept(p.Comma)||this.accept(p.SemiColon))&&!this.peek(p.ParenthesisR);)if(!n.getArguments().addChild(this._parseMixinArgument()))return this.finish(n,S.ExpressionExpected)}return this.accept(p.ParenthesisR)?this.finish(n):this.finish(n,S.RightParenthesisExpected)}_parseFunctionIdentifier(){if(this.peekDelim("%")){const e=this.create(ze);return e.referenceTypes=[Q.Function],this.consumeToken(),this.finish(e)}return super._parseFunctionIdentifier()}_parseURLArgument(){const e=this.mark(),n=super._parseURLArgument();if(!n||!this.peek(p.ParenthesisR)){this.restoreAtMark(e);const r=this.create(W);return r.addChild(this._parseBinaryExpr()),this.finish(r)}return n}}class tn extends ls{constructor(e,n){super("@",e,n)}createFunctionProposals(e,n,r,i){for(const s of e){const a={label:s.name,detail:s.example,documentation:s.description,textEdit:j.replace(this.getCompletionRange(n),s.name+"($0)"),insertTextFormat:Ie.Snippet,kind:q.Function};r&&(a.sortText="z"),i.items.push(a)}return i}getTermProposals(e,n,r){let i=tn.builtInProposals;return e&&(i=i.filter(s=>!s.type||!e.restrictions||e.restrictions.indexOf(s.type)!==-1)),this.createFunctionProposals(i,n,!0,r),super.getTermProposals(e,n,r)}getColorProposals(e,n,r){return this.createFunctionProposals(tn.colorProposals,n,!1,r),super.getColorProposals(e,n,r)}getCompletionsForDeclarationProperty(e,n){return this.getCompletionsForSelector(null,!0,n),super.getCompletionsForDeclarationProperty(e,n)}}tn.builtInProposals=[{name:"if",example:"if(condition, trueValue [, falseValue]);",description:w("returns one of two values depending on a condition.")},{name:"boolean",example:"boolean(condition);",description:w('"store" a boolean test for later evaluation in a guard or if().')},{name:"length",example:"length(@list);",description:w("returns the number of elements in a value list")},{name:"extract",example:"extract(@list, index);",description:w("returns a value at the specified position in the list")},{name:"range",example:"range([start, ] end [, step]);",description:w("generate a list spanning a range of values")},{name:"each",example:"each(@list, ruleset);",description:w("bind the evaluation of a ruleset to each member of a list.")},{name:"escape",example:"escape(@string);",description:w("URL encodes a string")},{name:"e",example:"e(@string);",description:w("escape string content")},{name:"replace",example:"replace(@string, @pattern, @replacement[, @flags]);",description:w("string replace")},{name:"unit",example:"unit(@dimension, [@unit: '']);",description:w("remove or change the unit of a dimension")},{name:"color",example:"color(@string);",description:w("parses a string to a color"),type:"color"},{name:"convert",example:"convert(@value, unit);",description:w("converts numbers from one type into another")},{name:"data-uri",example:"data-uri([mimetype,] url);",description:w("inlines a resource and falls back to `url()`"),type:"url"},{name:"abs",description:w("absolute value of a number"),example:"abs(number);"},{name:"acos",description:w("arccosine - inverse of cosine function"),example:"acos(number);"},{name:"asin",description:w("arcsine - inverse of sine function"),example:"asin(number);"},{name:"ceil",example:"ceil(@number);",description:w("rounds up to an integer")},{name:"cos",description:w("cosine function"),example:"cos(number);"},{name:"floor",description:w("rounds down to an integer"),example:"floor(@number);"},{name:"percentage",description:w("converts to a %, e.g. 0.5 > 50%"),example:"percentage(@number);",type:"percentage"},{name:"round",description:w("rounds a number to a number of places"),example:"round(number, [places: 0]);"},{name:"sqrt",description:w("calculates square root of a number"),example:"sqrt(number);"},{name:"sin",description:w("sine function"),example:"sin(number);"},{name:"tan",description:w("tangent function"),example:"tan(number);"},{name:"atan",description:w("arctangent - inverse of tangent function"),example:"atan(number);"},{name:"pi",description:w("returns pi"),example:"pi();"},{name:"pow",description:w("first argument raised to the power of the second argument"),example:"pow(@base, @exponent);"},{name:"mod",description:w("first argument modulus second argument"),example:"mod(number, number);"},{name:"min",description:w("returns the lowest of one or more values"),example:"min(@x, @y);"},{name:"max",description:w("returns the lowest of one or more values"),example:"max(@x, @y);"}],tn.colorProposals=[{name:"argb",example:"argb(@color);",description:w("creates a #AARRGGBB")},{name:"hsl",example:"hsl(@hue, @saturation, @lightness);",description:w("creates a color")},{name:"hsla",example:"hsla(@hue, @saturation, @lightness, @alpha);",description:w("creates a color")},{name:"hsv",example:"hsv(@hue, @saturation, @value);",description:w("creates a color")},{name:"hsva",example:"hsva(@hue, @saturation, @value, @alpha);",description:w("creates a color")},{name:"hue",example:"hue(@color);",description:w("returns the `hue` channel of `@color` in the HSL space")},{name:"saturation",example:"saturation(@color);",description:w("returns the `saturation` channel of `@color` in the HSL space")},{name:"lightness",example:"lightness(@color);",description:w("returns the `lightness` channel of `@color` in the HSL space")},{name:"hsvhue",example:"hsvhue(@color);",description:w("returns the `hue` channel of `@color` in the HSV space")},{name:"hsvsaturation",example:"hsvsaturation(@color);",description:w("returns the `saturation` channel of `@color` in the HSV space")},{name:"hsvvalue",example:"hsvvalue(@color);",description:w("returns the `value` channel of `@color` in the HSV space")},{name:"red",example:"red(@color);",description:w("returns the `red` channel of `@color`")},{name:"green",example:"green(@color);",description:w("returns the `green` channel of `@color`")},{name:"blue",example:"blue(@color);",description:w("returns the `blue` channel of `@color`")},{name:"alpha",example:"alpha(@color);",description:w("returns the `alpha` channel of `@color`")},{name:"luma",example:"luma(@color);",description:w("returns the `luma` value (perceptual brightness) of `@color`")},{name:"saturate",example:"saturate(@color, 10%);",description:w("return `@color` 10% points more saturated")},{name:"desaturate",example:"desaturate(@color, 10%);",description:w("return `@color` 10% points less saturated")},{name:"lighten",example:"lighten(@color, 10%);",description:w("return `@color` 10% points lighter")},{name:"darken",example:"darken(@color, 10%);",description:w("return `@color` 10% points darker")},{name:"fadein",example:"fadein(@color, 10%);",description:w("return `@color` 10% points less transparent")},{name:"fadeout",example:"fadeout(@color, 10%);",description:w("return `@color` 10% points more transparent")},{name:"fade",example:"fade(@color, 50%);",description:w("return `@color` with 50% transparency")},{name:"spin",example:"spin(@color, 10);",description:w("return `@color` with a 10 degree larger in hue")},{name:"mix",example:"mix(@color1, @color2, [@weight: 50%]);",description:w("return a mix of `@color1` and `@color2`")},{name:"greyscale",example:"greyscale(@color);",description:w("returns a grey, 100% desaturated color")},{name:"contrast",example:"contrast(@color1, [@darkcolor: black], [@lightcolor: white], [@threshold: 43%]);",description:w("return `@darkcolor` if `@color1 is> 43% luma` otherwise return `@lightcolor`, see notes")},{name:"multiply",example:"multiply(@color1, @color2);"},{name:"screen",example:"screen(@color1, @color2);"},{name:"overlay",example:"overlay(@color1, @color2);"},{name:"softlight",example:"softlight(@color1, @color2);"},{name:"hardlight",example:"hardlight(@color1, @color2);"},{name:"difference",example:"difference(@color1, @color2);"},{name:"exclusion",example:"exclusion(@color1, @color2);"},{name:"average",example:"average(@color1, @color2);"},{name:"negation",example:"negation(@color1, @color2);"}];function rf(t,e){const n=sf(t);return af(n,e)}function sf(t){function e(d){return t.positionAt(d.offset).line}function n(d){return t.positionAt(d.offset+d.len).line}function r(){switch(t.languageId){case"scss":return new Gc;case"less":return new Yc;default:return new _n}}function i(d,u){const m=e(d),f=n(d);return m!==f?{startLine:m,endLine:f,kind:u}:null}const s=[],a=[],o=r();o.ignoreComment=!1,o.setSource(t.getText());let l=o.scan(),c=null;for(;l.type!==p.EOF;){switch(l.type){case p.CurlyL:case Nr:{a.push({line:e(l),type:"brace",isStart:!0});break}case p.CurlyR:{if(a.length!==0){const d=Qc(a,"brace");if(!d)break;let u=n(l);d.type==="brace"&&(c&&n(c)!==u&&u--,d.line!==u&&s.push({startLine:d.line,endLine:u,kind:void 0}))}break}case p.Comment:{const d=f=>f==="#region"?{line:e(l),type:"comment",isStart:!0}:{line:n(l),type:"comment",isStart:!1},m=(f=>{const g=f.text.match(/^\s*\/\*\s*(#region|#endregion)\b\s*(.*?)\s*\*\//);if(g)return d(g[1]);if(t.languageId==="scss"||t.languageId==="less"){const b=f.text.match(/^\s*\/\/\s*(#region|#endregion)\b\s*(.*?)\s*/);if(b)return d(b[1])}return null})(l);if(m)if(m.isStart)a.push(m);else{const f=Qc(a,"comment");if(!f)break;f.type==="comment"&&f.line!==m.line&&s.push({startLine:f.line,endLine:m.line,kind:"region"})}else{const f=i(l,"comment");f&&s.push(f)}break}}c=l,l=o.scan()}return s}function Qc(t,e){if(t.length===0)return null;for(let n=t.length-1;n>=0;n--)if(t[n].type===e&&t[n].isStart)return t.splice(n,1)[0];return null}function af(t,e){const n=e&&e.rangeLimit||Number.MAX_VALUE,r=t.sort((a,o)=>{let l=a.startLine-o.startLine;return l===0&&(l=a.endLine-o.endLine),l}),i=[];let s=-1;return r.forEach(a=>{a.startLine=0;c--)if(this.__items[c].match(l))return!0;return!1},s.prototype.set_indent=function(l,c){this.is_empty()&&(this.__indent_count=l||0,this.__alignment_count=c||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},s.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},s.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},s.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var l=this.__parent.current_line;return l.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),l.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),l.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,l.__items[0]===" "&&(l.__items.splice(0,1),l.__character_count-=1),!0}return!1},s.prototype.is_empty=function(){return this.__items.length===0},s.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},s.prototype.push=function(l){this.__items.push(l);var c=l.lastIndexOf(` +`);c!==-1?this.__character_count=l.length-c:this.__character_count+=l.length},s.prototype.pop=function(){var l=null;return this.is_empty()||(l=this.__items.pop(),this.__character_count-=l.length),l},s.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},s.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},s.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},s.prototype.toString=function(){var l="";return this.is_empty()?this.__parent.indent_empty_lines&&(l=this.__parent.get_indent_string(this.__indent_count)):(l=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),l+=this.__items.join("")),l};function a(l,c){this.__cache=[""],this.__indent_size=l.indent_size,this.__indent_string=l.indent_char,l.indent_with_tabs||(this.__indent_string=new Array(l.indent_size+1).join(l.indent_char)),c=c||"",l.indent_level>0&&(c=new Array(l.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}a.prototype.get_indent_size=function(l,c){var d=this.__base_string_length;return c=c||0,l<0&&(d=0),d+=l*this.__indent_size,d+=c,d},a.prototype.get_indent_string=function(l,c){var d=this.__base_string;return c=c||0,l<0&&(l=0,d=""),c+=l*this.__indent_size,this.__ensure_cache(c),d+=this.__cache[c],d},a.prototype.__ensure_cache=function(l){for(;l>=this.__cache.length;)this.__add_column()},a.prototype.__add_column=function(){var l=this.__cache.length,c=0,d="";this.__indent_size&&l>=this.__indent_size&&(c=Math.floor(l/this.__indent_size),l-=c*this.__indent_size,d=new Array(c+1).join(this.__indent_string)),l&&(d+=new Array(l+1).join(" ")),this.__cache.push(d)};function o(l,c){this.__indent_cache=new a(l,c),this.raw=!1,this._end_with_newline=l.end_with_newline,this.indent_size=l.indent_size,this.wrap_line_length=l.wrap_line_length,this.indent_empty_lines=l.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new s(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}o.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},o.prototype.get_line_number=function(){return this.__lines.length},o.prototype.get_indent_string=function(l,c){return this.__indent_cache.get_indent_string(l,c)},o.prototype.get_indent_size=function(l,c){return this.__indent_cache.get_indent_size(l,c)},o.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},o.prototype.add_new_line=function(l){return this.is_empty()||!l&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},o.prototype.get_code=function(l){this.trim(!0);var c=this.current_line.pop();c&&(c[c.length-1]===` +`&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),this._end_with_newline&&this.__add_outputline();var d=this.__lines.join(` +`);return l!==` +`&&(d=d.replace(/[\n]/g,l)),d},o.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},o.prototype.set_indent=function(l,c){return l=l||0,c=c||0,this.next_line.set_indent(l,c),this.__lines.length>1?(this.current_line.set_indent(l,c),!0):(this.current_line.set_indent(),!1)},o.prototype.add_raw_token=function(l){for(var c=0;c1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},o.prototype.just_added_newline=function(){return this.current_line.is_empty()},o.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},o.prototype.ensure_empty_line_above=function(l,c){for(var d=this.__lines.length-2;d>=0;){var u=this.__lines[d];if(u.is_empty())break;if(u.item(0).indexOf(l)!==0&&u.item(-1)!==c){this.__lines.splice(d+1,0,new s(this)),this.previous_line=this.__lines[this.__lines.length-2];break}d--}},i.exports.Output=o}),,,,(function(i){function s(l,c){this.raw_options=a(l,c),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}s.prototype._get_array=function(l,c){var d=this.raw_options[l],u=c||[];return typeof d=="object"?d!==null&&typeof d.concat=="function"&&(u=d.concat()):typeof d=="string"&&(u=d.split(/[^a-zA-Z0-9_\/\-]+/)),u},s.prototype._get_boolean=function(l,c){var d=this.raw_options[l],u=d===void 0?!!c:!!d;return u},s.prototype._get_characters=function(l,c){var d=this.raw_options[l],u=c||"";return typeof d=="string"&&(u=d.replace(/\\r/,"\r").replace(/\\n/,` +`).replace(/\\t/," ")),u},s.prototype._get_number=function(l,c){var d=this.raw_options[l];c=parseInt(c,10),isNaN(c)&&(c=0);var u=parseInt(d,10);return isNaN(u)&&(u=c),u},s.prototype._get_selection=function(l,c,d){var u=this._get_selection_list(l,c,d);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+l+`' can only be one of the following values: +`+c+` +You passed in: '`+this.raw_options[l]+"'");return u[0]},s.prototype._get_selection_list=function(l,c,d){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(d=d||[c[0]],!this._is_valid_selection(d,c))throw new Error("Invalid Default Value!");var u=this._get_array(l,d);if(!this._is_valid_selection(u,c))throw new Error("Invalid Option Value: The option '"+l+`' can contain only the following values: +`+c+` +You passed in: '`+this.raw_options[l]+"'");return u},s.prototype._is_valid_selection=function(l,c){return l.length&&c.length&&!l.some(function(d){return c.indexOf(d)===-1})};function a(l,c){var d={};l=o(l);var u;for(u in l)u!==c&&(d[u]=l[u]);if(c&&l[c])for(u in l[c])d[u]=l[c][u];return d}function o(l){var c={},d;for(d in l){var u=d.replace(/-/g,"_");c[u]=l[d]}return c}i.exports.Options=s,i.exports.normalizeOpts=o,i.exports.mergeOpts=a}),,(function(i){var s=RegExp.prototype.hasOwnProperty("sticky");function a(o){this.__input=o||"",this.__input_length=this.__input.length,this.__position=0}a.prototype.restart=function(){this.__position=0},a.prototype.back=function(){this.__position>0&&(this.__position-=1)},a.prototype.hasNext=function(){return this.__position=0&&o=0&&l=o.length&&this.__input.substring(l-o.length,l).toLowerCase()===o},i.exports.InputScanner=a}),,,,,(function(i){function s(a,o){a=typeof a=="string"?a:a.source,o=typeof o=="string"?o:o.source,this.__directives_block_pattern=new RegExp(a+/ beautify( \w+[:]\w+)+ /.source+o,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(a+/\sbeautify\signore:end\s/.source+o,"g")}s.prototype.get_directives=function(a){if(!a.match(this.__directives_block_pattern))return null;var o={};this.__directive_pattern.lastIndex=0;for(var l=this.__directive_pattern.exec(a);l;)o[l[1]]=l[2],l=this.__directive_pattern.exec(a);return o},s.prototype.readIgnored=function(a){return a.readUntilAfter(this.__directives_end_ignore_pattern)},i.exports.Directives=s}),,(function(i,s,a){var o=a(16).Beautifier,l=a(17).Options;function c(d,u){var m=new o(d,u);return m.beautify()}i.exports=c,i.exports.defaultOptions=function(){return new l}}),(function(i,s,a){var o=a(17).Options,l=a(2).Output,c=a(8).InputScanner,d=a(13).Directives,u=new d(/\/\*/,/\*\//),m=/\r\n|[\r\n]/,f=/\r\n|[\r\n]/g,g=/\s/,b=/(?:\s|\n)+/g,k=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,F=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function N(_,T){this._source_text=_||"",this._options=new o(T),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}N.prototype.eatString=function(_){var T="";for(this._ch=this._input.next();this._ch;){if(T+=this._ch,this._ch==="\\")T+=this._input.next();else if(_.indexOf(this._ch)!==-1||this._ch===` +`)break;this._ch=this._input.next()}return T},N.prototype.eatWhitespace=function(_){for(var T=g.test(this._input.peek()),O=0;g.test(this._input.peek());)this._ch=this._input.next(),_&&this._ch===` +`&&(O===0||O0&&this._indentLevel--},N.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var _=this._source_text,T=this._options.eol;T==="auto"&&(T=` +`,_&&m.test(_||"")&&(T=_.match(m)[0])),_=_.replace(f,` +`);var O=_.match(/^[\t ]*/)[0];this._output=new l(this._options,O),this._input=new c(_),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var V=0,I=!1,R=!1,z=!1,$=!1,L=!1,y=this._ch,E=!1,D,A,M;D=this._input.read(b),A=D!=="",M=y,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),y=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var P=this._input.read(k),H=u.get_directives(P);H&&H.ignore==="start"&&(P+=u.readIgnored(this._input)),this.print_string(P),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(F)),this.eatWhitespace(!0);else if(this._ch==="$"){this.preserveSingleSpace(A),this.print_string(this._ch);var ee=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ee.match(/[ :]$/)&&(ee=this.eatString(": ").replace(/\s+$/,""),this.print_string(ee),this._output.space_before_token=!0),V===0&&ee.indexOf(":")!==-1&&(R=!0,this.indent())}else if(this._ch==="@")if(this.preserveSingleSpace(A),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var G=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);G.match(/[ :]$/)&&(G=this.eatString(": ").replace(/\s+$/,""),this.print_string(G),this._output.space_before_token=!0),V===0&&G.indexOf(":")!==-1?(R=!0,this.indent()):G in this.NESTED_AT_RULE?(this._nestedLevel+=1,G in this.CONDITIONAL_GROUP_RULE&&(z=!0)):V===0&&!R&&($=!0)}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(A),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")R&&(R=!1,this.outdent()),$=!1,z?(z=!1,I=this._indentLevel>=this._nestedLevel):I=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&I&&this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(M==="("?this._output.space_before_token=!1:M!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),M==="{"&&this._output.trim(!0),R&&(this.outdent(),R=!1),this.print_string(this._ch),I=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&this._input.peek()!=="}"&&this._output.add_new_line(!0),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var xe=0;xe"||this._ch==="+"||this._ch==="~")&&!R&&V===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&g.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(A),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),g.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var As=M==='"'||M==="'";this.preserveSingleSpace(As||A),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===` +`&&E&&this._output.add_new_line()}var ln=this._output.get_code(T);return ln},i.exports.Beautifier=N}),(function(i,s,a){var o=a(6).Options;function l(c){o.call(this,c,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var d=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||d;var u=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var m=0;m0&&th(r,u-1);)u--;u===0||eh(r,u-1)?d=u:u0){const d=n.insertSpaces?al(" ",o*s):al(" ",s);c=c.split(` +`).join(` +`+d),e.start.character===0&&(c=d+c)}return[{range:e,newText:c}]}function Zc(t){return t.replace(/^\s+/,"")}const cf=123,hf=125;function df(t,e){for(;e>=0;){const n=t.charCodeAt(e);if(n===cf)return!0;if(n===hf)return!1;e--}return!1}function ot(t,e,n){if(t&&t.hasOwnProperty(e)){const r=t[e];if(r!==null)return r}return n}function uf(t,e,n){let r=e,i=0;const s=n.tabSize||4;for(;r && ]#",relevance:50,description:"@counter-style descriptor. Specifies the symbols used by the marker-construction algorithm specified by the system descriptor. Needs to be specified if the counter system is 'additive'.",restrictions:["integer","string","image","identifier"]},{name:"align-content",browsers:["E12","FF28","S9","C29","IE11","O16"],values:[{name:"center",description:"Lines are packed toward the center of the flex container."},{name:"flex-end",description:"Lines are packed toward the end of the flex container."},{name:"flex-start",description:"Lines are packed toward the start of the flex container."},{name:"space-around",description:"Lines are evenly distributed in the flex container, with half-size spaces on either end."},{name:"space-between",description:"Lines are evenly distributed in the flex container."},{name:"stretch",description:"Lines stretch to take up the remaining space."},{name:"start"},{name:"end"},{name:"normal"},{name:"baseline"},{name:"first baseline"},{name:"last baseline"},{name:"space-around"},{name:"space-between"},{name:"space-evenly"},{name:"stretch"},{name:"safe"},{name:"unsafe"}],syntax:"normal | | | ? ",relevance:66,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/align-content"}],description:"Aligns a flex container's lines within the flex container when there is extra space in the cross-axis, similar to how 'justify-content' aligns individual items within the main-axis.",restrictions:["enum"]},{name:"align-items",browsers:["E12","FF20","S9","C29","IE11","O16"],values:[{name:"baseline",description:"If the flex item's inline axis is the same as the cross axis, this value is identical to 'flex-start'. Otherwise, it participates in baseline alignment."},{name:"center",description:"The flex item's margin box is centered in the cross axis within the line."},{name:"flex-end",description:"The cross-end margin edge of the flex item is placed flush with the cross-end edge of the line."},{name:"flex-start",description:"The cross-start margin edge of the flex item is placed flush with the cross-start edge of the line."},{name:"stretch",description:"If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched."},{name:"normal"},{name:"start"},{name:"end"},{name:"self-start"},{name:"self-end"},{name:"first baseline"},{name:"last baseline"},{name:"stretch"},{name:"safe"},{name:"unsafe"}],syntax:"normal | stretch | | [ ? ]",relevance:87,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/align-items"}],description:"Aligns flex items along the cross axis of the current line of the flex container.",restrictions:["enum"]},{name:"justify-items",browsers:["E12","FF20","S9","C52","IE11","O12.1"],values:[{name:"auto"},{name:"normal"},{name:"end"},{name:"start"},{name:"flex-end",description:'"Flex items are packed toward the end of the line."'},{name:"flex-start",description:'"Flex items are packed toward the start of the line."'},{name:"self-end",description:"The item is packed flush to the edge of the alignment container of the end side of the item, in the appropriate axis."},{name:"self-start",description:"The item is packed flush to the edge of the alignment container of the start side of the item, in the appropriate axis.."},{name:"center",description:"The items are packed flush to each other toward the center of the of the alignment container."},{name:"left"},{name:"right"},{name:"baseline"},{name:"first baseline"},{name:"last baseline"},{name:"stretch",description:"If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched."},{name:"safe"},{name:"unsafe"},{name:"legacy"}],syntax:"normal | stretch | | ? [ | left | right ] | legacy | legacy && [ left | right | center ]",relevance:53,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/justify-items"}],description:"Defines the default justify-self for all items of the box, giving them the default way of justifying each box along the appropriate axis",restrictions:["enum"]},{name:"justify-self",browsers:["E16","FF45","S10.1","C57","IE10","O44"],values:[{name:"auto"},{name:"normal"},{name:"end"},{name:"start"},{name:"flex-end",description:'"Flex items are packed toward the end of the line."'},{name:"flex-start",description:'"Flex items are packed toward the start of the line."'},{name:"self-end",description:"The item is packed flush to the edge of the alignment container of the end side of the item, in the appropriate axis."},{name:"self-start",description:"The item is packed flush to the edge of the alignment container of the start side of the item, in the appropriate axis.."},{name:"center",description:"The items are packed flush to each other toward the center of the of the alignment container."},{name:"left"},{name:"right"},{name:"baseline"},{name:"first baseline"},{name:"last baseline"},{name:"stretch",description:"If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched."},{name:"save"},{name:"unsave"}],syntax:"auto | normal | stretch | | ? [ | left | right ]",relevance:55,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/justify-self"}],description:"Defines the way of justifying a box inside its container along the appropriate axis.",restrictions:["enum"]},{name:"align-self",browsers:["E12","FF20","S9","C29","IE10","O12.1"],values:[{name:"auto",description:"Computes to the value of 'align-items' on the element's parent, or 'stretch' if the element has no parent. On absolutely positioned elements, it computes to itself."},{name:"normal"},{name:"self-end"},{name:"self-start"},{name:"baseline",description:"If the flex item's inline axis is the same as the cross axis, this value is identical to 'flex-start'. Otherwise, it participates in baseline alignment."},{name:"center",description:"The flex item's margin box is centered in the cross axis within the line."},{name:"flex-end",description:"The cross-end margin edge of the flex item is placed flush with the cross-end edge of the line."},{name:"flex-start",description:"The cross-start margin edge of the flex item is placed flush with the cross-start edge of the line."},{name:"stretch",description:"If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched."},{name:"baseline"},{name:"first baseline"},{name:"last baseline"},{name:"safe"},{name:"unsafe"}],syntax:"auto | normal | stretch | | ? ",relevance:73,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/align-self"}],description:"Allows the default alignment along the cross axis to be overridden for individual flex items.",restrictions:["enum"]},{name:"all",browsers:["E79","FF27","S9.1","C37","O24"],values:[],syntax:"initial | inherit | unset | revert | revert-layer",relevance:53,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/all"}],description:"Shorthand that resets all properties except 'direction' and 'unicode-bidi'.",restrictions:["enum"]},{name:"alt",browsers:["S9"],values:[],relevance:50,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/alt"}],description:"Provides alternative text for assistive technology to replace the generated content of a ::before or ::after element.",restrictions:["string","enum"]},{name:"animation",browsers:["E12","FF16","S9","C43","IE10","O30"],values:[{name:"alternate",description:"The animation cycle iterations that are odd counts are played in the normal direction, and the animation cycle iterations that are even counts are played in a reverse direction."},{name:"alternate-reverse",description:"The animation cycle iterations that are odd counts are played in the reverse direction, and the animation cycle iterations that are even counts are played in a normal direction."},{name:"backwards",description:"The beginning property value (as defined in the first @keyframes at-rule) is applied before the animation is displayed, during the period defined by 'animation-delay'."},{name:"both",description:"Both forwards and backwards fill modes are applied."},{name:"forwards",description:"The final property value (as defined in the last @keyframes at-rule) is maintained after the animation completes."},{name:"infinite",description:"Causes the animation to repeat forever."},{name:"none",description:"No animation is performed"},{name:"normal",description:"Normal playback."},{name:"reverse",description:"All iterations of the animation are played in the reverse direction from the way they were specified."}],syntax:"#",relevance:82,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/animation"}],description:"Shorthand property combines six of the animation properties into a single property.",restrictions:["time","timing-function","enum","identifier","number"]},{name:"animation-delay",browsers:["E12","FF16","S9","C43","IE10","O30"],syntax:"