From 0a37453d482c7db09b0ce1af46a3ad820305927c Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sun, 3 Sep 2023 17:03:04 +0200 Subject: [PATCH 01/35] Fix S3 configuration. --- ...Squidex.Domain.Apps.Core.Operations.csproj | 2 +- .../Squidex.Infrastructure.csproj | 12 +++++----- backend/src/Squidex/Squidex.csproj | 24 +++++++++---------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/Squidex.Domain.Apps.Core.Operations.csproj b/backend/src/Squidex.Domain.Apps.Core.Operations/Squidex.Domain.Apps.Core.Operations.csproj index 4a6dc3952..67d7597f5 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/Squidex.Domain.Apps.Core.Operations.csproj +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/Squidex.Domain.Apps.Core.Operations.csproj @@ -28,7 +28,7 @@ - + diff --git a/backend/src/Squidex.Infrastructure/Squidex.Infrastructure.csproj b/backend/src/Squidex.Infrastructure/Squidex.Infrastructure.csproj index badc75a90..ba3d1b7c9 100644 --- a/backend/src/Squidex.Infrastructure/Squidex.Infrastructure.csproj +++ b/backend/src/Squidex.Infrastructure/Squidex.Infrastructure.csproj @@ -24,12 +24,12 @@ - - - - - - + + + + + + diff --git a/backend/src/Squidex/Squidex.csproj b/backend/src/Squidex/Squidex.csproj index ecbab32c3..539b94402 100644 --- a/backend/src/Squidex/Squidex.csproj +++ b/backend/src/Squidex/Squidex.csproj @@ -62,18 +62,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + From a4311b2204eb66c9f846d33b57d339994480a14c Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Mon, 4 Sep 2023 08:58:56 +0200 Subject: [PATCH 02/35] Update GitHub Action Versions (#1020) Co-authored-by: github-actions[bot] --- .github/workflows/dev.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index bb139aacb..933eb7173 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -25,7 +25,7 @@ jobs: uses: docker/setup-qemu-action@v2.2.0 - name: Prepare - Set up Docker Buildx - uses: docker/setup-buildx-action@v2.9.1 + uses: docker/setup-buildx-action@v2.10.0 - name: Build - BUILD uses: docker/build-push-action@v4.1.1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 88f0f3872..b82c9dade 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: uses: docker/setup-qemu-action@v2.2.0 - name: Prepare - Set up Docker Buildx - uses: docker/setup-buildx-action@v2.9.1 + uses: docker/setup-buildx-action@v2.10.0 - name: Build - BUILD uses: docker/build-push-action@v4.1.1 From 37c046c9894f556f436633331aaf982b70464e92 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Mon, 4 Sep 2023 10:19:52 +0200 Subject: [PATCH 03/35] Improve counter performance. (#1021) --- backend/src/Migrations/MigrationPath.cs | 10 ++- .../Migrations/MongoDb/CopyRuleStatistics.cs | 66 +++++++++++++++++++ .../Billing/UsageGate.Rules.cs | 12 +++- .../UsageTracking/BackgroundUsageTracker.cs | 7 +- .../UsageTracking/Counters.cs | 9 +-- .../Squidex/Config/Domain/StoreServices.cs | 3 + .../forms/editors/code-editor.component.ts | 2 + 7 files changed, 93 insertions(+), 16 deletions(-) create mode 100644 backend/src/Migrations/Migrations/MongoDb/CopyRuleStatistics.cs diff --git a/backend/src/Migrations/MigrationPath.cs b/backend/src/Migrations/MigrationPath.cs index 42d55f02e..caafeb811 100644 --- a/backend/src/Migrations/MigrationPath.cs +++ b/backend/src/Migrations/MigrationPath.cs @@ -15,7 +15,7 @@ namespace Migrations; public sealed class MigrationPath : IMigrationPath { - private const int CurrentVersion = 25; + private const int CurrentVersion = 26; private readonly IServiceProvider serviceProvider; public MigrationPath(IServiceProvider serviceProvider) @@ -114,10 +114,16 @@ public sealed class MigrationPath : IMigrationPath } } - // Version 13: Json refactoring + // Version 13: Json refactoring. if (version < 13) { yield return serviceProvider.GetRequiredService(); } + + // Version 27: New rule statistics using normal usage collection. + if (version < 26) + { + yield return serviceProvider.GetRequiredService(); + } } } diff --git a/backend/src/Migrations/Migrations/MongoDb/CopyRuleStatistics.cs b/backend/src/Migrations/Migrations/MongoDb/CopyRuleStatistics.cs new file mode 100644 index 000000000..d97b51ca2 --- /dev/null +++ b/backend/src/Migrations/Migrations/MongoDb/CopyRuleStatistics.cs @@ -0,0 +1,66 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using MongoDB.Bson; +using MongoDB.Bson.Serialization.Attributes; +using MongoDB.Driver; +using Squidex.Domain.Apps.Entities.Rules; +using Squidex.Infrastructure; +using Squidex.Infrastructure.Migrations; +using Squidex.Infrastructure.MongoDb; + +namespace Migrations.Migrations.MongoDb; + +public sealed class CopyRuleStatistics : IMigration +{ + private readonly IMongoDatabase database; + private readonly IRuleUsageTracker ruleUsageTracker; + + [BsonIgnoreExtraElements] + public class Document + { + public DomainId AppId { get; private set; } + + public DomainId RuleId { get; private set; } + + public int NumFailed { get; private set; } + + public int NumSucceeded { get; private set; } + } + + public CopyRuleStatistics(IMongoDatabase database, IRuleUsageTracker ruleUsageTracker) + { + this.database = database; + this.ruleUsageTracker = ruleUsageTracker; + } + + public async Task UpdateAsync( + CancellationToken ct) + { + var collectionName = "RuleStatistics"; + + // Do not create the collection if not needed. + if (!await database.CollectionExistsAsync(collectionName, ct)) + { + return; + } + + var collection = database.GetCollection(collectionName); + + await foreach (var document in collection.Find(new BsonDocument()).ToAsyncEnumerable(ct)) + { + await ruleUsageTracker.TrackAsync( + document.AppId, + document.RuleId, + default, + 0, + document.NumSucceeded, + document.NumFailed, + ct); + } + } +} diff --git a/backend/src/Squidex.Domain.Apps.Entities/Billing/UsageGate.Rules.cs b/backend/src/Squidex.Domain.Apps.Entities/Billing/UsageGate.Rules.cs index 79cfba15e..5e04d5be9 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Billing/UsageGate.Rules.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Billing/UsageGate.Rules.cs @@ -103,18 +103,26 @@ public sealed partial class UsageGate : IRuleUsageTracker var tasks = new List { - usageTracker.TrackAsync(date, appKey, ruleId.ToString(), counters, ct), usageTracker.TrackAsync(SummaryDate, appKey, ruleId.ToString(), counters, ct) }; + if (date != default) + { + tasks.Add(usageTracker.TrackAsync(date, appKey, ruleId.ToString(), counters, ct)); + } + var (_, _, teamId) = await GetPlanForAppAsync(appId, true, ct); if (teamId != null) { var teamKey = TeamRulesKey(teamId.Value); - tasks.Add(usageTracker.TrackAsync(date, teamKey, appId.ToString(), counters, ct)); tasks.Add(usageTracker.TrackAsync(SummaryDate, teamKey, appId.ToString(), counters, ct)); + + if (date != default) + { + tasks.Add(usageTracker.TrackAsync(date, teamKey, appId.ToString(), counters, ct)); + } } await Task.WhenAll(tasks); diff --git a/backend/src/Squidex.Infrastructure/UsageTracking/BackgroundUsageTracker.cs b/backend/src/Squidex.Infrastructure/UsageTracking/BackgroundUsageTracker.cs index 535f3dbcd..3867f1a79 100644 --- a/backend/src/Squidex.Infrastructure/UsageTracking/BackgroundUsageTracker.cs +++ b/backend/src/Squidex.Infrastructure/UsageTracking/BackgroundUsageTracker.cs @@ -116,9 +116,8 @@ public sealed class BackgroundUsageTracker : DisposableObjectBase, IUsageTracker category = GetCategory(category); -#pragma warning disable MA0105 // Use the lambda parameters instead of using a closure - jobs.AddOrUpdate((key, category, date), counters, (k, p) => p.SumpUpCloned(counters)); -#pragma warning restore MA0105 // Use the lambda parameters instead of using a closure + // Create a copy of the counters on add, so that we do not share it. + jobs.AddOrUpdate((key, category, date), (_, args) => new Counters(args), (_, v, args) => v.Merge(args), counters); return Task.CompletedTask; } @@ -191,7 +190,7 @@ public sealed class BackgroundUsageTracker : DisposableObjectBase, IUsageTracker foreach (var usage in queried) { - result.SumpUp(usage.Counters); + result.Merge(usage.Counters); } return result; diff --git a/backend/src/Squidex.Infrastructure/UsageTracking/Counters.cs b/backend/src/Squidex.Infrastructure/UsageTracking/Counters.cs index c13e34696..2a9927166 100644 --- a/backend/src/Squidex.Infrastructure/UsageTracking/Counters.cs +++ b/backend/src/Squidex.Infrastructure/UsageTracking/Counters.cs @@ -42,14 +42,7 @@ public sealed class Counters : Dictionary return (long)value; } - public Counters SumpUpCloned(Counters counters) - { - var result = new Counters(this); - - return result.SumpUp(counters); - } - - public Counters SumpUp(Counters source) + public Counters Merge(Counters source) { foreach (var (key, value) in source) { diff --git a/backend/src/Squidex/Config/Domain/StoreServices.cs b/backend/src/Squidex/Config/Domain/StoreServices.cs index 168b59cb0..a73d7f554 100644 --- a/backend/src/Squidex/Config/Domain/StoreServices.cs +++ b/backend/src/Squidex/Config/Domain/StoreServices.cs @@ -80,6 +80,9 @@ public static class StoreServices services.AddTransientAs() .As(); + services.AddTransientAs() + .As(); + services.AddTransientAs(c => new DeleteContentCollections(GetDatabase(c, mongoContentDatabaseName))) .As(); diff --git a/frontend/src/app/framework/angular/forms/editors/code-editor.component.ts b/frontend/src/app/framework/angular/forms/editors/code-editor.component.ts index 1ff4b5aa7..bb5386b24 100644 --- a/frontend/src/app/framework/angular/forms/editors/code-editor.component.ts +++ b/frontend/src/app/framework/angular/forms/editors/code-editor.component.ts @@ -294,6 +294,8 @@ export class CodeEditorComponent extends StatefulControlComponent<{}, any> imple printMargin: !this.singleLine, showGutter: !this.singleLine, }); + + this.aceEditor.commands.bindKey('Enter|Shift-Enter', this.singleLine ? 'null' : undefined); } private setValue(value: string) { From d778c17bcea1dc8c94bd2df712856e6f4b2b10e3 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Thu, 7 Sep 2023 14:44:59 +0200 Subject: [PATCH 04/35] Improve chat dialog and connect form * Fix chat dialog and connect form. * Fix trusted flag --- backend/i18n/frontend_en.json | 14 +- backend/i18n/frontend_fr.json | 26 ++-- backend/i18n/frontend_it.json | 14 +- backend/i18n/frontend_nl.json | 14 +- backend/i18n/frontend_pt.json | 14 +- backend/i18n/frontend_zh.json | 14 +- backend/i18n/source/frontend_en.json | 14 +- backend/i18n/source/frontend_fr.json | 16 -- backend/i18n/source/frontend_it.json | 5 - backend/i18n/source/frontend_nl.json | 5 - backend/i18n/source/frontend_pt.json | 5 - backend/i18n/source/frontend_zh.json | 5 - frontend/src/app/app.component.html | 2 +- .../shared/forms/chat-dialog.component.html | 104 +++++++++---- .../shared/forms/chat-dialog.component.scss | 60 ++++++++ .../shared/forms/chat-dialog.component.ts | 47 +++++- .../shared/forms/field-editor.component.ts | 2 +- .../client-connect-form.component.html | 145 +++--------------- .../client-connect-form.component.scss | 50 +++++- .../clients/client-connect-form.component.ts | 19 ++- .../pages/clients/client.component.ts | 2 +- .../app/framework/angular/code.component.html | 6 +- .../app/framework/angular/code.component.scss | 34 +--- .../app/framework/angular/code.component.ts | 5 +- .../angular/forms/copy-global.directive.ts | 91 +++++++++++ .../framework/angular/markdown.directive.ts | 5 +- frontend/src/app/framework/declarations.ts | 1 + frontend/src/app/framework/module.ts | 4 +- frontend/src/app/framework/utils/markdown.ts | 23 ++- .../app/shared/services/help.service.spec.ts | 42 ++++- .../src/app/shared/services/help.service.ts | 24 +++ frontend/src/app/theme/_common.scss | 38 +++++ 32 files changed, 517 insertions(+), 333 deletions(-) create mode 100644 frontend/src/app/framework/angular/forms/copy-global.directive.ts diff --git a/backend/i18n/frontend_en.json b/backend/i18n/frontend_en.json index bdeba4151..1eea7677e 100644 --- a/backend/i18n/frontend_en.json +++ b/backend/i18n/frontend_en.json @@ -166,6 +166,7 @@ "backups.started": "Backup started, it can take several minutes to complete.", "backups.startedLabel": "Started", "backups.startFailed": "Failed to start backup.", + "chat.answer": "Here is my answer:", "chat.answers": "Answers", "chat.answersEmpty": "The ChatBot does not provide an answer or has not been configured yet.", "chat.ask": "Ask", @@ -194,16 +195,6 @@ "clients.connectWizard.cliStep3": "Add your app name the CLI config", "clients.connectWizard.cliStep3Hint": "You can manage configuration to multiple apps in the CLI and switch to an app.", "clients.connectWizard.cliStep4": "Switch to your app in the CLI", - "clients.connectWizard.dotnetSdk": "Use the .NET SDK", - "clients.connectWizard.dotnetSdkDocumentation": "Documentations for the .NET SDK is available: ", - "clients.connectWizard.dotnetSdkHint": "Install the .NET SDK and establish a connection to this app.", - "clients.connectWizard.dotnetSdkStep1": "Install the .NET SDK", - "clients.connectWizard.dotnetSdkStep1Download": "The SDK is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary/)", - "clients.connectWizard.dotnetSdkStep2": "Version 14 and before: Create a client manager", - "clients.connectWizard.dotnetSdkStep2_15": "Version 15 and later: Create a client", - "clients.connectWizard.dotnetSdkStep3": "Optionally: Install the Service Extensions for the SDK", - "clients.connectWizard.dotnetSdkStep3Download": "The SDK Extension is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary.ServiceExtensions/)", - "clients.connectWizard.dotnetSdkStep4": "Optionally: Register the client manager and all clients", "clients.connectWizard.javascriptSdk": "Use the JavaScript SDK", "clients.connectWizard.javascriptSdkDocumentation": "Documentations for the JavaScript SDK is available: ", "clients.connectWizard.javascriptSdkHint": "Install the SDK and establish a connection to this app.", @@ -217,8 +208,10 @@ "clients.connectWizard.manuallyStep3": "Add the token as HTTP header to all requests", "clients.connectWizard.manuallyTokenHint": "Tokens usally expire after 30days, but you can request multiple tokens.", "clients.connectWizard.postManDocs": "Start with the Postman tutorial in the [Documentation](https://docs.squidex.io/02-documentation/developer-guides/api-overview/postman).", + "clients.connectWizard.sdk": "Use the official SDK", "clients.connectWizard.sdkHelp": "You need another SDK?", "clients.connectWizard.sdkHelpLink": "Contact us in the Support Forum", + "clients.connectWizard.sdkHint": "Install the SDK and establish a connection to this app.", "clients.connectWizard.step0Title": "Setup client", "clients.connectWizard.step1Title": "Choose connection method", "clients.connectWizard.step2Title": "Connect", @@ -387,6 +380,7 @@ "common.remember": "Don't ask again", "common.rename": "Rename", "common.renameTag": "Rename Tag", + "common.repository": "Repository", "common.requiredHint": "required", "common.reset": "Reset", "common.restore": "Restore", diff --git a/backend/i18n/frontend_fr.json b/backend/i18n/frontend_fr.json index 79632c663..94066370e 100644 --- a/backend/i18n/frontend_fr.json +++ b/backend/i18n/frontend_fr.json @@ -166,6 +166,7 @@ "backups.started": "La sauvegarde a commencé, cela peut prendre plusieurs minutes.", "backups.startedLabel": "Commencé", "backups.startFailed": "Échec du démarrage de la sauvegarde.", + "chat.answer": "Here is my answer:", "chat.answers": "Answers", "chat.answersEmpty": "The ChatBot does not provide an answer or has not been configured yet.", "chat.ask": "Ask", @@ -194,22 +195,12 @@ "clients.connectWizard.cliStep3": "Ajoutez le nom de votre application à la configuration CLI", "clients.connectWizard.cliStep3Hint": "Vous pouvez gérer la configuration de plusieurs applications dans l'interface de ligne de commande et basculer vers une application.", "clients.connectWizard.cliStep4": "Basculez vers votre application dans la CLI", - "clients.connectWizard.dotnetSdk": "Utiliser le SDK .NET", - "clients.connectWizard.dotnetSdkDocumentation": "Les documentations pour le SDK .NET sont disponibles\u00A0:", - "clients.connectWizard.dotnetSdkHint": "Installez le SDK .NET et établissez une connexion à cette application.", - "clients.connectWizard.dotnetSdkStep1": "Installer le SDK .NET", - "clients.connectWizard.dotnetSdkStep1Download": "Le SDK est disponible sur [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary/)", - "clients.connectWizard.dotnetSdkStep2": "Version 14 et antérieure : Créer un gestionnaire de clientèle", - "clients.connectWizard.dotnetSdkStep2_15": "Version 15 et supérieures : Créer un client", - "clients.connectWizard.dotnetSdkStep3": "Facultatif\u00A0: installez les extensions de service pour le SDK", - "clients.connectWizard.dotnetSdkStep3Download": "L'extension SDK est disponible sur [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary.ServiceExtensions/)", - "clients.connectWizard.dotnetSdkStep4": "Facultativement\u00A0: Enregistrez le gestionnaire de clientèle et tous les clients", - "clients.connectWizard.javascriptSdk": "Utiliser le SDK JavaScript", - "clients.connectWizard.javascriptSdkDocumentation": "Les documentations pour le SDK JavaScript sont disponibles\u00A0:", - "clients.connectWizard.javascriptSdkHint": "Installez le SDK et établissez une connexion à cette application.", - "clients.connectWizard.javascriptSdkStep1": "Installer le SDK Javascript", - "clients.connectWizard.javascriptSdkStep1Download": "Le SDK est disponible sur [npm](https://www.npmjs.com/package/@squidex/squidex", - "clients.connectWizard.javascriptSdkStep2": "Créer un client", + "clients.connectWizard.javascriptSdk": "Use the JavaScript SDK", + "clients.connectWizard.javascriptSdkDocumentation": "Documentations for the JavaScript SDK is available: ", + "clients.connectWizard.javascriptSdkHint": "Install the SDK and establish a connection to this app.", + "clients.connectWizard.javascriptSdkStep1": "Install the Javascript SDK", + "clients.connectWizard.javascriptSdkStep1Download": "The SDK is available on [npm](https://www.npmjs.com/package/@squidex/squidex)", + "clients.connectWizard.javascriptSdkStep2": "Create a client", "clients.connectWizard.manually": "Connectez-vous manuellement", "clients.connectWizard.manuallyHint": "Obtenez des instructions pour établir une connexion avec Postman ou curl.", "clients.connectWizard.manuallyStep1": "Obtenir un jeton en utilisant curl", @@ -217,8 +208,10 @@ "clients.connectWizard.manuallyStep3": "Ajouter le jeton en tant qu'en-tête HTTP à toutes les requêtes", "clients.connectWizard.manuallyTokenHint": "Les jetons expirent généralement après 30 jours, mais vous pouvez demander plusieurs jetons.", "clients.connectWizard.postManDocs": "Commencez par le tutoriel Postman dans la [Documentation](https://docs.squidex.io/02-documentation/developer-guides/api-overview/postman).", + "clients.connectWizard.sdk": "Use the official SDK", "clients.connectWizard.sdkHelp": "Vous avez besoin d'un autre SDK\u00A0?", "clients.connectWizard.sdkHelpLink": "Contactez-nous sur le forum d'assistance", + "clients.connectWizard.sdkHint": "Install the SDK and establish a connection to this app.", "clients.connectWizard.step0Title": "Configurer le client", "clients.connectWizard.step1Title": "Choisissez la méthode de connexion", "clients.connectWizard.step2Title": "Connecter", @@ -387,6 +380,7 @@ "common.remember": "Ne demande plus", "common.rename": "Renommer", "common.renameTag": "Renommer la balise", + "common.repository": "Repository", "common.requiredHint": "requis", "common.reset": "Réinitialiser", "common.restore": "Restaurer", diff --git a/backend/i18n/frontend_it.json b/backend/i18n/frontend_it.json index 13043c818..fc054cebb 100644 --- a/backend/i18n/frontend_it.json +++ b/backend/i18n/frontend_it.json @@ -166,6 +166,7 @@ "backups.started": "Backup avviato, il suo completamento potrebbe richiedere alcuni minuti.", "backups.startedLabel": "Avviato", "backups.startFailed": "Non è stato possibile avviare il backup.", + "chat.answer": "Here is my answer:", "chat.answers": "Answers", "chat.answersEmpty": "The ChatBot does not provide an answer or has not been configured yet.", "chat.ask": "Ask", @@ -194,16 +195,6 @@ "clients.connectWizard.cliStep3": "Inserisci il nome della tua app per la configurazione della CLI", "clients.connectWizard.cliStep3Hint": "È possibile gestire le configurazione per le diverse appi all'interno della CLI e passare ad un'app.", "clients.connectWizard.cliStep4": "Passa alla tua app usando CLI", - "clients.connectWizard.dotnetSdk": "Connetti la tua APP utilizzando SDK", - "clients.connectWizard.dotnetSdkDocumentation": "Documentations for the .NET SDK is available: ", - "clients.connectWizard.dotnetSdkHint": "Scarica l'SDK e connetti quest'app.", - "clients.connectWizard.dotnetSdkStep1": "Installa .NET SDK", - "clients.connectWizard.dotnetSdkStep1Download": "L'SDK è disponibile su [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary/)", - "clients.connectWizard.dotnetSdkStep2": "Crea un client manager", - "clients.connectWizard.dotnetSdkStep2_15": "Version 15 and later: Create a client", - "clients.connectWizard.dotnetSdkStep3": "Optionally: Install the Service Extensions for the SDK", - "clients.connectWizard.dotnetSdkStep3Download": "The SDK Extension is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary.ServiceExtensions/)", - "clients.connectWizard.dotnetSdkStep4": "Optionally: Register the client manager and all clients", "clients.connectWizard.javascriptSdk": "Use the JavaScript SDK", "clients.connectWizard.javascriptSdkDocumentation": "Documentations for the JavaScript SDK is available: ", "clients.connectWizard.javascriptSdkHint": "Install the SDK and establish a connection to this app.", @@ -217,8 +208,10 @@ "clients.connectWizard.manuallyStep3": "Aggiungi il token come header HTTP header a tutte le richieste", "clients.connectWizard.manuallyTokenHint": "Solitamente i Token scadono dopo 30 giorni, ma puoi richiedere token multipli.", "clients.connectWizard.postManDocs": "Per il tutorial Postman inizia da questo link [Documentazione](https://docs.squidex.io/02-documentation/developer-guides/api-overview/postman).", + "clients.connectWizard.sdk": "Use the official SDK", "clients.connectWizard.sdkHelp": "Hai bisogno di un altro SDK?", "clients.connectWizard.sdkHelpLink": "Contattaci nel Forum di assistenza", + "clients.connectWizard.sdkHint": "Install the SDK and establish a connection to this app.", "clients.connectWizard.step0Title": "Setup client", "clients.connectWizard.step1Title": "Scegli la tipologia di connessione", "clients.connectWizard.step2Title": "Collega", @@ -387,6 +380,7 @@ "common.remember": "Ricorda la mia decisione", "common.rename": "Rinomina", "common.renameTag": "Rename Tag", + "common.repository": "Repository", "common.requiredHint": "obbligatorio", "common.reset": "Reimposta", "common.restore": "Ripristina", diff --git a/backend/i18n/frontend_nl.json b/backend/i18n/frontend_nl.json index 42ecb41ce..14a8d8749 100644 --- a/backend/i18n/frontend_nl.json +++ b/backend/i18n/frontend_nl.json @@ -166,6 +166,7 @@ "backups.started": "Back-up gestart, het kan enkele minuten duren om te voltooien.", "backups.startedLabel": "Gestart", "backups.startFailed": "Starten van back-up is mislukt.", + "chat.answer": "Here is my answer:", "chat.answers": "Answers", "chat.answersEmpty": "The ChatBot does not provide an answer or has not been configured yet.", "chat.ask": "Ask", @@ -194,16 +195,6 @@ "clients.connectWizard.cliStep3": "Voeg uw app-naam toe aan de CLI-configuratie", "clients.connectWizard.cliStep3Hint": "Je kunt de configuratie voor meerdere apps in de CLI beheren en overschakelen naar een app.", "clients.connectWizard.cliStep4": "Schakel over naar uw app in de CLI", - "clients.connectWizard.dotnetSdk": "Maak verbinding met uw app met SDK", - "clients.connectWizard.dotnetSdkDocumentation": "Documentations for the .NET SDK is available: ", - "clients.connectWizard.dotnetSdkHint": "Download een SDK en maak verbinding met deze app.", - "clients.connectWizard.dotnetSdkStep1": "Installeer de .NET SDK", - "clients.connectWizard.dotnetSdkStep1Download": "De SDK is beschikbaar op [nuget] (https://www.nuget.org/packages/Squidex.ClientLibrary/)", - "clients.connectWizard.dotnetSdkStep2": "Maak een klantenbeheerder", - "clients.connectWizard.dotnetSdkStep2_15": "Version 15 and later: Create a client", - "clients.connectWizard.dotnetSdkStep3": "Optionally: Install the Service Extensions for the SDK", - "clients.connectWizard.dotnetSdkStep3Download": "The SDK Extension is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary.ServiceExtensions/)", - "clients.connectWizard.dotnetSdkStep4": "Optionally: Register the client manager and all clients", "clients.connectWizard.javascriptSdk": "Use the JavaScript SDK", "clients.connectWizard.javascriptSdkDocumentation": "Documentations for the JavaScript SDK is available: ", "clients.connectWizard.javascriptSdkHint": "Install the SDK and establish a connection to this app.", @@ -217,8 +208,10 @@ "clients.connectWizard.manuallyStep3": "Voeg het token toe als HTTP-header aan alle verzoeken", "clients.connectWizard.manuallyTokenHint": "Tokens vervallen gewoonlijk na 30 dagen, maar je kunt meerdere tokens aanvragen.", "clients.connectWizard.postManDocs": "Begin met de Postman-tutorial in de [Documentatie] (https://docs.squidex.io/02-documentation/developer-guides/api-overview/postman).", + "clients.connectWizard.sdk": "Use the official SDK", "clients.connectWizard.sdkHelp": "Heb je een andere SDK nodig?", "clients.connectWizard.sdkHelpLink": "Neem contact met ons op in het ondersteuningsforum", + "clients.connectWizard.sdkHint": "Install the SDK and establish a connection to this app.", "clients.connectWizard.step0Title": "Client instellen", "clients.connectWizard.step1Title": "Kies verbindingsmethode", "clients.connectWizard.step2Title": "Verbinden", @@ -387,6 +380,7 @@ "common.remember": "Onthoud mijn keuze", "common.rename": "Hernoemen", "common.renameTag": "Hernoem Tag", + "common.repository": "Repository", "common.requiredHint": "verplicht", "common.reset": "Reset", "common.restore": "Herstellen", diff --git a/backend/i18n/frontend_pt.json b/backend/i18n/frontend_pt.json index 0872dfdef..288d6efb1 100644 --- a/backend/i18n/frontend_pt.json +++ b/backend/i18n/frontend_pt.json @@ -166,6 +166,7 @@ "backups.started": "O reforço começou, pode levar vários minutos para ser concluído.", "backups.startedLabel": "Começou", "backups.startFailed": "Falhou em começar o backup.", + "chat.answer": "Here is my answer:", "chat.answers": "Answers", "chat.answersEmpty": "The ChatBot does not provide an answer or has not been configured yet.", "chat.ask": "Ask", @@ -194,16 +195,6 @@ "clients.connectWizard.cliStep3": "Adicione o nome da sua aplicação ao CLI config", "clients.connectWizard.cliStep3Hint": "Pode gerir a configuração de várias aplicações no CLI e mudar para uma aplicação.", "clients.connectWizard.cliStep4": "Mude para a sua aplicação no CLI", - "clients.connectWizard.dotnetSdk": "Conecte-se à sua App com a SDK", - "clients.connectWizard.dotnetSdkDocumentation": "Documentations for the .NET SDK is available: ", - "clients.connectWizard.dotnetSdkHint": "Descarregue um SDK e estabeleça uma ligação a esta aplicação.", - "clients.connectWizard.dotnetSdkStep1": "Instale o .NET SDK", - "clients.connectWizard.dotnetSdkStep1Download": "O SDK está disponível em [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary/)", - "clients.connectWizard.dotnetSdkStep2": "Criar um gestor de clientes", - "clients.connectWizard.dotnetSdkStep2_15": "Version 15 and later: Create a client", - "clients.connectWizard.dotnetSdkStep3": "Optionally: Install the Service Extensions for the SDK", - "clients.connectWizard.dotnetSdkStep3Download": "The SDK Extension is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary.ServiceExtensions/)", - "clients.connectWizard.dotnetSdkStep4": "Optionally: Register the client manager and all clients", "clients.connectWizard.javascriptSdk": "Use the JavaScript SDK", "clients.connectWizard.javascriptSdkDocumentation": "Documentations for the JavaScript SDK is available: ", "clients.connectWizard.javascriptSdkHint": "Install the SDK and establish a connection to this app.", @@ -217,8 +208,10 @@ "clients.connectWizard.manuallyStep3": "Adicione o token como cabeçalho HTTP a todos os pedidos", "clients.connectWizard.manuallyTokenHint": "Tokens normalmente expiram após 30 dias, mas você pode solicitar várias tokens.", "clients.connectWizard.postManDocs": "Comece com o tutorial do Carteiro na [Documentação](https://docs.squidex.io/02-documentation/developer-guides/api-overview/postman).", + "clients.connectWizard.sdk": "Use the official SDK", "clients.connectWizard.sdkHelp": "Precisa de outro SDK?", "clients.connectWizard.sdkHelpLink": "Contacte-nos no Fórum de Apoio", + "clients.connectWizard.sdkHint": "Install the SDK and establish a connection to this app.", "clients.connectWizard.step0Title": "Cliente de configuração", "clients.connectWizard.step1Title": "Escolha o método de ligação", "clients.connectWizard.step2Title": "Ligar", @@ -387,6 +380,7 @@ "common.remember": "Não pergunte de novo.", "common.rename": "Renomear", "common.renameTag": "Renomear Etiqueta", + "common.repository": "Repository", "common.requiredHint": "Necessário", "common.reset": "Reset", "common.restore": "Restaurar", diff --git a/backend/i18n/frontend_zh.json b/backend/i18n/frontend_zh.json index 28cea090c..1949dfa56 100644 --- a/backend/i18n/frontend_zh.json +++ b/backend/i18n/frontend_zh.json @@ -166,6 +166,7 @@ "backups.started": "备份已开始,可能需要几分钟才能完成。", "backups.startedLabel": "开始", "backups.startFailed": "启动备份失败。", + "chat.answer": "Here is my answer:", "chat.answers": "Answers", "chat.answersEmpty": "The ChatBot does not provide an answer or has not been configured yet.", "chat.ask": "Ask", @@ -194,16 +195,6 @@ "clients.connectWizard.cliStep3": "在 CLI 配置中添加你的应用名称", "clients.connectWizard.cliStep3Hint": "您可以在 CLI 中管理多个应用程序的配置并切换到一个应用程序。", "clients.connectWizard.cliStep4": "在 CLI 中切换到您的应用程序", - "clients.connectWizard.dotnetSdk": "使用 SDK 连接到您的应用程序", - "clients.connectWizard.dotnetSdkDocumentation": "Documentations for the .NET SDK is available: ", - "clients.connectWizard.dotnetSdkHint": "下载 SDK 并建立与此应用程序的连接。", - "clients.connectWizard.dotnetSdkStep1": "安装.NET SDK", - "clients.connectWizard.dotnetSdkStep1Download": "SDK 可在 [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary/)", - "clients.connectWizard.dotnetSdkStep2": "创建客户端管理器", - "clients.connectWizard.dotnetSdkStep2_15": "Version 15 and later: Create a client", - "clients.connectWizard.dotnetSdkStep3": "Optionally: Install the Service Extensions for the SDK", - "clients.connectWizard.dotnetSdkStep3Download": "The SDK Extension is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary.ServiceExtensions/)", - "clients.connectWizard.dotnetSdkStep4": "Optionally: Register the client manager and all clients", "clients.connectWizard.javascriptSdk": "Use the JavaScript SDK", "clients.connectWizard.javascriptSdkDocumentation": "Documentations for the JavaScript SDK is available: ", "clients.connectWizard.javascriptSdkHint": "Install the SDK and establish a connection to this app.", @@ -217,8 +208,10 @@ "clients.connectWizard.manuallyStep3": "将令牌作为 HTTP 标头添加到所有请求中", "clients.connectWizard.manuallyTokenHint": "令牌通常会在 30 天后过期,但您可以请求多个令牌。", "clients.connectWizard.postManDocs": "从 [文档](https://docs.squidex.io/02-documentation/developer-guides/api-overview/postman) 中的 Postman 教程开始。", + "clients.connectWizard.sdk": "Use the official SDK", "clients.connectWizard.sdkHelp": "你需要另一个 SDK?", "clients.connectWizard.sdkHelpLink": "在支持论坛联系我们", + "clients.connectWizard.sdkHint": "Install the SDK and establish a connection to this app.", "clients.connectWizard.step0Title": "设置客户端", "clients.connectWizard.step1Title": "选择连接方式", "clients.connectWizard.step2Title": "连接", @@ -387,6 +380,7 @@ "common.remember": "不要再问了", "common.rename": "重命名", "common.renameTag": "Rename Tag", + "common.repository": "Repository", "common.requiredHint": "必需的", "common.reset": "重置", "common.restore": "恢复", diff --git a/backend/i18n/source/frontend_en.json b/backend/i18n/source/frontend_en.json index bdeba4151..1eea7677e 100644 --- a/backend/i18n/source/frontend_en.json +++ b/backend/i18n/source/frontend_en.json @@ -166,6 +166,7 @@ "backups.started": "Backup started, it can take several minutes to complete.", "backups.startedLabel": "Started", "backups.startFailed": "Failed to start backup.", + "chat.answer": "Here is my answer:", "chat.answers": "Answers", "chat.answersEmpty": "The ChatBot does not provide an answer or has not been configured yet.", "chat.ask": "Ask", @@ -194,16 +195,6 @@ "clients.connectWizard.cliStep3": "Add your app name the CLI config", "clients.connectWizard.cliStep3Hint": "You can manage configuration to multiple apps in the CLI and switch to an app.", "clients.connectWizard.cliStep4": "Switch to your app in the CLI", - "clients.connectWizard.dotnetSdk": "Use the .NET SDK", - "clients.connectWizard.dotnetSdkDocumentation": "Documentations for the .NET SDK is available: ", - "clients.connectWizard.dotnetSdkHint": "Install the .NET SDK and establish a connection to this app.", - "clients.connectWizard.dotnetSdkStep1": "Install the .NET SDK", - "clients.connectWizard.dotnetSdkStep1Download": "The SDK is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary/)", - "clients.connectWizard.dotnetSdkStep2": "Version 14 and before: Create a client manager", - "clients.connectWizard.dotnetSdkStep2_15": "Version 15 and later: Create a client", - "clients.connectWizard.dotnetSdkStep3": "Optionally: Install the Service Extensions for the SDK", - "clients.connectWizard.dotnetSdkStep3Download": "The SDK Extension is available on [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary.ServiceExtensions/)", - "clients.connectWizard.dotnetSdkStep4": "Optionally: Register the client manager and all clients", "clients.connectWizard.javascriptSdk": "Use the JavaScript SDK", "clients.connectWizard.javascriptSdkDocumentation": "Documentations for the JavaScript SDK is available: ", "clients.connectWizard.javascriptSdkHint": "Install the SDK and establish a connection to this app.", @@ -217,8 +208,10 @@ "clients.connectWizard.manuallyStep3": "Add the token as HTTP header to all requests", "clients.connectWizard.manuallyTokenHint": "Tokens usally expire after 30days, but you can request multiple tokens.", "clients.connectWizard.postManDocs": "Start with the Postman tutorial in the [Documentation](https://docs.squidex.io/02-documentation/developer-guides/api-overview/postman).", + "clients.connectWizard.sdk": "Use the official SDK", "clients.connectWizard.sdkHelp": "You need another SDK?", "clients.connectWizard.sdkHelpLink": "Contact us in the Support Forum", + "clients.connectWizard.sdkHint": "Install the SDK and establish a connection to this app.", "clients.connectWizard.step0Title": "Setup client", "clients.connectWizard.step1Title": "Choose connection method", "clients.connectWizard.step2Title": "Connect", @@ -387,6 +380,7 @@ "common.remember": "Don't ask again", "common.rename": "Rename", "common.renameTag": "Rename Tag", + "common.repository": "Repository", "common.requiredHint": "required", "common.reset": "Reset", "common.restore": "Restore", diff --git a/backend/i18n/source/frontend_fr.json b/backend/i18n/source/frontend_fr.json index 5d610ab48..9807fbd5b 100644 --- a/backend/i18n/source/frontend_fr.json +++ b/backend/i18n/source/frontend_fr.json @@ -183,22 +183,6 @@ "clients.connectWizard.cliStep3": "Ajoutez le nom de votre application à la configuration CLI", "clients.connectWizard.cliStep3Hint": "Vous pouvez gérer la configuration de plusieurs applications dans l'interface de ligne de commande et basculer vers une application.", "clients.connectWizard.cliStep4": "Basculez vers votre application dans la CLI", - "clients.connectWizard.dotnetSdk": "Utiliser le SDK .NET", - "clients.connectWizard.dotnetSdkDocumentation": "Les documentations pour le SDK .NET sont disponibles\u00A0:", - "clients.connectWizard.dotnetSdkHint": "Installez le SDK .NET et établissez une connexion à cette application.", - "clients.connectWizard.dotnetSdkStep1": "Installer le SDK .NET", - "clients.connectWizard.dotnetSdkStep1Download": "Le SDK est disponible sur [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary/)", - "clients.connectWizard.dotnetSdkStep2": "Version 14 et antérieure : Créer un gestionnaire de clientèle", - "clients.connectWizard.dotnetSdkStep2_15": "Version 15 et supérieures : Créer un client", - "clients.connectWizard.dotnetSdkStep3": "Facultatif\u00A0: installez les extensions de service pour le SDK", - "clients.connectWizard.dotnetSdkStep3Download": "L'extension SDK est disponible sur [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary.ServiceExtensions/)", - "clients.connectWizard.dotnetSdkStep4": "Facultativement\u00A0: Enregistrez le gestionnaire de clientèle et tous les clients", - "clients.connectWizard.javascriptSdk": "Utiliser le SDK JavaScript", - "clients.connectWizard.javascriptSdkDocumentation": "Les documentations pour le SDK JavaScript sont disponibles\u00A0:", - "clients.connectWizard.javascriptSdkHint": "Installez le SDK et établissez une connexion à cette application.", - "clients.connectWizard.javascriptSdkStep1": "Installer le SDK Javascript", - "clients.connectWizard.javascriptSdkStep1Download": "Le SDK est disponible sur [npm](https://www.npmjs.com/package/@squidex/squidex", - "clients.connectWizard.javascriptSdkStep2": "Créer un client", "clients.connectWizard.manually": "Connectez-vous manuellement", "clients.connectWizard.manuallyHint": "Obtenez des instructions pour établir une connexion avec Postman ou curl.", "clients.connectWizard.manuallyStep1": "Obtenir un jeton en utilisant curl", diff --git a/backend/i18n/source/frontend_it.json b/backend/i18n/source/frontend_it.json index c35828a46..ae80fa617 100644 --- a/backend/i18n/source/frontend_it.json +++ b/backend/i18n/source/frontend_it.json @@ -147,11 +147,6 @@ "clients.connectWizard.cliStep3": "Inserisci il nome della tua app per la configurazione della CLI", "clients.connectWizard.cliStep3Hint": "È possibile gestire le configurazione per le diverse appi all'interno della CLI e passare ad un'app.", "clients.connectWizard.cliStep4": "Passa alla tua app usando CLI", - "clients.connectWizard.dotnetSdk": "Connetti la tua APP utilizzando SDK", - "clients.connectWizard.dotnetSdkHint": "Scarica l'SDK e connetti quest'app.", - "clients.connectWizard.dotnetSdkStep1": "Installa .NET SDK", - "clients.connectWizard.dotnetSdkStep1Download": "L'SDK è disponibile su [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary/)", - "clients.connectWizard.dotnetSdkStep2": "Crea un client manager", "clients.connectWizard.manually": "Connetti manualmente", "clients.connectWizard.manuallyHint": "Leggi le istruzioni su come stabilire una connessione utilizzando Postman o curl.", "clients.connectWizard.manuallyStep1": "Ottenere un token usando curl", diff --git a/backend/i18n/source/frontend_nl.json b/backend/i18n/source/frontend_nl.json index 91c127ec5..21f5b879a 100644 --- a/backend/i18n/source/frontend_nl.json +++ b/backend/i18n/source/frontend_nl.json @@ -169,11 +169,6 @@ "clients.connectWizard.cliStep3": "Voeg uw app-naam toe aan de CLI-configuratie", "clients.connectWizard.cliStep3Hint": "Je kunt de configuratie voor meerdere apps in de CLI beheren en overschakelen naar een app.", "clients.connectWizard.cliStep4": "Schakel over naar uw app in de CLI", - "clients.connectWizard.dotnetSdk": "Maak verbinding met uw app met SDK", - "clients.connectWizard.dotnetSdkHint": "Download een SDK en maak verbinding met deze app.", - "clients.connectWizard.dotnetSdkStep1": "Installeer de .NET SDK", - "clients.connectWizard.dotnetSdkStep1Download": "De SDK is beschikbaar op [nuget] (https://www.nuget.org/packages/Squidex.ClientLibrary/)", - "clients.connectWizard.dotnetSdkStep2": "Maak een klantenbeheerder", "clients.connectWizard.manually": "Handmatig verbinden", "clients.connectWizard.manuallyHint": "Krijg instructies om een ​​verbinding tot stand te brengen met Postman of curl.", "clients.connectWizard.manuallyStep1": "Verkrijg een token met curl", diff --git a/backend/i18n/source/frontend_pt.json b/backend/i18n/source/frontend_pt.json index bd4e8c8db..b36461c14 100644 --- a/backend/i18n/source/frontend_pt.json +++ b/backend/i18n/source/frontend_pt.json @@ -180,11 +180,6 @@ "clients.connectWizard.cliStep3": "Adicione o nome da sua aplicação ao CLI config", "clients.connectWizard.cliStep3Hint": "Pode gerir a configuração de várias aplicações no CLI e mudar para uma aplicação.", "clients.connectWizard.cliStep4": "Mude para a sua aplicação no CLI", - "clients.connectWizard.dotnetSdk": "Conecte-se à sua App com a SDK", - "clients.connectWizard.dotnetSdkHint": "Descarregue um SDK e estabeleça uma ligação a esta aplicação.", - "clients.connectWizard.dotnetSdkStep1": "Instale o .NET SDK", - "clients.connectWizard.dotnetSdkStep1Download": "O SDK está disponível em [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary/)", - "clients.connectWizard.dotnetSdkStep2": "Criar um gestor de clientes", "clients.connectWizard.manually": "Conecte-se manualmente", "clients.connectWizard.manuallyHint": "Obtenha instruções sobre como estabelecer uma ligação com o Carteiro ou o caracol.", "clients.connectWizard.manuallyStep1": "Obter um símbolo usando caracóis", diff --git a/backend/i18n/source/frontend_zh.json b/backend/i18n/source/frontend_zh.json index 8d172325c..e518e8ee4 100644 --- a/backend/i18n/source/frontend_zh.json +++ b/backend/i18n/source/frontend_zh.json @@ -157,11 +157,6 @@ "clients.connectWizard.cliStep3": "在 CLI 配置中添加你的应用名称", "clients.connectWizard.cliStep3Hint": "您可以在 CLI 中管理多个应用程序的配置并切换到一个应用程序。", "clients.connectWizard.cliStep4": "在 CLI 中切换到您的应用程序", - "clients.connectWizard.dotnetSdk": "使用 SDK 连接到您的应用程序", - "clients.connectWizard.dotnetSdkHint": "下载 SDK 并建立与此应用程序的连接。", - "clients.connectWizard.dotnetSdkStep1": "安装.NET SDK", - "clients.connectWizard.dotnetSdkStep1Download": "SDK 可在 [nuget](https://www.nuget.org/packages/Squidex.ClientLibrary/)", - "clients.connectWizard.dotnetSdkStep2": "创建客户端管理器", "clients.connectWizard.manually": "手动连接", "clients.connectWizard.manuallyHint": "获取如何与 Postman 或 curl 建立连接的说明。", "clients.connectWizard.manuallyStep1": "使用 curl 获取令牌", diff --git a/frontend/src/app/app.component.html b/frontend/src/app/app.component.html index c70d2283c..f0454dfc4 100644 --- a/frontend/src/app/app.component.html +++ b/frontend/src/app/app.component.html @@ -1,4 +1,4 @@ -
+
diff --git a/frontend/src/app/features/content/shared/forms/chat-dialog.component.html b/frontend/src/app/features/content/shared/forms/chat-dialog.component.html index f130e3f29..0caa1f403 100644 --- a/frontend/src/app/features/content/shared/forms/chat-dialog.component.html +++ b/frontend/src/app/features/content/shared/forms/chat-dialog.component.html @@ -1,17 +1,84 @@ - + {{ 'chat.title' | sqxTranslate }} - - - +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ {{item.prompt}} +
+
+
+ +
+
+ +
+
+
+ +
+
+
+
+
+ {{ 'chat.answer' | sqxTranslate}} +
+ + +
+ +
+
+
+
+
+ +
+
+
+ +
+
+
+
+ + + + + +
+
+
+
+ +
-
- - - -

{{ 'chat.answers' | sqxTranslate }}

- -
- {{ 'chat.answersEmpty' | sqxTranslate }} -
- -
-
- -
-
- -
-
-
-
- - -
- -
-
diff --git a/frontend/src/app/features/content/shared/forms/chat-dialog.component.scss b/frontend/src/app/features/content/shared/forms/chat-dialog.component.scss index 573bc47d6..31ccba692 100644 --- a/frontend/src/app/features/content/shared/forms/chat-dialog.component.scss +++ b/frontend/src/app/features/content/shared/forms/chat-dialog.component.scss @@ -1,6 +1,66 @@ @import 'mixins'; @import 'vars'; +:host ::ng-deep { + .modal-body { + background-color: $color-background; + } +} + +form { + width: 100%; +} + textarea { height: 300px; +} + +.flex-reverse { + flex-direction: row-reverse; +} + +.bubble { + background-color: $color-white; + border: 0; + border-radius: $border-radius; + padding: 1rem; + position: relative; + + &-right { + &::before { + @include caret-left($color-white, 10px); + @include absolute(.5rem, null, null, -18px); + } + } + + &-left { + &::before { + @include caret-right($color-white, 10px); + @include absolute(.5rem, -18px); + } + } +} + +@keyframes blink { + 50% { + fill: transparent + } +} + +.dot { + animation: 1s blink infinite; +} + +svg { + .dot { + fill: $color-border; + } +} + +.dot:nth-child(2) { + animation-delay: 250ms; +} + +.dot:nth-child(3) { + animation-delay: 500ms; } \ No newline at end of file diff --git a/frontend/src/app/features/content/shared/forms/chat-dialog.component.ts b/frontend/src/app/features/content/shared/forms/chat-dialog.component.ts index b0aff8729..40c1d6511 100644 --- a/frontend/src/app/features/content/shared/forms/chat-dialog.component.ts +++ b/frontend/src/app/features/content/shared/forms/chat-dialog.component.ts @@ -5,8 +5,8 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, EventEmitter, Output } from '@angular/core'; -import { AppsState, StatefulComponent, TranslationsService } from '@app/shared'; +import { Component, ElementRef, EventEmitter, Output, ViewChild } from '@angular/core'; +import { AppsState, AuthService, StatefulComponent, TranslationsService } from '@app/shared'; interface State { // True, when running @@ -16,7 +16,7 @@ interface State { chatQuestion: string; // The answers. - chatAnswers?: ReadonlyArray; + chatTalk: ReadonlyArray<{ prompt: string; isUser?: boolean }>; } @Component({ @@ -31,14 +31,20 @@ export class ChatDialogComponent extends StatefulComponent { @Output() public select = new EventEmitter(); + @ViewChild('input', { static: false }) + public input!: ElementRef; + + public user = this.authService.user!; + constructor( private readonly appsState: AppsState, + private readonly authService: AuthService, private readonly translator: TranslationsService, ) { super({ isRunning: false, chatQuestion: '', - chatAnswers: undefined, + chatTalk: [], }); } @@ -47,15 +53,40 @@ export class ChatDialogComponent extends StatefulComponent { } public ask() { - this.next({ isRunning: true }); + const prompt = this.snapshot.chatQuestion; - this.translator.ask(this.appsState.appName, { prompt: this.snapshot.chatQuestion }) + if (!prompt || prompt.length === 0) { + return; + } + + this.next(s => ({ + ...s, + chatQuestion: '', + chatTalk: [ + ...s.chatTalk, + { prompt, isUser: true }, + ], + isRunning: true, + })); + + this.translator.ask(this.appsState.appName, { prompt }) .subscribe({ next: chatAnswers => { - this.next({ chatAnswers, isRunning: false }); + this.next(s => ({ + ...s, + chatTalk: [ + ...s.chatTalk, + ...chatAnswers.map(answer => ({ prompt: answer })), + ], + isRunning: false, + })); + + setTimeout(() => { + this.input.nativeElement.focus(); + }, 100); }, error: () => { - this.next({ chatAnswers: [], isRunning: false }); + this.next({ isRunning: false }); }, complete: () => { this.next({ isRunning: false }); diff --git a/frontend/src/app/features/content/shared/forms/field-editor.component.ts b/frontend/src/app/features/content/shared/forms/field-editor.component.ts index 36cc8f023..892fbc2ad 100644 --- a/frontend/src/app/features/content/shared/forms/field-editor.component.ts +++ b/frontend/src/app/features/content/shared/forms/field-editor.component.ts @@ -57,7 +57,7 @@ export class FieldEditorComponent { public isEmpty?: Observable; public isExpanded = false; - public chatDialog = new DialogModel(); + public chatDialog = new DialogModel(true); public get field() { return this.formModel.field; diff --git a/frontend/src/app/features/settings/pages/clients/client-connect-form.component.html b/frontend/src/app/features/settings/pages/clients/client-connect-form.component.html index 4f4ba0db0..72ec79bbe 100644 --- a/frontend/src/app/features/settings/pages/clients/client-connect-form.component.html +++ b/frontend/src/app/features/settings/pages/clients/client-connect-form.component.html @@ -9,7 +9,7 @@ - + - @@ -54,18 +54,10 @@
-
-
{{ 'clients.connectWizard.dotnetSdk' | sqxTranslate }}
+
+
{{ 'clients.connectWizard.sdk' | sqxTranslate }}
- {{ 'clients.connectWizard.dotnetSdkHint' | sqxTranslate }} - - -
- -
-
{{ 'clients.connectWizard.javascriptSdk' | sqxTranslate }}
- - {{ 'clients.connectWizard.javascriptSdkHint' | sqxTranslate }} + {{ 'clients.connectWizard.sdkHint' | sqxTranslate }}
@@ -144,132 +136,35 @@

- -
- - {{ 'clients.connectWizard.dotnetSdkDocumentation' | sqxTranslate }} {{ 'common.documentation' | sqxTranslate }} - -
- -
-
1 {{ 'clients.connectWizard.dotnetSdkStep1' | sqxTranslate }}
- -
- -

- dotnet add package Squidex.ClientLibrary -

-
- -
-
2 {{ 'clients.connectWizard.dotnetSdkStep2' | sqxTranslate }}
- -

- -

using Squidex.ClientLibrary;
-
 
-
var clientManager = new SquidexClientManager(new SquidexOptions
-
{{'{'}}
-
AppName = "{{appName}}",
-
ClientId = "{{appName}}:{{client.id}}",
-
ClientSecret = "{{client.secret}}",
-
Url = "{{apiUrl.value}}"
-
});
- -

-
- -
-
2 {{ 'clients.connectWizard.dotnetSdkStep2_15' | sqxTranslate }}
- -

- -

using Squidex.ClientLibrary;
-
 
-
var client = new SquidexClient(new SquidexOptions
-
{{'{'}}
-
AppName = "{{appName}}",
-
ClientId = "{{appName}}:{{client.id}},
-
ClientSecret = "{{client.secret}}",
-
Url = "{{apiUrl.value}}"
-
});
- -

-
- -
-
3 {{ 'clients.connectWizard.dotnetSdkStep3' | sqxTranslate }}
- -
- -

- dotnet add package Squidex.ClientLibrary.ServiceExtensions -

+ +
+
+ + {{availableSDK.value.name}} +
-
-
4 {{ 'clients.connectWizard.dotnetSdkStep4' | sqxTranslate }}
+
+ -

- -

using Microsoft.Extensions.DependencyInjection;
-
 
-
services.AddSquidex(options =>
-
{{'{'}}
-
options.AppName = "{{appName}}";
-
options.ClientId = "{{appName}}:{{client.id}}";
-
options.ClientSecret = "{{client.secret}}";
-
options.Url = "{{apiUrl.value}}";
-
});
- -

+
-
+
{{ 'clients.connectWizard.sdkHelp' | sqxTranslate }} {{ 'clients.connectWizard.sdkHelpLink' | sqxTranslate }}
- -
- - {{ 'clients.connectWizard.javascriptSdkDocumentation' | sqxTranslate }} {{ 'common.documentation' | sqxTranslate }} - -
- -
-
1 {{ 'clients.connectWizard.javascriptSdkStep1' | sqxTranslate }}
- -
- -

- npm i @squidex/squidex --save -

-
- -
-
2 {{ 'clients.connectWizard.javascriptSdkStep2' | sqxTranslate }}
- -

- -

import {{'{'}} SquidexClient } from "@squidex/squidex";
-
 
-
const client = new SquidexClient({{'{'}}
-
appName: "{{appName}}",
-
clientId: "{{appName}}:{{client.id}}",
-
clientSecret: "{{client.secret}}",
-
environment: "{{apiUrl.value}}"
-
});
- -

-
-
- diff --git a/frontend/src/app/features/settings/pages/clients/client-connect-form.component.scss b/frontend/src/app/features/settings/pages/clients/client-connect-form.component.scss index 9bf1100f4..255463ba6 100644 --- a/frontend/src/app/features/settings/pages/clients/client-connect-form.component.scss +++ b/frontend/src/app/features/settings/pages/clients/client-connect-form.component.scss @@ -1,6 +1,26 @@ @import 'mixins'; @import 'vars'; +sqx-code { + pre { + white-space: pre; + } +} + +:host ::ng-deep { + svg { + max-height: 100%; + } + + h3 { + margin-top: 1.75rem; + } + + .code-container { + margin: .5rem 0; + } +} + .badge { @include circle(1.3rem); font-size: $font-smallest; @@ -23,6 +43,30 @@ } } +.sdk-header { + border: 1px solid $color-border; + border-radius: $border-radius; + display: inline-block; + cursor: pointer; + padding: 1rem; + margin-bottom: .5rem; + margin-right: .5rem; + width: 160px; + text-align: center; + + &.active { + border-color: $color-theme-brand; + } + + &:hover { + border-color: $color-theme-brand-dark; + } + + .logo { + height: 100px; + } +} + .option { background: none; border: 1px solid $color-border; @@ -43,10 +87,4 @@ font-size: $font-smallest; font-weight: normal; } -} - -sqx-code { - pre { - white-space: pre; - } } \ No newline at end of file diff --git a/frontend/src/app/features/settings/pages/clients/client-connect-form.component.ts b/frontend/src/app/features/settings/pages/clients/client-connect-form.component.ts index 35d583ade..863c854e3 100644 --- a/frontend/src/app/features/settings/pages/clients/client-connect-form.component.ts +++ b/frontend/src/app/features/settings/pages/clients/client-connect-form.component.ts @@ -6,7 +6,7 @@ */ import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { AccessTokenDto, ApiUrlConfig, AppsState, ClientDto, ClientsService, ClientTourStated, DialogService, MessageBus } from '@app/shared'; +import { AccessTokenDto, ApiUrlConfig, AppsState, ClientDto, ClientsService, ClientTourStated, DialogService, HelpService, MessageBus, SDKEntry } from '@app/shared'; @Component({ selector: 'sqx-client-connect-form', @@ -20,21 +20,21 @@ export class ClientConnectFormComponent implements OnInit { @Input({ required: true }) public client!: ClientDto; + public sdks = this.helpService.getSDKs(); + public sdk?: SDKEntry; + public appName!: string; public appToken?: AccessTokenDto; public step = 'Start'; - public get isStart() { - return this.step === 'Start'; - } - constructor( public readonly appsState: AppsState, public readonly apiUrl: ApiUrlConfig, private readonly changeDetector: ChangeDetectorRef, private readonly clientsService: ClientsService, private readonly dialogs: DialogService, + private readonly helpService: HelpService, private readonly messageBus: MessageBus, ) { } @@ -57,6 +57,15 @@ export class ClientConnectFormComponent implements OnInit { this.messageBus.emit(new ClientTourStated()); } + public select(sdk: SDKEntry) { + sdk.instructions = sdk.instructions.replace(//g, this.appName); + sdk.instructions = sdk.instructions.replace(//g, `${this.appName}:${this.client.id}`); + sdk.instructions = sdk.instructions.replace(//g, this.client.secret); + sdk.instructions = sdk.instructions.replace(//g, this.apiUrl.value); + + this.sdk = sdk; + } + public go(step: string) { this.step = step; } diff --git a/frontend/src/app/features/settings/pages/clients/client.component.ts b/frontend/src/app/features/settings/pages/clients/client.component.ts index 6ef18c945..c356f014a 100644 --- a/frontend/src/app/features/settings/pages/clients/client.component.ts +++ b/frontend/src/app/features/settings/pages/clients/client.component.ts @@ -23,7 +23,7 @@ export class ClientComponent { public apiCallsLimit = 0; - public connectDialog = new DialogModel(); + public connectDialog = new DialogModel(false); constructor( public readonly appsState: AppsState, diff --git a/frontend/src/app/framework/angular/code.component.html b/frontend/src/app/framework/angular/code.component.html index dd797f9dc..64f56826e 100644 --- a/frontend/src/app/framework/angular/code.component.html +++ b/frontend/src/app/framework/angular/code.component.html @@ -1,7 +1,7 @@ -
- -
+
\ No newline at end of file diff --git a/frontend/src/app/framework/angular/code.component.scss b/frontend/src/app/framework/angular/code.component.scss index b7cb6a2ab..2742d895e 100644 --- a/frontend/src/app/framework/angular/code.component.scss +++ b/frontend/src/app/framework/angular/code.component.scss @@ -1,34 +1,2 @@ @import 'mixins'; -@import 'vars'; - -.code { - background: $color-code-background; - margin: .25rem 0; - padding-left: .5rem; - padding-right: 3rem; -} - -.code, -.code-copy { - @include text-code; - min-height: 27px; - padding-bottom: .25rem; - padding-top: .25rem; -} - -.copy-container { - position: relative; -} - -.code-copy { - @include absolute(0, 0, auto, auto); - background: darken($color-border-dark, 30%); - border: 0; - color: $color-white; - padding-left: .375rem; - padding-right: .375rem; - - &:focus { - background: darken($color-border-dark, 40%); - } -} \ No newline at end of file +@import 'vars'; \ No newline at end of file diff --git a/frontend/src/app/framework/angular/code.component.ts b/frontend/src/app/framework/angular/code.component.ts index 5d1bf4108..2cb1318a7 100644 --- a/frontend/src/app/framework/angular/code.component.ts +++ b/frontend/src/app/framework/angular/code.component.ts @@ -6,6 +6,7 @@ */ import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { MathHelper } from '../internal'; @Component({ selector: 'sqx-code', @@ -13,4 +14,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; templateUrl: './code.component.html', changeDetection: ChangeDetectionStrategy.OnPush, }) -export class CodeComponent {} +export class CodeComponent { + public readonly id = MathHelper.guid(); +} diff --git a/frontend/src/app/framework/angular/forms/copy-global.directive.ts b/frontend/src/app/framework/angular/forms/copy-global.directive.ts new file mode 100644 index 000000000..f668e4388 --- /dev/null +++ b/frontend/src/app/framework/angular/forms/copy-global.directive.ts @@ -0,0 +1,91 @@ +/* + * Squidex Headless CMS + * + * @license + * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. + */ + +import { Directive, HostListener, Renderer2 } from '@angular/core'; +import { DialogService, Types } from '@app/framework/internal'; + +@Directive({ + selector: '[sqxCopyGlobal]', +}) +export class CopyGlobalDirective { + constructor( + private readonly dialogs: DialogService, + private readonly renderer: Renderer2, + ) { + } + + @HostListener('document:click', ['$event']) + public onClick(event: MouseEvent) { + function findElement(target: HTMLElement | null): string | null { + if (!target) { + return null; + } + + const id = target.getAttribute('copy')!; + + if (id) { + return id; + } + + return findElement(target.parentElement); + } + + const toCopy = document.getElementById(findElement(event.target as any)!); + + if (!toCopy) { + return; + } + + this.copyToClipbord(toCopy); + } + + private copyToClipbord(element: HTMLElement) { + if (Types.is(element, HTMLInputElement) || Types.is(element, HTMLTextAreaElement)) { + const currentFocus: any = document.activeElement; + + const prevSelectionStart = element.selectionStart; + const prevSelectionEnd = element.selectionEnd; + + element.focus(); + element.setSelectionRange(0, element.value.length); + + this.copy(); + + element.setSelectionRange(prevSelectionStart!, prevSelectionEnd!); + + if (currentFocus && Types.isFunction(currentFocus.focus)) { + currentFocus.focus(); + } + } else { + const input = this.renderer.createElement('textarea'); + + this.renderer.setStyle(input, 'position', 'absolute'); + this.renderer.setStyle(input, 'right', '-1000px'); + this.renderer.appendChild(document.body, input); + + input.value = element.innerText; + input.select(); + + this.copy(); + + this.renderer.removeChild(document.body, input); + } + } + + private copy() { + try { + // eslint-disable-next-line deprecation/deprecation + document.execCommand('copy'); + + this.dialogs.notifyInfo('i18n:common.clipboardAdded'); + + return true; + } catch (e) { + return false; + } + } +} diff --git a/frontend/src/app/framework/angular/markdown.directive.ts b/frontend/src/app/framework/angular/markdown.directive.ts index 54ab21a30..77e48b071 100644 --- a/frontend/src/app/framework/angular/markdown.directive.ts +++ b/frontend/src/app/framework/angular/markdown.directive.ts @@ -15,6 +15,9 @@ export class MarkdownDirective { @Input('sqxMarkdown') public markdown!: string; + @Input({ transform: booleanAttribute }) + public trusted = false; + @Input({ transform: booleanAttribute }) public inline = true; @@ -43,7 +46,7 @@ export class MarkdownDirective { } else if (this.optional && !hasExclamation) { html = markdown; } else if (this.markdown) { - html = renderMarkdown(markdown, this.inline); + html = renderMarkdown(markdown, this.inline, this.trusted); } const hasHtml = html.indexOf('<') >= 0 || html.indexOf('&') >= 0; diff --git a/frontend/src/app/framework/declarations.ts b/frontend/src/app/framework/declarations.ts index c83e476d9..2962ec7c2 100644 --- a/frontend/src/app/framework/declarations.ts +++ b/frontend/src/app/framework/declarations.ts @@ -14,6 +14,7 @@ export * from './angular/forms/confirm-click.directive'; export * from './angular/forms/control-errors-messages.component'; export * from './angular/forms/control-errors.component'; export * from './angular/forms/copy.directive'; +export * from './angular/forms/copy-global.directive'; export * from './angular/forms/editable-title.component'; export * from './angular/forms/editors/autocomplete.component'; export * from './angular/forms/editors/checkbox-group.component'; diff --git a/frontend/src/app/framework/module.ts b/frontend/src/app/framework/module.ts index 08b760227..1af43c185 100644 --- a/frontend/src/app/framework/module.ts +++ b/frontend/src/app/framework/module.ts @@ -12,7 +12,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { RouterModule } from '@angular/router'; import { ColorPickerModule } from 'ngx-color-picker'; import { TourService as BaseTourService } from 'ngx-ui-tour-core'; -import { AnalyticsService, AutocompleteComponent, AvatarComponent, CachingInterceptor, CanDeactivateGuard, CheckboxGroupComponent, ClipboardService, CodeComponent, CodeEditorComponent, ColorPickerComponent, CompensateScrollbarDirective, ConfirmClickDirective, ControlErrorsComponent, ControlErrorsMessagesComponent, CopyDirective, DarkenPipe, DatePipe, DateTimeEditorComponent, DayOfWeekPipe, DayPipe, DialogRendererComponent, DialogService, DisplayNamePipe, DropdownComponent, DropdownMenuComponent, DurationPipe, EditableTitleComponent, ExternalLinkDirective, FileDropDirective, FileSizePipe, FocusOnInitDirective, FormAlertComponent, FormErrorComponent, FormHintComponent, FromNowPipe, FullDateTimePipe, GlobalErrorHandler, HighlightPipe, HoverBackgroundDirective, IfOnceDirective, ImageSourceDirective, ImageUrlDirective, IndeterminateValueDirective, ISODatePipe, JoinPipe, KeysPipe, KNumberPipe, LanguageSelectorComponent, LayoutComponent, LayoutContainerDirective, LightenPipe, ListViewComponent, LoaderComponent, LoadingInterceptor, LoadingService, LocalizedInputComponent, LocalStoreService, LongHoverDirective, MarkdownDirective, MarkdownInlinePipe, MarkdownPipe, MessageBus, ModalDialogComponent, ModalDirective, ModalPlacementDirective, MonthPipe, PagerComponent, ParentLinkDirective, ProgressBarComponent, RadioGroupComponent, ResizedDirective, ResizeService, ResourceLoaderService, RootViewComponent, SafeHtmlPipe, SafeResourceUrlPipe, SafeUrlPipe, ScrollActiveDirective, ShortcutComponent, ShortcutDirective, ShortcutService, ShortDatePipe, ShortTimePipe, StarsComponent, StatusIconComponent, StopClickDirective, StopDragDirective, SyncScollingDirective, SyncWidthDirective, TabRouterlinkDirective, TagEditorComponent, TemplateWrapperDirective, TempService, TitleComponent, TitleService, ToggleComponent, ToolbarComponent, TooltipDirective, TourService, TourStepDirective, TourTemplateComponent, TransformInputDirective, TranslatePipe, VideoPlayerComponent } from './declarations'; +import { AnalyticsService, AutocompleteComponent, AvatarComponent, CachingInterceptor, CanDeactivateGuard, CheckboxGroupComponent, ClipboardService, CodeComponent, CodeEditorComponent, ColorPickerComponent, CompensateScrollbarDirective, ConfirmClickDirective, ControlErrorsComponent, ControlErrorsMessagesComponent, CopyDirective, CopyGlobalDirective, DarkenPipe, DatePipe, DateTimeEditorComponent, DayOfWeekPipe, DayPipe, DialogRendererComponent, DialogService, DisplayNamePipe, DropdownComponent, DropdownMenuComponent, DurationPipe, EditableTitleComponent, ExternalLinkDirective, FileDropDirective, FileSizePipe, FocusOnInitDirective, FormAlertComponent, FormErrorComponent, FormHintComponent, FromNowPipe, FullDateTimePipe, GlobalErrorHandler, HighlightPipe, HoverBackgroundDirective, IfOnceDirective, ImageSourceDirective, ImageUrlDirective, IndeterminateValueDirective, ISODatePipe, JoinPipe, KeysPipe, KNumberPipe, LanguageSelectorComponent, LayoutComponent, LayoutContainerDirective, LightenPipe, ListViewComponent, LoaderComponent, LoadingInterceptor, LoadingService, LocalizedInputComponent, LocalStoreService, LongHoverDirective, MarkdownDirective, MarkdownInlinePipe, MarkdownPipe, MessageBus, ModalDialogComponent, ModalDirective, ModalPlacementDirective, MonthPipe, PagerComponent, ParentLinkDirective, ProgressBarComponent, RadioGroupComponent, ResizedDirective, ResizeService, ResourceLoaderService, RootViewComponent, SafeHtmlPipe, SafeResourceUrlPipe, SafeUrlPipe, ScrollActiveDirective, ShortcutComponent, ShortcutDirective, ShortcutService, ShortDatePipe, ShortTimePipe, StarsComponent, StatusIconComponent, StopClickDirective, StopDragDirective, SyncScollingDirective, SyncWidthDirective, TabRouterlinkDirective, TagEditorComponent, TemplateWrapperDirective, TempService, TitleComponent, TitleService, ToggleComponent, ToolbarComponent, TooltipDirective, TourService, TourStepDirective, TourTemplateComponent, TransformInputDirective, TranslatePipe, VideoPlayerComponent } from './declarations'; @NgModule({ imports: [ @@ -34,6 +34,7 @@ import { AnalyticsService, AutocompleteComponent, AvatarComponent, CachingInterc ControlErrorsComponent, ControlErrorsMessagesComponent, CopyDirective, + CopyGlobalDirective, DarkenPipe, DatePipe, DateTimeEditorComponent, @@ -124,6 +125,7 @@ import { AnalyticsService, AutocompleteComponent, AvatarComponent, CachingInterc ConfirmClickDirective, ControlErrorsComponent, CopyDirective, + CopyGlobalDirective, DarkenPipe, DatePipe, DateTimeEditorComponent, diff --git a/frontend/src/app/framework/utils/markdown.ts b/frontend/src/app/framework/utils/markdown.ts index c6bb9a851..1d1b86230 100644 --- a/frontend/src/app/framework/utils/markdown.ts +++ b/frontend/src/app/framework/utils/markdown.ts @@ -6,6 +6,7 @@ */ import { marked } from 'marked'; +import { MathHelper } from './math-helper'; function renderLink(href: string, _: string, text: string) { if (href && href.startsWith('mailto')) { @@ -15,6 +16,20 @@ function renderLink(href: string, _: string, text: string) { } } +function renderCode(code: string) { + const id = MathHelper.guid(); + + return ` +
+ + +
${code}
+
+ `; +} + function renderInlineParagraph(text: string) { return text; } @@ -24,14 +39,18 @@ const RENDERER_INLINE = new marked.Renderer(); RENDERER_INLINE.paragraph = renderInlineParagraph; RENDERER_INLINE.link = renderLink; +RENDERER_INLINE.code = renderCode; RENDERER_DEFAULT.link = renderLink; +RENDERER_DEFAULT.code = renderCode; -export function renderMarkdown(input: string | undefined | null, inline: boolean) { +export function renderMarkdown(input: string | undefined | null, inline: boolean, trusted = false) { if (!input) { return ''; } - input = escapeHTML(input); + if (!trusted) { + input = escapeHTML(input); + } if (inline) { return marked(input, { renderer: RENDERER_INLINE, mangle: false, headerIds: false }); diff --git a/frontend/src/app/shared/services/help.service.spec.ts b/frontend/src/app/shared/services/help.service.spec.ts index a9183f8d2..98403102c 100644 --- a/frontend/src/app/shared/services/help.service.spec.ts +++ b/frontend/src/app/shared/services/help.service.spec.ts @@ -9,7 +9,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; -import { HelpService } from '@app/shared/internal'; +import { HelpService, SDKEntry } from '@app/shared/internal'; describe('HelpService', () => { beforeEach(() => { @@ -62,4 +62,44 @@ describe('HelpService', () => { expect(helpSections!).toEqual(''); })); + + it('should make get request to get sdks', + inject([HelpService, HttpTestingController], (helpService: HelpService, httpMock: HttpTestingController) => { + let sdks: Record; + + helpService.getSDKs().subscribe(result => { + sdks = result; + }); + + const req = httpMock.expectOne('https://raw.githubusercontent.com/Squidex/sdk-fern/main/sdks.json'); + + expect(req.request.method).toEqual('GET'); + expect(req.request.headers.get('If-Match')).toBeNull(); + + req.flush({ + dotnet: {}, + }); + + expect(sdks!).toEqual({ + dotnet: {} as any, + }); + })); + + it('should return empty sdks if get request fails', + inject([HelpService, HttpTestingController], (helpService: HelpService, httpMock: HttpTestingController) => { + let sdks: Record; + + helpService.getSDKs().subscribe(result => { + sdks = result; + }); + + const req = httpMock.expectOne('https://raw.githubusercontent.com/Squidex/sdk-fern/main/sdks.json'); + + expect(req.request.method).toEqual('GET'); + expect(req.request.headers.get('If-Match')).toBeNull(); + + req.error({}); + + expect(sdks!).toEqual({}); + })); }); diff --git a/frontend/src/app/shared/services/help.service.ts b/frontend/src/app/shared/services/help.service.ts index c42cb6c9b..1bc0c0d7c 100644 --- a/frontend/src/app/shared/services/help.service.ts +++ b/frontend/src/app/shared/services/help.service.ts @@ -10,6 +10,23 @@ import { Injectable } from '@angular/core'; import { Observable, of } from 'rxjs'; import { catchError } from 'rxjs/operators'; +export interface SDKEntry { + // The display name. + name: string; + + // The link to the repository. + repository: string; + + // The link to the documentation. + documentation: string; + + // The instructions as markdown. + instructions: string; + + // The SVG logo. + logo: string; +} + @Injectable() export class HelpService { constructor( @@ -23,4 +40,11 @@ export class HelpService { return this.http.get(url, { responseType: 'text' }).pipe( catchError(() => of(''))); } + + public getSDKs(): Observable> { + const url = 'https://raw.githubusercontent.com/Squidex/sdk-fern/main/sdks.json'; + + return this.http.get>(url).pipe( + catchError(() => of({}))); + } } diff --git a/frontend/src/app/theme/_common.scss b/frontend/src/app/theme/_common.scss index dca2b684e..74b6c6727 100644 --- a/frontend/src/app/theme/_common.scss +++ b/frontend/src/app/theme/_common.scss @@ -154,6 +154,40 @@ hr { } } +// +// Code +// +.code { + background: $color-code-background; + margin: .25rem 0; + padding-left: .5rem; + padding-right: 3rem; +} +.code, +.code-copy { + @include text-code; + min-height: 27px; + padding-bottom: .25rem; + padding-top: .25rem; +} + +.code-container { + position: relative; +} + +.code-copy { + @include absolute(0, 0, auto, auto); + background: darken($color-border-dark, 30%); + border: 0; + color: $color-white; + padding-left: .375rem; + padding-right: .375rem; + + &:focus { + background: darken($color-border-dark, 40%); + } +} + // // Profile picture in circle // @@ -187,6 +221,10 @@ hr { img { max-height: 70%; } + + &-sm { + @include circle(32px); + } } .ngx-ui-tour_backdrop { From f196bbfe89df7e60ab38612cd4bf614c6a11c969 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 7 Sep 2023 15:32:32 +0200 Subject: [PATCH 05/35] Fix dialog. --- .../app/features/content/shared/forms/field-editor.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/app/features/content/shared/forms/field-editor.component.ts b/frontend/src/app/features/content/shared/forms/field-editor.component.ts index 892fbc2ad..36cc8f023 100644 --- a/frontend/src/app/features/content/shared/forms/field-editor.component.ts +++ b/frontend/src/app/features/content/shared/forms/field-editor.component.ts @@ -57,7 +57,7 @@ export class FieldEditorComponent { public isEmpty?: Observable; public isExpanded = false; - public chatDialog = new DialogModel(true); + public chatDialog = new DialogModel(); public get field() { return this.formModel.field; From 447203b7540121db5ee0d761fd71ab9d61c0e46e Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 7 Sep 2023 15:45:17 +0200 Subject: [PATCH 06/35] Better error handling. --- .../shared/forms/chat-dialog.component.html | 23 +++++++++--- .../shared/forms/chat-dialog.component.ts | 35 +++++++++++++------ 2 files changed, 42 insertions(+), 16 deletions(-) diff --git a/frontend/src/app/features/content/shared/forms/chat-dialog.component.html b/frontend/src/app/features/content/shared/forms/chat-dialog.component.html index 0caa1f403..2ae291f69 100644 --- a/frontend/src/app/features/content/shared/forms/chat-dialog.component.html +++ b/frontend/src/app/features/content/shared/forms/chat-dialog.component.html @@ -20,10 +20,10 @@
-
+
- {{item.prompt}} + {{item.text}}
@@ -31,7 +31,20 @@
-
+
+
+
+ +
+
+
+
+ {{ item.text | sqxTranslate}} +
+
+
+ +
@@ -43,10 +56,10 @@ {{ 'chat.answer' | sqxTranslate}}
- +
-
diff --git a/frontend/src/app/features/content/shared/forms/chat-dialog.component.ts b/frontend/src/app/features/content/shared/forms/chat-dialog.component.ts index 40c1d6511..6806afbda 100644 --- a/frontend/src/app/features/content/shared/forms/chat-dialog.component.ts +++ b/frontend/src/app/features/content/shared/forms/chat-dialog.component.ts @@ -6,6 +6,7 @@ */ import { Component, ElementRef, EventEmitter, Output, ViewChild } from '@angular/core'; +import { delay } from 'rxjs/operators'; import { AppsState, AuthService, StatefulComponent, TranslationsService } from '@app/shared'; interface State { @@ -16,7 +17,7 @@ interface State { chatQuestion: string; // The answers. - chatTalk: ReadonlyArray<{ prompt: string; isUser?: boolean }>; + chatTalk: ReadonlyArray<{ text: string; type: 'user' | 'bot' | 'system' }>; } @Component({ @@ -64,22 +65,34 @@ export class ChatDialogComponent extends StatefulComponent { chatQuestion: '', chatTalk: [ ...s.chatTalk, - { prompt, isUser: true }, + { text: prompt, type: 'user' }, ], isRunning: true, })); - this.translator.ask(this.appsState.appName, { prompt }) + this.translator.ask(this.appsState.appName, { prompt }).pipe(delay(500)) .subscribe({ next: chatAnswers => { - this.next(s => ({ - ...s, - chatTalk: [ - ...s.chatTalk, - ...chatAnswers.map(answer => ({ prompt: answer })), - ], - isRunning: false, - })); + if (chatAnswers.length === 0) { + this.next(s => ({ + ...s, + chatQuestion: '', + chatTalk: [ + ...s.chatTalk, + { text: 'i18n:chat.answersEmpty', type: 'system' }, + ], + isRunning: true, + })); + } else { + this.next(s => ({ + ...s, + chatTalk: [ + ...s.chatTalk, + ...chatAnswers.map(text => ({ text, type: 'bot' } as any)), + ], + isRunning: false, + })); + } setTimeout(() => { this.input.nativeElement.focus(); From 1f27d881dce4c2ec509a512822858a56c8f31f90 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 11 Sep 2023 20:49:22 +0200 Subject: [PATCH 07/35] Deep detect action. --- .../Actions/Algolia/AlgoliaActionHandler.cs | 90 ++++---- .../Actions/Comment/CommentActionHandler.cs | 41 ++-- .../CreateContentActionHandler.cs | 3 +- .../Actions/DeepDetect/DeepDetectAction.cs | 29 +++ .../DeepDetect/DeepDetectActionHandler.cs | 197 ++++++++++++++++++ .../Actions/DeepDetect/DeepDetectPlugin.cs | 32 +++ .../Actions/Email/EmailActionHandler.cs | 1 - .../Notification/NotificationActionHandler.cs | 62 +++--- .../Prerender/PrerenderActionHandler.cs | 4 +- .../IUrlGenerator.cs | 2 + .../src/Squidex.Web/Services/UrlGenerator.cs | 5 + .../Config/Authentication/IdentityServices.cs | 2 +- backend/src/Squidex/appsettings.json | 15 +- .../Contents/TestData/FakeUrlGenerator.cs | 5 + 14 files changed, 384 insertions(+), 104 deletions(-) create mode 100644 backend/extensions/Squidex.Extensions/Actions/DeepDetect/DeepDetectAction.cs create mode 100644 backend/extensions/Squidex.Extensions/Actions/DeepDetect/DeepDetectActionHandler.cs create mode 100644 backend/extensions/Squidex.Extensions/Actions/DeepDetect/DeepDetectPlugin.cs diff --git a/backend/extensions/Squidex.Extensions/Actions/Algolia/AlgoliaActionHandler.cs b/backend/extensions/Squidex.Extensions/Actions/Algolia/AlgoliaActionHandler.cs index bffac761a..d3c60f317 100644 --- a/backend/extensions/Squidex.Extensions/Actions/Algolia/AlgoliaActionHandler.cs +++ b/backend/extensions/Squidex.Extensions/Actions/Algolia/AlgoliaActionHandler.cs @@ -40,65 +40,65 @@ public sealed class AlgoliaActionHandler : RuleActionHandler CreateJobAsync(EnrichedEvent @event, AlgoliaAction action) { - if (@event is IEnrichedEntityEvent entityEvent) + if (@event is not IEnrichedEntityEvent entityEvent) { - var delete = @event.ShouldDelete(scriptEngine, action.Delete); + return ("Ignore", new AlgoliaJob()); + } - var ruleDescription = string.Empty; - var contentId = entityEvent.Id.ToString(); - var content = (AlgoliaContent?)null; + var delete = @event.ShouldDelete(scriptEngine, action.Delete); - if (delete) - { - ruleDescription = $"Delete entry from Algolia index: {action.IndexName}"; - } - else - { - ruleDescription = $"Add entry to Algolia index: {action.IndexName}"; + var ruleDescription = string.Empty; + var contentId = entityEvent.Id.ToString(); + var content = (AlgoliaContent?)null; - try - { - string? jsonString; + if (delete) + { + ruleDescription = $"Delete entry from Algolia index: {action.IndexName}"; + } + else + { + ruleDescription = $"Add entry to Algolia index: {action.IndexName}"; - if (!string.IsNullOrEmpty(action.Document)) - { - jsonString = await FormatAsync(action.Document, @event); - jsonString = jsonString?.Trim(); - } - else - { - jsonString = ToJson(@event); - } + try + { + string? jsonString; - content = serializer.Deserialize(jsonString!); + if (!string.IsNullOrEmpty(action.Document)) + { + jsonString = await FormatAsync(action.Document, @event); + jsonString = jsonString?.Trim(); } - catch (Exception ex) + else { - content = new AlgoliaContent - { - More = new Dictionary - { - ["error"] = $"Invalid JSON: {ex.Message}" - } - }; + jsonString = ToJson(@event); } - content.ObjectID = contentId; + content = serializer.Deserialize(jsonString!); } - - var ruleJob = new AlgoliaJob + catch (Exception ex) { - AppId = action.AppId, - ApiKey = action.ApiKey, - Content = serializer.Serialize(content, true), - ContentId = contentId, - IndexName = (await FormatAsync(action.IndexName, @event))! - }; - - return (ruleDescription, ruleJob); + content = new AlgoliaContent + { + More = new Dictionary + { + ["error"] = $"Invalid JSON: {ex.Message}" + } + }; + } + + content.ObjectID = contentId; } - return ("Ignore", new AlgoliaJob()); + var ruleJob = new AlgoliaJob + { + AppId = action.AppId, + ApiKey = action.ApiKey, + Content = serializer.Serialize(content, true), + ContentId = contentId, + IndexName = (await FormatAsync(action.IndexName, @event))! + }; + + return (ruleDescription, ruleJob); } protected override async Task ExecuteJobAsync(AlgoliaJob job, diff --git a/backend/extensions/Squidex.Extensions/Actions/Comment/CommentActionHandler.cs b/backend/extensions/Squidex.Extensions/Actions/Comment/CommentActionHandler.cs index 1865f7c38..e6b28a8b3 100644 --- a/backend/extensions/Squidex.Extensions/Actions/Comment/CommentActionHandler.cs +++ b/backend/extensions/Squidex.Extensions/Actions/Comment/CommentActionHandler.cs @@ -26,30 +26,37 @@ public sealed class CommentActionHandler : RuleActionHandler CreateJobAsync(EnrichedEvent @event, CommentAction action) { - if (@event is EnrichedContentEvent contentEvent) + if (@event is not EnrichedContentEvent contentEvent) { - var ruleJob = new CreateComment - { - AppId = contentEvent.AppId - }; + return ("Ignore", new CreateComment()); + } + + var ruleJob = new CreateComment + { + AppId = contentEvent.AppId + }; - ruleJob.Text = (await FormatAsync(action.Text, @event))!; + var text = await FormatAsync(action.Text, @event); - if (!string.IsNullOrEmpty(action.Client)) - { - ruleJob.Actor = RefToken.Client(action.Client); - } - else - { - ruleJob.Actor = contentEvent.Actor; - } + if (string.IsNullOrWhiteSpace(text)) + { + return ("NoText", new CreateComment()); + } - ruleJob.CommentsId = contentEvent.Id; + ruleJob.Text = text; - return (Description, ruleJob); + if (!string.IsNullOrEmpty(action.Client)) + { + ruleJob.Actor = RefToken.Client(action.Client); + } + else + { + ruleJob.Actor = contentEvent.Actor; } - return ("Ignore", new CreateComment()); + ruleJob.CommentsId = contentEvent.Id; + + return (Description, ruleJob); } protected override async Task ExecuteJobAsync(CreateComment job, diff --git a/backend/extensions/Squidex.Extensions/Actions/CreateContent/CreateContentActionHandler.cs b/backend/extensions/Squidex.Extensions/Actions/CreateContent/CreateContentActionHandler.cs index b97e08857..657db7908 100644 --- a/backend/extensions/Squidex.Extensions/Actions/CreateContent/CreateContentActionHandler.cs +++ b/backend/extensions/Squidex.Extensions/Actions/CreateContent/CreateContentActionHandler.cs @@ -47,6 +47,7 @@ public sealed class CreateContentActionHandler : RuleActionHandler +{ + private const string Description = "Analyze Image"; + private readonly IHttpClientFactory httpClientFactory; + private readonly IJsonSerializer jsonSerializer; + private readonly IAppProvider appProvider; + private readonly IAssetQueryService assetQuery; + private readonly ICommandBus commandBus; + private readonly IUrlGenerator urlGenerator; + + public DeepDetectActionHandler(RuleEventFormatter formatter, IHttpClientFactory httpClientFactory, + IJsonSerializer jsonSerializer, + IAppProvider appProvider, + IAssetQueryService assetQuery, + ICommandBus commandBus, + IUrlGenerator urlGenerator) + : base(formatter) + { + this.httpClientFactory = httpClientFactory; + this.jsonSerializer = jsonSerializer; + this.appProvider = appProvider; + this.assetQuery = assetQuery; + this.commandBus = commandBus; + this.urlGenerator = urlGenerator; + } + + protected override Task<(string Description, DeepDetectJob Data)> CreateJobAsync(EnrichedEvent @event, DeepDetectAction action) + { + if (@event is not EnrichedAssetEvent assetEvent) + { + return Task.FromResult(("Ignore", new DeepDetectJob())); + } + + if (assetEvent.AssetType != AssetType.Image) + { + return Task.FromResult(("Ignore", new DeepDetectJob())); + } + + var ruleJob = new DeepDetectJob + { + Actor = assetEvent.Actor, + AppId = assetEvent.AppId.Id, + AssetId = assetEvent.Id, + MaximumTags = action.MaximumTags, + MinimumPropability = action.MinimumProbability, + Url = urlGenerator.AssetContent(assetEvent.AppId, assetEvent.Id.ToString(), assetEvent.FileVersion) + }; + + return Task.FromResult((Description, ruleJob)); + } + + protected override async Task ExecuteJobAsync(DeepDetectJob job, + CancellationToken ct = default) + { + if (string.IsNullOrWhiteSpace(job.Url)) + { + return Result.Ignored(); + } + + var httpClient = httpClientFactory.CreateClient("DeepDetect"); + + var response = await httpClient.PostAsJsonAsync("predict", new + { + service = "squidexdetector", + output = new + { + best = job.MaximumTags, + confidence_threshold = job.MinimumPropability / 100d, + }, + data = new[] + { + job.Url, + } + }, ct); + + var body = await response.Content.ReadAsStringAsync(ct); + + if (!response.IsSuccessStatusCode) + { + return Result.Failed(new InvalidOperationException($"Failed with status code {response.StatusCode}\n\n{body}")); + } + + var responseJson = jsonSerializer.Deserialize(body); + + var tags = responseJson!.Body.Predictions.SelectMany(x => x.Classes); + + if (!tags.Any()) + { + return Result.Success(body); + } + + var app = await appProvider.GetAppAsync(job.AppId, true, ct); + if (app == null) + { + return Result.Failed(new InvalidOperationException("App not found.")); + } + + var context = Context.Admin(app); + + var asset = await assetQuery.FindAsync(context, job.AssetId, ct: ct); + if (asset == null) + { + return Result.Failed(new InvalidOperationException("Asset not found.")); + } + + var command = new AnnotateAsset + { + Tags = asset.TagNames, + AssetId = asset.AssetId, + AppId = asset.AppId, + Actor = job.Actor, + FromRule = true + }; + + foreach (var tag in tags) + { + var tagParts = tag.Cat.Split(',')[0].Split(' ', StringSplitOptions.RemoveEmptyEntries); + + if (IdRegex().IsMatch(tagParts[0])) + { + tagParts = tagParts.Skip(1).ToArray(); + } + + var tagName = string.Join('_', tagParts.Select(x => x.Slugify())); + + command.Tags.Add($"ai/{tagName}"); + } + + await commandBus.PublishAsync(command, ct); + return Result.Success(body); + } + + private sealed class DetectResponse + { + public DetectBody Body { get; set; } + } + + private sealed class DetectBody + { + public DetectPredications[] Predictions { get; set; } + } + + private sealed class DetectPredications + { + public DetectClass[] Classes { get; set; } + } + + private sealed class DetectClass + { + public double Prob { get; set; } + + public string Cat { get; set; } + } + + [GeneratedRegex("^n[0-9]+$")] + private static partial Regex IdRegex(); +} + +public sealed class DeepDetectJob +{ + public DomainId AppId { get; set; } + + public DomainId AssetId { get; set; } + + public RefToken Actor { get; set; } + + public long MaximumTags { get; set; } + + public long MinimumPropability { get; set; } + + public string? Url { get; set; } +} diff --git a/backend/extensions/Squidex.Extensions/Actions/DeepDetect/DeepDetectPlugin.cs b/backend/extensions/Squidex.Extensions/Actions/DeepDetect/DeepDetectPlugin.cs new file mode 100644 index 000000000..c614fc7a1 --- /dev/null +++ b/backend/extensions/Squidex.Extensions/Actions/DeepDetect/DeepDetectPlugin.cs @@ -0,0 +1,32 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Squidex.Infrastructure.Plugins; + +namespace Squidex.Extensions.Actions.DeepDetect; + +internal class DeepDetectPlugin : IPlugin +{ + public void ConfigureServices(IServiceCollection services, IConfiguration config) + { + var url = config.GetValue("deepdetect:url"); + + if (!Uri.TryCreate(url, UriKind.Absolute, out var uri)) + { + return; + } + + services.AddHttpClient("DeepDetect", client => + { + client.BaseAddress = uri; + }); + + services.AddRuleAction(); + } +} diff --git a/backend/extensions/Squidex.Extensions/Actions/Email/EmailActionHandler.cs b/backend/extensions/Squidex.Extensions/Actions/Email/EmailActionHandler.cs index 888fb19f7..1252a8dc6 100644 --- a/backend/extensions/Squidex.Extensions/Actions/Email/EmailActionHandler.cs +++ b/backend/extensions/Squidex.Extensions/Actions/Email/EmailActionHandler.cs @@ -47,7 +47,6 @@ public sealed class EmailActionHandler : RuleActionHandler CreateJobAsync(EnrichedEvent @event, NotificationAction action) { - if (@event is EnrichedUserEventBase userEvent) + if (@event is not EnrichedUserEventBase userEvent) { - var user = await userResolver.FindByIdOrEmailAsync(action.User); + return ("Ignore", new CreateComment()); + } - if (user == null) - { - throw new InvalidOperationException($"Cannot find user by '{action.User}'"); - } + var user = await userResolver.FindByIdOrEmailAsync(action.User); - var actor = userEvent.Actor; + if (user == null) + { + throw new InvalidOperationException($"Cannot find user by '{action.User}'"); + } - if (!string.IsNullOrEmpty(action.Client)) - { - actor = RefToken.Client(action.Client); - } + var actor = userEvent.Actor; - var ruleJob = new CreateComment - { - AppId = CommentsCommand.NoApp, - Actor = actor, - CommentId = DomainId.NewGuid(), - CommentsId = DomainId.Create(user.Id), - FromRule = true, - Text = (await FormatAsync(action.Text, @event))! - }; - - if (!string.IsNullOrWhiteSpace(action.Url)) - { - var url = await FormatAsync(action.Url, @event); + if (!string.IsNullOrEmpty(action.Client)) + { + actor = RefToken.Client(action.Client); + } - if (Uri.TryCreate(url, UriKind.RelativeOrAbsolute, out var uri)) - { - ruleJob.Url = uri; - } - } + var ruleJob = new CreateComment + { + AppId = CommentsCommand.NoApp, + Actor = actor, + CommentId = DomainId.NewGuid(), + CommentsId = DomainId.Create(user.Id), + FromRule = true, + Text = (await FormatAsync(action.Text, @event))! + }; + + if (!string.IsNullOrWhiteSpace(action.Url)) + { + var url = await FormatAsync(action.Url, @event); - return (Description, ruleJob); + if (Uri.TryCreate(url, UriKind.RelativeOrAbsolute, out var uri)) + { + ruleJob.Url = uri; + } } - return ("Ignore", new CreateComment()); + return (Description, ruleJob); } protected override async Task ExecuteJobAsync(CreateComment job, diff --git a/backend/extensions/Squidex.Extensions/Actions/Prerender/PrerenderActionHandler.cs b/backend/extensions/Squidex.Extensions/Actions/Prerender/PrerenderActionHandler.cs index 98686646d..5ac0c3357 100644 --- a/backend/extensions/Squidex.Extensions/Actions/Prerender/PrerenderActionHandler.cs +++ b/backend/extensions/Squidex.Extensions/Actions/Prerender/PrerenderActionHandler.cs @@ -27,8 +27,8 @@ public sealed class PrerenderActionHandler : RuleActionHandler appId, string idOrSlug); + string AssetContent(NamedId appId, string idOrSlug, long version); + string AssetContentBase(); string AssetContentBase(string appName); diff --git a/backend/src/Squidex.Web/Services/UrlGenerator.cs b/backend/src/Squidex.Web/Services/UrlGenerator.cs index 3b1ae6265..acdaeb28d 100644 --- a/backend/src/Squidex.Web/Services/UrlGenerator.cs +++ b/backend/src/Squidex.Web/Services/UrlGenerator.cs @@ -67,6 +67,11 @@ public sealed class UrlGenerator : IUrlGenerator return urlGenerator.BuildUrl($"api/assets/{appId.Name}/{idOrSlug}"); } + public string AssetContent(NamedId appId, string idOrSlug, long version) + { + return urlGenerator.BuildUrl($"api/assets/{appId.Name}/{idOrSlug}?version={version}"); + } + public string? AssetSource(NamedId appId, DomainId assetId, long fileVersion) { return assetFileStore.GeneratePublicUrl(appId.Id, assetId, fileVersion, null); diff --git a/backend/src/Squidex/Config/Authentication/IdentityServices.cs b/backend/src/Squidex/Config/Authentication/IdentityServices.cs index 669797580..14589250c 100644 --- a/backend/src/Squidex/Config/Authentication/IdentityServices.cs +++ b/backend/src/Squidex/Config/Authentication/IdentityServices.cs @@ -17,7 +17,7 @@ public static class IdentityServices services.Configure(config, "identity"); - services.AddHttpClient("USers"); + services.AddHttpClient("Users"); services.AddSingletonAs() .AsOptional(); diff --git a/backend/src/Squidex/appsettings.json b/backend/src/Squidex/appsettings.json index d1fd72c0c..349e0b2c9 100644 --- a/backend/src/Squidex/appsettings.json +++ b/backend/src/Squidex/appsettings.json @@ -355,11 +355,11 @@ "name": "Squidex", "stackdriver": { - // True, to enable stackdriver integration. - "enabled": false, + // True, to enable stackdriver integration. + "enabled": false, - // The ID of your Google Cloud project. - "projectId": "" + // The ID of your Google Cloud project. + "projectId": "" }, "otlp": { @@ -672,11 +672,16 @@ "version": "squidex:version" }, - // Kafka Producer configuration + // Kafka producer configuration "kafka": { "bootstrapServers": "" }, + // Deepdetect configuration + "deepdetect": { + "url": "" + }, + // The client information for twitter. "twitter": { "clientId": "QZhb3HQcGCvE6G8yNNP9ksNet", diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/TestData/FakeUrlGenerator.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/TestData/FakeUrlGenerator.cs index ce6ba5dbc..cd41ae86f 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/TestData/FakeUrlGenerator.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/TestData/FakeUrlGenerator.cs @@ -30,6 +30,11 @@ public sealed class FakeUrlGenerator : IUrlGenerator return $"assets/{appId.Name}/{idOrSlug}"; } + public string AssetContent(NamedId appId, string idOrSlug, long version) + { + return $"assets/{appId.Name}/{idOrSlug}?version={version}"; + } + public string ContentUI(NamedId appId, NamedId schemaId, DomainId contentId) { return $"contents/{schemaId.Name}/{contentId}"; From ece46c94cd5fed5cbe60111b219e27116530f691 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Mon, 11 Sep 2023 20:49:51 +0200 Subject: [PATCH 08/35] Update GitHub Action Versions (#1023) Co-authored-by: github-actions[bot] --- .github/workflows/check-updates.yml | 2 +- .github/workflows/dev.yml | 4 ++-- .github/workflows/release.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check-updates.yml b/.github/workflows/check-updates.yml index 40b4b6adb..e5bd1c6ab 100644 --- a/.github/workflows/check-updates.yml +++ b/.github/workflows/check-updates.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.6.0 + - uses: actions/checkout@v4.0.0 with: token: ${{ secrets.WORKFLOW_SECRET }} diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 933eb7173..2aa6d933b 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Prepare - Checkout - uses: actions/checkout@v3.6.0 + uses: actions/checkout@v4.0.0 - name: Prepare - Inject short Variables uses: rlespinasse/github-slug-action@v4.4.1 @@ -28,7 +28,7 @@ jobs: uses: docker/setup-buildx-action@v2.10.0 - name: Build - BUILD - uses: docker/build-push-action@v4.1.1 + uses: docker/build-push-action@v4.2.1 with: load: true build-args: "SQUIDEX__RUNTIME__VERSION=7.0.0-dev-${{ env.BUILD_NUMBER }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b82c9dade..b17731a00 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Prepare - Checkout - uses: actions/checkout@v3.6.0 + uses: actions/checkout@v4.0.0 - name: Prepare - Inject short Variables uses: rlespinasse/github-slug-action@v4.4.1 @@ -23,7 +23,7 @@ jobs: uses: docker/setup-buildx-action@v2.10.0 - name: Build - BUILD - uses: docker/build-push-action@v4.1.1 + uses: docker/build-push-action@v4.2.1 with: load: true build-args: "SQUIDEX__BUILD__VERSION=${{ env.GITHUB_REF_SLUG }},SQUIDEX__RUNTIME__VERSION=${{ env.GITHUB_REF_SLUG }}" From facdb2168a51fc3c6566598bd0c4370251378523 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 11 Sep 2023 22:22:33 +0200 Subject: [PATCH 09/35] Fix lookup. --- .../Contents/Operations/Extensions.cs | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/Extensions.cs b/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/Extensions.cs index da077c338..5a1cc11ca 100644 --- a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/Extensions.cs +++ b/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/Extensions.cs @@ -5,6 +5,7 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== +using MongoDB.Bson; using MongoDB.Bson.Serialization; using MongoDB.Bson.Serialization.Attributes; using MongoDB.Driver; @@ -18,6 +19,15 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Contents.Operations; public static class Extensions { + private static readonly BsonDocument LookupLet = + new BsonDocument() + .Add("id", "$_id"); + + private static readonly BsonDocument LookupMatch = + new BsonDocument() + .Add("$expr", new BsonDocument() + .Add("$eq", new BsonArray { "$_id", "$$id" })); + private static Dictionary propertyMap; public static IReadOnlyDictionary PropertyMap @@ -113,8 +123,15 @@ public static class Extensions .QuerySort(query) .QuerySkip(query) .QueryLimit(query) - .Lookup(collection, x => x.Id, x => x.DocumentId, x => x.Joined) - .SelectFields(q.Fields) + .Lookup(collection, + LookupLet, + PipelineDefinitionBuilder.For() + .Match(LookupMatch) + .Project( + BuildProjection2(q.Fields)), + x => x.Joined) + .Project( + Builders.Projection.Include(x => x.Joined)) .ToListAsync(ct); return joined.Select(x => x.Joined[0]).ToList(); @@ -147,15 +164,15 @@ public static class Extensions public static IFindFluent SelectFields(this IFindFluent find, IEnumerable? fields) { - return find.Project(BuildProjection(fields)); + return find.Project(BuildProjection2(fields)); } public static IAggregateFluent SelectFields(this IAggregateFluent find, IEnumerable? fields) { - return find.Project(BuildProjection(fields)); + return find.Project(BuildProjection2(fields)); } - private static ProjectionDefinition BuildProjection(IEnumerable? fields) + private static ProjectionDefinition BuildProjection2(IEnumerable? fields) { var projector = Builders.Projection; var projections = new List>(); From e243045617a6edca284f1360ef665a641058dd22 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Wed, 13 Sep 2023 22:53:03 +0200 Subject: [PATCH 10/35] Default value for arrays (#1024) * Default value for array and components. * Fix form group. * Fix tests --- .../Schemas/ArrayCalculatedDefaultValue.cs | 14 +++++++ .../Schemas/ArrayFieldProperties.cs | 2 + .../Schemas/ComponentsFieldProperties.cs | 2 + .../ConvertContent/DefaultValueFactory.cs | 20 +++++++--- .../Models/Fields/ArrayFieldPropertiesDto.cs | 5 +++ .../Fields/ComponentsFieldPropertiesDto.cs | 5 +++ .../DefaultValueFactoryTests.cs | 40 +++++++++++++++++++ .../Schemas/DomainObject/SchemaState.json | 2 + frontend/src/app/features/schemas/module.ts | 2 + .../fields/forms/field-form-ui.component.html | 3 ++ .../fields/types/array-ui.component.html | 11 +++++ .../fields/types/array-ui.component.scss | 2 + .../schema/fields/types/array-ui.component.ts | 30 ++++++++++++++ .../fields/types/components-ui.component.html | 11 +++++ .../fields/types/components-ui.component.ts | 4 ++ .../angular/forms/extended-form-array.spec.ts | 12 ++++++ .../angular/forms/extended-form-array.ts | 10 ++++- .../angular/forms/extended-form-group.spec.ts | 18 +++++++-- .../angular/forms/extended-form-group.ts | 10 ++++- .../angular/forms/templated-form-array.ts | 2 +- .../angular/forms/templated-form-group.ts | 2 +- .../src/app/shared/services/schemas.types.ts | 4 +- .../state/contents.forms.visitors.spec.ts | 20 ++++++++-- .../shared/state/contents.forms.visitors.ts | 20 +++++++--- .../src/app/shared/state/schemas.forms.ts | 2 + 25 files changed, 228 insertions(+), 25 deletions(-) create mode 100644 backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ArrayCalculatedDefaultValue.cs create mode 100644 frontend/src/app/features/schemas/pages/schema/fields/types/array-ui.component.html create mode 100644 frontend/src/app/features/schemas/pages/schema/fields/types/array-ui.component.scss create mode 100644 frontend/src/app/features/schemas/pages/schema/fields/types/array-ui.component.ts diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ArrayCalculatedDefaultValue.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ArrayCalculatedDefaultValue.cs new file mode 100644 index 000000000..c74a7a6b8 --- /dev/null +++ b/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ArrayCalculatedDefaultValue.cs @@ -0,0 +1,14 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +namespace Squidex.Domain.Apps.Core.Schemas; + +public enum ArrayCalculatedDefaultValue +{ + EmptyArray, + Null +} diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ArrayFieldProperties.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ArrayFieldProperties.cs index d5be61a81..3a6e74c40 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ArrayFieldProperties.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ArrayFieldProperties.cs @@ -15,6 +15,8 @@ public sealed record ArrayFieldProperties : FieldProperties public int? MaxItems { get; init; } + public ArrayCalculatedDefaultValue CalculatedDefaultValue { get; init; } + public ReadonlyList? UniqueFields { get; init; } public override T Accept(IFieldPropertiesVisitor visitor, TArgs args) diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ComponentsFieldProperties.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ComponentsFieldProperties.cs index 4cbff3585..09a7bf436 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ComponentsFieldProperties.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ComponentsFieldProperties.cs @@ -18,6 +18,8 @@ public sealed record ComponentsFieldProperties : FieldProperties public ReadonlyList? UniqueFields { get; init; } + public ArrayCalculatedDefaultValue CalculatedDefaultValue { get; init; } + public DomainId SchemaId { init diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/ConvertContent/DefaultValueFactory.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/ConvertContent/DefaultValueFactory.cs index e5e3be6bd..3a4c50dce 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/ConvertContent/DefaultValueFactory.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/ConvertContent/DefaultValueFactory.cs @@ -33,6 +33,21 @@ public sealed class DefaultValueFactory : IFieldPropertiesVisitor public int? MaxItems { get; set; } + /// + /// The calculated default value for the field value. + /// + public ArrayCalculatedDefaultValue CalculatedDefaultValue { get; set; } + /// /// The fields that must be unique. /// diff --git a/backend/src/Squidex/Areas/Api/Controllers/Schemas/Models/Fields/ComponentsFieldPropertiesDto.cs b/backend/src/Squidex/Areas/Api/Controllers/Schemas/Models/Fields/ComponentsFieldPropertiesDto.cs index f048b4f8a..7301f8ed0 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Schemas/Models/Fields/ComponentsFieldPropertiesDto.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Schemas/Models/Fields/ComponentsFieldPropertiesDto.cs @@ -26,6 +26,11 @@ public sealed class ComponentsFieldPropertiesDto : FieldPropertiesDto /// public int? MaxItems { get; set; } + /// + /// The calculated default value for the field value. + /// + public ArrayCalculatedDefaultValue CalculatedDefaultValue { get; set; } + /// /// The ID of the embedded schemas. /// diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ConvertContent/DefaultValueFactoryTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ConvertContent/DefaultValueFactoryTests.cs index c388fa6d3..f3b53bcef 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ConvertContent/DefaultValueFactoryTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ConvertContent/DefaultValueFactoryTests.cs @@ -19,6 +19,26 @@ public class DefaultValueFactoryTests private readonly Instant now = Instant.FromUtc(2017, 10, 12, 16, 30, 10); private readonly Language language = Language.DE; + [Fact] + public void Should_get_default_value_from_array_field() + { + var field = + Fields.Array(1, "1", Partitioning.Invariant, + new ArrayFieldProperties()); + + Assert.Equal(new JsonArray(), DefaultValueFactory.CreateDefaultValue(field, now, language.Iso2Code)); + } + + [Fact] + public void Should_get_default_value_from_array_field_if_set_to_null() + { + var field = + Fields.Array(1, "1", Partitioning.Invariant, + new ArrayFieldProperties { CalculatedDefaultValue = ArrayCalculatedDefaultValue.Null }); + + Assert.Equal(JsonValue.Null, DefaultValueFactory.CreateDefaultValue(field, now, language.Iso2Code)); + } + [Fact] public void Should_get_default_value_from_assets_field() { @@ -83,6 +103,26 @@ public class DefaultValueFactoryTests Assert.Equal(JsonValue.Null, DefaultValueFactory.CreateDefaultValue(field, now, language.Iso2Code)); } + [Fact] + public void Should_get_default_value_from_components_field() + { + var field = + Fields.Components(1, "1", Partitioning.Invariant, + new ComponentsFieldProperties()); + + Assert.Equal(new JsonArray(), DefaultValueFactory.CreateDefaultValue(field, now, language.Iso2Code)); + } + + [Fact] + public void Should_get_default_value_from_components_field_if_set_to_null() + { + var field = + Fields.Components(1, "1", Partitioning.Invariant, + new ComponentsFieldProperties { CalculatedDefaultValue = ArrayCalculatedDefaultValue.Null }); + + Assert.Equal(JsonValue.Null, DefaultValueFactory.CreateDefaultValue(field, now, language.Iso2Code)); + } + [Fact] public void Should_get_default_value_from_datetime_field() { diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/DomainObject/SchemaState.json b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/DomainObject/SchemaState.json index 498ac7af4..2235e95eb 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/DomainObject/SchemaState.json +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/DomainObject/SchemaState.json @@ -130,6 +130,7 @@ "isDisabled": false, "properties": { "$type": "ComponentsField", + "calculatedDefaultValue": "EmptyArray", "schemaId": "62a1d2a8-f08d-4870-8cb9-cb3ba286d56c", "schemaIds": [ "62a1d2a8-f08d-4870-8cb9-cb3ba286d56c" @@ -267,6 +268,7 @@ "isDisabled": false, "properties": { "$type": "ArrayField", + "calculatedDefaultValue": "EmptyArray", "isRequired": false, "isRequiredOnPublish": false, "isHalfWidth": false diff --git a/frontend/src/app/features/schemas/module.ts b/frontend/src/app/features/schemas/module.ts index ae1b30e23..861285a68 100644 --- a/frontend/src/app/features/schemas/module.ts +++ b/frontend/src/app/features/schemas/module.ts @@ -9,6 +9,7 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { HelpComponent, HistoryComponent, LoadSchemasGuard, SchemaMustExistGuard, SqxFrameworkModule, SqxSharedModule } from '@app/shared'; import { ArrayValidationComponent, AssetsUIComponent, AssetsValidationComponent, BooleanUIComponent, BooleanValidationComponent, ComponentsUIComponent, ComponentsValidationComponent, ComponentUIComponent, ComponentValidationComponent, DateTimeUIComponent, DateTimeValidationComponent, FieldComponent, FieldFormCommonComponent, FieldFormComponent, FieldFormUIComponent, FieldFormValidationComponent, FieldGroupComponent, FieldListComponent, FieldWizardComponent, GeolocationUIComponent, GeolocationValidationComponent, JsonMoreComponent, JsonUIComponent, JsonValidationComponent, NumberUIComponent, NumberValidationComponent, ReferencesUIComponent, ReferencesValidationComponent, SchemaEditFormComponent, SchemaExportFormComponent, SchemaFieldRulesFormComponent, SchemaFieldsComponent, SchemaFormComponent, SchemaPageComponent, SchemaPreviewUrlsFormComponent, SchemaScriptsFormComponent, SchemasPageComponent, SchemaUIFormComponent, SortableFieldListComponent, StringUIComponent, StringValidationComponent, TagsUIComponent, TagsValidationComponent } from './declarations'; +import { ArrayUIComponent } from './pages/schema/fields/types/array-ui.component'; const routes: Routes = [ { @@ -51,6 +52,7 @@ const routes: Routes = [ SchemaMustExistGuard, ], declarations: [ + ArrayUIComponent, ArrayValidationComponent, AssetsUIComponent, AssetsValidationComponent, diff --git a/frontend/src/app/features/schemas/pages/schema/fields/forms/field-form-ui.component.html b/frontend/src/app/features/schemas/pages/schema/fields/forms/field-form-ui.component.html index 300c95e8c..7416d0e45 100644 --- a/frontend/src/app/features/schemas/pages/schema/fields/forms/field-form-ui.component.html +++ b/frontend/src/app/features/schemas/pages/schema/fields/forms/field-form-ui.component.html @@ -13,6 +13,9 @@
+ + + diff --git a/frontend/src/app/features/schemas/pages/schema/fields/types/array-ui.component.html b/frontend/src/app/features/schemas/pages/schema/fields/types/array-ui.component.html new file mode 100644 index 000000000..f3fbddf8d --- /dev/null +++ b/frontend/src/app/features/schemas/pages/schema/fields/types/array-ui.component.html @@ -0,0 +1,11 @@ +
+
+ + +
+ +
+
+
\ No newline at end of file diff --git a/frontend/src/app/features/schemas/pages/schema/fields/types/array-ui.component.scss b/frontend/src/app/features/schemas/pages/schema/fields/types/array-ui.component.scss new file mode 100644 index 000000000..2742d895e --- /dev/null +++ b/frontend/src/app/features/schemas/pages/schema/fields/types/array-ui.component.scss @@ -0,0 +1,2 @@ +@import 'mixins'; +@import 'vars'; \ No newline at end of file diff --git a/frontend/src/app/features/schemas/pages/schema/fields/types/array-ui.component.ts b/frontend/src/app/features/schemas/pages/schema/fields/types/array-ui.component.ts new file mode 100644 index 000000000..cd10bf685 --- /dev/null +++ b/frontend/src/app/features/schemas/pages/schema/fields/types/array-ui.component.ts @@ -0,0 +1,30 @@ +/* + * Squidex Headless CMS + * + * @license + * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. + */ + +import { Component, Input } from '@angular/core'; +import { UntypedFormGroup } from '@angular/forms'; +import { ArrayFieldPropertiesDto, FieldDto } from '@app/shared'; + +const CALCULATED_DEFAULT_VALUES: ReadonlyArray = ['EmptyArray', 'Null']; + +@Component({ + selector: 'sqx-array-ui', + styleUrls: ['array-ui.component.scss'], + templateUrl: 'array-ui.component.html', +}) +export class ArrayUIComponent { + @Input({ required: true }) + public fieldForm!: UntypedFormGroup; + + @Input({ required: true }) + public field!: FieldDto; + + @Input({ required: true }) + public properties!: ArrayFieldPropertiesDto; + + public calculatedDefaultValues = CALCULATED_DEFAULT_VALUES; +} diff --git a/frontend/src/app/features/schemas/pages/schema/fields/types/components-ui.component.html b/frontend/src/app/features/schemas/pages/schema/fields/types/components-ui.component.html index e69de29bb..f3fbddf8d 100644 --- a/frontend/src/app/features/schemas/pages/schema/fields/types/components-ui.component.html +++ b/frontend/src/app/features/schemas/pages/schema/fields/types/components-ui.component.html @@ -0,0 +1,11 @@ +
+
+ + +
+ +
+
+
\ No newline at end of file diff --git a/frontend/src/app/features/schemas/pages/schema/fields/types/components-ui.component.ts b/frontend/src/app/features/schemas/pages/schema/fields/types/components-ui.component.ts index 671346161..508417b4d 100644 --- a/frontend/src/app/features/schemas/pages/schema/fields/types/components-ui.component.ts +++ b/frontend/src/app/features/schemas/pages/schema/fields/types/components-ui.component.ts @@ -9,6 +9,8 @@ import { Component, Input } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; import { FieldDto, ReferencesFieldPropertiesDto } from '@app/shared'; +const CALCULATED_DEFAULT_VALUES: ReadonlyArray = ['EmptyArray', 'Null']; + @Component({ selector: 'sqx-components-ui', styleUrls: ['components-ui.component.scss'], @@ -23,4 +25,6 @@ export class ComponentsUIComponent { @Input({ required: true }) public properties!: ReferencesFieldPropertiesDto; + + public calculatedDefaultValues = CALCULATED_DEFAULT_VALUES; } diff --git a/frontend/src/app/framework/angular/forms/extended-form-array.spec.ts b/frontend/src/app/framework/angular/forms/extended-form-array.spec.ts index 4bac0f7af..6f8acca46 100644 --- a/frontend/src/app/framework/angular/forms/extended-form-array.spec.ts +++ b/frontend/src/app/framework/angular/forms/extended-form-array.spec.ts @@ -41,6 +41,18 @@ describe('UndefinableFormArray', () => { valueActual: [1], }]; + it('should initialize with undefined', () => { + const control = new UndefinableFormArray(); + + expect(control.value).toBeUndefined(); + }); + + it('should initialize with empty array', () => { + const control = new UndefinableFormArray([]); + + expect(control.value).toEqual([]); + }); + it('should provide value even if controls are disabled', () => { const control = new UndefinableFormArray([ new UntypedFormControl('1'), diff --git a/frontend/src/app/framework/angular/forms/extended-form-array.ts b/frontend/src/app/framework/angular/forms/extended-form-array.ts index 9913c1fef..ed024f902 100644 --- a/frontend/src/app/framework/angular/forms/extended-form-array.ts +++ b/frontend/src/app/framework/angular/forms/extended-form-array.ts @@ -25,8 +25,8 @@ export class ExtendedFormArray extends UntypedFormArray { export class UndefinableFormArray extends ExtendedFormArray { private isUndefined = false; - constructor(controls: AbstractControl[], validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null, asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null) { - super(controls, validatorOrOpts, asyncValidator); + constructor(controls?: AbstractControl[], validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null, asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null) { + super(controls || [], validatorOrOpts, asyncValidator); const reduce = (this as any)['_reduceValue']; @@ -37,6 +37,12 @@ export class UndefinableFormArray extends ExtendedFormArray { return reduce.apply(this); } }; + + if (Types.isUndefined(controls)) { + this.isUndefined = true; + + super.reset([], { emitEvent: false }); + } } public getRawValue() { diff --git a/frontend/src/app/framework/angular/forms/extended-form-group.spec.ts b/frontend/src/app/framework/angular/forms/extended-form-group.spec.ts index 9da6d9c3d..4bf25cfbb 100644 --- a/frontend/src/app/framework/angular/forms/extended-form-group.spec.ts +++ b/frontend/src/app/framework/angular/forms/extended-form-group.spec.ts @@ -8,7 +8,7 @@ import { UntypedFormControl, UntypedFormGroup } from '@angular/forms'; import { ExtendedFormGroup, UndefinableFormGroup } from './extended-form-group'; -describe('UndefinableFormGroup', () => { +describe('ExtendedFormGroup', () => { it('should provide value even if controls are disabled', () => { const control = new ExtendedFormGroup({ test1: new UntypedFormControl('1'), @@ -23,7 +23,7 @@ describe('UndefinableFormGroup', () => { }); }); -describe('ExtendedFormGroup', () => { +describe('UndefinableFormGroup', () => { const tests = [{ name: 'undefined (on)', undefinable: true, @@ -41,8 +41,20 @@ describe('ExtendedFormGroup', () => { valueActual: { field: 1 }, }]; + it('should initialize with undefined', () => { + const control = new UndefinableFormGroup(); + + expect(control.value).toBeUndefined(); + }); + + it('should initialize with empty array', () => { + const control = new UndefinableFormGroup({}); + + expect(control.value).toEqual({}); + }); + it('should provide value even if controls are disabled', () => { - const control = new ExtendedFormGroup({ + const control = new UndefinableFormGroup({ test1: new UntypedFormControl('1'), test2: new UntypedFormControl('2'), }); diff --git a/frontend/src/app/framework/angular/forms/extended-form-group.ts b/frontend/src/app/framework/angular/forms/extended-form-group.ts index ab65bcdd6..e08e7328f 100644 --- a/frontend/src/app/framework/angular/forms/extended-form-group.ts +++ b/frontend/src/app/framework/angular/forms/extended-form-group.ts @@ -31,8 +31,8 @@ export class ExtendedFormGroup extends UntypedFormGroup { export class UndefinableFormGroup extends ExtendedFormGroup { private isUndefined = false; - constructor(controls: { [key: string]: AbstractControl }, validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null, asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null) { - super(controls, validatorOrOpts, asyncValidator); + constructor(controls?: { [key: string]: AbstractControl }, validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null, asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null) { + super(controls || {}, validatorOrOpts, asyncValidator); const reduce = (this as any)['_reduceValue']; @@ -43,6 +43,12 @@ export class UndefinableFormGroup extends ExtendedFormGroup { return reduce.apply(this); } }; + + if (Types.isUndefined(controls)) { + this.isUndefined = true; + + super.reset({}, { emitEvent: false }); + } } public getRawValue() { diff --git a/frontend/src/app/framework/angular/forms/templated-form-array.ts b/frontend/src/app/framework/angular/forms/templated-form-array.ts index ebd70a7ee..079309965 100644 --- a/frontend/src/app/framework/angular/forms/templated-form-array.ts +++ b/frontend/src/app/framework/angular/forms/templated-form-array.ts @@ -21,7 +21,7 @@ export class TemplatedFormArray extends UndefinableFormArray { constructor(public readonly template: FormArrayTemplate, validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null, asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null, ) { - super([], validatorOrOpts, asyncValidator); + super(undefined, validatorOrOpts, asyncValidator); } public setValue(value?: any[], options?: { onlySelf?: boolean; emitEvent?: boolean }) { diff --git a/frontend/src/app/framework/angular/forms/templated-form-group.ts b/frontend/src/app/framework/angular/forms/templated-form-group.ts index f2704bcea..a3fdaf7a5 100644 --- a/frontend/src/app/framework/angular/forms/templated-form-group.ts +++ b/frontend/src/app/framework/angular/forms/templated-form-group.ts @@ -19,7 +19,7 @@ export class TemplatedFormGroup extends UndefinableFormGroup { constructor(public readonly template: FormGroupTemplate, validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null, asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null, ) { - super({}, validatorOrOpts, asyncValidator); + super(undefined, validatorOrOpts, asyncValidator); } public setValue(value?: {}, options?: { onlySelf?: boolean; emitEvent?: boolean }) { diff --git a/frontend/src/app/shared/services/schemas.types.ts b/frontend/src/app/shared/services/schemas.types.ts index 77cdd8a94..aa2722b0f 100644 --- a/frontend/src/app/shared/services/schemas.types.ts +++ b/frontend/src/app/shared/services/schemas.types.ts @@ -179,6 +179,7 @@ export abstract class FieldPropertiesDto { export class ArrayFieldPropertiesDto extends FieldPropertiesDto { public readonly fieldType = 'Array'; + public readonly calculatedDefaultValue: 'EmptyArray' | 'Null' = 'EmptyArray'; public readonly maxItems?: number; public readonly minItems?: number; public readonly uniqueFields?: ReadonlyArray; @@ -269,6 +270,7 @@ export class ComponentFieldPropertiesDto extends FieldPropertiesDto { export class ComponentsFieldPropertiesDto extends FieldPropertiesDto { public readonly fieldType = 'Components'; + public readonly calculatedDefaultValue: 'EmptyArray' | 'Null' = 'EmptyArray'; public readonly schemaIds?: ReadonlyArray; public readonly maxItems?: number; public readonly minItems?: number; @@ -293,7 +295,7 @@ export const DATETIME_FIELD_EDITORS: ReadonlyArray = [ export class DateTimeFieldPropertiesDto extends FieldPropertiesDto { public readonly fieldType = 'DateTime'; - public readonly calculatedDefaultValue?: string; + public readonly calculatedDefaultValue?: 'Now' | 'Today'; public readonly defaultValue?: string; public readonly defaultValues?: DefaultValue; public readonly format?: string; diff --git a/frontend/src/app/shared/state/contents.forms.visitors.spec.ts b/frontend/src/app/shared/state/contents.forms.visitors.spec.ts index e140448d9..a74b64e76 100644 --- a/frontend/src/app/shared/state/contents.forms.visitors.spec.ts +++ b/frontend/src/app/shared/state/contents.forms.visitors.spec.ts @@ -38,8 +38,14 @@ describe('ArrayField', () => { expect(FieldFormatter.format(field, 1)).toBe('0 Items'); }); - it('should return default value as null', () => { - expect(FieldDefaultValue.get(field, 'iv')).toBeNull(); + it('should return default value as empty array', () => { + expect(FieldDefaultValue.get(field, 'iv')).toEqual([]); + }); + + it('should return default value as null when configured', () => { + const field2 = createField({ properties: createProperties('Array', { calculatedDefaultValue: 'Null' }) }); + + expect(FieldDefaultValue.get(field2, 'iv')).toBeNull(); }); }); @@ -130,8 +136,14 @@ describe('ComponentsField', () => { expect(FieldFormatter.format(field, 1)).toBe('0 Components'); }); - it('should return default value as null', () => { - expect(FieldDefaultValue.get(field, 'iv')).toBeNull(); + it('should return default value as empty array', () => { + expect(FieldDefaultValue.get(field, 'iv')).toEqual([]); + }); + + it('should return default value as null when configured', () => { + const field2 = createField({ properties: createProperties('Components', { calculatedDefaultValue: 'Null' }) }); + + expect(FieldDefaultValue.get(field2, 'iv')).toBeNull(); }); }); diff --git a/frontend/src/app/shared/state/contents.forms.visitors.ts b/frontend/src/app/shared/state/contents.forms.visitors.ts index cf1c7b490..884bb3caa 100644 --- a/frontend/src/app/shared/state/contents.forms.visitors.ts +++ b/frontend/src/app/shared/state/contents.forms.visitors.ts @@ -417,8 +417,20 @@ export class FieldDefaultValue implements FieldPropertiesVisitor { } } - public visitArray(_: ArrayFieldPropertiesDto): any { - return null; + public visitArray(properties: ArrayFieldPropertiesDto): any { + if (properties.calculatedDefaultValue === 'Null') { + return null; + } + + return []; + } + + public visitComponents(properties: ComponentsFieldPropertiesDto): any { + if (properties.calculatedDefaultValue === 'Null') { + return null; + } + + return []; } public visitAssets(properties: AssetsFieldPropertiesDto): any { @@ -433,10 +445,6 @@ export class FieldDefaultValue implements FieldPropertiesVisitor { return null; } - public visitComponents(_: ComponentsFieldPropertiesDto): any { - return null; - } - public visitGeolocation(_: GeolocationFieldPropertiesDto): any { return null; } diff --git a/frontend/src/app/shared/state/schemas.forms.ts b/frontend/src/app/shared/state/schemas.forms.ts index e30b441d7..2ff127472 100644 --- a/frontend/src/app/shared/state/schemas.forms.ts +++ b/frontend/src/app/shared/state/schemas.forms.ts @@ -249,6 +249,7 @@ export class EditFieldFormVisitor implements FieldPropertiesVisitor { } public visitArray() { + this.config['calculatedDefaultValue'] = new UntypedFormControl('EmptyArray'); this.config['maxItems'] = new UntypedFormControl(undefined); this.config['minItems'] = new UntypedFormControl(undefined); this.config['uniqueFields'] = new UntypedFormControl(undefined); @@ -288,6 +289,7 @@ export class EditFieldFormVisitor implements FieldPropertiesVisitor { } public visitComponents() { + this.config['calculatedDefaultValue'] = new UntypedFormControl('EmptyArray'); this.config['schemaIds'] = new UntypedFormControl(undefined); this.config['maxItems'] = new UntypedFormControl(undefined); this.config['minItems'] = new UntypedFormControl(undefined); From 554c694b5ed7c8292548c366550b14ecdd17ad25 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Sat, 16 Sep 2023 17:29:40 +0200 Subject: [PATCH 12/35] Fix unset. (#1025) --- backend/i18n/frontend_en.json | 2 + backend/i18n/frontend_fr.json | 2 + backend/i18n/frontend_it.json | 2 + backend/i18n/frontend_nl.json | 2 + backend/i18n/frontend_pt.json | 2 + backend/i18n/frontend_zh.json | 2 + backend/i18n/source/frontend_en.json | 2 + .../Schemas/ReferencesFieldProperties.cs | 2 + .../Fields/ReferencesFieldPropertiesDto.cs | 5 ++ .../Squidex/wwwroot/scripts/editor-sdk.d.ts | 23 ++--- .../src/Squidex/wwwroot/scripts/editor-sdk.js | 27 +++--- .../shared/forms/field-editor.component.html | 4 +- .../shared/forms/iframe-editor.component.html | 1 + .../shared/forms/iframe-editor.component.ts | 4 +- .../references/content-creator.component.html | 8 +- .../references-editor.component.html | 1 + .../references/references-editor.component.ts | 3 + .../fields/types/references-ui.component.html | 12 +++ .../angular/forms/templated-form-array.ts | 2 +- .../forms/templated-form-group.spec.ts | 1 + .../angular/forms/templated-form-group.ts | 2 +- .../content-selector.component.html | 6 +- .../references/content-selector.component.ts | 10 ++- .../references/reference-input.component.html | 1 + .../references/reference-input.component.ts | 3 + .../queries/filter-comparison.component.html | 3 +- .../src/app/shared/services/schemas.types.ts | 1 + .../app/shared/state/contents.forms.spec.ts | 89 ++++++++++--------- .../src/app/shared/state/contents.forms.ts | 2 + .../state/contents.forms.visitors.spec.ts | 8 +- .../shared/state/contents.forms.visitors.ts | 4 +- .../src/app/shared/state/schemas.forms.ts | 1 + 32 files changed, 158 insertions(+), 79 deletions(-) diff --git a/backend/i18n/frontend_en.json b/backend/i18n/frontend_en.json index 1eea7677e..4aac7c528 100644 --- a/backend/i18n/frontend_en.json +++ b/backend/i18n/frontend_en.json @@ -913,6 +913,8 @@ "schemas.fieldTypes.references.countMin": "Min Items", "schemas.fieldTypes.references.description": "Links to other content items.", "schemas.fieldTypes.references.mustBePublished": "Only take published references into account when validating.", + "schemas.fieldTypes.references.query": "Initial Query", + "schemas.fieldTypes.references.queryHint": "The initial query that is used in the UI to narrow down the results for the user. In Odata notation.", "schemas.fieldTypes.references.resolve": "Resolve references", "schemas.fieldTypes.references.resolveHint": "Show the name of the referenced item in content list when MaxItems is set to 1.", "schemas.fieldTypes.string.characters": "Characters", diff --git a/backend/i18n/frontend_fr.json b/backend/i18n/frontend_fr.json index 94066370e..e3157ea0b 100644 --- a/backend/i18n/frontend_fr.json +++ b/backend/i18n/frontend_fr.json @@ -913,6 +913,8 @@ "schemas.fieldTypes.references.countMin": "Articles minimum", "schemas.fieldTypes.references.description": "Liens vers d'autres éléments de contenu.", "schemas.fieldTypes.references.mustBePublished": "Ne tenez compte que des références publiées lors de la validation.", + "schemas.fieldTypes.references.query": "Initial Query", + "schemas.fieldTypes.references.queryHint": "The initial query that is used in the UI to narrow down the results for the user. In Odata notation.", "schemas.fieldTypes.references.resolve": "Résoudre les références", "schemas.fieldTypes.references.resolveHint": "Afficher le nom de l'élément référencé dans la liste de contenu lorsque MaxItems est défini sur 1.", "schemas.fieldTypes.string.characters": "Personnages", diff --git a/backend/i18n/frontend_it.json b/backend/i18n/frontend_it.json index fc054cebb..85bc51a75 100644 --- a/backend/i18n/frontend_it.json +++ b/backend/i18n/frontend_it.json @@ -913,6 +913,8 @@ "schemas.fieldTypes.references.countMin": "Numero Min Elementi", "schemas.fieldTypes.references.description": "Link ad altri elementi del contenuto.", "schemas.fieldTypes.references.mustBePublished": "I contenuti collegati devono essere pubblicati", + "schemas.fieldTypes.references.query": "Initial Query", + "schemas.fieldTypes.references.queryHint": "The initial query that is used in the UI to narrow down the results for the user. In Odata notation.", "schemas.fieldTypes.references.resolve": "Resolve references", "schemas.fieldTypes.references.resolveHint": "Mostra il nome dell'elemento collegato (riferimento) nella lista dei contenuti quando il numero massimo di elementi è impostato a 1.", "schemas.fieldTypes.string.characters": "Caratteri", diff --git a/backend/i18n/frontend_nl.json b/backend/i18n/frontend_nl.json index 14a8d8749..cc0de5df4 100644 --- a/backend/i18n/frontend_nl.json +++ b/backend/i18n/frontend_nl.json @@ -913,6 +913,8 @@ "schemas.fieldTypes.references.countMin": "Min. items", "schemas.fieldTypes.references.description": "Links naar andere inhoudsitems.", "schemas.fieldTypes.references.mustBePublished": "Referenties moeten worden gepubliceerd", + "schemas.fieldTypes.references.query": "Initial Query", + "schemas.fieldTypes.references.queryHint": "The initial query that is used in the UI to narrow down the results for the user. In Odata notation.", "schemas.fieldTypes.references.resolve": "Referenties tonen", "schemas.fieldTypes.references.resolveHint": "Toon de naam van het item waarnaar wordt verwezen in de inhoudslijst wanneer MaxItems is ingesteld op 1.", "schemas.fieldTypes.string.characters": "Karakters", diff --git a/backend/i18n/frontend_pt.json b/backend/i18n/frontend_pt.json index 288d6efb1..a64267211 100644 --- a/backend/i18n/frontend_pt.json +++ b/backend/i18n/frontend_pt.json @@ -913,6 +913,8 @@ "schemas.fieldTypes.references.countMin": "Min Itens", "schemas.fieldTypes.references.description": "Links para outros itens de conteúdo.", "schemas.fieldTypes.references.mustBePublished": "Só ter em conta as referências publicadas ao validar.", + "schemas.fieldTypes.references.query": "Initial Query", + "schemas.fieldTypes.references.queryHint": "The initial query that is used in the UI to narrow down the results for the user. In Odata notation.", "schemas.fieldTypes.references.resolve": "Resolver referências", "schemas.fieldTypes.references.resolveHint": "Mostre o nome do item referenciado na lista de conteúdos quando maxItems estiver definido para 1.", "schemas.fieldTypes.string.characters": "Personagens", diff --git a/backend/i18n/frontend_zh.json b/backend/i18n/frontend_zh.json index 1949dfa56..46f2e076a 100644 --- a/backend/i18n/frontend_zh.json +++ b/backend/i18n/frontend_zh.json @@ -913,6 +913,8 @@ "schemas.fieldTypes.references.countMin": "最小项目", "schemas.fieldTypes.references.description": "链接到其他内容项。", "schemas.fieldTypes.references.mustBePublished": "必须发布参考文献", + "schemas.fieldTypes.references.query": "Initial Query", + "schemas.fieldTypes.references.queryHint": "The initial query that is used in the UI to narrow down the results for the user. In Odata notation.", "schemas.fieldTypes.references.resolve": "Resolve references", "schemas.fieldTypes.references.resolveHint": "当 MaxItems 设置为 1 时,在内容列表中显示引用项的名称。", "schemas.fieldTypes.string.characters": "字符", diff --git a/backend/i18n/source/frontend_en.json b/backend/i18n/source/frontend_en.json index 1eea7677e..4aac7c528 100644 --- a/backend/i18n/source/frontend_en.json +++ b/backend/i18n/source/frontend_en.json @@ -913,6 +913,8 @@ "schemas.fieldTypes.references.countMin": "Min Items", "schemas.fieldTypes.references.description": "Links to other content items.", "schemas.fieldTypes.references.mustBePublished": "Only take published references into account when validating.", + "schemas.fieldTypes.references.query": "Initial Query", + "schemas.fieldTypes.references.queryHint": "The initial query that is used in the UI to narrow down the results for the user. In Odata notation.", "schemas.fieldTypes.references.resolve": "Resolve references", "schemas.fieldTypes.references.resolveHint": "Show the name of the referenced item in content list when MaxItems is set to 1.", "schemas.fieldTypes.string.characters": "Characters", diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ReferencesFieldProperties.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ReferencesFieldProperties.cs index d0f72af6a..c38fbf9db 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ReferencesFieldProperties.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ReferencesFieldProperties.cs @@ -26,6 +26,8 @@ public sealed record ReferencesFieldProperties : FieldProperties public bool MustBePublished { get; init; } + public string? Query { get; init;} + public ReferencesFieldEditor Editor { get; init; } public DomainId SchemaId diff --git a/backend/src/Squidex/Areas/Api/Controllers/Schemas/Models/Fields/ReferencesFieldPropertiesDto.cs b/backend/src/Squidex/Areas/Api/Controllers/Schemas/Models/Fields/ReferencesFieldPropertiesDto.cs index 8e54fe870..1fc6d02a7 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Schemas/Models/Fields/ReferencesFieldPropertiesDto.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Schemas/Models/Fields/ReferencesFieldPropertiesDto.cs @@ -51,6 +51,11 @@ public sealed class ReferencesFieldPropertiesDto : FieldPropertiesDto /// public bool MustBePublished { get; set; } + /// + /// The initial query that is applied in the UI. + /// + public string? Query { get; init; } + /// /// The editor that is used to manage this field. /// diff --git a/backend/src/Squidex/wwwroot/scripts/editor-sdk.d.ts b/backend/src/Squidex/wwwroot/scripts/editor-sdk.d.ts index 51e76a843..0fdf0c11c 100644 --- a/backend/src/Squidex/wwwroot/scripts/editor-sdk.d.ts +++ b/backend/src/Squidex/wwwroot/scripts/editor-sdk.d.ts @@ -12,14 +12,14 @@ declare class EditorPlugin { /** * Register an function that is called when the sidebar is initialized. * - * @param {Function} callback: The callback to invoke. + * @param {function} callback: The callback to invoke. */ onInit(callback: () => void): void; /** * Register an function that is called whenever the value of the content has changed. * - * @param {Function} callback: The callback to invoke. Argument 1: Content value (any). + * @param {function} callback: The callback to invoke. Argument 1: Content value (any). */ onContentChanged(callback: (content: any) => void): void; @@ -133,62 +133,63 @@ declare class SquidexFormField { * * @param {string} schemas: The list of schema names. * @param {function} callback The callback to invoke when the dialog is completed or closed. + * @param {string} query: The initial query that is used in the UI. */ - pickContents(schemas: string[], callback: (assets: any[]) => void): void; + pickContents(schemas: string[], callback: (assets: any[]) => void, query?: string): void; /** * Register an function that is called when the field is initialized. * - * @param {Function} callback: The callback to invoke. + * @param {function} callback: The callback to invoke. */ onInit(callback: () => void): void; /** * Register an function that is called when the field is moved. * - * @param {Function} callback: The callback to invoke. Argument 1: New position (number). + * @param {function} callback: The callback to invoke. Argument 1: New position (number). */ onMoved(callback: (index: number) => void): void; /** * Register an function that is called whenever the field is disabled or enabled. * - * @param {Function} callback: The callback to invoke. Argument 1: New disabled state (boolean, disabled = true, enabled = false). + * @param {function} callback: The callback to invoke. Argument 1: New disabled state (boolean, disabled = true, enabled = false). */ onDisabled(callback: (isDisabled: boolean) => void): void; /** * Register an function that is called whenever the field language is changed. * - * @param {Function} callback: The callback to invoke. Argument 1: Language code (string). + * @param {function} callback: The callback to invoke. Argument 1: Language code (string). */ onLanguageChanged(callback: (language: string) => void): void; /** * Register an function that is called whenever the value of the field has changed. * - * @param {Function} callback: The callback to invoke. Argument 1: Field value (any). + * @param {function} callback: The callback to invoke. Argument 1: Field value (any). */ onValueChanged(callback: (value: any) => void): void; /** * Register an function that is called whenever the value of the content has changed. * - * @param {Function} callback: The callback to invoke. Argument 1: Content value (any). + * @param {function} callback: The callback to invoke. Argument 1: Content value (any). */ onFormValueChanged(callback: (value: any) => void): void; /** * Register an function that is called whenever the fullscreen mode has changed. * - * @param {Function} callback: The callback to invoke. Argument 1: Fullscreen state (boolean, fullscreen on = true, fullscreen off = false). + * @param {function} callback: The callback to invoke. Argument 1: Fullscreen state (boolean, fullscreen on = true, fullscreen off = false). */ onFullscreen(callback: (isFullscreen: boolean) => void): void; /** * Register an function that is called whenever the expanded mode has changed. * - * @param {Function} callback: The callback to invoke. Argument 1: Expanded state (boolean, expanded on = true, expanded off = false). + * @param {function} callback: The callback to invoke. Argument 1: Expanded state (boolean, expanded on = true, expanded off = false). */ onExpanded(callback: (isExpanded: boolean) => void): void; diff --git a/backend/src/Squidex/wwwroot/scripts/editor-sdk.js b/backend/src/Squidex/wwwroot/scripts/editor-sdk.js index e0d131830..4c45b22e5 100644 --- a/backend/src/Squidex/wwwroot/scripts/editor-sdk.js +++ b/backend/src/Squidex/wwwroot/scripts/editor-sdk.js @@ -114,7 +114,7 @@ function SquidexPlugin() { /** * Register an function that is called when the sidebar is initialized. * - * @param {Function} callback: The callback to invoke. + * @param {function} callback: The callback to invoke. */ onInit: function (callback) { if (!isFunction(callback)) { @@ -129,7 +129,7 @@ function SquidexPlugin() { /** * Register an function that is called whenever the value of the content has changed. * - * @param {Function} callback: The callback to invoke. Argument 1: Content value (any). + * @param {function} callback: The callback to invoke. Argument 1: Content value (any). */ onContentChanged: function (callback) { if (!isFunction(callback)) { @@ -491,8 +491,9 @@ function SquidexFormField() { * * @param {string} schemas: The list of schema names. * @param {function} callback The callback to invoke when the dialog is completed or closed. + * @param {string} query: The initial filter that is used in the UI. */ - pickContents: function (schemas, callback) { + pickContents: function (schemas, callback, query) { if (!isFunction(callback) || !isArrayOfStrings(schemas)) { return; } @@ -501,18 +502,18 @@ function SquidexFormField() { currentPickContents = { correlationId: correlationId, - callback: callback + callback: callback, }; if (window.parent) { - window.parent.postMessage({ type: 'pickContents', correlationId: correlationId, schemas: schemas }, '*'); + window.parent.postMessage({ type: 'pickContents', correlationId: correlationId, schemas: schemas, query: query }, '*'); } }, /** * Register an function that is called when the field is initialized. * - * @param {Function} callback: The callback to invoke. + * @param {function} callback: The callback to invoke. */ onInit: function (callback) { if (!isFunction(callback)) { @@ -527,7 +528,7 @@ function SquidexFormField() { /** * Register an function that is called when the field is moved. * - * @param {Function} callback: The callback to invoke. Argument 1: New position (number). + * @param {function} callback: The callback to invoke. Argument 1: New position (number). */ onMoved: function (callback) { if (!isFunction(callback)) { @@ -542,7 +543,7 @@ function SquidexFormField() { /** * Register an function that is called whenever the field is disabled or enabled. * - * @param {Function} callback: The callback to invoke. Argument 1: New disabled state (boolean, disabled = true, enabled = false). + * @param {function} callback: The callback to invoke. Argument 1: New disabled state (boolean, disabled = true, enabled = false). */ onDisabled: function (callback) { if (!isFunction(callback)) { @@ -557,7 +558,7 @@ function SquidexFormField() { /** * Register an function that is called whenever the field language is changed. * - * @param {Function} callback: The callback to invoke. Argument 1: Language code (string). + * @param {function} callback: The callback to invoke. Argument 1: Language code (string). */ onLanguageChanged: function (callback) { if (!isFunction(callback)) { @@ -572,7 +573,7 @@ function SquidexFormField() { /** * Register an function that is called whenever the value of the field has changed. * - * @param {Function} callback: The callback to invoke. Argument 1: Field value (any). + * @param {function} callback: The callback to invoke. Argument 1: Field value (any). */ onValueChanged: function (callback) { if (!isFunction(callback)) { @@ -587,7 +588,7 @@ function SquidexFormField() { /** * Register an function that is called whenever the value of the content has changed. * - * @param {Function} callback: The callback to invoke. Argument 1: Content value (any). + * @param {function} callback: The callback to invoke. Argument 1: Content value (any). */ onFormValueChanged: function (callback) { if (!isFunction(callback)) { @@ -602,7 +603,7 @@ function SquidexFormField() { /** * Register an function that is called whenever the fullscreen mode has changed. * - * @param {Function} callback: The callback to invoke. Argument 1: Fullscreen state (boolean, fullscreen on = true, fullscreen off = false). + * @param {function} callback: The callback to invoke. Argument 1: Fullscreen state (boolean, fullscreen on = true, fullscreen off = false). */ onFullscreen: function (callback) { if (!isFunction(callback)) { @@ -617,7 +618,7 @@ function SquidexFormField() { /** * Register an function that is called whenever the expanded mode has changed. * - * @param {Function} callback: The callback to invoke. Argument 1: Expanded state (boolean, expanded on = true, expanded off = false). + * @param {function} callback: The callback to invoke. Argument 1: Expanded state (boolean, expanded on = true, expanded off = false). */ onExpanded: function (callback) { if (!isFunction(callback)) { diff --git a/frontend/src/app/features/content/shared/forms/field-editor.component.html b/frontend/src/app/features/content/shared/forms/field-editor.component.html index 2dde0a018..c6031418d 100644 --- a/frontend/src/app/features/content/shared/forms/field-editor.component.html +++ b/frontend/src/app/features/content/shared/forms/field-editor.component.html @@ -137,6 +137,7 @@ [isExpanded]="isExpanded" [language]="language" [languages]="languages" + [query]="field.rawProperties.query" [schemaIds]="field.rawProperties.schemaIds">
@@ -152,9 +153,10 @@ diff --git a/frontend/src/app/features/content/shared/forms/iframe-editor.component.html b/frontend/src/app/features/content/shared/forms/iframe-editor.component.html index c40501411..5b04e60cb 100644 --- a/frontend/src/app/features/content/shared/forms/iframe-editor.component.html +++ b/frontend/src/app/features/content/shared/forms/iframe-editor.component.html @@ -10,6 +10,7 @@ diff --git a/frontend/src/app/features/content/shared/forms/iframe-editor.component.ts b/frontend/src/app/features/content/shared/forms/iframe-editor.component.ts index e800ddf0d..3ad605c3d 100644 --- a/frontend/src/app/features/content/shared/forms/iframe-editor.component.ts +++ b/frontend/src/app/features/content/shared/forms/iframe-editor.component.ts @@ -78,6 +78,7 @@ export class IFrameEditorComponent extends StatefulComponent implements public assetsCorrelationId: any; public assetsDialog = new DialogModel(); + public contentsQuery?: string = undefined; public contentsCorrelationId: any; public contentsSchemas?: string[]; public contentsDialog = new DialogModel(); @@ -207,9 +208,10 @@ export class IFrameEditorComponent extends StatefulComponent implements this.assetsDialog.show(); } } else if (type === 'pickContents') { - const { correlationId, schemas } = event.data; + const { correlationId, schemas, query } = event.data; if (correlationId) { + this.contentsQuery = query; this.contentsCorrelationId = correlationId; this.contentsSchemas = schemas; this.contentsDialog.show(); diff --git a/frontend/src/app/features/content/shared/references/content-creator.component.html b/frontend/src/app/features/content/shared/references/content-creator.component.html index 29ef52ece..978366d2b 100644 --- a/frontend/src/app/features/content/shared/references/content-creator.component.html +++ b/frontend/src/app/features/content/shared/references/content-creator.component.html @@ -1,10 +1,14 @@ - +- - + +
+ {{ 'contents.referencesSelectSchema' | sqxTranslate: { schema: schemas[0].displayName } }} +
diff --git a/frontend/src/app/features/content/shared/references/references-editor.component.html b/frontend/src/app/features/content/shared/references/references-editor.component.html index 559b73ef8..945667dda 100644 --- a/frontend/src/app/features/content/shared/references/references-editor.component.html +++ b/frontend/src/app/features/content/shared/references/references-editor.component.html @@ -52,5 +52,6 @@ [alreadySelected]="snapshot.contentItems" [language]="language" [languages]="languages" + [query]="query" [schemaIds]="schemaIds">
\ No newline at end of file diff --git a/frontend/src/app/features/content/shared/references/references-editor.component.ts b/frontend/src/app/features/content/shared/references/references-editor.component.ts index 590ae40bf..31a1b902d 100644 --- a/frontend/src/app/features/content/shared/references/references-editor.component.ts +++ b/frontend/src/app/features/content/shared/references/references-editor.component.ts @@ -35,6 +35,9 @@ export class ReferencesEditorComponent extends StatefulControlComponent; + @Input({ required: true }) + public query?: string; + @Input({ required: true }) public language!: AppLanguageDto; diff --git a/frontend/src/app/features/schemas/pages/schema/fields/types/references-ui.component.html b/frontend/src/app/features/schemas/pages/schema/fields/types/references-ui.component.html index 3361b2c2d..a69fad61c 100644 --- a/frontend/src/app/features/schemas/pages/schema/fields/types/references-ui.component.html +++ b/frontend/src/app/features/schemas/pages/schema/fields/types/references-ui.component.html @@ -27,4 +27,16 @@
+ +
+ + +
+ + + + {{ 'schemas.field.references.queryHint' | sqxTranslate }} + +
+
\ No newline at end of file diff --git a/frontend/src/app/framework/angular/forms/templated-form-array.ts b/frontend/src/app/framework/angular/forms/templated-form-array.ts index 079309965..ebd70a7ee 100644 --- a/frontend/src/app/framework/angular/forms/templated-form-array.ts +++ b/frontend/src/app/framework/angular/forms/templated-form-array.ts @@ -21,7 +21,7 @@ export class TemplatedFormArray extends UndefinableFormArray { constructor(public readonly template: FormArrayTemplate, validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null, asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null, ) { - super(undefined, validatorOrOpts, asyncValidator); + super([], validatorOrOpts, asyncValidator); } public setValue(value?: any[], options?: { onlySelf?: boolean; emitEvent?: boolean }) { diff --git a/frontend/src/app/framework/angular/forms/templated-form-group.spec.ts b/frontend/src/app/framework/angular/forms/templated-form-group.spec.ts index 13f2c1433..f29a8b3ef 100644 --- a/frontend/src/app/framework/angular/forms/templated-form-group.spec.ts +++ b/frontend/src/app/framework/angular/forms/templated-form-group.spec.ts @@ -48,6 +48,7 @@ describe('TemplatedFormGroup', () => { expect(formArray.value).toEqual(value1); }); + it(`Should call template to clear items with for ${name}`, () => { const value1 = { value: 1, diff --git a/frontend/src/app/framework/angular/forms/templated-form-group.ts b/frontend/src/app/framework/angular/forms/templated-form-group.ts index a3fdaf7a5..f2704bcea 100644 --- a/frontend/src/app/framework/angular/forms/templated-form-group.ts +++ b/frontend/src/app/framework/angular/forms/templated-form-group.ts @@ -19,7 +19,7 @@ export class TemplatedFormGroup extends UndefinableFormGroup { constructor(public readonly template: FormGroupTemplate, validatorOrOpts?: ValidatorFn | ValidatorFn[] | AbstractControlOptions | null, asyncValidator?: AsyncValidatorFn | AsyncValidatorFn[] | null, ) { - super(undefined, validatorOrOpts, asyncValidator); + super({}, validatorOrOpts, asyncValidator); } public setValue(value?: {}, options?: { onlySelf?: boolean; emitEvent?: boolean }) { diff --git a/frontend/src/app/shared/components/references/content-selector.component.html b/frontend/src/app/shared/components/references/content-selector.component.html index e5ec35bca..c4023ea9f 100644 --- a/frontend/src/app/shared/components/references/content-selector.component.html +++ b/frontend/src/app/shared/components/references/content-selector.component.html @@ -2,13 +2,17 @@
-
+ +
+ {{ 'contents.referencesSelectSchema' | sqxTranslate: { schema: schemas[0].displayName } }} +
diff --git a/frontend/src/app/shared/components/references/content-selector.component.ts b/frontend/src/app/shared/components/references/content-selector.component.ts index a53ce9140..494972dc2 100644 --- a/frontend/src/app/shared/components/references/content-selector.component.ts +++ b/frontend/src/app/shared/components/references/content-selector.component.ts @@ -19,6 +19,8 @@ import { ApiUrlConfig, AppsState, ComponentContentsState, ContentDto, LanguageDt ], }) export class ContentSelectorComponent extends ResourceOwner implements OnInit { + private initialQuery?: string = undefined; + public readonly metaFields = META_FIELDS; @Output() @@ -36,6 +38,9 @@ export class ContentSelectorComponent extends ResourceOwner implements OnInit { @Input() public schemaNames?: ReadonlyArray; + @Input() + public query?: string; + @Input({ required: true }) public language!: LanguageDto; @@ -77,6 +82,8 @@ export class ContentSelectorComponent extends ResourceOwner implements OnInit { } public ngOnInit() { + this.initialQuery = this.query; + this.own( this.contentsState.statuses .subscribe(() => { @@ -101,7 +108,8 @@ export class ContentSelectorComponent extends ResourceOwner implements OnInit { if (schema) { this.contentsState.schema = schema; - this.contentsState.load(); + this.contentsState.search({ fullText: this.initialQuery || undefined }); + this.initialQuery = undefined; this.updateModel(); } diff --git a/frontend/src/app/shared/components/references/reference-input.component.html b/frontend/src/app/shared/components/references/reference-input.component.html index 258076a62..a5729262d 100644 --- a/frontend/src/app/shared/components/references/reference-input.component.html +++ b/frontend/src/app/shared/components/references/reference-input.component.html @@ -10,6 +10,7 @@ (select)="select($event)" [language]="language" [languages]="languages" + [query]="query" maxItems="1" [schemaIds]="schemaIds"> \ No newline at end of file diff --git a/frontend/src/app/shared/components/references/reference-input.component.ts b/frontend/src/app/shared/components/references/reference-input.component.ts index 1c4f6baa4..7a7a0b1fc 100644 --- a/frontend/src/app/shared/components/references/reference-input.component.ts +++ b/frontend/src/app/shared/components/references/reference-input.component.ts @@ -34,6 +34,9 @@ export class ReferenceInputComponent extends StatefulControlComponent; + @Input({ required: true }) + public query?: string; + @Input({ required: true }) public language!: LanguageDto; diff --git a/frontend/src/app/shared/components/search/queries/filter-comparison.component.html b/frontend/src/app/shared/components/search/queries/filter-comparison.component.html index 7f83efbc1..6c3ea4e37 100644 --- a/frontend/src/app/shared/components/search/queries/filter-comparison.component.html +++ b/frontend/src/app/shared/components/search/queries/filter-comparison.component.html @@ -45,7 +45,8 @@ [ngModel]="filter.value" (ngModelChange)="changeValue($event)" [language]="language" - [languages]="languages"> + [languages]="languages" + [query]="undefined"> diff --git a/frontend/src/app/shared/services/schemas.types.ts b/frontend/src/app/shared/services/schemas.types.ts index aa2722b0f..6f0c348ff 100644 --- a/frontend/src/app/shared/services/schemas.types.ts +++ b/frontend/src/app/shared/services/schemas.types.ts @@ -390,6 +390,7 @@ export class ReferencesFieldPropertiesDto extends FieldPropertiesDto { public readonly maxItems?: number; public readonly minItems?: number; public readonly mustBePublished?: boolean; + public readonly query?: string; public readonly resolveReference?: boolean; public readonly schemaIds?: ReadonlyArray; diff --git a/frontend/src/app/shared/state/contents.forms.spec.ts b/frontend/src/app/shared/state/contents.forms.spec.ts index be39f7a1d..24b5877bc 100644 --- a/frontend/src/app/shared/state/contents.forms.spec.ts +++ b/frontend/src/app/shared/state/contents.forms.spec.ts @@ -410,11 +410,11 @@ describe('ContentForm', () => { createField({ id: 4, properties: createProperties('Array'), - partitioning: 'invariant', nested: [ createNestedField({ id: 41, properties: createProperties('String') }), createNestedField({ id: 42, properties: createProperties('String', { defaultValue: 'Default' }), isDisabled: true }), ], + partitioning: 'invariant', }), ] }); @@ -452,6 +452,18 @@ describe('ContentForm', () => { }); describe('with complex form', () => { + const arraySetup = [ + { + value: [], + defaultValue: 'EmptyArray', + + }, + { + value: undefined, + defaultValue: 'Null', + }, + ]; + it('should not enabled disabled fields', () => { const contentForm = createForm([ createField({ id: 1, properties: createProperties('String') }), @@ -471,6 +483,32 @@ describe('ContentForm', () => { expectForm(contentForm.form, 'field3.de', { invalid: false }); }); + arraySetup.forEach(test => { + it(`should create array with ${test.defaultValue} default value`, () => { + const contentForm = createForm([ + createField({ + id: 4, + properties: createProperties('Array', { calculatedDefaultValue: test.defaultValue }), + }), + ]); + + expect(contentForm.value.field4.en).toEqual(test.value); + }); + }); + + arraySetup.forEach(test => { + it(`should create components with ${test.defaultValue} default value`, () => { + const contentForm = createForm([ + createField({ + id: 4, + properties: createProperties('Components', { calculatedDefaultValue: test.defaultValue }), + }), + ]); + + expect(contentForm.value.field4.en).toEqual(test.value); + }); + }); + it('should require field based on context condition', () => { const contentForm = createForm([ createField({ id: 1, properties: createProperties('Number'), partitioning: 'invariant' }), @@ -587,11 +625,11 @@ describe('ContentForm', () => { createField({ id: 4, properties: createProperties('Array'), - partitioning: 'invariant', nested: [ createNestedField({ id: 41, properties: createProperties('Number') }), createNestedField({ id: 42, properties: createProperties('Number') }), ], + partitioning: 'invariant', }), ], [{ field: 'field4.nested42', action: 'Disable', condition: 'itemData.nested41 > 100', @@ -620,11 +658,11 @@ describe('ContentForm', () => { createField({ id: 4, properties: createProperties('Array'), - partitioning: 'invariant', nested: [ createNestedField({ id: 41, properties: createProperties('Number') }), createNestedField({ id: 42, properties: createProperties('Number') }), ], + partitioning: 'invariant', }), ], [{ field: 'field4.nested42', action: 'Hide', condition: 'itemData.nested41 > 100', @@ -653,11 +691,11 @@ describe('ContentForm', () => { createField({ id: 4, properties: createProperties('Array'), - partitioning: 'language', nested: [ createNestedField({ id: 41, properties: createProperties('Number') }), createNestedField({ id: 42, properties: createProperties('Number') }), ], + partitioning: 'language', }), ], [{ field: 'field4.nested42', action: 'Hide', condition: 'itemData.nested41 > 100', @@ -686,11 +724,7 @@ describe('ContentForm', () => { const component = createSchema({ id: 2, fields: [ - createField({ - id: 1, - properties: createProperties('String'), - partitioning: 'invariant', - }), + createField({ id: 1, properties: createProperties('String'), partitioning: 'invariant' }), ], fieldRules: [{ field: 'field1', action: 'Hide', condition: 'data.field1 > 100', @@ -804,11 +838,7 @@ describe('ContentForm', () => { }); const contentForm = createForm([ - createField({ - id: 4, - properties: createProperties('Components'), - partitioning: 'invariant', - }), + createField({ id: 4, properties: createProperties('Components'), partitioning: 'invariant' }), ], [], { [componentId]: component, }); @@ -841,11 +871,7 @@ describe('ContentForm', () => { const component1 = createSchema({ id: 1, fields: [ - createField({ - id: 11, - properties: createProperties('String'), - partitioning: 'invariant', - }), + createField({ id: 11, properties: createProperties('String'), partitioning: 'invariant' }), ], }); @@ -853,20 +879,12 @@ describe('ContentForm', () => { const component2 = createSchema({ id: 2, fields: [ - createField({ - id: 21, - properties: createProperties('String'), - partitioning: 'invariant', - }), + createField({ id: 21, properties: createProperties('String'), partitioning: 'invariant' }), ], }); const contentForm = createForm([ - createField({ - id: 4, - properties: createProperties('Component'), - partitioning: 'invariant', - }), + createField({ id: 4, properties: createProperties('Component'), partitioning: 'invariant' }), ], [], { [component1Id]: component1, [component2Id]: component2, @@ -923,20 +941,11 @@ describe('ContentForm', () => { const component = createSchema({ id: 1, fields: [ - createField({ - id: 11, - properties: createProperties('String'), - partitioning: 'invariant', - }), - ], + createField({ id: 11, properties: createProperties('String'), partitioning: 'invariant' })], }); const contentForm = createForm([ - createField({ - id: 4, - properties: createProperties('Component'), - partitioning: 'invariant', - }), + createField({ id: 4, properties: createProperties('Component'), partitioning: 'invariant' }), ], [], { [componentId]: component, }); diff --git a/frontend/src/app/shared/state/contents.forms.ts b/frontend/src/app/shared/state/contents.forms.ts index 813abb2e9..a53392f18 100644 --- a/frontend/src/app/shared/state/contents.forms.ts +++ b/frontend/src/app/shared/state/contents.forms.ts @@ -345,6 +345,8 @@ export class FieldArrayForm extends AbstractContentForm this), FieldsValidators.create(field, isOptional)), isOptional, rules); + this.form.setValue(FieldDefaultValue.get(field, this.partition), { emitEvent: false }); + (this.form.template as any)['form'] = this; } diff --git a/frontend/src/app/shared/state/contents.forms.visitors.spec.ts b/frontend/src/app/shared/state/contents.forms.visitors.spec.ts index a74b64e76..2ec0ce978 100644 --- a/frontend/src/app/shared/state/contents.forms.visitors.spec.ts +++ b/frontend/src/app/shared/state/contents.forms.visitors.spec.ts @@ -42,10 +42,10 @@ describe('ArrayField', () => { expect(FieldDefaultValue.get(field, 'iv')).toEqual([]); }); - it('should return default value as null when configured', () => { + it('should return default value as undefined when configured', () => { const field2 = createField({ properties: createProperties('Array', { calculatedDefaultValue: 'Null' }) }); - expect(FieldDefaultValue.get(field2, 'iv')).toBeNull(); + expect(FieldDefaultValue.get(field2, 'iv')).toBeUndefined(); }); }); @@ -140,10 +140,10 @@ describe('ComponentsField', () => { expect(FieldDefaultValue.get(field, 'iv')).toEqual([]); }); - it('should return default value as null when configured', () => { + it('should return default value as undefined when configured', () => { const field2 = createField({ properties: createProperties('Components', { calculatedDefaultValue: 'Null' }) }); - expect(FieldDefaultValue.get(field2, 'iv')).toBeNull(); + expect(FieldDefaultValue.get(field2, 'iv')).toBeUndefined(); }); }); diff --git a/frontend/src/app/shared/state/contents.forms.visitors.ts b/frontend/src/app/shared/state/contents.forms.visitors.ts index 884bb3caa..d3d2ae047 100644 --- a/frontend/src/app/shared/state/contents.forms.visitors.ts +++ b/frontend/src/app/shared/state/contents.forms.visitors.ts @@ -419,7 +419,7 @@ export class FieldDefaultValue implements FieldPropertiesVisitor { public visitArray(properties: ArrayFieldPropertiesDto): any { if (properties.calculatedDefaultValue === 'Null') { - return null; + return undefined; } return []; @@ -427,7 +427,7 @@ export class FieldDefaultValue implements FieldPropertiesVisitor { public visitComponents(properties: ComponentsFieldPropertiesDto): any { if (properties.calculatedDefaultValue === 'Null') { - return null; + return undefined; } return []; diff --git a/frontend/src/app/shared/state/schemas.forms.ts b/frontend/src/app/shared/state/schemas.forms.ts index 2ff127472..83227059a 100644 --- a/frontend/src/app/shared/state/schemas.forms.ts +++ b/frontend/src/app/shared/state/schemas.forms.ts @@ -326,6 +326,7 @@ export class EditFieldFormVisitor implements FieldPropertiesVisitor { this.config['maxItems'] = new UntypedFormControl(undefined); this.config['minItems'] = new UntypedFormControl(undefined); this.config['mustBePublished'] = new UntypedFormControl(false); + this.config['query'] = new UntypedFormControl(undefined); this.config['resolveReference'] = new UntypedFormControl(false); this.config['schemaIds'] = new UntypedFormControl(undefined); } From b590c8f2b1e1aadf2aeb337d3c0285e088847370 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 18 Sep 2023 11:07:19 +0200 Subject: [PATCH 13/35] Fix content query. --- .../content/pages/contents/contents-page.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/features/content/pages/contents/contents-page.component.ts b/frontend/src/app/features/content/pages/contents/contents-page.component.ts index 4d5e3385a..605e315a1 100644 --- a/frontend/src/app/features/content/pages/contents/contents-page.component.ts +++ b/frontend/src/app/features/content/pages/contents/contents-page.component.ts @@ -11,7 +11,7 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { Observable } from 'rxjs'; import { distinctUntilChanged, map, shareReplay, switchMap, take, tap, withLatestFrom } from 'rxjs/operators'; -import { AppLanguageDto, AppsState, ContentDto, ContentsService, ContentsState, contentsTranslationStatus, ContributorsState, defined, getTableFields, LanguagesState, LocalStoreService, ModalModel, Queries, Query, QuerySynchronizer, ResourceOwner, Router2State, SchemaDto, SchemasService, SchemasState, Settings, switchSafe, TableSettings, TempService, TranslationStatus, Types, UIState } from '@app/shared'; +import { AppLanguageDto, AppsState, ContentDto, ContentsService, ContentsState, contentsTranslationStatus, ContributorsState, defined, getTableFields, LanguagesState, LocalStoreService, ModalModel, Queries, Query, QuerySynchronizer, ResourceOwner, Router2State, SchemaDto, SchemasService, SchemasState, Settings, switchSafe, TableSettings, TempService, TranslationStatus, UIState } from '@app/shared'; import { DueTimeSelectorComponent } from './../../shared/due-time-selector.component'; @Component({ @@ -98,7 +98,7 @@ export class ContentsPageComponent extends ResourceOwner implements OnInit { schema$.pipe(map(s => new TableSettings(this.uiState, s)), shareReplay(1)); const tableName$ = - tableSetting$.pipe(switchMap(s => s.listFields), map(s => getTableFields(s)), distinctUntilChanged(Types.equals)); + tableSetting$.pipe(switchMap(s => s.listFields), map(s => getTableFields(s))); this.tableSettings = tableSetting$; From 869177d9798a2be565b83d5a4704058fa4cfac77 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 18 Sep 2023 11:17:17 +0200 Subject: [PATCH 14/35] Cleaner code. --- .../pages/contents/contents-page.component.ts | 14 +++++------ .../app/shared/services/schemas.service.ts | 2 +- .../src/app/shared/state/table-settings.ts | 25 ++++++++++++++++--- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/frontend/src/app/features/content/pages/contents/contents-page.component.ts b/frontend/src/app/features/content/pages/contents/contents-page.component.ts index 605e315a1..96335bc0f 100644 --- a/frontend/src/app/features/content/pages/contents/contents-page.component.ts +++ b/frontend/src/app/features/content/pages/contents/contents-page.component.ts @@ -10,8 +10,8 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { Observable } from 'rxjs'; -import { distinctUntilChanged, map, shareReplay, switchMap, take, tap, withLatestFrom } from 'rxjs/operators'; -import { AppLanguageDto, AppsState, ContentDto, ContentsService, ContentsState, contentsTranslationStatus, ContributorsState, defined, getTableFields, LanguagesState, LocalStoreService, ModalModel, Queries, Query, QuerySynchronizer, ResourceOwner, Router2State, SchemaDto, SchemasService, SchemasState, Settings, switchSafe, TableSettings, TempService, TranslationStatus, UIState } from '@app/shared'; +import { distinctUntilChanged, map, shareReplay, switchMap, take, tap } from 'rxjs/operators'; +import { AppLanguageDto, AppsState, ContentDto, ContentsService, ContentsState, contentsTranslationStatus, ContributorsState, defined, getTableConfig, LanguagesState, LocalStoreService, ModalModel, Queries, Query, QuerySynchronizer, ResourceOwner, Router2State, SchemaDto, SchemasService, SchemasState, Settings, switchSafe, TableSettings, TempService, TranslationStatus, UIState } from '@app/shared'; import { DueTimeSelectorComponent } from './../../shared/due-time-selector.component'; @Component({ @@ -95,16 +95,16 @@ export class ContentsPageComponent extends ResourceOwner implements OnInit { getSchemaName(this.route).pipe(switchMap(() => this.schemasState.selectedSchema.pipe(defined(), take(1), shareReplay(1)))); const tableSetting$ = - schema$.pipe(map(s => new TableSettings(this.uiState, s)), shareReplay(1)); + schema$.pipe(map(schema => new TableSettings(this.uiState, schema)), shareReplay(1)); - const tableName$ = - tableSetting$.pipe(switchMap(s => s.listFields), map(s => getTableFields(s))); + const tableConfig$ = + tableSetting$.pipe(switchMap(getTableConfig)); this.tableSettings = tableSetting$; this.own( - tableName$.pipe(withLatestFrom(schema$)) - .subscribe(([fieldNames, schema]) => { + tableConfig$ + .subscribe(({ fieldNames, schema }) => { if (this.schema?.id !== schema.id) { this.resetSelection(); diff --git a/frontend/src/app/shared/services/schemas.service.ts b/frontend/src/app/shared/services/schemas.service.ts index 597e3a3ca..056a86fb3 100644 --- a/frontend/src/app/shared/services/schemas.service.ts +++ b/frontend/src/app/shared/services/schemas.service.ts @@ -101,7 +101,7 @@ export function getTableFields(fields: ReadonlyArray) { } result.sort(); - + return result; } diff --git a/frontend/src/app/shared/state/table-settings.ts b/frontend/src/app/shared/state/table-settings.ts index 6dfad2d53..838233715 100644 --- a/frontend/src/app/shared/state/table-settings.ts +++ b/frontend/src/app/shared/state/table-settings.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { take } from 'rxjs/operators'; +import { map, take } from 'rxjs/operators'; import { State, Types } from '@app/framework'; import { META_FIELDS, SchemaDto, TableField } from './../services/schemas.service'; import { UIState } from './ui.state'; @@ -45,8 +45,8 @@ export class TableSettings extends State { this.projectFrom(this.fields, x => x.length > 0 ? x : this.schemaDefaults); constructor( - private readonly uiState: UIState, - private readonly schema: SchemaDto, + public readonly uiState: UIState, + public readonly schema: SchemaDto, ) { super({ fields: [], sizes: {}, wrappings: {} }); @@ -143,3 +143,22 @@ export class TableSettings extends State { } } } + +export function getTableConfig(source: TableSettings) { + function sortedTableFields(fields: ReadonlyArray) { + const result: string[] = []; + + for (const field of fields) { + if (field.name && field.name.indexOf('meta') < 0) { + result.push(field.name); + } + } + + result.sort(); + return result; + } + + return source.listFields.pipe( + map(fields => sortedTableFields(fields)), + map(fields => ({ fieldNames: fields, schema: source.schema }))); +} \ No newline at end of file From 0386b8f2c1b4e5dd1316026b014f268c21971d5a Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 18 Sep 2023 22:12:55 +0200 Subject: [PATCH 15/35] IFrame SDK for widget. --- .../wwwroot/scripts/editor-context.html | 5 +- .../Squidex/wwwroot/scripts/editor-sdk.d.ts | 21 ++++- .../src/Squidex/wwwroot/scripts/editor-sdk.js | 77 +++++++++++++++++-- .../wwwroot/scripts/sidebar-content.html | 2 +- .../wwwroot/scripts/sidebar-context.html | 5 +- .../wwwroot/scripts/widget-context.html | 45 +++++++++++ .../pages/dashboard-config.component.ts | 3 +- .../pages/dashboard-page.component.html | 2 +- .../dashboard/dashboard-page.component.html | 2 +- .../components/cards/iframe-card.component.ts | 58 +++++++++++++- 10 files changed, 202 insertions(+), 18 deletions(-) create mode 100644 backend/src/Squidex/wwwroot/scripts/widget-context.html diff --git a/backend/src/Squidex/wwwroot/scripts/editor-context.html b/backend/src/Squidex/wwwroot/scripts/editor-context.html index d478786c6..5713479ae 100644 --- a/backend/src/Squidex/wwwroot/scripts/editor-context.html +++ b/backend/src/Squidex/wwwroot/scripts/editor-context.html @@ -11,7 +11,8 @@ textarea { box-sizing: border-box; resize: none; - overflow: hidden; + overflow-x: hidden; + overflow-y: hidden; width: 100%; } @@ -25,7 +26,7 @@ } - + - + - + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/src/app/features/dashboard/pages/dashboard-config.component.ts b/frontend/src/app/features/dashboard/pages/dashboard-config.component.ts index b580c87a1..f5e57df2e 100644 --- a/frontend/src/app/features/dashboard/pages/dashboard-config.component.ts +++ b/frontend/src/app/features/dashboard/pages/dashboard-config.component.ts @@ -60,7 +60,7 @@ export class DashboardConfigComponent { } if (changes.app) { - this.uiState.getAppUser('dashboard.grid', this.configDefaults).pipe(take(1)) + this.uiState.getAppShared('dashboard.grid', this.configDefaults).pipe(take(1)) .subscribe(dto => { this.setConfig(dto); }); @@ -91,7 +91,6 @@ export class DashboardConfigComponent { public resetConfig() { this.setConfig(Types.clone(this.configDefaults)); - this.saveConfig(); } diff --git a/frontend/src/app/features/dashboard/pages/dashboard-page.component.html b/frontend/src/app/features/dashboard/pages/dashboard-page.component.html index 228a645b6..99e74117f 100644 --- a/frontend/src/app/features/dashboard/pages/dashboard-page.component.html +++ b/frontend/src/app/features/dashboard/pages/dashboard-page.component.html @@ -68,7 +68,7 @@ - + diff --git a/frontend/src/app/features/teams/pages/dashboard/dashboard-page.component.html b/frontend/src/app/features/teams/pages/dashboard/dashboard-page.component.html index 07134dc71..2dc903cab 100644 --- a/frontend/src/app/features/teams/pages/dashboard/dashboard-page.component.html +++ b/frontend/src/app/features/teams/pages/dashboard/dashboard-page.component.html @@ -56,7 +56,7 @@ - + diff --git a/frontend/src/app/shared/components/cards/iframe-card.component.ts b/frontend/src/app/shared/components/cards/iframe-card.component.ts index c76e37800..b1870e221 100644 --- a/frontend/src/app/shared/components/cards/iframe-card.component.ts +++ b/frontend/src/app/shared/components/cards/iframe-card.component.ts @@ -5,7 +5,9 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, Input, ViewChild } from '@angular/core'; +import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, HostListener, Input, ViewChild } from '@angular/core'; +import { ApiUrlConfig, Types } from '@app/framework'; +import { AppDto, AuthService, TeamDto } from '@app/shared/internal'; @Component({ selector: 'sqx-iframe-card', @@ -14,13 +16,67 @@ import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, Input, V changeDetection: ChangeDetectionStrategy.OnPush, }) export class IFrameCardComponent implements AfterViewInit { + private readonly context: any; + private isInitialized = false; + @Input() public options: any; @ViewChild('iframe', { static: false }) public iframe!: ElementRef; + @Input() + public set team(value: TeamDto | undefined | null) { + if (value) { + this.context.teamId = value.id; + this.context.teamName = value.name; + } + } + + @Input() + public set app(value: AppDto | undefined | null) { + if (value) { + this.context.appId = value.id; + this.context.appName = value.name; + } + } + + constructor(apiUrl: ApiUrlConfig, authService: AuthService) { + this.context = { apiUrl: apiUrl.buildUrl('api'), user: authService.user }; + } + public ngAfterViewInit() { this.iframe.nativeElement.src = this.options?.src; } + + @HostListener('window:message', ['$event']) + public onWindowMessage(event: MessageEvent) { + if (event.source === this.iframe.nativeElement.contentWindow) { + const { type } = event.data; + + if (type === 'started') { + this.isInitialized = true; + + this.sendInit(); + } + } + } + + private sendInit() { + this.sendMessage('init', { context: this.context }); + } + + private sendMessage(type: string, payload: any) { + if (!this.iframe) { + return; + } + + const iframe = this.iframe.nativeElement; + + if (this.isInitialized && iframe.contentWindow && Types.isFunction(iframe.contentWindow.postMessage)) { + const message = { type, ...payload }; + + iframe.contentWindow.postMessage(message, '*'); + } + } } From aed30fa15332d19056dadcbf304f9baeb90d23e4 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Tue, 19 Sep 2023 08:34:43 +0200 Subject: [PATCH 16/35] Update GitHub Action Versions (#1028) Co-authored-by: github-actions[bot] --- .github/workflows/dev.yml | 8 ++++---- .github/workflows/release.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 2aa6d933b..adc1859f2 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -22,13 +22,13 @@ jobs: uses: rlespinasse/github-slug-action@v4.4.1 - name: Prepare - Set up QEMU - uses: docker/setup-qemu-action@v2.2.0 + uses: docker/setup-qemu-action@v3.0.0 - name: Prepare - Set up Docker Buildx - uses: docker/setup-buildx-action@v2.10.0 + uses: docker/setup-buildx-action@v3.0.0 - name: Build - BUILD - uses: docker/build-push-action@v4.2.1 + uses: docker/build-push-action@v5.0.0 with: load: true build-args: "SQUIDEX__RUNTIME__VERSION=7.0.0-dev-${{ env.BUILD_NUMBER }}" @@ -103,7 +103,7 @@ jobs: - name: Publish - Login to Docker Hub if: github.event_name != 'pull_request' - uses: docker/login-action@v2.2.0 + uses: docker/login-action@v3.0.0 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b17731a00..bd84b42e8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,13 +17,13 @@ jobs: uses: rlespinasse/github-slug-action@v4.4.1 - name: Prepare - Set up QEMU - uses: docker/setup-qemu-action@v2.2.0 + uses: docker/setup-qemu-action@v3.0.0 - name: Prepare - Set up Docker Buildx - uses: docker/setup-buildx-action@v2.10.0 + uses: docker/setup-buildx-action@v3.0.0 - name: Build - BUILD - uses: docker/build-push-action@v4.2.1 + uses: docker/build-push-action@v5.0.0 with: load: true build-args: "SQUIDEX__BUILD__VERSION=${{ env.GITHUB_REF_SLUG }},SQUIDEX__RUNTIME__VERSION=${{ env.GITHUB_REF_SLUG }}" @@ -104,7 +104,7 @@ jobs: fi - name: Publish - Login to Docker Hub - uses: docker/login-action@v2.2.0 + uses: docker/login-action@v3.0.0 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} From 3a8adbfdcf25ca07bf5968cc62fdfce990b78a85 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 19 Sep 2023 08:39:04 +0200 Subject: [PATCH 17/35] Changelog for 7.8.2 --- CHANGELOG.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1a11b277..b83f28758 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,26 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [7.8.2] - 2023-09-19 + +### Fixed + +* **Assets**: Fixed S3 configuration. +* **Contents**: Fixed a query that was causing exceptions when using pagination. +* **UI**: Generate unique IDs for radio groups to fix a problem when multiple groups exist per page. + +### Changed + +* **UI**: Migration to angular 16. +* **UI**: Better chat dialog. + +### Added + +* **Contents**: Default values for array fields. +* **Contents**: Default values for components fields. +* **Rules**: Support for deep detect to annotate images with AI models. +* **UI**: Widget plugins for teams and app dashboard. + ## [7.8.1] - 2023-08-04 ### Fixed From dfac42a733697016b59683d592962db60e36c73d Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Wed, 4 Oct 2023 20:55:44 +0200 Subject: [PATCH 18/35] Update GitHub Action Versions (#1031) Co-authored-by: github-actions[bot] --- .github/workflows/check-updates.yml | 2 +- .github/workflows/dev.yml | 2 +- .github/workflows/release.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-updates.yml b/.github/workflows/check-updates.yml index e5bd1c6ab..6aba3f9d1 100644 --- a/.github/workflows/check-updates.yml +++ b/.github/workflows/check-updates.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.0.0 + - uses: actions/checkout@v4.1.0 with: token: ${{ secrets.WORKFLOW_SECRET }} diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index adc1859f2..121e2b4b0 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Prepare - Checkout - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.0 - name: Prepare - Inject short Variables uses: rlespinasse/github-slug-action@v4.4.1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bd84b42e8..3ad43915b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Prepare - Checkout - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.0 - name: Prepare - Inject short Variables uses: rlespinasse/github-slug-action@v4.4.1 From 70f7f9bf22622c4968e22d4cf621d9cc116ac048 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Thu, 5 Oct 2023 21:33:40 +0200 Subject: [PATCH 19/35] fix: frontend/package.json & frontend/package-lock.json to reduce vulnerabilities (#1029) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-GRAPHQL-5905181 Co-authored-by: snyk-bot --- frontend/package-lock.json | 8 ++++---- frontend/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 492291d75..15c56dfd3 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -37,7 +37,7 @@ "date-fns": "2.30.0", "font-awesome": "4.7.0", "graphiql": "3.0.5", - "graphql": "16.7.1", + "graphql": "^16.8.1", "graphql-ws": "^5.14.0", "image-focus": "1.2.1", "keycharm": "0.4.0", @@ -20460,9 +20460,9 @@ } }, "node_modules/graphql": { - "version": "16.7.1", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.7.1.tgz", - "integrity": "sha512-DRYR9tf+UGU0KOsMcKAlXeFfX89UiiIZ0dRU3mR0yJfu6OjZqUcp68NnFLnqQU5RexygFoDy1EW+ccOYcPfmHg==", + "version": "16.8.1", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.8.1.tgz", + "integrity": "sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==", "engines": { "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" } diff --git a/frontend/package.json b/frontend/package.json index 99a67cd13..dbbba2cd2 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -44,7 +44,7 @@ "date-fns": "2.30.0", "font-awesome": "4.7.0", "graphiql": "3.0.5", - "graphql": "16.7.1", + "graphql": "16.8.1", "graphql-ws": "^5.14.0", "image-focus": "1.2.1", "keycharm": "0.4.0", From 16bf2baf2cdd8ddd7010e09b87631c716045a3c9 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Mon, 9 Oct 2023 16:28:07 +0200 Subject: [PATCH 21/35] Schema name. (#1032) * Schema name. * Fix build. --- .../FieldDescriptions.Designer.cs | 9 ++ .../FieldDescriptions.resx | 3 + .../Contents/ContentHeaders.cs | 11 ++ .../GraphQL/GraphQLExecutionContext.cs | 1 + .../GraphQL/Types/ApplicationQueries.cs | 55 ++++++-- .../GraphQL/Types/Contents/ContentActions.cs | 30 +++++ .../Contents/Queries/Steps/ConvertData.cs | 3 + .../Config/OpenApi/AcceptAnyBodyAttribute.cs | 42 ++++++ .../Config/OpenApi/AcceptQueryAttribute.cs | 13 +- .../Contents/ContentsSharedController.cs | 86 +++++++++++- .../Contents/Models/GraphQLQueryDto.cs | 31 +++++ .../Contents/GraphQL/GraphQLQueriesTests.cs | 125 +++++++++++++++--- .../Contents/GraphQL/GraphQLTestBase.cs | 7 +- .../Contents/GraphQL/TestContent.cs | 2 +- .../Contents/GraphQL/TestSchemas.cs | 6 + 15 files changed, 381 insertions(+), 43 deletions(-) create mode 100644 backend/src/Squidex/Areas/Api/Config/OpenApi/AcceptAnyBodyAttribute.cs create mode 100644 backend/src/Squidex/Areas/Api/Controllers/Contents/Models/GraphQLQueryDto.cs diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.Designer.cs b/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.Designer.cs index abb9aa2f3..7f4b90c45 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.Designer.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.Designer.cs @@ -762,6 +762,15 @@ namespace Squidex.Domain.Apps.Core { } } + /// + /// Looks up a localized string similar to The graphql request.. + /// + public static string GraphqlRequest { + get { + return ResourceManager.GetString("GraphqlRequest", resourceCulture); + } + } + /// /// Looks up a localized string similar to The current item, if the field is part of an array.. /// diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.resx b/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.resx index fb2bdafa3..ed8b9d303 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.resx +++ b/backend/src/Squidex.Domain.Apps.Core.Model/FieldDescriptions.resx @@ -351,6 +351,9 @@ The type of the event. + + The graphql request. + The current item, if the field is part of an array. diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/ContentHeaders.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/ContentHeaders.cs index bae1f0394..8330ca44f 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/ContentHeaders.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/ContentHeaders.cs @@ -23,6 +23,7 @@ public static class ContentHeaders public const string KeyNoResolveLanguages = "X-NoResolveLanguages"; public const string KeyResolveFlow = "X-ResolveFlow"; public const string KeyResolveUrls = "X-ResolveUrls"; + public const string KeyResolveSchemaNames = "X-ResolveSchemaName"; public const string KeyUnpublished = "X-Unpublished"; public static void AddCacheHeaders(this Context context, IRequestCache cache) @@ -98,6 +99,16 @@ public static class ContentHeaders return builder.WithBoolean(KeyResolveFlow, value); } + public static bool ResolveSchemaNames(this Context context) + { + return context.AsBoolean(KeyResolveSchemaNames); + } + + public static ICloneBuilder WithResolveSchemaNames(this ICloneBuilder builder, bool value = true) + { + return builder.WithBoolean(KeyResolveSchemaNames, value); + } + public static bool NoResolveLanguages(this Context context) { return context.AsBoolean(KeyNoResolveLanguages); diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/GraphQLExecutionContext.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/GraphQLExecutionContext.cs index faf3609b2..3edc45f98 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/GraphQLExecutionContext.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/GraphQLExecutionContext.cs @@ -41,6 +41,7 @@ public sealed class GraphQLExecutionContext : QueryExecutionContext this.dataLoaders = dataLoaders; Context = context.Clone(b => b + .WithResolveSchemaNames() .WithNoCleanup() .WithNoEnrichment() .WithNoAssetEnrichment()); diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ApplicationQueries.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ApplicationQueries.cs index 190cb3dac..200b1a6c2 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ApplicationQueries.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ApplicationQueries.cs @@ -6,7 +6,9 @@ // ========================================================================== using GraphQL.Types; +using Squidex.Domain.Apps.Core.Schemas; using Squidex.Domain.Apps.Entities.Contents.GraphQL.Types.Contents; +using static Squidex.Domain.Apps.Entities.Contents.GraphQL.Types.Contents.ContentActions; namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types; @@ -28,34 +30,62 @@ internal sealed class ApplicationQueries : ObjectGraphType continue; } - AddContentFind(schemaInfo, contentType); - AddContentQueries(builder, schemaInfo, contentType); + if (schemaInfo.Schema.SchemaDef.Type == SchemaType.Singleton) + { + // Mark the normal queries as deprecated to motivate using the new endpoint. + var deprecation = $"Use 'find{schemaInfo.TypeName}Singleton' instead."; + + AddContentFind(schemaInfo, contentType, deprecation); + AddContentFindSingleton(schemaInfo, contentType); + AddContentQueries(builder, schemaInfo, contentType, deprecation); + } + else + { + AddContentFind(schemaInfo, contentType, null); + AddContentQueries(builder, schemaInfo, contentType, null); + } } Description = "The app queries."; } - private void AddContentFind(SchemaInfo schemaInfo, IGraphType contentType) + private void AddContentFind(SchemaInfo schemaInfo, IGraphType contentType, string? deprecatedReason) { AddField(new FieldTypeWithSchemaId { Name = $"find{schemaInfo.TypeName}Content", - Arguments = ContentActions.Find.Arguments, + Arguments = Find.Arguments, ResolvedType = contentType, - Resolver = ContentActions.Find.Resolver, + Resolver = Find.Resolver, + DeprecationReason = deprecatedReason, Description = $"Find an {schemaInfo.DisplayName} content by id.", SchemaId = schemaInfo.Schema.Id }); } - private void AddContentQueries(Builder builder, SchemaInfo schemaInfo, IGraphType contentType) + private void AddContentFindSingleton(SchemaInfo schemaInfo, IGraphType contentType) + { + AddField(new FieldTypeWithSchemaId + { + Name = $"find{schemaInfo.TypeName}Singleton", + Arguments = FindSingleton.Arguments, + ResolvedType = contentType, + Resolver = FindSingleton.Resolver, + DeprecationReason = null, + Description = $"Find an {schemaInfo.DisplayName} singleton.", + SchemaId = schemaInfo.Schema.Id + }); + } + + private void AddContentQueries(Builder builder, SchemaInfo schemaInfo, IGraphType contentType, string? deprecatedReason) { AddField(new FieldTypeWithSchemaId { Name = $"query{schemaInfo.TypeName}Contents", - Arguments = ContentActions.QueryOrReferencing.Arguments, + Arguments = QueryOrReferencing.Arguments, ResolvedType = new ListGraphType(new NonNullGraphType(contentType)), - Resolver = ContentActions.QueryOrReferencing.Query, + Resolver = QueryOrReferencing.Query, + DeprecationReason = deprecatedReason, Description = $"Query {schemaInfo.DisplayName} content items.", SchemaId = schemaInfo.Schema.Id }); @@ -70,9 +100,10 @@ internal sealed class ApplicationQueries : ObjectGraphType AddField(new FieldTypeWithSchemaId { Name = $"query{schemaInfo.TypeName}ContentsWithTotal", - Arguments = ContentActions.QueryOrReferencing.Arguments, + Arguments = QueryOrReferencing.Arguments, ResolvedType = contentResultTyp, - Resolver = ContentActions.QueryOrReferencing.QueryWithTotal, + Resolver = QueryOrReferencing.QueryWithTotal, + DeprecationReason = deprecatedReason, Description = $"Query {schemaInfo.DisplayName} content items with total count.", SchemaId = schemaInfo.Schema.Id }); @@ -90,9 +121,9 @@ internal sealed class ApplicationQueries : ObjectGraphType AddField(new FieldType { Name = "queryContentsByIds", - Arguments = ContentActions.QueryByIds.Arguments, + Arguments = QueryByIds.Arguments, ResolvedType = new NonNullGraphType(new ListGraphType(new NonNullGraphType(unionType))), - Resolver = ContentActions.QueryByIds.Resolver, + Resolver = QueryByIds.Resolver, Description = "Query content items by IDs across schemeas." }); } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/Contents/ContentActions.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/Contents/ContentActions.cs index bda4e47f0..949aacf55 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/Contents/ContentActions.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/Contents/ContentActions.cs @@ -96,6 +96,36 @@ internal static class ContentActions }); } + public static class FindSingleton + { + public static readonly QueryArguments Arguments = new QueryArguments + { + new QueryArgument(Scalars.Int) + { + Name = "version", + Description = FieldDescriptions.QueryVersion, + DefaultValue = null + } + }; + + public static readonly IFieldResolver Resolver = Resolvers.Sync((_, fieldContext, context) => + { + var contentSchemaId = fieldContext.FieldDefinition.SchemaId(); + var contentVersion = fieldContext.GetArgument("version"); + + if (contentVersion >= 0) + { + return context.GetContent(contentSchemaId, contentSchemaId, contentVersion.Value); + } + else + { + return context.GetContent(contentSchemaId, contentSchemaId, + fieldContext.FieldNames(), + fieldContext.CacheDuration()); + } + }); + } + public static class QueryByIds { public static readonly QueryArguments Arguments = new QueryArguments diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/ConvertData.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/ConvertData.cs index 7327fcafe..82a6685a8 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/ConvertData.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/Queries/Steps/ConvertData.cs @@ -149,7 +149,10 @@ public sealed class ConvertData : IContentEnricherStep { converter.Add(new ResolveAssetUrls(context.App.NamedId(), urlGenerator, assetUrls)); } + } + if (!context.IsFrontendClient || context.ResolveSchemaNames()) + { converter.Add(new AddSchemaNames(components)); } diff --git a/backend/src/Squidex/Areas/Api/Config/OpenApi/AcceptAnyBodyAttribute.cs b/backend/src/Squidex/Areas/Api/Config/OpenApi/AcceptAnyBodyAttribute.cs new file mode 100644 index 000000000..0fb316492 --- /dev/null +++ b/backend/src/Squidex/Areas/Api/Config/OpenApi/AcceptAnyBodyAttribute.cs @@ -0,0 +1,42 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using NJsonSchema; +using NSwag; +using NSwag.Annotations; +using NSwag.Generation.Processors; +using NSwag.Generation.Processors.Contexts; +using Squidex.Domain.Apps.Core; + +namespace Squidex.Areas.Api.Config.OpenApi; + +public sealed class AcceptAnyBodyAttribute : OpenApiOperationProcessorAttribute +{ + public AcceptAnyBodyAttribute() + : base(typeof(Processor)) + { + } + + public sealed class Processor : IOperationProcessor + { + public bool Process(OperationProcessorContext context) + { + context.OperationDescription.Operation.Parameters.Add( + new OpenApiParameter + { + Name = "request", + Kind = OpenApiParameterKind.Body, + Schema = new JsonSchema + { + }, + Description = FieldDescriptions.GraphqlRequest + }); + + return true; + } + } +} diff --git a/backend/src/Squidex/Areas/Api/Config/OpenApi/AcceptQueryAttribute.cs b/backend/src/Squidex/Areas/Api/Config/OpenApi/AcceptQueryAttribute.cs index 8fc630000..adb8b66bc 100644 --- a/backend/src/Squidex/Areas/Api/Config/OpenApi/AcceptQueryAttribute.cs +++ b/backend/src/Squidex/Areas/Api/Config/OpenApi/AcceptQueryAttribute.cs @@ -18,18 +18,13 @@ public sealed class AcceptQueryAttribute : OpenApiOperationProcessorAttribute { } - public sealed class Processor : IOperationProcessor +#pragma warning disable SA1313 // Parameter names should begin with lower-case letter + public sealed record Processor(bool SupportsSearch) : IOperationProcessor +#pragma warning restore SA1313 // Parameter names should begin with lower-case letter { - private readonly bool supportsSearch; - - public Processor(bool supportsSearch) - { - this.supportsSearch = supportsSearch; - } - public bool Process(OperationProcessorContext context) { - context.OperationDescription.Operation.AddQuery(supportsSearch); + context.OperationDescription.Operation.AddQuery(SupportsSearch); return true; } } diff --git a/backend/src/Squidex/Areas/Api/Controllers/Contents/ContentsSharedController.cs b/backend/src/Squidex/Areas/Api/Controllers/Contents/ContentsSharedController.cs index 93a2c54cc..3fd095063 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Contents/ContentsSharedController.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Contents/ContentsSharedController.cs @@ -21,6 +21,7 @@ using Squidex.Web.Pipeline; namespace Squidex.Areas.Api.Controllers.Contents; [SchemaMustBePublished] +[ApiExplorerSettings(GroupName = nameof(Contents))] public sealed class ContentsSharedController : ApiController { private readonly IContentQueryService contentQuery; @@ -39,18 +40,97 @@ public sealed class ContentsSharedController : ApiController /// GraphQL endpoint. /// /// The name of the app. + /// The request parameters. /// Contents returned or mutated.. /// App not found.. /// /// You can read the generated documentation for your app at /api/content/{appName}/docs. /// [Route("content/{app}/graphql/")] - [Route("content/{app}/graphql/batch")] + [ProducesResponseType(typeof(object), StatusCodes.Status200OK)] [ApiPermissionOrAnonymous] [ApiCosts(2)] [AcceptHeader.Unpublished] [IgnoreCacheFilter] - public IActionResult GetGraphQL(string app) + public IActionResult GetGraphQL(string app, GraphQLQueryDto request) + { + var options = new GraphQLHttpMiddlewareOptions + { + DefaultResponseContentType = new MediaTypeHeaderValue("application/json") + }; + + return new GraphQLExecutionActionResult(options); + } + + /// + /// GraphQL endpoint. + /// + /// The name of the app. + /// Contents returned or mutated.. + /// App not found.. + /// + /// You can read the generated documentation for your app at /api/content/{appName}/docs. + /// + [HttpPost("content/{app}/graphql/")] + [ProducesResponseType(typeof(object), StatusCodes.Status200OK)] + [ApiPermissionOrAnonymous] + [ApiCosts(2)] + [AcceptAnyBody] + [AcceptHeader.Unpublished] + [IgnoreCacheFilter] + public IActionResult PostGraphQL(string app) + { + var options = new GraphQLHttpMiddlewareOptions + { + DefaultResponseContentType = new MediaTypeHeaderValue("application/json") + }; + + return new GraphQLExecutionActionResult(options); + } + + /// + /// GraphQL batch endpoint. + /// + /// The name of the app. + /// The request object. + /// Contents returned or mutated.. + /// App not found.. + /// + /// You can read the generated documentation for your app at /api/content/{appName}/docs. + /// + [HttpGet("content/{app}/graphql/batch")] + [ProducesResponseType(typeof(object), StatusCodes.Status200OK)] + [ApiPermissionOrAnonymous] + [ApiCosts(2)] + [AcceptHeader.Unpublished] + [IgnoreCacheFilter] + public IActionResult GetGraphQLBatch(string app, GraphQLQueryDto request) + { + var options = new GraphQLHttpMiddlewareOptions + { + DefaultResponseContentType = new MediaTypeHeaderValue("application/json") + }; + + return new GraphQLExecutionActionResult(options); + } + + /// + /// GraphQL batch endpoint. + /// + /// The name of the app. + /// Contents returned or mutated.. + /// App not found.. + /// + /// You can read the generated documentation for your app at /api/content/{appName}/docs. + /// + [HttpPost("content/{app}/graphql/batch")] + [ProducesResponseType(typeof(object), StatusCodes.Status200OK)] + [ApiPermissionOrAnonymous] + [ApiCosts(2)] + [AcceptAnyBody] + [AcceptHeader.Unpublished] + [IgnoreCacheFilter] + public IActionResult PostGraphQLBatch(string app) { var options = new GraphQLHttpMiddlewareOptions { @@ -143,7 +223,7 @@ public sealed class ContentsSharedController : ApiController [ProducesResponseType(typeof(BulkResultDto[]), StatusCodes.Status200OK)] [ApiPermissionOrAnonymous(PermissionIds.AppContentsReadOwn)] [ApiCosts(5)] - public async Task BulkUpdateContents(string app, string schema, [FromBody] BulkUpdateContentsDto request) + public async Task BulkUpdateAllContents(string app, string schema, [FromBody] BulkUpdateContentsDto request) { var command = request.ToCommand(true); diff --git a/backend/src/Squidex/Areas/Api/Controllers/Contents/Models/GraphQLQueryDto.cs b/backend/src/Squidex/Areas/Api/Controllers/Contents/Models/GraphQLQueryDto.cs new file mode 100644 index 000000000..8e11f52f6 --- /dev/null +++ b/backend/src/Squidex/Areas/Api/Controllers/Contents/Models/GraphQLQueryDto.cs @@ -0,0 +1,31 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using Microsoft.AspNetCore.Mvc; + +namespace Squidex.Areas.Api.Controllers.Contents.Models; + +public sealed class GraphQLQueryDto +{ + /// + /// The optional version of the asset. + /// + [FromQuery(Name = "The query string")] + public string Query { get; set; } + + /// + /// The optional operation variables. + /// + [FromQuery(Name = "variables")] + public string? Variables { get; set; } + + /// + /// The optional operation name. + /// + [FromQuery(Name = "operationName")] + public string? OperationName { get; set; } +} diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLQueriesTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLQueriesTests.cs index 79666087b..db79711dc 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLQueriesTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLQueriesTests.cs @@ -53,7 +53,7 @@ public class GraphQLQueriesTests : GraphQLTestBase var contentId = DomainId.NewGuid(); var content = TestContent.Create(contentId); - A.CallTo(() => contentQuery.QueryAsync(MatchsContentContext(), TestSchemas.Default.Id.ToString(), + A.CallTo(() => contentQuery.QueryAsync(MatchsContentContext(), content.SchemaId.Id.ToString(), A.That.Matches(x => x.QueryAsOdata == "?$skip=0&$search=\"Hello\"" && x.NoTotal), A._)) .Returns(ResultList.CreateFrom(0, content)); @@ -345,7 +345,7 @@ public class GraphQLQueriesTests : GraphQLTestBase var contentId = DomainId.NewGuid(); var content = TestContent.Create(contentId); - A.CallTo(() => contentQuery.QueryAsync(MatchsContentContext(), TestSchemas.Default.Id.ToString(), + A.CallTo(() => contentQuery.QueryAsync(MatchsContentContext(), content.SchemaId.Id.ToString(), A.That.Matches(x => x.QueryAsOdata == "?$top=30&$skip=5" && x.NoTotal), A._)) .Returns(ResultList.CreateFrom(0, content)); @@ -384,7 +384,7 @@ public class GraphQLQueriesTests : GraphQLTestBase var contentId = DomainId.NewGuid(); var content = TestContent.Create(contentId); - A.CallTo(() => contentQuery.QueryAsync(MatchsContentContext(), TestSchemas.Default.Id.ToString(), + A.CallTo(() => contentQuery.QueryAsync(MatchsContentContext(), content.SchemaId.Id.ToString(), A.That.Matches(x => x.QueryAsOdata == "?$top=30&$skip=5" && x.NoTotal), A._)) .Returns(ResultList.CreateFrom(0, content)); @@ -423,7 +423,7 @@ public class GraphQLQueriesTests : GraphQLTestBase var contentId = DomainId.NewGuid(); var content = TestContent.Create(contentId); - A.CallTo(() => contentQuery.QueryAsync(MatchsContentContext(), TestSchemas.Default.Id.ToString(), + A.CallTo(() => contentQuery.QueryAsync(MatchsContentContext(), content.SchemaId.Id.ToString(), A.That.Matches(x => x.QueryAsOdata == "?$top=30&$skip=5" && !x.NoTotal), A._)) .Returns(ResultList.CreateFrom(10, content)); @@ -503,7 +503,7 @@ public class GraphQLQueriesTests : GraphQLTestBase public async Task Should_return_null_if_single_content_from_another_schema() { var contentId = DomainId.NewGuid(); - var content = TestContent.CreateRef(TestSchemas.Reference1.NamedId(), contentId, "reference1-field", "reference1"); + var content = TestContent.CreateSimple(TestSchemas.Reference1.NamedId(), contentId, "reference1-field", "reference1"); A.CallTo(() => contentQuery.QueryAsync(MatchsContentContext(), A.That.HasIdsWithoutTotal(contentId), @@ -537,7 +537,7 @@ public class GraphQLQueriesTests : GraphQLTestBase } [Fact] - public async Task Should_return_single_content_if_finding_content() + public async Task Should_find_single_content() { var contentId = DomainId.NewGuid(); var content = TestContent.Create(contentId); @@ -574,12 +574,12 @@ public class GraphQLQueriesTests : GraphQLTestBase } [Fact] - public async Task Should_return_single_content_if_finding_content_with_version() + public async Task Should_find_single_content_with_version() { var contentId = DomainId.NewGuid(); var content = TestContent.Create(contentId); - A.CallTo(() => contentQuery.FindAsync(MatchsContentContext(), TestSchemas.Default.Id.ToString(), contentId, 3, + A.CallTo(() => contentQuery.FindAsync(MatchsContentContext(), content.SchemaId.Id.ToString(), contentId, 3, A._)) .Returns(content); @@ -609,11 +609,102 @@ public class GraphQLQueriesTests : GraphQLTestBase AssertResult(expected, actual); } + [Fact] + public async Task Should_find_singleton_content() + { + var contentId = TestSchemas.Singleton.Id; + var content = TestContent.CreateSimple(TestSchemas.Singleton.NamedId(), contentId, "singleton-field", "Hello"); + + A.CallTo(() => contentQuery.QueryAsync(MatchsContentContext(), + A.That.HasIdsWithoutTotal(contentId), + A._)) + .Returns(ResultList.CreateFrom(1, content)); + + var actual = await ExecuteAsync(new TestQuery + { + Query = @" + query { + findMySingletonSingleton { + id, + flatData { + singletonField + } + } + }", + Args = new + { + contentId + } + }); + + var expected = new + { + data = new + { + findMySingletonSingleton = new + { + id = contentId, + flatData = new + { + singletonField = "Hello" + } + } + } + }; + + AssertResult(expected, actual); + } + + [Fact] + public async Task Should_find_singleton_content_with_version() + { + var contentId = TestSchemas.Singleton.Id; + var content = TestContent.CreateSimple(TestSchemas.Singleton.NamedId(), contentId, "singleton-field", "Hello"); + + A.CallTo(() => contentQuery.FindAsync(MatchsContentContext(), content.SchemaId.Id.ToString(), contentId, 3, + A._)) + .Returns(content); + + var actual = await ExecuteAsync(new TestQuery + { + Query = @" + query { + findMySingletonSingleton(version: 3) { + id, + flatData { + singletonField + } + } + }", + Args = new + { + contentId + } + }); + + var expected = new + { + data = new + { + findMySingletonSingleton = new + { + id = contentId, + flatData = new + { + singletonField = "Hello" + } + } + } + }; + + AssertResult(expected, actual); + } + [Fact] public async Task Should_also_fetch_embedded_contents_if_field_is_included_in_query() { var contentRefId = DomainId.NewGuid(); - var contentRef = TestContent.CreateRef(TestSchemas.Reference1.NamedId(), contentRefId, "reference1-field", "reference1"); + var contentRef = TestContent.CreateSimple(TestSchemas.Reference1.NamedId(), contentRefId, "reference1-field", "reference1"); var contentId = DomainId.NewGuid(); var content = TestContent.Create(contentId, contentRefId); @@ -703,7 +794,7 @@ public class GraphQLQueriesTests : GraphQLTestBase public async Task Should_also_fetch_referenced_contents_if_field_is_included_in_query() { var contentRefId = DomainId.NewGuid(); - var contentRef = TestContent.CreateRef(TestSchemas.Reference1.NamedId(), contentRefId, "reference1-field", "reference1"); + var contentRef = TestContent.CreateSimple(TestSchemas.Reference1.NamedId(), contentRefId, "reference1-field", "reference1"); var contentId = DomainId.NewGuid(); var content = TestContent.Create(contentId, contentRefId); @@ -782,7 +873,7 @@ public class GraphQLQueriesTests : GraphQLTestBase public async Task Should_also_fetch_referenced_contents_from_flat_data_if_field_is_included_in_query() { var contentRefId = DomainId.NewGuid(); - var contentRef = TestContent.CreateRef(TestSchemas.Reference1.NamedId(), contentRefId, "reference1-field", "reference1"); + var contentRef = TestContent.CreateSimple(TestSchemas.Reference1.NamedId(), contentRefId, "reference1-field", "reference1"); var contentId = DomainId.NewGuid(); var content = TestContent.Create(contentId, contentRefId); @@ -844,7 +935,7 @@ public class GraphQLQueriesTests : GraphQLTestBase public async Task Should_cache_referenced_contents_from_flat_data_if_field_is_included_in_query() { var contentRefId = DomainId.NewGuid(); - var contentRef = TestContent.CreateRef(TestSchemas.Reference1.NamedId(), contentRefId, "reference1-field", "reference1"); + var contentRef = TestContent.CreateSimple(TestSchemas.Reference1.NamedId(), contentRefId, "reference1-field", "reference1"); var contentId = DomainId.NewGuid(); var content = TestContent.Create(contentId, contentRefId); @@ -915,7 +1006,7 @@ public class GraphQLQueriesTests : GraphQLTestBase public async Task Should_also_fetch_referencing_contents_if_field_is_included_in_query() { var contentRefId = DomainId.NewGuid(); - var contentRef = TestContent.CreateRef(TestSchemas.Reference1.NamedId(), contentRefId, "reference1-field", "reference1"); + var contentRef = TestContent.CreateSimple(TestSchemas.Reference1.NamedId(), contentRefId, "reference1-field", "reference1"); var contentId = DomainId.NewGuid(); var content = TestContent.Create(contentId, contentRefId); @@ -984,7 +1075,7 @@ public class GraphQLQueriesTests : GraphQLTestBase public async Task Should_also_fetch_referencing_contents_with_total_if_field_is_included_in_query() { var contentRefId = DomainId.NewGuid(); - var contentRef = TestContent.CreateRef(TestSchemas.Reference1.NamedId(), contentRefId, "reference1-field", "reference1"); + var contentRef = TestContent.CreateSimple(TestSchemas.Reference1.NamedId(), contentRefId, "reference1-field", "reference1"); var contentId = DomainId.NewGuid(); var content = TestContent.Create(contentId, contentRefId); @@ -1060,7 +1151,7 @@ public class GraphQLQueriesTests : GraphQLTestBase public async Task Should_also_fetch_references_contents_if_field_is_included_in_query() { var contentRefId = DomainId.NewGuid(); - var contentRef = TestContent.CreateRef(TestSchemas.Reference1.NamedId(), contentRefId, "reference1-field", "reference1"); + var contentRef = TestContent.CreateSimple(TestSchemas.Reference1.NamedId(), contentRefId, "reference1-field", "reference1"); var contentId = DomainId.NewGuid(); var content = TestContent.Create(contentId, contentRefId); @@ -1117,7 +1208,7 @@ public class GraphQLQueriesTests : GraphQLTestBase public async Task Should_also_fetch_references_contents_with_total_if_field_is_included_in_query() { var contentRefId = DomainId.NewGuid(); - var contentRef = TestContent.CreateRef(TestSchemas.Reference1.NamedId(), contentRefId, "reference1-field", "reference1"); + var contentRef = TestContent.CreateSimple(TestSchemas.Reference1.NamedId(), contentRefId, "reference1-field", "reference1"); var contentId = DomainId.NewGuid(); var content = TestContent.Create(contentId, contentRefId); @@ -1181,7 +1272,7 @@ public class GraphQLQueriesTests : GraphQLTestBase public async Task Should_also_fetch_union_contents_if_field_is_included_in_query() { var contentRefId = DomainId.NewGuid(); - var contentRef = TestContent.CreateRef(TestSchemas.Reference1.NamedId(), contentRefId, "reference1-field", "reference1"); + var contentRef = TestContent.CreateSimple(TestSchemas.Reference1.NamedId(), contentRefId, "reference1-field", "reference1"); var contentId = DomainId.NewGuid(); var content = TestContent.Create(contentId, contentRefId); diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLTestBase.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLTestBase.cs index 50be7d694..508bd5553 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLTestBase.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLTestBase.cs @@ -76,7 +76,12 @@ public abstract class GraphQLTestBase : IClassFixture protected Task ExecuteAsync(TestQuery query) { // Use a shared instance to test caching. - sut ??= CreateSut(TestSchemas.Default, TestSchemas.Reference1, TestSchemas.Reference2, TestSchemas.Component); + sut ??= CreateSut( + TestSchemas.Default, + TestSchemas.Reference1, + TestSchemas.Reference2, + TestSchemas.Singleton, + TestSchemas.Component); var options = query.ToOptions(sut.Services); diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/TestContent.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/TestContent.cs index a593e3993..c35923490 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/TestContent.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/TestContent.cs @@ -346,7 +346,7 @@ public static class TestContent return content; } - public static IEnrichedContentEntity CreateRef(NamedId schemaId, DomainId id, string field, string value) + public static IEnrichedContentEntity CreateSimple(NamedId schemaId, DomainId id, string field, string value) { var now = SystemClock.Instance.GetCurrentInstant(); diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/TestSchemas.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/TestSchemas.cs index 0946c4d6c..cb6501228 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/TestSchemas.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/TestSchemas.cs @@ -19,6 +19,7 @@ public static class TestSchemas public static readonly ISchemaEntity Default; public static readonly ISchemaEntity Reference1; public static readonly ISchemaEntity Reference2; + public static readonly ISchemaEntity Singleton; public static readonly ISchemaEntity Component; static TestSchemas() @@ -57,6 +58,11 @@ public static class TestSchemas .Publish() .AddString(1, "reference2-field", Partitioning.Invariant)); + Singleton = Mocks.Schema(TestApp.DefaultId, DomainId.NewGuid(), + new Schema("my-singleton", type: SchemaType.Singleton) + .Publish() + .AddString(1, "singleton-field", Partitioning.Invariant)); + Default = Mocks.Schema(TestApp.DefaultId, DomainId.NewGuid(), new Schema("my-schema") .Publish() From 64214262125caf6a14c52c237d57470cff29b147 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 9 Oct 2023 16:32:37 +0200 Subject: [PATCH 22/35] Fix content trigger. --- .../content-changed-trigger.component.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/app/features/rules/shared/triggers/content-changed-trigger.component.html b/frontend/src/app/features/rules/shared/triggers/content-changed-trigger.component.html index 6a4a93a12..2d05b8148 100644 --- a/frontend/src/app/features/rules/shared/triggers/content-changed-trigger.component.html +++ b/frontend/src/app/features/rules/shared/triggers/content-changed-trigger.component.html @@ -30,14 +30,14 @@
+
-
-
- - -
+
+
+ +
From 5440e68bd81a75ccd8b8c67ddd9690c396be1150 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Mon, 9 Oct 2023 23:44:34 +0200 Subject: [PATCH 23/35] Event query improvements (#1033) * Schema name. * Fix build. * Query improvements. * Simplifications. * Fix regex. * Build fix. --- backend/src/Migrations/RebuilderExtensions.cs | 25 +++++-- .../Schemas/ReferencesFieldProperties.cs | 2 +- .../Subscriptions/SubscriptionPublisher.cs | 20 ++---- .../Schemas/MongoSchemasHash.cs | 20 +----- .../Apps/AppEventDeleter.cs | 4 +- .../Apps/AppPermanentDeleter.cs | 10 +-- .../Assets/AssetPermanentDeleter.cs | 10 +-- .../Assets/AssetUsageTracker_EventHandling.cs | 20 +----- .../Assets/AssetsFluidExtension.cs | 20 +++--- .../Assets/RebuildFiles.cs | 4 +- .../Assets/RecursiveDeleter.cs | 10 +-- .../Backup/BackupProcessor.cs | 9 +-- .../Comments/DomainObject/CommentsStream.cs | 2 +- .../Contents/ReferencesFluidExtension.cs | 20 +++--- .../Contents/Text/TextIndexingProcess.cs | 20 ++---- .../Invitation/InvitationEventConsumer.cs | 10 +-- .../Rules/Runner/DefaultRuleRunnerService.cs | 5 +- .../Rules/Runner/RuleRunnerProcessor.cs | 4 +- .../EventStoreProjectionClient.cs | 12 ++-- .../EventSourcing/GetEventStore.cs | 32 ++++----- .../GetEventStoreSubscription.cs | 4 +- .../EventSourcing/Utils.cs | 18 +++++ .../EventSourcing/FilterExtensions.cs | 45 ++++++------ .../MongoEventStoreSubscription.cs | 10 +-- .../EventSourcing/MongoEventStore_Reader.cs | 72 ++++++------------- .../EventSourcing/MongoEventStore_Writer.cs | 14 +--- .../Commands/Rebuilder.cs | 4 +- .../EventSourcing/IEventConsumer.cs | 4 +- .../EventSourcing/IEventStore.cs | 28 ++------ .../EventSourcing/PollingSubscription.cs | 2 +- .../EventSourcing/StreamFilter.cs | 35 +++++++-- .../EventSourcing/StreamFilterKind.cs | 14 ++++ .../States/BatchContext.cs | 15 ++-- .../States/Persistence.cs | 4 +- .../SubscriptionPublisherTests.cs | 2 +- .../Apps/AppEventDeleterTests.cs | 4 +- .../Apps/AppPermanentDeleterTests.cs | 4 +- .../Assets/AssetPermanentDeleterTests.cs | 4 +- .../Assets/AssetUsageTrackerTests.cs | 4 +- .../Assets/RecursiveDeleterTests.cs | 4 +- .../Assets/RepairFilesTests.cs | 4 +- .../Contents/Text/TextIndexerTestsBase.cs | 6 ++ .../InvitationEventConsumerTests.cs | 19 +++++ .../Rules/RuleEnqueuerTests.cs | 2 +- .../Consume/EventConsumerProcessorTests.cs | 22 +++--- .../EventSourcing/EventStoreTests.cs | 62 +++++++++------- .../EventSourcing/MongoEventStoreTests.cs | 5 +- .../EventSourcing/MongoParallelInsertTests.cs | 2 +- .../EventSourcing/PollingSubscriptionTests.cs | 2 +- .../EventSourcing/RetrySubscriptionTests.cs | 8 +-- .../EventSourcing/StreamFilterTests.cs | 27 +++++++ .../States/PersistenceBatchTests.cs | 15 ++-- .../States/PersistenceEventSourcingTests.cs | 12 ++-- .../States/PersistenceSnapshotTests.cs | 2 +- 54 files changed, 369 insertions(+), 369 deletions(-) create mode 100644 backend/src/Squidex.Infrastructure/EventSourcing/StreamFilterKind.cs create mode 100644 backend/tests/Squidex.Infrastructure.Tests/EventSourcing/StreamFilterTests.cs diff --git a/backend/src/Migrations/RebuilderExtensions.cs b/backend/src/Migrations/RebuilderExtensions.cs index 1dc8462bd..73aea3227 100644 --- a/backend/src/Migrations/RebuilderExtensions.cs +++ b/backend/src/Migrations/RebuilderExtensions.cs @@ -11,6 +11,7 @@ using Squidex.Domain.Apps.Entities.Contents.DomainObject; using Squidex.Domain.Apps.Entities.Rules.DomainObject; using Squidex.Domain.Apps.Entities.Schemas.DomainObject; using Squidex.Infrastructure.Commands; +using Squidex.Infrastructure.EventSourcing; namespace Migrations; @@ -21,36 +22,48 @@ public static class RebuilderExtensions public static Task RebuildAppsAsync(this Rebuilder rebuilder, int batchSize, CancellationToken ct = default) { - return rebuilder.RebuildAsync("^app\\-", batchSize, AllowedErrorRate, ct); + var streamFilter = StreamFilter.Prefix("app-"); + + return rebuilder.RebuildAsync(streamFilter, batchSize, AllowedErrorRate, ct); } public static Task RebuildSchemasAsync(this Rebuilder rebuilder, int batchSize, CancellationToken ct = default) { - return rebuilder.RebuildAsync("^schema\\-", batchSize, AllowedErrorRate, ct); + var streamFilter = StreamFilter.Prefix("schema-"); + + return rebuilder.RebuildAsync(streamFilter, batchSize, AllowedErrorRate, ct); } public static Task RebuildRulesAsync(this Rebuilder rebuilder, int batchSize, CancellationToken ct = default) { - return rebuilder.RebuildAsync("^rule\\-", batchSize, AllowedErrorRate, ct); + var streamFilter = StreamFilter.Prefix("rule-"); + + return rebuilder.RebuildAsync(streamFilter, batchSize, AllowedErrorRate, ct); } public static Task RebuildAssetsAsync(this Rebuilder rebuilder, int batchSize, CancellationToken ct = default) { - return rebuilder.RebuildAsync("^asset\\-", batchSize, AllowedErrorRate, ct); + var streamFilter = StreamFilter.Prefix("asset-"); + + return rebuilder.RebuildAsync(streamFilter, batchSize, AllowedErrorRate, ct); } public static Task RebuildAssetFoldersAsync(this Rebuilder rebuilder, int batchSize, CancellationToken ct = default) { - return rebuilder.RebuildAsync("^assetFolder\\-", batchSize, AllowedErrorRate, ct); + var streamFilter = StreamFilter.Prefix("assetFolder-"); + + return rebuilder.RebuildAsync(streamFilter, batchSize, AllowedErrorRate, ct); } public static Task RebuildContentAsync(this Rebuilder rebuilder, int batchSize, CancellationToken ct = default) { - return rebuilder.RebuildAsync("^content\\-", batchSize, AllowedErrorRate, ct); + var streamFilter = StreamFilter.Prefix("content-"); + + return rebuilder.RebuildAsync(streamFilter, batchSize, AllowedErrorRate, ct); } } diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ReferencesFieldProperties.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ReferencesFieldProperties.cs index c38fbf9db..a35b58cd5 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ReferencesFieldProperties.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/ReferencesFieldProperties.cs @@ -26,7 +26,7 @@ public sealed record ReferencesFieldProperties : FieldProperties public bool MustBePublished { get; init; } - public string? Query { get; init;} + public string? Query { get; init; } public ReferencesFieldEditor Editor { get; init; } diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/Subscriptions/SubscriptionPublisher.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/Subscriptions/SubscriptionPublisher.cs index fa2db26d5..4bd054ed7 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/Subscriptions/SubscriptionPublisher.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/Subscriptions/SubscriptionPublisher.cs @@ -16,25 +16,13 @@ public sealed class SubscriptionPublisher : IEventConsumer private readonly ISubscriptionService subscriptionService; private readonly IEnumerable subscriptionEventCreators; - public string Name - { - get => "Subscriptions"; - } + public string Name => "Subscriptions"; - public string EventsFilter - { - get => "^(content-|asset-)"; - } + public StreamFilter EventsFilter { get; } = StreamFilter.Prefix("content-", "asset-"); - public bool StartLatest - { - get => true; - } + public bool StartLatest => true; - public bool CanClear - { - get => false; - } + public bool CanClear => false; public SubscriptionPublisher(ISubscriptionService subscriptionService, IEnumerable subscriptionEventCreators) { diff --git a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Schemas/MongoSchemasHash.cs b/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Schemas/MongoSchemasHash.cs index 85fe766d8..e1bc24fbb 100644 --- a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Schemas/MongoSchemasHash.cs +++ b/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Schemas/MongoSchemasHash.cs @@ -19,25 +19,11 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Schemas; public sealed class MongoSchemasHash : MongoRepositoryBase, ISchemasHash, IEventConsumer, IDeleter { - public int BatchSize - { - get => 1000; - } + public int BatchSize => 1000; - public int BatchDelay - { - get => 500; - } + public int BatchDelay => 500; - public string Name - { - get => GetType().Name; - } - - public string EventsFilter - { - get => "^schema-"; - } + public StreamFilter EventsFilter { get; } = StreamFilter.Prefix("schema-"); public MongoSchemasHash(IMongoDatabase database) : base(database) diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/AppEventDeleter.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/AppEventDeleter.cs index 4574191b5..08ac26e25 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/AppEventDeleter.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Apps/AppEventDeleter.cs @@ -23,6 +23,8 @@ public sealed class AppEventDeleter : IDeleter public Task DeleteAppAsync(IAppEntity app, CancellationToken ct) { - return eventStore.DeleteAsync($"^([a-zA-Z0-9]+)\\-{app.Id}", ct); + var streamFilter = StreamFilter.Prefix($"([a-zA-Z0-9]+)-{app.Id}"); + + return eventStore.DeleteAsync(streamFilter, ct); } } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/AppPermanentDeleter.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/AppPermanentDeleter.cs index 8c1857763..d339b83fb 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/AppPermanentDeleter.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Apps/AppPermanentDeleter.cs @@ -20,15 +20,7 @@ public sealed class AppPermanentDeleter : IEventConsumer private readonly IDomainObjectFactory factory; private readonly HashSet consumingTypes; - public string Name - { - get => GetType().Name; - } - - public string EventsFilter - { - get => "^app-"; - } + public StreamFilter EventsFilter { get; } = StreamFilter.Prefix("app-"); public AppPermanentDeleter(IEnumerable deleters, IDomainObjectFactory factory, TypeRegistry typeRegistry) { diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetPermanentDeleter.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetPermanentDeleter.cs index 0ca13dc5b..85e299c82 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetPermanentDeleter.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetPermanentDeleter.cs @@ -17,15 +17,7 @@ public sealed class AssetPermanentDeleter : IEventConsumer private readonly IAssetFileStore assetFileStore; private readonly HashSet consumingTypes; - public string Name - { - get => GetType().Name; - } - - public string EventsFilter - { - get => "^asset-"; - } + public StreamFilter EventsFilter { get; } = StreamFilter.Prefix("asset-"); public AssetPermanentDeleter(IAssetFileStore assetFileStore, TypeRegistry typeRegistry) { diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetUsageTracker_EventHandling.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetUsageTracker_EventHandling.cs index b7251970d..dd9af405b 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetUsageTracker_EventHandling.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetUsageTracker_EventHandling.cs @@ -21,25 +21,11 @@ public partial class AssetUsageTracker : IEventConsumer { private IMemoryCache memoryCache; - public int BatchSize - { - get => 1000; - } + public int BatchSize => 1000; - public int BatchDelay - { - get => 1000; - } + public int BatchDelay => 1000; - public string Name - { - get => GetType().Name; - } - - public string EventsFilter - { - get => "^asset-"; - } + public StreamFilter EventsFilter { get; } = StreamFilter.Prefix("asset-"); private void ClearCache() { diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetsFluidExtension.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetsFluidExtension.cs index 4bdbb74f5..07f964a1a 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetsFluidExtension.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetsFluidExtension.cs @@ -39,19 +39,21 @@ public sealed class AssetsFluidExtension : IFluidExtension private async ValueTask ResolveAsset(ValueTuple arguments, TextWriter writer, TextEncoder encoder, TemplateContext context) { - if (context.GetValue("event")?.ToObjectValue() is EnrichedEvent enrichedEvent) + if (context.GetValue("event")?.ToObjectValue() is not EnrichedEvent enrichedEvent) { - var (nameArg, idArg) = arguments; + return Completion.Normal; + } - var assetId = await idArg.EvaluateAsync(context); - var asset = await ResolveAssetAsync(serviceProvider, enrichedEvent.AppId.Id, assetId); + var (nameArg, idArg) = arguments; - if (asset != null) - { - var name = (await nameArg.EvaluateAsync(context)).ToStringValue(); + var assetId = await idArg.EvaluateAsync(context); + var asset = await ResolveAssetAsync(serviceProvider, enrichedEvent.AppId.Id, assetId); - context.SetValue(name, asset); - } + if (asset != null) + { + var name = (await nameArg.EvaluateAsync(context)).ToStringValue(); + + context.SetValue(name, asset); } return Completion.Normal; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/RebuildFiles.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/RebuildFiles.cs index 91a8c128c..b9c248abc 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/RebuildFiles.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/RebuildFiles.cs @@ -33,7 +33,9 @@ public sealed class RebuildFiles public async Task RepairAsync( CancellationToken ct = default) { - await foreach (var storedEvent in eventStore.QueryAllAsync("^asset\\-", ct: ct)) + var streamFilter = StreamFilter.Prefix("asset-"); + + await foreach (var storedEvent in eventStore.QueryAllAsync(streamFilter, ct: ct)) { var @event = eventFormatter.ParseIfKnown(storedEvent); diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/RecursiveDeleter.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/RecursiveDeleter.cs index 1ec6fa155..9d198968f 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/RecursiveDeleter.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/RecursiveDeleter.cs @@ -23,15 +23,7 @@ public sealed class RecursiveDeleter : IEventConsumer private readonly ILogger log; private readonly HashSet consumingTypes; - public string Name - { - get => GetType().Name; - } - - public string EventsFilter - { - get => "^assetFolder-"; - } + public StreamFilter EventsFilter { get; } = StreamFilter.Prefix("assetFolder-"); public RecursiveDeleter( ICommandBus commandBus, diff --git a/backend/src/Squidex.Domain.Apps.Entities/Backup/BackupProcessor.cs b/backend/src/Squidex.Domain.Apps.Entities/Backup/BackupProcessor.cs index 64b9e66a3..ef1c359fa 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Backup/BackupProcessor.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Backup/BackupProcessor.cs @@ -147,7 +147,9 @@ public sealed partial class BackupProcessor var backupUsers = new UserMapping(run.Actor); var backupContext = new BackupContext(appId, backupUsers, writer); - await foreach (var storedEvent in eventStore.QueryAllAsync(GetFilter(), ct: ct)) + var streamFilter = StreamFilter.Prefix($"[^\\-]*-{appId}"); + + await foreach (var storedEvent in eventStore.QueryAllAsync(streamFilter, ct: ct)) { var @event = eventFormatter.Parse(storedEvent); @@ -200,11 +202,6 @@ public sealed partial class BackupProcessor } } - private string GetFilter() - { - return $"^[^\\-]*-{Regex.Escape(appId.ToString())}"; - } - public Task DeleteAsync(DomainId id) { return scheduler.ScheduleAsync(async _ => diff --git a/backend/src/Squidex.Domain.Apps.Entities/Comments/DomainObject/CommentsStream.cs b/backend/src/Squidex.Domain.Apps.Entities/Comments/DomainObject/CommentsStream.cs index a40721ac2..1b087e470 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Comments/DomainObject/CommentsStream.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Comments/DomainObject/CommentsStream.cs @@ -42,7 +42,7 @@ public class CommentsStream : IAggregate public virtual async Task LoadAsync( CancellationToken ct) { - var storedEvents = await eventStore.QueryReverseAsync(streamName, 100, ct); + var storedEvents = await eventStore.QueryStreamReverseAsync(streamName, 100, ct); foreach (var @event in storedEvents) { diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/ReferencesFluidExtension.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/ReferencesFluidExtension.cs index fcd5d3b6d..8695544ab 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/ReferencesFluidExtension.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/ReferencesFluidExtension.cs @@ -39,19 +39,21 @@ public sealed class ReferencesFluidExtension : IFluidExtension private async ValueTask ResolveReference(ValueTuple arguments, TextWriter writer, TextEncoder encoder, TemplateContext context) { - if (context.GetValue("event")?.ToObjectValue() is EnrichedEvent enrichedEvent) + if (context.GetValue("event")?.ToObjectValue() is not EnrichedEvent enrichedEvent) { - var (nameArg, idArg) = arguments; + return Completion.Normal; + } - var contentId = await idArg.EvaluateAsync(context); - var content = await ResolveContentAsync(serviceProvider, enrichedEvent.AppId.Id, contentId); + var (nameArg, idArg) = arguments; - if (content != null) - { - var name = (await nameArg.EvaluateAsync(context)).ToStringValue(); + var contentId = await idArg.EvaluateAsync(context); + var content = await ResolveContentAsync(serviceProvider, enrichedEvent.AppId.Id, contentId); - context.SetValue(name, content); - } + if (content != null) + { + var name = (await nameArg.EvaluateAsync(context)).ToStringValue(); + + context.SetValue(name, content); } return Completion.Normal; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/TextIndexingProcess.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/TextIndexingProcess.cs index 754f68d34..adf5aaf19 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/TextIndexingProcess.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/TextIndexingProcess.cs @@ -21,25 +21,13 @@ public sealed class TextIndexingProcess : IEventConsumer private readonly ITextIndex textIndex; private readonly ITextIndexerState textIndexerState; - public int BatchSize - { - get => 1000; - } + public int BatchSize => 1000; - public int BatchDelay - { - get => 1000; - } + public int BatchDelay => 1000; - public string Name - { - get => "TextIndexer5"; - } + public string Name => "TextIndexer5"; - public string EventsFilter - { - get => "^content-"; - } + public StreamFilter EventsFilter { get; } = StreamFilter.Prefix("content-"); public ITextIndex TextIndex { diff --git a/backend/src/Squidex.Domain.Apps.Entities/Invitation/InvitationEventConsumer.cs b/backend/src/Squidex.Domain.Apps.Entities/Invitation/InvitationEventConsumer.cs index faaa7b406..811cc6f07 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Invitation/InvitationEventConsumer.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Invitation/InvitationEventConsumer.cs @@ -24,15 +24,9 @@ public sealed class InvitationEventConsumer : IEventConsumer private readonly IAppProvider appProvider; private readonly ILogger log; - public string Name - { - get => "NotificationEmailSender"; - } + public string Name => "NotificationEmailSender"; - public string EventsFilter - { - get { return "^app-|^app-"; } - } + public StreamFilter EventsFilter { get; } = StreamFilter.Prefix("app-"); public InvitationEventConsumer( IAppProvider appProvider, diff --git a/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/DefaultRuleRunnerService.cs b/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/DefaultRuleRunnerService.cs index efd5edefd..4c8e8dbb4 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/DefaultRuleRunnerService.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/DefaultRuleRunnerService.cs @@ -65,9 +65,10 @@ public sealed class DefaultRuleRunnerService : IRuleRunnerService var simulatedEvents = new List(MaxSimulatedEvents); - var fromNow = SystemClock.Instance.GetCurrentInstant().Minus(Duration.FromDays(7)); + var streamStart = SystemClock.Instance.GetCurrentInstant().Minus(Duration.FromDays(7)); + var streamFilter = StreamFilter.Prefix($"([a-zA-Z0-9]+)-{appId.Id}"); - await foreach (var storedEvent in eventStore.QueryAllReverseAsync($"^([a-zA-Z0-9]+)\\-{appId.Id}", fromNow, MaxSimulatedEvents, ct)) + await foreach (var storedEvent in eventStore.QueryAllReverseAsync(streamFilter, streamStart, MaxSimulatedEvents, ct)) { var @event = eventFormatter.ParseIfKnown(storedEvent); diff --git a/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/RuleRunnerProcessor.cs b/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/RuleRunnerProcessor.cs index 7947b4d1e..a9d2e5745 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/RuleRunnerProcessor.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Rules/Runner/RuleRunnerProcessor.cs @@ -254,9 +254,9 @@ public sealed class RuleRunnerProcessor await using var batch = new RuleQueueWriter(ruleEventRepository, ruleUsageTracker, null); // Use a prefix query so that the storage can use an index for the query. - var filter = $"^([a-z]+)\\-{appId}"; + var streamFilter = StreamFilter.Prefix($"([a-zA-Z0-9]+)\\-{appId}"); - await foreach (var storedEvent in eventStore.QueryAllAsync(filter, run.Job.Position, ct: ct)) + await foreach (var storedEvent in eventStore.QueryAllAsync(streamFilter, run.Job.Position, ct: ct)) { var @event = eventFormatter.ParseIfKnown(storedEvent); diff --git a/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/EventStoreProjectionClient.cs b/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/EventStoreProjectionClient.cs index f40798b0e..7dd723949 100644 --- a/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/EventStoreProjectionClient.cs +++ b/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/EventStoreProjectionClient.cs @@ -29,22 +29,22 @@ public sealed class EventStoreProjectionClient return $"by-{projectionPrefix.Slugify()}-{filter.Slugify()}"; } - public async Task CreateProjectionAsync(string? streamFilter = null) + public async Task CreateProjectionAsync(StreamFilter filter) { - if (!string.IsNullOrWhiteSpace(streamFilter) && streamFilter[0] != '^') + if (filter.Kind == StreamFilterKind.MatchFull && filter.Prefixes?.Count == 1) { - return $"{projectionPrefix}-{streamFilter}"; + return $"{projectionPrefix}-{filter.Prefixes[0]}"; } - streamFilter ??= ".*"; + var regex = filter.ToRegex(); - var name = CreateFilterProjectionName(streamFilter); + var name = CreateFilterProjectionName(regex); var query = $@"fromAll() .when({{ $any: function (s, e) {{ - if (e.streamId.indexOf('{projectionPrefix}') === 0 && /{streamFilter}/.test(e.streamId.substring({projectionPrefix.Length + 1}))) {{ + if (e.streamId.indexOf('{projectionPrefix}') === 0 && /{regex}/.test(e.streamId.substring({projectionPrefix.Length + 1}))) {{ linkTo('{name}', e); }} }} diff --git a/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/GetEventStore.cs b/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/GetEventStore.cs index 5e90f56a3..0ae89afa5 100644 --- a/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/GetEventStore.cs +++ b/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/GetEventStore.cs @@ -46,14 +46,14 @@ public sealed class GetEventStore : IEventStore, IInitializable } } - public IEventSubscription CreateSubscription(IEventSubscriber subscriber, string? streamFilter = null, string? position = null) + public IEventSubscription CreateSubscription(IEventSubscriber subscriber, StreamFilter filter, string? position = null) { - Guard.NotNull(streamFilter); + Guard.NotNull(filter); - return new GetEventStoreSubscription(subscriber, client, projectionClient, serializer, position, StreamPrefix, streamFilter); + return new GetEventStoreSubscription(subscriber, client, projectionClient, serializer, position, StreamPrefix, filter); } - public async IAsyncEnumerable QueryAllAsync(string? streamFilter = null, string? position = null, int take = int.MaxValue, + public async IAsyncEnumerable QueryAllAsync(StreamFilter filter, string? position = null, int take = int.MaxValue, [EnumeratorCancellation] CancellationToken ct = default) { if (take <= 0) @@ -61,7 +61,7 @@ public sealed class GetEventStore : IEventStore, IInitializable yield break; } - var streamName = await projectionClient.CreateProjectionAsync(streamFilter); + var streamName = await projectionClient.CreateProjectionAsync(filter); var stream = QueryAsync(streamName, position.ToPosition(false), take, ct); @@ -71,7 +71,7 @@ public sealed class GetEventStore : IEventStore, IInitializable } } - public async IAsyncEnumerable QueryAllReverseAsync(string? streamFilter = null, Instant timestamp = default, int take = int.MaxValue, + public async IAsyncEnumerable QueryAllReverseAsync(StreamFilter filter, Instant timestamp = default, int take = int.MaxValue, [EnumeratorCancellation] CancellationToken ct = default) { if (take <= 0) @@ -79,7 +79,7 @@ public sealed class GetEventStore : IEventStore, IInitializable yield break; } - var streamName = await projectionClient.CreateProjectionAsync(streamFilter); + var streamName = await projectionClient.CreateProjectionAsync(filter); var stream = QueryReverseAsync(streamName, StreamPosition.End, take, ct); @@ -89,11 +89,9 @@ public sealed class GetEventStore : IEventStore, IInitializable } } - public async Task> QueryReverseAsync(string streamName, int count = int.MaxValue, + public async Task> QueryStreamReverseAsync(string streamName, int count = int.MaxValue, CancellationToken ct = default) { - Guard.NotNullOrEmpty(streamName); - if (count <= 0) { return EmptyEvents; @@ -103,7 +101,7 @@ public sealed class GetEventStore : IEventStore, IInitializable { var result = new List(); - var stream = QueryReverseAsync(GetStreamName(streamName), StreamPosition.End, count, ct); + var stream = QueryReverseAsync(streamName, StreamPosition.End, count, ct); await foreach (var storedEvent in stream.IgnoreNotFound(ct)) { @@ -114,16 +112,14 @@ public sealed class GetEventStore : IEventStore, IInitializable } } - public async Task> QueryAsync(string streamName, long afterStreamPosition = EtagVersion.Empty, + public async Task> QueryStreamAsync(string streamName, long afterStreamPosition = EtagVersion.Empty, CancellationToken ct = default) { - Guard.NotNullOrEmpty(streamName); - using (Telemetry.Activities.StartActivity("GetEventStore/QueryAsync")) { var result = new List(); - var stream = QueryAsync(GetStreamName(streamName), afterStreamPosition.ToPositionBefore(), int.MaxValue, ct); + var stream = QueryAsync(streamName, afterStreamPosition.ToPositionBefore(), int.MaxValue, ct); await foreach (var storedEvent in stream.IgnoreNotFound(ct)) { @@ -156,7 +152,7 @@ public sealed class GetEventStore : IEventStore, IInitializable streamName, start, count, - resolveLinkTos: true, + true, cancellationToken: ct); return result.Select(x => Formatter.Read(x, StreamPrefix, serializer)); @@ -210,10 +206,10 @@ public sealed class GetEventStore : IEventStore, IInitializable } } - public async Task DeleteAsync(string streamFilter, + public async Task DeleteAsync(StreamFilter filter, CancellationToken ct = default) { - var streamName = await projectionClient.CreateProjectionAsync(streamFilter); + var streamName = await projectionClient.CreateProjectionAsync(filter); var events = client.ReadStreamAsync(Direction.Forwards, streamName, StreamPosition.Start, resolveLinkTos: true, cancellationToken: ct); diff --git a/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/GetEventStoreSubscription.cs b/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/GetEventStoreSubscription.cs index e5d511f58..432abadff 100644 --- a/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/GetEventStoreSubscription.cs +++ b/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/GetEventStoreSubscription.cs @@ -23,14 +23,14 @@ internal sealed class GetEventStoreSubscription : IEventSubscription IJsonSerializer serializer, string? position, string? prefix, - string? streamFilter) + StreamFilter filter) { #pragma warning disable MA0134 // Observe result of async calls Task.Run(async () => { var ct = cts.Token; - var streamName = await projectionClient.CreateProjectionAsync(streamFilter); + var streamName = await projectionClient.CreateProjectionAsync(filter); async Task OnEvent(StreamSubscription subscription, ResolvedEvent @event, CancellationToken ct) diff --git a/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/Utils.cs b/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/Utils.cs index f2e233b28..d9ee49ad6 100644 --- a/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/Utils.cs +++ b/backend/src/Squidex.Infrastructure.GetEventStore/EventSourcing/Utils.cs @@ -7,6 +7,7 @@ using System.Globalization; using System.Runtime.CompilerServices; +using System.Text.RegularExpressions; using EventStore.Client; namespace Squidex.Infrastructure.EventSourcing; @@ -77,4 +78,21 @@ public static class Utils yield return enumerator.Current; } } + + public static string ToRegex(this StreamFilter filter) + { + if (filter.Prefixes == null) + { + return ".*"; + } + + if (filter.Kind == StreamFilterKind.MatchStart) + { + return $"^{string.Join('|', filter.Prefixes.Select(p => $"({p})"))}"; + } + else + { + return $"^{string.Join('|', filter.Prefixes.Select(p => $"({p})"))}$"; + } + } } diff --git a/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/FilterExtensions.cs b/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/FilterExtensions.cs index 3e9ec4f83..fe75f1ff7 100644 --- a/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/FilterExtensions.cs +++ b/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/FilterExtensions.cs @@ -5,6 +5,7 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== +using System.Text.RegularExpressions; using MongoDB.Driver; namespace Squidex.Infrastructure.EventSourcing; @@ -13,53 +14,57 @@ internal static class FilterExtensions { public static FilterDefinition ByOffset(long streamPosition) { - return Builders.Filter.Gte(x => x.EventStreamOffset, streamPosition); + var builder = Builders.Filter; + + return builder.Gte(x => x.EventStreamOffset, streamPosition); } public static FilterDefinition ByPosition(StreamPosition streamPosition) { + var builder = Builders.Filter; + if (streamPosition.IsEndOfCommit) { - return Builders.Filter.Gt(x => x.Timestamp, streamPosition.Timestamp); + return builder.Gt(x => x.Timestamp, streamPosition.Timestamp); } else { - return Builders.Filter.Gte(x => x.Timestamp, streamPosition.Timestamp); + return builder.Gte(x => x.Timestamp, streamPosition.Timestamp); } } - public static FilterDefinition? ByStream(string? streamFilter) + public static FilterDefinition ByStream(StreamFilter filter) { - if (StreamFilter.IsAll(streamFilter)) - { - return Builders.Filter.Exists(x => x.EventStream, true); - } + var builder = Builders.Filter; - if (streamFilter.Contains('^', StringComparison.Ordinal)) + if (filter.Prefixes == null) { - return Builders.Filter.Regex(x => x.EventStream, streamFilter); + return builder.Exists(x => x.EventStream, true); } - else + + if (filter.Kind == StreamFilterKind.MatchStart) { - return Builders.Filter.Eq(x => x.EventStream, streamFilter); + return builder.Or(filter.Prefixes.Select(p => builder.Regex(x => x.EventStream, $"^{p}"))); } + + return builder.In(x => x.EventStream, filter.Prefixes); } - public static FilterDefinition>? ByChangeInStream(string? streamFilter) + public static FilterDefinition>? ByChangeInStream(StreamFilter filter) { - if (StreamFilter.IsAll(streamFilter)) + var builder = Builders>.Filter; + + if (filter.Prefixes == null) { return null; } - if (streamFilter.Contains('^', StringComparison.Ordinal)) - { - return Builders>.Filter.Regex(x => x.FullDocument.EventStream, streamFilter); - } - else + if (filter.Kind == StreamFilterKind.MatchStart) { - return Builders>.Filter.Eq(x => x.FullDocument.EventStream, streamFilter); + return builder.Or(filter.Prefixes.Select(p => builder.Regex(x => x.FullDocument.EventStream, $"^{Regex.Escape(p)}"))); } + + return builder.In(x => x.FullDocument.EventStream, filter.Prefixes); } public static IEnumerable Filtered(this MongoEventCommit commit, StreamPosition position) diff --git a/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/MongoEventStoreSubscription.cs b/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/MongoEventStoreSubscription.cs index 7239513c7..2e6177045 100644 --- a/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/MongoEventStoreSubscription.cs +++ b/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/MongoEventStoreSubscription.cs @@ -18,7 +18,7 @@ public sealed class MongoEventStoreSubscription : IEventSubscription private readonly IEventSubscriber eventSubscriber; private readonly CancellationTokenSource stopToken = new CancellationTokenSource(); - public MongoEventStoreSubscription(MongoEventStore eventStore, IEventSubscriber eventSubscriber, string? streamFilter, string? position) + public MongoEventStoreSubscription(MongoEventStore eventStore, IEventSubscriber eventSubscriber, StreamFilter streamFilter, string? position) { this.eventStore = eventStore; this.eventSubscriber = eventSubscriber; @@ -26,7 +26,7 @@ public sealed class MongoEventStoreSubscription : IEventSubscription QueryAsync(streamFilter, position).Forget(); } - private async Task QueryAsync(string? streamFilter, string? position) + private async Task QueryAsync(StreamFilter streamFilter, string? position) { try { @@ -51,7 +51,7 @@ public sealed class MongoEventStoreSubscription : IEventSubscription } } - private async Task QueryCurrentAsync(string? streamFilter, StreamPosition lastPosition) + private async Task QueryCurrentAsync(StreamFilter streamFilter, StreamPosition lastPosition) { BsonDocument? resumeToken = null; @@ -103,7 +103,7 @@ public sealed class MongoEventStoreSubscription : IEventSubscription } } - private async Task QueryOldAsync(string? streamFilter, string? position) + private async Task QueryOldAsync(StreamFilter streamFilter, string? position) { string? lastRawPosition = null; @@ -134,7 +134,7 @@ public sealed class MongoEventStoreSubscription : IEventSubscription return lastRawPosition; } - private static PipelineDefinition, ChangeStreamDocument>? Match(string? streamFilter) + private static PipelineDefinition, ChangeStreamDocument>? Match(StreamFilter streamFilter) { var result = new EmptyPipelineDefinition>(); diff --git a/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/MongoEventStore_Reader.cs b/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/MongoEventStore_Reader.cs index adaa68d6e..7345bc320 100644 --- a/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/MongoEventStore_Reader.cs +++ b/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/MongoEventStore_Reader.cs @@ -20,25 +20,23 @@ public partial class MongoEventStore : MongoRepositoryBase, IE { private static readonly List EmptyEvents = new List(); - public IEventSubscription CreateSubscription(IEventSubscriber subscriber, string? streamFilter = null, string? position = null) + public IEventSubscription CreateSubscription(IEventSubscriber subscriber, StreamFilter filter, string? position = null) { Guard.NotNull(subscriber); if (CanUseChangeStreams) { - return new MongoEventStoreSubscription(this, subscriber, streamFilter, position); + return new MongoEventStoreSubscription(this, subscriber, filter, position); } else { - return new PollingSubscription(this, subscriber, streamFilter, position); + return new PollingSubscription(this, subscriber, filter, position); } } - public async Task> QueryReverseAsync(string streamName, int count = int.MaxValue, + public async Task> QueryStreamReverseAsync(string streamName, int count = int.MaxValue, CancellationToken ct = default) { - Guard.NotNullOrEmpty(streamName); - if (count <= 0) { return EmptyEvents; @@ -46,7 +44,7 @@ public partial class MongoEventStore : MongoRepositoryBase, IE using (Telemetry.Activities.StartActivity("MongoEventStore/QueryLatestAsync")) { - var filter = Filter.Eq(x => x.EventStream, streamName); + var filter = FilterExtensions.ByStream(StreamFilter.Name(streamName)); var commits = await Collection.Find(filter).Sort(Sort.Descending(x => x.Timestamp)).Limit(count) @@ -58,33 +56,26 @@ public partial class MongoEventStore : MongoRepositoryBase, IE } } - public async Task> QueryAsync(string streamName, long afterStreamPosition = EtagVersion.Empty, + public async Task> QueryStreamAsync(string streamName, long afterStreamPosition = EtagVersion.Empty, CancellationToken ct = default) { - Guard.NotNullOrEmpty(streamName); - using (Telemetry.Activities.StartActivity("MongoEventStore/QueryAsync")) { - var filter = - Filter.And( - Filter.Eq(x => x.EventStream, streamName), - Filter.Gte(x => x.EventStreamOffset, afterStreamPosition)); - var commits = - await Collection.Find(filter) + await Collection.Find(CreateFilter(StreamFilter.Name(streamName), afterStreamPosition)) .ToListAsync(ct); var result = Convert(commits, afterStreamPosition); if ((commits.Count == 0 || commits[0].EventStreamOffset != afterStreamPosition) && afterStreamPosition > EtagVersion.Empty) { - filter = + var filterBefore = Filter.And( - Filter.Eq(x => x.EventStream, streamName), + FilterExtensions.ByStream(StreamFilter.Name(streamName)), Filter.Lt(x => x.EventStreamOffset, afterStreamPosition)); commits = - await Collection.Find(filter).SortByDescending(x => x.EventStreamOffset).Limit(1) + await Collection.Find(filterBefore).SortByDescending(x => x.EventStreamOffset).Limit(1) .ToListAsync(ct); result = Convert(commits, afterStreamPosition).Concat(result).ToList(); @@ -94,26 +85,7 @@ public partial class MongoEventStore : MongoRepositoryBase, IE } } - public async Task>> QueryManyAsync(IEnumerable streamNames, - CancellationToken ct = default) - { - Guard.NotNull(streamNames); - - using (Telemetry.Activities.StartActivity("MongoEventStore/QueryManyAsync")) - { - var filter = Filter.In(x => x.EventStream, streamNames); - - var commits = - await Collection.Find(filter) - .ToListAsync(ct); - - var result = commits.GroupBy(x => x.EventStream).ToDictionary(x => x.Key, Convert); - - return result; - } - } - - public async IAsyncEnumerable QueryAllReverseAsync(string? streamFilter = null, Instant timestamp = default, int take = int.MaxValue, + public async IAsyncEnumerable QueryAllReverseAsync(StreamFilter filter, Instant timestamp = default, int take = int.MaxValue, [EnumeratorCancellation] CancellationToken ct = default) { if (take <= 0) @@ -123,10 +95,8 @@ public partial class MongoEventStore : MongoRepositoryBase, IE StreamPosition lastPosition = timestamp; - var filterDefinition = CreateFilter(streamFilter, lastPosition); - var find = - Collection.Find(filterDefinition, Batching.Options) + Collection.Find(CreateFilter(filter, lastPosition), Batching.Options) .Limit(take).Sort(Sort.Descending(x => x.Timestamp).Ascending(x => x.EventStream)); var taken = 0; @@ -158,12 +128,12 @@ public partial class MongoEventStore : MongoRepositoryBase, IE } } - public async IAsyncEnumerable QueryAllAsync(string? streamFilter = null, string? position = null, int take = int.MaxValue, + public async IAsyncEnumerable QueryAllAsync(StreamFilter filter, string? position = null, int take = int.MaxValue, [EnumeratorCancellation] CancellationToken ct = default) { StreamPosition lastPosition = position; - var filterDefinition = CreateFilter(streamFilter, lastPosition); + var filterDefinition = CreateFilter(filter, lastPosition); var find = Collection.Find(filterDefinition).SortBy(x => x.Timestamp).ThenByDescending(x => x.EventStream) @@ -197,15 +167,13 @@ public partial class MongoEventStore : MongoRepositoryBase, IE return commits.OrderBy(x => x.EventStreamOffset).ThenBy(x => x.Timestamp).SelectMany(x => x.Filtered(streamPosition)).ToList(); } - private static FilterDefinition CreateFilter(string? streamFilter, StreamPosition streamPosition) + private static FilterDefinition CreateFilter(StreamFilter filter, StreamPosition streamPosition) { - var filter = FilterExtensions.ByPosition(streamPosition); - - if (streamFilter != null) - { - return Filter.And(filter, FilterExtensions.ByStream(streamFilter)); - } + return Filter.And(FilterExtensions.ByPosition(streamPosition), FilterExtensions.ByStream(filter)); + } - return filter; + private static FilterDefinition CreateFilter(StreamFilter filter, long streamPosition) + { + return Filter.And(FilterExtensions.ByStream(filter), FilterExtensions.ByOffset(streamPosition)); } } diff --git a/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/MongoEventStore_Writer.cs b/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/MongoEventStore_Writer.cs index f9a490114..cfc17fe19 100644 --- a/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/MongoEventStore_Writer.cs +++ b/backend/src/Squidex.Infrastructure.MongoDb/EventSourcing/MongoEventStore_Writer.cs @@ -17,20 +17,12 @@ public partial class MongoEventStore private const int MaxWriteAttempts = 20; private static readonly BsonTimestamp EmptyTimestamp = new BsonTimestamp(0); - public Task DeleteStreamAsync(string streamName, + public Task DeleteAsync(StreamFilter filter, CancellationToken ct = default) { - Guard.NotNullOrEmpty(streamName); - - return Collection.DeleteManyAsync(x => x.EventStream == streamName, ct); - } - - public Task DeleteAsync(string streamFilter, - CancellationToken ct = default) - { - Guard.NotNullOrEmpty(streamFilter); + Guard.NotDefault(filter); - return Collection.DeleteManyAsync(FilterExtensions.ByStream(streamFilter), ct); + return Collection.DeleteManyAsync(FilterExtensions.ByStream(filter), ct); } public async Task AppendAsync(Guid commitId, string streamName, long expectedVersion, ICollection events, diff --git a/backend/src/Squidex.Infrastructure/Commands/Rebuilder.cs b/backend/src/Squidex.Infrastructure/Commands/Rebuilder.cs index efb001f67..c5fa61ad1 100644 --- a/backend/src/Squidex.Infrastructure/Commands/Rebuilder.cs +++ b/backend/src/Squidex.Infrastructure/Commands/Rebuilder.cs @@ -49,14 +49,14 @@ public class Rebuilder return domainObject; } - public virtual Task RebuildAsync(string filter, int batchSize, + public virtual Task RebuildAsync(StreamFilter filter, int batchSize, CancellationToken ct = default) where T : DomainObject where TState : class, IDomainState, new() { return RebuildAsync(filter, batchSize, 0, ct); } - public virtual async Task RebuildAsync(string filter, int batchSize, double errorThreshold, + public virtual async Task RebuildAsync(StreamFilter filter, int batchSize, double errorThreshold, CancellationToken ct = default) where T : DomainObject where TState : class, IDomainState, new() { diff --git a/backend/src/Squidex.Infrastructure/EventSourcing/IEventConsumer.cs b/backend/src/Squidex.Infrastructure/EventSourcing/IEventConsumer.cs index cc664b1f3..78331f763 100644 --- a/backend/src/Squidex.Infrastructure/EventSourcing/IEventConsumer.cs +++ b/backend/src/Squidex.Infrastructure/EventSourcing/IEventConsumer.cs @@ -13,9 +13,9 @@ public interface IEventConsumer int BatchSize => 1; - string Name { get; } + string Name => GetType().Name; - string EventsFilter => ".*"; + StreamFilter EventsFilter => default; bool StartLatest => false; diff --git a/backend/src/Squidex.Infrastructure/EventSourcing/IEventStore.cs b/backend/src/Squidex.Infrastructure/EventSourcing/IEventStore.cs index b957ec631..314f109bc 100644 --- a/backend/src/Squidex.Infrastructure/EventSourcing/IEventStore.cs +++ b/backend/src/Squidex.Infrastructure/EventSourcing/IEventStore.cs @@ -11,28 +11,25 @@ namespace Squidex.Infrastructure.EventSourcing; public interface IEventStore { - Task> QueryReverseAsync(string streamName, int take = int.MaxValue, + Task> QueryStreamReverseAsync(string streamName, int take = int.MaxValue, CancellationToken ct = default); - Task> QueryAsync(string streamName, long afterStreamPosition = EtagVersion.Empty, + Task> QueryStreamAsync(string streamName, long afterStreamPosition = EtagVersion.Empty, CancellationToken ct = default); - IAsyncEnumerable QueryAllReverseAsync(string? streamFilter = null, Instant timestamp = default, int take = int.MaxValue, + IAsyncEnumerable QueryAllReverseAsync(StreamFilter filter, Instant timestamp = default, int take = int.MaxValue, CancellationToken ct = default); - IAsyncEnumerable QueryAllAsync(string? streamFilter = null, string? position = null, int take = int.MaxValue, + IAsyncEnumerable QueryAllAsync(StreamFilter filter, string? position = null, int take = int.MaxValue, CancellationToken ct = default); Task AppendAsync(Guid commitId, string streamName, long expectedVersion, ICollection events, CancellationToken ct = default); - Task DeleteAsync(string streamFilter, + Task DeleteAsync(StreamFilter filter, CancellationToken ct = default); - Task DeleteStreamAsync(string streamName, - CancellationToken ct = default); - - IEventSubscription CreateSubscription(IEventSubscriber eventSubscriber, string? streamFilter = null, string? position = null); + IEventSubscription CreateSubscription(IEventSubscriber eventSubscriber, StreamFilter filter, string? position = null); async Task AppendUnsafeAsync(IEnumerable commits, CancellationToken ct = default) @@ -42,17 +39,4 @@ public interface IEventStore await AppendAsync(commit.Id, commit.StreamName, commit.Offset, commit.Events, ct); } } - - async Task>> QueryManyAsync(IEnumerable streamNames, - CancellationToken ct = default) - { - var result = new Dictionary>(); - - foreach (var streamName in streamNames) - { - result[streamName] = await QueryAsync(streamName, EtagVersion.Empty, ct); - } - - return result; - } } diff --git a/backend/src/Squidex.Infrastructure/EventSourcing/PollingSubscription.cs b/backend/src/Squidex.Infrastructure/EventSourcing/PollingSubscription.cs index acc12d042..e6129c5f5 100644 --- a/backend/src/Squidex.Infrastructure/EventSourcing/PollingSubscription.cs +++ b/backend/src/Squidex.Infrastructure/EventSourcing/PollingSubscription.cs @@ -17,7 +17,7 @@ public sealed class PollingSubscription : IEventSubscription public PollingSubscription( IEventStore eventStore, IEventSubscriber eventSubscriber, - string? streamFilter, + StreamFilter streamFilter, string? position) { timer = new CompletionTimer(5000, async ct => diff --git a/backend/src/Squidex.Infrastructure/EventSourcing/StreamFilter.cs b/backend/src/Squidex.Infrastructure/EventSourcing/StreamFilter.cs index 89605f3dc..4b907bc96 100644 --- a/backend/src/Squidex.Infrastructure/EventSourcing/StreamFilter.cs +++ b/backend/src/Squidex.Infrastructure/EventSourcing/StreamFilter.cs @@ -5,17 +5,38 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== -using System.Diagnostics.CodeAnalysis; +using Squidex.Infrastructure.Collections; namespace Squidex.Infrastructure.EventSourcing; -public static class StreamFilter +public readonly record struct StreamFilter { - public static bool IsAll([NotNullWhen(false)] string? filter) + public ReadonlyList? Prefixes { get; } + + public StreamFilterKind Kind { get; } + + public StreamFilter(StreamFilterKind kind, params string[] prefixes) + { + Kind = kind; + + if (prefixes.Length > 0) + { + Prefixes = prefixes.ToReadonlyList(); + } + } + + public static StreamFilter Prefix(params string[] prefixes) + { + return new StreamFilter(StreamFilterKind.MatchStart, prefixes); + } + + public static StreamFilter Name(params string[] prefixes) + { + return new StreamFilter(StreamFilterKind.MatchFull, prefixes); + } + + public static StreamFilter All() { - return string.IsNullOrWhiteSpace(filter) - || string.Equals(filter, ".*", StringComparison.OrdinalIgnoreCase) - || string.Equals(filter, "(.*)", StringComparison.OrdinalIgnoreCase) - || string.Equals(filter, "(.*?)", StringComparison.OrdinalIgnoreCase); + return default; } } diff --git a/backend/src/Squidex.Infrastructure/EventSourcing/StreamFilterKind.cs b/backend/src/Squidex.Infrastructure/EventSourcing/StreamFilterKind.cs new file mode 100644 index 000000000..f52fda22c --- /dev/null +++ b/backend/src/Squidex.Infrastructure/EventSourcing/StreamFilterKind.cs @@ -0,0 +1,14 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +namespace Squidex.Infrastructure.EventSourcing; + +public enum StreamFilterKind +{ + MatchFull, + MatchStart +} diff --git a/backend/src/Squidex.Infrastructure/States/BatchContext.cs b/backend/src/Squidex.Infrastructure/States/BatchContext.cs index 325123302..a56671dea 100644 --- a/backend/src/Squidex.Infrastructure/States/BatchContext.cs +++ b/backend/src/Squidex.Infrastructure/States/BatchContext.cs @@ -50,22 +50,27 @@ public sealed class BatchContext : IBatchContext public async Task LoadAsync(IEnumerable ids) { - var streamNames = ids.ToDictionary(x => x, x => eventStreamNames.GetStreamName(owner, x.ToString())); + var streamNames = ids.ToDictionary( + x => x, + x => eventStreamNames.GetStreamName(owner, x.ToString())); if (streamNames.Count == 0) { return; } - var streams = await eventStore.QueryManyAsync(streamNames.Values); + var eventsResults = await eventStore.QueryAllAsync(StreamFilter.Name(streamNames.Values.ToArray())).ToListAsync(); + var eventsByStream = eventsResults.ToLookup(x => x.StreamName); foreach (var (id, streamName) in streamNames) { - if (streams.TryGetValue(streamName, out var data)) + var byStream = eventsByStream[streamName].ToList(); + + if (byStream.Count > 0) { - var stream = data.Select(eventFormatter.ParseIfKnown).NotNull().ToList(); + var parsed = byStream.Select(eventFormatter.ParseIfKnown).NotNull().ToList(); - events[id] = (data.Count - 1, stream); + events[id] = (byStream.Count - 1, parsed); } else { diff --git a/backend/src/Squidex.Infrastructure/States/Persistence.cs b/backend/src/Squidex.Infrastructure/States/Persistence.cs index 8e2fcc798..6592c48e0 100644 --- a/backend/src/Squidex.Infrastructure/States/Persistence.cs +++ b/backend/src/Squidex.Infrastructure/States/Persistence.cs @@ -82,7 +82,7 @@ internal sealed class Persistence : IPersistence { using (Telemetry.Activities.StartActivity("Persistence/ReadEvents")) { - await eventStore.DeleteStreamAsync(streamName.Value, ct); + await eventStore.DeleteAsync(StreamFilter.Name(streamName.Value), ct); } versionEvents = EtagVersion.Empty; @@ -144,7 +144,7 @@ internal sealed class Persistence : IPersistence private async Task ReadEventsAsync( CancellationToken ct) { - var events = await eventStore.QueryAsync(streamName.Value, versionEvents, ct); + var events = await eventStore.QueryStreamAsync(streamName.Value, versionEvents, ct); var isStopped = false; diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/Subscriptions/SubscriptionPublisherTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/Subscriptions/SubscriptionPublisherTests.cs index 746f0e23c..7594fe0cc 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/Subscriptions/SubscriptionPublisherTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/Subscriptions/SubscriptionPublisherTests.cs @@ -29,7 +29,7 @@ public class SubscriptionPublisherTests [Fact] public void Should_return_content_and_asset_filter_for_events_filter() { - Assert.Equal("^(content-|asset-)", sut.EventsFilter); + Assert.Equal(StreamFilter.Prefix("content-", "asset-"), sut.EventsFilter); } [Fact] diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/AppEventDeleterTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/AppEventDeleterTests.cs index a00c1acc9..850f21228 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/AppEventDeleterTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/AppEventDeleterTests.cs @@ -33,7 +33,9 @@ public class AppEventDeleterTests : GivenContext { await sut.DeleteAppAsync(App, CancellationToken); - A.CallTo(() => eventStore.DeleteAsync($"^[a-zA-Z0-9]-{AppId.Id}", A._)) + var streamFilter = StreamFilter.Prefix($"[a-zA-Z0-9]-{AppId.Id}"); + + A.CallTo(() => eventStore.DeleteAsync(streamFilter, A._)) .MustNotHaveHappened(); } } diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/AppPermanentDeleterTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/AppPermanentDeleterTests.cs index 41df184f0..77a096bcc 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/AppPermanentDeleterTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/AppPermanentDeleterTests.cs @@ -29,7 +29,7 @@ public class AppPermanentDeleterTests : GivenContext [Fact] public void Should_return_assets_filter_for_events_filter() { - Assert.Equal("^app-", sut.EventsFilter); + Assert.Equal(StreamFilter.Prefix("app-"), sut.EventsFilter); } [Fact] @@ -41,7 +41,7 @@ public class AppPermanentDeleterTests : GivenContext [Fact] public void Should_return_type_name_for_name() { - Assert.Equal(nameof(AppPermanentDeleter), sut.Name); + Assert.Equal(nameof(AppPermanentDeleter), ((IEventConsumer)sut).Name); } [Fact] diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetPermanentDeleterTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetPermanentDeleterTests.cs index 9ada40d63..89e5a124c 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetPermanentDeleterTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetPermanentDeleterTests.cs @@ -27,7 +27,7 @@ public class AssetPermanentDeleterTests : GivenContext [Fact] public void Should_return_assets_filter_for_events_filter() { - Assert.Equal("^asset-", sut.EventsFilter); + Assert.Equal(StreamFilter.Prefix("asset-"), sut.EventsFilter); } [Fact] @@ -39,7 +39,7 @@ public class AssetPermanentDeleterTests : GivenContext [Fact] public void Should_return_type_name_for_name() { - Assert.Equal(nameof(AssetPermanentDeleter), sut.Name); + Assert.Equal(nameof(AssetPermanentDeleter), ((IEventConsumer)sut).Name); } [Fact] diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetUsageTrackerTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetUsageTrackerTests.cs index 4d6d5b48f..3aa8b6146 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetUsageTrackerTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/AssetUsageTrackerTests.cs @@ -35,7 +35,7 @@ public class AssetUsageTrackerTests : GivenContext [Fact] public void Should_return_assets_filter_for_events_filter() { - Assert.Equal("^asset-", sut.EventsFilter); + Assert.Equal(StreamFilter.Prefix("asset-"), sut.EventsFilter); } [Fact] @@ -47,7 +47,7 @@ public class AssetUsageTrackerTests : GivenContext [Fact] public void Should_return_type_name_for_name() { - Assert.Equal(nameof(AssetUsageTracker), sut.Name); + Assert.Equal(nameof(AssetUsageTracker), ((IEventConsumer)sut).Name); } [Fact] diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/RecursiveDeleterTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/RecursiveDeleterTests.cs index ffbd44f1a..08acb029e 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/RecursiveDeleterTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/RecursiveDeleterTests.cs @@ -33,7 +33,7 @@ public class RecursiveDeleterTests : GivenContext [Fact] public void Should_return_assets_filter_for_events_filter() { - Assert.Equal("^assetFolder-", sut.EventsFilter); + Assert.Equal(StreamFilter.Prefix("assetFolder-"), sut.EventsFilter); } [Fact] @@ -45,7 +45,7 @@ public class RecursiveDeleterTests : GivenContext [Fact] public void Should_return_type_name_for_name() { - Assert.Equal(nameof(RecursiveDeleter), sut.Name); + Assert.Equal(nameof(RecursiveDeleter), ((IEventConsumer)sut).Name); } [Fact] diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/RepairFilesTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/RepairFilesTests.cs index ba81142fd..9903f2177 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/RepairFilesTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Assets/RepairFilesTests.cs @@ -122,7 +122,9 @@ public class RepairFilesTests : GivenContext .Returns(null); } - A.CallTo(() => eventStore.QueryAllAsync("^asset\\-", null, int.MaxValue, CancellationToken)) + var streamFilter = StreamFilter.Prefix("asset-"); + + A.CallTo(() => eventStore.QueryAllAsync(streamFilter, null, int.MaxValue, CancellationToken)) .Returns(storedEvents.ToAsyncEnumerable()); } } diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Text/TextIndexerTestsBase.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Text/TextIndexerTestsBase.cs index 4cbdfefde..82f0324c5 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Text/TextIndexerTestsBase.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/Text/TextIndexerTestsBase.cs @@ -49,6 +49,12 @@ public abstract class TextIndexerTestsBase : GivenContext public abstract ITextIndex CreateIndex(); + [Fact] + public void Should_return_content_filter_for_events_filter() + { + Assert.Equal(StreamFilter.Prefix("content-"), Sut.EventsFilter); + } + [Fact] public async Task Should_search_with_fuzzy() { diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Invitation/InvitationEventConsumerTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Invitation/InvitationEventConsumerTests.cs index 0195372c7..d27aba9c6 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Invitation/InvitationEventConsumerTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Invitation/InvitationEventConsumerTests.cs @@ -9,6 +9,7 @@ using Microsoft.Extensions.Logging; using NodaTime; using Squidex.Domain.Apps.Core.TestHelpers; using Squidex.Domain.Apps.Entities.Apps; +using Squidex.Domain.Apps.Entities.Assets; using Squidex.Domain.Apps.Entities.Notifications; using Squidex.Domain.Apps.Entities.Teams; using Squidex.Domain.Apps.Entities.TestHelpers; @@ -45,6 +46,24 @@ public class InvitationEventConsumerTests : GivenContext sut = new InvitationEventConsumer(AppProvider, userNotifications, userResolver, log); } + [Fact] + public void Should_return_app_filter_for_events_filter() + { + Assert.Equal(StreamFilter.Prefix("app-"), sut.EventsFilter); + } + + [Fact] + public async Task Should_do_nothing_on_clear() + { + await ((IEventConsumer)sut).ClearAsync(); + } + + [Fact] + public void Should_return_custom_name() + { + Assert.Equal("NotificationEmailSender", sut.Name); + } + [Fact] public async Task Should_not_send_app_email_if_contributors_assigned_by_clients() { diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/RuleEnqueuerTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/RuleEnqueuerTests.cs index 947ae910b..fa738f598 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/RuleEnqueuerTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Rules/RuleEnqueuerTests.cs @@ -52,7 +52,7 @@ public class RuleEnqueuerTests : GivenContext [Fact] public void Should_return_wildcard_filter_for_events_filter() { - Assert.Equal(".*", ((IEventConsumer)sut).EventsFilter); + Assert.Equal(default, ((IEventConsumer)sut).EventsFilter); } [Fact] diff --git a/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/Consume/EventConsumerProcessorTests.cs b/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/Consume/EventConsumerProcessorTests.cs index a65a67564..9f41151c5 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/Consume/EventConsumerProcessorTests.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/Consume/EventConsumerProcessorTests.cs @@ -62,7 +62,7 @@ public class EventConsumerProcessorTests } }; - A.CallTo(() => eventStore.CreateSubscription(A>._, A._, A._)) + A.CallTo(() => eventStore.CreateSubscription(A>._, A._, A._)) .Returns(eventSubscription); A.CallTo(() => eventConsumer.Name) @@ -101,15 +101,17 @@ public class EventConsumerProcessorTests { state.Snapshot = new EventConsumerState(); + var filter = StreamFilter.Name("my-filter"); + A.CallTo(() => eventConsumer.StartLatest) .Returns(true); A.CallTo(() => eventConsumer.EventsFilter) - .Returns("my-filter"); + .Returns(filter); var latestPosition = "LATEST"; - A.CallTo(() => eventStore.QueryAllReverseAsync("my-filter", default, 1, A._)) + A.CallTo(() => eventStore.QueryAllReverseAsync(filter, default, 1, A._)) .Returns(Enumerable.Repeat(new StoredEvent("Stream", latestPosition, 1, eventData), 1).ToAsyncEnumerable()); await sut.InitializeAsync(default); @@ -129,7 +131,7 @@ public class EventConsumerProcessorTests AssertGrainState(isStopped: true, position: initialPosition); - A.CallTo(() => eventStore.CreateSubscription(A>._, A._, A._)) + A.CallTo(() => eventStore.CreateSubscription(A>._, A._, A._)) .MustNotHaveHappened(); } @@ -143,7 +145,7 @@ public class EventConsumerProcessorTests AssertGrainState(isStopped: false, position: initialPosition); - A.CallTo(() => eventStore.CreateSubscription(A>._, A._, A._)) + A.CallTo(() => eventStore.CreateSubscription(A>._, A._, A._)) .MustHaveHappenedOnceExactly(); } @@ -159,7 +161,7 @@ public class EventConsumerProcessorTests AssertGrainState(isStopped: false, position: initialPosition); - A.CallTo(() => eventStore.CreateSubscription(A>._, A._, A._)) + A.CallTo(() => eventStore.CreateSubscription(A>._, A._, A._)) .MustHaveHappenedOnceExactly(); } @@ -173,7 +175,7 @@ public class EventConsumerProcessorTests AssertGrainState(isStopped: false, position: initialPosition); - A.CallTo(() => eventStore.CreateSubscription(A>._, A._, A._)) + A.CallTo(() => eventStore.CreateSubscription(A>._, A._, A._)) .MustHaveHappenedOnceExactly(); } @@ -219,10 +221,10 @@ public class EventConsumerProcessorTests A.CallTo(() => eventSubscription.Dispose()) .MustHaveHappenedOnceExactly(); - A.CallTo(() => eventStore.CreateSubscription(A>._, A._, state.Snapshot.Position)) + A.CallTo(() => eventStore.CreateSubscription(A>._, A._, state.Snapshot.Position)) .MustHaveHappenedOnceExactly(); - A.CallTo(() => eventStore.CreateSubscription(A>._, A._, null)) + A.CallTo(() => eventStore.CreateSubscription(A>._, A._, null)) .MustHaveHappenedOnceExactly(); } @@ -530,7 +532,7 @@ public class EventConsumerProcessorTests A.CallTo(() => eventSubscription.Dispose()) .MustHaveHappenedOnceExactly(); - A.CallTo(() => eventStore.CreateSubscription(A>._, A._, A._)) + A.CallTo(() => eventStore.CreateSubscription(A>._, A._, A._)) .MustHaveHappened(2, Times.Exactly); } diff --git a/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/EventStoreTests.cs b/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/EventStoreTests.cs index 0cd4cd593..c7227f5fb 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/EventStoreTests.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/EventStoreTests.cs @@ -7,6 +7,7 @@ using System.Globalization; using System.Text.RegularExpressions; +using EventStore.Client; namespace Squidex.Infrastructure.EventSourcing; @@ -90,6 +91,7 @@ public abstract class EventStoreTests where T : IEventStore public async Task Should_append_events() { var streamName = $"test-{Guid.NewGuid()}"; + var streamFilter = StreamFilter.Name(streamName); var commit1 = new[] { @@ -107,7 +109,7 @@ public abstract class EventStoreTests where T : IEventStore await Sut.AppendAsync(Guid.NewGuid(), streamName, EtagVersion.Any, commit2); var readEvents1 = await QueryAsync(streamName); - var readEvents2 = await QueryAllAsync(streamName); + var readEvents2 = await QueryAllAsync(streamFilter); var expected = new[] { @@ -125,6 +127,7 @@ public abstract class EventStoreTests where T : IEventStore public async Task Should_append_events_unsafe() { var streamName = $"test-{Guid.NewGuid()}"; + var streamFilter = StreamFilter.Name(streamName); var commit1 = new[] { @@ -138,7 +141,7 @@ public abstract class EventStoreTests where T : IEventStore }); var readEvents1 = await QueryAsync(streamName); - var readEvents2 = await QueryAllAsync(streamName); + var readEvents2 = await QueryAllAsync(streamFilter); var expected = new[] { @@ -154,6 +157,7 @@ public abstract class EventStoreTests where T : IEventStore public async Task Should_subscribe_to_events() { var streamName = $"test-{Guid.NewGuid()}"; + var streamFilter = StreamFilter.Name(streamName); var commit1 = new[] { @@ -161,7 +165,7 @@ public abstract class EventStoreTests where T : IEventStore CreateEventData(2) }; - var readEvents = await QueryWithSubscriptionAsync(streamName, async () => + var readEvents = await QueryWithSubscriptionAsync(streamFilter, async () => { await Sut.AppendAsync(Guid.NewGuid(), streamName, EtagVersion.Any, commit1); }); @@ -179,6 +183,7 @@ public abstract class EventStoreTests where T : IEventStore public async Task Should_subscribe_to_next_events() { var streamName = $"test-{Guid.NewGuid()}"; + var streamFilter = StreamFilter.Name(streamName); var commit1 = new[] { @@ -187,7 +192,7 @@ public abstract class EventStoreTests where T : IEventStore }; // Append and read in parallel. - await QueryWithSubscriptionAsync(streamName, async () => + await QueryWithSubscriptionAsync(streamFilter, async () => { await Sut.AppendAsync(Guid.NewGuid(), streamName, EtagVersion.Any, commit1); }); @@ -199,7 +204,7 @@ public abstract class EventStoreTests where T : IEventStore }; // Append and read in parallel. - var readEventsFromPosition = await QueryWithSubscriptionAsync(streamName, async () => + var readEventsFromPosition = await QueryWithSubscriptionAsync(streamFilter, async () => { await Sut.AppendAsync(Guid.NewGuid(), streamName, EtagVersion.Any, commit2); }); @@ -210,7 +215,7 @@ public abstract class EventStoreTests where T : IEventStore new StoredEvent(streamName, "Position", 3, commit2[1]) }; - var readEventsFromBeginning = await QueryWithSubscriptionAsync(streamName, fromBeginning: true); + var readEventsFromBeginning = await QueryWithSubscriptionAsync(streamFilter, fromBeginning: true); var expectedFromBeginning = new[] { @@ -228,12 +233,13 @@ public abstract class EventStoreTests where T : IEventStore public async Task Should_subscribe_with_parallel_writes() { var streamName = $"test-{Guid.NewGuid()}"; + var streamFilter = StreamFilter.Prefix(streamName); var numTasks = 50; var numEvents = 100; // Append and read in parallel. - var readEvents = await QueryWithSubscriptionAsync($"^{streamName}", async () => + var readEvents = await QueryWithSubscriptionAsync(streamFilter, async () => { await Parallel.ForEachAsync(Enumerable.Range(0, numTasks), async (i, ct) => { @@ -277,7 +283,7 @@ public abstract class EventStoreTests where T : IEventStore await Sut.AppendAsync(Guid.NewGuid(), streamName1, EtagVersion.Any, stream1Commit); await Sut.AppendAsync(Guid.NewGuid(), streamName2, EtagVersion.Any, stream2Commit); - var readEvents = await Sut.QueryManyAsync(new[] { streamName1, streamName2 }); + var readEvents = await Sut.QueryAllAsync(StreamFilter.Name(streamName1, streamName2)).ToListAsync(); var expected1 = new[] { @@ -291,8 +297,8 @@ public abstract class EventStoreTests where T : IEventStore new StoredEvent(streamName2, "Position", 1, stream2Commit[1]) }; - ShouldBeEquivalentTo(readEvents[streamName1], expected1); - ShouldBeEquivalentTo(readEvents[streamName2], expected2); + ShouldBeEquivalentTo(readEvents.Where(x => x.StreamName == streamName1), expected1); + ShouldBeEquivalentTo(readEvents.Where(x => x.StreamName == streamName2), expected2); } [Theory] @@ -300,7 +306,7 @@ public abstract class EventStoreTests where T : IEventStore [InlineData(5, 30)] [InlineData(5, 300)] [InlineData(5, 3000)] - public async Task Should_read_events_from_offset(int commits, int count) + public async Task Should_query_events_from_offset(int commits, int count) { var streamName = $"test-{Guid.NewGuid()}"; @@ -308,7 +314,7 @@ public abstract class EventStoreTests where T : IEventStore var readEvents0 = await QueryAsync(streamName); var readEvents1 = await QueryAsync(streamName, count - 2); - var readEvents2 = await QueryAllAsync(streamName, readEvents0[^2].EventPosition); + var readEvents2 = await QueryAllAsync(default, readEvents0[^2].EventPosition); var expected = new[] { @@ -322,7 +328,7 @@ public abstract class EventStoreTests where T : IEventStore [Theory] [InlineData(5, 30)] [InlineData(5, 300)] - public async Task Should_read_reverse(int commits, int count) + public async Task Should_query_reverse(int commits, int count) { var streamName = $"test-{Guid.NewGuid()}"; @@ -332,7 +338,7 @@ public abstract class EventStoreTests where T : IEventStore for (var take = 0; take < count; take += count / 10) { var eventsExpected = eventsStored.TakeLast(take).ToArray(); - var eventsQueried = await Sut.QueryReverseAsync(streamName, take); + var eventsQueried = await Sut.QueryStreamReverseAsync(streamName, take); ShouldBeEquivalentTo(eventsQueried, eventsExpected); } @@ -342,10 +348,10 @@ public abstract class EventStoreTests where T : IEventStore [InlineData(5, 30)] [InlineData(5, 300)] [InlineData(5, 3000)] - public async Task Should_read_all_reverse_by_name(int commits, int count) + public async Task Should_query_all_reverse_by_names(int commits, int count) { var streamName = $"test-{Guid.NewGuid()}"; - var streamFilter = streamName; + var streamFilter = StreamFilter.Name(streamName, "invalid"); var eventsWritten = await AppendEventsAsync(streamName, count, commits); var eventsStored = eventsWritten.Select((x, i) => new StoredEvent(streamName, "Position", i, x)).ToArray(); @@ -353,7 +359,7 @@ public abstract class EventStoreTests where T : IEventStore for (var take = 0; take < count; take += count / 10) { var eventsExpected = eventsStored.Reverse().Take(take).ToArray(); - var eventsQueried = await Sut.QueryAllReverseAsync(streamName, default, take).ToArrayAsync(); + var eventsQueried = await Sut.QueryAllReverseAsync(streamFilter, default, take).ToArrayAsync(); ShouldBeEquivalentTo(eventsQueried, eventsExpected); } @@ -363,10 +369,10 @@ public abstract class EventStoreTests where T : IEventStore [InlineData(5, 30)] [InlineData(5, 300)] [InlineData(5, 3000)] - public async Task Should_read_all_reverse_by_filter(int commits, int count) + public async Task Should_query_all_reverse_by_filter(int commits, int count) { var streamName = $"test-{Guid.NewGuid()}-suffix"; - var streamFilter = $"^{Regex.Escape(streamName)}"; + var streamFilter = StreamFilter.Prefix(streamName[..^7], "invalid"); var eventsWritten = await AppendEventsAsync(streamName, count, commits); var eventsStored = eventsWritten.Select((x, i) => new StoredEvent(streamName, "Position", i, x)).ToArray(); @@ -387,7 +393,7 @@ public abstract class EventStoreTests where T : IEventStore public async Task Should_read_all_reverse(int commits, int count) { var streamName = $"test-{Guid.NewGuid()}-suffix"; - var streamFilter = ".*"; + var streamFilter = default(StreamFilter); await AppendEventsAsync(streamName, count, commits); @@ -403,6 +409,7 @@ public abstract class EventStoreTests where T : IEventStore public async Task Should_delete_by_filter() { var streamName = $"test-{Guid.NewGuid()}"; + var streamFilter = StreamFilter.Prefix($"{streamName[..10]}"); await AppendEventsAsync(streamName, 2, 1); @@ -410,7 +417,7 @@ public abstract class EventStoreTests where T : IEventStore for (var i = 0; i < 5; i++) { - await Sut.DeleteAsync($"^{streamName[..10]}"); + await Sut.DeleteAsync(streamFilter); readEvents = await QueryAsync(streamName); @@ -427,9 +434,10 @@ public abstract class EventStoreTests where T : IEventStore } [Fact] - public async Task Should_delete_stream() + public async Task Should_delete_by_name() { var streamName = $"test-{Guid.NewGuid()}"; + var streamFilter = StreamFilter.Name(streamName); await AppendEventsAsync(streamName, 2, 1); @@ -437,7 +445,7 @@ public abstract class EventStoreTests where T : IEventStore for (var i = 0; i < 5; i++) { - await Sut.DeleteStreamAsync(streamName); + await Sut.DeleteAsync(streamFilter); readEvents = await QueryAsync(streamName); @@ -455,12 +463,12 @@ public abstract class EventStoreTests where T : IEventStore private async Task> QueryAsync(string streamName, long position = EtagVersion.Any) { - return await Sut.QueryAsync(streamName, position); + return await Sut.QueryStreamAsync(streamName, position); } - private async Task?> QueryAllAsync(string? streamFilter = null, string? position = null) + private async Task?> QueryAllAsync(StreamFilter filter, string? position = null) { - return await Sut.QueryAllAsync(streamFilter, position).ToListAsync(); + return await Sut.QueryAllAsync(filter, position).ToListAsync(); } private static EventData CreateEventData(int i) @@ -473,7 +481,7 @@ public abstract class EventStoreTests where T : IEventStore return new EventData($"Type{i}", headers, i.ToString(CultureInfo.InvariantCulture)); } - private async Task?> QueryWithSubscriptionAsync(string streamFilter, + private async Task?> QueryWithSubscriptionAsync(StreamFilter streamFilter, Func? subscriptionRunning = null, bool fromBeginning = false) { var subscriber = new EventSubscriber(); diff --git a/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/MongoEventStoreTests.cs b/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/MongoEventStoreTests.cs index 4f18b632d..ec5b5270e 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/MongoEventStoreTests.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/MongoEventStoreTests.cs @@ -41,9 +41,8 @@ public abstract class MongoEventStoreTests : EventStoreTests, I Assert.All(queries, query => { - Assert.Equal(query.NumDocuments, query.DocsExamined); - Assert.True(query.KeysExamined >= query.NumDocuments); - Assert.True(query.KeysExamined <= query.NumDocuments * 2); + Assert.InRange(query.DocsExamined, 0, query.NumDocuments); + Assert.InRange(query.KeysExamined, query.NumDocuments, (Math.Max(1, query.NumDocuments) * 2) + 1); }); } } diff --git a/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/MongoParallelInsertTests.cs b/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/MongoParallelInsertTests.cs index 999319152..b72f177fa 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/MongoParallelInsertTests.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/MongoParallelInsertTests.cs @@ -38,7 +38,7 @@ public sealed class MongoParallelInsertTests : IClassFixture $"^{Name}"; + public StreamFilter EventsFilter => StreamFilter.Prefix(Name); public Task Completed => tcs.Task; diff --git a/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/PollingSubscriptionTests.cs b/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/PollingSubscriptionTests.cs index 013ecc5ac..c5f65e29d 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/PollingSubscriptionTests.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/PollingSubscriptionTests.cs @@ -13,8 +13,8 @@ public class PollingSubscriptionTests { private readonly IEventStore eventStore = A.Fake(); private readonly IEventSubscriber eventSubscriber = A.Fake>(); + private readonly StreamFilter filter = StreamFilter.Name("my-stream"); private readonly string position = Guid.NewGuid().ToString(); - private readonly string filter = "^my-stream"; [Fact] public async Task Should_subscribe_on_start() diff --git a/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/RetrySubscriptionTests.cs b/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/RetrySubscriptionTests.cs index 9118f2dbf..8317e4513 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/RetrySubscriptionTests.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/RetrySubscriptionTests.cs @@ -17,10 +17,10 @@ public class RetrySubscriptionTests public RetrySubscriptionTests() { - A.CallTo(() => eventStore.CreateSubscription(A>._, A._, A._)) + A.CallTo(() => eventStore.CreateSubscription(A>._, A._, A._)) .Returns(eventSubscription); - sut = new RetrySubscription(eventSubscriber, s => eventStore.CreateSubscription(s)) { ReconnectWaitMs = 50 }; + sut = new RetrySubscription(eventSubscriber, s => eventStore.CreateSubscription(s, default)) { ReconnectWaitMs = 50 }; sutSubscriber = sut; } @@ -29,7 +29,7 @@ public class RetrySubscriptionTests { sut.Dispose(); - A.CallTo(() => eventStore.CreateSubscription(sut, A._, A._)) + A.CallTo(() => eventStore.CreateSubscription(sut, A._, A._)) .MustHaveHappened(); } @@ -47,7 +47,7 @@ public class RetrySubscriptionTests A.CallTo(() => eventSubscription.Dispose()) .MustHaveHappened(2, Times.Exactly); - A.CallTo(() => eventStore.CreateSubscription(A>._, A._, A._)) + A.CallTo(() => eventStore.CreateSubscription(A>._, A._, A._)) .MustHaveHappened(2, Times.Exactly); A.CallTo(() => eventSubscriber.OnErrorAsync(eventSubscription, A._)) diff --git a/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/StreamFilterTests.cs b/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/StreamFilterTests.cs new file mode 100644 index 000000000..45c310c63 --- /dev/null +++ b/backend/tests/Squidex.Infrastructure.Tests/EventSourcing/StreamFilterTests.cs @@ -0,0 +1,27 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +namespace Squidex.Infrastructure.EventSourcing; + +public class StreamFilterTests +{ + [Fact] + public void Should_simplify_input_to_default_filter() + { + var sut = new StreamFilter(StreamFilterKind.MatchFull); + + Assert.Equal(default, sut); + } + + [Fact] + public void Should_simplify_input_to_default_filter_with_factory() + { + var sut = StreamFilter.Name(); + + Assert.Equal(default, sut); + } +} diff --git a/backend/tests/Squidex.Infrastructure.Tests/States/PersistenceBatchTests.cs b/backend/tests/Squidex.Infrastructure.Tests/States/PersistenceBatchTests.cs index bbebf7178..1e2b24b2c 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/States/PersistenceBatchTests.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/States/PersistenceBatchTests.cs @@ -185,12 +185,10 @@ public class PersistenceBatchTests private void SetupEventStore(Dictionary> streams) { - var storedStreams = new Dictionary>(); + var events = new List(); foreach (var (id, stream) in streams) { - var storedStream = new List(); - var i = 0; foreach (var @event in stream) @@ -198,23 +196,20 @@ public class PersistenceBatchTests var eventData = new EventData("Type", new EnvelopeHeaders(), "Payload"); var eventStored = new StoredEvent(id.ToString(), i.ToString(CultureInfo.InvariantCulture), i, eventData); - storedStream.Add(eventStored); - A.CallTo(() => eventFormatter.Parse(eventStored)) .Returns(new Envelope(@event)); A.CallTo(() => eventFormatter.ParseIfKnown(eventStored)) .Returns(new Envelope(@event)); + events.Add(eventStored); i++; } - - storedStreams[id.ToString()] = storedStream; } - var streamNames = streams.Keys.Select(x => x.ToString()).ToArray(); + var filter = StreamFilter.Name(streams.Keys.Select(x => x.ToString()).ToArray()); - A.CallTo(() => eventStore.QueryManyAsync(A>.That.IsSameSequenceAs(streamNames), A._)) - .Returns(storedStreams); + A.CallTo(() => eventStore.QueryAllAsync(filter, null, int.MaxValue, A._)) + .Returns(events.ToAsyncEnumerable()); } } diff --git a/backend/tests/Squidex.Infrastructure.Tests/States/PersistenceEventSourcingTests.cs b/backend/tests/Squidex.Infrastructure.Tests/States/PersistenceEventSourcingTests.cs index 02761c9e6..f640b0349 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/States/PersistenceEventSourcingTests.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/States/PersistenceEventSourcingTests.cs @@ -65,7 +65,7 @@ public class PersistenceEventSourcingTests { var storedEvent = new StoredEvent("1", "1", 0, new EventData("Type", new EnvelopeHeaders(), "Payload")); - A.CallTo(() => eventStore.QueryAsync(key.ToString(), -1, A._)) + A.CallTo(() => eventStore.QueryStreamAsync(key.ToString(), -1, A._)) .Returns(new List { storedEvent }); A.CallTo(() => eventFormatter.ParseIfKnown(storedEvent)) @@ -96,7 +96,7 @@ public class PersistenceEventSourcingTests Assert.False(persistence.IsSnapshotStale); - A.CallTo(() => eventStore.QueryAsync(key.ToString(), 2, A._)) + A.CallTo(() => eventStore.QueryStreamAsync(key.ToString(), 2, A._)) .MustHaveHappened(); } @@ -116,7 +116,7 @@ public class PersistenceEventSourcingTests Assert.True(persistence.IsSnapshotStale); - A.CallTo(() => eventStore.QueryAsync(key.ToString(), 1, A._)) + A.CallTo(() => eventStore.QueryStreamAsync(key.ToString(), 1, A._)) .MustHaveHappened(); } @@ -327,7 +327,7 @@ public class PersistenceEventSourcingTests await persistence.DeleteAsync(); - A.CallTo(() => eventStore.DeleteStreamAsync(key.ToString(), A._)) + A.CallTo(() => eventStore.DeleteAsync(StreamFilter.Name(key.ToString()), A._)) .MustHaveHappened(); A.CallTo(() => snapshotStore.RemoveAsync(key, A._)) @@ -341,7 +341,7 @@ public class PersistenceEventSourcingTests await persistence.DeleteAsync(); - A.CallTo(() => eventStore.DeleteStreamAsync(key.ToString(), A._)) + A.CallTo(() => eventStore.DeleteAsync(StreamFilter.Name(key.ToString()), A._)) .MustHaveHappened(); A.CallTo(() => snapshotStore.RemoveAsync(key, A._)) @@ -382,7 +382,7 @@ public class PersistenceEventSourcingTests i++; } - A.CallTo(() => eventStore.QueryAsync(key.ToString(), readPosition, A._)) + A.CallTo(() => eventStore.QueryStreamAsync(key.ToString(), readPosition, A._)) .Returns(eventsStored); } } diff --git a/backend/tests/Squidex.Infrastructure.Tests/States/PersistenceSnapshotTests.cs b/backend/tests/Squidex.Infrastructure.Tests/States/PersistenceSnapshotTests.cs index 64e634bfe..f77683b88 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/States/PersistenceSnapshotTests.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/States/PersistenceSnapshotTests.cs @@ -162,7 +162,7 @@ public class PersistenceSnapshotTests await persistence.DeleteAsync(); - A.CallTo(() => eventStore.DeleteStreamAsync(A._, A._)) + A.CallTo(() => eventStore.DeleteAsync(A._, A._)) .MustNotHaveHappened(); A.CallTo(() => snapshotStore.RemoveAsync(key, A._)) From 43c207b4432fefed19d944fa72b3cedfe9d34b1b Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 10 Oct 2023 15:10:01 +0200 Subject: [PATCH 24/35] Show AI button based on settings. --- ...Squidex.Domain.Apps.Core.Operations.csproj | 2 +- .../Squidex.Domain.Apps.Entities.csproj | 2 +- .../Squidex.Infrastructure.csproj | 12 ++-- .../Frontend/Middlewares/IndexExtensions.cs | 20 +------ .../Squidex/Config/Domain/FontendServices.cs | 58 +++++++++++++++++++ backend/src/Squidex/Squidex.csproj | 22 +++---- backend/src/Squidex/Startup.cs | 1 + .../apps/pages/apps-page.component.ts | 6 +- .../editor/content-field.component.html | 8 ++- .../content/editor/content-field.component.ts | 9 ++- .../pages/schemas/schemas-page.component.ts | 7 +-- .../shared/forms/array-editor.component.html | 4 +- .../shared/forms/array-editor.component.ts | 3 + .../shared/forms/array-item.component.html | 1 + .../shared/forms/array-item.component.ts | 3 + .../forms/component-section.component.html | 1 + .../forms/component-section.component.ts | 3 + .../shared/forms/component.component.html | 1 + .../shared/forms/component.component.ts | 3 + .../shared/forms/field-editor.component.html | 5 +- .../shared/forms/field-editor.component.ts | 3 + .../references-checkboxes.component.ts | 8 +-- .../editors/date-time-editor.component.ts | 11 ++-- frontend/src/app/framework/configurations.ts | 22 ------- .../forms/geolocation-editor.component.ts | 28 +++++---- .../app/shared/components/notifo.component.ts | 7 +-- .../guards/must-be-authenticated.guard.ts | 9 ++- .../guards/must-be-not-authenticated.guard.ts | 7 ++- frontend/src/app/shared/state/resolvers.ts | 7 +-- frontend/src/app/shared/state/tour.state.ts | 9 +-- .../shell/pages/home/home-page.component.ts | 7 ++- .../pages/internal/feedback-menu.component.ts | 9 +-- .../pages/internal/internal-area.component.ts | 8 +-- .../internal/notifications-menu.component.ts | 2 +- .../pages/internal/profile-menu.component.ts | 8 +-- 35 files changed, 172 insertions(+), 144 deletions(-) create mode 100644 backend/src/Squidex/Config/Domain/FontendServices.cs diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/Squidex.Domain.Apps.Core.Operations.csproj b/backend/src/Squidex.Domain.Apps.Core.Operations/Squidex.Domain.Apps.Core.Operations.csproj index 67d7597f5..0ecc9f021 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/Squidex.Domain.Apps.Core.Operations.csproj +++ b/backend/src/Squidex.Domain.Apps.Core.Operations/Squidex.Domain.Apps.Core.Operations.csproj @@ -28,7 +28,7 @@ - + diff --git a/backend/src/Squidex.Domain.Apps.Entities/Squidex.Domain.Apps.Entities.csproj b/backend/src/Squidex.Domain.Apps.Entities/Squidex.Domain.Apps.Entities.csproj index 3219d7b43..d1e5d1318 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Squidex.Domain.Apps.Entities.csproj +++ b/backend/src/Squidex.Domain.Apps.Entities/Squidex.Domain.Apps.Entities.csproj @@ -29,7 +29,7 @@ - + diff --git a/backend/src/Squidex.Infrastructure/Squidex.Infrastructure.csproj b/backend/src/Squidex.Infrastructure/Squidex.Infrastructure.csproj index ba3d1b7c9..029014e54 100644 --- a/backend/src/Squidex.Infrastructure/Squidex.Infrastructure.csproj +++ b/backend/src/Squidex.Infrastructure/Squidex.Infrastructure.csproj @@ -24,12 +24,12 @@ - - - - - - + + + + + + diff --git a/backend/src/Squidex/Areas/Frontend/Middlewares/IndexExtensions.cs b/backend/src/Squidex/Areas/Frontend/Middlewares/IndexExtensions.cs index e4acf17f2..81584e7e0 100644 --- a/backend/src/Squidex/Areas/Frontend/Middlewares/IndexExtensions.cs +++ b/backend/src/Squidex/Areas/Frontend/Middlewares/IndexExtensions.cs @@ -10,8 +10,6 @@ using System.Globalization; using System.Text.Json; using Microsoft.Extensions.Options; using Squidex.Areas.Api.Controllers.UI; -using Squidex.Domain.Apps.Entities.History; -using Squidex.Web; namespace Squidex.Areas.Frontend.Middlewares; @@ -39,28 +37,12 @@ public static class IndexExtensions { var clonedOptions = uiOptions with { - More = new Dictionary + More = new Dictionary(uiOptions.More) { ["culture"] = CultureInfo.CurrentUICulture.Name } }; - var jsonOptions = httpContext.RequestServices.GetRequiredService(); - - using var jsonDocument = JsonSerializer.SerializeToDocument(uiOptions, jsonOptions); - - if (httpContext.RequestServices.GetService() is ExposedValues values) - { - clonedOptions.More["info"] = values.ToString(); - } - - var notifo = httpContext.RequestServices!.GetService>()?.Value; - - if (notifo?.IsConfigured() == true) - { - clonedOptions.More["notifoApi"] = notifo.ApiUrl; - } - var options = httpContext.Features.Get(); if (options != null) diff --git a/backend/src/Squidex/Config/Domain/FontendServices.cs b/backend/src/Squidex/Config/Domain/FontendServices.cs new file mode 100644 index 000000000..b16ec298c --- /dev/null +++ b/backend/src/Squidex/Config/Domain/FontendServices.cs @@ -0,0 +1,58 @@ +// ========================================================================== +// Squidex Headless CMS +// ========================================================================== +// Copyright (c) Squidex UG (haftungsbeschraenkt) +// All rights reserved. Licensed under the MIT license. +// ========================================================================== + +using System.Text.Json; +using Microsoft.Extensions.Options; +using Squidex.Areas.Api.Controllers.UI; +using Squidex.Domain.Apps.Entities.History; +using Squidex.Text.ChatBots; +using Squidex.Text.Translations; +using Squidex.Web; + +namespace Squidex.Config.Domain; + +public static class FontendServices +{ + public static void AddSquidexFrontend(this IServiceCollection services) + { + services.Configure((services, options) => + { + var jsonOptions = services.GetRequiredService(); + + using var jsonDocument = JsonSerializer.SerializeToDocument(options, jsonOptions); + + if (services.GetService() is ExposedValues values) + { + options.More["info"] = values.ToString(); + } + }); + + services.Configure((services, options) => + { + var notifo = services.GetRequiredService>().Value; + + if (notifo.IsConfigured()) + { + options.More["notifoApi"] = notifo.ApiUrl; + } + }); + + services.Configure((services, options) => + { + var translator = services.GetRequiredService(); + + options.More["canUseTranslator"] = translator.IsConfigured; + }); + + services.Configure((services, options) => + { + var chatBot = services.GetRequiredService(); + + options.More["canUseChatBot"] = chatBot.IsConfigured; + }); + } +} diff --git a/backend/src/Squidex/Squidex.csproj b/backend/src/Squidex/Squidex.csproj index 539b94402..be86b8a1a 100644 --- a/backend/src/Squidex/Squidex.csproj +++ b/backend/src/Squidex/Squidex.csproj @@ -62,18 +62,18 @@ - - - - - - - - + + + + + + + + - - - + + + diff --git a/backend/src/Squidex/Startup.cs b/backend/src/Squidex/Startup.cs index 0edaf078d..0ed289b9c 100644 --- a/backend/src/Squidex/Startup.cs +++ b/backend/src/Squidex/Startup.cs @@ -50,6 +50,7 @@ public sealed class Startup services.AddSquidexContents(config); services.AddSquidexControllerServices(config); services.AddSquidexEventSourcing(config); + services.AddSquidexFrontend(); services.AddSquidexGraphQL(); services.AddSquidexHealthChecks(config); services.AddSquidexHistory(config); diff --git a/frontend/src/app/features/apps/pages/apps-page.component.ts b/frontend/src/app/features/apps/pages/apps-page.component.ts index 846c8ddad..6ded4e811 100644 --- a/frontend/src/app/features/apps/pages/apps-page.component.ts +++ b/frontend/src/app/features/apps/pages/apps-page.component.ts @@ -68,8 +68,8 @@ export class AppsPageComponent implements OnInit { private readonly tourState: TourState, private readonly uiOptions: UIOptions, ) { - if (uiOptions.get('showInfo')) { - this.info = uiOptions.get('info'); + if (uiOptions.value.showInfo) { + this.info = uiOptions.value.info; } } @@ -87,7 +87,7 @@ export class AppsPageComponent implements OnInit { this.tourState.complete(); } - if (!this.uiOptions.get('hideNews')) { + if (!this.uiOptions.value.hideNews) { const newsVersion = this.localStore.getInt(Settings.Local.NEWS_VERSION); this.newsService.getFeatures(newsVersion) diff --git a/frontend/src/app/features/content/pages/content/editor/content-field.component.html b/frontend/src/app/features/content/pages/content/editor/content-field.component.html index 15d826b50..83a39b3ac 100644 --- a/frontend/src/app/features/content/pages/content/editor/content-field.component.html +++ b/frontend/src/app/features/content/pages/content/editor/content-field.component.html @@ -15,7 +15,7 @@ -
@@ -32,6 +32,7 @@ [formLevel]="formLevel" [formModel]="formModel.get(language)" [isComparing]="!!formModelCompare" + [hasChatBot]="hasChatBot" [language]="language" [languages]="languages"> @@ -46,6 +47,7 @@ [formLevel]="formLevel" [formModel]="getControl()" [isComparing]="!!formModelCompare" + [hasChatBot]="hasChatBot" [language]="language" [languages]="languages"> @@ -85,6 +87,7 @@ [formLevel]="formLevel" [formModel]="formModelCompare.get(language)" [isComparing]="!!formModelCompare" + [hasChatBot]="hasChatBot" [language]="language" [languages]="languages"> @@ -99,7 +102,8 @@ [formModel]="getControlCompare()!" [language]="language" [languages]="languages" - [isComparing]="!!formModelCompare"> + [isComparing]="!!formModelCompare" + [hasChatBot]="hasChatBot"> diff --git a/frontend/src/app/features/content/pages/content/editor/content-field.component.ts b/frontend/src/app/features/content/pages/content/editor/content-field.component.ts index ad3f7d66c..de4754e9e 100644 --- a/frontend/src/app/features/content/pages/content/editor/content-field.component.ts +++ b/frontend/src/app/features/content/pages/content/editor/content-field.component.ts @@ -5,9 +5,9 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { booleanAttribute, Component, EventEmitter, HostBinding, Input, numberAttribute, Output } from '@angular/core'; +import { booleanAttribute, Component, EventEmitter, HostBinding, inject, Input, numberAttribute, Output } from '@angular/core'; import { Observable } from 'rxjs'; -import { AppLanguageDto, AppsState, changed$, disabled$, EditContentForm, FieldForm, invalid$, LocalStoreService, SchemaDto, Settings, TranslationsService, TypedSimpleChanges } from '@app/shared'; +import { AppLanguageDto, AppsState, changed$, disabled$, EditContentForm, FieldForm, invalid$, LocalStoreService, SchemaDto, Settings, TranslationsService, TypedSimpleChanges, UIOptions } from '@app/shared'; @Component({ selector: 'sqx-content-field', @@ -54,6 +54,9 @@ export class ContentFieldComponent { public isInvalid?: Observable; public isDisabled?: Observable; + public readonly hasTranslator = inject(UIOptions).value.canUseTranslator; + public readonly hasChatBot = inject(UIOptions).value.canUseChatBot; + @HostBinding('class') public get class() { return this.isHalfWidth ? 'col-6 half-field' : 'col-12'; @@ -64,7 +67,7 @@ export class ContentFieldComponent { } public get isTranslatable() { - return this.formModel.field.properties.fieldType === 'String' && this.formModel.field.isLocalizable && this.languages.length > 1; + return this.formModel.field.properties.fieldType === 'String' && this.hasTranslator && this.formModel.field.isLocalizable && this.languages.length > 1; } constructor( diff --git a/frontend/src/app/features/content/pages/schemas/schemas-page.component.ts b/frontend/src/app/features/content/pages/schemas/schemas-page.component.ts index f9da7f160..7b1502e17 100644 --- a/frontend/src/app/features/content/pages/schemas/schemas-page.component.ts +++ b/frontend/src/app/features/content/pages/schemas/schemas-page.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component } from '@angular/core'; +import { Component, inject } from '@angular/core'; import { UntypedFormControl } from '@angular/forms'; import { combineLatest } from 'rxjs'; import { map } from 'rxjs/operators'; @@ -19,7 +19,7 @@ import { AppsState, getCategoryTree, SchemaCategory, SchemasState, Settings, UIO export class SchemasPageComponent { public schemasFilter = new UntypedFormControl(); - public isEmbedded = false; + public readonly isEmbedded = inject(UIOptions).value.embedded; public schemas = this.schemasState.schemas.pipe( @@ -43,11 +43,10 @@ export class SchemasPageComponent { return getCategoryTree(schemas, categories, filter); }); - constructor(uiOptions: UIOptions, + constructor( public readonly schemasState: SchemasState, private readonly appsState: AppsState, ) { - this.isEmbedded = uiOptions.get('embedded'); } public trackByCategory(_index: number, category: SchemaCategory) { diff --git a/frontend/src/app/features/content/shared/forms/array-editor.component.html b/frontend/src/app/features/content/shared/forms/array-editor.component.html index efc4373a0..6318bd658 100644 --- a/frontend/src/app/features/content/shared/forms/array-editor.component.html +++ b/frontend/src/app/features/content/shared/forms/array-editor.component.html @@ -24,7 +24,8 @@ [isFirst]="isFirst" [isLast]="isLast" (itemRemove)="removeItem(i)" - (itemMove)="move(itemForm, $event)" + (itemMove)="move(itemForm, $event)" + [hasChatBot]="hasChatBot" [language]="language" [languages]="languages"> @@ -53,6 +54,7 @@ (itemExpanded)="scroll.invalidateCachedMeasurementAtIndex(scroll.viewPortInfo.startIndexWithBuffer + i)" (itemRemove)="removeItem(scroll.viewPortInfo.startIndexWithBuffer + i)" (itemMove)="move(itemForm, $event)" + [hasChatBot]="hasChatBot" [language]="language" [languages]="languages"> diff --git a/frontend/src/app/features/content/shared/forms/array-editor.component.ts b/frontend/src/app/features/content/shared/forms/array-editor.component.ts index 9ead4f4fc..5272f2edc 100644 --- a/frontend/src/app/features/content/shared/forms/array-editor.component.ts +++ b/frontend/src/app/features/content/shared/forms/array-editor.component.ts @@ -20,6 +20,9 @@ import { ArrayItemComponent } from './array-item.component'; changeDetection: ChangeDetectionStrategy.OnPush, }) export class ArrayEditorComponent { + @Input({ required: true }) + public hasChatBot!: boolean; + @Input({ required: true }) public form!: EditContentForm; diff --git a/frontend/src/app/features/content/shared/forms/array-item.component.html b/frontend/src/app/features/content/shared/forms/array-item.component.html index 0819c0f71..2b9aa3dc1 100644 --- a/frontend/src/app/features/content/shared/forms/array-item.component.html +++ b/frontend/src/app/features/content/shared/forms/array-item.component.html @@ -52,6 +52,7 @@ [formSection]="$any(section)" [index]="index" [isComparing]="isComparing" + [hasChatBot]="hasChatBot" [language]="language" [languages]="languages"> diff --git a/frontend/src/app/features/content/shared/forms/array-item.component.ts b/frontend/src/app/features/content/shared/forms/array-item.component.ts index 1ae46d1e5..2043fcee1 100644 --- a/frontend/src/app/features/content/shared/forms/array-item.component.ts +++ b/frontend/src/app/features/content/shared/forms/array-item.component.ts @@ -30,6 +30,9 @@ export class ArrayItemComponent { @Output() public clone = new EventEmitter(); + @Input({ required: true }) + public hasChatBot!: boolean; + @Input({ required: true }) public form!: EditContentForm; diff --git a/frontend/src/app/features/content/shared/forms/component-section.component.html b/frontend/src/app/features/content/shared/forms/component-section.component.html index 3294d60ae..59ddb4209 100644 --- a/frontend/src/app/features/content/shared/forms/component-section.component.html +++ b/frontend/src/app/features/content/shared/forms/component-section.component.html @@ -19,6 +19,7 @@ [formModel]="child" [index]="index" [isComparing]="isComparing" + [hasChatBot]="hasChatBot" [language]="language" [languages]="languages"> diff --git a/frontend/src/app/features/content/shared/forms/component-section.component.ts b/frontend/src/app/features/content/shared/forms/component-section.component.ts index 005088dc7..4089067a7 100644 --- a/frontend/src/app/features/content/shared/forms/component-section.component.ts +++ b/frontend/src/app/features/content/shared/forms/component-section.component.ts @@ -16,6 +16,9 @@ import { FieldEditorComponent } from './field-editor.component'; changeDetection: ChangeDetectionStrategy.OnPush, }) export class ComponentSectionComponent { + @Input({ required: true }) + public hasChatBot!: boolean; + @Input({ required: true }) public form!: EditContentForm; diff --git a/frontend/src/app/features/content/shared/forms/component.component.html b/frontend/src/app/features/content/shared/forms/component.component.html index f8ad865cd..a7cf481cf 100644 --- a/frontend/src/app/features/content/shared/forms/component.component.html +++ b/frontend/src/app/features/content/shared/forms/component.component.html @@ -12,6 +12,7 @@ [formLevel]="formLevel + 1" [formSection]="$any(section)" [isComparing]="isComparing" + [hasChatBot]="hasChatBot" [language]="language" [languages]="languages"> diff --git a/frontend/src/app/features/content/shared/forms/component.component.ts b/frontend/src/app/features/content/shared/forms/component.component.ts index 2418e281b..57b7e13d1 100644 --- a/frontend/src/app/features/content/shared/forms/component.component.ts +++ b/frontend/src/app/features/content/shared/forms/component.component.ts @@ -17,6 +17,9 @@ import { ComponentSectionComponent } from './component-section.component'; changeDetection: ChangeDetectionStrategy.OnPush, }) export class ComponentComponent extends ResourceOwner { + @Input({ required: true }) + public hasChatBot!: boolean; + @Input({ transform: booleanAttribute }) public canUnset?: boolean | null; diff --git a/frontend/src/app/features/content/shared/forms/field-editor.component.html b/frontend/src/app/features/content/shared/forms/field-editor.component.html index c6031418d..859b9b264 100644 --- a/frontend/src/app/features/content/shared/forms/field-editor.component.html +++ b/frontend/src/app/features/content/shared/forms/field-editor.component.html @@ -1,7 +1,7 @@
- @@ -54,6 +54,7 @@ [formContext]="formContext" [isComparing]="isComparing" [isExpanded]="isExpanded" + [hasChatBot]="hasChatBot" [language]="language" [languages]="languages"> @@ -82,6 +83,7 @@ [formLevel]="formLevel" [formModel]="$any(formModel)" [isComparing]="isComparing" + [hasChatBot]="hasChatBot" [language]="language" [languages]="languages"> @@ -95,6 +97,7 @@ [formContext]="formContext" [isComparing]="isComparing" [isExpanded]="isExpanded" + [hasChatBot]="hasChatBot" [language]="language" [languages]="languages"> diff --git a/frontend/src/app/features/content/shared/forms/field-editor.component.ts b/frontend/src/app/features/content/shared/forms/field-editor.component.ts index 36cc8f023..4d76f75b0 100644 --- a/frontend/src/app/features/content/shared/forms/field-editor.component.ts +++ b/frontend/src/app/features/content/shared/forms/field-editor.component.ts @@ -21,6 +21,9 @@ export class FieldEditorComponent { @Output() public expandedChange = new EventEmitter(); + @Input({ required: true }) + public hasChatBot!: boolean; + @Input({ required: true }) public form!: EditContentForm; diff --git a/frontend/src/app/features/content/shared/references/references-checkboxes.component.ts b/frontend/src/app/features/content/shared/references/references-checkboxes.component.ts index 068e5997e..80eb6a6a6 100644 --- a/frontend/src/app/features/content/shared/references/references-checkboxes.component.ts +++ b/frontend/src/app/features/content/shared/references/references-checkboxes.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { booleanAttribute, ChangeDetectionStrategy, Component, forwardRef, Input } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, forwardRef, inject, Input } from '@angular/core'; import { NG_VALUE_ACCESSOR, UntypedFormControl } from '@angular/forms'; import { AppsState, ContentDto, ContentsService, LanguageDto, LocalizerService, StatefulControlComponent, TypedSimpleChanges, UIOptions } from '@app/shared/internal'; import { ReferencesTagsConverter } from './references-tag-converter'; @@ -31,7 +31,7 @@ const NO_EMIT = { emitEvent: false }; changeDetection: ChangeDetectionStrategy.OnPush, }) export class ReferencesCheckboxesComponent extends StatefulControlComponent> { - private readonly itemCount: number; + private readonly itemCount: number = inject(UIOptions).value.referencesDropdownItemCount; private contentItems: ReadonlyArray | null = null; @Input({ required: true }) @@ -51,15 +51,13 @@ export class ReferencesCheckboxesComponent extends StatefulControlComponent { diff --git a/frontend/src/app/framework/angular/forms/editors/date-time-editor.component.ts b/frontend/src/app/framework/angular/forms/editors/date-time-editor.component.ts index c9aa4bb18..001f87032 100644 --- a/frontend/src/app/framework/angular/forms/editors/date-time-editor.component.ts +++ b/frontend/src/app/framework/angular/forms/editors/date-time-editor.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { AfterViewInit, booleanAttribute, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, forwardRef, Input, OnInit, Output, ViewChild } from '@angular/core'; +import { AfterViewInit, booleanAttribute, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, forwardRef, inject, Input, OnInit, Output, ViewChild } from '@angular/core'; import { NG_VALUE_ACCESSOR, UntypedFormControl } from '@angular/forms'; import * as Pikaday from 'pikaday/pikaday'; import { DateHelper, DateTime, StatefulControlComponent, UIOptions } from '@app/framework/internal'; @@ -34,8 +34,8 @@ interface State { changeDetection: ChangeDetectionStrategy.OnPush, }) export class DateTimeEditorComponent extends StatefulControlComponent implements OnInit, AfterViewInit, FocusComponent { - private readonly hideDateButtonsSettings: boolean; - private readonly hideDateTimeModeButtonSetting: boolean; + private readonly hideDateButtonsSettings: boolean = !!inject(UIOptions).value.hideDateButtons; + private readonly hideDateTimeModeButtonSetting: boolean = !!inject(UIOptions).value.hideDateTimeModeButton; private picker: any; private dateTime?: DateTime | null; private suppressEvents = false; @@ -88,11 +88,8 @@ export class DateTimeEditorComponent extends StatefulControlComponent implements AfterViewInit { + private readonly googleMapsKey = inject(UIOptions).value.map.googleMaps.key; private marker: any; private map: any; private value: Geolocation | null = null; + @ViewChild('editor', { static: false }) + public editor!: ElementRef; + + @ViewChild('searchBox', { static: false }) + public searchBoxInput!: ElementRef; + @Input({ transform: booleanAttribute }) public set disabled(value: boolean | undefined | null) { this.setDisabledState(value === true); } - public readonly isGoogleMaps: boolean; - - public get hasValue() { - return !!this.value; - } + public readonly isGoogleMaps = inject(UIOptions).value.map.type !== 'OSM'; public geolocationForm = new ExtendedFormGroup({ @@ -63,23 +66,18 @@ export class GeolocationEditorComponent extends StatefulControlComponent; - - @ViewChild('searchBox', { static: false }) - public searchBoxInput!: ElementRef; + public get hasValue() { + return !!this.value; + } constructor(localStore: LocalStoreService, private readonly resourceLoader: ResourceLoaderService, - private readonly uiOptions: UIOptions, ) { super({ isMapHidden: localStore.getBoolean(Settings.Local.HIDE_MAP) }); this.project(x => x.isMapHidden).subscribe(isMapHidden => { localStore.setBoolean(Settings.Local.HIDE_MAP, isMapHidden); }); - - this.isGoogleMaps = uiOptions.get('map.type') !== 'OSM'; } public hideMap(isMapHidden: boolean) { @@ -161,7 +159,7 @@ export class GeolocationEditorComponent extends StatefulControlComponent= 0) { diff --git a/frontend/src/app/shared/guards/must-be-authenticated.guard.ts b/frontend/src/app/shared/guards/must-be-authenticated.guard.ts index 5f30f2cc6..9efd816bb 100644 --- a/frontend/src/app/shared/guards/must-be-authenticated.guard.ts +++ b/frontend/src/app/shared/guards/must-be-authenticated.guard.ts @@ -6,7 +6,7 @@ */ import { Location } from '@angular/common'; -import { Injectable } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { Router } from '@angular/router'; import { Observable } from 'rxjs'; import { map, take, tap } from 'rxjs/operators'; @@ -15,17 +15,16 @@ import { AuthService } from './../services/auth.service'; @Injectable() export class MustBeAuthenticatedGuard { + private readonly redirectToLogin = inject(UIOptions).value.redirectToLogin; + constructor( private readonly authService: AuthService, private readonly location: Location, private readonly router: Router, - private readonly uiOptions: UIOptions, ) { } public canActivate(): Observable { - const redirect = this.uiOptions.get('redirectToLogin'); - return this.authService.userChanges.pipe( take(1), tap(user => { @@ -35,7 +34,7 @@ export class MustBeAuthenticatedGuard { const redirectPath = this.location.path(true); - if (redirect) { + if (this.redirectToLogin) { this.authService.loginRedirect(redirectPath); } else { this.router.navigate([''], { queryParams: { redirectPath } }); diff --git a/frontend/src/app/shared/guards/must-be-not-authenticated.guard.ts b/frontend/src/app/shared/guards/must-be-not-authenticated.guard.ts index 503594531..b8fea978c 100644 --- a/frontend/src/app/shared/guards/must-be-not-authenticated.guard.ts +++ b/frontend/src/app/shared/guards/must-be-not-authenticated.guard.ts @@ -6,7 +6,7 @@ */ import { Location } from '@angular/common'; -import { Injectable } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, Router } from '@angular/router'; import { Observable } from 'rxjs'; import { map, take, tap } from 'rxjs/operators'; @@ -15,16 +15,17 @@ import { AuthService } from './../services/auth.service'; @Injectable() export class MustBeNotAuthenticatedGuard { + private readonly redirectToLogin = inject(UIOptions).value.redirectToLogin; + constructor( private readonly authService: AuthService, private readonly location: Location, private readonly router: Router, - private readonly uiOptions: UIOptions, ) { } public canActivate(snapshot: ActivatedRouteSnapshot): Observable { - const redirect = this.uiOptions.get('redirectToLogin') && !snapshot.queryParams.logout; + const redirect = this.redirectToLogin && !snapshot.queryParams.logout; return this.authService.userChanges.pipe( take(1), diff --git a/frontend/src/app/shared/state/resolvers.ts b/frontend/src/app/shared/state/resolvers.ts index 959eeba56..6093fa60f 100644 --- a/frontend/src/app/shared/state/resolvers.ts +++ b/frontend/src/app/shared/state/resolvers.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Injectable } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { from, Observable, of, shareReplay } from 'rxjs'; import { UIOptions } from '@app/framework'; import { AssetDto, AssetsDto, AssetsService } from './../services/assets.service'; @@ -105,16 +105,13 @@ abstract class ResolverBase { private readonly schemas: { [name: string]: Observable } = {}; - private readonly itemCount; + private readonly itemCount = inject(UIOptions).value.referencesDropdownItemCount; constructor( - uiOptions: UIOptions, private readonly appsState: AppsState, private readonly contentsService: ContentsService, ) { super(); - - this.itemCount = uiOptions.get('referencesDropdownItemCount'); } public resolveAll(schema: string) { diff --git a/frontend/src/app/shared/state/tour.state.ts b/frontend/src/app/shared/state/tour.state.ts index 3db7fd3d3..2ef793de8 100644 --- a/frontend/src/app/shared/state/tour.state.ts +++ b/frontend/src/app/shared/state/tour.state.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Inject, Injectable } from '@angular/core'; +import { inject, Inject, Injectable } from '@angular/core'; import { filter, skip, take } from 'rxjs'; import { debug, State, TourService, UIOptions } from '@app/framework'; import { TASK_CONFIGURATION, TaskConfiguration, TaskDefinition } from './tour.tasks'; @@ -32,6 +32,8 @@ interface Snapshot { @Injectable() export class TourState extends State { + private readonly isDisabled = inject(UIOptions).value.hideOnboarding; + public completedTasks = this.project(x => x.completedTasks); @@ -48,7 +50,6 @@ export class TourState extends State { @Inject(TASK_CONFIGURATION) private readonly definition: TaskConfiguration, private readonly tourService: TourService, private readonly uiState: UIState, - private readonly uiOptions: UIOptions, ) { super({}); @@ -114,10 +115,6 @@ export class TourState extends State { private disableHintCore(key: string) { this.next(s => ({ ...s, shownHints: { ...s.shownHints || {}, [key]: true } }), 'Disable Hint'); } - - private get isDisabled() { - return this.uiOptions.get('hideOnboarding'); - } } const LoadedEvent = 'Loaded'; diff --git a/frontend/src/app/shell/pages/home/home-page.component.ts b/frontend/src/app/shell/pages/home/home-page.component.ts index bcf97fd81..f31d5517f 100644 --- a/frontend/src/app/shell/pages/home/home-page.component.ts +++ b/frontend/src/app/shell/pages/home/home-page.component.ts @@ -6,7 +6,7 @@ */ import { Location } from '@angular/common'; -import { Component } from '@angular/core'; +import { Component, inject } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { AuthService, UIOptions } from '@app/shared'; @@ -16,6 +16,8 @@ import { AuthService, UIOptions } from '@app/shared'; templateUrl: './home-page.component.html', }) export class HomePageComponent { + private readonly redirectToLogin = inject(UIOptions).value.redirectToLogin; + public showLoginError = false; constructor( @@ -23,7 +25,6 @@ export class HomePageComponent { private readonly location: Location, private readonly route: ActivatedRoute, private readonly router: Router, - private readonly uiOptions: UIOptions, ) { } @@ -32,7 +33,7 @@ export class HomePageComponent { this.route.snapshot.queryParams.redirectPath || this.location.path(); - if (this.isInternetExplorer() || this.uiOptions.get('redirectToLogin')) { + if (this.isInternetExplorer() || this.redirectToLogin) { this.authService.loginRedirect(redirectPath); return; } diff --git a/frontend/src/app/shell/pages/internal/feedback-menu.component.ts b/frontend/src/app/shell/pages/internal/feedback-menu.component.ts index bf82d7801..49c9c181c 100644 --- a/frontend/src/app/shell/pages/internal/feedback-menu.component.ts +++ b/frontend/src/app/shell/pages/internal/feedback-menu.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, OnDestroy, OnInit } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject, OnDestroy, OnInit } from '@angular/core'; import markerSDK, { MarkerSdk } from '@marker.io/browser'; import { UIOptions } from '@app/shared'; @@ -18,12 +18,7 @@ import { UIOptions } from '@app/shared'; export class FeedbackMenuComponent implements OnInit, OnDestroy { private widget?: MarkerSdk; - public markerProject = ''; - - constructor(uiOptions: UIOptions, - ) { - this.markerProject = uiOptions.get('markerProject'); - } + public readonly markerProject = inject(UIOptions).value.markerProject; public ngOnDestroy() { this.widget?.unload(); diff --git a/frontend/src/app/shell/pages/internal/internal-area.component.ts b/frontend/src/app/shell/pages/internal/internal-area.component.ts index d7c9153e1..923486280 100644 --- a/frontend/src/app/shell/pages/internal/internal-area.component.ts +++ b/frontend/src/app/shell/pages/internal/internal-area.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, OnInit } from '@angular/core'; +import { Component, inject, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { DialogService, LoadingService, Notification, ResourceOwner, UIOptions } from '@app/shared'; @@ -15,16 +15,14 @@ import { DialogService, LoadingService, Notification, ResourceOwner, UIOptions } templateUrl: './internal-area.component.html', }) export class InternalAreaComponent extends ResourceOwner implements OnInit { - public isEmbedded = false; + public readonly isEmbedded = inject(UIOptions).value.embedded; - constructor(uiOptions: UIOptions, + constructor( public readonly loadingService: LoadingService, private readonly dialogs: DialogService, private readonly route: ActivatedRoute, ) { super(); - - this.isEmbedded = !!uiOptions.get('embedded'); } public ngOnInit() { diff --git a/frontend/src/app/shell/pages/internal/notifications-menu.component.ts b/frontend/src/app/shell/pages/internal/notifications-menu.component.ts index 20127c0d9..e129ec35a 100644 --- a/frontend/src/app/shell/pages/internal/notifications-menu.component.ts +++ b/frontend/src/app/shell/pages/internal/notifications-menu.component.ts @@ -20,7 +20,7 @@ export class NotificationsMenuComponent { constructor(authService: AuthService, uiOptions: UIOptions, ) { const notifoApiKey = authService.user?.notifoToken; - const notifoApiUrl = uiOptions.get('notifoApi'); + const notifoApiUrl = uiOptions.value.notifoAPi; this.isNotifoConfigured = !!notifoApiKey && !!notifoApiUrl; } diff --git a/frontend/src/app/shell/pages/internal/profile-menu.component.ts b/frontend/src/app/shell/pages/internal/profile-menu.component.ts index dff5f6dda..f882d5ca6 100644 --- a/frontend/src/app/shell/pages/internal/profile-menu.component.ts +++ b/frontend/src/app/shell/pages/internal/profile-menu.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject, OnInit } from '@angular/core'; import { ApiUrlConfig, AuthService, Cookies, ModalModel, StatefulComponent, UILanguages, UIOptions, UIState } from '@app/shared'; interface State { @@ -32,10 +32,10 @@ interface State { changeDetection: ChangeDetectionStrategy.OnPush, }) export class ProfileMenuComponent extends StatefulComponent implements OnInit { - public modalMenu = new ModalModel(); + public readonly modalMenu = new ModalModel(); - public language = this.uiOptions.get('culture'); - public languages = UILanguages.ALL; + public readonly language = inject(UIOptions).value.culture; + public readonly languages = UILanguages.ALL; constructor(apiUrl: ApiUrlConfig, public readonly uiState: UIState, From 0909a21fc7557d649cf514e6b0f5f6b1b7a0fc51 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Fri, 20 Oct 2023 11:59:25 +0200 Subject: [PATCH 25/35] New editor. (#1034) * New editor. * Fix tests --- .../Squidex/wwwroot/editor/squidex-editor.css | 1 + .../Squidex/wwwroot/editor/squidex-editor.js | 5000 +++++++++++++++++ .../wwwroot/scripts/editor-combined.html | 13 +- .../wwwroot/scripts/editor-context.html | 13 +- .../wwwroot/scripts/editor-dialogs.html | 15 +- .../wwwroot/scripts/editor-editorjs.html | 68 - .../wwwroot/scripts/editor-json-schema.html | 88 - .../Squidex/wwwroot/scripts/editor-log.html | 20 +- .../wwwroot/scripts/editor-monaco.html | 77 - .../Squidex/wwwroot/scripts/editor-plain.html | 28 +- .../wwwroot/scripts/editor-references.html | 5 +- .../Squidex/wwwroot/scripts/editor-sdk.d.ts | 53 +- .../src/Squidex/wwwroot/scripts/editor-sdk.js | 42 +- .../wwwroot/scripts/editor-simple.html | 104 - .../wwwroot/scripts/sidebar-content.html | 12 +- .../wwwroot/scripts/sidebar-context.html | 13 +- .../wwwroot/scripts/sidebar-search.html | 116 - .../wwwroot/scripts/widget-context.html | 15 +- frontend/package.json | 2 - frontend/src/app/declarations.d.ts | 82 +- .../shared/forms/field-editor.component.html | 13 +- .../shared/forms/iframe-editor.component.ts | 5 +- .../angular/forms/file-drop.directive.ts | 7 +- .../forms/markdown-editor.component.html | 18 - .../forms/markdown-editor.component.scss | 18 - .../forms/markdown-editor.component.ts | 363 -- .../forms/rich-editor.component.html | 4 +- .../forms/rich-editor.component.scss | 10 +- .../components/forms/rich-editor.component.ts | 352 +- frontend/src/app/shared/declarations.ts | 1 - .../must-be-authenticated.guard.spec.ts | 13 +- .../guards/must-be-authenticated.guard.ts | 4 +- .../must-be-not-authenticated.guard.spec.ts | 13 +- .../guards/must-be-not-authenticated.guard.ts | 4 +- frontend/src/app/shared/module.ts | 4 +- .../src/app/shared/state/resolvers.spec.ts | 8 +- frontend/src/config/webpack.config.js | 14 - 37 files changed, 5340 insertions(+), 1278 deletions(-) create mode 100644 backend/src/Squidex/wwwroot/editor/squidex-editor.css create mode 100644 backend/src/Squidex/wwwroot/editor/squidex-editor.js delete mode 100644 backend/src/Squidex/wwwroot/scripts/editor-editorjs.html delete mode 100644 backend/src/Squidex/wwwroot/scripts/editor-json-schema.html delete mode 100644 backend/src/Squidex/wwwroot/scripts/editor-monaco.html delete mode 100644 backend/src/Squidex/wwwroot/scripts/editor-simple.html delete mode 100644 backend/src/Squidex/wwwroot/scripts/sidebar-search.html delete mode 100644 frontend/src/app/shared/components/forms/markdown-editor.component.html delete mode 100644 frontend/src/app/shared/components/forms/markdown-editor.component.scss delete mode 100644 frontend/src/app/shared/components/forms/markdown-editor.component.ts diff --git a/backend/src/Squidex/wwwroot/editor/squidex-editor.css b/backend/src/Squidex/wwwroot/editor/squidex-editor.css new file mode 100644 index 000000000..00f21bdba --- /dev/null +++ b/backend/src/Squidex/wwwroot/editor/squidex-editor.css @@ -0,0 +1 @@ +.remirror-theme{width:100%}.remirror-theme *{box-sizing:border-box}.remirror-editor{min-height:300px!important;max-height:500px}.menu{border:1px solid #dedfe3;border-bottom:0}.MuiStack-root{padding:5px}.MuiStack-root>.MuiBox-root{margin-right:5px}.MuiStack-root>.MuiBox-root>button.MuiButtonBase-root{margin-left:-1px}.MuiBox-root>.MuiButtonBase-root{border-color:#dedfe3!important;border-radius:0}.MuiButtonBase-root.Mui-selected:hover{background-color:#3284f4!important}.remirror-editor img{max-width:300px;max-height:300px}.remirror-editor-wrapper{padding-top:0!important}.custom-icon path{fill:#0000008a}.remirror-theme div.ProseMirror{border:1px solid #dedfe3!important;border-radius:0!important;box-shadow:none!important}.MuiTooltip-popper>div{background-color:#1a2129;border-radius:0;font-size:85%;font-weight:400;padding:.5rem}.squidex-editor-disabled{pointer-events:none}.squidex-editor-floating{border:1px solid #dedfe3}.squidex-editor-floating .MuiBox-root{margin-right:0!important}.squidex-editor-floating input{border:1px solid #dedfe3;border-radius:0;box-sizing:border-box;height:30px;margin-left:0;margin-right:5px;outline:none;padding:6px 12px}.squidex-editor-floating input:active{border-color:#3389ff}.squidex-editor-floating .MuiButtonBase-root{height:30px}.squidex-editor-counter{border:1px solid #dedfe3;border-top:0;font-size:85%;font-weight:400;opacity:.8;padding:4px 10px 4px 4px;text-align:right} diff --git a/backend/src/Squidex/wwwroot/editor/squidex-editor.js b/backend/src/Squidex/wwwroot/editor/squidex-editor.js new file mode 100644 index 000000000..d963016e9 --- /dev/null +++ b/backend/src/Squidex/wwwroot/editor/squidex-editor.js @@ -0,0 +1,5000 @@ +var fO=Object.defineProperty;var pO=(e,t,r)=>t in e?fO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Lm=(e,t,r)=>(pO(e,typeof t!="symbol"?t+"":t,r),r);function hO(e,t){for(var r=0;rn[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(o){if(o.ep)return;o.ep=!0;const i=r(o);fetch(o.href,i)}})();var bu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Eo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var q4={exports:{}},ch={},G4={exports:{}},we={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var fd=Symbol.for("react.element"),mO=Symbol.for("react.portal"),gO=Symbol.for("react.fragment"),vO=Symbol.for("react.strict_mode"),yO=Symbol.for("react.profiler"),bO=Symbol.for("react.provider"),kO=Symbol.for("react.context"),xO=Symbol.for("react.forward_ref"),wO=Symbol.for("react.suspense"),SO=Symbol.for("react.memo"),EO=Symbol.for("react.lazy"),vk=Symbol.iterator;function CO(e){return e===null||typeof e!="object"?null:(e=vk&&e[vk]||e["@@iterator"],typeof e=="function"?e:null)}var Y4={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},J4=Object.assign,X4={};function jl(e,t,r){this.props=e,this.context=t,this.refs=X4,this.updater=r||Y4}jl.prototype.isReactComponent={};jl.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};jl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Q4(){}Q4.prototype=jl.prototype;function q0(e,t,r){this.props=e,this.context=t,this.refs=X4,this.updater=r||Y4}var G0=q0.prototype=new Q4;G0.constructor=q0;J4(G0,jl.prototype);G0.isPureReactComponent=!0;var yk=Array.isArray,Z4=Object.prototype.hasOwnProperty,Y0={current:null},eS={key:!0,ref:!0,__self:!0,__source:!0};function tS(e,t,r){var n,o={},i=null,s=null;if(t!=null)for(n in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)Z4.call(t,n)&&!eS.hasOwnProperty(n)&&(o[n]=t[n]);var a=arguments.length-2;if(a===1)o.children=r;else if(1(e.PlainExtension="RemirrorPlainExtension",e.NodeExtension="RemirrorNodeExtension",e.MarkExtension="RemirrorMarkExtension",e.PlainExtensionConstructor="RemirrorPlainExtensionConstructor",e.NodeExtensionConstructor="RemirrorNodeExtensionConstructor",e.MarkExtensionConstructor="RemirrorMarkExtensionConstructor",e.Manager="RemirrorManager",e.Preset="RemirrorPreset",e.PresetConstructor="RemirrorPresetConstructor",e))($t||{}),De=(e=>(e[e.Critical=1e6]="Critical",e[e.Highest=1e5]="Highest",e[e.High=1e4]="High",e[e.Medium=1e3]="Medium",e[e.Default=100]="Default",e[e.Low=10]="Low",e[e.Lowest=0]="Lowest",e))(De||{}),Tr=(e=>(e[e.None=0]="None",e[e.Create=1]="Create",e[e.EditorView=2]="EditorView",e[e.Runtime=3]="Runtime",e[e.Destroy=4]="Destroy",e))(Tr||{}),j=(e=>(e.Undo="_|undo|_",e.Redo="_|redo|_",e.Bold="_|bold|_",e.Italic="_|italic|_",e.Underline="_|underline|_",e.Strike="_|strike|_",e.Code="_|code|_",e.Paragraph="_|paragraph|_",e.H1="_|h1|_",e.H2="_|h2|_",e.H3="_|h3|_",e.H4="_|h4|_",e.H5="_|h5|_",e.H6="_|h6|_",e.TaskList="_|task|_",e.BulletList="_|bullet|_",e.OrderedList="_|number|_",e.Quote="_|quote|_",e.Divider="_|divider|_",e.Codeblock="_|codeblock|_",e.ClearFormatting="_|clear|_",e.Superscript="_|sup|_",e.Subscript="_|sub|_",e.LeftAlignment="_|left-align|_",e.CenterAlignment="_|center-align|_",e.RightAlignment="_|right-align|_",e.JustifyAlignment="_|justify-align|_",e.InsertLink="_|link|_",e.Find="_|find|_",e.FindBackwards="_|find-backwards|_",e.FindReplace="_|find-replace|_",e.AddFootnote="_|footnote|_",e.AddComment="_|comment|_",e.ContextMenu="_|context-menu|_",e.IncreaseFontSize="_|inc-font-size|_",e.DecreaseFontSize="_|dec-font-size|_",e.IncreaseIndent="_|indent|_",e.DecreaseIndent="_|dedent|_",e.Shortcuts="_|shortcuts|_",e.Copy="_|copy|_",e.Cut="_|cut|_",e.Paste="_|paste|_",e.PastePlain="_|paste-plain|_",e.SelectAll="_|select-all|_",e.Format="_|format|_",e))(j||{}),$=(e=>(e.PROD="RMR0000",e.UNKNOWN="RMR0001",e.INVALID_COMMAND_ARGUMENTS="RMR0002",e.CUSTOM="RMR0003",e.CORE_HELPERS="RMR0004",e.MUTATION="RMR0005",e.INTERNAL="RMR0006",e.MISSING_REQUIRED_EXTENSION="RMR0007",e.MANAGER_PHASE_ERROR="RMR0008",e.INVALID_GET_EXTENSION="RMR0010",e.INVALID_MANAGER_ARGUMENTS="RMR0011",e.SCHEMA="RMR0012",e.HELPERS_CALLED_IN_OUTER_SCOPE="RMR0013",e.INVALID_MANAGER_EXTENSION="RMR0014",e.DUPLICATE_COMMAND_NAMES="RMR0016",e.DUPLICATE_HELPER_NAMES="RMR0017",e.NON_CHAINABLE_COMMAND="RMR0018",e.INVALID_EXTENSION="RMR0019",e.INVALID_CONTENT="RMR0021",e.INVALID_NAME="RMR0050",e.EXTENSION="RMR0100",e.EXTENSION_SPEC="RMR0101",e.EXTENSION_EXTRA_ATTRIBUTES="RMR0102",e.INVALID_SET_EXTENSION_OPTIONS="RMR0103",e.REACT_PROVIDER_CONTEXT="RMR0200",e.REACT_GET_ROOT_PROPS="RMR0201",e.REACT_EDITOR_VIEW="RMR0202",e.REACT_CONTROLLED="RMR0203",e.REACT_NODE_VIEW="RMR0204",e.REACT_GET_CONTEXT="RMR0205",e.REACT_COMPONENTS="RMR0206",e.REACT_HOOKS="RMR0207",e.I18N_CONTEXT="RMR0300",e))($||{}),DO=function(t){return $O(t)&&!HO(t)};function $O(e){return!!e&&typeof e=="object"}function HO(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||VO(e)}var BO=typeof Symbol=="function"&&Symbol.for,FO=BO?Symbol.for("react.element"):60103;function VO(e){return e.$$typeof===FO}function jO(e){return Array.isArray(e)?[]:{}}function ku(e,t){return t.clone!==!1&&t.isMergeableObject(e)?ml(jO(e),e,t):e}function UO(e,t,r){return e.concat(t).map(function(n){return ku(n,r)})}function WO(e,t){if(!t.customMerge)return ml;var r=t.customMerge(e);return typeof r=="function"?r:ml}function KO(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function wk(e){return Object.keys(e).concat(KO(e))}function oS(e,t){try{return t in e}catch{return!1}}function qO(e,t){return oS(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function GO(e,t,r){var n={};return r.isMergeableObject(e)&&wk(e).forEach(function(o){n[o]=ku(e[o],r)}),wk(t).forEach(function(o){qO(e,o)||(oS(e,o)&&r.isMergeableObject(t[o])?n[o]=WO(o,r)(e[o],t[o],r):n[o]=ku(t[o],r))}),n}function ml(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||UO,r.isMergeableObject=r.isMergeableObject||DO,r.cloneUnlessOtherwiseSpecified=ku;var n=Array.isArray(t),o=Array.isArray(e),i=n===o;return i?n?r.arrayMerge(e,t,r):GO(e,t,r):ku(t,r)}ml.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,o){return ml(n,o,r)},{})};var YO=ml,JO=YO;const XO=Eo(JO);var QO=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r};const ZO=Eo(QO);/*! + * isobject + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */var iS=function(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===!1};/*! + * is-plain-object + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */var e_=iS;function Sk(e){return e_(e)===!0&&Object.prototype.toString.call(e)==="[object Object]"}var t_=function(t){var r,n;return!(Sk(t)===!1||(r=t.constructor,typeof r!="function")||(n=r.prototype,Sk(n)===!1)||n.hasOwnProperty("isPrototypeOf")===!1)};/*! + * is-extendable + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */var r_=t_,n_=function(t){return r_(t)||typeof t=="function"||Array.isArray(t)};/*! + * object.omit + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */var o_=n_,i_=function(t,r,n){if(!o_(t))return{};typeof r=="function"&&(n=r,r=[]),typeof r=="string"&&(r=[r]);for(var o=typeof n=="function",i=Object.keys(t),s={},a=0;a + * + * Copyright (c) 2014-2015 Jon Schlinkert, contributors. + * Licensed under the MIT License + */var s_=iS,a_=function(t,r){if(!s_(t)&&typeof t!="function")return{};var n={};if(typeof r=="string")return r in t&&(n[r]=t[r]),n;for(var o=r.length,i=-1;++i{let d=l.prefixes[u]||"",f=c;return r===!1&&(n&&(f=f.normalize("NFD").replace(new RegExp(`[^a-zA-ZØßø0-9${n.join("")}]`,"g"),"")),n||(f=f.normalize("NFD").replace(/[^a-zA-ZØßø0-9]/g,""),d="")),n&&(d=d.replace(new RegExp(`[^${n.join("")}]`,"g"),"")),u===0?d+f:!d&&!f?"":s&&!d&&o.match(/\s/)?" "+f:(d||o)+f}).filter(Boolean)}function u_(e){const t=e.matchAll(sS).next().value,r=t?t.index:0;return e.slice(0,r+1).toUpperCase()+e.slice(r+1).toLowerCase()}function lS(e,t){return aS(e,t).reduce((r,n)=>r+u_(n),"")}function Ek(e,t){return aS(e,{...t,prefix:"-"}).join("").toLowerCase()}function e1(e,t,r,n){var o,i=!1,s=0;function a(){o&&clearTimeout(o)}function l(){a(),i=!0}typeof t!="boolean"&&(n=r,r=t,t=void 0);function c(){for(var u=arguments.length,d=new Array(u),f=0;fe?m():t!==!0&&(o=setTimeout(n?b:m,n===void 0?e-h:e))}return c.cancel=l,c}function cS(e,t,r){return r===void 0?e1(e,t,!1):e1(e,r,t!==!1)}function nt(e,t,r){const n=e[t];return uS(!dh(n),r),n}function uS(e,t){if(!e)throw new d_(t)}var d_=class extends nS.BaseError{constructor(){super(...arguments),this.name="AssertionError"}};function At(e){return Object.entries(e)}function xu(e){return Object.keys(e)}function uh(e){return Object.values(e)}function vr(e,t,r){return e.includes(t,r)}function ee(e){return Object.assign(Object.create(null),e)}function dS(e){return Object.prototype.toString.call(e)}function fS(e){return dS(e).slice(8,-1)}function pd(e,t){return r=>typeof r!==e?!1:t?t(r):!0}function Z0(e){return t=>fS(t)===e}var dh=pd("undefined"),ne=pd("string"),sn=pd("number",e=>!Number.isNaN(e)),Ne=pd("function");function f_(e){return e===null}function t1(e){return e===!0||e===!1}function ss(e){if(fS(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})}function p_(e){return e==null||/^[bns]/.test(typeof e)}function Wi(e){return f_(e)||dh(e)}function Xt(e){return!Wi(e)&&(Ne(e)||pd("object")(e))}var h_=Z0("RegExp");function m_(e){return Z0("Map")(e)}function g_(e){return Z0("Set")(e)}function Yf(e){return Xt(e)&&!m_(e)&&!g_(e)&&Object.keys(e).length===0}var at=Array.isArray;function Ki(e){return at(e)&&e.length===0}function Ck(e){return at(e)&&e.length>0}function v_(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ul(e,t,r=n=>!!n){t.lastIndex=0;const n=[],o=t.flags;let i;o.includes("g")||(t=new RegExp(t.source,`g${o}`));do i=t.exec(e),i&&n.push(i);while(r(i));return t.lastIndex=0,n}function Jf(){const e=Date.now(),t=Jf.last||e;return Jf.last=e>t?e:t+1}Jf.last=0;function gl(e=""){return`${e}${Jf().toString(36)}`}function pS(e){return Q0(e,t=>!dh(t))}function y_(e){if(!ss(e))throw new Error("An invalid value was passed into this clone utility. Expected a plain object");return{...e}}var hS=ZO;function vl(e,t=!1){const r=t?[...e].reverse():e,n=new Set(r);return t?[...n].reverse():[...n]}function mS(e){const t=[];for(const r of e){const n=at(r)?mS(r):[r];t.push(...n)}return t}function gS(){}function vS(...e){return XO.all(e,{isMergeableObject:ss})}function b_({min:e,max:t,value:r}){return rt?t:r}function k_(e){return e[e.length-1]}function qs(e,t){return[...e].map((r,n)=>({value:r,index:n})).sort((r,n)=>t(r.value,n.value)||r.index-n.index).map(({value:r})=>r)}function x_(e,t,r){try{if(ne(t)&&t in e)return e[t];at(t)&&(t=`['${t.join("']['")}']`);let n=e;return t.replace(/\[\s*(["'])(.*?)\1\s*]|^\s*(\w+)\s*(?=\.|\[|$)|\.\s*(\w*)\s*(?=\.|\[|$)|\[\s*(-?\d+)\s*]/g,(o,i,s,a,l,c)=>(n=n[s||a||l||c],"")),n===void 0?r:n}catch{return r}}function w_(e,t){const r=y_(t);let n=r;for(const[o,i]of e.entries()){const s=o>=e.length-1;let a=n[i];if(s){if(at(n)){const l=Number.parseInt(i.toString(),10);sn(l)&&n.splice(l,1)}else Reflect.deleteProperty(n,i);return r}if(p_(a))return r;a=at(a)?[...a]:{...a},n[i]=a,n=a}return r}function S_(e){return t=>x_(t,e)}function yS(e,t,r=!1){const n=[],o=new Set,i=Ne(t)?t:S_(t),s=r?[...e].reverse():e;for(const a of s){const l=i(a);o.has(l)||(o.add(l),n.push(a))}return r?n.reverse():n}function ev(e,t){const r=at(e)?e[0]:e;return sn(t)?r<=t?Array.from({length:t+1-r},(n,o)=>o+r):Array.from({length:r+1-t},(n,o)=>-1*o+r):Array.from({length:Math.abs(r)},(n,o)=>(r<0?-1:1)*o)}function Mk(e,...t){const r=t.filter(sn);return e>=Math.min(...r)&&e<=Math.max(...r)}function bS(e){return Ne(e)?e():e}var kS="https://remirror.io/docs/errors",E_={[$.UNKNOWN]:"An error occurred but we're not quite sure why. 🧐",[$.INVALID_COMMAND_ARGUMENTS]:"The arguments passed to the command method were invalid.",[$.CUSTOM]:"This is a custom error, possibly thrown by an external library.",[$.CORE_HELPERS]:"An error occurred in a function called from the `@remirror/core-helpers` library.",[$.MUTATION]:"Mutation of immutable value detected.",[$.INTERNAL]:"This is an error which should not occur and is internal to the remirror codebase.",[$.MISSING_REQUIRED_EXTENSION]:"Your editor is missing a required extension.",[$.MANAGER_PHASE_ERROR]:"This occurs when accessing a method or property before it is available.",[$.INVALID_GET_EXTENSION]:"The user requested an invalid extension from the getExtensions method. Please check the `createExtensions` return method is returning an extension with the defined constructor.",[$.INVALID_MANAGER_ARGUMENTS]:"Invalid value(s) passed into `Manager` constructor. Only `Presets` and `Extensions` are supported.",[$.SCHEMA]:"There is a problem with the schema or you are trying to access a node / mark that doesn't exists.",[$.HELPERS_CALLED_IN_OUTER_SCOPE]:"The `helpers` method which is passed into the ``create*` method should only be called within returned method since it relies on an active view (not present in the outer scope).",[$.INVALID_MANAGER_EXTENSION]:"You requested an invalid extension from the manager.",[$.DUPLICATE_COMMAND_NAMES]:"Command method names must be unique within the editor.",[$.DUPLICATE_HELPER_NAMES]:"Helper method names must be unique within the editor.",[$.NON_CHAINABLE_COMMAND]:"Attempted to chain a non chainable command.",[$.INVALID_EXTENSION]:"The provided extension is invalid.",[$.INVALID_CONTENT]:"The content provided to the editor is not supported.",[$.INVALID_NAME]:"An invalid name was used for the extension.",[$.EXTENSION]:"An error occurred within an extension. More details should be made available.",[$.EXTENSION_SPEC]:"The spec was defined without calling the `defaults`, `parse` or `dom` methods.",[$.EXTENSION_EXTRA_ATTRIBUTES]:"Extra attributes must either be a string or an object.",[$.INVALID_SET_EXTENSION_OPTIONS]:"A call to `extension.setOptions` was made with invalid keys.",[$.REACT_PROVIDER_CONTEXT]:"`useRemirrorContext` was called outside of the `remirror` context. It can only be used within an active remirror context created by the ``.",[$.REACT_GET_ROOT_PROPS]:"`getRootProps` has been attached to the DOM more than once. It should only be attached to the dom once per editor.",[$.REACT_EDITOR_VIEW]:"A problem occurred adding the editor view to the dom.",[$.REACT_CONTROLLED]:"There is a problem with your controlled editor setup.",[$.REACT_NODE_VIEW]:"Something went wrong with your custom ReactNodeView Component.",[$.REACT_GET_CONTEXT]:"You attempted to call `getContext` provided by the `useRemirror` prop during the first render of the editor. This is not possible and should only be after the editor first mounts.",[$.REACT_COMPONENTS]:"An error occurred within a remirror component.",[$.REACT_HOOKS]:"An error occurred within a remirror hook.",[$.I18N_CONTEXT]:"You called `useI18n()` outside of an `I18nProvider` context."};function C_(e){return ne(e)&&vr(uh($),e)}function M_(e,t){const r=E_[e],n=r?`${r} + +`:"",o=t?`${t} + +`:"";return`${n}${o}For more information visit ${kS}#${e.toLowerCase()}`}var xS=class extends nS.BaseError{constructor({code:e,message:t,disableLogging:r=!1}={}){const n=C_(e)?e:$.CUSTOM;super(M_(n,t)),this.errorCode=n,this.url=`${kS}#${n.toLowerCase()}`,r||console.error(this.message)}static create(e={}){return new xS(e)}};function te(e,t){if(!e)throw xS.create(t)}function tv(e){if(typeof e!="object"||e===null)return e;const t=Symbol.toStringTag in e&&e[Symbol.toStringTag]==="Module"?e.default??e:e;return t&&typeof e=="object"&&"__esModule"in t&&t.__esModule&&t.default!==void 0?t.default:t}function Rs(e,t={}){return e}function Wt(e){this.content=e}Wt.prototype={constructor:Wt,find:function(e){for(var t=0;t>1}};Wt.from=function(e){if(e instanceof Wt)return e;var t=[];if(e)for(var r in e)t.push(r,e[r]);return new Wt(t)};function wS(e,t,r){for(let n=0;;n++){if(n==e.childCount||n==t.childCount)return e.childCount==t.childCount?null:r;let o=e.child(n),i=t.child(n);if(o==i){r+=o.nodeSize;continue}if(!o.sameMarkup(i))return r;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)r++;return r}if(o.content.size||i.content.size){let s=wS(o.content,i.content,r+1);if(s!=null)return s}r+=o.nodeSize}}function SS(e,t,r,n){for(let o=e.childCount,i=t.childCount;;){if(o==0||i==0)return o==i?null:{a:r,b:n};let s=e.child(--o),a=t.child(--i),l=s.nodeSize;if(s==a){r-=l,n-=l;continue}if(!s.sameMarkup(a))return{a:r,b:n};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;ct&&n(l,o+a,i||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,t-u),Math.min(l.content.size,r-u),n,o+u)}a=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,r,n,o){let i="",s=!0;return this.nodesBetween(t,r,(a,l)=>{a.isText?(i+=a.text.slice(Math.max(t,l)-l,r-l),s=!n):a.isLeaf?(o?i+=typeof o=="function"?o(a):o:a.type.spec.leafText&&(i+=a.type.spec.leafText(a)),s=!n):!s&&a.isBlock&&(i+=n,s=!0)},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let r=this.lastChild,n=t.firstChild,o=this.content.slice(),i=0;for(r.isText&&r.sameMarkup(n)&&(o[o.length-1]=r.withText(r.text+n.text),i=1);it)for(let i=0,s=0;st&&((sr)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,r-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,r-s-1))),n.push(a),o+=a.nodeSize),s=l}return new P(n,o)}cutByIndex(t,r){return t==r?P.empty:t==0&&r==this.content.length?this:new P(this.content.slice(t,r))}replaceChild(t,r){let n=this.content[t];if(n==r)return this;let o=this.content.slice(),i=this.size+r.nodeSize-n.nodeSize;return o[t]=r,new P(o,i)}addToStart(t){return new P([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new P(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let r=0;rthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,o=0;;n++){let i=this.child(n),s=o+i.nodeSize;if(s>=t)return s==t||r>0?Dd(n+1,s):Dd(n,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,r){if(!r)return P.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new P(r.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return P.empty;let r,n=0;for(let o=0;othis.type.rank&&(r||(r=t.slice(0,o)),r.push(this),n=!0),r&&r.push(i)}}return r||(r=t.slice()),n||r.push(this),r}removeFromSet(t){for(let r=0;rn.type.rank-o.type.rank),r}}Te.none=[];class Qf extends Error{}class W{constructor(t,r,n){this.content=t,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,r){let n=CS(this.content,t+this.openStart,r);return n&&new W(n,this.openStart,this.openEnd)}removeBetween(t,r){return new W(ES(this.content,t+this.openStart,r+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,r){if(!r)return W.empty;let n=r.openStart||0,o=r.openEnd||0;if(typeof n!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new W(P.fromJSON(t,r.content),n,o)}static maxOpen(t,r=!0){let n=0,o=0;for(let i=t.firstChild;i&&!i.isLeaf&&(r||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=t.lastChild;i&&!i.isLeaf&&(r||!i.type.spec.isolating);i=i.lastChild)o++;return new W(t,n,o)}}W.empty=new W(P.empty,0,0);function ES(e,t,r){let{index:n,offset:o}=e.findIndex(t),i=e.maybeChild(n),{index:s,offset:a}=e.findIndex(r);if(o==t||i.isText){if(a!=r&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(r))}if(n!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(n,i.copy(ES(i.content,t-o-1,r-o-1)))}function CS(e,t,r,n){let{index:o,offset:i}=e.findIndex(t),s=e.maybeChild(o);if(i==t||s.isText)return n&&!n.canReplace(o,o,r)?null:e.cut(0,t).append(r).append(e.cut(t));let a=CS(s.content,t-i-1,r);return a&&e.replaceChild(o,s.copy(a))}function T_(e,t,r){if(r.openStart>e.depth)throw new Qf("Inserted content deeper than insertion position");if(e.depth-r.openStart!=t.depth-r.openEnd)throw new Qf("Inconsistent open depths");return MS(e,t,r,0)}function MS(e,t,r,n){let o=e.index(n),i=e.node(n);if(o==t.index(n)&&n=0&&e.isText&&e.sameMarkup(t[r])?t[r]=e.withText(t[r].text+e.text):t.push(e)}function tu(e,t,r,n){let o=(t||e).node(r),i=0,s=t?t.index(r):o.childCount;e&&(i=e.index(r),e.depth>r?i++:e.textOffset&&(Bs(e.nodeAfter,n),i++));for(let a=i;ao&&r1(e,t,o+1),s=n.depth>o&&r1(r,n,o+1),a=[];return tu(null,e,o,a),i&&s&&t.index(o)==r.index(o)?(TS(i,s),Bs(Fs(i,OS(e,t,r,n,o+1)),a)):(i&&Bs(Fs(i,Zf(e,t,o+1)),a),tu(t,r,o,a),s&&Bs(Fs(s,Zf(r,n,o+1)),a)),tu(n,null,o,a),new P(a)}function Zf(e,t,r){let n=[];if(tu(null,e,r,n),e.depth>r){let o=r1(e,t,r+1);Bs(Fs(o,Zf(e,t,r+1)),n)}return tu(t,null,r,n),new P(n)}function O_(e,t){let r=t.depth-e.openStart,o=t.node(r).copy(e.content);for(let i=r-1;i>=0;i--)o=t.node(i).copy(P.from(o));return{start:o.resolveNoCache(e.openStart+r),end:o.resolveNoCache(o.content.size-e.openEnd-r)}}class yl{constructor(t,r,n){this.pos=t,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,r=this.index(this.depth);if(r==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],o=t.child(r);return n?t.child(r).cut(n):o}get nodeBefore(){let t=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(t).cut(0,r):t==0?null:this.parent.child(t-1)}posAtIndex(t,r){r=this.resolveDepth(r);let n=this.path[r*3],o=r==0?0:this.path[r*3-1]+1;for(let i=0;i0;r--)if(this.start(r)<=t&&this.end(r)>=t)return r;return 0}blockRange(t=this,r){if(t.pos=0;n--)if(t.pos<=this.end(n)&&(!r||r(this.node(n))))return new Gs(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&r<=t.content.size))throw new RangeError("Position "+r+" out of range");let n=[],o=0,i=r;for(let s=t;;){let{index:a,offset:l}=s.content.findIndex(i),c=i-l;if(n.push(s,a,o+l),!c||(s=s.child(a),s.isText))break;i=c-1,o+=l+1}return new yl(r,n,i)}static resolveCached(t,r){for(let o=0;o<$m.length;o++){let i=$m[o];if(i.pos==r&&i.doc==t)return i}let n=$m[Hm]=yl.resolve(t,r);return Hm=(Hm+1)%__,n}}let $m=[],Hm=0,__=12;class Gs{constructor(t,r,n){this.$from=t,this.$to=r,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const A_=Object.create(null);let Pi=class n1{constructor(t,r,n,o=Te.none){this.type=t,this.attrs=r,this.marks=o,this.content=n||P.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,r,n,o=0){this.content.nodesBetween(t,r,n,o,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,r,n,o){return this.content.textBetween(t,r,n,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,r,n){return this.type==t&&Xf(this.attrs,r||t.defaultAttrs||A_)&&Te.sameSet(this.marks,n||Te.none)}copy(t=null){return t==this.content?this:new n1(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new n1(this.type,this.attrs,this.content,t)}cut(t,r=this.content.size){return t==0&&r==this.content.size?this:this.copy(this.content.cut(t,r))}slice(t,r=this.content.size,n=!1){if(t==r)return W.empty;let o=this.resolve(t),i=this.resolve(r),s=n?0:o.sharedDepth(r),a=o.start(s),c=o.node(s).content.cut(o.pos-a,i.pos-a);return new W(c,o.depth-s,i.depth-s)}replace(t,r,n){return T_(this.resolve(t),this.resolve(r),n)}nodeAt(t){for(let r=this;;){let{index:n,offset:o}=r.content.findIndex(t);if(r=r.maybeChild(n),!r)return null;if(o==t||r.isText)return r;t-=o+1}}childAfter(t){let{index:r,offset:n}=this.content.findIndex(t);return{node:this.content.maybeChild(r),index:r,offset:n}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:r,offset:n}=this.content.findIndex(t);if(nt&&this.nodesBetween(t,r,i=>(n.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),_S(this.marks,t)}contentMatchAt(t){let r=this.type.contentMatch.matchFragment(this.content,0,t);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(t,r,n=P.empty,o=0,i=n.childCount){let s=this.contentMatchAt(t).matchFragment(n,o,i),a=s&&s.matchFragment(this.content,r);if(!a||!a.validEnd)return!1;for(let l=o;lr.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let t={type:this.type.name};for(let r in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(r=>r.toJSON())),t}static fromJSON(t,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(t.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(r.text,n)}let o=P.fromJSON(t,r.content);return t.nodeType(r.type).create(r.attrs,o,n)}};Pi.prototype.text=void 0;class ep extends Pi{constructor(t,r,n,o){if(super(t,r,null,o),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):_S(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,r){return this.text.slice(t,r)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new ep(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new ep(this.type,this.attrs,t,this.marks)}cut(t=0,r=this.text.length){return t==0&&r==this.text.length?this:this.withText(this.text.slice(t,r))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function _S(e,t){for(let r=e.length-1;r>=0;r--)t=e[r].type.name+"("+t+")";return t}class Ys{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,r){let n=new R_(t,r);if(n.next==null)return Ys.empty;let o=AS(n);n.next&&n.err("Unexpected trailing text");let i=$_(D_(o));return H_(i,n),i}matchType(t){for(let r=0;rc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function r(n){t.push(n);for(let o=0;o{let i=o+(n.validEnd?"*":" ")+" ";for(let s=0;s"+t.indexOf(n.next[s].next);return i}).join(` +`)}}Ys.empty=new Ys(!0);class R_{constructor(t,r){this.string=t,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function AS(e){let t=[];do t.push(P_(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function P_(e){let t=[];do t.push(N_(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function N_(e){let t=I_(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=z_(e,t);else break;return t}function Tk(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function z_(e,t){let r=Tk(e),n=r;return e.eat(",")&&(e.next!="}"?n=Tk(e):n=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:t}}function L_(e,t){let r=e.nodeTypes,n=r[t];if(n)return[n];let o=[];for(let i in r){let s=r[i];s.groups.indexOf(t)>-1&&o.push(s)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function I_(e){if(e.eat("(")){let t=AS(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=L_(e,e.next).map(r=>(e.inline==null?e.inline=r.isInline:e.inline!=r.isInline&&e.err("Mixing inline and block content"),{type:"name",value:r}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function D_(e){let t=[[]];return o(i(e,0),r()),t;function r(){return t.push([])-1}function n(s,a,l){let c={term:l,to:a};return t[s].push(c),c}function o(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=r())}else if(s.type=="star"){let l=r();return n(a,l),o(i(s.expr,l),l),[n(l)]}else if(s.type=="plus"){let l=r();return o(i(s.expr,a),l),o(i(s.expr,l),l),[n(l)]}else{if(s.type=="opt")return[n(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c{e[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u{c||o.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=t[n.join(",")]=new Ys(n.indexOf(e.length-1)>-1);for(let s=0;s-1}allowsMarks(t){if(this.markSet==null)return!0;for(let r=0;rn[i]=new LS(i,r,s));let o=r.spec.topNode||"doc";if(!n[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let i in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};class B_{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class hd{constructor(t,r,n,o){this.name=t,this.rank=r,this.schema=n,this.spec=o,this.attrs=zS(o.attrs),this.excluded=null;let i=PS(this.attrs);this.instance=i?new Te(this,i):null}create(t=null){return!t&&this.instance?this.instance:new Te(this,NS(this.attrs,t))}static compile(t,r){let n=Object.create(null),o=0;return t.forEach((i,s)=>n[i]=new hd(i,o++,r,s)),n}removeFromSet(t){for(var r=0;r-1}}let F_=class{constructor(t){this.cached=Object.create(null);let r=this.spec={};for(let o in t)r[o]=t[o];r.nodes=Wt.from(t.nodes),r.marks=Wt.from(t.marks||{}),this.nodes=o1.compile(this.spec.nodes,this),this.marks=hd.compile(this.spec.marks,this);let n=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=n[s]||(n[s]=Ys.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=a=="_"?null:a?_k(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:_k(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,r=null,n,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof o1){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(r,n,o)}text(t,r){let n=this.nodes.text;return new ep(n,n.defaultAttrs,t,Te.setFrom(r))}mark(t,r){return typeof t=="string"&&(t=this.marks[t]),t.create(r)}nodeFromJSON(t){return Pi.fromJSON(this,t)}markFromJSON(t){return Te.fromJSON(this,t)}nodeType(t){let r=this.nodes[t];if(!r)throw new RangeError("Unknown node type: "+t);return r}};function _k(e,t){let r=[];for(let n=0;n-1)&&r.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[n]+"'")}return r}let rv=class i1{constructor(t,r){this.schema=t,this.rules=r,this.tags=[],this.styles=[],r.forEach(n=>{n.tag?this.tags.push(n):n.style&&this.styles.push(n)}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let o=t.nodes[n.node];return o.contentMatch.matchType(o)})}parse(t,r={}){let n=new Rk(this,r,!1);return n.addAll(t,r.from,r.to),n.finish()}parseSlice(t,r={}){let n=new Rk(this,r,!0);return n.addAll(t,r.from,r.to),W.maxOpen(n.finish())}matchTag(t,r,n){for(let o=n?this.tags.indexOf(n)+1:0;ot.length&&(a.charCodeAt(t.length)!=61||a.slice(t.length+1)!=r))){if(s.getAttrs){let l=s.getAttrs(r);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(t){let r=[];function n(o){let i=o.priority==null?50:o.priority,s=0;for(;s{n(s=Pk(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in t.nodes){let i=t.nodes[o].spec.parseDOM;i&&i.forEach(s=>{n(s=Pk(s)),s.node||s.ignore||s.mark||(s.node=o)})}return r}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new i1(t,i1.schemaRules(t)))}};const IS={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},V_={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},DS={ol:!0,ul:!0},tp=1,rp=2,ru=4;function Ak(e,t,r){return t!=null?(t?tp:0)|(t==="full"?rp:0):e&&e.whitespace=="pre"?tp|rp:r&~ru}class $d{constructor(t,r,n,o,i,s,a){this.type=t,this.attrs=r,this.marks=n,this.pendingMarks=o,this.solid=i,this.options=a,this.content=[],this.activeMarks=Te.none,this.stashMarks=[],this.match=s||(a&ru?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let r=this.type.contentMatch.fillBefore(P.from(t));if(r)this.match=this.type.contentMatch.matchFragment(r);else{let n=this.type.contentMatch,o;return(o=n.findWrapping(t.type))?(this.match=n,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&tp)){let n=this.content[this.content.length-1],o;if(n&&n.isText&&(o=/[ \t\r\n\u000c]+$/.exec(n.text))){let i=n;n.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let r=P.from(this.content);return!t&&this.match&&(r=r.append(this.match.fillBefore(P.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}popFromStashMark(t){for(let r=this.stashMarks.length-1;r>=0;r--)if(t.eq(this.stashMarks[r]))return this.stashMarks.splice(r,1)[0]}applyPending(t){for(let r=0,n=this.pendingMarks;rthis.addAll(t)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(t,()=>{this.addElementByRule(t,i,i.consuming===!1?o:void 0)})}leafFallback(t){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(` +`))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let r=Te.none,n=Te.none;for(let o=0;o{s.clearMark(a)&&(n=a.addToSet(n))}):r=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(r),s.consuming===!1)i=s;else break}return[r,n]}addElementByRule(t,r,n){let o,i,s;r.node?(i=this.parser.schema.nodes[r.node],i.isLeaf?this.insertNode(i.create(r.attrs))||this.leafFallback(t):o=this.enter(i,r.attrs||null,r.preserveWhitespace)):(s=this.parser.schema.marks[r.mark].create(r.attrs),this.addPendingMark(s));let a=this.top;if(i&&i.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(r.getContent)this.findInside(t),r.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=t;typeof r.contentElement=="string"?l=t.querySelector(r.contentElement):typeof r.contentElement=="function"?l=r.contentElement(t):r.contentElement&&(l=r.contentElement),this.findAround(t,l,!0),this.addAll(l)}o&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(t,r,n){let o=r||0;for(let i=r?t.childNodes[r]:t.firstChild,s=n==null?null:t.childNodes[n];i!=s;i=i.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(i);this.findAtPoint(t,o)}findPlace(t){let r,n;for(let o=this.open;o>=0;o--){let i=this.nodes[o],s=i.findWrapping(t);if(s&&(!r||r.length>s.length)&&(r=s,n=i,!s.length)||i.solid)break}if(!r)return!1;this.sync(n);for(let o=0;othis.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let r=this.open;r>=0;r--)if(this.nodes[r]==t)return this.open=r,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let o=n.length-1;o>=0;o--)t+=n[o].nodeSize;r&&t++}return t}findAtPoint(t,r){if(this.find)for(let n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let r=t.split("/"),n=this.options.context,o=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(o?0:1),s=(a,l)=>{for(;a>=0;a--){let c=r[a];if(c==""){if(a==r.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&o?this.nodes[l].type:n&&l>=i?n.node(l-i).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;l--}}return!0};return s(r.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let r=t.depth;r>=0;r--){let n=t.node(r).contentMatchAt(t.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}addPendingMark(t){let r=q_(t,this.top.pendingMarks);r&&this.top.stashMarks.push(r),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,r){for(let n=this.open;n>=0;n--){let o=this.nodes[n];if(o.pendingMarks.lastIndexOf(t)>-1)o.pendingMarks=t.removeFromSet(o.pendingMarks);else{o.activeMarks=t.removeFromSet(o.activeMarks);let s=o.popFromStashMark(t);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==r)break}}}function j_(e){for(let t=e.firstChild,r=null;t;t=t.nextSibling){let n=t.nodeType==1?t.nodeName.toLowerCase():null;n&&DS.hasOwnProperty(n)&&r?(r.appendChild(t),t=r):n=="li"?r=t:n&&(r=null)}}function U_(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function W_(e){let t=/\s*([\w-]+)\s*:\s*([^;]+)/g,r,n=[];for(;r=t.exec(e);)n.push(r[1],r[2].trim());return n}function Pk(e){let t={};for(let r in e)t[r]=e[r];return t}function K_(e,t){let r=t.schema.nodes;for(let n in r){let o=r[n];if(!o.allowsMarkType(e))continue;let i=[],s=a=>{i.push(a);for(let l=0;l{if(i.length||s.marks.length){let a=0,l=0;for(;a=0;o--){let i=this.serializeMark(t.marks[o],t.isInline,r);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,r,n={}){let o=this.marks[t.type.name];return o&&kn.renderSpec(Bm(n),o(t,r))}static renderSpec(t,r,n=null){if(typeof r=="string")return{dom:t.createTextNode(r)};if(r.nodeType!=null)return{dom:r};if(r.dom&&r.dom.nodeType!=null)return r;let o=r[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let s,a=n?t.createElementNS(n,o):t.createElement(o),l=r[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(let u in l)if(l[u]!=null){let d=u.indexOf(" ");d>0?a.setAttributeNS(u.slice(0,d),u.slice(d+1),l[u]):a.setAttribute(u,l[u])}}for(let u=c;uc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:f,contentDOM:p}=kn.renderSpec(t,d,n);if(a.appendChild(f),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:a,contentDOM:s}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new kn(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let r=Nk(t.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(t){return Nk(t.marks)}}function Nk(e){let t={};for(let r in e){let n=e[r].spec.toDOM;n&&(t[r]=n)}return t}function Bm(e){return e.document||window.document}const $S=65535,HS=Math.pow(2,16);function G_(e,t){return e+t*HS}function zk(e){return e&$S}function Y_(e){return(e-(e&$S))/HS}const BS=1,FS=2,vf=4,VS=8;class s1{constructor(t,r,n){this.pos=t,this.delInfo=r,this.recover=n}get deleted(){return(this.delInfo&VS)>0}get deletedBefore(){return(this.delInfo&(BS|vf))>0}get deletedAfter(){return(this.delInfo&(FS|vf))>0}get deletedAcross(){return(this.delInfo&vf)>0}}class Qr{constructor(t,r=!1){if(this.ranges=t,this.inverted=r,!t.length&&Qr.empty)return Qr.empty}recover(t){let r=0,n=zk(t);if(!this.inverted)for(let o=0;ot)break;let c=this.ranges[a+i],u=this.ranges[a+s],d=l+c;if(t<=d){let f=c?t==l?-1:t==d?1:r:r,p=l+o+(f<0?0:u);if(n)return p;let h=t==(r<0?l:d)?null:G_(a/3,t-l),m=t==l?FS:t==d?BS:vf;return(r<0?t!=l:t!=d)&&(m|=VS),new s1(p,m,h)}o+=u-c}return n?t+o:new s1(t+o,0,null)}touches(t,r){let n=0,o=zk(r),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;at)break;let c=this.ranges[a+i],u=l+c;if(t<=u&&a==o*3)return!0;n+=this.ranges[a+s]-c}return!1}forEach(t){let r=this.inverted?2:1,n=this.inverted?1:2;for(let o=0,i=0;o=0;r--){let o=t.getMirror(r);this.appendMap(t.maps[r].invert(),o!=null&&o>r?n-o-1:void 0)}}invert(){let t=new tl;return t.appendMappingInverted(this),t}map(t,r=1){if(this.mirror)return this._map(t,r,!0);for(let n=this.from;ni&&l!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),r.openStart,r.openEnd);return mt.fromReplace(t,this.from,this.to,i)}invert(){return new Gn(this.from,this.to,this.mark)}map(t){let r=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new Ho(r.pos,n.pos,this.mark)}merge(t){return t instanceof Ho&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ho(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ho(r.from,r.to,t.markFromJSON(r.mark))}}Pt.jsonID("addMark",Ho);class Gn extends Pt{constructor(t,r,n){super(),this.from=t,this.to=r,this.mark=n}apply(t){let r=t.slice(this.from,this.to),n=new W(nv(r.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),r.openStart,r.openEnd);return mt.fromReplace(t,this.from,this.to,n)}invert(){return new Ho(this.from,this.to,this.mark)}map(t){let r=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new Gn(r.pos,n.pos,this.mark)}merge(t){return t instanceof Gn&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Gn(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Gn(r.from,r.to,t.markFromJSON(r.mark))}}Pt.jsonID("removeMark",Gn);class Ti extends Pt{constructor(t,r){super(),this.pos=t,this.mark=r}apply(t){let r=t.nodeAt(this.pos);if(!r)return mt.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.addToSet(r.marks));return mt.fromReplace(t,this.pos,this.pos+1,new W(P.from(n),0,r.isLeaf?0:1))}invert(t){let r=t.nodeAt(this.pos);if(r){let n=this.mark.addToSet(r.marks);if(n.length==r.marks.length){for(let o=0;on.pos?null:new vt(r.pos,n.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number"||typeof r.gapFrom!="number"||typeof r.gapTo!="number"||typeof r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new vt(r.from,r.to,r.gapFrom,r.gapTo,W.fromJSON(t,r.slice),r.insert,!!r.structure)}}Pt.jsonID("replaceAround",vt);function a1(e,t,r){let n=e.resolve(t),o=r-t,i=n.depth;for(;o>0&&i>0&&n.indexAfter(i)==n.node(i).childCount;)i--,o--;if(o>0){let s=n.node(i).maybeChild(n.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function J_(e,t,r,n){let o=[],i=[],s,a;e.doc.nodesBetween(t,r,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!n.isInSet(d)&&u.type.allowsMarkType(n.type)){let f=Math.max(c,t),p=Math.min(c+l.nodeSize,r),h=n.addToSet(d);for(let m=0;me.step(l)),i.forEach(l=>e.step(l))}function X_(e,t,r,n){let o=[],i=0;e.doc.nodesBetween(t,r,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(n instanceof hd){let c=s.marks,u;for(;u=n.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else n?n.isInSet(s.marks)&&(l=[n]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,r);for(let u=0;ue.step(new Gn(s.from,s.to,s.style)))}function Q_(e,t,r,n=r.contentMatch){let o=e.doc.nodeAt(t),i=[],s=t+1;for(let a=0;a=0;a--)e.step(i[a])}function Z_(e,t,r){return(t==0||e.canReplace(t,e.childCount))&&(r==e.childCount||e.canReplace(0,r))}function Wl(e){let r=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let o=e.$from.node(n),i=e.$from.index(n),s=e.$to.indexAfter(n);if(nr;h--)m||n.index(h)>0?(m=!0,u=P.from(n.node(h).copy(u)),d++):l--;let f=P.empty,p=0;for(let h=i,m=!1;h>r;h--)m||o.after(h+1)=0;s--){if(n.size){let a=r[s].type.contentMatch.matchFragment(n);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=P.from(r[s].type.create(r[s].attrs,n))}let o=t.start,i=t.end;e.step(new vt(o,i,o,i,new W(n,0,0),r.length,!0))}function oA(e,t,r,n,o){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,r,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(n,o)&&iA(e.doc,e.mapping.slice(i).map(a),n)){e.clearIncompatible(e.mapping.slice(i).map(a,1),n);let l=e.mapping.slice(i),c=l.map(a,1),u=l.map(a+s.nodeSize,1);return e.step(new vt(c,u,c+1,u-1,new W(P.from(n.create(o,null,s.marks)),0,0),1,!0)),!1}})}function iA(e,t,r){let n=e.resolve(t),o=n.index();return n.parent.canReplaceWith(o,o+1,r)}function sA(e,t,r,n,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");r||(r=i.type);let s=r.create(n,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!r.validContent(i.content))throw new RangeError("Invalid content for node type "+r.name);e.step(new vt(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new W(P.from(s),0,0),1,!0))}function rl(e,t,r=1,n){let o=e.resolve(t),i=o.depth-r,s=n&&n[n.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=r-2;c>i;c--,u--){let d=o.node(c),f=o.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=n&&n[u+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let m=n&&n[u]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(p))return!1}let a=o.indexAfter(i),l=n&&n[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function aA(e,t,r=1,n){let o=e.doc.resolve(t),i=P.empty,s=P.empty;for(let a=o.depth,l=o.depth-r,c=r-1;a>l;a--,c--){i=P.from(o.node(a).copy(i));let u=n&&n[c];s=P.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}e.step(new Dt(t,t,new W(i.append(s),r,r),!0))}function md(e,t){let r=e.resolve(t),n=r.index();return lA(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function lA(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function cA(e,t,r){let n=new Dt(t-r,t+r,W.empty,!0);e.step(n)}function jS(e,t,r){let n=e.resolve(t);if(n.parent.canReplaceWith(n.index(),n.index(),r))return t;if(n.parentOffset==0)for(let o=n.depth-1;o>=0;o--){let i=n.index(o);if(n.node(o).canReplaceWith(i,i,r))return n.before(o+1);if(i>0)return null}if(n.parentOffset==n.parent.content.size)for(let o=n.depth-1;o>=0;o--){let i=n.indexAfter(o);if(n.node(o).canReplaceWith(i,i,r))return n.after(o+1);if(i=0;s--){let a=s==n.depth?0:n.pos<=(n.start(s+1)+n.end(s+1))/2?-1:1,l=n.index(s)+(a>0?1:0),c=n.node(s),u=!1;if(i==1)u=c.canReplace(l,l,o);else{let d=c.contentMatchAt(l).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?n.pos:a<0?n.before(s+1):n.after(s+1)}return null}function iv(e,t,r=t,n=W.empty){if(t==r&&!n.size)return null;let o=e.resolve(t),i=e.resolve(r);return US(o,i,n)?new Dt(t,r,n):new dA(o,i,n).fit()}function US(e,t,r){return!r.openStart&&!r.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),r.content)}class dA{constructor(t,r,n){this.$from=t,this.$to=r,this.unplaced=n,this.frontier=[],this.placed=P.empty;for(let o=0;o<=t.depth;o++){let i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=P.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,n=this.$from,o=this.close(t<0?this.$to:n.doc.resolve(t));if(!o)return null;let i=this.placed,s=n.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new W(i,s,a);return t>-1?new vt(n.pos,t,this.$to.pos,this.$to.end(),l,r):l.size||n.pos!=this.$to.pos?new Dt(n.pos,o.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let r=this.unplaced.content,n=0,o=this.unplaced.openEnd;n1&&(o=0),i.type.spec.isolating&&o<=n){t=n;break}r=i.content}for(let r=1;r<=2;r++)for(let n=r==1?t:this.unplaced.openStart;n>=0;n--){let o,i=null;n?(i=Vm(this.unplaced.content,n-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(r==1&&(s?c.matchType(s.type)||(d=c.fillBefore(P.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:n,frontierDepth:a,parent:i,inject:d};if(r==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:n,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:t,openStart:r,openEnd:n}=this.unplaced,o=Vm(t,r);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new W(t,r+1,Math.max(n,o.size+r>=t.size-n?r+1:0)),!0)}dropNode(){let{content:t,openStart:r,openEnd:n}=this.unplaced,o=Vm(t,r);if(o.childCount<=1&&r>0){let i=t.size-r<=r+o.size;this.unplaced=new W(kc(t,r-1,1),r-1,i?r-1:n)}else this.unplaced=new W(kc(t,r,1),r,n)}placeNodes({sliceDepth:t,frontierDepth:r,parent:n,inject:o,wrap:i}){for(;this.depth>r;)this.closeFrontierNode();if(i)for(let m=0;m1||l==0||m.content.size)&&(d=b,u.push(WS(m.mark(f.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?p:-1)))}let h=c==a.childCount;h||(p=-1),this.placed=xc(this.placed,r,P.from(u)),this.frontier[r].match=d,h&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,b=a;m1&&o==this.$to.end(--n);)++o;return o}findCloseLevel(t){e:for(let r=Math.min(this.depth,t.depth);r>=0;r--){let{match:n,type:o}=this.frontier[r],i=r=0;a--){let{match:l,type:c}=this.frontier[a],u=jm(t,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:r,fit:s,move:i?t.doc.resolve(t.after(r+1)):t}}}}close(t){let r=this.findCloseLevel(t);if(!r)return null;for(;this.depth>r.depth;)this.closeFrontierNode();r.fit.childCount&&(this.placed=xc(this.placed,r.depth,r.fit)),t=r.move;for(let n=r.depth+1;n<=t.depth;n++){let o=t.node(n),i=o.type.contentMatch.fillBefore(o.content,!0,t.index(n));this.openFrontierNode(o.type,o.attrs,i)}return t}openFrontierNode(t,r=null,n){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=xc(this.placed,this.depth,P.from(t.create(r,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let r=this.frontier.pop().match.fillBefore(P.empty,!0);r.childCount&&(this.placed=xc(this.placed,this.frontier.length,r))}}function kc(e,t,r){return t==0?e.cutByIndex(r,e.childCount):e.replaceChild(0,e.firstChild.copy(kc(e.firstChild.content,t-1,r)))}function xc(e,t,r){return t==0?e.append(r):e.replaceChild(e.childCount-1,e.lastChild.copy(xc(e.lastChild.content,t-1,r)))}function Vm(e,t){for(let r=0;r1&&(n=n.replaceChild(0,WS(n.firstChild,t-1,n.childCount==1?r-1:0))),t>0&&(n=e.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(e.type.contentMatch.matchFragment(n).fillBefore(P.empty,!0)))),e.copy(n)}function jm(e,t,r,n,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!r.compatibleContent(i.type))return null;let a=n.fillBefore(i.content,!0,s);return a&&!fA(r,i.content,s)?a:null}function fA(e,t,r){for(let n=r;n0;f--,p--){let h=o.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(f)>-1?a=f:o.before(f)==p&&s.splice(1,0,-f)}let l=s.indexOf(a),c=[],u=n.openStart;for(let f=n.content,p=0;;p++){let h=f.firstChild;if(c.push(h),p==n.openStart)break;f=h.content}for(let f=u-1;f>=0;f--){let p=c[f],h=pA(p.type);if(h&&!p.sameMarkup(o.node(Math.abs(a)-1)))u=f;else if(h||!p.type.isTextblock)break}for(let f=n.openStart;f>=0;f--){let p=(f+u+1)%(n.openStart+1),h=c[p];if(h)for(let m=0;m=0&&(e.replace(t,r,n),!(e.steps.length>d));f--){let p=s[f];p<0||(t=o.before(p),r=i.after(p))}}function KS(e,t,r,n,o){if(tn){let i=o.contentMatchAt(0),s=i.fillBefore(e).append(e);e=s.append(i.matchFragment(s).fillBefore(P.empty,!0))}return e}function mA(e,t,r,n){if(!n.isInline&&t==r&&e.doc.resolve(t).parent.content.size){let o=jS(e.doc,t,n.type);o!=null&&(t=r=o)}e.replaceRange(t,r,new W(P.from(n),0,0))}function gA(e,t,r){let n=e.doc.resolve(t),o=e.doc.resolve(r),i=qS(n,o);for(let s=0;s0&&(l||n.node(a-1).canReplace(n.index(a-1),o.indexAfter(a-1))))return e.delete(n.before(a),o.after(a))}for(let s=1;s<=n.depth&&s<=o.depth;s++)if(t-n.start(s)==n.depth-s&&r>n.end(s)&&o.end(s)-r!=o.depth-s)return e.delete(n.before(s),r);e.delete(t,r)}function qS(e,t){let r=[],n=Math.min(e.depth,t.depth);for(let o=n;o>=0;o--){let i=e.start(o);if(it.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(i==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==i-1)&&r.push(o)}return r}class nl extends Pt{constructor(t,r,n){super(),this.pos=t,this.attr=r,this.value=n}apply(t){let r=t.nodeAt(this.pos);if(!r)return mt.fail("No node at attribute step's position");let n=Object.create(null);for(let i in r.attrs)n[i]=r.attrs[i];n[this.attr]=this.value;let o=r.type.create(n,null,r.marks);return mt.fromReplace(t,this.pos,this.pos+1,new W(P.from(o),0,r.isLeaf?0:1))}getMap(){return Qr.empty}invert(t){return new nl(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let r=t.mapResult(this.pos,1);return r.deletedAfter?null:new nl(r.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,r){if(typeof r.pos!="number"||typeof r.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new nl(r.pos,r.attr,r.value)}}Pt.jsonID("attr",nl);class wu extends Pt{constructor(t,r){super(),this.attr=t,this.value=r}apply(t){let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let n=t.type.create(r,t.content,t.marks);return mt.ok(n)}getMap(){return Qr.empty}invert(t){return new wu(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,r){if(typeof r.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new wu(r.attr,r.value)}}Pt.jsonID("docAttr",wu);let kl=class extends Error{};kl=function e(t){let r=Error.call(this,t);return r.__proto__=e.prototype,r};kl.prototype=Object.create(Error.prototype);kl.prototype.constructor=kl;kl.prototype.name="TransformError";class vA{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new tl}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let r=this.maybeStep(t);if(r.failed)throw new kl(r.failed);return this}maybeStep(t){let r=t.apply(this.doc);return r.failed||this.addStep(t,r.doc),r}get docChanged(){return this.steps.length>0}addStep(t,r){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=r}replace(t,r=t,n=W.empty){let o=iv(this.doc,t,r,n);return o&&this.step(o),this}replaceWith(t,r,n){return this.replace(t,r,new W(P.from(n),0,0))}delete(t,r){return this.replace(t,r,W.empty)}insert(t,r){return this.replaceWith(t,t,r)}replaceRange(t,r,n){return hA(this,t,r,n),this}replaceRangeWith(t,r,n){return mA(this,t,r,n),this}deleteRange(t,r){return gA(this,t,r),this}lift(t,r){return eA(this,t,r),this}join(t,r=1){return cA(this,t,r),this}wrap(t,r){return nA(this,t,r),this}setBlockType(t,r=t,n,o=null){return oA(this,t,r,n,o),this}setNodeMarkup(t,r,n=null,o){return sA(this,t,r,n,o),this}setNodeAttribute(t,r,n){return this.step(new nl(t,r,n)),this}setDocAttribute(t,r){return this.step(new wu(t,r)),this}addNodeMark(t,r){return this.step(new Ti(t,r)),this}removeNodeMark(t,r){if(!(r instanceof Te)){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(r=r.isInSet(n.marks),!r)return this}return this.step(new bl(t,r)),this}split(t,r=1,n){return aA(this,t,r,n),this}addMark(t,r,n){return J_(this,t,r,n),this}removeMark(t,r,n){return X_(this,t,r,n),this}clearIncompatible(t,r,n){return Q_(this,t,r,n),this}}const Um=Object.create(null);class be{constructor(t,r,n){this.$anchor=t,this.$head=r,this.ranges=n||[new yA(t.min(r),t.max(r))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let r=0;r=0;i--){let s=r<0?Pa(t.node(0),t.node(i),t.before(i+1),t.index(i),r,n):Pa(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,r,n);if(s)return s}return null}static near(t,r=1){return this.findFrom(t,r)||this.findFrom(t,-r)||new mr(t.node(0))}static atStart(t){return Pa(t,t,0,0,1)||new mr(t)}static atEnd(t){return Pa(t,t,t.content.size,t.childCount,-1)||new mr(t)}static fromJSON(t,r){if(!r||!r.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Um[r.type];if(!n)throw new RangeError(`No selection type ${r.type} defined`);return n.fromJSON(t,r)}static jsonID(t,r){if(t in Um)throw new RangeError("Duplicate use of selection JSON ID "+t);return Um[t]=r,r.prototype.jsonID=t,r}getBookmark(){return le.between(this.$anchor,this.$head).getBookmark()}}be.prototype.visible=!0;class yA{constructor(t,r){this.$from=t,this.$to=r}}let Ik=!1;function Dk(e){!Ik&&!e.parent.inlineContent&&(Ik=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class le extends be{constructor(t,r=t){Dk(t),Dk(r),super(t,r)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,r){let n=t.resolve(r.map(this.head));if(!n.parent.inlineContent)return be.near(n);let o=t.resolve(r.map(this.anchor));return new le(o.parent.inlineContent?o:n,n)}replace(t,r=W.empty){if(super.replace(t,r),r==W.empty){let n=this.$from.marksAcross(this.$to);n&&t.ensureMarks(n)}}eq(t){return t instanceof le&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new fh(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,r){if(typeof r.anchor!="number"||typeof r.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new le(t.resolve(r.anchor),t.resolve(r.head))}static create(t,r,n=r){let o=t.resolve(r);return new this(o,n==r?o:t.resolve(n))}static between(t,r,n){let o=t.pos-r.pos;if((!n||o)&&(n=o>=0?1:-1),!r.parent.inlineContent){let i=be.findFrom(r,n,!0)||be.findFrom(r,-n,!0);if(i)r=i.$head;else return be.near(r,n)}return t.parent.inlineContent||(o==0?t=r:(t=(be.findFrom(t,-n,!0)||be.findFrom(t,n,!0)).$anchor,t.pos0?0:1);o>0?s=0;s+=o){let a=t.child(s);if(a.isAtom){if(!i&&ce.isSelectable(a))return ce.create(e,r-(o<0?a.nodeSize:0))}else{let l=Pa(e,a,r+o,o<0?a.childCount:0,o,i);if(l)return l}r+=a.nodeSize*o}return null}function $k(e,t,r){let n=e.steps.length-1;if(n{s==null&&(s=u)}),e.setSelection(be.near(e.doc.resolve(s),r))}const Hk=1,Hd=2,Bk=4;class kA extends vA{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=Hd,this}ensureMarks(t){return Te.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Hd)>0}addStep(t,r){super.addStep(t,r),this.updated=this.updated&~Hd,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,r=!0){let n=this.selection;return r&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Te.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,r,n){let o=this.doc.type.schema;if(r==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(n==null&&(n=r),n=n??r,!t)return this.deleteRange(r,n);let i=this.storedMarks;if(!i){let s=this.doc.resolve(r);i=n==r?s.marks():s.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(r,n,o.text(t,i)),this.selection.empty||this.setSelection(be.near(this.selection.$to)),this}}setMeta(t,r){return this.meta[typeof t=="string"?t:t.key]=r,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Bk,this}get scrolledIntoView(){return(this.updated&Bk)>0}}function Fk(e,t){return!t||!e?e:e.bind(t)}class wc{constructor(t,r,n){this.name=t,this.init=Fk(r.init,n),this.apply=Fk(r.apply,n)}}const xA=[new wc("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new wc("selection",{init(e,t){return e.selection||be.atStart(t.doc)},apply(e){return e.selection}}),new wc("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,r,n){return n.selection.$cursor?e.storedMarks:null}}),new wc("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class Wm{constructor(t,r){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=xA.slice(),r&&r.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new wc(n.key,n.spec.state,n))})}}class Ps{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,r=-1){for(let n=0;nn.toJSON())),t&&typeof t=="object")for(let n in t){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[n],i=o.spec.state;i&&i.toJSON&&(r[n]=i.toJSON.call(o,this[o.key]))}return r}static fromJSON(t,r,n){if(!r)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new Wm(t.schema,t.plugins),i=new Ps(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=Pi.fromJSON(t.schema,r.doc);else if(s.name=="selection")i.selection=be.fromJSON(i.doc,r.selection);else if(s.name=="storedMarks")r.storedMarks&&(i.storedMarks=r.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let a in n){let l=n[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(r,a)){i[s.name]=c.fromJSON.call(l,t,r[a],i);return}}i[s.name]=s.init(t,i)}}),i}}function GS(e,t,r){for(let n in e){let o=e[n];o instanceof Function?o=o.bind(t):n=="handleDOMEvents"&&(o=GS(o,t,{})),r[n]=o}return r}class Co{constructor(t){this.spec=t,this.props={},t.props&&GS(t.props,this,this.props),this.key=t.key?t.key.key:YS("plugin")}getState(t){return t[this.key]}}const Km=Object.create(null);function YS(e){return e in Km?e+"$"+ ++Km[e]:(Km[e]=0,e+"$")}class da{constructor(t="key"){this.key=YS(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}var wA=/[A-Z]/g,SA=/^ms-/,qm={};function EA(e){return"-"+e.toLowerCase()}function CA(e){if(qm.hasOwnProperty(e))return qm[e];var t=e.replace(wA,EA);return qm[e]=SA.test(t)?"-"+t:t}function MA(e){return CA(e)}function TA(e,t){return MA(e)+":"+t}function OA(e){var t="";for(var r in e){var n=e[r];typeof n!="string"&&typeof n!="number"||(t&&(t+=";"),t+=TA(r,n))}return t}function _A(){return typeof document<"u"?document:null}var JS=_A;function XS(e,t){if(typeof e!="string")return[e];var r=[e];typeof t=="string"||Array.isArray(t)?t={brackets:t}:t||(t={});var n=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],o=t.escape||"___",i=!!t.flat;n.forEach(function(l){var c=new RegExp(["\\",l[0],"[^\\",l[0],"\\",l[1],"]*\\",l[1]].join("")),u=[];function d(f,p,h){var m=r.push(f.slice(l[0].length,-l[1].length))-1;return u.push(m),o+m+o}r.forEach(function(f,p){for(var h,m=0;f!=h;)if(h=f,f=f.replace(c,d),m++>1e4)throw Error("References have circular dependency. Please, check them.");r[p]=f}),u=u.reverse(),r=r.map(function(f){return u.forEach(function(p){f=f.replace(new RegExp("(\\"+o+p+"\\"+o+")","g"),l[0]+"$1"+l[1])}),f})});var s=new RegExp("\\"+o+"([0-9]+)\\"+o);function a(l,c,u){for(var d=[],f,p=0;f=s.exec(l);){if(p++>1e4)throw Error("Circular references in parenthesis");d.push(l.slice(0,f.index)),d.push(a(c[f[1]],c)),l=l.slice(f.index+f[0].length)}return d.push(l),d}return i?r:a(r[0],r)}function QS(e,t){if(t&&t.flat){var r=t&&t.escape||"___",n=e[0],o;if(!n)return"";for(var i=new RegExp("\\"+r+"([0-9]+)\\"+r),s=0;n!=o;){if(s++>1e4)throw Error("Circular references in "+e);o=n,n=n.replace(i,a)}return n}return e.reduce(function l(c,u){return Array.isArray(u)&&(u=u.reduce(l,"")),c+u},"");function a(l,c){if(e[c]==null)throw Error("Reference "+c+"is undefined");return e[c]}}function ZS(e,t){return Array.isArray(e)?QS(e,t):XS(e,t)}ZS.parse=XS;ZS.stringify=QS;const AA={id:"extension.command.copy.label",message:"Copy",comment:"Label for copy command."},RA={id:"extension.command.copy.description",message:"Copy the selected text",comment:"Description for copy command."},PA={id:"extension.command.cut.label",message:"Cut",comment:"Label for cut command."},NA={id:"extension.command.cut.description",message:"Cut the selected text",comment:"Description for cut command."},zA={id:"extension.command.paste.label",message:"Paste",comment:"Label for paste command."},LA={id:"extension.command.paste.description",message:"Paste content into the editor",comment:"Description for paste command."},IA={id:"extension.command.select-all.label",message:"Select all",comment:"Label for select all command."},DA={id:"extension.command.select-all.description",message:"Select all content within the editor",comment:"Description for select all command."};var qi=Object.freeze({__proto__:null,COPY_DESCRIPTION:RA,COPY_LABEL:AA,CUT_DESCRIPTION:NA,CUT_LABEL:PA,PASTE_DESCRIPTION:LA,PASTE_LABEL:zA,SELECT_ALL_DESCRIPTION:DA,SELECT_ALL_LABEL:IA});const $A={id:"keyboard.shortcut.escape",message:"Enter",comment:"Label for escape key in shortcuts."},HA={id:"keyboard.shortcut.command",message:"Command",comment:"Label for command key in shortcuts."},BA={id:"keyboard.shortcut.control",message:"Control",comment:"Label for control key in shortcuts."},FA={id:"keyboard.shortcut.enter",message:"Enter",comment:"Label for enter key in shortcuts."},VA={id:"keyboard.shortcut.shift",message:"Shift",comment:"Label for shift key in shortcuts."},jA={id:"keyboard.shortcut.alt",message:"Alt",comment:"Label for alt key in shortcuts."},UA={id:"keyboard.shortcut.capsLock",message:"Caps Lock",comment:"Label for caps lock key in shortcuts."},WA={id:"keyboard.shortcut.backspace",message:"Backspace",comment:"Label for backspace key in shortcuts."},KA={id:"keyboard.shortcut.tab",message:"Tab",comment:"Label for tab key in shortcuts."},qA={id:"keyboard.shortcut.space",message:"Space",comment:"Label for space key in shortcuts."},GA={id:"keyboard.shortcut.delete",message:"Delete",comment:"Label for delete key in shortcuts."},YA={id:"keyboard.shortcut.pageUp",message:"Page Up",comment:"Label for page up key in shortcuts."},JA={id:"keyboard.shortcut.pageDown",message:"Page Down",comment:"Label for page down key in shortcuts."},XA={id:"keyboard.shortcut.home",message:"Home",comment:"Label for home key in shortcuts."},QA={id:"keyboard.shortcut.end",message:"End",comment:"Label for end key in shortcuts."},ZA={id:"keyboard.shortcut.arrowLeft",message:"Arrow Left",comment:"Label for arrow left key in shortcuts."},eR={id:"keyboard.shortcut.arrowRight",message:"Arrow Right",comment:"Label for arrow right key in shortcuts."},tR={id:"keyboard.shortcut.arrowUp",message:"Arrow Up",comment:"Label for arrow up key in shortcuts."},rR={id:"keyboard.shortcut.arrowDown",message:"Arrow Down",comment:"Label for arrowDown key in shortcuts."};var Mt=Object.freeze({__proto__:null,ALT_KEY:jA,ARROW_DOWN_KEY:rR,ARROW_LEFT_KEY:ZA,ARROW_RIGHT_KEY:eR,ARROW_UP_KEY:tR,BACKSPACE_KEY:WA,CAPS_LOCK_KEY:UA,COMMAND_KEY:HA,CONTROL_KEY:BA,DELETE_KEY:GA,END_KEY:QA,ENTER_KEY:FA,ESCAPE_KEY:$A,HOME_KEY:XA,PAGE_DOWN_KEY:JA,PAGE_UP_KEY:YA,SHIFT_KEY:VA,SPACE_KEY:qA,TAB_KEY:KA});const nR={id:"extension.command.toggle-blockquote.label",message:"Blockquote",comment:"Label for blockquote formatting command."},oR={id:"extension.command.toggle-blockquote.description",message:"Add blockquote formatting to the selected text",comment:"Description for blockquote formatting command."};var Vk=Object.freeze({__proto__:null,DESCRIPTION:oR,LABEL:nR});const iR={id:"extension.command.toggle-bold.label",message:"Bold",comment:"Label for bold formatting command."},sR={id:"extension.command.toggle-bold.description",message:"Add bold formatting to the selected text",comment:"Description for bold formatting command."};var jk=Object.freeze({__proto__:null,DESCRIPTION:sR,LABEL:iR});const aR={id:"extension.command.toggle-code-block.label",message:"Codeblock",comment:"Label for the code block command."},lR={id:"extension.command.toggle-code-block.description",message:"Add a code block",comment:"Description for the code block command."};var cR=Object.freeze({__proto__:null,DESCRIPTION:lR,LABEL:aR});const uR={id:"extension.command.toggle-code.label",message:"Code",comment:"Label for the inline code formatting."},dR={id:"extension.command.toggle-code.description",message:"Add inline code formatting to the selected text",comment:"Description for the inline code formatting command."};var fR=Object.freeze({__proto__:null,DESCRIPTION:dR,LABEL:uR});const pR={id:"extension.command.toggle-heading.label",message:`{level, select, 1 {Heading 1} +2 {Heading 2} +3 {Heading 3} +4 {Heading 4} +5 {Heading 5} +6 {Heading 6} +other {Heading}}`,comment:"Label for heading command with support for levels."};var hR=Object.freeze({__proto__:null,LABEL:pR});const mR={id:"extension.command.undo.label",message:"Undo",comment:"Label for undo."},gR={id:"extension.command.undo.description",message:"Undo the most recent action",comment:"Description for undo."},vR={id:"extension.command.redo.label",message:"Redo",comment:"Label for redo."},yR={id:"extension.command.redo.description",message:"Redo the most recent action",comment:"Description for redo."};var np=Object.freeze({__proto__:null,REDO_DESCRIPTION:yR,REDO_LABEL:vR,UNDO_DESCRIPTION:gR,UNDO_LABEL:mR});const bR={id:"extension.command.insert-horizontal-rule.label",message:"Divider",comment:"Label for inserting a horizontal rule (divider) command."},kR={id:"extension.command.insert-horizontal-rule.description",message:"Separate content with a diving horizontal line",comment:"Description for inserting a horizontal rule (divider) command."};var Uk=Object.freeze({__proto__:null,DESCRIPTION:kR,LABEL:bR});const xR={id:"extension.command.toggle-italic.label",message:"Italic",comment:"Label for italic formatting command."},wR={id:"extension.command.toggle-italic.description",message:"Italicize the selected text",comment:"Description for italic formatting command."};var Wk=Object.freeze({__proto__:null,DESCRIPTION:wR,LABEL:xR});const SR={id:"extension.command.toggle-ordered-list.label",message:"Ordered list",comment:"Label for inserting an ordered list into the editor."},ER={id:"extension.command.toggle-bullet-list.description",message:"Bulleted list",comment:"Description for inserting a bullet list into the editor."},CR={id:"extension.command.toggle-task-list.description",message:"Tasked list",comment:"Description for inserting a task list into the editor."};var av=Object.freeze({__proto__:null,BULLET_LIST_LABEL:ER,ORDERED_LIST_LABEL:SR,TASK_LIST_LABEL:CR});const MR={id:"extension.command.insert-paragraph.label",message:"Insert Paragraph",comment:"Label for inserting a paragraph."},TR={id:"extension.command.insert-paragraph.description",message:"Insert a new paragraph",comment:"Description for inserting a paragraph."},OR={id:"extension.command.convert-paragraph.label",message:"Convert Paragraph",comment:"Label for converting the current node into a paragraph."},_R={id:"extension.command.convert-paragraph.description",message:"Convert current block into a paragraph block.",comment:"Description for converting a paragraph."};var op=Object.freeze({__proto__:null,CONVERT_DESCRIPTION:_R,CONVERT_LABEL:OR,INSERT_DESCRIPTION:TR,INSERT_LABEL:MR});const AR={id:"extension.command.toggle-strike.label",message:"Strikethrough",comment:"Label for strike formatting command."},RR={id:"extension.command.toggle-strike.description",message:"Strikethrough the selected text",comment:"Description for strike formatting command."};var Kk=Object.freeze({__proto__:null,DESCRIPTION:RR,LABEL:AR});const PR={id:"extension.command.toggle-underline.label",message:"Underline",comment:"Label for underline formatting command."},NR={id:"extension.command.toggle-underline.description",message:"Underline the selected text",comment:"Description for underline formatting command."};var qk=Object.freeze({__proto__:null,DESCRIPTION:NR,LABEL:PR});class fa{constructor(t,r){this.match=t,this.match=t,this.handler=typeof r=="string"?zR(r):r}}function zR(e){return function(t,r,n,o){let i=e;if(r[1]){let s=r[0].lastIndexOf(r[1]);i+=r[0].slice(s+r[1].length),n+=s;let a=n-o;a>0&&(i=r[0].slice(s-a,s)+i,n=o)}return t.tr.insertText(i,n,o)}}const LR=500;function IR({rules:e}){let t=new Co({state:{init(){return null},apply(r,n){let o=r.getMeta(this);return o||(r.selectionSet||r.docChanged?null:n)}},props:{handleTextInput(r,n,o,i){return Gk(r,n,o,i,e,t)},handleDOMEvents:{compositionend:r=>{setTimeout(()=>{let{$cursor:n}=r.state.selection;n&&Gk(r,n.pos,n.pos,"",e,t)})}}},isInputRules:!0});return t}function Gk(e,t,r,n,o,i){if(e.composing)return!1;let s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;let l=a.parent.textBetween(Math.max(0,a.parentOffset-LR),a.parentOffset,null,"")+n;for(let c=0;c{let r=e.plugins;for(let n=0;n=0;l--)s.step(a.steps[l].invert(a.docs[l]));if(i.text){let l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,e.schema.text(i.text,l))}else s.delete(i.from,i.to);t(s)}return!0}}return!1};function ph(e,t,r=null,n){return new fa(e,(o,i,s,a)=>{let l=r instanceof Function?r(i):r,c=o.tr.delete(s,a),u=c.doc.resolve(s),d=u.blockRange(),f=d&&ov(d,t,l);if(!f)return null;c.wrap(d,f);let p=c.doc.resolve(s-1).nodeBefore;return p&&p.type==t&&md(c.doc,s-1)&&(!n||n(i,p))&&c.join(s-1),c})}function $R(e,t,r=null){return new fa(e,(n,o,i,s)=>{let a=n.doc.resolve(i),l=r instanceof Function?r(o):r;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t)?n.tr.delete(i,s).setBlockType(i,i,t,l):null})}const pr=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Su=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let Yk=null;const zo=function(e,t,r){let n=Yk||(Yk=document.createRange());return n.setEnd(e,r??e.nodeValue.length),n.setStart(e,t||0),n},Js=function(e,t,r,n){return r&&(Jk(e,t,r,n,-1)||Jk(e,t,r,n,1))},HR=/^(img|br|input|textarea|hr)$/i;function Jk(e,t,r,n,o){for(;;){if(e==r&&t==n)return!0;if(t==(o<0?0:fo(e))){let i=e.parentNode;if(!i||i.nodeType!=1||lv(e)||HR.test(e.nodeName)||e.contentEditable=="false")return!1;t=pr(e)+(o<0?0:1),e=i}else if(e.nodeType==1){if(e=e.childNodes[t+(o<0?-1:0)],e.contentEditable=="false")return!1;t=o<0?fo(e):0}else return!1}}function fo(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function BR(e,t,r){for(let n=t==0,o=t==fo(e);n||o;){if(e==r)return!0;let i=pr(e);if(e=e.parentNode,!e)return!1;n=n&&i==0,o=o&&i==fo(e)}}function lv(e){let t;for(let r=e;r&&!(t=r.pmViewDesc);r=r.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const hh=function(e){return e.focusNode&&Js(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function As(e,t){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=e,r.key=r.code=t,r}function FR(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function VR(e,t,r){if(e.caretPositionFromPoint)try{let n=e.caretPositionFromPoint(t,r);if(n)return{node:n.offsetNode,offset:n.offset}}catch{}if(e.caretRangeFromPoint){let n=e.caretRangeFromPoint(t,r);if(n)return{node:n.startContainer,offset:n.startOffset}}}const ko=typeof navigator<"u"?navigator:null,Xk=typeof document<"u"?document:null,as=ko&&ko.userAgent||"",l1=/Edge\/(\d+)/.exec(as),eE=/MSIE \d/.exec(as),c1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(as),Pr=!!(eE||c1||l1),Ni=eE?document.documentMode:c1?+c1[1]:l1?+l1[1]:0,Qn=!Pr&&/gecko\/(\d+)/i.test(as);Qn&&+(/Firefox\/(\d+)/.exec(as)||[0,0])[1];const u1=!Pr&&/Chrome\/(\d+)/.exec(as),ar=!!u1,jR=u1?+u1[1]:0,yr=!Pr&&!!ko&&/Apple Computer/.test(ko.vendor),xl=yr&&(/Mobile\/\w+/.test(as)||!!ko&&ko.maxTouchPoints>2),gn=xl||(ko?/Mac/.test(ko.platform):!1),UR=ko?/Win/.test(ko.platform):!1,Un=/Android \d/.test(as),gd=!!Xk&&"webkitFontSmoothing"in Xk.documentElement.style,WR=gd?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function KR(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Oo(e,t){return typeof e=="number"?e:e[t]}function qR(e){let t=e.getBoundingClientRect(),r=t.width/e.offsetWidth||1,n=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*r,top:t.top,bottom:t.top+e.clientHeight*n}}function Qk(e,t,r){let n=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=r||e.dom;s;s=Su(s)){if(s.nodeType!=1)continue;let a=s,l=a==i.body,c=l?KR(i):qR(a),u=0,d=0;if(t.topc.bottom-Oo(n,"bottom")&&(d=t.bottom-t.top>c.bottom-c.top?t.top+Oo(o,"top")-c.top:t.bottom-c.bottom+Oo(o,"bottom")),t.leftc.right-Oo(n,"right")&&(u=t.right-c.right+Oo(o,"right")),u||d)if(l)i.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let h=a.scrollLeft-f,m=a.scrollTop-p;t={left:t.left-h,top:t.top-m,right:t.right-h,bottom:t.bottom-m}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function GR(e){let t=e.dom.getBoundingClientRect(),r=Math.max(0,t.top),n,o;for(let i=(t.left+t.right)/2,s=r+1;s=r-20){n=a,o=l.top;break}}return{refDOM:n,refTop:o,stack:tE(e.dom)}}function tE(e){let t=[],r=e.ownerDocument;for(let n=e;n&&(t.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),e!=r);n=Su(n));return t}function YR({refDOM:e,refTop:t,stack:r}){let n=e?e.getBoundingClientRect().top:0;rE(r,n==0?0:n-t)}function rE(e,t){for(let r=0;r=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);let m=h.left>t.left?h.left-t.left:h.right=(h.left+h.right)/2?1:0));continue}}else h.top>t.top&&!l&&h.left<=t.left&&h.right>=t.left&&(l=u,c={left:Math.max(h.left,Math.min(h.right,t.left)),top:h.top});!r&&(t.left>=h.right&&t.top>=h.top||t.left>=h.left&&t.top>=h.bottom)&&(i=d+1)}}return!r&&l&&(r=l,o=c,n=0),r&&r.nodeType==3?XR(r,o):!r||n&&r.nodeType==1?{node:e,offset:i}:nE(r,o)}function XR(e,t){let r=e.nodeValue.length,n=document.createRange();for(let o=0;o=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}function cv(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function QR(e,t){let r=e.parentNode;return r&&/^li$/i.test(r.nodeName)&&t.left(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(n,o,i)}function eP(e,t,r,n){let o=-1;for(let i=t,s=!1;i!=e.dom;){let a=e.docView.nearestDesc(i,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent&&!s||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&!s&&(s=!0,l.left>n.left||l.top>n.top?o=a.posBefore:(l.right-1?o:e.docView.posFromDOM(t,r,-1)}function oE(e,t,r){let n=e.childNodes.length;if(n&&r.topt.top&&o++}let c;gd&&o&&n.nodeType==1&&(c=n.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=t.top&&o--,n==e.dom&&o==n.childNodes.length-1&&n.lastChild.nodeType==1&&t.top>n.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(o==0||n.nodeType!=1||n.childNodes[o-1].nodeName!="BR")&&(a=eP(e,n,o,t))}a==null&&(a=ZR(e,s,t));let l=e.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Zk(e){return e.top=0&&o==n.nodeValue.length?(l--,u=1):r<0?l--:c++,oc(pi(zo(n,l,c),u),u<0)}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(i==null&&o&&(r<0||o==fo(n))){let l=n.childNodes[o-1];if(l.nodeType==1)return Gm(l.getBoundingClientRect(),!1)}if(i==null&&o=0)}if(i==null&&o&&(r<0||o==fo(n))){let l=n.childNodes[o-1],c=l.nodeType==3?zo(l,fo(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return oc(pi(c,1),!1)}if(i==null&&o=0)}function oc(e,t){if(e.width==0)return e;let r=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:r,right:r}}function Gm(e,t){if(e.height==0)return e;let r=t?e.top:e.bottom;return{top:r,bottom:r,left:e.left,right:e.right}}function sE(e,t,r){let n=e.state,o=e.root.activeElement;n!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return r()}finally{n!=t&&e.updateState(n),o!=e.dom&&o&&o.focus()}}function nP(e,t,r){let n=t.selection,o=r=="up"?n.$from:n.$to;return sE(e,t,()=>{let{node:i}=e.docView.domFromPos(o.pos,r=="up"?-1:1);for(;;){let a=e.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=iE(e,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=zo(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(r=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const oP=/[\u0590-\u08ac]/;function iP(e,t,r){let{$head:n}=t.selection;if(!n.parent.isTextblock)return!1;let o=n.parentOffset,i=!o,s=o==n.parent.content.size,a=e.domSelection();return!oP.test(n.parent.textContent)||!a.modify?r=="left"||r=="backward"?i:s:sE(e,t,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=e.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",r,"character");let p=n.depth?e.docView.domAfterPos(n.before()):e.dom,{focusNode:h,focusOffset:m}=e.domSelectionRange(),b=h&&!p.contains(h.nodeType==1?h:h.parentNode)||l==h&&c==m;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),b})}let ex=null,tx=null,rx=!1;function sP(e,t,r){return ex==t&&tx==r?rx:(ex=t,tx=r,rx=r=="up"||r=="down"?nP(e,t,r):iP(e,t,r))}const wn=0,nx=1,Ns=2,xo=3;class vd{constructor(t,r,n,o){this.parent=t,this.children=r,this.dom=n,this.contentDOM=o,this.dirty=wn,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,r,n){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let r=0;rpr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(r==0)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&r==t.childNodes.length)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??n>0?this.posAtEnd:this.posAtStart}nearestDesc(t,r=!1){for(let n=!0,o=t;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!r||i.node))if(n&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(t.nodeType==1?t:t.parentNode):s==t))n=!1;else return i}}getDesc(t){let r=t.pmViewDesc;for(let n=r;n;n=n.parent)if(n==this)return r}posFromDOM(t,r,n){for(let o=t;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(t,r,n)}return-1}descAt(t){for(let r=0,n=0;rt||s instanceof lE){o=t-i;break}i=a}if(o)return this.children[n].domFromPos(o-this.children[n].border,r);for(let i;n&&!(i=this.children[n-1]).size&&i instanceof aE&&i.side>=0;n--);if(r<=0){let i,s=!0;for(;i=n?this.children[n-1]:null,!(!i||i.dom.parentNode==this.contentDOM);n--,s=!1);return i&&r&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,r):{node:this.contentDOM,offset:i?pr(i.dom)+1:0}}else{let i,s=!0;for(;i=n=u&&r<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,r,u);t=s;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=pr(f.dom)+1;break}t-=f.size}o==-1&&(o=0)}if(o>-1&&(c>r||a==this.children.length-1)){r=c;for(let u=a+1;up&&sr){let p=a;a=l,l=p}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,r){for(let n=0,o=0;o=n:tn){let a=n+i.border,l=s-i.border;if(t>=a&&r<=l){this.dirty=t==n||r==s?Ns:nx,t==a&&r==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=xo:i.markDirty(t-a,r-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Ns:xo}n=s}this.dirty=Ns}markParentsDirty(){let t=1;for(let r=this.parent;r;r=r.parent,t++){let n=t==1?Ns:nx;r.dirty{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!r.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=r,this.widget=r,i=this}matchesWidget(t){return this.dirty==wn&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let r=this.widget.spec.stopEvent;return r?r(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class aP extends vd{constructor(t,r,n,o){super(t,[],r,null),this.textDOM=n,this.text=o}get size(){return this.text.length}localPosFromDOM(t,r){return t!=this.textDOM?this.posAtStart+(r?this.size:0):this.posAtStart+r}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class Xs extends vd{constructor(t,r,n,o){super(t,[],n,o),this.mark=r}static create(t,r,n,o){let i=o.nodeViews[r.type.name],s=i&&i(r,o,n);return(!s||!s.dom)&&(s=kn.renderSpec(document,r.type.spec.toDOM(r,n))),new Xs(t,r,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&xo||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=xo&&this.mark.eq(t)}markDirty(t,r){if(super.markDirty(t,r),this.dirty!=wn){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty0&&(i=p1(i,0,t,n));for(let a=0;a{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},n,o),u=c&&c.dom,d=c&&c.contentDOM;if(r.isText){if(!u)u=document.createTextNode(r.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=kn.renderSpec(document,r.type.spec.toDOM(r)));!d&&!r.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),r.type.spec.draggable&&(u.draggable=!0));let f=u;return u=dE(u,n,r),c?l=new lP(t,r,n,o,u,d||null,f,c,i,s+1):r.isText?new mh(t,r,n,o,u,f,i):new zi(t,r,n,o,u,d||null,f,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let n=this.children[r];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}t.contentElement||(t.getContent=()=>P.empty)}return t}matchesNode(t,r,n){return this.dirty==wn&&t.eq(this.node)&&f1(r,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,r){let n=this.node.inlineContent,o=r,i=t.composing?this.localCompositionInfo(t,r):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new uP(this,s&&s.node,t);pP(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,n,t):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?Te.none:this.node.child(u).marks,n,t),l.placeWidget(c,t,o)},(c,u,d,f)=>{l.syncToMarks(c.marks,n,t);let p;l.findNodeMatch(c,u,d,f)||a&&t.state.selection.from>o&&t.state.selection.to-1&&l.updateNodeAt(c,u,d,p,t)||l.updateNextNode(c,u,d,t,f,o)||l.addNode(c,u,d,t,o),o+=c.nodeSize}),l.syncToMarks([],n,t),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Ns)&&(s&&this.protectLocalComposition(t,s),cE(this.contentDOM,this.children,t),xl&&hP(this.dom))}localCompositionInfo(t,r){let{from:n,to:o}=t.state.selection;if(!(t.state.selection instanceof le)||nr+this.node.content.size)return null;let i=t.domSelectionRange(),s=mP(i.focusNode,i.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,l=gP(this.node.content,a,n-r,o-r);return l<0?null:{node:s,pos:l,text:a}}else return{node:s,pos:-1,text:""}}protectLocalComposition(t,{node:r,pos:n,text:o}){if(this.getDesc(r))return;let i=r;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new aP(this,i,r,o);t.input.compositionNodes.push(s),this.children=p1(this.children,n,n+o.length,t,s)}update(t,r,n,o){return this.dirty==xo||!t.sameMarkup(this.node)?!1:(this.updateInner(t,r,n,o),!0)}updateInner(t,r,n,o){this.updateOuterDeco(r),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=wn}updateOuterDeco(t){if(f1(t,this.outerDeco))return;let r=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=uE(this.dom,this.nodeDOM,d1(this.outerDeco,this.node,r),d1(t,this.node,r)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function ox(e,t,r,n,o){dE(n,t,e);let i=new zi(void 0,e,t,r,n,n,n,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class mh extends zi{constructor(t,r,n,o,i,s,a){super(t,r,n,o,i,null,s,a,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,r,n,o){return this.dirty==xo||this.dirty!=wn&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(r),(this.dirty!=wn||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=t,this.dirty=wn,!0)}inParent(){let t=this.parent.contentDOM;for(let r=this.nodeDOM;r;r=r.parentNode)if(r==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,r,n){return t==this.nodeDOM?this.posAtStart+Math.min(r,this.node.text.length):super.localPosFromDOM(t,r,n)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,r,n){let o=this.node.cut(t,r),i=document.createTextNode(o.text);return new mh(this.parent,o,this.outerDeco,this.innerDeco,i,i,n)}markDirty(t,r){super.markDirty(t,r),this.dom!=this.nodeDOM&&(t==0||r==this.nodeDOM.nodeValue.length)&&(this.dirty=xo)}get domAtom(){return!1}}class lE extends vd{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==wn&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class lP extends zi{constructor(t,r,n,o,i,s,a,l,c,u){super(t,r,n,o,i,s,a,c,u),this.spec=l}update(t,r,n,o){if(this.dirty==xo)return!1;if(this.spec.update){let i=this.spec.update(t,r,n);return i&&this.updateInner(t,r,n,o),i}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,r,n,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,r,n,o){this.spec.setSelection?this.spec.setSelection(t,r,n):super.setSelection(t,r,n,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function cE(e,t,r){let n=e.firstChild,o=!1;for(let i=0;i>1,s=Math.min(i,t.length);for(;o-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=Xs.create(this.top,t[i],r,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(t,r,n,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(t,r,n))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(n){let c=r.children[n-1];if(c instanceof Xs)r=c,n=c.children.length;else{a=c,n--;break}}else{if(r==t)break e;n=r.parent.children.indexOf(r),r=r.parent}let l=a.node;if(l){if(l!=e.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function fP(e,t){return e.type.side-t.type.side}function pP(e,t,r,n){let o=t.locals(e),i=0;if(o.length==0){for(let c=0;ci;)a.push(o[s++]);let h=i+f.nodeSize;if(f.isText){let b=h;s!b.inline):a.slice();n(f,m,t.forChild(i,f),p),i=h}}function hP(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function mP(e,t){for(;;){if(e.nodeType==3)return e;if(e.nodeType==1&&t>0){if(e.childNodes.length>t&&e.childNodes[t].nodeType==3)return e.childNodes[t];e=e.childNodes[t-1],t=fo(e)}else if(e.nodeType==1&&t=r){if(i>=n&&l.slice(n-t.length-a,n-a)==t)return n-t.length;let c=a=0&&c+t.length+a>=r)return a+c;if(r==n&&l.length>=n+t.length-a&&l.slice(n-a,n-a+t.length)==t)return n}}return-1}function p1(e,t,r,n,o){let i=[];for(let s=0,a=0;s=r||u<=t?i.push(l):(cr&&i.push(l.slice(r-c,l.size,n)))}return i}function uv(e,t=null){let r=e.domSelectionRange(),n=e.state.doc;if(!r.focusNode)return null;let o=e.docView.nearestDesc(r.focusNode),i=o&&o.size==0,s=e.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(s<0)return null;let a=n.resolve(s),l,c;if(hh(r)){for(l=a;o&&!o.node;)o=o.parent;let u=o.node;if(o&&u.isAtom&&ce.isSelectable(u)&&o.parent&&!(u.isInline&&BR(r.focusNode,r.focusOffset,o.dom))){let d=o.posBefore;c=new ce(s==d?a:n.resolve(d))}}else{let u=e.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(u<0)return null;l=n.resolve(u)}if(!c){let u=t=="pointer"||e.state.selection.head{(r.anchorNode!=n||r.anchorOffset!=o)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!fE(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function yP(e){let t=e.domSelection(),r=document.createRange(),n=e.cursorWrapper.dom,o=n.nodeName=="IMG";o?r.setEnd(n.parentNode,pr(n)+1):r.setEnd(n,0),r.collapse(!1),t.removeAllRanges(),t.addRange(r),!o&&!e.state.selection.visible&&Pr&&Ni<=11&&(n.disabled=!0,n.disabled=!1)}function pE(e,t){if(t instanceof ce){let r=e.docView.descAt(t.from);r!=e.lastSelectedViewDesc&&(cx(e),r&&r.selectNode(),e.lastSelectedViewDesc=r)}else cx(e)}function cx(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function dv(e,t,r,n){return e.someProp("createSelectionBetween",o=>o(e,t,r))||le.between(t,r,n)}function ux(e){return e.editable&&!e.hasFocus()?!1:hE(e)}function hE(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function bP(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),r=e.domSelectionRange();return Js(t.node,t.offset,r.anchorNode,r.anchorOffset)}function h1(e,t){let{$anchor:r,$head:n}=e.selection,o=t>0?r.max(n):r.min(n),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&be.findFrom(i,t)}function bi(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function dx(e,t,r){let n=e.state.selection;if(n instanceof le)if(r.indexOf("s")>-1){let{$head:o}=n,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=e.state.doc.resolve(o.pos+i.nodeSize*(t<0?-1:1));return bi(e,new le(n.$anchor,s))}else if(n.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let o=h1(e.state,t);return o&&o instanceof ce?bi(e,o):!1}else if(!(gn&&r.indexOf("m")>-1)){let o=n.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let a=t<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=e.docView.descAt(a))&&!s.contentDOM?ce.isSelectable(i)?bi(e,new ce(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):gd?bi(e,new le(e.state.doc.resolve(t<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(n instanceof ce&&n.node.isInline)return bi(e,new le(t>0?n.$to:n.$from));{let o=h1(e.state,t);return o?bi(e,o):!1}}}function ip(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function ou(e,t){let r=e.pmViewDesc;return r&&r.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function xa(e,t){return t<0?kP(e):xP(e)}function kP(e){let t=e.domSelectionRange(),r=t.focusNode,n=t.focusOffset;if(!r)return;let o,i,s=!1;for(Qn&&r.nodeType==1&&n0){if(r.nodeType!=1)break;{let a=r.childNodes[n-1];if(ou(a,-1))o=r,i=--n;else if(a.nodeType==3)r=a,n=r.nodeValue.length;else break}}else{if(mE(r))break;{let a=r.previousSibling;for(;a&&ou(a,-1);)o=r.parentNode,i=pr(a),a=a.previousSibling;if(a)r=a,n=ip(r);else{if(r=r.parentNode,r==e.dom)break;n=0}}}s?m1(e,r,n):o&&m1(e,o,i)}function xP(e){let t=e.domSelectionRange(),r=t.focusNode,n=t.focusOffset;if(!r)return;let o=ip(r),i,s;for(;;)if(n{e.state==o&&Ko(e)},50)}function fx(e,t){let r=e.state.doc.resolve(t);if(!(ar||UR)&&r.parent.inlineContent){let o=e.coordsAtPos(t);if(t>r.start()){let i=e.coordsAtPos(t-1),s=(i.top+i.bottom)/2;if(s>o.top&&s1)return i.lefto.top&&s1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function px(e,t,r){let n=e.state.selection;if(n instanceof le&&!n.empty||r.indexOf("s")>-1||gn&&r.indexOf("m")>-1)return!1;let{$from:o,$to:i}=n;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=h1(e.state,t);if(s&&s instanceof ce)return bi(e,s)}if(!o.parent.inlineContent){let s=t<0?o:i,a=n instanceof mr?be.near(s,t):be.findFrom(s,t);return a?bi(e,a):!1}return!1}function hx(e,t){if(!(e.state.selection instanceof le))return!0;let{$head:r,$anchor:n,empty:o}=e.state.selection;if(!r.sameParent(n))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(i&&!i.isText){let s=e.state.tr;return t<0?s.delete(r.pos-i.nodeSize,r.pos):s.delete(r.pos,r.pos+i.nodeSize),e.dispatch(s),!0}return!1}function mx(e,t,r){e.domObserver.stop(),t.contentEditable=r,e.domObserver.start()}function EP(e){if(!yr||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:r}=e.domSelectionRange();if(t&&t.nodeType==1&&r==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let n=t.firstChild;mx(e,n,"true"),setTimeout(()=>mx(e,n,"false"),20)}return!1}function CP(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function MP(e,t){let r=t.keyCode,n=CP(t);if(r==8||gn&&r==72&&n=="c")return hx(e,-1)||xa(e,-1);if(r==46&&!t.shiftKey||gn&&r==68&&n=="c")return hx(e,1)||xa(e,1);if(r==13||r==27)return!0;if(r==37||gn&&r==66&&n=="c"){let o=r==37?fx(e,e.state.selection.from)=="ltr"?-1:1:-1;return dx(e,o,n)||xa(e,o)}else if(r==39||gn&&r==70&&n=="c"){let o=r==39?fx(e,e.state.selection.from)=="ltr"?1:-1:1;return dx(e,o,n)||xa(e,o)}else{if(r==38||gn&&r==80&&n=="c")return px(e,-1,n)||xa(e,-1);if(r==40||gn&&r==78&&n=="c")return EP(e)||px(e,1,n)||xa(e,1);if(n==(gn?"m":"c")&&(r==66||r==73||r==89||r==90))return!0}return!1}function gE(e,t){e.someProp("transformCopied",p=>{t=p(t,e)});let r=[],{content:n,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&n.childCount==1&&n.firstChild.childCount==1;){o--,i--;let p=n.firstChild;r.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),n=p.content}let s=e.someProp("clipboardSerializer")||kn.fromSchema(e.state.schema),a=wE(),l=a.createElement("div");l.appendChild(s.serializeFragment(n,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=xE[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let h=a.createElement(u[p]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(r)}`);let f=e.someProp("clipboardTextSerializer",p=>p(t,e))||t.content.textBetween(0,t.content.size,` + +`);return{dom:l,text:f}}function vE(e,t,r,n,o){let i=o.parent.type.spec.code,s,a;if(!r&&!t)return null;let l=t&&(n||i||!r);if(l){if(e.someProp("transformPastedText",f=>{t=f(t,i||n,e)}),i)return t?new W(P.from(e.state.schema.text(t.replace(/\r\n?/g,` +`))),0,0):W.empty;let d=e.someProp("clipboardTextParser",f=>f(t,o,n,e));if(d)a=d;else{let f=o.marks(),{schema:p}=e.state,h=kn.fromSchema(p);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(m=>{let b=s.appendChild(document.createElement("p"));m&&b.appendChild(h.serializeNode(p.text(m,f)))})}}else e.someProp("transformPastedHTML",d=>{r=d(r,e)}),s=_P(r),gd&&AP(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||rv.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!TP.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)a=RP(gx(a,+u[1],+u[2]),u[4]);else if(a=W.maxOpen(OP(a.content,o),!0),a.openStart||a.openEnd){let d=0,f=0;for(let p=a.content.firstChild;d{a=d(a,e)}),a}const TP=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function OP(e,t){if(e.childCount<2)return e;for(let r=t.depth;r>=0;r--){let o=t.node(r).contentMatchAt(t.index(r)),i,s=[];if(e.forEach(a=>{if(!s)return;let l=o.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&i.length&&bE(l,i,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=kE(s[s.length-1],i.length));let u=yE(a,l);s.push(u),o=o.matchType(u.type),i=l}}),s)return P.from(s)}return e}function yE(e,t,r=0){for(let n=t.length-1;n>=r;n--)e=t[n].create(null,P.from(e));return e}function bE(e,t,r,n,o){if(o1&&(i=0),o=r&&(a=t<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(P.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function gx(e,t,r){return t]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let r=wE().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(e),o;if((o=n&&xE[n[1].toLowerCase()])&&(e=o.map(i=>"<"+i+">").join("")+e+o.map(i=>"").reverse().join("")),r.innerHTML=e,o)for(let i=0;i=0;a-=2){let l=r.nodes[n[a]];if(!l||l.hasRequiredAttrs())break;o=P.from(l.create(n[a+1],o)),i++,s++}return new W(o,i,s)}const br={},kr={},PP={touchstart:!0,touchmove:!0};class NP{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function zP(e){for(let t in br){let r=br[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=n=>{IP(e,n)&&!fv(e,n)&&(e.editable||!(n.type in kr))&&r(e,n)},PP[t]?{passive:!0}:void 0)}yr&&e.dom.addEventListener("input",()=>null),v1(e)}function Oi(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function LP(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function v1(e){e.someProp("handleDOMEvents",t=>{for(let r in t)e.input.eventHandlers[r]||e.dom.addEventListener(r,e.input.eventHandlers[r]=n=>fv(e,n))})}function fv(e,t){return e.someProp("handleDOMEvents",r=>{let n=r[t.type];return n?n(e,t)||t.defaultPrevented:!1})}function IP(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let r=t.target;r!=e.dom;r=r.parentNode)if(!r||r.nodeType==11||r.pmViewDesc&&r.pmViewDesc.stopEvent(t))return!1;return!0}function DP(e,t){!fv(e,t)&&br[t.type]&&(e.editable||!(t.type in kr))&&br[t.type](e,t)}kr.keydown=(e,t)=>{let r=t;if(e.input.shiftKey=r.keyCode==16||r.shiftKey,!EE(e,r)&&(e.input.lastKeyCode=r.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Un&&ar&&r.keyCode==13)))if(r.keyCode!=229&&e.domObserver.forceFlush(),xl&&r.keyCode==13&&!r.ctrlKey&&!r.altKey&&!r.metaKey){let n=Date.now();e.input.lastIOSEnter=n,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==n&&(e.someProp("handleKeyDown",o=>o(e,As(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",n=>n(e,r))||MP(e,r)?r.preventDefault():Oi(e,"key")};kr.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};kr.keypress=(e,t)=>{let r=t;if(EE(e,r)||!r.charCode||r.ctrlKey&&!r.altKey||gn&&r.metaKey)return;if(e.someProp("handleKeyPress",o=>o(e,r))){r.preventDefault();return}let n=e.state.selection;if(!(n instanceof le)||!n.$from.sameParent(n.$to)){let o=String.fromCharCode(r.charCode);!/[\r\n]/.test(o)&&!e.someProp("handleTextInput",i=>i(e,n.$from.pos,n.$to.pos,o))&&e.dispatch(e.state.tr.insertText(o).scrollIntoView()),r.preventDefault()}};function gh(e){return{left:e.clientX,top:e.clientY}}function $P(e,t){let r=t.x-e.clientX,n=t.y-e.clientY;return r*r+n*n<100}function pv(e,t,r,n,o){if(n==-1)return!1;let i=e.state.doc.resolve(n);for(let s=i.depth+1;s>0;s--)if(e.someProp(t,a=>s>i.depth?a(e,r,i.nodeAfter,i.before(s),o,!0):a(e,r,i.node(s),i.before(s),o,!1)))return!0;return!1}function ol(e,t,r){e.focused||e.focus();let n=e.state.tr.setSelection(t);r=="pointer"&&n.setMeta("pointer",!0),e.dispatch(n)}function HP(e,t){if(t==-1)return!1;let r=e.state.doc.resolve(t),n=r.nodeAfter;return n&&n.isAtom&&ce.isSelectable(n)?(ol(e,new ce(r),"pointer"),!0):!1}function BP(e,t){if(t==-1)return!1;let r=e.state.selection,n,o;r instanceof ce&&(n=r.node);let i=e.state.doc.resolve(t);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(ce.isSelectable(a)){n&&r.$from.depth>0&&s>=r.$from.depth&&i.before(r.$from.depth+1)==r.$from.pos?o=i.before(r.$from.depth):o=i.before(s);break}}return o!=null?(ol(e,ce.create(e.state.doc,o),"pointer"),!0):!1}function FP(e,t,r,n,o){return pv(e,"handleClickOn",t,r,n)||e.someProp("handleClick",i=>i(e,t,n))||(o?BP(e,r):HP(e,r))}function VP(e,t,r,n){return pv(e,"handleDoubleClickOn",t,r,n)||e.someProp("handleDoubleClick",o=>o(e,t,n))}function jP(e,t,r,n){return pv(e,"handleTripleClickOn",t,r,n)||e.someProp("handleTripleClick",o=>o(e,t,n))||UP(e,r,n)}function UP(e,t,r){if(r.button!=0)return!1;let n=e.state.doc;if(t==-1)return n.inlineContent?(ol(e,le.create(n,0,n.content.size),"pointer"),!0):!1;let o=n.resolve(t);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)ol(e,le.create(n,a+1,a+1+s.content.size),"pointer");else if(ce.isSelectable(s))ol(e,ce.create(n,a),"pointer");else continue;return!0}}function hv(e){return sp(e)}const SE=gn?"metaKey":"ctrlKey";br.mousedown=(e,t)=>{let r=t;e.input.shiftKey=r.shiftKey;let n=hv(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&$P(r,e.input.lastClick)&&!r[SE]&&(e.input.lastClick.type=="singleClick"?i="doubleClick":e.input.lastClick.type=="doubleClick"&&(i="tripleClick")),e.input.lastClick={time:o,x:r.clientX,y:r.clientY,type:i};let s=e.posAtCoords(gh(r));s&&(i=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new WP(e,s,r,!!n)):(i=="doubleClick"?VP:jP)(e,s.pos,s.inside,r)?r.preventDefault():Oi(e,"pointer"))};class WP{constructor(t,r,n,o){this.view=t,this.pos=r,this.event=n,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[SE],this.allowDefault=n.shiftKey;let i,s;if(r.inside>-1)i=t.state.doc.nodeAt(r.inside),s=r.inside;else{let u=t.state.doc.resolve(r.pos);i=u.parent,s=u.depth?u.before():0}const a=o?null:n.target,l=a?t.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:c}=t.state;(n.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof ce&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Qn&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Oi(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Ko(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords(gh(t))),this.updateAllowDefault(t),this.allowDefault||!r?Oi(this.view,"pointer"):FP(this.view,r.pos,r.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||yr&&this.mightDrag&&!this.mightDrag.node.isAtom||ar&&!this.view.state.selection.visible&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(ol(this.view,be.near(this.view.state.doc.resolve(r.pos)),"pointer"),t.preventDefault()):Oi(this.view,"pointer")}move(t){this.updateAllowDefault(t),Oi(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}br.touchstart=e=>{e.input.lastTouch=Date.now(),hv(e),Oi(e,"pointer")};br.touchmove=e=>{e.input.lastTouch=Date.now(),Oi(e,"pointer")};br.contextmenu=e=>hv(e);function EE(e,t){return e.composing?!0:yr&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const KP=Un?5e3:-1;kr.compositionstart=kr.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,r=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||r.marks(),sp(e,!0),e.markCursor=null;else if(sp(e),Qn&&t.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let n=e.domSelectionRange();for(let o=n.focusNode,i=n.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){e.domSelection().collapse(s,s.nodeValue.length);break}else o=s,i=-1}}e.input.composing=!0}CE(e,KP)};kr.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,CE(e,20))};function CE(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>sp(e),t))}function ME(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=qP());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function qP(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function sp(e,t=!1){if(!(Un&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),ME(e),t||e.docView&&e.docView.dirty){let r=uv(e);return r&&!r.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(r)):e.updateState(e.state),!0}return!1}}function GP(e,t){if(!e.dom.parentNode)return;let r=e.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(t),r.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),n.removeAllRanges(),n.addRange(o),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),e.focus()},50)}const wl=Pr&&Ni<15||xl&&WR<604;br.copy=kr.cut=(e,t)=>{let r=t,n=e.state.selection,o=r.type=="cut";if(n.empty)return;let i=wl?null:r.clipboardData,s=n.content(),{dom:a,text:l}=gE(e,s);i?(r.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):GP(e,a),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function YP(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function JP(e,t){if(!e.dom.parentNode)return;let r=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,n=e.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let o=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),n.parentNode&&n.parentNode.removeChild(n),r?Eu(e,n.value,null,o,t):Eu(e,n.textContent,n.innerHTML,o,t)},50)}function Eu(e,t,r,n,o){let i=vE(e,t,r,n,e.state.selection.$from);if(e.someProp("handlePaste",l=>l(e,o,i||W.empty)))return!0;if(!i)return!1;let s=YP(i),a=s?e.state.tr.replaceSelectionWith(s,n):e.state.tr.replaceSelection(i);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}kr.paste=(e,t)=>{let r=t;if(e.composing&&!Un)return;let n=wl?null:r.clipboardData,o=e.input.shiftKey&&e.input.lastKeyCode!=45;n&&Eu(e,n.getData("text/plain"),n.getData("text/html"),o,r)?r.preventDefault():JP(e,r)};class XP{constructor(t,r){this.slice=t,this.move=r}}const TE=gn?"altKey":"ctrlKey";br.dragstart=(e,t)=>{let r=t,n=e.input.mouseDown;if(n&&n.done(),!r.dataTransfer)return;let o=e.state.selection,i=o.empty?null:e.posAtCoords(gh(r));if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof ce?o.to-1:o.to))){if(n&&n.mightDrag)e.dispatch(e.state.tr.setSelection(ce.create(e.state.doc,n.mightDrag.pos)));else if(r.target&&r.target.nodeType==1){let c=e.docView.nearestDesc(r.target,!0);c&&c.node.type.spec.draggable&&c!=e.docView&&e.dispatch(e.state.tr.setSelection(ce.create(e.state.doc,c.posBefore)))}}let s=e.state.selection.content(),{dom:a,text:l}=gE(e,s);r.dataTransfer.clearData(),r.dataTransfer.setData(wl?"Text":"text/html",a.innerHTML),r.dataTransfer.effectAllowed="copyMove",wl||r.dataTransfer.setData("text/plain",l),e.dragging=new XP(s,!r[TE])};br.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};kr.dragover=kr.dragenter=(e,t)=>t.preventDefault();kr.drop=(e,t)=>{let r=t,n=e.dragging;if(e.dragging=null,!r.dataTransfer)return;let o=e.posAtCoords(gh(r));if(!o)return;let i=e.state.doc.resolve(o.pos),s=n&&n.slice;s?e.someProp("transformPasted",h=>{s=h(s,e)}):s=vE(e,r.dataTransfer.getData(wl?"Text":"text/plain"),wl?null:r.dataTransfer.getData("text/html"),!1,i);let a=!!(n&&!r[TE]);if(e.someProp("handleDrop",h=>h(e,r,s||W.empty,a))){r.preventDefault();return}if(!s)return;r.preventDefault();let l=s?uA(e.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=e.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&ce.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new ce(p));else{let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((m,b,v,g)=>h=g),c.setSelection(dv(e,p,c.doc.resolve(h)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))};br.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Ko(e)},20))};br.blur=(e,t)=>{let r=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),r.relatedTarget&&e.dom.contains(r.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};br.beforeinput=(e,t)=>{if(ar&&Un&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:n}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=n||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",i=>i(e,As(8,"Backspace")))))return;let{$cursor:o}=e.state.selection;o&&o.pos>0&&e.dispatch(e.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let e in kr)br[e]=kr[e];function Cu(e,t){if(e==t)return!0;for(let r in e)if(e[r]!==t[r])return!1;for(let r in t)if(!(r in e))return!1;return!0}class ap{constructor(t,r){this.toDOM=t,this.spec=r||Vs,this.side=this.spec.side||0}map(t,r,n,o){let{pos:i,deleted:s}=t.mapResult(r.from+o,this.side<0?-1:1);return s?null:new Ke(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof ap&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Cu(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Li{constructor(t,r){this.attrs=t,this.spec=r||Vs}map(t,r,n,o){let i=t.map(r.from+o,this.spec.inclusiveStart?-1:1)-n,s=t.map(r.to+o,this.spec.inclusiveEnd?1:-1)-n;return i>=s?null:new Ke(i,s,this)}valid(t,r){return r.from=t&&(!i||i(a.spec))&&n.push(a.copy(a.from+o,a.to+o))}for(let s=0;st){let a=this.children[s]+1;this.children[s+2].findInner(t-a,r-a,n,o+a,i)}}map(t,r,n){return this==or||t.maps.length==0?this:this.mapInner(t,r,0,0,n||Vs)}mapInner(t,r,n,o,i){let s;for(let a=0;a{let c=l+n,u;if(u=_E(r,a,c)){for(o||(o=this.children.slice());ia&&d.to=t){this.children[a]==t&&(n=this.children[a+2]);break}let i=t+1,s=i+r.content.size;for(let a=0;ai&&l.type instanceof Li){let c=Math.max(i,l.from)-i,u=Math.min(s,l.to)-i;co.map(t,r,Vs));return Si.from(n)}forChild(t,r){if(r.isLeaf)return Ee.empty;let n=[];for(let o=0;or instanceof Ee)?t:t.reduce((r,n)=>r.concat(n instanceof Ee?n:n.members),[]))}}}function QP(e,t,r,n,o,i,s){let a=e.slice();for(let c=0,u=i;c{let b=m-h-(p-f);for(let v=0;vg+u-d)continue;let y=a[v]+u-d;p>=y?a[v+1]=f<=y?-2:-1:h>=o&&b&&(a[v]+=b,a[v+1]+=b)}d+=b}),u=r.maps[c].map(u,-1)}let l=!1;for(let c=0;c=n.content.size){l=!0;continue}let f=r.map(e[c+1]+i,-1),p=f-o,{index:h,offset:m}=n.content.findIndex(d),b=n.maybeChild(h);if(b&&m==d&&m+b.nodeSize==p){let v=a[c+2].mapInner(r,b,u+1,e[c]+i+1,s);v!=or?(a[c]=d,a[c+1]=p,a[c+2]=v):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=ZP(a,e,t,r,o,i,s),u=lp(c,n,0,s);t=u.local;for(let d=0;dr&&s.to{let c=_E(e,a,l+r);if(c){i=!0;let u=lp(c,a,r+l+1,n);u!=or&&o.push(l,l+a.nodeSize,u)}});let s=OE(i?AE(e):e,-r).sort(js);for(let a=0;a0;)t++;e.splice(t,0,r)}function Jm(e){let t=[];return e.someProp("decorations",r=>{let n=r(e.state);n&&n!=or&&t.push(n)}),e.cursorWrapper&&t.push(Ee.create(e.state.doc,[e.cursorWrapper.deco])),Si.from(t)}const eN={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},tN=Pr&&Ni<=11;class rN{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class nN{constructor(t,r){this.view=t,this.handleDOMChange=r,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new rN,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let o=0;oo.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),tN&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,eN)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let r=0;rthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(ux(this.view)){if(this.suppressingSelectionUpdates)return Ko(this.view);if(Pr&&Ni<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Js(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let r=new Set,n;for(let i=t.focusNode;i;i=Su(i))r.add(i);for(let i=t.anchorNode;i;i=Su(i))if(r.has(i)){n=i;break}let o=n&&this.view.docView.nearestDesc(n);if(o&&o.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let r=this.pendingRecords();r.length&&(this.queue=[]);let n=t.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&ux(t)&&!this.ignoreSelectionChange(n),i=-1,s=-1,a=!1,l=[];if(t.editable)for(let u=0;u1){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let d=u[0],f=u[1];d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}}let c=null;i<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||o)&&(i>-1&&(t.docView.markDirty(i,s),oN(t)),this.handleDOMChange(i,s,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||Ko(t),this.currentSelection.set(n))}registerMutation(t,r){if(r.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(n==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!n||n.ignoreMutation(t))return null;if(t.type=="childList"){for(let u=0;uo;b--){let v=n.childNodes[b-1],g=v.pmViewDesc;if(v.nodeName=="BR"&&!g){i=b;break}if(!g||g.size)break}let d=e.state.doc,f=e.someProp("domParser")||rv.fromSchema(e.state.schema),p=d.resolve(s),h=null,m=f.parse(n,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:i,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:aN,context:p});if(c&&c[0].pos!=null){let b=c[0].pos,v=c[1]&&c[1].pos;v==null&&(v=b),h={anchor:b+s,head:v+s}}return{doc:m,sel:h,from:s,to:a}}function aN(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(yr&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(e.parentNode.lastChild==e||yr&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const lN=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function cN(e,t,r,n,o){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let C=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,T=uv(e,C);if(T&&!e.state.selection.eq(T)){if(ar&&Un&&e.input.lastKeyCode===13&&Date.now()-100B(e,As(13,"Enter"))))return;let R=e.state.tr.setSelection(T);C=="pointer"?R.setMeta("pointer",!0):C=="key"&&R.scrollIntoView(),i&&R.setMeta("composition",i),e.dispatch(R)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(r);t=s.before(a+1),r=e.state.doc.resolve(r).after(a+1);let l=e.state.selection,c=sN(e,t,r),u=e.state.doc,d=u.slice(c.from,c.to),f,p;e.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Un)&&o.some(C=>C.nodeType==1&&!lN.test(C.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",C=>C(e,As(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!h)if(n&&l instanceof le&&!l.empty&&l.$head.sameParent(l.$anchor)&&!e.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let C=xx(e,e.state.doc,c.sel);if(C&&!C.eq(e.state.selection)){let T=e.state.tr.setSelection(C);i&&T.setMeta("composition",i),e.dispatch(T)}}return}if(ar&&e.cursorWrapper&&c.sel&&c.sel.anchor==e.cursorWrapper.deco.from&&c.sel.head==c.sel.anchor){let C=h.endB-h.start;c.sel={anchor:c.sel.anchor+C,head:c.sel.anchor+C}}e.input.domChangeCount++,e.state.selection.frome.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=c.from?h.start=e.state.selection.from:h.endA=e.state.selection.to-2&&e.state.selection.to<=c.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),Pr&&Ni<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let m=c.doc.resolveNoCache(h.start-c.from),b=c.doc.resolveNoCache(h.endB-c.from),v=u.resolve(h.start),g=m.sameParent(b)&&m.parent.inlineContent&&v.end()>=h.endA,y;if((xl&&e.input.lastIOSEnter>Date.now()-225&&(!g||o.some(C=>C.nodeName=="DIV"||C.nodeName=="P"))||!g&&m.posC(e,As(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>h.start&&dN(u,h.start,h.endA,m,b)&&e.someProp("handleKeyDown",C=>C(e,As(8,"Backspace")))){Un&&ar&&e.domObserver.suppressSelectionUpdates();return}ar&&Un&&h.endB==h.start&&(e.input.lastAndroidDelete=Date.now()),Un&&!g&&m.start()!=b.start()&&b.parentOffset==0&&m.depth==b.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,b=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{e.someProp("handleKeyDown",function(C){return C(e,As(13,"Enter"))})},20));let k=h.start,x=h.endA,w,E,M;if(g){if(m.pos==b.pos)Pr&&Ni<=11&&m.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ko(e),20)),w=e.state.tr.delete(k,x),E=u.resolve(h.start).marksAcross(u.resolve(h.endA));else if(h.endA==h.endB&&(M=uN(m.parent.content.cut(m.parentOffset,b.parentOffset),v.parent.content.cut(v.parentOffset,h.endA-v.start()))))w=e.state.tr,M.type=="add"?w.addMark(k,x,M.mark):w.removeMark(k,x,M.mark);else if(m.parent.child(m.index()).isText&&m.index()==b.index()-(b.textOffset?0:1)){let C=m.parent.textBetween(m.parentOffset,b.parentOffset);if(e.someProp("handleTextInput",T=>T(e,k,x,C)))return;w=e.state.tr.insertText(C,k,x)}}if(w||(w=e.state.tr.replace(k,x,c.doc.slice(h.start-c.from,h.endB-c.from))),c.sel){let C=xx(e,w.doc,c.sel);C&&!(ar&&Un&&e.composing&&C.empty&&(h.start!=h.endB||e.input.lastAndroidDeletet.content.size?null:dv(e,t.resolve(r.anchor),t.resolve(r.head))}function uN(e,t){let r=e.firstChild.marks,n=t.firstChild.marks,o=r,i=n,s,a,l;for(let u=0;uu.mark(a.addToSet(u.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;ur||Xm(s,!0,!1)0&&(t||e.indexAfter(n)==e.node(n).childCount);)n--,o++,t=!1;if(r){let i=e.node(n).maybeChild(e.indexAfter(n));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function fN(e,t,r,n,o){let i=e.findDiffStart(t,r);if(i==null)return null;let{a:s,b:a}=e.findDiffEnd(t,r+e.size,r+t.size);if(o=="end"){let l=Math.max(0,i-Math.min(s,a));n-=s+l-i}if(s=s?i-n:0;i-=l,a=i+(a-s),s=i}else if(a=a?i-n:0;i-=l,s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}class pN{constructor(t,r){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new NP,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=r,this.state=r.state,this.directPlugins=r.plugins||[],this.directPlugins.forEach(Mx),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Ex(this),Sx(this),this.nodeViews=Cx(this),this.docView=ox(this.state.doc,wx(this),Jm(this),this.dom,this),this.domObserver=new nN(this,(n,o,i,s)=>cN(this,n,o,i,s)),this.domObserver.start(),zP(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let r in t)this._props[r]=t[r];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&v1(this);let r=this._props;this._props=t,t.plugins&&(t.plugins.forEach(Mx),this.directPlugins=t.plugins),this.updateStateInner(t.state,r)}setProps(t){let r={};for(let n in this._props)r[n]=this._props[n];r.state=this.state;for(let n in t)r[n]=t[n];this.update(r)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,r){let n=this.state,o=!1,i=!1;t.storedMarks&&this.composing&&(ME(this),i=!0),this.state=t;let s=n.plugins!=t.plugins||this._props.plugins!=r.plugins;if(s||this._props.plugins!=r.plugins||this._props.nodeViews!=r.nodeViews){let f=Cx(this);mN(f,this.nodeViews)&&(this.nodeViews=f,o=!0)}(s||r.handleDOMEvents!=this._props.handleDOMEvents)&&v1(this),this.editable=Ex(this),Sx(this);let a=Jm(this),l=wx(this),c=n.plugins!=t.plugins&&!n.doc.eq(t.doc)?"reset":t.scrollToSelection>n.scrollToSelection?"to selection":"preserve",u=o||!this.docView.matchesNode(t.doc,l,a);(u||!t.selection.eq(n.selection))&&(i=!0);let d=c=="preserve"&&i&&this.dom.style.overflowAnchor==null&&GR(this);if(i){this.domObserver.stop();let f=u&&(Pr||ar)&&!this.composing&&!n.selection.empty&&!t.selection.empty&&hN(n.selection,t.selection);if(u){let p=ar?this.trackWrites=this.domSelectionRange().focusNode:null;(o||!this.docView.update(t.doc,l,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=ox(t.doc,l,a,this.dom,this)),p&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&bP(this))?Ko(this,f):(pE(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():d&&YR(d)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",r=>r(this)))if(this.state.selection instanceof ce){let r=this.docView.domAfterPos(this.state.selection.from);r.nodeType==1&&Qk(this,r.getBoundingClientRect(),t)}else Qk(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let r=0;rr.ownerDocument.getSelection()),this._root=r}return t||document}updateRoot(){this._root=null}posAtCoords(t){return tP(this,t)}coordsAtPos(t,r=1){return iE(this,t,r)}domAtPos(t,r=0){return this.docView.domFromPos(t,r)}nodeDOM(t){let r=this.docView.descAt(t);return r?r.nodeDOM:null}posAtDOM(t,r,n=-1){let o=this.docView.posFromDOM(t,r,n);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(t,r){return sP(this,r||this.state,t)}pasteHTML(t,r){return Eu(this,"",t,!1,r||new ClipboardEvent("paste"))}pasteText(t,r){return Eu(this,t,null,!0,r||new ClipboardEvent("paste"))}destroy(){this.docView&&(LP(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Jm(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(t){return DP(this,t)}dispatch(t){let r=this._props.dispatchTransaction;r?r.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return yr&&this.root.nodeType===11&&FR(this.dom.ownerDocument)==this.dom?iN(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function wx(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",r=>{if(typeof r=="function"&&(r=r(e.state)),r)for(let n in r)n=="class"?t.class+=" "+r[n]:n=="style"?t.style=(t.style?t.style+";":"")+r[n]:!t[n]&&n!="contenteditable"&&n!="nodeName"&&(t[n]=String(r[n]))}),t.translate||(t.translate="no"),[Ke.node(0,e.state.doc.content.size,t)]}function Sx(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Ke.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Ex(e){return!e.someProp("editable",t=>t(e.state)===!1)}function hN(e,t){let r=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(r)!=t.$anchor.start(r)}function Cx(e){let t=Object.create(null);function r(n){for(let o in n)Object.prototype.hasOwnProperty.call(t,o)||(t[o]=n[o])}return e.someProp("nodeViews",r),e.someProp("markViews",r),t}function mN(e,t){let r=0,n=0;for(let o in e){if(e[o]!=t[o])return!0;r++}for(let o in t)n++;return r!=n}function Mx(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var gN=e=>{if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")};const vN=Eo(gN);var RE=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},me=(e,t,r)=>(RE(e,t,"read from private field"),r?r.call(e):t.get(e)),_o=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},We=(e,t,r,n)=>(RE(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);function yN(e){return!!(e.prev&&e.next&&e.prev.text.full!==e.next.text.full)}function bN(e){return!!(e.prev&&e.next&&e.prev.range.cursor!==e.next.range.cursor)}function kN(e){return!!(!e.prev&&e.next)}function xN(e){return!!(e.prev&&!e.next)}function wN(e){return!!(e.prev&&e.next&&e.prev.range.from!==e.next.range.from)}function SN(e){return e==="invalid-exit-split"}var EN=["jump-backward-exit","jump-forward-exit"],CN=["jump-backward-change","jump-forward-change"];function MN(e){var t,r;return vr(EN,(t=e.exit)==null?void 0:t.exitReason)||vr(CN,(r=e.change)==null?void 0:r.changeReason)}function Tx(e){return!!(e&&e.query.full.length>=e.suggester.matchOffset)}function Ox(e){return Xt(e)&&e instanceof le}function _r(e){const{match:t,changeReason:r,exitReason:n}=e;return{...t,changeReason:r,exitReason:n}}function TN(e,t){const{invalidPrefixCharacters:r,validPrefixCharacters:n}=t;return r?!new RegExp(b1(r)).test(e):new RegExp(b1(n)).test(e)}function ON(e){const{text:t,regexp:r,$pos:n,suggester:o}=e,i=n.start();let s;return Ul(t,r).forEach(a=>{const l=a.input.slice(Math.max(0,a.index-1),a.index);if(TN(l,o)){const c=a.index+i,u=a[0],d=a[1];if(!ne(u)||!ne(d))return;const f=c+u.length,p=Math.min(f,n.pos),h=p-c;c=n.pos&&(s={range:{from:c,to:f,cursor:p},match:a,query:{partial:u.slice(d.length,h),full:u.slice(d.length)},text:{partial:u.slice(0,h),full:u},textAfter:n.doc.textBetween(f,n.end(),Mi,Mi),textBefore:n.doc.textBetween(i,c,Mi,Mi),suggester:o})}}),s}function PE(e){const{$pos:t,suggester:r}=e,{char:n,name:o,startOfLine:i,supportedCharacters:s,matchOffset:a,multiline:l,caseInsensitive:c,unicode:u}=r,d=DN({char:n,matchOffset:a,startOfLine:i,supportedCharacters:s,multiline:l,caseInsensitive:c,unicode:u}),f=t.doc.textBetween(t.before(),t.end(),Mi,Mi);return ON({suggester:r,text:f,regexp:d,$pos:t,char:n,name:o})}function NE(e){const{state:t,match:r}=e;try{return PE({$pos:t.doc.resolve(r.range.cursor),suggester:r.suggester})}catch{return}}function zE(e){const{prev:t,next:r,state:n}=e;return!r&&t.range.from>=n.doc.nodeSize?{exit:_r({match:t,exitReason:"delete"})}:!r||!t.query.partial?{exit:_r({match:t,exitReason:"invalid-exit-split"})}:t.range.to===r.range.cursor?{exit:_r({match:r,exitReason:"exit-end"})}:t.query.partial?{exit:_r({match:r,exitReason:"exit-split"})}:{}}function _N(e){const{prev:t,next:r,state:n}=e,o=ee(),i=NE({state:n,match:t}),{exit:s}=i&&i.query.full!==t.query.full?zE({prev:t,next:i,state:n}):o;return t.range.from=t.range.to)?{exit:_r({match:t,exitReason:"selection-outside"})}:n.pos>t.range.to?{exit:_r({match:t,exitReason:"move-end"})}:n.pos<=t.range.from?{exit:_r({match:t,exitReason:"move-start"})}:{}}function RN(e){const{prev:t,next:r,state:n,$pos:o}=e,i=ee();if(!t&&!r)return i;const s={prev:t,next:r};return wN(s)?_N({prev:s.prev,next:s.next,state:n}):kN(s)?{change:_r({match:s.next,changeReason:"start"})}:xN(s)?AN({$pos:o,match:s.prev,state:n}):yN(s)?{change:_r({match:s.next,changeReason:"change-character"})}:bN(s)?{change:_r({match:s.next,changeReason:n.selection.empty?"move":"selection-inside"})}:i}function _x(e,t){for(let r=e.depth;r>0;r--){const n=e.node(r);if(t.includes(n.type.name))return!0}return!1}function y1(e,t){const{$from:r,$to:n}=e;return LE(e,t)?!0:ev(r.pos,n.pos).some(o=>PN(r.doc.resolve(o),t))}function LE(e,t){const{$from:r,$to:n}=e,o=new Set((r.marksAcross(n)??[]).map(i=>i.type.name));return t.some(i=>o.has(i))}function PN(e,t){const r=new Set(e.marks().map(n=>n.type.name));return t.some(n=>r.has(n))}function NN(e,t){const{$cursor:r}=t,{validMarks:n,validNodes:o,invalidMarks:i,invalidNodes:s}=e;return!n&&!o&&Ki(i)&&Ki(s)?!0:!(n&&!LE(t,n)||o&&!_x(r,o)||!n&&y1(t,i)||!o&&_x(r,s))}function Ax(e){const{suggesters:t,$pos:r,selectionEmpty:n}=e;for(const o of t)if(!(o.emptySelectionsOnly&&!n))try{const i=PE({suggester:o,$pos:r});if(!i)continue;const s={$from:r.doc.resolve(i.range.from),$to:r.doc.resolve(i.range.to),$cursor:r};if(NN(o,s)&&o.isValidPosition(s,i))return i}catch{}}function b1(e){return h_(e)?e.source:e}function zN(e){return e?"^":""}function LN(e,t){return`(?:${b1(e)}){${t},}`}function IN(e){return ne(e)?new RegExp(vN(e)):e}function DN(e){const{char:t,matchOffset:r,startOfLine:n,supportedCharacters:o,captureChar:i=!0,caseInsensitive:s=!1,multiline:a=!1,unicode:l=!1}=e,c=`g${a?"m":""}${s?"i":""}${l?"u":""}`;let u=IN(t).source;return i&&(u=`(${u})`),new RegExp(`${zN(n)}${u}${LN(o,r)}`,c)}var $N={appendTransaction:!1,priority:50,ignoredTag:"span",matchOffset:0,disableDecorations:!1,startOfLine:!1,suggestClassName:"suggest",suggestTag:"span",supportedCharacters:/\w+/,validPrefixCharacters:/^[\s\0]?$/,invalidPrefixCharacters:null,ignoredClassName:null,invalidMarks:[],invalidNodes:[],validMarks:null,validNodes:null,isValidPosition:()=>!0,checkNextValidSelection:null,emptySelectionsOnly:!1,caseInsensitive:!1,multiline:!1,unicode:!1,captureChar:!0},IE="__ignore_prosemirror_suggest_update__",yf,Sc,zt,hi,za,io,Ot,mi,La,DE=class{constructor(e){_o(this,yf,!1),_o(this,Sc,!1),_o(this,zt,void 0),_o(this,hi,void 0),_o(this,za,void 0),_o(this,io,ee()),_o(this,Ot,Ee.empty),_o(this,mi,!1),_o(this,La,!1),this.setMarkRemoved=()=>{We(this,mi,!0)},this.findNextTextSelection=r=>{const n=r.$from.doc,o=Math.min(n.nodeSize-2,r.to+1),i=n.resolve(o),s=be.findFrom(i,1,!0);if(Ox(s))return s},this.ignoreNextExit=()=>{We(this,Sc,!0)},this.addIgnored=({from:r,name:n,specific:o=!1})=>{const i=me(this,zt).find(u=>u.name===n);if(!i)throw new Error(`No suggester exists for the name provided: ${n}`);const s=ne(i.char)?i.char.length:1,a=r+s,l=i.ignoredClassName?{class:i.ignoredClassName}:{},c=Ke.inline(r,a,{nodeName:i.ignoredTag,...l},{name:n,specific:o,char:i.char});We(this,Ot,me(this,Ot).add(this.view.state.doc,[c]))},this.removeIgnored=({from:r,name:n})=>{const o=me(this,zt).find(a=>a.name===n);if(!o)throw new Error(`No suggester exists for the name provided: ${n}`);const i=ne(o.char)?o.char.length:1,s=me(this,Ot).find(r,r+i)[0];!s||s.spec.name!==n||We(this,Ot,me(this,Ot).remove([s]))},this.clearIgnored=r=>{if(!r){We(this,Ot,Ee.empty);return}const o=me(this,Ot).find().filter(({spec:i})=>i.name===r);We(this,Ot,me(this,Ot).remove(o))},this.findMatchAtPosition=(r,n)=>{const o=n?me(this,zt).filter(i=>i.name===n):me(this,zt);return Ax({suggesters:o,$pos:r,docChanged:!1,selectionEmpty:!0})},this.setLastChangeFromAppend=()=>{We(this,La,!0)};const t=Rx();We(this,zt,e.map(t)),We(this,zt,qs(me(this,zt),(r,n)=>n.priority-r.priority))}static create(e){return new DE(e)}get decorationSet(){return me(this,Ot)}get removed(){return me(this,mi)}get match(){return me(this,hi)?me(this,hi):me(this,za)&&me(this,io).exit?me(this,za):void 0}init(e){return this.view=e,this}createProps(e){const{name:t,char:r}=e.suggester;return{view:this.view,addIgnored:this.addIgnored,clearIgnored:this.clearIgnored,ignoreNextExit:this.ignoreNextExit,setMarkRemoved:this.setMarkRemoved,name:t,char:r,...e}}shouldRunExit(){return me(this,Sc)?(We(this,Sc,!1),!1):!0}updateWithNextSelection(e){var t,r,n;const o=this.findNextTextSelection(e.selection);if(o)for(const i of me(this,zt)){const s=(t=me(this,io).change)==null?void 0:t.suggester.name,a=(r=me(this,io).exit)==null?void 0:r.suggester.name;(n=i.checkNextValidSelection)==null||n.call(i,o.$from,e,{change:s,exit:a})}}changeHandler(e,t){const{change:r,exit:n}=me(this,io),o=this.match;if(!r&&!n||!Tx(o))return;const i=t===(n==null?void 0:n.suggester.appendTransaction)&&this.shouldRunExit(),s=t===(r==null?void 0:r.suggester.appendTransaction);if(!(!i&&!s)){if(r&&n&&MN({change:r,exit:n})){const a=this.createProps(n),l=this.createProps(r),c=n.range.from{const a=ne(s.char)?s.char.length:1;return i-o!==a});We(this,Ot,t.remove(n))}shouldIgnoreMatch({range:e,suggester:{name:t}}){return me(this,Ot).find().some(({spec:o,from:i})=>i!==e.from?!1:o.specific?o.name===t:!0)}resetState(){We(this,io,ee()),We(this,hi,void 0),We(this,mi,!1),We(this,La,!1)}updateReasons(e){const{$pos:t,state:r}=e,n=me(this,yf),o=me(this,zt),i=r.selection.empty,s=Ox(r.selection)?Ax({suggesters:o,$pos:t,docChanged:n,selectionEmpty:i}):void 0;We(this,hi,s&&this.shouldIgnoreMatch(s)?void 0:s),We(this,io,RN({next:me(this,hi),prev:me(this,za),state:r,$pos:t}))}addSuggester(e){const t=me(this,zt).find(n=>n.name===e.name),r=Rx();if(t)We(this,zt,me(this,zt).map(n=>n===t?r(e):n));else{const n=[...me(this,zt),r(e)];We(this,zt,qs(n,(o,i)=>i.priority-o.priority))}return()=>this.removeSuggester(e.name)}removeSuggester(e){const t=ne(e)?e:e.name;We(this,zt,me(this,zt).filter(r=>r.name!==t)),this.clearIgnored(t)}toJSON(){return this.match}apply(e){const{exit:t,change:r}=me(this,io);if(me(this,La)&&(We(this,La,!1),!(t!=null&&t.suggester.appendTransaction)&&!(r!=null&&r.suggester.appendTransaction)))return this;const{tr:n,state:o}=e,i=n.docChanged||n.selectionSet;return n.getMeta(IE)||!i&&!me(this,mi)?this:(We(this,yf,n.docChanged),this.mapIgnoredDecorations(n),t&&this.resetState(),We(this,za,me(this,hi)),this.updateReasons({$pos:n.selection.$from,state:o}),this)}createDecorations(e){const t=this.match;if(!Tx(t))return me(this,Ot);const{disableDecorations:r}=t.suggester;if(Ne(r)?r(e,t):r)return me(this,Ot);const{range:o,suggester:i}=t,{name:s,suggestTag:a,suggestClassName:l}=i,{from:c,to:u}=o;return this.shouldIgnoreMatch(t)?me(this,Ot):me(this,Ot).add(e.doc,[Ke.inline(c,u,{nodeName:a,class:s?`${l} suggest-${s}`:l},{name:s})])}},HN=DE;yf=new WeakMap;Sc=new WeakMap;zt=new WeakMap;hi=new WeakMap;za=new WeakMap;io=new WeakMap;Ot=new WeakMap;mi=new WeakMap;La=new WeakMap;function Rx(){const e=new Set;return t=>{if(e.has(t.name))throw new Error(`A suggester already exists with the name '${t.name}'. The name provided must be unique.`);const r={...$N,...t};return e.add(t.name),r}}var $E=new da("suggest");function vv(e){return $E.getState(e)}function Px(e,t){return vv(e).addSuggester(t)}function Nx(e){e.setMeta(IE,!0)}function BN(e,t){return vv(e).removeSuggester(t)}function FN(...e){const t=HN.create(e);return new Co({key:$E,view:r=>(t.init(r),{update:n=>t.changeHandler(n.state.tr,!1)}),state:{init:()=>t,apply:(r,n,o,i)=>t.apply({tr:r,state:i})},appendTransaction:(r,n,o)=>{const i=o.tr;return t.updateWithNextSelection(i),t.changeHandler(i,!0),i.docChanged||i.steps.length>0||i.selectionSet||i.storedMarksSet?(t.setLastChangeFromAppend(),i):null},props:{decorations:r=>t.createDecorations(r)}})}function yv(e,t){const r=Object.getPrototypeOf(t);let n=e.selection,o=e.doc,i=e.storedMarks;const s=ee();for(const[a,l]of Object.entries(t))s[a]={value:l};return Object.create(r,{...s,storedMarks:{get(){return i}},selection:{get(){return n}},doc:{get(){return o}},tr:{get(){return n=e.selection,o=e.doc,i=e.storedMarks,e}}})}function iu(e){return({state:t,dispatch:r,view:n,tr:o})=>e(yv(o,t),r,n)}function zx(e){return t=>{var r;return te(t.dispatch===void 0||t.dispatch===((r=t.view)==null?void 0:r.dispatch),{code:$.NON_CHAINABLE_COMMAND}),e(t)}}function VN(...e){return({state:t,dispatch:r,view:n,tr:o,...i})=>{for(const s of e)if(s({state:t,dispatch:r,view:n,tr:o,...i}))return!0;return!1}}var Zr={get isBrowser(){return!!(typeof window<"u"&&typeof window.document<"u"&&window.navigator&&window.navigator.userAgent)},get isJSDOM(){return Zr.isBrowser&&window.navigator.userAgent.includes("jsdom")},get isNode(){return typeof process<"u"&&process.versions!=null&&process.versions.node!=null},get isIos(){return Zr.isBrowser&&/iPod|iPhone|iPad/.test(navigator.platform)},get isMac(){return Zr.isBrowser&&/Mac|iPod|iPhone|iPad/.test(navigator.platform)},get isApple(){return Zr.isNode?process.platform==="darwin":Zr.isBrowser?/Mac|iPod|iPhone|iPad/.test(window.navigator.platform):!1},get isDevelopment(){return!1},get isTest(){return!1},get isProduction(){return!0}};function so(e,t){var r;const n=v6(e);return((r=n==null?void 0:n.getComputedStyle(e))==null?void 0:r.getPropertyValue(t))??""}function nr(e,t){return Object.assign(e.style,t)}function cp(e){return Xt(e)&&sn(e.nodeType)&&ne(e.nodeName)}function gt(e){return cp(e)&&e.nodeType===1}function jN(e){return cp(e)&&e.nodeType===3}function vh(e){const{types:t,node:r}=e;if(!r)return!1;const n=o=>o===r.type||o===r.type.name;return at(t)?t.some(n):n(t)}function UN(e,t){const{tr:r}=t;return e.forEach(n=>{n.steps.forEach(o=>{r.step(o)})}),r}function WN({pos:e,tr:t}){const r=t.doc.nodeAt(e);return r&&t.delete(e,e+r.nodeSize),t}function KN({pos:e,tr:t,content:r}){const n=t.doc.nodeAt(e);return n&&t.replaceWith(e,e+n.nodeSize,r),t}function yd(e){const{predicate:t,selection:r}=e,n=FE(r)?r.selection.$from:xv(r)?r.$from:r;for(let o=n.depth;o>0;o--){const i=n.node(o),s=o>0?n.before(o):0,a=n.start(o),l=s+i.nodeSize;if(t(i,s))return{pos:s,depth:o,node:i,start:a,end:l}}}function qN(e){const{depth:t}=e,r=t>0?e.before(t):0,n=e.node(t),o=e.start(t),i=r+n.nodeSize;return{pos:r,start:o,node:n,end:i,depth:t}}function GN(e){const t=yd({predicate:()=>!0,selection:e});return te(t,{message:"No parent node found for the selection provided."}),t}function Gi(e){const{types:t,selection:r}=e;return yd({predicate:n=>vh({types:t,node:n}),selection:r})}function YN(e){const{types:t,selection:r}=e;if(!(!kd(r)||!vh({types:t,node:r.node})))return{pos:r.$from.pos,depth:r.$from.depth,start:r.$from.start(),end:r.$from.pos+r.node.nodeSize,node:r.node}}function bv(e){return xv(e)?e.empty:e.selection.empty}function JN(e){return e.docChanged||e.selectionSet}function HE(e){return!!Mu(e)}function Mu(e){const{state:t,type:r,attrs:n}=e,{selection:o,doc:i}=t,s=ne(r)?i.type.schema.nodes[r]:r;te(s,{code:$.SCHEMA,message:`No node exists for ${r}`});const a=YN({selection:o,types:r})??yd({predicate:l=>l.type===s,selection:o});return!n||Yf(n)||!a||a.node.hasMarkup(s,{...a.node.attrs,...n})?a:void 0}function up(...e){return t=>{if(!Ck(e))return!1;const[r,...n]=e;let o=!1;const i=(...l)=>()=>{if(!Ck(l))return!1;o=!0;const[,...c]=l;return up(...l)({...t,next:i(...c)})},s=i(...n),a=r({...t,next:s});return o||a?a:s()}}function XN(e,t){const r=new Map,n=ee();for(const o of e)for(const[i,s]of At(o)){const l=[...r.get(i)??[],s],c=up(...l);r.set(i,l),n[i]=t(c)}return n}function QN(e){return XN(e,t=>(r,n,o)=>t({state:r,dispatch:n,view:o,tr:r.tr,next:()=>!1}))}function kv(e,t){const r=e.attrs??{};return Object.entries(t).every(([n,o])=>r[n]===o)}function ZN(e){return jE(e,[Ho,vt,Dt,Gn])}function Kl(e){return Xt(e)}function ql(e,t){return at(t)?vr(t,e[Go]):t===e[Go]}function e6(e){return Xt(e)&&e instanceof o1}function t6(e,t){return ne(e)?nt(t.nodes,e):e}function BE(e){return Xt(e)&&e instanceof hd}function r6(e,t){return ne(e)?nt(t.marks,e):e}function bd(e){return Xt(e)&&e instanceof Pi}function n6(e){return Xt(e)&&e instanceof P}function o6(e){return Xt(e)&&e instanceof Te}function FE(e){return Xt(e)&&e instanceof Ps}function ls(e){return Xt(e)&&e instanceof le}function i6(e){return Xt(e)&&e instanceof mr}function xv(e){return Xt(e)&&e instanceof be}function s6(e){return Xt(e)&&e instanceof yl}function Lx(e){const{trState:t,from:r,to:n,type:o,attrs:i={}}=e,{doc:s}=t,a=r6(o,s.type.schema);if(Object.keys(i).length===0)return s.rangeHasMark(r,n,a);let l=!1;return n>r&&s.nodesBetween(r,n,c=>l?!1:(l=(c.marks??[]).some(d=>d.type!==a?!1:kv(d,i)),!l)),l}function kd(e){return Xt(e)&&e instanceof ce}function dp(e){const{trState:t,type:r,attrs:n={},from:o,to:i}=e,{selection:s,doc:a,storedMarks:l}=t,c=ne(r)?a.type.schema.marks[r]:r;if(te(c,{code:$.SCHEMA,message:`Mark type: ${r} does not exist on the current schema.`}),o&&i)try{return Math.max(o,i)d.type!==r?!1:kv(d,n??{})):Lx({...e,from:s.from,to:s.to})}function wv(e,t={}){const r=a6(e.type.schema);if(!r)return!1;const{ignoreAttributes:n,ignoreDocAttributes:o}=t;return n?VE(r,e):o?r.content.eq(e.content):r.eq(e)}function VE(e,t){if(e===t)return!0;const r=e.type===t.type&&Te.sameSet(e.marks,t.marks);function n(){if(e.content===t.content)return!0;if(e.content.size!==t.content.size)return!1;const o=[],i=[];e.content.forEach(s=>o.push(s)),t.content.forEach(s=>i.push(s));for(const[s,a]of o.entries()){const l=i[s];if(!l||!VE(a,l))return!1}return!0}return r&&n()}function a6(e){var t;return((t=e.nodes.doc)==null?void 0:t.createAndFill())??void 0}function yh(e){for(const t of Object.values(e.nodes))if(t.name!=="doc"&&(t.isBlock||t.isTextblock))return t;te(!1,{code:$.SCHEMA,message:"No default block node found for the provided schema."})}function l6(e){return e.type===yh(e.type.schema)}function bh(e){return!!e&&e.type.isBlock&&!e.textContent&&!e.childCount}function Yo(e,t,r){const n=e.parent.childAfter(e.parentOffset);if(!n.node)return;const o=ne(t)?t:t.name,i=n.node.marks.find(({type:d})=>d.name===o);let s=e.index(),a=e.start()+n.offset,l=s+1,c=a+n.node.nodeSize;if(!i)return r&&c0&&i.isInSet(e.parent.child(s-1).marks);)s-=1,a-=e.parent.child(s).nodeSize;for(;le instanceof r)}function c6(e){return yS(e,({from:r,to:n,prevFrom:o,prevTo:i})=>`${r}_${n}_${o}_${i}`).filter((r,n,o)=>!o.some((i,s)=>n===s?!1:r.prevFrom>=i.prevFrom&&r.prevTo<=i.prevTo&&r.from>=i.from&&r.to<=i.to))}function UE(e,t=[]){const r=[],{steps:n,mapping:o}=e,i=o.invert();n.forEach((a,l)=>{if(!jE(a,t))return;const c=[],u=a.getMap(),d=o.slice(l);if(u.ranges.length===0&&ZN(a)){const{from:f,to:p}=a;c.push({from:f,to:p})}else u.forEach((f,p)=>{c.push({from:f,to:p})});c.forEach(f=>{const p=d.map(f.from,-1),h=d.map(f.to);r.push({from:p,to:h,prevFrom:i.map(p,-1),prevTo:i.map(h)})})});const s=qs(r,(a,l)=>a.from-l.from);return c6(s)}function u6(e,t){const r=[],n=UE(e,t);for(const o of n)try{const i=e.doc.resolve(o.from),s=e.doc.resolve(o.to),a=i.blockRange(s);a&&r.push(a)}catch{}return r}function d6(e){var t;return((t=e.content.firstChild)==null?void 0:t.textContent)??""}function f6(e,t){if(!ls(e.selection))return;let{from:r,to:n}=e.selection;const o=(s,a)=>d6(le.between(e.doc.resolve(s),e.doc.resolve(a)).content());for(let s=o(r-1,r);s&&!t.test(s);r--,s=o(r-1,r));for(let s=o(n,n+1);s&&!t.test(s);n++,s=o(n,n+1));if(r===n)return;const i=e.doc.textBetween(r,n,X0,` + +`);return{from:r,to:n,text:i}}function WE(e){return f6(e,/\W/)}function il(e,t=0){const r=at(e)?e[t]:e;return uS(ne(r),`No match string found for match ${e}`),r??""}function p6(e){return ls(e)?e.$cursor:void 0}function h6(e,t){return bd(e)?t?e.type===t.nodes.doc:e.type.name==="doc":!1}function m6(e){return Xt(e)&&sn(e.anchor)&&sn(e.head)}function Cn(e,t){const r=t.nodeSize-2,n=0;let o;const i=l=>b_({min:n,max:r,value:l});if(xv(e))return e;if(e==="all")return new mr(t);if(e==="start"?o=n:e==="end"?o=r:s6(e)?o=e.pos:o=e,sn(o))return o=i(o),le.near(t.resolve(o));if(m6(o)){const l=i(o.anchor),c=i(o.head);return le.between(t.resolve(l),t.resolve(c))}const s=i(o.from),a=i(o.to);return le.between(t.resolve(s),t.resolve(a))}var g6=3;function KE(e){const{content:t,schema:r,document:n,stringHandler:o,onError:i,attempts:s=0}=e,a=i&&s<=g6||s===0;if(te(a,{code:$.INVALID_CONTENT,message:"The invalid content has been called recursively more than ${MAX_ATTEMPTS} times. The content is invalid and the error handler has not been able to recover properly."}),ne(t))return te(o,{code:$.INVALID_CONTENT,message:`The string '${t}' was added to the editor, but no \`stringHandler\` was added. Please provide a valid string handler which transforms your content to a \`ProsemirrorNode\` to prevent this error.`}),o({document:n,content:t,schema:r});if(FE(t))return t.doc;if(bd(t))return t;try{return r.nodeFromJSON(t)}catch(l){const c=E6({schema:r,error:l,json:t}),u=i==null?void 0:i(c);return te(u,{code:$.INVALID_CONTENT,message:`An error occurred when processing the content. Please provide an \`onError\` handler to process the invalid content: ${JSON.stringify(c.invalidContent,null,2)}`}),KE({...e,content:u,attempts:s+1})}}function kh(){const e=JS();if(e)return e;throw new Error(`Unable to retrieve the document from the global scope. +It seems that you are running Remirror in a non-browser environment. Remirror need browser APIs to work. +If you are using Jest (or other testing frameworks), make sure that you are using the JSDOM environment (https://jestjs.io/docs/29.0/configuration#testenvironment-string). +If you are using Next.js (or other server-side rendering frameworks), please use dynamic import with \`ssr: false\` to load the editor component without rendering it on the server (https://nextjs.org/docs/advanced-features/dynamic-import#with-no-ssr). +If you are using Node.js, you can install JSDOM and Remirror will try to use it automatically, or you can create a fake document and pass it to Remirror`)}function qE(e){var t;return(e==null?void 0:e.defaultView)??(typeof window<"u"?window:void 0)??((t=JS())==null?void 0:t.defaultView)}function v6(e){return qE(e==null?void 0:e.ownerDocument)}function y6(e){const t=qE(e)??kh().defaultView;if(t)return t;throw new Error("Unable to retrieve the window from the global scope")}function b6(e,t=kh()){const r=h6(e,e.type.schema)?e.content:P.from(e);return kn.fromSchema(e.type.schema).serializeFragment(r,{document:t})}function k6(e,t){return new(y6(t)).DOMParser().parseFromString(`${e}`,"text/html").body}function x6(e,t=kh()){const r=t.createElement("div");return r.append(b6(e,t)),r.innerHTML}function k1(e){const{content:t,schema:r,document:n,fragment:o=!1,...i}=e,s=k6(t,n),a=rv.fromSchema(r);return o?a.parseSlice(s,{...Ix,...i}).content:a.parse(s,{...Ix,...i})}var Ix={preserveWhitespace:!1};function Sv(e,t){const r=xu(t.defaults());return Q0({...e},r)}function w6(e,t){let r="";t&&(r=`${t.trim()}`);const n=OA(e);if(!n)return r;const o=(r.endsWith(";")," ");return`${r}${o}${n}`}var S6={remove(e,t){let r=e;for(const n of t)n.invalidParentNode||(r=w_(n.path,r));return r}};function E6({json:e,schema:t,...r}){const n=new Set(xu(t.marks)),o=new Set(xu(t.nodes)),i=GE({json:e,path:[],validNodes:o,validMarks:n});return{json:e,invalidContent:i,transformers:S6,...r}}function GE(e){const{json:t,validMarks:r,validNodes:n,path:o=[]}=e,i={validMarks:r,validNodes:n},s=[],{type:a,marks:l,content:c}=t;let{invalidParentMark:u=!1,invalidParentNode:d=!1}=e;if(l){const f=[];for(const[p,h]of l.entries()){const m=ne(h)?h:h.type;r.has(m)||(f.unshift({name:m,path:[...o,"marks",`${p}`],type:"mark",invalidParentMark:u,invalidParentNode:d}),u=!0)}s.push(...f)}if(n.has(a)||(s.push({name:a,type:"node",path:o,invalidParentMark:u,invalidParentNode:d}),d=!0),c){const f=[];for(const[p,h]of c.entries())f.unshift(...GE({...i,json:h,path:[...o,"content",`${p}`],invalidParentMark:u,invalidParentNode:d}));s.unshift(...f)}return s}function C6(e){return!!(ls(e)&&e.$cursor&&e.$cursor.parentOffset>=e.$cursor.parent.content.size)}function x1(e){return!!(ls(e)&&e.$cursor&&e.$cursor.parentOffset<=0)}function Dx(e){const t=be.atStart(e.$anchor.doc);return!!(x1(e)&&t.anchor===e.anchor)}function M6(e){return({dispatch:t,tr:r})=>{const{type:n,attrs:o=ee(),appendText:i,range:s}=e,a=s?le.between(r.doc.resolve(s.from),r.doc.resolve(s.to)):r.selection,{$from:l,from:c,to:u}=a;let d=l.depth===0?r.doc.type.allowsMarkType(n):!1;return r.doc.nodesBetween(c,u,f=>{if(d)return!1;if(f.inlineContent&&f.type.allowsMarkType(n)){d=!0;return}}),d?(t==null||t(r.addMark(c,u,n.create(o))&&i?r.insertText(i):r),!0):!1}}function T6({tr:e,dispatch:t}){const{$from:r,$to:n}=e.selection,o=r.blockRange(n),i=o&&Wl(o);return!sn(i)||!o?!1:(t==null||t(e.lift(o,i).scrollIntoView()),!0)}function YE(e,t={},r){return function(n){const{tr:o,dispatch:i,state:s}=n,a=ne(e)?nt(s.schema.nodes,e):e,{from:l,to:c}=Cn(r??o.selection,o.doc),u=o.doc.resolve(l),d=o.doc.resolve(c),f=u.blockRange(d),p=f&&ov(f,a,t);return!p||!f?!1:(i==null||i(o.wrap(f,p).scrollIntoView()),!0)}}function JE(e,t={},r){return n=>{const{tr:o,state:i}=n,s=ne(e)?nt(i.schema.nodes,e):e;return Mu({state:o,type:s,attrs:t})?T6(n):YE(e,t,r)(n)}}function Tu(e,t,r,n=!0){return function(o){const{tr:i,dispatch:s,state:a}=o,l=ne(e)?nt(a.schema.nodes,e):e,{from:c,to:u}=Cn(r??i.selection,i.doc);let d=!1,f;return i.doc.nodesBetween(c,u,(p,h)=>{if(d)return!1;if(!p.isTextblock||p.hasMarkup(l,t))return;if(p.type===l){d=!0,f=p.attrs;return}const m=i.doc.resolve(h),b=m.index();d=m.parent.canReplaceWith(b,b+1,l),d&&(f=m.parent.attrs)}),d?(s==null||s(i.setBlockType(c,u,l,{...n?f:{},...t}).scrollIntoView()),!0):!1}}function Ev(e){return t=>{const{tr:r,state:n}=t,{type:o,attrs:i,preserveAttrs:s=!0}=e,a=Mu({state:r,type:o,attrs:i}),l=e.toggleType??yh(n.schema);if(a)return Tu(l,{...s?a.node.attrs:{},...i})(t);const c=Mu({state:r,type:l,attrs:i});return Tu(o,{...s?c==null?void 0:c.node.attrs:{},...i})(t)}}function O6(e=0){const t=navigator.userAgent.match(/Chrom(e|ium)\/(\d+)\./);return t?Number.parseInt(nt(t,2),10)>=e:!1}function _6(e,t){let{head:r,empty:n,anchor:o}=e;for(const i of t.steps)r=i.getMap().map(r);n?t.setSelection(le.near(t.doc.resolve(r))):t.setSelection(le.between(t.doc.resolve(o),t.doc.resolve(r)))}function A6(e){const{attrs:t={},appendText:r="",content:n="",keepSelection:o=!1,range:i}=e;return({state:s,tr:a,dispatch:l})=>{var c;const u=s.schema,d=Cn(e.selection??i??a.selection,a.doc),f=d.$from.index(),{from:p,to:h,$from:m}=d,b=ne(e.type)?u.nodes[e.type]??u.marks[e.type]:e.type;if(te(ne(e.type)?b:!0,{code:$.SCHEMA,message:`Schema contains no marks or nodes with name ${b}`}),e6(b)){if(!m.parent.canReplaceWith(f,f,b))return!1;a.replaceWith(p,h,b.create(t,n?u.text(n):void 0))}else te(n,{message:"`replaceText` cannot be called without content when using a mark type"}),a.replaceWith(p,h,u.text(n,BE(b)?[b.create(t)]:void 0));return r&&a.insertText(r),o&&_6(s.selection,a),l&&(O6(60)&&((c=document.getSelection())==null||c.empty()),l(a)),!0}}function XE(e,t){const r=e.parent.childAfter(e.parentOffset);if(!r.node)return;const{marks:n,nodeSize:o}=r.node;if(n[0])return n[0].type;const s=e.start()+r.offset+o;return XE(e.doc.resolve(s+1))}function QE(e){return({dispatch:t,tr:r,state:n})=>{const{type:o,expand:i=!0,range:s}=e,a=Cn(e.selection??s??r.selection,r.doc);let{from:l,to:c,$from:u,$to:d}=a;const f=ne(o)?n.schema.marks[o]:o;f!==null&&te(f,{code:$.SCHEMA,message:`Mark type: ${o} does not exist on the current schema.`});const p=f??XE(u);if(!p)return!1;const h=Yo(u,p,d);return i&&h&&(l=Math.max(0,Math.min(l,h.from)),c=Math.min(Math.max(c,h.to),r.doc.nodeSize-2)),t==null||t(r.removeMark(l,sn(c)?c:l,BE(f)?f:void 0)),!0}}function R6(e){const t=["command","cmd","meta"];return Zr.isMac&&t.push("mod"),t.includes(e)}function P6(e){const t=["control","ctrl"];return Zr.isMac||t.push("mod"),t.includes(e)}function N6(e){const t=[];for(let r of e.split("-")){if(r=r.toLowerCase(),R6(r)){t.push({type:"modifier",symbol:"⌘",key:"command",i18n:Mt.COMMAND_KEY});continue}if(P6(r)){t.push({type:"modifier",symbol:"⌃",key:"control",i18n:Mt.CONTROL_KEY});continue}switch(r){case"shift":t.push({type:"modifier",symbol:"⇧",key:r,i18n:Mt.SHIFT_KEY});continue;case"alt":t.push({type:"modifier",symbol:"⌥",key:r,i18n:Mt.ALT_KEY});continue;case` +`:case"\r":case"enter":t.push({type:"named",symbol:"↵",key:r,i18n:Mt.ENTER_KEY});continue;case"backspace":t.push({type:"named",symbol:"⌫",key:r,i18n:Mt.BACKSPACE_KEY});continue;case"delete":t.push({type:"named",symbol:"⌦",key:r,i18n:Mt.DELETE_KEY});continue;case"escape":t.push({type:"named",symbol:"␛",key:r,i18n:Mt.ESCAPE_KEY});continue;case"tab":t.push({type:"named",symbol:"⇥",key:r,i18n:Mt.TAB_KEY});continue;case"capslock":t.push({type:"named",symbol:"⇪",key:r,i18n:Mt.CAPS_LOCK_KEY});continue;case"space":t.push({type:"named",symbol:"␣",key:r,i18n:Mt.SPACE_KEY});continue;case"pageup":t.push({type:"named",symbol:"⤒",key:r,i18n:Mt.PAGE_UP_KEY});continue;case"pagedown":t.push({type:"named",symbol:"⤓",key:r,i18n:Mt.PAGE_DOWN_KEY});continue;case"home":t.push({type:"named",key:r,i18n:Mt.HOME_KEY});continue;case"end":t.push({type:"named",key:r,i18n:Mt.END_KEY});continue;case"arrowleft":t.push({type:"named",symbol:"←",key:r,i18n:Mt.ARROW_LEFT_KEY});continue;case"arrowright":t.push({type:"named",symbol:"→",key:r,i18n:Mt.ARROW_RIGHT_KEY});continue;case"arrowup":t.push({type:"named",symbol:"→",key:r,i18n:Mt.ARROW_UP_KEY});continue;case"arrowdown":t.push({type:"named",symbol:"↓",key:r,i18n:Mt.ARROW_DOWN_KEY});continue;default:t.push({type:"char",key:r});continue}}return t}function z6(e){const{node:t,predicate:r,descend:n=!0,action:o}=e;te(bd(t),{code:$.INTERNAL,message:'Invalid "node" parameter passed to "findChildren".'}),te(Ne(r),{code:$.INTERNAL,message:'Invalid "predicate" parameter passed to "findChildren".'});const i=[];return t.descendants((s,a)=>{const l={node:s,pos:a};return r(l)&&(i.push(l),o==null||o(l)),n}),i}function L6(e){const{type:t,...r}=e;return z6({...r,predicate:n=>n.node.type===t})}function I6(e,t={}){const{descend:r=!1,predicate:n,StepTypes:o}=t,i=u6(e,o),s=[];for(const a of i){const{start:l,end:c}=a;e.doc.nodesBetween(l,c,(u,d)=>(((n==null?void 0:n(u,d,a))??!0)&&s.push({node:u,pos:d}),r))}return s}function Ou(e){const{regexp:t,type:r,getAttributes:n,ignoreWhitespace:o=!1,beforeDispatch:i,updateCaptured:s,shouldSkip:a,invalidMarks:l}=e;let c;const u=new fa(t,(d,f,p,h)=>{const{tr:m,schema:b}=d;c||(c=ne(r)?b.marks[r]:r,te(c,{code:$.SCHEMA,message:`Mark type: ${r} does not exist on the current schema.`}));let v=f[1],g=f[0];const y=e5({captureGroup:v,fullMatch:g,end:h,start:p,rule:u,state:d,ignoreWhitespace:o,invalidMarks:l,shouldSkip:a,updateCaptured:s});if(!y)return null;({start:p,end:h,captureGroup:v,fullMatch:g}=y);const k=Ne(n)?n(f):n;let x=h,w=[];if(v){const E=g.search(/\S/),M=p+g.indexOf(v),C=M+v.length;w=m.storedMarks??[],Cp&&m.delete(p+E,M),x=p+E+v.length}return m.addMark(p,x,c.create(k)),m.setStoredMarks(w),i==null||i({tr:m,match:f,start:p,end:h}),m});return u}function ZE(e){const{regexp:t,type:r,getAttributes:n,beforeDispatch:o,shouldSkip:i,ignoreWhitespace:s=!1,updateCaptured:a,invalidMarks:l}=e,c=new fa(t,(u,d,f,p)=>{const h=Ne(n)?n(d):n,{tr:m,schema:b}=u,v=ne(r)?b.nodes[r]:r;let g=d[1],y=d[0];const k=e5({captureGroup:g,fullMatch:y,end:p,start:f,rule:c,state:u,ignoreWhitespace:s,invalidMarks:l,shouldSkip:i,updateCaptured:a});if(!k)return null;({start:f,end:p,captureGroup:g,fullMatch:y}=k),te(v,{code:$.SCHEMA,message:`No node exists for ${r} in the schema.`});const x=v.createAndFill(h);return x&&(m.replaceRangeWith(v.isBlock?m.doc.resolve(f).before():f,p,x),o==null||o({tr:m,match:[y,g??""],start:f,end:p})),m});return c}function e5({captureGroup:e,fullMatch:t,end:r,start:n,rule:o,ignoreWhitespace:i,shouldSkip:s,updateCaptured:a,state:l,invalidMarks:c}){var u;if(t==null)return null;const d=(a==null?void 0:a({captureGroup:e,fullMatch:t,start:n,end:r}))??{};e=d.captureGroup??e,t=d.fullMatch??t,n=d.start??n,r=d.end??r;const f=l.doc.resolve(n),p=l.doc.resolve(r);return c&&y1({$from:f,$to:p},c)||o.invalidMarks&&y1({$from:f,$to:p},o.invalidMarks)||i&&(e==null?void 0:e.trim())===""||s!=null&&s({state:l,captureGroup:e,fullMatch:t,start:n,end:r,ruleType:"mark"})||(u=o.shouldSkip)!=null&&u.call(o,{state:l,captureGroup:e,fullMatch:t,start:n,end:r,ruleType:"mark"})?null:{captureGroup:e,end:r,fullMatch:t,start:n}}var D6=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),r={},n=[];t.forEach(i=>{(i?i.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,l]=a.split("_");r[l]=a}else n.push(a)})});const o=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&o.push(r[i]);return o.push(...n),o.join(" ")},$6=D6;const t5=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function H6(e,t){let{$cursor:r}=e.selection;return!r||(t?!t.endOfTextblock("backward",e):r.parentOffset>0)?null:r}const r5=(e,t,r)=>{let n=H6(e,r);if(!n)return!1;let o=n5(n);if(!o){let s=n.blockRange(),a=s&&Wl(s);return a==null?!1:(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&s5(e,o,t))return!0;if(n.parent.content.size==0&&(Sl(i,"end")||ce.isSelectable(i))){let s=iv(e.doc,n.before(),n.after(),W.empty);if(s&&s.slice.size{let{$head:n,empty:o}=e.selection,i=n;if(!o)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("backward",e):n.parentOffset>0)return!1;i=n5(n)}let s=i&&i.nodeBefore;return!s||!ce.isSelectable(s)?!1:(t&&t(e.tr.setSelection(ce.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function n5(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function F6(e,t){let{$cursor:r}=e.selection;return!r||(t?!t.endOfTextblock("forward",e):r.parentOffset{let n=F6(e,r);if(!n)return!1;let o=o5(n);if(!o)return!1;let i=o.nodeAfter;if(s5(e,o,t))return!0;if(n.parent.content.size==0&&(Sl(i,"start")||ce.isSelectable(i))){let s=iv(e.doc,n.before(),n.after(),W.empty);if(s&&s.slice.size{let{$head:n,empty:o}=e.selection,i=n;if(!o)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("forward",e):n.parentOffset=0;t--){let r=e.node(t);if(e.index(t)+1{let{$head:r,$anchor:n}=e.selection;return!r.parent.type.spec.code||!r.sameParent(n)?!1:(t&&t(e.tr.insertText(` +`).scrollIntoView()),!0)};function Cv(e){for(let t=0;t{let{$head:r,$anchor:n}=e.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;let o=r.node(-1),i=r.indexAfter(-1),s=Cv(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let a=r.after(),l=e.tr.replaceWith(a,a,s.createAndFill());l.setSelection(be.near(l.doc.resolve(a),1)),t(l.scrollIntoView())}return!0},W6=(e,t)=>{let r=e.selection,{$from:n,$to:o}=r;if(r instanceof mr||n.parent.inlineContent||o.parent.inlineContent)return!1;let i=Cv(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let s=(!n.parentOffset&&o.index(){let{$cursor:r}=e.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let i=r.before();if(rl(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let n=r.blockRange(),o=n&&Wl(n);return o==null?!1:(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)};function q6(e){return(t,r)=>{let{$from:n,$to:o}=t.selection;if(t.selection instanceof ce&&t.selection.node.isBlock)return!n.parentOffset||!rl(t.doc,n.pos)?!1:(r&&r(t.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(r){let i=o.parentOffset==o.parent.content.size,s=t.tr;(t.selection instanceof le||t.selection instanceof mr)&&s.deleteSelection();let a=n.depth==0?null:Cv(n.node(-1).contentMatchAt(n.indexAfter(-1))),l=e&&e(o.parent,i),c=l?[l]:i&&a?[{type:a}]:void 0,u=rl(s.doc,s.mapping.map(n.pos),1,c);if(!c&&!u&&rl(s.doc,s.mapping.map(n.pos),1,a?[{type:a}]:void 0)&&(a&&(c=[{type:a}]),u=!0),u&&(s.split(s.mapping.map(n.pos),1,c),!i&&!n.parentOffset&&n.parent.type!=a)){let d=s.mapping.map(n.before()),f=s.doc.resolve(d);a&&n.node(-1).canReplaceWith(f.index(),f.index()+1,a)&&s.setNodeMarkup(s.mapping.map(n.before()),a)}r(s.scrollIntoView())}return!0}}const G6=q6(),Y6=(e,t)=>{let{$from:r,to:n}=e.selection,o,i=r.sharedDepth(n);return i==0?!1:(o=r.before(i),t&&t(e.tr.setSelection(ce.create(e.doc,o))),!0)},J6=(e,t)=>(t&&t(e.tr.setSelection(new mr(e.doc))),!0);function X6(e,t,r){let n=t.nodeBefore,o=t.nodeAfter,i=t.index();return!n||!o||!n.type.compatibleContent(o.type)?!1:!n.content.size&&t.parent.canReplace(i-1,i)?(r&&r(e.tr.delete(t.pos-n.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(i,i+1)||!(o.isTextblock||md(e.doc,t.pos))?!1:(r&&r(e.tr.clearIncompatible(t.pos,n.type,n.contentMatchAt(n.childCount)).join(t.pos).scrollIntoView()),!0)}function s5(e,t,r){let n=t.nodeBefore,o=t.nodeAfter,i,s;if(n.type.spec.isolating||o.type.spec.isolating)return!1;if(X6(e,t,r))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(i=(s=n.contentMatchAt(n.childCount)).findWrapping(o.type))&&s.matchType(i[0]||o.type).validEnd){if(r){let d=t.pos+o.nodeSize,f=P.empty;for(let m=i.length-1;m>=0;m--)f=P.from(i[m].create(null,f));f=P.from(n.copy(f));let p=e.tr.step(new vt(t.pos-1,d,t.pos,d,new W(f,1,0),i.length,!0)),h=d+2*i.length;md(p.doc,h)&&p.join(h),r(p.scrollIntoView())}return!0}let l=be.findFrom(t,1),c=l&&l.$from.blockRange(l.$to),u=c&&Wl(c);if(u!=null&&u>=t.depth)return r&&r(e.tr.lift(c,u).scrollIntoView()),!0;if(a&&Sl(o,"start",!0)&&Sl(n,"end")){let d=n,f=[];for(;f.push(d),!d.isTextblock;)d=d.lastChild;let p=o,h=1;for(;!p.isTextblock;p=p.firstChild)h++;if(d.canReplace(d.childCount,d.childCount,p.content)){if(r){let m=P.empty;for(let v=f.length-1;v>=0;v--)m=P.from(f[v].copy(m));let b=e.tr.step(new vt(t.pos-f.length,t.pos+o.nodeSize,t.pos+h,t.pos+o.nodeSize-h,new W(m,f.length,0),0,!0));r(b.scrollIntoView())}return!0}}return!1}function a5(e){return function(t,r){let n=t.selection,o=e<0?n.$from:n.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(r&&r(t.tr.setSelection(le.create(t.doc,e<0?o.start(i):o.end(i)))),!0):!1}}const Q6=a5(-1),Z6=a5(1);function ez(e,t,r){for(let n=0;n{if(s)return!1;s=a.inlineContent&&a.type.allowsMarkType(r)}),s)return!0}return!1}function tz(e,t=null){return function(r,n){let{empty:o,$cursor:i,ranges:s}=r.selection;if(o&&!i||!ez(r.doc,s,e))return!1;if(n)if(i)e.isInSet(r.storedMarks||i.marks())?n(r.tr.removeStoredMark(e)):n(r.tr.addStoredMark(e.create(t)));else{let a=!1,l=r.tr;for(let c=0;!a&&c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},nz=typeof navigator<"u"&&/Mac/.test(navigator.platform),oz=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Gt=0;Gt<10;Gt++)Yi[48+Gt]=Yi[96+Gt]=String(Gt);for(var Gt=1;Gt<=24;Gt++)Yi[Gt+111]="F"+Gt;for(var Gt=65;Gt<=90;Gt++)Yi[Gt]=String.fromCharCode(Gt+32),fp[Gt]=String.fromCharCode(Gt);for(var eg in Yi)fp.hasOwnProperty(eg)||(fp[eg]=Yi[eg]);function iz(e){var t=nz&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||oz&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",r=!t&&e.key||(e.shiftKey?fp:Yi)[e.keyCode]||e.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}const sz=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function az(e){let t=e.split(/-(?!$)/),r=t[t.length-1];r=="Space"&&(r=" ");let n,o,i,s;for(let a=0;a127)&&(i=Yi[n.keyCode])&&i!=o){let a=t[tg(i,n)];if(a&&a(r.state,r.dispatch,r))return!0}}return!1}}function cz(e){const t=qs(e,(i,s)=>(s.priority??De.Low)-(i.priority??De.Low)),r=[],n=[];for(const i of t)gz(i)?r.push(i):n.push(i);let o;return new Co({key:uz,view:i=>(o=i,{}),props:{transformPasted:i=>{var s,a,l;const c=o.state.selection.$from,u=c.node().type.name,d=new Set(c.marks().map(f=>f.type.name));for(const f of r){if((s=f.ignoredNodes)!=null&&s.includes(u)||(a=f.ignoredMarks)!=null&&a.some(g=>d.has(g)))continue;const p=((l=i.content.firstChild)==null?void 0:l.textContent)??"",h=!o.state.selection.empty&&i.content.childCount===1&&p,m=Ul(p,f.regexp)[0];if(h&&m&&f.type==="mark"&&f.replaceSelection){const{from:g,to:y}=o.state.selection,k=o.state.doc.slice(g,y),x=k.content.textBetween(0,k.content.size);if(typeof f.replaceSelection!="boolean"?f.replaceSelection(x):f.replaceSelection){const w=[],{getAttributes:E,markType:M}=f,C=Ne(E)?E(m,!0):E,T=M.create(C);return k.content.forEach(R=>{if(R.isText){const B=T.addToSet(R.marks);w.push(R.mark(B))}}),W.maxOpen(P.fromArray(w))}}const{nodes:b,transformed:v}=hz(i.content,f,o.state.schema);v&&(i=f.type==="node"&&f.nodeType.isBlock?new W(P.fromArray(b),0,0):new W(P.fromArray(b),i.openStart,i.openEnd))}return kz(i)},handleDOMEvents:{paste:(i,s)=>{var a,l;const c=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{clipboardData:u}=c;if(!u)return!1;const d=[...u.items].map(p=>p.getAsFile()).filter(p=>!!p);if(d.length===0)return!1;const{selection:f}=i.state;for(const{fileHandler:p,regexp:h}of n){const m=h?d.filter(b=>h.test(b.type)):d;if(m.length!==0&&p({event:c,files:m,selection:f,view:i,type:"paste"}))return c.preventDefault(),!0}return!1},drop:(i,s)=>{var a,l,c;const u=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{dataTransfer:d,clientX:f,clientY:p}=u;if(!d)return!1;const h=bz(u);if(h.length===0)return!1;const m=((c=i.posAtCoords({left:f,top:p}))==null?void 0:c.pos)??i.state.selection.anchor;for(const{fileHandler:b,regexp:v}of n){const g=v?h.filter(y=>v.test(y.type)):h;if(g.length!==0&&b({event:u,files:g,pos:m,view:i,type:"drop"}))return u.preventDefault(),!0}return!1}}}})}var uz=new da("pasteRule");function rg(e,t){return function r(n){const{fragment:o,rule:i,nodes:s}=n,{regexp:a,ignoreWhitespace:l,ignoredMarks:c,ignoredNodes:u}=i;let d=!1;return o.forEach(f=>{if(u!=null&&u.includes(f.type.name)||vz(f)){s.push(f);return}if(!f.isText){const m=r({fragment:f.content,rule:i,nodes:[]});d||(d=m.transformed);const b=P.fromArray(m.nodes);f.type.validContent(b)?s.push(f.copy(b)):s.push(...m.nodes);return}if(f.marks.some(m=>yz(m)||(c==null?void 0:c.includes(m.type.name)))){s.push(f);return}const p=f.text??"";let h=0;for(const m of Ul(p,a)){const b=m[1],v=m[0];if(l&&(b==null?void 0:b.trim())===""||!v)return;const g=m.index,y=g+v.length;g>h&&s.push(f.cut(h,g));let k=f.cut(g,y);if(v&&b){const x=v.search(/\S/),w=g+v.indexOf(b),E=w+b.length;x&&s.push(f.cut(g,g+x)),k=f.cut(w,E)}e({nodes:s,rule:i,textNode:k,match:m,schema:t}),d=!0,h=y}p&&h0?[...n.files]:(r=n.items)!=null&&r.length?[...n.items].map(o=>o.getAsFile()).filter(o=>!!o):[]:[]}function kz(e){const t=W.maxOpen(e.content);return t.openStart({events:{},emit(e,...t){(this.events[e]||[]).forEach(r=>r(...t))},on(e,t){return(this.events[e]=this.events[e]||[]).push(t),()=>this.events[e]=(this.events[e]||[]).filter(r=>r!==t)}});var xz=Object.defineProperty,wz=Object.getOwnPropertyDescriptor,Z=(e,t,r,n)=>{for(var o=n>1?void 0:n?wz(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&xz(t,r,o),o},c5=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},q=(e,t,r)=>(c5(e,t,"read from private field"),r?r.call(e):t.get(e)),bt=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Lt=(e,t,r,n)=>(c5(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);function Sz(e,t){return e===t}function Hx(e){const{previousOptions:t,update:r,equals:n=Sz}=e,o=Rs({...t,...r}),i=ee(),s=xu(t);for(const l of s){const c=t[l],u=o[l];if(n(c,u)){i[l]={changed:!1};continue}i[l]={changed:!0,previousValue:c,value:u}}const a=l=>{const c=ee();for(const u of l){const d=i[u];d!=null&&d.changed&&(c[u]=d.value)}return c};return{changes:Rs(i),options:o,pickChanged:a}}var Ez={[$.DUPLICATE_HELPER_NAMES]:"helper method",[$.DUPLICATE_COMMAND_NAMES]:"command method"};function u5(e){const{name:t,set:r,code:n}=e,o=Ez[n];te(!r.has(t),{code:n,message:`There is a naming conflict for the name: ${t} used in this '${o}'. Please rename or remove from the editor to avoid runtime errors.`}),r.add(t)}function _u(...e){return vl($6(...e).split(" ")).join(" ")}var Bx="__IGNORE__",Cz="__ALL__",Gl=class{constructor(e,...[t]){this["~O"]={},this._mappedHandlers=ee(),this.populateMappedHandlers(),this._options=this._initialOptions=vS(e,this.constructor.defaultOptions,t??ee(),this.createDefaultHandlerOptions()),this._dynamicKeys=this.getDynamicKeys(),this.init()}get options(){return this._options}get dynamicKeys(){return this._dynamicKeys}get initialOptions(){return this._initialOptions}init(){}getDynamicKeys(){const e=[],{customHandlerKeys:t,handlerKeys:r,staticKeys:n}=this.constructor;for(const o of xu(this._options))n.includes(o)||r.includes(o)||t.includes(o)||e.push(o);return e}ensureAllKeysAreDynamic(e){}setOptions(e){var t;const r=this.getDynamicOptions();this.ensureAllKeysAreDynamic(e);const{changes:n,options:o,pickChanged:i}=Hx({previousOptions:r,update:e});this.updateDynamicOptions(o),(t=this.onSetOptions)==null||t.call(this,{reason:"set",changes:n,options:o,pickChanged:i,initialOptions:this._initialOptions})}resetOptions(){var e;const t=this.getDynamicOptions(),{changes:r,options:n,pickChanged:o}=Hx({previousOptions:t,update:this._initialOptions});this.updateDynamicOptions(n),(e=this.onSetOptions)==null||e.call(this,{reason:"reset",options:n,changes:r,pickChanged:o,initialOptions:this._initialOptions})}getDynamicOptions(){return Q0(this._options,[...this.constructor.customHandlerKeys,...this.constructor.handlerKeys])}updateDynamicOptions(e){this._options={...this._options,...e}}populateMappedHandlers(){for(const e of this.constructor.handlerKeys)this._mappedHandlers[e]=[]}createDefaultHandlerOptions(){const e=ee();for(const t of this.constructor.handlerKeys)e[t]=(...r)=>{var n;const{handlerKeyOptions:o}=this.constructor,i=(n=o[t])==null?void 0:n.reducer;let s=i==null?void 0:i.getDefault(...r);for(const[,a]of this._mappedHandlers[t]){const l=a(...r);if(s=i?i.accumulator(s,l,...r):l,Mz(o,s,t))return s}return s};return e}addHandler(e,t,r=De.Default){return this._mappedHandlers[e].push([r,t]),this.sortHandlers(e),()=>this._mappedHandlers[e]=this._mappedHandlers[e].filter(([,n])=>n!==t)}hasHandlers(e){return(this._mappedHandlers[e]??[]).length>0}sortHandlers(e){this._mappedHandlers[e]=qs(this._mappedHandlers[e],([t],[r])=>r-t)}addCustomHandler(e,t){var r;return((r=this.onAddCustomHandler)==null?void 0:r.call(this,{[e]:t}))??gS}};Gl.defaultOptions={};Gl.staticKeys=[];Gl.handlerKeys=[];Gl.handlerKeyOptions={};Gl.customHandlerKeys=[];function Mz(e,t,r){const{[Cz]:n}=e,o=e[r];return!n&&!o?!1:!!(o&&o.earlyReturnValue!==Bx&&(Ne(o.earlyReturnValue)?o.earlyReturnValue(t)===!0:t===o.earlyReturnValue)||n&&n.earlyReturnValue!==Bx&&(Ne(n.earlyReturnValue)?n.earlyReturnValue(t)===!0:t===n.earlyReturnValue))}var Sh=class extends Gl{constructor(...e){super(Tz,...e),this["~E"]={},this._extensions=yS(this.createExtensions(),t=>t.constructor),this.extensionMap=new Map;for(const t of this._extensions)this.extensionMap.set(t.constructor,t)}get priority(){return this.priorityOverride??this.options.priority??this.constructor.defaultPriority}get constructorName(){return`${lS(this.name)}Extension`}get store(){return te(this._store,{code:$.MANAGER_PHASE_ERROR,message:"An error occurred while attempting to access the 'extension.store' when the Manager has not yet set created the lifecycle methods."}),Rs(this._store,{requireKeys:!0})}get extensions(){return this._extensions}replaceChildExtension(e,t){this.extensionMap.has(e)&&(this.extensionMap.set(e,t),this._extensions=this.extensions.map(r=>t.constructor===e?t:r))}createExtensions(){return[]}getExtension(e){const t=this.extensionMap.get(e);return te(t,{code:$.INVALID_GET_EXTENSION,message:`'${e.name}' does not exist within the preset: '${this.name}'`}),t}isOfType(e){return this.constructor===e}setStore(e){this._store||(this._store=e)}clone(...e){return new this.constructor(...e)}setPriority(e){this.priorityOverride=e}};Sh.defaultPriority=De.Default;var Ge=class extends Sh{static get[Go](){return $t.PlainExtensionConstructor}get[Go](){return $t.PlainExtension}},pa=class extends Sh{static get[Go](){return $t.MarkExtensionConstructor}get[Go](){return $t.MarkExtension}get type(){return nt(this.store.schema.marks,this.name)}constructor(...e){super(...e)}};pa.disableExtraAttributes=!1;var wr=class extends Sh{static get[Go](){return $t.NodeExtensionConstructor}get[Go](){return $t.NodeExtension}get type(){return nt(this.store.schema.nodes,this.name)}constructor(...e){super(...e)}};wr.disableExtraAttributes=!1;var Tz={priority:void 0,extraAttributes:{},disableExtraAttributes:!1,exclude:{}};function d5(e){return Kl(e)&&ql(e,[$t.PlainExtension,$t.MarkExtension,$t.NodeExtension])}function Oz(e){return Kl(e)&&ql(e,[$t.PlainExtensionConstructor,$t.MarkExtensionConstructor,$t.NodeExtensionConstructor])}function f5(e){return Kl(e)&&ql(e,$t.PlainExtension)}function xd(e){return Kl(e)&&ql(e,$t.NodeExtension)}function Eh(e){return Kl(e)&&ql(e,$t.MarkExtension)}function ye(e){return t=>{const{defaultOptions:r,customHandlerKeys:n,handlerKeys:o,staticKeys:i,defaultPriority:s,handlerKeyOptions:a,...l}=e,c=t;r&&(c.defaultOptions=r),s&&(c.defaultPriority=s),a&&(c.handlerKeyOptions=a),c.staticKeys=i??[],c.handlerKeys=o??[],c.customHandlerKeys=n??[];for(const[u,d]of Object.entries(l))c[u]||(c[u]=d);return c}}var _z=class extends Ge{constructor(){super(...arguments),this.attributeList=[],this.attributeObject=ee(),this.updateAttributes=(e=!0)=>{this.transformAttributes(),e&&this.store.commands.forceUpdate("attributes")}}get name(){return"attributes"}onCreate(){this.transformAttributes(),this.store.setExtensionStore("updateAttributes",this.updateAttributes)}transformAttributes(){var e,t,r;if(this.attributeObject=ee(),(e=this.store.managerSettings.exclude)!=null&&e.attributes){this.store.setStoreKey("attributes",this.attributeObject);return}this.attributeList=[];for(const n of this.store.extensions){if((t=n.options.exclude)!=null&&t.attributes)continue;const o=(r=n.createAttributes)==null?void 0:r.call(n),i={...o,class:_u(...n.classNames??[],o==null?void 0:o.class)};this.attributeList.unshift(i)}for(const n of this.attributeList)this.attributeObject={...this.attributeObject,...n,class:_u(this.attributeObject.class,n.class)};this.store.setStoreKey("attributes",this.attributeObject)}};function je(e={}){return(t,r,n)=>{(t.decoratedHelpers??(t.decoratedHelpers={}))[r]=e}}function Y(e={}){return(t,r,n)=>{(t.decoratedCommands??(t.decoratedCommands={}))[r]=e}}function Et(e){return(t,r,n)=>{(t.decoratedKeybindings??(t.decoratedKeybindings={}))[r]=e}}var Az=class{constructor(e){this.promiseCreator=e,this.failureHandlers=[],this.successHandlers=[],this.validateHandlers=[],this.generateCommand=()=>t=>{let r=!0;const{view:n,tr:o,dispatch:i}=t;if(!n)return!1;for(const a of this.validateHandlers)if(!a({...t,dispatch:()=>{}})){r=!1;break}return!i||!r?r:(this.promiseCreator(t).then(a=>{this.runHandlers(this.successHandlers,{value:a,state:n.state,tr:n.state.tr,dispatch:n.dispatch,view:n})}).catch(a=>{this.runHandlers(this.failureHandlers,{error:a,state:n.state,tr:n.state.tr,dispatch:n.dispatch,view:n})}),i(o),!0)}}validate(e,t="push"){return this.validateHandlers[t](e),this}success(e,t="push"){return this.successHandlers[t](e),this}failure(e,t="push"){return this.failureHandlers[t](e),this}runHandlers(e,t){var r;for(const n of e)if(!n({...t,dispatch:()=>{}}))break;(r=t.dispatch)==null||r.call(t,t.tr)}};function Ji(e){const{type:t,attrs:r,range:n,selection:o}=e;return i=>{const{dispatch:s,tr:a,state:l}=i,c=ne(t)?l.schema.marks[t]:t;if(te(c,{code:$.SCHEMA,message:`Mark type: ${t} does not exist on the current schema.`}),n||o){const{from:u,to:d}=Cn(o??n??a.selection,a.doc);return dp({trState:a,type:t,...n})?s==null||s(a.removeMark(u,d,c)):s==null||s(a.addMark(u,d,c.create(r))),!0}return iu(tz(c,r))(i)}}function Rz(e,t,r){for(const{$from:n,$to:o}of r){let i=n.depth===0?t.type.allowsMarkType(e):!1;if(t.nodesBetween(n.pos,o.pos,s=>{if(i)return!1;i=s.inlineContent&&s.type.allowsMarkType(e)}),i)return!0}return!1}function Pz(e,t,r){return({tr:n,dispatch:o,state:i})=>{const s=Cn(r??n.selection,n.doc),a=p6(s),l=ne(e)?i.schema.marks[e]:e;if(te(l,{code:$.SCHEMA,message:`Mark type: ${e} does not exist on the current schema.`}),s.empty&&!a||!Rz(l,n.doc,s.ranges))return!1;if(!o)return!0;if(a)return n.removeStoredMark(l),t&&n.addStoredMark(l.create(t)),o(n),!0;let c=!1;for(const{$from:u,$to:d}of s.ranges){if(c)break;c=n.doc.rangeHasMark(u.pos,d.pos,l)}for(const{$from:u,$to:d}of s.ranges)c&&n.removeMark(u.pos,d.pos,l),t&&n.addMark(u.pos,d.pos,l.create(t));return o(n),!0}}function Nz(e,t={}){return({tr:r,dispatch:n,state:o})=>{const i=o.schema,s=r.selection,{from:a=s.from,to:l=a??s.to,marks:c={}}=t;if(!n)return!0;r.insertText(e,a,l);const u=nt(r.steps,r.steps.length-1).getMap().map(l);for(const[d,f]of At(c))r.addMark(a,u,nt(i.marks,d).create(f));return n(r),!0}}var ke=class extends Ge{constructor(){super(...arguments),this.decorated=new Map,this.forceUpdateTransaction=(e,...t)=>{const{forcedUpdates:r}=this.getCommandMeta(e);return this.setCommandMeta(e,{forcedUpdates:vl([...r,...t])}),e}}get name(){return"commands"}get transaction(){const e=this.store.getState();this._transaction||(this._transaction=e.tr);const t=this._transaction.before.eq(e.doc),r=!Ki(this._transaction.steps);if(!t){const n=e.tr;if(r)for(const o of this._transaction.steps)n.step(o);this._transaction=n}return this._transaction}onCreate(){this.store.setStoreKey("getForcedUpdates",this.getForcedUpdates.bind(this))}onView(e){var t;const{extensions:r,helpers:n}=this.store,o=ee(),i=new Set;let s=ee();const a=c=>{var u;const d=ee(),f=()=>c??this.transaction;let p=[];const h=()=>p;for(const[b,v]of Object.entries(o))(u=s[b])!=null&&u.disableChaining||(d[b]=this.chainedFactory({chain:d,command:v.original,getTr:f,getChain:h}));const m=b=>{te(b===f(),{message:"Chaining currently only supports `CommandFunction` methods which do not use the `state.tr` property. Instead you should use the provided `tr` property."})};return d.run=(b={})=>{const v=p;p=[];for(const g of v)if(!g(m)&&b.exitEarly)return;e.dispatch(f())},d.tr=()=>{const b=p;p=[];for(const v of b)v(m);return f()},d.enabled=()=>{for(const b of p)if(!b())return!1;return!0},d.new=b=>a(b),d};for(const c of r){const u=((t=c.createCommands)==null?void 0:t.call(c))??{},d=c.decoratedCommands??{},f={};s={...s,decoratedCommands:d};for(const[p,h]of Object.entries(d)){const m=ne(h.shortcut)&&h.shortcut.startsWith("_|")?{shortcut:n.getNamedShortcut(h.shortcut,c.options)}:void 0;this.updateDecorated(p,{...h,name:c.name,...m}),u[p]=c[p].bind(c),h.active&&(f[p]=()=>{var b;return((b=h.active)==null?void 0:b.call(h,c.options,this.store))??!1})}Yf(u)||this.addCommands({active:f,names:i,commands:o,extensionCommands:u})}const l=a();for(const[c,u]of Object.entries(l))a[c]=u;this.store.setStoreKey("commands",o),this.store.setStoreKey("chain",a),this.store.setExtensionStore("commands",o),this.store.setExtensionStore("chain",a)}onStateUpdate({state:e}){this._transaction=e.tr}createPlugin(){return{}}customDispatch(e){return e}insertText(e,t={}){return ne(e)?Nz(e,t):this.store.createPlaceholderCommand({promise:e,placeholder:{type:"inline"},onSuccess:(r,n,o)=>this.insertText(r,{...t,...n})(o)}).generateCommand()}selectText(e,t={}){return({tr:r,dispatch:n})=>{const o=Cn(e,r.doc);return r.selection.anchor===o.anchor&&r.selection.head===o.head&&!t.forceUpdate?!1:(n==null||n(r.setSelection(o)),!0)}}selectMark(e){return t=>{const{tr:r}=t,n=Yo(r.selection.$from,e);return n?this.store.commands.selectText.original({from:n.from,to:n.to})(t):!1}}delete(e){return({tr:t,dispatch:r})=>{const{from:n,to:o}=e??t.selection;return r==null||r(t.delete(n,o)),!0}}emptyUpdate(e){return({tr:t,dispatch:r})=>(r&&(e==null||e(),r(t)),!0)}forceUpdate(...e){return({tr:t,dispatch:r})=>(r==null||r(this.forceUpdateTransaction(t,...e)),!0)}updateNodeAttributes(e,t){return({tr:r,dispatch:n})=>(n==null||n(r.setNodeMarkup(e,void 0,t)),!0)}setContent(e,t){return r=>{const{tr:n,dispatch:o}=r,i=this.store.manager.createState({content:e,selection:t});return i?(o==null||o(n.replaceRangeWith(0,n.doc.nodeSize-2,i.doc)),!0):!1}}resetContent(){return e=>{const{tr:t,dispatch:r}=e,n=this.store.manager.createEmptyDoc();return n?this.setContent(n)(e):(r==null||r(t.delete(0,t.doc.nodeSize)),!0)}}emptySelection(){return({tr:e,dispatch:t})=>e.selection.empty?!1:(t==null||t(e.setSelection(le.near(e.selection.$anchor))),!0)}insertNewLine(){return({dispatch:e,tr:t})=>ls(t.selection)?(e==null||e(t.insertText(` +`)),!0):!1}insertNode(e,t={}){return({dispatch:r,tr:n,state:o})=>{var i;const{attrs:s,range:a,selection:l,replaceEmptyParentBlock:c=!1}=t,{from:u,to:d,$from:f}=Cn(l??a??n.selection,n.doc);if(bd(e)||n6(e)){const v=f.before(f.depth);return r==null||r(c&&u===d&&bh(f.parent)?n.replaceWith(v,v+f.parent.nodeSize,e):n.replaceWith(u,d,e)),!0}const p=ne(e)?o.schema.nodes[e]:e;te(p,{code:$.SCHEMA,message:`The requested node type ${e} does not exist in the schema.`});const h=(i=t.marks)==null?void 0:i.map(v=>{if(v instanceof Te)return v;const g=ne(v)?o.schema.marks[v]:v;return te(g,{code:$.SCHEMA,message:`The requested mark type ${v} does not exist in the schema.`}),g.create()}),m=p.createAndFill(s,ne(t.content)?o.schema.text(t.content):t.content,h);if(!m)return!1;const b=u!==d;return r==null||r(b?n.replaceRangeWith(u,d,m):n.insert(u,m)),!0}}focus(e){return t=>{const{dispatch:r,tr:n}=t,{view:o}=this.store;if(e===!1||o.hasFocus()&&(e===void 0||e===!0))return!1;if(e===void 0||e===!0){const{from:i=0,to:s=i}=n.selection;e={from:i,to:s}}return r&&this.delayedFocus(),this.selectText(e)(t)}}blur(e){return t=>{const{view:r}=this.store;return r.hasFocus()?(requestAnimationFrame(()=>{r.dom.blur()}),e?this.selectText(e)(t):!0):!1}}setBlockNodeType(e,t,r,n=!0){return Tu(e,t,r,n)}toggleWrappingNode(e,t,r){return JE(e,t,r)}toggleBlockNodeItem(e){return Ev(e)}wrapInNode(e,t,r){return YE(e,t,r)}applyMark(e,t,r){return Pz(e,t,r)}toggleMark(e){return Ji(e)}removeMark(e){return QE(e)}setMeta(e,t){return({tr:r})=>(r.setMeta(e,t),!0)}selectAll(){return this.selectText("all")}copy(){return e=>e.tr.selection.empty?!1:(e.dispatch&&document.execCommand("copy"),!0)}paste(){return this.store.createPlaceholderCommand({promise:async()=>{var e;return(e=navigator.clipboard)!=null&&e.readText?await navigator.clipboard.readText():""},placeholder:{type:"inline"},onSuccess:(e,t,r)=>this.insertNode(k1({content:e,schema:r.state.schema}),{selection:t})(r)}).generateCommand()}cut(){return e=>e.tr.selection.empty?!1:(e.dispatch&&document.execCommand("cut"),!0)}replaceText(e){return A6(e)}getAllCommandOptions(){const e={};for(const[t,r]of this.decorated)Yf(r)||(e[t]=r);return e}getCommandOptions(e){return this.decorated.get(e)}getCommandProp(){return{tr:this.transaction,dispatch:this.store.view.dispatch,state:this.store.view.state,view:this.store.view}}updateDecorated(e,t){if(!t){this.decorated.delete(e);return}const r=this.decorated.get(e)??{name:""};this.decorated.set(e,{...r,...t})}handleIosFocus(){Zr.isIos&&this.store.view.dom.focus()}delayedFocus(){this.handleIosFocus(),requestAnimationFrame(()=>{this.store.view.focus(),this.store.view.dispatch(this.transaction.scrollIntoView())})}getForcedUpdates(e){return this.getCommandMeta(e).forcedUpdates}getCommandMeta(e){const t=e.getMeta(this.pluginKey)??{};return{...zz,...t}}setCommandMeta(e,t){const r=this.getCommandMeta(e);e.setMeta(this.pluginKey,{...r,...t})}addCommands(e){const{extensionCommands:t,commands:r,names:n,active:o}=e;for(const[i,s]of At(t))u5({name:i,set:n,code:$.DUPLICATE_COMMAND_NAMES}),te(!Lz.has(i),{code:$.DUPLICATE_COMMAND_NAMES,message:"The command name you chose is forbidden."}),r[i]=this.createUnchainedCommand(s,o[i])}unchainedFactory(e){return(...t)=>{const{shouldDispatch:r=!0,command:n}=e,{view:o}=this.store,{state:i}=o;let s;return r&&(s=o.dispatch),n(...t)({state:i,dispatch:s,view:o,tr:i.tr})}}createUnchainedCommand(e,t){const r=this.unchainedFactory({command:e});return r.enabled=this.unchainedFactory({command:e,shouldDispatch:!1}),r.isEnabled=r.enabled,r.original=e,r.active=t,r}chainedFactory(e){return(...t)=>{const{chain:r,command:n,getTr:o,getChain:i}=e,s=i(),{view:a}=this.store,{state:l}=a;return s.push(c=>n(...t)({state:l,dispatch:c,view:a,tr:o()})),r}}};Z([Y()],ke.prototype,"customDispatch",1);Z([Y()],ke.prototype,"insertText",1);Z([Y()],ke.prototype,"selectText",1);Z([Y()],ke.prototype,"selectMark",1);Z([Y()],ke.prototype,"delete",1);Z([Y()],ke.prototype,"emptyUpdate",1);Z([Y()],ke.prototype,"forceUpdate",1);Z([Y()],ke.prototype,"updateNodeAttributes",1);Z([Y()],ke.prototype,"setContent",1);Z([Y()],ke.prototype,"resetContent",1);Z([Y()],ke.prototype,"emptySelection",1);Z([Y()],ke.prototype,"insertNewLine",1);Z([Y()],ke.prototype,"insertNode",1);Z([Y()],ke.prototype,"focus",1);Z([Y()],ke.prototype,"blur",1);Z([Y()],ke.prototype,"setBlockNodeType",1);Z([Y()],ke.prototype,"toggleWrappingNode",1);Z([Y()],ke.prototype,"toggleBlockNodeItem",1);Z([Y()],ke.prototype,"wrapInNode",1);Z([Y()],ke.prototype,"applyMark",1);Z([Y()],ke.prototype,"toggleMark",1);Z([Y()],ke.prototype,"removeMark",1);Z([Y()],ke.prototype,"setMeta",1);Z([Y({description:({t:e})=>e(qi.SELECT_ALL_DESCRIPTION),label:({t:e})=>e(qi.SELECT_ALL_LABEL),shortcut:j.SelectAll})],ke.prototype,"selectAll",1);Z([Y({description:({t:e})=>e(qi.COPY_DESCRIPTION),label:({t:e})=>e(qi.COPY_LABEL),shortcut:j.Copy,icon:"fileCopyLine"})],ke.prototype,"copy",1);Z([Y({description:({t:e})=>e(qi.PASTE_DESCRIPTION),label:({t:e})=>e(qi.PASTE_LABEL),shortcut:j.Paste,icon:"clipboardLine"})],ke.prototype,"paste",1);Z([Y({description:({t:e})=>e(qi.CUT_DESCRIPTION),label:({t:e})=>e(qi.CUT_LABEL),shortcut:j.Cut,icon:"scissorsFill"})],ke.prototype,"cut",1);Z([Y()],ke.prototype,"replaceText",1);Z([je()],ke.prototype,"getAllCommandOptions",1);Z([je()],ke.prototype,"getCommandOptions",1);Z([je()],ke.prototype,"getCommandProp",1);ke=Z([ye({defaultPriority:De.Highest,defaultOptions:{trackerClassName:"remirror-tracker-position",trackerNodeName:"span"},staticKeys:["trackerClassName","trackerNodeName"]})],ke);var zz={forcedUpdates:[]},Lz=new Set(["run","chain","original","raw","enabled","tr","new"]),Zn=class extends Ge{constructor(){super(...arguments),this.placeholders=Ee.empty,this.placeholderWidgets=new Map,this.createPlaceholderCommand=e=>{const t=gl(),{promise:r,placeholder:n,onFailure:o,onSuccess:i}=e;return new Az(r).validate(s=>this.addPlaceholder(t,n)(s)).success(s=>{const{state:a,tr:l,dispatch:c,view:u,value:d}=s,f=this.store.helpers.findPlaceholder(t);if(!f){const p=new Error("The placeholder has been removed");return(o==null?void 0:o({error:p,state:a,tr:l,dispatch:c,view:u}))??!1}return this.removePlaceholder(t)({state:a,tr:l,view:u,dispatch:()=>{}}),i(d,f,{state:a,tr:l,dispatch:c,view:u})}).failure(s=>(this.removePlaceholder(t)({...s,dispatch:()=>{}}),(o==null?void 0:o(s))??!1))}}get name(){return"decorations"}onCreate(){this.store.setExtensionStore("createPlaceholderCommand",this.createPlaceholderCommand)}createPlugin(){return{state:{init:()=>{},apply:e=>{var t,r,n,o,i,s;const{added:a,clearTrackers:l,removed:c,updated:u}=this.getMeta(e);if(l){this.placeholders=Ee.empty;for(const[,d]of this.placeholderWidgets)(r=(t=d.spec).onDestroy)==null||r.call(t,this.store.view,d.spec.element);this.placeholderWidgets.clear();return}this.placeholders=this.placeholders.map(e.mapping,e.doc,{onRemove:d=>{var f,p;const h=this.placeholderWidgets.get(d.id);h&&((p=(f=h.spec).onDestroy)==null||p.call(f,this.store.view,h.spec.element))}});for(const[,d]of this.placeholderWidgets)(o=(n=d.spec).onUpdate)==null||o.call(n,this.store.view,d.from,d.spec.element,d.spec.data);for(const d of a){if(d.type==="inline"){this.addInlinePlaceholder(d,e);continue}if(d.type==="node"){this.addNodePlaceholder(d,e);continue}if(d.type==="widget"){this.addWidgetPlaceholder(d,e);continue}}for(const{id:d,data:f}of u){const p=this.placeholderWidgets.get(d);if(!p)continue;const h=Ke.widget(p.from,p.spec.element,{...p.spec,data:f});this.placeholders=this.placeholders.remove([p]).add(e.doc,[h]),this.placeholderWidgets.set(d,h)}for(const d of c){const f=this.placeholders.find(void 0,void 0,h=>h.id===d&&h.__type===wa),p=this.placeholderWidgets.get(d);p&&((s=(i=p.spec).onDestroy)==null||s.call(i,this.store.view,p.spec.element)),this.placeholders=this.placeholders.remove(f),this.placeholderWidgets.delete(d)}}},props:{decorations:e=>{let t=this.options.decorations(e);t=t.add(e.doc,this.placeholders.find());for(const r of this.store.extensions){if(!r.createDecorations)continue;const n=r.createDecorations(e).find();t=t.add(e.doc,n)}return t},handleDOMEvents:{blur:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(Fx,!1)),!1),focus:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(Fx,!0)),!1)}}}}updateDecorations(){return({tr:e,dispatch:t})=>(t==null||t(e),!0)}addPlaceholder(e,t,r){return({dispatch:n,tr:o})=>this.addPlaceholderTransaction(e,t,o,!n)?(n==null||n(r?o.deleteSelection():o),!0):!1}updatePlaceholder(e,t){return({dispatch:r,tr:n})=>this.updatePlaceholderTransaction({id:e,data:t,tr:n,checkOnly:!r})?(r==null||r(n),!0):!1}removePlaceholder(e){return({dispatch:t,tr:r})=>this.removePlaceholderTransaction({id:e,tr:r,checkOnly:!t})?(t==null||t(r),!0):!1}clearPlaceholders(){return({tr:e,dispatch:t})=>this.clearPlaceholdersTransaction({tr:e,checkOnly:!t})?(t==null||t(e),!0):!1}findPlaceholder(e){return this.findAllPlaceholders().get(e)}findAllPlaceholders(){const e=new Map,t=this.placeholders.find(void 0,void 0,r=>r.__type===wa);for(const r of t)e.set(r.spec.id,{from:r.from,to:r.to});return e}createDecorations(e){var t,r,n;const{persistentSelectionClass:o}=this.options;return!o||(t=this.store.view)!=null&&t.hasFocus()||(n=(r=this.store.helpers).isInteracting)!=null&&n.call(r)?Ee.empty:Dz(e,Ee.empty,{class:ne(o)?o:"selection"})}onApplyState(){}addWidgetPlaceholder(e,t){const{pos:r,createElement:n,onDestroy:o,onUpdate:i,className:s,nodeName:a,id:l,type:c}=e,u=(n==null?void 0:n(this.store.view,r))??document.createElement(a);u.classList.add(s);const d=Ke.widget(r,u,{id:l,__type:wa,type:c,element:u,onDestroy:o,onUpdate:i});this.placeholderWidgets.set(l,d),this.placeholders=this.placeholders.add(t.doc,[d])}addInlinePlaceholder(e,t){const{from:r=t.selection.from,to:n=t.selection.to,className:o,nodeName:i,id:s,type:a}=e;let l;if(r===n){const c=document.createElement(i);c.classList.add(o),l=Ke.widget(r,c,{id:s,type:a,__type:wa,widget:c})}else l=Ke.inline(r,n,{nodeName:i,class:o},{id:s,__type:wa});this.placeholders=this.placeholders.add(t.doc,[l])}addNodePlaceholder(e,t){const{pos:r,className:n,nodeName:o,id:i}=e,s=sn(r)?t.doc.resolve(r):t.selection.$from,a=sn(r)?s.nodeAfter?{pos:r,end:s.nodeAfter.nodeSize}:void 0:qN(s);if(!a)return;const l=Ke.node(a.pos,a.end,{nodeName:o,class:n},{id:i,__type:wa});this.placeholders=this.placeholders.add(t.doc,[l])}withRequiredBase(e,t){const{placeholderNodeName:r,placeholderClassName:n}=this.options,{nodeName:o=r,className:i,...s}=t,a=(i?[n,i]:[n]).join(" ");return{nodeName:o,className:a,...s,id:e}}getMeta(e){const t=e.getMeta(this.pluginKey)??{};return{...Iz,...t}}setMeta(e,t){const r=this.getMeta(e);e.setMeta(this.pluginKey,{...r,...t})}addPlaceholderTransaction(e,t,r,n=!1){if(this.findPlaceholder(e))return!1;if(n)return!0;const{added:i}=this.getMeta(r);return this.setMeta(r,{added:[...i,this.withRequiredBase(e,t)]}),!0}updatePlaceholderTransaction(e){const{id:t,tr:r,checkOnly:n=!1,data:o}=e;if(!this.findPlaceholder(t))return!1;if(n)return!0;const{updated:s}=this.getMeta(r);return this.setMeta(r,{updated:vl([...s,{id:t,data:o}])}),!0}removePlaceholderTransaction(e){const{id:t,tr:r,checkOnly:n=!1}=e;if(!this.findPlaceholder(t))return!1;if(n)return!0;const{removed:i}=this.getMeta(r);return this.setMeta(r,{removed:vl([...i,t])}),!0}clearPlaceholdersTransaction(e){const{tr:t,checkOnly:r=!1}=e;return this.getPluginState()===Ee.empty?!1:(r||this.setMeta(t,{clearTrackers:!0}),!0)}};Z([Y()],Zn.prototype,"updateDecorations",1);Z([Y()],Zn.prototype,"addPlaceholder",1);Z([Y()],Zn.prototype,"updatePlaceholder",1);Z([Y()],Zn.prototype,"removePlaceholder",1);Z([Y()],Zn.prototype,"clearPlaceholders",1);Z([je()],Zn.prototype,"findPlaceholder",1);Z([je()],Zn.prototype,"findAllPlaceholders",1);Zn=Z([ye({defaultOptions:{persistentSelectionClass:void 0,placeholderClassName:"placeholder",placeholderNodeName:"span"},staticKeys:["placeholderClassName","placeholderNodeName"],handlerKeys:["decorations"],handlerKeyOptions:{decorations:{reducer:{accumulator:(e,t,r)=>e.add(r.doc,t.find()),getDefault:()=>Ee.empty}}},defaultPriority:De.Low})],Zn);var Iz={added:[],updated:[],clearTrackers:!1,removed:[]},wa="placeholderDecoration",Fx="persistentSelectionFocus";function Dz(e,t,r){const{selection:n,doc:o}=e;if(n.empty)return t;const{from:i,to:s}=n,a=kd(n)?Ke.node(i,s,r):Ke.inline(i,s,r);return t.add(o,[a])}var w1=class extends Ge{get name(){return"docChanged"}onStateUpdate(e){const{firstUpdate:t,transactions:r,tr:n}=e;t||(r??[n]).some(o=>o==null?void 0:o.docChanged)&&this.options.docChanged(e)}};w1=Z([ye({handlerKeys:["docChanged"],handlerKeyOptions:{docChanged:{earlyReturnValue:!1}},defaultPriority:De.Lowest})],w1);var Mn=class extends Ge{get name(){return"helpers"}onCreate(){var e;this.store.setStringHandler("text",this.textToProsemirrorNode.bind(this)),this.store.setStringHandler("html",k1);const t=ee(),r=ee(),n=ee(),o=new Set;for(const i of this.store.extensions){xd(i)&&(r[i.name]=a=>HE({state:this.store.getState(),type:i.type,attrs:a}),n[i.name]=a=>{var l;return(l=Mu({state:this.store.getState(),type:i.type,attrs:a}))==null?void 0:l.node.attrs}),Eh(i)&&(r[i.name]=a=>dp({trState:this.store.getState(),type:i.type,attrs:a}),n[i.name]=a=>{const l=Yo(this.store.getState().selection.$from,i.type);if(!l||!a)return l==null?void 0:l.mark.attrs;if(kv(l.mark,a))return l.mark.attrs});const s=((e=i.createHelpers)==null?void 0:e.call(i))??{};for(const a of Object.keys(i.decoratedHelpers??{}))s[a]=i[a].bind(i);if(!Yf(s))for(const[a,l]of At(s))u5({name:a,set:o,code:$.DUPLICATE_HELPER_NAMES}),t[a]=l}this.store.setStoreKey("attrs",n),this.store.setStoreKey("active",r),this.store.setStoreKey("helpers",t),this.store.setExtensionStore("attrs",n),this.store.setExtensionStore("active",r),this.store.setExtensionStore("helpers",t)}isSelectionEmpty(e=this.store.getState()){return bv(e)}isViewEditable(e=this.store.getState()){var t,r;return((r=(t=this.store.view.props).editable)==null?void 0:r.call(t,e))??!1}getStateJSON(e=this.store.getState()){return e.toJSON()}getJSON(e=this.store.getState()){return e.doc.toJSON()}getRemirrorJSON(e=this.store.getState()){return this.getJSON(e)}insertHtml(e,t){return r=>{const{state:n}=r,o=k1({content:e,schema:n.schema,fragment:!0});return this.store.commands.insertNode.original(o,t)(r)}}getText({lineBreakDivider:e=` + +`,state:t=this.store.getState()}={}){return t.doc.textBetween(0,t.doc.content.size,e,Mi)}getTextBetween(e,t,r=this.store.getState().doc){return r.textBetween(e,t,` + +`,Mi)}getHTML(e=this.store.getState()){return x6(e.doc,this.store.document)}textToProsemirrorNode(e){const t=`
${e.content}
`;return this.store.stringHandlers.html({...e,content:t})}};Z([je()],Mn.prototype,"isSelectionEmpty",1);Z([je()],Mn.prototype,"isViewEditable",1);Z([je()],Mn.prototype,"getStateJSON",1);Z([je()],Mn.prototype,"getJSON",1);Z([je()],Mn.prototype,"getRemirrorJSON",1);Z([Y()],Mn.prototype,"insertHtml",1);Z([je()],Mn.prototype,"getText",1);Z([je()],Mn.prototype,"getTextBetween",1);Z([je()],Mn.prototype,"getHTML",1);Mn=Z([ye({})],Mn);var S1=class extends Ge{get name(){return"inputRules"}onCreate(){this.store.setExtensionStore("rebuildInputRules",this.rebuildInputRules.bind(this))}createExternalPlugins(){return[this.generateInputRulesPlugin()]}generateInputRulesPlugin(){var e,t;const r=[],n=this.store.markTags[ae.ExcludeInputRules];for(const o of this.store.extensions)if(!((e=this.store.managerSettings.exclude)!=null&&e.inputRules||!o.createInputRules||(t=o.options.exclude)!=null&&t.inputRules))for(const i of o.createInputRules())i.shouldSkip=this.options.shouldSkipInputRule,i.invalidMarks=n,r.push(i);return IR({rules:r})}rebuildInputRules(){this.store.updateExtensionPlugins(this)}};S1=Z([ye({defaultPriority:De.Default,handlerKeys:["shouldSkipInputRule"],handlerKeyOptions:{shouldSkipInputRule:{earlyReturnValue:!0}}})],S1);var Kn=class extends Ge{constructor(){super(...arguments),this.extraKeyBindings=[],this.backwardMarkExitTracker=new Map,this.keydownHandler=null,this.onAddCustomHandler=({keymap:e})=>{var t,r;if(e)return this.extraKeyBindings=[...this.extraKeyBindings,e],(r=(t=this.store).rebuildKeymap)==null||r.call(t),()=>{var n,o;this.extraKeyBindings=this.extraKeyBindings.filter(i=>i!==e),(o=(n=this.store).rebuildKeymap)==null||o.call(n)}},this.rebuildKeymap=()=>{this.setupKeydownHandler()}}get name(){return"keymap"}get shortcutMap(){const{shortcuts:e}=this.options;return ne(e)?Fz[e]:e}onCreate(){this.store.setExtensionStore("rebuildKeymap",this.rebuildKeymap)}createExternalPlugins(){var e;return(e=this.store.managerSettings.exclude)!=null&&e.keymap?[]:(this.setupKeydownHandler(),[new Co({props:{handleKeyDown:(t,r)=>{var n;return(n=this.keydownHandler)==null?void 0:n.call(this,t,r)}}})])}setupKeydownHandler(){const e=this.generateKeymapBindings();this.keydownHandler=Mv(e)}generateKeymapBindings(){var e;const t=[],r=this.shortcutMap,n=this.store.getExtension(ke),o=a=>l=>bf({shortcut:l,map:r,store:this.store,options:a.options});for(const a of this.store.extensions){const l=a.decoratedKeybindings??{};if(!((e=a.options.exclude)!=null&&e.keymap)){a.createKeymap&&t.push(Hz(a.createKeymap(o(a)),r));for(const[c,u]of At(l)){if(u.isActive&&!u.isActive(a.options,this.store))continue;const d=a[c].bind(a),f=bf({shortcut:u.shortcut,map:r,options:a.options,store:this.store}),p=Ne(u.priority)?u.priority(a.options,this.store):u.priority??De.Low,h=ee();for(const m of f)h[m]=d;t.push([p,h]),u.command&&n.updateDecorated(u.command,{shortcut:f})}}}const i=this.sortKeymaps([...this.extraKeyBindings,...t]);return QN(i)}arrowRightShortcut(e){const t=this.store.markTags[ae.PreventExits],r=this.store.nodeTags[ae.PreventExits];return this.exitMarkForwards(t,r)(e)}arrowLeftShortcut(e){const t=this.store.markTags[ae.PreventExits],r=this.store.nodeTags[ae.PreventExits];return up(this.exitNodeBackwards(r),this.exitMarkBackwards(t,r))(e)}backspace(e){const t=this.store.markTags[ae.PreventExits],r=this.store.nodeTags[ae.PreventExits];return up(this.exitNodeBackwards(r,!0),this.exitMarkBackwards(t,r,!0))(e)}createKeymap(){const{selectParentNodeOnEscape:e,undoInputRuleOnBackspace:t,excludeBaseKeymap:r}=this.options,n=ee();if(!r)for(const[o,i]of At(Zm))n[o]=iu(i);return t&&Zm.Backspace&&(n.Backspace=iu(xh(DR,Zm.Backspace))),e&&(n.Escape=iu(Y6)),[De.Low,n]}getNamedShortcut(e,t={}){return e.startsWith("_|")?bf({shortcut:e,map:this.shortcutMap,store:this.store,options:t}):[e]}onSetOptions(e){var t,r;const{changes:n}=e;(n.excludeBaseKeymap.changed||n.selectParentNodeOnEscape.changed||n.undoInputRuleOnBackspace.changed)&&((r=(t=this.store).rebuildKeymap)==null||r.call(t))}sortKeymaps(e){return qs(e.map(t=>at(t)?t:[De.Default,t]),(t,r)=>r[0]-t[0]).map(t=>t[1])}exitMarkForwards(e,t){return r=>{const{tr:n,dispatch:o}=r;if(!C6(n.selection)||Gi({selection:n.selection,types:t}))return!1;const a=n.selection.$from.marks().filter(l=>!e.includes(l.type.name));if(Ki(a))return!1;if(!o)return!0;for(const l of a)n.removeStoredMark(l);return o(n.insertText(" ",n.selection.from)),!0}}exitNodeBackwards(e,t=!1){return r=>{const{tr:n}=r;if(!(t?Dx:x1)(n.selection))return!1;const i=n.selection.$anchor.node();return!bh(i)||l6(i)||e.includes(i.type.name)?!1:this.store.commands.toggleBlockNodeItem.original({type:i.type})(r)}}exitMarkBackwards(e,t,r=!1){return n=>{const{tr:o,dispatch:i}=n;if(!(r?Dx:x1)(o.selection)||this.backwardMarkExitTracker.has(o.selection.anchor))return this.backwardMarkExitTracker.clear(),!1;if(Gi({selection:o.selection,types:t}))return!1;const l=[...o.storedMarks??[],...o.selection.$from.marks()].filter(c=>!e.includes(c.type.name));if(Ki(l))return!1;if(!i)return!0;for(const c of l)o.removeStoredMark(c);return this.backwardMarkExitTracker.set(o.selection.anchor,!0),i(o),!0}}};Z([Et({shortcut:"ArrowRight",isActive:e=>e.exitMarksOnArrowPress})],Kn.prototype,"arrowRightShortcut",1);Z([Et({shortcut:"ArrowLeft",isActive:e=>e.exitMarksOnArrowPress})],Kn.prototype,"arrowLeftShortcut",1);Z([Et({shortcut:"Backspace",isActive:e=>e.exitMarksOnArrowPress})],Kn.prototype,"backspace",1);Z([je()],Kn.prototype,"getNamedShortcut",1);Kn=Z([ye({defaultPriority:De.Low,defaultOptions:{shortcuts:"default",undoInputRuleOnBackspace:!0,selectParentNodeOnEscape:!1,excludeBaseKeymap:!1,exitMarksOnArrowPress:!0},customHandlerKeys:["keymap"]})],Kn);function $z(e){return vr(uh(j),e)}function bf({shortcut:e,map:t,options:r,store:n}){return ne(e)?[E1(e,t)]:at(e)?e.map(o=>E1(o,t)):(e=e(r,n),bf({shortcut:e,map:t,options:r,store:n}))}function E1(e,t){return $z(e)?t[e]:e}function Hz(e,t){const r={};let n,o;at(e)?[o,n]=e:n=e;for(const[i,s]of At(n))r[E1(i,t)]=s;return dh(o)?r:[o,r]}var p5={[j.Copy]:"Mod-c",[j.Cut]:"Mod-x",[j.Paste]:"Mod-v",[j.PastePlain]:"Mod-Shift-v",[j.SelectAll]:"Mod-a",[j.Undo]:"Mod-z",[j.Redo]:Zr.isMac?"Shift-Mod-z":"Mod-y",[j.Bold]:"Mod-b",[j.Italic]:"Mod-i",[j.Underline]:"Mod-u",[j.Strike]:"Mod-d",[j.Code]:"Mod-`",[j.Paragraph]:"Mod-Shift-0",[j.H1]:"Mod-Shift-1",[j.H2]:"Mod-Shift-2",[j.H3]:"Mod-Shift-3",[j.H4]:"Mod-Shift-4",[j.H5]:"Mod-Shift-5",[j.H6]:"Mod-Shift-6",[j.TaskList]:"Mod-Shift-7",[j.BulletList]:"Mod-Shift-8",[j.OrderedList]:"Mod-Shift-9",[j.Quote]:"Mod->",[j.Divider]:"Mod-Shift-|",[j.Codeblock]:"Mod-Shift-~",[j.ClearFormatting]:"Mod-Shift-C",[j.Superscript]:"Mod-.",[j.Subscript]:"Mod-,",[j.LeftAlignment]:"Mod-Shift-L",[j.CenterAlignment]:"Mod-Shift-E",[j.RightAlignment]:"Mod-Shift-R",[j.JustifyAlignment]:"Mod-Shift-J",[j.InsertLink]:"Mod-k",[j.Find]:"Mod-f",[j.FindBackwards]:"Mod-Shift-f",[j.FindReplace]:"Mod-Shift-H",[j.AddFootnote]:"Mod-Alt-f",[j.AddComment]:"Mod-Alt-m",[j.ContextMenu]:"Mod-Shift-\\",[j.IncreaseFontSize]:"Mod-Shift-.",[j.DecreaseFontSize]:"Mod-Shift-,",[j.IncreaseIndent]:"Tab",[j.DecreaseIndent]:"Shift-Tab",[j.Shortcuts]:"Mod-/",[j.Format]:Zr.isMac?"Alt-Shift-f":"Shift-Ctrl-f"},Bz={...p5,[j.Strike]:"Mod-Shift-S",[j.Code]:"Mod-Shift-M",[j.Paragraph]:"Mod-Alt-0",[j.H1]:"Mod-Alt-1",[j.H2]:"Mod-Alt-2",[j.H3]:"Mod-Alt-3",[j.H4]:"Mod-Alt-4",[j.H5]:"Mod-Alt-5",[j.H6]:"Mod-Alt-6",[j.OrderedList]:"Mod-Alt-7",[j.BulletList]:"Mod-Alt-8",[j.Quote]:"Mod-Alt-9",[j.ClearFormatting]:"Mod-\\",[j.IncreaseIndent]:"Mod-[",[j.DecreaseIndent]:"Mod-]"},Fz={default:p5,googleDoc:Bz},Vz=class extends Ge{get name(){return"nodeViews"}createPlugin(){const e=[],t=ee();for(const r of this.store.extensions){if(!r.createNodeViews)continue;const n=r.createNodeViews();e.unshift(Ne(n)?{[r.name]:n}:n)}e.unshift(this.store.managerSettings.nodeViews??{});for(const r of e)Object.assign(t,r);return{props:{nodeViews:t}}}},jz=class extends Ge{get name(){return"pasteRules"}createExternalPlugins(){return[this.generatePasteRulesPlugin()]}generatePasteRulesPlugin(){var e,t;const r=[];for(const n of this.store.extensions){if((e=this.store.managerSettings.exclude)!=null&&e.pasteRules||!n.createPasteRules||(t=n.options.exclude)!=null&&t.pasteRules)continue;const o=n.createPasteRules(),i=at(o)?o:[o];r.push(...i)}return cz(r)}},pp=class extends Ge{constructor(){super(...arguments),this.plugins=[],this.managerPlugins=[],this.applyStateHandlers=[],this.initStateHandlers=[],this.appendTransactionHandlers=[],this.pluginKeys=ee(),this.stateGetters=new Map,this.getPluginStateCreator=e=>t=>e.getState(t??this.store.getState()),this.getStateByName=e=>{const t=this.stateGetters.get(e);return te(t,{message:"No plugin exists for the requested extension name."}),t()}}get name(){return"plugins"}onCreate(){const{setStoreKey:e,setExtensionStore:t,managerSettings:r,extensions:n}=this.store;this.updateExtensionStore();const{plugins:o=[]}=r;this.updatePlugins(o,this.managerPlugins);for(const i of n)i.onApplyState&&this.applyStateHandlers.push(i.onApplyState.bind(i)),i.onInitState&&this.initStateHandlers.push(i.onInitState.bind(i)),i.onAppendTransaction&&this.appendTransactionHandlers.push(i.onAppendTransaction.bind(i)),this.extractExtensionPlugins(i);this.managerPlugins=o,this.store.setStoreKey("plugins",this.plugins),e("pluginKeys",this.pluginKeys),e("getPluginState",this.getStateByName),t("getPluginState",this.getStateByName)}createPlugin(){return{appendTransaction:(e,t,r)=>{const n=r.tr,o={previousState:t,tr:n,transactions:e,state:r};for(const i of this.appendTransactionHandlers)i(o);return this.options.appendTransaction(o),n.docChanged||n.steps.length>0||n.selectionSet||n.storedMarksSet?n:void 0},state:{init:(e,t)=>{for(const r of this.initStateHandlers)r(t)},apply:(e,t,r,n)=>{const o={previousState:r,state:n,tr:e};for(const i of this.applyStateHandlers)i(o);this.options.applyState(o)}}}}extractExtensionPlugins(e){var t,r;if(!(!e.createPlugin&&!e.createExternalPlugins||(t=this.store.managerSettings.exclude)!=null&&t.plugins||(r=e.options.exclude)!=null&&r.plugins)){if(e.createPlugin){const o=new da(e.name);this.pluginKeys[e.name]=o;const i=this.getPluginStateCreator(o);e.pluginKey=o,e.getPluginState=i,this.stateGetters.set(e.name,i),this.stateGetters.set(e.constructor,i);const s={...e.createPlugin(),key:o},a=new Co(s);this.updatePlugins([a],e.plugin?[e.plugin]:void 0),e.plugin=a}if(e.createExternalPlugins){const o=e.createExternalPlugins();this.updatePlugins(o,e.externalPlugins),e.externalPlugins=o}}}updatePlugins(e,t){if(!t||Ki(t)){this.plugins=[...this.plugins,...e];return}if(e.length!==t.length){this.plugins=[...this.plugins.filter(n=>!t.includes(n)),...e];return}const r=new Map;for(const[n,o]of e.entries())r.set(nt(t,n),o);this.plugins=this.plugins.map(n=>t.includes(n)?r.get(n):n)}updateExtensionStore(){const{setExtensionStore:e}=this.store;e("updatePlugins",this.updatePlugins.bind(this)),e("dispatchPluginUpdate",this.dispatchPluginUpdate.bind(this)),e("updateExtensionPlugins",this.updateExtensionPlugins.bind(this))}updateExtensionPlugins(e){const t=d5(e)?e:Oz(e)?this.store.manager.getExtension(e):this.store.extensions.find(r=>r.name===e);te(t,{code:$.INVALID_MANAGER_EXTENSION,message:`The extension ${e} does not exist within the editor.`}),this.extractExtensionPlugins(t),this.store.setStoreKey("plugins",this.plugins),this.dispatchPluginUpdate()}dispatchPluginUpdate(){te(this.store.phase>=Tr.EditorView,{code:$.MANAGER_PHASE_ERROR,message:"`dispatchPluginUpdate` should only be called after the view has been added to the manager."});const{view:e,updateState:t}=this.store,r=e.state.reconfigure({plugins:this.plugins});t(r)}};pp=Z([ye({defaultPriority:De.Highest,handlerKeys:["applyState","appendTransaction"]})],pp);var C1=class extends Ge{constructor(){super(...arguments),this.dynamicAttributes={marks:ee(),nodes:ee()}}get name(){return"schema"}onCreate(){const{managerSettings:e,tags:t,markNames:r,nodeNames:n,extensions:o}=this.store,{defaultBlockNode:i,disableExtraAttributes:s,nodeOverride:a,markOverride:l}=e,c=h=>!!(h&&t[ae.Block].includes(h));if(e.schema){const{nodes:h,marks:m}=Xz(e.schema);this.addSchema(e.schema,h,m);return}const u=c(i)?{doc:ee(),[i]:ee()}:ee(),d=ee(),f=Uz({settings:e,gatheredSchemaAttributes:this.gatherExtraAttributes(o),nodeNames:n,markNames:r,tags:t});for(const h of o){f[h.name]={...f[h.name],...h.options.extraAttributes};const m=s===!0||h.options.disableExtraAttributes===!0||h.constructor.disableExtraAttributes===!0;if(xd(h)){const{spec:b,dynamic:v}=Vx({createExtensionSpec:(g,y)=>h.createNodeSpec(g,y),extraAttributes:nt(f,h.name),override:{...a,...h.options.nodeOverride},ignoreExtraAttributes:m,name:h.constructorName,tags:h.tags});h.spec=b,u[h.name]=b,Object.keys(v).length>0&&(this.dynamicAttributes.nodes[h.name]=v)}if(Eh(h)){const{spec:b,dynamic:v}=Vx({createExtensionSpec:(g,y)=>h.createMarkSpec(g,y),extraAttributes:nt(f,h.name),override:{...l,...h.options.markOverride},ignoreExtraAttributes:m,name:h.constructorName,tags:h.tags??[]});h.spec=b,d[h.name]=b,Object.keys(v).length>0&&(this.dynamicAttributes.marks[h.name]=v)}}const p=new F_({nodes:u,marks:d,topNode:"doc"});this.addSchema(p,u,d)}createPlugin(){return{appendTransaction:(e,t,r)=>{const{tr:n}=r;return!e.some(i=>i.docChanged)||Object.keys(this.dynamicAttributes.nodes).length===0&&Object.keys(this.dynamicAttributes.marks).length===0?null:(n.doc.descendants((i,s)=>(this.checkAndUpdateDynamicNodes(i,s,n),this.checkAndUpdateDynamicMarks(i,s,n),!0)),n.steps.length>0?n:null)}}}addSchema(e,t,r){this.store.setStoreKey("nodes",t),this.store.setStoreKey("marks",r),this.store.setStoreKey("schema",e),this.store.setExtensionStore("schema",e),this.store.setStoreKey("defaultBlockNode",yh(e).name);for(const n of Object.values(e.nodes))if(n.name!=="doc"&&(n.isBlock||n.isTextblock))break}checkAndUpdateDynamicNodes(e,t,r){for(const[n,o]of At(this.dynamicAttributes.nodes))if(e.type.name===n)for(const[i,s]of At(o)){if(!Wi(e.attrs[i]))continue;const a={...e.attrs,[i]:s(e)};r.setNodeMarkup(t,void 0,a),Nx(r)}}checkAndUpdateDynamicMarks(e,t,r){for(const[n,o]of At(this.dynamicAttributes.marks)){const i=nt(this.store.schema.marks,n),s=e.marks.find(a=>a.type.name===n);if(s)for(const[a,l]of At(o)){if(!Wi(s.attrs[a]))continue;const c=Yo(r.doc.resolve(t),i);if(!c)continue;const{from:u,to:d}=c,f=i.create({...s.attrs,[a]:l(s)});r.removeMark(u,d,i).addMark(u,d,f),Nx(r)}}}gatherExtraAttributes(e){const t=[];for(const r of e)r.createSchemaAttributes&&t.push(...r.createSchemaAttributes());return t}};C1=Z([ye({defaultPriority:De.Highest})],C1);function Uz(e){const{settings:t,gatheredSchemaAttributes:r,nodeNames:n,markNames:o,tags:i}=e,s=ee();if(t.disableExtraAttributes)return s;const a=[...r,...t.extraAttributes??[]];for(const l of a??[]){const c=Kz({identifiers:l.identifiers,nodeNames:n,markNames:o,tags:i});for(const u of c){const d=s[u]??{};s[u]={...d,...l.attributes}}}return s}function Wz(e){return ss(e)&&at(e.tags)}function Kz(e){const{identifiers:t,nodeNames:r,markNames:n,tags:o}=e;if(t==="nodes")return r;if(t==="marks")return n;if(t==="all")return[...r,...n];if(at(t))return t;te(Wz(t),{code:$.EXTENSION_EXTRA_ATTRIBUTES,message:"Invalid value passed as an identifier when creating `extraAttributes`."});const{tags:i=[],names:s=[],behavior:a="any",excludeNames:l,excludeTags:c,type:u}=t,d=new Set,f=u==="mark"?n:u==="node"?r:[...n,...r],p=m=>f.includes(m)&&!(l!=null&&l.includes(m));for(const m of s)p(m)&&d.add(m);const h=new Map;for(const m of i)if(!(c!=null&&c.includes(m)))for(const b of o[m]){if(!p(b))continue;if(a==="any"){d.add(b);continue}const v=h.get(b)??new Set;v.add(m),h.set(b,v)}for(const[m,b]of h)b.size===i.length&&d.add(m);return[...d]}function Vx(e){var t;const{createExtensionSpec:r,extraAttributes:n,ignoreExtraAttributes:o,name:i,tags:s,override:a}=e,l=ee();function c(b,v){l[b]=v}let u=!1;function d(){u=!0}const f=qz(n,o,d,c),p=Gz(n,o),h=Yz(n,o),m=r({defaults:f,parse:p,dom:h},a);return te(o||u,{code:$.EXTENSION_SPEC,message:`When creating a node specification you must call the 'defaults', and parse, and 'dom' methods. To avoid this error you can set the static property 'disableExtraAttributes' of '${i}' to 'true'.`}),m.group=[...((t=m.group)==null?void 0:t.split(" "))??[],...s].join(" ")||void 0,{spec:m,dynamic:l}}function Tv(e){return ne(e)||Ne(e)?{default:e}:(te(e,{message:`${dS(e)} is not supported`,code:$.EXTENSION_EXTRA_ATTRIBUTES}),e)}function qz(e,t,r,n){return()=>{r();const o=ee();if(t)return o;for(const[i,s]of At(e)){let l=Tv(s).default;Ne(l)&&(n(i,l),l=null),o[i]=l===void 0?{}:{default:l}}return o}}function Gz(e,t){return r=>{const n=ee();if(t)return n;for(const[o,i]of At(e)){const{parseDOM:s,...a}=Tv(i);if(gt(r)){if(Wi(s)){n[o]=r.getAttribute(o)??a.default;continue}if(Ne(s)){n[o]=s(r)??a.default;continue}n[o]=r.getAttribute(s)??a.default}}return n}}function Yz(e,t){return r=>{const n=ee();if(t)return n;function o(i,s){if(i){if(ne(i)){n[s]=i;return}if(at(i)){const[a,l]=i;n[a]=l??r.attrs[s];return}for(const[a,l]of At(i))n[a]=l}}for(const[i,s]of At(e)){const{toDOM:a,parseDOM:l}=Tv(s);if(Wi(a)){const c=ne(l)?l:i;n[c]=r.attrs[i];continue}if(Ne(a)){o(a(r.attrs,Jz(r)),i);continue}o(a,i)}return n}}function Jz(e){return bd(e)?{node:e}:o6(e)?{mark:e}:{}}function Xz(e){const t=ee(),r=ee();for(const[n,o]of Object.entries(e.nodes))t[n]=o.spec;for(const[n,o]of Object.entries(e.marks))r[n]=o.spec;return{nodes:t,marks:r}}var El=class extends Ge{constructor(){super(...arguments),this.onAddCustomHandler=({suggester:e})=>{var t;if(!(!e||(t=this.store.managerSettings.exclude)!=null&&t.suggesters))return Px(this.store.getState(),e)}}get name(){return"suggest"}onCreate(){this.store.setExtensionStore("addSuggester",e=>Px(this.store.getState(),e)),this.store.setExtensionStore("removeSuggester",e=>BN(this.store.getState(),e))}createExternalPlugins(){var e,t;const r=[];for(const n of this.store.extensions){if((e=this.store.managerSettings.exclude)!=null&&e.suggesters)break;if(!n.createSuggesters||(t=n.options.exclude)!=null&&t.suggesters)continue;const o=n.createSuggesters(),i=at(o)?o:[o];r.push(...i)}return[FN(...r)]}getSuggestState(e){return vv(e??this.store.getState())}getSuggestMethods(){const{addIgnored:e,clearIgnored:t,removeIgnored:r,ignoreNextExit:n,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}=this.getSuggestState();return{addIgnored:e,clearIgnored:t,removeIgnored:r,ignoreNextExit:n,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}}isSuggesterActive(e){var t;return vr(at(e)?e:[e],(t=this.getSuggestState().match)==null?void 0:t.suggester.name)}};Z([je()],El.prototype,"getSuggestState",1);Z([je()],El.prototype,"getSuggestMethods",1);Z([je()],El.prototype,"isSuggesterActive",1);El=Z([ye({customHandlerKeys:["suggester"]})],El);var M1=class extends Ge{constructor(){super(...arguments),this.allTags=ee(),this.plainTags=ee(),this.markTags=ee(),this.nodeTags=ee()}get name(){return"tags"}onCreate(){this.resetTags();for(const e of this.store.extensions)this.updateTagForExtension(e);this.store.setStoreKey("tags",this.allTags),this.store.setExtensionStore("tags",this.allTags),this.store.setStoreKey("plainTags",this.plainTags),this.store.setExtensionStore("plainTags",this.plainTags),this.store.setStoreKey("markTags",this.markTags),this.store.setExtensionStore("markTags",this.markTags),this.store.setStoreKey("nodeTags",this.nodeTags),this.store.setExtensionStore("nodeTags",this.nodeTags)}resetTags(){const e=ee(),t=ee(),r=ee(),n=ee();for(const o of uh(ae))e[o]=[],t[o]=[],r[o]=[],n[o]=[];this.allTags=e,this.plainTags=t,this.markTags=r,this.nodeTags=n}updateTagForExtension(e){var t,r;const n=new Set([...e.tags??[],...((t=e.createTags)==null?void 0:t.call(e))??[],...e.options.extraTags??[],...((r=this.store.managerSettings.extraTags)==null?void 0:r[e.name])??[]]);for(const o of n)te(Qz(o),{code:$.EXTENSION,message:`The tag provided by the extension: ${e.constructorName} is not supported by the editor. To add custom tags you can use the 'mutateTag' method.`}),this.allTags[o].push(e.name),f5(e)&&this.plainTags[o].push(e.name),Eh(e)&&this.markTags[o].push(e.name),xd(e)&&this.nodeTags[o].push(e.name);e.tags=[...n]}};M1=Z([ye({defaultPriority:De.Highest})],M1);function Qz(e){return vr(uh(ae),e)}var Zz=new da("remirrorFilePlaceholderPlugin");function e8(){const e=new Co({key:Zz,state:{init(){return{set:Ee.empty,payloads:new Map}},apply(t,{set:r,payloads:n}){r=r.map(t.mapping,t.doc);const o=t.getMeta(e);if(o)if(o.type===0){const i=document.createElement("placeholder"),s=Ke.widget(o.pos,i,{id:o.id});r=r.add(t.doc,[s]),n.set(o.id,o.payload)}else o.type===1&&(r=r.remove(r.find(void 0,void 0,i=>i.id===o.id)),n.delete(o.id));return{set:r,payloads:n}}},props:{decorations(t){var r;return((r=e.getState(t))==null?void 0:r.set)??null}}});return e}var t8=class extends Ge{get name(){return"upload"}createExternalPlugins(){return[e8()]}};function r8(e={}){e={...{exitMarksOnArrowPress:Kn.defaultOptions.exitMarksOnArrowPress,excludeBaseKeymap:Kn.defaultOptions.excludeBaseKeymap,selectParentNodeOnEscape:Kn.defaultOptions.selectParentNodeOnEscape,undoInputRuleOnBackspace:Kn.defaultOptions.undoInputRuleOnBackspace,persistentSelectionClass:Zn.defaultOptions.persistentSelectionClass},...e};const r=Zg(e,["excludeBaseKeymap","selectParentNodeOnEscape","undoInputRuleOnBackspace"]),n=Zg(e,["persistentSelectionClass"]);return[new M1,new C1,new _z,new pp,new S1,new jz,new Vz,new El,new ke,new Mn,new Kn(r),new w1,new t8,new Zn(n)]}var jx=class extends Ge{get name(){return"meta"}onCreate(){if(this.store.setStoreKey("getCommandMeta",this.getCommandMeta.bind(this)),!!this.options.capture)for(const e of this.store.extensions)this.captureCommands(e),this.captureKeybindings(e)}createPlugin(){return{}}captureCommands(e){const t=e.decoratedCommands??{},r=e.createCommands;for(const n of Object.keys(t)){const o=e[n];e[n]=(...i)=>s=>{var a;const l=o(...i)(s);return s.dispatch&&l&&this.setCommandMeta(s.tr,{type:"command",chain:s.dispatch!==((a=s.view)==null?void 0:a.dispatch),name:n,extension:e.name,decorated:!0}),l}}r&&(e.createCommands=()=>{const n=r();for(const[o,i]of Object.entries(n))n[o]=(...s)=>a=>{var l;const c=i(...s)(a);return a.dispatch&&c&&this.setCommandMeta(a.tr,{type:"command",chain:a.dispatch!==((l=a.view)==null?void 0:l.dispatch),name:o,extension:e.name,decorated:!1}),c};return n})}captureKeybindings(e){}getCommandMeta(e){return e.getMeta(this.pluginKey)??[]}setCommandMeta(e,t){const r=this.getCommandMeta(e);e.setMeta(this.pluginKey,[...r,t])}};jx=Z([ye({defaultOptions:{capture:Zr.isDevelopment},staticKeys:["capture"],defaultPriority:De.Highest})],jx);var kf,Ec,xf,Ia,gi,wf,Sf,n8=class{constructor(e){bt(this,kf,gl()),bt(this,Ec,void 0),bt(this,xf,void 0),bt(this,Ia,!0),bt(this,gi,wh()),bt(this,wf,void 0),bt(this,Sf,void 0),this.getState=()=>this.view.state??this.initialEditorState,this.getPreviousState=()=>this.previousState,this.dispatchTransaction=i=>{var s,a;te(!this.manager.destroyed,{code:$.MANAGER_PHASE_ERROR,message:"A transaction was dispatched to a manager that has already been destroyed. Please check your set up, or open an issue."}),i=((a=(s=this.props).onDispatchTransaction)==null?void 0:a.call(s,i,this.getState()))??i;const l=this.getState(),{state:c,transactions:u}=l.applyTransaction(i);Lt(this,xf,l),this.updateState({state:c,tr:i,transactions:u});const d=this.manager.store.getForcedUpdates(i);Ki(d)||this.updateViewProps(...d)},this.onChange=(i=ee())=>{var s,a;const l=this.eventListenerProps(i);q(this,Ia)&&Lt(this,Ia,!1),(a=(s=this.props).onChange)==null||a.call(s,l)},this.onBlur=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onBlur)==null||a.call(s,l,i),q(this,gi).emit("blur",l,i)},this.onFocus=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onFocus)==null||a.call(s,l,i),q(this,gi).emit("focus",l,i)},this.setContent=(i,{triggerChange:s=!1}={})=>{const{doc:a}=this.manager.createState({content:i}),l=this.getState(),{state:c}=this.getState().applyTransaction(l.tr.replaceRangeWith(0,l.doc.nodeSize-2,a));if(s)return this.updateState({state:c,triggerChange:s});this.view.updateState(c)},this.clearContent=({triggerChange:i=!1}={})=>{this.setContent(this.manager.createEmptyDoc(),{triggerChange:i})},this.createStateFromContent=(i,s)=>this.manager.createState({content:i,selection:s}),this.focus=i=>{this.manager.store.commands.focus(i)},this.blur=i=>{this.manager.store.commands.blur(i)};const{getProps:t,initialEditorState:r,element:n}=e;if(Lt(this,Ec,t),Lt(this,Sf,r),this.manager.attachFramework(this,this.updateListener.bind(this)),this.manager.view)return;const o=this.createView(r,n);this.manager.addView(o)}get addHandler(){return q(this,wf)??Lt(this,wf,q(this,gi).on.bind(q(this,gi)))}get updatableViewProps(){return{attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0}}get firstRender(){return q(this,Ia)}get props(){return q(this,Ec).call(this)}get previousState(){return this.previousStateOverride??q(this,xf)??this.initialEditorState}get manager(){return this.props.manager}get view(){return this.manager.view}get uid(){return q(this,kf)}get initialEditorState(){return q(this,Sf)}updateListener(e){const{state:t,tr:r}=e;return q(this,gi).emit("updated",this.eventListenerProps({state:t,tr:r}))}update(e){const{getProps:t}=e;return Lt(this,Ec,t),this}updateViewProps(...e){const t=Zg(this.updatableViewProps,e);this.view.setProps({...this.view.props,...t})}getAttributes(e){var t;const{attributes:r,autoFocus:n,classNames:o=[],label:i,editable:s}=this.props,a=(t=this.manager.store)==null?void 0:t.attributes,l=Ne(r)?r(this.eventListenerProps()):r;let c={};(n||sn(n))&&(c=e?{autoFocus:!0}:{autofocus:"true"});const u=vl(_u(e&&"Prosemirror","remirror-editor",a==null?void 0:a.class,...o).split(" ")).join(" "),d={role:"textbox",...c,"aria-multiline":"true",...s??!0?{}:{"aria-readonly":"true"},"aria-label":i??"",...a,class:u};return pS({...d,...l})}addFocusListeners(){this.view.dom.addEventListener("blur",this.onBlur),this.view.dom.addEventListener("focus",this.onFocus)}removeFocusListeners(){this.view.dom.removeEventListener("blur",this.onBlur),this.view.dom.removeEventListener("focus",this.onFocus)}destroy(){q(this,gi).emit("destroy"),this.view&&this.removeFocusListeners()}eventListenerProps(e=ee()){const{state:t,tr:r,transactions:n}=e;return{tr:r,transactions:n,internalUpdate:!r,view:this.view,firstRender:q(this,Ia),state:t??this.getState(),createStateFromContent:this.createStateFromContent,previousState:this.previousState,helpers:this.manager.store.helpers}}get baseOutput(){return{manager:this.manager,...this.manager.store,addHandler:this.addHandler,focus:this.focus,blur:this.blur,uid:q(this,kf),view:this.view,getState:this.getState,getPreviousState:this.getPreviousState,getExtension:this.manager.getExtension.bind(this.manager),hasExtension:this.manager.hasExtension.bind(this.manager),clearContent:this.clearContent,setContent:this.setContent}}};kf=new WeakMap;Ec=new WeakMap;xf=new WeakMap;Ia=new WeakMap;gi=new WeakMap;wf=new WeakMap;Sf=new WeakMap;function o8(e,t){const r=[],n=new WeakMap,o=[],i=new WeakMap;let s=[];const a={duplicateMap:i,parentExtensions:o,gatheredExtensions:s,settings:t};for(const d of e)h5(a,{extension:d});s=qs(s,(d,f)=>f.priority-d.priority);const l=new WeakSet,c=new Set;for(const d of s){const f=d.constructor,p=d.name,h=i.get(f);te(h,{message:`No entries were found for the ExtensionConstructor ${d.name}`,code:$.INTERNAL}),!(l.has(f)||c.has(p))&&(l.add(f),c.add(p),r.push(d),n.set(f,d),h.forEach(m=>m==null?void 0:m.replaceChildExtension(f,d)))}const u=[];for(const d of r)i8({extension:d,found:l,missing:u});return te(Ki(u),{code:$.MISSING_REQUIRED_EXTENSION,message:u.map(({Constructor:d,extension:f})=>`The extension '${f.name}' requires '${d.name} in order to run correctly.`).join(` +`)}),{extensions:r,extensionMap:n}}function h5(e,t){var r;const{gatheredExtensions:n,duplicateMap:o,parentExtensions:i,settings:s}=e,{extension:a,parentExtension:l}=t;let{names:c=[]}=t;te(d5(a),{code:$.INVALID_MANAGER_EXTENSION,message:`An invalid extension: ${a} was provided to the [[\`RemirrorManager\`]].`});const u=a.extensions;if(a.setPriority((r=s.priority)==null?void 0:r[a.name]),n.push(a),s8({duplicateMap:o,extension:a,parentExtension:l}),u.length!==0){if(c.includes(a.name)){`${c.join(" > ")}${a.name}`;return}c=[...c,a.name],i.push(a);for(const d of u)h5(e,{names:c,extension:d,parentExtension:a})}}function i8(e){const{extension:t,found:r,missing:n}=e;if(t.requiredExtensions)for(const o of t.requiredExtensions??[])r.has(o)||n.push({Constructor:o,extension:t})}function s8(e){const{duplicateMap:t,extension:r,parentExtension:n}=e,o=r.constructor,i=t.get(o),s=n?[n]:[];t.set(o,i?[...i,...s]:s)}function a8(e){var t,r,n,o;const{extension:i,nodeNames:s,markNames:a,plainNames:l,store:c,handlers:u}=e;i.setStore(c);const d=(t=i.onCreate)==null?void 0:t.bind(i),f=(r=i.onView)==null?void 0:r.bind(i),p=(n=i.onStateUpdate)==null?void 0:n.bind(i),h=(o=i.onDestroy)==null?void 0:o.bind(i);d&&u.create.push(d),f&&u.view.push(f),p&&u.update.push(p),h&&u.destroy.push(h),Eh(i)&&a.push(i.name),xd(i)&&i.name!=="doc"&&s.push(i.name),f5(i)&&l.push(i.name)}var vi,Cc,Hn,Ro,Mc,Gr,vs,Tc,ys,Oc,bs,Bn,_c,Ef=class{constructor(e,t={}){bt(this,vi,void 0),bt(this,Cc,ee()),bt(this,Hn,ee()),bt(this,Ro,void 0),bt(this,Mc,void 0),bt(this,Gr,Tr.None),bt(this,vs,void 0),bt(this,Tc,!0),bt(this,ys,{create:[],view:[],update:[],destroy:[]}),bt(this,Oc,[]),bt(this,bs,wh()),bt(this,Bn,void 0),bt(this,_c,void 0),this.getState=()=>{var o;return q(this,Gr)>=Tr.EditorView?this.view.state:(te(q(this,Bn),{code:$.MANAGER_PHASE_ERROR,message:"`getState` can only be called after the `Framework` or the `EditorView` has been added to the manager`. Check your plugins to make sure that the decorations callback uses the state argument."}),(o=q(this,Bn))==null?void 0:o.initialEditorState)},this.updateState=o=>{const i=this.getState();this.view.updateState(o),this.onStateUpdate({previousState:i,state:o})};const{extensions:r,extensionMap:n}=o8(e,t);Lt(this,vs,t),Lt(this,Ro,Rs(r)),Lt(this,Mc,n),Lt(this,vi,this.createExtensionStore()),Lt(this,Gr,Tr.Create),this.setupLifecycleHandlers();for(const o of q(this,ys).create){const i=o();i&&q(this,Oc).push(i)}}static create(e,t={}){return new Ef([...bS(e),...r8(t.builtin)],t)}get[Go](){return $t.Manager}get destroyed(){return q(this,Gr)===Tr.Destroy}get mounted(){return q(this,Gr)>=Tr.EditorView&&q(this,Gr)q(this,Ro),enumerable:t},phase:{get:()=>q(this,Gr),enumerable:t},view:{get:()=>this.view,enumerable:t},managerSettings:{get:()=>Rs(q(this,vs)),enumerable:t},getState:{value:this.getState,enumerable:t},updateState:{value:this.updateState,enumerable:t},isMounted:{value:()=>this.mounted,enumerable:t},getExtension:{value:this.getExtension.bind(this),enumerable:t},manager:{get:()=>this,enumerable:t},document:{get:()=>this.document,enumerable:t},stringHandlers:{get:()=>q(this,Cc),enumerable:t},currentState:{get:()=>r??(r=this.getState()),set:o=>{r=o},enumerable:t},previousState:{get:()=>n,set:o=>{n=o},enumerable:t}}),e.getStoreKey=this.getStoreKey.bind(this),e.setStoreKey=this.setStoreKey.bind(this),e.setExtensionStore=this.setExtensionStore.bind(this),e.setStringHandler=this.setStringHandler.bind(this),e}addView(e){if(q(this,Gr)>=Tr.EditorView)return this;Lt(this,Tc,!0),Lt(this,Gr,Tr.EditorView),q(this,Hn).view=e;for(const t of q(this,ys).view){const r=t(e);r&&q(this,Oc).push(r)}return this}attachFramework(e,t){var r;q(this,Bn)!==e&&(q(this,Bn)&&(q(this,Bn).destroy(),(r=q(this,_c))==null||r.call(this)),Lt(this,Bn,e),Lt(this,_c,this.addHandler("stateUpdate",t)))}createEmptyDoc(){var e;const t=(e=this.schema.nodes.doc)==null?void 0:e.createAndFill();return te(t,{code:$.INVALID_CONTENT,message:"An empty node could not be created due to an invalid schema."}),t}createState(e={}){const{onError:t,defaultSelection:r="end"}=this.settings,{content:n=this.createEmptyDoc(),selection:o=r,stringHandler:i=this.settings.stringHandler}=e,{schema:s,plugins:a}=this.store,l=KE({stringHandler:ne(i)?this.stringHandlers[i]:i,document:this.document,content:n,onError:t,schema:s,selection:o});return Ps.create({schema:s,doc:l,plugins:a,selection:Cn(o,l)})}addHandler(e,t){return q(this,bs).on(e,t)}onStateUpdate(e){const t=q(this,Tc);q(this,vi).currentState=e.state,q(this,vi).previousState=e.previousState,t&&(Lt(this,Gr,Tr.Runtime),Lt(this,Tc,!1));const r={...e,firstUpdate:t};for(const n of q(this,ys).update)n(r);q(this,bs).emit("stateUpdate",r)}getExtension(e){const t=q(this,Mc).get(e);return te(t,{code:$.INVALID_MANAGER_EXTENSION,message:`'${e.name}' doesn't exist within this manager. Make sure it is properly added before attempting to use it.`}),t}hasExtension(e){return!!q(this,Mc).get(e)}clone(){const e=q(this,Ro).map(r=>r.clone(r.options)),t=Ef.create(()=>e,q(this,vs));return q(this,bs).emit("clone",t),t}recreate(e=[],t={}){const r=q(this,Ro).map(o=>o.clone(o.initialOptions)),n=Ef.create(()=>[...r,...e],t);return q(this,bs).emit("recreate",n),n}destroy(){var e,t,r,n,o,i;Lt(this,Gr,Tr.Destroy);for(const s of((e=this.view)==null?void 0:e.state.plugins)??[])(r=(t=s.getState(this.view.state))==null?void 0:t.destroy)==null||r.call(t);(n=q(this,Bn))==null||n.destroy(),(o=q(this,_c))==null||o.call(this);for(const s of q(this,Oc))s();for(const s of q(this,ys).destroy)s();(i=this.view)==null||i.destroy(),q(this,bs).emit("destroy")}includes(e){const t=[],r=[];for(const n of q(this,Ro))t.push(n.name,n.constructorName),r.push(n.constructor);return e.every(n=>ne(n)?vr(t,n):vr(r,n))}},l8=Ef;vi=new WeakMap;Cc=new WeakMap;Hn=new WeakMap;Ro=new WeakMap;Mc=new WeakMap;Gr=new WeakMap;vs=new WeakMap;Tc=new WeakMap;ys=new WeakMap;Oc=new WeakMap;bs=new WeakMap;Bn=new WeakMap;_c=new WeakMap;function c8(e,t){return!Kl(e)||!ql(e,$t.Manager)?!1:t?e.includes(t):!0}function Bo(e,t,r){return Math.min(Math.max(e,r),t)}class u8 extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var Ac=u8;function Ov(e){if(typeof e!="string")throw new Ac(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=y8.test(e)?p8(e):e;const r=h8.exec(t);if(r){const s=Array.from(r).slice(1);return[...s.slice(0,3).map(a=>parseInt(Au(a,2),16)),parseInt(Au(s[3]||"f",2),16)/255]}const n=m8.exec(t);if(n){const s=Array.from(n).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,16)),parseInt(s[3]||"ff",16)/255]}const o=g8.exec(t);if(o){const s=Array.from(o).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,10)),parseFloat(s[3]||"1")]}const i=v8.exec(t);if(i){const[s,a,l,c]=Array.from(i).slice(1).map(parseFloat);if(Bo(0,100,a)!==a)throw new Ac(e);if(Bo(0,100,l)!==l)throw new Ac(e);return[...b8(s,a,l),Number.isNaN(c)?1:c]}throw new Ac(e)}function d8(e){let t=5381,r=e.length;for(;r;)t=t*33^e.charCodeAt(--r);return(t>>>0)%2341}const Ux=e=>parseInt(e.replace(/_/g,""),36),f8="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const r=Ux(t.substring(0,3)),n=Ux(t.substring(3)).toString(16);let o="";for(let i=0;i<6-n.length;i++)o+="0";return e[r]=`${o}${n}`,e},{});function p8(e){const t=e.toLowerCase().trim(),r=f8[d8(t)];if(!r)throw new Ac(e);return`#${r}`}const Au=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),h8=new RegExp(`^#${Au("([a-f0-9])",3)}([a-f0-9])?$`,"i"),m8=new RegExp(`^#${Au("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),g8=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${Au(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),v8=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,y8=/^[a-z]+$/i,Wx=e=>Math.round(e*255),b8=(e,t,r)=>{let n=r/100;if(t===0)return[n,n,n].map(Wx);const o=(e%360+360)%360/60,i=(1-Math.abs(2*n-1))*(t/100),s=i*(1-Math.abs(o%2-1));let a=0,l=0,c=0;o>=0&&o<1?(a=i,l=s):o>=1&&o<2?(a=s,l=i):o>=2&&o<3?(l=i,c=s):o>=3&&o<4?(l=s,c=i):o>=4&&o<5?(a=s,c=i):o>=5&&o<6&&(a=i,c=s);const u=n-i/2,d=a+u,f=l+u,p=c+u;return[d,f,p].map(Wx)};function k8(e){const[t,r,n,o]=Ov(e).map((d,f)=>f===3?d:d/255),i=Math.max(t,r,n),s=Math.min(t,r,n),a=(i+s)/2;if(i===s)return[0,0,a,o];const l=i-s,c=a>.5?l/(2-i-s):l/(i+s);return[60*(t===i?(r-n)/l+(r.179}function sl(e){return E8(e)?"#000":"#fff"}const C8="remirror-editor-wrapper",M8="remirror-button-active",T8="remirror-button",O8="remirror-composite",_8="remirror-dialog",A8="remirror-dialog-backdrop",R8="remirror-form",P8="remirror-form-message",N8="remirror-form-label",z8="remirror-form-group",L8="remirror-group",I8="remirror-input",D8="remirror-menu",$8="remirror-menu-pane",H8="remirror-menu-pane-active",B8="remirror-menu-dropdown-label",F8="remirror-menu-pane-icon",V8="remirror-menu-pane-label",j8="remirror-menu-pane-shortcut",U8="remirror-menu-button-left",W8="remirror-menu-button-right",K8="remirror-menu-button-nested-left",q8="remirror-menu-button-nested-right",G8="remirror-menu-button",Y8="remirror-menu-bar",J8="remirror-flex-column",X8="remirror-flex-row",Q8="remirror-menu-item",Z8="remirror-menu-item-row",eL="remirror-menu-item-column",tL="remirror-menu-item-checkbox",rL="remirror-menu-item-radio",nL="remirror-menu-group",oL="remirror-floating-popover",iL="remirror-popover",sL="remirror-animated-popover",aL="remirror-role",lL="remirror-separator",cL="remirror-tab",uL="remirror-tab-list",dL="remirror-tabbable",fL="remirror-toolbar",pL="remirror-tooltip",hL="remirror-table-size-editor",mL="remirror-table-size-editor-body",gL="remirror-table-size-editor-cell",vL="remirror-table-size-editor-cell-selected",yL="remirror-table-size-editor-footer",bL="remirror-color-picker",kL="remirror-color-picker-cell",xL="remirror-color-picker-cell-selected";var wL=Object.freeze({__proto__:null,ANIMATED_POPOVER:sL,BUTTON:T8,BUTTON_ACTIVE:M8,COLOR_PICKER:bL,COLOR_PICKER_CELL:kL,COLOR_PICKER_CELL_SELECTED:xL,COMPOSITE:O8,DIALOG:_8,DIALOG_BACKDROP:A8,EDITOR_WRAPPER:C8,FLEX_COLUMN:J8,FLEX_ROW:X8,FLOATING_POPOVER:oL,FORM:R8,FORM_GROUP:z8,FORM_LABEL:N8,FORM_MESSAGE:P8,GROUP:L8,INPUT:I8,MENU:D8,MENU_BAR:Y8,MENU_BUTTON:G8,MENU_BUTTON_LEFT:U8,MENU_BUTTON_NESTED_LEFT:K8,MENU_BUTTON_NESTED_RIGHT:q8,MENU_BUTTON_RIGHT:W8,MENU_DROPDOWN_LABEL:B8,MENU_GROUP:nL,MENU_ITEM:Q8,MENU_ITEM_CHECKBOX:tL,MENU_ITEM_COLUMN:eL,MENU_ITEM_RADIO:rL,MENU_ITEM_ROW:Z8,MENU_PANE:$8,MENU_PANE_ACTIVE:H8,MENU_PANE_ICON:F8,MENU_PANE_LABEL:V8,MENU_PANE_SHORTCUT:j8,POPOVER:iL,ROLE:aL,SEPARATOR:lL,TAB:cL,TABBABLE:dL,TABLE_SIZE_EDITOR:hL,TABLE_SIZE_EDITOR_BODY:mL,TABLE_SIZE_EDITOR_CELL:gL,TABLE_SIZE_EDITOR_CELL_SELECTED:vL,TABLE_SIZE_EDITOR_FOOTER:yL,TAB_LIST:uL,TOOLBAR:fL,TOOLTIP:pL});const SL="remirror-wrap",EL="remirror-language-select-positioner",CL="remirror-language-select-width",ML="remirror-a11y-dark",TL="remirror-atom-dark",OL="remirror-base16-ateliersulphurpool-light",_L="remirror-cb",AL="remirror-darcula",RL="remirror-dracula",PL="remirror-duotone-dark",NL="remirror-duotone-earth",zL="remirror-duotone-forest",LL="remirror-duotone-light",IL="remirror-duotone-sea",DL="remirror-duotone-space",$L="remirror-gh-colors",HL="remirror-hopscotch",BL="remirror-pojoaque",FL="remirror-vs",VL="remirror-xonokai";var jL=Object.freeze({__proto__:null,A11Y_DARK:ML,ATOM_DARK:TL,BASE16_ATELIERSULPHURPOOL_LIGHT:OL,CB:_L,DARCULA:AL,DRACULA:RL,DUOTONE_DARK:PL,DUOTONE_EARTH:NL,DUOTONE_FOREST:zL,DUOTONE_LIGHT:LL,DUOTONE_SEA:IL,DUOTONE_SPACE:DL,GH_COLORS:$L,HOPSCOTCH:HL,LANGUAGE_SELECT_POSITIONER:EL,LANGUAGE_SELECT_WIDTH:CL,POJOAQUE:BL,VS:FL,WRAP:SL,XONOKAI:VL});const UL="remirror-image-loader";var WL=Object.freeze({__proto__:null,IMAGE_LOADER:UL});const KL="remirror-list-item-with-custom-mark",qL="remirror-ul-list-content",GL="remirror-editor",YL="remirror-list-item-marker-container",JL="remirror-list-item-checkbox",XL="remirror-collapsible-list-item-closed",QL="remirror-collapsible-list-item-button",ZL="remirror-list-spine";var Xi=Object.freeze({__proto__:null,COLLAPSIBLE_LIST_ITEM_BUTTON:QL,COLLAPSIBLE_LIST_ITEM_CLOSED:XL,EDITOR:GL,LIST_ITEM_CHECKBOX:JL,LIST_ITEM_MARKER_CONTAINER:YL,LIST_ITEM_WITH_CUSTOM_MARKER:KL,LIST_SPINE:ZL,UL_LIST_CONTENT:qL});const eI="remirror-is-empty";var tI=Object.freeze({__proto__:null,IS_EMPTY:eI});const rI="remirror-editor",nI="remirror-positioner",oI="remirror-positioner-widget";var iI=Object.freeze({__proto__:null,EDITOR:rI,POSITIONER:nI,POSITIONER_WIDGET:oI});const sI="remirror-theme";function aI(e={}){const t=[],r={};function n(o,i){if(typeof i=="string"||typeof i=="number"){t.push(`${Kx(o)}: ${i};`),r[Kx(o)]=i;return}if(!(typeof i!="object"||!i))for(const[s,a]of Object.entries(i))n([...o,s],a)}for(const[o,i]of Object.entries(e))n([o],i);return{css:t.join(` +`),styles:r}}function lI(e){return e.replace(/([a-z])([\dA-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function Kx(e){return`--rmr-${e.map(lI).join("-")}`}const Fn={gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},Fo="#000000",_v="#ffffff",cI="#252103",Av=hp(Fo,.75),Ch="#7963d2",Rv="#bcd263",uI="#fff",dI="#fff",Pv=Fn.gray[1],qx="rgba(10,31,68,0.08)",Gx="rgba(10,31,68,0.10)",Yx="rgba(10,31,68,0.12)",fI=Cf(hp(Fo,.1),.13),Nv={background:_v,border:Av,foreground:Fo,muted:Pv,primary:Ch,secondary:Rv,primaryText:uI,secondaryText:dI,text:cI,faded:fI},pI={...Nv,background:Xr(_v,.15),border:Xr(Av,.15),foreground:Xr(Fo,.15),muted:Xr(Pv,.15),primary:Xr(Ch,.15),secondary:Xr(Rv,.15),get text(){return sl(this.background)},get primaryText(){return sl(this.primary)},get secondaryText(){return sl(this.secondary)}},hI={...Nv,background:Xr(_v,.075),border:Xr(Av,.075),foreground:Xr(Fo,.075),muted:Xr(Pv,.075),primary:Xr(Ch,.075),secondary:Xr(Rv,.075),get text(){return sl(this.background)},get primaryText(){return sl(this.primary)},get secondaryText(){return sl(this.secondary)}},ms={color:{...Nv,active:pI,hover:hI,shadow1:qx,shadow2:Gx,shadow3:Yx,backdrop:hp(Fo,.1),outline:hp(Ch,.6),table:{default:{border:Cf(Fo,.8),cell:Cf(Fo,.4),controller:Fn.gray[3]},selected:{border:Fn.blue[7],cell:Fn.blue[1],controller:Fn.blue[5]},preselect:{border:Fn.blue[7],cell:Cf(Fo,.4),controller:Fn.blue[5]},predelete:{border:Fn.red[7],cell:Fn.red[1],controller:Fn.red[5]},mark:"#91919196"}},hue:Fn,radius:{border:"0.25rem",extra:"0.5rem",circle:"50%"},fontFamily:{default:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif',heading:"inherit",mono:"Menlo, monospace"},fontSize:{0:"12px",1:"14px",2:"16px",3:"20px",4:"24px",5:"32px",6:"48px",7:"64px",8:"96px",default:"16px"},space:{1:"4px",2:"8px",3:"16px",4:"32px",5:"64px",6:"128px",7:"256px",8:"512px"},fontWeight:{bold:"700",default:"400",heading:"700"},letterSpacing:{tight:"-1px",default:"normal",loose:"1px",wide:"3px"},lineHeight:{heading:"1.25em",default:"1.5em"},boxShadow:{1:`0 1px 1px ${qx}`,2:`0 1px 1px ${Gx}`,3:`0 1px 1px ${Yx}`}};var mI=Object.defineProperty,gI=Object.getOwnPropertyDescriptor,zv=(e,t,r,n)=>{for(var o=n>1?void 0:n?gI(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&mI(t,r,o),o},m5=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},Tt=(e,t,r)=>(m5(e,t,"read from private field"),r?r.call(e):t.get(e)),Ao=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},ci=(e,t,r,n)=>(m5(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Rc,Pc,Da,Nc,Mf,zc,Lc,Ic,Dc,Tf=class{constructor(e){Ao(this,Rc,wh()),Ao(this,Pc,[]),Ao(this,Da,new Map),Ao(this,Nc,[]),Ao(this,Mf,!1),Ao(this,zc,void 0),Ao(this,Lc,void 0),Ao(this,Ic,void 0),Ao(this,Dc,void 0),this.addListener=(t,r)=>Tt(this,Rc).on(t,r),ci(this,zc,e),ci(this,Lc,e.getActive),ci(this,Dc,e.getPosition),ci(this,Ic,e.getID),this.hasChanged=e.hasChanged,this.events=e.events??["state","scroll"]}static create(e){return new Tf(e)}static fromPositioner(e,t){return Tf.create({...e.basePositioner,...t})}get basePositioner(){return{getActive:Tt(this,Lc),getPosition:Tt(this,Dc),hasChanged:this.hasChanged,events:this.events,getID:Tt(this,Ic)}}onActiveChanged(e){this.recentUpdate=e;const t=Tt(this,Lc).call(this,e);ci(this,Pc,t),ci(this,Da,new Map),ci(this,Mf,!1),ci(this,Nc,[]);const r=[];for(const[n,o]of t.entries()){const i=this.getID(o,n);Tt(this,Nc).push(i),r.push({setElement:s=>this.addProps({...e,data:o,element:s},n),id:i,data:o})}Tt(this,Rc).emit("update",r)}getID(e,t){var r;return((r=Tt(this,Ic))==null?void 0:r.call(this,e,t))??t.toString()}addProps(e,t){if(Tt(this,Mf)||(Tt(this,Da).set(t,e),Tt(this,Da).sizee;return this.clone(r=>({getActive:n=>r.getActive(n).filter(t)}))}},Yn=Tf;Rc=new WeakMap;Pc=new WeakMap;Da=new WeakMap;Nc=new WeakMap;Mf=new WeakMap;zc=new WeakMap;Lc=new WeakMap;Ic=new WeakMap;Dc=new WeakMap;Yn.EMPTY=[];function vI(e,t=b5){const{key:r}=(e==null?void 0:e.getMeta(y5))??{};return r===t}function g5(e){const{tr:t,state:r,previousState:n}=e;return!n||t&&vI(t)?!0:t?JN(t):!r.doc.eq(n.doc)||!r.selection.eq(n.selection)}function v5(e,t,r={}){const n=t.getBoundingClientRect(),{accountForPadding:o=!1}=r;let i=0,s=0,a=0,l=0;if(gt(t)&&o){const u=Number.parseFloat(so(t,"padding-left").replace("px","")),d=Number.parseFloat(so(t,"padding-right").replace("px","")),f=Number.parseFloat(so(t,"padding-top").replace("px","")),p=Number.parseFloat(so(t,"padding-bottom").replace("px","")),h=Number.parseFloat(so(t,"border-left").replace("px","")),m=Number.parseFloat(so(t,"border-right").replace("px","")),b=Number.parseFloat(so(t,"border-top").replace("px","")),v=Number.parseFloat(so(t,"border-bottom").replace("px","")),g=t.offsetWidth-t.clientWidth,y=t.offsetHeight-t.clientHeight;i+=u+h+(t.dir==="rtl"?g:0),s+=d+m+(t.dir==="rtl"?0:g),a+=f+b,l+=p+v+y}const c=new DOMRect(n.left+i,n.top+a,n.width-s,n.height-l);for(const[u,d]of[[e.top,e.left],[e.top,e.right],[e.bottom,e.left],[e.bottom,e.right]])if(Mk(u,c.top,c.bottom)&&Mk(d,c.left,c.right))return!0;return!1}var yI="remirror-positioner-widget",y5="positionerUpdate",b5="__all_positioners__",k5={y:-999999,x:-999999,width:0,height:0},Jx={...k5,left:-999999,top:-999999,bottom:-999999,right:-999999},Lv={...k5,rect:{...Jx,toJSON:()=>Jx},visible:!1},x5=Yn.create({hasChanged:g5,getActive(e){const{state:t}=e;if(!bv(t)||t.selection.$anchor.depth>2)return Yn.EMPTY;const r=yd({predicate:n=>n.type.isBlock,selection:t});return r?[r]:Yn.EMPTY},getPosition(e){const{view:t,data:r}=e,n=t.nodeDOM(r.pos);if(!gt(n))return Lv;const o=n.getBoundingClientRect(),i=t.dom.getBoundingClientRect(),s=o.height,a=o.width,l=t.dom.scrollLeft+o.left-i.left,c=t.dom.scrollTop+o.top-i.top,u=v5(o,t.dom);return{y:c,x:l,height:s,width:a,rect:o,visible:u}}}),Iv=x5.clone(({getActive:e})=>({getActive:t=>{const[r]=e(t);return r&&bh(r.node)&&r.node.type===yh(t.state.schema)?[r]:Yn.EMPTY}})),bI=Iv.clone(({getPosition:e})=>({getPosition:t=>({...e(t),width:1})})),kI=Iv.clone(({getPosition:e})=>({getPosition:t=>{const{width:r,x:n,y:o,height:i}=e(t);return{...e(t),width:1,x:r+n,rect:new DOMRect(r+n,o,1,i)}}}));function Dv(e){return Yn.create({hasChanged:g5,getActive:t=>{const{state:r,view:n}=t;if(!e(r)||!ls(r.selection))return Yn.EMPTY;try{const{head:o,anchor:i}=r.selection;return[{from:n.coordsAtPos(i),to:n.coordsAtPos(o)}]}catch{return Yn.EMPTY}},getPosition(t){const{element:r,data:n,view:o}=t,{from:i,to:s}=n,a=r.offsetParent??o.dom,l=a.getBoundingClientRect(),c=Math.abs(s.bottom-i.top),u=c>i.bottom-i.top,d=Math.min(i.left,s.left),f=Math.min(i.top,s.top),p=a.scrollLeft+(u?s.left-l.left:d-l.left),h=a.scrollTop+f-l.top,m=u?1:Math.abs(i.left-s.right),b=new DOMRect(u?s.left:d,f,m,c),v=v5(b,o.dom);return{rect:b,y:h,x:p,height:c,width:m,visible:v}}})}var w5=Dv(e=>!e.selection.empty),xI=Dv(e=>e.selection.empty),wI=Dv(()=>!0),SI=w5.clone(()=>({getActive:e=>{const{state:t,view:r}=e;if(!t.selection.empty)return Yn.EMPTY;const n=WE(t);if(!n)return Yn.EMPTY;try{return[{from:r.coordsAtPos(n.from),to:r.coordsAtPos(n.to)}]}catch{return Yn.EMPTY}}})),EI={selection:w5,cursor:xI,always:wI,block:x5,emptyBlock:Iv,emptyBlockStart:bI,emptyBlockEnd:kI,nearestWord:SI},Cl=class extends Ge{constructor(){super(...arguments),this.positioners=[],this.onAddCustomHandler=({positioner:e})=>{if(e)return this.positioners=[...this.positioners,e],this.store.commands.forceUpdate(),()=>{this.positioners=this.positioners.filter(t=>t!==e)}}}get name(){return"positioner"}createAttributes(){return{class:iI.EDITOR}}init(){this.onScroll=cS(this.options.scrollDebounce,this.onScroll.bind(this))}createEventHandlers(){return{scroll:()=>(this.onScroll(),!1),hover:(e,t)=>(this.positioner(this.getBaseProps("hover",{hover:t})),!1),contextmenu:(e,t)=>(this.positioner(this.getBaseProps("contextmenu",{contextmenu:t})),!1)}}onStateUpdate(e){this.positioner({...e,previousState:e.firstUpdate?void 0:e.previousState,event:"state",helpers:this.store.helpers})}createDecorations(e){if(this.element??(this.element=this.createElement()),!this.element.hasChildNodes())return Ee.empty;const t=Ke.widget(0,this.element,{key:"positioner-widget",side:-1,stopEvent:()=>!0});return Ee.create(e.doc,[t])}forceUpdatePositioners(e=b5){return({tr:t,dispatch:r})=>(r==null||r(t.setMeta(y5,{key:e})),!0)}getPositionerWidget(){return this.element??(this.element=this.createElement())}createElement(){const e=document.createElement("span");return e.dataset.id=yI,e.setAttribute("role","presentation"),e}triggerPositioner(e,t){e.hasChanged(t)&&e.onActiveChanged({...t,view:this.store.view})}positioner(e){for(const t of this.positioners)t.events.includes(e.event)&&this.triggerPositioner(t,e)}getBaseProps(e,t){const r=this.store.getState(),n=this.store.previousState;return{helpers:this.store.helpers,event:e,firstUpdate:!1,previousState:n,state:r,...t}}onScroll(){this.positioner(this.getBaseProps("scroll",{scroll:{scrollTop:this.store.view.dom.scrollTop}}))}};zv([Y()],Cl.prototype,"forceUpdatePositioners",1);zv([je()],Cl.prototype,"getPositionerWidget",1);Cl=zv([ye({defaultOptions:{scrollDebounce:100},customHandlerKeys:["positioner"],staticKeys:["scrollDebounce"]})],Cl);function T1(e){return ne(e)?EI[e].clone():Ne(e)?e().clone():e.clone()}var CI=Object.defineProperty,MI=Object.getOwnPropertyDescriptor,S5=(e,t,r,n)=>{for(var o=n>1?void 0:n?MI(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&CI(t,r,o),o},$v=class extends wr{get name(){return"blockquote"}createTags(){return[ae.Block,ae.FormattingNode]}createNodeSpec(e,t){return{content:"block+",defining:!0,draggable:!1,...t,attrs:e.defaults(),parseDOM:[{tag:"blockquote",getAttrs:e.parse,priority:100},...t.parseDOM??[]],toDOM:r=>["blockquote",e.dom(r),0]}}toggleBlockquote(){return JE(this.type)}shortcut(e){return this.toggleBlockquote()(e)}createInputRules(){return[ph(/^\s*>\s$/,this.type)]}createPasteRules(){return{type:"node",nodeType:this.type,regexp:/^\s*>\s$/,startOfTextBlock:!0}}};S5([Y({icon:"doubleQuotesL",description:({t:e})=>e(Vk.DESCRIPTION),label:({t:e})=>e(Vk.LABEL)})],$v.prototype,"toggleBlockquote",1);S5([Et({shortcut:"Ctrl->",command:"toggleBlockquote"})],$v.prototype,"shortcut",1);var TI=Object.defineProperty,OI=Object.getOwnPropertyDescriptor,wd=(e,t,r,n)=>{for(var o=n>1?void 0:n?OI(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&TI(t,r,o),o},_I={icon:"bold",label:({t:e})=>e(jk.LABEL),description:({t:e})=>e(jk.DESCRIPTION)},Qs=class extends pa{get name(){return"bold"}createTags(){return[ae.FormattingMark,ae.FontStyle]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"strong",getAttrs:e.parse},{tag:"b",getAttrs:r=>gt(r)&&r.style.fontWeight!=="normal"?e.parse(r):!1},{style:"font-weight",getAttrs:r=>ne(r)&&/^(bold(er)?|[5-9]\d{2,})$/.test(r)?null:!1},...t.parseDOM??[]],toDOM:r=>{const{weight:n}=this.options;return n?["strong",{"font-weight":n.toString()},0]:["strong",e.dom(r),0]}}}createInputRules(){return[Ou({regexp:/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,type:this.type,ignoreWhitespace:!0})]}toggleBold(e){return Ji({type:this.type,selection:e})}setBold(e){return({tr:t,dispatch:r})=>{const{from:n,to:o}=Cn(e??t.selection,t.doc);return r==null||r(t.addMark(n,o,this.type.create())),!0}}removeBold(e){return({tr:t,dispatch:r})=>{const{from:n,to:o}=Cn(e??t.selection,t.doc);return t.doc.rangeHasMark(n,o,this.type)?(r==null||r(t.removeMark(n,o,this.type)),!0):!1}}shortcut(e){return this.toggleBold()(e)}};wd([Y(_I)],Qs.prototype,"toggleBold",1);wd([Y()],Qs.prototype,"setBold",1);wd([Y()],Qs.prototype,"removeBold",1);wd([Et({shortcut:j.Bold,command:"toggleBold"})],Qs.prototype,"shortcut",1);Qs=wd([ye({defaultOptions:{weight:void 0},staticKeys:["weight"]})],Qs);var AI=Object.defineProperty,RI=Object.getOwnPropertyDescriptor,Hv=(e,t,r,n)=>{for(var o=n>1?void 0:n?RI(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&AI(t,r,o),o},{DESCRIPTION:PI,LABEL:NI}=fR,zI={icon:"codeLine",description:({t:e})=>e(PI),label:({t:e})=>e(NI)},Ru=class extends pa{get name(){return"code"}createTags(){return[ae.Code,ae.ExcludeInputRules]}createMarkSpec(e,t){return{excludes:"_",...t,attrs:e.defaults(),parseDOM:[{tag:"code",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["code",{spellcheck:"false",...e.dom(r)},0]}}createKeymap(){return{"Mod-`":Ji({type:this.type})}}keyboardShortcut(e){return this.toggleCode()(e)}toggleCode(){return Ji({type:this.type})}createInputRules(){return[Ou({regexp:new RegExp(`(?:\`)([^\`${X0}]+)(?:\`)$`),type:this.type,ignoreWhitespace:!0})]}createPasteRules(){return[{type:"mark",regexp:/`([^`]+)`/g,markType:this.type}]}};Hv([Et({shortcut:j.Code,command:"toggleCode"})],Ru.prototype,"keyboardShortcut",1);Hv([Y(zI)],Ru.prototype,"toggleCode",1);Ru=Hv([ye({})],Ru);var LI=DI,II=Object.prototype.hasOwnProperty;function DI(){for(var e={},t=0;t4&&r.slice(0,4)===Uv&&E9.test(t)&&(t.charAt(4)==="-"?n=T9(t):t=O9(t),o=x9),new o(n,t))}function T9(e){var t=e.slice(5).replace(P5,A9);return Uv+t.charAt(0).toUpperCase()+t.slice(1)}function O9(e){var t=e.slice(4);return P5.test(t)?e:(t=t.replace(C9,_9),t.charAt(0)!=="-"&&(t="-"+t),Uv+t)}function _9(e){return"-"+e.toLowerCase()}function A9(e){return e.charAt(1).toUpperCase()}var R9=P9,t2=/[#.]/g;function P9(e,t){for(var r=e||"",n=t||"div",o={},i=0,s,a,l;i=48&&t<=57}var e$=t$;function t$(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}var r$=n$;function n$(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}var o$=r$,i$=L5,s$=a$;function a$(e){return o$(e)||i$(e)}var Fd,l$=59,c$=u$;function u$(e){var t="&"+e+";",r;return Fd=Fd||document.createElement("i"),Fd.innerHTML=t,r=Fd.textContent,r.charCodeAt(r.length-1)===l$&&e!=="semi"||r===t?!1:r}var l2=XD,c2=QD,d$=L5,f$=e$,I5=s$,p$=c$,h$=T$,m$={}.hasOwnProperty,Sa=String.fromCharCode,g$=Function.prototype,u2={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:!1,nonTerminated:!0},v$=9,d2=10,y$=12,b$=32,f2=38,k$=59,x$=60,w$=61,S$=35,E$=88,C$=120,M$=65533,$a="named",qv="hexadecimal",Gv="decimal",Yv={};Yv[qv]=16;Yv[Gv]=10;var Mh={};Mh[$a]=I5;Mh[Gv]=d$;Mh[qv]=f$;var D5=1,$5=2,H5=3,B5=4,F5=5,_1=6,V5=7,cs={};cs[D5]="Named character references must be terminated by a semicolon";cs[$5]="Numeric character references must be terminated by a semicolon";cs[H5]="Named character references cannot be empty";cs[B5]="Numeric character references cannot be empty";cs[F5]="Named character references must be known";cs[_1]="Numeric character references cannot be disallowed";cs[V5]="Numeric character references cannot be outside the permissible Unicode range";function T$(e,t){var r={},n,o;t||(t={});for(o in u2)n=t[o],r[o]=n??u2[o];return(r.position.indent||r.position.start)&&(r.indent=r.position.indent||[],r.position=r.position.start),O$(e,r)}function O$(e,t){var r=t.additional,n=t.nonTerminated,o=t.text,i=t.reference,s=t.warning,a=t.textContext,l=t.referenceContext,c=t.warningContext,u=t.position,d=t.indent||[],f=e.length,p=0,h=-1,m=u.column||1,b=u.line||1,v="",g=[],y,k,x,w,E,M,C,T,R,B,I,F,V,z,K,_,N,H,G;for(typeof r=="string"&&(r=r.charCodeAt(0)),_=J(),T=s?_e:g$,p--,f++;++p65535&&(M-=65536,B+=Sa(M>>>10|55296),M=56320|M&1023),M=B+Sa(M))):z!==$a&&T(B5,H)),M?(oe(),_=J(),p=G-1,m+=G-V+1,g.push(M),N=J(),N.offset++,i&&i.call(l,M,{start:_,end:N},e.slice(V-1,G)),_=N):(w=e.slice(V-1,G),v+=w,m+=w.length,p=G-1)}else E===10&&(b++,h++,m=0),E===E?(v+=Sa(E),m++):oe();return g.join("");function J(){return{line:b,column:m,offset:p+(u.offset||0)}}function _e(ue,de){var he=J();he.column+=de,he.offset+=de,s.call(c,cs[ue],he,ue)}function oe(){v&&(g.push(v),o&&o.call(a,v,{start:_,end:J()}),v="")}}function _$(e){return e>=55296&&e<=57343||e>1114111}function A$(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var j5={exports:{}};(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/** + * Prism: Lightweight, robust, elegant syntax highlighting + * + * @license MIT + * @author Lea Verou + * @namespace + * @public + */var r=function(n){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,s={},a={manual:n.Prism&&n.Prism.manual,disableWorkerMessageHandler:n.Prism&&n.Prism.disableWorkerMessageHandler,util:{encode:function g(y){return y instanceof l?new l(y.type,g(y.content),y.alias):Array.isArray(y)?y.map(g):y.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(x){var g=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(x.stack)||[])[1];if(g){var y=document.getElementsByTagName("script");for(var k in y)if(y[k].src==g)return y[k]}return null}},isActive:function(g,y,k){for(var x="no-"+y;g;){var w=g.classList;if(w.contains(y))return!0;if(w.contains(x))return!1;g=g.parentElement}return!!k}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(g,y){var k=a.util.clone(a.languages[g]);for(var x in y)k[x]=y[x];return k},insertBefore:function(g,y,k,x){x=x||a.languages;var w=x[g],E={};for(var M in w)if(w.hasOwnProperty(M)){if(M==y)for(var C in k)k.hasOwnProperty(C)&&(E[C]=k[C]);k.hasOwnProperty(M)||(E[M]=w[M])}var T=x[g];return x[g]=E,a.languages.DFS(a.languages,function(R,B){B===T&&R!=g&&(this[R]=E)}),E},DFS:function g(y,k,x,w){w=w||{};var E=a.util.objId;for(var M in y)if(y.hasOwnProperty(M)){k.call(y,M,y[M],x||M);var C=y[M],T=a.util.type(C);T==="Object"&&!w[E(C)]?(w[E(C)]=!0,g(C,k,null,w)):T==="Array"&&!w[E(C)]&&(w[E(C)]=!0,g(C,k,M,w))}}},plugins:{},highlightAll:function(g,y){a.highlightAllUnder(document,g,y)},highlightAllUnder:function(g,y,k){var x={callback:k,container:g,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",x),x.elements=Array.prototype.slice.apply(x.container.querySelectorAll(x.selector)),a.hooks.run("before-all-elements-highlight",x);for(var w=0,E;E=x.elements[w++];)a.highlightElement(E,y===!0,x.callback)},highlightElement:function(g,y,k){var x=a.util.getLanguage(g),w=a.languages[x];a.util.setLanguage(g,x);var E=g.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(E,x);var M=g.textContent,C={element:g,language:x,grammar:w,code:M};function T(B){C.highlightedCode=B,a.hooks.run("before-insert",C),C.element.innerHTML=C.highlightedCode,a.hooks.run("after-highlight",C),a.hooks.run("complete",C),k&&k.call(C.element)}if(a.hooks.run("before-sanity-check",C),E=C.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!C.code){a.hooks.run("complete",C),k&&k.call(C.element);return}if(a.hooks.run("before-highlight",C),!C.grammar){T(a.util.encode(C.code));return}if(y&&n.Worker){var R=new Worker(a.filename);R.onmessage=function(B){T(B.data)},R.postMessage(JSON.stringify({language:C.language,code:C.code,immediateClose:!0}))}else T(a.highlight(C.code,C.grammar,C.language))},highlight:function(g,y,k){var x={code:g,grammar:y,language:k};if(a.hooks.run("before-tokenize",x),!x.grammar)throw new Error('The language "'+x.language+'" has no grammar.');return x.tokens=a.tokenize(x.code,x.grammar),a.hooks.run("after-tokenize",x),l.stringify(a.util.encode(x.tokens),x.language)},tokenize:function(g,y){var k=y.rest;if(k){for(var x in k)y[x]=k[x];delete y.rest}var w=new d;return f(w,w.head,g),u(g,w,y,w.head,0),h(w)},hooks:{all:{},add:function(g,y){var k=a.hooks.all;k[g]=k[g]||[],k[g].push(y)},run:function(g,y){var k=a.hooks.all[g];if(!(!k||!k.length))for(var x=0,w;w=k[x++];)w(y)}},Token:l};n.Prism=a;function l(g,y,k,x){this.type=g,this.content=y,this.alias=k,this.length=(x||"").length|0}l.stringify=function g(y,k){if(typeof y=="string")return y;if(Array.isArray(y)){var x="";return y.forEach(function(T){x+=g(T,k)}),x}var w={type:y.type,content:g(y.content,k),tag:"span",classes:["token",y.type],attributes:{},language:k},E=y.alias;E&&(Array.isArray(E)?Array.prototype.push.apply(w.classes,E):w.classes.push(E)),a.hooks.run("wrap",w);var M="";for(var C in w.attributes)M+=" "+C+'="'+(w.attributes[C]||"").replace(/"/g,""")+'"';return"<"+w.tag+' class="'+w.classes.join(" ")+'"'+M+">"+w.content+""};function c(g,y,k,x){g.lastIndex=y;var w=g.exec(k);if(w&&x&&w[1]){var E=w[1].length;w.index+=E,w[0]=w[0].slice(E)}return w}function u(g,y,k,x,w,E){for(var M in k)if(!(!k.hasOwnProperty(M)||!k[M])){var C=k[M];C=Array.isArray(C)?C:[C];for(var T=0;T=E.reach);N+=_.value.length,_=_.next){var H=_.value;if(y.length>g.length)return;if(!(H instanceof l)){var G=1,J;if(F){if(J=c(K,N,g,I),!J||J.index>=g.length)break;var de=J.index,_e=J.index+J[0].length,oe=N;for(oe+=_.value.length;de>=oe;)_=_.next,oe+=_.value.length;if(oe-=_.value.length,N=oe,_.value instanceof l)continue;for(var ue=_;ue!==y.tail&&(oe<_e||typeof ue.value=="string");ue=ue.next)G++,oe+=ue.value.length;G--,H=g.slice(N,oe),J.index-=N}else if(J=c(K,0,H,I),!J)continue;var de=J.index,he=J[0],Me=H.slice(0,de),Se=H.slice(de+he.length),ct=N+H.length;E&&ct>E.reach&&(E.reach=ct);var et=_.prev;Me&&(et=f(y,et,Me),N+=Me.length),p(y,et,G);var Er=new l(M,B?a.tokenize(he,B):he,V,he);if(_=f(y,et,Er),Se&&f(y,_,Se),G>1){var pe={cause:M+","+T,reach:ct};u(g,y,k,_.prev,N,pe),E&&pe.reach>E.reach&&(E.reach=pe.reach)}}}}}}function d(){var g={value:null,prev:null,next:null},y={value:null,prev:g,next:null};g.next=y,this.head=g,this.tail=y,this.length=0}function f(g,y,k){var x=y.next,w={value:k,prev:y,next:x};return y.next=w,x.prev=w,g.length++,w}function p(g,y,k){for(var x=y.next,w=0;w/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(r,n){var o={};o["language-"+n]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[n]},o.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:o}};i["language-"+n]={pattern:/[\s\S]+/,inside:e.languages[n]};var s={};s[r]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return r}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",s)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,r){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[r,"language-"+r],inside:e.languages[r]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}var N$=Xv;Xv.displayName="css";Xv.aliases=[];function Xv(e){(function(t){var r=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+r.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+r.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+r.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:r,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var n=t.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))})(e)}var z$=Qv;Qv.displayName="clike";Qv.aliases=[];function Qv(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}var L$=Zv;Zv.displayName="javascript";Zv.aliases=["js"];function Zv(e){e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}var Hc=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof bu=="object"?bu:{},I$=Q$();Hc.Prism={manual:!0,disableWorkerMessageHandler:!0};var D$=Q9,$$=h$,U5=R$,H$=P$,B$=N$,F$=z$,V$=L$;I$();var ey={}.hasOwnProperty;function W5(){}W5.prototype=U5;var St=new W5,j$=St;St.highlight=W$;St.register=Ed;St.alias=U$;St.registered=K$;St.listLanguages=q$;Ed(H$);Ed(B$);Ed(F$);Ed(V$);St.util.encode=J$;St.Token.stringify=G$;function Ed(e){if(typeof e!="function"||!e.displayName)throw new Error("Expected `function` for `grammar`, got `"+e+"`");St.languages[e.displayName]===void 0&&e(St)}function U$(e,t){var r=St.languages,n=e,o,i,s,a;t&&(n={},n[e]=t);for(o in n)for(i=n[o],i=typeof i=="string"?[i]:i,s=i.length,a=-1;++a{for(var o=n>1?void 0:n?eH(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Z$(t,r,o),o},K5=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},ui=(e,t,r)=>(K5(e,t,"read from private field"),r?r.call(e):t.get(e)),ng=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},og=(e,t,r,n)=>(K5(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),q5="data-code-block-language";function G5(e,t,r=[]){return e.map(n=>{const o=[...r];return n.type==="element"&&n.properties.className?o.push(...n.properties.className):n.type==="text"&&o.length===0&&t&&o.push(t),n.type==="element"?G5(n.children,t,o):{text:n.value,classes:o}})}function tH(e,t){var r;const{node:n,pos:o}=e,i=mp({language:(r=n.attrs.language)==null?void 0:r.replace("language-",""),fallback:"markup"}),s=ty.highlight(n.textContent??"",i),a=G5(s,t);let l=o+1;function c(u){const d=l,f=d+u.text.length;return l=f,{...u,from:d,to:f}}return mS(a).map(c)}function p2(e){const{blocks:t,skipLast:r,plainTextClassName:n}=e,o=[];for(const i of t){const s=tH(i,n),a=r?s.length-1:s.length;for(const l of ev(a)){const c=s[l],u=c==null?void 0:c.classes;if(!c||!(u!=null&&u.length))continue;const d=Ke.inline(c.from,c.to,{class:u.join(" ")});o.push(d)}}return o}function rH(e){return!!(e&&Xt(e)&&ne(e.language)&&e.language.length>0)}function nH(e){return t=>({state:{tr:r,selection:n},dispatch:o})=>{if(!rH(t))throw new Error("Invalid attrs passed to the updateAttributes method");const i=Gi({types:e,selection:n});return!i||hS(t,i.node.attrs)?!1:(r.setNodeMarkup(i.pos,e,{...i.node.attrs,...t}),o&&o(r),!0)}}function mp(e){const{language:t,fallback:r}=e;if(!t)return r;const n=ty.listLanguages();for(const o of n)if(o.toLowerCase()===t.toLowerCase())return o;return r}function oH(e,t){const{language:r,wrap:n}=Sv(e.attrs,t),{style:o,...i}=t.dom(e);let s=i.style;return n&&(s=w6({whiteSpace:"pre-wrap",wordBreak:"break-all"},s)),["pre",{spellcheck:"false",...i,class:_u(i.class,`language-${r}`)},["code",{[q5]:r,style:s},0]]}function iH(e){return({pos:t}=ee())=>({tr:r,dispatch:n})=>{const{type:o,formatter:i,defaultLanguage:s}=e,{from:a,to:l}=t?{from:t,to:t}:r.selection,c=Gi({types:o,selection:r.selection});if(!c)return!1;const{node:{attrs:u,textContent:d},start:f}=c,p=a-f,h=l-f,m=mp({language:u.language,fallback:s}),b=i({source:d,language:m,cursorOffset:p});let v;if(p!==h&&(v=i({source:d,language:m,cursorOffset:h})),!b)return!1;const{cursorOffset:g,formatted:y}=b;if(y===d)return!1;const k=f+d.length;r.insertText(y,f,k);const x=f+g,w=v?f+v.cursorOffset:void 0;return r.setSelection(le.between(r.doc.resolve(x),r.doc.resolve(w??x))),n&&n(r),!0}}function sH(e){var t;return(t=e.getAttribute(q5)??e.classList[0])==null?void 0:t.replace("language-","")}var{DESCRIPTION:aH,LABEL:lH}=cR,cH={icon:"bracesLine",description:({t:e})=>e(aH),label:({t:e})=>e(lH)},ks,Bc,Fc,uH=class{constructor(e,t){ng(this,ks,void 0),ng(this,Bc,void 0),ng(this,Fc,!1),og(this,Bc,e),og(this,ks,t)}init(e){const t=L6({node:e.doc,type:ui(this,Bc)});return this.refreshDecorationSet(e.doc,t),this}refreshDecorationSet(e,t){const r=p2({blocks:t,skipLast:ui(this,Fc),defaultLanguage:ui(this,ks).options.defaultLanguage,plainTextClassName:ui(this,ks).options.plainTextClassName??void 0});this.decorationSet=Ee.create(e,r)}apply(e,t){if(!e.docChanged)return this;this.decorationSet=this.decorationSet.map(e.mapping,e.doc);const r=I6(e,{descend:!0,predicate:n=>n.type===ui(this,Bc),StepTypes:[]});return this.updateDecorationSet(e,r),this}updateDecorationSet(e,t){if(t.length===0)return;let r=this.decorationSet;for(const{node:n,pos:o}of t)r=this.decorationSet.remove(this.decorationSet.find(o,o+n.nodeSize));this.decorationSet=r.add(e.doc,p2({blocks:t,skipLast:ui(this,Fc),defaultLanguage:ui(this,ks).options.defaultLanguage,plainTextClassName:ui(this,ks).options.plainTextClassName??void 0}))}setDeleted(e){og(this,Fc,e)}};ks=new WeakMap;Bc=new WeakMap;Fc=new WeakMap;var eo=class extends wr{get name(){return"codeBlock"}createTags(){return[ae.Block,ae.Code]}init(){this.registerLanguages()}createNodeSpec(e,t){const r=/highlight-(?:text|source)-([\da-z]+)/;return{content:"text*",marks:"",defining:!0,draggable:!1,...t,code:!0,attrs:{...e.defaults(),language:{default:this.options.defaultLanguage},wrap:{default:this.options.defaultWrap}},parseDOM:[{tag:"div.highlight",preserveWhitespace:"full",getAttrs:n=>{var o,i;if(!gt(n))return!1;const s=n.querySelector("pre.code");if(!gt(s))return!1;const a=so(s,"white-space")==="pre-wrap",l=(i=(o=n.className.match(r))==null?void 0:o[1])==null?void 0:i.replace("language-","");return{...e.parse(n),language:l,wrap:a}}},{tag:"pre",preserveWhitespace:"full",getAttrs:n=>{if(!gt(n))return!1;const o=n.querySelector("code");if(!gt(o))return!1;const i=so(o,"white-space")==="pre-wrap",s=this.options.getLanguageFromDom(o,n);return{...e.parse(n),language:s,wrap:i}}},...t.parseDOM??[]],toDOM:n=>oH(n,e)}}createAttributes(){return{class:jL[this.options.syntaxTheme.toUpperCase()]}}createInputRules(){const e=/^```([\dA-Za-z]*) $/,t=r=>({language:mp({language:il(r,1),fallback:this.options.defaultLanguage})});return[ZE({regexp:e,type:this.type,beforeDispatch:({tr:r,start:n})=>{const o=r.doc.resolve(n);r.setSelection(le.near(o))},getAttributes:t})]}onSetOptions(e){const{changes:t}=e;t.supportedLanguages.changed&&this.registerLanguages(),t.syntaxTheme.changed&&this.store.updateAttributes()}createPlugin(){const e=new uH(this.type,this),t=()=>(e.setDeleted(!0),!1);return{state:{init(r,n){return e.init(n)},apply(r,n,o,i){return e.apply(r,i)}},props:{handleKeyDown:Mv({Backspace:t,"Mod-Backspace":t,Delete:t,"Mod-Delete":t,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t}),decorations(){return e.setDeleted(!1),e.decorationSet}}}}toggleCodeBlock(e={}){return Ev({type:this.type,toggleType:this.options.toggleName,attrs:{language:this.options.defaultLanguage,...e}})}createCodeBlock(e){return Tu(this.type,e)}updateCodeBlock(e){return nH(this.type)(e)}formatCodeBlock(e){return iH({type:this.type,formatter:this.options.formatter,defaultLanguage:this.options.defaultLanguage})(e)}tabKey({state:e,dispatch:t}){const{selection:r,tr:n,schema:o}=e,{node:i}=GN(r);if(!vh({node:i,types:this.type}))return!1;if(r.empty)n.insertText(" ");else{const{from:s,to:a}=r;n.replaceWith(s,a,o.text(" "))}return t&&t(n),!0}backspaceKey({dispatch:e,tr:t,state:r}){if(!t.selection.empty)return!1;const n=Gi({types:this.type,selection:t.selection});if((n==null?void 0:n.start)!==t.selection.from)return!1;const{pos:o,node:i,start:s}=n,a=nt(r.schema.nodes,this.options.toggleName);return i.textContent.trim()===""?t.doc.lastChild===i&&t.doc.firstChild===i?KN({pos:o,tr:t,content:a.create()}):WN({pos:o,tr:t}):s>2?t.setSelection(le.near(t.doc.resolve(s-2))):(t.insert(0,a.create()),t.setSelection(le.near(t.doc.resolve(1)))),e&&e(t),!0}enterKey({dispatch:e,tr:t}){if(!(ls(t.selection)&&t.selection.empty))return!1;const{nodeBefore:r,parent:n}=t.selection.$anchor;if(!(r!=null&&r.isText)||!n.type.isTextblock)return!1;const o=/^```([A-Za-z]*)?$/,{text:i,nodeSize:s}=r,{textContent:a}=n;if(!i)return!1;const l=i.match(o),c=a.match(o);if(!l||!c)return!1;const[,u]=l,d=mp({language:u,fallback:this.options.defaultLanguage}),f=t.selection.$from.before(),p=f+s+1;return t.replaceWith(f,p,this.type.create({language:d})),t.setSelection(le.near(t.doc.resolve(f+1))),e&&e(t),!0}formatShortcut({tr:e}){const t=this.store.commands;if(!HE({type:this.type,state:e}))return!1;const r=t.formatCodeBlock.isEnabled();return r&&t.formatCodeBlock(),r}registerLanguages(){for(const e of this.options.supportedLanguages)ty.register(e)}};ri([Y(cH)],eo.prototype,"toggleCodeBlock",1);ri([Y()],eo.prototype,"createCodeBlock",1);ri([Y()],eo.prototype,"updateCodeBlock",1);ri([Y()],eo.prototype,"formatCodeBlock",1);ri([Et({shortcut:"Tab"})],eo.prototype,"tabKey",1);ri([Et({shortcut:"Backspace"})],eo.prototype,"backspaceKey",1);ri([Et({shortcut:"Enter"})],eo.prototype,"enterKey",1);ri([Et({shortcut:j.Format})],eo.prototype,"formatShortcut",1);eo=ri([ye({defaultOptions:{supportedLanguages:[],toggleName:"paragraph",formatter:({source:e})=>({cursorOffset:0,formatted:e}),syntaxTheme:"a11y_dark",defaultLanguage:"markup",defaultWrap:!1,plainTextClassName:"",getLanguageFromDom:sH},staticKeys:["getLanguageFromDom"]})],eo);var gp=200,Ht=function(){};Ht.prototype.append=function(t){return t.length?(t=Ht.from(t),!this.length&&t||t.length=r?Ht.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,r))};Ht.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Ht.prototype.forEach=function(t,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length),r<=n?this.forEachInner(t,r,n,0):this.forEachInvertedInner(t,r,n,0)};Ht.prototype.map=function(t,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length);var o=[];return this.forEach(function(i,s){return o.push(t(i,s))},r,n),o};Ht.from=function(t){return t instanceof Ht?t:t&&t.length?new Y5(t):Ht.empty};var Y5=function(e){function t(n){e.call(this),this.values=n}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new t(this.values.slice(o,i))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,i,s,a){for(var l=i;l=s;l--)if(o(this.values[l],a+l)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=gp)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=gp)return new t(o.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(t.prototype,r),t}(Ht);Ht.empty=new Y5([]);var dH=function(e){function t(r,n){e.call(this),this.left=r,this.right=n,this.length=r.length+n.length,this.depth=Math.max(r.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(n){return na&&this.right.forEachInner(n,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(n,o,i,s){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(n,o-a,Math.max(i,a)-a,s+a)===!1||i=i?this.right.slice(n-i,o-i):this.left.slice(n,i).append(this.right.slice(0,o-i))},t.prototype.leafAppend=function(n){var o=this.right.leafAppend(n);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(n){var o=this.left.leafPrepend(n);if(o)return new t(o,this.right)},t.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new t(this.left,new t(this.right,n)):new t(this,n)},t}(Ht);const fH=500;class qn{constructor(t,r){this.items=t,this.eventCount=r}popEvent(t,r){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let o,i;r&&(o=this.remapping(n,this.items.length),i=o.maps.length);let s=t.tr,a,l,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(n,f+1),i=o.maps.length),i--,u.push(d);return}if(o){u.push(new ao(d.map));let p=d.step.map(o.slice(i)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new ao(h,void 0,void 0,c.length+u.length))),i--,h&&o.appendMap(h,i)}else s.maybeStep(d.step);if(d.selection)return a=o?d.selection.map(o.slice(i)):d.selection,l=new qn(this.items.slice(0,n).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(t,r,n,o){let i=[],s=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let u=0;uhH&&(a=pH(a,c),s-=c),new qn(a.append(i),s)}remapping(t,r){let n=new tl;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=t?n.maps.length-o.mirrorOffset:void 0;n.appendMap(o.map,s)},t,r),n}addMaps(t){return this.eventCount==0?this:new qn(this.items.append(t.map(r=>new ao(r))),this.eventCount)}rebased(t,r){if(!this.eventCount)return this;let n=[],o=Math.max(0,this.items.length-r),i=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},o);let l=r;this.items.forEach(f=>{let p=i.getMirror(--l);if(p==null)return;s=Math.min(s,p);let h=i.maps[p];if(f.step){let m=t.steps[p].invert(t.docs[p]),b=f.selection&&f.selection.map(i.slice(l+1,p));b&&a++,n.push(new ao(h,m,b))}else n.push(new ao(h))},o);let c=[];for(let f=r;ffH&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let t=0;return this.items.forEach(r=>{r.step||t++}),t}compress(t=this.items.length){let r=this.remapping(0,t),n=r.maps.length,o=[],i=0;return this.items.forEach((s,a)=>{if(a>=t)o.push(s),s.selection&&i++;else if(s.step){let l=s.step.map(r.slice(n)),c=l&&l.getMap();if(n--,c&&r.appendMap(c,n),l){let u=s.selection&&s.selection.map(r.slice(n));u&&i++;let d=new ao(c.invert(),l,u),f,p=o.length-1;(f=o.length&&o[p].merge(d))?o[p]=f:o.push(d)}}else s.map&&n--},this.items.length,0),new qn(Ht.from(o.reverse()),i)}}qn.empty=new qn(Ht.empty,0);function pH(e,t){let r;return e.forEach((n,o)=>{if(n.selection&&t--==0)return r=o,!1}),e.slice(r)}class ao{constructor(t,r,n,o){this.map=t,this.step=r,this.selection=n,this.mirrorOffset=o}merge(t){if(this.step&&t.step&&!t.selection){let r=t.step.merge(this.step);if(r)return new ao(r.getMap().invert(),r,this.selection)}}}class ki{constructor(t,r,n,o,i){this.done=t,this.undone=r,this.prevRanges=n,this.prevTime=o,this.prevComposition=i}}const hH=20;function mH(e,t,r,n){let o=r.getMeta(mo),i;if(o)return o.historyState;r.getMeta(vH)&&(e=new ki(e.done,e.undone,null,0,-1));let s=r.getMeta("appendedTransaction");if(r.steps.length==0)return e;if(s&&s.getMeta(mo))return s.getMeta(mo).redo?new ki(e.done.addTransform(r,void 0,n,Of(t)),e.undone,h2(r.mapping.maps[r.steps.length-1]),e.prevTime,e.prevComposition):new ki(e.done,e.undone.addTransform(r,void 0,n,Of(t)),null,e.prevTime,e.prevComposition);if(r.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=r.getMeta("composition"),l=e.prevTime==0||!s&&e.prevComposition!=a&&(e.prevTime<(r.time||0)-n.newGroupDelay||!gH(r,e.prevRanges)),c=s?ig(e.prevRanges,r.mapping):h2(r.mapping.maps[r.steps.length-1]);return new ki(e.done.addTransform(r,l?t.selection.getBookmark():void 0,n,Of(t)),qn.empty,c,r.time,a??e.prevComposition)}else return(i=r.getMeta("rebased"))?new ki(e.done.rebased(r,i),e.undone.rebased(r,i),ig(e.prevRanges,r.mapping),e.prevTime,e.prevComposition):new ki(e.done.addMaps(r.mapping.maps),e.undone.addMaps(r.mapping.maps),ig(e.prevRanges,r.mapping),e.prevTime,e.prevComposition)}function gH(e,t){if(!t)return!1;if(!e.docChanged)return!0;let r=!1;return e.mapping.maps[0].forEach((n,o)=>{for(let i=0;i=t[i]&&(r=!0)}),r}function h2(e){let t=[];return e.forEach((r,n,o,i)=>t.push(o,i)),t}function ig(e,t){if(!e)return null;let r=[];for(let n=0;n{let r=mo.getState(e);return!r||r.done.eventCount==0?!1:(t&&J5(r,e,t,!1),!0)},Vc=(e,t)=>{let r=mo.getState(e);return!r||r.undone.eventCount==0?!1:(t&&J5(r,e,t,!0),!0)};function A1(e){let t=mo.getState(e);return t?t.done.eventCount:0}function bH(e){let t=mo.getState(e);return t?t.undone.eventCount:0}var kH=Object.defineProperty,xH=Object.getOwnPropertyDescriptor,ry=(e,t,r,n)=>{for(var o=n>1?void 0:n?xH(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&kH(t,r,o),o},Ml=class extends wr{get name(){return"doc"}createNodeSpec(e,t){const{docAttributes:r,content:n}=this.options,o=ee();if(ss(r))for(const[i,s]of At(r))o[i]={default:s};else for(const i of r)o[i]={default:null};return{attrs:o,content:n,...t}}setDocAttributes(e){return({tr:t,dispatch:r})=>{if(r){for(const[n,o]of Object.entries(e))t.step(new Pu(n,o));r(t)}return!0}}isDefaultDocNode({state:e=this.store.getState(),options:t}={}){return wv(e.doc,t)}};ry([Y()],Ml.prototype,"setDocAttributes",1);ry([je()],Ml.prototype,"isDefaultDocNode",1);Ml=ry([ye({defaultOptions:{content:"block+",docAttributes:[]},defaultPriority:De.Medium,staticKeys:["content","docAttributes"],disableExtraAttributes:!0})],Ml);var X5="SetDocAttribute",Q5="RevertSetDocAttribute",Pu=class extends Pt{constructor(e,t,r=X5){super(),this.stepType=r,this.key=e,this.value=t}static fromJSON(e,t){return new Pu(t.key,t.value,t.stepType)}apply(e){this.previous=e.attrs[this.key];const t={...e.attrs,[this.key]:this.value};return mt.ok(e.type.create(t,e.content,e.marks))}invert(){return new Pu(this.key,this.previous,Q5)}map(){return this}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}};try{Pt.jsonID(X5,Pu),Pt.jsonID(Q5,Pu)}catch(e){if(!e.message.startsWith("Duplicate use of step JSON ID"))throw e}var Z5=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},Pe=(e,t,r)=>(Z5(e,t,"read from private field"),r?r.call(e):t.get(e)),Ha=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},yi=(e,t,r,n)=>(Z5(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),wH='',SH='',EH=encodeURIComponent(wH),CH=encodeURIComponent(SH),Mr,MH=class{constructor(e){Ha(this,Mr,void 0);const t=document.createElement("div"),r=document.createElement("div");this.dom=t,yi(this,Mr,r),this.type=e,this.createHandle(e)}createHandle(e){switch(nr(this.dom,{position:"absolute",pointerEvents:"auto",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"100"}),nr(Pe(this,Mr),{opacity:"0",transition:"opacity 300ms ease-in 0s"}),Pe(this,Mr).dataset.dragging="",e){case 0:nr(this.dom,{right:"0px",top:"0px",height:"100%",width:"15px",cursor:"col-resize"}),nr(Pe(this,Mr),{width:" 4px",height:"36px",maxHeight:"50%",boxSizing:"content-box",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 1:nr(this.dom,{left:"0px",top:"0px",height:"100%",width:"15px",cursor:"col-resize"}),nr(Pe(this,Mr),{width:" 4px",height:"36px",maxHeight:"50%",boxSizing:"content-box",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 2:nr(this.dom,{bottom:"0px",width:"100%",height:"14px",cursor:"row-resize"}),nr(Pe(this,Mr),{width:" 42px",height:"4px",boxSizing:"content-box",maxWidth:"50%",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 3:nr(this.dom,{right:"-1px",bottom:"-2px",width:"30px",height:"30px",cursor:"nwse-resize",zIndex:"101"}),nr(Pe(this,Mr),{height:"22px",width:"22px",backgroundRepeat:"no-repeat",backgroundImage:`url("data:image/svg+xml,${CH}") `});break;case 4:nr(this.dom,{left:"-1px",bottom:"-2px",width:"30px",height:"30px",cursor:"nesw-resize",zIndex:"101"}),nr(Pe(this,Mr),{height:"22px",width:"22px",backgroundRepeat:"no-repeat",backgroundImage:`url("data:image/svg+xml,${EH}") `});break}this.dom.append(Pe(this,Mr))}setHandleVisibility(e){const t=e||!!Pe(this,Mr).dataset.dragging;Pe(this,Mr).style.opacity=t?"1":"0"}dataSetDragging(e){Pe(this,Mr).dataset.dragging=e?"true":""}};Mr=new WeakMap;var Vd=50,eC=(e=>(e[e.Fixed=0]="Fixed",e[e.Flexible=1]="Flexible",e))(eC||{}),xs,ws,Ss,Po,Es,TH=class{constructor({node:e,view:t,getPos:r,aspectRatio:n=0,options:o,initialSize:i}){Ha(this,xs,void 0),Ha(this,ws,void 0),Ha(this,Ss,[]),Ha(this,Po,void 0),Ha(this,Es,void 0);const s=this.createWrapper(e,i),a=this.createElement({node:e,view:t,getPos:r,options:o}),c=(n===1?[0,1,2,3,4]:[0,1]).map(f=>new MH(f));for(const f of c){const p=h=>{this.startResizing(h,t,r,f)};f.dom.addEventListener("mousedown",p),Pe(this,Ss).push(()=>f.dom.removeEventListener("mousedown",p)),s.append(f.dom)}const u=()=>{c.forEach(f=>f.setHandleVisibility(!0))},d=()=>{c.forEach(f=>f.setHandleVisibility(!1))};s.addEventListener("mouseover",u),s.addEventListener("mouseout",d),Pe(this,Ss).push(()=>s.removeEventListener("mouseover",u),()=>s.removeEventListener("mouseout",d)),s.append(a),this.dom=s,yi(this,ws,e),yi(this,xs,a),this.aspectRatio=n}createWrapper(e,t){const r=document.createElement("div");return r.classList.add("remirror-resizable-view"),r.style.position="relative",t?nr(r,{width:g2(t.width),aspectRatio:`${t.width} / ${t.height}`}):nr(r,{width:g2(e.attrs.width),aspectRatio:`${e.attrs.width} / ${e.attrs.height}`}),nr(r,{maxWidth:"100%",minWidth:`${Vd}px`,verticalAlign:"bottom",display:"inline-block",lineHeight:"0",transition:"width 0.15s ease-out, height 0.15s ease-out"}),r}startResizing(e,t,r,n){var o,i;e.preventDefault(),n.dataSetDragging(!0),Pe(this,xs).style.pointerEvents="none";const s=e.pageX,a=e.pageY,l=((o=Pe(this,xs))==null?void 0:o.getBoundingClientRect().width)||0,c=((i=Pe(this,xs))==null?void 0:i.getBoundingClientRect().height)||0,u=e1(100,!1,f=>{const p=f.pageX,h=f.pageY,m=p-s,b=h-a;let v=null,g=null;if(this.aspectRatio===0&&l&&c)switch(n.type){case 0:case 3:v=l+m,g=c/l*v;break;case 1:case 4:v=l-m,g=c/l*v;break;case 2:g=c+b,v=l/c*g;break}else if(this.aspectRatio===1)switch(n.type){case 0:v=l+m;break;case 1:v=l-m;break;case 2:g=c+b;break;case 3:v=l+m,g=c+b;break;case 4:v=l-m,g=c+b;break}typeof v=="number"&&v{f.preventDefault(),n.dataSetDragging(!1),n.setHandleVisibility(!1),Pe(this,xs).style.pointerEvents="auto",document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",d);const p=r(),h=t.state.tr.setNodeMarkup(p,void 0,{...Pe(this,ws).attrs,width:Pe(this,Po),height:Pe(this,Es)});t.dispatch(h)};document.addEventListener("mousemove",u),document.addEventListener("mouseup",d),Pe(this,Ss).push(()=>document.removeEventListener("mousemove",u)),Pe(this,Ss).push(()=>document.removeEventListener("mouseup",d))}update(e){return e.type!==Pe(this,ws).type||this.aspectRatio===0&&e.attrs.width&&e.attrs.width!==Pe(this,Po)||this.aspectRatio===1&&e.attrs.width&&e.attrs.height&&e.attrs.width!==Pe(this,Po)&&e.attrs.height!==Pe(this,Es)||!OH(Pe(this,ws),e,["width","height"])?!1:(yi(this,ws,e),yi(this,Po,e.attrs.width),yi(this,Es,e.attrs.height),!0)}destroy(){Pe(this,Ss).forEach(e=>e())}};xs=new WeakMap;ws=new WeakMap;Ss=new WeakMap;Po=new WeakMap;Es=new WeakMap;function OH(e,t,r){return e===t||_H(e,t,r)&&e.content.eq(t.content)}function _H(e,t,r){const n=e.attrs,o=t.attrs,i={};for(const a of r)i[a]=null;e.attrs={...n,...i},t.attrs={...o,...i};const s=e.sameMarkup(t);return e.attrs=n,t.attrs=o,s}function g2(e){return typeof e=="number"?`${e}px`:e||void 0}function O(){return O=Object.assign?Object.assign.bind():function(e){for(var t=1;t{for(var o=n>1?void 0:n?RH(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&AH(t,r,o),o};function PH(e,t,r,n){const o=e.docView.posFromDOM(t,r,n);return o===null||o<0?null:o}function NH(e,t){const r=t.target;if(r){const n=PH(e,r,0);if(n!==null){const o=e.state.doc.resolve(n),i=o.node().isLeaf?0:1,s=o.start()-i;return{pos:n,inside:s}}}return e.posAtCoords({left:t.clientX,top:t.clientY})??void 0}var vp=class extends Ge{constructor(){super(...arguments),this.mousedown=!1,this.mouseover=!1,this.createMouseEventHandler=e=>(t,r)=>{const n=r,o=NH(t,n);if(!o)return!1;const i=[],s=[],{inside:a,pos:l}=o;if(a===-1)return!1;const c=t.state.doc.resolve(l),u=c.depth+1;for(const d of ev(u,1))i.push({node:d>c.depth&&c.nodeAfter?c.nodeAfter:c.node(d),pos:c.before(d)});for(const{type:d}of c.marksAcross(c)??[]){const f=Yo(c,d);f&&s.push(f)}return e(n,{view:t,nodes:i,marks:s,getMark:d=>{const f=ne(d)?t.state.schema.marks[d]:d;return te(f,{code:$.EXTENSION,message:`The mark ${d} being checked does not exist within the editor schema.`}),s.find(p=>p.mark.type===f)},getNode:d=>{var f;const p=ne(d)?t.state.schema.nodes[d]:d;te(p,{code:$.EXTENSION,message:"The node being checked does not exist"});const h=i.find(({node:m})=>m.type===p);if(h)return{...h,isRoot:!!((f=i[0])!=null&&f.node.eq(h.node))}}})}}get name(){return"events"}onView(){var e,t;if(!((e=this.store.managerSettings.exclude)!=null&&e.clickHandler))for(const r of this.store.extensions){if(!r.createEventHandlers||(t=r.options.exclude)!=null&&t.clickHandler)continue;const n=r.createEventHandlers();for(const[o,i]of At(n))this.addHandler(o,i)}}createPlugin(){const e=new WeakMap,t=(r,n,o,i,s,a,l,c)=>{const u=this.store.currentState,{schema:d,doc:f}=u,p=f.resolve(i),h=e.has(l),m=zH({$pos:p,handled:h,view:o,state:u});let b=!1;h||(b=r(l,m)||b);const v={...m,pos:i,direct:c,nodeWithPosition:{node:s,pos:a},getNode:g=>{const y=ne(g)?d.nodes[g]:g;return te(y,{code:$.EXTENSION,message:"The node being checked does not exist"}),y===s.type?{node:s,pos:a}:void 0}};return e.set(l,!0),n(l,v)||b};return{props:{handleKeyPress:(r,n)=>this.options.keypress(n)||!1,handleKeyDown:(r,n)=>this.options.keydown(n)||!1,handleTextInput:(r,n,o,i)=>this.options.textInput({from:n,to:o,text:i})||!1,handleClickOn:(r,n,o,i,s,a)=>t(this.options.clickMark,this.options.click,r,n,o,i,s,a),handleDoubleClickOn:(r,n,o,i,s,a)=>t(this.options.doubleClickMark,this.options.doubleClick,r,n,o,i,s,a),handleTripleClickOn:(r,n,o,i,s,a)=>t(this.options.tripleClickMark,this.options.tripleClick,r,n,o,i,s,a),handleDOMEvents:{focus:(r,n)=>this.options.focus(n)||!1,blur:(r,n)=>this.options.blur(n)||!1,mousedown:(r,n)=>(this.startMouseover(),this.options.mousedown(n)||!1),mouseup:(r,n)=>(this.endMouseover(),this.options.mouseup(n)||!1),mouseleave:(r,n)=>(this.mouseover=!1,this.options.mouseleave(n)||!1),mouseenter:(r,n)=>(this.mouseover=!0,this.options.mouseenter(n)||!1),keyup:(r,n)=>this.options.keyup(n)||!1,mouseout:this.createMouseEventHandler((r,n)=>{const o={...n,hovering:!1};return this.options.hover(r,o)||!1}),mouseover:this.createMouseEventHandler((r,n)=>{const o={...n,hovering:!0};return this.options.hover(r,o)||!1}),contextmenu:this.createMouseEventHandler((r,n)=>this.options.contextmenu(r,n)||!1),scroll:(r,n)=>this.options.scroll(n)||!1,copy:(r,n)=>this.options.copy(n)||!1,cut:(r,n)=>this.options.cut(n)||!1,paste:(r,n)=>this.options.paste(n)||!1}},view:r=>{let n=r.editable;const o=this.options;return{update(i){const s=i.editable;s!==n&&(o.editable(s),n=s)}}}}}isInteracting(){return this.mousedown&&this.mouseover}startMouseover(){this.mouseover=!0,!this.mousedown&&(this.mousedown=!0,this.store.document.documentElement.addEventListener("mouseup",()=>{this.endMouseover()},{once:!0}))}endMouseover(){this.mousedown&&(this.mousedown=!1,this.store.commands.emptyUpdate())}};tC([je()],vp.prototype,"isInteracting",1);vp=tC([ye({handlerKeys:["blur","focus","mousedown","mouseup","mouseenter","mouseleave","textInput","keypress","keyup","keydown","click","clickMark","doubleClick","doubleClickMark","tripleClick","tripleClickMark","contextmenu","hover","scroll","copy","cut","paste","editable"],handlerKeyOptions:{blur:{earlyReturnValue:!0},focus:{earlyReturnValue:!0},mousedown:{earlyReturnValue:!0},mouseleave:{earlyReturnValue:!0},mouseup:{earlyReturnValue:!0},click:{earlyReturnValue:!0},doubleClick:{earlyReturnValue:!0},tripleClick:{earlyReturnValue:!0},hover:{earlyReturnValue:!0},contextmenu:{earlyReturnValue:!0},scroll:{earlyReturnValue:!0},copy:{earlyReturnValue:!0},cut:{earlyReturnValue:!0},paste:{earlyReturnValue:!0}},defaultPriority:De.High})],vp);function zH(e){const{handled:t,view:r,$pos:n,state:o}=e,i={getMark:gS,markRanges:[],view:r,state:o};if(t)return i;for(const{type:s}of n.marksAcross(n)??[]){const a=Yo(n,s);a&&i.markRanges.push(a)}return i.getMark=s=>{const a=ne(s)?o.schema.marks[s]:s;return te(a,{code:$.EXTENSION,message:`The mark ${s} being checked does not exist within the editor schema.`}),i.markRanges.find(l=>l.mark.type===a)},i}class pt extends be{constructor(t){super(t,t)}map(t,r){let n=t.resolve(r.map(this.head));return pt.valid(n)?new pt(n):be.near(n)}content(){return W.empty}eq(t){return t instanceof pt&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new pt(t.resolve(r.pos))}getBookmark(){return new ny(this.anchor)}static valid(t){let r=t.parent;if(r.isTextblock||!LH(t)||!IH(t))return!1;let n=r.type.spec.allowGapCursor;if(n!=null)return n;let o=r.contentMatchAt(t.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(t,r,n=!1){e:for(;;){if(!n&&pt.valid(t))return t;let o=t.pos,i=null;for(let s=t.depth;;s--){let a=t.node(s);if(r>0?t.indexAfter(s)0){i=a.child(r>0?t.indexAfter(s):t.index(s)-1);break}else if(s==0)return null;o+=r;let l=t.doc.resolve(o);if(pt.valid(l))return l}for(;;){let s=r>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!ce.isSelectable(i)){t=t.doc.resolve(o+i.nodeSize*r),n=!1;continue e}break}i=s,o+=r;let a=t.doc.resolve(o);if(pt.valid(a))return a}return null}}}pt.prototype.visible=!1;pt.findFrom=pt.findGapCursorFrom;be.jsonID("gapcursor",pt);class ny{constructor(t){this.pos=t}map(t){return new ny(t.map(this.pos))}resolve(t){let r=t.resolve(this.pos);return pt.valid(r)?new pt(r):be.near(r)}}function LH(e){for(let t=e.depth;t>=0;t--){let r=e.index(t),n=e.node(t);if(r==0){if(n.type.spec.isolating)return!0;continue}for(let o=n.child(r-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function IH(e){for(let t=e.depth;t>=0;t--){let r=e.indexAfter(t),n=e.node(t);if(r==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let o=n.child(r);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function DH(){return new Co({props:{decorations:FH,createSelectionBetween(e,t,r){return t.pos==r.pos&&pt.valid(r)?new pt(r):null},handleClick:HH,handleKeyDown:$H,handleDOMEvents:{beforeinput:BH}}})}const $H=Mv({ArrowLeft:jd("horiz",-1),ArrowRight:jd("horiz",1),ArrowUp:jd("vert",-1),ArrowDown:jd("vert",1)});function jd(e,t){const r=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(n,o,i){let s=n.selection,a=t>0?s.$to:s.$from,l=s.empty;if(s instanceof le){if(!i.endOfTextblock(r)||a.depth==0)return!1;l=!1,a=n.doc.resolve(t>0?a.after():a.before())}let c=pt.findGapCursorFrom(a,t,l);return c?(o&&o(n.tr.setSelection(new pt(c))),!0):!1}}function HH(e,t,r){if(!e||!e.editable)return!1;let n=e.state.doc.resolve(t);if(!pt.valid(n))return!1;let o=e.posAtCoords({left:r.clientX,top:r.clientY});return o&&o.inside>-1&&ce.isSelectable(e.state.doc.nodeAt(o.inside))?!1:(e.dispatch(e.state.tr.setSelection(new pt(n))),!0)}function BH(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof pt))return!1;let{$from:r}=e.state.selection,n=r.parent.contentMatchAt(r.index()).findWrapping(e.state.schema.nodes.text);if(!n)return!1;let o=P.empty;for(let s=n.length-1;s>=0;s--)o=P.from(n[s].createAndFill(null,o));let i=e.state.tr.replace(r.pos,r.pos,new W(o,0,0));return i.setSelection(le.near(i.doc.resolve(r.pos+1))),e.dispatch(i),!1}function FH(e){if(!(e.selection instanceof pt))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Ee.create(e.doc,[Ke.widget(e.selection.head,t,{key:"gapcursor"})])}var VH=Object.defineProperty,jH=Object.getOwnPropertyDescriptor,UH=(e,t,r,n)=>{for(var o=n>1?void 0:n?jH(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&VH(t,r,o),o},R1=class extends Ge{get name(){return"gapCursor"}createExternalPlugins(){return[DH()]}};R1=UH([ye({})],R1);var WH=Object.defineProperty,KH=Object.getOwnPropertyDescriptor,rC=(e,t,r,n)=>{for(var o=n>1?void 0:n?KH(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&WH(t,r,o),o},yp=class extends wr{get name(){return"hardBreak"}createTags(){return[ae.InlineNode]}createNodeSpec(e,t){return{inline:!0,selectable:!1,atom:!0,leafText:()=>` +`,...t,attrs:e.defaults(),parseDOM:[{tag:"br",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["br",e.dom(r)]}}createKeymap(){const e=VN(iu(i5),()=>(this.store.commands.insertHardBreak(),!0));return{"Mod-Enter":e,"Shift-Enter":e}}insertHardBreak(){return e=>{const{tr:t,dispatch:r}=e;return r==null||r(t.replaceSelectionWith(this.type.create()).scrollIntoView()),!0}}};rC([Y()],yp.prototype,"insertHardBreak",1);yp=rC([ye({defaultPriority:De.Low})],yp);var qH=Object.defineProperty,GH=Object.getOwnPropertyDescriptor,nC=(e,t,r,n)=>{for(var o=n>1?void 0:n?GH(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&qH(t,r,o),o},{LABEL:YH}=hR,JH={icon:({attrs:e})=>`h${(e==null?void 0:e.level)??"1"}`,label:({t:e,attrs:t})=>e({...YH,values:{level:t==null?void 0:t.level}})},XH=[j.H1,j.H2,j.H3,j.H4,j.H5,j.H6],bp=class extends wr{get name(){return"heading"}createTags(){return[ae.Block,ae.TextBlock,ae.FormattingNode]}createNodeSpec(e,t){return{content:"inline*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),level:{default:this.options.defaultLevel}},parseDOM:[...this.options.levels.map(r=>({tag:`h${r}`,getAttrs:n=>({...e.parse(n),level:r})})),...t.parseDOM??[]],toDOM:r=>this.options.levels.includes(r.attrs.level)?[`h${r.attrs.level}`,e.dom(r),0]:[`h${this.options.defaultLevel}`,e.dom(r),0]}}toggleHeading(e={}){return Ev({type:this.type,toggleType:"paragraph",attrs:e})}createKeymap(e){const t=this.store.getExtension(ke),r=ee(),n=[];for(const o of this.options.levels){const i=XH[o-1]??j.H1;r[i]=Tu(this.type,{level:o}),n.push({attrs:{level:o},shortcut:e(i)[0]})}return t.updateDecorated("toggleHeading",{shortcut:n}),r}createInputRules(){return this.options.levels.map(e=>$R(new RegExp(`^(#{1,${e}})\\s$`),this.type,()=>({level:e})))}createPasteRules(){return this.options.levels.map(e=>({type:"node",nodeType:this.type,regexp:new RegExp(`^#{${e}}\\s([\\s\\w]+)$`),getAttributes:()=>({level:e}),startOfTextBlock:!0}))}};nC([Y(JH)],bp.prototype,"toggleHeading",1);bp=nC([ye({defaultOptions:{levels:[1,2,3,4,5,6],defaultLevel:1},staticKeys:["defaultLevel","levels"]})],bp);var QH=Object.defineProperty,ZH=Object.getOwnPropertyDescriptor,ma=(e,t,r,n)=>{for(var o=n>1?void 0:n?ZH(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&QH(t,r,o),o},wo=class extends Ge{constructor(){super(...arguments),this.wrapMethod=(e,t)=>({state:r,dispatch:n,view:o})=>{const{getState:i,getDispatch:s}=this.options,a=Ne(i)?i():r,l=Ne(s)&&n?s():n,c=e(a,l,o);return t==null||t(c),c}}get name(){return"history"}createKeymap(){return{"Mod-y":Zr.isMac?()=>!1:this.wrapMethod(Vc,this.options.onRedo),"Mod-z":this.wrapMethod(_f,this.options.onUndo),"Shift-Mod-z":this.wrapMethod(Vc,this.options.onRedo)}}undoShortcut(e){return this.wrapMethod(_f,this.options.onUndo)(e)}redoShortcut(e){return this.wrapMethod(Vc,this.options.onRedo)(e)}createExternalPlugins(){const{depth:e,newGroupDelay:t}=this.options;return[yH({depth:e,newGroupDelay:t})]}undo(){return zx(this.wrapMethod(_f,this.options.onUndo))}redo(){return zx(this.wrapMethod(Vc,this.options.onRedo))}undoDepth(e=this.store.getState()){return A1(e)}redoDepth(e=this.store.getState()){return bH(e)}};ma([Et({shortcut:j.Undo,command:"undo"})],wo.prototype,"undoShortcut",1);ma([Et({shortcut:j.Redo,command:"redo"})],wo.prototype,"redoShortcut",1);ma([Y({disableChaining:!0,description:({t:e})=>e(np.UNDO_DESCRIPTION),label:({t:e})=>e(np.UNDO_LABEL),icon:"arrowGoBackFill"})],wo.prototype,"undo",1);ma([Y({disableChaining:!0,description:({t:e})=>e(np.REDO_DESCRIPTION),label:({t:e})=>e(np.REDO_LABEL),icon:"arrowGoForwardFill"})],wo.prototype,"redo",1);ma([je()],wo.prototype,"undoDepth",1);ma([je()],wo.prototype,"redoDepth",1);wo=ma([ye({defaultOptions:{depth:100,newGroupDelay:500,getDispatch:void 0,getState:void 0},staticKeys:["depth","newGroupDelay"],handlerKeys:["onUndo","onRedo"]})],wo);var eB=Object.defineProperty,tB=Object.getOwnPropertyDescriptor,oC=(e,t,r,n)=>{for(var o=n>1?void 0:n?tB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&eB(t,r,o),o},rB={icon:"separator",label:({t:e})=>e(Uk.LABEL),description:({t:e})=>e(Uk.DESCRIPTION)},kp=class extends wr{get name(){return"horizontalRule"}createTags(){return[ae.Block]}createNodeSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"hr",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["hr",e.dom(r)]}}insertHorizontalRule(){return e=>{const{tr:t,dispatch:r}=e,n=t.selection.$anchor,o=n.parent;return o.type.name==="doc"||o.isAtom||o.isLeaf?!1:(r&&(t.selection.empty&&bh(o)&&t.insert(n.pos+1,o),t.replaceSelectionWith(this.type.create()),this.updateFromNodeSelection(t),r(t.scrollIntoView())),!0)}}createInputRules(){return[ZE({regexp:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type,beforeDispatch:({tr:e})=>{this.updateFromNodeSelection(e)}})]}updateFromNodeSelection(e){if(!kd(e.selection)||e.selection.node.type.name!==this.name)return;const t=e.selection.$from.pos+1,{insertionNode:r}=this.options;if(!r)return;const n=this.store.schema.nodes[r];te(n,{code:$.EXTENSION,message:`'${r}' node provided as the insertionNode to the '${this.constructorName}' does not exist.`});const o=n.create();e.insert(t,o),e.setSelection(le.near(e.doc.resolve(t+1)))}};oC([Y(rB)],kp.prototype,"insertHorizontalRule",1);kp=oC([ye({defaultOptions:{insertionNode:"paragraph"}})],kp);var nB=Object.defineProperty,oB=Object.getOwnPropertyDescriptor,oy=(e,t,r,n)=>{for(var o=n>1?void 0:n?oB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&nB(t,r,o),o},iB=class extends TH{constructor(e,t,r){super({node:e,view:t,getPos:r,aspectRatio:eC.Fixed})}createElement({node:e}){const t=document.createElement("img");return t.setAttribute("src",e.attrs.src),nr(t,{width:"100%",minWidth:"50px",objectFit:"contain"}),t}},Nu=class extends wr{get name(){return"image"}createTags(){return[ae.InlineNode,ae.Media]}createNodeSpec(e,t){const{preferPastedTextContent:r}=this.options;return{inline:!0,draggable:!0,selectable:!1,...t,attrs:{...e.defaults(),alt:{default:""},crop:{default:null},height:{default:null},width:{default:null},rotate:{default:null},src:{default:null},title:{default:""},fileName:{default:null},resizable:{default:!1}},parseDOM:[{tag:"img[src]",getAttrs:n=>{var o;if(gt(n)){const i=aB({element:n,parse:e.parse});return r&&((o=i.src)!=null&&o.startsWith("file:///"))?!1:i}return{}}},...t.parseDOM??[]],toDOM:n=>{const o=Sv(n.attrs,e);return["img",{...e.dom(n),...o}]}}}insertImage(e,t){return({tr:r,dispatch:n})=>{const{from:o,to:i}=Cn(t??r.selection,r.doc),s=this.type.create(e);return n==null||n(r.replaceRangeWith(o,i,s)),!0}}uploadImage(e,t){const{updatePlaceholder:r,destroyPlaceholder:n,createPlaceholder:o}=this.options;return i=>{const{tr:s}=i;let a=s.selection.from;return this.store.createPlaceholderCommand({promise:e,placeholder:{type:"widget",get pos(){return a},createElement:(l,c)=>{const u=o(l,c);return t==null||t(u),u},onUpdate:(l,c,u,d)=>{r(l,c,u,d)},onDestroy:(l,c)=>{n(l,c)}},onSuccess:(l,c,u)=>this.insertImage(l,c)(u)}).validate(({tr:l,dispatch:c})=>{const u=jS(l.doc,a,this.type);return u==null?!1:(a=u,l.selection.empty||c==null||c(l.deleteSelection()),!0)},"unshift").generateCommand()(i)}}fileUploadFileHandler(e,t,r){var n;const{preferPastedTextContent:o,uploadHandler:i}=this.options;if(o&&uB(t)&&((n=t.clipboardData)!=null&&n.getData("text/plain")))return!1;const{commands:s,chain:a}=this.store,l=e.map((u,d)=>({file:u,progress:f=>{s.updatePlaceholder(c[d],f)}})),c=i(l);sn(r)&&a.selectText(r);for(const u of c)a.uploadImage(u);return a.run(),!0}createPasteRules(){return[{type:"file",regexp:/image/i,fileHandler:e=>{const t=e.type==="drop"?e.pos:void 0;return this.fileUploadFileHandler(e.files,e.event,t)}}]}createNodeViews(){return this.options.enableResizing?(e,t,r)=>new iB(e,t,r):{}}};oy([Y()],Nu.prototype,"insertImage",1);oy([Y()],Nu.prototype,"uploadImage",1);Nu=oy([ye({defaultOptions:{createPlaceholder:lB,updatePlaceholder:()=>{},destroyPlaceholder:()=>{},uploadHandler:cB,enableResizing:!1,preferPastedTextContent:!0}})],Nu);function sB(e){let{width:t,height:r}=e.style;return t=t||e.getAttribute("width")||"",r=r||e.getAttribute("height")||"",{width:t,height:r}}function aB({element:e,parse:t}){const{width:r,height:n}=sB(e);return{...t(e),alt:e.getAttribute("alt")??"",height:Number.parseInt(n||"0",10)||null,src:e.getAttribute("src")??null,title:e.getAttribute("title")??"",width:Number.parseInt(r||"0",10)||null,fileName:e.getAttribute("data-file-name")??null}}function lB(e,t){const r=document.createElement("div");return r.classList.add(WL.IMAGE_LOADER),r}function cB(e){te(e.length>0,{code:$.EXTENSION,message:"The upload handler was applied for the image extension without any valid files"});let t=0;const r=[];for(const{file:n,progress:o}of e)r.push(()=>new Promise(i=>{const s=new FileReader;s.addEventListener("load",a=>{var l;t+=1,o(t/e.length),i({src:(l=a.target)==null?void 0:l.result,fileName:n.name})},{once:!0}),s.readAsDataURL(n)}));return r}function uB(e){return e.clipboardData!==void 0}var dB=Object.defineProperty,fB=Object.getOwnPropertyDescriptor,iy=(e,t,r,n)=>{for(var o=n>1?void 0:n?fB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&dB(t,r,o),o},pB={icon:"italic",label:({t:e})=>e(Wk.LABEL),description:({t:e})=>e(Wk.DESCRIPTION)},zu=class extends pa{get name(){return"italic"}createTags(){return[ae.FontStyle,ae.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"i",getAttrs:e.parse},{tag:"em",getAttrs:e.parse},{style:"font-style=italic"},...t.parseDOM??[]],toDOM:r=>["em",e.dom(r),0]}}createKeymap(){return{"Mod-i":Ji({type:this.type})}}createInputRules(){return[Ou({regexp:/(?:^|[^*])\*([^*]+)\*$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:e,start:t})=>e.startsWith("*")?{}:{fullMatch:e.slice(1),start:t+1}}),Ou({regexp:/(?:^|\W)_([^_]+)_$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:e,start:t})=>e.startsWith("_")?{}:{fullMatch:e.slice(1),start:t+1}})]}createPasteRules(){return[{type:"mark",markType:this.type,regexp:/(?:^|\W)_([^_]+)_/g},{type:"mark",markType:this.type,regexp:/\*([^*]+)\*/g}]}toggleItalic(e){return Ji({type:this.type,selection:e})}shortcut(e){return this.toggleItalic()(e)}};iy([Y(pB)],zu.prototype,"toggleItalic",1);iy([Et({shortcut:j.Italic,command:"toggleItalic"})],zu.prototype,"shortcut",1);zu=iy([ye({})],zu);var iC={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(typeof self<"u"?self:bu,function(){return function(r){function n(i){if(o[i])return o[i].exports;var s=o[i]={i,l:!1,exports:{}};return r[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}var o={};return n.m=r,n.c=o,n.d=function(i,s,a){n.o(i,s)||Object.defineProperty(i,s,{configurable:!1,enumerable:!0,get:a})},n.n=function(i){var s=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(s,"a",s),s},n.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)},n.p="",n(n.s=0)}([function(r,n,o){function i(){throw new TypeError("The given URL is not a string. Please verify your string|array.")}function s(c){typeof c!="string"&&i();for(var u=0,d=0,f=0,p=c.length,h=0;p--&&++h&&!(u&&-1f?"":c.slice(f,u)}var a=["/",":","?","#"],l=[".","/","@"];r.exports=function(c){if(typeof c=="string")return s(c);if(Array.isArray(c)){var u=[],d,f=0;for(d=c.length;f{for(var o=n>1?void 0:n?vB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&gB(t,r,o),o},yB=["com","de","net","org","uk","cn","ga","nl","cf","ml","tk","ru","br","gq","xyz","fr","eu","info","co","au","ca","it","in","ch","pl","es","online","us","top","be","jp","biz","se","at","dk","cz","za","me","ir","icu","shop","kr","site","mx","hu","io","cc","club","no","cyou"],v2="updateLink",bB=/(?:(?:(?:https?|ftp):)?\/\/)?(?:\S+(?::\S*)?@)?(?:(?:[\da-z\u00A1-\uFFFF][\w\u00A1-\uFFFF-]{0,62})?[\da-z\u00A1-\uFFFF]\.)*(?:(?:\d(?!\.)|[a-z\u00A1-\uFFFF])(?:[\da-z\u00A1-\uFFFF][\w\u00A1-\uFFFF-]{0,62})?[\da-z\u00A1-\uFFFF]\.)+[a-z\u00A1-\uFFFF]{2,}(?::\d{2,5})?(?:[#/?]\S*)?/gi,Qi=class extends pa{constructor(){super(...arguments),this._autoLinkRegexNonGlobal=void 0}get name(){return"link"}createTags(){return[ae.Link,ae.ExcludeInputRules]}createMarkSpec(e,t){const r="data-link-auto",n=o=>{const{defaultTarget:i,supportedTargets:s}=this.options,a=i?[...s,i]:s;return o&&vr(a,o)?{target:o}:void 0};return{inclusive:!1,excludes:"_",...t,attrs:{...e.defaults(),href:{},target:{default:this.options.defaultTarget},auto:{default:!1}},parseDOM:[{tag:"a[href]",getAttrs:o=>{if(!gt(o))return!1;const i=o.getAttribute("href"),s=o.textContent,a=this.options.autoLink&&(o.hasAttribute(r)||i===s||(i==null?void 0:i.replace(`${this.options.defaultProtocol}//`,""))===s);return{...e.parse(o),href:i,auto:a,...n(o.getAttribute("target"))}}},...t.parseDOM??[]],toDOM:o=>{const{auto:i,target:s,...a}=Sv(o.attrs,e),l=o.attrs.auto?{[r]:""}:{},c="noopener noreferrer nofollow";return["a",{...e.dom(o),...a,rel:c,...l,...n(o.attrs.target)},0]}}}onCreate(){const{autoLinkRegex:e}=this.options;this._autoLinkRegexNonGlobal=new RegExp(`^${e.source}$`,e.flags.replace("g",""))}shortcut({tr:e}){let t="",{from:r,to:n,empty:o,$from:i}=e.selection,s=!1;const a=Yo(i,this.type);if(o){const l=a??WE(e);if(!l)return!1;({text:t,from:r,to:n}=l),s=!0}return r===n?!1:(s||(t=e.doc.textBetween(r,n)),this.options.onActivateLink(t),this.options.onShortcut({activeLink:a?{attrs:a.mark.attrs,from:a.from,to:a.to}:void 0,selectedText:t,from:r,to:n}),!0)}updateLink(e,t){return r=>{const{tr:n}=r;return!(ls(n.selection)&&!bv(n.selection)||i6(n.selection)||dp({trState:n,type:this.type}))&&!t?!1:(n.setMeta(this.name,{command:v2,attrs:e,range:t}),M6({type:this.type,attrs:e,range:t})(r))}}selectLink(){return this.store.commands.selectMark.original(this.type)}removeLink(e){return t=>{const{tr:r}=t;return dp({trState:r,type:this.type,...e})?QE({type:this.type,expand:!0,range:e})(t):!1}}createPasteRules(){return[{type:"mark",regexp:this.options.autoLinkRegex,markType:this.type,getAttributes:(e,t)=>({href:this.buildHref(il(e)),auto:!t}),transformMatch:e=>{const t=il(e);return!t||!this.isValidUrl(t)?!1:t}}]}createEventHandlers(){return{clickMark:(e,t)=>{const r=t.getMark(this.type);if(!r)return;const n=r.mark.attrs,o={...n,...r};if(this.options.onClick(e,o))return!0;if(!this.store.view.editable)return;let i=!1;if(this.options.openLinkOnClick){i=!0;const s=n.href;window.open(s,"_blank")}return this.options.selectTextOnClick&&(i=!0,this.store.commands.selectText(r)),i}}}createPlugin(){return{appendTransaction:(e,t,r)=>{if(e.filter(p=>!!p.getMeta(this.name)).forEach(p=>{const h=p.getMeta(this.name);if(h.command===v2){const{range:m,attrs:b}=h,{selection:v,doc:g}=r,y={range:m,selection:v,doc:g,attrs:b},{from:k,to:x}=m??v;this.options.onUpdateLink(g.textBetween(k,x),y)}}),!this.options.autoLink||A1(t)-A1(r)===1||!e.some(p=>p.docChanged))return;const s=UN(e,t),a=UE(s,[vt,Dt]),{mapping:l}=s,{tr:c,doc:u}=r,{updateLink:d,removeLink:f}=this.store.chain(c);if(a.forEach(({prevFrom:p,prevTo:h,from:m,to:b})=>{const v=[],g=b-m===2,y=this.getLinkMarksInRange(t.doc,p,h,!0).filter(k=>k.mark.type===this.type).map(({from:k,to:x,text:w})=>({mappedFrom:l.map(k),mappedTo:l.map(x),text:w,from:k,to:x}));y.forEach(({mappedFrom:k,mappedTo:x,from:w,to:E},M)=>this.getLinkMarksInRange(u,k,x,!0).filter(C=>C.mark.type===this.type).forEach(C=>{const T=t.doc.textBetween(w,E,void 0," "),R=u.textBetween(C.from,C.to+1,void 0," ").trim(),B=this.isValidUrl(T);this.isValidUrl(R)||(B&&(f({from:C.from,to:C.to}).tr(),y.splice(M,1)),!g&&m===b&&this.findAutoLinks(R).map(F=>this.addLinkProperties({...F,from:k+F.start,to:k+F.end})).forEach(({attrs:F,range:V,text:z})=>{d(F,V).tr(),v.push({attrs:F,range:V,text:z})}))})),this.findTextBlocksInRange(u,{from:m,to:b}).forEach(({text:k,positionStart:x})=>{this.findAutoLinks(k).map(w=>this.addLinkProperties({...w,from:x+w.start+1,to:x+w.end+1})).filter(({range:w})=>{const E=m>=w.from&&m<=w.to,M=b>=w.from&&b<=w.to;return E||M||g}).filter(({range:w})=>this.getLinkMarksInRange(c.doc,w.from,w.to,!1).length===0).filter(({range:{from:w},text:E})=>!y.some(({text:M,mappedFrom:C})=>C===w&&M===E)).forEach(({attrs:w,text:E,range:M})=>{d(w,M).tr(),v.push({attrs:w,range:M,text:E})})}),window.requestAnimationFrame(()=>{v.forEach(({attrs:k,range:x,text:w})=>{const{doc:E,selection:M}=c;this.options.onUpdateLink(w,{attrs:k,doc:E,range:x,selection:M})})})}),c.steps.length!==0)return c}}}buildHref(e){return this.options.extractHref({url:e,defaultProtocol:this.options.defaultProtocol})}getLinkMarksInRange(e,t,r,n){const o=[];if(t===r){const i=Math.max(t-1,0),s=e.resolve(i),a=Yo(s,this.type);(a==null?void 0:a.mark.attrs.auto)===n&&o.push(a)}else e.nodesBetween(t,r,(i,s)=>{const l=(i.marks??[]).find(({type:c,attrs:u})=>c===this.type&&u.auto===n);l&&o.push({from:s,to:s+i.nodeSize,mark:l,text:i.textContent})});return o}findTextBlocksInRange(e,t){const r=[];return e.nodesBetween(t.from,t.to,(n,o)=>{!n.isTextblock||!n.type.allowsMarkType(this.type)||r.push({node:n,pos:o})}),r.map(n=>({text:e.textBetween(n.pos,n.pos+n.node.nodeSize,void 0," "),positionStart:n.pos}))}addLinkProperties({from:e,to:t,href:r,...n}){return{...n,range:{from:e,to:t},attrs:{href:r,auto:!0}}}findAutoLinks(e){if(this.options.findAutoLinks)return this.options.findAutoLinks(e,this.options.defaultProtocol);const t=[];for(const r of Ul(e,this.options.autoLinkRegex)){const n=il(r);if(!n)continue;const o=this.buildHref(n);!this.isValidTLD(o)&&!o.startsWith("tel:")||t.push({text:n,href:o,start:r.index,end:r.index+n.length})}return t}isValidUrl(e){var t;return this.options.isValidUrl?this.options.isValidUrl(e,this.options.defaultProtocol):this.isValidTLD(this.buildHref(e))&&!!((t=this._autoLinkRegexNonGlobal)!=null&&t.test(e))}isValidTLD(e){const{autoLinkAllowedTLDs:t}=this.options;if(t.length===0)return!0;const r=mB(e);if(r==="")return!0;const n=k_(r.split("."));return t.includes(n)}};Cd([Et({shortcut:j.InsertLink})],Qi.prototype,"shortcut",1);Cd([Y()],Qi.prototype,"updateLink",1);Cd([Y()],Qi.prototype,"selectLink",1);Cd([Y()],Qi.prototype,"removeLink",1);Qi=Cd([ye({defaultOptions:{autoLink:!1,defaultProtocol:"",selectTextOnClick:!1,openLinkOnClick:!1,autoLinkRegex:bB,autoLinkAllowedTLDs:yB,findAutoLinks:void 0,isValidUrl:void 0,defaultTarget:null,supportedTargets:[],extractHref:kB},staticKeys:["autoLinkRegex"],handlerKeyOptions:{onClick:{earlyReturnValue:!0}},handlerKeys:["onActivateLink","onShortcut","onUpdateLink","onClick"],defaultPriority:De.Medium})],Qi);function kB({url:e,defaultProtocol:t}){const r=/^((?:https?|ftp)?:)\/\//.test(e);return!r&&e.includes("@")?`mailto:${e}`:r?e:`${t}//${e}`}function xB(e,t=null){return function(r,n){let{$from:o,$to:i}=r.selection,s=o.blockRange(i),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(e)&&s.startIndex==0){if(o.index(s.depth-1)==0)return!1;let u=r.doc.resolve(s.start-2);l=new Gs(u,u,s.depth),s.endIndex=0;u--)i=P.from(r[u].type.create(r[u].attrs,i));e.step(new vt(t.start-(n?2:0),t.end,t.start,t.end,new W(i,0,0),r.length,!0));let s=0;for(let u=0;us.childCount>0&&s.firstChild.type==e);return i?r?n.node(i.depth-1).type==e?EB(t,r,e,i):CB(t,r,i):!0:!1}}function EB(e,t,r,n){let o=e.tr,i=n.end,s=n.$to.end(n.depth);im;h--)p-=o.child(h).nodeSize,n.delete(p-1,p+1);let i=n.doc.resolve(r.start),s=i.nodeAfter;if(n.mapping.map(r.end)!=r.start+i.nodeAfter.nodeSize)return!1;let a=r.startIndex==0,l=r.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?P.empty:P.from(o))))return!1;let d=i.pos,f=d+s.nodeSize;return n.step(new vt(d-(a?1:0),f+(l?1:0),d+1,f-1,new W((a?P.empty:P.from(o.copy(P.empty))).append(l?P.empty:P.from(o.copy(P.empty))),a?0:1,l?0:1),a?0:1)),t(n.scrollIntoView()),!0}var MB=Object.defineProperty,TB=Object.getOwnPropertyDescriptor,Pn=(e,t,r,n)=>{for(var o=n>1?void 0:n?TB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&MB(t,r,o),o};function P1(e){var t;return!!((t=e.spec.group)!=null&&t.includes(ae.ListContainerNode))}function OB(e){var t;return!!((t=e.spec.group)!=null&&t.includes(ae.ListItemNode))}function Zi(e){return P1(e.type)}function Ii(e){return OB(e.type)}function sy(e,t){return r=>{const{dispatch:n,tr:o}=r,i=yv(o,r.state),{$from:s,$to:a}=o.selection,l=s.blockRange(a);if(!l)return!1;const c=yd({predicate:u=>P1(u.type),selection:o.selection});if(c&&l.depth-c.depth<=1&&l.startIndex===0){if(c.node.type===e)return lC(t)(r);if(P1(c.node.type))return e.validContent(c.node.content)?(n==null||n(o.setNodeMarkup(c.pos,e)),!0):_B(o,c,e,t)?(n==null||n(o.scrollIntoView()),!0):!1}return xB(e)(i,n)}}function sC(e,t=["checked"]){return function({tr:r,dispatch:n,state:o}){var i,s;const a=t6(e,o.schema),{$from:l,$to:c}=r.selection;if(kd(r.selection)&&r.selection.node.isBlock||l.depth<2||!l.sameParent(c))return!1;const u=l.node(-1);if(u.type!==a)return!1;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(n){const m=l.index(-1)>0;let b=P.empty;for(let y=l.depth-(m?1:2);y>=l.depth-3;y--)b=P.from(l.node(y).copy(b));const v=((i=a.contentMatch.defaultType)==null?void 0:i.createAndFill())||void 0;b=b.append(P.from(a.createAndFill(null,v)||void 0));const g=l.indexAfter(-1)!t.includes(m))),f=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,p={...l.node().attrs};r.delete(l.pos,c.pos);const h=f?[{type:a,attrs:d},{type:f,attrs:p}]:[{type:a,attrs:d}];return rl(r.doc,l.pos,2)?(n&&n(r.split(l.pos,2,h).scrollIntoView()),!0):!1}}function _B(e,t,r,n){const o=t.node,i=e.doc.resolve(t.start),s=i.node(-1),a=i.index(-1);if(!s||!s.canReplace(a,a+1,P.from(r.create())))return!1;const l=[];for(let p=0;pb;m--)h-=o.child(m).nodeSize,n.delete(h-1,h+1);const s=n.doc.resolve(r.start),a=s.nodeAfter;if(!a||n.mapping.slice(i).map(r.end)!==r.start+a.nodeSize)return!1;const l=r.startIndex===0,c=r.endIndex===o.childCount,u=s.node(-1),d=s.index(-1);if(!u.canReplace(d+(l?0:1),d+1,a.content.append(c?P.empty:P.from(o))))return!1;const f=s.pos,p=f+a.nodeSize;return n.step(new vt(f-(l?1:0),p+(c?1:0),f+1,p-1,new W((l?P.empty:P.from(o.copy(P.empty))).append(c?P.empty:P.from(o.copy(P.empty))),l?0:1,c?0:1),l?0:1)),t(n.scrollIntoView()),!0}function aC(e,t){const r=t||e.selection.$from;let n=[],o,i,s,a;for(let c=r.depth;c>=0;c--){if(i=r.node(c),o=r.index(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&Zi(s)){const u=r.before(c+1);n.push(u)}if(o=r.indexAfter(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&Zi(s)){const u=r.after(c+1);n.push(u)}}n=[...new Set(n)].sort((c,u)=>u-c);let l=!1;for(const c of n)md(e.doc,c)&&(e.join(c),l=!0);return l}function lC(e){return t=>{const{dispatch:r,tr:n}=t,o=yv(n,t.state),i=PB(e,n.selection);return i?(r&&RB(o,r,i),!0):!1}}function PB(e,t){const{$from:r,$to:n}=t;return r.blockRange(n,i=>{var s;return((s=i.firstChild)==null?void 0:s.type)===e})}function xp(e){const{$from:t,$to:r}=e;return t.blockRange(r,Zi)}function NB(e){const t=e.selection.$from,r=t.blockRange();if(!r||!Ii(r.parent)||r.startIndex!==0)return!1;const n=t.node(r.depth-2),o=t.index(r.depth),i=t.index(r.depth-1),s=t.index(r.depth-2),a=n.maybeChild(s-1),l=a==null?void 0:a.lastChild;if(o!==0||i!==0)return!1;if(a&&Zi(a)&&l&&Ii(l))return Tl({listType:a.type,itemType:l.type,tr:e});if(Ii(n)){const c=n,u=t.node(r.depth-3);if(Zi(u))return Tl({listType:u.type,itemType:c.type,tr:e})}return!1}function y2({view:e}){if(!e)return!1;{const t=e.state.selection.$cursor;if(!t||t.parentOffset>0)return!1;const r=t.blockRange();if(!r||!Ii(r.parent)||r.startIndex!==0)return!1}{const t=e.state.tr;NB(t)&&e.dispatch(t)}{const t=e.state.selection.$cursor;if(!t||t.parentOffset>0)return!1;const r=t.blockRange();if(!r||!Ii(r.parent)||r.startIndex!==0)return!1;const n=t.index(r.depth),o=t.index(r.depth-1),i=t.index(r.depth-2),s=r.depth-2>=1&&Ii(t.node(r.depth-2));n===0&&o===0&&i<=1&&s&&SB(r.parent.type)(e.state,e.dispatch)}return r5(e.state,e.dispatch,e),!0}function cC({node:e,mark:t,updateDOM:r,updateMark:n}){const o=document.createElement("label");o.contentEditable="false",o.classList.add(Xi.LIST_ITEM_MARKER_CONTAINER),o.append(t);const i=document.createElement("div"),s=document.createElement("li");s.classList.add(Xi.LIST_ITEM_WITH_CUSTOM_MARKER),s.append(o),s.append(i);const a=l=>l.type!==e.type?!1:(e=l,r(e,s),n(e,t),!0);return a(e),{dom:s,contentDOM:i,update:a}}function zB(e,t){const r=e.node(t.depth-1),n=e.node(t.depth-2);return!Ii(r)||!Zi(n)?!1:{parentItem:r,parentList:n}}function LB(e,t){const r=t.parent,n=t.parent.child(t.endIndex-1),o=t.end,i=t.$to.end(t.depth);return o$B(e)?(t==null||t(e.scrollIntoView()),!0):!1;function BB(e,t,r){let n,o,i,s;const a=t.doc;if(r.startIndex>=1){n=e.child(r.startIndex-1),o=e,s=a.resolve(r.start).start(r.depth),i=s+1;for(let l=0;l=1){const c=t.node(r.depth-1),u=t.start(r.depth-1);if(o=c.child(l-1),!Zi(o))return!1;s=u+1;for(let d=0;d=r.depth+2?t.end(r.depth+2):r.end-1,a=r.end;return s+1>=a?(n=e.slice(i,a),o=null):(n=e.slice(i,s),o=e.slice(s+1,a-1)),{selectedSlice:n,unselectedSlice:o}}function VB(e){const{$from:t,$to:r}=e.selection,n=xp(e.selection);if(!n)return!1;const o=e.doc.resolve(n.start).node();if(!Zi(o))return!1;const i=BB(o,t,n);if(!i)return!1;const{previousItem:s,previousList:a,previousItemStart:l}=i,{selectedSlice:c,unselectedSlice:u}=FB(e.doc,r,n),d=s.content.append(P.fromArray([o.copy(c.content)])).append(u?u.content:P.empty);e.deleteRange(n.start,n.end);const f=l+s.nodeSize-2,p=s.copy(d);return p.check(),e.replaceRangeWith(l-1,f+1,p),e.setSelection(a===o?le.between(e.doc.resolve(t.pos),e.doc.resolve(r.pos)):le.between(e.doc.resolve(t.pos-2),e.doc.resolve(r.pos-2))),!0}var jB=({tr:e,dispatch:t})=>VB(e)?(t==null||t(e.scrollIntoView()),!0):!1,uC=class extends Ge{get name(){return"listItemShared"}createKeymap(){const e={Tab:jB,"Shift-Tab":HB,Backspace:y2,"Mod-Backspace":y2};if(Zr.isMac){const t={"Ctrl-h":e.Backspace,"Alt-Backspace":e["Mod-Backspace"]};return{...e,...t}}return e}createPlugin(){return{appendTransaction:(e,t,r)=>{const n=r.tr;return aC(n)?n:null}}}},Zs=class extends wr{get name(){return"listItem"}createTags(){return[ae.ListItemNode]}createNodeSpec(e,t){return{content:"paragraph block*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),closed:{default:!1},nested:{default:!1}},parseDOM:[{tag:"li",getAttrs:e.parse,priority:De.Lowest},...t.parseDOM??[]],toDOM:r=>["li",e.dom(r),0]}}createNodeViews(){return this.options.enableCollapsible?(e,t,r)=>{const n=document.createElement("div");return n.classList.add(Xi.COLLAPSIBLE_LIST_ITEM_BUTTON),n.contentEditable="false",n.addEventListener("click",()=>{if(n.classList.contains("disabled"))return;const o=r(),i=ce.create(t.state.doc,o);return t.dispatch(t.state.tr.setSelection(i)),this.store.commands.toggleListItemClosed(),!0}),cC({mark:n,node:e,updateDOM:UB,updateMark:WB})}:{}}createKeymap(){return{Enter:sC(this.type)}}createExtensions(){return[new uC]}toggleListItemClosed(e){return({state:{tr:t,selection:r},dispatch:n})=>{if(!kd(r)||r.node.type.name!==this.name)return!1;const{node:o,from:i}=r;return e=t1(e)?e:!o.attrs.closed,n==null||n(t.setNodeMarkup(i,void 0,{...o.attrs,closed:e})),!0}}liftListItemOutOfList(e){return lC(e??this.type)}};Pn([Y()],Zs.prototype,"toggleListItemClosed",1);Pn([Y()],Zs.prototype,"liftListItemOutOfList",1);Zs=Pn([ye({defaultOptions:{enableCollapsible:!1},staticKeys:["enableCollapsible"]})],Zs);function UB(e,t){e.attrs.closed?t.classList.add(Xi.COLLAPSIBLE_LIST_ITEM_CLOSED):t.classList.remove(Xi.COLLAPSIBLE_LIST_ITEM_CLOSED)}function WB(e,t){e.childCount<=1?t.classList.add("disabled"):t.classList.remove("disabled")}var Lu=class extends wr{get name(){return"bulletList"}createTags(){return[ae.Block,ae.ListContainerNode]}createNodeSpec(e,t){return{content:"listItem+",...t,attrs:e.defaults(),parseDOM:[{tag:"ul",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["ul",e.dom(r),0]}}createNodeViews(){return this.options.enableSpine?(e,t,r)=>{var n;const o=document.createElement("div");o.style.position="relative";const i=r(),s=t.state.doc.resolve(i+1),a=s.node(s.depth-1);if(!(((n=a==null?void 0:a.type)==null?void 0:n.name)!=="listItem")){const u=document.createElement("div");u.contentEditable="false",u.classList.add(Xi.LIST_SPINE),u.addEventListener("click",d=>{const f=r(),p=t.state.doc.resolve(f+1),h=p.start(p.depth-1),m=ce.create(t.state.doc,h-1);t.dispatch(t.state.tr.setSelection(m)),this.store.commands.toggleListItemClosed(),d.preventDefault(),d.stopPropagation()}),o.append(u)}const c=document.createElement("ul");return c.classList.add(Xi.UL_LIST_CONTENT),o.append(c),{dom:o,contentDOM:c}}:{}}createExtensions(){return[new Zs({priority:De.Low,enableCollapsible:this.options.enableSpine})]}toggleBulletList(){return sy(this.type,nt(this.store.schema.nodes,"listItem"))}listShortcut(e){return this.toggleBulletList()(e)}createInputRules(){const e=/^\s*([*+-])\s$/;return[ph(e,this.type),new fa(e,(t,r,n,o)=>{const i=t.tr;return i.deleteRange(n,o),Tl({listType:this.type,itemType:nt(this.store.schema.nodes,"listItem"),tr:i})?i:null})]}};Pn([Y({icon:"listUnordered",label:({t:e})=>e(av.BULLET_LIST_LABEL)})],Lu.prototype,"toggleBulletList",1);Pn([Et({shortcut:j.BulletList,command:"toggleBulletList"})],Lu.prototype,"listShortcut",1);Lu=Pn([ye({defaultOptions:{enableSpine:!1},staticKeys:["enableSpine"]})],Lu);var Iu=class extends wr{get name(){return"orderedList"}createTags(){return[ae.Block,ae.ListContainerNode]}createNodeSpec(e,t){return{content:"listItem+",...t,attrs:{...e.defaults(),order:{default:1}},parseDOM:[{tag:"ol",getAttrs:r=>gt(r)?{...e.parse(r),order:+(r.getAttribute("start")??1)}:{}},...t.parseDOM??[]],toDOM:r=>{const n=e.dom(r);return r.attrs.order===1?["ol",n,0]:["ol",{...n,start:r.attrs.order},0]}}}createExtensions(){return[new Zs({priority:De.Low})]}toggleOrderedList(){return sy(this.type,nt(this.store.schema.nodes,"listItem"))}listShortcut(e){return this.toggleOrderedList()(e)}createInputRules(){const e=/^(\d+)\.\s$/;return[ph(e,this.type,t=>({order:+nt(t,1)}),(t,r)=>r.childCount+r.attrs.order===+nt(t,1)),new fa(e,(t,r,n,o)=>{const i=t.tr;if(i.deleteRange(n,o),!Tl({listType:this.type,itemType:nt(this.store.schema.nodes,"listItem"),tr:i}))return null;const a=+nt(r,1);if(a!==1){const l=Gi({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{order:a})}return i})]}};Pn([Y({icon:"listOrdered",label:({t:e})=>e(av.ORDERED_LIST_LABEL)})],Iu.prototype,"toggleOrderedList",1);Pn([Et({shortcut:j.OrderedList,command:"toggleOrderedList"})],Iu.prototype,"listShortcut",1);Iu=Pn([ye({})],Iu);var dC=class extends wr{get name(){return"taskListItem"}createTags(){return[ae.ListItemNode]}createNodeSpec(e,t){return{content:"paragraph block*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),checked:{default:!1}},parseDOM:[{tag:"li[data-task-list-item]",getAttrs:r=>{let n=!1;return gt(r)&&r.getAttribute("data-checked")!==null&&(n=!0),{checked:n,...e.parse(r)}},priority:De.Medium},...t.parseDOM??[]],toDOM:r=>["li",{...e.dom(r),"data-task-list-item":"","data-checked":r.attrs.checked?"":void 0},0]}}createNodeViews(){return(e,t,r)=>{const n=document.createElement("input");return n.type="checkbox",n.classList.add(Xi.LIST_ITEM_CHECKBOX),n.contentEditable="false",n.addEventListener("click",o=>{t.editable||o.preventDefault()}),n.addEventListener("change",()=>{const o=r(),i=t.state.doc.resolve(o+1);this.store.commands.toggleCheckboxChecked({$pos:i})}),n.checked=e.attrs.checked,cC({node:e,mark:n,updateDOM:KB,updateMark:qB})}}createKeymap(){return{Enter:sC(this.type)}}createExtensions(){return[new uC]}toggleCheckboxChecked(e){let t,r;return typeof e=="boolean"?t=e:e&&(t=e.checked,r=e.$pos),({tr:n,dispatch:o})=>{const i=Gi({selection:r??n.selection.$from,types:this.type});if(!i)return!1;const{node:s,pos:a}=i,l={...s.attrs,checked:t??!s.attrs.checked};return o==null||o(n.setNodeMarkup(a,void 0,l)),!0}}createInputRules(){const e=/^\s*(\[( ?|x|X)]\s)$/;return[ph(e,this.type,t=>({checked:["x","X"].includes(il(t,2))})),new fa(e,(t,r,n,o)=>{const i=t.tr;if(i.deleteRange(n,o),!Tl({listType:nt(this.store.schema.nodes,"taskList"),itemType:this.type,tr:i}))return null;const a=["x","X"].includes(il(r,2));if(a){const l=Gi({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{checked:a})}return i})]}};Pn([Y()],dC.prototype,"toggleCheckboxChecked",1);function KB(e,t){e.attrs.checked?t.setAttribute("data-checked",""):t.removeAttribute("data-checked"),t.setAttribute("data-task-list-item","")}function qB(e,t){t.checked=!!e.attrs.checked}var fC=class extends wr{get name(){return"taskList"}createTags(){return[ae.Block,ae.ListContainerNode]}createNodeSpec(e,t){return{content:"taskListItem+",...t,attrs:e.defaults(),parseDOM:[{tag:"ul[data-task-list]",getAttrs:e.parse,priority:De.Medium},...t.parseDOM??[]],toDOM:r=>["ul",{...e.dom(r),"data-task-list":""},0]}}createExtensions(){return[new dC({})]}toggleTaskList(){return sy(this.type,nt(this.store.schema.nodes,"taskListItem"))}listShortcut(e){return this.toggleTaskList()(e)}};Pn([Y({icon:"checkboxMultipleLine",label:({t:e})=>e(av.TASK_LIST_LABEL)})],fC.prototype,"toggleTaskList",1);Pn([Et({shortcut:j.TaskList,command:"toggleTaskList"})],fC.prototype,"listShortcut",1);function GB(e){for(var t=1;t0&&e[t-1]===` +`;)t--;return e.substring(0,t)}var XB=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function ay(e){return ly(e,XB)}var pC=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function hC(e){return ly(e,pC)}function QB(e){return gC(e,pC)}var mC=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function ZB(e){return ly(e,mC)}function eF(e){return gC(e,mC)}function ly(e,t){return t.indexOf(e.nodeName)>=0}function gC(e,t){return e.getElementsByTagName&&t.some(function(r){return e.getElementsByTagName(r).length})}var cr={};cr.paragraph={filter:"p",replacement:function(e){return` + +`+e+` + +`}};cr.lineBreak={filter:"br",replacement:function(e,t,r){return r.br+` +`}};cr.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,r){var n=Number(t.nodeName.charAt(1));if(r.headingStyle==="setext"&&n<3){var o=N1(n===1?"=":"-",e.length);return` + +`+e+` +`+o+` + +`}else return` + +`+N1("#",n)+" "+e+` + +`}};cr.blockquote={filter:"blockquote",replacement:function(e){return e=e.replace(/^\n+|\n+$/g,""),e=e.replace(/^/gm,"> "),` + +`+e+` + +`}};cr.list={filter:["ul","ol"],replacement:function(e,t){var r=t.parentNode;return r.nodeName==="LI"&&r.lastElementChild===t?` +`+e:` + +`+e+` + +`}};cr.listItem={filter:"li",replacement:function(e,t,r){e=e.replace(/^\n+/,"").replace(/\n+$/,` +`).replace(/\n/gm,` + `);var n=r.bulletListMarker+" ",o=t.parentNode;if(o.nodeName==="OL"){var i=o.getAttribute("start"),s=Array.prototype.indexOf.call(o.children,t);n=(i?Number(i)+s:s+1)+". "}return n+e+(t.nextSibling&&!/\n$/.test(e)?` +`:"")}};cr.indentedCodeBlock={filter:function(e,t){return t.codeBlockStyle==="indented"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,t,r){return` + + `+t.firstChild.textContent.replace(/\n/g,` + `)+` + +`}};cr.fencedCodeBlock={filter:function(e,t){return t.codeBlockStyle==="fenced"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,t,r){for(var n=t.firstChild.getAttribute("class")||"",o=(n.match(/language-(\S+)/)||[null,""])[1],i=t.firstChild.textContent,s=r.fence.charAt(0),a=3,l=new RegExp("^"+s+"{3,}","gm"),c;c=l.exec(i);)c[0].length>=a&&(a=c[0].length+1);var u=N1(s,a);return` + +`+u+o+` +`+i.replace(/\n$/,"")+` +`+u+` + +`}};cr.horizontalRule={filter:"hr",replacement:function(e,t,r){return` + +`+r.hr+` + +`}};cr.inlineLink={filter:function(e,t){return t.linkStyle==="inlined"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t){var r=t.getAttribute("href"),n=wp(t.getAttribute("title"));return n&&(n=' "'+n+'"'),"["+e+"]("+r+n+")"}};cr.referenceLink={filter:function(e,t){return t.linkStyle==="referenced"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t,r){var n=t.getAttribute("href"),o=wp(t.getAttribute("title"));o&&(o=' "'+o+'"');var i,s;switch(r.linkReferenceStyle){case"collapsed":i="["+e+"][]",s="["+e+"]: "+n+o;break;case"shortcut":i="["+e+"]",s="["+e+"]: "+n+o;break;default:var a=this.references.length+1;i="["+e+"]["+a+"]",s="["+a+"]: "+n+o}return this.references.push(s),i},references:[],append:function(e){var t="";return this.references.length&&(t=` + +`+this.references.join(` +`)+` + +`,this.references=[]),t}};cr.emphasis={filter:["em","i"],replacement:function(e,t,r){return e.trim()?r.emDelimiter+e+r.emDelimiter:""}};cr.strong={filter:["strong","b"],replacement:function(e,t,r){return e.trim()?r.strongDelimiter+e+r.strongDelimiter:""}};cr.code={filter:function(e){var t=e.previousSibling||e.nextSibling,r=e.parentNode.nodeName==="PRE"&&!t;return e.nodeName==="CODE"&&!r},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",r="`",n=e.match(/`+/gm)||[];n.indexOf(r)!==-1;)r=r+"`";return r+t+e+t+r}};cr.image={filter:"img",replacement:function(e,t){var r=wp(t.getAttribute("alt")),n=t.getAttribute("src")||"",o=wp(t.getAttribute("title")),i=o?' "'+o+'"':"";return n?"!["+r+"]("+n+i+")":""}};function wp(e){return e?e.replace(/(\n+\s*)+/g,` +`):""}function vC(e){this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[];for(var t in e.rules)this.array.push(e.rules[t])}vC.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){if(e.isBlank)return this.blankRule;var t;return(t=ag(this.array,e,this.options))||(t=ag(this._keep,e,this.options))||(t=ag(this._remove,e,this.options))?t:this.defaultRule},forEach:function(e){for(var t=0;t-1)return!0}else if(typeof n=="function"){if(n.call(e,t,r))return!0}else throw new TypeError("`filter` needs to be a string, array, or function")}function rF(e){var t=e.element,r=e.isBlock,n=e.isVoid,o=e.isPre||function(d){return d.nodeName==="PRE"};if(!(!t.firstChild||o(t))){for(var i=null,s=!1,a=null,l=b2(a,t,o);l!==t;){if(l.nodeType===3||l.nodeType===4){var c=l.data.replace(/[ \r\n\t]+/g," ");if((!i||/ $/.test(i.data))&&!s&&c[0]===" "&&(c=c.substr(1)),!c){l=lg(l);continue}l.data=c,i=l}else if(l.nodeType===1)r(l)||l.nodeName==="BR"?(i&&(i.data=i.data.replace(/ $/,"")),i=null,s=!1):n(l)||o(l)?(i=null,s=!0):i&&(s=!1);else{l=lg(l);continue}var u=b2(a,l,o);a=l,l=u}i&&(i.data=i.data.replace(/ $/,""),i.data||lg(i))}}function lg(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function b2(e,t,r){return e&&e.parentNode===t||r(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}var yC=typeof window<"u"?window:{};function nF(){var e=yC.DOMParser,t=!1;try{new e().parseFromString("","text/html")&&(t=!0)}catch{}return t}function oF(){var e=function(){};return iF()?e.prototype.parseFromString=function(t){var r=new window.ActiveXObject("htmlfile");return r.designMode="on",r.open(),r.write(t),r.close(),r}:e.prototype.parseFromString=function(t){var r=document.implementation.createHTMLDocument("");return r.open(),r.write(t),r.close(),r},e}function iF(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch{window.ActiveXObject&&(e=!0)}return e}var sF=nF()?yC.DOMParser:oF();function aF(e,t){var r;if(typeof e=="string"){var n=lF().parseFromString(''+e+"","text/html");r=n.getElementById("turndown-root")}else r=e.cloneNode(!0);return rF({element:r,isBlock:ay,isVoid:hC,isPre:t.preformattedCode?cF:null}),r}var cg;function lF(){return cg=cg||new sF,cg}function cF(e){return e.nodeName==="PRE"||e.nodeName==="CODE"}function uF(e,t){return e.isBlock=ay(e),e.isCode=e.nodeName==="CODE"||e.parentNode.isCode,e.isBlank=dF(e),e.flankingWhitespace=fF(e,t),e}function dF(e){return!hC(e)&&!ZB(e)&&/^\s*$/i.test(e.textContent)&&!QB(e)&&!eF(e)}function fF(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var r=pF(e.textContent);return r.leadingAscii&&k2("left",e,t)&&(r.leading=r.leadingNonAscii),r.trailingAscii&&k2("right",e,t)&&(r.trailing=r.trailingNonAscii),{leading:r.leading,trailing:r.trailing}}function pF(e){var t=e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:t[1],leadingAscii:t[2],leadingNonAscii:t[3],trailing:t[4],trailingNonAscii:t[5],trailingAscii:t[6]}}function k2(e,t,r){var n,o,i;return e==="left"?(n=t.previousSibling,o=/ $/):(n=t.nextSibling,o=/^ /),n&&(n.nodeType===3?i=o.test(n.nodeValue):r.preformattedCode&&n.nodeName==="CODE"?i=!1:n.nodeType===1&&!ay(n)&&(i=o.test(n.textContent))),i}var hF=Array.prototype.reduce,mF=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function Sp(e){if(!(this instanceof Sp))return new Sp(e);var t={rules:cr,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(r,n){return n.isBlock?` + +`:""},keepReplacement:function(r,n){return n.isBlock?` + +`+n.outerHTML+` + +`:n.outerHTML},defaultReplacement:function(r,n){return n.isBlock?` + +`+r+` + +`:r}};this.options=GB({},t,e),this.rules=new vC(this.options)}Sp.prototype={turndown:function(e){if(!yF(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(e==="")return"";var t=bC.call(this,new aF(e,this.options));return gF.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t"']/,kF=new RegExp(wC.source,"g"),SC=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,xF=new RegExp(SC.source,"g"),wF={"&":"&","<":"<",">":">",'"':""","'":"'"},x2=e=>wF[e];function ir(e,t){if(t){if(wC.test(e))return e.replace(kF,x2)}else if(SC.test(e))return e.replace(xF,x2);return e}const SF=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function EC(e){return e.replace(SF,(t,r)=>(r=r.toLowerCase(),r==="colon"?":":r.charAt(0)==="#"?r.charAt(1)==="x"?String.fromCharCode(parseInt(r.substring(2),16)):String.fromCharCode(+r.substring(1)):""))}const EF=/(^|[^\[])\^/g;function Ve(e,t){e=typeof e=="string"?e:e.source,t=t||"";const r={replace:(n,o)=>(o=o.source||o,o=o.replace(EF,"$1"),e=e.replace(n,o),r),getRegex:()=>new RegExp(e,t)};return r}const CF=/[^\w:]/g,MF=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function w2(e,t,r){if(e){let n;try{n=decodeURIComponent(EC(r)).replace(CF,"").toLowerCase()}catch{return null}if(n.indexOf("javascript:")===0||n.indexOf("vbscript:")===0||n.indexOf("data:")===0)return null}t&&!MF.test(r)&&(r=AF(t,r));try{r=encodeURI(r).replace(/%25/g,"%")}catch{return null}return r}const Ud={},TF=/^[^:]+:\/*[^/]*$/,OF=/^([^:]+:)[\s\S]*$/,_F=/^([^:]+:\/*[^/]*)[\s\S]*$/;function AF(e,t){Ud[" "+e]||(TF.test(e)?Ud[" "+e]=e+"/":Ud[" "+e]=Af(e,"/",!0)),e=Ud[" "+e];const r=e.indexOf(":")===-1;return t.substring(0,2)==="//"?r?t:e.replace(OF,"$1")+t:t.charAt(0)==="/"?r?t:e.replace(_F,"$1")+t:e+t}const Ep={exec:function(){}};function S2(e,t){const r=e.replace(/\|/g,(i,s,a)=>{let l=!1,c=s;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),n=r.split(/ \|/);let o=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length1;)t&1&&(r+=e),t>>=1,e+=e;return r+e}function C2(e,t,r,n){const o=t.href,i=t.title?ir(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){n.state.inLink=!0;const a={type:"link",raw:r,href:o,title:i,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,a}return{type:"image",raw:r,href:o,title:i,text:ir(s)}}function NF(e,t){const r=e.match(/^(\s+)(?:```)/);if(r===null)return t;const n=r[1];return t.split(` +`).map(o=>{const i=o.match(/^\s+/);if(i===null)return o;const[s]=i;return s.length>=n.length?o.slice(n.length):o}).join(` +`)}class cy{constructor(t){this.options=t||ga}space(t){const r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){const r=this.rules.block.code.exec(t);if(r){const n=r[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Af(n,` +`)}}}fences(t){const r=this.rules.block.fences.exec(t);if(r){const n=r[0],o=NF(n,r[3]||"");return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline._escapes,"$1"):r[2],text:o}}}heading(t){const r=this.rules.block.heading.exec(t);if(r){let n=r[2].trim();if(/#$/.test(n)){const o=Af(n,"#");(this.options.pedantic||!o||/ $/.test(o))&&(n=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){const r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:r[0]}}blockquote(t){const r=this.rules.block.blockquote.exec(t);if(r){const n=r[0].replace(/^ *>[ \t]?/gm,""),o=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(n);return this.lexer.state.top=o,{type:"blockquote",raw:r[0],tokens:i,text:n}}}list(t){let r=this.rules.block.list.exec(t);if(r){let n,o,i,s,a,l,c,u,d,f,p,h,m=r[1].trim();const b=m.length>1,v={type:"list",raw:"",ordered:b,start:b?+m.slice(0,-1):"",loose:!1,items:[]};m=b?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=b?m:"[*+-]");const g=new RegExp(`^( {0,3}${m})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(h=!1,!(!(r=g.exec(t))||this.rules.block.hr.test(t)));){if(n=r[0],t=t.substring(n.length),u=r[2].split(` +`,1)[0].replace(/^\t+/,k=>" ".repeat(3*k.length)),d=t.split(` +`,1)[0],this.options.pedantic?(s=2,p=u.trimLeft()):(s=r[2].search(/[^ ]/),s=s>4?1:s,p=u.slice(s),s+=r[1].length),l=!1,!u&&/^ *$/.test(d)&&(n+=d+` +`,t=t.substring(d.length+1),h=!0),!h){const k=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),x=new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),w=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),E=new RegExp(`^ {0,${Math.min(3,s-1)}}#`);for(;t&&(f=t.split(` +`,1)[0],d=f,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(w.test(d)||E.test(d)||k.test(d)||x.test(t)));){if(d.search(/[^ ]/)>=s||!d.trim())p+=` +`+d.slice(s);else{if(l||u.search(/[^ ]/)>=4||w.test(u)||E.test(u)||x.test(u))break;p+=` +`+d}!l&&!d.trim()&&(l=!0),n+=f+` +`,t=t.substring(f.length+1),u=d.slice(s)}}v.loose||(c?v.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(o=/^\[[ xX]\] /.exec(p),o&&(i=o[0]!=="[ ] ",p=p.replace(/^\[[ xX]\] +/,""))),v.items.push({type:"list_item",raw:n,task:!!o,checked:i,loose:!1,text:p}),v.raw+=n}v.items[v.items.length-1].raw=n.trimRight(),v.items[v.items.length-1].text=p.trimRight(),v.raw=v.raw.trimRight();const y=v.items.length;for(a=0;aw.type==="space"),x=k.length>0&&k.some(w=>/\n.*\n/.test(w.raw));v.loose=x}if(v.loose)for(a=0;a$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline._escapes,"$1"):r[3];return{type:"def",tag:n,raw:r[0],href:o,title:i}}}table(t){const r=this.rules.block.table.exec(t);if(r){const n={type:"table",header:S2(r[1]).map(o=>({text:o})),align:r[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:r[3]&&r[3].trim()?r[3].replace(/\n[ \t]*$/,"").split(` +`):[]};if(n.header.length===n.align.length){n.raw=r[0];let o=n.align.length,i,s,a,l;for(i=0;i({text:c}));for(o=n.header.length,s=0;s/i.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):ir(r[0]):r[0]}}link(t){const r=this.rules.inline.link.exec(t);if(r){const n=r[2].trim();if(!this.options.pedantic&&/^$/.test(n))return;const s=Af(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{const s=RF(r[2],"()");if(s>-1){const l=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,l).trim(),r[3]=""}}let o=r[2],i="";if(this.options.pedantic){const s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);s&&(o=s[1],i=s[3])}else i=r[3]?r[3].slice(1,-1):"";return o=o.trim(),/^$/.test(n)?o=o.slice(1):o=o.slice(1,-1)),C2(r,{href:o&&o.replace(this.rules.inline._escapes,"$1"),title:i&&i.replace(this.rules.inline._escapes,"$1")},r[0],this.lexer)}}reflink(t,r){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let o=(n[2]||n[1]).replace(/\s+/g," ");if(o=r[o.toLowerCase()],!o){const i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return C2(n,o,n[0],this.lexer)}}emStrong(t,r,n=""){let o=this.rules.inline.emStrong.lDelim.exec(t);if(!o||o[3]&&n.match(/[\p{L}\p{N}]/u))return;const i=o[1]||o[2]||"";if(!i||i&&(n===""||this.rules.inline.punctuation.exec(n))){const s=o[0].length-1;let a,l,c=s,u=0;const d=o[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,r=r.slice(-1*t.length+s);(o=d.exec(r))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(l=a.length,o[3]||o[4]){c+=l;continue}else if((o[5]||o[6])&&s%3&&!((s+l)%3)){u+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+u);const f=t.slice(0,s+o.index+(o[0].length-a.length)+l);if(Math.min(s,l)%2){const h=f.slice(1,-1);return{type:"em",raw:f,text:h,tokens:this.lexer.inlineTokens(h)}}const p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(t){const r=this.rules.inline.code.exec(t);if(r){let n=r[2].replace(/\n/g," ");const o=/[^ ]/.test(n),i=/^ /.test(n)&&/ $/.test(n);return o&&i&&(n=n.substring(1,n.length-1)),n=ir(n,!0),{type:"codespan",raw:r[0],text:n}}}br(t){const r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){const r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t,r){const n=this.rules.inline.autolink.exec(t);if(n){let o,i;return n[2]==="@"?(o=ir(this.options.mangle?r(n[1]):n[1]),i="mailto:"+o):(o=ir(n[1]),i=o),{type:"link",raw:n[0],text:o,href:i,tokens:[{type:"text",raw:o,text:o}]}}}url(t,r){let n;if(n=this.rules.inline.url.exec(t)){let o,i;if(n[2]==="@")o=ir(this.options.mangle?r(n[0]):n[0]),i="mailto:"+o;else{let s;do s=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0];while(s!==n[0]);o=ir(n[0]),n[1]==="www."?i="http://"+n[0]:i=n[0]}return{type:"link",raw:n[0],text:o,href:i,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(t,r){const n=this.rules.inline.text.exec(t);if(n){let o;return this.lexer.state.inRawBlock?o=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):ir(n[0]):n[0]:o=ir(this.options.smartypants?r(n[0]):n[0]),{type:"text",raw:n[0],text:o}}}}const se={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Ep,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};se._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;se._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;se.def=Ve(se.def).replace("label",se._label).replace("title",se._title).getRegex();se.bullet=/(?:[*+-]|\d{1,9}[.)])/;se.listItemStart=Ve(/^( *)(bull) */).replace("bull",se.bullet).getRegex();se.list=Ve(se.list).replace(/bull/g,se.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+se.def.source+")").getRegex();se._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";se._comment=/|$)/;se.html=Ve(se.html,"i").replace("comment",se._comment).replace("tag",se._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();se.paragraph=Ve(se._paragraph).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",se._tag).getRegex();se.blockquote=Ve(se.blockquote).replace("paragraph",se.paragraph).getRegex();se.normal={...se};se.gfm={...se.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};se.gfm.table=Ve(se.gfm.table).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",se._tag).getRegex();se.gfm.paragraph=Ve(se._paragraph).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",se.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",se._tag).getRegex();se.pedantic={...se.normal,html:Ve(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",se._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ep,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ve(se.normal._paragraph).replace("hr",se.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",se.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ep,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ep,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";Q.punctuation=Ve(Q.punctuation).replace(/punctuation/g,Q._punctuation).getRegex();Q.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;Q.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;Q._comment=Ve(se._comment).replace("(?:-->|$)","-->").getRegex();Q.emStrong.lDelim=Ve(Q.emStrong.lDelim).replace(/punct/g,Q._punctuation).getRegex();Q.emStrong.rDelimAst=Ve(Q.emStrong.rDelimAst,"g").replace(/punct/g,Q._punctuation).getRegex();Q.emStrong.rDelimUnd=Ve(Q.emStrong.rDelimUnd,"g").replace(/punct/g,Q._punctuation).getRegex();Q._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;Q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;Q._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;Q.autolink=Ve(Q.autolink).replace("scheme",Q._scheme).replace("email",Q._email).getRegex();Q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;Q.tag=Ve(Q.tag).replace("comment",Q._comment).replace("attribute",Q._attribute).getRegex();Q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;Q._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;Q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;Q.link=Ve(Q.link).replace("label",Q._label).replace("href",Q._href).replace("title",Q._title).getRegex();Q.reflink=Ve(Q.reflink).replace("label",Q._label).replace("ref",se._label).getRegex();Q.nolink=Ve(Q.nolink).replace("ref",se._label).getRegex();Q.reflinkSearch=Ve(Q.reflinkSearch,"g").replace("reflink",Q.reflink).replace("nolink",Q.nolink).getRegex();Q.normal={...Q};Q.pedantic={...Q.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ve(/^!?\[(label)\]\((.*?)\)/).replace("label",Q._label).getRegex(),reflink:Ve(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Q._label).getRegex()};Q.gfm={...Q.normal,escape:Ve(Q.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),t+="&#"+n+";";return t}class es{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||ga,this.options.tokenizer=this.options.tokenizer||new cy,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={block:se.normal,inline:Q.normal};this.options.pedantic?(r.block=se.pedantic,r.inline=Q.pedantic):this.options.gfm&&(r.block=se.gfm,this.options.breaks?r.inline=Q.breaks:r.inline=Q.gfm),this.tokenizer.rules=r}static get rules(){return{block:se,inline:Q}}static lex(t,r){return new es(r).lex(t)}static lexInline(t,r){return new es(r).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,` +`),this.blockTokens(t,this.tokens);let r;for(;r=this.inlineQueue.shift();)this.inlineTokens(r.src,r.tokens);return this.tokens}blockTokens(t,r=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(a,l,c)=>l+" ".repeat(c.length));let n,o,i,s;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(n=a.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length),n.raw.length===1&&r.length>0?r[r.length-1].raw+=` +`:r.push(n);continue}if(n=this.tokenizer.code(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=` +`+n.raw,o.text+=` +`+n.text,this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n);continue}if(n=this.tokenizer.fences(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.heading(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.hr(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.blockquote(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.list(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.html(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.def(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=` +`+n.raw,o.text+=` +`+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.lheading(t)){t=t.substring(n.raw.length),r.push(n);continue}if(i=t,this.options.extensions&&this.options.extensions.startBlock){let a=1/0;const l=t.slice(1);let c;this.options.extensions.startBlock.forEach(function(u){c=u.call({lexer:this},l),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(i=t.substring(0,a+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i))){o=r[r.length-1],s&&o.type==="paragraph"?(o.raw+=` +`+n.raw,o.text+=` +`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n),s=i.length!==t.length,t=t.substring(n.raw.length);continue}if(n=this.tokenizer.text(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&o.type==="text"?(o.raw+=` +`+n.raw,o.text+=` +`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let n,o,i,s=t,a,l,c;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)u.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+E2("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,a.index)+"["+E2("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(s))!=null;)s=s.slice(0,a.index+a[0].length-2)+"++"+s.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;t;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(n=u.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.escape(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.tag(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(n=this.tokenizer.link(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(n.raw.length),o=r[r.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(n=this.tokenizer.emStrong(t,s,c)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.codespan(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.br(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.del(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.autolink(t,M2)){t=t.substring(n.raw.length),r.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(t,M2))){t=t.substring(n.raw.length),r.push(n);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let u=1/0;const d=t.slice(1);let f;this.options.extensions.startInline.forEach(function(p){f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(i=t.substring(0,u+1))}if(n=this.tokenizer.inlineText(i,zF)){t=t.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(c=n.raw.slice(-1)),l=!0,o=r[r.length-1],o&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(t){const u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return r}}class uy{constructor(t){this.options=t||ga}code(t,r,n){const o=(r||"").match(/\S*/)[0];if(this.options.highlight){const i=this.options.highlight(t,o);i!=null&&i!==t&&(n=!0,t=i)}return t=t.replace(/\n$/,"")+` +`,o?'
'+(n?t:ir(t,!0))+`
+`:"
"+(n?t:ir(t,!0))+`
+`}blockquote(t){return`
+${t}
+`}html(t){return t}heading(t,r,n,o){if(this.options.headerIds){const i=this.options.headerPrefix+o.slug(n);return`${t} +`}return`${t} +`}hr(){return this.options.xhtml?`
+`:`
+`}list(t,r,n){const o=r?"ol":"ul",i=r&&n!==1?' start="'+n+'"':"";return"<"+o+i+`> +`+t+" +`}listitem(t){return`
  • ${t}
  • +`}checkbox(t){return" "}paragraph(t){return`

    ${t}

    +`}table(t,r){return r&&(r=`${r}`),` + +`+t+` +`+r+`
    +`}tablerow(t){return` +${t} +`}tablecell(t,r){const n=r.header?"th":"td";return(r.align?`<${n} align="${r.align}">`:`<${n}>`)+t+` +`}strong(t){return`${t}`}em(t){return`${t}`}codespan(t){return`${t}`}br(){return this.options.xhtml?"
    ":"
    "}del(t){return`${t}`}link(t,r,n){if(t=w2(this.options.sanitize,this.options.baseUrl,t),t===null)return n;let o='",o}image(t,r,n){if(t=w2(this.options.sanitize,this.options.baseUrl,t),t===null)return n;let o=`${n}":">",o}text(t){return t}}class CC{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,r,n){return""+n}image(t,r,n){return""+n}br(){return""}}class MC{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,r){let n=t,o=0;if(this.seen.hasOwnProperty(n)){o=this.seen[t];do o++,n=t+"-"+o;while(this.seen.hasOwnProperty(n))}return r||(this.seen[t]=o,this.seen[n]=0),n}slug(t,r={}){const n=this.serialize(t);return this.getNextSafeSlug(n,r.dryrun)}}class ts{constructor(t){this.options=t||ga,this.options.renderer=this.options.renderer||new uy,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new CC,this.slugger=new MC}static parse(t,r){return new ts(r).parse(t)}static parseInline(t,r){return new ts(r).parseInline(t)}parse(t,r=!0){let n="",o,i,s,a,l,c,u,d,f,p,h,m,b,v,g,y,k,x,w;const E=t.length;for(o=0;o0&&g.tokens[0].type==="paragraph"?(g.tokens[0].text=x+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&g.tokens[0].tokens[0].type==="text"&&(g.tokens[0].tokens[0].text=x+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:x}):v+=x),v+=this.parse(g.tokens,b),f+=this.renderer.listitem(v,k,y);n+=this.renderer.list(f,h,m);continue}case"html":{n+=this.renderer.html(p.text);continue}case"paragraph":{n+=this.renderer.paragraph(this.parseInline(p.tokens));continue}case"text":{for(f=p.tokens?this.parseInline(p.tokens):p.text;o+1{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,e){const o="

    An error occurred:

    "+ir(n.message+"",!0)+"
    ";if(t)return Promise.resolve(o);if(r){r(null,o);return}return o}if(t)return Promise.reject(n);if(r){r(n);return}throw n}}function TC(e,t){return(r,n,o)=>{typeof n=="function"&&(o=n,n=null);const i={...n};n={...ie.defaults,...i};const s=LF(n.silent,n.async,o);if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(PF(n),n.hooks&&(n.hooks.options=n),o){const a=n.highlight;let l;try{n.hooks&&(r=n.hooks.preprocess(r)),l=e(r,n)}catch(d){return s(d)}const c=function(d){let f;if(!d)try{n.walkTokens&&ie.walkTokens(l,n.walkTokens),f=t(l,n),n.hooks&&(f=n.hooks.postprocess(f))}catch(p){d=p}return n.highlight=a,d?s(d):o(null,f)};if(!a||a.length<3||(delete n.highlight,!l.length))return c();let u=0;ie.walkTokens(l,function(d){d.type==="code"&&(u++,setTimeout(()=>{a(d.text,d.lang,function(f,p){if(f)return c(f);p!=null&&p!==d.text&&(d.text=p,d.escaped=!0),u--,u===0&&c()})},0))}),u===0&&c();return}if(n.async)return Promise.resolve(n.hooks?n.hooks.preprocess(r):r).then(a=>e(a,n)).then(a=>n.walkTokens?Promise.all(ie.walkTokens(a,n.walkTokens)).then(()=>a):a).then(a=>t(a,n)).then(a=>n.hooks?n.hooks.postprocess(a):a).catch(s);try{n.hooks&&(r=n.hooks.preprocess(r));const a=e(r,n);n.walkTokens&&ie.walkTokens(a,n.walkTokens);let l=t(a,n);return n.hooks&&(l=n.hooks.postprocess(l)),l}catch(a){return s(a)}}}function ie(e,t,r){return TC(es.lex,ts.parse)(e,t,r)}ie.options=ie.setOptions=function(e){return ie.defaults={...ie.defaults,...e},bF(ie.defaults),ie};ie.getDefaults=xC;ie.defaults=ga;ie.use=function(...e){const t=ie.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(r=>{const n={...r};if(n.async=ie.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if(o.renderer){const i=t.renderers[o.name];i?t.renderers[o.name]=function(...s){let a=o.renderer.apply(this,s);return a===!1&&(a=i.apply(this,s)),a}:t.renderers[o.name]=o.renderer}if(o.tokenizer){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[o.level]?t[o.level].unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),n.extensions=t),r.renderer){const o=ie.defaults.renderer||new uy;for(const i in r.renderer){const s=o[i];o[i]=(...a)=>{let l=r.renderer[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}n.renderer=o}if(r.tokenizer){const o=ie.defaults.tokenizer||new cy;for(const i in r.tokenizer){const s=o[i];o[i]=(...a)=>{let l=r.tokenizer[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}n.tokenizer=o}if(r.hooks){const o=ie.defaults.hooks||new Cp;for(const i in r.hooks){const s=o[i];Cp.passThroughHooks.has(i)?o[i]=a=>{if(ie.defaults.async)return Promise.resolve(r.hooks[i].call(o,a)).then(c=>s.call(o,c));const l=r.hooks[i].call(o,a);return s.call(o,l)}:o[i]=(...a)=>{let l=r.hooks[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}n.hooks=o}if(r.walkTokens){const o=ie.defaults.walkTokens;n.walkTokens=function(i){let s=[];return s.push(r.walkTokens.call(this,i)),o&&(s=s.concat(o.call(this,i))),s}}ie.setOptions(n)})};ie.walkTokens=function(e,t){let r=[];for(const n of e)switch(r=r.concat(t.call(ie,n)),n.type){case"table":{for(const o of n.header)r=r.concat(ie.walkTokens(o.tokens,t));for(const o of n.rows)for(const i of o)r=r.concat(ie.walkTokens(i.tokens,t));break}case"list":{r=r.concat(ie.walkTokens(n.items,t));break}default:ie.defaults.extensions&&ie.defaults.extensions.childTokens&&ie.defaults.extensions.childTokens[n.type]?ie.defaults.extensions.childTokens[n.type].forEach(function(o){r=r.concat(ie.walkTokens(n[o],t))}):n.tokens&&(r=r.concat(ie.walkTokens(n.tokens,t)))}return r};ie.parseInline=TC(es.lexInline,ts.parseInline);ie.Parser=ts;ie.parser=ts.parse;ie.Renderer=uy;ie.TextRenderer=CC;ie.Lexer=es;ie.lexer=es.lex;ie.Tokenizer=cy;ie.Slugger=MC;ie.Hooks=Cp;ie.parse=ie;ie.options;ie.setOptions;ie.use;ie.walkTokens;ie.parseInline;ts.parse;es.lex;var IF=Object.defineProperty,DF=Object.getOwnPropertyDescriptor,Th=(e,t,r,n)=>{for(var o=n>1?void 0:n?DF(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&IF(t,r,o),o},$F=tv(Sp);function HF(e){return FF.turndown(e)}function ug(e){const t=e.parentNode;if(!gt(t))return!1;if(t.nodeName==="THEAD")return!0;if(t.nodeName!=="TABLE"&&!OC(t))return!1;const r=[...e.childNodes];return r.every(n=>n.nodeName==="TH")&&r.some(n=>!!n.textContent)}function Mp(e){return gt(e)&&e.matches("th[data-controller-cell]")}function BF(e){const t=e.parentNode;return!gt(t)||t.nodeName!=="TABLE"&&!OC(t)?!1:[...e.childNodes].every(n=>Mp(n))}function OC(e){var t;if(e.nodeName!=="TBODY")return!1;const r=e.previousSibling;return r?gt(r)&&r.nodeName==="THEAD"&&!((t=r.textContent)!=null&&t.trim()):!0}function T2(e){const t=e.closest("table");if(!t)return!1;const{parentNode:r}=t;return r?!!r.closest("table"):!0}function O2(e,t){var r;const n=[];for(const s of((r=t.parentNode)==null?void 0:r.childNodes)??[])Mp(s)||n.push(s);return`${(n.indexOf(t)===0?"| ":" ")+e.trim()} |`}var FF=new $F({codeBlockStyle:"fenced",headingStyle:"atx"}).addRule("taskListItems",{filter:e=>e.nodeName==="LI"&&e.hasAttribute("data-task-list-item"),replacement:(e,t)=>`- ${t.hasAttribute("data-checked")?"[x]":"[ ]"} ${e.trimStart()}`}).addRule("tableCell",{filter:["th","td"],replacement:(e,t)=>Mp(t)?"":O2(e,t)}).addRule("tableRow",{filter:"tr",replacement:(e,t)=>{let r="";const n={left:":--",right:"--:",center:":-:"},o=[...t.childNodes].filter(i=>!Mp(i));if(ug(t))for(const i of o){if(!gt(i))continue;let s="---";const a=(i.getAttribute("align")??"").toLowerCase();a&&(s=n[a]||s),r+=O2(s,i)}return` +${e}${r?` +${r}`:""}`}}).addRule("table",{filter:e=>{if(e.nodeName!=="TABLE"||T2(e))return!1;const t=[...e.rows].filter(r=>!BF(r));return ug(t[0])},replacement:e=>(e=e.replace(` + +`,` +`),` + +${e} + +`)}).addRule("tableSection",{filter:["thead","tbody","tfoot"],replacement:function(e){return e}}).keep(e=>e.nodeName==="TABLE"&&!ug(e.rows[0])).keep(e=>e.nodeName==="TABLE"&&T2(e)).addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return`~${e}~`}}).addRule("fencedCodeBlock",{filter:(e,t)=>!!(t.codeBlockStyle==="fenced"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"),replacement:(e,t,r)=>{var n,o;te(gt(t.firstChild),{code:$.EXTENSION,message:`Invalid node \`${(n=t.firstChild)==null?void 0:n.nodeName}\` encountered for codeblock when converting html to markdown.`});const s=((o=(t.firstChild.getAttribute("class")??"").match(/(?:lang|language)-(\S+)/))==null?void 0:o[1])??t.firstChild.getAttribute("data-code-block-language")??"";return` + +${r.fence}${s} +${t.firstChild.textContent} +${r.fence} + +`}});ie.use({renderer:{list(e,t,r){return t?`
      +${e}
    +`:`
      +${e}
    +`},listitem(e,t,r){return t?`
  • ${e}
  • +`:`
  • ${e}
  • +`}}});function VF(e,t){return ie(e,{gfm:!0,smartLists:!0,xhtml:!0,sanitizer:t})}function jF(e){te(typeof document,{code:$.EXTENSION,message:"Attempting to sanitize html within a non-browser environment. Please provide your own `sanitizeHtml` method to the `MarkdownExtension`."});const t=new DOMParser().parseFromString(`${e}`,"text/html");return t.normalize(),_C(t.body),t.body.innerHTML}function _C(e){if(!jN(e)){if(!gt(e)||/^(script|iframe|object|embed|svg)$/i.test(e.tagName))return e==null?void 0:e.remove();for(const{name:t}of e.attributes)/^(class|id|name|href|src|alt|align|valign)$/i.test(t)||e.attributes.removeNamedItem(t);for(const t of e.childNodes)_C(t)}}var Ol=class extends Ge{get name(){return"markdown"}onCreate(){this.store.setStringHandler("markdown",this.markdownToProsemirrorNode.bind(this))}createPlugin(){return{props:{clipboardTextSerializer:this.options.copyAsMarkdown?t=>{const r=document.createElement("div"),n=kn.fromSchema(this.store.schema);return r.append(n.serializeFragment(t.content)),this.options.htmlToMarkdown(r.innerHTML)}:void 0}}}markdownToProsemirrorNode(e){return this.store.stringHandlers.html({...e,content:this.options.markdownToHtml(e.content,this.options.htmlSanitizer)})}insertMarkdown(e,t){return r=>{const{state:n}=r;let o=this.options.markdownToHtml(e,this.options.htmlSanitizer);o=!(t!=null&&t.alwaysWrapInBlock)&&o.startsWith("

    <")&&o.endsWith(`

    +`)?o.slice(3,-5):`
    ${o}
    `;const i=this.store.stringHandlers.html({content:o,schema:n.schema,fragment:!0});return this.store.commands.insertNode.original(i,{...t,replaceEmptyParentBlock:!0})(r)}}getMarkdown(e){return this.options.htmlToMarkdown(this.store.helpers.getHTML(e))}toggleBoldMarkdown(){return e=>!1}};Th([Y()],Ol.prototype,"insertMarkdown",1);Th([je()],Ol.prototype,"getMarkdown",1);Th([Y()],Ol.prototype,"toggleBoldMarkdown",1);Ol=Th([ye({defaultOptions:{htmlToMarkdown:HF,markdownToHtml:VF,htmlSanitizer:jF,activeNodes:[ae.Code],copyAsMarkdown:!1},staticKeys:["htmlToMarkdown","markdownToHtml","htmlSanitizer"]})],Ol);var UF=Object.defineProperty,WF=Object.getOwnPropertyDescriptor,Oh=(e,t,r,n)=>{for(var o=n>1?void 0:n?WF(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&UF(t,r,o),o},KF={icon:"paragraph",label:({t:e})=>e(op.INSERT_LABEL),description:({t:e})=>e(op.INSERT_DESCRIPTION)},qF={icon:"paragraph",label:({t:e})=>e(op.CONVERT_LABEL),description:({t:e})=>e(op.CONVERT_DESCRIPTION)},ea=class extends wr{get name(){return"paragraph"}createTags(){return[ae.LastNodeCompatible,ae.TextBlock,ae.Block,ae.FormattingNode]}createNodeSpec(e,t){return{content:"inline*",draggable:!1,...t,attrs:{...e.defaults()},parseDOM:[{tag:"p",getAttrs:r=>({...e.parse(r)})},...t.parseDOM??[]],toDOM:r=>["p",e.dom(r),0]}}convertParagraph(e={}){const{attrs:t,selection:r,preserveAttrs:n}=e;return this.store.commands.setBlockNodeType.original(this.type,t,r,n)}insertParagraph(e,t={}){const{selection:r,attrs:n}=t;return this.store.commands.insertNode.original(this.type,{content:e,selection:r,attrs:n})}shortcut(e){return this.convertParagraph()(e)}};Oh([Y(qF)],ea.prototype,"convertParagraph",1);Oh([Y(KF)],ea.prototype,"insertParagraph",1);Oh([Et({shortcut:j.Paragraph,command:"convertParagraph"})],ea.prototype,"shortcut",1);ea=Oh([ye({defaultPriority:De.Medium})],ea);var GF=Object.defineProperty,YF=Object.getOwnPropertyDescriptor,JF=(e,t,r,n)=>{for(var o=n>1?void 0:n?YF(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&GF(t,r,o),o},ta=class extends Ge{get name(){return"placeholder"}createAttributes(){return{"aria-placeholder":this.options.placeholder}}createPlugin(){return{state:{init:(e,t)=>({...this.options,empty:wv(t.doc,{ignoreAttributes:!0})}),apply:(e,t,r,n)=>XF({pluginState:t,tr:e,extension:this,state:n})},props:{decorations:e=>QF({state:e,extension:this})}}}onSetOptions(e){const{changes:t}=e;t.placeholder.changed&&this.store.phase>=Tr.EditorView&&this.store.updateAttributes()}};ta=JF([ye({defaultOptions:{emptyNodeClass:tI.IS_EMPTY,placeholder:""}})],ta);function XF(e){const{pluginState:t,extension:r,tr:n,state:o}=e;return n.docChanged?{...r.options,empty:wv(o.doc)}:t}function QF(e){const{extension:t,state:r}=e,{empty:n}=t.pluginKey.getState(r),{emptyNodeClass:o,placeholder:i}=t.options;if(!n)return null;const s=[];return r.doc.descendants((a,l)=>{const c=Ke.node(l,l+a.nodeSize,{class:o,"data-placeholder":i});s.push(c)}),Ee.create(r.doc,s)}var ZF=Object.defineProperty,eV=Object.getOwnPropertyDescriptor,dy=(e,t,r,n)=>{for(var o=n>1?void 0:n?eV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&ZF(t,r,o),o},tV={icon:"strikethrough",label:({t:e})=>e(Kk.LABEL),description:({t:e})=>e(Kk.DESCRIPTION)},Du=class extends pa{get name(){return"strike"}createTags(){return[ae.FontStyle,ae.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"s",getAttrs:e.parse},{tag:"del",getAttrs:e.parse},{tag:"strike",getAttrs:e.parse},{style:"text-decoration",getAttrs:r=>r==="line-through"?{}:!1},...t.parseDOM??[]],toDOM:r=>["s",e.dom(r),0]}}toggleStrike(){return Ji({type:this.type})}shortcut(e){return this.toggleStrike()(e)}createInputRules(){return[Ou({regexp:/~([^~]+)~$/,type:this.type,ignoreWhitespace:!0})]}createPasteRules(){return[{regexp:/~([^~]+)~/g,type:"mark",markType:this.type}]}};dy([Y(tV)],Du.prototype,"toggleStrike",1);dy([Et({shortcut:j.Strike,command:"toggleStrike"})],Du.prototype,"shortcut",1);Du=dy([ye({})],Du);var rV=Object.defineProperty,nV=Object.getOwnPropertyDescriptor,oV=(e,t,r,n)=>{for(var o=n>1?void 0:n?nV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&rV(t,r,o),o},z1=class extends wr{get name(){return"text"}createTags(){return[ae.InlineNode]}createNodeSpec(){return{}}};z1=oV([ye({disableExtraAttributes:!0,defaultPriority:De.Medium})],z1);var _2=new da("trailingNode");function iV(e){const{ignoredNodes:t=[],nodeName:r="paragraph"}=e??{},n=vl([...t,r]);let o,i;return new Co({key:_2,appendTransaction(s,a,l){const{doc:c,tr:u}=l,d=_2.getState(l),f=c.content.size;if(d)return u.insert(f,o.create())},state:{init:(s,{doc:a,schema:l})=>{var c;const u=l.nodes[r];if(!u)throw new Error(`Invalid node being used for trailing node extension: '${r}'`);return o=u,i=Object.values(l.nodes).map(d=>d).filter(d=>!n.includes(d.name)),vr(i,(c=a.lastChild)==null?void 0:c.type)},apply:(s,a)=>{var l;return s.docChanged?vr(i,(l=s.doc.lastChild)==null?void 0:l.type):a}}})}var sV=Object.defineProperty,aV=Object.getOwnPropertyDescriptor,lV=(e,t,r,n)=>{for(var o=n>1?void 0:n?aV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&sV(t,r,o),o},L1=class extends Ge{get name(){return"trailingNode"}onSetOptions(e){const{changes:t}=e;(t.disableTags.changed||t.ignoredNodes.changed||t.nodeName.changed)&&this.store.updateExtensionPlugins(this)}createExternalPlugins(){const{tags:e}=this.store,{disableTags:t,nodeName:r}=this.options,n=t?[...this.options.ignoredNodes]:[...this.options.ignoredNodes,...e.lastNodeCompatible];return[iV({ignoredNodes:n,nodeName:r})]}};L1=lV([ye({defaultOptions:{ignoredNodes:[],disableTags:!1,nodeName:"paragraph"}})],L1);var cV=Object.defineProperty,uV=Object.getOwnPropertyDescriptor,fy=(e,t,r,n)=>{for(var o=n>1?void 0:n?uV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&cV(t,r,o),o},dV={icon:"underline",label:({t:e})=>e(qk.LABEL),description:({t:e})=>e(qk.DESCRIPTION)},$u=class extends pa{get name(){return"underline"}createTags(){return[ae.FontStyle,ae.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"u",getAttrs:e.parse},{style:"text-decoration",getAttrs:r=>r==="underline"?{}:!1},...t.parseDOM??[]],toDOM:r=>["u",e.dom(r),0]}}toggleUnderline(e){return Ji({type:this.type,selection:e})}shortcut(e){return this.toggleUnderline()(e)}};fy([Y(dV)],$u.prototype,"toggleUnderline",1);fy([Et({shortcut:j.Underline,command:"toggleUnderline"})],$u.prototype,"shortcut",1);$u=fy([ye({})],$u);var fV={...Ml.defaultOptions,...ea.defaultOptions,...wo.defaultOptions,excludeExtensions:[]};function pV(e={}){e={...fV,...e};const{content:t,depth:r,getDispatch:n,getState:o,newGroupDelay:i,excludeExtensions:s}=e,a={};for(const c of s??[])a[c]=!0;const l=[];if(!a.history){const c=new wo({depth:r,getDispatch:n,getState:o,newGroupDelay:i});l.push(c)}return a.doc||l.push(new Ml({content:t})),a.text||l.push(new z1),a.paragraph||l.push(new ea),a.positioner||l.push(new Cl),a.gapCursor||l.push(new R1),a.events||l.push(new vp),l}var AC={exports:{}},cn={},RC={exports:{}},PC={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */(function(e){function t(_,N){var H=_.length;_.push(N);e:for(;0>>1,J=_[G];if(0>>1;G<_e;){var oe=2*(G+1)-1,ue=_[oe],de=oe+1,he=_[de];if(0>o(ue,H))deo(he,ue)?(_[G]=he,_[de]=H,G=de):(_[G]=ue,_[oe]=H,G=oe);else if(deo(he,H))_[G]=he,_[de]=H,G=de;else break e}}return N}function o(_,N){var H=_.sortIndex-N.sortIndex;return H!==0?H:_.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,d=null,f=3,p=!1,h=!1,m=!1,b=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(_){for(var N=r(c);N!==null;){if(N.callback===null)n(c);else if(N.startTime<=_)n(c),N.sortIndex=N.expirationTime,t(l,N);else break;N=r(c)}}function k(_){if(m=!1,y(_),!h)if(r(l)!==null)h=!0,z(x);else{var N=r(c);N!==null&&K(k,N.startTime-_)}}function x(_,N){h=!1,m&&(m=!1,v(M),M=-1),p=!0;var H=f;try{for(y(N),d=r(l);d!==null&&(!(d.expirationTime>N)||_&&!R());){var G=d.callback;if(typeof G=="function"){d.callback=null,f=d.priorityLevel;var J=G(d.expirationTime<=N);N=e.unstable_now(),typeof J=="function"?d.callback=J:d===r(l)&&n(l),y(N)}else n(l);d=r(l)}if(d!==null)var _e=!0;else{var oe=r(c);oe!==null&&K(k,oe.startTime-N),_e=!1}return _e}finally{d=null,f=H,p=!1}}var w=!1,E=null,M=-1,C=5,T=-1;function R(){return!(e.unstable_now()-T_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return r(l)},e.unstable_next=function(_){switch(f){case 1:case 2:case 3:var N=3;break;default:N=f}var H=f;f=N;try{return _()}finally{f=H}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,N){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var H=f;f=_;try{return N()}finally{f=H}},e.unstable_scheduleCallback=function(_,N,H){var G=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0G?(_.sortIndex=H,t(c,_),r(l)===null&&_===r(c)&&(m?(v(M),M=-1):m=!0,K(k,H-G))):(_.sortIndex=J,t(l,_),h||p||(h=!0,z(x))),_},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(_){var N=f;return function(){var H=f;f=N;try{return _.apply(this,arguments)}finally{f=H}}}})(PC);RC.exports=PC;var hV=RC.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var NC=S,an=hV;function D(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),I1=Object.prototype.hasOwnProperty,mV=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,A2={},R2={};function gV(e){return I1.call(R2,e)?!0:I1.call(A2,e)?!1:mV.test(e)?R2[e]=!0:(A2[e]=!0,!1)}function vV(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function yV(e,t,r,n){if(t===null||typeof t>"u"||vV(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Sr(e,t,r,n,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Jt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Jt[e]=new Sr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Jt[t]=new Sr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Jt[e]=new Sr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Jt[e]=new Sr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Jt[e]=new Sr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Jt[e]=new Sr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Jt[e]=new Sr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Jt[e]=new Sr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Jt[e]=new Sr(e,5,!1,e.toLowerCase(),null,!1,!1)});var py=/[\-:]([a-z])/g;function hy(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(py,hy);Jt[t]=new Sr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(py,hy);Jt[t]=new Sr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(py,hy);Jt[t]=new Sr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Jt[e]=new Sr(e,1,!1,e.toLowerCase(),null,!1,!1)});Jt.xlinkHref=new Sr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Jt[e]=new Sr(e,1,!1,e.toLowerCase(),null,!0,!0)});function my(e,t,r,n){var o=Jt.hasOwnProperty(t)?Jt[t]:null;(o!==null?o.type!==0:n||!(2a||o[s]!==i[a]){var l=` +`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{fg=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?jc(e):""}function bV(e){switch(e.tag){case 5:return jc(e.type);case 16:return jc("Lazy");case 13:return jc("Suspense");case 19:return jc("SuspenseList");case 0:case 2:case 15:return e=pg(e.type,!1),e;case 11:return e=pg(e.type.render,!1),e;case 1:return e=pg(e.type,!0),e;default:return""}}function B1(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ua:return"Fragment";case ja:return"Portal";case D1:return"Profiler";case gy:return"StrictMode";case $1:return"Suspense";case H1:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case IC:return(e.displayName||"Context")+".Consumer";case LC:return(e._context.displayName||"Context")+".Provider";case vy:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case yy:return t=e.displayName||null,t!==null?t:B1(e.type)||"Memo";case xi:t=e._payload,e=e._init;try{return B1(e(t))}catch{}}return null}function kV(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return B1(t);case 8:return t===gy?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function rs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $C(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function xV(e){var t=$C(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){n=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Kd(e){e._valueTracker||(e._valueTracker=xV(e))}function HC(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=$C(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Tp(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function F1(e,t){var r=t.checked;return lt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function N2(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=rs(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function BC(e,t){t=t.checked,t!=null&&my(e,"checked",t,!1)}function V1(e,t){BC(e,t);var r=rs(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?j1(e,t.type,r):t.hasOwnProperty("defaultValue")&&j1(e,t.type,rs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function z2(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function j1(e,t,r){(t!=="number"||Tp(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Uc=Array.isArray;function al(e,t,r,n){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=qd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Bu(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var su={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},wV=["Webkit","ms","Moz","O"];Object.keys(su).forEach(function(e){wV.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),su[t]=su[e]})});function UC(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||su.hasOwnProperty(e)&&su[e]?(""+t).trim():t+"px"}function WC(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,o=UC(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}var SV=lt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function K1(e,t){if(t){if(SV[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(D(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(D(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(D(61))}if(t.style!=null&&typeof t.style!="object")throw Error(D(62))}}function q1(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var G1=null;function by(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Y1=null,ll=null,cl=null;function D2(e){if(e=Od(e)){if(typeof Y1!="function")throw Error(D(280));var t=e.stateNode;t&&(t=Nh(t),Y1(e.stateNode,e.type,t))}}function KC(e){ll?cl?cl.push(e):cl=[e]:ll=e}function qC(){if(ll){var e=ll,t=cl;if(cl=ll=null,D2(e),t)for(e=0;e>>=0,e===0?32:31-(zV(e)/LV|0)|0}var Gd=64,Yd=4194304;function Wc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Rp(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,o=e.suspendedLanes,i=e.pingedLanes,s=r&268435455;if(s!==0){var a=s&~o;a!==0?n=Wc(a):(i&=s,i!==0&&(n=Wc(i)))}else s=r&~o,s!==0?n=Wc(s):i!==0&&(n=Wc(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&o)&&(o=n&-n,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Md(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Jn(t),e[t]=r}function HV(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=lu),K2=String.fromCharCode(32),q2=!1;function pM(e,t){switch(e){case"keyup":return pj.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hM(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wa=!1;function mj(e,t){switch(e){case"compositionend":return hM(t);case"keypress":return t.which!==32?null:(q2=!0,K2);case"textInput":return e=t.data,e===K2&&q2?null:e;default:return null}}function gj(e,t){if(Wa)return e==="compositionend"||!Ty&&pM(e,t)?(e=dM(),Pf=Ey=_i=null,Wa=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=X2(r)}}function yM(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yM(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function bM(){for(var e=window,t=Tp();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Tp(e.document)}return t}function Oy(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Cj(e){var t=bM(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&yM(r.ownerDocument.documentElement,r)){if(n!==null&&Oy(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=r.textContent.length,i=Math.min(n.start,o);n=n.end===void 0?i:Math.min(n.end,o),!e.extend&&i>n&&(o=n,n=i,i=o),o=Q2(r,i);var s=Q2(r,n);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Ka=null,t0=null,uu=null,r0=!1;function Z2(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;r0||Ka==null||Ka!==Tp(n)||(n=Ka,"selectionStart"in n&&Oy(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),uu&&Ku(uu,n)||(uu=n,n=zp(t0,"onSelect"),0Ya||(e.current=l0[Ya],l0[Ya]=null,Ya--)}function qe(e,t){Ya++,l0[Ya]=e.current,e.current=t}var ns={},lr=ds(ns),Nr=ds(!1),ra=ns;function Al(e,t){var r=e.type.contextTypes;if(!r)return ns;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in r)o[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function zr(e){return e=e.childContextTypes,e!=null}function Ip(){Ze(Nr),Ze(lr)}function sw(e,t,r){if(lr.current!==ns)throw Error(D(168));qe(lr,t),qe(Nr,r)}function OM(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var o in n)if(!(o in t))throw Error(D(108,kV(e)||"Unknown",o));return lt({},r,n)}function Dp(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ns,ra=lr.current,qe(lr,e),qe(Nr,Nr.current),!0}function aw(e,t,r){var n=e.stateNode;if(!n)throw Error(D(169));r?(e=OM(e,t,ra),n.__reactInternalMemoizedMergedChildContext=e,Ze(Nr),Ze(lr),qe(lr,e)):Ze(Nr),qe(Nr,r)}var Do=null,zh=!1,Tg=!1;function _M(e){Do===null?Do=[e]:Do.push(e)}function Dj(e){zh=!0,_M(e)}function fs(){if(!Tg&&Do!==null){Tg=!0;var e=0,t=$e;try{var r=Do;for($e=1;e>=s,o-=s,Vo=1<<32-Jn(t)+o|r<M?(C=E,E=null):C=E.sibling;var T=f(v,E,y[M],k);if(T===null){E===null&&(E=C);break}e&&E&&T.alternate===null&&t(v,E),g=i(T,g,M),w===null?x=T:w.sibling=T,w=T,E=C}if(M===y.length)return r(v,E),rt&&Cs(v,M),x;if(E===null){for(;MM?(C=E,E=null):C=E.sibling;var R=f(v,E,T.value,k);if(R===null){E===null&&(E=C);break}e&&E&&R.alternate===null&&t(v,E),g=i(R,g,M),w===null?x=R:w.sibling=R,w=R,E=C}if(T.done)return r(v,E),rt&&Cs(v,M),x;if(E===null){for(;!T.done;M++,T=y.next())T=d(v,T.value,k),T!==null&&(g=i(T,g,M),w===null?x=T:w.sibling=T,w=T);return rt&&Cs(v,M),x}for(E=n(v,E);!T.done;M++,T=y.next())T=p(E,v,M,T.value,k),T!==null&&(e&&T.alternate!==null&&E.delete(T.key===null?M:T.key),g=i(T,g,M),w===null?x=T:w.sibling=T,w=T);return e&&E.forEach(function(B){return t(v,B)}),rt&&Cs(v,M),x}function b(v,g,y,k){if(typeof y=="object"&&y!==null&&y.type===Ua&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Wd:e:{for(var x=y.key,w=g;w!==null;){if(w.key===x){if(x=y.type,x===Ua){if(w.tag===7){r(v,w.sibling),g=o(w,y.props.children),g.return=v,v=g;break e}}else if(w.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===xi&&hw(x)===w.type){r(v,w.sibling),g=o(w,y.props),g.ref=dc(v,w,y),g.return=v,v=g;break e}r(v,w);break}else t(v,w);w=w.sibling}y.type===Ua?(g=Ws(y.props.children,v.mode,k,y.key),g.return=v,v=g):(k=Bf(y.type,y.key,y.props,null,v.mode,k),k.ref=dc(v,g,y),k.return=v,v=k)}return s(v);case ja:e:{for(w=y.key;g!==null;){if(g.key===w)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){r(v,g.sibling),g=o(g,y.children||[]),g.return=v,v=g;break e}else{r(v,g);break}else t(v,g);g=g.sibling}g=Lg(y,v.mode,k),g.return=v,v=g}return s(v);case xi:return w=y._init,b(v,g,w(y._payload),k)}if(Uc(y))return h(v,g,y,k);if(sc(y))return m(v,g,y,k);rf(v,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,g!==null&&g.tag===6?(r(v,g.sibling),g=o(g,y),g.return=v,v=g):(r(v,g),g=zg(y,v.mode,k),g.return=v,v=g),s(v)):r(v,g)}return b}var Pl=DM(!0),$M=DM(!1),_d={},vo=ds(_d),Ju=ds(_d),Xu=ds(_d);function Ds(e){if(e===_d)throw Error(D(174));return e}function Dy(e,t){switch(qe(Xu,t),qe(Ju,e),qe(vo,_d),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:W1(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=W1(t,e)}Ze(vo),qe(vo,t)}function Nl(){Ze(vo),Ze(Ju),Ze(Xu)}function HM(e){Ds(Xu.current);var t=Ds(vo.current),r=W1(t,e.type);t!==r&&(qe(Ju,e),qe(vo,r))}function $y(e){Ju.current===e&&(Ze(vo),Ze(Ju))}var it=ds(0);function jp(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Og=[];function Hy(){for(var e=0;er?r:4,e(!0);var n=_g.transition;_g.transition={};try{e(!1),t()}finally{$e=r,_g.transition=n}}function t3(){return On().memoizedState}function Fj(e,t,r){var n=ji(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},r3(e))n3(t,r);else if(r=NM(e,t,r,n),r!==null){var o=gr();Xn(r,e,n,o),o3(r,t,n)}}function Vj(e,t,r){var n=ji(e),o={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(r3(e))n3(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,r);if(o.hasEagerState=!0,o.eagerState=a,to(a,s)){var l=t.interleaved;l===null?(o.next=o,Ly(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}r=NM(e,t,o,n),r!==null&&(o=gr(),Xn(r,e,n,o),o3(r,t,n))}}function r3(e){var t=e.alternate;return e===st||t!==null&&t===st}function n3(e,t){du=Up=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function o3(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,xy(e,r)}}var Wp={readContext:Tn,useCallback:er,useContext:er,useEffect:er,useImperativeHandle:er,useInsertionEffect:er,useLayoutEffect:er,useMemo:er,useReducer:er,useRef:er,useState:er,useDebugValue:er,useDeferredValue:er,useTransition:er,useMutableSource:er,useSyncExternalStore:er,useId:er,unstable_isNewReconciler:!1},jj={readContext:Tn,useCallback:function(e,t){return lo().memoizedState=[e,t===void 0?null:t],e},useContext:Tn,useEffect:gw,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,If(4194308,4,JM.bind(null,t,e),r)},useLayoutEffect:function(e,t){return If(4194308,4,e,t)},useInsertionEffect:function(e,t){return If(4,2,e,t)},useMemo:function(e,t){var r=lo();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=lo();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=Fj.bind(null,st,e),[n.memoizedState,e]},useRef:function(e){var t=lo();return e={current:e},t.memoizedState=e},useState:mw,useDebugValue:Uy,useDeferredValue:function(e){return lo().memoizedState=e},useTransition:function(){var e=mw(!1),t=e[0];return e=Bj.bind(null,e[1]),lo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=st,o=lo();if(rt){if(r===void 0)throw Error(D(407));r=r()}else{if(r=t(),Bt===null)throw Error(D(349));oa&30||VM(n,t,r)}o.memoizedState=r;var i={value:r,getSnapshot:t};return o.queue=i,gw(UM.bind(null,n,i,e),[e]),n.flags|=2048,ed(9,jM.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=lo(),t=Bt.identifierPrefix;if(rt){var r=jo,n=Vo;r=(n&~(1<<32-Jn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Qu++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=s.createElement(r,{is:n.is}):(e=s.createElement(r),r==="select"&&(s=e,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):e=s.createElementNS(e,r),e[po]=t,e[Yu]=n,p3(e,t,!1,!1),t.stateNode=e;e:{switch(s=q1(r,n),r){case"dialog":Qe("cancel",e),Qe("close",e),o=n;break;case"iframe":case"object":case"embed":Qe("load",e),o=n;break;case"video":case"audio":for(o=0;oLl&&(t.flags|=128,n=!0,fc(i,!1),t.lanes=4194304)}else{if(!n)if(e=jp(s),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),fc(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!rt)return tr(t),null}else 2*ht()-i.renderingStartTime>Ll&&r!==1073741824&&(t.flags|=128,n=!0,fc(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(r=i.last,r!==null?r.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=ht(),t.sibling=null,r=it.current,qe(it,n?r&1|2:r&1),t):(tr(t),null);case 22:case 23:return Jy(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Jr&1073741824&&(tr(t),t.subtreeFlags&6&&(t.flags|=8192)):tr(t),null;case 24:return null;case 25:return null}throw Error(D(156,t.tag))}function Xj(e,t){switch(Ay(t),t.tag){case 1:return zr(t.type)&&Ip(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Nl(),Ze(Nr),Ze(lr),Hy(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return $y(t),null;case 13:if(Ze(it),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(D(340));Rl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ze(it),null;case 4:return Nl(),null;case 10:return zy(t.type._context),null;case 22:case 23:return Jy(),null;case 24:return null;default:return null}}var of=!1,sr=!1,Qj=typeof WeakSet=="function"?WeakSet:Set,X=null;function Za(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){ft(e,t,n)}else r.current=null}function k0(e,t,r){try{r()}catch(n){ft(e,t,n)}}var Cw=!1;function Zj(e,t){if(n0=Pp,e=bM(),Oy(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var o=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var p;d!==r||o!==0&&d.nodeType!==3||(a=s+o),d!==i||n!==0&&d.nodeType!==3||(l=s+n),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===r&&++c===o&&(a=s),f===i&&++u===n&&(l=s),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(o0={focusedElem:e,selectionRange:r},Pp=!1,X=t;X!==null;)if(t=X,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,X=e;else for(;X!==null;){t=X;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var m=h.memoizedProps,b=h.memoizedState,v=t.stateNode,g=v.getSnapshotBeforeUpdate(t.elementType===t.type?m:Vn(t.type,m),b);v.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(D(163))}}catch(k){ft(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,X=e;break}X=t.return}return h=Cw,Cw=!1,h}function fu(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&k0(t,r,i)}o=o.next}while(o!==n)}}function Dh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function x0(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function g3(e){var t=e.alternate;t!==null&&(e.alternate=null,g3(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[po],delete t[Yu],delete t[a0],delete t[Lj],delete t[Ij])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function v3(e){return e.tag===5||e.tag===3||e.tag===4}function Mw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||v3(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function w0(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Lp));else if(n!==4&&(e=e.child,e!==null))for(w0(e,t,r),e=e.sibling;e!==null;)w0(e,t,r),e=e.sibling}function S0(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(S0(e,t,r),e=e.sibling;e!==null;)S0(e,t,r),e=e.sibling}var Kt=null,jn=!1;function di(e,t,r){for(r=r.child;r!==null;)y3(e,t,r),r=r.sibling}function y3(e,t,r){if(go&&typeof go.onCommitFiberUnmount=="function")try{go.onCommitFiberUnmount(_h,r)}catch{}switch(r.tag){case 5:sr||Za(r,t);case 6:var n=Kt,o=jn;Kt=null,di(e,t,r),Kt=n,jn=o,Kt!==null&&(jn?(e=Kt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Kt.removeChild(r.stateNode));break;case 18:Kt!==null&&(jn?(e=Kt,r=r.stateNode,e.nodeType===8?Mg(e.parentNode,r):e.nodeType===1&&Mg(e,r),Uu(e)):Mg(Kt,r.stateNode));break;case 4:n=Kt,o=jn,Kt=r.stateNode.containerInfo,jn=!0,di(e,t,r),Kt=n,jn=o;break;case 0:case 11:case 14:case 15:if(!sr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){o=n=n.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&k0(r,t,s),o=o.next}while(o!==n)}di(e,t,r);break;case 1:if(!sr&&(Za(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){ft(r,t,a)}di(e,t,r);break;case 21:di(e,t,r);break;case 22:r.mode&1?(sr=(n=sr)||r.memoizedState!==null,di(e,t,r),sr=n):di(e,t,r);break;default:di(e,t,r)}}function Tw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Qj),t.forEach(function(n){var o=lU.bind(null,e,n);r.has(n)||(r.add(n),n.then(o,o))})}}function $n(e,t){var r=t.deletions;if(r!==null)for(var n=0;no&&(o=s),n&=~i}if(n=o,n=ht()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*tU(n/1960))-n,10e?16:e,Ai===null)var n=!1;else{if(e=Ai,Ai=null,Gp=0,Oe&6)throw Error(D(331));var o=Oe;for(Oe|=4,X=e.current;X!==null;){var i=X,s=i.child;if(X.flags&16){var a=i.deletions;if(a!==null){for(var l=0;lht()-Gy?Us(e,0):qy|=r),Lr(e,t)}function M3(e,t){t===0&&(e.mode&1?(t=Yd,Yd<<=1,!(Yd&130023424)&&(Yd=4194304)):t=1);var r=gr();e=Qo(e,t),e!==null&&(Md(e,t,r),Lr(e,r))}function aU(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),M3(e,r)}function lU(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(D(314))}n!==null&&n.delete(t),M3(e,r)}var T3;T3=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Nr.current)Ar=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Ar=!1,Yj(e,t,r);Ar=!!(e.flags&131072)}else Ar=!1,rt&&t.flags&1048576&&AM(t,Hp,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Df(e,t),e=t.pendingProps;var o=Al(t,lr.current);dl(t,r),o=Fy(null,t,n,e,o,r);var i=Vy();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,zr(n)?(i=!0,Dp(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Iy(t),o.updater=Lh,t.stateNode=o,o._reactInternals=t,p0(t,n,e,r),t=g0(null,t,n,!0,i,r)):(t.tag=0,rt&&i&&_y(t),fr(null,t,o,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Df(e,t),e=t.pendingProps,o=n._init,n=o(n._payload),t.type=n,o=t.tag=uU(n),e=Vn(n,e),o){case 0:t=m0(null,t,n,e,r);break e;case 1:t=ww(null,t,n,e,r);break e;case 11:t=kw(null,t,n,e,r);break e;case 14:t=xw(null,t,n,Vn(n.type,e),r);break e}throw Error(D(306,n,""))}return t;case 0:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Vn(n,o),m0(e,t,n,o,r);case 1:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Vn(n,o),ww(e,t,n,o,r);case 3:e:{if(u3(t),e===null)throw Error(D(387));n=t.pendingProps,i=t.memoizedState,o=i.element,zM(e,t),Vp(t,n,null,r);var s=t.memoizedState;if(n=s.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=zl(Error(D(423)),t),t=Sw(e,t,n,r,o);break e}else if(n!==o){o=zl(Error(D(424)),t),t=Sw(e,t,n,r,o);break e}else for(tn=Bi(t.stateNode.containerInfo.firstChild),rn=t,rt=!0,Wn=null,r=$M(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Rl(),n===o){t=Zo(e,t,r);break e}fr(e,t,n,r)}t=t.child}return t;case 5:return HM(t),e===null&&u0(t),n=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,i0(n,o)?s=null:i!==null&&i0(n,i)&&(t.flags|=32),c3(e,t),fr(e,t,s,r),t.child;case 6:return e===null&&u0(t),null;case 13:return d3(e,t,r);case 4:return Dy(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Pl(t,null,n,r):fr(e,t,n,r),t.child;case 11:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Vn(n,o),kw(e,t,n,o,r);case 7:return fr(e,t,t.pendingProps,r),t.child;case 8:return fr(e,t,t.pendingProps.children,r),t.child;case 12:return fr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,qe(Bp,n._currentValue),n._currentValue=s,i!==null)if(to(i.value,s)){if(i.children===o.children&&!Nr.current){t=Zo(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=qo(-1,r&-r),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),d0(i.return,r,t),a.lanes|=r;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(D(341));s.lanes|=r,a=s.alternate,a!==null&&(a.lanes|=r),d0(s,r,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}fr(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,n=t.pendingProps.children,dl(t,r),o=Tn(o),n=n(o),t.flags|=1,fr(e,t,n,r),t.child;case 14:return n=t.type,o=Vn(n,t.pendingProps),o=Vn(n.type,o),xw(e,t,n,o,r);case 15:return a3(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Vn(n,o),Df(e,t),t.tag=1,zr(n)?(e=!0,Dp(t)):e=!1,dl(t,r),IM(t,n,o),p0(t,n,o,r),g0(null,t,n,!0,e,r);case 19:return f3(e,t,r);case 22:return l3(e,t,r)}throw Error(D(156,t.tag))};function O3(e,t){return eM(e,t)}function cU(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xn(e,t,r,n){return new cU(e,t,r,n)}function Qy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function uU(e){if(typeof e=="function")return Qy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===vy)return 11;if(e===yy)return 14}return 2}function Ui(e,t){var r=e.alternate;return r===null?(r=xn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Bf(e,t,r,n,o,i){var s=2;if(n=e,typeof e=="function")Qy(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Ua:return Ws(r.children,o,i,t);case gy:s=8,o|=8;break;case D1:return e=xn(12,r,t,o|2),e.elementType=D1,e.lanes=i,e;case $1:return e=xn(13,r,t,o),e.elementType=$1,e.lanes=i,e;case H1:return e=xn(19,r,t,o),e.elementType=H1,e.lanes=i,e;case DC:return Hh(r,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case LC:s=10;break e;case IC:s=9;break e;case vy:s=11;break e;case yy:s=14;break e;case xi:s=16,n=null;break e}throw Error(D(130,e==null?e:typeof e,""))}return t=xn(s,r,t,o),t.elementType=e,t.type=n,t.lanes=i,t}function Ws(e,t,r,n){return e=xn(7,e,n,t),e.lanes=r,e}function Hh(e,t,r,n){return e=xn(22,e,n,t),e.elementType=DC,e.lanes=r,e.stateNode={isHidden:!1},e}function zg(e,t,r){return e=xn(6,e,null,t),e.lanes=r,e}function Lg(e,t,r){return t=xn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function dU(e,t,r,n,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=mg(0),this.expirationTimes=mg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mg(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Zy(e,t,r,n,o,i,s,a,l){return e=new dU(e,t,r,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=xn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Iy(i),e}function fU(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(P3)}catch(e){console.error(e)}}P3(),AC.exports=cn;var Uh=AC.exports;const lf=Eo(Uh);var vU=Object.defineProperty,yU=Object.getOwnPropertyDescriptor,bU=(e,t,r,n)=>{for(var o=n>1?void 0:n?yU(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&vU(t,r,o),o},N3=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},re=(e,t,r)=>(N3(e,t,"read from private field"),r?r.call(e):t.get(e)),Yr=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},qr=(e,t,r,n)=>(N3(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),qc,kU=class{constructor(){this.portals=new Map,Yr(this,qc,wh()),this.on=e=>re(this,qc).on("update",e),this.once=e=>{const t=re(this,qc).on("update",r=>{t(),e(r)});return t}}update(){re(this,qc).emit("update",this.portals)}render({Component:e,container:t}){const r=this.portals.get(t);this.portals.set(t,{Component:e,key:(r==null?void 0:r.key)??gl()}),this.update()}forceUpdate(){for(const[e,{Component:t}]of this.portals)this.portals.set(e,{Component:t,key:gl()})}remove(e){this.portals.delete(e),this.update()}};qc=new WeakMap;var xU=e=>{const{portals:t}=e;return L.createElement(L.Fragment,null,t.map(([r,{Component:n,key:o}])=>Uh.createPortal(L.createElement(n,null),r,o)))};function wU(e){const[t,r]=S.useState(()=>Array.from(e.portals.entries()));return S.useEffect(()=>e.on(n=>{r(Array.from(n.entries()))}),[e]),S.useMemo(()=>t,[t])}var ot,Gc,Ts,Yc,Ff,Jc,Ba,Xc,Vf,No,dr,O0,z3=class{constructor({getPosition:e,node:t,portalContainer:r,view:n,ReactComponent:o,options:i}){Yr(this,ot,void 0),Yr(this,Gc,[]),Yr(this,Ts,void 0),Yr(this,Yc,void 0),Yr(this,Ff,void 0),Yr(this,Jc,void 0),Yr(this,Ba,void 0),Yr(this,Xc,!1),Yr(this,Vf,void 0),Yr(this,No,void 0),Yr(this,dr,void 0),Yr(this,O0,l=>{l&&(te(re(this,No),{code:$.REACT_NODE_VIEW,message:`You have applied a ref to a node view provided for '${re(this,ot).type.name}' which doesn't support content.`}),l.append(re(this,No)))}),this.Component=()=>{const l=re(this,Ff);return te(l,{code:$.REACT_NODE_VIEW,message:`The custom react node view provided for ${re(this,ot).type.name} doesn't have a valid ReactComponent`}),L.createElement(l,{updateAttributes:this.updateAttributes,selected:this.selected,view:re(this,Ts),getPosition:re(this,Jc),node:re(this,ot),forwardRef:re(this,O0),decorations:re(this,Gc)})},this.updateAttributes=l=>{if(!re(this,Ts).editable)return;const c=re(this,Jc).call(this);if(c==null)return;const u=re(this,Ts).state.tr.setNodeMarkup(c,void 0,{...re(this,ot).attrs,...l});re(this,Ts).dispatch(u)},te(Ne(e),{message:"You are attempting to use a node view for a mark type. This is not supported yet. Please check your configuration."}),qr(this,ot,t),qr(this,Ts,n),qr(this,Yc,r),qr(this,Ff,o),qr(this,Jc,e),qr(this,Ba,i),qr(this,dr,this.createDom());const{contentDOM:s,wrapper:a}=this.createContentDom()??{};qr(this,Vf,s??void 0),qr(this,No,a),re(this,No)&&re(this,dr).append(re(this,No)),this.setDomAttributes(re(this,ot),re(this,dr)),this.Component.displayName=lS(`${re(this,ot).type.name}NodeView`),this.renderComponent()}static create(e){const{portalContainer:t,ReactComponent:r,options:n}=e;return(o,i,s)=>new z3({options:n,node:o,view:i,getPosition:s,portalContainer:t,ReactComponent:r})}get selected(){return re(this,Xc)}get contentDOM(){return re(this,Vf)}get dom(){return re(this,dr)}renderComponent(){re(this,Yc).render({Component:this.Component,container:re(this,dr)})}createDom(){const{defaultBlockNode:e,defaultInlineNode:t}=re(this,Ba),r=re(this,ot).isInline?document.createElement(t):document.createElement(e);return r.classList.add(`${Ek(re(this,ot).type.name)}-node-view-wrapper`),r}createContentDom(){var e,t;if(re(this,ot).isLeaf)return;const r=(t=(e=re(this,ot).type.spec).toDOM)==null?void 0:t.call(e,re(this,ot));if(!r)return;const{contentDOM:n,dom:o}=kn.renderSpec(document,r);let i;if(gt(o))return i=o,o===n&&(i=document.createElement("span"),i.classList.add(`${Ek(re(this,ot).type.name)}-node-view-content-wrapper`),i.append(n)),gt(n),{wrapper:i,contentDOM:n}}update(e,t){return vh({types:re(this,ot).type,node:e})?(re(this,ot)===e&&re(this,Gc)===t||(re(this,ot).sameMarkup(e)||this.setDomAttributes(e,re(this,dr)),qr(this,ot,e),qr(this,Gc,t),this.renderComponent()),!0):!1}setDomAttributes(e,t){const{toDOM:r}=re(this,ot).type.spec;let n=e.attrs;if(r){const o=r(e);if(ne(o)||SU(o))return;ss(o[1])&&(n=o[1])}for(const[o,i]of At(n))t.setAttribute(o,i)}selectNode(){qr(this,Xc,!0),re(this,dr)&&re(this,dr).classList.add(kk),this.renderComponent()}deselectNode(){qr(this,Xc,!1),re(this,dr)&&re(this,dr).classList.remove(kk),this.renderComponent()}destroy(){re(this,Yc).remove(re(this,dr))}ignoreMutation(e){return e.type==="selection"?!re(this,ot).type.spec.selectable:re(this,No)?!re(this,No).contains(e.target):!0}stopEvent(e){var t;if(!re(this,dr))return!1;if(Ne(re(this,Ba).stopEvent))return re(this,Ba).stopEvent({event:e});const r=e.target;if(!(re(this,dr).contains(r)&&!((t=this.contentDOM)!=null&&t.contains(r))))return!1;const o=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!o)return!0;const s=!!re(this,ot).type.spec.draggable,a=ce.isSelectable(re(this,ot)),l=e.type==="copy",c=e.type==="paste",u=e.type==="cut",d=e.type==="mousedown",f=e.type.startsWith("drag");return!s&&a&&f&&e.preventDefault(),!(f||o||l||c||u||d&&a)}},Lw=z3;ot=new WeakMap;Gc=new WeakMap;Ts=new WeakMap;Yc=new WeakMap;Ff=new WeakMap;Jc=new WeakMap;Ba=new WeakMap;Xc=new WeakMap;Vf=new WeakMap;No=new WeakMap;dr=new WeakMap;O0=new WeakMap;function SU(e){return cp(e)||ss(e)&&cp(e.dom)}var rd=class extends Ge{constructor(){super(...arguments),this.portalContainer=new kU}get name(){return"reactComponent"}onCreate(){this.store.setStoreKey("portalContainer",this.portalContainer)}createNodeViews(){const e=ee(),t=this.store.managerSettings.nodeViewComponents??{};for(const n of this.store.extensions)!n.ReactComponent||!xd(n)||n.reactComponentEnvironment==="ssr"||(e[n.name]=Lw.create({options:this.options,ReactComponent:n.ReactComponent,portalContainer:this.portalContainer}));const r=At({...this.options.nodeViewComponents,...t});for(const[n,o]of r)e[n]=Lw.create({options:this.options,ReactComponent:o,portalContainer:this.portalContainer});return e}};rd=bU([ye({defaultOptions:{defaultBlockNode:"div",defaultInlineNode:"span",defaultContentNode:"span",defaultEnvironment:"both",nodeViewComponents:{},stopEvent:null},staticKeys:["defaultBlockNode","defaultInlineNode","defaultContentNode","defaultEnvironment"]})],rd);function EU(e){const t=S.createContext(null),r=CU(t);return[o=>{const i=e(o);return L.createElement(t.Provider,{value:i},o.children)},r,t]}function CU(e){return(t,r)=>{const n=S.useContext(e),o=MU(n);if(!n)throw new Error("`useContextHook` must be placed inside the `Provider` returned by the `createContextState` method");if(!t)return n;if(typeof t!="function")throw new TypeError("invalid arguments passed to `useContextHook`. This hook must be called with zero arguments, a getter function or a path string.");const i=t(n);if(!o||!r)return i;const s=t(o);return r(s,i)?s:i}}function MU(e){const t=S.useRef();return TU(()=>{t.current=e}),t.current}var TU=typeof document<"u"?S.useLayoutEffect:S.useEffect;function OU(e,t){return EU(r=>{const n=S.useRef(null),o=S.useRef(),i=t==null?void 0:t(r),[s,a]=S.useState(()=>e({get:Iw(n),set:Dw(o),previousContext:void 0,props:r,state:i})),l=[...Object.values(r),i];return S.useEffect(()=>{l.length!==0&&a(c=>e({get:Iw(n),set:Dw(o),previousContext:c,props:r,state:i}))},l),n.current=s,o.current=a,s})}function Iw(e){return t=>{if(!e.current)throw new Error("`get` called outside of function scope. `get` can only be called within a function.");if(!t)return e.current;if(typeof t!="function")throw new TypeError("Invalid arguments passed to `useContextHook`. The hook must be called with zero arguments, a getter function or a path string.");return t(e.current)}}function Dw(e){return t=>{if(!e.current)throw new Error("`set` called outside of function scope. `set` can only be called within a function.");e.current(r=>({...r,...typeof t=="function"?t(r):t}))}}var L3={},I3={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.errorMessages=e.ErrorType=void 0;var t;(function(r){r.MalformedUnicode="MALFORMED_UNICODE",r.MalformedHexadecimal="MALFORMED_HEXADECIMAL",r.CodePointLimit="CODE_POINT_LIMIT",r.OctalDeprecation="OCTAL_DEPRECATION",r.EndOfString="END_OF_STRING"})(t=e.ErrorType||(e.ErrorType={})),e.errorMessages=new Map([[t.MalformedUnicode,"malformed Unicode character escape sequence"],[t.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[t.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[t.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[t.EndOfString,"malformed escape sequence at end of string"]])})(I3);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.unraw=e.errorMessages=e.ErrorType=void 0;const t=I3;Object.defineProperty(e,"ErrorType",{enumerable:!0,get:function(){return t.ErrorType}}),Object.defineProperty(e,"errorMessages",{enumerable:!0,get:function(){return t.errorMessages}});function r(p){return!p.match(/[^a-f0-9]/i)?parseInt(p,16):NaN}function n(p,h,m){const b=r(p);if(Number.isNaN(b)||m!==void 0&&m!==p.length)throw new SyntaxError(t.errorMessages.get(h));return b}function o(p){const h=n(p,t.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(h)}function i(p,h){const m=n(p,t.ErrorType.MalformedUnicode,4);if(h!==void 0){const b=n(h,t.ErrorType.MalformedUnicode,4);return String.fromCharCode(m,b)}return String.fromCharCode(m)}function s(p){return p.charAt(0)==="{"&&p.charAt(p.length-1)==="}"}function a(p){if(!s(p))throw new SyntaxError(t.errorMessages.get(t.ErrorType.MalformedUnicode));const h=p.slice(1,-1),m=n(h,t.ErrorType.MalformedUnicode);try{return String.fromCodePoint(m)}catch(b){throw b instanceof RangeError?new SyntaxError(t.errorMessages.get(t.ErrorType.CodePointLimit)):b}}function l(p,h=!1){if(h)throw new SyntaxError(t.errorMessages.get(t.ErrorType.OctalDeprecation));const m=parseInt(p,8);return String.fromCharCode(m)}const c=new Map([["b","\b"],["f","\f"],["n",` +`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function u(p){return c.get(p)||p}const d=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function f(p,h=!1){return p.replace(d,function(m,b,v,g,y,k,x,w,E){if(b!==void 0)return"\\";if(v!==void 0)return o(v);if(g!==void 0)return a(g);if(y!==void 0)return i(y,k);if(x!==void 0)return i(x);if(w==="0")return"\0";if(w!==void 0)return l(w,!h);if(E!==void 0)return u(E);throw new SyntaxError(t.errorMessages.get(t.ErrorType.EndOfString))})}e.unraw=f,e.default=f})(L3);const _U=Eo(L3),Uo=e=>typeof e=="string",AU=e=>typeof e=="function",$w=new Map;function nb(e){return[...Array.isArray(e)?e:[e],"en"]}function D3(e,t,r){const n=nb(e);return Xp(()=>Qp("date",n,r),()=>new Intl.DateTimeFormat(n,r)).format(Uo(t)?new Date(t):t)}function _0(e,t,r){const n=nb(e);return Xp(()=>Qp("number",n,r),()=>new Intl.NumberFormat(n,r)).format(t)}function Hw(e,t,r,{offset:n=0,...o}){const i=nb(e),s=t?Xp(()=>Qp("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):Xp(()=>Qp("plural-cardinal",i),()=>new Intl.PluralRules(i,{type:"cardinal"}));return o[r]??o[s.select(r-n)]??o.other}function Xp(e,t){const r=e();let n=$w.get(r);return n||(n=t(),$w.set(r,n)),n}function Qp(e,t,r){const n=t.join("-");return`${e}-${n}-${JSON.stringify(r)}`}const $3=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g,RU=(e,t,r={})=>{t=t||e;const n=i=>Uo(i)?r[i]||{style:i}:i,o=(i,s)=>{const a=Object.keys(r).length?n("number"):{},l=_0(t,i,a);return s.replace("#",l)};return{plural:(i,s)=>{const{offset:a=0}=s,l=Hw(t,!1,i,s);return o(i-a,l)},selectordinal:(i,s)=>{const{offset:a=0}=s,l=Hw(t,!0,i,s);return o(i-a,l)},select:(i,s)=>s[i]??s.other,number:(i,s)=>_0(t,i,n(s)),date:(i,s)=>D3(t,i,n(s)),undefined:i=>i}};function PU(e,t,r){return(n,o={})=>{const i=RU(t,r,o),s=l=>Array.isArray(l)?l.reduce((c,u)=>{if(Uo(u))return c+u;const[d,f,p]=u;let h={};p!=null&&!Uo(p)?Object.keys(p).forEach(b=>{h[b]=s(p[b])}):h=p;const m=i[f](n[d],h);return m==null?c:c+m},""):l,a=s(e);return Uo(a)&&$3.test(a)?_U(a.trim()):Uo(a)?a.trim():a}}var NU=Object.defineProperty,zU=(e,t,r)=>t in e?NU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,LU=(e,t,r)=>(zU(e,typeof t!="symbol"?t+"":t,r),r);class IU{constructor(){LU(this,"_events",{})}on(t,r){return this._hasEvent(t)||(this._events[t]=[]),this._events[t].push(r),()=>this.removeListener(t,r)}removeListener(t,r){if(!this._hasEvent(t))return;const n=this._events[t].indexOf(r);~n&&this._events[t].splice(n,1)}emit(t,...r){this._hasEvent(t)&&this._events[t].map(n=>n.apply(this,r))}_hasEvent(t){return Array.isArray(this._events[t])}}var DU=Object.defineProperty,$U=(e,t,r)=>t in e?DU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ca=(e,t,r)=>($U(e,typeof t!="symbol"?t+"":t,r),r);class HU extends IU{constructor(t){super(),Ca(this,"_locale"),Ca(this,"_locales"),Ca(this,"_localeData"),Ca(this,"_messages"),Ca(this,"_missing"),Ca(this,"t",this._.bind(this)),this._messages={},this._localeData={},t.missing!=null&&(this._missing=t.missing),t.messages!=null&&this.load(t.messages),t.localeData!=null&&this.loadLocaleData(t.localeData),(t.locale!=null||t.locales!=null)&&this.activate(t.locale,t.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(t,r){this._localeData[t]==null?this._localeData[t]=r:Object.assign(this._localeData[t],r)}loadLocaleData(t,r){r!=null?this._loadLocaleData(t,r):Object.keys(t).forEach(n=>this._loadLocaleData(n,t[n])),this.emit("change")}_load(t,r){this._messages[t]==null?this._messages[t]=r:Object.assign(this._messages[t],r)}load(t,r){r!=null?this._load(t,r):Object.keys(t).forEach(n=>this._load(n,t[n])),this.emit("change")}loadAndActivate({locale:t,locales:r,messages:n}){this._locale=t,this._locales=r||void 0,this._messages[this._locale]=n,this.emit("change")}activate(t,r){this._locale=t,this._locales=r,this.emit("change")}_(t,r={},{message:n,formats:o}={}){Uo(t)||(r=t.values||r,n=t.message,t=t.id);const i=!this.messages[t],s=this._missing;if(s&&i)return AU(s)?s(this._locale,t):s;i&&this.emit("missing",{id:t,locale:this._locale});let a=this.messages[t]||n||t;return Uo(a)&&$3.test(a)?JSON.parse(`"${a}"`):Uo(a)?a:PU(a,this._locale,this._locales)(r,o)}date(t,r){return D3(this._locales||this._locale,t,r)}number(t,r){return _0(this._locales||this._locale,t,r)}}function BU(e={}){return new HU(e)}const Wh=BU();function U(e,t){return t?"other":e==1?"one":"other"}function oi(e,t){return t?"other":e==0||e==1?"one":"other"}function Fr(e,t){var r=String(e).split("."),n=!r[1];return t?"other":e==1&&n?"one":"other"}function ze(e,t){return"other"}function ps(e,t){return t?"other":e==1?"one":e==2?"two":"other"}const FU=ze,VU=U,jU=oi;function UU(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const WU=U;function KU(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2);return t?"other":e==0?"zero":e==1?"one":e==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function qU(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2);return t?"other":e==0?"zero":e==1?"one":e==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function GU(e,t){return t?e==1||e==5||e==7||e==8||e==9||e==10?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const YU=U,JU=Fr;function XU(e,t){var r=String(e).split("."),n=r[0],o=n.slice(-1),i=n.slice(-2),s=n.slice(-3);return t?o==1||o==2||o==5||o==7||o==8||i==20||i==50||i==70||i==80?"one":o==3||o==4||s==100||s==200||s==300||s==400||s==500||s==600||s==700||s==800||s==900?"few":n==0||o==6||i==40||i==60||i==90?"many":"other":e==1?"one":"other"}function QU(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2);return t?(o==2||o==3)&&i!=12&&i!=13?"few":"other":o==1&&i!=11?"one":o>=2&&o<=4&&(i<12||i>14)?"few":n&&o==0||o>=5&&o<=9||i>=11&&i<=14?"many":"other"}const ZU=U,eW=U,tW=U,rW=oi,nW=ze;function oW(e,t){return t?e==1||e==5||e==7||e==8||e==9||e==10?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const iW=ze;function sW(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2),s=n&&r[0].slice(-6);return t?"other":o==1&&i!=11&&i!=71&&i!=91?"one":o==2&&i!=12&&i!=72&&i!=92?"two":(o==3||o==4||o==9)&&(i<10||i>19)&&(i<70||i>79)&&(i<90||i>99)?"few":e!=0&&n&&s==0?"many":"other"}const aW=U;function lW(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function cW(e,t){var r=String(e).split("."),n=!r[1];return t?e==1||e==3?"one":e==2?"two":e==4?"few":"other":e==1&&n?"one":"other"}const uW=U;function dW(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?"other":i&&(n==1||n==2||n==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const fW=U,pW=U,hW=U;function mW(e,t){var r=String(e).split("."),n=r[0],o=!r[1];return t?"other":e==1&&o?"one":n>=2&&n<=4&&o?"few":o?"other":"many"}function gW(e,t){return t?e==0||e==7||e==8||e==9?"zero":e==1?"one":e==2?"two":e==3||e==4?"few":e==5||e==6?"many":"other":e==0?"zero":e==1?"one":e==2?"two":e==3?"few":e==6?"many":"other"}function vW(e,t){var r=String(e).split("."),n=r[0],o=Number(r[0])==e;return t?"other":e==1||!o&&(n==0||n==1)?"one":"other"}const yW=Fr;function bW(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-2),a=o.slice(-2);return t?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}const kW=U,xW=ze,wW=U,SW=U;function EW(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?i==1&&s!=11?"one":i==2&&s!=12?"two":i==3&&s!=13?"few":"other":e==1&&n?"one":"other"}const CW=U,MW=U,TW=Fr,OW=U;function _W(e,t){return t?"other":e>=0&&e<=1?"one":"other"}function AW(e,t){return t?"other":e>=0&&e<2?"one":"other"}const RW=Fr;function PW(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?e==1?"one":"other":i&&(n==1||n==2||n==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const NW=U;function zW(e,t){return t?e==1?"one":"other":e>=0&&e<2?"one":"other"}const LW=U,IW=Fr;function DW(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?e==1?"one":"other":e==1?"one":e==2?"two":n&&e>=3&&e<=6?"few":n&&e>=7&&e<=10?"many":"other"}function $W(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?e==1||e==11?"one":e==2||e==12?"two":e==3||e==13?"few":"other":e==1||e==11?"one":e==2||e==12?"two":n&&e>=3&&e<=10||n&&e>=13&&e<=19?"few":"other"}const HW=Fr,BW=U;function FW(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const VW=oi;function jW(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":o&&i==1?"one":o&&i==2?"two":o&&(s==0||s==20||s==40||s==60||s==80)?"few":o?"other":"many"}const UW=U,WW=U;function KW(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1);return t?"other":e==1&&o?"one":n==2&&o?"two":o&&(e<0||e>10)&&i&&s==0?"many":"other"}function qW(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}function GW(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function YW(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-2),a=o.slice(-2);return t?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}function JW(e,t){return t?e==1||e==5?"one":"other":e==1?"one":"other"}function XW(e,t){return t?e==1?"one":"other":e>=0&&e<2?"one":"other"}const QW=Fr,ZW=ze,eK=ze,tK=ze,rK=Fr;function nK(e,t){var r=String(e).split("."),n=r[0],o=Number(r[0])==e,i=n.slice(-1),s=n.slice(-2);return t?"other":o&&i==1&&s!=11||!o?"one":"other"}function oK(e,t){var r=String(e).split("."),n=!r[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&n?"one":"other"}const iK=ps;function sK(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1);return t?"other":e==1&&o?"one":n==2&&o?"two":o&&(e<0||e>10)&&i&&s==0?"many":"other"}const aK=ze,lK=ze,cK=U,uK=Fr,dK=U,fK=ze,pK=ze;function hK(e,t){var r=String(e).split("."),n=r[0],o=n.slice(-2);return t?n==1?"one":n==0||o>=2&&o<=20||o==40||o==60||o==80?"many":"other":e==1?"one":"other"}function mK(e,t){return t?"other":e>=0&&e<2?"one":"other"}const gK=U,vK=U,yK=ze,bK=ze;function kK(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1);return t?o==6||o==9||n&&o==0&&e!=0?"many":"other":e==1?"one":"other"}const xK=U,wK=U,SK=ze;function EK(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const CK=ze,MK=U,TK=U;function OK(e,t){return t?"other":e==0?"zero":e==1?"one":"other"}const _K=U;function AK(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2),i=n&&r[0].slice(-3),s=n&&r[0].slice(-5),a=n&&r[0].slice(-6);return t?n&&e>=1&&e<=4||o>=1&&o<=4||o>=21&&o<=24||o>=41&&o<=44||o>=61&&o<=64||o>=81&&o<=84?"one":e==5||o==5?"many":"other":e==0?"zero":e==1?"one":o==2||o==22||o==42||o==62||o==82||n&&i==0&&(s>=1e3&&s<=2e4||s==4e4||s==6e4||s==8e4)||e!=0&&a==1e5?"two":o==3||o==23||o==43||o==63||o==83?"few":e!=1&&(o==1||o==21||o==41||o==61||o==81)?"many":"other"}const RK=U;function PK(e,t){var r=String(e).split("."),n=r[0];return t?"other":e==0?"zero":(n==0||n==1)&&e!=0?"one":"other"}const NK=U,zK=U,LK=ze,IK=oi;function DK(e,t){return t&&e==1?"one":"other"}function $K(e,t){var r=String(e).split("."),n=r[1]||"",o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?"other":i==1&&(s<11||s>19)?"one":i>=2&&i<=9&&(s<11||s>19)?"few":n!=0?"many":"other"}function HK(e,t){var r=String(e).split("."),n=r[1]||"",o=n.length,i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-2),c=n.slice(-1);return t?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const BK=U,FK=oi,VK=U;function jK(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?s==1&&a!=11?"one":s==2&&a!=12?"two":(s==7||s==8)&&a!=17&&a!=18?"many":"other":i&&s==1&&a!=11||l==1&&c!=11?"one":"other"}const UK=U,WK=U;function KK(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-2);return t?e==1?"one":"other":e==1&&n?"one":!n||e==0||i>=2&&i<=19?"few":"other"}function qK(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":"other":e==1?"one":"other"}function GK(e,t){return t&&e==1?"one":"other"}function YK(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2);return t?"other":e==1?"one":e==0||o>=2&&o<=10?"few":o>=11&&o<=19?"many":"other"}const JK=ze,XK=U,QK=ps,ZK=U,eq=U;function tq(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?n&&e>=1&&e<=4?"one":"other":e==1?"one":"other"}const rq=Fr,nq=U,oq=U,iq=U,sq=ze,aq=U,lq=oi,cq=U,uq=U,dq=U;function fq(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?e==1||e==5||n&&e>=7&&e<=9?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e==1?"one":"other"}const pq=U,hq=ze,mq=oi,gq=U;function vq(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":e==1&&o?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&n!=1&&(i==0||i==1)||o&&i>=5&&i<=9||o&&s>=12&&s<=14?"many":"other"}function yq(e,t){var r=String(e).split("."),n=r[1]||"",o=n.length,i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-2),c=n.slice(-1);return t?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const bq=U;function kq(e,t){var r=String(e).split("."),n=r[0];return t?"other":n==0||n==1?"one":"other"}const xq=Fr,wq=U;function Sq(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-2);return t?e==1?"one":"other":e==1&&n?"one":!n||e==0||i>=2&&i<=19?"few":"other"}const Eq=U,Cq=ze;function Mq(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":o&&i==1&&s!=11?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&i==0||o&&i>=5&&i<=9||o&&s>=11&&s<=14?"many":"other"}const Tq=U,Oq=ze,_q=U;function Aq(e,t){var r=String(e).split("."),n=!r[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&n?"one":"other"}function Rq(e,t){var r=String(e).split("."),n=!r[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&n?"one":"other"}const Pq=U,Nq=U,zq=ps,Lq=U,Iq=ze,Dq=ze;function $q(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function Hq(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?"other":e>=0&&e<=1?"one":n&&e>=2&&e<=10?"few":"other"}function Bq(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"";return t?"other":e==0||e==1||n==0&&o==1?"one":"other"}function Fq(e,t){var r=String(e).split("."),n=r[0],o=!r[1];return t?"other":e==1&&o?"one":n>=2&&n<=4&&o?"few":o?"other":"many"}function Vq(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-2);return t?"other":o&&i==1?"one":o&&i==2?"two":o&&(i==3||i==4)||!o?"few":"other"}const jq=ps,Uq=ps,Wq=ps,Kq=ps,qq=ps,Gq=U,Yq=U;function Jq(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2);return t?e==1?"one":o==4&&i!=14?"many":"other":e==1?"one":"other"}function Xq(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}const Qq=U,Zq=U,eG=U,tG=ze;function rG(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?(i==1||i==2)&&s!=11&&s!=12?"one":"other":e==1&&n?"one":"other"}const nG=Fr,oG=U,iG=U,sG=U,aG=U,lG=ze,cG=oi,uG=U;function dG(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1);return t?o==6||o==9||e==10?"few":"other":e==1?"one":"other"}function fG(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?e==1?"one":"other":i&&(n==1||n==2||n==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const pG=U,hG=ze,mG=U,gG=U;function vG(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?"other":e==0||e==1||n&&e>=11&&e<=99?"one":"other"}const yG=U;function bG(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-1),c=n.slice(-2);return t?s==3&&a!=13?"few":"other":o&&l==1&&c!=11?"one":o&&l>=2&&l<=4&&(c<12||c>14)?"few":o&&l==0||o&&l>=5&&l<=9||o&&c>=11&&c<=14?"many":"other"}const kG=Fr,xG=U,wG=U;function SG(e,t){return t&&e==1?"one":"other"}const EG=U,CG=U,MG=oi,TG=U,OG=ze,_G=U,AG=U,RG=Fr,PG=ze,NG=ze,zG=ze;function LG(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const IG=Object.freeze(Object.defineProperty({__proto__:null,_in:FU,af:VU,ak:jU,am:UU,an:WU,ar:KU,ars:qU,as:GU,asa:YU,ast:JU,az:XU,be:QU,bem:ZU,bez:eW,bg:tW,bho:rW,bm:nW,bn:oW,bo:iW,br:sW,brx:aW,bs:lW,ca:cW,ce:uW,ceb:dW,cgg:fW,chr:pW,ckb:hW,cs:mW,cy:gW,da:vW,de:yW,dsb:bW,dv:kW,dz:xW,ee:wW,el:SW,en:EW,eo:CW,es:MW,et:TW,eu:OW,fa:_W,ff:AW,fi:RW,fil:PW,fo:NW,fr:zW,fur:LW,fy:IW,ga:DW,gd:$W,gl:HW,gsw:BW,gu:FW,guw:VW,gv:jW,ha:UW,haw:WW,he:KW,hi:qW,hr:GW,hsb:YW,hu:JW,hy:XW,ia:QW,id:ZW,ig:eK,ii:tK,io:rK,is:nK,it:oK,iu:iK,iw:sK,ja:aK,jbo:lK,jgo:cK,ji:uK,jmc:dK,jv:fK,jw:pK,ka:hK,kab:mK,kaj:gK,kcg:vK,kde:yK,kea:bK,kk:kK,kkj:xK,kl:wK,km:SK,kn:EK,ko:CK,ks:MK,ksb:TK,ksh:OK,ku:_K,kw:AK,ky:RK,lag:PK,lb:NK,lg:zK,lkt:LK,ln:IK,lo:DK,lt:$K,lv:HK,mas:BK,mg:FK,mgo:VK,mk:jK,ml:UK,mn:WK,mo:KK,mr:qK,ms:GK,mt:YK,my:JK,nah:XK,naq:QK,nb:ZK,nd:eq,ne:tq,nl:rq,nn:nq,nnh:oq,no:iq,nqo:sq,nr:aq,nso:lq,ny:cq,nyn:uq,om:dq,or:fq,os:pq,osa:hq,pa:mq,pap:gq,pl:vq,prg:yq,ps:bq,pt:kq,pt_PT:xq,rm:wq,ro:Sq,rof:Eq,root:Cq,ru:Mq,rwk:Tq,sah:Oq,saq:_q,sc:Aq,scn:Rq,sd:Pq,sdh:Nq,se:zq,seh:Lq,ses:Iq,sg:Dq,sh:$q,shi:Hq,si:Bq,sk:Fq,sl:Vq,sma:jq,smi:Uq,smj:Wq,smn:Kq,sms:qq,sn:Gq,so:Yq,sq:Jq,sr:Xq,ss:Qq,ssy:Zq,st:eG,su:tG,sv:rG,sw:nG,syr:oG,ta:iG,te:sG,teo:aG,th:lG,ti:cG,tig:uG,tk:dG,tl:fG,tn:pG,to:hG,tr:mG,ts:gG,tzm:vG,ug:yG,uk:bG,ur:kG,uz:xG,ve:wG,vi:SG,vo:EG,vun:CG,wa:MG,wae:TG,wo:OG,xh:_G,xog:AG,yi:RG,yo:PG,yue:NG,zh:zG,zu:LG},Symbol.toStringTag,{value:"Module"}));var DG=Object.defineProperty,$G=Object.getOwnPropertyDescriptor,HG=Object.getOwnPropertyNames,BG=Object.prototype.hasOwnProperty,Bw=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of HG(t))!BG.call(e,o)&&o!==r&&DG(e,o,{get:()=>t[o],enumerable:!(n=$G(t,o))||n.enumerable});return e},FG=(e,t,r)=>(Bw(e,t,"default"),r&&Bw(r,t,"default")),VG=JSON.parse('{"extension.command.toggle-upper-case.label":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"extension.table.column_count":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"extension.table.row_count":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.toggle-columns.description":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"extension.command.toggle-columns.label":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"extension.command.set-text-direction.label":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"extension.command.set-text-direction.description":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"extension.command.toggle-heading.label":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"extension.command.toggle-callout.description":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"extension.command.toggle-callout.label":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"extension.command.toggle-code-block.description":"Add a code block","extension.command.add-annotation.label":"Add annotation","extension.command.toggle-blockquote.description":"Add blockquote formatting to the selected text","extension.command.toggle-bold.description":"Add bold formatting to the selected text","extension.command.toggle-code.description":"Add inline code formatting to the selected text","keyboard.shortcut.alt":"Alt","keyboard.shortcut.arrowDown":"Arrow Down","keyboard.shortcut.arrowLeft":"Arrow Left","keyboard.shortcut.arrowRight":"Arrow Right","keyboard.shortcut.arrowUp":"Arrow Up","keyboard.shortcut.backspace":"Backspace","ui.text-color.black":"Black","extension.command.toggle-blockquote.label":"Blockquote","ui.text-color.blue":"Blue","ui.text-color.blue.hue":["Blue ",["hue"]],"extension.command.toggle-bold.label":"Bold","extension.command.toggle-bullet-list.description":"Bulleted list","keyboard.shortcut.capsLock":"Caps Lock","extension.command.center-align.label":"Center align","extension.command.toggle-code.label":"Code","extension.command.toggle-code-block.label":"Codeblock","keyboard.shortcut.command":"Command","QcPNd6":"Image description","ogrUzJ":"Add a short description here.","yqdyzr":"Image","6/02F4":"Image source","X8H91v":"Image","zhQ7Zt":"Italic","ZL7E7l":"Underline","keyboard.shortcut.control":"Control","extension.command.convert-paragraph.description":"Convert current block into a paragraph block.","extension.command.convert-paragraph.label":"Convert Paragraph","extension.command.copy.label":"Copy","extension.command.copy.description":"Copy the selected text","extension.command.create-table.description":"Create a table with set number of rows and columns.","extension.command.create-table.label":"Create table","extension.command.cut.label":"Cut","extension.command.cut.description":"Cut the selected text","ui.text-color.cyan":"Cyan","ui.text-color.cyan.hue":["Cyan ",["hue"]],"extension.command.decrease-font-size.label":"Decrease","extension.command.decrease-indent.label":"Decrease indentation","extension.command.decrease-font-size.description":"Decrease the font size.","keyboard.shortcut.delete":"Delete","extension.command.insert-horizontal-rule.label":"Divider","keyboard.shortcut.end":"End","keyboard.shortcut.escape":"Enter","keyboard.shortcut.enter":"Enter","6PjrOF":"Add annotation","OTq5WC":"Center align","oeZ3ox":"Convert current block into a paragraph block.","m1khs+":"Convert Paragraph","w/1U+3":"Copy the selected text","kdodi0":"Copy","k0KR/u":"Create a table with set number of rows and columns.","zrwMyD":"Create table","D/nWxh":"Cut the selected text","jHPv5m":"Cut","5cNgRx":"Decrease the font size.","vyRNWx":"Decrease","Jgiol4":"Decrease indentation","1gJSHH":"Increase the font size","OQXJXz":"Increase","72TLhr":"Increase indentation","HFlfzJ":"Insert Emoji","RPq9fY":"Separate content with a diving horizontal line","OKQF+e":"Divider","zjYb9C":"Insert a new paragraph","4M4sXC":"Insert Paragraph","1Q+eVc":"Justify","ejWWtP":"Left align","wVqrpS":"Paste content into the editor","07v9aw":"Paste","zUYfou":"Redo the most recent action","9Nq9zr":"Redo","0uxaZe":"Remove annotation","iJWZAz":"Right align","g5WpPn":"Select all content within the editor","2+pZDT":"Select all","yChCR1":"Set text case","GMzAC/":"Set the font size for the selected text.","vzEyrv":"Font size","7VCkJ8":"Set the text color for the selected text.","qjWFaR":"Text color","LVWgFu":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"WXwRy1":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"G/o315":"Set the text highlight color for the selected text.","xtHg6d":"Text highlight","1p1W/p":"Add blockquote formatting to the selected text","6+rh6I":"Blockquote","0yB3LV":"Add bold formatting to the selected text","sFMo4Z":"Bold","SMKG/s":"Bulleted list","/BYCMi":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"V+3IBe":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"hbIo4L":"Add a code block","7GkMcx":"Codeblock","2r4JYl":"Add inline code formatting to the selected text","Up8Tpe":"Code","ATHSPS":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"7DC1VE":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"hnrBeo":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"NkZAcw":"Italicize the selected text","2fTW9e":"Italic","c759Ra":"Ordered list","uQwrZu":"Strikethrough the selected text","pT3qly":"Strikethrough","BHk+zu":"Subscript","18BVwM":"Superscript","tOIVCV":"Tasked list","4Janx3":"Underline the selected text","dCHt+D":"Underline","YYAprs":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"tczyZL":"Show hidden whitespace characters in your editor.","0qAX23":"Toggle Whitespace","ezMADU":"Undo the most recent action","N3P7EC":"Undo","2nj/+s":"Update annotation","dWD7u4":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"qXqgVT":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.set-font-size.label":"Font size","ui.text-color.grape":"Grape","ui.text-color.grape.hue":["Grape ",["hue"]],"ui.text-color.gray":"Gray","ui.text-color.gray.hue":["Gray ",["hue"]],"ui.text-color.green":"Green","ui.text-color.green.hue":["Green ",["hue"]],"keyboard.shortcut.home":"Home","extension.command.increase-font-size.label":"Increase","extension.command.increase-indent.label":"Increase indentation","extension.command.increase-font-size.description":"Increase the font size","ui.text-color.indigo":"Indigo","ui.text-color.indigo.hue":["Indigo ",["hue"]],"extension.command.insert-paragraph.description":"Insert a new paragraph","extension.command.insert-emoji.label":"Insert Emoji","extension.command.insert-paragraph.label":"Insert Paragraph","extension.command.toggle-italic.label":"Italic","extension.command.toggle-italic.description":"Italicize the selected text","extension.command.justify-align.label":"Justify","R7NlCw":"Alt","RbDiK5":"Arrow Down","Dgyd+E":"Arrow Left","8pdCk4":"Arrow Right","Gp/343":"Arrow Up","PFPV0A":"Backspace","0IRYvp":"Caps Lock","X7HX0D":"Command","zq0AdD":"Control","8SfToN":"Delete","Ys/uah":"End","3K5hww":"Enter","veQt1j":"Enter","ySv7i+":"Home","e6RUI1":"Page Down","EEJk31":"Page Up","7sbhAU":"Shift","Q4eplT":"Space","SUhVVC":"Tab","extension.command.left-align.label":"Left align","ui.text-color.lime":"Lime","ui.text-color.lime.hue":["Lime ",["hue"]],"react-components.mention-atom-component.zero-items":"No items available","ui.text-color.orange":"Orange","ui.text-color.orange.hue":["Orange ",["hue"]],"extension.command.toggle-ordered-list.label":"Ordered list","keyboard.shortcut.pageDown":"Page Down","keyboard.shortcut.pageUp":"Page Up","extension.command.paste.label":"Paste","extension.command.paste.description":"Paste content into the editor","ui.text-color.pink":"Pink","ui.text-color.pink.hue":["Pink ",["hue"]],"zvMfIA":"No items available","pEjhti":"Static Menu","ui.text-color.red":"Red","ui.text-color.red.hue":["Red ",["hue"]],"extension.command.redo.label":"Redo","extension.command.redo.description":"Redo the most recent action","extension.command.remove-annotation.label":"Remove annotation","extension.command.right-align.label":"Right align","extension.command.select-all.label":"Select all","extension.command.select-all.description":"Select all content within the editor","extension.command.insert-horizontal-rule.description":"Separate content with a diving horizontal line","extension.command.set-casing.label":"Set text case","extension.command.set-font-size.description":"Set the font size for the selected text.","extension.command.set-text-color.description":"Set the text color for the selected text.","extension.command.set-text-highlight.description":"Set the text highlight color for the selected text.","keyboard.shortcut.shift":"Shift","extension.command.toggle-whitespace.description":"Show hidden whitespace characters in your editor.","keyboard.shortcut.space":"Space","extension.command.toggle-strike.label":"Strikethrough","extension.command.toggle-strike.description":"Strikethrough the selected text","extension.command.toggle-subscript.label":"Subscript","extension.command.toggle-superscript.label":"Superscript","keyboard.shortcut.tab":"Tab","extension.command.toggle-task-list.description":"Tasked list","ui.text-color.teal":"Teal","ui.text-color.teal.hue":["Teal ",["hue"]],"extension.command.set-text-color.label":"Text color","extension.command.set-text-highlight.label":"Text highlight","extension.command.toggle-whitespace.label":"Toggle Whitespace","ui.text-color.transparent":"Transparent","slrB1c":"Black","6QML30":"Blue","xw+keN":["Blue ",["hue"]],"38RHqP":"Cyan","D89yPf":["Cyan ",["hue"]],"VjBLnd":"Grape","Rp40yv":["Grape ",["hue"]],"5Dm9D1":"Gray","HGjXjC":["Gray ",["hue"]],"b9fz+n":"Green","18jo3M":["Green ",["hue"]],"CFzqCV":"Indigo","aVlDku":["Indigo ",["hue"]],"04PfLc":"Lime","KRTK6Y":["Lime ",["hue"]],"pSnXFd":"Orange","ve/MJZ":["Orange ",["hue"]],"OvCgDa":"Pink","l7NqyT":["Pink ",["hue"]],"IT9k0j":"Red","AdyJ7/":["Red ",["hue"]],"3D2UWc":"Teal","Dcq0Y1":["Teal ",["hue"]],"bsi2ik":"Transparent","Tj3PRR":"Violet","xxMH5N":["Violet ",["hue"]],"Rum0ah":"White","4gaw/Q":"Yellow","hhauc3":["Yellow ",["hue"]],"extension.command.toggle-underline.label":"Underline","extension.command.toggle-underline.description":"Underline the selected text","extension.command.undo.label":"Undo","extension.command.undo.description":"Undo the most recent action","extension.command.update-annotation.label":"Update annotation","ui.text-color.violet":"Violet","ui.text-color.violet.hue":["Violet ",["hue"]],"ui.text-color.white":"White","ui.text-color.yellow":"Yellow","ui.text-color.yellow.hue":["Yellow ",["hue"]]}'),H3={};FG(H3,IG);Wh.loadLocaleData("en",{plurals:H3.en});Wh.load("en",VG);Wh.activate("en");var jG=Object.defineProperty,UG=Object.getOwnPropertyDescriptor,WG=(e,t,r,n)=>{for(var o=n>1?void 0:n?UG(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&jG(t,r,o),o},KG={...ta.defaultOptions,...rd.defaultOptions},qG=[...ta.staticKeys,...rd.staticKeys],nd=class extends Ge{get name(){return"react"}onSetOptions(e){const{pickChanged:t}=e;this.getExtension(ta).setOptions(t(["placeholder"]))}createExtensions(){const{emptyNodeClass:e,placeholder:t,defaultBlockNode:r,defaultContentNode:n,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s}=this.options;return[new ta({emptyNodeClass:e,placeholder:t,priority:De.Low}),new rd({defaultBlockNode:r,defaultContentNode:n,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s})]}};nd=WG([ye({defaultOptions:KG,staticKeys:qG})],nd);var B3={};Object.defineProperty(B3,"__esModule",{value:!0});function GG(){for(var e=[],t=0;t{if(!t.has(e))throw TypeError("Cannot "+r)},Ig=(e,t,r)=>(F3(e,t,"read from private field"),r?r.call(e):t.get(e)),YG=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},JG=(e,t,r,n)=>(F3(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);function XG(){const[,e]=S.useState(ee());return S.useCallback(()=>{e(ee())},[])}var V3=S.createContext(null);function ii(e){const t=S.useContext(V3),r=S.useRef(XG());te(t,{code:$.REACT_PROVIDER_CONTEXT});const{addHandler:n}=t;return S.useEffect(()=>{let o=e;if(o){if(ss(o)){const{autoUpdate:i}=o;o=i?()=>r.current():void 0}if(Ne(o))return n("updated",o)}},[n,e]),t}function Nn(e=!0){return ii({autoUpdate:e}).active}function QG(e=!1){return ii(e?{autoUpdate:!0}:void 0).attrs}function ob(){return ii().chain.new()}function Vr(){return ii().commands}function j3(){return ii({autoUpdate:!0}).getState().selection}function ib(e,t=void 0,r){const{getExtension:n}=ii(),o=S.useMemo(()=>n(e),[e,n]);let i;if(Ne(t)?i=r?[o,...r]:[o,t]:i=t?[o,...Object.values(t)]:[],S.useEffect(()=>{Ne(t)||!t||o.setOptions(t)},i),S.useEffect(()=>{if(Ne(t))return t({addHandler:o.addHandler.bind(o),addCustomHandler:o.addCustomHandler.bind(o),extension:o})},i),!t)return o}function U3(e,t,r){const n=S.useCallback(({addHandler:o})=>o(t,r),[r,t]);return ib(e,n)}function Kh(e=!1){return ii(e?{autoUpdate:!0}:void 0).helpers}var[ZG,eY]=OU(({props:e})=>{const t=e.locale??"en",r=e.i18n??Wh,n=e.supportedLocales??[t],o=r._.bind(r);return{locale:t,i18n:r,supportedLocales:n,t:o}});function Uw(e,t={}){const{core:r,react:n,...o}=t;return c8(e)?e:l8.create(()=>[...bS(e),new nd(n),...pV(r)],o)}function tY(e,t={}){const r=S.useRef(e),n=S.useRef(t),[o,i]=S.useState(()=>Uw(e,t));return r.current=e,n.current=t,S.useEffect(()=>o.addHandler("destroy",()=>{i(()=>Uw(r.current,n.current))}),[o]),o}var rY=typeof hr=="object"&&hr.__esModule&&hr.default?hr.default:hr,Fa,nY=class extends n8{constructor(e){if(super(e),YG(this,Fa,void 0),this.rootPropsConfig={called:!1,count:0},this.getRootProps=t=>this.internalGetRootProps(t,null),this.internalGetRootProps=(t,r)=>{this.rootPropsConfig.called=!0;const{refKey:n="ref",ref:o,...i}=t??ee();return{[n]:rY(o,this.onRef),key:this.uid,...i,children:r}},this.onRef=t=>{t&&(this.rootPropsConfig.count+=1,te(this.rootPropsConfig.count<=1,{code:$.REACT_GET_ROOT_PROPS,message:`Called ${this.rootPropsConfig.count} times`}),JG(this,Fa,t),this.onRefLoad())},this.manager.view){this.manager.view.setProps({state:this.manager.view.state,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0});return}this.manager.getExtension(ta).setOptions({placeholder:this.props.placeholder??""})}get name(){return"react"}update(e){return super.update(e),this}createView(e){return new pN(null,{state:e,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0,plugins:[]})}updateState({state:e,...t}){const{triggerChange:r=!0,tr:n,transactions:o}=t;if(this.props.state){const{onChange:i}=this.props;te(i,{code:$.REACT_CONTROLLED,message:"You are required to provide the `onChange` handler when creating a controlled editor."}),te(r,{code:$.REACT_CONTROLLED,message:"Controlled editors do not support `clearContent` or `setContent` where `triggerChange` is `true`. Update the `state` prop instead."}),this.previousStateOverride||(this.previousStateOverride=this.getState()),this.onChange({state:e,tr:n,transactions:o});return}!n&&!o&&(e=e.apply(e.tr.setMeta(xk,{}))),this.view.updateState(e),r&&(o==null?void 0:o.length)!==0&&this.onChange({state:e,tr:n,transactions:o}),this.manager.onStateUpdate({previousState:this.previousState,state:e,tr:n,transactions:o})}updateControlledState(e,t){this.previousStateOverride=t,e=e.apply(e.tr.setMeta(xk,{})),this.view.updateState(e),this.manager.onStateUpdate({previousState:this.previousState,state:e}),this.previousStateOverride=void 0}addProsemirrorViewToDom(e,t){this.props.insertPosition==="start"?e.insertBefore(t,e.firstChild):e.append(t)}onRefLoad(){te(Ig(this,Fa),{code:$.REACT_EDITOR_VIEW,message:"Something went wrong when initializing the text editor. Please check your setup."});const{autoFocus:e}=this.props;this.addProsemirrorViewToDom(Ig(this,Fa),this.view.dom),e&&this.focus(e),this.onChange(),this.addFocusListeners()}onUpdate(){this.view&&Ig(this,Fa)&&this.view.setProps({...this.view.props,editable:()=>this.props.editable??!0})}get frameworkOutput(){return{...this.baseOutput,getRootProps:this.getRootProps,portalContainer:this.manager.store.portalContainer}}resetRender(){this.rootPropsConfig.called=!1,this.rootPropsConfig.count=0}};Fa=new WeakMap;var W3=typeof document<"u"?S.useLayoutEffect:S.useEffect;function oY(e){const t=S.useRef();return W3(()=>{t.current=e}),t.current}function iY(e){const{manager:t,state:r}=e,{placeholder:n,editable:o}=e;S.useRef(!0).current&&!Wi(n)&&t.getExtension(nd).setOptions({placeholder:n}),S.useEffect(()=>{n!=null&&t.getExtension(nd).setOptions({placeholder:n})},[n,t]);const[s]=S.useState(()=>{if(r)return r;const l=t.createEmptyDoc(),[c,u]=at(e.initialContent)?e.initialContent:[e.initialContent??l];return t.createState({content:c,selection:u})}),a=sY({initialEditorState:s,getProps:()=>e});return S.useEffect(()=>()=>{a.destroy()},[a]),S.useEffect(()=>{a.onUpdate()},[o,a]),aY(a),a.frameworkOutput}function sY(e){const t=S.useRef(e);t.current=e;const r=S.useMemo(()=>new nY(t.current),[]);return r.update(e),r}function aY(e){const{state:t}=e.props,r=S.useRef(!!t),n=oY(t);W3(()=>{const o=t?r.current===!0:r.current===!1;te(o,{code:$.REACT_CONTROLLED,message:r.current?"You have attempted to switch from a controlled to an uncontrolled editor. Once you set up an editor as a controlled editor it must always provide a `state` prop.":"You have provided a `state` prop to an uncontrolled editor. In order to set up your editor as controlled you must provide the `state` prop from the very first render."}),!(!t||t===n)&&e.updateControlledState(t,n??void 0)},[t,n,e])}function lY(e={}){const{content:t,document:r,selection:n,extensions:o,...i}=e,s=tY(o??(()=>[]),i),[a,l]=S.useState(()=>s.createState({selection:n,content:t??s.createEmptyDoc()})),c=S.useCallback(({state:d})=>{l(d)},[]),u=S.useCallback(()=>s.output,[s]);return S.useMemo(()=>({state:a,setState:l,manager:s,onChange:c,getContext:u}),[u,s,c,a])}var Ww={doc:!1,selection:!1,storedMark:!1};function cY(){const[e,t]=S.useState(Ww);return U3(pp,"applyState",S.useCallback(({tr:r})=>{const n={...Ww};r.docChanged&&(n.doc=!0),r.selectionSet&&(n.selection=!0),r.storedMarksSet&&(n.storedMark=!0),t(n)},[])),e}var A0=()=>L.createElement("div",{className:wL.EDITOR_WRAPPER,...ii().getRootProps()}),uY=e=>(e.hook(),null);function dY(e){const{children:t,autoRender:r,i18n:n,locale:o,supportedLocales:i,hooks:s=[],...a}=e,l=iY(a),c=wU(l.portalContainer),u=r==="start"||r===!0||!t&&Wi(r),d=r==="end";return L.createElement(ZG,{i18n:n,locale:o,supportedLocales:i},L.createElement(V3.Provider,{value:l},L.createElement(xU,{portals:c}),s.map((f,p)=>L.createElement(uY,{hook:f,key:p})),u&&L.createElement(A0,null),t,d&&L.createElement(A0,null)))}const fY={black:"#000",white:"#fff"},od=fY,pY={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},Ma=pY,hY={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},Ta=hY,mY={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Oa=mY,gY={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},_a=gY,vY={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},Aa=vY,yY={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},hc=yY,bY={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},kY=bY;function $o(e){return e!==null&&typeof e=="object"&&e.constructor===Object}function K3(e){if(!$o(e))return e;const t={};return Object.keys(e).forEach(r=>{t[r]=K3(e[r])}),t}function nn(e,t,r={clone:!0}){const n=r.clone?O({},e):e;return $o(e)&&$o(t)&&Object.keys(t).forEach(o=>{o!=="__proto__"&&($o(t[o])&&o in e&&$o(e[o])?n[o]=nn(e[o],t[o],r):r.clone?n[o]=$o(t[o])?K3(t[o]):t[o]:n[o]=t[o])}),n}function Il(e){let t="https://mui.com/production-error/?code="+e;for(let r=1;rr==null?t:function(...o){t.apply(this,o),r.apply(this,o)},()=>{})}function SY(e,t=166){let r;function n(...o){const i=()=>{e.apply(this,o)};clearTimeout(r),r=setTimeout(i,t)}return n.clear=()=>{clearTimeout(r)},n}function Ir(e){return e&&e.ownerDocument||document}function id(e){return Ir(e).defaultView||window}function R0(e,t){typeof e=="function"?e(t):e&&(e.current=t)}const EY=typeof window<"u"?S.useLayoutEffect:S.useEffect,aa=EY;let qw=0;function CY(e){const[t,r]=S.useState(e),n=e||t;return S.useEffect(()=>{t==null&&(qw+=1,r(`mui-${qw}`))},[t]),n}const Gw=Xg["useId".toString()];function MY(e){if(Gw!==void 0){const t=Gw();return e??t}return CY(e)}function TY({controlled:e,default:t,name:r,state:n="value"}){const{current:o}=S.useRef(e!==void 0),[i,s]=S.useState(t),a=o?e:i,l=S.useCallback(c=>{o||s(c)},[]);return[a,l]}function $s(e){const t=S.useRef(e);return aa(()=>{t.current=e}),S.useCallback((...r)=>(0,t.current)(...r),[])}function Hr(...e){return S.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(r=>{R0(r,t)})},e)}let nm=!0,P0=!1,Yw;const OY={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function _Y(e){const{type:t,tagName:r}=e;return!!(r==="INPUT"&&OY[t]&&!e.readOnly||r==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function AY(e){e.metaKey||e.altKey||e.ctrlKey||(nm=!0)}function Dg(){nm=!1}function RY(){this.visibilityState==="hidden"&&P0&&(nm=!0)}function PY(e){e.addEventListener("keydown",AY,!0),e.addEventListener("mousedown",Dg,!0),e.addEventListener("pointerdown",Dg,!0),e.addEventListener("touchstart",Dg,!0),e.addEventListener("visibilitychange",RY,!0)}function NY(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return nm||_Y(t)}function G3(){const e=S.useCallback(o=>{o!=null&&PY(o.ownerDocument)},[]),t=S.useRef(!1);function r(){return t.current?(P0=!0,window.clearTimeout(Yw),Yw=window.setTimeout(()=>{P0=!1},100),t.current=!1,!0):!1}function n(o){return NY(o)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:n,onBlur:r,ref:e}}function Y3(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}const zY=e=>{const t=S.useRef({});return S.useEffect(()=>{t.current=e}),t.current},J3=zY;function X3(e,t){const r=O({},t);return Object.keys(e).forEach(n=>{if(n.toString().match(/^(components|slots)$/))r[n]=O({},e[n],r[n]);else if(n.toString().match(/^(componentsProps|slotProps)$/)){const o=e[n]||{},i=t[n];r[n]={},!i||!Object.keys(i)?r[n]=o:!o||!Object.keys(o)?r[n]=i:(r[n]=O({},i),Object.keys(o).forEach(s=>{r[n][s]=X3(o[s],i[s])}))}else r[n]===void 0&&(r[n]=e[n])}),r}function Qt(e,t,r=void 0){const n={};return Object.keys(e).forEach(o=>{n[o]=e[o].reduce((i,s)=>{if(s){const a=t(s);a!==""&&i.push(a),r&&r[s]&&i.push(r[s])}return i},[]).join(" ")}),n}const Jw=e=>e,LY=()=>{let e=Jw;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Jw}}},IY=LY(),Q3=IY,DY={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Ft(e,t,r="Mui"){const n=DY[t];return n?`${r}-${n}`:`${Q3.generate(e)}-${t}`}function Vt(e,t,r="Mui"){const n={};return t.forEach(o=>{n[o]=Ft(e,o,r)}),n}const Dl="$$material";function ge(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i=0)&&(r[o]=e[o]);return r}function Z3(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var $Y=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,HY=Z3(function(e){return $Y.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91});function BY(e){if(e.sheet)return e.sheet;for(var t=0;t0?qt(Ql,--Br):0,$l--,kt===10&&($l=1,im--),kt}function on(){return kt=Br2||ad(kt)>3?"":" "}function ZY(e,t){for(;--t&&on()&&!(kt<48||kt>102||kt>57&&kt<65||kt>70&&kt<97););return Ad(e,jf()+(t<6&&yo()==32&&on()==32))}function z0(e){for(;on();)switch(kt){case e:return Br;case 34:case 39:e!==34&&e!==39&&z0(kt);break;case 40:e===41&&z0(e);break;case 92:on();break}return Br}function eJ(e,t){for(;on()&&e+kt!==47+10;)if(e+kt===42+42&&yo()===47)break;return"/*"+Ad(t,Br-1)+"*"+om(e===47?e:on())}function tJ(e){for(;!ad(yo());)on();return Ad(e,Br)}function rJ(e){return iT(Wf("",null,null,null,[""],e=oT(e),0,[0],e))}function Wf(e,t,r,n,o,i,s,a,l){for(var c=0,u=0,d=s,f=0,p=0,h=0,m=1,b=1,v=1,g=0,y="",k=o,x=i,w=n,E=y;b;)switch(h=g,g=on()){case 40:if(h!=108&&qt(E,d-1)==58){N0(E+=Re(Uf(g),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:E+=Uf(g);break;case 9:case 10:case 13:case 32:E+=QY(h);break;case 92:E+=ZY(jf()-1,7);continue;case 47:switch(yo()){case 42:case 47:cf(nJ(eJ(on(),jf()),t,r),l);break;default:E+="/"}break;case 123*m:a[c++]=co(E)*v;case 125*m:case 59:case 0:switch(g){case 0:case 125:b=0;case 59+u:v==-1&&(E=Re(E,/\f/g,"")),p>0&&co(E)-d&&cf(p>32?Qw(E+";",n,r,d-1):Qw(Re(E," ","")+";",n,r,d-2),l);break;case 59:E+=";";default:if(cf(w=Xw(E,t,r,c,u,o,a,y,k=[],x=[],d),i),g===123)if(u===0)Wf(E,t,w,w,k,i,d,a,x);else switch(f===99&&qt(E,3)===110?100:f){case 100:case 108:case 109:case 115:Wf(e,w,w,n&&cf(Xw(e,w,w,0,0,o,a,y,o,k=[],d),x),o,x,d,a,n?k:x);break;default:Wf(E,w,w,w,[""],x,0,a,x)}}c=u=p=0,m=v=1,y=E="",d=s;break;case 58:d=1+co(E),p=h;default:if(m<1){if(g==123)--m;else if(g==125&&m++==0&&XY()==125)continue}switch(E+=om(g),g*m){case 38:v=u>0?1:(E+="\f",-1);break;case 44:a[c++]=(co(E)-1)*v,v=1;break;case 64:yo()===45&&(E+=Uf(on())),f=yo(),u=d=co(y=E+=tJ(jf())),g++;break;case 45:h===45&&co(E)==2&&(m=0)}}return i}function Xw(e,t,r,n,o,i,s,a,l,c,u){for(var d=o-1,f=o===0?i:[""],p=ub(f),h=0,m=0,b=0;h0?f[v]+" "+g:Re(g,/&\f/g,f[v])))&&(l[b++]=y);return sm(e,t,r,o===0?lb:a,l,c,u)}function nJ(e,t,r){return sm(e,t,r,eT,om(JY()),sd(e,2,-2),0)}function Qw(e,t,r,n){return sm(e,t,r,cb,sd(e,0,n),sd(e,n+1,-1),n)}function pl(e,t){for(var r="",n=ub(e),o=0;o6)switch(qt(e,t+1)){case 109:if(qt(e,t+4)!==45)break;case 102:return Re(e,/(.+:)(.+)-([^]+)/,"$1"+Ae+"$2-$3$1"+Zp+(qt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~N0(e,"stretch")?sT(Re(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(qt(e,t+1)!==115)break;case 6444:switch(qt(e,co(e)-3-(~N0(e,"!important")&&10))){case 107:return Re(e,":",":"+Ae)+e;case 101:return Re(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ae+(qt(e,14)===45?"inline-":"")+"box$3$1"+Ae+"$2$3$1"+rr+"$2box$3")+e}break;case 5936:switch(qt(e,t+11)){case 114:return Ae+e+rr+Re(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ae+e+rr+Re(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ae+e+rr+Re(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ae+e+rr+e+e}return e}var fJ=function(t,r,n,o){if(t.length>-1&&!t.return)switch(t.type){case cb:t.return=sT(t.value,t.length);break;case tT:return pl([mc(t,{value:Re(t.value,"@","@"+Ae)})],o);case lb:if(t.length)return YY(t.props,function(i){switch(GY(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return pl([mc(t,{props:[Re(i,/:(read-\w+)/,":"+Zp+"$1")]})],o);case"::placeholder":return pl([mc(t,{props:[Re(i,/:(plac\w+)/,":"+Ae+"input-$1")]}),mc(t,{props:[Re(i,/:(plac\w+)/,":"+Zp+"$1")]}),mc(t,{props:[Re(i,/:(plac\w+)/,rr+"input-$1")]})],o)}return""})}},pJ=[fJ],hJ=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(m){var b=m.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var o=t.stylisPlugins||pJ,i={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(m){for(var b=m.getAttribute("data-emotion").split(" "),v=1;v=4;++n,o-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var TJ={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},OJ=/[A-Z]|^ms/g,_J=/_EMO_([^_]+?)_([^]*?)_EMO_/g,fT=function(t){return t.charCodeAt(1)===45},e4=function(t){return t!=null&&typeof t!="boolean"},$g=Z3(function(e){return fT(e)?e:e.replace(OJ,"-$&").toLowerCase()}),t4=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(_J,function(n,o,i){return uo={name:o,styles:i,next:uo},o})}return TJ[t]!==1&&!fT(t)&&typeof r=="number"&&r!==0?r+"px":r};function ld(e,t,r){if(r==null)return"";if(r.__emotion_styles!==void 0)return r;switch(typeof r){case"boolean":return"";case"object":{if(r.anim===1)return uo={name:r.name,styles:r.styles,next:uo},r.name;if(r.styles!==void 0){var n=r.next;if(n!==void 0)for(;n!==void 0;)uo={name:n.name,styles:n.styles,next:uo},n=n.next;var o=r.styles+";";return o}return AJ(e,t,r)}case"function":{if(e!==void 0){var i=uo,s=r(e);return uo=i,ld(e,t,s)}break}}if(t==null)return r;var a=t[r];return a!==void 0?a:r}function AJ(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o96?LJ:IJ},o4=function(t,r,n){var o;if(r){var i=r.shouldForwardProp;o=t.__emotion_forwardProp&&i?function(s){return t.__emotion_forwardProp(s)&&i(s)}:i}return typeof o!="function"&&n&&(o=t.__emotion_forwardProp),o},DJ=function(t){var r=t.cache,n=t.serialized,o=t.isStringTag;return dT(r,n,o),NJ(function(){return CJ(r,n,o)}),null},$J=function e(t,r){var n=t.__emotion_real===t,o=n&&t.__emotion_base||t,i,s;r!==void 0&&(i=r.label,s=r.target);var a=o4(t,r,n),l=a||n4(o),c=!l("as");return function(){var u=arguments,d=n&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&d.push("label:"+i+";"),u[0]==null||u[0].raw===void 0)d.push.apply(d,u);else{d.push(u[0][0]);for(var f=u.length,p=1;p{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))},FJ=["values","unit","step"],VJ=e=>{const t=Object.keys(e).map(r=>({key:r,val:e[r]}))||[];return t.sort((r,n)=>r.val-n.val),t.reduce((r,n)=>O({},r,{[n.key]:n.val}),{})};function jJ(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5}=e,o=ge(e,FJ),i=VJ(t),s=Object.keys(i);function a(f){return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r})`}function l(f){return`@media (max-width:${(typeof t[f]=="number"?t[f]:f)-n/100}${r})`}function c(f,p){const h=s.indexOf(p);return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r}) and (max-width:${(h!==-1&&typeof t[s[h]]=="number"?t[s[h]]:p)-n/100}${r})`}function u(f){return s.indexOf(f)+1`@media (min-width:${gb[e]}px)`};function ro(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const i=n.breakpoints||i4;return t.reduce((s,a,l)=>(s[i.up(i.keys[l])]=r(t[l]),s),{})}if(typeof t=="object"){const i=n.breakpoints||i4;return Object.keys(t).reduce((s,a)=>{if(Object.keys(i.values||gb).indexOf(a)!==-1){const l=i.up(a);s[l]=r(t[a],a)}else{const l=a;s[l]=t[l]}return s},{})}return r(t)}function gT(e={}){var t;return((t=e.keys)==null?void 0:t.reduce((n,o)=>{const i=e.up(o);return n[i]={},n},{}))||{}}function vT(e,t){return e.reduce((r,n)=>{const o=r[n];return(!o||Object.keys(o).length===0)&&delete r[n],r},t)}function KJ(e,...t){const r=gT(e),n=[r,...t].reduce((o,i)=>nn(o,i),{});return vT(Object.keys(r),n)}function qJ(e,t){if(typeof e!="object")return{};const r={},n=Object.keys(t);return Array.isArray(e)?n.forEach((o,i)=>{i{e[o]!=null&&(r[o]=!0)}),r}function Hg({values:e,breakpoints:t,base:r}){const n=r||qJ(e,t),o=Object.keys(n);if(o.length===0)return e;let i;return o.reduce((s,a,l)=>(Array.isArray(e)?(s[a]=e[l]!=null?e[l]:e[i],i=l):typeof e=="object"?(s[a]=e[a]!=null?e[a]:e[i],i=a):s[a]=e,s),{})}function vm(e,t,r=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&r){const n=`vars.${t}`.split(".").reduce((o,i)=>o&&o[i]?o[i]:null,e);if(n!=null)return n}return t.split(".").reduce((n,o)=>n&&n[o]!=null?n[o]:null,e)}function th(e,t,r,n=r){let o;return typeof e=="function"?o=e(r):Array.isArray(e)?o=e[r]||n:o=vm(e,r)||n,t&&(o=t(o,n,e)),o}function Le(e){const{prop:t,cssProperty:r=e.prop,themeKey:n,transform:o}=e,i=s=>{if(s[t]==null)return null;const a=s[t],l=s.theme,c=vm(l,n)||{};return ro(s,a,d=>{let f=th(c,o,d);return d===f&&typeof d=="string"&&(f=th(c,o,`${t}${d==="default"?"":Be(d)}`,d)),r===!1?f:{[r]:f}})};return i.propTypes={},i.filterProps=[t],i}function GJ(e){const t={};return r=>(t[r]===void 0&&(t[r]=e(r)),t[r])}const YJ={m:"margin",p:"padding"},JJ={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},s4={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},XJ=GJ(e=>{if(e.length>2)if(s4[e])e=s4[e];else return[e];const[t,r]=e.split(""),n=YJ[t],o=JJ[r]||"";return Array.isArray(o)?o.map(i=>n+i):[n+o]}),vb=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],yb=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...vb,...yb];function Rd(e,t,r,n){var o;const i=(o=vm(e,t,!1))!=null?o:r;return typeof i=="number"?s=>typeof s=="string"?s:i*s:Array.isArray(i)?s=>typeof s=="string"?s:i[s]:typeof i=="function"?i:()=>{}}function bb(e){return Rd(e,"spacing",8)}function la(e,t){if(typeof t=="string"||t==null)return t;const r=Math.abs(t),n=e(r);return t>=0?n:typeof n=="number"?-n:`-${n}`}function QJ(e,t){return r=>e.reduce((n,o)=>(n[o]=la(t,r),n),{})}function ZJ(e,t,r,n){if(t.indexOf(r)===-1)return null;const o=XJ(r),i=QJ(o,n),s=e[r];return ro(e,s,i)}function yT(e,t){const r=bb(e.theme);return Object.keys(e).map(n=>ZJ(e,t,n,r)).reduce(mu,{})}function ut(e){return yT(e,vb)}ut.propTypes={};ut.filterProps=vb;function dt(e){return yT(e,yb)}dt.propTypes={};dt.filterProps=yb;function eX(e=8){if(e.mui)return e;const t=bb({spacing:e}),r=(...n)=>(n.length===0?[1]:n).map(i=>{const s=t(i);return typeof s=="number"?`${s}px`:s}).join(" ");return r.mui=!0,r}function ym(...e){const t=e.reduce((n,o)=>(o.filterProps.forEach(i=>{n[i]=o}),n),{}),r=n=>Object.keys(n).reduce((o,i)=>t[i]?mu(o,t[i](n)):o,{});return r.propTypes={},r.filterProps=e.reduce((n,o)=>n.concat(o.filterProps),[]),r}function ho(e){return typeof e!="number"?e:`${e}px solid`}const tX=Le({prop:"border",themeKey:"borders",transform:ho}),rX=Le({prop:"borderTop",themeKey:"borders",transform:ho}),nX=Le({prop:"borderRight",themeKey:"borders",transform:ho}),oX=Le({prop:"borderBottom",themeKey:"borders",transform:ho}),iX=Le({prop:"borderLeft",themeKey:"borders",transform:ho}),sX=Le({prop:"borderColor",themeKey:"palette"}),aX=Le({prop:"borderTopColor",themeKey:"palette"}),lX=Le({prop:"borderRightColor",themeKey:"palette"}),cX=Le({prop:"borderBottomColor",themeKey:"palette"}),uX=Le({prop:"borderLeftColor",themeKey:"palette"}),bm=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Rd(e.theme,"shape.borderRadius",4),r=n=>({borderRadius:la(t,n)});return ro(e,e.borderRadius,r)}return null};bm.propTypes={};bm.filterProps=["borderRadius"];ym(tX,rX,nX,oX,iX,sX,aX,lX,cX,uX,bm);const km=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Rd(e.theme,"spacing",8),r=n=>({gap:la(t,n)});return ro(e,e.gap,r)}return null};km.propTypes={};km.filterProps=["gap"];const xm=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Rd(e.theme,"spacing",8),r=n=>({columnGap:la(t,n)});return ro(e,e.columnGap,r)}return null};xm.propTypes={};xm.filterProps=["columnGap"];const wm=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Rd(e.theme,"spacing",8),r=n=>({rowGap:la(t,n)});return ro(e,e.rowGap,r)}return null};wm.propTypes={};wm.filterProps=["rowGap"];const dX=Le({prop:"gridColumn"}),fX=Le({prop:"gridRow"}),pX=Le({prop:"gridAutoFlow"}),hX=Le({prop:"gridAutoColumns"}),mX=Le({prop:"gridAutoRows"}),gX=Le({prop:"gridTemplateColumns"}),vX=Le({prop:"gridTemplateRows"}),yX=Le({prop:"gridTemplateAreas"}),bX=Le({prop:"gridArea"});ym(km,xm,wm,dX,fX,pX,hX,mX,gX,vX,yX,bX);function hl(e,t){return t==="grey"?t:e}const kX=Le({prop:"color",themeKey:"palette",transform:hl}),xX=Le({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:hl}),wX=Le({prop:"backgroundColor",themeKey:"palette",transform:hl});ym(kX,xX,wX);function en(e){return e<=1&&e!==0?`${e*100}%`:e}const SX=Le({prop:"width",transform:en}),kb=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=r=>{var n,o;const i=((n=e.theme)==null||(n=n.breakpoints)==null||(n=n.values)==null?void 0:n[r])||gb[r];return i?((o=e.theme)==null||(o=o.breakpoints)==null?void 0:o.unit)!=="px"?{maxWidth:`${i}${e.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:en(r)}};return ro(e,e.maxWidth,t)}return null};kb.filterProps=["maxWidth"];const EX=Le({prop:"minWidth",transform:en}),CX=Le({prop:"height",transform:en}),MX=Le({prop:"maxHeight",transform:en}),TX=Le({prop:"minHeight",transform:en});Le({prop:"size",cssProperty:"width",transform:en});Le({prop:"size",cssProperty:"height",transform:en});const OX=Le({prop:"boxSizing"});ym(SX,kb,EX,CX,MX,TX,OX);const _X={border:{themeKey:"borders",transform:ho},borderTop:{themeKey:"borders",transform:ho},borderRight:{themeKey:"borders",transform:ho},borderBottom:{themeKey:"borders",transform:ho},borderLeft:{themeKey:"borders",transform:ho},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:bm},color:{themeKey:"palette",transform:hl},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:hl},backgroundColor:{themeKey:"palette",transform:hl},p:{style:dt},pt:{style:dt},pr:{style:dt},pb:{style:dt},pl:{style:dt},px:{style:dt},py:{style:dt},padding:{style:dt},paddingTop:{style:dt},paddingRight:{style:dt},paddingBottom:{style:dt},paddingLeft:{style:dt},paddingX:{style:dt},paddingY:{style:dt},paddingInline:{style:dt},paddingInlineStart:{style:dt},paddingInlineEnd:{style:dt},paddingBlock:{style:dt},paddingBlockStart:{style:dt},paddingBlockEnd:{style:dt},m:{style:ut},mt:{style:ut},mr:{style:ut},mb:{style:ut},ml:{style:ut},mx:{style:ut},my:{style:ut},margin:{style:ut},marginTop:{style:ut},marginRight:{style:ut},marginBottom:{style:ut},marginLeft:{style:ut},marginX:{style:ut},marginY:{style:ut},marginInline:{style:ut},marginInlineStart:{style:ut},marginInlineEnd:{style:ut},marginBlock:{style:ut},marginBlockStart:{style:ut},marginBlockEnd:{style:ut},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:km},rowGap:{style:wm},columnGap:{style:xm},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:en},maxWidth:{style:kb},minWidth:{transform:en},height:{transform:en},maxHeight:{transform:en},minHeight:{transform:en},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},Sm=_X;function AX(...e){const t=e.reduce((n,o)=>n.concat(Object.keys(o)),[]),r=new Set(t);return e.every(n=>r.size===Object.keys(n).length)}function RX(e,t){return typeof e=="function"?e(t):e}function PX(){function e(r,n,o,i){const s={[r]:n,theme:o},a=i[r];if(!a)return{[r]:n};const{cssProperty:l=r,themeKey:c,transform:u,style:d}=a;if(n==null)return null;if(c==="typography"&&n==="inherit")return{[r]:n};const f=vm(o,c)||{};return d?d(s):ro(s,n,h=>{let m=th(f,u,h);return h===m&&typeof h=="string"&&(m=th(f,u,`${r}${h==="default"?"":Be(h)}`,h)),l===!1?m:{[l]:m}})}function t(r){var n;const{sx:o,theme:i={}}=r||{};if(!o)return null;const s=(n=i.unstable_sxConfig)!=null?n:Sm;function a(l){let c=l;if(typeof l=="function")c=l(i);else if(typeof l!="object")return l;if(!c)return null;const u=gT(i.breakpoints),d=Object.keys(u);let f=u;return Object.keys(c).forEach(p=>{const h=RX(c[p],i);if(h!=null)if(typeof h=="object")if(s[p])f=mu(f,e(p,h,i,s));else{const m=ro({theme:i},h,b=>({[p]:b}));AX(m,h)?f[p]=t({sx:h,theme:i}):f=mu(f,m)}else f=mu(f,e(p,h,i,s))}),vT(d,f)}return Array.isArray(o)?o.map(a):a(o)}return t}const bT=PX();bT.filterProps=["sx"];const Em=bT,NX=["breakpoints","palette","spacing","shape"];function Cm(e={},...t){const{breakpoints:r={},palette:n={},spacing:o,shape:i={}}=e,s=ge(e,NX),a=jJ(r),l=eX(o);let c=nn({breakpoints:a,direction:"ltr",components:{},palette:O({mode:"light"},n),spacing:l,shape:O({},WJ,i)},s);return c=t.reduce((u,d)=>nn(u,d),c),c.unstable_sxConfig=O({},Sm,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(d){return Em({sx:d,theme:this})},c}function zX(e){return Object.keys(e).length===0}function xb(e=null){const t=S.useContext(hb);return!t||zX(t)?e:t}const LX=Cm();function wb(e=LX){return xb(e)}const IX=["sx"],DX=e=>{var t,r;const n={systemProps:{},otherProps:{}},o=(t=e==null||(r=e.theme)==null?void 0:r.unstable_sxConfig)!=null?t:Sm;return Object.keys(e).forEach(i=>{o[i]?n.systemProps[i]=e[i]:n.otherProps[i]=e[i]}),n};function Sb(e){const{sx:t}=e,r=ge(e,IX),{systemProps:n,otherProps:o}=DX(r);let i;return Array.isArray(t)?i=[n,...t]:typeof t=="function"?i=(...s)=>{const a=t(...s);return $o(a)?O({},n,a):n}:i=O({},n,t),O({},o,{sx:i})}function kT(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ta!=="theme"&&a!=="sx"&&a!=="as"})(Em);return S.forwardRef(function(l,c){const u=wb(r),d=Sb(l),{className:f,component:p="div"}=d,h=ge(d,$X);return A.jsx(i,O({as:p,ref:c,className:Ce(f,o?o(n):n),theme:t&&u[t]||u},h))})}const BX=["variant"];function a4(e){return e.length===0}function xT(e){const{variant:t}=e,r=ge(e,BX);let n=t||"";return Object.keys(r).sort().forEach(o=>{o==="color"?n+=a4(n)?e[o]:Be(e[o]):n+=`${a4(n)?o:Be(o)}${Be(e[o].toString())}`}),n}const FX=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function VX(e){return Object.keys(e).length===0}function jX(e){return typeof e=="string"&&e.charCodeAt(0)>96}const UX=(e,t)=>t.components&&t.components[e]&&t.components[e].styleOverrides?t.components[e].styleOverrides:null,rh=e=>{const t={};return e&&e.forEach(r=>{const n=xT(r.props);t[n]=r.style}),t},WX=(e,t)=>{let r=[];return t&&t.components&&t.components[e]&&t.components[e].variants&&(r=t.components[e].variants),rh(r)},nh=(e,t,r)=>{const{ownerState:n={}}=e,o=[];return r&&r.forEach(i=>{let s=!0;Object.keys(i.props).forEach(a=>{n[a]!==i.props[a]&&e[a]!==i.props[a]&&(s=!1)}),s&&o.push(t[xT(i.props)])}),o},KX=(e,t,r,n)=>{var o;const i=r==null||(o=r.components)==null||(o=o[n])==null?void 0:o.variants;return nh(e,t,i)};function Kf(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const qX=Cm(),GX=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function qf({defaultTheme:e,theme:t,themeId:r}){return VX(t)?e:t[r]||t}function YX(e){return e?(t,r)=>r[e]:null}const l4=({styledArg:e,props:t,defaultTheme:r,themeId:n})=>{const o=e(O({},t,{theme:qf(O({},t,{defaultTheme:r,themeId:n}))}));let i;if(o&&o.variants&&(i=o.variants,delete o.variants),i){const s=nh(t,rh(i),i);return[o,...s]}return o};function wT(e={}){const{themeId:t,defaultTheme:r=qX,rootShouldForwardProp:n=Kf,slotShouldForwardProp:o=Kf}=e,i=s=>Em(O({},s,{theme:qf(O({},s,{defaultTheme:r,themeId:t}))}));return i.__mui_systemSx=!0,(s,a={})=>{BJ(s,k=>k.filter(x=>!(x!=null&&x.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:d,overridesResolver:f=YX(GX(c))}=a,p=ge(a,FX),h=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,m=d||!1;let b,v=Kf;c==="Root"||c==="root"?v=n:c?v=o:jX(s)&&(v=void 0);const g=mT(s,O({shouldForwardProp:v,label:b},p)),y=(k,...x)=>{const w=x?x.map(T=>{if(typeof T=="function"&&T.__emotion_real!==T)return R=>l4({styledArg:T,props:R,defaultTheme:r,themeId:t});if($o(T)){let R=T,B;return T&&T.variants&&(B=T.variants,delete R.variants,R=I=>{let F=T;return nh(I,rh(B),B).forEach(z=>{F=nn(F,z)}),F}),R}return T}):[];let E=k;if($o(k)){let T;k&&k.variants&&(T=k.variants,delete E.variants,E=R=>{let B=k;return nh(R,rh(T),T).forEach(F=>{B=nn(B,F)}),B})}else typeof k=="function"&&k.__emotion_real!==k&&(E=T=>l4({styledArg:k,props:T,defaultTheme:r,themeId:t}));l&&f&&w.push(T=>{const R=qf(O({},T,{defaultTheme:r,themeId:t})),B=UX(l,R);if(B){const I={};return Object.entries(B).forEach(([F,V])=>{I[F]=typeof V=="function"?V(O({},T,{theme:R})):V}),f(T,I)}return null}),l&&!h&&w.push(T=>{const R=qf(O({},T,{defaultTheme:r,themeId:t}));return KX(T,WX(l,R),R,l)}),m||w.push(i);const M=w.length-x.length;if(Array.isArray(k)&&M>0){const T=new Array(M).fill("");E=[...k,...T],E.raw=[...k.raw,...T]}const C=g(E,...w);return s.muiName&&(C.muiName=s.muiName),C};return g.withConfig&&(y.withConfig=g.withConfig),y}}const JX=wT(),XX=JX;function QX(e){const{theme:t,name:r,props:n}=e;return!t||!t.components||!t.components[r]||!t.components[r].defaultProps?n:X3(t.components[r].defaultProps,n)}function ST({props:e,name:t,defaultTheme:r,themeId:n}){let o=wb(r);return n&&(o=o[n]||o),QX({theme:o,name:t,props:e})}function Eb(e,t=0,r=1){return Math.min(Math.max(t,e),r)}function ZX(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let r=e.match(t);return r&&r[0].length===1&&(r=r.map(n=>n+n)),r?`rgb${r.length===4?"a":""}(${r.map((n,o)=>o<3?parseInt(n,16):Math.round(parseInt(n,16)/255*1e3)/1e3).join(", ")})`:""}function ca(e){if(e.type)return e;if(e.charAt(0)==="#")return ca(ZX(e));const t=e.indexOf("("),r=e.substring(0,t);if(["rgb","rgba","hsl","hsla","color"].indexOf(r)===-1)throw new Error(Il(9,e));let n=e.substring(t+1,e.length-1),o;if(r==="color"){if(n=n.split(" "),o=n.shift(),n.length===4&&n[3].charAt(0)==="/"&&(n[3]=n[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(o)===-1)throw new Error(Il(10,o))}else n=n.split(",");return n=n.map(i=>parseFloat(i)),{type:r,values:n,colorSpace:o}}function Mm(e){const{type:t,colorSpace:r}=e;let{values:n}=e;return t.indexOf("rgb")!==-1?n=n.map((o,i)=>i<3?parseInt(o,10):o):t.indexOf("hsl")!==-1&&(n[1]=`${n[1]}%`,n[2]=`${n[2]}%`),t.indexOf("color")!==-1?n=`${r} ${n.join(" ")}`:n=`${n.join(", ")}`,`${t}(${n})`}function eQ(e){e=ca(e);const{values:t}=e,r=t[0],n=t[1]/100,o=t[2]/100,i=n*Math.min(o,1-o),s=(c,u=(c+r/30)%12)=>o-i*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return e.type==="hsla"&&(a+="a",l.push(t[3])),Mm({type:a,values:l})}function c4(e){e=ca(e);let t=e.type==="hsl"||e.type==="hsla"?ca(eQ(e)).values:e.values;return t=t.map(r=>(e.type!=="color"&&(r/=255),r<=.03928?r/12.92:((r+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function tQ(e,t){const r=c4(e),n=c4(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}function Rr(e,t){return e=ca(e),t=Eb(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Mm(e)}function rQ(e,t){if(e=ca(e),t=Eb(t),e.type.indexOf("hsl")!==-1)e.values[2]*=1-t;else if(e.type.indexOf("rgb")!==-1||e.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)e.values[r]*=1-t;return Mm(e)}function nQ(e,t){if(e=ca(e),t=Eb(t),e.type.indexOf("hsl")!==-1)e.values[2]+=(100-e.values[2])*t;else if(e.type.indexOf("rgb")!==-1)for(let r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(e.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return Mm(e)}const oQ=S.createContext(null),ET=oQ;function CT(){return S.useContext(ET)}const iQ=typeof Symbol=="function"&&Symbol.for,sQ=iQ?Symbol.for("mui.nested"):"__THEME_NESTED__";function aQ(e,t){return typeof t=="function"?t(e):O({},e,t)}function lQ(e){const{children:t,theme:r}=e,n=CT(),o=S.useMemo(()=>{const i=n===null?r:aQ(n,r);return i!=null&&(i[sQ]=n!==null),i},[r,n]);return A.jsx(ET.Provider,{value:o,children:t})}const u4={};function d4(e,t,r,n=!1){return S.useMemo(()=>{const o=e&&t[e]||t;if(typeof r=="function"){const i=r(o),s=e?O({},t,{[e]:i}):i;return n?()=>s:s}return e?O({},t,{[e]:r}):O({},t,r)},[e,t,r,n])}function cQ(e){const{children:t,theme:r,themeId:n}=e,o=xb(u4),i=CT()||u4,s=d4(n,o,r),a=d4(n,i,r,!0);return A.jsx(lQ,{theme:a,children:A.jsx(hb.Provider,{value:s,children:t})})}const uQ=["component","direction","spacing","divider","children","className","useFlexGap"],dQ=Cm(),fQ=XX("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root});function pQ(e){return ST({props:e,name:"MuiStack",defaultTheme:dQ})}function hQ(e,t){const r=S.Children.toArray(e).filter(Boolean);return r.reduce((n,o,i)=>(n.push(o),i({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],gQ=({ownerState:e,theme:t})=>{let r=O({display:"flex",flexDirection:"column"},ro({theme:t},Hg({values:e.direction,breakpoints:t.breakpoints.values}),n=>({flexDirection:n})));if(e.spacing){const n=bb(t),o=Object.keys(t.breakpoints.values).reduce((l,c)=>((typeof e.spacing=="object"&&e.spacing[c]!=null||typeof e.direction=="object"&&e.direction[c]!=null)&&(l[c]=!0),l),{}),i=Hg({values:e.direction,base:o}),s=Hg({values:e.spacing,base:o});typeof i=="object"&&Object.keys(i).forEach((l,c,u)=>{if(!i[l]){const f=c>0?i[u[c-1]]:"column";i[l]=f}}),r=nn(r,ro({theme:t},s,(l,c)=>e.useFlexGap?{gap:la(n,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${mQ(c?i[c]:e.direction)}`]:la(n,l)}}))}return r=KJ(t.breakpoints,r),r};function vQ(e={}){const{createStyledComponent:t=fQ,useThemeProps:r=pQ,componentName:n="MuiStack"}=e,o=()=>Qt({root:["root"]},l=>Ft(n,l),{}),i=t(gQ);return S.forwardRef(function(l,c){const u=r(l),d=Sb(u),{component:f="div",direction:p="column",spacing:h=0,divider:m,children:b,className:v,useFlexGap:g=!1}=d,y=ge(d,uQ),k={direction:p,spacing:h,useFlexGap:g},x=o();return A.jsx(i,O({as:f,ownerState:k,ref:c,className:Ce(x.root,v)},y,{children:m?hQ(b,m):b}))})}function yQ(e,t){return O({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},t)}const bQ=["mode","contrastThreshold","tonalOffset"],f4={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:od.white,default:od.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},Bg={text:{primary:od.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:od.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function p4(e,t,r,n){const o=n.light||n,i=n.dark||n*1.5;e[t]||(e.hasOwnProperty(r)?e[t]=e[r]:t==="light"?e.light=nQ(e.main,o):t==="dark"&&(e.dark=rQ(e.main,i)))}function kQ(e="light"){return e==="dark"?{main:Oa[200],light:Oa[50],dark:Oa[400]}:{main:Oa[700],light:Oa[400],dark:Oa[800]}}function xQ(e="light"){return e==="dark"?{main:Ta[200],light:Ta[50],dark:Ta[400]}:{main:Ta[500],light:Ta[300],dark:Ta[700]}}function wQ(e="light"){return e==="dark"?{main:Ma[500],light:Ma[300],dark:Ma[700]}:{main:Ma[700],light:Ma[400],dark:Ma[800]}}function SQ(e="light"){return e==="dark"?{main:_a[400],light:_a[300],dark:_a[700]}:{main:_a[700],light:_a[500],dark:_a[900]}}function EQ(e="light"){return e==="dark"?{main:Aa[400],light:Aa[300],dark:Aa[700]}:{main:Aa[800],light:Aa[500],dark:Aa[900]}}function CQ(e="light"){return e==="dark"?{main:hc[400],light:hc[300],dark:hc[700]}:{main:"#ed6c02",light:hc[500],dark:hc[900]}}function MQ(e){const{mode:t="light",contrastThreshold:r=3,tonalOffset:n=.2}=e,o=ge(e,bQ),i=e.primary||kQ(t),s=e.secondary||xQ(t),a=e.error||wQ(t),l=e.info||SQ(t),c=e.success||EQ(t),u=e.warning||CQ(t);function d(m){return tQ(m,Bg.text.primary)>=r?Bg.text.primary:f4.text.primary}const f=({color:m,name:b,mainShade:v=500,lightShade:g=300,darkShade:y=700})=>{if(m=O({},m),!m.main&&m[v]&&(m.main=m[v]),!m.hasOwnProperty("main"))throw new Error(Il(11,b?` (${b})`:"",v));if(typeof m.main!="string")throw new Error(Il(12,b?` (${b})`:"",JSON.stringify(m.main)));return p4(m,"light",g,n),p4(m,"dark",y,n),m.contrastText||(m.contrastText=d(m.main)),m},p={dark:Bg,light:f4};return nn(O({common:O({},od),mode:t,primary:f({color:i,name:"primary"}),secondary:f({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:f({color:a,name:"error"}),warning:f({color:u,name:"warning"}),info:f({color:l,name:"info"}),success:f({color:c,name:"success"}),grey:kY,contrastThreshold:r,getContrastText:d,augmentColor:f,tonalOffset:n},p[t]),o)}const TQ=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function OQ(e){return Math.round(e*1e5)/1e5}const h4={textTransform:"uppercase"},m4='"Roboto", "Helvetica", "Arial", sans-serif';function _Q(e,t){const r=typeof t=="function"?t(e):t,{fontFamily:n=m4,fontSize:o=14,fontWeightLight:i=300,fontWeightRegular:s=400,fontWeightMedium:a=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:d}=r,f=ge(r,TQ),p=o/14,h=d||(v=>`${v/c*p}rem`),m=(v,g,y,k,x)=>O({fontFamily:n,fontWeight:v,fontSize:h(g),lineHeight:y},n===m4?{letterSpacing:`${OQ(k/g)}em`}:{},x,u),b={h1:m(i,96,1.167,-1.5),h2:m(i,60,1.2,-.5),h3:m(s,48,1.167,0),h4:m(s,34,1.235,.25),h5:m(s,24,1.334,0),h6:m(a,20,1.6,.15),subtitle1:m(s,16,1.75,.15),subtitle2:m(a,14,1.57,.1),body1:m(s,16,1.5,.15),body2:m(s,14,1.43,.15),button:m(a,14,1.75,.4,h4),caption:m(s,12,1.66,.4),overline:m(s,12,2.66,1,h4),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return nn(O({htmlFontSize:c,pxToRem:h,fontFamily:n,fontSize:o,fontWeightLight:i,fontWeightRegular:s,fontWeightMedium:a,fontWeightBold:l},b),f,{clone:!1})}const AQ=.2,RQ=.14,PQ=.12;function tt(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${AQ})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${RQ})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${PQ})`].join(",")}const NQ=["none",tt(0,2,1,-1,0,1,1,0,0,1,3,0),tt(0,3,1,-2,0,2,2,0,0,1,5,0),tt(0,3,3,-2,0,3,4,0,0,1,8,0),tt(0,2,4,-1,0,4,5,0,0,1,10,0),tt(0,3,5,-1,0,5,8,0,0,1,14,0),tt(0,3,5,-1,0,6,10,0,0,1,18,0),tt(0,4,5,-2,0,7,10,1,0,2,16,1),tt(0,5,5,-3,0,8,10,1,0,3,14,2),tt(0,5,6,-3,0,9,12,1,0,3,16,2),tt(0,6,6,-3,0,10,14,1,0,4,18,3),tt(0,6,7,-4,0,11,15,1,0,4,20,3),tt(0,7,8,-4,0,12,17,2,0,5,22,4),tt(0,7,8,-4,0,13,19,2,0,5,24,4),tt(0,7,9,-4,0,14,21,2,0,5,26,4),tt(0,8,9,-5,0,15,22,2,0,6,28,5),tt(0,8,10,-5,0,16,24,2,0,6,30,5),tt(0,8,11,-5,0,17,26,2,0,6,32,5),tt(0,9,11,-5,0,18,28,2,0,7,34,6),tt(0,9,12,-6,0,19,29,2,0,7,36,6),tt(0,10,13,-6,0,20,31,3,0,8,38,7),tt(0,10,13,-6,0,21,33,3,0,8,40,7),tt(0,10,14,-6,0,22,35,3,0,8,42,7),tt(0,11,14,-7,0,23,36,3,0,9,44,8),tt(0,11,15,-7,0,24,38,3,0,9,46,8)],zQ=NQ,LQ=["duration","easing","delay"],IQ={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},DQ={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function g4(e){return`${Math.round(e)}ms`}function $Q(e){if(!e)return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function HQ(e){const t=O({},IQ,e.easing),r=O({},DQ,e.duration);return O({getAutoHeightDuration:$Q,create:(o=["all"],i={})=>{const{duration:s=r.standard,easing:a=t.easeInOut,delay:l=0}=i;return ge(i,LQ),(Array.isArray(o)?o:[o]).map(c=>`${c} ${typeof s=="string"?s:g4(s)} ${a} ${typeof l=="string"?l:g4(l)}`).join(",")}},e,{easing:t,duration:r})}const BQ={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},FQ=BQ,VQ=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function Cb(e={},...t){const{mixins:r={},palette:n={},transitions:o={},typography:i={}}=e,s=ge(e,VQ);if(e.vars)throw new Error(Il(18));const a=MQ(n),l=Cm(e);let c=nn(l,{mixins:yQ(l.breakpoints,r),palette:a,shadows:zQ.slice(),typography:_Q(a,i),transitions:HQ(o),zIndex:O({},FQ)});return c=nn(c,s),c=t.reduce((u,d)=>nn(u,d),c),c.unstable_sxConfig=O({},Sm,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(d){return Em({sx:d,theme:this})},c}const jQ=Cb(),Mb=jQ;function Tm(){const e=wb(Mb);return e[Dl]||e}function Ut({props:e,name:t}){return ST({props:e,name:t,defaultTheme:Mb,themeId:Dl})}const Tb=e=>Kf(e)&&e!=="classes",UQ=wT({themeId:Dl,defaultTheme:Mb,rootShouldForwardProp:Tb}),Ye=UQ,WQ=["theme"];function KQ(e){let{theme:t}=e,r=ge(e,WQ);const n=t[Dl];return A.jsx(cQ,O({},r,{themeId:n?Dl:void 0,theme:n||t}))}const qQ=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)},v4=qQ;function L0(e,t){return L0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},L0(e,t)}function MT(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,L0(e,t)}const y4={disabled:!1},oh=L.createContext(null);var GQ=function(t){return t.scrollTop},Qc="unmounted",Os="exited",_s="entering",Va="entered",I0="exiting",si=function(e){MT(t,e);function t(n,o){var i;i=e.call(this,n,o)||this;var s=o,a=s&&!s.isMounting?n.enter:n.appear,l;return i.appearStatus=null,n.in?a?(l=Os,i.appearStatus=_s):l=Va:n.unmountOnExit||n.mountOnEnter?l=Qc:l=Os,i.state={status:l},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var s=o.in;return s&&i.status===Qc?{status:Os}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(o){var i=null;if(o!==this.props){var s=this.state.status;this.props.in?s!==_s&&s!==Va&&(i=_s):(s===_s||s===Va)&&(i=I0)}this.updateStatus(!1,i)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var o=this.props.timeout,i,s,a;return i=s=a=o,o!=null&&typeof o!="number"&&(i=o.exit,s=o.enter,a=o.appear!==void 0?o.appear:s),{exit:i,enter:s,appear:a}},r.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===_s){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:lf.findDOMNode(this);s&&GQ(s)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Os&&this.setState({status:Qc})},r.performEnter=function(o){var i=this,s=this.props.enter,a=this.context?this.context.isMounting:o,l=this.props.nodeRef?[a]:[lf.findDOMNode(this),a],c=l[0],u=l[1],d=this.getTimeouts(),f=a?d.appear:d.enter;if(!o&&!s||y4.disabled){this.safeSetState({status:Va},function(){i.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:_s},function(){i.props.onEntering(c,u),i.onTransitionEnd(f,function(){i.safeSetState({status:Va},function(){i.props.onEntered(c,u)})})})},r.performExit=function(){var o=this,i=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:lf.findDOMNode(this);if(!i||y4.disabled){this.safeSetState({status:Os},function(){o.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:I0},function(){o.props.onExiting(a),o.onTransitionEnd(s.exit,function(){o.safeSetState({status:Os},function(){o.props.onExited(a)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},r.setNextCallback=function(o){var i=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,i.nextCallback=null,o(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},r.onTransitionEnd=function(o,i){this.setNextCallback(i);var s=this.props.nodeRef?this.props.nodeRef.current:lf.findDOMNode(this),a=o==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}o!=null&&setTimeout(this.nextCallback,o)},r.render=function(){var o=this.state.status;if(o===Qc)return null;var i=this.props,s=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var a=ge(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return L.createElement(oh.Provider,{value:null},typeof s=="function"?s(o,a):L.cloneElement(L.Children.only(s),a))},t}(L.Component);si.contextType=oh;si.propTypes={};function Ra(){}si.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ra,onEntering:Ra,onEntered:Ra,onExit:Ra,onExiting:Ra,onExited:Ra};si.UNMOUNTED=Qc;si.EXITED=Os;si.ENTERING=_s;si.ENTERED=Va;si.EXITING=I0;const TT=si;function YQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ob(e,t){var r=function(i){return t&&S.isValidElement(i)?t(i):i},n=Object.create(null);return e&&S.Children.map(e,function(o){return o}).forEach(function(o){n[o.key]=r(o)}),n}function JQ(e,t){e=e||{},t=t||{};function r(u){return u in t?t[u]:e[u]}var n=Object.create(null),o=[];for(var i in e)i in t?o.length&&(n[i]=o,o=[]):o.push(i);var s,a={};for(var l in t){if(n[l])for(s=0;se.scrollTop;function ih(e,t){var r,n;const{timeout:o,easing:i,style:s={}}=e;return{duration:(r=s.transitionDuration)!=null?r:typeof o=="number"?o:o[t.mode]||0,easing:(n=s.transitionTimingFunction)!=null?n:typeof i=="object"?i[t.mode]:i,delay:s.transitionDelay}}function rZ(e){return Ft("MuiPaper",e)}Vt("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const nZ=["className","component","elevation","square","variant"],oZ=e=>{const{square:t,elevation:r,variant:n,classes:o}=e,i={root:["root",n,!t&&"rounded",n==="elevation"&&`elevation${r}`]};return Qt(i,rZ,o)},iZ=Ye("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],!r.square&&t.rounded,r.variant==="elevation"&&t[`elevation${r.elevation}`]]}})(({theme:e,ownerState:t})=>{var r;return O({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!t.square&&{borderRadius:e.shape.borderRadius},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.divider}`},t.variant==="elevation"&&O({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&e.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${Rr("#fff",v4(t.elevation))}, ${Rr("#fff",v4(t.elevation))})`},e.vars&&{backgroundImage:(r=e.vars.overlays)==null?void 0:r[t.elevation]}))}),sZ=S.forwardRef(function(t,r){const n=Ut({props:t,name:"MuiPaper"}),{className:o,component:i="div",elevation:s=1,square:a=!1,variant:l="elevation"}=n,c=ge(n,nZ),u=O({},n,{component:i,elevation:s,square:a,variant:l}),d=oZ(u);return A.jsx(iZ,O({as:i,ownerState:u,className:Ce(d.root,o),ref:r},c))}),aZ=sZ;function lZ(e){const{className:t,classes:r,pulsate:n=!1,rippleX:o,rippleY:i,rippleSize:s,in:a,onExited:l,timeout:c}=e,[u,d]=S.useState(!1),f=Ce(t,r.ripple,r.rippleVisible,n&&r.ripplePulsate),p={width:s,height:s,top:-(s/2)+i,left:-(s/2)+o},h=Ce(r.child,u&&r.childLeaving,n&&r.childPulsate);return!a&&!u&&d(!0),S.useEffect(()=>{if(!a&&l!=null){const m=setTimeout(l,c);return()=>{clearTimeout(m)}}},[l,a,c]),A.jsx("span",{className:f,style:p,children:A.jsx("span",{className:h})})}const cZ=Vt("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),vn=cZ,uZ=["center","classes","className"];let Om=e=>e,b4,k4,x4,w4;const D0=550,dZ=80,fZ=mb(b4||(b4=Om` + 0% { + transform: scale(0); + opacity: 0.1; + } + + 100% { + transform: scale(1); + opacity: 0.3; + } +`)),pZ=mb(k4||(k4=Om` + 0% { + opacity: 1; + } + + 100% { + opacity: 0; + } +`)),hZ=mb(x4||(x4=Om` + 0% { + transform: scale(1); + } + + 50% { + transform: scale(0.92); + } + + 100% { + transform: scale(1); + } +`)),mZ=Ye("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),gZ=Ye(lZ,{name:"MuiTouchRipple",slot:"Ripple"})(w4||(w4=Om` + opacity: 0; + position: absolute; + + &.${0} { + opacity: 0.3; + transform: scale(1); + animation-name: ${0}; + animation-duration: ${0}ms; + animation-timing-function: ${0}; + } + + &.${0} { + animation-duration: ${0}ms; + } + + & .${0} { + opacity: 1; + display: block; + width: 100%; + height: 100%; + border-radius: 50%; + background-color: currentColor; + } + + & .${0} { + opacity: 0; + animation-name: ${0}; + animation-duration: ${0}ms; + animation-timing-function: ${0}; + } + + & .${0} { + position: absolute; + /* @noflip */ + left: 0px; + top: 0; + animation-name: ${0}; + animation-duration: 2500ms; + animation-timing-function: ${0}; + animation-iteration-count: infinite; + animation-delay: 200ms; + } +`),vn.rippleVisible,fZ,D0,({theme:e})=>e.transitions.easing.easeInOut,vn.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,vn.child,vn.childLeaving,pZ,D0,({theme:e})=>e.transitions.easing.easeInOut,vn.childPulsate,hZ,({theme:e})=>e.transitions.easing.easeInOut),vZ=S.forwardRef(function(t,r){const n=Ut({props:t,name:"MuiTouchRipple"}),{center:o=!1,classes:i={},className:s}=n,a=ge(n,uZ),[l,c]=S.useState([]),u=S.useRef(0),d=S.useRef(null);S.useEffect(()=>{d.current&&(d.current(),d.current=null)},[l]);const f=S.useRef(!1),p=S.useRef(0),h=S.useRef(null),m=S.useRef(null);S.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const b=S.useCallback(k=>{const{pulsate:x,rippleX:w,rippleY:E,rippleSize:M,cb:C}=k;c(T=>[...T,A.jsx(gZ,{classes:{ripple:Ce(i.ripple,vn.ripple),rippleVisible:Ce(i.rippleVisible,vn.rippleVisible),ripplePulsate:Ce(i.ripplePulsate,vn.ripplePulsate),child:Ce(i.child,vn.child),childLeaving:Ce(i.childLeaving,vn.childLeaving),childPulsate:Ce(i.childPulsate,vn.childPulsate)},timeout:D0,pulsate:x,rippleX:w,rippleY:E,rippleSize:M},u.current)]),u.current+=1,d.current=C},[i]),v=S.useCallback((k={},x={},w=()=>{})=>{const{pulsate:E=!1,center:M=o||x.pulsate,fakeElement:C=!1}=x;if((k==null?void 0:k.type)==="mousedown"&&f.current){f.current=!1;return}(k==null?void 0:k.type)==="touchstart"&&(f.current=!0);const T=C?null:m.current,R=T?T.getBoundingClientRect():{width:0,height:0,left:0,top:0};let B,I,F;if(M||k===void 0||k.clientX===0&&k.clientY===0||!k.clientX&&!k.touches)B=Math.round(R.width/2),I=Math.round(R.height/2);else{const{clientX:V,clientY:z}=k.touches&&k.touches.length>0?k.touches[0]:k;B=Math.round(V-R.left),I=Math.round(z-R.top)}if(M)F=Math.sqrt((2*R.width**2+R.height**2)/3),F%2===0&&(F+=1);else{const V=Math.max(Math.abs((T?T.clientWidth:0)-B),B)*2+2,z=Math.max(Math.abs((T?T.clientHeight:0)-I),I)*2+2;F=Math.sqrt(V**2+z**2)}k!=null&&k.touches?h.current===null&&(h.current=()=>{b({pulsate:E,rippleX:B,rippleY:I,rippleSize:F,cb:w})},p.current=setTimeout(()=>{h.current&&(h.current(),h.current=null)},dZ)):b({pulsate:E,rippleX:B,rippleY:I,rippleSize:F,cb:w})},[o,b]),g=S.useCallback(()=>{v({},{pulsate:!0})},[v]),y=S.useCallback((k,x)=>{if(clearTimeout(p.current),(k==null?void 0:k.type)==="touchend"&&h.current){h.current(),h.current=null,p.current=setTimeout(()=>{y(k,x)});return}h.current=null,c(w=>w.length>0?w.slice(1):w),d.current=x},[]);return S.useImperativeHandle(r,()=>({pulsate:g,start:v,stop:y}),[g,v,y]),A.jsx(mZ,O({className:Ce(vn.root,i.root,s),ref:m},a,{children:A.jsx(tZ,{component:null,exit:!0,children:l})}))}),yZ=vZ;function bZ(e){return Ft("MuiButtonBase",e)}const kZ=Vt("MuiButtonBase",["root","disabled","focusVisible"]),xZ=kZ,wZ=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],SZ=e=>{const{disabled:t,focusVisible:r,focusVisibleClassName:n,classes:o}=e,s=Qt({root:["root",t&&"disabled",r&&"focusVisible"]},bZ,o);return r&&n&&(s.root+=` ${n}`),s},EZ=Ye("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${xZ.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),CZ=S.forwardRef(function(t,r){const n=Ut({props:t,name:"MuiButtonBase"}),{action:o,centerRipple:i=!1,children:s,className:a,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:d=!1,focusRipple:f=!1,LinkComponent:p="a",onBlur:h,onClick:m,onContextMenu:b,onDragLeave:v,onFocus:g,onFocusVisible:y,onKeyDown:k,onKeyUp:x,onMouseDown:w,onMouseLeave:E,onMouseUp:M,onTouchEnd:C,onTouchMove:T,onTouchStart:R,tabIndex:B=0,TouchRippleProps:I,touchRippleRef:F,type:V}=n,z=ge(n,wZ),K=S.useRef(null),_=S.useRef(null),N=Hr(_,F),{isFocusVisibleRef:H,onFocus:G,onBlur:J,ref:_e}=G3(),[oe,ue]=S.useState(!1);c&&oe&&ue(!1),S.useImperativeHandle(o,()=>({focusVisible:()=>{ue(!0),K.current.focus()}}),[]);const[de,he]=S.useState(!1);S.useEffect(()=>{he(!0)},[]);const Me=de&&!u&&!c;S.useEffect(()=>{oe&&f&&!u&&de&&_.current.pulsate()},[u,f,oe,de]);function Se(fe,hn,Zl=d){return $s(li=>(hn&&hn(li),!Zl&&_.current&&_.current[fe](li),!0))}const ct=Se("start",w),et=Se("stop",b),Er=Se("stop",v),pe=Se("stop",M),Ie=Se("stop",fe=>{oe&&fe.preventDefault(),E&&E(fe)}),Ue=Se("start",R),Ln=Se("stop",C),jr=Se("stop",T),Zt=Se("stop",fe=>{J(fe),H.current===!1&&ue(!1),h&&h(fe)},!1),To=$s(fe=>{K.current||(K.current=fe.currentTarget),G(fe),H.current===!0&&(ue(!0),y&&y(fe)),g&&g(fe)}),Nt=()=>{const fe=K.current;return l&&l!=="button"&&!(fe.tagName==="A"&&fe.href)},Ur=S.useRef(!1),fn=$s(fe=>{f&&!Ur.current&&oe&&_.current&&fe.key===" "&&(Ur.current=!0,_.current.stop(fe,()=>{_.current.start(fe)})),fe.target===fe.currentTarget&&Nt()&&fe.key===" "&&fe.preventDefault(),k&&k(fe),fe.target===fe.currentTarget&&Nt()&&fe.key==="Enter"&&!c&&(fe.preventDefault(),m&&m(fe))}),In=$s(fe=>{f&&fe.key===" "&&_.current&&oe&&!fe.defaultPrevented&&(Ur.current=!1,_.current.stop(fe,()=>{_.current.pulsate(fe)})),x&&x(fe),m&&fe.target===fe.currentTarget&&Nt()&&fe.key===" "&&!fe.defaultPrevented&&m(fe)});let Je=l;Je==="button"&&(z.href||z.to)&&(Je=p);const Wr={};Je==="button"?(Wr.type=V===void 0?"button":V,Wr.disabled=c):(!z.href&&!z.to&&(Wr.role="button"),c&&(Wr["aria-disabled"]=c));const pn=Hr(r,_e,K),ai=O({},n,{centerRipple:i,component:l,disabled:c,disableRipple:u,disableTouchRipple:d,focusRipple:f,tabIndex:B,focusVisible:oe}),ba=SZ(ai);return A.jsxs(EZ,O({as:Je,className:Ce(ba.root,a),ownerState:ai,onBlur:Zt,onClick:m,onContextMenu:et,onFocus:To,onKeyDown:fn,onKeyUp:In,onMouseDown:ct,onMouseLeave:Ie,onMouseUp:pe,onDragLeave:Er,onTouchEnd:Ln,onTouchMove:jr,onTouchStart:Ue,ref:pn,tabIndex:c?-1:B,type:V},Wr,z,{children:[s,Me?A.jsx(yZ,O({ref:N,center:i},I)):null]}))}),Ab=CZ;function MZ(e){return Ft("MuiIconButton",e)}const TZ=Vt("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),OZ=TZ,_Z=["edge","children","className","color","disabled","disableFocusRipple","size"],AZ=e=>{const{classes:t,disabled:r,color:n,edge:o,size:i}=e,s={root:["root",r&&"disabled",n!=="default"&&`color${Be(n)}`,o&&`edge${Be(o)}`,`size${Be(i)}`]};return Qt(s,MZ,t)},RZ=Ye(Ab,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.color!=="default"&&t[`color${Be(r.color)}`],r.edge&&t[`edge${Be(r.edge)}`],t[`size${Be(r.size)}`]]}})(({theme:e,ownerState:t})=>O({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Rr(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12}),({theme:e,ownerState:t})=>{var r;const n=(r=(e.vars||e).palette)==null?void 0:r[t.color];return O({},t.color==="inherit"&&{color:"inherit"},t.color!=="inherit"&&t.color!=="default"&&O({color:n==null?void 0:n.main},!t.disableRipple&&{"&:hover":O({},n&&{backgroundColor:e.vars?`rgba(${n.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Rr(n.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),t.size==="small"&&{padding:5,fontSize:e.typography.pxToRem(18)},t.size==="large"&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${OZ.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})}),PZ=S.forwardRef(function(t,r){const n=Ut({props:t,name:"MuiIconButton"}),{edge:o=!1,children:i,className:s,color:a="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium"}=n,d=ge(n,_Z),f=O({},n,{edge:o,color:a,disabled:l,disableFocusRipple:c,size:u}),p=AZ(f);return A.jsx(RZ,O({className:Ce(p.root,s),centerRipple:!0,focusRipple:!c,disabled:l,ref:r,ownerState:f},d,{children:i}))}),NZ=PZ;function zZ(e){return Ft("MuiTypography",e)}Vt("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const LZ=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],IZ=e=>{const{align:t,gutterBottom:r,noWrap:n,paragraph:o,variant:i,classes:s}=e,a={root:["root",i,e.align!=="inherit"&&`align${Be(t)}`,r&&"gutterBottom",n&&"noWrap",o&&"paragraph"]};return Qt(a,zZ,s)},DZ=Ye("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.variant&&t[r.variant],r.align!=="inherit"&&t[`align${Be(r.align)}`],r.noWrap&&t.noWrap,r.gutterBottom&&t.gutterBottom,r.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>O({margin:0},t.variant==="inherit"&&{font:"inherit"},t.variant!=="inherit"&&e.typography[t.variant],t.align!=="inherit"&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),S4={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},$Z={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},HZ=e=>$Z[e]||e,BZ=S.forwardRef(function(t,r){const n=Ut({props:t,name:"MuiTypography"}),o=HZ(n.color),i=Sb(O({},n,{color:o})),{align:s="inherit",className:a,component:l,gutterBottom:c=!1,noWrap:u=!1,paragraph:d=!1,variant:f="body1",variantMapping:p=S4}=i,h=ge(i,LZ),m=O({},i,{align:s,color:o,className:a,component:l,gutterBottom:c,noWrap:u,paragraph:d,variant:f,variantMapping:p}),b=l||(d?"p":p[f]||S4[f])||"span",v=IZ(m);return A.jsx(DZ,O({as:b,ref:r,ownerState:m,className:Ce(v.root,a)},h))}),Zc=BZ;function _T(e){return typeof e=="string"}function eu(e,t,r){return e===void 0||_T(e)?t:O({},t,{ownerState:O({},t.ownerState,r)})}const FZ={disableDefaultClasses:!1},VZ=S.createContext(FZ);function jZ(e){const{disableDefaultClasses:t}=S.useContext(VZ);return r=>t?"":e(r)}function AT(e,t=[]){if(e===void 0)return{};const r={};return Object.keys(e).filter(n=>n.match(/^on[A-Z]/)&&typeof e[n]=="function"&&!t.includes(n)).forEach(n=>{r[n]=e[n]}),r}function UZ(e,t,r){return typeof e=="function"?e(t,r):e}function E4(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(r=>!(r.match(/^on[A-Z]/)&&typeof e[r]=="function")).forEach(r=>{t[r]=e[r]}),t}function WZ(e){const{getSlotProps:t,additionalProps:r,externalSlotProps:n,externalForwardedProps:o,className:i}=e;if(!t){const p=Ce(o==null?void 0:o.className,n==null?void 0:n.className,i,r==null?void 0:r.className),h=O({},r==null?void 0:r.style,o==null?void 0:o.style,n==null?void 0:n.style),m=O({},r,o,n);return p.length>0&&(m.className=p),Object.keys(h).length>0&&(m.style=h),{props:m,internalRef:void 0}}const s=AT(O({},o,n)),a=E4(n),l=E4(o),c=t(s),u=Ce(c==null?void 0:c.className,r==null?void 0:r.className,i,o==null?void 0:o.className,n==null?void 0:n.className),d=O({},c==null?void 0:c.style,r==null?void 0:r.style,o==null?void 0:o.style,n==null?void 0:n.style),f=O({},c,r,l,a);return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:c.ref}}const KZ=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function ei(e){var t;const{elementType:r,externalSlotProps:n,ownerState:o,skipResolvingSlotProps:i=!1}=e,s=ge(e,KZ),a=i?{}:UZ(n,o),{props:l,internalRef:c}=WZ(O({},s,{externalSlotProps:a})),u=Hr(c,a==null?void 0:a.ref,(t=e.additionalProps)==null?void 0:t.ref);return eu(r,O({},l,{ref:u}),o)}function qZ(e){const{badgeContent:t,invisible:r=!1,max:n=99,showZero:o=!1}=e,i=J3({badgeContent:t,max:n});let s=r;r===!1&&t===0&&!o&&(s=!0);const{badgeContent:a,max:l=n}=s?i:e,c=a&&Number(a)>l?`${l}+`:a;return{badgeContent:a,invisible:s,max:l,displayValue:c}}const GZ=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function YZ(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function JZ(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=n=>e.ownerDocument.querySelector(`input[type="radio"]${n}`);let r=t(`[name="${e.name}"]:checked`);return r||(r=t(`[name="${e.name}"]`)),r!==e}function XZ(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||JZ(e))}function QZ(e){const t=[],r=[];return Array.from(e.querySelectorAll(GZ)).forEach((n,o)=>{const i=YZ(n);i===-1||!XZ(n)||(i===0?t.push(n):r.push({documentOrder:o,tabIndex:i,node:n}))}),r.sort((n,o)=>n.tabIndex===o.tabIndex?n.documentOrder-o.documentOrder:n.tabIndex-o.tabIndex).map(n=>n.node).concat(t)}function ZZ(){return!0}function eee(e){const{children:t,disableAutoFocus:r=!1,disableEnforceFocus:n=!1,disableRestoreFocus:o=!1,getTabbable:i=QZ,isEnabled:s=ZZ,open:a}=e,l=S.useRef(!1),c=S.useRef(null),u=S.useRef(null),d=S.useRef(null),f=S.useRef(null),p=S.useRef(!1),h=S.useRef(null),m=Hr(t.ref,h),b=S.useRef(null);S.useEffect(()=>{!a||!h.current||(p.current=!r)},[r,a]),S.useEffect(()=>{if(!a||!h.current)return;const y=Ir(h.current);return h.current.contains(y.activeElement)||(h.current.hasAttribute("tabIndex")||h.current.setAttribute("tabIndex","-1"),p.current&&h.current.focus()),()=>{o||(d.current&&d.current.focus&&(l.current=!0,d.current.focus()),d.current=null)}},[a]),S.useEffect(()=>{if(!a||!h.current)return;const y=Ir(h.current),k=E=>{b.current=E,!(n||!s()||E.key!=="Tab")&&y.activeElement===h.current&&E.shiftKey&&(l.current=!0,u.current&&u.current.focus())},x=()=>{const E=h.current;if(E===null)return;if(!y.hasFocus()||!s()||l.current){l.current=!1;return}if(E.contains(y.activeElement)||n&&y.activeElement!==c.current&&y.activeElement!==u.current)return;if(y.activeElement!==f.current)f.current=null;else if(f.current!==null)return;if(!p.current)return;let M=[];if((y.activeElement===c.current||y.activeElement===u.current)&&(M=i(h.current)),M.length>0){var C,T;const R=!!((C=b.current)!=null&&C.shiftKey&&((T=b.current)==null?void 0:T.key)==="Tab"),B=M[0],I=M[M.length-1];typeof B!="string"&&typeof I!="string"&&(R?I.focus():B.focus())}else E.focus()};y.addEventListener("focusin",x),y.addEventListener("keydown",k,!0);const w=setInterval(()=>{y.activeElement&&y.activeElement.tagName==="BODY"&&x()},50);return()=>{clearInterval(w),y.removeEventListener("focusin",x),y.removeEventListener("keydown",k,!0)}},[r,n,o,s,a,i]);const v=y=>{d.current===null&&(d.current=y.relatedTarget),p.current=!0,f.current=y.target;const k=t.props.onFocus;k&&k(y)},g=y=>{d.current===null&&(d.current=y.relatedTarget),p.current=!0};return A.jsxs(S.Fragment,{children:[A.jsx("div",{tabIndex:a?0:-1,onFocus:g,ref:c,"data-testid":"sentinelStart"}),S.cloneElement(t,{ref:m,onFocus:v}),A.jsx("div",{tabIndex:a?0:-1,onFocus:g,ref:u,"data-testid":"sentinelEnd"})]})}var Dr="top",_n="bottom",An="right",$r="left",Rb="auto",Pd=[Dr,_n,An,$r],Hl="start",cd="end",tee="clippingParents",RT="viewport",gc="popper",ree="reference",C4=Pd.reduce(function(e,t){return e.concat([t+"-"+Hl,t+"-"+cd])},[]),PT=[].concat(Pd,[Rb]).reduce(function(e,t){return e.concat([t,t+"-"+Hl,t+"-"+cd])},[]),nee="beforeRead",oee="read",iee="afterRead",see="beforeMain",aee="main",lee="afterMain",cee="beforeWrite",uee="write",dee="afterWrite",fee=[nee,oee,iee,see,aee,lee,cee,uee,dee];function So(e){return e?(e.nodeName||"").toLowerCase():null}function ln(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function ua(e){var t=ln(e).Element;return e instanceof t||e instanceof Element}function En(e){var t=ln(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Pb(e){if(typeof ShadowRoot>"u")return!1;var t=ln(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function pee(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},o=t.attributes[r]||{},i=t.elements[r];!En(i)||!So(i)||(Object.assign(i.style,n),Object.keys(o).forEach(function(s){var a=o[s];a===!1?i.removeAttribute(s):i.setAttribute(s,a===!0?"":a)}))})}function hee(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var o=t.elements[n],i=t.attributes[n]||{},s=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),a=s.reduce(function(l,c){return l[c]="",l},{});!En(o)||!So(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const mee={name:"applyStyles",enabled:!0,phase:"write",fn:pee,effect:hee,requires:["computeStyles"]};function bo(e){return e.split("-")[0]}var Ks=Math.max,sh=Math.min,Bl=Math.round;function $0(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function NT(){return!/^((?!chrome|android).)*safari/i.test($0())}function Fl(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),o=1,i=1;t&&En(e)&&(o=e.offsetWidth>0&&Bl(n.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Bl(n.height)/e.offsetHeight||1);var s=ua(e)?ln(e):window,a=s.visualViewport,l=!NT()&&r,c=(n.left+(l&&a?a.offsetLeft:0))/o,u=(n.top+(l&&a?a.offsetTop:0))/i,d=n.width/o,f=n.height/i;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function Nb(e){var t=Fl(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function zT(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&Pb(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function ti(e){return ln(e).getComputedStyle(e)}function gee(e){return["table","td","th"].indexOf(So(e))>=0}function hs(e){return((ua(e)?e.ownerDocument:e.document)||window.document).documentElement}function _m(e){return So(e)==="html"?e:e.assignedSlot||e.parentNode||(Pb(e)?e.host:null)||hs(e)}function M4(e){return!En(e)||ti(e).position==="fixed"?null:e.offsetParent}function vee(e){var t=/firefox/i.test($0()),r=/Trident/i.test($0());if(r&&En(e)){var n=ti(e);if(n.position==="fixed")return null}var o=_m(e);for(Pb(o)&&(o=o.host);En(o)&&["html","body"].indexOf(So(o))<0;){var i=ti(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function Nd(e){for(var t=ln(e),r=M4(e);r&&gee(r)&&ti(r).position==="static";)r=M4(r);return r&&(So(r)==="html"||So(r)==="body"&&ti(r).position==="static")?t:r||vee(e)||t}function zb(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function gu(e,t,r){return Ks(e,sh(t,r))}function yee(e,t,r){var n=gu(e,t,r);return n>r?r:n}function LT(){return{top:0,right:0,bottom:0,left:0}}function IT(e){return Object.assign({},LT(),e)}function DT(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var bee=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,IT(typeof t!="number"?t:DT(t,Pd))};function kee(e){var t,r=e.state,n=e.name,o=e.options,i=r.elements.arrow,s=r.modifiersData.popperOffsets,a=bo(r.placement),l=zb(a),c=[$r,An].indexOf(a)>=0,u=c?"height":"width";if(!(!i||!s)){var d=bee(o.padding,r),f=Nb(i),p=l==="y"?Dr:$r,h=l==="y"?_n:An,m=r.rects.reference[u]+r.rects.reference[l]-s[l]-r.rects.popper[u],b=s[l]-r.rects.reference[l],v=Nd(i),g=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,y=m/2-b/2,k=d[p],x=g-f[u]-d[h],w=g/2-f[u]/2+y,E=gu(k,w,x),M=l;r.modifiersData[n]=(t={},t[M]=E,t.centerOffset=E-w,t)}}function xee(e){var t=e.state,r=e.options,n=r.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||zT(t.elements.popper,o)&&(t.elements.arrow=o))}const wee={name:"arrow",enabled:!0,phase:"main",fn:kee,effect:xee,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Vl(e){return e.split("-")[1]}var See={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Eee(e,t){var r=e.x,n=e.y,o=t.devicePixelRatio||1;return{x:Bl(r*o)/o||0,y:Bl(n*o)/o||0}}function T4(e){var t,r=e.popper,n=e.popperRect,o=e.placement,i=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=s.x,p=f===void 0?0:f,h=s.y,m=h===void 0?0:h,b=typeof u=="function"?u({x:p,y:m}):{x:p,y:m};p=b.x,m=b.y;var v=s.hasOwnProperty("x"),g=s.hasOwnProperty("y"),y=$r,k=Dr,x=window;if(c){var w=Nd(r),E="clientHeight",M="clientWidth";if(w===ln(r)&&(w=hs(r),ti(w).position!=="static"&&a==="absolute"&&(E="scrollHeight",M="scrollWidth")),w=w,o===Dr||(o===$r||o===An)&&i===cd){k=_n;var C=d&&w===x&&x.visualViewport?x.visualViewport.height:w[E];m-=C-n.height,m*=l?1:-1}if(o===$r||(o===Dr||o===_n)&&i===cd){y=An;var T=d&&w===x&&x.visualViewport?x.visualViewport.width:w[M];p-=T-n.width,p*=l?1:-1}}var R=Object.assign({position:a},c&&See),B=u===!0?Eee({x:p,y:m},ln(r)):{x:p,y:m};if(p=B.x,m=B.y,l){var I;return Object.assign({},R,(I={},I[k]=g?"0":"",I[y]=v?"0":"",I.transform=(x.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",I))}return Object.assign({},R,(t={},t[k]=g?m+"px":"",t[y]=v?p+"px":"",t.transform="",t))}function Cee(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=n===void 0?!0:n,i=r.adaptive,s=i===void 0?!0:i,a=r.roundOffsets,l=a===void 0?!0:a,c={placement:bo(t.placement),variation:Vl(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,T4(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,T4(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Mee={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Cee,data:{}};var uf={passive:!0};function Tee(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,i=o===void 0?!0:o,s=n.resize,a=s===void 0?!0:s,l=ln(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",r.update,uf)}),a&&l.addEventListener("resize",r.update,uf),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",r.update,uf)}),a&&l.removeEventListener("resize",r.update,uf)}}const Oee={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Tee,data:{}};var _ee={left:"right",right:"left",bottom:"top",top:"bottom"};function Gf(e){return e.replace(/left|right|bottom|top/g,function(t){return _ee[t]})}var Aee={start:"end",end:"start"};function O4(e){return e.replace(/start|end/g,function(t){return Aee[t]})}function Lb(e){var t=ln(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function Ib(e){return Fl(hs(e)).left+Lb(e).scrollLeft}function Ree(e,t){var r=ln(e),n=hs(e),o=r.visualViewport,i=n.clientWidth,s=n.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;var c=NT();(c||!c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a+Ib(e),y:l}}function Pee(e){var t,r=hs(e),n=Lb(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=Ks(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=Ks(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-n.scrollLeft+Ib(e),l=-n.scrollTop;return ti(o||r).direction==="rtl"&&(a+=Ks(r.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function Db(e){var t=ti(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function $T(e){return["html","body","#document"].indexOf(So(e))>=0?e.ownerDocument.body:En(e)&&Db(e)?e:$T(_m(e))}function vu(e,t){var r;t===void 0&&(t=[]);var n=$T(e),o=n===((r=e.ownerDocument)==null?void 0:r.body),i=ln(n),s=o?[i].concat(i.visualViewport||[],Db(n)?n:[]):n,a=t.concat(s);return o?a:a.concat(vu(_m(s)))}function H0(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Nee(e,t){var r=Fl(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function _4(e,t,r){return t===RT?H0(Ree(e,r)):ua(t)?Nee(t,r):H0(Pee(hs(e)))}function zee(e){var t=vu(_m(e)),r=["absolute","fixed"].indexOf(ti(e).position)>=0,n=r&&En(e)?Nd(e):e;return ua(n)?t.filter(function(o){return ua(o)&&zT(o,n)&&So(o)!=="body"}):[]}function Lee(e,t,r,n){var o=t==="clippingParents"?zee(e):[].concat(t),i=[].concat(o,[r]),s=i[0],a=i.reduce(function(l,c){var u=_4(e,c,n);return l.top=Ks(u.top,l.top),l.right=sh(u.right,l.right),l.bottom=sh(u.bottom,l.bottom),l.left=Ks(u.left,l.left),l},_4(e,s,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function HT(e){var t=e.reference,r=e.element,n=e.placement,o=n?bo(n):null,i=n?Vl(n):null,s=t.x+t.width/2-r.width/2,a=t.y+t.height/2-r.height/2,l;switch(o){case Dr:l={x:s,y:t.y-r.height};break;case _n:l={x:s,y:t.y+t.height};break;case An:l={x:t.x+t.width,y:a};break;case $r:l={x:t.x-r.width,y:a};break;default:l={x:t.x,y:t.y}}var c=o?zb(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case Hl:l[c]=l[c]-(t[u]/2-r[u]/2);break;case cd:l[c]=l[c]+(t[u]/2-r[u]/2);break}}return l}function ud(e,t){t===void 0&&(t={});var r=t,n=r.placement,o=n===void 0?e.placement:n,i=r.strategy,s=i===void 0?e.strategy:i,a=r.boundary,l=a===void 0?tee:a,c=r.rootBoundary,u=c===void 0?RT:c,d=r.elementContext,f=d===void 0?gc:d,p=r.altBoundary,h=p===void 0?!1:p,m=r.padding,b=m===void 0?0:m,v=IT(typeof b!="number"?b:DT(b,Pd)),g=f===gc?ree:gc,y=e.rects.popper,k=e.elements[h?g:f],x=Lee(ua(k)?k:k.contextElement||hs(e.elements.popper),l,u,s),w=Fl(e.elements.reference),E=HT({reference:w,element:y,strategy:"absolute",placement:o}),M=H0(Object.assign({},y,E)),C=f===gc?M:w,T={top:x.top-C.top+v.top,bottom:C.bottom-x.bottom+v.bottom,left:x.left-C.left+v.left,right:C.right-x.right+v.right},R=e.modifiersData.offset;if(f===gc&&R){var B=R[o];Object.keys(T).forEach(function(I){var F=[An,_n].indexOf(I)>=0?1:-1,V=[Dr,_n].indexOf(I)>=0?"y":"x";T[I]+=B[V]*F})}return T}function Iee(e,t){t===void 0&&(t={});var r=t,n=r.placement,o=r.boundary,i=r.rootBoundary,s=r.padding,a=r.flipVariations,l=r.allowedAutoPlacements,c=l===void 0?PT:l,u=Vl(n),d=u?a?C4:C4.filter(function(h){return Vl(h)===u}):Pd,f=d.filter(function(h){return c.indexOf(h)>=0});f.length===0&&(f=d);var p=f.reduce(function(h,m){return h[m]=ud(e,{placement:m,boundary:o,rootBoundary:i,padding:s})[bo(m)],h},{});return Object.keys(p).sort(function(h,m){return p[h]-p[m]})}function Dee(e){if(bo(e)===Rb)return[];var t=Gf(e);return[O4(e),t,O4(t)]}function $ee(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=r.mainAxis,i=o===void 0?!0:o,s=r.altAxis,a=s===void 0?!0:s,l=r.fallbackPlacements,c=r.padding,u=r.boundary,d=r.rootBoundary,f=r.altBoundary,p=r.flipVariations,h=p===void 0?!0:p,m=r.allowedAutoPlacements,b=t.options.placement,v=bo(b),g=v===b,y=l||(g||!h?[Gf(b)]:Dee(b)),k=[b].concat(y).reduce(function(oe,ue){return oe.concat(bo(ue)===Rb?Iee(t,{placement:ue,boundary:u,rootBoundary:d,padding:c,flipVariations:h,allowedAutoPlacements:m}):ue)},[]),x=t.rects.reference,w=t.rects.popper,E=new Map,M=!0,C=k[0],T=0;T=0,V=F?"width":"height",z=ud(t,{placement:R,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),K=F?I?An:$r:I?_n:Dr;x[V]>w[V]&&(K=Gf(K));var _=Gf(K),N=[];if(i&&N.push(z[B]<=0),a&&N.push(z[K]<=0,z[_]<=0),N.every(function(oe){return oe})){C=R,M=!1;break}E.set(R,N)}if(M)for(var H=h?3:1,G=function(ue){var de=k.find(function(he){var Me=E.get(he);if(Me)return Me.slice(0,ue).every(function(Se){return Se})});if(de)return C=de,"break"},J=H;J>0;J--){var _e=G(J);if(_e==="break")break}t.placement!==C&&(t.modifiersData[n]._skip=!0,t.placement=C,t.reset=!0)}}const Hee={name:"flip",enabled:!0,phase:"main",fn:$ee,requiresIfExists:["offset"],data:{_skip:!1}};function A4(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function R4(e){return[Dr,An,_n,$r].some(function(t){return e[t]>=0})}function Bee(e){var t=e.state,r=e.name,n=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=ud(t,{elementContext:"reference"}),a=ud(t,{altBoundary:!0}),l=A4(s,n),c=A4(a,o,i),u=R4(l),d=R4(c);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const Fee={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Bee};function Vee(e,t,r){var n=bo(e),o=[$r,Dr].indexOf(n)>=0?-1:1,i=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[$r,An].indexOf(n)>=0?{x:a,y:s}:{x:s,y:a}}function jee(e){var t=e.state,r=e.options,n=e.name,o=r.offset,i=o===void 0?[0,0]:o,s=PT.reduce(function(u,d){return u[d]=Vee(d,t.rects,i),u},{}),a=s[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=s}const Uee={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:jee};function Wee(e){var t=e.state,r=e.name;t.modifiersData[r]=HT({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Kee={name:"popperOffsets",enabled:!0,phase:"read",fn:Wee,data:{}};function qee(e){return e==="x"?"y":"x"}function Gee(e){var t=e.state,r=e.options,n=e.name,o=r.mainAxis,i=o===void 0?!0:o,s=r.altAxis,a=s===void 0?!1:s,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,d=r.padding,f=r.tether,p=f===void 0?!0:f,h=r.tetherOffset,m=h===void 0?0:h,b=ud(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),v=bo(t.placement),g=Vl(t.placement),y=!g,k=zb(v),x=qee(k),w=t.modifiersData.popperOffsets,E=t.rects.reference,M=t.rects.popper,C=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,T=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),R=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,B={x:0,y:0};if(w){if(i){var I,F=k==="y"?Dr:$r,V=k==="y"?_n:An,z=k==="y"?"height":"width",K=w[k],_=K+b[F],N=K-b[V],H=p?-M[z]/2:0,G=g===Hl?E[z]:M[z],J=g===Hl?-M[z]:-E[z],_e=t.elements.arrow,oe=p&&_e?Nb(_e):{width:0,height:0},ue=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:LT(),de=ue[F],he=ue[V],Me=gu(0,E[z],oe[z]),Se=y?E[z]/2-H-Me-de-T.mainAxis:G-Me-de-T.mainAxis,ct=y?-E[z]/2+H+Me+he+T.mainAxis:J+Me+he+T.mainAxis,et=t.elements.arrow&&Nd(t.elements.arrow),Er=et?k==="y"?et.clientTop||0:et.clientLeft||0:0,pe=(I=R==null?void 0:R[k])!=null?I:0,Ie=K+Se-pe-Er,Ue=K+ct-pe,Ln=gu(p?sh(_,Ie):_,K,p?Ks(N,Ue):N);w[k]=Ln,B[k]=Ln-K}if(a){var jr,Zt=k==="x"?Dr:$r,To=k==="x"?_n:An,Nt=w[x],Ur=x==="y"?"height":"width",fn=Nt+b[Zt],In=Nt-b[To],Je=[Dr,$r].indexOf(v)!==-1,Wr=(jr=R==null?void 0:R[x])!=null?jr:0,pn=Je?fn:Nt-E[Ur]-M[Ur]-Wr+T.altAxis,ai=Je?Nt+E[Ur]+M[Ur]-Wr-T.altAxis:In,ba=p&&Je?yee(pn,Nt,ai):gu(p?pn:fn,Nt,p?ai:In);w[x]=ba,B[x]=ba-Nt}t.modifiersData[n]=B}}const Yee={name:"preventOverflow",enabled:!0,phase:"main",fn:Gee,requiresIfExists:["offset"]};function Jee(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Xee(e){return e===ln(e)||!En(e)?Lb(e):Jee(e)}function Qee(e){var t=e.getBoundingClientRect(),r=Bl(t.width)/e.offsetWidth||1,n=Bl(t.height)/e.offsetHeight||1;return r!==1||n!==1}function Zee(e,t,r){r===void 0&&(r=!1);var n=En(t),o=En(t)&&Qee(t),i=hs(t),s=Fl(e,o,r),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!r)&&((So(t)!=="body"||Db(i))&&(a=Xee(t)),En(t)?(l=Fl(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=Ib(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function ete(e){var t=new Map,r=new Set,n=[];e.forEach(function(i){t.set(i.name,i)});function o(i){r.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!r.has(a)){var l=t.get(a);l&&o(l)}}),n.push(i)}return e.forEach(function(i){r.has(i.name)||o(i)}),n}function tte(e){var t=ete(e);return fee.reduce(function(r,n){return r.concat(t.filter(function(o){return o.phase===n}))},[])}function rte(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function nte(e){var t=e.reduce(function(r,n){var o=r[n.name];return r[n.name]=o?Object.assign({},o,n,{options:Object.assign({},o.options,n.options),data:Object.assign({},o.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var P4={placement:"bottom",modifiers:[],strategy:"absolute"};function N4(){for(var e=arguments.length,t=new Array(e),r=0;r{i||a(ate(o)||document.body)},[o,i]),aa(()=>{if(s&&!i)return R0(r,s),()=>{R0(r,null)}},[r,s,i]),i){if(S.isValidElement(n)){const c={ref:l};return S.cloneElement(n,c)}return A.jsx(S.Fragment,{children:n})}return A.jsx(S.Fragment,{children:s&&Uh.createPortal(n,s)})});function lte(e){return Ft("MuiPopper",e)}Vt("MuiPopper",["root"]);const cte=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],ute=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function dte(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function B0(e){return typeof e=="function"?e():e}function fte(e){return e.nodeType!==void 0}const pte=()=>Qt({root:["root"]},jZ(lte)),hte={},mte=S.forwardRef(function(t,r){var n;const{anchorEl:o,children:i,direction:s,disablePortal:a,modifiers:l,open:c,placement:u,popperOptions:d,popperRef:f,slotProps:p={},slots:h={},TransitionProps:m}=t,b=ge(t,cte),v=S.useRef(null),g=Hr(v,r),y=S.useRef(null),k=Hr(y,f),x=S.useRef(k);aa(()=>{x.current=k},[k]),S.useImperativeHandle(f,()=>y.current,[]);const w=dte(u,s),[E,M]=S.useState(w),[C,T]=S.useState(B0(o));S.useEffect(()=>{y.current&&y.current.forceUpdate()}),S.useEffect(()=>{o&&T(B0(o))},[o]),aa(()=>{if(!C||!c)return;const V=_=>{M(_.placement)};let z=[{name:"preventOverflow",options:{altBoundary:a}},{name:"flip",options:{altBoundary:a}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:_})=>{V(_)}}];l!=null&&(z=z.concat(l)),d&&d.modifiers!=null&&(z=z.concat(d.modifiers));const K=ste(C,v.current,O({placement:w},d,{modifiers:z}));return x.current(K),()=>{K.destroy(),x.current(null)}},[C,a,l,c,d,w]);const R={placement:E};m!==null&&(R.TransitionProps=m);const B=pte(),I=(n=h.root)!=null?n:"div",F=ei({elementType:I,externalSlotProps:p.root,externalForwardedProps:b,additionalProps:{role:"tooltip",ref:g},ownerState:t,className:B.root});return A.jsx(I,O({},F,{children:typeof i=="function"?i(R):i}))}),gte=S.forwardRef(function(t,r){const{anchorEl:n,children:o,container:i,direction:s="ltr",disablePortal:a=!1,keepMounted:l=!1,modifiers:c,open:u,placement:d="bottom",popperOptions:f=hte,popperRef:p,style:h,transition:m=!1,slotProps:b={},slots:v={}}=t,g=ge(t,ute),[y,k]=S.useState(!0),x=()=>{k(!1)},w=()=>{k(!0)};if(!l&&!u&&(!m||y))return null;let E;if(i)E=i;else if(n){const T=B0(n);E=T&&fte(T)?Ir(T).body:Ir(null).body}const M=!u&&l&&(!m||y)?"none":void 0,C=m?{in:u,onEnter:x,onExited:w}:void 0;return A.jsx(BT,{disablePortal:a,container:E,children:A.jsx(mte,O({anchorEl:n,direction:s,disablePortal:a,modifiers:c,ref:r,open:m?!y:u,placement:d,popperOptions:f,popperRef:p,slotProps:b,slots:v},g,{style:O({position:"fixed",top:0,left:0,display:M},h),TransitionProps:C,children:o}))})});function vte(e){const t=Ir(e);return t.body===e?id(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function yu(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function z4(e){return parseInt(id(e).getComputedStyle(e).paddingRight,10)||0}function yte(e){const r=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName)!==-1,n=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return r||n}function L4(e,t,r,n,o){const i=[t,r,...n];[].forEach.call(e.children,s=>{const a=i.indexOf(s)===-1,l=!yte(s);a&&l&&yu(s,o)})}function Fg(e,t){let r=-1;return e.some((n,o)=>t(n)?(r=o,!0):!1),r}function bte(e,t){const r=[],n=e.container;if(!t.disableScrollLock){if(vte(n)){const s=Y3(Ir(n));r.push({value:n.style.paddingRight,property:"padding-right",el:n}),n.style.paddingRight=`${z4(n)+s}px`;const a=Ir(n).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{r.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${z4(l)+s}px`})}let i;if(n.parentNode instanceof DocumentFragment)i=Ir(n).body;else{const s=n.parentElement,a=id(n);i=(s==null?void 0:s.nodeName)==="HTML"&&a.getComputedStyle(s).overflowY==="scroll"?s:n}r.push({value:i.style.overflow,property:"overflow",el:i},{value:i.style.overflowX,property:"overflow-x",el:i},{value:i.style.overflowY,property:"overflow-y",el:i}),i.style.overflow="hidden"}return()=>{r.forEach(({value:i,el:s,property:a})=>{i?s.style.setProperty(a,i):s.style.removeProperty(a)})}}function kte(e){const t=[];return[].forEach.call(e.children,r=>{r.getAttribute("aria-hidden")==="true"&&t.push(r)}),t}class xte{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(t,r){let n=this.modals.indexOf(t);if(n!==-1)return n;n=this.modals.length,this.modals.push(t),t.modalRef&&yu(t.modalRef,!1);const o=kte(r);L4(r,t.mount,t.modalRef,o,!0);const i=Fg(this.containers,s=>s.container===r);return i!==-1?(this.containers[i].modals.push(t),n):(this.containers.push({modals:[t],container:r,restore:null,hiddenSiblings:o}),n)}mount(t,r){const n=Fg(this.containers,i=>i.modals.indexOf(t)!==-1),o=this.containers[n];o.restore||(o.restore=bte(o,r))}remove(t,r=!0){const n=this.modals.indexOf(t);if(n===-1)return n;const o=Fg(this.containers,s=>s.modals.indexOf(t)!==-1),i=this.containers[o];if(i.modals.splice(i.modals.indexOf(t),1),this.modals.splice(n,1),i.modals.length===0)i.restore&&i.restore(),t.modalRef&&yu(t.modalRef,r),L4(i.container,t.mount,t.modalRef,i.hiddenSiblings,!1),this.containers.splice(o,1);else{const s=i.modals[i.modals.length-1];s.modalRef&&yu(s.modalRef,!1)}return n}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function wte(e){return typeof e=="function"?e():e}function Ste(e){return e?e.props.hasOwnProperty("in"):!1}const Ete=new xte;function Cte(e){const{container:t,disableEscapeKeyDown:r=!1,disableScrollLock:n=!1,manager:o=Ete,closeAfterTransition:i=!1,onTransitionEnter:s,onTransitionExited:a,children:l,onClose:c,open:u,rootRef:d}=e,f=S.useRef({}),p=S.useRef(null),h=S.useRef(null),m=Hr(h,d),[b,v]=S.useState(!u),g=Ste(l);let y=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(y=!1);const k=()=>Ir(p.current),x=()=>(f.current.modalRef=h.current,f.current.mount=p.current,f.current),w=()=>{o.mount(x(),{disableScrollLock:n}),h.current&&(h.current.scrollTop=0)},E=$s(()=>{const z=wte(t)||k().body;o.add(x(),z),h.current&&w()}),M=S.useCallback(()=>o.isTopModal(x()),[o]),C=$s(z=>{p.current=z,z&&(u&&M()?w():h.current&&yu(h.current,y))}),T=S.useCallback(()=>{o.remove(x(),y)},[y,o]);S.useEffect(()=>()=>{T()},[T]),S.useEffect(()=>{u?E():(!g||!i)&&T()},[u,T,g,i,E]);const R=z=>K=>{var _;(_=z.onKeyDown)==null||_.call(z,K),!(K.key!=="Escape"||!M())&&(r||(K.stopPropagation(),c&&c(K,"escapeKeyDown")))},B=z=>K=>{var _;(_=z.onClick)==null||_.call(z,K),K.target===K.currentTarget&&c&&c(K,"backdropClick")};return{getRootProps:(z={})=>{const K=AT(e);delete K.onTransitionEnter,delete K.onTransitionExited;const _=O({},K,z);return O({role:"presentation"},_,{onKeyDown:R(_),ref:m})},getBackdropProps:(z={})=>{const K=z;return O({"aria-hidden":!0},K,{onClick:B(K),open:u})},getTransitionProps:()=>{const z=()=>{v(!1),s&&s()},K=()=>{v(!0),a&&a(),i&&T()};return{onEnter:Kw(z,l==null?void 0:l.props.onEnter),onExited:Kw(K,l==null?void 0:l.props.onExited)}},rootRef:m,portalRef:C,isTopModal:M,exited:b,hasTransition:g}}const Mte=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],Tte=Ye(gte,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Ote=S.forwardRef(function(t,r){var n;const o=xb(),i=Ut({props:t,name:"MuiPopper"}),{anchorEl:s,component:a,components:l,componentsProps:c,container:u,disablePortal:d,keepMounted:f,modifiers:p,open:h,placement:m,popperOptions:b,popperRef:v,transition:g,slots:y,slotProps:k}=i,x=ge(i,Mte),w=(n=y==null?void 0:y.root)!=null?n:l==null?void 0:l.Root,E=O({anchorEl:s,container:u,disablePortal:d,keepMounted:f,modifiers:p,open:h,placement:m,popperOptions:b,popperRef:v,transition:g},x);return A.jsx(Tte,O({as:a,direction:o==null?void 0:o.direction,slots:{root:w},slotProps:k??c},E,{ref:r}))}),$b=Ote,_te=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],Ate={entering:{opacity:1},entered:{opacity:1}},Rte=S.forwardRef(function(t,r){const n=Tm(),o={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:s=!0,children:a,easing:l,in:c,onEnter:u,onEntered:d,onEntering:f,onExit:p,onExited:h,onExiting:m,style:b,timeout:v=o,TransitionComponent:g=TT}=t,y=ge(t,_te),k=S.useRef(null),x=Hr(k,a.ref,r),w=F=>V=>{if(F){const z=k.current;V===void 0?F(z):F(z,V)}},E=w(f),M=w((F,V)=>{OT(F);const z=ih({style:b,timeout:v,easing:l},{mode:"enter"});F.style.webkitTransition=n.transitions.create("opacity",z),F.style.transition=n.transitions.create("opacity",z),u&&u(F,V)}),C=w(d),T=w(m),R=w(F=>{const V=ih({style:b,timeout:v,easing:l},{mode:"exit"});F.style.webkitTransition=n.transitions.create("opacity",V),F.style.transition=n.transitions.create("opacity",V),p&&p(F)}),B=w(h),I=F=>{i&&i(k.current,F)};return A.jsx(g,O({appear:s,in:c,nodeRef:k,onEnter:M,onEntered:C,onEntering:E,onExit:R,onExited:B,onExiting:T,addEndListener:I,timeout:v},y,{children:(F,V)=>S.cloneElement(a,O({style:O({opacity:0,visibility:F==="exited"&&!c?"hidden":void 0},Ate[F],b,a.props.style),ref:x},V))}))}),Pte=Rte;function Nte(e){return Ft("MuiBackdrop",e)}Vt("MuiBackdrop",["root","invisible"]);const zte=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],Lte=e=>{const{classes:t,invisible:r}=e;return Qt({root:["root",r&&"invisible"]},Nte,t)},Ite=Ye("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.invisible&&t.invisible]}})(({ownerState:e})=>O({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},e.invisible&&{backgroundColor:"transparent"})),Dte=S.forwardRef(function(t,r){var n,o,i;const s=Ut({props:t,name:"MuiBackdrop"}),{children:a,className:l,component:c="div",components:u={},componentsProps:d={},invisible:f=!1,open:p,slotProps:h={},slots:m={},TransitionComponent:b=Pte,transitionDuration:v}=s,g=ge(s,zte),y=O({},s,{component:c,invisible:f}),k=Lte(y),x=(n=h.root)!=null?n:d.root;return A.jsx(b,O({in:p,timeout:v},g,{children:A.jsx(Ite,O({"aria-hidden":!0},x,{as:(o=(i=m.root)!=null?i:u.Root)!=null?o:c,className:Ce(k.root,l,x==null?void 0:x.className),ownerState:O({},y,x==null?void 0:x.ownerState),classes:k,ref:r,children:a}))}))}),$te=Dte;function Hte(e){return Ft("MuiBadge",e)}const Bte=Vt("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),fi=Bte,Fte=["anchorOrigin","className","classes","component","components","componentsProps","children","overlap","color","invisible","max","badgeContent","slots","slotProps","showZero","variant"],Vg=10,jg=4,Vte=e=>{const{color:t,anchorOrigin:r,invisible:n,overlap:o,variant:i,classes:s={}}=e,a={root:["root"],badge:["badge",i,n&&"invisible",`anchorOrigin${Be(r.vertical)}${Be(r.horizontal)}`,`anchorOrigin${Be(r.vertical)}${Be(r.horizontal)}${Be(o)}`,`overlap${Be(o)}`,t!=="default"&&`color${Be(t)}`]};return Qt(a,Hte,s)},jte=Ye("span",{name:"MuiBadge",slot:"Root",overridesResolver:(e,t)=>t.root})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),Ute=Ye("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.badge,t[r.variant],t[`anchorOrigin${Be(r.anchorOrigin.vertical)}${Be(r.anchorOrigin.horizontal)}${Be(r.overlap)}`],r.color!=="default"&&t[`color${Be(r.color)}`],r.invisible&&t.invisible]}})(({theme:e,ownerState:t})=>O({display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(12),minWidth:Vg*2,lineHeight:1,padding:"0 6px",height:Vg*2,borderRadius:Vg,zIndex:1,transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.enteringScreen})},t.color!=="default"&&{backgroundColor:(e.vars||e).palette[t.color].main,color:(e.vars||e).palette[t.color].contrastText},t.variant==="dot"&&{borderRadius:jg,height:jg*2,minWidth:jg*2,padding:0},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular"&&{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${fi.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular"&&{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${fi.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular"&&{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${fi.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular"&&{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${fi.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular"&&{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${fi.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular"&&{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${fi.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular"&&{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${fi.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular"&&{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${fi.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}},t.invisible&&{transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.leavingScreen})})),Wte=S.forwardRef(function(t,r){var n,o,i,s,a,l;const c=Ut({props:t,name:"MuiBadge"}),{anchorOrigin:u={vertical:"top",horizontal:"right"},className:d,component:f,components:p={},componentsProps:h={},children:m,overlap:b="rectangular",color:v="default",invisible:g=!1,max:y=99,badgeContent:k,slots:x,slotProps:w,showZero:E=!1,variant:M="standard"}=c,C=ge(c,Fte),{badgeContent:T,invisible:R,max:B,displayValue:I}=qZ({max:y,invisible:g,badgeContent:k,showZero:E}),F=J3({anchorOrigin:u,color:v,overlap:b,variant:M,badgeContent:k}),V=R||T==null&&M!=="dot",{color:z=v,overlap:K=b,anchorOrigin:_=u,variant:N=M}=V?F:c,H=N!=="dot"?I:void 0,G=O({},c,{badgeContent:T,invisible:V,max:B,displayValue:H,showZero:E,anchorOrigin:_,color:z,overlap:K,variant:N}),J=Vte(G),_e=(n=(o=x==null?void 0:x.root)!=null?o:p.Root)!=null?n:jte,oe=(i=(s=x==null?void 0:x.badge)!=null?s:p.Badge)!=null?i:Ute,ue=(a=w==null?void 0:w.root)!=null?a:h.root,de=(l=w==null?void 0:w.badge)!=null?l:h.badge,he=ei({elementType:_e,externalSlotProps:ue,externalForwardedProps:C,additionalProps:{ref:r,as:f},ownerState:G,className:Ce(ue==null?void 0:ue.className,J.root,d)}),Me=ei({elementType:oe,externalSlotProps:de,ownerState:G,className:Ce(J.badge,de==null?void 0:de.className)});return A.jsxs(_e,O({},he,{children:[m,A.jsx(oe,O({},Me,{children:H}))]}))}),Kte=Wte,qte=Cb(),Gte=HX({themeId:Dl,defaultTheme:qte,defaultClassName:"MuiBox-root",generateClassName:Q3.generate}),FT=Gte;function Yte(e){return Ft("MuiModal",e)}Vt("MuiModal",["root","hidden","backdrop"]);const Jte=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],Xte=e=>{const{open:t,exited:r,classes:n}=e;return Qt({root:["root",!t&&r&&"hidden"],backdrop:["backdrop"]},Yte,n)},Qte=Ye("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.open&&r.exited&&t.hidden]}})(({theme:e,ownerState:t})=>O({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),Zte=Ye($te,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),ere=S.forwardRef(function(t,r){var n,o,i,s,a,l;const c=Ut({name:"MuiModal",props:t}),{BackdropComponent:u=Zte,BackdropProps:d,className:f,closeAfterTransition:p=!1,children:h,container:m,component:b,components:v={},componentsProps:g={},disableAutoFocus:y=!1,disableEnforceFocus:k=!1,disableEscapeKeyDown:x=!1,disablePortal:w=!1,disableRestoreFocus:E=!1,disableScrollLock:M=!1,hideBackdrop:C=!1,keepMounted:T=!1,onBackdropClick:R,open:B,slotProps:I,slots:F}=c,V=ge(c,Jte),z=O({},c,{closeAfterTransition:p,disableAutoFocus:y,disableEnforceFocus:k,disableEscapeKeyDown:x,disablePortal:w,disableRestoreFocus:E,disableScrollLock:M,hideBackdrop:C,keepMounted:T}),{getRootProps:K,getBackdropProps:_,getTransitionProps:N,portalRef:H,isTopModal:G,exited:J,hasTransition:_e}=Cte(O({},z,{rootRef:r})),oe=O({},z,{exited:J}),ue=Xte(oe),de={};if(h.props.tabIndex===void 0&&(de.tabIndex="-1"),_e){const{onEnter:pe,onExited:Ie}=N();de.onEnter=pe,de.onExited=Ie}const he=(n=(o=F==null?void 0:F.root)!=null?o:v.Root)!=null?n:Qte,Me=(i=(s=F==null?void 0:F.backdrop)!=null?s:v.Backdrop)!=null?i:u,Se=(a=I==null?void 0:I.root)!=null?a:g.root,ct=(l=I==null?void 0:I.backdrop)!=null?l:g.backdrop,et=ei({elementType:he,externalSlotProps:Se,externalForwardedProps:V,getSlotProps:K,additionalProps:{ref:r,as:b},ownerState:oe,className:Ce(f,Se==null?void 0:Se.className,ue==null?void 0:ue.root,!oe.open&&oe.exited&&(ue==null?void 0:ue.hidden))}),Er=ei({elementType:Me,externalSlotProps:ct,additionalProps:d,getSlotProps:pe=>_(O({},pe,{onClick:Ie=>{R&&R(Ie),pe!=null&&pe.onClick&&pe.onClick(Ie)}})),className:Ce(ct==null?void 0:ct.className,d==null?void 0:d.className,ue==null?void 0:ue.backdrop),ownerState:oe});return!T&&!B&&(!_e||J)?null:A.jsx(BT,{ref:H,container:m,disablePortal:w,children:A.jsxs(he,O({},et,{children:[!C&&u?A.jsx(Me,O({},Er)):null,A.jsx(eee,{disableEnforceFocus:k,disableAutoFocus:y,disableRestoreFocus:E,isEnabled:G,open:B,children:S.cloneElement(h,de)})]}))})}),tre=ere,rre=Vt("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),I4=rre,nre=vQ({createStyledComponent:Ye("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>Ut({props:e,name:"MuiStack"})}),ore=nre,ire=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function F0(e){return`scale(${e}, ${e**2})`}const sre={entering:{opacity:1,transform:F0(1)},entered:{opacity:1,transform:"none"}},Ug=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),VT=S.forwardRef(function(t,r){const{addEndListener:n,appear:o=!0,children:i,easing:s,in:a,onEnter:l,onEntered:c,onEntering:u,onExit:d,onExited:f,onExiting:p,style:h,timeout:m="auto",TransitionComponent:b=TT}=t,v=ge(t,ire),g=S.useRef(),y=S.useRef(),k=Tm(),x=S.useRef(null),w=Hr(x,i.ref,r),E=V=>z=>{if(V){const K=x.current;z===void 0?V(K):V(K,z)}},M=E(u),C=E((V,z)=>{OT(V);const{duration:K,delay:_,easing:N}=ih({style:h,timeout:m,easing:s},{mode:"enter"});let H;m==="auto"?(H=k.transitions.getAutoHeightDuration(V.clientHeight),y.current=H):H=K,V.style.transition=[k.transitions.create("opacity",{duration:H,delay:_}),k.transitions.create("transform",{duration:Ug?H:H*.666,delay:_,easing:N})].join(","),l&&l(V,z)}),T=E(c),R=E(p),B=E(V=>{const{duration:z,delay:K,easing:_}=ih({style:h,timeout:m,easing:s},{mode:"exit"});let N;m==="auto"?(N=k.transitions.getAutoHeightDuration(V.clientHeight),y.current=N):N=z,V.style.transition=[k.transitions.create("opacity",{duration:N,delay:K}),k.transitions.create("transform",{duration:Ug?N:N*.666,delay:Ug?K:K||N*.333,easing:_})].join(","),V.style.opacity=0,V.style.transform=F0(.75),d&&d(V)}),I=E(f),F=V=>{m==="auto"&&(g.current=setTimeout(V,y.current||0)),n&&n(x.current,V)};return S.useEffect(()=>()=>{clearTimeout(g.current)},[]),A.jsx(b,O({appear:o,in:a,nodeRef:x,onEnter:C,onEntered:T,onEntering:M,onExit:B,onExited:I,onExiting:R,addEndListener:F,timeout:m==="auto"?null:m},v,{children:(V,z)=>S.cloneElement(i,O({style:O({opacity:0,transform:F0(.75),visibility:V==="exited"&&!a?"hidden":void 0},sre[V],h,i.props.style),ref:w},z))}))});VT.muiSupportAuto=!0;const V0=VT,are=S.createContext({}),dd=are;function lre(e){return Ft("MuiList",e)}Vt("MuiList",["root","padding","dense","subheader"]);const cre=["children","className","component","dense","disablePadding","subheader"],ure=e=>{const{classes:t,disablePadding:r,dense:n,subheader:o}=e;return Qt({root:["root",!r&&"padding",n&&"dense",o&&"subheader"]},lre,t)},dre=Ye("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disablePadding&&t.padding,r.dense&&t.dense,r.subheader&&t.subheader]}})(({ownerState:e})=>O({listStyle:"none",margin:0,padding:0,position:"relative"},!e.disablePadding&&{paddingTop:8,paddingBottom:8},e.subheader&&{paddingTop:0})),fre=S.forwardRef(function(t,r){const n=Ut({props:t,name:"MuiList"}),{children:o,className:i,component:s="ul",dense:a=!1,disablePadding:l=!1,subheader:c}=n,u=ge(n,cre),d=S.useMemo(()=>({dense:a}),[a]),f=O({},n,{component:s,dense:a,disablePadding:l}),p=ure(f);return A.jsx(dd.Provider,{value:d,children:A.jsxs(dre,O({as:s,className:Ce(p.root,i),ref:r,ownerState:f},u,{children:[c,o]}))})}),pre=fre;function hre(e){return Ft("MuiListItemIcon",e)}const mre=Vt("MuiListItemIcon",["root","alignItemsFlexStart"]),D4=mre,gre=["className"],vre=e=>{const{alignItems:t,classes:r}=e;return Qt({root:["root",t==="flex-start"&&"alignItemsFlexStart"]},hre,r)},yre=Ye("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.alignItems==="flex-start"&&t.alignItemsFlexStart]}})(({theme:e,ownerState:t})=>O({minWidth:56,color:(e.vars||e).palette.action.active,flexShrink:0,display:"inline-flex"},t.alignItems==="flex-start"&&{marginTop:8})),bre=S.forwardRef(function(t,r){const n=Ut({props:t,name:"MuiListItemIcon"}),{className:o}=n,i=ge(n,gre),s=S.useContext(dd),a=O({},n,{alignItems:s.alignItems}),l=vre(a);return A.jsx(yre,O({className:Ce(l.root,o),ownerState:a,ref:r},i))}),kre=bre;function xre(e){return Ft("MuiListItemText",e)}const wre=Vt("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),ah=wre,Sre=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],Ere=e=>{const{classes:t,inset:r,primary:n,secondary:o,dense:i}=e;return Qt({root:["root",r&&"inset",i&&"dense",n&&o&&"multiline"],primary:["primary"],secondary:["secondary"]},xre,t)},Cre=Ye("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${ah.primary}`]:t.primary},{[`& .${ah.secondary}`]:t.secondary},t.root,r.inset&&t.inset,r.primary&&r.secondary&&t.multiline,r.dense&&t.dense]}})(({ownerState:e})=>O({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},e.primary&&e.secondary&&{marginTop:6,marginBottom:6},e.inset&&{paddingLeft:56})),Mre=S.forwardRef(function(t,r){const n=Ut({props:t,name:"MuiListItemText"}),{children:o,className:i,disableTypography:s=!1,inset:a=!1,primary:l,primaryTypographyProps:c,secondary:u,secondaryTypographyProps:d}=n,f=ge(n,Sre),{dense:p}=S.useContext(dd);let h=l??o,m=u;const b=O({},n,{disableTypography:s,inset:a,primary:!!h,secondary:!!m,dense:p}),v=Ere(b);return h!=null&&h.type!==Zc&&!s&&(h=A.jsx(Zc,O({variant:p?"body2":"body1",className:v.primary,component:c!=null&&c.variant?void 0:"span",display:"block"},c,{children:h}))),m!=null&&m.type!==Zc&&!s&&(m=A.jsx(Zc,O({variant:"body2",className:v.secondary,color:"text.secondary",display:"block"},d,{children:m}))),A.jsxs(Cre,O({className:Ce(v.root,i),ownerState:b,ref:r},f,{children:[h,m]}))}),Tre=Mre,Ore=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function Wg(e,t,r){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:r?null:e.firstChild}function $4(e,t,r){return e===t?r?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:r?null:e.lastChild}function jT(e,t){if(t===void 0)return!0;let r=e.innerText;return r===void 0&&(r=e.textContent),r=r.trim().toLowerCase(),r.length===0?!1:t.repeating?r[0]===t.keys[0]:r.indexOf(t.keys.join(""))===0}function vc(e,t,r,n,o,i){let s=!1,a=o(e,t,t?r:!1);for(;a;){if(a===e.firstChild){if(s)return!1;s=!0}const l=n?!1:a.disabled||a.getAttribute("aria-disabled")==="true";if(!a.hasAttribute("tabindex")||!jT(a,i)||l)a=o(e,a,r);else return a.focus(),!0}return!1}const _re=S.forwardRef(function(t,r){const{actions:n,autoFocus:o=!1,autoFocusItem:i=!1,children:s,className:a,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:d="selectedMenu"}=t,f=ge(t,Ore),p=S.useRef(null),h=S.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});aa(()=>{o&&p.current.focus()},[o]),S.useImperativeHandle(n,()=>({adjustStyleForScrollbar:(y,k)=>{const x=!p.current.style.width;if(y.clientHeight{const k=p.current,x=y.key,w=Ir(k).activeElement;if(x==="ArrowDown")y.preventDefault(),vc(k,w,c,l,Wg);else if(x==="ArrowUp")y.preventDefault(),vc(k,w,c,l,$4);else if(x==="Home")y.preventDefault(),vc(k,null,c,l,Wg);else if(x==="End")y.preventDefault(),vc(k,null,c,l,$4);else if(x.length===1){const E=h.current,M=x.toLowerCase(),C=performance.now();E.keys.length>0&&(C-E.lastTime>500?(E.keys=[],E.repeating=!0,E.previousKeyMatched=!0):E.repeating&&M!==E.keys[0]&&(E.repeating=!1)),E.lastTime=C,E.keys.push(M);const T=w&&!E.repeating&&jT(w,E);E.previousKeyMatched&&(T||vc(k,w,!1,l,Wg,E))?y.preventDefault():E.previousKeyMatched=!1}u&&u(y)},b=Hr(p,r);let v=-1;S.Children.forEach(s,(y,k)=>{if(!S.isValidElement(y)){v===k&&(v+=1,v>=s.length&&(v=-1));return}y.props.disabled||(d==="selectedMenu"&&y.props.selected||v===-1)&&(v=k),v===k&&(y.props.disabled||y.props.muiSkipListHighlight||y.type.muiSkipListHighlight)&&(v+=1,v>=s.length&&(v=-1))});const g=S.Children.map(s,(y,k)=>{if(k===v){const x={};return i&&(x.autoFocus=!0),y.props.tabIndex===void 0&&d==="selectedMenu"&&(x.tabIndex=0),S.cloneElement(y,x)}return y});return A.jsx(pre,O({role:"menu",ref:b,className:a,onKeyDown:m,tabIndex:o?0:-1},f,{children:g}))}),Are=_re;function Rre(e){return Ft("MuiPopover",e)}Vt("MuiPopover",["root","paper"]);const Pre=["onEntering"],Nre=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],zre=["slotProps"];function H4(e,t){let r=0;return typeof t=="number"?r=t:t==="center"?r=e.height/2:t==="bottom"&&(r=e.height),r}function B4(e,t){let r=0;return typeof t=="number"?r=t:t==="center"?r=e.width/2:t==="right"&&(r=e.width),r}function F4(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function Kg(e){return typeof e=="function"?e():e}const Lre=e=>{const{classes:t}=e;return Qt({root:["root"],paper:["paper"]},Rre,t)},Ire=Ye(tre,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),UT=Ye(aZ,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),Dre=S.forwardRef(function(t,r){var n,o,i;const s=Ut({props:t,name:"MuiPopover"}),{action:a,anchorEl:l,anchorOrigin:c={vertical:"top",horizontal:"left"},anchorPosition:u,anchorReference:d="anchorEl",children:f,className:p,container:h,elevation:m=8,marginThreshold:b=16,open:v,PaperProps:g={},slots:y,slotProps:k,transformOrigin:x={vertical:"top",horizontal:"left"},TransitionComponent:w=V0,transitionDuration:E="auto",TransitionProps:{onEntering:M}={},disableScrollLock:C=!1}=s,T=ge(s.TransitionProps,Pre),R=ge(s,Nre),B=(n=k==null?void 0:k.paper)!=null?n:g,I=S.useRef(),F=Hr(I,B.ref),V=O({},s,{anchorOrigin:c,anchorReference:d,elevation:m,marginThreshold:b,externalPaperSlotProps:B,transformOrigin:x,TransitionComponent:w,transitionDuration:E,TransitionProps:T}),z=Lre(V),K=S.useCallback(()=>{if(d==="anchorPosition")return u;const pe=Kg(l),Ue=(pe&&pe.nodeType===1?pe:Ir(I.current).body).getBoundingClientRect();return{top:Ue.top+H4(Ue,c.vertical),left:Ue.left+B4(Ue,c.horizontal)}},[l,c.horizontal,c.vertical,u,d]),_=S.useCallback(pe=>({vertical:H4(pe,x.vertical),horizontal:B4(pe,x.horizontal)}),[x.horizontal,x.vertical]),N=S.useCallback(pe=>{const Ie={width:pe.offsetWidth,height:pe.offsetHeight},Ue=_(Ie);if(d==="none")return{top:null,left:null,transformOrigin:F4(Ue)};const Ln=K();let jr=Ln.top-Ue.vertical,Zt=Ln.left-Ue.horizontal;const To=jr+Ie.height,Nt=Zt+Ie.width,Ur=id(Kg(l)),fn=Ur.innerHeight-b,In=Ur.innerWidth-b;if(b!==null&&jrfn){const Je=To-fn;jr-=Je,Ue.vertical+=Je}if(b!==null&&ZtIn){const Je=Nt-In;Zt-=Je,Ue.horizontal+=Je}return{top:`${Math.round(jr)}px`,left:`${Math.round(Zt)}px`,transformOrigin:F4(Ue)}},[l,d,K,_,b]),[H,G]=S.useState(v),J=S.useCallback(()=>{const pe=I.current;if(!pe)return;const Ie=N(pe);Ie.top!==null&&(pe.style.top=Ie.top),Ie.left!==null&&(pe.style.left=Ie.left),pe.style.transformOrigin=Ie.transformOrigin,G(!0)},[N]);S.useEffect(()=>(C&&window.addEventListener("scroll",J),()=>window.removeEventListener("scroll",J)),[l,C,J]);const _e=(pe,Ie)=>{M&&M(pe,Ie),J()},oe=()=>{G(!1)};S.useEffect(()=>{v&&J()}),S.useImperativeHandle(a,()=>v?{updatePosition:()=>{J()}}:null,[v,J]),S.useEffect(()=>{if(!v)return;const pe=SY(()=>{J()}),Ie=id(l);return Ie.addEventListener("resize",pe),()=>{pe.clear(),Ie.removeEventListener("resize",pe)}},[l,v,J]);let ue=E;E==="auto"&&!w.muiSupportAuto&&(ue=void 0);const de=h||(l?Ir(Kg(l)).body:void 0),he=(o=y==null?void 0:y.root)!=null?o:Ire,Me=(i=y==null?void 0:y.paper)!=null?i:UT,Se=ei({elementType:Me,externalSlotProps:O({},B,{style:H?B.style:O({},B.style,{opacity:0})}),additionalProps:{elevation:m,ref:F},ownerState:V,className:Ce(z.paper,B==null?void 0:B.className)}),ct=ei({elementType:he,externalSlotProps:(k==null?void 0:k.root)||{},externalForwardedProps:R,additionalProps:{ref:r,slotProps:{backdrop:{invisible:!0}},container:de,open:v},ownerState:V,className:Ce(z.root,p)}),{slotProps:et}=ct,Er=ge(ct,zre);return A.jsx(he,O({},Er,!_T(he)&&{slotProps:et,disableScrollLock:C},{children:A.jsx(w,O({appear:!0,in:v,onEntering:_e,onExited:oe,timeout:ue},T,{children:A.jsx(Me,O({},Se,{children:f}))}))}))}),$re=Dre;function Hre(e){return Ft("MuiMenu",e)}Vt("MuiMenu",["root","paper","list"]);const Bre=["onEntering"],Fre=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],Vre={vertical:"top",horizontal:"right"},jre={vertical:"top",horizontal:"left"},Ure=e=>{const{classes:t}=e;return Qt({root:["root"],paper:["paper"],list:["list"]},Hre,t)},Wre=Ye($re,{shouldForwardProp:e=>Tb(e)||e==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Kre=Ye(UT,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),qre=Ye(Are,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),Gre=S.forwardRef(function(t,r){var n,o;const i=Ut({props:t,name:"MuiMenu"}),{autoFocus:s=!0,children:a,className:l,disableAutoFocusItem:c=!1,MenuListProps:u={},onClose:d,open:f,PaperProps:p={},PopoverClasses:h,transitionDuration:m="auto",TransitionProps:{onEntering:b}={},variant:v="selectedMenu",slots:g={},slotProps:y={}}=i,k=ge(i.TransitionProps,Bre),x=ge(i,Fre),w=Tm(),E=w.direction==="rtl",M=O({},i,{autoFocus:s,disableAutoFocusItem:c,MenuListProps:u,onEntering:b,PaperProps:p,transitionDuration:m,TransitionProps:k,variant:v}),C=Ure(M),T=s&&!c&&f,R=S.useRef(null),B=(N,H)=>{R.current&&R.current.adjustStyleForScrollbar(N,w),b&&b(N,H)},I=N=>{N.key==="Tab"&&(N.preventDefault(),d&&d(N,"tabKeyDown"))};let F=-1;S.Children.map(a,(N,H)=>{S.isValidElement(N)&&(N.props.disabled||(v==="selectedMenu"&&N.props.selected||F===-1)&&(F=H))});const V=(n=g.paper)!=null?n:Kre,z=(o=y.paper)!=null?o:p,K=ei({elementType:g.root,externalSlotProps:y.root,ownerState:M,className:[C.root,l]}),_=ei({elementType:V,externalSlotProps:z,ownerState:M,className:C.paper});return A.jsx(Wre,O({onClose:d,anchorOrigin:{vertical:"bottom",horizontal:E?"right":"left"},transformOrigin:E?Vre:jre,slots:{paper:V,root:g.root},slotProps:{root:K,paper:_},open:f,ref:r,transitionDuration:m,TransitionProps:O({onEntering:B},k),ownerState:M},x,{classes:h,children:A.jsx(qre,O({onKeyDown:I,actions:R,autoFocus:s&&(F===-1||c),autoFocusItem:T,variant:v},u,{className:Ce(C.list,u.className),children:a}))}))}),Yre=Gre;function Jre(e){return Ft("MuiMenuItem",e)}const Xre=Vt("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),yc=Xre,Qre=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],Zre=(e,t)=>{const{ownerState:r}=e;return[t.root,r.dense&&t.dense,r.divider&&t.divider,!r.disableGutters&&t.gutters]},ene=e=>{const{disabled:t,dense:r,divider:n,disableGutters:o,selected:i,classes:s}=e,l=Qt({root:["root",r&&"dense",t&&"disabled",!o&&"gutters",n&&"divider",i&&"selected"]},Jre,s);return O({},s,l)},tne=Ye(Ab,{shouldForwardProp:e=>Tb(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:Zre})(({theme:e,ownerState:t})=>O({},e.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${yc.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Rr(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${yc.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Rr(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${yc.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Rr(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Rr(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${yc.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${yc.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${I4.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${I4.inset}`]:{marginLeft:52},[`& .${ah.root}`]:{marginTop:0,marginBottom:0},[`& .${ah.inset}`]:{paddingLeft:36},[`& .${D4.root}`]:{minWidth:36}},!t.dense&&{[e.breakpoints.up("sm")]:{minHeight:"auto"}},t.dense&&O({minHeight:32,paddingTop:4,paddingBottom:4},e.typography.body2,{[`& .${D4.root} svg`]:{fontSize:"1.25rem"}}))),rne=S.forwardRef(function(t,r){const n=Ut({props:t,name:"MuiMenuItem"}),{autoFocus:o=!1,component:i="li",dense:s=!1,divider:a=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:d,className:f}=n,p=ge(n,Qre),h=S.useContext(dd),m=S.useMemo(()=>({dense:s||h.dense||!1,disableGutters:l}),[h.dense,s,l]),b=S.useRef(null);aa(()=>{o&&b.current&&b.current.focus()},[o]);const v=O({},n,{dense:m.dense,divider:a,disableGutters:l}),g=ene(n),y=Hr(b,r);let k;return n.disabled||(k=d!==void 0?d:-1),A.jsx(dd.Provider,{value:m,children:A.jsx(tne,O({ref:y,role:u,tabIndex:k,component:i,focusVisibleClassName:Ce(g.focusVisible,c),className:Ce(g.root,f)},p,{ownerState:v,classes:g}))})}),nne=rne;function one(e){return Ft("MuiTooltip",e)}const ine=Vt("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),Ri=ine,sne=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","slotProps","slots","title","TransitionComponent","TransitionProps"];function ane(e){return Math.round(e*1e5)/1e5}const lne=e=>{const{classes:t,disableInteractive:r,arrow:n,touch:o,placement:i}=e,s={popper:["popper",!r&&"popperInteractive",n&&"popperArrow"],tooltip:["tooltip",n&&"tooltipArrow",o&&"touch",`tooltipPlacement${Be(i.split("-")[0])}`],arrow:["arrow"]};return Qt(s,one,t)},cne=Ye($b,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.popper,!r.disableInteractive&&t.popperInteractive,r.arrow&&t.popperArrow,!r.open&&t.popperClose]}})(({theme:e,ownerState:t,open:r})=>O({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none"},!t.disableInteractive&&{pointerEvents:"auto"},!r&&{pointerEvents:"none"},t.arrow&&{[`&[data-popper-placement*="bottom"] .${Ri.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Ri.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Ri.arrow}`]:O({},t.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}}),[`&[data-popper-placement*="left"] .${Ri.arrow}`]:O({},t.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})),une=Ye("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.tooltip,r.touch&&t.touch,r.arrow&&t.tooltipArrow,t[`tooltipPlacement${Be(r.placement.split("-")[0])}`]]}})(({theme:e,ownerState:t})=>O({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:Rr(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},t.arrow&&{position:"relative",margin:0},t.touch&&{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${ane(16/14)}em`,fontWeight:e.typography.fontWeightRegular},{[`.${Ri.popper}[data-popper-placement*="left"] &`]:O({transformOrigin:"right center"},t.isRtl?O({marginLeft:"14px"},t.touch&&{marginLeft:"24px"}):O({marginRight:"14px"},t.touch&&{marginRight:"24px"})),[`.${Ri.popper}[data-popper-placement*="right"] &`]:O({transformOrigin:"left center"},t.isRtl?O({marginRight:"14px"},t.touch&&{marginRight:"24px"}):O({marginLeft:"14px"},t.touch&&{marginLeft:"24px"})),[`.${Ri.popper}[data-popper-placement*="top"] &`]:O({transformOrigin:"center bottom",marginBottom:"14px"},t.touch&&{marginBottom:"24px"}),[`.${Ri.popper}[data-popper-placement*="bottom"] &`]:O({transformOrigin:"center top",marginTop:"14px"},t.touch&&{marginTop:"24px"})})),dne=Ye("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:Rr(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}));let df=!1,qg=null,bc={x:0,y:0};function ff(e,t){return r=>{t&&t(r),e(r)}}const fne=S.forwardRef(function(t,r){var n,o,i,s,a,l,c,u,d,f,p,h,m,b,v,g,y,k,x;const w=Ut({props:t,name:"MuiTooltip"}),{arrow:E=!1,children:M,components:C={},componentsProps:T={},describeChild:R=!1,disableFocusListener:B=!1,disableHoverListener:I=!1,disableInteractive:F=!1,disableTouchListener:V=!1,enterDelay:z=100,enterNextDelay:K=0,enterTouchDelay:_=700,followCursor:N=!1,id:H,leaveDelay:G=0,leaveTouchDelay:J=1500,onClose:_e,onOpen:oe,open:ue,placement:de="bottom",PopperComponent:he,PopperProps:Me={},slotProps:Se={},slots:ct={},title:et,TransitionComponent:Er=V0,TransitionProps:pe}=w,Ie=ge(w,sne),Ue=S.isValidElement(M)?M:A.jsx("span",{children:M}),Ln=Tm(),jr=Ln.direction==="rtl",[Zt,To]=S.useState(),[Nt,Ur]=S.useState(null),fn=S.useRef(!1),In=F||N,Je=S.useRef(),Wr=S.useRef(),pn=S.useRef(),ai=S.useRef(),[ba,fe]=TY({controlled:ue,default:!1,name:"Tooltip",state:"open"});let hn=ba;const Zl=MY(H),li=S.useRef(),ec=S.useCallback(()=>{li.current!==void 0&&(document.body.style.WebkitUserSelect=li.current,li.current=void 0),clearTimeout(ai.current)},[]);S.useEffect(()=>()=>{clearTimeout(Je.current),clearTimeout(Wr.current),clearTimeout(pn.current),ec()},[ec]);const ok=xe=>{clearTimeout(qg),df=!0,fe(!0),oe&&!hn&&oe(xe)},Ld=$s(xe=>{clearTimeout(qg),qg=setTimeout(()=>{df=!1},800+G),fe(!1),_e&&hn&&_e(xe),clearTimeout(Je.current),Je.current=setTimeout(()=>{fn.current=!1},Ln.transitions.duration.shortest)}),Rm=xe=>{fn.current&&xe.type!=="touchstart"||(Zt&&Zt.removeAttribute("title"),clearTimeout(Wr.current),clearTimeout(pn.current),z||df&&K?Wr.current=setTimeout(()=>{ok(xe)},df?K:z):ok(xe))},ik=xe=>{clearTimeout(Wr.current),clearTimeout(pn.current),pn.current=setTimeout(()=>{Ld(xe)},G)},{isFocusVisibleRef:sk,onBlur:eO,onFocus:tO,ref:rO}=G3(),[,ak]=S.useState(!1),lk=xe=>{eO(xe),sk.current===!1&&(ak(!1),ik(xe))},ck=xe=>{Zt||To(xe.currentTarget),tO(xe),sk.current===!0&&(ak(!0),Rm(xe))},uk=xe=>{fn.current=!0;const Kr=Ue.props;Kr.onTouchStart&&Kr.onTouchStart(xe)},dk=Rm,fk=ik,nO=xe=>{uk(xe),clearTimeout(pn.current),clearTimeout(Je.current),ec(),li.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",ai.current=setTimeout(()=>{document.body.style.WebkitUserSelect=li.current,Rm(xe)},_)},oO=xe=>{Ue.props.onTouchEnd&&Ue.props.onTouchEnd(xe),ec(),clearTimeout(pn.current),pn.current=setTimeout(()=>{Ld(xe)},J)};S.useEffect(()=>{if(!hn)return;function xe(Kr){(Kr.key==="Escape"||Kr.key==="Esc")&&Ld(Kr)}return document.addEventListener("keydown",xe),()=>{document.removeEventListener("keydown",xe)}},[Ld,hn]);const iO=Hr(Ue.ref,rO,To,r);!et&&et!==0&&(hn=!1);const Pm=S.useRef(),sO=xe=>{const Kr=Ue.props;Kr.onMouseMove&&Kr.onMouseMove(xe),bc={x:xe.clientX,y:xe.clientY},Pm.current&&Pm.current.update()},tc={},Nm=typeof et=="string";R?(tc.title=!hn&&Nm&&!I?et:null,tc["aria-describedby"]=hn?Zl:null):(tc["aria-label"]=Nm?et:null,tc["aria-labelledby"]=hn&&!Nm?Zl:null);const Dn=O({},tc,Ie,Ue.props,{className:Ce(Ie.className,Ue.props.className),onTouchStart:uk,ref:iO},N?{onMouseMove:sO}:{}),rc={};V||(Dn.onTouchStart=nO,Dn.onTouchEnd=oO),I||(Dn.onMouseOver=ff(dk,Dn.onMouseOver),Dn.onMouseLeave=ff(fk,Dn.onMouseLeave),In||(rc.onMouseOver=dk,rc.onMouseLeave=fk)),B||(Dn.onFocus=ff(ck,Dn.onFocus),Dn.onBlur=ff(lk,Dn.onBlur),In||(rc.onFocus=ck,rc.onBlur=lk));const aO=S.useMemo(()=>{var xe;let Kr=[{name:"arrow",enabled:!!Nt,options:{element:Nt,padding:4}}];return(xe=Me.popperOptions)!=null&&xe.modifiers&&(Kr=Kr.concat(Me.popperOptions.modifiers)),O({},Me.popperOptions,{modifiers:Kr})},[Nt,Me]),nc=O({},w,{isRtl:jr,arrow:E,disableInteractive:In,placement:de,PopperComponentProp:he,touch:fn.current}),zm=lne(nc),pk=(n=(o=ct.popper)!=null?o:C.Popper)!=null?n:cne,hk=(i=(s=(a=ct.transition)!=null?a:C.Transition)!=null?s:Er)!=null?i:V0,mk=(l=(c=ct.tooltip)!=null?c:C.Tooltip)!=null?l:une,gk=(u=(d=ct.arrow)!=null?d:C.Arrow)!=null?u:dne,lO=eu(pk,O({},Me,(f=Se.popper)!=null?f:T.popper,{className:Ce(zm.popper,Me==null?void 0:Me.className,(p=(h=Se.popper)!=null?h:T.popper)==null?void 0:p.className)}),nc),cO=eu(hk,O({},pe,(m=Se.transition)!=null?m:T.transition),nc),uO=eu(mk,O({},(b=Se.tooltip)!=null?b:T.tooltip,{className:Ce(zm.tooltip,(v=(g=Se.tooltip)!=null?g:T.tooltip)==null?void 0:v.className)}),nc),dO=eu(gk,O({},(y=Se.arrow)!=null?y:T.arrow,{className:Ce(zm.arrow,(k=(x=Se.arrow)!=null?x:T.arrow)==null?void 0:k.className)}),nc);return A.jsxs(S.Fragment,{children:[S.cloneElement(Ue,Dn),A.jsx(pk,O({as:he??$b,placement:de,anchorEl:N?{getBoundingClientRect:()=>({top:bc.y,left:bc.x,right:bc.x,bottom:bc.y,width:0,height:0})}:Zt,popperRef:Pm,open:Zt?hn:!1,id:Zl,transition:!0},rc,lO,{popperOptions:aO,children:({TransitionProps:xe})=>A.jsx(hk,O({timeout:Ln.transitions.duration.shorter},xe,cO,{children:A.jsxs(mk,O({},uO,{children:[et,E?A.jsx(gk,O({},dO,{ref:Ur})):null]}))}))}))]})}),WT=fne;function pne(e){return Ft("MuiToggleButton",e)}const hne=Vt("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge"]),V4=hne,mne=["children","className","color","disabled","disableFocusRipple","fullWidth","onChange","onClick","selected","size","value"],gne=e=>{const{classes:t,fullWidth:r,selected:n,disabled:o,size:i,color:s}=e,a={root:["root",n&&"selected",o&&"disabled",r&&"fullWidth",`size${Be(i)}`,s]};return Qt(a,pne,t)},vne=Ye(Ab,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`size${Be(r.size)}`]]}})(({theme:e,ownerState:t})=>{let r=t.color==="standard"?e.palette.text.primary:e.palette[t.color].main,n;return e.vars&&(r=t.color==="standard"?e.vars.palette.text.primary:e.vars.palette[t.color].main,n=t.color==="standard"?e.vars.palette.text.primaryChannel:e.vars.palette[t.color].mainChannel),O({},e.typography.button,{borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active},t.fullWidth&&{width:"100%"},{[`&.${V4.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Rr(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${V4.selected}`]:{color:r,backgroundColor:e.vars?`rgba(${n} / ${e.vars.palette.action.selectedOpacity})`:Rr(r,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${n} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Rr(r,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${n} / ${e.vars.palette.action.selectedOpacity})`:Rr(r,e.palette.action.selectedOpacity)}}}},t.size==="small"&&{padding:7,fontSize:e.typography.pxToRem(13)},t.size==="large"&&{padding:15,fontSize:e.typography.pxToRem(15)})}),yne=S.forwardRef(function(t,r){const n=Ut({props:t,name:"MuiToggleButton"}),{children:o,className:i,color:s="standard",disabled:a=!1,disableFocusRipple:l=!1,fullWidth:c=!1,onChange:u,onClick:d,selected:f,size:p="medium",value:h}=n,m=ge(n,mne),b=O({},n,{color:s,disabled:a,disableFocusRipple:l,fullWidth:c,size:p}),v=gne(b),g=y=>{d&&(d(y,h),y.defaultPrevented)||u&&u(y,h)};return A.jsx(vne,O({className:Ce(v.root,i),disabled:a,focusRipple:!l,ref:r,onClick:g,onChange:u,value:h,ownerState:b,"aria-pressed":f},m,{children:o}))}),bne=yne;var kne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 15v2c0 1.054.95 2 2 2h3v2H7a4 4 0 0 1-4-4v-2h2zm13-5l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16 10h2zm-1 2.885L15.753 16h2.492L17 12.885zM3 3h6a3 3 0 0 1 2.235 5A3 3 0 0 1 9 13H3V3zm6 6H5v2h4a1 1 0 0 0 0-2zm8-6a4 4 0 0 1 4 4v2h-2V7a2 2 0 0 0-2-2h-3V3h3zM9 5H5v2h4a1 1 0 1 0 0-2z"}}],xne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"}}],wne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"}}],Sne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0zm-8.66 16h15.588L12 5.5 4.206 19zM11 16h2v2h-2v-2zm0-7h2v5h-2V9z"}}],Ene=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 19h18v2H3v-2zm5-6h3l-4 4-4-4h3V3h2v10zm10 0h3l-4 4-4-4h3V3h2v10z"}}],Cne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm2 15h14v2H5v-2zm-2-5h18v2H3v-2zm2-5h14v2H5V9z"}}],Mne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h18v2H3v-2zm0-5h18v2H3v-2zm0-5h18v2H3V9z"}}],Tne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h14v2H3v-2zm0-5h18v2H3v-2zm0-5h14v2H3V9z"}}],One=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm4 15h14v2H7v-2zm-4-5h18v2H3v-2zm4-5h14v2H7V9z"}}],_ne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 3h18v2H3V3zm5 8v10H6V11H3l4-4 4 4H8zm10 0v10h-2V11h-3l4-4 4 4h-3z"}}],Ane=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 11h18v2H3v-2zm15 7v3h-2v-3h-3l4-4 4 4h-3zM8 18v3H6v-3H3l4-4 4 4H8zM18 6h3l-4 4-4-4h3V3h2v3zM8 6h3l-4 4-4-4h3V3h2v3z"}}],Rne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M6.75 2.5A4.25 4.25 0 0 1 11 6.75V11H6.75a4.25 4.25 0 1 1 0-8.5zM9 9V6.75A2.25 2.25 0 1 0 6.75 9H9zm-2.25 4H11v4.25A4.25 4.25 0 1 1 6.75 13zm0 2A2.25 2.25 0 1 0 9 17.25V15H6.75zm10.5-12.5a4.25 4.25 0 1 1 0 8.5H13V6.75a4.25 4.25 0 0 1 4.25-4.25zm0 6.5A2.25 2.25 0 1 0 15 6.75V9h2.25zM13 13h4.25A4.25 4.25 0 1 1 13 17.25V13zm2 2v2.25A2.25 2.25 0 1 0 17.25 15H15z"}}],Pne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 16l-6-6h12z"}}],Nne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 7v4L2 6l6-5v4h5a8 8 0 1 1 0 16H4v-2h9a6 6 0 1 0 0-12H8z"}}],zne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 7h-5a6 6 0 1 0 0 12h9v2h-9a8 8 0 1 1 0-16h5V1l6 5-6 5V7z"}}],Lne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 12l6-6v12z"}}],Ine=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 12l-6 6V6z"}}],Dne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 8l6 6H6z"}}],$ne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 3v7.267l6.294-3.633 1 1.732-6.293 3.633 6.293 3.635-1 1.732L13 13.732V21h-2v-7.268l-6.294 3.634-1-1.732L9.999 12 3.706 8.366l1-1.732L11 10.267V3z"}}],Hne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14.828 7.757l-5.656 5.657a1 1 0 1 0 1.414 1.414l5.657-5.656A3 3 0 1 0 12 4.929l-5.657 5.657a5 5 0 1 0 7.071 7.07L19.071 12l1.414 1.414-5.657 5.657a7 7 0 1 1-9.9-9.9l5.658-5.656a5 5 0 0 1 7.07 7.07L12 16.244A3 3 0 1 1 7.757 12l5.657-5.657 1.414 1.414z"}}],Bne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 11h4.5a2.5 2.5 0 1 0 0-5H8v5zm10 4.5a4.5 4.5 0 0 1-4.5 4.5H6V4h6.5a4.5 4.5 0 0 1 3.256 7.606A4.498 4.498 0 0 1 18 15.5zM8 13v5h5.5a2.5 2.5 0 1 0 0-5H8z"}}],Fne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12 2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3zm16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5z"}}],Vne=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M14 3c.552 0 1 .448 1 1v5h5c.552 0 1 .448 1 1v10c0 .552-.448 1-1 1H10c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h10zm-1 2H5v8h8V5z"}}],jne=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M11 3c.552 0 1 .448 1 1v2h5c.552 0 1 .448 1 1v5h2c.552 0 1 .448 1 1v7c0 .552-.448 1-1 1h-7c-.552 0-1-.448-1-1v-2H7c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h7zm5 5H8v8h8V8z"}}],Une=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 3v2H4v13.385L5.763 17H20v-7h2v8a1 1 0 0 1-1 1H6.455L2 22.5V4a1 1 0 0 1 1-1h11zm5 0V0h2v3h3v2h-3v3h-2V5h-3V3h3z"}}],Wne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-.997-4L6.76 11.757l1.414-1.414 2.829 2.829 5.656-5.657 1.415 1.414L11.003 16z"}}],Kne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M7 7V3a1 1 0 0 1 1-1h13a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-4v3.993c0 .556-.449 1.007-1.007 1.007H3.007A1.006 1.006 0 0 1 2 20.993l.003-12.986C2.003 7.451 2.452 7 3.01 7H7zm2 0h6.993C16.549 7 17 7.449 17 8.007V15h3V4H9v3zm6 2H4.003L4 20h11V9zm-6.497 9l-3.536-3.536 1.414-1.414 2.122 2.122 4.242-4.243 1.414 1.414L8.503 18z"}}],qne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M6 4v4h12V4h2.007c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.994.994 0 0 1 3 21.007V4.993C3 4.445 3.445 4 3.993 4H6zm2-2h8v4H8V2z"}}],Gne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 4V2h10v2h3.007c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.994.994 0 0 1 3 21.007V4.993C3 4.445 3.445 4 3.993 4H7zm0 2H5v14h14V6h-2v2H7V6zm2-2v2h6V4H9z"}}],Yne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm0-9.414l2.828-2.829 1.415 1.415L13.414 12l2.829 2.828-1.415 1.415L12 13.414l-2.828 2.829-1.415-1.415L10.586 12 7.757 9.172l1.415-1.415L12 10.586z"}}],Jne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"}}],Xne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"}}],Qne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M23 12l-7.071 7.071-1.414-1.414L20.172 12l-5.657-5.657 1.414-1.414L23 12zM3.828 12l5.657 5.657-1.414 1.414L1 12l7.071-7.071 1.414 1.414L3.828 12z"}}],Zne=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16.95 8.464l1.414-1.414 4.95 4.95-4.95 4.95-1.414-1.414L20.485 12 16.95 8.464zm-9.9 0L3.515 12l3.535 3.536-1.414 1.414L.686 12l4.95-4.95L7.05 8.464z"}}],eoe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 6h5v2h-2v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V8H2V6h5V3a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v3zm-8 5v6h2v-6H9zm4 0v6h2v-6h-2zM9 4v2h6V4H9z"}}],toe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 6h5v2h-2v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V8H2V6h5V3a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v3zm1 2H6v12h12V8zm-9 3h2v6H9v-6zm4 0h2v6h-2v-6zM9 4v2h6V4H9z"}}],roe=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M12 3c.552 0 1 .448 1 1v8c.835-.628 1.874-1 3-1 2.761 0 5 2.239 5 5s-2.239 5-5 5c-1.032 0-1.99-.313-2.787-.848L13 20c0 .552-.448 1-1 1H6c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zm-1 2H7v14h4V5zm8 10h-6v2h6v-2z"}}],noe=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 5c.552 0 1 .448 1 1v6c0 .552-.448 1-1 1 .628.835 1 1.874 1 3 0 2.761-2.239 5-5 5s-5-2.239-5-5c0-1.126.372-2.165 1-3H4c-.552 0-1-.448-1-1V6c0-.552.448-1 1-1h16zm-7 10v2h6v-2h-6zm6-8H5v4h14V7z"}}],ooe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4.583 17.321C3.553 16.227 3 15 3 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 0 1-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179zm10 0C13.553 16.227 13 15 13 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 0 1-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179z"}}],ioe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19.417 6.679C20.447 7.773 21 9 21 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311-1.804-.167-3.226-1.648-3.226-3.489a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179zm-10 0C10.447 7.773 11 9 11 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311C4.591 12.322 3.17 10.841 3.17 9a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179z"}}],soe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 19h16v-7h2v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-8h2v7zM14 9h5l-7 7-7-7h5V3h4v6z"}}],aoe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M16 13l6.964 4.062-2.973.85 2.125 3.681-1.732 1-2.125-3.68-2.223 2.15L16 13zm-2-7h2v2h5a1 1 0 0 1 1 1v4h-2v-3H10v10h4v2H9a1 1 0 0 1-1-1v-5H6v-2h2V9a1 1 0 0 1 1-1h5V6zM4 14v2H2v-2h2zm0-4v2H2v-2h2zm0-4v2H2V6h2zm0-4v2H2V2h2zm4 0v2H6V2h2zm4 0v2h-2V2h2zm4 0v2h-2V2h2z"}}],loe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 19a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm-5.5 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm11 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zM13 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.621 6.302 14.685 14.685 0 0 0 5.327 3.042l-.536 1.93A16.685 16.685 0 0 1 12 13.726a16.696 16.696 0 0 1-6.202 3.547l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042 18.077 18.077 0 0 1-2.822-4.3h2.24A16.031 16.031 0 0 0 12 10.876a16.168 16.168 0 0 0 2.91-4.876L5 6V4h6V2h2z"}}],coe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 19a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm-5.5 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm11 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zM18 3v2H8v4h9v2H8v4h10v2H6V3h12z"}}],uoe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 10h2v.757a4.5 4.5 0 0 1 7 3.743V20h-2v-5.5c0-1.43-1.175-2.5-2.5-2.5S16 13.07 16 14.5V20h-2V10zm-2-6v2H4v5h8v2H4v5h8v2H2V4h10z"}}],doe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-1-5h2v2h-2v-2zm0-8h2v6h-2V7z"}}],foe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6zm11-3v9l-3.794-3.793-5.999 6-1.414-1.414 5.999-6L12 3h9z"}}],poe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1.001 1.001 0 0 1 3 21l.003-14c0-.552.45-1 1.007-1H7zM5.003 8L5 20h10V8H5.003zM9 6h8v10h2V4H9v2z"}}],hoe=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M6 21.5c-1.933 0-3.5-1.567-3.5-3.5s1.567-3.5 3.5-3.5c1.585 0 2.924 1.054 3.355 2.5H15v-2h2V9.242L14.757 7H9V9H3V3h6v2h5.757L18 1.756 22.243 6 19 9.241V15L21 15v6h-6v-2H9.355c-.43 1.446-1.77 2.5-3.355 2.5zm0-5c-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5-.672-1.5-1.5-1.5zm13 .5h-2v2h2v-2zM18 4.586L16.586 6 18 7.414 19.414 6 18 4.586zM7 5H5v2h2V5z"}}],moe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15.246 14H8.754l-1.6 4H5l6-15h2l6 15h-2.154l-1.6-4zm-.8-2L12 5.885 9.554 12h4.892zM3 20h18v2H3v-2z"}}],goe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M10 6v15H8V6H2V4h14v2h-6zm8 8v7h-2v-7h-3v-2h8v2h-3z"}}],voe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11.246 15H4.754l-2 5H.6L7 4h2l6.4 16h-2.154l-2-5zm-.8-2L8 6.885 5.554 13h4.892zM21 12.535V12h2v8h-2v-.535a4 4 0 1 1 0-6.93zM19 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"}}],yoe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12.651 14.065L11.605 20H9.574l1.35-7.661-7.41-7.41L4.93 3.515 20.485 19.07l-1.414 1.414-6.42-6.42zm-.878-6.535l.27-1.53h-1.8l-2-2H20v2h-5.927L13.5 9.257 11.773 7.53z"}}],boe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z"}}],koe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 3h2v6h-2V5h-4V3h4zM4 3h4v2H4v4H2V3h2zm16 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z"}}],xoe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 18l7.68-6L5 6V4h14v2H8.263L16 12l-7.737 6H19v2H5v-2z"}}],woe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 1v4H4v14h16V3h1.008c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3H6V1h2zm4 7l4 4h-3v4h-2v-4H8l4-4zm6-7v4h-8V3h6V1h2z"}}],Soe=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M13 20h-2v-7H4v7H2V4h2v7h7V4h2v16zm8-12v12h-2v-9.796l-2 .536V8.67L19.5 8H21z"}}],Eoe=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M4 4v7h7V4h2v16h-2v-7H4v7H2V4h2zm14.5 4c2.071 0 3.75 1.679 3.75 3.75 0 .857-.288 1.648-.772 2.28l-.148.18L18.034 18H22v2h-7v-1.556l4.82-5.546c.268-.307.43-.709.43-1.148 0-.966-.784-1.75-1.75-1.75-.918 0-1.671.707-1.744 1.606l-.006.144h-2C14.75 9.679 16.429 8 18.5 8z"}}],Coe=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M22 8l-.002 2-2.505 2.883c1.59.435 2.757 1.89 2.757 3.617 0 2.071-1.679 3.75-3.75 3.75-1.826 0-3.347-1.305-3.682-3.033l1.964-.382c.156.806.866 1.415 1.718 1.415.966 0 1.75-.784 1.75-1.75s-.784-1.75-1.75-1.75c-.286 0-.556.069-.794.19l-1.307-1.547L19.35 10H15V8h7zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2z"}}],Moe=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M13 20h-2v-7H4v7H2V4h2v7h7V4h2v16zm9-12v8h1.5v2H22v2h-2v-2h-5.5v-1.34l5-8.66H22zm-2 3.133L17.19 16H20v-4.867z"}}],Toe=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M22 8v2h-4.323l-.464 2.636c.33-.089.678-.136 1.037-.136 2.21 0 4 1.79 4 4s-1.79 4-4 4c-1.827 0-3.367-1.224-3.846-2.897l1.923-.551c.24.836 1.01 1.448 1.923 1.448 1.105 0 2-.895 2-2s-.895-2-2-2c-.63 0-1.193.292-1.56.748l-1.81-.904L16 8h6zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2z"}}],Ooe=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M21.097 8l-2.598 4.5c2.21 0 4.001 1.79 4.001 4s-1.79 4-4 4-4-1.79-4-4c0-.736.199-1.426.546-2.019L18.788 8h2.309zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2zm14.5 10.5c-1.105 0-2 .895-2 2s.895 2 2 2 2-.895 2-2-.895-2-2-2z"}}],_oe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7.784 14l.42-4H4V8h4.415l.525-5h2.011l-.525 5h3.989l.525-5h2.011l-.525 5H20v2h-3.784l-.42 4H20v2h-4.415l-.525 5h-2.011l.525-5H9.585l-.525 5H7.049l.525-5H4v-2h3.784zm2.011 0h3.99l.42-4h-3.99l-.42 4z"}}],Aoe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 11V4h2v17h-2v-8H7v8H5V4h2v7z"}}],Roe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 15v3h3v2h-3v3h-2v-3h-3v-2h3v-3h2zm.008-12c.548 0 .992.445.992.993V13h-2V5H4v13.999L14 9l3 3v2.829l-3-3L6.827 19H14v2H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016zM8 7a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"}}],Poe=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v1.757l-2 2V5H5v8.1l4-4 4.328 4.329-1.415 1.413L9 11.93l-4 3.999V19h10.533l.708.001 1.329-1.33L18.9 19h.1v-2.758l2-2V20c0 .552-.448 1-1 1H4c-.55 0-1-.45-1-1V4c0-.552.448-1 1-1h16zm1.778 4.808l1.414 1.414L15.414 17l-1.416-.002.002-1.412 7.778-7.778zM15.5 7c.828 0 1.5.672 1.5 1.5s-.672 1.5-1.5 1.5S14 9.328 14 8.5 14.672 7 15.5 7z"}}],Noe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4.828 21l-.02.02-.021-.02H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H4.828zM20 15V5H4v14L14 9l6 6zm0 2.828l-6-6L6.828 19H20v-1.172zM8 11a2 2 0 1 1 0-4 2 2 0 0 1 0 4z"}}],zoe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h18v2H3v-2zm8-5h10v2H11v-2zm0-5h10v2H11V9zm-8 3.5L7 9v7l-4-3.5z"}}],Loe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h18v2H3v-2zm8-5h10v2H11v-2zm0-5h10v2H11V9zm-4 3.5L3 16V9l4 3.5z"}}],Ioe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM11 7h2v2h-2V7zm0 4h2v6h-2v-6z"}}],Doe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 21v-2h3V5H8V3h8v2h-3v14h3v2H8zM18.05 7.05L23 12l-4.95 4.95-1.414-1.414L20.172 12l-3.536-3.536L18.05 7.05zm-12.1 0l1.414 1.414L3.828 12l3.536 3.536L5.95 16.95 1 12l4.95-4.95z"}}],$oe=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zm-1 2h-4v14h4V5zM6 7c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2H5v1.999L3 11v2l2-.001V15h2v-2.001L9 13v-2l-2-.001V9z"}}],Hoe=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M10 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zM9 5H5v14h4V5zm9 2c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2h-2v1.999L15 11v2l2-.001V15h2v-2.001L21 13v-2l-2-.001V9z"}}],Boe=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M12 13c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2h-2v1.999L9 17v2l2-.001V21h2v-2.001L15 19v-2l-2-.001V15zm7-12c.552 0 1 .448 1 1v6c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zM5 5v4h14V5H5z"}}],Foe=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 13c.552 0 1 .448 1 1v6c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1v-6c0-.552.448-1 1-1h16zm-1 2H5v4h14v-4zM12 1c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2h-2v1.999L9 5v2l2-.001V9h2V6.999L15 7V5l-2-.001V3z"}}],Voe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 20H7v-2h2.927l2.116-12H9V4h8v2h-2.927l-2.116 12H15z"}}],joe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M11 5H5v14h6V5zm2 0v14h6V5h-6zM4 3h16a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"}}],Uoe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 4h10v2H11V4zM6 7v4H4V7H1l4-4 4 4H6zm0 10h3l-4 4-4-4h3v-4h2v4zm5 1h10v2H11v-2zm-2-7h12v2H9v-2z"}}],Woe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.657 14.828l-1.414-1.414L17.657 12A4 4 0 1 0 12 6.343l-1.414 1.414-1.414-1.414 1.414-1.414a6 6 0 0 1 8.485 8.485l-1.414 1.414zm-2.829 2.829l-1.414 1.414a6 6 0 1 1-8.485-8.485l1.414-1.414 1.414 1.414L6.343 12A4 4 0 1 0 12 17.657l1.414-1.414 1.414 1.414zm0-9.9l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"}}],Koe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.657 14.828l-1.414-1.414L17.657 12A4 4 0 1 0 12 6.343l-1.414 1.414-1.414-1.414 1.414-1.414a6 6 0 0 1 8.485 8.485l-1.414 1.414zm-2.829 2.829l-1.414 1.414a6 6 0 1 1-8.485-8.485l1.414-1.414 1.414 1.414L6.343 12A4 4 0 1 0 12 17.657l1.414-1.414 1.414 1.414zm0-9.9l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07zM5.775 2.293l1.932-.518L8.742 5.64l-1.931.518-1.036-3.864zm9.483 16.068l1.931-.518 1.036 3.864-1.932.518-1.035-3.864zM2.293 5.775l3.864 1.036-.518 1.931-3.864-1.035.518-1.932zm16.068 9.483l3.864 1.035-.518 1.932-3.864-1.036.518-1.931z"}}],qoe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 17h5v2h-3v3h-2v-5zM7 7H2V5h3V2h2v5zm11.364 8.536L16.95 14.12l1.414-1.414a5 5 0 1 0-7.071-7.071L9.879 7.05 8.464 5.636 9.88 4.222a7 7 0 0 1 9.9 9.9l-1.415 1.414zm-2.828 2.828l-1.415 1.414a7 7 0 0 1-9.9-9.9l1.415-1.414L7.05 9.88l-1.414 1.414a5 5 0 1 0 7.071 7.071l1.414-1.414 1.415 1.414zm-.708-10.607l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"}}],Goe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18.364 15.536L16.95 14.12l1.414-1.414a5 5 0 1 0-7.071-7.071L9.879 7.05 8.464 5.636 9.88 4.222a7 7 0 0 1 9.9 9.9l-1.415 1.414zm-2.828 2.828l-1.415 1.414a7 7 0 0 1-9.9-9.9l1.415-1.414L7.05 9.88l-1.414 1.414a5 5 0 1 0 7.071 7.071l1.414-1.414 1.415 1.414zm-.708-10.607l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"}}],Yoe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 4h10v2H11V4zm0 4h6v2h-6V8zm0 6h10v2H11v-2zm0 4h6v2h-6v-2zM3 4h6v6H3V4zm2 2v2h2V6H5zm-2 8h6v6H3v-6zm2 2v2h2v-2H5z"}}],Joe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 4h13v2H8V4zm-5-.5h3v3H3v-3zm0 7h3v3H3v-3zm0 7h3v3H3v-3zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"}}],Xoe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 4h13v2H8V4zM5 3v3h1v1H3V6h1V4H3V3h2zM3 14v-2.5h2V11H3v-1h3v2.5H4v.5h2v1H3zm2 5.5H3v-1h2V18H3v-1h3v4H3v-1h2v-.5zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"}}],Qoe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 4h13v2H8V4zM4.5 6.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 6.9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"}}],Zoe=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15.243 4.515l-6.738 6.737-.707 2.121-1.04 1.041 2.828 2.829 1.04-1.041 2.122-.707 6.737-6.738-4.242-4.242zm6.364 3.535a1 1 0 0 1 0 1.414l-7.779 7.779-2.12.707-1.415 1.414a1 1 0 0 1-1.414 0l-4.243-4.243a1 1 0 0 1 0-1.414l1.414-1.414.707-2.121 7.779-7.779a1 1 0 0 1 1.414 0l5.657 5.657zm-6.364-.707l1.414 1.414-4.95 4.95-1.414-1.414 4.95-4.95zM4.283 16.89l2.828 2.829-1.414 1.414-4.243-1.414 2.828-2.829z"}}],eie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm4 12.5v-4l2 2 2-2v4h2v-7h-2l-2 2-2-2H5v7h2zm11-3v-4h-2v4h-2l3 3 3-3h-2z"}}],tie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm1 2v14h16V5H4zm3 10.5H5v-7h2l2 2 2-2h2v7h-2v-4l-2 2-2-2v4zm11-3h2l-3 3-3-3h2v-4h2v4z"}}],rie=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zm-9 2H5v5.999h2V9l3 3-3 3v-2H5v6h6v-2h2v2h6v-6h-2v2l-3-3 3-3v1.999h2V5h-6v2h-2V5zm2 8v2h-2v-2h2zm0-4v2h-2V9h2z"}}],nie=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M21 20c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16c.552 0 1 .448 1 1v16zm-2-9V5h-5.999v2H15l-3 3-3-3h2V5H5v6h2v2H5v6h6v-2H9l3-3 3 3h-1.999v2H19v-6h-2v-2h2zm-8 2H9v-2h2v2zm4 0h-2v-2h2v2z"}}],oie=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M18 3c1.657 0 3 1.343 3 3s-1.343 3-3 3h-3c-1.306 0-2.417-.834-2.829-2H11c-1.1 0-2 .9-2 2v.171c1.166.412 2 1.523 2 2.829 0 1.306-.834 2.417-2 2.829V15c0 1.1.9 2 2 2h1.17c.412-1.165 1.524-2 2.83-2h3c1.657 0 3 1.343 3 3s-1.343 3-3 3h-3c-1.306 0-2.417-.834-2.829-2H11c-2.21 0-4-1.79-4-4H5c-1.657 0-3-1.343-3-3s1.343-3 3-3h2c0-2.21 1.79-4 4-4h1.17c.412-1.165 1.524-2 2.83-2h3zm0 14h-3c-.552 0-1 .448-1 1s.448 1 1 1h3c.552 0 1-.448 1-1s-.448-1-1-1zM8 11H5c-.552 0-1 .448-1 1s.448 1 1 1h3c.552 0 1-.448 1-1s-.448-1-1-1zm10-6h-3c-.552 0-1 .448-1 1s.448 1 1 1h3c.552 0 1-.448 1-1s-.448-1-1-1z"}}],iie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm14 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-7 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}}],sie=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M10 2c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1H8v2h5V9c0-.552.448-1 1-1h6c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1v-1H8v6h5v-1c0-.552.448-1 1-1h6c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1v-1H7c-.552 0-1-.448-1-1V8H4c-.552 0-1-.448-1-1V3c0-.552.448-1 1-1h6zm9 16h-4v2h4v-2zm0-8h-4v2h4v-2zM9 4H5v2h4V4z"}}],aie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 1.5c1.321 0 2.484.348 3.447.994.963.645 1.726 1.588 2.249 2.778.522 1.19.804 2.625.804 4.257v4.942c0 1.632-.282 3.068-.804 4.257-.523 1.19-1.286 2.133-2.25 2.778-.962.646-2.125.994-3.446.994-1.321 0-2.484-.348-3.447-.994-.963-.645-1.726-1.588-2.249-2.778-.522-1.19-.804-2.625-.804-4.257V9.529c0-1.632.282-3.068.804-4.257.523-1.19 1.286-2.133 2.25-2.778C9.515 1.848 10.678 1.5 12 1.5zm0 2c-.916 0-1.694.226-2.333.655-.637.427-1.158 1.07-1.532 1.92-.412.94-.635 2.108-.635 3.454v4.942c0 1.346.223 2.514.635 3.453.374.851.895 1.494 1.532 1.921.639.429 1.417.655 2.333.655.916 0 1.694-.226 2.333-.655.637-.427 1.158-1.07 1.532-1.92.412-.94.635-2.108.635-3.454V9.529c0-1.346-.223-2.514-.635-3.453-.374-.851-.895-1.494-1.532-1.921C13.694 3.726 12.916 3.5 12 3.5z"}}],lie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 1.5V22h-2V3.704L7.5 4.91V2.839l5-1.339z"}}],cie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 7.5a4 4 0 1 0-8 0H6a6 6 0 1 1 10.663 3.776l-7.32 8.723L18 20v2H6v-1.127l9.064-10.802A3.982 3.982 0 0 0 16 7.5z"}}],uie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18 2v1.362L12.809 9.55a6.501 6.501 0 1 1-7.116 8.028l1.94-.486A4.502 4.502 0 0 0 16.5 16a4.5 4.5 0 0 0-6.505-4.03l-.228.122-.69-1.207L14.855 4 6.5 4V2H18z"}}],die=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 1.5V16h3v2h-3v4h-2v-4H4v-1.102L14 1.5h2zM14 16V5.171L6.968 16H14z"}}],fie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18 2v2H9.3l-.677 6.445a6.5 6.5 0 1 1-2.93 7.133l1.94-.486A4.502 4.502 0 0 0 16.5 16a4.5 4.5 0 0 0-4.5-4.5c-2.022 0-3.278.639-3.96 1.53l-1.575-1.182L7.5 2H18z"}}],pie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14.886 2l-4.438 7.686A6.5 6.5 0 1 1 6.4 12.7L12.576 2h2.31zM12 11.5a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9z"}}],hie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 2v1.5L10.763 22H8.574l8.013-18H6V2z"}}],mie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 1.5a5.5 5.5 0 0 1 3.352 9.86C17.24 12.41 18.5 14.32 18.5 16.5c0 3.314-2.91 6-6.5 6s-6.5-2.686-6.5-6c0-2.181 1.261-4.09 3.147-5.141A5.5 5.5 0 0 1 12 1.5zm0 11c-2.52 0-4.5 1.828-4.5 4 0 2.172 1.98 4 4.5 4s4.5-1.828 4.5-4c0-2.172-1.98-4-4.5-4zm0-9a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7z"}}],gie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 1.5a6.5 6.5 0 0 1 5.619 9.77l-6.196 10.729H9.114l4.439-7.686A6.5 6.5 0 1 1 12 1.5zm0 2a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9z"}}],vie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M14 20v-2.157c1.863-1.192 3.5-3.875 3.5-6.959 0-3.073-2-6.029-5.5-6.029s-5.5 2.956-5.5 6.03c0 3.083 1.637 5.766 3.5 6.958V20H3v-2h4.76C5.666 16.505 4 13.989 4 10.884 4 6.247 7.5 3 12 3s8 3.247 8 7.884c0 3.105-1.666 5.621-3.76 7.116H21v2h-7z"}}],yie=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M15 3c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-2v2h4c.552 0 1 .448 1 1v3h2c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1v-4c0-.552.448-1 1-1h2v-2H8v2h2c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1v-4c0-.552.448-1 1-1h2v-3c0-.552.448-1 1-1h4V9H9c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zM9 17H5v2h4v-2zm10 0h-4v2h4v-2zM14 5h-4v2h4V5z"}}],bie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 21v-4H7v4H5v-5a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v5h-2zM7 3v4h10V3h2v5a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V3h2zM2 9l4 3-4 3V9zm20 0v6l-4-3 4-3z"}}],kie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 6v15h-2v-5a6 6 0 1 1 0-12h10v2h-3v15h-2V6h-3zm-2 0a4 4 0 1 0 0 8V6z"}}],xie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12.9 6.858l4.242 4.243L7.242 21H3v-4.243l9.9-9.9zm1.414-1.414l2.121-2.122a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414l-2.122 2.121-4.242-4.242z"}}],wie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15.728 9.686l-1.414-1.414L5 17.586V19h1.414l9.314-9.314zm1.414-1.414l1.414-1.414-1.414-1.414-1.414 1.414 1.414 1.414zM7.242 21H3v-4.243L16.435 3.322a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414L7.243 21z"}}],Sie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.934 3.036l1.732 1L18.531 6H21v2h-2v4h2v2h-2v7h-2v-7h-3.084c-.325 2.862-1.564 5.394-3.37 7.193l-1.562-1.27c1.52-1.438 2.596-3.522 2.917-5.922L10 14v-2l2-.001V8h-2V6h2.467l-1.133-1.964 1.732-1L14.777 6h1.444l1.713-2.964zM5 13.803l-2 .536v-2.071l2-.536V8H3V6h2V3h2v3h2v2H7v3.197l2-.536v2.07l-2 .536V18.5A2.5 2.5 0 0 1 4.5 21H3v-2h1.5a.5.5 0 0 0 .492-.41L5 18.5v-4.697zM17 8h-3v4h3V8z"}}],Eie=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M12 19c.828 0 1.5.672 1.5 1.5S12.828 22 12 22s-1.5-.672-1.5-1.5.672-1.5 1.5-1.5zm0-17c3.314 0 6 2.686 6 6 0 2.165-.753 3.29-2.674 4.923C13.399 14.56 13 15.297 13 17h-2c0-2.474.787-3.695 3.031-5.601C15.548 10.11 16 9.434 16 8c0-2.21-1.79-4-4-4S8 5.79 8 8v1H6V8c0-3.314 2.686-6 6-6z"}}],Cie=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M21 19v2h-2v-2h2zm-4 0v2h-2v-2h2zm-4 0v2h-2v-2h2zm-4 0v2H7v-2h2zm-4 0v2H3v-2h2zm16-4v2h-2v-2h2zM5 15v2H3v-2h2zm0-4v2H3v-2h2zm11-8c2.687 0 4.882 2.124 4.995 4.783L21 8v5h-2V8c0-1.591-1.255-2.903-2.824-2.995L16 5h-5V3h5zM5 7v2H3V7h2zm0-4v2H3V3h2zm4 0v2H7V3h2z"}}],Mie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M9.683 7.562L12 9.88l6.374-6.375a2 2 0 0 1 2.829 0l.707.707L9.683 16.438a4 4 0 1 1-2.121-2.121L9.88 12 7.562 9.683a4 4 0 1 1 2.121-2.121zM6 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 12a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm9.535-6.587l6.375 6.376-.707.707a2 2 0 0 1-2.829 0l-4.96-4.961 2.12-2.122z"}}],Tie=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M14 3c.552 0 1 .448 1 1v5h5c.552 0 1 .448 1 1v10c0 .552-.448 1-1 1H10c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h10zm-1 2H5v8h4v-3c0-.552.448-1 1-1h3V5z"}}],Oie=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M11 3c.552 0 1 .448 1 1v2h5c.552 0 1 .448 1 1v5h2c.552 0 1 .448 1 1v7c0 .552-.448 1-1 1h-7c-.552 0-1-.448-1-1v-2H7c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h7zm5 5h-4v3c0 .552-.448 1-1 1H8v4h4v-3c0-.552.448-1 1-1h3V8z"}}],_ie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M2 11h2v2H2v-2zm4 0h12v2H6v-2zm14 0h2v2h-2v-2z"}}],Aie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M9.583 17.321C8.553 16.227 8 15 8 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 0 1-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179z"}}],Rie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14.417 6.679C15.447 7.773 16 9 16 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311C9.591 12.322 8.17 10.841 8.17 9a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179z"}}],Pie=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M19 3l4 5h-3v12h-2V8h-3l4-5zm-5 15v2H3v-2h11zm0-7v2H3v-2h11zm-2-7v2H3V4h9z"}}],Nie=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 4v12h3l-4 5-4-5h3V4h2zm-8 14v2H3v-2h9zm2-7v2H3v-2h11zm0-7v2H3V4h11z"}}],zie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 9v4h16V9h2v5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V9h2z"}}],Lie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M17.5 2.5L23 12l-5.5 9.5h-11L1 12l5.5-9.5h11zm-1.153 2H7.653L3.311 12l4.342 7.5h8.694l4.342-7.5-4.342-7.5zM11 15h2v2h-2v-2zm0-8h2v6h-2V7z"}}],Iie=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zm-9 2H5v14h6v-4h2v4h6V5h-6v4h-2V5zm4 4l3 3-3 3v-2H9v2l-3-3 3-3v2h6V9z"}}],Die=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zm-1 2H5v5.999L9 11v2H5v6h14v-6h-4v-2l4-.001V5zm-7 1l3 3h-2v6h2l-3 3-3-3h2V9H9l3-3z"}}],$ie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 9h-2V6H5V4h14v2h-6v3zm0 6v5h-2v-5h2zM3 11h18v2H3v-2z"}}],Hie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.154 14c.23.516.346 1.09.346 1.72 0 1.342-.524 2.392-1.571 3.147C14.88 19.622 13.433 20 11.586 20c-1.64 0-3.263-.381-4.87-1.144V16.6c1.52.877 3.075 1.316 4.666 1.316 2.551 0 3.83-.732 3.839-2.197a2.21 2.21 0 0 0-.648-1.603l-.12-.117H3v-2h18v2h-3.846zm-4.078-3H7.629a4.086 4.086 0 0 1-.481-.522C6.716 9.92 6.5 9.246 6.5 8.452c0-1.236.466-2.287 1.397-3.153C8.83 4.433 10.271 4 12.222 4c1.471 0 2.879.328 4.222.984v2.152c-1.2-.687-2.515-1.03-3.946-1.03-2.48 0-3.719.782-3.719 2.346 0 .42.218.786.654 1.099.436.313.974.562 1.613.75.62.18 1.297.414 2.03.699z"}}],Bie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 6v13H9V6H3V4h14v2h-6zm8.55 10.58a.8.8 0 1 0-1.32-.36l-1.154.33A2.001 2.001 0 0 1 19 14a2 2 0 0 1 1.373 3.454L18.744 19H21v1h-4v-1l2.55-2.42z"}}],Fie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5.596 4L10.5 9.928 15.404 4H18l-6.202 7.497L18 18.994V19h-2.59l-4.91-5.934L5.59 19H3v-.006l6.202-7.497L3 4h2.596zM21.55 16.58a.8.8 0 1 0-1.32-.36l-1.155.33A2.001 2.001 0 0 1 21 14a2 2 0 0 1 1.373 3.454L20.744 19H23v1h-4v-1l2.55-2.42z"}}],Vie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 11h14v2H5z"}}],jie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 7v13H9V7H3V5h12v2h-4zm8.55-.42a.8.8 0 1 0-1.32-.36l-1.154.33A2.001 2.001 0 0 1 19 4a2 2 0 0 1 1.373 3.454L18.744 9H21v1h-4V9l2.55-2.42z"}}],Uie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5.596 5l4.904 5.928L15.404 5H18l-6.202 7.497L18 19.994V20h-2.59l-4.91-5.934L5.59 20H3v-.006l6.202-7.497L3 5h2.596zM21.55 6.58a.8.8 0 1 0-1.32-.36l-1.155.33A2.001 2.001 0 0 1 21 4a2 2 0 0 1 1.373 3.454L20.744 9H23v1h-4V9l2.55-2.42z"}}],Wie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M13 10v4h6v-4h-6zm-2 0H5v4h6v-4zm2 9h6v-3h-6v3zm-2 0v-3H5v3h6zm2-14v3h6V5h-6zm-2 0H5v3h6V5zM4 3h16a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"}}],Kie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 8h16V5H4v3zm10 11v-9h-4v9h4zm2 0h4v-9h-4v9zm-8 0v-9H4v9h4zM3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"}}],qie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 5v10H9v-4a4 4 0 1 1 0-8h8v2h-2v10h-2V5h-2zM9 5a2 2 0 1 0 0 4V5zm8 12v-2.5l4 3.5-4 3.5V19H5v-2h12z"}}],Gie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 5v10H9v-4a4 4 0 1 1 0-8h8v2h-2v10h-2V5h-2zM9 5a2 2 0 1 0 0 4V5zM7 17h12v2H7v2.5L3 18l4-3.5V17z"}}],Yie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 17h10v-2.5l3.5 3.5-3.5 3.5V19H7v2.5L3.5 18 7 14.5V17zm6-11v9h-2V6H5V4h14v2h-6z"}}],Jie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 18h1.5a2.5 2.5 0 1 0 0-5H3v-2h13.5a4.5 4.5 0 1 1 0 9H15v2l-4-3 4-3v2zM3 4h18v2H3V4zm6 14v2H3v-2h6z"}}],Xie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 6v15h-2V6H5V4h14v2z"}}],Qie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301 14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"}}],Zie=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 15v2a2 2 0 0 0 1.85 1.995L7 19h3v2H7a4 4 0 0 1-4-4v-2h2zm13-5l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16 10h2zm-1 2.885L15.753 16h2.492L17 12.885zM8 2v2h4v7H8v3H6v-3H2V4h4V2h2zm9 1a4 4 0 0 1 4 4v2h-2V7a2 2 0 0 0-2-2h-3V3h3zM6 6H4v3h2V6zm4 0H8v3h2V6z"}}],ese=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 3v9a4 4 0 1 0 8 0V3h2v9a6 6 0 1 1-12 0V3h2zM4 20h16v2H4v-2z"}}],tse=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 19h16v-7h2v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-8h2v7zM14 9v6h-4V9H5l7-7 7 7h-5z"}}],rse=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 3.993C3 3.445 3.445 3 3.993 3h16.014c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.994.994 0 0 1 3 20.007V3.993zM5 5v14h14V5H5zm5.622 3.415l4.879 3.252a.4.4 0 0 1 0 .666l-4.88 3.252a.4.4 0 0 1-.621-.332V8.747a.4.4 0 0 1 .622-.332z"}}],nse=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 21v-2h3.662l1.234-7H5v-2h3.249l.881-5H4V3h16v2h-8.839l-.882 5H18v9h3v2H3zm13-9H9.927l-1.235 7H16v-7z"}}];const ose=Object.freeze(Object.defineProperty({__proto__:null,ab:kne,addFill:xne,addLine:wne,alertLine:Sne,alignBottom:Ene,alignCenter:Cne,alignJustify:Mne,alignLeft:Tne,alignRight:One,alignTop:_ne,alignVertically:Ane,appsLine:Rne,arrowDownSFill:Pne,arrowGoBackFill:Nne,arrowGoForwardFill:zne,arrowLeftSFill:Lne,arrowRightSFill:Ine,arrowUpSFill:Dne,asterisk:$ne,attachment2:Hne,bold:Bne,bracesLine:Fne,bringForward:Vne,bringToFront:jne,chatNewLine:Une,checkboxCircleLine:Wne,checkboxMultipleLine:Kne,clipboardFill:qne,clipboardLine:Gne,closeCircleLine:Yne,closeFill:Jne,closeLine:Xne,codeLine:Qne,codeView:Zne,deleteBinFill:eoe,deleteBinLine:toe,deleteColumn:roe,deleteRow:noe,doubleQuotesL:ooe,doubleQuotesR:ioe,download2Fill:soe,dragDropLine:aoe,emphasis:coe,emphasisCn:loe,englishInput:uoe,errorWarningLine:doe,externalLinkFill:foe,fileCopyLine:poe,flowChart:hoe,fontColor:moe,fontSize:voe,fontSize2:goe,formatClear:yoe,fullscreenExitLine:boe,fullscreenLine:koe,functions:xoe,galleryUploadLine:woe,h1:Soe,h2:Eoe,h3:Coe,h4:Moe,h5:Toe,h6:Ooe,hashtag:_oe,heading:Aoe,imageAddLine:Roe,imageEditLine:Poe,imageLine:Noe,indentDecrease:zoe,indentIncrease:Loe,informationLine:Ioe,inputCursorMove:Doe,insertColumnLeft:$oe,insertColumnRight:Hoe,insertRowBottom:Boe,insertRowTop:Foe,italic:Voe,layoutColumnLine:joe,lineHeight:Uoe,link:Goe,linkM:Woe,linkUnlink:qoe,linkUnlinkM:Koe,listCheck:Joe,listCheck2:Yoe,listOrdered:Xoe,listUnordered:Qoe,markPenLine:Zoe,markdownFill:eie,markdownLine:tie,mergeCellsHorizontal:rie,mergeCellsVertical:nie,mindMap:oie,moreFill:iie,nodeTree:sie,number0:aie,number1:lie,number2:cie,number3:uie,number4:die,number5:fie,number6:pie,number7:hie,number8:mie,number9:gie,omega:vie,organizationChart:yie,pageSeparator:bie,paragraph:kie,pencilFill:xie,pencilLine:wie,pinyinInput:Sie,questionMark:Eie,roundedCorner:Cie,scissorsFill:Mie,sendBackward:Tie,sendToBack:Oie,separator:_ie,singleQuotesL:Aie,singleQuotesR:Rie,sortAsc:Pie,sortDesc:Nie,space:zie,spamLine:Lie,splitCellsHorizontal:Iie,splitCellsVertical:Die,strikethrough:Hie,strikethrough2:$ie,subscript:Fie,subscript2:Bie,subtractLine:Vie,superscript:Uie,superscript2:jie,table2:Wie,tableLine:Kie,text:Xie,textDirectionL:qie,textDirectionR:Gie,textSpacing:Yie,textWrap:Jie,translate:Zie,translate2:Qie,underline:ese,upload2Fill:tse,videoLine:rse,wubiInput:nse},Symbol.toStringTag,{value:"Module"}));var oo,ise=(e=document)=>oo||(oo=e.createElement("div"),oo.setAttribute("id","a11y-status-message"),oo.setAttribute("role","status"),oo.setAttribute("aria-live","polite"),oo.setAttribute("aria-relevant","additions text"),Object.assign(oo.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.append(oo),oo);cS(500,()=>{ise().textContent=""});function j4(e){return typeof e=="object"&&e!=null&&e.nodeType===1}function U4(e,t){return(!t||e!=="hidden")&&e!=="visible"&&e!=="clip"}function Gg(e,t){if(e.clientHeightt||i>e&&s=t&&a>=r?i-e-n:s>t&&ar?s-t+o:0}var sse=function(e,t){var r=window,n=t.scrollMode,o=t.block,i=t.inline,s=t.boundary,a=t.skipOverflowHiddenElements,l=typeof s=="function"?s:function(Ie){return Ie!==s};if(!j4(e))throw new TypeError("Invalid target");for(var c,u,d=document.scrollingElement||document.documentElement,f=[],p=e;j4(p)&&l(p);){if((p=(u=(c=p).parentElement)==null?c.getRootNode().host||null:u)===d){f.push(p);break}p!=null&&p===document.body&&Gg(p)&&!Gg(document.documentElement)||p!=null&&Gg(p,a)&&f.push(p)}for(var h=r.visualViewport?r.visualViewport.width:innerWidth,m=r.visualViewport?r.visualViewport.height:innerHeight,b=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,g=e.getBoundingClientRect(),y=g.height,k=g.width,x=g.top,w=g.right,E=g.bottom,M=g.left,C=o==="start"||o==="nearest"?x:o==="end"?E:x+y/2,T=i==="center"?M+k/2:i==="end"?w:M,R=[],B=0;B=0&&M>=0&&E<=m&&w<=h&&x>=K&&E<=N&&M>=H&&w<=_)return R;var G=getComputedStyle(I),J=parseInt(G.borderLeftWidth,10),_e=parseInt(G.borderTopWidth,10),oe=parseInt(G.borderRightWidth,10),ue=parseInt(G.borderBottomWidth,10),de=0,he=0,Me="offsetWidth"in I?I.offsetWidth-I.clientWidth-J-oe:0,Se="offsetHeight"in I?I.offsetHeight-I.clientHeight-_e-ue:0,ct="offsetWidth"in I?I.offsetWidth===0?0:z/I.offsetWidth:0,et="offsetHeight"in I?I.offsetHeight===0?0:V/I.offsetHeight:0;if(d===I)de=o==="start"?C:o==="end"?C-m:o==="nearest"?pf(v,v+m,m,_e,ue,v+C,v+C+y,y):C-m/2,he=i==="start"?T:i==="center"?T-h/2:i==="end"?T-h:pf(b,b+h,h,J,oe,b+T,b+T+k,k),de=Math.max(0,de+v),he=Math.max(0,he+b);else{de=o==="start"?C-K-_e:o==="end"?C-N+ue+Se:o==="nearest"?pf(K,N,V,_e,ue+Se,C,C+y,y):C-(K+V/2)+Se/2,he=i==="start"?T-H-J:i==="center"?T-(H+z/2)+Me/2:i==="end"?T-_+oe+Me:pf(H,_,z,J,oe+Me,T,T+k,k);var Er=I.scrollLeft,pe=I.scrollTop;C+=pe-(de=Math.max(0,Math.min(pe+de/et,I.scrollHeight-V/et+Se))),T+=Er-(he=Math.max(0,Math.min(Er+he/ct,I.scrollWidth-z/ct+Me)))}R.push({el:I,top:de,left:he})}return R};typeof hr=="object"&&hr.__esModule&&hr.default&&hr.default;tv(sse);var ase=typeof document<"u"?S.useLayoutEffect:S.useEffect;function lse(e){const t=S.useRef();return ase(()=>{t.current=e}),t.current}function cse(e,t){const[r,n]=S.useState([]),[o,i]=S.useState(()=>T1(e)),[s,a]=S.useState([]),l=S.useRef(e),c=lse(o);return l.current=e,ib(Cl,({addCustomHandler:u})=>{const d=T1(l.current),f=u("positioner",d);return i(d),f},t),S.useLayoutEffect(()=>{const u=o.addListener("update",f=>{const p=[];for(const{id:h,data:m,setElement:b}of f){const v=g=>{g&&b(g)};p.push({id:h,data:m,ref:v})}a(p)}),d=o.addListener("done",f=>{n(f)});return c!=null&&c.recentUpdate&&o.onActiveChanged(c==null?void 0:c.recentUpdate),()=>{u(),d()}},[o,c]),S.useMemo(()=>{const u=[];for(const[d,{ref:f,data:p,id:h}]of s.entries()){const m=r[d],{element:b,position:v={}}=m??{},g={...Lv,...pS(v)};u.push({ref:f,element:b,data:p,key:h,...g})}return u},[s,r])}function use(e,t){const r=t==null||t1(t)?[e]:t,n=t1(t)?t:!0,o=S.useRef(gl()),s=cse(e,r)[0];return S.useMemo(()=>s&&n?{...s,active:!0}:{...Lv,ref:void 0,data:{},active:!1,key:o.current},[n,s])}function Yg(e,t){return Ne(e)?e(t):e}function dse(e){return ne(e[0])}function fse(e,t){var r;return ne(e)?e:at(e)?dse(e)?e[0]??"":((r=e.find(n=>hS(n.attrs,t))??e[0])==null?void 0:r.shortcut)??"":e.shortcut}var pse={title:e=>v_(e),upper:e=>e.toLocaleUpperCase(),lower:e=>e.toLocaleLowerCase()};function hse(e,t){const{casing:r="title",namedAsSymbol:n=!1,modifierAsSymbol:o=!0,separator:i=" ",t:s}=t,a=N6(e),l=[],c=pse[r];for(const u of a){if(u.type==="char"){l.push(c(u.key));continue}if(u.type==="named"){const f=n===!0||at(n)&&vr(n,u.key)?u.symbol??s(u.i18n):s(u.i18n);l.push(c(f));continue}const d=o===!0||at(o)&&vr(o,u.key)?u.symbol:s(u.i18n);l.push(c(d))}return l.join(i)}var KT=({commandName:e,active:t,enabled:r,attrs:n})=>{const{t:o}=eY(),{getCommandOptions:i}=Kh(),s=i(e),{description:a,label:l,icon:c,shortcut:u}=s||{},d=S.useMemo(()=>({active:t,attrs:n,enabled:r,t:o}),[t,n,r,o]),f=S.useMemo(()=>{if(u)return hse(fse(u,n??{}),{t:o,separator:""})},[u,n,o]);return S.useMemo(()=>({description:Yg(a,d),label:Yg(l,d),icon:Yg(c,d),shortcut:f}),[d,a,l,c,f])},mse={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},qT=S.createContext(mse);qT.Provider;function GT(e){return e.map((t,r)=>S.createElement(t.tag,{key:r,...t.attr},GT(t.child??[])))}var Am=e=>{const{name:t}=e;return L.createElement(gse,{...e},GT(ose[t]))},gse=e=>{const t=r=>{const n=e.size??r.size??"1em";let o;r.className&&(o=r.className),e.className&&(o=(o?`${o} `:"")+e.className);const{title:i,...s}=e;return L.createElement("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",...r.attr,...s,className:o,style:{color:e.color??r.color,...r.style,...e.style},height:n,width:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},i&&L.createElement("title",null,i),e.children)};return L.createElement(qT.Consumer,null,t)},vse=e=>ss(e)?!!e.name:!1,yse=({icon:e})=>ne(e)?L.createElement(Am,{name:e,size:"1rem"}):e,bse=({icon:e,children:t})=>{if(!vse(e))return L.createElement(L.Fragment,null,t);const{sub:r,sup:n}=e,o=r??n,i=r!==void 0;return o===void 0?L.createElement(L.Fragment,null,t):L.createElement(Kte,{anchorOrigin:{vertical:i?"bottom":"top",horizontal:"right"},badgeContent:o,sx:{"& > .MuiBadge-badge":{bgcolor:"background.paper",color:"text.secondary",minWidth:12,height:12,margin:"2px 0",padding:"1px"}}},t)},wt=({commandName:e,active:t=!1,enabled:r,attrs:n,onSelect:o,onChange:i,icon:s,displayShortcut:a=!0,"aria-label":l,label:c,...u})=>{const d=S.useCallback((g,y)=>{o(),i==null||i(g,y)},[o,i]),f=S.useCallback(g=>{g.preventDefault()},[]),p=KT({commandName:e,active:t,enabled:r,attrs:n});let h=null;p.icon&&(h=ne(p.icon)?p.icon:p.icon.name);const m=l??p.label??"",b=c??m,v=a&&p.shortcut?` (${p.shortcut})`:"";return L.createElement(WT,{title:`${b}${v}`},L.createElement(FT,{component:"span",sx:{"&:not(:first-of-type)":{marginLeft:"-1px"}}},L.createElement(bne,{"aria-label":m,selected:t,disabled:!r,onMouseDown:f,color:"primary",size:"small",sx:{padding:"6px 12px","&.Mui-selected":{backgroundColor:"primary.main",color:"primary.contrastText"},"&.Mui-selected:hover":{backgroundColor:"primary.dark",color:"primary.contrastText"},"&:not(:first-of-type)":{borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:last-of-type)":{borderTopRightRadius:0,borderBottomRightRadius:0}},...u,value:e,onChange:d},L.createElement(bse,{icon:p.icon},L.createElement(yse,{icon:s??h})))))},kse=({icon:e})=>ne(e)?L.createElement(Am,{name:e,size:"1rem"}):e,xse=({label:e,"aria-label":t,icon:r,children:n,onClose:o,...i})=>{const s=S.useRef(gl()),[a,l]=S.useState(null),c=!!a,u=S.useCallback(p=>{p.preventDefault()},[]),d=S.useCallback(p=>{l(p.currentTarget)},[]),f=S.useCallback((p,h)=>{l(null),o==null||o(p,h)},[o]);return L.createElement(L.Fragment,null,L.createElement(WT,{title:e??t},L.createElement(NZ,{"aria-label":t,"aria-controls":c?s.current:void 0,"aria-haspopup":!0,"aria-expanded":c?"true":void 0,onMouseDown:u,onClick:d,size:"small",sx:p=>({border:`1px solid ${p.palette.divider}`,borderRadius:`${p.shape.borderRadius}px`,padding:"6px 12px","&:not(:first-of-type)":{marginLeft:"-1px",borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:last-of-type)":{borderTopRightRadius:0,borderBottomRightRadius:0}})},r&&L.createElement(kse,{icon:r}),L.createElement(Am,{name:"arrowDownSFill",size:"1rem"}))),L.createElement(Yre,{...i,id:s.current,anchorEl:a,open:c,onClose:f},n))},wse=e=>{const{insertHorizontalRule:t}=Vr();j3();const r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=t.enabled();return L.createElement(wt,{...e,commandName:"insertHorizontalRule",enabled:n,onSelect:r})},Sse=e=>{const{redo:t}=Vr(),{redoDepth:r}=Kh(!0),n=S.useCallback(()=>{t.enabled()&&t()},[t]),o=r()>0;return L.createElement(wt,{...e,commandName:"redo",active:!1,enabled:o,onSelect:n})},Ese=e=>{const{toggleBlockquote:t}=Vr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=Nn().blockquote(),o=t.enabled();return L.createElement(wt,{...e,commandName:"toggleBlockquote",active:n,enabled:o,onSelect:r})},j0=e=>{const{toggleBold:t}=Vr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=Nn().bold(),o=t.enabled();return L.createElement(wt,{...e,commandName:"toggleBold",active:n,enabled:o,onSelect:r})},Cse=e=>{const{toggleBulletList:t}=Vr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=Nn().bulletList(),o=t.enabled();return L.createElement(wt,{...e,commandName:"toggleBulletList",active:n,enabled:o,onSelect:r})},Mse=({attrs:e={},...t})=>{const{toggleCodeBlock:r}=Vr(),n=S.useCallback(()=>{r.enabled(e)&&r(e)},[r,e]),o=Nn().codeBlock(),i=r.enabled(e);return L.createElement(wt,{...t,commandName:"toggleCodeBlock",active:o,enabled:i,attrs:e,onSelect:n})},U0=e=>{const{toggleCode:t}=Vr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=Nn().code(),o=t.enabled();return L.createElement(wt,{...e,commandName:"toggleCode",active:n,enabled:o,onSelect:r})},Jg=({attrs:e,...t})=>{const{toggleHeading:r}=Vr(),n=S.useCallback(()=>{r.enabled(e)&&r(e)},[r,e]),o=Nn().heading(e),i=r.enabled(e);return L.createElement(wt,{...t,commandName:"toggleHeading",active:o,enabled:i,attrs:e,onSelect:n})},W0=e=>{const{toggleItalic:t}=Vr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=Nn().italic(),o=t.enabled();return L.createElement(wt,{...e,commandName:"toggleItalic",active:n,enabled:o,onSelect:r})},Tse=e=>{const{toggleOrderedList:t}=Vr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=Nn().orderedList(),o=t.enabled();return L.createElement(wt,{...e,commandName:"toggleOrderedList",active:n,enabled:o,onSelect:r})},Ose=e=>{const{toggleStrike:t}=Vr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=Nn().strike(),o=t.enabled();return L.createElement(wt,{...e,commandName:"toggleStrike",active:n,enabled:o,onSelect:r})},K0=e=>{const{toggleUnderline:t}=Vr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=Nn().underline(),o=t.enabled();return L.createElement(wt,{...e,commandName:"toggleUnderline",active:n,enabled:o,onSelect:r})},_se=e=>{const{undo:t}=Vr(),{undoDepth:r}=Kh(!0),n=S.useCallback(()=>{t.enabled()&&t()},[t]),o=r()>0;return L.createElement(wt,{...e,commandName:"undo",active:!1,enabled:o,onSelect:n})},Wo=e=>L.createElement(FT,{sx:{display:"flex",alignItems:"center",width:"fit-content",bgcolor:"background.paper",color:"text.secondary"},...e}),Ase=({children:e})=>L.createElement(Wo,null,L.createElement(j0,null),L.createElement(W0,null),L.createElement(K0,null),L.createElement(Ose,null),L.createElement(U0,null),e),Rse=({icon:e})=>e?L.createElement(kre,null,ne(e)?L.createElement(Am,{name:e,size:"1rem"}):L.createElement(L.Fragment,null,e)):null,Pse=({commandName:e,active:t=!1,enabled:r,attrs:n,onSelect:o,onClick:i,icon:s,displayShortcut:a=!0,label:l,description:c,displayDescription:u=!0,...d})=>{const f=S.useCallback(g=>{o(),i==null||i(g)},[o,i]),p=S.useCallback(g=>{g.preventDefault()},[]),h=KT({commandName:e,active:t,enabled:r,attrs:n});let m=null;h.icon&&(m=ne(h.icon)?h.icon:h.icon.name);const b=l??h.label??"",v=u&&(c??h.description);return L.createElement(nne,{selected:t,disabled:!r,onMouseDown:p,...d,onClick:f},s!==null&&L.createElement(Rse,{icon:s??m}),L.createElement(Tre,{primary:b,secondary:v}),a&&h.shortcut&&L.createElement(Zc,{variant:"body2",color:"text.secondary",sx:{ml:2}},h.shortcut))},hf=({attrs:e,...t})=>{const{toggleHeading:r}=Vr(),n=S.useCallback(()=>{r.enabled(e)&&r(e)},[r,e]),o=Nn().heading(e),i=r.enabled(e);return L.createElement(Pse,{...t,commandName:"toggleHeading",active:o,enabled:i,attrs:e,onSelect:n})},Nse={level:1},zse={level:2},W4={level:3},Lse={level:4},Ise={level:5},Dse={level:6},$se=({showAll:e=!1,children:t})=>L.createElement(Wo,null,L.createElement(Jg,{attrs:Nse}),L.createElement(Jg,{attrs:zse}),e?L.createElement(xse,{"aria-label":"More heading options"},L.createElement(hf,{attrs:W4}),L.createElement(hf,{attrs:Lse}),L.createElement(hf,{attrs:Ise}),L.createElement(hf,{attrs:Dse})):L.createElement(Jg,{attrs:W4}),t),Hse=({children:e})=>L.createElement(Wo,null,L.createElement(_se,null),L.createElement(Sse,null),e);typeof hr=="object"&&hr.__esModule&&hr.default&&hr.default;var YT=S.createContext({});function Bse(e={}){const t=S.useContext(YT),r=S.useMemo(()=>vS(t,e.theme??{}),[t,e.theme]),n=S.useMemo(()=>aI(r).styles,[r]),o=_u(sI,e.className);return S.useMemo(()=>({style:n,className:o,theme:r}),[n,o,r])}var Fse=e=>{var t,r,n,o,i,s,a,l;const{children:c,as:u="div"}=e,{theme:d,style:f,className:p}=Bse({theme:e.theme??ms}),h=Cb({palette:{primary:{main:((t=d.color)==null?void 0:t.primary)??ms.color.primary,dark:((n=(r=d.color)==null?void 0:r.hover)==null?void 0:n.primary)??ms.color.hover.primary,contrastText:((o=d.color)==null?void 0:o.primaryText)??ms.color.primaryText},secondary:{main:((i=d.color)==null?void 0:i.secondary)??ms.color.secondary,dark:((a=(s=d.color)==null?void 0:s.hover)==null?void 0:a.secondary)??ms.color.hover.secondary,contrastText:((l=d.color)==null?void 0:l.secondaryText)??ms.color.secondaryText}}});return L.createElement(KQ,{theme:h},L.createElement(YT.Provider,{value:d},L.createElement(u,{style:f,className:p},c)))},JT=e=>L.createElement(ore,{direction:"row",spacing:1,sx:{backgroundColor:"background.paper",overflowX:"auto"},...e}),Vse=[{name:"offset",options:{offset:[0,8]}}],jse=({positioner:e="selection",children:t,...r})=>{const{ref:n,x:o,y:i,width:s,height:a,active:l}=use(()=>T1(e),[e]),[c,u]=S.useState(null),d=S.useMemo(()=>({position:"absolute",pointerEvents:"none",left:o,top:i,width:s,height:a}),[o,i,s,a]),f=S.useCallback(p=>{u(p),n==null||n(p)},[n]);return L.createElement(L.Fragment,null,L.createElement("div",{ref:f,style:d}),L.createElement($b,{placement:"top",modifiers:Vse,...r,open:l,anchorEl:c},L.createElement(JT,null,t?L.createElement(L.Fragment,null,t):L.createElement(Ase,null))))},Ct=tv(eh),Hb=yt` + /** + * Styles extracted from: packages/remirror__theme/src/components-theme.ts + */ + .remirror-editor-wrapper { + padding-top: var(--rmr-space-3); + } + + .remirror-button-active { + color: var(--rmr-color-primary-text) !important; + background-color: var(--rmr-color-primary) !important; + } + + .remirror-button { + display: inline-flex; + font-weight: 400; + align-items: center; + justify-content: center; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + padding: 0.375em 0.75em; + line-height: 1.5; + border-radius: var(--rmr-radius-border); + text-decoration: none; + border: 1px solid var(--rmr-color-border); + cursor: pointer; + white-space: nowrap; + color: var(--rmr-color-text); + background-color: var(--rmr-color-background); + transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, + border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; + font-size: 100%; + } + + .remirror-button[aria-disabled='true'] { + cursor: auto; + } + + .remirror-button:not([aria-disabled='true']):hover { + color: var(--rmr-color-hover-primary-text); + border-color: var(--rmr-color-hover-border); + background-color: var(--rmr-color-hover-primary); + } + + .remirror-button:not([aria-disabled='true']):active, + .remirror-button:not([aria-disabled='true'])[data-active], + .remirror-button:not([aria-disabled='true'])[aria-expanded='true'] { + color: var(--rmr-color-active-primary-text); + border-color: var(--rmr-color-active-border); + background-color: var(--rmr-color-active-primary); + } + + /* Ensure a perceivable button border for users with Windows High Contrast + mode enabled https://moderncss.dev/css-button-styling-guide/ */ + + @media screen and (-ms-high-contrast: active) { + .remirror-button { + border: 2px solid currentcolor; + } + } + + .remirror-composite { + align-items: center; + justify-content: center; + padding: 0.375em 0.75em; + font-size: 100%; + border: 0; + color: inherit; + background-color: inherit; + } + + .remirror-composite:not([aria-selected='true']) { + color: inherit; + background-color: inherit; + } + + [aria-activedescendant='*']:focus .remirror-composite[aria-selected='true'], + [aria-activedescendant='*']:focus ~ * .remirror-composite[aria-selected='true'] { + color: var(--rmr-color-text); + background-color: var(--rmr-color-background); + } + + .remirror-dialog { + position: fixed; + top: 28px; + left: 50%; + transform: translateX(-50%); + border-radius: var(--rmr-radius-border); + padding: 1em; + max-height: calc(100vh - 56px); + outline: 0; + border: 1px solid var(--rmr-color-border); + color: var(--rmr-color-text); + z-index: 999; + } + + .remirror-dialog:focus { + box-shadow: 0 0 0 0.2em var(--rmr-color-shadow-1); + } + + .remirror-dialog-backdrop { + background-color: var(--rmr-color-backdrop); + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 999; + } + + .remirror-form > *:not(:first-child) { + margin-top: 1rem; + } + + .remirror-form-message { + font-size: 0.8em; + margin-top: 0.5rem !important; + } + + .remirror-form-label { + display: block; + margin: 0 0 0.5rem 0 !important; + } + + input[type='checkbox'] + .remirror-form-label, + input[type='radio'] + .remirror-form-label { + display: inline-block; + margin: 0 0 0 0.5rem !important; + } + + .remirror-form-group { + display: block; + color: var(--rmr-color-text); + border: 1px solid var(--rmr-color-border); + border-radius: var(--rmr-radius-border); + padding: 0.5rem 1rem 1rem; + } + + .remirror-form-group > * { + display: block; + } + + .remirror-group { + display: flex; + } + + .remirror-group > :not(:first-child) { + margin-left: -1px; + } + + .remirror-group > :not(:first-child):not(:last-child):not(.first-child):not(.last-child) { + border-radius: 0; + } + + .remirror-group > :first-child:not(:last-child), + .remirror-group > .first-child { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + } + + .remirror-group > :last-child:not(:first-child), + .remirror-group > .last-child { + border-top-left-radius: 0; + border-bottom-left-radius: 0; + } + + .remirror-input { + display: block; + width: 100%; + border-radius: var(--rmr-radius-border); + padding: 0.5em 0.75em; + font-size: 100%; + border: 1px solid var(--rmr-hue-gray-2); + color: var(--rmr-hue-gray-5); + margin: 0 !important; + } + + .remirror-input:focus { + border-color: var(--rmr-hue-gray-3); + } + + .remirror-menu { + display: flex; + border-radius: 0; + } + + .remirror-menu-pane { + position: relative; + display: flex; + justify-content: center; + align-items: flex-start; + padding-top: var(--rmr-space-1); + padding-bottom: var(--rmr-space-1); + padding-right: var(--rmr-space-2); + } + + .remirror-menu-pane-active { + color: var(--rmr-color-primary-text); + background-color: var(--rmr-color-primary); + } + + .remirror-menu-dropdown-label { + padding: 0 var(--rmr-space-2); + } + + .remirror-menu-pane-icon { + position: absolute; + left: 8px; + width: 20px; + color: var(--rmr-hue-gray-7); + } + + button:hover .remirror-menu-pane-icon, + button:active .remirror-menu-pane-icon, + [aria-checked='true'] .remirror-menu-pane-icon { + color: var(--rmr-hue-gray-1); + } + + .remirror-menu-pane-label { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + padding-right: var(--rmr-space-3); + } + + .remirror-menu-pane-shortcut { + align-self: flex-end; + color: var(--rmr-hue-gray-6); + } + + button:hover .remirror-menu-pane-shortcut, + button:active .remirror-menu-pane-shortcut, + [aria-checked='true'] .remirror-menu-pane-shortcut { + color: var(--rmr-hue-gray-1); + } + + [role='menu'] > .remirror-menu-button-left { + left: var(--rmr-space-2); + } + + [role='menu'] > .remirror-menu-button-right { + right: var(--rmr-space-2); + } + + .remirror-menu-button-nested-left svg { + margin-right: var(--rmr-space-2); + } + + [role='menu'] > .remirror-menu-button-nested-right { + padding-right: 2em !important; + } + + .remirror-menu-button-nested-right svg { + margin-left: var(--rmr-space-2); + } + + .remirror-menu-button { + position: relative; + } + + .remirror-menu-button svg { + fill: currentColor; + width: 0.65em; + height: 0.65em; + } + + [role='menu'] > .remirror-menu-button svg { + position: absolute; + top: 50%; + transform: translateY(-50%); + } + + [role='menubar'] > .remirror-menu-button svg { + display: none; + } + + .remirror-menu-bar { + position: relative; + display: flex; + white-space: nowrap; + box-shadow: none !important; + } + + .remirror-menu-bar[aria-orientation='vertical'] { + padding: 0.25em 0; + } + + .remirror-menu-bar[aria-orientation='horizontal'] { + padding: 0; + } + + .remirror-flex-column { + flex-direction: column; + } + + .remirror-flex-row { + flex-direction: row; + } + + .remirror-menu-item { + line-height: 1.5; + text-align: left; + justify-content: flex-start; + border: 0; + border-radius: 0; + font-size: 100%; + background: transparent; + color: var(--rmr-color-foreground); + margin: 0; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: default; + text-decoration: none; + } + + .remirror-menu-item:focus, + .remirror-menu-item[aria-expanded='true'] { + background-color: var(--rmr-color-primary); + color: var(--rmr-color-primary-text); + box-shadow: none !important; + } + + .remirror-menu-item:active, + .remirror-menu-item[data-active] { + background-color: var(--rmr-color-active-primary) !important; + color: var(--rmr-color-active-primary-text) !important; + } + + .remirror-menu-item:disabled { + opacity: 0.5; + } + + .remirror-menu-item-row { + padding: 0 var(--rmr-space-2); + } + + .remirror-menu-item-column { + padding: 0 var(--rmr-space-4); + } + + .remirror-menu-item-checkbox { + position: relative; + outline: 0; + } + + .remirror-menu-item-checkbox[aria-checked='true']:before { + content: '✓'; + position: absolute; + top: 0; + left: 0.4em; + width: 1em; + height: 1em; + } + + .remirror-menu-item-radio { + position: relative; + outline: 0; + } + + .remirror-menu-item-radio[aria-checked='true']:before { + content: '•'; + position: absolute; + font-size: 1.4em; + top: -0.25em; + left: 0.35em; + width: 0.7142857143em; + height: 0.7142857143em; + } + + .remirror-menu-group { + display: inherit; + flex-direction: inherit; + } + + .remirror-floating-popover { + /* padding: var(--rmr-space-2); */ + padding: 0; + border: none; + max-height: calc(100vh - 56px); + } + + .remirror-popover [data-arrow] { + background-color: transparent; + } + + .remirror-popover [data-arrow] .stroke { + fill: var(--rmr-color-border); + } + + .remirror-popover [data-arrow] .fill { + fill: var(--rmr-color-background); + } + + .remirror-animated-popover { + transition: opacity 250ms ease-in-out, transform 250ms ease-in-out; + opacity: 0; + transform-origin: top center; + transform: translate3d(0, -20px, 0); + } + + [data-enter] .remirror-animated-popover { + opacity: 1; + transform: translate3d(0, 0, 0); + } + + .remirror-role { + box-sizing: border-box; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + font-family: var(--rmr-font-family-default); + color: var(--rmr-color-text); + background-color: var(--rmr-color-background); + /* border: 1px solid var(--rmr-color-border); */ + } + + .remirror-separator { + border: 1px solid var(--rmr-color-border); + border-width: 0 1px 0 0; + margin: 0 0.5em; + padding: 0; + width: 0; + height: auto; + } + + .remirror-separator[aria-orientation='horizontal'] { + border-width: 0 0 1px 0; + margin: 0.5em 0; + width: auto; + height: 0; + } + + .remirror-tab { + background-color: transparent; + border: 1px solid transparent; + border-width: 1px 1px 0 1px; + border-radius: var(--rmr-radius-border) var(--rmr-radius-border) 0 0; + font-size: 100%; + padding: 0.5em 1em; + margin: 0 0 -1px 0; + } + + .remirror-tab[aria-selected='true'] { + background-color: var(--rmr-color-background); + border-color: var(--rmr-color-border); + } + + [aria-orientation='vertical'] .remirror-tab { + border-width: 1px 0 1px 1px; + border-radius: 0.2em 0 0 0.2em; + margin: 0 -1px 0 0; + } + + .remirror-tab-list { + display: flex; + flex-direction: row; + border: 1px solid var(--rmr-color-border); + border-width: 0 0 1px 0; + margin: 0 0 1em 0; + } + + .remirror-tab-list[aria-orientation='vertical'] { + flex-direction: column; + border-width: 0 1px 0 0; + margin: 0 1em 0 0; + } + + .remirror-tabbable:not([type='checkbox']):not([type='radio']) { + /* transition: box-shadow 0.15s ease-in-out; */ + outline: 0; + } + + .remirror-tabbable:not([type='checkbox']):not([type='radio']):focus { + box-shadow: var(--rmr-color-outline) 0px 0px 0px 0.2em; + position: relative; + z-index: 2; + } + + .remirror-tabbable:not([type='checkbox']):not([type='radio']):hover { + z-index: 2; + } + + .remirror-tabbable[aria-disabled='true'] { + opacity: 0.5; + } + + .remirror-toolbar { + display: flex; + flex-direction: row; + + overflow-y: auto; + } + + .remirror-toolbar > *:not(:first-child) { + margin: 0 0 0 0.5em; + } + + .remirror-toolbar[aria-orientation='vertical'] { + display: inline-flex; + flex-direction: column; + } + + .remirror-toolbar[aria-orientation='vertical'] > *:not(:first-child) { + margin: 0.5em 0 0; + } + + .remirror-tooltip { + background-color: var(--rmr-color-faded); + color: white; + font-size: 0.8em; + padding: 0.5rem; + border-radius: var(--rmr-radius-border); + z-index: 999; + } + + .remirror-tooltip [data-arrow] { + background-color: transparent; + } + + .remirror-tooltip [data-arrow] .stroke { + fill: transparent; + } + + .remirror-tooltip [data-arrow] .fill { + fill: var(--rmr-hue-gray-8); + } + + .remirror-table-size-editor { + background: var(--rmr-color-background); + box-shadow: var(--rmr-color-shadow-1); + font-family: var(--rmr-font-family-default); + font-size: var(--rmr-font-size-1); + } + + .remirror-table-size-editor-body { + position: relative; + } + + .remirror-table-size-editor-body::after { + background: rgba(0, 0, 0, 0); + bottom: -50px; + content: ''; + left: 0; + position: absolute; + right: -50px; + top: -50px; + } + + .remirror-table-size-editor-cell { + border: var(--rmr-color-border); + position: absolute; + z-index: 2; + } + + .remirror-table-size-editor-cell-selected { + background: var(--rmr-color-table-selected-border); + border-color: var(--rmr-color-border); + } + + .remirror-table-size-editor-footer { + padding-bottom: var(--rmr-space-1); + text-align: center; + } + + .remirror-color-picker { + background: var(--rmr-color-background); + box-shadow: var(--rmr-box-shadow-1); + font-family: var(--rmr-font-family-default); + font-size: var(--rmr-font-size-1); + padding: var(--rmr-space-2) var(--rmr-space-3); + } + + .remirror-color-picker-cell { + } + + .remirror-color-picker-cell-selected { + } +`;Ct.div` + ${Hb} +`;var Bb=yt` + /** + * Styles extracted from: packages/remirror__theme/src/core-theme.ts + */ + .remirror-editor.ProseMirror { + word-wrap: break-word; + white-space: pre-wrap; + white-space: break-spaces; + position: relative; + font-variant-ligatures: none; + font-feature-settings: 'liga' 0; + overflow-y: scroll; + } + + .remirror-editor.ProseMirror pre { + white-space: pre-wrap; + } + + .remirror-editor.ProseMirror li { + position: relative; + } + + .remirror-editor.ProseMirror hr { + border-color: #2e2e2e; + } + + /* Protect against generic img rules. See also https://github.com/ProseMirror/prosemirror-view/commit/aaa50d592074c8063fc2ef77907ab6d0373822fb */ + + .remirror-editor.ProseMirror img.ProseMirror-separator { + display: inline !important; + border: none !important; + margin: 0 !important; + } + .remirror-editor.ProseMirror-hideselection *::-moz-selection { + background: transparent; + color: inherit; + } + .remirror-editor.ProseMirror-hideselection *::selection { + background: transparent; + color: inherit; + } + .remirror-editor.ProseMirror-hideselection *::-moz-selection { + background: transparent; + color: inherit; + } + .remirror-editor.ProseMirror-hideselection { + caret-color: transparent; + } + .remirror-editor .ProseMirror-selectednode { + outline: 2px solid #8cf; + } + /* Make sure li selections wrap around markers */ + .remirror-editor li.ProseMirror-selectednode { + outline: none; + } + .remirror-editor li.ProseMirror-selectednode:after { + content: ''; + position: absolute; + left: -32px; + right: -2px; + top: -2px; + bottom: -2px; + border: 2px solid #8cf; + pointer-events: none; + } +`;Ct.div` + ${Bb} +`;var Fb=yt` + /** + * Styles extracted from: packages/remirror__theme/src/extension-blockquote-theme.ts + */ + .remirror-editor.ProseMirror blockquote { + border-left: 3px solid var(--rmr-hue-gray-3); + margin-left: 0; + margin-right: 0; + padding-left: 10px; + font-style: italic; + } + .remirror-editor.ProseMirror blockquote p { + color: #888; + } +`;Ct.div` + ${Fb} +`;var Vb=yt` + /** + * Styles extracted from: packages/remirror__theme/src/extension-callout-theme.ts + */ + .remirror-editor div[data-callout-type] { + display: flex; + margin-left: 0; + margin-right: 0; + padding: 10px; + border-left: 2px solid transparent; + } + + .remirror-editor div[data-callout-type] > :not(.remirror-callout-emoji-wrapper) { + margin-left: 8px; + flex-grow: 1; + } + .remirror-editor div[data-callout-type='info'] { + background: #eef6fc; + border-left-color: #3298dc; + } + .remirror-editor div[data-callout-type='warning'] { + background: #fffbeb; + border-left-color: #ffdd57; + } + .remirror-editor div[data-callout-type='error'] { + background: #feecf0; + border-left-color: #f14668; + } + .remirror-editor div[data-callout-type='success'] { + background: #effaf3; + border-left-color: #48c774; + } + .remirror-editor div[data-callout-type='blank'] { + background: #f8f8f8; + } +`;Ct.div` + ${Vb} +`;var jb=yt` + /** + * Styles extracted from: packages/remirror__theme/src/extension-code-block-theme.ts + */ + .remirror-wrap { + white-space: pre-wrap !important; + } + + .remirror-language-select-positioner { + position: absolute; + top: var(--y); + left: var(--x); + } + + .remirror-language-select-width { + width: var(--w); + } + + .remirror-a11y-dark code[class*='language-'], + .remirror-a11y-dark pre[class*='language-'] { + color: #f8f8f2; + background: none; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + -moz-tab-size: 4; + tab-size: 4; + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; + } + + /* Code blocks */ + + .remirror-a11y-dark pre[class*='language-'] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; + border-radius: 0.3em; + } + + .remirror-a11y-dark :has(.remirror-language-select-positioner) ~ pre[class*='language-'] { + padding: 2em 1em; + } + + .remirror-a11y-dark :not(pre) > code[class*='language-'], + .remirror-a11y-dark pre[class*='language-'] { + background: #2b2b2b; + } + + /* Inline code */ + + .remirror-a11y-dark :not(pre) > code[class*='language-'] { + padding: 0.1em; + border-radius: 0.3em; + white-space: normal; + } + + .remirror-a11y-dark .token.comment, + .remirror-a11y-dark .token.prolog, + .remirror-a11y-dark .token.doctype, + .remirror-a11y-dark .token.cdata { + color: #d4d0ab; + } + + .remirror-a11y-dark .token.punctuation, + .remirror-a11y-dark .token.punctuation.important { + color: #fefefe; + } + + .remirror-a11y-dark .token.property, + .remirror-a11y-dark .token.tag, + .remirror-a11y-dark .token.constant, + .remirror-a11y-dark .token.symbol, + .remirror-a11y-dark .token.deleted { + color: #ffa07a; + } + + .remirror-a11y-dark .token.boolean, + .remirror-a11y-dark .token.number { + color: #00e0e0; + } + + .remirror-a11y-dark .token.selector, + .remirror-a11y-dark .token.attr-name, + .remirror-a11y-dark .token.string, + .remirror-a11y-dark .token.char, + .remirror-a11y-dark .token.builtin, + .remirror-a11y-dark .token.inserted { + color: #abe338; + } + + .remirror-a11y-dark .token.operator, + .remirror-a11y-dark .token.entity, + .remirror-a11y-dark .token.url, + .remirror-a11y-dark .language-css .token.string, + .remirror-a11y-dark .style .token.string, + .remirror-a11y-dark .token.variable { + color: #00e0e0; + } + + .remirror-a11y-dark .token.atrule, + .remirror-a11y-dark .token.attr-value, + .remirror-a11y-dark .token.function { + color: #ffd700; + } + + .remirror-a11y-dark .token.keyword { + color: #00e0e0; + } + + .remirror-a11y-dark .token.regex, + .remirror-a11y-dark .token.important { + color: #ffd700; + } + + .remirror-a11y-dark .token.important, + .remirror-a11y-dark .token.bold { + font-weight: bold; + } + + .remirror-a11y-dark .token.italic { + font-style: italic; + } + + .remirror-a11y-dark .token.entity { + cursor: help; + } + + @media screen and (-ms-high-contrast: active) { + .remirror-a11y-dark code[class*='language-'], + .remirror-a11y-dark pre[class*='language-'] { + color: windowText; + background: window; + } + .remirror-a11y-dark :not(pre) > code[class*='language-'], + .remirror-a11y-dark pre[class*='language-'] { + background: window; + } + .remirror-a11y-dark .token.important { + background: highlight; + color: window; + font-weight: normal; + } + .remirror-a11y-dark .token.atrule, + .remirror-a11y-dark .token.attr-value, + .remirror-a11y-dark .token.function, + .remirror-a11y-dark .token.keyword, + .remirror-a11y-dark .token.operator, + .remirror-a11y-dark .token.selector { + font-weight: bold; + } + .remirror-a11y-dark .token.attr-value, + .remirror-a11y-dark .token.comment, + .remirror-a11y-dark .token.doctype, + .remirror-a11y-dark .token.function, + .remirror-a11y-dark .token.keyword, + .remirror-a11y-dark .token.operator, + .remirror-a11y-dark .token.property, + .remirror-a11y-dark .token.string { + color: highlight; + } + .remirror-a11y-dark .token.attr-value, + .remirror-a11y-dark .token.url { + font-weight: normal; + } + } + + .remirror-atom-dark code[class*='language-'], + .remirror-atom-dark pre[class*='language-'] { + color: #c5c8c6; + text-shadow: 0 1px rgba(0, 0, 0, 0.3); + font-family: Inconsolata, Monaco, Consolas, 'Courier New', Courier, monospace; + direction: ltr; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + line-height: 1.5; + -moz-tab-size: 4; + tab-size: 4; + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; + } + + /* Code blocks */ + + .remirror-atom-dark pre[class*='language-'] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; + border-radius: 0.3em; + } + + .remirror-atom-dark :has(.remirror-language-select-positioner) ~ pre[class*='language-'] { + padding: 2em 1em; + } + + .remirror-atom-dark :not(pre) > code[class*='language-'], + .remirror-atom-dark pre[class*='language-'] { + background: #1d1f21; + } + + /* Inline code */ + + .remirror-atom-dark :not(pre) > code[class*='language-'] { + padding: 0.1em; + border-radius: 0.3em; + } + + .remirror-atom-dark .token.comment, + .remirror-atom-dark .token.prolog, + .remirror-atom-dark .token.doctype, + .remirror-atom-dark .token.cdata { + color: #7c7c7c; + } + + .remirror-atom-dark .token.punctuation, + .remirror-atom-dark .token.punctuation.important { + color: #c5c8c6; + } + + .remirror-atom-dark .namespace { + opacity: 0.7; + } + + .remirror-atom-dark .token.property, + .remirror-atom-dark .token.keyword, + .remirror-atom-dark .token.tag { + color: #96cbfe; + } + + .remirror-atom-dark .token.class-name { + color: #ffffb6; + text-decoration: underline; + } + + .remirror-atom-dark .token.boolean, + .remirror-atom-dark .token.constant { + color: #99cc99; + } + + .remirror-atom-dark .token.symbol, + .remirror-atom-dark .token.deleted { + color: #f92672; + } + + .remirror-atom-dark .token.number { + color: #ff73fd; + } + + .remirror-atom-dark .token.selector, + .remirror-atom-dark .token.attr-name, + .remirror-atom-dark .token.string, + .remirror-atom-dark .token.char, + .remirror-atom-dark .token.builtin, + .remirror-atom-dark .token.inserted { + color: #a8ff60; + } + + .remirror-atom-dark .token.variable { + color: #c6c5fe; + } + + .remirror-atom-dark .token.operator { + color: #ededed; + } + + .remirror-atom-dark .token.entity { + color: #ffffb6; + /* text-decoration: underline; */ + } + + .remirror-atom-dark .token.url { + color: #96cbfe; + } + + .remirror-atom-dark .language-css .token.string, + .remirror-atom-dark .style .token.string { + color: #87c38a; + } + + .remirror-atom-dark .token.atrule, + .remirror-atom-dark .token.attr-value { + color: #f9ee98; + } + + .remirror-atom-dark .token.function { + color: #dad085; + } + + .remirror-atom-dark .token.regex { + color: #e9c062; + } + + .remirror-atom-dark .token.important { + color: #fd971f; + } + + .remirror-atom-dark .token.important, + .remirror-atom-dark .token.bold { + font-weight: bold; + } + + .remirror-atom-dark .token.italic { + font-style: italic; + } + + .remirror-atom-dark .token.entity { + cursor: help; + } + + .remirror-base16-ateliersulphurpool-light code[class*='language-'], + .remirror-base16-ateliersulphurpool-light pre[class*='language-'] { + font-family: Consolas, Menlo, Monaco, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', + 'Lucida Sans Typewriter', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Liberation Mono', + 'Nimbus Mono L', 'Courier New', Courier, monospace; + font-size: 14px; + line-height: 1.375; + direction: ltr; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + -moz-tab-size: 4; + tab-size: 4; + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; + background: #f5f7ff; + color: #5e6687; + } + + .remirror-base16-ateliersulphurpool-light pre[class*='language-']::-moz-selection, + .remirror-base16-ateliersulphurpool-light pre[class*='language-'] ::-moz-selection, + .remirror-base16-ateliersulphurpool-light code[class*='language-']::-moz-selection, + .remirror-base16-ateliersulphurpool-light code[class*='language-'] ::-moz-selection { + text-shadow: none; + background: #dfe2f1; + } + + .remirror-base16-ateliersulphurpool-light pre[class*='language-']::-moz-selection, + .remirror-base16-ateliersulphurpool-light pre[class*='language-'] ::-moz-selection, + .remirror-base16-ateliersulphurpool-light code[class*='language-']::-moz-selection, + .remirror-base16-ateliersulphurpool-light code[class*='language-'] ::-moz-selection { + text-shadow: none; + background: #dfe2f1; + } + + .remirror-base16-ateliersulphurpool-light pre[class*='language-']::selection, + .remirror-base16-ateliersulphurpool-light pre[class*='language-'] ::selection, + .remirror-base16-ateliersulphurpool-light code[class*='language-']::selection, + .remirror-base16-ateliersulphurpool-light code[class*='language-'] ::selection { + text-shadow: none; + background: #dfe2f1; + } + + /* Code blocks */ + + .remirror-base16-ateliersulphurpool-light pre[class*='language-'] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; + } + + .remirror-base16-ateliersulphurpool-light + :has(.remirror-language-select-positioner) + ~ pre[class*='language-'] { + padding: 2em 1em; + } + + /* Inline code */ + + .remirror-base16-ateliersulphurpool-light :not(pre) > code[class*='language-'] { + padding: 0.1em; + border-radius: 0.3em; + } + + .remirror-base16-ateliersulphurpool-light .token.comment, + .remirror-base16-ateliersulphurpool-light .token.prolog, + .remirror-base16-ateliersulphurpool-light .token.doctype, + .remirror-base16-ateliersulphurpool-light .token.cdata { + color: #898ea4; + } + + .remirror-base16-ateliersulphurpool-light .token.punctuation, + .remirror-base16-ateliersulphurpool-light .token.punctuation.important { + color: #5e6687; + } + + .remirror-base16-ateliersulphurpool-light .token.namespace { + opacity: 0.7; + } + + .remirror-base16-ateliersulphurpool-light .token.operator, + .remirror-base16-ateliersulphurpool-light .token.boolean, + .remirror-base16-ateliersulphurpool-light .token.number { + color: #c76b29; + } + + .remirror-base16-ateliersulphurpool-light .token.property { + color: #c08b30; + } + + .remirror-base16-ateliersulphurpool-light .token.tag { + color: #3d8fd1; + } + + .remirror-base16-ateliersulphurpool-light .token.string { + color: #22a2c9; + } + + .remirror-base16-ateliersulphurpool-light .token.selector { + color: #6679cc; + } + + .remirror-base16-ateliersulphurpool-light .token.attr-name { + color: #c76b29; + } + + .remirror-base16-ateliersulphurpool-light .token.entity, + .remirror-base16-ateliersulphurpool-light .token.url, + .remirror-base16-ateliersulphurpool-light .language-css .token.string, + .remirror-base16-ateliersulphurpool-light .style .token.string { + color: #22a2c9; + } + + .remirror-base16-ateliersulphurpool-light .token.attr-value, + .remirror-base16-ateliersulphurpool-light .token.keyword, + .remirror-base16-ateliersulphurpool-light .token.control, + .remirror-base16-ateliersulphurpool-light .token.directive, + .remirror-base16-ateliersulphurpool-light .token.unit { + color: #ac9739; + } + + .remirror-base16-ateliersulphurpool-light .token.statement, + .remirror-base16-ateliersulphurpool-light .token.regex, + .remirror-base16-ateliersulphurpool-light .token.atrule { + color: #22a2c9; + } + + .remirror-base16-ateliersulphurpool-light .token.placeholder, + .remirror-base16-ateliersulphurpool-light .token.variable { + color: #3d8fd1; + } + + .remirror-base16-ateliersulphurpool-light .token.deleted { + text-decoration: line-through; + } + + .remirror-base16-ateliersulphurpool-light .token.inserted { + border-bottom: 1px dotted #202746; + text-decoration: none; + } + + .remirror-base16-ateliersulphurpool-light .token.italic { + font-style: italic; + } + + .remirror-base16-ateliersulphurpool-light .token.important, + .remirror-base16-ateliersulphurpool-light .token.bold { + font-weight: bold; + } + + .remirror-base16-ateliersulphurpool-light .token.important { + color: #c94922; + } + + .remirror-base16-ateliersulphurpool-light .token.entity { + cursor: help; + } + + .remirror-base16-ateliersulphurpool-light pre > code.highlight { + outline: 0.4em solid #c94922; + outline-offset: 0.4em; + } + + /* overrides color-values for the Line Numbers plugin + * http://prismjs.com/plugins/line-numbers/ + */ + + .remirror-base16-ateliersulphurpool-light .line-numbers .line-numbers-rows { + border-right-color: #dfe2f1; + } + + .remirror-base16-ateliersulphurpool-light .line-numbers-rows > span:before { + color: #979db4; + } + + /* overrides color-values for the Line Highlight plugin + * http://prismjs.com/plugins/line-highlight/ + */ + + .remirror-base16-ateliersulphurpool-light .line-highlight { + background: rgba(107, 115, 148, 0.2); + background: linear-gradient(to right, rgba(107, 115, 148, 0.2) 70%, rgba(107, 115, 148, 0)); + } + + .remirror-cb code[class*='language-'], + .remirror-cb pre[class*='language-'] { + color: #fff; + text-shadow: 0 1px 1px #000; + font-family: Menlo, Monaco, 'Courier New', monospace; + direction: ltr; + text-align: left; + word-spacing: normal; + white-space: pre; + word-wrap: normal; + line-height: 1.4; + background: none; + border: 0; + + -moz-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; + } + + .remirror-cb pre[class*='language-'] code { + float: left; + padding: 0 15px 0 0; + } + + .remirror-cb pre[class*='language-'], + .remirror-cb :not(pre) > code[class*='language-'] { + background: #222; + } + + /* Code blocks */ + + .remirror-cb pre[class*='language-'] { + padding: 15px; + margin: 1em 0; + overflow: auto; + border-radius: 8px; + } + + .remirror-cb :has(.remirror-language-select-positioner) ~ pre[class*='language-'] { + padding: 2em 1em; + } + + /* Inline code */ + + .remirror-cb :not(pre) > code[class*='language-'] { + padding: 5px 10px; + line-height: 1; + border-radius: 3px; + } + + .remirror-cb .token.comment, + .remirror-cb .token.prolog, + .remirror-cb .token.doctype, + .remirror-cb .token.cdata { + color: #797979; + } + + .remirror-cb .token.selector, + .remirror-cb .token.operator, + .remirror-cb .token.punctuation, + .remirror-cb .token.punctuation.important { + color: #fff; + } + + .remirror-cb .token.namespace { + opacity: 0.7; + } + + .remirror-cb .token.tag, + .remirror-cb .token.boolean { + color: #ffd893; + } + + .remirror-cb .token.atrule, + .remirror-cb .token.attr-value, + .remirror-cb .token.hex, + .remirror-cb .token.string { + color: #b0c975; + } + + .remirror-cb .token.property, + .remirror-cb .token.entity, + .remirror-cb .token.url, + .remirror-cb .token.attr-name, + .remirror-cb .token.keyword { + color: #c27628; + } + + .remirror-cb .token.regex { + color: #9b71c6; + } + + .remirror-cb .token.entity { + cursor: help; + } + + .remirror-cb .token.function, + .remirror-cb .token.constant { + color: #e5a638; + } + + .remirror-cb .token.variable { + color: #fdfba8; + } + + .remirror-cb .token.number { + color: #8799b0; + } + + .remirror-cb .token.important, + .remirror-cb .token.deliminator { + color: #e45734; + } + + /* Line highlight plugin */ + + .remirror-cb pre[data-line] { + position: relative; + padding: 1em 0 1em 3em; + } + + .remirror-cb .line-highlight { + position: absolute; + left: 0; + right: 0; + margin-top: 1em; /* Same as .prism's padding-top */ + background: rgba(255, 255, 255, 0.2); + pointer-events: none; + line-height: inherit; + white-space: pre; + } + + .remirror-cb .line-highlight:before, + .remirror-cb .line-highlight[data-end]:after { + content: attr(data-start); + position: absolute; + top: 0.3em; + left: 0.6em; + min-width: 1em; + padding: 0 0.5em; + background-color: rgba(255, 255, 255, 0.3); + color: #fff; + font: bold 65%/1.5 sans-serif; + text-align: center; + border-radius: 8px; + text-shadow: none; + } + + .remirror-cb .line-highlight[data-end]:after { + content: attr(data-end); + top: auto; + bottom: 0.4em; + } + + /* for line numbers */ + + .remirror-cb .line-numbers-rows { + margin: 0; + } + + .remirror-cb .line-numbers-rows span { + padding-right: 10px; + border-right: 3px #d9d336 solid; + } + + .remirror-darcula code[class*='language-'], + .remirror-darcula pre[class*='language-'] { + color: #a9b7c6; + font-family: Consolas, Monaco, 'Andale Mono', monospace; + direction: ltr; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + line-height: 1.5; + + -moz-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; + } + + .remirror-darcula pre[class*='language-']::-moz-selection, + .remirror-darcula pre[class*='language-'] ::-moz-selection, + .remirror-darcula code[class*='language-']::-moz-selection, + .remirror-darcula code[class*='language-'] ::-moz-selection { + color: inherit; + background: rgba(33, 66, 131, 0.85); + } + + .remirror-darcula pre[class*='language-']::-moz-selection, + .remirror-darcula pre[class*='language-'] ::-moz-selection, + .remirror-darcula code[class*='language-']::-moz-selection, + .remirror-darcula code[class*='language-'] ::-moz-selection { + color: inherit; + background: rgba(33, 66, 131, 0.85); + } + + .remirror-darcula pre[class*='language-']::selection, + .remirror-darcula pre[class*='language-'] ::selection, + .remirror-darcula code[class*='language-']::selection, + .remirror-darcula code[class*='language-'] ::selection { + color: inherit; + background: rgba(33, 66, 131, 0.85); + } + + /* Code blocks */ + + .remirror-darcula pre[class*='language-'] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; + } + + .remirror-darcula :has(.remirror-language-select-positioner) ~ pre[class*='language-'] { + padding: 2em 1em; + } + + .remirror-darcula :not(pre) > code[class*='language-'], + .remirror-darcula pre[class*='language-'] { + background: #2b2b2b; + } + + /* Inline code */ + + .remirror-darcula :not(pre) > code[class*='language-'] { + padding: 0.1em; + border-radius: 0.3em; + } + + .remirror-darcula .token.comment, + .remirror-darcula .token.prolog, + .remirror-darcula .token.cdata { + color: #808080; + } + + .remirror-darcula .token.delimiter, + .remirror-darcula .token.boolean, + .remirror-darcula .token.keyword, + .remirror-darcula .token.selector, + .remirror-darcula .token.important, + .remirror-darcula .token.atrule { + color: #cc7832; + } + + .remirror-darcula .token.operator, + .remirror-darcula .token.punctuation, + .remirror-darcula .token.attr-name { + color: #a9b7c6; + } + + .remirror-darcula .token.tag, + .remirror-darcula .token.tag .punctuation, + .remirror-darcula .token.doctype, + .remirror-darcula .token.builtin { + color: #e8bf6a; + } + + .remirror-darcula .token.entity, + .remirror-darcula .token.number, + .remirror-darcula .token.symbol { + color: #6897bb; + } + + .remirror-darcula .token.property, + .remirror-darcula .token.constant, + .remirror-darcula .token.variable { + color: #9876aa; + } + + .remirror-darcula .token.string, + .remirror-darcula .token.char { + color: #6a8759; + } + + .remirror-darcula .token.attr-value, + .remirror-darcula .token.attr-value .punctuation { + color: #a5c261; + } + + .remirror-darcula .token.attr-value .punctuation:first-of-type { + color: #a9b7c6; + } + + .remirror-darcula .token.url { + color: #287bde; + text-decoration: underline; + } + + .remirror-darcula .token.function { + color: #ffc66d; + } + + .remirror-darcula .token.regex { + background: #364135; + } + + .remirror-darcula .token.bold { + font-weight: bold; + } + + .remirror-darcula .token.italic { + font-style: italic; + } + + .remirror-darcula .token.inserted { + background: #294436; + } + + .remirror-darcula .token.deleted { + background: #484a4a; + } + + /*code.language-css .token.punctuation, .token.punctuation.important {color: + #cc7832; +}*/ + + .remirror-darcula code.language-css .token.property, + .remirror-darcula code.language-css .token.property + .token.punctuation, + .remirror-darcula .token.punctuation.important { + color: #a9b7c6; + } + + .remirror-darcula code.language-css .token.id { + color: #ffc66d; + } + + .remirror-darcula code.language-css .token.selector > .token.class, + .remirror-darcula code.language-css .token.selector > .token.attribute, + .remirror-darcula code.language-css .token.selector > .token.pseudo-class, + .remirror-darcula code.language-css .token.selector > .token.pseudo-element { + color: #ffc66d; + } + + .remirror-dracula code[class*='language-'], + .remirror-dracula pre[class*='language-'] { + color: #f8f8f2; + background: none; + text-shadow: 0 1px rgba(0, 0, 0, 0.3); + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + -moz-tab-size: 4; + tab-size: 4; + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; + } + + /* Code blocks */ + + .remirror-dracula pre[class*='language-'] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; + border-radius: 0.3em; + } + + .remirror-dracula :has(.remirror-language-select-positioner) ~ pre[class*='language-'] { + padding: 2em 1em; + } + + .remirror-dracula :not(pre) > code[class*='language-'], + .remirror-dracula pre[class*='language-'] { + background: #282a36; + } + + /* Inline code */ + + .remirror-dracula :not(pre) > code[class*='language-'] { + padding: 0.1em; + border-radius: 0.3em; + white-space: normal; + } + + .remirror-dracula .token.comment, + .remirror-dracula .token.prolog, + .remirror-dracula .token.doctype, + .remirror-dracula .token.cdata { + color: #6272a4; + } + + .remirror-dracula .token.punctuation, + .remirror-dracula .token.punctuation.important { + color: #f8f8f2; + } + + .remirror-dracula .namespace { + opacity: 0.7; + } + + .remirror-dracula .token.property, + .remirror-dracula .token.tag, + .remirror-dracula .token.constant, + .remirror-dracula .token.symbol, + .remirror-dracula .token.deleted { + color: #ff79c6; + } + + .remirror-dracula .token.boolean, + .remirror-dracula .token.number { + color: #bd93f9; + } + + .remirror-dracula .token.selector, + .remirror-dracula .token.attr-name, + .remirror-dracula .token.string, + .remirror-dracula .token.char, + .remirror-dracula .token.builtin, + .remirror-dracula .token.inserted { + color: #50fa7b; + } + + .remirror-dracula .token.operator, + .remirror-dracula .token.entity, + .remirror-dracula .token.url, + .remirror-dracula .language-css .token.string, + .remirror-dracula .style .token.string, + .remirror-dracula .token.variable { + color: #f8f8f2; + } + + .remirror-dracula .token.atrule, + .remirror-dracula .token.attr-value, + .remirror-dracula .token.function, + .remirror-dracula .token.class-name { + color: #f1fa8c; + } + + .remirror-dracula .token.keyword { + color: #8be9fd; + } + + .remirror-dracula .token.regex, + .remirror-dracula .token.important { + color: #ffb86c; + } + + .remirror-dracula .token.important, + .remirror-dracula .token.bold { + font-weight: bold; + } + + .remirror-dracula .token.italic { + font-style: italic; + } + + .remirror-dracula .token.entity { + cursor: help; + } + + .remirror-duotone-dark code[class*='language-'], + .remirror-duotone-dark pre[class*='language-'] { + font-family: Consolas, Menlo, Monaco, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', + 'Lucida Sans Typewriter', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Liberation Mono', + 'Nimbus Mono L', 'Courier New', Courier, monospace; + font-size: 14px; + line-height: 1.375; + direction: ltr; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + + -moz-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; + background: #2a2734; + color: #9a86fd; + } + + .remirror-duotone-dark pre[class*='language-']::-moz-selection, + .remirror-duotone-dark pre[class*='language-'] ::-moz-selection, + .remirror-duotone-dark code[class*='language-']::-moz-selection, + .remirror-duotone-dark code[class*='language-'] ::-moz-selection { + text-shadow: none; + background: #6a51e6; + } + + .remirror-duotone-dark pre[class*='language-']::-moz-selection, + .remirror-duotone-dark pre[class*='language-'] ::-moz-selection, + .remirror-duotone-dark code[class*='language-']::-moz-selection, + .remirror-duotone-dark code[class*='language-'] ::-moz-selection { + text-shadow: none; + background: #6a51e6; + } + + .remirror-duotone-dark pre[class*='language-']::selection, + .remirror-duotone-dark pre[class*='language-'] ::selection, + .remirror-duotone-dark code[class*='language-']::selection, + .remirror-duotone-dark code[class*='language-'] ::selection { + text-shadow: none; + background: #6a51e6; + } + + /* Code blocks */ + + .remirror-duotone-dark pre[class*='language-'] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; + } + + .remirror-duotone-dark :has(.remirror-language-select-positioner) ~ pre[class*='language-'] { + padding: 2em 1em; + } + + /* Inline code */ + + .remirror-duotone-dark :not(pre) > code[class*='language-'] { + padding: 0.1em; + border-radius: 0.3em; + } + + .remirror-duotone-dark .token.comment, + .remirror-duotone-dark .token.prolog, + .remirror-duotone-dark .token.doctype, + .remirror-duotone-dark .token.cdata { + color: #6c6783; + } + + .remirror-duotone-dark .token.punctuation, + .remirror-duotone-dark .token.punctuation.important { + color: #6c6783; + } + + .remirror-duotone-dark .token.namespace { + opacity: 0.7; + } + + .remirror-duotone-dark .token.tag, + .remirror-duotone-dark .token.operator, + .remirror-duotone-dark .token.number { + color: #e09142; + } + + .remirror-duotone-dark .token.property, + .remirror-duotone-dark .token.function { + color: #9a86fd; + } + + .remirror-duotone-dark .token.tag-id, + .remirror-duotone-dark .token.selector, + .remirror-duotone-dark .token.atrule-id { + color: #eeebff; + } + + .remirror-duotone-dark code.language-javascript, + .remirror-duotone-dark .token.attr-name { + color: #c4b9fe; + } + + .remirror-duotone-dark code.language-css, + .remirror-duotone-dark code.language-scss, + .remirror-duotone-dark .token.boolean, + .remirror-duotone-dark .token.string, + .remirror-duotone-dark .token.entity, + .remirror-duotone-dark .token.url, + .remirror-duotone-dark .language-css .token.string, + .remirror-duotone-dark .language-scss .token.string, + .remirror-duotone-dark .style .token.string, + .remirror-duotone-dark .token.attr-value, + .remirror-duotone-dark .token.keyword, + .remirror-duotone-dark .token.control, + .remirror-duotone-dark .token.directive, + .remirror-duotone-dark .token.unit, + .remirror-duotone-dark .token.statement, + .remirror-duotone-dark .token.regex, + .remirror-duotone-dark .token.atrule { + color: #ffcc99; + } + + .remirror-duotone-dark .token.placeholder, + .remirror-duotone-dark .token.variable { + color: #ffcc99; + } + + .remirror-duotone-dark .token.deleted { + text-decoration: line-through; + } + + .remirror-duotone-dark .token.inserted { + border-bottom: 1px dotted #eeebff; + text-decoration: none; + } + + .remirror-duotone-dark .token.italic { + font-style: italic; + } + + .remirror-duotone-dark .token.important, + .remirror-duotone-dark .token.bold { + font-weight: bold; + } + + .remirror-duotone-dark .token.important { + color: #c4b9fe; + } + + .remirror-duotone-dark .token.entity { + cursor: help; + } + + .remirror-duotone-dark pre > code.highlight { + outline: 0.4em solid #8a75f5; + outline-offset: 0.4em; + } + + /* overrides color-values for the Line Numbers plugin + * http://prismjs.com/plugins/line-numbers/ + */ + + .remirror-duotone-dark .line-numbers .line-numbers-rows { + border-right-color: #2c2937; + } + + .remirror-duotone-dark .line-numbers-rows > span:before { + color: #3c3949; + } + + /* overrides color-values for the Line Highlight plugin +* http://prismjs.com/plugins/line-highlight/ +*/ + + .remirror-duotone-dark .line-highlight { + background: rgba(224, 145, 66, 0.2); + background: linear-gradient(to right, rgba(224, 145, 66, 0.2) 70%, rgba(224, 145, 66, 0)); + } + + .remirror-duotone-earth code[class*='language-'], + .remirror-duotone-earth pre[class*='language-'] { + font-family: Consolas, Menlo, Monaco, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', + 'Lucida Sans Typewriter', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Liberation Mono', + 'Nimbus Mono L', 'Courier New', Courier, monospace; + font-size: 14px; + line-height: 1.375; + direction: ltr; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + + -moz-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; + background: #322d29; + color: #88786d; + } + + .remirror-duotone-earth pre[class*='language-']::-moz-selection, + .remirror-duotone-earth pre[class*='language-'] ::-moz-selection, + .remirror-duotone-earth code[class*='language-']::-moz-selection, + .remirror-duotone-earth code[class*='language-'] ::-moz-selection { + text-shadow: none; + background: #6f5849; + } + + .remirror-duotone-earth pre[class*='language-']::-moz-selection, + .remirror-duotone-earth pre[class*='language-'] ::-moz-selection, + .remirror-duotone-earth code[class*='language-']::-moz-selection, + .remirror-duotone-earth code[class*='language-'] ::-moz-selection { + text-shadow: none; + background: #6f5849; + } + + .remirror-duotone-earth pre[class*='language-']::selection, + .remirror-duotone-earth pre[class*='language-'] ::selection, + .remirror-duotone-earth code[class*='language-']::selection, + .remirror-duotone-earth code[class*='language-'] ::selection { + text-shadow: none; + background: #6f5849; + } + + /* Code blocks */ + + .remirror-duotone-earth pre[class*='language-'] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; + } + + .remirror-duotone-earth :has(.remirror-language-select-positioner) ~ pre[class*='language-'] { + padding: 2em 1em; + } + + /* Inline code */ + + .remirror-duotone-earth :not(pre) > code[class*='language-'] { + padding: 0.1em; + border-radius: 0.3em; + } + + .remirror-duotone-earth .token.comment, + .remirror-duotone-earth .token.prolog, + .remirror-duotone-earth .token.doctype, + .remirror-duotone-earth .token.cdata { + color: #6a5f58; + } + + .remirror-duotone-earth .token.punctuation, + .remirror-duotone-earth .token.punctuation.important { + color: #6a5f58; + } + + .remirror-duotone-earth .token.namespace { + opacity: 0.7; + } + + .remirror-duotone-earth .token.tag, + .remirror-duotone-earth .token.operator, + .remirror-duotone-earth .token.number { + color: #bfa05a; + } + + .remirror-duotone-earth .token.property, + .remirror-duotone-earth .token.function { + color: #88786d; + } + + .remirror-duotone-earth .token.tag-id, + .remirror-duotone-earth .token.selector, + .remirror-duotone-earth .token.atrule-id { + color: #fff3eb; + } + + .remirror-duotone-earth code.language-javascript, + .remirror-duotone-earth .token.attr-name { + color: #a48774; + } + + .remirror-duotone-earth code.language-css, + .remirror-duotone-earth code.language-scss, + .remirror-duotone-earth .token.boolean, + .remirror-duotone-earth .token.string, + .remirror-duotone-earth .token.entity, + .remirror-duotone-earth .token.url, + .remirror-duotone-earth .language-css .token.string, + .remirror-duotone-earth .language-scss .token.string, + .remirror-duotone-earth .style .token.string, + .remirror-duotone-earth .token.attr-value, + .remirror-duotone-earth .token.keyword, + .remirror-duotone-earth .token.control, + .remirror-duotone-earth .token.directive, + .remirror-duotone-earth .token.unit, + .remirror-duotone-earth .token.statement, + .remirror-duotone-earth .token.regex, + .remirror-duotone-earth .token.atrule { + color: #fcc440; + } + + .remirror-duotone-earth .token.placeholder, + .remirror-duotone-earth .token.variable { + color: #fcc440; + } + + .remirror-duotone-earth .token.deleted { + text-decoration: line-through; + } + + .remirror-duotone-earth .token.inserted { + border-bottom: 1px dotted #fff3eb; + text-decoration: none; + } + + .remirror-duotone-earth .token.italic { + font-style: italic; + } + + .remirror-duotone-earth .token.important, + .remirror-duotone-earth .token.bold { + font-weight: bold; + } + + .remirror-duotone-earth .token.important { + color: #a48774; + } + + .remirror-duotone-earth .token.entity { + cursor: help; + } + + .remirror-duotone-earth pre > code.highlight { + outline: 0.4em solid #816d5f; + outline-offset: 0.4em; + } + + /* overrides color-values for the Line Numbers plugin + * http://prismjs.com/plugins/line-numbers/ + */ + + .remirror-duotone-earth .line-numbers .line-numbers-rows { + border-right-color: #35302b; + } + + .remirror-duotone-earth .line-numbers-rows > span:before { + color: #46403d; + } + + /* overrides color-values for the Line Highlight plugin +* http://prismjs.com/plugins/line-highlight/ +*/ + + .remirror-duotone-earth .line-highlight { + background: rgba(191, 160, 90, 0.2); + background: linear-gradient(to right, rgba(191, 160, 90, 0.2) 70%, rgba(191, 160, 90, 0)); + } + + .remirror-duotone-forest code[class*='language-'], + .remirror-duotone-forest pre[class*='language-'] { + font-family: Consolas, Menlo, Monaco, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', + 'Lucida Sans Typewriter', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Liberation Mono', + 'Nimbus Mono L', 'Courier New', Courier, monospace; + font-size: 14px; + line-height: 1.375; + direction: ltr; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + + -moz-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; + background: #2a2d2a; + color: #687d68; + } + + .remirror-duotone-forest pre[class*='language-']::-moz-selection, + .remirror-duotone-forest pre[class*='language-'] ::-moz-selection, + .remirror-duotone-forest code[class*='language-']::-moz-selection, + .remirror-duotone-forest code[class*='language-'] ::-moz-selection { + text-shadow: none; + background: #435643; + } + + .remirror-duotone-forest pre[class*='language-']::-moz-selection, + .remirror-duotone-forest pre[class*='language-'] ::-moz-selection, + .remirror-duotone-forest code[class*='language-']::-moz-selection, + .remirror-duotone-forest code[class*='language-'] ::-moz-selection { + text-shadow: none; + background: #435643; + } + + .remirror-duotone-forest pre[class*='language-']::selection, + .remirror-duotone-forest pre[class*='language-'] ::selection, + .remirror-duotone-forest code[class*='language-']::selection, + .remirror-duotone-forest code[class*='language-'] ::selection { + text-shadow: none; + background: #435643; + } + + /* Code blocks */ + + .remirror-duotone-forest pre[class*='language-'] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; + } + + .remirror-duotone-forest :has(.remirror-language-select-positioner) ~ pre[class*='language-'] { + padding: 2em 1em; + } + + /* Inline code */ + + .remirror-duotone-forest :not(pre) > code[class*='language-'] { + padding: 0.1em; + border-radius: 0.3em; + } + + .remirror-duotone-forest .token.comment, + .remirror-duotone-forest .token.prolog, + .remirror-duotone-forest .token.doctype, + .remirror-duotone-forest .token.cdata { + color: #535f53; + } + + .remirror-duotone-forest .token.punctuation, + .remirror-duotone-forest .token.punctuation.important { + color: #535f53; + } + + .remirror-duotone-forest .token.namespace { + opacity: 0.7; + } + + .remirror-duotone-forest .token.tag, + .remirror-duotone-forest .token.operator, + .remirror-duotone-forest .token.number { + color: #a2b34d; + } + + .remirror-duotone-forest .token.property, + .remirror-duotone-forest .token.function { + color: #687d68; + } + + .remirror-duotone-forest .token.tag-id, + .remirror-duotone-forest .token.selector, + .remirror-duotone-forest .token.atrule-id { + color: #f0fff0; + } + + .remirror-duotone-forest code.language-javascript, + .remirror-duotone-forest .token.attr-name { + color: #b3d6b3; + } + + .remirror-duotone-forest code.language-css, + .remirror-duotone-forest code.language-scss, + .remirror-duotone-forest .token.boolean, + .remirror-duotone-forest .token.string, + .remirror-duotone-forest .token.entity, + .remirror-duotone-forest .token.url, + .remirror-duotone-forest .language-css .token.string, + .remirror-duotone-forest .language-scss .token.string, + .remirror-duotone-forest .style .token.string, + .remirror-duotone-forest .token.attr-value, + .remirror-duotone-forest .token.keyword, + .remirror-duotone-forest .token.control, + .remirror-duotone-forest .token.directive, + .remirror-duotone-forest .token.unit, + .remirror-duotone-forest .token.statement, + .remirror-duotone-forest .token.regex, + .remirror-duotone-forest .token.atrule { + color: #e5fb79; + } + + .remirror-duotone-forest .token.placeholder, + .remirror-duotone-forest .token.variable { + color: #e5fb79; + } + + .remirror-duotone-forest .token.deleted { + text-decoration: line-through; + } + + .remirror-duotone-forest .token.inserted { + border-bottom: 1px dotted #f0fff0; + text-decoration: none; + } + + .remirror-duotone-forest .token.italic { + font-style: italic; + } + + .remirror-duotone-forest .token.important, + .remirror-duotone-forest .token.bold { + font-weight: bold; + } + + .remirror-duotone-forest .token.important { + color: #b3d6b3; + } + + .remirror-duotone-forest .token.entity { + cursor: help; + } + + .remirror-duotone-forest pre > code.highlight { + outline: 0.4em solid #5c705c; + outline-offset: 0.4em; + } + + /* overrides color-values for the Line Numbers plugin + * http://prismjs.com/plugins/line-numbers/ + */ + + .remirror-duotone-forest .line-numbers .line-numbers-rows { + border-right-color: #2c302c; + } + + .remirror-duotone-forest .line-numbers-rows > span:before { + color: #3b423b; + } + + /* overrides color-values for the Line Highlight plugin +* http://prismjs.com/plugins/line-highlight/ +*/ + + .remirror-duotone-forest .line-highlight { + background: rgba(162, 179, 77, 0.2); + background: linear-gradient(to right, rgba(162, 179, 77, 0.2) 70%, rgba(162, 179, 77, 0)); + } + + .remirror-duotone-light code[class*='language-'], + .remirror-duotone-light pre[class*='language-'] { + font-family: Consolas, Menlo, Monaco, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', + 'Lucida Sans Typewriter', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Liberation Mono', + 'Nimbus Mono L', 'Courier New', Courier, monospace; + font-size: 14px; + line-height: 1.375; + direction: ltr; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + + -moz-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; + background: #faf8f5; + color: #728fcb; + } + + .remirror-duotone-light pre[class*='language-']::-moz-selection, + .remirror-duotone-light pre[class*='language-'] ::-moz-selection, + .remirror-duotone-light code[class*='language-']::-moz-selection, + .remirror-duotone-light code[class*='language-'] ::-moz-selection { + text-shadow: none; + background: #faf8f5; + } + + .remirror-duotone-light pre[class*='language-']::-moz-selection, + .remirror-duotone-light pre[class*='language-'] ::-moz-selection, + .remirror-duotone-light code[class*='language-']::-moz-selection, + .remirror-duotone-light code[class*='language-'] ::-moz-selection { + text-shadow: none; + background: #faf8f5; + } + + .remirror-duotone-light pre[class*='language-']::selection, + .remirror-duotone-light pre[class*='language-'] ::selection, + .remirror-duotone-light code[class*='language-']::selection, + .remirror-duotone-light code[class*='language-'] ::selection { + text-shadow: none; + background: #faf8f5; + } + + /* Code blocks */ + + .remirror-duotone-light pre[class*='language-'] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; + } + + .remirror-duotone-light :has(.remirror-language-select-positioner) ~ pre[class*='language-'] { + padding: 2em 1em; + } + + /* Inline code */ + + .remirror-duotone-light :not(pre) > code[class*='language-'] { + padding: 0.1em; + border-radius: 0.3em; + } + + .remirror-duotone-light .token.comment, + .remirror-duotone-light .token.prolog, + .remirror-duotone-light .token.doctype, + .remirror-duotone-light .token.cdata { + color: #b6ad9a; + } + + .remirror-duotone-light .token.punctuation, + .remirror-duotone-light .token.punctuation.important { + color: #b6ad9a; + } + + .remirror-duotone-light .token.namespace { + opacity: 0.7; + } + + .remirror-duotone-light .token.tag, + .remirror-duotone-light .token.operator, + .remirror-duotone-light .token.number { + color: #063289; + } + + .remirror-duotone-light .token.property, + .remirror-duotone-light .token.function { + color: #b29762; + } + + .remirror-duotone-light .token.tag-id, + .remirror-duotone-light .token.selector, + .remirror-duotone-light .token.atrule-id { + color: #2d2006; + } + + .remirror-duotone-light code.language-javascript, + .remirror-duotone-light .token.attr-name { + color: #896724; + } + + .remirror-duotone-light code.language-css, + .remirror-duotone-light code.language-scss, + .remirror-duotone-light .token.boolean, + .remirror-duotone-light .token.string, + .remirror-duotone-light .token.entity, + .remirror-duotone-light .token.url, + .remirror-duotone-light .language-css .token.string, + .remirror-duotone-light .language-scss .token.string, + .remirror-duotone-light .style .token.string, + .remirror-duotone-light .token.attr-value, + .remirror-duotone-light .token.keyword, + .remirror-duotone-light .token.control, + .remirror-duotone-light .token.directive, + .remirror-duotone-light .token.unit, + .remirror-duotone-light .token.statement, + .remirror-duotone-light .token.regex, + .remirror-duotone-light .token.atrule { + color: #728fcb; + } + + .remirror-duotone-light .token.placeholder, + .remirror-duotone-light .token.variable { + color: #93abdc; + } + + .remirror-duotone-light .token.deleted { + text-decoration: line-through; + } + + .remirror-duotone-light .token.inserted { + border-bottom: 1px dotted #2d2006; + text-decoration: none; + } + + .remirror-duotone-light .token.italic { + font-style: italic; + } + + .remirror-duotone-light .token.important, + .remirror-duotone-light .token.bold { + font-weight: bold; + } + + .remirror-duotone-light .token.important { + color: #896724; + } + + .remirror-duotone-light .token.entity { + cursor: help; + } + + .remirror-duotone-light pre > code.highlight { + outline: 0.4em solid #896724; + outline-offset: 0.4em; + } + + /* overrides color-values for the Line Numbers plugin + * http://prismjs.com/plugins/line-numbers/ + */ + + .remirror-duotone-light .line-numbers .line-numbers-rows { + border-right-color: #ece8de; + } + + .remirror-duotone-light .line-numbers-rows > span:before { + color: #cdc4b1; + } + + /* overrides color-values for the Line Highlight plugin + * http://prismjs.com/plugins/line-highlight/ + */ + + .remirror-duotone-light .line-highlight { + background: rgba(45, 32, 6, 0.2); + background: linear-gradient(to right, rgba(45, 32, 6, 0.2) 70%, rgba(45, 32, 6, 0)); + } + + .remirror-duotone-sea code[class*='language-'], + .remirror-duotone-sea pre[class*='language-'] { + font-family: Consolas, Menlo, Monaco, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', + 'Lucida Sans Typewriter', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Liberation Mono', + 'Nimbus Mono L', 'Courier New', Courier, monospace; + font-size: 14px; + line-height: 1.375; + direction: ltr; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + + -moz-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; + background: #1d262f; + color: #57718e; + } + + .remirror-duotone-sea pre[class*='language-']::-moz-selection, + .remirror-duotone-sea pre[class*='language-'] ::-moz-selection, + .remirror-duotone-sea code[class*='language-']::-moz-selection, + .remirror-duotone-sea code[class*='language-'] ::-moz-selection { + text-shadow: none; + background: #004a9e; + } + + .remirror-duotone-sea pre[class*='language-']::-moz-selection, + .remirror-duotone-sea pre[class*='language-'] ::-moz-selection, + .remirror-duotone-sea code[class*='language-']::-moz-selection, + .remirror-duotone-sea code[class*='language-'] ::-moz-selection { + text-shadow: none; + background: #004a9e; + } + + .remirror-duotone-sea pre[class*='language-']::selection, + .remirror-duotone-sea pre[class*='language-'] ::selection, + .remirror-duotone-sea code[class*='language-']::selection, + .remirror-duotone-sea code[class*='language-'] ::selection { + text-shadow: none; + background: #004a9e; + } + + /* Code blocks */ + + .remirror-duotone-sea pre[class*='language-'] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; + } + + .remirror-duotone-sea :has(.remirror-language-select-positioner) ~ pre[class*='language-'] { + padding: 2em 1em; + } + + /* Inline code */ + + .remirror-duotone-sea :not(pre) > code[class*='language-'] { + padding: 0.1em; + border-radius: 0.3em; + } + + .remirror-duotone-sea .token.comment, + .remirror-duotone-sea .token.prolog, + .remirror-duotone-sea .token.doctype, + .remirror-duotone-sea .token.cdata { + color: #4a5f78; + } + + .remirror-duotone-sea .token.punctuation, + .remirror-duotone-sea .token.punctuation.important { + color: #4a5f78; + } + + .remirror-duotone-sea .token.namespace { + opacity: 0.7; + } + + .remirror-duotone-sea .token.tag, + .remirror-duotone-sea .token.operator, + .remirror-duotone-sea .token.number { + color: #0aa370; + } + + .remirror-duotone-sea .token.property, + .remirror-duotone-sea .token.function { + color: #57718e; + } + + .remirror-duotone-sea .token.tag-id, + .remirror-duotone-sea .token.selector, + .remirror-duotone-sea .token.atrule-id { + color: #ebf4ff; + } + + .remirror-duotone-sea code.language-javascript, + .remirror-duotone-sea .token.attr-name { + color: #7eb6f6; + } + + .remirror-duotone-sea code.language-css, + .remirror-duotone-sea code.language-scss, + .remirror-duotone-sea .token.boolean, + .remirror-duotone-sea .token.string, + .remirror-duotone-sea .token.entity, + .remirror-duotone-sea .token.url, + .remirror-duotone-sea .language-css .token.string, + .remirror-duotone-sea .language-scss .token.string, + .remirror-duotone-sea .style .token.string, + .remirror-duotone-sea .token.attr-value, + .remirror-duotone-sea .token.keyword, + .remirror-duotone-sea .token.control, + .remirror-duotone-sea .token.directive, + .remirror-duotone-sea .token.unit, + .remirror-duotone-sea .token.statement, + .remirror-duotone-sea .token.regex, + .remirror-duotone-sea .token.atrule { + color: #47ebb4; + } + + .remirror-duotone-sea .token.placeholder, + .remirror-duotone-sea .token.variable { + color: #47ebb4; + } + + .remirror-duotone-sea .token.deleted { + text-decoration: line-through; + } + + .remirror-duotone-sea .token.inserted { + border-bottom: 1px dotted #ebf4ff; + text-decoration: none; + } + + .remirror-duotone-sea .token.italic { + font-style: italic; + } + + .remirror-duotone-sea .token.important, + .remirror-duotone-sea .token.bold { + font-weight: bold; + } + + .remirror-duotone-sea .token.important { + color: #7eb6f6; + } + + .remirror-duotone-sea .token.entity { + cursor: help; + } + + .remirror-duotone-sea pre > code.highlight { + outline: 0.4em solid #34659d; + outline-offset: 0.4em; + } + + /* overrides color-values for the Line Numbers plugin + * http://prismjs.com/plugins/line-numbers/ + */ + + .remirror-duotone-sea .line-numbers .line-numbers-rows { + border-right-color: #1f2932; + } + + .remirror-duotone-sea .line-numbers-rows > span:before { + color: #2c3847; + } + + /* overrides color-values for the Line Highlight plugin +* http://prismjs.com/plugins/line-highlight/ +*/ + + .remirror-duotone-sea .line-highlight { + background: rgba(10, 163, 112, 0.2); + background: linear-gradient(to right, rgba(10, 163, 112, 0.2) 70%, rgba(10, 163, 112, 0)); + } + + .remirror-duotone-space code[class*='language-'], + .remirror-duotone-space pre[class*='language-'] { + font-family: Consolas, Menlo, Monaco, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', + 'Lucida Sans Typewriter', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Liberation Mono', + 'Nimbus Mono L', 'Courier New', Courier, monospace; + font-size: 14px; + line-height: 1.375; + direction: ltr; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + + -moz-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; + background: #24242e; + color: #767693; + } + + .remirror-duotone-space pre[class*='language-']::-moz-selection, + .remirror-duotone-space pre[class*='language-'] ::-moz-selection, + .remirror-duotone-space code[class*='language-']::-moz-selection, + .remirror-duotone-space code[class*='language-'] ::-moz-selection { + text-shadow: none; + background: #5151e6; + } + + .remirror-duotone-space pre[class*='language-']::-moz-selection, + .remirror-duotone-space pre[class*='language-'] ::-moz-selection, + .remirror-duotone-space code[class*='language-']::-moz-selection, + .remirror-duotone-space code[class*='language-'] ::-moz-selection { + text-shadow: none; + background: #5151e6; + } + + .remirror-duotone-space pre[class*='language-']::selection, + .remirror-duotone-space pre[class*='language-'] ::selection, + .remirror-duotone-space code[class*='language-']::selection, + .remirror-duotone-space code[class*='language-'] ::selection { + text-shadow: none; + background: #5151e6; + } + + /* Code blocks */ + + .remirror-duotone-space pre[class*='language-'] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; + } + + .remirror-duotone-space :has(.remirror-language-select-positioner) ~ pre[class*='language-'] { + padding: 2em 1em; + } + + /* Inline code */ + + .remirror-duotone-space :not(pre) > code[class*='language-'] { + padding: 0.1em; + border-radius: 0.3em; + } + + .remirror-duotone-space .token.comment, + .remirror-duotone-space .token.prolog, + .remirror-duotone-space .token.doctype, + .remirror-duotone-space .token.cdata { + color: #5b5b76; + } + + .remirror-duotone-space .token.punctuation, + .remirror-duotone-space .token.punctuation.important { + color: #5b5b76; + } + + .remirror-duotone-space .token.namespace { + opacity: 0.7; + } + + .remirror-duotone-space .token.tag, + .remirror-duotone-space .token.operator, + .remirror-duotone-space .token.number { + color: #dd672c; + } + + .remirror-duotone-space .token.property, + .remirror-duotone-space .token.function { + color: #767693; + } + + .remirror-duotone-space .token.tag-id, + .remirror-duotone-space .token.selector, + .remirror-duotone-space .token.atrule-id { + color: #ebebff; + } + + .remirror-duotone-space code.language-javascript, + .remirror-duotone-space .token.attr-name { + color: #aaaaca; + } + + .remirror-duotone-space code.language-css, + .remirror-duotone-space code.language-scss, + .remirror-duotone-space .token.boolean, + .remirror-duotone-space .token.string, + .remirror-duotone-space .token.entity, + .remirror-duotone-space .token.url, + .remirror-duotone-space .language-css .token.string, + .remirror-duotone-space .language-scss .token.string, + .remirror-duotone-space .style .token.string, + .remirror-duotone-space .token.attr-value, + .remirror-duotone-space .token.keyword, + .remirror-duotone-space .token.control, + .remirror-duotone-space .token.directive, + .remirror-duotone-space .token.unit, + .remirror-duotone-space .token.statement, + .remirror-duotone-space .token.regex, + .remirror-duotone-space .token.atrule { + color: #fe8c52; + } + + .remirror-duotone-space .token.placeholder, + .remirror-duotone-space .token.variable { + color: #fe8c52; + } + + .remirror-duotone-space .token.deleted { + text-decoration: line-through; + } + + .remirror-duotone-space .token.inserted { + border-bottom: 1px dotted #ebebff; + text-decoration: none; + } + + .remirror-duotone-space .token.italic { + font-style: italic; + } + + .remirror-duotone-space .token.important, + .remirror-duotone-space .token.bold { + font-weight: bold; + } + + .remirror-duotone-space .token.important { + color: #aaaaca; + } + + .remirror-duotone-space .token.entity { + cursor: help; + } + + .remirror-duotone-space pre > code.highlight { + outline: 0.4em solid #7676f4; + outline-offset: 0.4em; + } + + /* overrides color-values for the Line Numbers plugin + * http://prismjs.com/plugins/line-numbers/ + */ + + .remirror-duotone-space .line-numbers .line-numbers-rows { + border-right-color: #262631; + } + + .remirror-duotone-space .line-numbers-rows > span:before { + color: #393949; + } + + /* overrides color-values for the Line Highlight plugin +* http://prismjs.com/plugins/line-highlight/ +*/ + + .remirror-duotone-space .line-highlight { + background: rgba(221, 103, 44, 0.2); + background: linear-gradient(to right, rgba(221, 103, 44, 0.2) 70%, rgba(221, 103, 44, 0)); + } + + .remirror-gh-colors code[class*='language-'], + .remirror-gh-colors pre[class*='language-'] { + color: #393a34; + font-family: 'Consolas', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + direction: ltr; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + font-size: 0.95em; + line-height: 1.2em; + + -moz-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; + } + + .remirror-gh-colors pre[class*='language-']::-moz-selection, + .remirror-gh-colors pre[class*='language-'] ::-moz-selection, + .remirror-gh-colors code[class*='language-']::-moz-selection, + .remirror-gh-colors code[class*='language-'] ::-moz-selection { + background: #b3d4fc; + } + + .remirror-gh-colors pre[class*='language-']::-moz-selection, + .remirror-gh-colors pre[class*='language-'] ::-moz-selection, + .remirror-gh-colors code[class*='language-']::-moz-selection, + .remirror-gh-colors code[class*='language-'] ::-moz-selection { + background: #b3d4fc; + } + + .remirror-gh-colors pre[class*='language-']::selection, + .remirror-gh-colors pre[class*='language-'] ::selection, + .remirror-gh-colors code[class*='language-']::selection, + .remirror-gh-colors code[class*='language-'] ::selection { + background: #b3d4fc; + } + + /* Code blocks */ + + .remirror-gh-colors pre[class*='language-'] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; + border: 1px solid #dddddd; + background-color: white; + } + + .remirror-gh-colors :has(.remirror-language-select-positioner) ~ pre[class*='language-'] { + padding: 2em 1em; + } + + .remirror-gh-colors :not(pre) > code[class*='language-'], + .remirror-gh-colors pre[class*='language-'] { + } + + /* Inline code */ + + .remirror-gh-colors :not(pre) > code[class*='language-'] { + padding: 0.2em; + padding-top: 1px; + padding-bottom: 1px; + background: #f8f8f8; + border: 1px solid #dddddd; + } + + .remirror-gh-colors .token.comment, + .remirror-gh-colors .token.prolog, + .remirror-gh-colors .token.doctype, + .remirror-gh-colors .token.cdata { + color: #999988; + font-style: italic; + } + + .remirror-gh-colors .token.namespace { + opacity: 0.7; + } + + .remirror-gh-colors .token.string, + .remirror-gh-colors .token.attr-value { + color: #e3116c; + } + + .remirror-gh-colors .token.punctuation, + .remirror-gh-colors .token.operator { + color: #393a34; /* no highlight */ + } + + .remirror-gh-colors .token.entity, + .remirror-gh-colors .token.url, + .remirror-gh-colors .token.symbol, + .remirror-gh-colors .token.number, + .remirror-gh-colors .token.boolean, + .remirror-gh-colors .token.variable, + .remirror-gh-colors .token.constant, + .remirror-gh-colors .token.property, + .remirror-gh-colors .token.regex, + .remirror-gh-colors .token.inserted { + color: #36acaa; + } + + .remirror-gh-colors .token.atrule, + .remirror-gh-colors .token.keyword, + .remirror-gh-colors .token.attr-name, + .remirror-gh-colors .language-autohotkey .token.selector { + color: #00a4db; + } + + .remirror-gh-colors .token.function, + .remirror-gh-colors .token.deleted, + .remirror-gh-colors .language-autohotkey .token.tag { + color: #9a050f; + } + + .remirror-gh-colors .token.tag, + .remirror-gh-colors .token.selector, + .remirror-gh-colors .language-autohotkey .token.keyword { + color: #00009f; + } + + .remirror-gh-colors .token.important, + .remirror-gh-colors .token.function, + .remirror-gh-colors .token.bold { + font-weight: bold; + } + + .remirror-gh-colors .token.italic { + font-style: italic; + } + + .remirror-hopscotch code[class*='language-'], + .remirror-hopscotch pre[class*='language-'] { + color: #ffffff; + font-family: 'Fira Mono', Menlo, Monaco, 'Lucida Console', 'Courier New', Courier, monospace; + font-size: 16px; + line-height: 1.375; + direction: ltr; + text-align: left; + word-spacing: normal; + + -moz-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; + white-space: pre; + white-space: pre-wrap; + word-break: break-all; + word-wrap: break-word; + background: #322931; + color: #b9b5b8; + } + + /* Code blocks */ + + .remirror-hopscotch pre[class*='language-'] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; + } + + .remirror-hopscotch :has(.remirror-language-select-positioner) ~ pre[class*='language-'] { + padding: 2em 1em; + } + + /* Inline code */ + + .remirror-hopscotch :not(pre) > code[class*='language-'] { + padding: 0.1em; + border-radius: 0.3em; + } + + .remirror-hopscotch .token.comment, + .remirror-hopscotch .token.prolog, + .remirror-hopscotch .token.doctype, + .remirror-hopscotch .token.cdata { + color: #797379; + } + + .remirror-hopscotch .token.punctuation, + .remirror-hopscotch .token.punctuation.important { + color: #b9b5b8; + } + + .remirror-hopscotch .namespace { + opacity: 0.7; + } + + .remirror-hopscotch .token.null, + .remirror-hopscotch .token.operator, + .remirror-hopscotch .token.boolean, + .remirror-hopscotch .token.number { + color: #fd8b19; + } + + .remirror-hopscotch .token.property { + color: #fdcc59; + } + + .remirror-hopscotch .token.tag { + color: #1290bf; + } + + .remirror-hopscotch .token.string { + color: #149b93; + } + + .remirror-hopscotch .token.selector { + color: #c85e7c; + } + + .remirror-hopscotch .token.attr-name { + color: #fd8b19; + } + + .remirror-hopscotch .token.entity, + .remirror-hopscotch .token.url, + .remirror-hopscotch .language-css .token.string, + .remirror-hopscotch .style .token.string { + color: #149b93; + } + + .remirror-hopscotch .token.attr-value, + .remirror-hopscotch .token.keyword, + .remirror-hopscotch .token.control, + .remirror-hopscotch .token.directive, + .remirror-hopscotch .token.unit { + color: #8fc13e; + } + + .remirror-hopscotch .token.statement, + .remirror-hopscotch .token.regex, + .remirror-hopscotch .token.atrule { + color: #149b93; + } + + .remirror-hopscotch .token.placeholder, + .remirror-hopscotch .token.variable { + color: #1290bf; + } + + .remirror-hopscotch .token.important { + color: #dd464c; + font-weight: bold; + } + + .remirror-hopscotch .token.entity { + cursor: help; + } + + .remirror-hopscotch pre > code.highlight { + outline: 0.4em solid red; + outline-offset: 0.4em; + } + + .remirror-pojoaque code[class*='language-'], + .remirror-pojoaque pre[class*='language-'] { + -moz-tab-size: 4; + tab-size: 4; + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; + white-space: pre; + white-space: pre-wrap; + word-break: break-all; + word-wrap: break-word; + font-family: Menlo, Monaco, 'Courier New', monospace; + font-size: 15px; + line-height: 1.5; + color: #dccf8f; + text-shadow: 0; + } + + .remirror-pojoaque pre[class*='language-'], + .remirror-pojoaque :not(pre) > code[class*='language-'] { + border-radius: 5px; + border: 1px solid #000; + color: #dccf8f; + background: #181914 + url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAMAAA/+4ADkFkb2JlAGTAAAAAAf/bAIQACQYGBgcGCQcHCQ0IBwgNDwsJCQsPEQ4ODw4OERENDg4ODg0RERQUFhQUERoaHBwaGiYmJiYmKysrKysrKysrKwEJCAgJCgkMCgoMDwwODA8TDg4ODhMVDg4PDg4VGhMRERERExoXGhYWFhoXHR0aGh0dJCQjJCQrKysrKysrKysr/8AAEQgAjACMAwEiAAIRAQMRAf/EAF4AAQEBAAAAAAAAAAAAAAAAAAABBwEBAQAAAAAAAAAAAAAAAAAAAAIQAAEDAwIHAQEAAAAAAAAAAADwAREhYaExkUFRcYGxwdHh8REBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8AyGFEjHaBS2fDDs2zkhKmBKktb7km+ZwwCnXPkLVmCTMItj6AXFxRS465/BTnkAJvkLkJe+7AKKoi2AtRS2zuAWsCb5GOlBN8gKfmuGHZ8MFqIth3ALmFoFwbwKWyAlTAp17uKqBvgBD8sM4fTjhvAhkzhaRkBMKBrfs7jGPIpzy7gFrAqnC0C0gB0EWwBDW2cBVQwm+QtPpa3wBO3sVvszCnLAhkzgL5/RLf13cLQd8/AGlu0Cb5HTx9KuAEieGJEdcehS3eRTp2ATdt3CpIm+QtZwAhROXFeb7swp/ahaM3kBE/jSIUBc/AWrgBN8uNFAl+b7sAXFxFn2YLUU5Ns7gFX8C4ib+hN8gFWXwK3bZglxEJm+gKdciLPsFV/TClsgJUwKJ5FVA7tvIFrfZhVfGJDcsCKaYgAqv6YRbE+RWOWBtu7+AL3yRalXLyKqAIIfk+zARbDgFyEsncYwJvlgFRW+GEWntIi2P0BooyFxcNr8Ep3+ANLbMO+QyhvbiqdgC0kVvgUUiLYgBS2QtPbiVI1/sgOmG9uO+Y8DW+7jS2zAOnj6O2BndwuIAUtkdRN8gFoK3wwXMQyZwHVbClsuNLd4E3yAUR6FVDBR+BafQGt93LVMxJTv8ABts4CVLhcfYWsCb5kC9/BHdU8CLYFY5bMAd+eX9MGthhpbA1vu4B7+RKkaW2Yq4AQtVBBFsAJU/AuIXBhN8gGWnstefhiZyWvLAEnbYS1uzSFP6Jvn4Baxx70JKkQojLib5AVTey1jjgkKJGO0AKWyOm7N7cSpgSpAdPH0Tfd/gp1z5C1ZgKqN9J2wFxcUUuAFLZAm+QC0Fb4YUVRFsAOvj4KW2dwtYE3yAWk/wS/PLMKfmuGHZ8MAXF/Ja32Yi5haAKWz4Ydm2cSpgU693Atb7km+Zwwh+WGcPpxw3gAkzCLY+iYUDW/Z3Adc/gpzyFrAqnALkJe+7DoItgAtRS2zuKqGE3yAx0oJvkdvYrfZmALURbDuL5/RLf13cAuDeBS2RpbtAm+QFVA3wR+3fUtFHoBDJnC0jIXH0HWsgMY8inPLuOkd9chp4z20ALQLSA8cI9jYAIa2zjzjBd8gRafS1vgiUho/kAKcsCGTOGWvoOpkAtB3z8Hm8x2Ff5ADp4+lXAlIvcmwH/2Q==') + repeat left top; + } + + .remirror-pojoaque pre[class*='language-'] { + padding: 12px; + overflow: auto; + } + + .remirror-pojoaque :has(.remirror-language-select-positioner) ~ pre[class*='language-'] { + padding: 2em 1em; + } + + .remirror-pojoaque :not(pre) > code[class*='language-'] { + padding: 2px 6px; + } + + .remirror-pojoaque .token.namespace { + opacity: 0.7; + } + + .remirror-pojoaque .token.comment, + .remirror-pojoaque .token.prolog, + .remirror-pojoaque .token.doctype, + .remirror-pojoaque .token.cdata { + color: #586e75; + font-style: italic; + } + + .remirror-pojoaque .token.number, + .remirror-pojoaque .token.string, + .remirror-pojoaque .token.char, + .remirror-pojoaque .token.builtin, + .remirror-pojoaque .token.inserted { + color: #468966; + } + + .remirror-pojoaque .token.attr-name { + color: #b89859; + } + + .remirror-pojoaque .token.operator, + .remirror-pojoaque .token.entity, + .remirror-pojoaque .token.url, + .remirror-pojoaque .language-css .token.string, + .remirror-pojoaque .style .token.string { + color: #dccf8f; + } + + .remirror-pojoaque .token.selector, + .remirror-pojoaque .token.regex { + color: #859900; + } + + .remirror-pojoaque .token.atrule, + .remirror-pojoaque .token.keyword { + color: #cb4b16; + } + + .remirror-pojoaque .token.attr-value { + color: #468966; + } + + .remirror-pojoaque .token.function, + .remirror-pojoaque .token.variable, + .remirror-pojoaque .token.placeholder { + color: #b58900; + } + + .remirror-pojoaque .token.property, + .remirror-pojoaque .token.tag, + .remirror-pojoaque .token.boolean, + .remirror-pojoaque .token.number, + .remirror-pojoaque .token.constant, + .remirror-pojoaque .token.symbol { + color: #b89859; + } + + .remirror-pojoaque .token.tag { + color: #ffb03b; + } + + .remirror-pojoaque .token.important, + .remirror-pojoaque .token.statement, + .remirror-pojoaque .token.deleted { + color: #dc322f; + } + + .remirror-pojoaque .token.punctuation, + .remirror-pojoaque .token.punctuation.important { + color: #dccf8f; + } + + .remirror-pojoaque .token.entity { + cursor: help; + } + + .remirror-pojoaque .token.bold { + font-weight: bold; + } + + .remirror-pojoaque .token.italic { + font-style: italic; + } + + .remirror-vs code[class*='language-'], + .remirror-vs pre[class*='language-'] { + color: #393a34; + font-family: 'Consolas', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; + direction: ltr; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + font-size: 0.95em; + line-height: 1.2em; + + -moz-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; + } + + .remirror-vs pre[class*='language-']::-moz-selection, + .remirror-vs pre[class*='language-'] ::-moz-selection, + .remirror-vs code[class*='language-']::-moz-selection, + .remirror-vs code[class*='language-'] ::-moz-selection { + background: #c1def1; + } + + .remirror-vs pre[class*='language-']::-moz-selection, + .remirror-vs pre[class*='language-'] ::-moz-selection, + .remirror-vs code[class*='language-']::-moz-selection, + .remirror-vs code[class*='language-'] ::-moz-selection { + background: #c1def1; + } + + .remirror-vs pre[class*='language-']::selection, + .remirror-vs pre[class*='language-'] ::selection, + .remirror-vs code[class*='language-']::selection, + .remirror-vs code[class*='language-'] ::selection { + background: #c1def1; + } + + /* Code blocks */ + + .remirror-vs pre[class*='language-'] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; + border: 1px solid #dddddd; + background-color: white; + } + + .remirror-vs :has(.remirror-language-select-positioner) ~ pre[class*='language-'] { + padding: 2em 1em; + } + + /* Inline code */ + + .remirror-vs :not(pre) > code[class*='language-'] { + padding: 0.2em; + padding-top: 1px; + padding-bottom: 1px; + background: #f8f8f8; + border: 1px solid #dddddd; + } + + .remirror-vs .token.comment, + .remirror-vs .token.prolog, + .remirror-vs .token.doctype, + .remirror-vs .token.cdata { + color: #008000; + font-style: italic; + } + + .remirror-vs .token.namespace { + opacity: 0.7; + } + + .remirror-vs .token.string { + color: #a31515; + } + + .remirror-vs .token.punctuation, + .remirror-vs .token.operator { + color: #393a34; /* no highlight */ + } + + .remirror-vs .token.url, + .remirror-vs .token.symbol, + .remirror-vs .token.number, + .remirror-vs .token.boolean, + .remirror-vs .token.variable, + .remirror-vs .token.constant, + .remirror-vs .token.inserted { + color: #36acaa; + } + + .remirror-vs .token.atrule, + .remirror-vs .token.keyword, + .remirror-vs .token.attr-value, + .remirror-vs .language-autohotkey .token.selector, + .remirror-vs .language-json .token.boolean, + .remirror-vs .language-json .token.number, + .remirror-vs code[class*='language-css'] { + color: #0000ff; + } + + .remirror-vs .token.function { + color: #393a34; + } + + .remirror-vs .token.deleted, + .remirror-vs .language-autohotkey .token.tag { + color: #9a050f; + } + + .remirror-vs .token.selector, + .remirror-vs .language-autohotkey .token.keyword { + color: #00009f; + } + + .remirror-vs .token.important, + .remirror-vs .token.bold { + font-weight: bold; + } + + .remirror-vs .token.italic { + font-style: italic; + } + + .remirror-vs .token.class-name, + .remirror-vs .language-json .token.property { + color: #2b91af; + } + + .remirror-vs .token.tag, + .remirror-vs .token.selector { + color: #800000; + } + + .remirror-vs .token.attr-name, + .remirror-vs .token.property, + .remirror-vs .token.regex, + .remirror-vs .token.entity { + color: #ff0000; + } + + .remirror-vs .token.directive.tag .tag { + background: #ffff00; + color: #393a34; + } + + /* overrides color-values for the Line Numbers plugin + * http://prismjs.com/plugins/line-numbers/ + */ + + .remirror-vs .line-numbers .line-numbers-rows { + border-right-color: #a5a5a5; + } + + .remirror-vs .line-numbers-rows > span:before { + color: #2b91af; + } + + /* overrides color-values for the Line Highlight plugin +* http://prismjs.com/plugins/line-highlight/ +*/ + + .remirror-vs .line-highlight { + background: rgba(193, 222, 241, 0.2); + background: linear-gradient(to right, rgba(193, 222, 241, 0.2) 70%, rgba(221, 222, 241, 0)); + } + + .remirror-xonokai code[class*='language-'], + .remirror-xonokai pre[class*='language-'] { + -moz-tab-size: 2; + tab-size: 2; + -webkit-hyphens: none; + -ms-hyphens: none; + hyphens: none; + white-space: pre; + white-space: pre-wrap; + word-wrap: normal; + font-family: Menlo, Monaco, 'Courier New', monospace; + font-size: 14px; + color: #76d9e6; + text-shadow: none; + } + + .remirror-xonokai pre[class*='language-'], + .remirror-xonokai :not(pre) > code[class*='language-'] { + background: #2a2a2a; + } + + .remirror-xonokai pre[class*='language-'] { + padding: 15px; + border-radius: 4px; + border: 1px solid #e1e1e8; + overflow: auto; + } + + .remirror-xonokai :has(.remirror-language-select-positioner) ~ pre[class*='language-'] { + padding: 2em 1em; + } + + .remirror-xonokai pre[class*='language-'] { + position: relative; + } + + .remirror-xonokai pre[class*='language-'] code { + white-space: pre; + display: block; + } + + .remirror-xonokai :not(pre) > code[class*='language-'] { + padding: 0.15em 0.2em 0.05em; + border-radius: 0.3em; + border: 0.13em solid #7a6652; + box-shadow: 1px 1px 0.3em -0.1em #000 inset; + } + + .remirror-xonokai .token.namespace { + opacity: 0.7; + } + + .remirror-xonokai .token.comment, + .remirror-xonokai .token.prolog, + .remirror-xonokai .token.doctype, + .remirror-xonokai .token.cdata { + color: #6f705e; + } + + .remirror-xonokai .token.operator, + .remirror-xonokai .token.boolean, + .remirror-xonokai .token.number { + color: #a77afe; + } + + .remirror-xonokai .token.attr-name, + .remirror-xonokai .token.string { + color: #e6d06c; + } + + .remirror-xonokai .token.entity, + .remirror-xonokai .token.url, + .remirror-xonokai .language-css .token.string, + .remirror-xonokai .style .token.string { + color: #e6d06c; + } + + .remirror-xonokai .token.selector, + .remirror-xonokai .token.inserted { + color: #a6e22d; + } + + .remirror-xonokai .token.atrule, + .remirror-xonokai .token.attr-value, + .remirror-xonokai .token.keyword, + .remirror-xonokai .token.important, + .remirror-xonokai .token.deleted { + color: #ef3b7d; + } + + .remirror-xonokai .token.regex, + .remirror-xonokai .token.statement { + color: #76d9e6; + } + + .remirror-xonokai .token.placeholder, + .remirror-xonokai .token.variable { + color: #fff; + } + + .remirror-xonokai .token.important, + .remirror-xonokai .token.statement, + .remirror-xonokai .token.bold { + font-weight: bold; + } + + .remirror-xonokai .token.punctuation, + .remirror-xonokai .token.punctuation.important { + color: #bebec5; + } + + .remirror-xonokai .token.entity { + cursor: help; + } + + .remirror-xonokai .token.italic { + font-style: italic; + } + + .remirror-xonokai code.language-markup { + color: #f9f9f9; + } + + .remirror-xonokai code.language-markup .token.tag { + color: #ef3b7d; + } + + .remirror-xonokai code.language-markup .token.attr-name { + color: #a6e22d; + } + + .remirror-xonokai code.language-markup .token.attr-value { + color: #e6d06c; + } + + .remirror-xonokai code.language-markup .token.style, + .remirror-xonokai code.language-markup .token.script { + color: #76d9e6; + } + + .remirror-xonokai code.language-markup .token.script .token.keyword { + color: #76d9e6; + } + + /* Line highlight plugin */ + + .remirror-xonokai pre[class*='language-'][data-line] { + position: relative; + padding: 1em 0 1em 3em; + } + + .remirror-xonokai pre[data-line] .line-highlight { + position: absolute; + left: 0; + right: 0; + padding: 0; + margin-top: 1em; + background: rgba(255, 255, 255, 0.08); + pointer-events: none; + line-height: inherit; + white-space: pre; + } + + .remirror-xonokai pre[data-line] .line-highlight:before, + .remirror-xonokai pre[data-line] .line-highlight[data-end]:after { + content: attr(data-start); + position: absolute; + top: 0.4em; + left: 0.6em; + min-width: 1em; + padding: 0.2em 0.5em; + background-color: rgba(255, 255, 255, 0.4); + color: black; + font: bold 65%/1 sans-serif; + height: 1em; + line-height: 1em; + text-align: center; + border-radius: 999px; + text-shadow: none; + box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7); + } + + .remirror-xonokai pre[data-line] .line-highlight[data-end]:after { + content: attr(data-end); + top: auto; + bottom: 0.4em; + } +`;Ct.div` + ${jb} +`;var Ub=yt` + /** + * Styles extracted from: packages/remirror__theme/src/extension-count-theme.ts + */ + .remirror-editor span.remirror-max-count-exceeded { + background-color: var(--rmr-hue-red-4); + } +`;Ct.div` + ${Ub} +`;var Wb=yt` + /** + * Styles extracted from: packages/remirror__theme/src/extension-emoji-theme.ts + */ + .remirror-emoji-image { + object-fit: contain; + width: 1.375em; + height: 1.375em; + vertical-align: bottom; + } + + .remirror-emoji-wrapper { + text-indent: -99999px; + } + + .remirror-emoji-popup-item { + padding: 8px; + text-overflow: ellipsis; + max-width: 250px; + width: 250px; + overflow: hidden; + white-space: nowrap; + color: white; + } + + .remirror-emoji-popup-hovered { + background-color: var(--rmr-hue-gray-2); + } + + .remirror-emoji-popup-highlight { + background-color: var(--rmr-hue-gray-3); + } + + .remirror-emoji-popup-wrapper { + position: absolute; + width: -webkit-max-content; + width: -moz-max-content; + width: max-content; + padding-top: 8px; + padding-bottom: 8px; + margin: 0 auto; + border-radius: 8px; + box-shadow: hsla(205, 70%, 15%, 0.25) 0 4px 8px, hsla(205, 70%, 15%, 0.31) 0px 0px 1px; + background-color: white; + z-index: 10; + max-height: 250px; + overflow-y: scroll; + } + + .remirror-emoji-popup-name { + color: rgb(121, 129, 134); + } + + .remirror-emoji-popup-char { + font-size: 1.25em; + padding-right: 5px; + } +`;Ct.div` + ${Wb} +`;var Kb=yt` + /** + * Styles extracted from: packages/remirror__theme/src/extension-file-theme.ts + */ + .remirror-file-root { + border-radius: 4px; + padding: 8px 12px; + background-color: #e8ecf1; + color: #000; + margin: 8px auto; + min-height: 32px; + width: 100%; + max-width: 600px; + display: flex; + align-items: center; + } + + .remirror-file-name { + font-size: 1rem; + margin-left: 8px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + .remirror-file-size { + font-size: 0.8rem; + margin-left: 8px; + color: gray; + white-space: nowrap; + } + + .remirror-file-upload-progress { + font-size: 0.8rem; + margin-left: 8px; + margin-right: 8px; + color: gray; + font-family: Menlo, Monaco, 'Courier New', monospace; + } + + .remirror-file-error { + font-size: 0.8rem; + color: red; + } + + .remirror-file-icon-button { + display: flex; + justify-content: center; + align-items: center; + color: #000; + } +`;Ct.div` + ${Kb} +`;var qb=yt` + /** + * Styles extracted from: packages/remirror__theme/src/extension-gap-cursor-theme.ts + */ + .remirror-editor.ProseMirror .ProseMirror-gapcursor { + display: none; + pointer-events: none; + position: absolute; + } + .remirror-editor.ProseMirror .ProseMirror-gapcursor:after { + content: ''; + display: block; + position: absolute; + top: -2px; + width: 20px; + border-top: 1px solid black; + animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; + } + @keyframes ProseMirror-cursor-blink { + to { + visibility: hidden; + } + } + .remirror-editor.ProseMirror .ProseMirror-focused .ProseMirror-gapcursor, + .remirror-editor.ProseMirror.ProseMirror-focused .ProseMirror-gapcursor { + display: block; + } +`;Ct.div` + ${qb} +`;var Gb=yt` + /** + * Styles extracted from: packages/remirror__theme/src/extension-image-theme.ts + */ + .remirror-image-loader { + border: 16px solid #f3f3f3; + border-radius: 50%; + border-top: 16px solid #3498db; + width: 120px; + height: 120px; + animation: spin 2s linear infinite; + } + + @keyframes spin { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } + } +`;Ct.div` + ${Gb} +`;var Yb=yt` + /** + * Styles extracted from: packages/remirror__theme/src/extension-list-theme.ts + */ + /* don't show the custom markers in a ordered list */ + .remirror-editor ol > li > .remirror-list-item-marker-container { + display: none; + } + /* don't show the origin markers when using custom markers (checkbox / collapsible) */ + .remirror-editor ul > li.remirror-list-item-with-custom-mark { + list-style: none; + } + .remirror-editor .remirror-ul-list-content > li.remirror-list-item-with-custom-mark { + list-style: none; + } + /* override the browser's default styles */ + .remirror-editor ul ul + ul { + -webkit-margin-before: 1em; + margin-block-start: 1em; + } + + .remirror-list-item-marker-container { + position: absolute; + left: -32px; + width: 24px; + display: inline-block; + text-align: center; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + } + + .remirror-list-item-checkbox { + /* change the checkbox color from blue (default on Chrome) to purple. */ + -webkit-filter: hue-rotate(60deg); + filter: hue-rotate(60deg); + } + + .remirror-collapsible-list-item-closed li { + display: none; + } + + .remirror-collapsible-list-item-closed .remirror-collapsible-list-item-button { + background-color: var(--rmr-hue-gray-6); + } + + .remirror-collapsible-list-item-button { + width: 8px; + height: 8px; + border-radius: 50%; + cursor: pointer; + display: inline-block; + vertical-align: middle; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + + transition: background-color 0.25s ease; + background-color: var(--rmr-color-border); + } + + .remirror-collapsible-list-item-button:hover { + background-color: var(--rmr-color-primary); + } + + .remirror-collapsible-list-item-button.disabled, + .remirror-collapsible-list-item-button.disabled:hover { + background-color: var(--rmr-color-border); + cursor: default; + } + + .remirror-list-spine { + position: absolute; + top: 4px; + bottom: 0px; + left: -20px; + width: 16px; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + + transition: border-left-color 0.25s ease; + border-left-color: var(--rmr-color-border); + border-left-style: solid; + border-left-width: 1px; + } + + .remirror-list-spine:hover { + border-left-color: var(--rmr-color-primary); + } +`;Ct.div` + ${Yb} +`;var Jb=yt` + /** + * Styles extracted from: packages/remirror__theme/src/extension-mention-atom-theme.ts + */ + .remirror-mention-atom { + background: var(--rmr-hue-gray-2); + font-weight: bold; + font-size: 0.9em; + font-style: normal; + border-radius: var(--rmr-radius-border); + padding: 0.2rem 0.5rem; + white-space: nowrap; + color: var(--rmr-color-primary); + } + + .remirror-suggest-atom { + color: rgba(0, 0, 0, 0.6); + } + + .remirror-mention-atom-popup-item { + padding: 8px; + text-overflow: ellipsis; + max-width: 250px; + width: 250px; + overflow: hidden; + white-space: nowrap; + color: white; + } + + .remirror-mention-atom-popup-hovered { + background-color: var(--rmr-hue-gray-2); + } + + .remirror-mention-atom-popup-highlight { + background-color: var(--rmr-hue-gray-3); + } + + .remirror-mention-atom-popup-wrapper { + width: -webkit-max-content; + width: -moz-max-content; + width: max-content; + padding-top: 8px; + padding-bottom: 8px; + margin: 0 auto; + border-radius: 8px; + box-shadow: hsla(205, 70%, 15%, 0.25) 0 4px 8px, hsla(205, 70%, 15%, 0.31) 0px 0px 1px; + background-color: white; + z-index: 10; + max-height: 250px; + overflow-y: scroll; + } + + .remirror-mention-atom-popup-name { + color: rgb(121, 129, 134); + } + + .remirror-mention-atom-zero-items { + color: rgb(121, 129, 134); + } + + .remirror-mention-atom-popup-char { + font-size: 1.25em; + padding-right: 5px; + } +`;Ct.div` + ${Jb} +`;var Xb=yt` + /** + * Styles extracted from: packages/remirror__theme/src/extension-node-formatting-theme.ts + */ + .remirror-editor.ProseMirror { + } +`;Ct.div` + ${Xb} +`;var Qb=yt` + /** + * Styles extracted from: packages/remirror__theme/src/extension-placeholder-theme.ts + */ + .remirror-is-empty:first-of-type::before { + position: absolute; + color: #aaa; + pointer-events: none; + height: 0; + font-style: italic; + content: attr(data-placeholder); + } +`;Ct.div` + ${Qb} +`;var Zb=yt` + /** + * Styles extracted from: packages/remirror__theme/src/extension-positioner-theme.ts + */ + .remirror-editor.ProseMirror { + position: relative; + } + + .remirror-positioner { + position: absolute; + min-width: 1px; + min-height: 1px; + pointer-events: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: none; + z-index: -1; + } + + .remirror-positioner-widget { + width: 0; + height: 0; + position: absolute; + } +`;Ct.div` + ${Zb} +`;var ek=yt` + /** + * Styles extracted from: packages/remirror__theme/src/extension-tables-theme.ts + */ + .remirror-editor.ProseMirror { + /* Give selected cells a blue overlay */ + /* We don't need this anymore -- 2021-04-03 ocavue */ + } + .remirror-editor.ProseMirror .tableWrapper { + overflow-x: auto; + } + .remirror-editor.ProseMirror table { + border-collapse: collapse; + table-layout: fixed; + width: 100%; + overflow: hidden; + } + .remirror-editor.ProseMirror td, + .remirror-editor.ProseMirror th { + vertical-align: top; + box-sizing: border-box; + position: relative; + border-width: 1px; + border-style: solid; + border-color: var(--rmr-color-table-default-border); + } + .remirror-editor.ProseMirror .column-resize-handle { + position: absolute; + right: -2px; + top: 0; + bottom: 0; + width: 4px; + z-index: 40; + background-color: var(--rmr-hue-blue-7); + pointer-events: none; + } + .remirror-editor.ProseMirror.resize-cursor { + cursor: ew-resize; + cursor: col-resize; + } + /* + .selectedCell:after { + z-index: 2; + position: absolute; + content: ''; + left: 0; + right: 0; + top: 0; + bottom: 0; + background: rgba(200, 200, 255, 0.4); + pointer-events: none; + } + */ + .remirror-editor.ProseMirror th.selectedCell, + .remirror-editor.ProseMirror td.selectedCell { + border-style: double; + border-color: var(--rmr-color-table-selected-border); + background-color: var(--rmr-color-table-selected-cell); + } + + .remirror-table-colgroup > col:first-of-type { + width: 13px; + overflow: visible; + } + + .remirror-controllers-toggle { + visibility: hidden; + } + + .remirror-table-show-controllers .remirror-controllers-toggle { + visibility: visible; + } + + .remirror-table-insert-button { + position: absolute; + width: 18px; + height: 18px; + z-index: 25; + cursor: pointer; + border-radius: 4px; + transition: background-color 150ms ease; + + background-color: #dcdcdc; + } + + .remirror-table-insert-button svg { + fill: #ffffff; + } + + .remirror-table-insert-button:hover { + background-color: #136bda; + } + + .remirror-table-insert-button:hover svg { + fill: #ffffff; + } + + .remirror-table-delete-inner-button { + border: none; + padding: 0; + width: 18px; + height: 18px; + + position: absolute; + z-index: 30; + cursor: pointer; + border-radius: 4px; + background-color: #cecece; + transition: background-color 150ms ease; + } + + .remirror-table-delete-inner-button:hover { + background-color: #ff7884; + } + + .remirror-table-delete-table-inner-button { + top: calc(var(--remirror-table-delete-button-y) - 9px); + left: calc(var(--remirror-table-delete-button-x) - 9px); + } + + .remirror-table-delete-row-column-inner-button { + top: calc(var(--remirror-table-delete-row-column-button-y) - 9px); + left: calc(var(--remirror-table-delete-row-column-button-x) - 9px); + } + + .remirror-table-with-controllers { + /* Space for marks */ + margin-top: 40px; + margin-bottom: 40px; + + /* To make controller's 'height: 100%' works, table must set its own height. */ + height: 1px; + } + + /* To show marks */ + + .ProseMirror table.remirror-table-with-controllers { + overflow: visible; + } + + .remirror-table-waitting-controllers { + /* Hide the table before controllers injected */ + display: none; + } + + /* First row contains one corner controller and multiple column controllers */ + + .remirror-table-tbody-with-controllers > tr:nth-of-type(1) { + height: 12px; + overflow: visible; + } + + /* First controller cell is the corner controller */ + + .remirror-table-tbody-with-controllers > tr:nth-of-type(1) th:nth-of-type(1) { + overflow: visible; + padding: 0; + cursor: pointer; + z-index: 15; + position: relative; + height: 12px; + width: 12px; + } + + .remirror-table-tbody-with-controllers + > tr:nth-of-type(1) + th:nth-of-type(1) + div.remirror-table-controller-wrapper { + overflow: visible; + display: flex; + justify-content: flex-end; + align-items: flex-end; + width: 12px; + height: 12px; + } + + .remirror-table-tbody-with-controllers + > tr:nth-of-type(1) + th:nth-of-type(1) + div.remirror-table-controller-trigger-area { + flex: 1; + position: relative; + z-index: 10; /* Style for debug. Use linear-gradient as background so that we can differentiate two neighbor areas. */ /* background: linear-gradient(to left top, rgba(0, 255, 100, 0.2), rgba(200, 100, 255, 0.2)); */ + display: none; + } + + .remirror-table-tbody-with-controllers + > tr:nth-of-type(1) + th:nth-of-type(1) + div.remirror-table-controller-mark-row-corner { + bottom: -2px; + left: -12px; + position: absolute; + width: 0px; + height: 0px; + border-radius: 50%; + border-style: solid; + border-color: var(--rmr-color-table-mark); + border-width: 2px; + } + + .remirror-table-tbody-with-controllers + > tr:nth-of-type(1) + th:nth-of-type(1) + div.remirror-table-controller-mark-column-corner { + position: absolute; + width: 0px; + height: 0px; + border-radius: 50%; + border-style: solid; + border-color: var(--rmr-color-table-mark); + border-width: 2px; + right: -2px; + top: -12px; + } + + /* Second and more cells are column controllers */ + + .remirror-table-tbody-with-controllers > tr:nth-of-type(1) th:nth-of-type(n + 2) { + overflow: visible; + padding: 0; + cursor: pointer; + z-index: 15; + position: relative; + height: 12px; + } + + .remirror-table-tbody-with-controllers + > tr:nth-of-type(1) + th:nth-of-type(n + 2) + div.remirror-table-controller-wrapper { + overflow: visible; + display: flex; + justify-content: flex-end; + align-items: flex-end; + width: 100%; + height: 12px; + flex-direction: row; + } + + .remirror-table-tbody-with-controllers + > tr:nth-of-type(1) + th:nth-of-type(n + 2) + div.remirror-table-controller-trigger-area { + flex: 1; + position: relative; + z-index: 10; /* Style for debug. Use linear-gradient as background so that we can differentiate two neighbor areas. */ /* background: linear-gradient(to left top, rgba(0, 255, 100, 0.2), rgba(200, 100, 255, 0.2)); */ + height: 36px; + } + + .remirror-table-tbody-with-controllers + > tr:nth-of-type(1) + th:nth-of-type(n + 2) + div.remirror-table-controller-mark-row-corner { + display: none; + } + + .remirror-table-tbody-with-controllers + > tr:nth-of-type(1) + th:nth-of-type(n + 2) + div.remirror-table-controller-mark-column-corner { + position: absolute; + width: 0px; + height: 0px; + border-radius: 50%; + border-style: solid; + border-color: var(--rmr-color-table-mark); + border-width: 2px; + right: -2px; + top: -12px; + } + + /* Second and more rows containes row controllers */ + + /* First controller cell in each row is a row controller */ + + .remirror-table-tbody-with-controllers > tr:nth-of-type(n + 2) th { + overflow: visible; + padding: 0; + cursor: pointer; + z-index: 15; + position: relative; + width: 12px; + } + + .remirror-table-tbody-with-controllers + > tr:nth-of-type(n + 2) + th + div.remirror-table-controller-wrapper { + overflow: visible; + display: flex; + justify-content: flex-end; + align-items: flex-end; + height: 100%; + width: 12px; + flex-direction: column; + } + + .remirror-table-tbody-with-controllers + > tr:nth-of-type(n + 2) + th + div.remirror-table-controller-trigger-area { + flex: 1; + position: relative; + z-index: 10; /* Style for debug. Use linear-gradient as background so that we can differentiate two neighbor areas. */ /* background: linear-gradient(to left top, rgba(0, 255, 100, 0.2), rgba(200, 100, 255, 0.2)); */ + width: 36px; + } + + .remirror-table-tbody-with-controllers + > tr:nth-of-type(n + 2) + th + div.remirror-table-controller-mark-row-corner { + bottom: -2px; + left: -12px; + position: absolute; + width: 0px; + height: 0px; + border-radius: 50%; + border-style: solid; + border-color: var(--rmr-color-table-mark); + border-width: 2px; + } + + .remirror-table-tbody-with-controllers + > tr:nth-of-type(n + 2) + th + div.remirror-table-controller-mark-column-corner { + display: none; + } + + /* Styles for default */ + + .remirror-table-tbody-with-controllers th.remirror-table-controller { + background-color: var(--rmr-color-table-default-controller); + } + + /* Styles for selected */ + + .remirror-table-tbody-with-controllers th.selectedCell.remirror-table-controller { + background-color: var(--rmr-color-table-selected-controller); + } + + .remirror-table-preselect-all { + } + + /* Styles for predelete */ + + .remirror-table-show-predelete th.selectedCell.remirror-table-controller, + .remirror-table-show-predelete td.selectedCell { + border-color: var(--rmr-color-table-predelete-border) !important; + background-color: var(--rmr-color-table-predelete-cell) !important; + } + + .remirror-table-show-predelete th.selectedCell.remirror-table-controller { + background-color: var(--rmr-color-table-predelete-controller) !important; + } + + .remirror-table-show-predelete.remirror-table-preselect-all th.remirror-table-controller, + .remirror-table-show-predelete.remirror-table-preselect-all td { + border-color: var(--rmr-color-table-predelete-border) !important; + background-color: var(--rmr-color-table-predelete-cell) !important; + } + + .remirror-table-show-predelete.remirror-table-preselect-all th.remirror-table-controller { + background-color: var(--rmr-color-table-predelete-controller) !important; + } +`;Ct.div` + ${ek} +`;var tk=yt` + /** + * Styles extracted from: packages/remirror__theme/src/extension-whitespace-theme.ts + */ + .remirror-editor.ProseMirror .whitespace { + pointer-events: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + } + .remirror-editor.ProseMirror .whitespace:before { + caret-color: inherit; + color: gray; + display: inline-block; + font-weight: 400; + font-style: normal; + line-height: 1em; + width: 0; + } + .remirror-editor.ProseMirror .whitespace--s:before { + content: '·'; + } + .remirror-editor.ProseMirror .whitespace--br:before { + content: '¬'; + } + .remirror-editor.ProseMirror .whitespace--p:before { + content: '¶'; + } +`;Ct.div` + ${tk} +`;var rk=yt` + /** + * Styles extracted from: packages/remirror__theme/src/extension-yjs-theme.ts + */ + .remirror-editor.ProseMirror .ProseMirror-yjs-cursor { + position: absolute; + border-left: black; + border-left-style: solid; + border-left-width: 2px; + border-color: orange; + height: 1em; + word-break: normal; + pointer-events: none; + } + + .remirror-editor.ProseMirror .ProseMirror-yjs-cursor > div { + position: relative; + top: -1.05em; + font-size: 13px; + background-color: rgb(250, 129, 0); + font-family: serif; + font-style: normal; + font-weight: normal; + line-height: normal; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + color: white; + padding-left: 2px; + padding-right: 2px; + } + .remirror-editor.ProseMirror > .ProseMirror-yjs-cursor:first-child { + margin-top: 16px; + } + .remirror-editor #y-functions { + position: absolute; + top: 20px; + right: 20px; + } + .remirror-editor #y-functions > * { + display: inline-block; + } +`;Ct.div` + ${rk} +`;var nk=yt` + /** + * Styles extracted from: packages/remirror__theme/src/theme.ts + */ + .remirror-theme { + /* The following makes it easier to measure components within the editor. */ + box-sizing: border-box; + } + + .remirror-theme *, + .remirror-theme *:before, + .remirror-theme *:after { + /** Preserve box-sizing when override exists: + * https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ + * */ + box-sizing: inherit; + } + + .remirror-theme { + --rmr-color-background: #ffffff; + --rmr-color-border: rgba(0, 0, 0, 0.25); + --rmr-color-foreground: #000000; + --rmr-color-muted: #f1f3f5; + --rmr-color-primary: #7963d2; + --rmr-color-secondary: #bcd263; + --rmr-color-primary-text: #fff; + --rmr-color-secondary-text: #fff; + --rmr-color-text: #252103; + --rmr-color-faded: hsla(0, 0%, 13%, 0.9); + --rmr-color-active-background: hsla(0, 0%, 85%, 1); + --rmr-color-active-border: hsla(0, 0%, 0%, 0.25); + --rmr-color-active-foreground: hsla(0, 0%, 0%, 1); + --rmr-color-active-muted: hsla(210, 17%, 80%, 1); + --rmr-color-active-primary: hsla(252, 55%, 46%, 1); + --rmr-color-active-secondary: hsla(72, 55%, 46%, 1); + --rmr-color-active-primary-text: #fff; + --rmr-color-active-secondary-text: #000; + --rmr-color-active-text: #000; + --rmr-color-active-faded: hsla(0, 0%, 13%, 0.9); + --rmr-color-hover-background: hsla(0, 0%, 93%, 1); + --rmr-color-hover-border: hsla(0, 0%, 0%, 0.25); + --rmr-color-hover-foreground: hsla(0, 0%, 0%, 1); + --rmr-color-hover-muted: hsla(210, 17%, 88%, 1); + --rmr-color-hover-primary: hsla(252, 55%, 53%, 1); + --rmr-color-hover-secondary: hsla(72, 55%, 53%, 1); + --rmr-color-hover-primary-text: #fff; + --rmr-color-hover-secondary-text: #000; + --rmr-color-hover-text: #000; + --rmr-color-hover-faded: hsla(0, 0%, 13%, 0.9); + --rmr-color-shadow-1: rgba(10, 31, 68, 0.08); + --rmr-color-shadow-2: rgba(10, 31, 68, 0.1); + --rmr-color-shadow-3: rgba(10, 31, 68, 0.12); + --rmr-color-backdrop: rgba(0, 0, 0, 0.9); + --rmr-color-outline: rgba(121, 99, 210, 0.4); + --rmr-color-table-default-border: hsla(0, 0%, 80%, 1); + --rmr-color-table-default-cell: hsla(0, 0%, 40%, 1); + --rmr-color-table-default-controller: #dee2e6; + --rmr-color-table-selected-border: #1c7ed6; + --rmr-color-table-selected-cell: #d0ebff; + --rmr-color-table-selected-controller: #339af0; + --rmr-color-table-preselect-border: #1c7ed6; + --rmr-color-table-preselect-cell: hsla(0, 0%, 40%, 1); + --rmr-color-table-preselect-controller: #339af0; + --rmr-color-table-predelete-border: #f03e3e; + --rmr-color-table-predelete-cell: #ffe3e3; + --rmr-color-table-predelete-controller: #ff6b6b; + --rmr-color-table-mark: #91919196; + --rmr-hue-gray-0: #f8f9fa; + --rmr-hue-gray-1: #f1f3f5; + --rmr-hue-gray-2: #e9ecef; + --rmr-hue-gray-3: #dee2e6; + --rmr-hue-gray-4: #ced4da; + --rmr-hue-gray-5: #adb5bd; + --rmr-hue-gray-6: #868e96; + --rmr-hue-gray-7: #495057; + --rmr-hue-gray-8: #343a40; + --rmr-hue-gray-9: #212529; + --rmr-hue-red-0: #fff5f5; + --rmr-hue-red-1: #ffe3e3; + --rmr-hue-red-2: #ffc9c9; + --rmr-hue-red-3: #ffa8a8; + --rmr-hue-red-4: #ff8787; + --rmr-hue-red-5: #ff6b6b; + --rmr-hue-red-6: #fa5252; + --rmr-hue-red-7: #f03e3e; + --rmr-hue-red-8: #e03131; + --rmr-hue-red-9: #c92a2a; + --rmr-hue-pink-0: #fff0f6; + --rmr-hue-pink-1: #ffdeeb; + --rmr-hue-pink-2: #fcc2d7; + --rmr-hue-pink-3: #faa2c1; + --rmr-hue-pink-4: #f783ac; + --rmr-hue-pink-5: #f06595; + --rmr-hue-pink-6: #e64980; + --rmr-hue-pink-7: #d6336c; + --rmr-hue-pink-8: #c2255c; + --rmr-hue-pink-9: #a61e4d; + --rmr-hue-grape-0: #f8f0fc; + --rmr-hue-grape-1: #f3d9fa; + --rmr-hue-grape-2: #eebefa; + --rmr-hue-grape-3: #e599f7; + --rmr-hue-grape-4: #da77f2; + --rmr-hue-grape-5: #cc5de8; + --rmr-hue-grape-6: #be4bdb; + --rmr-hue-grape-7: #ae3ec9; + --rmr-hue-grape-8: #9c36b5; + --rmr-hue-grape-9: #862e9c; + --rmr-hue-violet-0: #f3f0ff; + --rmr-hue-violet-1: #e5dbff; + --rmr-hue-violet-2: #d0bfff; + --rmr-hue-violet-3: #b197fc; + --rmr-hue-violet-4: #9775fa; + --rmr-hue-violet-5: #845ef7; + --rmr-hue-violet-6: #7950f2; + --rmr-hue-violet-7: #7048e8; + --rmr-hue-violet-8: #6741d9; + --rmr-hue-violet-9: #5f3dc4; + --rmr-hue-indigo-0: #edf2ff; + --rmr-hue-indigo-1: #dbe4ff; + --rmr-hue-indigo-2: #bac8ff; + --rmr-hue-indigo-3: #91a7ff; + --rmr-hue-indigo-4: #748ffc; + --rmr-hue-indigo-5: #5c7cfa; + --rmr-hue-indigo-6: #4c6ef5; + --rmr-hue-indigo-7: #4263eb; + --rmr-hue-indigo-8: #3b5bdb; + --rmr-hue-indigo-9: #364fc7; + --rmr-hue-blue-0: #e7f5ff; + --rmr-hue-blue-1: #d0ebff; + --rmr-hue-blue-2: #a5d8ff; + --rmr-hue-blue-3: #74c0fc; + --rmr-hue-blue-4: #4dabf7; + --rmr-hue-blue-5: #339af0; + --rmr-hue-blue-6: #228be6; + --rmr-hue-blue-7: #1c7ed6; + --rmr-hue-blue-8: #1971c2; + --rmr-hue-blue-9: #1864ab; + --rmr-hue-cyan-0: #e3fafc; + --rmr-hue-cyan-1: #c5f6fa; + --rmr-hue-cyan-2: #99e9f2; + --rmr-hue-cyan-3: #66d9e8; + --rmr-hue-cyan-4: #3bc9db; + --rmr-hue-cyan-5: #22b8cf; + --rmr-hue-cyan-6: #15aabf; + --rmr-hue-cyan-7: #1098ad; + --rmr-hue-cyan-8: #0c8599; + --rmr-hue-cyan-9: #0b7285; + --rmr-hue-teal-0: #e6fcf5; + --rmr-hue-teal-1: #c3fae8; + --rmr-hue-teal-2: #96f2d7; + --rmr-hue-teal-3: #63e6be; + --rmr-hue-teal-4: #38d9a9; + --rmr-hue-teal-5: #20c997; + --rmr-hue-teal-6: #12b886; + --rmr-hue-teal-7: #0ca678; + --rmr-hue-teal-8: #099268; + --rmr-hue-teal-9: #087f5b; + --rmr-hue-green-0: #ebfbee; + --rmr-hue-green-1: #d3f9d8; + --rmr-hue-green-2: #b2f2bb; + --rmr-hue-green-3: #8ce99a; + --rmr-hue-green-4: #69db7c; + --rmr-hue-green-5: #51cf66; + --rmr-hue-green-6: #40c057; + --rmr-hue-green-7: #37b24d; + --rmr-hue-green-8: #2f9e44; + --rmr-hue-green-9: #2b8a3e; + --rmr-hue-lime-0: #f4fce3; + --rmr-hue-lime-1: #e9fac8; + --rmr-hue-lime-2: #d8f5a2; + --rmr-hue-lime-3: #c0eb75; + --rmr-hue-lime-4: #a9e34b; + --rmr-hue-lime-5: #94d82d; + --rmr-hue-lime-6: #82c91e; + --rmr-hue-lime-7: #74b816; + --rmr-hue-lime-8: #66a80f; + --rmr-hue-lime-9: #5c940d; + --rmr-hue-yellow-0: #fff9db; + --rmr-hue-yellow-1: #fff3bf; + --rmr-hue-yellow-2: #ffec99; + --rmr-hue-yellow-3: #ffe066; + --rmr-hue-yellow-4: #ffd43b; + --rmr-hue-yellow-5: #fcc419; + --rmr-hue-yellow-6: #fab005; + --rmr-hue-yellow-7: #f59f00; + --rmr-hue-yellow-8: #f08c00; + --rmr-hue-yellow-9: #e67700; + --rmr-hue-orange-0: #fff4e6; + --rmr-hue-orange-1: #ffe8cc; + --rmr-hue-orange-2: #ffd8a8; + --rmr-hue-orange-3: #ffc078; + --rmr-hue-orange-4: #ffa94d; + --rmr-hue-orange-5: #ff922b; + --rmr-hue-orange-6: #fd7e14; + --rmr-hue-orange-7: #f76707; + --rmr-hue-orange-8: #e8590c; + --rmr-hue-orange-9: #d9480f; + --rmr-radius-border: 0.25rem; + --rmr-radius-extra: 0.5rem; + --rmr-radius-circle: 50%; + --rmr-font-family-default: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, + 'Helvetica Neue', sans-serif; + --rmr-font-family-heading: inherit; + --rmr-font-family-mono: Menlo, monospace; + --rmr-font-size-0: 12px; + --rmr-font-size-1: 14px; + --rmr-font-size-2: 16px; + --rmr-font-size-3: 20px; + --rmr-font-size-4: 24px; + --rmr-font-size-5: 32px; + --rmr-font-size-6: 48px; + --rmr-font-size-7: 64px; + --rmr-font-size-8: 96px; + --rmr-font-size-default: 16px; + --rmr-space-1: 4px; + --rmr-space-2: 8px; + --rmr-space-3: 16px; + --rmr-space-4: 32px; + --rmr-space-5: 64px; + --rmr-space-6: 128px; + --rmr-space-7: 256px; + --rmr-space-8: 512px; + --rmr-font-weight-bold: 700; + --rmr-font-weight-default: 400; + --rmr-font-weight-heading: 700; + --rmr-letter-spacing-tight: -1px; + --rmr-letter-spacing-default: normal; + --rmr-letter-spacing-loose: 1px; + --rmr-letter-spacing-wide: 3px; + --rmr-line-height-heading: 1.25em; + --rmr-line-height-default: 1.5em; + --rmr-box-shadow-1: 0 1px 1px rgba(10, 31, 68, 0.08); + --rmr-box-shadow-2: 0 1px 1px rgba(10, 31, 68, 0.1); + --rmr-box-shadow-3: 0 1px 1px rgba(10, 31, 68, 0.12); + + font-family: var(--rmr-font-family-default); + line-height: var(--rmr-line-height-default); + font-weight: var(--rmr-font-weight-default); + } + + .remirror-theme h1, + .remirror-theme h2, + .remirror-theme h3, + .remirror-theme h4, + .remirror-theme h5, + .remirror-theme h6 { + color: var(--rmr-color-text); + font-family: var(--rmr-font-family-heading); + line-height: var(--rmr-line-height-heading); + font-weight: var(--rmr-font-weight-heading); + } + + .remirror-theme h1 { + font-size: var(--rmr-font-size-5); + } + + .remirror-theme h2 { + font-size: var(--rmr-font-size-4); + } + + .remirror-theme h3 { + font-size: var(--rmr-font-size-3); + } + + .remirror-theme h4 { + font-size: var(--rmr-font-size-2); + } + + .remirror-theme h5 { + font-size: var(--rmr-font-size-1); + } + + .remirror-theme h6 { + font-size: var(--rmr-font-size-0); + } + + .remirror-theme .ProseMirror { + min-height: var(--rmr-space-6); + box-shadow: var(--rmr-color-border) 0px 0px 0px 0.1em; + padding: var(--rmr-space-3); + border-radius: var(--rmr-radius-border); + outline: none; + } + + .remirror-theme .ProseMirror:active, + .remirror-theme .ProseMirror:focus { + box-shadow: var(--rmr-color-outline) 0px 0px 0px 0.2em; + } + + .remirror-theme .ProseMirror p, + .remirror-theme .ProseMirror h1, + .remirror-theme .ProseMirror h2, + .remirror-theme .ProseMirror h3, + .remirror-theme .ProseMirror h4, + .remirror-theme .ProseMirror h4, + .remirror-theme .ProseMirror h5, + .remirror-theme .ProseMirror h6, + .remirror-theme .ProseMirror span { + margin: 0; + /* margin-bottom: var(--rmr-space-2); */ + } +`;Ct.div` + ${nk} +`;yt` + ${Hb} + ${Bb} + ${Fb} + ${Vb} + ${jb} + ${Ub} + ${Wb} + ${Kb} + ${qb} + ${Gb} + ${Yb} + ${Jb} + ${Xb} + ${Qb} + ${Zb} + ${ek} + ${tk} + ${rk} + ${nk} +`;var Use=Ct.div` + ${Hb} + ${Bb} + ${Fb} + ${Vb} + ${jb} + ${Ub} + ${Wb} + ${Kb} + ${qb} + ${Gb} + ${Yb} + ${Jb} + ${Xb} + ${Qb} + ${Zb} + ${ek} + ${tk} + ${rk} + ${nk} +`;const lh=e=>{const{type:t}=e;return t==="Assets"?A.jsxs("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 28 28",children:[A.jsx("title",{children:"assets"}),A.jsx("path",{d:"M21.875 28h-15.75c-3.413 0-6.125-2.713-6.125-6.125v-15.75c0-3.413 2.712-6.125 6.125-6.125h15.75c3.412 0 6.125 2.712 6.125 6.125v15.75c0 3.412-2.713 6.125-6.125 6.125zM6.125 1.75c-2.45 0-4.375 1.925-4.375 4.375v15.75c0 2.45 1.925 4.375 4.375 4.375h15.75c2.45 0 4.375-1.925 4.375-4.375v-15.75c0-2.45-1.925-4.375-4.375-4.375h-15.75z"}),A.jsx("path",{d:"M21.088 23.537h-11.988c-0.35 0-0.612-0.175-0.787-0.525s-0.088-0.7 0.088-0.962l8.225-9.713c0.175-0.175 0.438-0.35 0.7-0.35s0.525 0.175 0.7 0.35l5.25 7.525c0.088 0.087 0.088 0.175 0.088 0.262 0.438 1.225 0.087 2.012-0.175 2.45-0.613 0.875-1.925 0.963-2.1 0.963zM11.025 21.787h10.15c0.175 0 0.612-0.088 0.7-0.262 0.088-0.088 0.088-0.35 0-0.7l-4.55-6.475-6.3 7.438z"}),A.jsx("path",{d:"M9.1 13.737c-2.1 0-3.85-1.75-3.85-3.85s1.75-3.85 3.85-3.85 3.85 1.75 3.85 3.85-1.663 3.85-3.85 3.85zM9.1 7.788c-1.138 0-2.1 0.875-2.1 2.1s0.962 2.1 2.1 2.1 2.1-0.962 2.1-2.1-0.875-2.1-2.1-2.1z"})]}):t==="Contents"?A.jsxs("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 28 28",children:[A.jsx("title",{children:"contents"}),A.jsx("path",{d:"M21.875 28h-15.75c-3.413 0-6.125-2.713-6.125-6.125v-15.75c0-3.413 2.712-6.125 6.125-6.125h15.75c3.412 0 6.125 2.712 6.125 6.125v15.75c0 3.412-2.713 6.125-6.125 6.125zM6.125 1.75c-2.45 0-4.375 1.925-4.375 4.375v15.75c0 2.45 1.925 4.375 4.375 4.375h15.75c2.45 0 4.375-1.925 4.375-4.375v-15.75c0-2.45-1.925-4.375-4.375-4.375h-15.75z"}),A.jsx("path",{d:"M13.125 12.25h-5.775c-1.575 0-2.888-1.313-2.888-2.888v-2.013c0-1.575 1.313-2.888 2.888-2.888h5.775c1.575 0 2.887 1.313 2.887 2.888v2.013c0 1.575-1.312 2.888-2.887 2.888zM7.35 6.212c-0.613 0-1.138 0.525-1.138 1.138v2.012c0 0.612 0.525 1.138 1.138 1.138h5.775c0.612 0 1.138-0.525 1.138-1.138v-2.013c0-0.612-0.525-1.138-1.138-1.138h-5.775z"}),A.jsx("path",{d:"M22.662 16.713h-17.325c-0.525 0-0.875-0.35-0.875-0.875s0.35-0.875 0.875-0.875h17.237c0.525 0 0.875 0.35 0.875 0.875s-0.35 0.875-0.787 0.875z"}),A.jsx("path",{d:"M15.138 21.262h-9.8c-0.525 0-0.875-0.35-0.875-0.875s0.35-0.875 0.875-0.875h9.713c0.525 0 0.875 0.35 0.875 0.875s-0.35 0.875-0.787 0.875z"})]}):t==="Check"?A.jsx("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960",width:"1rem",height:"1rem",children:A.jsx("path",{d:"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"})}):t==="Cancel"?A.jsx("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960",width:"1rem",height:"1rem",children:A.jsx("path",{d:"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"})}):null};function Wse(){const[e,t]=S.useState(),[r,n]=S.useState(!1);return U3(Qi,"onShortcut",S.useCallback(o=>(r||n(!0),t(o)),[r])),{linkShortcut:e,isEditing:r,setIsEditing:n}}function Kse(){const{isEditing:e,linkShortcut:t,setIsEditing:r}=Wse(),n=cY(),o=ob(),s=QG().link(),a=(s==null?void 0:s.href)??"",l=j3(),[c,u]=S.useState(a),d=S.useCallback(()=>{o.removeLink().focus().run()},[o]);S.useLayoutEffect(()=>{e&&(n.doc||n.selection)&&r(!1)},[e,r,n.doc,n.selection]),S.useEffect(()=>{u(a)},[a]);const f=S.useCallback(()=>{r(!1);const m=t??void 0;c?o.updateLink({href:c,auto:!1},m):o.removeLink(),o.focus((m==null?void 0:m.to)??l.to).run()},[r,t,o,c,l]),p=S.useCallback(()=>{r(!1)},[r]),h=S.useCallback(()=>{r(!0)},[r]);return S.useMemo(()=>({href:c,setHref:u,linkShortcut:t,isEditing:e,clickEdit:h,onRemove:d,submitHref:f,cancelHref:p}),[c,t,e,h,d,f,p])}const qse=e=>{const t=S.useRef(null);return S.useEffect(()=>{const r=window.requestAnimationFrame(()=>{var n;(n=t.current)==null||n.focus()});return()=>{window.cancelAnimationFrame(r)}},[]),A.jsx("input",{ref:t,...e})},Gse=e=>{const{isEditing:t,clickEdit:r,onRemove:n,submitHref:o,href:i,setHref:s,cancelHref:a}=Kse(),c=Nn().link(),u=S.useCallback(f=>{s(f.target.value)},[s]),d=S.useCallback(f=>{const{code:p}=f;p==="Enter"&&o(),p==="Escape"&&a()},[a,o]);return A.jsxs(jse,{className:"squidex-editor-floating",children:[t&&A.jsxs(Wo,{children:[A.jsx(qse,{placeholder:"Enter link...",value:i,onChange:u,onKeyPress:d}),A.jsx(wt,{commandName:"submitLink",enabled:!0,onSelect:o,icon:A.jsx(lh,{type:"Check"})}),A.jsx(wt,{commandName:"cancelLink",enabled:!0,onSelect:a,icon:A.jsx(lh,{type:"Cancel"})})]}),!t&&A.jsxs(Wo,{children:[e.children,c?A.jsxs(A.Fragment,{children:[A.jsx(wt,{commandName:"updateLink",enabled:!0,onSelect:r,icon:"pencilLine"}),A.jsx(wt,{commandName:"removeLink",enabled:!0,onSelect:n,icon:"linkUnlink"})]}):A.jsx(A.Fragment,{children:A.jsx(wt,{commandName:"updateLink",enabled:!0,onSelect:r,icon:"link"})})]})]})},Yse=({onSelectAssets:e})=>{const t=ob(),r=S.useCallback(async()=>{const n=await e();for(const o of n)o.type.startsWith("image/")?t.insertImage(o):t.insertText(o.fileName,{marks:{link:{href:o.src}}}),t.insertText(" ");t.run()},[t,e]);return A.jsx(wt,{commandName:"addImage",enabled:!0,onSelect:r,label:"Select Asset",icon:A.jsx(lh,{type:"Assets"})})},Jse=({onSelectContents:e})=>{const t=ob(),r=S.useCallback(async()=>{const n=await e();for(const o of n)t.insertText(o.title,{marks:{link:{href:o.href}}}),t.insertText(" ");t.run()},[t,e]);return A.jsx(wt,{commandName:"addContent",enabled:!0,onSelect:r,label:"Select Content",icon:A.jsx(lh,{type:"Contents"})})},Xse=({mode:e,onChange:t,state:r,value:n})=>{const{setContent:o}=ii(),{getMarkdown:i,getHTML:s}=Kh(),a=S.useRef(null),l=S.useRef(!1);return S.useEffect(()=>{l.current=!!n&&n.length>0,a.current!==n&&(a.current=n,o(n||""))},[o,n]),S.useEffect(()=>{if(!t)return;function c(){switch(e){case"Markdown":return i(r);default:return s(r)}}let u=c().trim();u==="

    "&&(u=""),a.current!==u&&(!l.current&&u.length===0?t(void 0):t(u),a.current=u,l.current=!!u&&u.length>0)},[s,i,e,t,r]),null};var Qse=Object.defineProperty,Zse=Object.getOwnPropertyDescriptor,zd=(e,t,r,n)=>{for(var o=n>1?void 0:n?Zse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Qse(t,r,o),o},XT=/\S+/g;function QT(e){return e.type.isTextblock?1:e.type.isText?e.textBetween(0,e.nodeSize).length:0}function eae({doc:e},t){let r=0,n=0;return e.nodesBetween(0,e.nodeSize-2,(o,i)=>{if(n>0)return!1;const s=QT(o);return r+s>t?(n=i+1+(t-r),!1):(r+=s,!0)}),n}function tae({doc:e},t){let r=0,n=0;return e.nodesBetween(0,e.nodeSize-2,(o,i)=>{if(n>0)return!1;if(!o.type.isText)return!0;const s=o.textBetween(0,o.nodeSize),a=Ul(s,XT);if(r+a.length>t){const l=t-r,c=a[l];return n=i+((c==null?void 0:c.index)??0),!1}return r+=a.length,!0}),n}var is=class extends Ge{get name(){return"count"}getCountMaximum(){return this.options.maximum}getCharacterCount(e=this.store.getState()){let t=0;return e.doc.nodesBetween(0,e.doc.nodeSize-2,r=>(t+=QT(r),!0)),Math.max(t-1,0)}getWordCount(e=this.store.getState()){const t=this.store.helpers.getText({lineBreakDivider:" ",state:e});return Ul(t,XT).length}isCountValid(e=this.store.getState()){const{maximumStrategy:t,maximum:r}=this.options;return r<1?!0:t==="CHARACTERS"?this.store.helpers.getCharacterCount(e)<=r:this.store.helpers.getWordCount(e)<=r}createDecorationSet(e){const{maximum:t=-1,maximumStrategy:r,maximumExceededClassName:n}=this.options,s=(r==="CHARACTERS"?eae:tae)(e,t);return Ee.create(e.doc,[Ke.inline(s,e.doc.nodeSize-2,{class:n})])}createExternalPlugins(){const{maximum:e}=this.options,t=new Co({state:{init:(r,n)=>this.isCountValid(n)?{decorationSet:Ee.empty}:{decorationSet:this.createDecorationSet(n)},apply:(r,n,o,i)=>!r.docChanged||e<1?n:this.isCountValid(i)?{decorationSet:Ee.empty}:{decorationSet:this.createDecorationSet(i)}},props:{decorations(r){var n;return((n=t.getState(r))==null?void 0:n.decorationSet)??null}}});return[t]}};zd([je()],is.prototype,"getCountMaximum",1);zd([je()],is.prototype,"getCharacterCount",1);zd([je()],is.prototype,"getWordCount",1);zd([je()],is.prototype,"isCountValid",1);is=zd([ye({defaultOptions:{maximum:-1,maximumExceededClassName:"remirror-max-count-exceeded",maximumStrategy:"CHARACTERS"},staticKeys:["maximum","maximumStrategy","maximumExceededClassName"]})],is);const rae=()=>{const e=ib(is);return A.jsxs("div",{className:"squidex-editor-counter",children:["Words: ",A.jsx("strong",{children:e.getWordCount()}),", Characters: ",A.jsx("strong",{children:e.getCharacterCount()})]})};const nae=e=>{const{canSelectAssets:t,canSelectContents:r,isDisabled:n,mode:o,onChange:i,onSelectAssets:s,onSelectContents:a,onUpload:l,value:c}=e,u=S.useCallback(()=>[new $v,new Qs,new Lu({enableSpine:!0}),new eo,new Ru,new is,new yp,new bp,new kp,new Nu({uploadHandler:l}),new zu,new Qi({autoLink:!0}),new Zs({enableCollapsible:!0}),new Ol({copyAsMarkdown:!1}),new Iu,new Du,new L1,new $u],[l]),{manager:d,state:f,setState:p}=lY({extensions:u,stringHandler:o==="Markdown"?"markdown":"html",content:c});return A.jsx(Use,{children:A.jsx(Fse,{theme:{color:{primary:"#3389ff",active:{primary:"#3389ff"}}},children:A.jsxs(dY,{classNames:n?["squidex-editor-disabled"]:[],manager:d,state:f,onChange:h=>p(h.state),children:[A.jsx("div",{className:"menu",children:A.jsxs(JT,{children:[A.jsx(Hse,{}),A.jsx($se,{showAll:!0}),A.jsxs(Wo,{children:[A.jsx(j0,{}),A.jsx(W0,{}),A.jsx(K0,{}),A.jsx(U0,{})]}),A.jsxs(Wo,{children:[A.jsx(Ese,{}),A.jsx(Mse,{}),A.jsx(wse,{})]}),A.jsxs(Wo,{children:[A.jsx(Cse,{}),A.jsx(Tse,{})]}),A.jsxs(Wo,{children:[t&&A.jsx(Yse,{onSelectAssets:s}),r&&A.jsx(Jse,{onSelectContents:a})]})]})}),A.jsx(Xse,{mode:o,onChange:i,state:f,value:c}),A.jsxs(Gse,{children:[A.jsx(j0,{}),A.jsx(W0,{}),A.jsx(K0,{}),A.jsx(U0,{})]}),A.jsx(A0,{}),A.jsx(rae,{})]})})})};var ZT,K4=Uh;ZT=K4.createRoot,K4.hydrateRoot;class oae{constructor(t,r){Lm(this,"root");this.element=t,this.props=r,this.root=ZT(this.element),this.render()}update(t){this.props={...this.props,...t},this.render()}setValue(t){this.update({value:t})}setIsDisabled(t){this.update({isDisabled:t})}destroy(){this.root.unmount()}render(){this.root.render(A.jsx(nae,{...this.props}))}}window.SquidexEditorWrapper=oae; diff --git a/backend/src/Squidex/wwwroot/scripts/editor-combined.html b/backend/src/Squidex/wwwroot/scripts/editor-combined.html index 5d2abe715..84e6974d4 100644 --- a/backend/src/Squidex/wwwroot/scripts/editor-combined.html +++ b/backend/src/Squidex/wwwroot/scripts/editor-combined.html @@ -6,10 +6,21 @@ + + + - + + @@ -26,7 +27,7 @@ } - + + + + - - - - diff --git a/backend/src/Squidex/wwwroot/scripts/editor-editorjs.html b/backend/src/Squidex/wwwroot/scripts/editor-editorjs.html deleted file mode 100644 index d5d44b781..000000000 --- a/backend/src/Squidex/wwwroot/scripts/editor-editorjs.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - -
    -
    -
    - - - - - \ No newline at end of file diff --git a/backend/src/Squidex/wwwroot/scripts/editor-json-schema.html b/backend/src/Squidex/wwwroot/scripts/editor-json-schema.html deleted file mode 100644 index 874e6b458..000000000 --- a/backend/src/Squidex/wwwroot/scripts/editor-json-schema.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - -
    - - - - - \ No newline at end of file diff --git a/backend/src/Squidex/wwwroot/scripts/editor-log.html b/backend/src/Squidex/wwwroot/scripts/editor-log.html index f7dbd5004..09ae1df7f 100644 --- a/backend/src/Squidex/wwwroot/scripts/editor-log.html +++ b/backend/src/Squidex/wwwroot/scripts/editor-log.html @@ -7,22 +7,26 @@ + -
    - +
    +
    - + - - - - - - -
    - - - - - \ No newline at end of file diff --git a/backend/src/Squidex/wwwroot/scripts/editor-plain.html b/backend/src/Squidex/wwwroot/scripts/editor-plain.html index c16a04cf4..cfc77da1e 100644 --- a/backend/src/Squidex/wwwroot/scripts/editor-plain.html +++ b/backend/src/Squidex/wwwroot/scripts/editor-plain.html @@ -4,39 +4,31 @@ - + + - -
    - -
    - +
    - - + diff --git a/backend/src/Squidex/wwwroot/scripts/editor-sdk.d.ts b/backend/src/Squidex/wwwroot/scripts/editor-sdk.d.ts index 6a9c91871..c6f12f7b5 100644 --- a/backend/src/Squidex/wwwroot/scripts/editor-sdk.d.ts +++ b/backend/src/Squidex/wwwroot/scripts/editor-sdk.d.ts @@ -12,14 +12,14 @@ declare class SquidexSidebar { /** * Register an function that is called when the sidebar is initialized. * - * @param {function} callback: The callback to invoke. + * @param callback: The callback to invoke. */ onInit(callback: () => void): void; /** * Register an function that is called whenever the value of the content has changed. * - * @param {function} callback: The callback to invoke. Argument 1: Content value (any). + * @param callback: The callback to invoke. Argument 1: Content value (any). */ onContentChanged(callback: (content: any) => void): void; @@ -38,7 +38,7 @@ declare class SquidexWidget { /** * Register an function that is called when the sidebar is initialized. * - * @param {function} callback: The callback to invoke. + * @param callback: The callback to invoke. */ onInit(callback: () => void): void; /** @@ -96,119 +96,124 @@ declare class SquidexFormField { /** * Notifies the parent to navigate to the path. * - * @param {string} url: The url to navigate to. + * @param url: The url to navigate to. */ navigate(url: string): void; /** - * Notifies the parent to go to fullscreen mode. + * Notifies the parent to toggle the fullscreen mode. */ toggleFullscreen(): void; /** - * Notifies the parent to go to expanded mode. + * Notifies the parent to toggle the expanded mode. */ toggleExpanded(): void; /** * Notifies the control container that the value has been changed. * - * @param {any} newValue: The new field value. + * @param newValue: The new field value. */ valueChanged(newValue: any): void; /** * Shows an info alert. * - * @param {string} text: The info text. + * @param text: The info text. */ notifyInfo(text: string): void; /** * Shows an error alert. * - * @param {string} text: error info text. + * @param text: error info text. */ notifyError(text: string): void; /** * Shows an confirm dialog. * - * @param {string} title The title of the dialog. - * @param {string} text The text of the dialog. - * @param {function} callback The callback to invoke when the dialog is completed or closed. + * @param title The title of the dialog. + * @param text The text of the dialog. + * @param callback The callback to invoke when the dialog is completed or closed. */ confirm(title: string, text: string, callback: (result: boolean) => void): void; /** * Shows the dialog to pick assets. * - * @param {function} callback The callback to invoke when the dialog is completed or closed. + * @param callback The callback to invoke when the dialog is completed or closed. */ pickAssets(callback: (assets: any[]) => void): void; /** * Shows the dialog to pick contents. * - * @param {string} schemas: The list of schema names. - * @param {function} callback The callback to invoke when the dialog is completed or closed. - * @param {string} query: The initial query that is used in the UI. + * @param schemas: The list of schema names. + * @param callback The callback to invoke when the dialog is completed or closed. + * @param query: The initial query that is used in the UI. */ pickContents(schemas: string[], callback: (assets: any[]) => void, query?: string): void; + /** + * Shows a dialog to pick a file. + */ + pickFile(): void; + /** * Register an function that is called when the field is initialized. * - * @param {function} callback: The callback to invoke. + * @param callback: The callback to invoke. */ onInit(callback: () => void): void; /** * Register an function that is called when the field is moved. * - * @param {function} callback: The callback to invoke. Argument 1: New position (number). + * @param callback: The callback to invoke. Argument 1: New position (number). */ onMoved(callback: (index: number) => void): void; /** * Register an function that is called whenever the field is disabled or enabled. * - * @param {function} callback: The callback to invoke. Argument 1: New disabled state (boolean, disabled = true, enabled = false). + * @param callback: The callback to invoke. Argument 1: New disabled state (boolean, disabled = true, enabled = false). */ onDisabled(callback: (isDisabled: boolean) => void): void; /** * Register an function that is called whenever the field language is changed. * - * @param {function} callback: The callback to invoke. Argument 1: Language code (string). + * @param callback: The callback to invoke. Argument 1: Language code (string). */ onLanguageChanged(callback: (language: string) => void): void; /** * Register an function that is called whenever the value of the field has changed. * - * @param {function} callback: The callback to invoke. Argument 1: Field value (any). + * @param callback: The callback to invoke. Argument 1: Field value (any). */ onValueChanged(callback: (value: any) => void): void; /** * Register an function that is called whenever the value of the content has changed. * - * @param {function} callback: The callback to invoke. Argument 1: Content value (any). + * @param callback: The callback to invoke. Argument 1: Content value (any). */ onFormValueChanged(callback: (value: any) => void): void; /** * Register an function that is called whenever the fullscreen mode has changed. * - * @param {function} callback: The callback to invoke. Argument 1: Fullscreen state (boolean, fullscreen on = true, fullscreen off = false). + * @param callback: The callback to invoke. Argument 1: Fullscreen state (boolean, fullscreen on = true, fullscreen off = false). */ onFullscreen(callback: (isFullscreen: boolean) => void): void; /** * Register an function that is called whenever the expanded mode has changed. * - * @param {function} callback: The callback to invoke. Argument 1: Expanded state (boolean, expanded on = true, expanded off = false). + * @param callback: The callback to invoke. Argument 1: Expanded state (boolean, expanded on = true, expanded off = false). */ onExpanded(callback: (isExpanded: boolean) => void): void; diff --git a/backend/src/Squidex/wwwroot/scripts/editor-sdk.js b/backend/src/Squidex/wwwroot/scripts/editor-sdk.js index 3284c6517..5e5c3b58a 100644 --- a/backend/src/Squidex/wwwroot/scripts/editor-sdk.js +++ b/backend/src/Squidex/wwwroot/scripts/editor-sdk.js @@ -242,6 +242,13 @@ function SquidexFormField() { var value; var valueHandler; + function raiseInit() { + if (initHandler && !initCalled && context) { + initHandler(context); + initCalled = true; + } + } + function raiseDisabled() { if (disabledHandler) { disabledHandler(disabled); @@ -284,13 +291,6 @@ function SquidexFormField() { } } - function raiseInit() { - if (initHandler && !initCalled && context) { - initHandler(context); - initCalled = true; - } - } - function eventListener(event) { if (event.source !== window) { var type = event.data.type; @@ -451,7 +451,7 @@ function SquidexFormField() { }, /** - * Notifies the parent to go to fullscreen mode. + * Notifies the parent to toggle the fullscreen mode. */ toggleFullscreen: function () { if (window.parent) { @@ -460,7 +460,7 @@ function SquidexFormField() { }, /** - * Notifies the parent to go to expanded mode. + * Notifies the parent to toggle the expanded mode. */ toggleExpanded: function () { if (window.parent) { @@ -517,10 +517,7 @@ function SquidexFormField() { var correlationId = new Date().getTime().toString(); - currentConfirm = { - correlationId: correlationId, - callback: callback - }; + currentConfirm = { correlationId: correlationId, callback: callback }; if (window.parent) { window.parent.postMessage({ type: 'confirm', title: title, text: text, correlationId: correlationId }, '*'); @@ -539,10 +536,7 @@ function SquidexFormField() { var correlationId = new Date().getTime().toString(); - currentPickAssets = { - correlationId: correlationId, - callback: callback - }; + currentPickAssets = { correlationId: correlationId, callback: callback }; if (window.parent) { window.parent.postMessage({ type: 'pickAssets', correlationId: correlationId }, '*'); @@ -563,16 +557,22 @@ function SquidexFormField() { var correlationId = new Date().getTime().toString(); - currentPickContents = { - correlationId: correlationId, - callback: callback, - }; + currentPickContents = { correlationId: correlationId, callback: callback }; if (window.parent) { window.parent.postMessage({ type: 'pickContents', correlationId: correlationId, schemas: schemas, query: query }, '*'); } }, + /** + * Shows a dialog to pick a file. + */ + pickFile: function () { + if (window.parent) { + window.parent.postMessage({ type: 'pickFile' }, '*'); + } + }, + /** * Register an function that is called when the field is initialized. * diff --git a/backend/src/Squidex/wwwroot/scripts/editor-simple.html b/backend/src/Squidex/wwwroot/scripts/editor-simple.html deleted file mode 100644 index a63869b46..000000000 --- a/backend/src/Squidex/wwwroot/scripts/editor-simple.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - -
    Toggle fullscreen - - - - - - - \ No newline at end of file diff --git a/backend/src/Squidex/wwwroot/scripts/sidebar-content.html b/backend/src/Squidex/wwwroot/scripts/sidebar-content.html index f57f38a8f..de643ebf9 100644 --- a/backend/src/Squidex/wwwroot/scripts/sidebar-content.html +++ b/backend/src/Squidex/wwwroot/scripts/sidebar-content.html @@ -7,14 +7,10 @@ + @@ -27,7 +23,7 @@ } - + + @@ -28,7 +23,7 @@ } - + - - - - - - - - - - - - -
    - - -
    -
    - - - - - \ No newline at end of file diff --git a/backend/src/Squidex/wwwroot/scripts/widget-context.html b/backend/src/Squidex/wwwroot/scripts/widget-context.html index 247eb93d0..c1b7ad494 100644 --- a/backend/src/Squidex/wwwroot/scripts/widget-context.html +++ b/backend/src/Squidex/wwwroot/scripts/widget-context.html @@ -7,23 +7,16 @@ + - + diff --git a/backend/src/Squidex/wwwroot/scripts/editor-sdk.d.ts b/backend/src/Squidex/wwwroot/scripts/editor-sdk.d.ts index c6f12f7b5..3d2377e8f 100644 --- a/backend/src/Squidex/wwwroot/scripts/editor-sdk.d.ts +++ b/backend/src/Squidex/wwwroot/scripts/editor-sdk.d.ts @@ -153,8 +153,9 @@ declare class SquidexFormField { * @param schemas: The list of schema names. * @param callback The callback to invoke when the dialog is completed or closed. * @param query: The initial query that is used in the UI. + * @param selectedIds: The selected ids to mark them as selected in the content selector dialog. */ - pickContents(schemas: string[], callback: (assets: any[]) => void, query?: string): void; + pickContents(schemas: string[], callback: (assets: any[]) => void, query?: string, selectedIds?: string[]): void; /** * Shows a dialog to pick a file. diff --git a/backend/src/Squidex/wwwroot/scripts/editor-sdk.js b/backend/src/Squidex/wwwroot/scripts/editor-sdk.js index 5e5c3b58a..6329cde8d 100644 --- a/backend/src/Squidex/wwwroot/scripts/editor-sdk.js +++ b/backend/src/Squidex/wwwroot/scripts/editor-sdk.js @@ -546,12 +546,13 @@ function SquidexFormField() { /** * Shows the dialog to pick assets. * - * @param {string} schemas: The list of schema names. + * @param {string[]} schemas: The list of schema names. * @param {function} callback The callback to invoke when the dialog is completed or closed. * @param {string} query: The initial filter that is used in the UI. + * @param {string[]} selectedIds: The selected ids to mark them as selected in the content selector dialog. */ - pickContents: function (schemas, callback, query) { - if (!isFunction(callback) || !isArrayOfStrings(schemas)) { + pickContents: function (schemas, callback, query, selectedIds) { + if (!isFunction(callback)) { return; } @@ -560,7 +561,7 @@ function SquidexFormField() { currentPickContents = { correlationId: correlationId, callback: callback }; if (window.parent) { - window.parent.postMessage({ type: 'pickContents', correlationId: correlationId, schemas: schemas, query: query }, '*'); + window.parent.postMessage({ type: 'pickContents', correlationId: correlationId, schemas: schemas, query: query, selectedIds: selectedIds }, '*'); } }, diff --git a/frontend/src/app/declarations.d.ts b/frontend/src/app/declarations.d.ts index 6f4364f73..352cc72ff 100644 --- a/frontend/src/app/declarations.d.ts +++ b/frontend/src/app/declarations.d.ts @@ -35,8 +35,11 @@ type Asset = { }; type Content = { - // The link of the content item. - href: string; + // The title of the content. + id: string; + + // The name of the schema. + schemaName: string; // The title of the content item. title: string; @@ -65,6 +68,12 @@ interface EditorProps { // The incoming value. value?: string; + // The base url. + baseUrl: string; + + // The name to the app. + appName: string; + // Called when the value has been changed. onChange?: OnChange; diff --git a/frontend/src/app/features/content/shared/forms/iframe-editor.component.html b/frontend/src/app/features/content/shared/forms/iframe-editor.component.html index dd547c731..cbb3eca0f 100644 --- a/frontend/src/app/features/content/shared/forms/iframe-editor.component.html +++ b/frontend/src/app/features/content/shared/forms/iframe-editor.component.html @@ -10,6 +10,7 @@ implements O public contentsQuery?: string = undefined; public contentsCorrelationId: any; - public contentsSchemas?: string[]; + public contentsSchemas?: ReadonlyArray; public contentsDialog = new DialogModel(); + public contentsSelectedIds?: ReadonlyArray; constructor( private readonly appsState: AppsState, @@ -212,12 +213,13 @@ export class IFrameEditorComponent extends StatefulComponent implements O this.assetsDialog.show(); } } else if (type === 'pickContents') { - const { correlationId, schemas, query } = event.data; + const { correlationId, schemas, query, selectedIds } = event.data; if (correlationId) { this.contentsQuery = query; this.contentsCorrelationId = correlationId; - this.contentsSchemas = this.schemaIds && this.schemaIds.length > 0 ? this.schemaIds : schemas; + this.contentsSelectedIds = Types.isArrayOfString(selectedIds) ? selectedIds : undefined; + this.contentsSchemas = this.schemaIds && this.schemaIds.length > 0 ? this.schemaIds : Types.isArrayOfString(schemas) ? schemas : undefined; this.contentsDialog.show(); } } diff --git a/frontend/src/app/shared/components/forms/rich-editor.component.ts b/frontend/src/app/shared/components/forms/rich-editor.component.ts index ce4e5a7c8..eebb6b52d 100644 --- a/frontend/src/app/shared/components/forms/rich-editor.component.ts +++ b/frontend/src/app/shared/components/forms/rich-editor.component.ts @@ -8,7 +8,7 @@ import { AfterViewInit, booleanAttribute, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, forwardRef, Input, OnDestroy, Output, ViewChild } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; import { ContentDto } from '@app/shared'; -import { ApiUrlConfig, AssetDto, AssetUploaderState, DialogModel, getContentValue, LanguageDto, ResourceLoaderService, StatefulControlComponent, Types } from '@app/shared/internal'; +import { ApiUrlConfig, AppsState, AssetDto, AssetUploaderState, DialogModel, getContentValue, LanguageDto, ResourceLoaderService, StatefulControlComponent, Types } from '@app/shared/internal'; export const SQX_RICH_EDITOR_CONTROL_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => RichEditorComponent), multi: true, @@ -67,6 +67,7 @@ export class RichEditorComponent extends StatefulControlComponent<{}, string> im constructor( private readonly apiUrl: ApiUrlConfig, + private readonly appsState: AppsState, private readonly assetUploader: AssetUploaderState, private readonly resourceLoader: ResourceLoaderService, ) { @@ -122,6 +123,8 @@ export class RichEditorComponent extends StatefulControlComponent<{}, string> im onChange: (value: string | undefined) => { this.callChange(value); }, + appName: this.appsState.appName, + baseUrl: this.apiUrl.buildUrl(''), canSelectAIText: this.hasChatBot, canSelectAssets: true, canSelectContents: !!this.schemaIds, @@ -208,16 +211,16 @@ export class RichEditorComponent extends StatefulControlComponent<{}, string> im return requests.map(r => () => uploadFile(r)); } - private buildAsset(asset: AssetDto) { + private buildAsset(asset: AssetDto): Asset { return { type: asset.mimeType, src: asset.fullUrl(this.apiUrl), fileName: asset.fileName }; } - private buildContent(content: ContentDto) { - return { url: this.apiUrl.buildUrl(content._links['self'].href), name: buildContentName(content, this.language) }; + private buildContent(content: ContentDto): Content { + return { ...content, title: buildContentTitle(content, this.language) }; } } -function buildContentName(content: ContentDto, language: LanguageDto) { +function buildContentTitle(content: ContentDto, language: LanguageDto) { const name = content.referenceFields .map(f => getContentValue(content, language, f, false)) diff --git a/frontend/src/app/shared/components/references/content-selector.component.ts b/frontend/src/app/shared/components/references/content-selector.component.ts index 3087595ad..251c58ab1 100644 --- a/frontend/src/app/shared/components/references/content-selector.component.ts +++ b/frontend/src/app/shared/components/references/content-selector.component.ts @@ -52,7 +52,12 @@ export class ContentSelectorComponent implements OnInit { public allowDuplicates?: boolean | null; @Input() - public alreadySelected: ReadonlyArray | undefined | null; + public alreadySelectedIds: ReadonlyArray | undefined | null; + + @Input() + public set alreadySelected(value: ReadonlyArray | undefined | null) { + this.alreadySelectedIds = value?.map(x => x.id); + } public schema!: SchemaDto; public schemas: ReadonlyArray = []; @@ -132,7 +137,7 @@ export class ContentSelectorComponent implements OnInit { } public isItemAlreadySelected(content: ContentDto) { - return !this.allowDuplicates && this.alreadySelected && !!this.alreadySelected.find(x => x.id === content.id); + return !this.allowDuplicates && this.alreadySelectedIds && this.alreadySelectedIds.indexOf(content.id) >= 0; } public emitClose() { From 552acb5db0335f13e40be85bad03ddcb3044b3bd Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 27 Oct 2023 18:12:14 +0200 Subject: [PATCH 34/35] Support class names in editor. --- backend/i18n/frontend_en.json | 2 + backend/i18n/frontend_fr.json | 2 + backend/i18n/frontend_it.json | 2 + backend/i18n/frontend_nl.json | 2 + backend/i18n/frontend_pt.json | 2 + backend/i18n/frontend_zh.json | 2 + backend/i18n/source/frontend_en.json | 2 + .../Schemas/StringFieldProperties.cs | 2 + .../Models/Fields/StringFieldPropertiesDto.cs | 5 + .../Config/IdentityServerServices.cs | 14 + .../Squidex/wwwroot/editor/squidex-editor.css | 2 +- .../Squidex/wwwroot/editor/squidex-editor.js | 250 +++++++++--------- frontend/src/app/declarations.d.ts | 3 + .../shared/forms/field-editor.component.html | 2 + .../fields/types/string-ui.component.html | 12 + .../fields/types/string-ui.component.ts | 4 + .../components/forms/rich-editor.component.ts | 6 +- .../src/app/shared/services/schemas.types.ts | 1 + .../src/app/shared/state/schemas.forms.ts | 1 + 19 files changed, 196 insertions(+), 120 deletions(-) diff --git a/backend/i18n/frontend_en.json b/backend/i18n/frontend_en.json index 7fab77ed4..0f002690e 100644 --- a/backend/i18n/frontend_en.json +++ b/backend/i18n/frontend_en.json @@ -921,6 +921,8 @@ "schemas.fieldTypes.string.characters": "Characters", "schemas.fieldTypes.string.charactersMax": "Max Characters", "schemas.fieldTypes.string.charactersMin": "Min Characters", + "schemas.fieldTypes.string.classNames": "Class Names", + "schemas.fieldTypes.string.classNamesHint": "The allowed CSS classes that the content creator can choose from.", "schemas.fieldTypes.string.contentType": "Content Type", "schemas.fieldTypes.string.description": "Titles, names, paragraphs.", "schemas.fieldTypes.string.folderId": "Asset folder", diff --git a/backend/i18n/frontend_fr.json b/backend/i18n/frontend_fr.json index 2f9cdd038..c8411c57d 100644 --- a/backend/i18n/frontend_fr.json +++ b/backend/i18n/frontend_fr.json @@ -921,6 +921,8 @@ "schemas.fieldTypes.string.characters": "Personnages", "schemas.fieldTypes.string.charactersMax": "Caractères maximum", "schemas.fieldTypes.string.charactersMin": "Caractères minimum", + "schemas.fieldTypes.string.classNames": "Class Names", + "schemas.fieldTypes.string.classNamesHint": "The allowed CSS classes that the content creator can choose from.", "schemas.fieldTypes.string.contentType": "Type de contenu", "schemas.fieldTypes.string.description": "Titres, noms, paragraphes.", "schemas.fieldTypes.string.folderId": "Dossier d'actifs", diff --git a/backend/i18n/frontend_it.json b/backend/i18n/frontend_it.json index 179ed7e6f..233a4352c 100644 --- a/backend/i18n/frontend_it.json +++ b/backend/i18n/frontend_it.json @@ -921,6 +921,8 @@ "schemas.fieldTypes.string.characters": "Caratteri", "schemas.fieldTypes.string.charactersMax": "Max numero di Caratteri", "schemas.fieldTypes.string.charactersMin": "Min numero di Caratteri", + "schemas.fieldTypes.string.classNames": "Class Names", + "schemas.fieldTypes.string.classNamesHint": "The allowed CSS classes that the content creator can choose from.", "schemas.fieldTypes.string.contentType": "Content Type", "schemas.fieldTypes.string.description": "Titoli, nomi, paragrafi.", "schemas.fieldTypes.string.folderId": "Asset folder", diff --git a/backend/i18n/frontend_nl.json b/backend/i18n/frontend_nl.json index 915086440..0a15099fc 100644 --- a/backend/i18n/frontend_nl.json +++ b/backend/i18n/frontend_nl.json @@ -921,6 +921,8 @@ "schemas.fieldTypes.string.characters": "Karakters", "schemas.fieldTypes.string.charactersMax": "Max. karakters", "schemas.fieldTypes.string.charactersMin": "Min. karakters", + "schemas.fieldTypes.string.classNames": "Class Names", + "schemas.fieldTypes.string.classNamesHint": "The allowed CSS classes that the content creator can choose from.", "schemas.fieldTypes.string.contentType": "Inhoudstype", "schemas.fieldTypes.string.description": "Titels, namen, alinea's.", "schemas.fieldTypes.string.folderId": "Documenten map", diff --git a/backend/i18n/frontend_pt.json b/backend/i18n/frontend_pt.json index d65e2eb7f..559412548 100644 --- a/backend/i18n/frontend_pt.json +++ b/backend/i18n/frontend_pt.json @@ -921,6 +921,8 @@ "schemas.fieldTypes.string.characters": "Personagens", "schemas.fieldTypes.string.charactersMax": "Personagens Max", "schemas.fieldTypes.string.charactersMin": "Personagens de Min", + "schemas.fieldTypes.string.classNames": "Class Names", + "schemas.fieldTypes.string.classNamesHint": "The allowed CSS classes that the content creator can choose from.", "schemas.fieldTypes.string.contentType": "Tipo de Conteúdo", "schemas.fieldTypes.string.description": "Títulos, nomes, parágrafos.", "schemas.fieldTypes.string.folderId": "Pasta de ativos", diff --git a/backend/i18n/frontend_zh.json b/backend/i18n/frontend_zh.json index 8c7278a1c..6816f8f03 100644 --- a/backend/i18n/frontend_zh.json +++ b/backend/i18n/frontend_zh.json @@ -921,6 +921,8 @@ "schemas.fieldTypes.string.characters": "字符", "schemas.fieldTypes.string.charactersMax": "最大字符数", "schemas.fieldTypes.string.charactersMin": "最小字符数", + "schemas.fieldTypes.string.classNames": "Class Names", + "schemas.fieldTypes.string.classNamesHint": "The allowed CSS classes that the content creator can choose from.", "schemas.fieldTypes.string.contentType": "内容类型", "schemas.fieldTypes.string.description": "标题、名称、段落。", "schemas.fieldTypes.string.folderId": "资源文件夹", diff --git a/backend/i18n/source/frontend_en.json b/backend/i18n/source/frontend_en.json index 7fab77ed4..0f002690e 100644 --- a/backend/i18n/source/frontend_en.json +++ b/backend/i18n/source/frontend_en.json @@ -921,6 +921,8 @@ "schemas.fieldTypes.string.characters": "Characters", "schemas.fieldTypes.string.charactersMax": "Max Characters", "schemas.fieldTypes.string.charactersMin": "Min Characters", + "schemas.fieldTypes.string.classNames": "Class Names", + "schemas.fieldTypes.string.classNamesHint": "The allowed CSS classes that the content creator can choose from.", "schemas.fieldTypes.string.contentType": "Content Type", "schemas.fieldTypes.string.description": "Titles, names, paragraphs.", "schemas.fieldTypes.string.folderId": "Asset folder", diff --git a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/StringFieldProperties.cs b/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/StringFieldProperties.cs index 11448b254..817af70ba 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/StringFieldProperties.cs +++ b/backend/src/Squidex.Domain.Apps.Core.Model/Schemas/StringFieldProperties.cs @@ -14,6 +14,8 @@ public sealed record StringFieldProperties : FieldProperties { public ReadonlyList? AllowedValues { get; init; } + public ReadonlyList? ClassNames { get; set; } + public LocalizedValue DefaultValues { get; init; } public string? DefaultValue { get; init; } diff --git a/backend/src/Squidex/Areas/Api/Controllers/Schemas/Models/Fields/StringFieldPropertiesDto.cs b/backend/src/Squidex/Areas/Api/Controllers/Schemas/Models/Fields/StringFieldPropertiesDto.cs index 3da6a0f4f..7de5d52a1 100644 --- a/backend/src/Squidex/Areas/Api/Controllers/Schemas/Models/Fields/StringFieldPropertiesDto.cs +++ b/backend/src/Squidex/Areas/Api/Controllers/Schemas/Models/Fields/StringFieldPropertiesDto.cs @@ -71,6 +71,11 @@ public sealed class StringFieldPropertiesDto : FieldPropertiesDto /// public int? MaxWords { get; set; } + /// + /// The class names for the editor. + /// + public ReadonlyList? ClassNames { get; set; } + /// /// The allowed values for the field value. /// diff --git a/backend/src/Squidex/Areas/IdentityServer/Config/IdentityServerServices.cs b/backend/src/Squidex/Areas/IdentityServer/Config/IdentityServerServices.cs index c25e7736e..79d356fa3 100644 --- a/backend/src/Squidex/Areas/IdentityServer/Config/IdentityServerServices.cs +++ b/backend/src/Squidex/Areas/IdentityServer/Config/IdentityServerServices.cs @@ -81,6 +81,12 @@ public static class IdentityServerServices }) .AddServer(builder => { + builder.AddEventHandler(builder => + { + builder.UseSingletonHandler() + .SetOrder(int.MinValue); + }); + builder.AddEventHandler(builder => { builder.UseSingletonHandler() @@ -171,3 +177,11 @@ public static class IdentityServerServices endpointUris.Add(uri); } } + +public sealed class TestHandler : IOpenIddictServerHandler +{ + public ValueTask HandleAsync(ValidateTokenRequestContext context) + { + return default; + } +} diff --git a/backend/src/Squidex/wwwroot/editor/squidex-editor.css b/backend/src/Squidex/wwwroot/editor/squidex-editor.css index e54155e92..f1bd3efb4 100644 --- a/backend/src/Squidex/wwwroot/editor/squidex-editor.css +++ b/backend/src/Squidex/wwwroot/editor/squidex-editor.css @@ -1 +1 @@ -.remirror-theme{width:100%}.remirror-theme{position:relative}.remirror-theme *{box-sizing:border-box}.remirror-editor{min-height:300px!important;max-height:500px}.MuiStack-root{padding:5px}.MuiStack-root>.MuiBox-root{margin-right:5px}.MuiBox-root>.MuiButtonBase-root{border-color:#dedfe3!important;border-radius:0}.MuiBox-root>.MuiButtonBase-root{border-left-width:0}.MuiBox-root>.MuiBox-root:first-child>.MuiButtonBase-root{border-left-width:1px}.MuiButtonBase-root.Mui-selected:hover{background-color:#3284f4!important}.remirror-editor-wrapper{padding-top:0!important}.custom-icon path{fill:#0000008a}.remirror-theme div.ProseMirror{border:1px solid #dedfe3!important;border-radius:0!important;box-shadow:none!important}.MuiTooltip-popper>div{background-color:#1a2129;border-radius:0;font-size:85%;font-weight:400;padding:.5rem}.squidex-editor-disabled{pointer-events:none}.squidex-editor-menu{border:1px solid #dedfe3;border-bottom:0}.squidex-editor-counter{border:1px solid #dedfe3;border-top:0;font-size:85%;font-weight:400;opacity:.8;padding:4px 10px 4px 4px;text-align:right}.squidex-editor-image-view{border:1px solid #dedfe3;border-radius:0;display:inline-block;margin-top:15px;margin-bottom:15px;overflow:hidden}.squidex-editor-image-view .squidex-editor-button{bottom:10px;left:10px;position:absolute}.squidex-editor-image-element{display:block;max-width:400px;max-height:400px}.squidex-editor-image-info{left:10px;top:10px;position:absolute;background-color:#3284f4;color:#fff;font-size:85%;font-weight:400;padding:2px 6px}.squidex-editor-content-link{align-items:center;border-radius:2px;border:1px solid #dedfe3;padding:10px;display:flex;flex-direction:row;flex-wrap:nowrap;margin-top:10px;margin-bottom:10px}.squidex-editor-content-schema{display:block;overflow-x:hidden;overflow-y:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;min-width:0;width:auto;border-right:1px solid #c2c4cc;color:#8b8f9d;flex-shrink:0;padding-left:10px;padding-right:10px;width:200px}.squidex-editor-content-name{display:block;overflow-x:hidden;overflow-y:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;min-width:0;width:auto;padding-left:10px;padding-right:0}.squidex-editor-html{margin-bottom:10px;margin-top:10px;position:relative}.squidex-editor-html-label{left:6px;top:0;position:absolute;color:#8b8f9d;font-size:85%;font-weight:400}.squidex-editor-html textarea{font-family:monospace;padding:30px 20px 20px}.squidex-editor-button{background-color:#fff;border-radius:0;border:1px solid #dedfe3;bottom:10px;font-size:85%;font-weight:400;line-height:1;padding:6px 12px}.squidex-editor-button:hover{background-color:#f5f5f5}.squidex-editor-input{border:1px solid #dedfe3;border-radius:0;box-sizing:border-box;height:30px;margin-left:0;margin-right:5px;outline:none;padding:6px 12px}.squidex-editor-input:active{border-color:#3284f4}.squidex-editor-floating{border:1px solid #dedfe3}.squidex-editor-floating .MuiBox-root{margin-right:0!important}.squidex-editor-floating .MuiButtonBase-root{height:30px}.squidex-editor-modal-wrapper,.squidex-editor-modal-backdrop{bottom:0;left:0;right:0;top:0;position:absolute}.squidex-editor-modal-backdrop{background-color:#00000003}.squidex-editor-modal-window{left:50%;top:50%;background-color:#fff;border:1px solid #dedfe3;border-radius:0;box-sizing:border-box;margin-top:-50px;margin-left:-150px;position:absolute;width:350px}.squidex-editor-modal-body{display:flex;flex-direction:row;flex-grow:1;padding-top:0!important}.squidex-editor-modal-body,.squidex-editor-modal-title{padding:15px}.squidex-editor-modal-title{font-size:85%}.squidex-editor-modal-window input{flex-grow:1} +.remirror-theme{width:100%}.remirror-theme{position:relative}.remirror-theme *{box-sizing:border-box}.remirror-editor{min-height:300px!important;max-height:500px}.MuiStack-root>.MuiBox-root{margin-right:5px}.MuiBox-root>.MuiButtonBase-root{border-color:#dedfe3!important;border-radius:0}.MuiBox-root>.MuiButtonBase-root{border-left-width:0!important}.MuiBox-root>.MuiBox-root:first-child>.MuiButtonBase-root{border-left-width:1px!important}.MuiStack-root>.MuiBox-root>.MuiButtonBase-root:first-child{border-left-width:1px!important}.MuiButtonBase-root.Mui-selected:hover{background-color:#3284f4!important}.remirror-editor-wrapper{padding-top:0!important}.custom-icon path{fill:#0000008a}.remirror-theme div.ProseMirror{border:1px solid #dedfe3!important;border-radius:0!important;box-shadow:none!important}.MuiTooltip-popper>div{background-color:#1a2129;border-radius:0;font-size:85%;font-weight:400;padding:.5rem}.MuiMenu-paper{transform:none!important}.squidex-editor-disabled{pointer-events:none}.squidex-editor-menu{border:1px solid #dedfe3;border-bottom:0;padding:5px}.squidex-editor-counter{border:1px solid #dedfe3;border-top:0;font-size:85%;font-weight:400;opacity:.8;padding:4px 10px 4px 4px;text-align:right}.squidex-editor-image-view{border:1px solid #dedfe3;border-radius:0;display:inline-block;margin-top:15px;margin-bottom:15px;overflow:hidden}.squidex-editor-image-view .squidex-editor-button{bottom:10px;left:10px;position:absolute}.squidex-editor-image-element{display:block;max-width:400px;max-height:400px}.squidex-editor-image-info{left:10px;top:10px;position:absolute;background-color:#3284f4;color:#fff;font-size:85%;font-weight:400;padding:2px 6px}.squidex-editor-content-link{align-items:center;border-radius:2px;border:1px solid #dedfe3;padding:10px;display:flex;flex-direction:row;flex-wrap:nowrap;margin-top:10px;margin-bottom:10px}.squidex-editor-content-schema{display:block;overflow-x:hidden;overflow-y:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;min-width:0;width:auto;border-right:1px solid #c2c4cc;color:#8b8f9d;flex-shrink:0;padding-left:10px;padding-right:10px;width:200px}.squidex-editor-content-name{display:block;overflow-x:hidden;overflow-y:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;min-width:0;width:auto;padding-left:10px;padding-right:0}.squidex-editor-html{margin-bottom:10px;margin-top:10px;position:relative}.squidex-editor-html-label{left:6px;top:0;position:absolute;color:#8b8f9d;font-size:85%;font-weight:400}.squidex-editor-html textarea{font-family:monospace;padding:30px 20px 20px}.squidex-editor-button{background-color:#fff;border-radius:0;border:1px solid #dedfe3;bottom:10px;font-size:85%;font-weight:400;line-height:1;padding:6px 12px}.squidex-editor-button:hover{background-color:#f5f5f5}.squidex-editor-input{border:1px solid #dedfe3;border-radius:0;box-sizing:border-box;height:30px;margin-left:0;margin-right:5px;outline:none;padding:6px 12px}.squidex-editor-input:active{border-color:#3284f4}.squidex-editor-floating{border:1px solid #dedfe3}.squidex-editor-floating .MuiBox-root{margin-right:0!important}.squidex-editor-floating .MuiButtonBase-root{height:30px}.squidex-editor-modal-wrapper,.squidex-editor-modal-backdrop{bottom:0;left:0;right:0;top:0;position:absolute}.squidex-editor-modal-backdrop{background-color:#00000003}.squidex-editor-modal-window{left:50%;top:50%;background-color:#fff;border:0;border-radius:.25rem;box-sizing:border-box;box-shadow:0 3px 16px #0003;margin-top:-50px;margin-left:-150px;position:absolute;width:350px}.squidex-editor-modal-body{display:flex;flex-direction:row;flex-grow:1;padding-top:0!important}.squidex-editor-modal-body,.squidex-editor-modal-title{padding:15px}.squidex-editor-modal-title{font-size:85%}.squidex-editor-modal-window input{flex-grow:1}.b:before{content:"";font-family:monospace;font-size:90%}.b:after{content:"";font-family:monospace;font-size:90%} diff --git a/backend/src/Squidex/wwwroot/editor/squidex-editor.js b/backend/src/Squidex/wwwroot/editor/squidex-editor.js index 14ea1cc92..aec7c0e7e 100644 --- a/backend/src/Squidex/wwwroot/editor/squidex-editor.js +++ b/backend/src/Squidex/wwwroot/editor/squidex-editor.js @@ -1,4 +1,4 @@ -var ZO=Object.defineProperty;var e_=(e,t,r)=>t in e?ZO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var gc=(e,t,r)=>(e_(e,typeof t!="symbol"?t+"":t,r),r);function t_(e,t){for(var r=0;rn[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(o){if(o.ep)return;o.ep=!0;const i=r(o);fetch(o.href,i)}})();var Ru=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ln(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var S4={exports:{}},Mh={},E4={exports:{}},we={};/** +var s_=Object.defineProperty;var a_=(e,t,r)=>t in e?s_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var vc=(e,t,r)=>(a_(e,typeof t!="symbol"?t+"":t,r),r);function l_(e,t){for(var r=0;rn[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(o){if(o.ep)return;o.ep=!0;const i=r(o);fetch(o.href,i)}})();var Pu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var T4={exports:{}},_h={},O4={exports:{}},we={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var ZO=Object.defineProperty;var e_=(e,t,r)=>t in e?ZO(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Td=Symbol.for("react.element"),r_=Symbol.for("react.portal"),n_=Symbol.for("react.fragment"),o_=Symbol.for("react.strict_mode"),i_=Symbol.for("react.profiler"),s_=Symbol.for("react.provider"),a_=Symbol.for("react.context"),l_=Symbol.for("react.forward_ref"),c_=Symbol.for("react.suspense"),u_=Symbol.for("react.memo"),d_=Symbol.for("react.lazy"),Fx=Symbol.iterator;function f_(e){return e===null||typeof e!="object"?null:(e=Fx&&e[Fx]||e["@@iterator"],typeof e=="function"?e:null)}var C4={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M4=Object.assign,T4={};function ec(e,t,r){this.props=e,this.context=t,this.refs=T4,this.updater=r||C4}ec.prototype.isReactComponent={};ec.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ec.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function O4(){}O4.prototype=ec.prototype;function hv(e,t,r){this.props=e,this.context=t,this.refs=T4,this.updater=r||C4}var mv=hv.prototype=new O4;mv.constructor=hv;M4(mv,ec.prototype);mv.isPureReactComponent=!0;var Vx=Array.isArray,_4=Object.prototype.hasOwnProperty,gv={current:null},A4={key:!0,ref:!0,__self:!0,__source:!0};function N4(e,t,r){var n,o={},i=null,s=null;if(t!=null)for(n in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)_4.call(t,n)&&!A4.hasOwnProperty(n)&&(o[n]=t[n]);var a=arguments.length-2;if(a===1)o.children=r;else if(1t in e?ZO(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var v_=S,y_=Symbol.for("react.element"),b_=Symbol.for("react.fragment"),x_=Object.prototype.hasOwnProperty,k_=v_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,w_={key:!0,ref:!0,__self:!0,__source:!0};function R4(e,t,r){var n,o={},i=null,s=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(n in t)x_.call(t,n)&&!w_.hasOwnProperty(n)&&(o[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)o[n]===void 0&&(o[n]=t[n]);return{$$typeof:y_,type:e,key:i,ref:s,props:o,_owner:k_.current}}Mh.Fragment=b_;Mh.jsx=R4;Mh.jsxs=R4;S4.exports=Mh;var O=S4.exports,y1={exports:{}};(function(e,t){var r=typeof Reflect<"u"?Reflect.construct:void 0,n=Object.defineProperty,o=Error.captureStackTrace;o===void 0&&(o=function(c){var u=new Error;n(c,"stack",{configurable:!0,get:function(){var f=u.stack;return n(this,"stack",{configurable:!0,value:f,writable:!0}),f},set:function(f){n(c,"stack",{configurable:!0,value:f,writable:!0})}})});function i(l){l!==void 0&&n(this,"message",{configurable:!0,value:l,writable:!0});var c=this.constructor.name;c!==void 0&&c!==this.name&&n(this,"name",{configurable:!0,value:c,writable:!0}),o(this,this.constructor)}i.prototype=Object.create(Error.prototype,{constructor:{configurable:!0,value:i,writable:!0}});var s=function(){function l(u,d){return n(u,"name",{configurable:!0,value:d})}try{var c=function(){};if(l(c,"foo"),c.name==="foo")return l}catch{}}();function a(l,c){if(c==null||c===Error)c=i;else if(typeof c!="function")throw new TypeError("super_ should be a function");var u;if(typeof l=="string")u=l,l=r!==void 0?function(){return r(c,arguments,this.constructor)}:function(){c.apply(this,arguments)},s!==void 0&&(s(l,u),u=void 0);else if(typeof l!="function")throw new TypeError("constructor should be either a string or a function");l.super_=l.super=c;var d={constructor:{configurable:!0,value:l,writable:!0}};return u!==void 0&&(d.name={configurable:!0,value:u,writable:!0}),l.prototype=Object.create(c.prototype,d),l}t=e.exports=a,t.BaseError=i})(y1,y1.exports);var P4=y1.exports,Ux="ProseMirror-selectednode",yv="",zi="\0",Wx="__state_override__",S_={LastNodeCompatible:"lastNodeCompatible",FormattingMark:"formattingMark",FormattingNode:"formattingNode",NodeCursor:"nodeCursor",FontStyle:"fontStyle",Link:"link",Color:"color",Alignment:"alignment",Indentation:"indentation",Behavior:"behavior",Code:"code",InlineNode:"inline",ListContainerNode:"listContainer",ListItemNode:"listItemNode",Block:"block",BlockNode:"block",TextBlock:"textBlock",ExcludeInputRules:"excludeFromInputRules",PreventExits:"preventsExits",Media:"media"},oe=S_,ti=Symbol.for("__remirror__"),$t=(e=>(e.PlainExtension="RemirrorPlainExtension",e.NodeExtension="RemirrorNodeExtension",e.MarkExtension="RemirrorMarkExtension",e.PlainExtensionConstructor="RemirrorPlainExtensionConstructor",e.NodeExtensionConstructor="RemirrorNodeExtensionConstructor",e.MarkExtensionConstructor="RemirrorMarkExtensionConstructor",e.Manager="RemirrorManager",e.Preset="RemirrorPreset",e.PresetConstructor="RemirrorPresetConstructor",e))($t||{}),Ae=(e=>(e[e.Critical=1e6]="Critical",e[e.Highest=1e5]="Highest",e[e.High=1e4]="High",e[e.Medium=1e3]="Medium",e[e.Default=100]="Default",e[e.Low=10]="Low",e[e.Lowest=0]="Lowest",e))(Ae||{}),Nr=(e=>(e[e.None=0]="None",e[e.Create=1]="Create",e[e.EditorView=2]="EditorView",e[e.Runtime=3]="Runtime",e[e.Destroy=4]="Destroy",e))(Nr||{}),D=(e=>(e.Undo="_|undo|_",e.Redo="_|redo|_",e.Bold="_|bold|_",e.Italic="_|italic|_",e.Underline="_|underline|_",e.Strike="_|strike|_",e.Code="_|code|_",e.Paragraph="_|paragraph|_",e.H1="_|h1|_",e.H2="_|h2|_",e.H3="_|h3|_",e.H4="_|h4|_",e.H5="_|h5|_",e.H6="_|h6|_",e.TaskList="_|task|_",e.BulletList="_|bullet|_",e.OrderedList="_|number|_",e.Quote="_|quote|_",e.Divider="_|divider|_",e.Codeblock="_|codeblock|_",e.ClearFormatting="_|clear|_",e.Superscript="_|sup|_",e.Subscript="_|sub|_",e.LeftAlignment="_|left-align|_",e.CenterAlignment="_|center-align|_",e.RightAlignment="_|right-align|_",e.JustifyAlignment="_|justify-align|_",e.InsertLink="_|link|_",e.Find="_|find|_",e.FindBackwards="_|find-backwards|_",e.FindReplace="_|find-replace|_",e.AddFootnote="_|footnote|_",e.AddComment="_|comment|_",e.ContextMenu="_|context-menu|_",e.IncreaseFontSize="_|inc-font-size|_",e.DecreaseFontSize="_|dec-font-size|_",e.IncreaseIndent="_|indent|_",e.DecreaseIndent="_|dedent|_",e.Shortcuts="_|shortcuts|_",e.Copy="_|copy|_",e.Cut="_|cut|_",e.Paste="_|paste|_",e.PastePlain="_|paste-plain|_",e.SelectAll="_|select-all|_",e.Format="_|format|_",e))(D||{}),H=(e=>(e.PROD="RMR0000",e.UNKNOWN="RMR0001",e.INVALID_COMMAND_ARGUMENTS="RMR0002",e.CUSTOM="RMR0003",e.CORE_HELPERS="RMR0004",e.MUTATION="RMR0005",e.INTERNAL="RMR0006",e.MISSING_REQUIRED_EXTENSION="RMR0007",e.MANAGER_PHASE_ERROR="RMR0008",e.INVALID_GET_EXTENSION="RMR0010",e.INVALID_MANAGER_ARGUMENTS="RMR0011",e.SCHEMA="RMR0012",e.HELPERS_CALLED_IN_OUTER_SCOPE="RMR0013",e.INVALID_MANAGER_EXTENSION="RMR0014",e.DUPLICATE_COMMAND_NAMES="RMR0016",e.DUPLICATE_HELPER_NAMES="RMR0017",e.NON_CHAINABLE_COMMAND="RMR0018",e.INVALID_EXTENSION="RMR0019",e.INVALID_CONTENT="RMR0021",e.INVALID_NAME="RMR0050",e.EXTENSION="RMR0100",e.EXTENSION_SPEC="RMR0101",e.EXTENSION_EXTRA_ATTRIBUTES="RMR0102",e.INVALID_SET_EXTENSION_OPTIONS="RMR0103",e.REACT_PROVIDER_CONTEXT="RMR0200",e.REACT_GET_ROOT_PROPS="RMR0201",e.REACT_EDITOR_VIEW="RMR0202",e.REACT_CONTROLLED="RMR0203",e.REACT_NODE_VIEW="RMR0204",e.REACT_GET_CONTEXT="RMR0205",e.REACT_COMPONENTS="RMR0206",e.REACT_HOOKS="RMR0207",e.I18N_CONTEXT="RMR0300",e))(H||{}),E_=function(t){return C_(t)&&!M_(t)};function C_(e){return!!e&&typeof e=="object"}function M_(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||__(e)}var T_=typeof Symbol=="function"&&Symbol.for,O_=T_?Symbol.for("react.element"):60103;function __(e){return e.$$typeof===O_}function A_(e){return Array.isArray(e)?[]:{}}function Pu(e,t){return t.clone!==!1&&t.isMergeableObject(e)?El(A_(e),e,t):e}function N_(e,t,r){return e.concat(t).map(function(n){return Pu(n,r)})}function R_(e,t){if(!t.customMerge)return El;var r=t.customMerge(e);return typeof r=="function"?r:El}function P_(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function Kx(e){return Object.keys(e).concat(P_(e))}function z4(e,t){try{return t in e}catch{return!1}}function z_(e,t){return z4(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function L_(e,t,r){var n={};return r.isMergeableObject(e)&&Kx(e).forEach(function(o){n[o]=Pu(e[o],r)}),Kx(t).forEach(function(o){z_(e,o)||(z4(e,o)&&r.isMergeableObject(t[o])?n[o]=R_(o,r)(e[o],t[o],r):n[o]=Pu(t[o],r))}),n}function El(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||N_,r.isMergeableObject=r.isMergeableObject||E_,r.cloneUnlessOtherwiseSpecified=Pu;var n=Array.isArray(t),o=Array.isArray(e),i=n===o;return i?n?r.arrayMerge(e,t,r):L_(e,t,r):Pu(t,r)}El.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,o){return El(n,o,r)},{})};var I_=El,D_=I_;const $_=Ln(D_);var H_=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r};const B_=Ln(H_);/*! + */var E_=S,C_=Symbol.for("react.element"),M_=Symbol.for("react.fragment"),T_=Object.prototype.hasOwnProperty,O_=E_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,__={key:!0,ref:!0,__self:!0,__source:!0};function I4(e,t,r){var n,o={},i=null,s=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(n in t)T_.call(t,n)&&!__.hasOwnProperty(n)&&(o[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)o[n]===void 0&&(o[n]=t[n]);return{$$typeof:C_,type:e,key:i,ref:s,props:o,_owner:O_.current}}_h.Fragment=M_;_h.jsx=I4;_h.jsxs=I4;T4.exports=_h;var O=T4.exports,k1={exports:{}};(function(e,t){var r=typeof Reflect<"u"?Reflect.construct:void 0,n=Object.defineProperty,o=Error.captureStackTrace;o===void 0&&(o=function(c){var u=new Error;n(c,"stack",{configurable:!0,get:function(){var f=u.stack;return n(this,"stack",{configurable:!0,value:f,writable:!0}),f},set:function(f){n(c,"stack",{configurable:!0,value:f,writable:!0})}})});function i(l){l!==void 0&&n(this,"message",{configurable:!0,value:l,writable:!0});var c=this.constructor.name;c!==void 0&&c!==this.name&&n(this,"name",{configurable:!0,value:c,writable:!0}),o(this,this.constructor)}i.prototype=Object.create(Error.prototype,{constructor:{configurable:!0,value:i,writable:!0}});var s=function(){function l(u,d){return n(u,"name",{configurable:!0,value:d})}try{var c=function(){};if(l(c,"foo"),c.name==="foo")return l}catch{}}();function a(l,c){if(c==null||c===Error)c=i;else if(typeof c!="function")throw new TypeError("super_ should be a function");var u;if(typeof l=="string")u=l,l=r!==void 0?function(){return r(c,arguments,this.constructor)}:function(){c.apply(this,arguments)},s!==void 0&&(s(l,u),u=void 0);else if(typeof l!="function")throw new TypeError("constructor should be either a string or a function");l.super_=l.super=c;var d={constructor:{configurable:!0,value:l,writable:!0}};return u!==void 0&&(d.name={configurable:!0,value:u,writable:!0}),l.prototype=Object.create(c.prototype,d),l}t=e.exports=a,t.BaseError=i})(k1,k1.exports);var D4=k1.exports,qx="ProseMirror-selectednode",kv="",zi="\0",Gx="__state_override__",A_={LastNodeCompatible:"lastNodeCompatible",FormattingMark:"formattingMark",FormattingNode:"formattingNode",NodeCursor:"nodeCursor",FontStyle:"fontStyle",Link:"link",Color:"color",Alignment:"alignment",Indentation:"indentation",Behavior:"behavior",Code:"code",InlineNode:"inline",ListContainerNode:"listContainer",ListItemNode:"listItemNode",Block:"block",BlockNode:"block",TextBlock:"textBlock",ExcludeInputRules:"excludeFromInputRules",PreventExits:"preventsExits",Media:"media"},oe=A_,ti=Symbol.for("__remirror__"),$t=(e=>(e.PlainExtension="RemirrorPlainExtension",e.NodeExtension="RemirrorNodeExtension",e.MarkExtension="RemirrorMarkExtension",e.PlainExtensionConstructor="RemirrorPlainExtensionConstructor",e.NodeExtensionConstructor="RemirrorNodeExtensionConstructor",e.MarkExtensionConstructor="RemirrorMarkExtensionConstructor",e.Manager="RemirrorManager",e.Preset="RemirrorPreset",e.PresetConstructor="RemirrorPresetConstructor",e))($t||{}),Ae=(e=>(e[e.Critical=1e6]="Critical",e[e.Highest=1e5]="Highest",e[e.High=1e4]="High",e[e.Medium=1e3]="Medium",e[e.Default=100]="Default",e[e.Low=10]="Low",e[e.Lowest=0]="Lowest",e))(Ae||{}),Nr=(e=>(e[e.None=0]="None",e[e.Create=1]="Create",e[e.EditorView=2]="EditorView",e[e.Runtime=3]="Runtime",e[e.Destroy=4]="Destroy",e))(Nr||{}),D=(e=>(e.Undo="_|undo|_",e.Redo="_|redo|_",e.Bold="_|bold|_",e.Italic="_|italic|_",e.Underline="_|underline|_",e.Strike="_|strike|_",e.Code="_|code|_",e.Paragraph="_|paragraph|_",e.H1="_|h1|_",e.H2="_|h2|_",e.H3="_|h3|_",e.H4="_|h4|_",e.H5="_|h5|_",e.H6="_|h6|_",e.TaskList="_|task|_",e.BulletList="_|bullet|_",e.OrderedList="_|number|_",e.Quote="_|quote|_",e.Divider="_|divider|_",e.Codeblock="_|codeblock|_",e.ClearFormatting="_|clear|_",e.Superscript="_|sup|_",e.Subscript="_|sub|_",e.LeftAlignment="_|left-align|_",e.CenterAlignment="_|center-align|_",e.RightAlignment="_|right-align|_",e.JustifyAlignment="_|justify-align|_",e.InsertLink="_|link|_",e.Find="_|find|_",e.FindBackwards="_|find-backwards|_",e.FindReplace="_|find-replace|_",e.AddFootnote="_|footnote|_",e.AddComment="_|comment|_",e.ContextMenu="_|context-menu|_",e.IncreaseFontSize="_|inc-font-size|_",e.DecreaseFontSize="_|dec-font-size|_",e.IncreaseIndent="_|indent|_",e.DecreaseIndent="_|dedent|_",e.Shortcuts="_|shortcuts|_",e.Copy="_|copy|_",e.Cut="_|cut|_",e.Paste="_|paste|_",e.PastePlain="_|paste-plain|_",e.SelectAll="_|select-all|_",e.Format="_|format|_",e))(D||{}),H=(e=>(e.PROD="RMR0000",e.UNKNOWN="RMR0001",e.INVALID_COMMAND_ARGUMENTS="RMR0002",e.CUSTOM="RMR0003",e.CORE_HELPERS="RMR0004",e.MUTATION="RMR0005",e.INTERNAL="RMR0006",e.MISSING_REQUIRED_EXTENSION="RMR0007",e.MANAGER_PHASE_ERROR="RMR0008",e.INVALID_GET_EXTENSION="RMR0010",e.INVALID_MANAGER_ARGUMENTS="RMR0011",e.SCHEMA="RMR0012",e.HELPERS_CALLED_IN_OUTER_SCOPE="RMR0013",e.INVALID_MANAGER_EXTENSION="RMR0014",e.DUPLICATE_COMMAND_NAMES="RMR0016",e.DUPLICATE_HELPER_NAMES="RMR0017",e.NON_CHAINABLE_COMMAND="RMR0018",e.INVALID_EXTENSION="RMR0019",e.INVALID_CONTENT="RMR0021",e.INVALID_NAME="RMR0050",e.EXTENSION="RMR0100",e.EXTENSION_SPEC="RMR0101",e.EXTENSION_EXTRA_ATTRIBUTES="RMR0102",e.INVALID_SET_EXTENSION_OPTIONS="RMR0103",e.REACT_PROVIDER_CONTEXT="RMR0200",e.REACT_GET_ROOT_PROPS="RMR0201",e.REACT_EDITOR_VIEW="RMR0202",e.REACT_CONTROLLED="RMR0203",e.REACT_NODE_VIEW="RMR0204",e.REACT_GET_CONTEXT="RMR0205",e.REACT_COMPONENTS="RMR0206",e.REACT_HOOKS="RMR0207",e.I18N_CONTEXT="RMR0300",e))(H||{}),N_=function(t){return R_(t)&&!P_(t)};function R_(e){return!!e&&typeof e=="object"}function P_(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||I_(e)}var z_=typeof Symbol=="function"&&Symbol.for,L_=z_?Symbol.for("react.element"):60103;function I_(e){return e.$$typeof===L_}function D_(e){return Array.isArray(e)?[]:{}}function zu(e,t){return t.clone!==!1&&t.isMergeableObject(e)?El(D_(e),e,t):e}function $_(e,t,r){return e.concat(t).map(function(n){return zu(n,r)})}function H_(e,t){if(!t.customMerge)return El;var r=t.customMerge(e);return typeof r=="function"?r:El}function B_(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function Yx(e){return Object.keys(e).concat(B_(e))}function $4(e,t){try{return t in e}catch{return!1}}function F_(e,t){return $4(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function V_(e,t,r){var n={};return r.isMergeableObject(e)&&Yx(e).forEach(function(o){n[o]=zu(e[o],r)}),Yx(t).forEach(function(o){F_(e,o)||($4(e,o)&&r.isMergeableObject(t[o])?n[o]=H_(o,r)(e[o],t[o],r):n[o]=zu(t[o],r))}),n}function El(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||$_,r.isMergeableObject=r.isMergeableObject||N_,r.cloneUnlessOtherwiseSpecified=zu;var n=Array.isArray(t),o=Array.isArray(e),i=n===o;return i?n?r.arrayMerge(e,t,r):V_(e,t,r):zu(t,r)}El.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,o){return El(n,o,r)},{})};var j_=El,U_=j_;const W_=Dn(U_);var K_=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r};const q_=Dn(K_);/*! * isobject * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. - */var L4=function(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===!1};/*! + */var H4=function(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===!1};/*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. - */var F_=L4;function qx(e){return F_(e)===!0&&Object.prototype.toString.call(e)==="[object Object]"}var V_=function(t){var r,n;return!(qx(t)===!1||(r=t.constructor,typeof r!="function")||(n=r.prototype,qx(n)===!1)||n.hasOwnProperty("isPrototypeOf")===!1)};/*! + */var G_=H4;function Jx(e){return G_(e)===!0&&Object.prototype.toString.call(e)==="[object Object]"}var Y_=function(t){var r,n;return!(Jx(t)===!1||(r=t.constructor,typeof r!="function")||(n=r.prototype,Jx(n)===!1)||n.hasOwnProperty("isPrototypeOf")===!1)};/*! * is-extendable * * Copyright (c) 2015-2017, Jon Schlinkert. * Released under the MIT License. - */var j_=V_,U_=function(t){return j_(t)||typeof t=="function"||Array.isArray(t)};/*! + */var J_=Y_,X_=function(t){return J_(t)||typeof t=="function"||Array.isArray(t)};/*! * object.omit * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. - */var W_=U_,K_=function(t,r,n){if(!W_(t))return{};typeof r=="function"&&(n=r,r=[]),typeof r=="string"&&(r=[r]);for(var o=typeof n=="function",i=Object.keys(t),s={},a=0;a * * Copyright (c) 2014-2015 Jon Schlinkert, contributors. * Licensed under the MIT License - */var q_=L4,G_=function(t,r){if(!q_(t)&&typeof t!="function")return{};var n={};if(typeof r=="string")return r in t&&(n[r]=t[r]),n;for(var o=r.length,i=-1;++i{let d=l.prefixes[u]||"",f=c;return r===!1&&(n&&(f=f.normalize("NFD").replace(new RegExp(`[^a-zA-ZØßø0-9${n.join("")}]`,"g"),"")),n||(f=f.normalize("NFD").replace(/[^a-zA-ZØßø0-9]/g,""),d="")),n&&(d=d.replace(new RegExp(`[^${n.join("")}]`,"g"),"")),u===0?d+f:!d&&!f?"":s&&!d&&o.match(/\s/)?" "+f:(d||o)+f}).filter(Boolean)}function X_(e){const t=e.matchAll(I4).next().value,r=t?t.index:0;return e.slice(0,r+1).toUpperCase()+e.slice(r+1).toLowerCase()}function $4(e,t){return D4(e,t).reduce((r,n)=>r+X_(n),"")}function Gx(e,t){return D4(e,{...t,prefix:"-"}).join("").toLowerCase()}function x1(e,t,r,n){var o,i=!1,s=0;function a(){o&&clearTimeout(o)}function l(){a(),i=!0}typeof t!="boolean"&&(n=r,r=t,t=void 0);function c(){for(var u=arguments.length,d=new Array(u),f=0;fe?m():t!==!0&&(o=setTimeout(n?b:m,n===void 0?e-h:e))}return c.cancel=l,c}function H4(e,t,r){return r===void 0?x1(e,t,!1):x1(e,r,t!==!1)}function it(e,t,r){const n=e[t];return B4(!Oh(n),r),n}function B4(e,t){if(!e)throw new Q_(t)}var Q_=class extends P4.BaseError{constructor(){super(...arguments),this.name="AssertionError"}};function At(e){return Object.entries(e)}function zu(e){return Object.keys(e)}function Th(e){return Object.values(e)}function dr(e,t,r){return e.includes(t,r)}function ee(e){return Object.assign(Object.create(null),e)}function F4(e){return Object.prototype.toString.call(e)}function V4(e){return F4(e).slice(8,-1)}function Od(e,t){return r=>typeof r!==e?!1:t?t(r):!0}function xv(e){return t=>V4(t)===e}var Oh=Od("undefined"),ne=Od("string"),Jt=Od("number",e=>!Number.isNaN(e)),_e=Od("function");function Z_(e){return e===null}function k1(e){return e===!0||e===!1}function hs(e){if(V4(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})}function eA(e){return e==null||/^[bns]/.test(typeof e)}function Zi(e){return Z_(e)||Oh(e)}function Zt(e){return!Zi(e)&&(_e(e)||Od("object")(e))}var tA=xv("RegExp");function rA(e){return xv("Map")(e)}function nA(e){return xv("Set")(e)}function hp(e){return Zt(e)&&!rA(e)&&!nA(e)&&Object.keys(e).length===0}var ct=Array.isArray;function Mo(e){return ct(e)&&e.length===0}function Yx(e){return ct(e)&&e.length>0}function oA(e){return e.charAt(0).toUpperCase()+e.slice(1)}function xa(e,t,r=n=>!!n){t.lastIndex=0;const n=[],o=t.flags;let i;o.includes("g")||(t=new RegExp(t.source,`g${o}`));do i=t.exec(e),i&&n.push(i);while(r(i));return t.lastIndex=0,n}function mp(){const e=Date.now(),t=mp.last||e;return mp.last=e>t?e:t+1}mp.last=0;function Cl(e=""){return`${e}${mp().toString(36)}`}function j4(e){return bv(e,t=>!Oh(t))}function iA(e){if(!hs(e))throw new Error("An invalid value was passed into this clone utility. Expected a plain object");return{...e}}var U4=B_;function Ml(e,t=!1){const r=t?[...e].reverse():e,n=new Set(r);return t?[...n].reverse():[...n]}function W4(e){const t=[];for(const r of e){const n=ct(r)?W4(r):[r];t.push(...n)}return t}function K4(){}function q4(...e){return $_.all(e,{isMergeableObject:hs})}function _d({min:e,max:t,value:r}){return rt?t:r}function G4(e){return e[e.length-1]}function ra(e,t){return[...e].map((r,n)=>({value:r,index:n})).sort((r,n)=>t(r.value,n.value)||r.index-n.index).map(({value:r})=>r)}function sA(e,t,r){try{if(ne(t)&&t in e)return e[t];ct(t)&&(t=`['${t.join("']['")}']`);let n=e;return t.replace(/\[\s*(["'])(.*?)\1\s*]|^\s*(\w+)\s*(?=\.|\[|$)|\.\s*(\w*)\s*(?=\.|\[|$)|\[\s*(-?\d+)\s*]/g,(o,i,s,a,l,c)=>(n=n[s||a||l||c],"")),n===void 0?r:n}catch{return r}}function aA(e,t){const r=iA(t);let n=r;for(const[o,i]of e.entries()){const s=o>=e.length-1;let a=n[i];if(s){if(ct(n)){const l=Number.parseInt(i.toString(),10);Jt(l)&&n.splice(l,1)}else Reflect.deleteProperty(n,i);return r}if(eA(a))return r;a=ct(a)?[...a]:{...a},n[i]=a,n=a}return r}function lA(e){return t=>sA(t,e)}function Y4(e,t,r=!1){const n=[],o=new Set,i=_e(t)?t:lA(t),s=r?[...e].reverse():e;for(const a of s){const l=i(a);o.has(l)||(o.add(l),n.push(a))}return r?n.reverse():n}function kv(e,t){const r=ct(e)?e[0]:e;return Jt(t)?r<=t?Array.from({length:t+1-r},(n,o)=>o+r):Array.from({length:r+1-t},(n,o)=>-1*o+r):Array.from({length:Math.abs(r)},(n,o)=>(r<0?-1:1)*o)}function Jx(e,...t){const r=t.filter(Jt);return e>=Math.min(...r)&&e<=Math.max(...r)}function J4(e){return _e(e)?e():e}var X4="https://remirror.io/docs/errors",cA={[H.UNKNOWN]:"An error occurred but we're not quite sure why. 🧐",[H.INVALID_COMMAND_ARGUMENTS]:"The arguments passed to the command method were invalid.",[H.CUSTOM]:"This is a custom error, possibly thrown by an external library.",[H.CORE_HELPERS]:"An error occurred in a function called from the `@remirror/core-helpers` library.",[H.MUTATION]:"Mutation of immutable value detected.",[H.INTERNAL]:"This is an error which should not occur and is internal to the remirror codebase.",[H.MISSING_REQUIRED_EXTENSION]:"Your editor is missing a required extension.",[H.MANAGER_PHASE_ERROR]:"This occurs when accessing a method or property before it is available.",[H.INVALID_GET_EXTENSION]:"The user requested an invalid extension from the getExtensions method. Please check the `createExtensions` return method is returning an extension with the defined constructor.",[H.INVALID_MANAGER_ARGUMENTS]:"Invalid value(s) passed into `Manager` constructor. Only `Presets` and `Extensions` are supported.",[H.SCHEMA]:"There is a problem with the schema or you are trying to access a node / mark that doesn't exists.",[H.HELPERS_CALLED_IN_OUTER_SCOPE]:"The `helpers` method which is passed into the ``create*` method should only be called within returned method since it relies on an active view (not present in the outer scope).",[H.INVALID_MANAGER_EXTENSION]:"You requested an invalid extension from the manager.",[H.DUPLICATE_COMMAND_NAMES]:"Command method names must be unique within the editor.",[H.DUPLICATE_HELPER_NAMES]:"Helper method names must be unique within the editor.",[H.NON_CHAINABLE_COMMAND]:"Attempted to chain a non chainable command.",[H.INVALID_EXTENSION]:"The provided extension is invalid.",[H.INVALID_CONTENT]:"The content provided to the editor is not supported.",[H.INVALID_NAME]:"An invalid name was used for the extension.",[H.EXTENSION]:"An error occurred within an extension. More details should be made available.",[H.EXTENSION_SPEC]:"The spec was defined without calling the `defaults`, `parse` or `dom` methods.",[H.EXTENSION_EXTRA_ATTRIBUTES]:"Extra attributes must either be a string or an object.",[H.INVALID_SET_EXTENSION_OPTIONS]:"A call to `extension.setOptions` was made with invalid keys.",[H.REACT_PROVIDER_CONTEXT]:"`useRemirrorContext` was called outside of the `remirror` context. It can only be used within an active remirror context created by the ``.",[H.REACT_GET_ROOT_PROPS]:"`getRootProps` has been attached to the DOM more than once. It should only be attached to the dom once per editor.",[H.REACT_EDITOR_VIEW]:"A problem occurred adding the editor view to the dom.",[H.REACT_CONTROLLED]:"There is a problem with your controlled editor setup.",[H.REACT_NODE_VIEW]:"Something went wrong with your custom ReactNodeView Component.",[H.REACT_GET_CONTEXT]:"You attempted to call `getContext` provided by the `useRemirror` prop during the first render of the editor. This is not possible and should only be after the editor first mounts.",[H.REACT_COMPONENTS]:"An error occurred within a remirror component.",[H.REACT_HOOKS]:"An error occurred within a remirror hook.",[H.I18N_CONTEXT]:"You called `useI18n()` outside of an `I18nProvider` context."};function uA(e){return ne(e)&&dr(Th(H),e)}function dA(e,t){const r=cA[e],n=r?`${r} + */var eA=H4,tA=function(t,r){if(!eA(t)&&typeof t!="function")return{};var n={};if(typeof r=="string")return r in t&&(n[r]=t[r]),n;for(var o=r.length,i=-1;++i{let d=l.prefixes[u]||"",f=c;return r===!1&&(n&&(f=f.normalize("NFD").replace(new RegExp(`[^a-zA-ZØßø0-9${n.join("")}]`,"g"),"")),n||(f=f.normalize("NFD").replace(/[^a-zA-ZØßø0-9]/g,""),d="")),n&&(d=d.replace(new RegExp(`[^${n.join("")}]`,"g"),"")),u===0?d+f:!d&&!f?"":s&&!d&&o.match(/\s/)?" "+f:(d||o)+f}).filter(Boolean)}function oA(e){const t=e.matchAll(B4).next().value,r=t?t.index:0;return e.slice(0,r+1).toUpperCase()+e.slice(r+1).toLowerCase()}function V4(e,t){return F4(e,t).reduce((r,n)=>r+oA(n),"")}function Xx(e,t){return F4(e,{...t,prefix:"-"}).join("").toLowerCase()}function S1(e,t,r,n){var o,i=!1,s=0;function a(){o&&clearTimeout(o)}function l(){a(),i=!0}typeof t!="boolean"&&(n=r,r=t,t=void 0);function c(){for(var u=arguments.length,d=new Array(u),f=0;fe?m():t!==!0&&(o=setTimeout(n?b:m,n===void 0?e-h:e))}return c.cancel=l,c}function j4(e,t,r){return r===void 0?S1(e,t,!1):S1(e,r,t!==!1)}function it(e,t,r){const n=e[t];return U4(!Nh(n),r),n}function U4(e,t){if(!e)throw new iA(t)}var iA=class extends D4.BaseError{constructor(){super(...arguments),this.name="AssertionError"}};function At(e){return Object.entries(e)}function Lu(e){return Object.keys(e)}function Ah(e){return Object.values(e)}function fr(e,t,r){return e.includes(t,r)}function ee(e){return Object.assign(Object.create(null),e)}function W4(e){return Object.prototype.toString.call(e)}function K4(e){return W4(e).slice(8,-1)}function _d(e,t){return r=>typeof r!==e?!1:t?t(r):!0}function Sv(e){return t=>K4(t)===e}var Nh=_d("undefined"),ne=_d("string"),Jt=_d("number",e=>!Number.isNaN(e)),_e=_d("function");function sA(e){return e===null}function E1(e){return e===!0||e===!1}function hs(e){if(K4(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})}function aA(e){return e==null||/^[bns]/.test(typeof e)}function Zi(e){return sA(e)||Nh(e)}function Zt(e){return!Zi(e)&&(_e(e)||_d("object")(e))}var lA=Sv("RegExp");function cA(e){return Sv("Map")(e)}function uA(e){return Sv("Set")(e)}function gp(e){return Zt(e)&&!cA(e)&&!uA(e)&&Object.keys(e).length===0}var ct=Array.isArray;function Mo(e){return ct(e)&&e.length===0}function Qx(e){return ct(e)&&e.length>0}function dA(e){return e.charAt(0).toUpperCase()+e.slice(1)}function xa(e,t,r=n=>!!n){t.lastIndex=0;const n=[],o=t.flags;let i;o.includes("g")||(t=new RegExp(t.source,`g${o}`));do i=t.exec(e),i&&n.push(i);while(r(i));return t.lastIndex=0,n}function vp(){const e=Date.now(),t=vp.last||e;return vp.last=e>t?e:t+1}vp.last=0;function Cl(e=""){return`${e}${vp().toString(36)}`}function q4(e){return wv(e,t=>!Nh(t))}function fA(e){if(!hs(e))throw new Error("An invalid value was passed into this clone utility. Expected a plain object");return{...e}}var G4=q_;function Ml(e,t=!1){const r=t?[...e].reverse():e,n=new Set(r);return t?[...n].reverse():[...n]}function Y4(e){const t=[];for(const r of e){const n=ct(r)?Y4(r):[r];t.push(...n)}return t}function J4(){}function X4(...e){return W_.all(e,{isMergeableObject:hs})}function Ad({min:e,max:t,value:r}){return rt?t:r}function Q4(e){return e[e.length-1]}function ra(e,t){return[...e].map((r,n)=>({value:r,index:n})).sort((r,n)=>t(r.value,n.value)||r.index-n.index).map(({value:r})=>r)}function pA(e,t,r){try{if(ne(t)&&t in e)return e[t];ct(t)&&(t=`['${t.join("']['")}']`);let n=e;return t.replace(/\[\s*(["'])(.*?)\1\s*]|^\s*(\w+)\s*(?=\.|\[|$)|\.\s*(\w*)\s*(?=\.|\[|$)|\[\s*(-?\d+)\s*]/g,(o,i,s,a,l,c)=>(n=n[s||a||l||c],"")),n===void 0?r:n}catch{return r}}function hA(e,t){const r=fA(t);let n=r;for(const[o,i]of e.entries()){const s=o>=e.length-1;let a=n[i];if(s){if(ct(n)){const l=Number.parseInt(i.toString(),10);Jt(l)&&n.splice(l,1)}else Reflect.deleteProperty(n,i);return r}if(aA(a))return r;a=ct(a)?[...a]:{...a},n[i]=a,n=a}return r}function mA(e){return t=>pA(t,e)}function Z4(e,t,r=!1){const n=[],o=new Set,i=_e(t)?t:mA(t),s=r?[...e].reverse():e;for(const a of s){const l=i(a);o.has(l)||(o.add(l),n.push(a))}return r?n.reverse():n}function Ev(e,t){const r=ct(e)?e[0]:e;return Jt(t)?r<=t?Array.from({length:t+1-r},(n,o)=>o+r):Array.from({length:r+1-t},(n,o)=>-1*o+r):Array.from({length:Math.abs(r)},(n,o)=>(r<0?-1:1)*o)}function Zx(e,...t){const r=t.filter(Jt);return e>=Math.min(...r)&&e<=Math.max(...r)}function eE(e){return _e(e)?e():e}var tE="https://remirror.io/docs/errors",gA={[H.UNKNOWN]:"An error occurred but we're not quite sure why. 🧐",[H.INVALID_COMMAND_ARGUMENTS]:"The arguments passed to the command method were invalid.",[H.CUSTOM]:"This is a custom error, possibly thrown by an external library.",[H.CORE_HELPERS]:"An error occurred in a function called from the `@remirror/core-helpers` library.",[H.MUTATION]:"Mutation of immutable value detected.",[H.INTERNAL]:"This is an error which should not occur and is internal to the remirror codebase.",[H.MISSING_REQUIRED_EXTENSION]:"Your editor is missing a required extension.",[H.MANAGER_PHASE_ERROR]:"This occurs when accessing a method or property before it is available.",[H.INVALID_GET_EXTENSION]:"The user requested an invalid extension from the getExtensions method. Please check the `createExtensions` return method is returning an extension with the defined constructor.",[H.INVALID_MANAGER_ARGUMENTS]:"Invalid value(s) passed into `Manager` constructor. Only `Presets` and `Extensions` are supported.",[H.SCHEMA]:"There is a problem with the schema or you are trying to access a node / mark that doesn't exists.",[H.HELPERS_CALLED_IN_OUTER_SCOPE]:"The `helpers` method which is passed into the ``create*` method should only be called within returned method since it relies on an active view (not present in the outer scope).",[H.INVALID_MANAGER_EXTENSION]:"You requested an invalid extension from the manager.",[H.DUPLICATE_COMMAND_NAMES]:"Command method names must be unique within the editor.",[H.DUPLICATE_HELPER_NAMES]:"Helper method names must be unique within the editor.",[H.NON_CHAINABLE_COMMAND]:"Attempted to chain a non chainable command.",[H.INVALID_EXTENSION]:"The provided extension is invalid.",[H.INVALID_CONTENT]:"The content provided to the editor is not supported.",[H.INVALID_NAME]:"An invalid name was used for the extension.",[H.EXTENSION]:"An error occurred within an extension. More details should be made available.",[H.EXTENSION_SPEC]:"The spec was defined without calling the `defaults`, `parse` or `dom` methods.",[H.EXTENSION_EXTRA_ATTRIBUTES]:"Extra attributes must either be a string or an object.",[H.INVALID_SET_EXTENSION_OPTIONS]:"A call to `extension.setOptions` was made with invalid keys.",[H.REACT_PROVIDER_CONTEXT]:"`useRemirrorContext` was called outside of the `remirror` context. It can only be used within an active remirror context created by the ``.",[H.REACT_GET_ROOT_PROPS]:"`getRootProps` has been attached to the DOM more than once. It should only be attached to the dom once per editor.",[H.REACT_EDITOR_VIEW]:"A problem occurred adding the editor view to the dom.",[H.REACT_CONTROLLED]:"There is a problem with your controlled editor setup.",[H.REACT_NODE_VIEW]:"Something went wrong with your custom ReactNodeView Component.",[H.REACT_GET_CONTEXT]:"You attempted to call `getContext` provided by the `useRemirror` prop during the first render of the editor. This is not possible and should only be after the editor first mounts.",[H.REACT_COMPONENTS]:"An error occurred within a remirror component.",[H.REACT_HOOKS]:"An error occurred within a remirror hook.",[H.I18N_CONTEXT]:"You called `useI18n()` outside of an `I18nProvider` context."};function vA(e){return ne(e)&&fr(Ah(H),e)}function yA(e,t){const r=gA[e],n=r?`${r} `:"",o=t?`${t} -`:"";return`${n}${o}For more information visit ${X4}#${e.toLowerCase()}`}var Q4=class extends P4.BaseError{constructor({code:e,message:t,disableLogging:r=!1}={}){const n=uA(e)?e:H.CUSTOM;super(dA(n,t)),this.errorCode=n,this.url=`${X4}#${n.toLowerCase()}`,r||console.error(this.message)}static create(e={}){return new Q4(e)}};function te(e,t){if(!e)throw Q4.create(t)}function _h(e){if(typeof e!="object"||e===null)return e;const t=Symbol.toStringTag in e&&e[Symbol.toStringTag]==="Module"?e.default??e:e;return t&&typeof e=="object"&&"__esModule"in t&&t.__esModule&&t.default!==void 0?t.default:t}function Hs(e,t={}){return e}function Kt(e){this.content=e}Kt.prototype={constructor:Kt,find:function(e){for(var t=0;t>1}};Kt.from=function(e){if(e instanceof Kt)return e;var t=[];if(e)for(var r in e)t.push(r,e[r]);return new Kt(t)};function Z4(e,t,r){for(let n=0;;n++){if(n==e.childCount||n==t.childCount)return e.childCount==t.childCount?null:r;let o=e.child(n),i=t.child(n);if(o==i){r+=o.nodeSize;continue}if(!o.sameMarkup(i))return r;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)r++;return r}if(o.content.size||i.content.size){let s=Z4(o.content,i.content,r+1);if(s!=null)return s}r+=o.nodeSize}}function eE(e,t,r,n){for(let o=e.childCount,i=t.childCount;;){if(o==0||i==0)return o==i?null:{a:r,b:n};let s=e.child(--o),a=t.child(--i),l=s.nodeSize;if(s==a){r-=l,n-=l;continue}if(!s.sameMarkup(a))return{a:r,b:n};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;ct&&n(l,o+a,i||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,t-u),Math.min(l.content.size,r-u),n,o+u)}a=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,r,n,o){let i="",s=!0;return this.nodesBetween(t,r,(a,l)=>{a.isText?(i+=a.text.slice(Math.max(t,l)-l,r-l),s=!n):a.isLeaf?(o?i+=typeof o=="function"?o(a):o:a.type.spec.leafText&&(i+=a.type.spec.leafText(a)),s=!n):!s&&a.isBlock&&(i+=n,s=!0)},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let r=this.lastChild,n=t.firstChild,o=this.content.slice(),i=0;for(r.isText&&r.sameMarkup(n)&&(o[o.length-1]=r.withText(r.text+n.text),i=1);it)for(let i=0,s=0;st&&((sr)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,r-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,r-s-1))),n.push(a),o+=a.nodeSize),s=l}return new R(n,o)}cutByIndex(t,r){return t==r?R.empty:t==0&&r==this.content.length?this:new R(this.content.slice(t,r))}replaceChild(t,r){let n=this.content[t];if(n==r)return this;let o=this.content.slice(),i=this.size+r.nodeSize-n.nodeSize;return o[t]=r,new R(o,i)}addToStart(t){return new R([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new R(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let r=0;rthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,o=0;;n++){let i=this.child(n),s=o+i.nodeSize;if(s>=t)return s==t||r>0?ef(n+1,s):ef(n,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,r){if(!r)return R.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new R(r.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return R.empty;let r,n=0;for(let o=0;othis.type.rank&&(r||(r=t.slice(0,o)),r.push(this),n=!0),r&&r.push(i)}}return r||(r=t.slice()),n||r.push(this),r}removeFromSet(t){for(let r=0;rn.type.rank-o.type.rank),r}}Te.none=[];class vp extends Error{}class K{constructor(t,r,n){this.content=t,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,r){let n=rE(this.content,t+this.openStart,r);return n&&new K(n,this.openStart,this.openEnd)}removeBetween(t,r){return new K(tE(this.content,t+this.openStart,r+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,r){if(!r)return K.empty;let n=r.openStart||0,o=r.openEnd||0;if(typeof n!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new K(R.fromJSON(t,r.content),n,o)}static maxOpen(t,r=!0){let n=0,o=0;for(let i=t.firstChild;i&&!i.isLeaf&&(r||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=t.lastChild;i&&!i.isLeaf&&(r||!i.type.spec.isolating);i=i.lastChild)o++;return new K(t,n,o)}}K.empty=new K(R.empty,0,0);function tE(e,t,r){let{index:n,offset:o}=e.findIndex(t),i=e.maybeChild(n),{index:s,offset:a}=e.findIndex(r);if(o==t||i.isText){if(a!=r&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(r))}if(n!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(n,i.copy(tE(i.content,t-o-1,r-o-1)))}function rE(e,t,r,n){let{index:o,offset:i}=e.findIndex(t),s=e.maybeChild(o);if(i==t||s.isText)return n&&!n.canReplace(o,o,r)?null:e.cut(0,t).append(r).append(e.cut(t));let a=rE(s.content,t-i-1,r);return a&&e.replaceChild(o,s.copy(a))}function fA(e,t,r){if(r.openStart>e.depth)throw new vp("Inserted content deeper than insertion position");if(e.depth-r.openStart!=t.depth-r.openEnd)throw new vp("Inconsistent open depths");return nE(e,t,r,0)}function nE(e,t,r,n){let o=e.index(n),i=e.node(n);if(o==t.index(n)&&n=0&&e.isText&&e.sameMarkup(t[r])?t[r]=e.withText(t[r].text+e.text):t.push(e)}function hu(e,t,r,n){let o=(t||e).node(r),i=0,s=t?t.index(r):o.childCount;e&&(i=e.index(r),e.depth>r?i++:e.textOffset&&(Gs(e.nodeAfter,n),i++));for(let a=i;ao&&w1(e,t,o+1),s=n.depth>o&&w1(r,n,o+1),a=[];return hu(null,e,o,a),i&&s&&t.index(o)==r.index(o)?(oE(i,s),Gs(Ys(i,iE(e,t,r,n,o+1)),a)):(i&&Gs(Ys(i,yp(e,t,o+1)),a),hu(t,r,o,a),s&&Gs(Ys(s,yp(r,n,o+1)),a)),hu(n,null,o,a),new R(a)}function yp(e,t,r){let n=[];if(hu(null,e,r,n),e.depth>r){let o=w1(e,t,r+1);Gs(Ys(o,yp(e,t,r+1)),n)}return hu(t,null,r,n),new R(n)}function pA(e,t){let r=t.depth-e.openStart,o=t.node(r).copy(e.content);for(let i=r-1;i>=0;i--)o=t.node(i).copy(R.from(o));return{start:o.resolveNoCache(e.openStart+r),end:o.resolveNoCache(o.content.size-e.openEnd-r)}}class Tl{constructor(t,r,n){this.pos=t,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,r=this.index(this.depth);if(r==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],o=t.child(r);return n?t.child(r).cut(n):o}get nodeBefore(){let t=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(t).cut(0,r):t==0?null:this.parent.child(t-1)}posAtIndex(t,r){r=this.resolveDepth(r);let n=this.path[r*3],o=r==0?0:this.path[r*3-1]+1;for(let i=0;i0;r--)if(this.start(r)<=t&&this.end(r)>=t)return r;return 0}blockRange(t=this,r){if(t.pos=0;n--)if(t.pos<=this.end(n)&&(!r||r(this.node(n))))return new na(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&r<=t.content.size))throw new RangeError("Position "+r+" out of range");let n=[],o=0,i=r;for(let s=t;;){let{index:a,offset:l}=s.content.findIndex(i),c=i-l;if(n.push(s,a,o+l),!c||(s=s.child(a),s.isText))break;i=c-1,o+=l+1}return new Tl(r,n,i)}static resolveCached(t,r){for(let o=0;ot&&this.nodesBetween(t,r,i=>(n.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),sE(this.marks,t)}contentMatchAt(t){let r=this.type.contentMatch.matchFragment(this.content,0,t);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(t,r,n=R.empty,o=0,i=n.childCount){let s=this.contentMatchAt(t).matchFragment(n,o,i),a=s&&s.matchFragment(this.content,r);if(!a||!a.validEnd)return!1;for(let l=o;lr.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let t={type:this.type.name};for(let r in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(r=>r.toJSON())),t}static fromJSON(t,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(t.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(r.text,n)}let o=R.fromJSON(t,r.content);return t.nodeType(r.type).create(r.attrs,o,n)}};Bi.prototype.text=void 0;class bp extends Bi{constructor(t,r,n,o){if(super(t,r,null,o),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):sE(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,r){return this.text.slice(t,r)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new bp(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new bp(this.type,this.attrs,t,this.marks)}cut(t=0,r=this.text.length){return t==0&&r==this.text.length?this:this.withText(this.text.slice(t,r))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function sE(e,t){for(let r=e.length-1;r>=0;r--)t=e[r].type.name+"("+t+")";return t}class oa{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,r){let n=new gA(t,r);if(n.next==null)return oa.empty;let o=aE(n);n.next&&n.err("Unexpected trailing text");let i=SA(wA(o));return EA(i,n),i}matchType(t){for(let r=0;rc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function r(n){t.push(n);for(let o=0;o{let i=o+(n.validEnd?"*":" ")+" ";for(let s=0;s"+t.indexOf(n.next[s].next);return i}).join(` -`)}}oa.empty=new oa(!0);class gA{constructor(t,r){this.string=t,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function aE(e){let t=[];do t.push(vA(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function vA(e){let t=[];do t.push(yA(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function yA(e){let t=kA(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=bA(e,t);else break;return t}function Xx(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function bA(e,t){let r=Xx(e),n=r;return e.eat(",")&&(e.next!="}"?n=Xx(e):n=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:t}}function xA(e,t){let r=e.nodeTypes,n=r[t];if(n)return[n];let o=[];for(let i in r){let s=r[i];s.groups.indexOf(t)>-1&&o.push(s)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function kA(e){if(e.eat("(")){let t=aE(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=xA(e,e.next).map(r=>(e.inline==null?e.inline=r.isInline:e.inline!=r.isInline&&e.err("Mixing inline and block content"),{type:"name",value:r}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function wA(e){let t=[[]];return o(i(e,0),r()),t;function r(){return t.push([])-1}function n(s,a,l){let c={term:l,to:a};return t[s].push(c),c}function o(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=r())}else if(s.type=="star"){let l=r();return n(a,l),o(i(s.expr,l),l),[n(l)]}else if(s.type=="plus"){let l=r();return o(i(s.expr,a),l),o(i(s.expr,l),l),[n(l)]}else{if(s.type=="opt")return[n(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c{e[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u{c||o.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=t[n.join(",")]=new oa(n.indexOf(e.length-1)>-1);for(let s=0;s-1}allowsMarks(t){if(this.markSet==null)return!0;for(let r=0;rn[i]=new fE(i,r,s));let o=r.spec.topNode||"doc";if(!n[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let i in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};class CA{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Ad{constructor(t,r,n,o){this.name=t,this.rank=r,this.schema=n,this.spec=o,this.attrs=dE(o.attrs),this.excluded=null;let i=cE(this.attrs);this.instance=i?new Te(this,i):null}create(t=null){return!t&&this.instance?this.instance:new Te(this,uE(this.attrs,t))}static compile(t,r){let n=Object.create(null),o=0;return t.forEach((i,s)=>n[i]=new Ad(i,o++,r,s)),n}removeFromSet(t){for(var r=0;r-1}}let MA=class{constructor(t){this.cached=Object.create(null);let r=this.spec={};for(let o in t)r[o]=t[o];r.nodes=Kt.from(t.nodes),r.marks=Kt.from(t.marks||{}),this.nodes=E1.compile(this.spec.nodes,this),this.marks=Ad.compile(this.spec.marks,this);let n=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=n[s]||(n[s]=oa.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=a=="_"?null:a?Zx(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:Zx(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,r=null,n,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof E1){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(r,n,o)}text(t,r){let n=this.nodes.text;return new bp(n,n.defaultAttrs,t,Te.setFrom(r))}mark(t,r){return typeof t=="string"&&(t=this.marks[t]),t.create(r)}nodeFromJSON(t){return Bi.fromJSON(this,t)}markFromJSON(t){return Te.fromJSON(this,t)}nodeType(t){let r=this.nodes[t];if(!r)throw new RangeError("Unknown node type: "+t);return r}};function Zx(e,t){let r=[];for(let n=0;n-1)&&r.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[n]+"'")}return r}let wv=class C1{constructor(t,r){this.schema=t,this.rules=r,this.tags=[],this.styles=[],r.forEach(n=>{n.tag?this.tags.push(n):n.style&&this.styles.push(n)}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let o=t.nodes[n.node];return o.contentMatch.matchType(o)})}parse(t,r={}){let n=new tk(this,r,!1);return n.addAll(t,r.from,r.to),n.finish()}parseSlice(t,r={}){let n=new tk(this,r,!0);return n.addAll(t,r.from,r.to),K.maxOpen(n.finish())}matchTag(t,r,n){for(let o=n?this.tags.indexOf(n)+1:0;ot.length&&(a.charCodeAt(t.length)!=61||a.slice(t.length+1)!=r))){if(s.getAttrs){let l=s.getAttrs(r);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(t){let r=[];function n(o){let i=o.priority==null?50:o.priority,s=0;for(;s{n(s=rk(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in t.nodes){let i=t.nodes[o].spec.parseDOM;i&&i.forEach(s=>{n(s=rk(s)),s.node||s.ignore||s.mark||(s.node=o)})}return r}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new C1(t,C1.schemaRules(t)))}};const pE={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},TA={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},hE={ol:!0,ul:!0},xp=1,kp=2,mu=4;function ek(e,t,r){return t!=null?(t?xp:0)|(t==="full"?kp:0):e&&e.whitespace=="pre"?xp|kp:r&~mu}class tf{constructor(t,r,n,o,i,s,a){this.type=t,this.attrs=r,this.marks=n,this.pendingMarks=o,this.solid=i,this.options=a,this.content=[],this.activeMarks=Te.none,this.stashMarks=[],this.match=s||(a&mu?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let r=this.type.contentMatch.fillBefore(R.from(t));if(r)this.match=this.type.contentMatch.matchFragment(r);else{let n=this.type.contentMatch,o;return(o=n.findWrapping(t.type))?(this.match=n,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&xp)){let n=this.content[this.content.length-1],o;if(n&&n.isText&&(o=/[ \t\r\n\u000c]+$/.exec(n.text))){let i=n;n.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let r=R.from(this.content);return!t&&this.match&&(r=r.append(this.match.fillBefore(R.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}popFromStashMark(t){for(let r=this.stashMarks.length-1;r>=0;r--)if(t.eq(this.stashMarks[r]))return this.stashMarks.splice(r,1)[0]}applyPending(t){for(let r=0,n=this.pendingMarks;rthis.addAll(t)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(t,()=>{this.addElementByRule(t,i,i.consuming===!1?o:void 0)})}leafFallback(t){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(` -`))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let r=Te.none,n=Te.none;for(let o=0;o{s.clearMark(a)&&(n=a.addToSet(n))}):r=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(r),s.consuming===!1)i=s;else break}return[r,n]}addElementByRule(t,r,n){let o,i,s;r.node?(i=this.parser.schema.nodes[r.node],i.isLeaf?this.insertNode(i.create(r.attrs))||this.leafFallback(t):o=this.enter(i,r.attrs||null,r.preserveWhitespace)):(s=this.parser.schema.marks[r.mark].create(r.attrs),this.addPendingMark(s));let a=this.top;if(i&&i.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(r.getContent)this.findInside(t),r.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=t;typeof r.contentElement=="string"?l=t.querySelector(r.contentElement):typeof r.contentElement=="function"?l=r.contentElement(t):r.contentElement&&(l=r.contentElement),this.findAround(t,l,!0),this.addAll(l)}o&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(t,r,n){let o=r||0;for(let i=r?t.childNodes[r]:t.firstChild,s=n==null?null:t.childNodes[n];i!=s;i=i.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(i);this.findAtPoint(t,o)}findPlace(t){let r,n;for(let o=this.open;o>=0;o--){let i=this.nodes[o],s=i.findWrapping(t);if(s&&(!r||r.length>s.length)&&(r=s,n=i,!s.length)||i.solid)break}if(!r)return!1;this.sync(n);for(let o=0;othis.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let r=this.open;r>=0;r--)if(this.nodes[r]==t)return this.open=r,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let o=n.length-1;o>=0;o--)t+=n[o].nodeSize;r&&t++}return t}findAtPoint(t,r){if(this.find)for(let n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let r=t.split("/"),n=this.options.context,o=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(o?0:1),s=(a,l)=>{for(;a>=0;a--){let c=r[a];if(c==""){if(a==r.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&o?this.nodes[l].type:n&&l>=i?n.node(l-i).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;l--}}return!0};return s(r.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let r=t.depth;r>=0;r--){let n=t.node(r).contentMatchAt(t.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}addPendingMark(t){let r=RA(t,this.top.pendingMarks);r&&this.top.stashMarks.push(r),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,r){for(let n=this.open;n>=0;n--){let o=this.nodes[n];if(o.pendingMarks.lastIndexOf(t)>-1)o.pendingMarks=t.removeFromSet(o.pendingMarks);else{o.activeMarks=t.removeFromSet(o.activeMarks);let s=o.popFromStashMark(t);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==r)break}}}function OA(e){for(let t=e.firstChild,r=null;t;t=t.nextSibling){let n=t.nodeType==1?t.nodeName.toLowerCase():null;n&&hE.hasOwnProperty(n)&&r?(r.appendChild(t),t=r):n=="li"?r=t:n&&(r=null)}}function _A(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function AA(e){let t=/\s*([\w-]+)\s*:\s*([^;]+)/g,r,n=[];for(;r=t.exec(e);)n.push(r[1],r[2].trim());return n}function rk(e){let t={};for(let r in e)t[r]=e[r];return t}function NA(e,t){let r=t.schema.nodes;for(let n in r){let o=r[n];if(!o.allowsMarkType(e))continue;let i=[],s=a=>{i.push(a);for(let l=0;l{if(i.length||s.marks.length){let a=0,l=0;for(;a=0;o--){let i=this.serializeMark(t.marks[o],t.isInline,r);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,r,n={}){let o=this.marks[t.type.name];return o&&sn.renderSpec(og(n),o(t,r))}static renderSpec(t,r,n=null){if(typeof r=="string")return{dom:t.createTextNode(r)};if(r.nodeType!=null)return{dom:r};if(r.dom&&r.dom.nodeType!=null)return r;let o=r[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let s,a=n?t.createElementNS(n,o):t.createElement(o),l=r[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(let u in l)if(l[u]!=null){let d=u.indexOf(" ");d>0?a.setAttributeNS(u.slice(0,d),u.slice(d+1),l[u]):a.setAttribute(u,l[u])}}for(let u=c;uc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:f,contentDOM:p}=sn.renderSpec(t,d,n);if(a.appendChild(f),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:a,contentDOM:s}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new sn(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let r=nk(t.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(t){return nk(t.marks)}}function nk(e){let t={};for(let r in e){let n=e[r].spec.toDOM;n&&(t[r]=n)}return t}function og(e){return e.document||window.document}const mE=65535,gE=Math.pow(2,16);function PA(e,t){return e+t*gE}function ok(e){return e&mE}function zA(e){return(e-(e&mE))/gE}const vE=1,yE=2,zf=4,bE=8;class M1{constructor(t,r,n){this.pos=t,this.delInfo=r,this.recover=n}get deleted(){return(this.delInfo&bE)>0}get deletedBefore(){return(this.delInfo&(vE|zf))>0}get deletedAfter(){return(this.delInfo&(yE|zf))>0}get deletedAcross(){return(this.delInfo&zf)>0}}class rn{constructor(t,r=!1){if(this.ranges=t,this.inverted=r,!t.length&&rn.empty)return rn.empty}recover(t){let r=0,n=ok(t);if(!this.inverted)for(let o=0;ot)break;let c=this.ranges[a+i],u=this.ranges[a+s],d=l+c;if(t<=d){let f=c?t==l?-1:t==d?1:r:r,p=l+o+(f<0?0:u);if(n)return p;let h=t==(r<0?l:d)?null:PA(a/3,t-l),m=t==l?yE:t==d?vE:zf;return(r<0?t!=l:t!=d)&&(m|=bE),new M1(p,m,h)}o+=u-c}return n?t+o:new M1(t+o,0,null)}touches(t,r){let n=0,o=ok(r),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;at)break;let c=this.ranges[a+i],u=l+c;if(t<=u&&a==o*3)return!0;n+=this.ranges[a+s]-c}return!1}forEach(t){let r=this.inverted?2:1,n=this.inverted?1:2;for(let o=0,i=0;o=0;r--){let o=t.getMirror(r);this.appendMap(t.maps[r].invert(),o!=null&&o>r?n-o-1:void 0)}}invert(){let t=new ul;return t.appendMappingInverted(this),t}map(t,r=1){if(this.mirror)return this._map(t,r,!0);for(let n=this.from;ni&&l!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),r.openStart,r.openEnd);return yt.fromReplace(t,this.from,this.to,i)}invert(){return new eo(this.from,this.to,this.mark)}map(t){let r=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new Ko(r.pos,n.pos,this.mark)}merge(t){return t instanceof Ko&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ko(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ko(r.from,r.to,t.markFromJSON(r.mark))}}Rt.jsonID("addMark",Ko);class eo extends Rt{constructor(t,r,n){super(),this.from=t,this.to=r,this.mark=n}apply(t){let r=t.slice(this.from,this.to),n=new K(Sv(r.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),r.openStart,r.openEnd);return yt.fromReplace(t,this.from,this.to,n)}invert(){return new Ko(this.from,this.to,this.mark)}map(t){let r=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new eo(r.pos,n.pos,this.mark)}merge(t){return t instanceof eo&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new eo(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new eo(r.from,r.to,t.markFromJSON(r.mark))}}Rt.jsonID("removeMark",eo);class Li extends Rt{constructor(t,r){super(),this.pos=t,this.mark=r}apply(t){let r=t.nodeAt(this.pos);if(!r)return yt.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.addToSet(r.marks));return yt.fromReplace(t,this.pos,this.pos+1,new K(R.from(n),0,r.isLeaf?0:1))}invert(t){let r=t.nodeAt(this.pos);if(r){let n=this.mark.addToSet(r.marks);if(n.length==r.marks.length){for(let o=0;on.pos?null:new bt(r.pos,n.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number"||typeof r.gapFrom!="number"||typeof r.gapTo!="number"||typeof r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new bt(r.from,r.to,r.gapFrom,r.gapTo,K.fromJSON(t,r.slice),r.insert,!!r.structure)}}Rt.jsonID("replaceAround",bt);function T1(e,t,r){let n=e.resolve(t),o=r-t,i=n.depth;for(;o>0&&i>0&&n.indexAfter(i)==n.node(i).childCount;)i--,o--;if(o>0){let s=n.node(i).maybeChild(n.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function LA(e,t,r,n){let o=[],i=[],s,a;e.doc.nodesBetween(t,r,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!n.isInSet(d)&&u.type.allowsMarkType(n.type)){let f=Math.max(c,t),p=Math.min(c+l.nodeSize,r),h=n.addToSet(d);for(let m=0;me.step(l)),i.forEach(l=>e.step(l))}function IA(e,t,r,n){let o=[],i=0;e.doc.nodesBetween(t,r,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(n instanceof Ad){let c=s.marks,u;for(;u=n.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else n?n.isInSet(s.marks)&&(l=[n]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,r);for(let u=0;ue.step(new eo(s.from,s.to,s.style)))}function DA(e,t,r,n=r.contentMatch){let o=e.doc.nodeAt(t),i=[],s=t+1;for(let a=0;a=0;a--)e.step(i[a])}function $A(e,t,r){return(t==0||e.canReplace(t,e.childCount))&&(r==e.childCount||e.canReplace(0,r))}function tc(e){let r=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let o=e.$from.node(n),i=e.$from.index(n),s=e.$to.indexAfter(n);if(nr;h--)m||n.index(h)>0?(m=!0,u=R.from(n.node(h).copy(u)),d++):l--;let f=R.empty,p=0;for(let h=i,m=!1;h>r;h--)m||o.after(h+1)=0;s--){if(n.size){let a=r[s].type.contentMatch.matchFragment(n);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=R.from(r[s].type.create(r[s].attrs,n))}let o=t.start,i=t.end;e.step(new bt(o,i,o,i,new K(n,0,0),r.length,!0))}function jA(e,t,r,n,o){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,r,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(n,o)&&UA(e.doc,e.mapping.slice(i).map(a),n)){e.clearIncompatible(e.mapping.slice(i).map(a,1),n);let l=e.mapping.slice(i),c=l.map(a,1),u=l.map(a+s.nodeSize,1);return e.step(new bt(c,u,c+1,u-1,new K(R.from(n.create(o,null,s.marks)),0,0),1,!0)),!1}})}function UA(e,t,r){let n=e.resolve(t),o=n.index();return n.parent.canReplaceWith(o,o+1,r)}function WA(e,t,r,n,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");r||(r=i.type);let s=r.create(n,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!r.validContent(i.content))throw new RangeError("Invalid content for node type "+r.name);e.step(new bt(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new K(R.from(s),0,0),1,!0))}function dl(e,t,r=1,n){let o=e.resolve(t),i=o.depth-r,s=n&&n[n.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=r-2;c>i;c--,u--){let d=o.node(c),f=o.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=n&&n[u+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let m=n&&n[u]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(p))return!1}let a=o.indexAfter(i),l=n&&n[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function KA(e,t,r=1,n){let o=e.doc.resolve(t),i=R.empty,s=R.empty;for(let a=o.depth,l=o.depth-r,c=r-1;a>l;a--,c--){i=R.from(o.node(a).copy(i));let u=n&&n[c];s=R.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}e.step(new Dt(t,t,new K(i.append(s),r,r),!0))}function Nd(e,t){let r=e.resolve(t),n=r.index();return qA(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function qA(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function GA(e,t,r){let n=new Dt(t-r,t+r,K.empty,!0);e.step(n)}function xE(e,t,r){let n=e.resolve(t);if(n.parent.canReplaceWith(n.index(),n.index(),r))return t;if(n.parentOffset==0)for(let o=n.depth-1;o>=0;o--){let i=n.index(o);if(n.node(o).canReplaceWith(i,i,r))return n.before(o+1);if(i>0)return null}if(n.parentOffset==n.parent.content.size)for(let o=n.depth-1;o>=0;o--){let i=n.indexAfter(o);if(n.node(o).canReplaceWith(i,i,r))return n.after(o+1);if(i=0;s--){let a=s==n.depth?0:n.pos<=(n.start(s+1)+n.end(s+1))/2?-1:1,l=n.index(s)+(a>0?1:0),c=n.node(s),u=!1;if(i==1)u=c.canReplace(l,l,o);else{let d=c.contentMatchAt(l).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?n.pos:a<0?n.before(s+1):n.after(s+1)}return null}function Cv(e,t,r=t,n=K.empty){if(t==r&&!n.size)return null;let o=e.resolve(t),i=e.resolve(r);return kE(o,i,n)?new Dt(t,r,n):new JA(o,i,n).fit()}function kE(e,t,r){return!r.openStart&&!r.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),r.content)}class JA{constructor(t,r,n){this.$from=t,this.$to=r,this.unplaced=n,this.frontier=[],this.placed=R.empty;for(let o=0;o<=t.depth;o++){let i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=R.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,n=this.$from,o=this.close(t<0?this.$to:n.doc.resolve(t));if(!o)return null;let i=this.placed,s=n.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new K(i,s,a);return t>-1?new bt(n.pos,t,this.$to.pos,this.$to.end(),l,r):l.size||n.pos!=this.$to.pos?new Dt(n.pos,o.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let r=this.unplaced.content,n=0,o=this.unplaced.openEnd;n1&&(o=0),i.type.spec.isolating&&o<=n){t=n;break}r=i.content}for(let r=1;r<=2;r++)for(let n=r==1?t:this.unplaced.openStart;n>=0;n--){let o,i=null;n?(i=sg(this.unplaced.content,n-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(r==1&&(s?c.matchType(s.type)||(d=c.fillBefore(R.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:n,frontierDepth:a,parent:i,inject:d};if(r==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:n,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:t,openStart:r,openEnd:n}=this.unplaced,o=sg(t,r);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new K(t,r+1,Math.max(n,o.size+r>=t.size-n?r+1:0)),!0)}dropNode(){let{content:t,openStart:r,openEnd:n}=this.unplaced,o=sg(t,r);if(o.childCount<=1&&r>0){let i=t.size-r<=r+o.size;this.unplaced=new K(Pc(t,r-1,1),r-1,i?r-1:n)}else this.unplaced=new K(Pc(t,r,1),r,n)}placeNodes({sliceDepth:t,frontierDepth:r,parent:n,inject:o,wrap:i}){for(;this.depth>r;)this.closeFrontierNode();if(i)for(let m=0;m1||l==0||m.content.size)&&(d=b,u.push(wE(m.mark(f.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?p:-1)))}let h=c==a.childCount;h||(p=-1),this.placed=zc(this.placed,r,R.from(u)),this.frontier[r].match=d,h&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,b=a;m1&&o==this.$to.end(--n);)++o;return o}findCloseLevel(t){e:for(let r=Math.min(this.depth,t.depth);r>=0;r--){let{match:n,type:o}=this.frontier[r],i=r=0;a--){let{match:l,type:c}=this.frontier[a],u=ag(t,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:r,fit:s,move:i?t.doc.resolve(t.after(r+1)):t}}}}close(t){let r=this.findCloseLevel(t);if(!r)return null;for(;this.depth>r.depth;)this.closeFrontierNode();r.fit.childCount&&(this.placed=zc(this.placed,r.depth,r.fit)),t=r.move;for(let n=r.depth+1;n<=t.depth;n++){let o=t.node(n),i=o.type.contentMatch.fillBefore(o.content,!0,t.index(n));this.openFrontierNode(o.type,o.attrs,i)}return t}openFrontierNode(t,r=null,n){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=zc(this.placed,this.depth,R.from(t.create(r,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let r=this.frontier.pop().match.fillBefore(R.empty,!0);r.childCount&&(this.placed=zc(this.placed,this.frontier.length,r))}}function Pc(e,t,r){return t==0?e.cutByIndex(r,e.childCount):e.replaceChild(0,e.firstChild.copy(Pc(e.firstChild.content,t-1,r)))}function zc(e,t,r){return t==0?e.append(r):e.replaceChild(e.childCount-1,e.lastChild.copy(zc(e.lastChild.content,t-1,r)))}function sg(e,t){for(let r=0;r1&&(n=n.replaceChild(0,wE(n.firstChild,t-1,n.childCount==1?r-1:0))),t>0&&(n=e.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(e.type.contentMatch.matchFragment(n).fillBefore(R.empty,!0)))),e.copy(n)}function ag(e,t,r,n,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!r.compatibleContent(i.type))return null;let a=n.fillBefore(i.content,!0,s);return a&&!XA(r,i.content,s)?a:null}function XA(e,t,r){for(let n=r;n0;f--,p--){let h=o.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(f)>-1?a=f:o.before(f)==p&&s.splice(1,0,-f)}let l=s.indexOf(a),c=[],u=n.openStart;for(let f=n.content,p=0;;p++){let h=f.firstChild;if(c.push(h),p==n.openStart)break;f=h.content}for(let f=u-1;f>=0;f--){let p=c[f],h=QA(p.type);if(h&&!p.sameMarkup(o.node(Math.abs(a)-1)))u=f;else if(h||!p.type.isTextblock)break}for(let f=n.openStart;f>=0;f--){let p=(f+u+1)%(n.openStart+1),h=c[p];if(h)for(let m=0;m=0&&(e.replace(t,r,n),!(e.steps.length>d));f--){let p=s[f];p<0||(t=o.before(p),r=i.after(p))}}function SE(e,t,r,n,o){if(tn){let i=o.contentMatchAt(0),s=i.fillBefore(e).append(e);e=s.append(i.matchFragment(s).fillBefore(R.empty,!0))}return e}function eN(e,t,r,n){if(!n.isInline&&t==r&&e.doc.resolve(t).parent.content.size){let o=xE(e.doc,t,n.type);o!=null&&(t=r=o)}e.replaceRange(t,r,new K(R.from(n),0,0))}function tN(e,t,r){let n=e.doc.resolve(t),o=e.doc.resolve(r),i=EE(n,o);for(let s=0;s0&&(l||n.node(a-1).canReplace(n.index(a-1),o.indexAfter(a-1))))return e.delete(n.before(a),o.after(a))}for(let s=1;s<=n.depth&&s<=o.depth;s++)if(t-n.start(s)==n.depth-s&&r>n.end(s)&&o.end(s)-r!=o.depth-s)return e.delete(n.before(s),r);e.delete(t,r)}function EE(e,t){let r=[],n=Math.min(e.depth,t.depth);for(let o=n;o>=0;o--){let i=e.start(o);if(it.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(i==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==i-1)&&r.push(o)}return r}class fl extends Rt{constructor(t,r,n){super(),this.pos=t,this.attr=r,this.value=n}apply(t){let r=t.nodeAt(this.pos);if(!r)return yt.fail("No node at attribute step's position");let n=Object.create(null);for(let i in r.attrs)n[i]=r.attrs[i];n[this.attr]=this.value;let o=r.type.create(n,null,r.marks);return yt.fromReplace(t,this.pos,this.pos+1,new K(R.from(o),0,r.isLeaf?0:1))}getMap(){return rn.empty}invert(t){return new fl(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let r=t.mapResult(this.pos,1);return r.deletedAfter?null:new fl(r.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,r){if(typeof r.pos!="number"||typeof r.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new fl(r.pos,r.attr,r.value)}}Rt.jsonID("attr",fl);class Lu extends Rt{constructor(t,r){super(),this.attr=t,this.value=r}apply(t){let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let n=t.type.create(r,t.content,t.marks);return yt.ok(n)}getMap(){return rn.empty}invert(t){return new Lu(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,r){if(typeof r.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Lu(r.attr,r.value)}}Rt.jsonID("docAttr",Lu);let _l=class extends Error{};_l=function e(t){let r=Error.call(this,t);return r.__proto__=e.prototype,r};_l.prototype=Object.create(Error.prototype);_l.prototype.constructor=_l;_l.prototype.name="TransformError";class rN{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new ul}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let r=this.maybeStep(t);if(r.failed)throw new _l(r.failed);return this}maybeStep(t){let r=t.apply(this.doc);return r.failed||this.addStep(t,r.doc),r}get docChanged(){return this.steps.length>0}addStep(t,r){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=r}replace(t,r=t,n=K.empty){let o=Cv(this.doc,t,r,n);return o&&this.step(o),this}replaceWith(t,r,n){return this.replace(t,r,new K(R.from(n),0,0))}delete(t,r){return this.replace(t,r,K.empty)}insert(t,r){return this.replaceWith(t,t,r)}replaceRange(t,r,n){return ZA(this,t,r,n),this}replaceRangeWith(t,r,n){return eN(this,t,r,n),this}deleteRange(t,r){return tN(this,t,r),this}lift(t,r){return HA(this,t,r),this}join(t,r=1){return GA(this,t,r),this}wrap(t,r){return VA(this,t,r),this}setBlockType(t,r=t,n,o=null){return jA(this,t,r,n,o),this}setNodeMarkup(t,r,n=null,o){return WA(this,t,r,n,o),this}setNodeAttribute(t,r,n){return this.step(new fl(t,r,n)),this}setDocAttribute(t,r){return this.step(new Lu(t,r)),this}addNodeMark(t,r){return this.step(new Li(t,r)),this}removeNodeMark(t,r){if(!(r instanceof Te)){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(r=r.isInSet(n.marks),!r)return this}return this.step(new Ol(t,r)),this}split(t,r=1,n){return KA(this,t,r,n),this}addMark(t,r,n){return LA(this,t,r,n),this}removeMark(t,r,n){return IA(this,t,r,n),this}clearIncompatible(t,r,n){return DA(this,t,r,n),this}}const lg=Object.create(null);class be{constructor(t,r,n){this.$anchor=t,this.$head=r,this.ranges=n||[new nN(t.min(r),t.max(r))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let r=0;r=0;i--){let s=r<0?Fa(t.node(0),t.node(i),t.before(i+1),t.index(i),r,n):Fa(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,r,n);if(s)return s}return null}static near(t,r=1){return this.findFrom(t,r)||this.findFrom(t,-r)||new xr(t.node(0))}static atStart(t){return Fa(t,t,0,0,1)||new xr(t)}static atEnd(t){return Fa(t,t,t.content.size,t.childCount,-1)||new xr(t)}static fromJSON(t,r){if(!r||!r.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=lg[r.type];if(!n)throw new RangeError(`No selection type ${r.type} defined`);return n.fromJSON(t,r)}static jsonID(t,r){if(t in lg)throw new RangeError("Duplicate use of selection JSON ID "+t);return lg[t]=r,r.prototype.jsonID=t,r}getBookmark(){return le.between(this.$anchor,this.$head).getBookmark()}}be.prototype.visible=!0;class nN{constructor(t,r){this.$from=t,this.$to=r}}let sk=!1;function ak(e){!sk&&!e.parent.inlineContent&&(sk=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class le extends be{constructor(t,r=t){ak(t),ak(r),super(t,r)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,r){let n=t.resolve(r.map(this.head));if(!n.parent.inlineContent)return be.near(n);let o=t.resolve(r.map(this.anchor));return new le(o.parent.inlineContent?o:n,n)}replace(t,r=K.empty){if(super.replace(t,r),r==K.empty){let n=this.$from.marksAcross(this.$to);n&&t.ensureMarks(n)}}eq(t){return t instanceof le&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Ah(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,r){if(typeof r.anchor!="number"||typeof r.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new le(t.resolve(r.anchor),t.resolve(r.head))}static create(t,r,n=r){let o=t.resolve(r);return new this(o,n==r?o:t.resolve(n))}static between(t,r,n){let o=t.pos-r.pos;if((!n||o)&&(n=o>=0?1:-1),!r.parent.inlineContent){let i=be.findFrom(r,n,!0)||be.findFrom(r,-n,!0);if(i)r=i.$head;else return be.near(r,n)}return t.parent.inlineContent||(o==0?t=r:(t=(be.findFrom(t,-n,!0)||be.findFrom(t,n,!0)).$anchor,t.pos0?0:1);o>0?s=0;s+=o){let a=t.child(s);if(a.isAtom){if(!i&&ce.isSelectable(a))return ce.create(e,r-(o<0?a.nodeSize:0))}else{let l=Fa(e,a,r+o,o<0?a.childCount:0,o,i);if(l)return l}r+=a.nodeSize*o}return null}function lk(e,t,r){let n=e.steps.length-1;if(n{s==null&&(s=u)}),e.setSelection(be.near(e.doc.resolve(s),r))}const ck=1,rf=2,uk=4;class iN extends rN{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=rf,this}ensureMarks(t){return Te.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&rf)>0}addStep(t,r){super.addStep(t,r),this.updated=this.updated&~rf,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,r=!0){let n=this.selection;return r&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Te.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,r,n){let o=this.doc.type.schema;if(r==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(n==null&&(n=r),n=n??r,!t)return this.deleteRange(r,n);let i=this.storedMarks;if(!i){let s=this.doc.resolve(r);i=n==r?s.marks():s.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(r,n,o.text(t,i)),this.selection.empty||this.setSelection(be.near(this.selection.$to)),this}}setMeta(t,r){return this.meta[typeof t=="string"?t:t.key]=r,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=uk,this}get scrolledIntoView(){return(this.updated&uk)>0}}function dk(e,t){return!t||!e?e:e.bind(t)}class Lc{constructor(t,r,n){this.name=t,this.init=dk(r.init,n),this.apply=dk(r.apply,n)}}const sN=[new Lc("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Lc("selection",{init(e,t){return e.selection||be.atStart(t.doc)},apply(e){return e.selection}}),new Lc("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,r,n){return n.selection.$cursor?e.storedMarks:null}}),new Lc("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class cg{constructor(t,r){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=sN.slice(),r&&r.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new Lc(n.key,n.spec.state,n))})}}class Bs{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,r=-1){for(let n=0;nn.toJSON())),t&&typeof t=="object")for(let n in t){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[n],i=o.spec.state;i&&i.toJSON&&(r[n]=i.toJSON.call(o,this[o.key]))}return r}static fromJSON(t,r,n){if(!r)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new cg(t.schema,t.plugins),i=new Bs(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=Bi.fromJSON(t.schema,r.doc);else if(s.name=="selection")i.selection=be.fromJSON(i.doc,r.selection);else if(s.name=="storedMarks")r.storedMarks&&(i.storedMarks=r.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let a in n){let l=n[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(r,a)){i[s.name]=c.fromJSON.call(l,t,r[a],i);return}}i[s.name]=s.init(t,i)}}),i}}function CE(e,t,r){for(let n in e){let o=e[n];o instanceof Function?o=o.bind(t):n=="handleDOMEvents"&&(o=CE(o,t,{})),r[n]=o}return r}class Ro{constructor(t){this.spec=t,this.props={},t.props&&CE(t.props,this,this.props),this.key=t.key?t.key.key:ME("plugin")}getState(t){return t[this.key]}}const ug=Object.create(null);function ME(e){return e in ug?e+"$"+ ++ug[e]:(ug[e]=0,e+"$")}class ka{constructor(t="key"){this.key=ME(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}var aN=/[A-Z]/g,lN=/^ms-/,dg={};function cN(e){return"-"+e.toLowerCase()}function uN(e){if(dg.hasOwnProperty(e))return dg[e];var t=e.replace(aN,cN);return dg[e]=lN.test(t)?"-"+t:t}function dN(e){return uN(e)}function fN(e,t){return dN(e)+":"+t}function pN(e){var t="";for(var r in e){var n=e[r];typeof n!="string"&&typeof n!="number"||(t&&(t+=";"),t+=fN(r,n))}return t}function hN(){return typeof document<"u"?document:null}var TE=hN;function OE(e,t){if(typeof e!="string")return[e];var r=[e];typeof t=="string"||Array.isArray(t)?t={brackets:t}:t||(t={});var n=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],o=t.escape||"___",i=!!t.flat;n.forEach(function(l){var c=new RegExp(["\\",l[0],"[^\\",l[0],"\\",l[1],"]*\\",l[1]].join("")),u=[];function d(f,p,h){var m=r.push(f.slice(l[0].length,-l[1].length))-1;return u.push(m),o+m+o}r.forEach(function(f,p){for(var h,m=0;f!=h;)if(h=f,f=f.replace(c,d),m++>1e4)throw Error("References have circular dependency. Please, check them.");r[p]=f}),u=u.reverse(),r=r.map(function(f){return u.forEach(function(p){f=f.replace(new RegExp("(\\"+o+p+"\\"+o+")","g"),l[0]+"$1"+l[1])}),f})});var s=new RegExp("\\"+o+"([0-9]+)\\"+o);function a(l,c,u){for(var d=[],f,p=0;f=s.exec(l);){if(p++>1e4)throw Error("Circular references in parenthesis");d.push(l.slice(0,f.index)),d.push(a(c[f[1]],c)),l=l.slice(f.index+f[0].length)}return d.push(l),d}return i?r:a(r[0],r)}function _E(e,t){if(t&&t.flat){var r=t&&t.escape||"___",n=e[0],o;if(!n)return"";for(var i=new RegExp("\\"+r+"([0-9]+)\\"+r),s=0;n!=o;){if(s++>1e4)throw Error("Circular references in "+e);o=n,n=n.replace(i,a)}return n}return e.reduce(function l(c,u){return Array.isArray(u)&&(u=u.reduce(l,"")),c+u},"");function a(l,c){if(e[c]==null)throw Error("Reference "+c+"is undefined");return e[c]}}function Tv(e,t){return Array.isArray(e)?_E(e,t):OE(e,t)}Tv.parse=OE;Tv.stringify=_E;var mN=Tv;const gN=Ln(mN),vN={id:"extension.command.copy.label",message:"Copy",comment:"Label for copy command."},yN={id:"extension.command.copy.description",message:"Copy the selected text",comment:"Description for copy command."},bN={id:"extension.command.cut.label",message:"Cut",comment:"Label for cut command."},xN={id:"extension.command.cut.description",message:"Cut the selected text",comment:"Description for cut command."},kN={id:"extension.command.paste.label",message:"Paste",comment:"Label for paste command."},wN={id:"extension.command.paste.description",message:"Paste content into the editor",comment:"Description for paste command."},SN={id:"extension.command.select-all.label",message:"Select all",comment:"Label for select all command."},EN={id:"extension.command.select-all.description",message:"Select all content within the editor",comment:"Description for select all command."};var es=Object.freeze({__proto__:null,COPY_DESCRIPTION:yN,COPY_LABEL:vN,CUT_DESCRIPTION:xN,CUT_LABEL:bN,PASTE_DESCRIPTION:wN,PASTE_LABEL:kN,SELECT_ALL_DESCRIPTION:EN,SELECT_ALL_LABEL:SN});const CN={id:"keyboard.shortcut.escape",message:"Enter",comment:"Label for escape key in shortcuts."},MN={id:"keyboard.shortcut.command",message:"Command",comment:"Label for command key in shortcuts."},TN={id:"keyboard.shortcut.control",message:"Control",comment:"Label for control key in shortcuts."},ON={id:"keyboard.shortcut.enter",message:"Enter",comment:"Label for enter key in shortcuts."},_N={id:"keyboard.shortcut.shift",message:"Shift",comment:"Label for shift key in shortcuts."},AN={id:"keyboard.shortcut.alt",message:"Alt",comment:"Label for alt key in shortcuts."},NN={id:"keyboard.shortcut.capsLock",message:"Caps Lock",comment:"Label for caps lock key in shortcuts."},RN={id:"keyboard.shortcut.backspace",message:"Backspace",comment:"Label for backspace key in shortcuts."},PN={id:"keyboard.shortcut.tab",message:"Tab",comment:"Label for tab key in shortcuts."},zN={id:"keyboard.shortcut.space",message:"Space",comment:"Label for space key in shortcuts."},LN={id:"keyboard.shortcut.delete",message:"Delete",comment:"Label for delete key in shortcuts."},IN={id:"keyboard.shortcut.pageUp",message:"Page Up",comment:"Label for page up key in shortcuts."},DN={id:"keyboard.shortcut.pageDown",message:"Page Down",comment:"Label for page down key in shortcuts."},$N={id:"keyboard.shortcut.home",message:"Home",comment:"Label for home key in shortcuts."},HN={id:"keyboard.shortcut.end",message:"End",comment:"Label for end key in shortcuts."},BN={id:"keyboard.shortcut.arrowLeft",message:"Arrow Left",comment:"Label for arrow left key in shortcuts."},FN={id:"keyboard.shortcut.arrowRight",message:"Arrow Right",comment:"Label for arrow right key in shortcuts."},VN={id:"keyboard.shortcut.arrowUp",message:"Arrow Up",comment:"Label for arrow up key in shortcuts."},jN={id:"keyboard.shortcut.arrowDown",message:"Arrow Down",comment:"Label for arrowDown key in shortcuts."};var Mt=Object.freeze({__proto__:null,ALT_KEY:AN,ARROW_DOWN_KEY:jN,ARROW_LEFT_KEY:BN,ARROW_RIGHT_KEY:FN,ARROW_UP_KEY:VN,BACKSPACE_KEY:RN,CAPS_LOCK_KEY:NN,COMMAND_KEY:MN,CONTROL_KEY:TN,DELETE_KEY:LN,END_KEY:HN,ENTER_KEY:ON,ESCAPE_KEY:CN,HOME_KEY:$N,PAGE_DOWN_KEY:DN,PAGE_UP_KEY:IN,SHIFT_KEY:_N,SPACE_KEY:zN,TAB_KEY:PN});const UN={id:"extension.command.toggle-blockquote.label",message:"Blockquote",comment:"Label for blockquote formatting command."},WN={id:"extension.command.toggle-blockquote.description",message:"Add blockquote formatting to the selected text",comment:"Description for blockquote formatting command."};var fk=Object.freeze({__proto__:null,DESCRIPTION:WN,LABEL:UN});const KN={id:"extension.command.toggle-bold.label",message:"Bold",comment:"Label for bold formatting command."},qN={id:"extension.command.toggle-bold.description",message:"Add bold formatting to the selected text",comment:"Description for bold formatting command."};var pk=Object.freeze({__proto__:null,DESCRIPTION:qN,LABEL:KN});const GN={id:"extension.command.toggle-code-block.label",message:"Codeblock",comment:"Label for the code block command."},YN={id:"extension.command.toggle-code-block.description",message:"Add a code block",comment:"Description for the code block command."};var JN=Object.freeze({__proto__:null,DESCRIPTION:YN,LABEL:GN});const XN={id:"extension.command.toggle-code.label",message:"Code",comment:"Label for the inline code formatting."},QN={id:"extension.command.toggle-code.description",message:"Add inline code formatting to the selected text",comment:"Description for the inline code formatting command."};var ZN=Object.freeze({__proto__:null,DESCRIPTION:QN,LABEL:XN});const eR={id:"extension.command.set-font-size.label",message:"Font size",comment:"Label for adding a font size."},tR={id:"extension.command.set-font-size.description",message:"Set the font size for the selected text.",comment:"Description for adding a font size."},rR={id:"extension.command.increase-font-size.label",message:"Increase",comment:"Label for increasing the font size."},nR={id:"extension.command.increase-font-size.description",message:"Increase the font size",comment:"Description for increasing the font size."},oR={id:"extension.command.decrease-font-size.label",message:"Decrease",comment:"Label for decreasing the font size."},iR={id:"extension.command.decrease-font-size.description",message:"Decrease the font size.",comment:"Description for decreasing the font size."};var Al=Object.freeze({__proto__:null,DECREASE_DESCRIPTION:iR,DECREASE_LABEL:oR,INCREASE_DESCRIPTION:nR,INCREASE_LABEL:rR,SET_DESCRIPTION:tR,SET_LABEL:eR});const sR={id:"extension.command.toggle-heading.label",message:`{level, select, 1 {Heading 1} +`:"";return`${n}${o}For more information visit ${tE}#${e.toLowerCase()}`}var rE=class extends D4.BaseError{constructor({code:e,message:t,disableLogging:r=!1}={}){const n=vA(e)?e:H.CUSTOM;super(yA(n,t)),this.errorCode=n,this.url=`${tE}#${n.toLowerCase()}`,r||console.error(this.message)}static create(e={}){return new rE(e)}};function te(e,t){if(!e)throw rE.create(t)}function Rh(e){if(typeof e!="object"||e===null)return e;const t=Symbol.toStringTag in e&&e[Symbol.toStringTag]==="Module"?e.default??e:e;return t&&typeof e=="object"&&"__esModule"in t&&t.__esModule&&t.default!==void 0?t.default:t}function Hs(e,t={}){return e}function Kt(e){this.content=e}Kt.prototype={constructor:Kt,find:function(e){for(var t=0;t>1}};Kt.from=function(e){if(e instanceof Kt)return e;var t=[];if(e)for(var r in e)t.push(r,e[r]);return new Kt(t)};function nE(e,t,r){for(let n=0;;n++){if(n==e.childCount||n==t.childCount)return e.childCount==t.childCount?null:r;let o=e.child(n),i=t.child(n);if(o==i){r+=o.nodeSize;continue}if(!o.sameMarkup(i))return r;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)r++;return r}if(o.content.size||i.content.size){let s=nE(o.content,i.content,r+1);if(s!=null)return s}r+=o.nodeSize}}function oE(e,t,r,n){for(let o=e.childCount,i=t.childCount;;){if(o==0||i==0)return o==i?null:{a:r,b:n};let s=e.child(--o),a=t.child(--i),l=s.nodeSize;if(s==a){r-=l,n-=l;continue}if(!s.sameMarkup(a))return{a:r,b:n};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;ct&&n(l,o+a,i||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,t-u),Math.min(l.content.size,r-u),n,o+u)}a=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,r,n,o){let i="",s=!0;return this.nodesBetween(t,r,(a,l)=>{a.isText?(i+=a.text.slice(Math.max(t,l)-l,r-l),s=!n):a.isLeaf?(o?i+=typeof o=="function"?o(a):o:a.type.spec.leafText&&(i+=a.type.spec.leafText(a)),s=!n):!s&&a.isBlock&&(i+=n,s=!0)},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let r=this.lastChild,n=t.firstChild,o=this.content.slice(),i=0;for(r.isText&&r.sameMarkup(n)&&(o[o.length-1]=r.withText(r.text+n.text),i=1);it)for(let i=0,s=0;st&&((sr)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,r-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,r-s-1))),n.push(a),o+=a.nodeSize),s=l}return new R(n,o)}cutByIndex(t,r){return t==r?R.empty:t==0&&r==this.content.length?this:new R(this.content.slice(t,r))}replaceChild(t,r){let n=this.content[t];if(n==r)return this;let o=this.content.slice(),i=this.size+r.nodeSize-n.nodeSize;return o[t]=r,new R(o,i)}addToStart(t){return new R([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new R(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let r=0;rthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,o=0;;n++){let i=this.child(n),s=o+i.nodeSize;if(s>=t)return s==t||r>0?rf(n+1,s):rf(n,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,r){if(!r)return R.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new R(r.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return R.empty;let r,n=0;for(let o=0;othis.type.rank&&(r||(r=t.slice(0,o)),r.push(this),n=!0),r&&r.push(i)}}return r||(r=t.slice()),n||r.push(this),r}removeFromSet(t){for(let r=0;rn.type.rank-o.type.rank),r}}Te.none=[];class bp extends Error{}class K{constructor(t,r,n){this.content=t,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,r){let n=sE(this.content,t+this.openStart,r);return n&&new K(n,this.openStart,this.openEnd)}removeBetween(t,r){return new K(iE(this.content,t+this.openStart,r+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,r){if(!r)return K.empty;let n=r.openStart||0,o=r.openEnd||0;if(typeof n!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new K(R.fromJSON(t,r.content),n,o)}static maxOpen(t,r=!0){let n=0,o=0;for(let i=t.firstChild;i&&!i.isLeaf&&(r||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=t.lastChild;i&&!i.isLeaf&&(r||!i.type.spec.isolating);i=i.lastChild)o++;return new K(t,n,o)}}K.empty=new K(R.empty,0,0);function iE(e,t,r){let{index:n,offset:o}=e.findIndex(t),i=e.maybeChild(n),{index:s,offset:a}=e.findIndex(r);if(o==t||i.isText){if(a!=r&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(r))}if(n!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(n,i.copy(iE(i.content,t-o-1,r-o-1)))}function sE(e,t,r,n){let{index:o,offset:i}=e.findIndex(t),s=e.maybeChild(o);if(i==t||s.isText)return n&&!n.canReplace(o,o,r)?null:e.cut(0,t).append(r).append(e.cut(t));let a=sE(s.content,t-i-1,r);return a&&e.replaceChild(o,s.copy(a))}function bA(e,t,r){if(r.openStart>e.depth)throw new bp("Inserted content deeper than insertion position");if(e.depth-r.openStart!=t.depth-r.openEnd)throw new bp("Inconsistent open depths");return aE(e,t,r,0)}function aE(e,t,r,n){let o=e.index(n),i=e.node(n);if(o==t.index(n)&&n=0&&e.isText&&e.sameMarkup(t[r])?t[r]=e.withText(t[r].text+e.text):t.push(e)}function mu(e,t,r,n){let o=(t||e).node(r),i=0,s=t?t.index(r):o.childCount;e&&(i=e.index(r),e.depth>r?i++:e.textOffset&&(Gs(e.nodeAfter,n),i++));for(let a=i;ao&&C1(e,t,o+1),s=n.depth>o&&C1(r,n,o+1),a=[];return mu(null,e,o,a),i&&s&&t.index(o)==r.index(o)?(lE(i,s),Gs(Ys(i,cE(e,t,r,n,o+1)),a)):(i&&Gs(Ys(i,xp(e,t,o+1)),a),mu(t,r,o,a),s&&Gs(Ys(s,xp(r,n,o+1)),a)),mu(n,null,o,a),new R(a)}function xp(e,t,r){let n=[];if(mu(null,e,r,n),e.depth>r){let o=C1(e,t,r+1);Gs(Ys(o,xp(e,t,r+1)),n)}return mu(t,null,r,n),new R(n)}function xA(e,t){let r=t.depth-e.openStart,o=t.node(r).copy(e.content);for(let i=r-1;i>=0;i--)o=t.node(i).copy(R.from(o));return{start:o.resolveNoCache(e.openStart+r),end:o.resolveNoCache(o.content.size-e.openEnd-r)}}class Tl{constructor(t,r,n){this.pos=t,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,r=this.index(this.depth);if(r==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],o=t.child(r);return n?t.child(r).cut(n):o}get nodeBefore(){let t=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(t).cut(0,r):t==0?null:this.parent.child(t-1)}posAtIndex(t,r){r=this.resolveDepth(r);let n=this.path[r*3],o=r==0?0:this.path[r*3-1]+1;for(let i=0;i0;r--)if(this.start(r)<=t&&this.end(r)>=t)return r;return 0}blockRange(t=this,r){if(t.pos=0;n--)if(t.pos<=this.end(n)&&(!r||r(this.node(n))))return new na(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&r<=t.content.size))throw new RangeError("Position "+r+" out of range");let n=[],o=0,i=r;for(let s=t;;){let{index:a,offset:l}=s.content.findIndex(i),c=i-l;if(n.push(s,a,o+l),!c||(s=s.child(a),s.isText))break;i=c-1,o+=l+1}return new Tl(r,n,i)}static resolveCached(t,r){for(let o=0;ot&&this.nodesBetween(t,r,i=>(n.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),uE(this.marks,t)}contentMatchAt(t){let r=this.type.contentMatch.matchFragment(this.content,0,t);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(t,r,n=R.empty,o=0,i=n.childCount){let s=this.contentMatchAt(t).matchFragment(n,o,i),a=s&&s.matchFragment(this.content,r);if(!a||!a.validEnd)return!1;for(let l=o;lr.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let t={type:this.type.name};for(let r in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(r=>r.toJSON())),t}static fromJSON(t,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(t.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(r.text,n)}let o=R.fromJSON(t,r.content);return t.nodeType(r.type).create(r.attrs,o,n)}};Bi.prototype.text=void 0;class kp extends Bi{constructor(t,r,n,o){if(super(t,r,null,o),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):uE(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,r){return this.text.slice(t,r)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new kp(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new kp(this.type,this.attrs,t,this.marks)}cut(t=0,r=this.text.length){return t==0&&r==this.text.length?this:this.withText(this.text.slice(t,r))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function uE(e,t){for(let r=e.length-1;r>=0;r--)t=e[r].type.name+"("+t+")";return t}class oa{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,r){let n=new SA(t,r);if(n.next==null)return oa.empty;let o=dE(n);n.next&&n.err("Unexpected trailing text");let i=AA(_A(o));return NA(i,n),i}matchType(t){for(let r=0;rc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function r(n){t.push(n);for(let o=0;o{let i=o+(n.validEnd?"*":" ")+" ";for(let s=0;s"+t.indexOf(n.next[s].next);return i}).join(` +`)}}oa.empty=new oa(!0);class SA{constructor(t,r){this.string=t,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function dE(e){let t=[];do t.push(EA(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function EA(e){let t=[];do t.push(CA(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function CA(e){let t=OA(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=MA(e,t);else break;return t}function ek(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function MA(e,t){let r=ek(e),n=r;return e.eat(",")&&(e.next!="}"?n=ek(e):n=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:t}}function TA(e,t){let r=e.nodeTypes,n=r[t];if(n)return[n];let o=[];for(let i in r){let s=r[i];s.groups.indexOf(t)>-1&&o.push(s)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function OA(e){if(e.eat("(")){let t=dE(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=TA(e,e.next).map(r=>(e.inline==null?e.inline=r.isInline:e.inline!=r.isInline&&e.err("Mixing inline and block content"),{type:"name",value:r}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function _A(e){let t=[[]];return o(i(e,0),r()),t;function r(){return t.push([])-1}function n(s,a,l){let c={term:l,to:a};return t[s].push(c),c}function o(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=r())}else if(s.type=="star"){let l=r();return n(a,l),o(i(s.expr,l),l),[n(l)]}else if(s.type=="plus"){let l=r();return o(i(s.expr,a),l),o(i(s.expr,l),l),[n(l)]}else{if(s.type=="opt")return[n(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c{e[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u{c||o.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=t[n.join(",")]=new oa(n.indexOf(e.length-1)>-1);for(let s=0;s-1}allowsMarks(t){if(this.markSet==null)return!0;for(let r=0;rn[i]=new gE(i,r,s));let o=r.spec.topNode||"doc";if(!n[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let i in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};class RA{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Nd{constructor(t,r,n,o){this.name=t,this.rank=r,this.schema=n,this.spec=o,this.attrs=mE(o.attrs),this.excluded=null;let i=pE(this.attrs);this.instance=i?new Te(this,i):null}create(t=null){return!t&&this.instance?this.instance:new Te(this,hE(this.attrs,t))}static compile(t,r){let n=Object.create(null),o=0;return t.forEach((i,s)=>n[i]=new Nd(i,o++,r,s)),n}removeFromSet(t){for(var r=0;r-1}}let PA=class{constructor(t){this.cached=Object.create(null);let r=this.spec={};for(let o in t)r[o]=t[o];r.nodes=Kt.from(t.nodes),r.marks=Kt.from(t.marks||{}),this.nodes=T1.compile(this.spec.nodes,this),this.marks=Nd.compile(this.spec.marks,this);let n=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=n[s]||(n[s]=oa.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=a=="_"?null:a?rk(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:rk(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,r=null,n,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof T1){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(r,n,o)}text(t,r){let n=this.nodes.text;return new kp(n,n.defaultAttrs,t,Te.setFrom(r))}mark(t,r){return typeof t=="string"&&(t=this.marks[t]),t.create(r)}nodeFromJSON(t){return Bi.fromJSON(this,t)}markFromJSON(t){return Te.fromJSON(this,t)}nodeType(t){let r=this.nodes[t];if(!r)throw new RangeError("Unknown node type: "+t);return r}};function rk(e,t){let r=[];for(let n=0;n-1)&&r.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[n]+"'")}return r}let Cv=class O1{constructor(t,r){this.schema=t,this.rules=r,this.tags=[],this.styles=[],r.forEach(n=>{n.tag?this.tags.push(n):n.style&&this.styles.push(n)}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let o=t.nodes[n.node];return o.contentMatch.matchType(o)})}parse(t,r={}){let n=new ok(this,r,!1);return n.addAll(t,r.from,r.to),n.finish()}parseSlice(t,r={}){let n=new ok(this,r,!0);return n.addAll(t,r.from,r.to),K.maxOpen(n.finish())}matchTag(t,r,n){for(let o=n?this.tags.indexOf(n)+1:0;ot.length&&(a.charCodeAt(t.length)!=61||a.slice(t.length+1)!=r))){if(s.getAttrs){let l=s.getAttrs(r);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(t){let r=[];function n(o){let i=o.priority==null?50:o.priority,s=0;for(;s{n(s=ik(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in t.nodes){let i=t.nodes[o].spec.parseDOM;i&&i.forEach(s=>{n(s=ik(s)),s.node||s.ignore||s.mark||(s.node=o)})}return r}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new O1(t,O1.schemaRules(t)))}};const vE={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},zA={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},yE={ol:!0,ul:!0},wp=1,Sp=2,gu=4;function nk(e,t,r){return t!=null?(t?wp:0)|(t==="full"?Sp:0):e&&e.whitespace=="pre"?wp|Sp:r&~gu}class nf{constructor(t,r,n,o,i,s,a){this.type=t,this.attrs=r,this.marks=n,this.pendingMarks=o,this.solid=i,this.options=a,this.content=[],this.activeMarks=Te.none,this.stashMarks=[],this.match=s||(a&gu?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let r=this.type.contentMatch.fillBefore(R.from(t));if(r)this.match=this.type.contentMatch.matchFragment(r);else{let n=this.type.contentMatch,o;return(o=n.findWrapping(t.type))?(this.match=n,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&wp)){let n=this.content[this.content.length-1],o;if(n&&n.isText&&(o=/[ \t\r\n\u000c]+$/.exec(n.text))){let i=n;n.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let r=R.from(this.content);return!t&&this.match&&(r=r.append(this.match.fillBefore(R.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}popFromStashMark(t){for(let r=this.stashMarks.length-1;r>=0;r--)if(t.eq(this.stashMarks[r]))return this.stashMarks.splice(r,1)[0]}applyPending(t){for(let r=0,n=this.pendingMarks;rthis.addAll(t)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(t,()=>{this.addElementByRule(t,i,i.consuming===!1?o:void 0)})}leafFallback(t){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(` +`))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let r=Te.none,n=Te.none;for(let o=0;o{s.clearMark(a)&&(n=a.addToSet(n))}):r=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(r),s.consuming===!1)i=s;else break}return[r,n]}addElementByRule(t,r,n){let o,i,s;r.node?(i=this.parser.schema.nodes[r.node],i.isLeaf?this.insertNode(i.create(r.attrs))||this.leafFallback(t):o=this.enter(i,r.attrs||null,r.preserveWhitespace)):(s=this.parser.schema.marks[r.mark].create(r.attrs),this.addPendingMark(s));let a=this.top;if(i&&i.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(r.getContent)this.findInside(t),r.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=t;typeof r.contentElement=="string"?l=t.querySelector(r.contentElement):typeof r.contentElement=="function"?l=r.contentElement(t):r.contentElement&&(l=r.contentElement),this.findAround(t,l,!0),this.addAll(l)}o&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(t,r,n){let o=r||0;for(let i=r?t.childNodes[r]:t.firstChild,s=n==null?null:t.childNodes[n];i!=s;i=i.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(i);this.findAtPoint(t,o)}findPlace(t){let r,n;for(let o=this.open;o>=0;o--){let i=this.nodes[o],s=i.findWrapping(t);if(s&&(!r||r.length>s.length)&&(r=s,n=i,!s.length)||i.solid)break}if(!r)return!1;this.sync(n);for(let o=0;othis.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let r=this.open;r>=0;r--)if(this.nodes[r]==t)return this.open=r,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let o=n.length-1;o>=0;o--)t+=n[o].nodeSize;r&&t++}return t}findAtPoint(t,r){if(this.find)for(let n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let r=t.split("/"),n=this.options.context,o=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(o?0:1),s=(a,l)=>{for(;a>=0;a--){let c=r[a];if(c==""){if(a==r.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&o?this.nodes[l].type:n&&l>=i?n.node(l-i).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;l--}}return!0};return s(r.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let r=t.depth;r>=0;r--){let n=t.node(r).contentMatchAt(t.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}addPendingMark(t){let r=HA(t,this.top.pendingMarks);r&&this.top.stashMarks.push(r),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,r){for(let n=this.open;n>=0;n--){let o=this.nodes[n];if(o.pendingMarks.lastIndexOf(t)>-1)o.pendingMarks=t.removeFromSet(o.pendingMarks);else{o.activeMarks=t.removeFromSet(o.activeMarks);let s=o.popFromStashMark(t);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==r)break}}}function LA(e){for(let t=e.firstChild,r=null;t;t=t.nextSibling){let n=t.nodeType==1?t.nodeName.toLowerCase():null;n&&yE.hasOwnProperty(n)&&r?(r.appendChild(t),t=r):n=="li"?r=t:n&&(r=null)}}function IA(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function DA(e){let t=/\s*([\w-]+)\s*:\s*([^;]+)/g,r,n=[];for(;r=t.exec(e);)n.push(r[1],r[2].trim());return n}function ik(e){let t={};for(let r in e)t[r]=e[r];return t}function $A(e,t){let r=t.schema.nodes;for(let n in r){let o=r[n];if(!o.allowsMarkType(e))continue;let i=[],s=a=>{i.push(a);for(let l=0;l{if(i.length||s.marks.length){let a=0,l=0;for(;a=0;o--){let i=this.serializeMark(t.marks[o],t.isInline,r);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,r,n={}){let o=this.marks[t.type.name];return o&&an.renderSpec(ag(n),o(t,r))}static renderSpec(t,r,n=null){if(typeof r=="string")return{dom:t.createTextNode(r)};if(r.nodeType!=null)return{dom:r};if(r.dom&&r.dom.nodeType!=null)return r;let o=r[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let s,a=n?t.createElementNS(n,o):t.createElement(o),l=r[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(let u in l)if(l[u]!=null){let d=u.indexOf(" ");d>0?a.setAttributeNS(u.slice(0,d),u.slice(d+1),l[u]):a.setAttribute(u,l[u])}}for(let u=c;uc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:f,contentDOM:p}=an.renderSpec(t,d,n);if(a.appendChild(f),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:a,contentDOM:s}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new an(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let r=sk(t.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(t){return sk(t.marks)}}function sk(e){let t={};for(let r in e){let n=e[r].spec.toDOM;n&&(t[r]=n)}return t}function ag(e){return e.document||window.document}const bE=65535,xE=Math.pow(2,16);function BA(e,t){return e+t*xE}function ak(e){return e&bE}function FA(e){return(e-(e&bE))/xE}const kE=1,wE=2,If=4,SE=8;class _1{constructor(t,r,n){this.pos=t,this.delInfo=r,this.recover=n}get deleted(){return(this.delInfo&SE)>0}get deletedBefore(){return(this.delInfo&(kE|If))>0}get deletedAfter(){return(this.delInfo&(wE|If))>0}get deletedAcross(){return(this.delInfo&If)>0}}class nn{constructor(t,r=!1){if(this.ranges=t,this.inverted=r,!t.length&&nn.empty)return nn.empty}recover(t){let r=0,n=ak(t);if(!this.inverted)for(let o=0;ot)break;let c=this.ranges[a+i],u=this.ranges[a+s],d=l+c;if(t<=d){let f=c?t==l?-1:t==d?1:r:r,p=l+o+(f<0?0:u);if(n)return p;let h=t==(r<0?l:d)?null:BA(a/3,t-l),m=t==l?wE:t==d?kE:If;return(r<0?t!=l:t!=d)&&(m|=SE),new _1(p,m,h)}o+=u-c}return n?t+o:new _1(t+o,0,null)}touches(t,r){let n=0,o=ak(r),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;at)break;let c=this.ranges[a+i],u=l+c;if(t<=u&&a==o*3)return!0;n+=this.ranges[a+s]-c}return!1}forEach(t){let r=this.inverted?2:1,n=this.inverted?1:2;for(let o=0,i=0;o=0;r--){let o=t.getMirror(r);this.appendMap(t.maps[r].invert(),o!=null&&o>r?n-o-1:void 0)}}invert(){let t=new ul;return t.appendMappingInverted(this),t}map(t,r=1){if(this.mirror)return this._map(t,r,!0);for(let n=this.from;ni&&l!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),r.openStart,r.openEnd);return yt.fromReplace(t,this.from,this.to,i)}invert(){return new eo(this.from,this.to,this.mark)}map(t){let r=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new Ko(r.pos,n.pos,this.mark)}merge(t){return t instanceof Ko&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ko(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ko(r.from,r.to,t.markFromJSON(r.mark))}}Rt.jsonID("addMark",Ko);class eo extends Rt{constructor(t,r,n){super(),this.from=t,this.to=r,this.mark=n}apply(t){let r=t.slice(this.from,this.to),n=new K(Mv(r.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),r.openStart,r.openEnd);return yt.fromReplace(t,this.from,this.to,n)}invert(){return new Ko(this.from,this.to,this.mark)}map(t){let r=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new eo(r.pos,n.pos,this.mark)}merge(t){return t instanceof eo&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new eo(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new eo(r.from,r.to,t.markFromJSON(r.mark))}}Rt.jsonID("removeMark",eo);class Li extends Rt{constructor(t,r){super(),this.pos=t,this.mark=r}apply(t){let r=t.nodeAt(this.pos);if(!r)return yt.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.addToSet(r.marks));return yt.fromReplace(t,this.pos,this.pos+1,new K(R.from(n),0,r.isLeaf?0:1))}invert(t){let r=t.nodeAt(this.pos);if(r){let n=this.mark.addToSet(r.marks);if(n.length==r.marks.length){for(let o=0;on.pos?null:new bt(r.pos,n.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number"||typeof r.gapFrom!="number"||typeof r.gapTo!="number"||typeof r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new bt(r.from,r.to,r.gapFrom,r.gapTo,K.fromJSON(t,r.slice),r.insert,!!r.structure)}}Rt.jsonID("replaceAround",bt);function A1(e,t,r){let n=e.resolve(t),o=r-t,i=n.depth;for(;o>0&&i>0&&n.indexAfter(i)==n.node(i).childCount;)i--,o--;if(o>0){let s=n.node(i).maybeChild(n.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function VA(e,t,r,n){let o=[],i=[],s,a;e.doc.nodesBetween(t,r,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!n.isInSet(d)&&u.type.allowsMarkType(n.type)){let f=Math.max(c,t),p=Math.min(c+l.nodeSize,r),h=n.addToSet(d);for(let m=0;me.step(l)),i.forEach(l=>e.step(l))}function jA(e,t,r,n){let o=[],i=0;e.doc.nodesBetween(t,r,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(n instanceof Nd){let c=s.marks,u;for(;u=n.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else n?n.isInSet(s.marks)&&(l=[n]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,r);for(let u=0;ue.step(new eo(s.from,s.to,s.style)))}function UA(e,t,r,n=r.contentMatch){let o=e.doc.nodeAt(t),i=[],s=t+1;for(let a=0;a=0;a--)e.step(i[a])}function WA(e,t,r){return(t==0||e.canReplace(t,e.childCount))&&(r==e.childCount||e.canReplace(0,r))}function rc(e){let r=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let o=e.$from.node(n),i=e.$from.index(n),s=e.$to.indexAfter(n);if(nr;h--)m||n.index(h)>0?(m=!0,u=R.from(n.node(h).copy(u)),d++):l--;let f=R.empty,p=0;for(let h=i,m=!1;h>r;h--)m||o.after(h+1)=0;s--){if(n.size){let a=r[s].type.contentMatch.matchFragment(n);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=R.from(r[s].type.create(r[s].attrs,n))}let o=t.start,i=t.end;e.step(new bt(o,i,o,i,new K(n,0,0),r.length,!0))}function JA(e,t,r,n,o){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,r,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(n,o)&&XA(e.doc,e.mapping.slice(i).map(a),n)){e.clearIncompatible(e.mapping.slice(i).map(a,1),n);let l=e.mapping.slice(i),c=l.map(a,1),u=l.map(a+s.nodeSize,1);return e.step(new bt(c,u,c+1,u-1,new K(R.from(n.create(o,null,s.marks)),0,0),1,!0)),!1}})}function XA(e,t,r){let n=e.resolve(t),o=n.index();return n.parent.canReplaceWith(o,o+1,r)}function QA(e,t,r,n,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");r||(r=i.type);let s=r.create(n,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!r.validContent(i.content))throw new RangeError("Invalid content for node type "+r.name);e.step(new bt(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new K(R.from(s),0,0),1,!0))}function dl(e,t,r=1,n){let o=e.resolve(t),i=o.depth-r,s=n&&n[n.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=r-2;c>i;c--,u--){let d=o.node(c),f=o.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=n&&n[u+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let m=n&&n[u]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(p))return!1}let a=o.indexAfter(i),l=n&&n[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function ZA(e,t,r=1,n){let o=e.doc.resolve(t),i=R.empty,s=R.empty;for(let a=o.depth,l=o.depth-r,c=r-1;a>l;a--,c--){i=R.from(o.node(a).copy(i));let u=n&&n[c];s=R.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}e.step(new Dt(t,t,new K(i.append(s),r,r),!0))}function Rd(e,t){let r=e.resolve(t),n=r.index();return eN(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function eN(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function tN(e,t,r){let n=new Dt(t-r,t+r,K.empty,!0);e.step(n)}function EE(e,t,r){let n=e.resolve(t);if(n.parent.canReplaceWith(n.index(),n.index(),r))return t;if(n.parentOffset==0)for(let o=n.depth-1;o>=0;o--){let i=n.index(o);if(n.node(o).canReplaceWith(i,i,r))return n.before(o+1);if(i>0)return null}if(n.parentOffset==n.parent.content.size)for(let o=n.depth-1;o>=0;o--){let i=n.indexAfter(o);if(n.node(o).canReplaceWith(i,i,r))return n.after(o+1);if(i=0;s--){let a=s==n.depth?0:n.pos<=(n.start(s+1)+n.end(s+1))/2?-1:1,l=n.index(s)+(a>0?1:0),c=n.node(s),u=!1;if(i==1)u=c.canReplace(l,l,o);else{let d=c.contentMatchAt(l).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?n.pos:a<0?n.before(s+1):n.after(s+1)}return null}function Ov(e,t,r=t,n=K.empty){if(t==r&&!n.size)return null;let o=e.resolve(t),i=e.resolve(r);return CE(o,i,n)?new Dt(t,r,n):new nN(o,i,n).fit()}function CE(e,t,r){return!r.openStart&&!r.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),r.content)}class nN{constructor(t,r,n){this.$from=t,this.$to=r,this.unplaced=n,this.frontier=[],this.placed=R.empty;for(let o=0;o<=t.depth;o++){let i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=R.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,n=this.$from,o=this.close(t<0?this.$to:n.doc.resolve(t));if(!o)return null;let i=this.placed,s=n.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new K(i,s,a);return t>-1?new bt(n.pos,t,this.$to.pos,this.$to.end(),l,r):l.size||n.pos!=this.$to.pos?new Dt(n.pos,o.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let r=this.unplaced.content,n=0,o=this.unplaced.openEnd;n1&&(o=0),i.type.spec.isolating&&o<=n){t=n;break}r=i.content}for(let r=1;r<=2;r++)for(let n=r==1?t:this.unplaced.openStart;n>=0;n--){let o,i=null;n?(i=cg(this.unplaced.content,n-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(r==1&&(s?c.matchType(s.type)||(d=c.fillBefore(R.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:n,frontierDepth:a,parent:i,inject:d};if(r==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:n,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:t,openStart:r,openEnd:n}=this.unplaced,o=cg(t,r);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new K(t,r+1,Math.max(n,o.size+r>=t.size-n?r+1:0)),!0)}dropNode(){let{content:t,openStart:r,openEnd:n}=this.unplaced,o=cg(t,r);if(o.childCount<=1&&r>0){let i=t.size-r<=r+o.size;this.unplaced=new K(zc(t,r-1,1),r-1,i?r-1:n)}else this.unplaced=new K(zc(t,r,1),r,n)}placeNodes({sliceDepth:t,frontierDepth:r,parent:n,inject:o,wrap:i}){for(;this.depth>r;)this.closeFrontierNode();if(i)for(let m=0;m1||l==0||m.content.size)&&(d=b,u.push(ME(m.mark(f.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?p:-1)))}let h=c==a.childCount;h||(p=-1),this.placed=Lc(this.placed,r,R.from(u)),this.frontier[r].match=d,h&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,b=a;m1&&o==this.$to.end(--n);)++o;return o}findCloseLevel(t){e:for(let r=Math.min(this.depth,t.depth);r>=0;r--){let{match:n,type:o}=this.frontier[r],i=r=0;a--){let{match:l,type:c}=this.frontier[a],u=ug(t,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:r,fit:s,move:i?t.doc.resolve(t.after(r+1)):t}}}}close(t){let r=this.findCloseLevel(t);if(!r)return null;for(;this.depth>r.depth;)this.closeFrontierNode();r.fit.childCount&&(this.placed=Lc(this.placed,r.depth,r.fit)),t=r.move;for(let n=r.depth+1;n<=t.depth;n++){let o=t.node(n),i=o.type.contentMatch.fillBefore(o.content,!0,t.index(n));this.openFrontierNode(o.type,o.attrs,i)}return t}openFrontierNode(t,r=null,n){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=Lc(this.placed,this.depth,R.from(t.create(r,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let r=this.frontier.pop().match.fillBefore(R.empty,!0);r.childCount&&(this.placed=Lc(this.placed,this.frontier.length,r))}}function zc(e,t,r){return t==0?e.cutByIndex(r,e.childCount):e.replaceChild(0,e.firstChild.copy(zc(e.firstChild.content,t-1,r)))}function Lc(e,t,r){return t==0?e.append(r):e.replaceChild(e.childCount-1,e.lastChild.copy(Lc(e.lastChild.content,t-1,r)))}function cg(e,t){for(let r=0;r1&&(n=n.replaceChild(0,ME(n.firstChild,t-1,n.childCount==1?r-1:0))),t>0&&(n=e.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(e.type.contentMatch.matchFragment(n).fillBefore(R.empty,!0)))),e.copy(n)}function ug(e,t,r,n,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!r.compatibleContent(i.type))return null;let a=n.fillBefore(i.content,!0,s);return a&&!oN(r,i.content,s)?a:null}function oN(e,t,r){for(let n=r;n0;f--,p--){let h=o.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(f)>-1?a=f:o.before(f)==p&&s.splice(1,0,-f)}let l=s.indexOf(a),c=[],u=n.openStart;for(let f=n.content,p=0;;p++){let h=f.firstChild;if(c.push(h),p==n.openStart)break;f=h.content}for(let f=u-1;f>=0;f--){let p=c[f],h=iN(p.type);if(h&&!p.sameMarkup(o.node(Math.abs(a)-1)))u=f;else if(h||!p.type.isTextblock)break}for(let f=n.openStart;f>=0;f--){let p=(f+u+1)%(n.openStart+1),h=c[p];if(h)for(let m=0;m=0&&(e.replace(t,r,n),!(e.steps.length>d));f--){let p=s[f];p<0||(t=o.before(p),r=i.after(p))}}function TE(e,t,r,n,o){if(tn){let i=o.contentMatchAt(0),s=i.fillBefore(e).append(e);e=s.append(i.matchFragment(s).fillBefore(R.empty,!0))}return e}function aN(e,t,r,n){if(!n.isInline&&t==r&&e.doc.resolve(t).parent.content.size){let o=EE(e.doc,t,n.type);o!=null&&(t=r=o)}e.replaceRange(t,r,new K(R.from(n),0,0))}function lN(e,t,r){let n=e.doc.resolve(t),o=e.doc.resolve(r),i=OE(n,o);for(let s=0;s0&&(l||n.node(a-1).canReplace(n.index(a-1),o.indexAfter(a-1))))return e.delete(n.before(a),o.after(a))}for(let s=1;s<=n.depth&&s<=o.depth;s++)if(t-n.start(s)==n.depth-s&&r>n.end(s)&&o.end(s)-r!=o.depth-s)return e.delete(n.before(s),r);e.delete(t,r)}function OE(e,t){let r=[],n=Math.min(e.depth,t.depth);for(let o=n;o>=0;o--){let i=e.start(o);if(it.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(i==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==i-1)&&r.push(o)}return r}class fl extends Rt{constructor(t,r,n){super(),this.pos=t,this.attr=r,this.value=n}apply(t){let r=t.nodeAt(this.pos);if(!r)return yt.fail("No node at attribute step's position");let n=Object.create(null);for(let i in r.attrs)n[i]=r.attrs[i];n[this.attr]=this.value;let o=r.type.create(n,null,r.marks);return yt.fromReplace(t,this.pos,this.pos+1,new K(R.from(o),0,r.isLeaf?0:1))}getMap(){return nn.empty}invert(t){return new fl(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let r=t.mapResult(this.pos,1);return r.deletedAfter?null:new fl(r.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,r){if(typeof r.pos!="number"||typeof r.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new fl(r.pos,r.attr,r.value)}}Rt.jsonID("attr",fl);class Iu extends Rt{constructor(t,r){super(),this.attr=t,this.value=r}apply(t){let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let n=t.type.create(r,t.content,t.marks);return yt.ok(n)}getMap(){return nn.empty}invert(t){return new Iu(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,r){if(typeof r.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Iu(r.attr,r.value)}}Rt.jsonID("docAttr",Iu);let _l=class extends Error{};_l=function e(t){let r=Error.call(this,t);return r.__proto__=e.prototype,r};_l.prototype=Object.create(Error.prototype);_l.prototype.constructor=_l;_l.prototype.name="TransformError";class cN{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new ul}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let r=this.maybeStep(t);if(r.failed)throw new _l(r.failed);return this}maybeStep(t){let r=t.apply(this.doc);return r.failed||this.addStep(t,r.doc),r}get docChanged(){return this.steps.length>0}addStep(t,r){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=r}replace(t,r=t,n=K.empty){let o=Ov(this.doc,t,r,n);return o&&this.step(o),this}replaceWith(t,r,n){return this.replace(t,r,new K(R.from(n),0,0))}delete(t,r){return this.replace(t,r,K.empty)}insert(t,r){return this.replaceWith(t,t,r)}replaceRange(t,r,n){return sN(this,t,r,n),this}replaceRangeWith(t,r,n){return aN(this,t,r,n),this}deleteRange(t,r){return lN(this,t,r),this}lift(t,r){return KA(this,t,r),this}join(t,r=1){return tN(this,t,r),this}wrap(t,r){return YA(this,t,r),this}setBlockType(t,r=t,n,o=null){return JA(this,t,r,n,o),this}setNodeMarkup(t,r,n=null,o){return QA(this,t,r,n,o),this}setNodeAttribute(t,r,n){return this.step(new fl(t,r,n)),this}setDocAttribute(t,r){return this.step(new Iu(t,r)),this}addNodeMark(t,r){return this.step(new Li(t,r)),this}removeNodeMark(t,r){if(!(r instanceof Te)){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(r=r.isInSet(n.marks),!r)return this}return this.step(new Ol(t,r)),this}split(t,r=1,n){return ZA(this,t,r,n),this}addMark(t,r,n){return VA(this,t,r,n),this}removeMark(t,r,n){return jA(this,t,r,n),this}clearIncompatible(t,r,n){return UA(this,t,r,n),this}}const dg=Object.create(null);class be{constructor(t,r,n){this.$anchor=t,this.$head=r,this.ranges=n||[new uN(t.min(r),t.max(r))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let r=0;r=0;i--){let s=r<0?Fa(t.node(0),t.node(i),t.before(i+1),t.index(i),r,n):Fa(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,r,n);if(s)return s}return null}static near(t,r=1){return this.findFrom(t,r)||this.findFrom(t,-r)||new kr(t.node(0))}static atStart(t){return Fa(t,t,0,0,1)||new kr(t)}static atEnd(t){return Fa(t,t,t.content.size,t.childCount,-1)||new kr(t)}static fromJSON(t,r){if(!r||!r.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=dg[r.type];if(!n)throw new RangeError(`No selection type ${r.type} defined`);return n.fromJSON(t,r)}static jsonID(t,r){if(t in dg)throw new RangeError("Duplicate use of selection JSON ID "+t);return dg[t]=r,r.prototype.jsonID=t,r}getBookmark(){return le.between(this.$anchor,this.$head).getBookmark()}}be.prototype.visible=!0;class uN{constructor(t,r){this.$from=t,this.$to=r}}let ck=!1;function uk(e){!ck&&!e.parent.inlineContent&&(ck=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class le extends be{constructor(t,r=t){uk(t),uk(r),super(t,r)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,r){let n=t.resolve(r.map(this.head));if(!n.parent.inlineContent)return be.near(n);let o=t.resolve(r.map(this.anchor));return new le(o.parent.inlineContent?o:n,n)}replace(t,r=K.empty){if(super.replace(t,r),r==K.empty){let n=this.$from.marksAcross(this.$to);n&&t.ensureMarks(n)}}eq(t){return t instanceof le&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Ph(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,r){if(typeof r.anchor!="number"||typeof r.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new le(t.resolve(r.anchor),t.resolve(r.head))}static create(t,r,n=r){let o=t.resolve(r);return new this(o,n==r?o:t.resolve(n))}static between(t,r,n){let o=t.pos-r.pos;if((!n||o)&&(n=o>=0?1:-1),!r.parent.inlineContent){let i=be.findFrom(r,n,!0)||be.findFrom(r,-n,!0);if(i)r=i.$head;else return be.near(r,n)}return t.parent.inlineContent||(o==0?t=r:(t=(be.findFrom(t,-n,!0)||be.findFrom(t,n,!0)).$anchor,t.pos0?0:1);o>0?s=0;s+=o){let a=t.child(s);if(a.isAtom){if(!i&&ce.isSelectable(a))return ce.create(e,r-(o<0?a.nodeSize:0))}else{let l=Fa(e,a,r+o,o<0?a.childCount:0,o,i);if(l)return l}r+=a.nodeSize*o}return null}function dk(e,t,r){let n=e.steps.length-1;if(n{s==null&&(s=u)}),e.setSelection(be.near(e.doc.resolve(s),r))}const fk=1,of=2,pk=4;class fN extends cN{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=of,this}ensureMarks(t){return Te.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&of)>0}addStep(t,r){super.addStep(t,r),this.updated=this.updated&~of,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,r=!0){let n=this.selection;return r&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Te.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,r,n){let o=this.doc.type.schema;if(r==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(n==null&&(n=r),n=n??r,!t)return this.deleteRange(r,n);let i=this.storedMarks;if(!i){let s=this.doc.resolve(r);i=n==r?s.marks():s.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(r,n,o.text(t,i)),this.selection.empty||this.setSelection(be.near(this.selection.$to)),this}}setMeta(t,r){return this.meta[typeof t=="string"?t:t.key]=r,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=pk,this}get scrolledIntoView(){return(this.updated&pk)>0}}function hk(e,t){return!t||!e?e:e.bind(t)}class Ic{constructor(t,r,n){this.name=t,this.init=hk(r.init,n),this.apply=hk(r.apply,n)}}const pN=[new Ic("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Ic("selection",{init(e,t){return e.selection||be.atStart(t.doc)},apply(e){return e.selection}}),new Ic("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,r,n){return n.selection.$cursor?e.storedMarks:null}}),new Ic("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class fg{constructor(t,r){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=pN.slice(),r&&r.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new Ic(n.key,n.spec.state,n))})}}class Bs{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,r=-1){for(let n=0;nn.toJSON())),t&&typeof t=="object")for(let n in t){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[n],i=o.spec.state;i&&i.toJSON&&(r[n]=i.toJSON.call(o,this[o.key]))}return r}static fromJSON(t,r,n){if(!r)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new fg(t.schema,t.plugins),i=new Bs(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=Bi.fromJSON(t.schema,r.doc);else if(s.name=="selection")i.selection=be.fromJSON(i.doc,r.selection);else if(s.name=="storedMarks")r.storedMarks&&(i.storedMarks=r.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let a in n){let l=n[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(r,a)){i[s.name]=c.fromJSON.call(l,t,r[a],i);return}}i[s.name]=s.init(t,i)}}),i}}function _E(e,t,r){for(let n in e){let o=e[n];o instanceof Function?o=o.bind(t):n=="handleDOMEvents"&&(o=_E(o,t,{})),r[n]=o}return r}class Ro{constructor(t){this.spec=t,this.props={},t.props&&_E(t.props,this,this.props),this.key=t.key?t.key.key:AE("plugin")}getState(t){return t[this.key]}}const pg=Object.create(null);function AE(e){return e in pg?e+"$"+ ++pg[e]:(pg[e]=0,e+"$")}class ka{constructor(t="key"){this.key=AE(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}var hN=/[A-Z]/g,mN=/^ms-/,hg={};function gN(e){return"-"+e.toLowerCase()}function vN(e){if(hg.hasOwnProperty(e))return hg[e];var t=e.replace(hN,gN);return hg[e]=mN.test(t)?"-"+t:t}function yN(e){return vN(e)}function bN(e,t){return yN(e)+":"+t}function xN(e){var t="";for(var r in e){var n=e[r];typeof n!="string"&&typeof n!="number"||(t&&(t+=";"),t+=bN(r,n))}return t}function kN(){return typeof document<"u"?document:null}var NE=kN;function RE(e,t){if(typeof e!="string")return[e];var r=[e];typeof t=="string"||Array.isArray(t)?t={brackets:t}:t||(t={});var n=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],o=t.escape||"___",i=!!t.flat;n.forEach(function(l){var c=new RegExp(["\\",l[0],"[^\\",l[0],"\\",l[1],"]*\\",l[1]].join("")),u=[];function d(f,p,h){var m=r.push(f.slice(l[0].length,-l[1].length))-1;return u.push(m),o+m+o}r.forEach(function(f,p){for(var h,m=0;f!=h;)if(h=f,f=f.replace(c,d),m++>1e4)throw Error("References have circular dependency. Please, check them.");r[p]=f}),u=u.reverse(),r=r.map(function(f){return u.forEach(function(p){f=f.replace(new RegExp("(\\"+o+p+"\\"+o+")","g"),l[0]+"$1"+l[1])}),f})});var s=new RegExp("\\"+o+"([0-9]+)\\"+o);function a(l,c,u){for(var d=[],f,p=0;f=s.exec(l);){if(p++>1e4)throw Error("Circular references in parenthesis");d.push(l.slice(0,f.index)),d.push(a(c[f[1]],c)),l=l.slice(f.index+f[0].length)}return d.push(l),d}return i?r:a(r[0],r)}function PE(e,t){if(t&&t.flat){var r=t&&t.escape||"___",n=e[0],o;if(!n)return"";for(var i=new RegExp("\\"+r+"([0-9]+)\\"+r),s=0;n!=o;){if(s++>1e4)throw Error("Circular references in "+e);o=n,n=n.replace(i,a)}return n}return e.reduce(function l(c,u){return Array.isArray(u)&&(u=u.reduce(l,"")),c+u},"");function a(l,c){if(e[c]==null)throw Error("Reference "+c+"is undefined");return e[c]}}function Av(e,t){return Array.isArray(e)?PE(e,t):RE(e,t)}Av.parse=RE;Av.stringify=PE;var wN=Av;const SN=Dn(wN),EN={id:"extension.command.copy.label",message:"Copy",comment:"Label for copy command."},CN={id:"extension.command.copy.description",message:"Copy the selected text",comment:"Description for copy command."},MN={id:"extension.command.cut.label",message:"Cut",comment:"Label for cut command."},TN={id:"extension.command.cut.description",message:"Cut the selected text",comment:"Description for cut command."},ON={id:"extension.command.paste.label",message:"Paste",comment:"Label for paste command."},_N={id:"extension.command.paste.description",message:"Paste content into the editor",comment:"Description for paste command."},AN={id:"extension.command.select-all.label",message:"Select all",comment:"Label for select all command."},NN={id:"extension.command.select-all.description",message:"Select all content within the editor",comment:"Description for select all command."};var es=Object.freeze({__proto__:null,COPY_DESCRIPTION:CN,COPY_LABEL:EN,CUT_DESCRIPTION:TN,CUT_LABEL:MN,PASTE_DESCRIPTION:_N,PASTE_LABEL:ON,SELECT_ALL_DESCRIPTION:NN,SELECT_ALL_LABEL:AN});const RN={id:"keyboard.shortcut.escape",message:"Enter",comment:"Label for escape key in shortcuts."},PN={id:"keyboard.shortcut.command",message:"Command",comment:"Label for command key in shortcuts."},zN={id:"keyboard.shortcut.control",message:"Control",comment:"Label for control key in shortcuts."},LN={id:"keyboard.shortcut.enter",message:"Enter",comment:"Label for enter key in shortcuts."},IN={id:"keyboard.shortcut.shift",message:"Shift",comment:"Label for shift key in shortcuts."},DN={id:"keyboard.shortcut.alt",message:"Alt",comment:"Label for alt key in shortcuts."},$N={id:"keyboard.shortcut.capsLock",message:"Caps Lock",comment:"Label for caps lock key in shortcuts."},HN={id:"keyboard.shortcut.backspace",message:"Backspace",comment:"Label for backspace key in shortcuts."},BN={id:"keyboard.shortcut.tab",message:"Tab",comment:"Label for tab key in shortcuts."},FN={id:"keyboard.shortcut.space",message:"Space",comment:"Label for space key in shortcuts."},VN={id:"keyboard.shortcut.delete",message:"Delete",comment:"Label for delete key in shortcuts."},jN={id:"keyboard.shortcut.pageUp",message:"Page Up",comment:"Label for page up key in shortcuts."},UN={id:"keyboard.shortcut.pageDown",message:"Page Down",comment:"Label for page down key in shortcuts."},WN={id:"keyboard.shortcut.home",message:"Home",comment:"Label for home key in shortcuts."},KN={id:"keyboard.shortcut.end",message:"End",comment:"Label for end key in shortcuts."},qN={id:"keyboard.shortcut.arrowLeft",message:"Arrow Left",comment:"Label for arrow left key in shortcuts."},GN={id:"keyboard.shortcut.arrowRight",message:"Arrow Right",comment:"Label for arrow right key in shortcuts."},YN={id:"keyboard.shortcut.arrowUp",message:"Arrow Up",comment:"Label for arrow up key in shortcuts."},JN={id:"keyboard.shortcut.arrowDown",message:"Arrow Down",comment:"Label for arrowDown key in shortcuts."};var Mt=Object.freeze({__proto__:null,ALT_KEY:DN,ARROW_DOWN_KEY:JN,ARROW_LEFT_KEY:qN,ARROW_RIGHT_KEY:GN,ARROW_UP_KEY:YN,BACKSPACE_KEY:HN,CAPS_LOCK_KEY:$N,COMMAND_KEY:PN,CONTROL_KEY:zN,DELETE_KEY:VN,END_KEY:KN,ENTER_KEY:LN,ESCAPE_KEY:RN,HOME_KEY:WN,PAGE_DOWN_KEY:UN,PAGE_UP_KEY:jN,SHIFT_KEY:IN,SPACE_KEY:FN,TAB_KEY:BN});const XN={id:"extension.command.toggle-blockquote.label",message:"Blockquote",comment:"Label for blockquote formatting command."},QN={id:"extension.command.toggle-blockquote.description",message:"Add blockquote formatting to the selected text",comment:"Description for blockquote formatting command."};var mk=Object.freeze({__proto__:null,DESCRIPTION:QN,LABEL:XN});const ZN={id:"extension.command.toggle-bold.label",message:"Bold",comment:"Label for bold formatting command."},eR={id:"extension.command.toggle-bold.description",message:"Add bold formatting to the selected text",comment:"Description for bold formatting command."};var gk=Object.freeze({__proto__:null,DESCRIPTION:eR,LABEL:ZN});const tR={id:"extension.command.toggle-code-block.label",message:"Codeblock",comment:"Label for the code block command."},rR={id:"extension.command.toggle-code-block.description",message:"Add a code block",comment:"Description for the code block command."};var nR=Object.freeze({__proto__:null,DESCRIPTION:rR,LABEL:tR});const oR={id:"extension.command.toggle-code.label",message:"Code",comment:"Label for the inline code formatting."},iR={id:"extension.command.toggle-code.description",message:"Add inline code formatting to the selected text",comment:"Description for the inline code formatting command."};var sR=Object.freeze({__proto__:null,DESCRIPTION:iR,LABEL:oR});const aR={id:"extension.command.set-font-size.label",message:"Font size",comment:"Label for adding a font size."},lR={id:"extension.command.set-font-size.description",message:"Set the font size for the selected text.",comment:"Description for adding a font size."},cR={id:"extension.command.increase-font-size.label",message:"Increase",comment:"Label for increasing the font size."},uR={id:"extension.command.increase-font-size.description",message:"Increase the font size",comment:"Description for increasing the font size."},dR={id:"extension.command.decrease-font-size.label",message:"Decrease",comment:"Label for decreasing the font size."},fR={id:"extension.command.decrease-font-size.description",message:"Decrease the font size.",comment:"Description for decreasing the font size."};var Al=Object.freeze({__proto__:null,DECREASE_DESCRIPTION:fR,DECREASE_LABEL:dR,INCREASE_DESCRIPTION:uR,INCREASE_LABEL:cR,SET_DESCRIPTION:lR,SET_LABEL:aR});const pR={id:"extension.command.toggle-heading.label",message:`{level, select, 1 {Heading 1} 2 {Heading 2} 3 {Heading 3} 4 {Heading 4} 5 {Heading 5} 6 {Heading 6} -other {Heading}}`,comment:"Label for heading command with support for levels."};var aR=Object.freeze({__proto__:null,LABEL:sR});const lR={id:"extension.command.undo.label",message:"Undo",comment:"Label for undo."},cR={id:"extension.command.undo.description",message:"Undo the most recent action",comment:"Description for undo."},uR={id:"extension.command.redo.label",message:"Redo",comment:"Label for redo."},dR={id:"extension.command.redo.description",message:"Redo the most recent action",comment:"Description for redo."};var wp=Object.freeze({__proto__:null,REDO_DESCRIPTION:dR,REDO_LABEL:uR,UNDO_DESCRIPTION:cR,UNDO_LABEL:lR});const fR={id:"extension.command.insert-horizontal-rule.label",message:"Divider",comment:"Label for inserting a horizontal rule (divider) command."},pR={id:"extension.command.insert-horizontal-rule.description",message:"Separate content with a diving horizontal line",comment:"Description for inserting a horizontal rule (divider) command."};var hk=Object.freeze({__proto__:null,DESCRIPTION:pR,LABEL:fR});const hR={id:"extension.command.toggle-italic.label",message:"Italic",comment:"Label for italic formatting command."},mR={id:"extension.command.toggle-italic.description",message:"Italicize the selected text",comment:"Description for italic formatting command."};var mk=Object.freeze({__proto__:null,DESCRIPTION:mR,LABEL:hR});const gR={id:"extension.command.toggle-ordered-list.label",message:"Ordered list",comment:"Label for inserting an ordered list into the editor."},vR={id:"extension.command.toggle-bullet-list.description",message:"Bulleted list",comment:"Description for inserting a bullet list into the editor."},yR={id:"extension.command.toggle-task-list.description",message:"Tasked list",comment:"Description for inserting a task list into the editor."};var Ov=Object.freeze({__proto__:null,BULLET_LIST_LABEL:vR,ORDERED_LIST_LABEL:gR,TASK_LIST_LABEL:yR});const bR={id:"extension.command.increase-indent.label",message:"Increase indentation",comment:"Label for increasing the indentation level."},xR={id:"extension.command.decrease-indent.label",message:"Decrease indentation",comment:"Label for decreasing the indentation level of the current node block."},kR={id:"extension.command.center-align.label",message:"Center align",comment:"Center align the text in the current node."},wR={id:"extension.command.justify-align.label",message:"Justify",comment:"Justify the alignment of the selected nodes."},SR={id:"extension.command.right-align.label",message:"Right align",comment:"Right align the selected nodes."},ER={id:"extension.command.left-align.label",message:"Left align",comment:"Left align the selected nodes."};var rc=Object.freeze({__proto__:null,CENTER_ALIGN_LABEL:kR,DECREASE_INDENT_LABEL:xR,INCREASE_INDENT_LABEL:bR,JUSTIFY_ALIGN_LABEL:wR,LEFT_ALIGN_LABEL:ER,RIGHT_ALIGN_LABEL:SR});const CR={id:"extension.command.insert-paragraph.label",message:"Insert Paragraph",comment:"Label for inserting a paragraph."},MR={id:"extension.command.insert-paragraph.description",message:"Insert a new paragraph",comment:"Description for inserting a paragraph."},TR={id:"extension.command.convert-paragraph.label",message:"Convert Paragraph",comment:"Label for converting the current node into a paragraph."},OR={id:"extension.command.convert-paragraph.description",message:"Convert current block into a paragraph block.",comment:"Description for converting a paragraph."};var Sp=Object.freeze({__proto__:null,CONVERT_DESCRIPTION:OR,CONVERT_LABEL:TR,INSERT_DESCRIPTION:MR,INSERT_LABEL:CR});const _R={id:"extension.command.toggle-strike.label",message:"Strikethrough",comment:"Label for strike formatting command."},AR={id:"extension.command.toggle-strike.description",message:"Strikethrough the selected text",comment:"Description for strike formatting command."};var gk=Object.freeze({__proto__:null,DESCRIPTION:AR,LABEL:_R});const NR={id:"extension.command.toggle-underline.label",message:"Underline",comment:"Label for underline formatting command."},RR={id:"extension.command.toggle-underline.description",message:"Underline the selected text",comment:"Description for underline formatting command."};var vk=Object.freeze({__proto__:null,DESCRIPTION:RR,LABEL:NR});class wa{constructor(t,r){this.match=t,this.match=t,this.handler=typeof r=="string"?PR(r):r}}function PR(e){return function(t,r,n,o){let i=e;if(r[1]){let s=r[0].lastIndexOf(r[1]);i+=r[0].slice(s+r[1].length),n+=s;let a=n-o;a>0&&(i=r[0].slice(s-a,s)+i,n=o)}return t.tr.insertText(i,n,o)}}const zR=500;function LR({rules:e}){let t=new Ro({state:{init(){return null},apply(r,n){let o=r.getMeta(this);return o||(r.selectionSet||r.docChanged?null:n)}},props:{handleTextInput(r,n,o,i){return yk(r,n,o,i,e,t)},handleDOMEvents:{compositionend:r=>{setTimeout(()=>{let{$cursor:n}=r.state.selection;n&&yk(r,n.pos,n.pos,"",e,t)})}}},isInputRules:!0});return t}function yk(e,t,r,n,o,i){if(e.composing)return!1;let s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;let l=a.parent.textBetween(Math.max(0,a.parentOffset-zR),a.parentOffset,null,"")+n;for(let c=0;c{let r=e.plugins;for(let n=0;n=0;l--)s.step(a.steps[l].invert(a.docs[l]));if(i.text){let l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,e.schema.text(i.text,l))}else s.delete(i.from,i.to);t(s)}return!0}}return!1};function Nh(e,t,r=null,n){return new wa(e,(o,i,s,a)=>{let l=r instanceof Function?r(i):r,c=o.tr.delete(s,a),u=c.doc.resolve(s),d=u.blockRange(),f=d&&Ev(d,t,l);if(!f)return null;c.wrap(d,f);let p=c.doc.resolve(s-1).nodeBefore;return p&&p.type==t&&Nd(c.doc,s-1)&&(!n||n(i,p))&&c.join(s-1),c})}function DR(e,t,r=null){return new wa(e,(n,o,i,s)=>{let a=n.doc.resolve(i),l=r instanceof Function?r(o):r;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t)?n.tr.delete(i,s).setBlockType(i,i,t,l):null})}const yr=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Iu=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let bk=null;const Fo=function(e,t,r){let n=bk||(bk=document.createRange());return n.setEnd(e,r??e.nodeValue.length),n.setStart(e,t||0),n},ia=function(e,t,r,n){return r&&(xk(e,t,r,n,-1)||xk(e,t,r,n,1))},$R=/^(img|br|input|textarea|hr)$/i;function xk(e,t,r,n,o){for(;;){if(e==r&&t==n)return!0;if(t==(o<0?0:yo(e))){let i=e.parentNode;if(!i||i.nodeType!=1||_v(e)||$R.test(e.nodeName)||e.contentEditable=="false")return!1;t=yr(e)+(o<0?0:1),e=i}else if(e.nodeType==1){if(e=e.childNodes[t+(o<0?-1:0)],e.contentEditable=="false")return!1;t=o<0?yo(e):0}else return!1}}function yo(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function HR(e,t,r){for(let n=t==0,o=t==yo(e);n||o;){if(e==r)return!0;let i=yr(e);if(e=e.parentNode,!e)return!1;n=n&&i==0,o=o&&i==yo(e)}}function _v(e){let t;for(let r=e;r&&!(t=r.pmViewDesc);r=r.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const Rh=function(e){return e.focusNode&&ia(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function $s(e,t){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=e,r.key=r.code=t,r}function BR(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function FR(e,t,r){if(e.caretPositionFromPoint)try{let n=e.caretPositionFromPoint(t,r);if(n)return{node:n.offsetNode,offset:n.offset}}catch{}if(e.caretRangeFromPoint){let n=e.caretRangeFromPoint(t,r);if(n)return{node:n.startContainer,offset:n.startOffset}}}const To=typeof navigator<"u"?navigator:null,kk=typeof document<"u"?document:null,ms=To&&To.userAgent||"",O1=/Edge\/(\d+)/.exec(ms),AE=/MSIE \d/.exec(ms),_1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ms),Ir=!!(AE||_1||O1),Fi=AE?document.documentMode:_1?+_1[1]:O1?+O1[1]:0,oo=!Ir&&/gecko\/(\d+)/i.test(ms);oo&&+(/Firefox\/(\d+)/.exec(ms)||[0,0])[1];const A1=!Ir&&/Chrome\/(\d+)/.exec(ms),ur=!!A1,VR=A1?+A1[1]:0,wr=!Ir&&!!To&&/Apple Computer/.test(To.vendor),Nl=wr&&(/Mobile\/\w+/.test(ms)||!!To&&To.maxTouchPoints>2),kn=Nl||(To?/Mac/.test(To.platform):!1),jR=To?/Win/.test(To.platform):!1,Yn=/Android \d/.test(ms),Rd=!!kk&&"webkitFontSmoothing"in kk.documentElement.style,UR=Rd?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function WR(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Lo(e,t){return typeof e=="number"?e:e[t]}function KR(e){let t=e.getBoundingClientRect(),r=t.width/e.offsetWidth||1,n=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*r,top:t.top,bottom:t.top+e.clientHeight*n}}function wk(e,t,r){let n=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=r||e.dom;s;s=Iu(s)){if(s.nodeType!=1)continue;let a=s,l=a==i.body,c=l?WR(i):KR(a),u=0,d=0;if(t.topc.bottom-Lo(n,"bottom")&&(d=t.bottom-t.top>c.bottom-c.top?t.top+Lo(o,"top")-c.top:t.bottom-c.bottom+Lo(o,"bottom")),t.leftc.right-Lo(n,"right")&&(u=t.right-c.right+Lo(o,"right")),u||d)if(l)i.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let h=a.scrollLeft-f,m=a.scrollTop-p;t={left:t.left-h,top:t.top-m,right:t.right-h,bottom:t.bottom-m}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function qR(e){let t=e.dom.getBoundingClientRect(),r=Math.max(0,t.top),n,o;for(let i=(t.left+t.right)/2,s=r+1;s=r-20){n=a,o=l.top;break}}return{refDOM:n,refTop:o,stack:NE(e.dom)}}function NE(e){let t=[],r=e.ownerDocument;for(let n=e;n&&(t.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),e!=r);n=Iu(n));return t}function GR({refDOM:e,refTop:t,stack:r}){let n=e?e.getBoundingClientRect().top:0;RE(r,n==0?0:n-t)}function RE(e,t){for(let r=0;r=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);let m=h.left>t.left?h.left-t.left:h.right=(h.left+h.right)/2?1:0));continue}}else h.top>t.top&&!l&&h.left<=t.left&&h.right>=t.left&&(l=u,c={left:Math.max(h.left,Math.min(h.right,t.left)),top:h.top});!r&&(t.left>=h.right&&t.top>=h.top||t.left>=h.left&&t.top>=h.bottom)&&(i=d+1)}}return!r&&l&&(r=l,o=c,n=0),r&&r.nodeType==3?JR(r,o):!r||n&&r.nodeType==1?{node:e,offset:i}:PE(r,o)}function JR(e,t){let r=e.nodeValue.length,n=document.createRange();for(let o=0;o=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}function Av(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function XR(e,t){let r=e.parentNode;return r&&/^li$/i.test(r.nodeName)&&t.left(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(n,o,i)}function ZR(e,t,r,n){let o=-1;for(let i=t,s=!1;i!=e.dom;){let a=e.docView.nearestDesc(i,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent&&!s||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&!s&&(s=!0,l.left>n.left||l.top>n.top?o=a.posBefore:(l.right-1?o:e.docView.posFromDOM(t,r,-1)}function zE(e,t,r){let n=e.childNodes.length;if(n&&r.topt.top&&o++}let c;Rd&&o&&n.nodeType==1&&(c=n.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=t.top&&o--,n==e.dom&&o==n.childNodes.length-1&&n.lastChild.nodeType==1&&t.top>n.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(o==0||n.nodeType!=1||n.childNodes[o-1].nodeName!="BR")&&(a=ZR(e,n,o,t))}a==null&&(a=QR(e,s,t));let l=e.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Sk(e){return e.top=0&&o==n.nodeValue.length?(l--,u=1):r<0?l--:c++,vc(ki(Fo(n,l,c),u),u<0)}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(i==null&&o&&(r<0||o==yo(n))){let l=n.childNodes[o-1];if(l.nodeType==1)return fg(l.getBoundingClientRect(),!1)}if(i==null&&o=0)}if(i==null&&o&&(r<0||o==yo(n))){let l=n.childNodes[o-1],c=l.nodeType==3?Fo(l,yo(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return vc(ki(c,1),!1)}if(i==null&&o=0)}function vc(e,t){if(e.width==0)return e;let r=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:r,right:r}}function fg(e,t){if(e.height==0)return e;let r=t?e.top:e.bottom;return{top:r,bottom:r,left:e.left,right:e.right}}function IE(e,t,r){let n=e.state,o=e.root.activeElement;n!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return r()}finally{n!=t&&e.updateState(n),o!=e.dom&&o&&o.focus()}}function rP(e,t,r){let n=t.selection,o=r=="up"?n.$from:n.$to;return IE(e,t,()=>{let{node:i}=e.docView.domFromPos(o.pos,r=="up"?-1:1);for(;;){let a=e.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=LE(e,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Fo(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(r=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const nP=/[\u0590-\u08ac]/;function oP(e,t,r){let{$head:n}=t.selection;if(!n.parent.isTextblock)return!1;let o=n.parentOffset,i=!o,s=o==n.parent.content.size,a=e.domSelection();return!nP.test(n.parent.textContent)||!a.modify?r=="left"||r=="backward"?i:s:IE(e,t,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=e.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",r,"character");let p=n.depth?e.docView.domAfterPos(n.before()):e.dom,{focusNode:h,focusOffset:m}=e.domSelectionRange(),b=h&&!p.contains(h.nodeType==1?h:h.parentNode)||l==h&&c==m;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),b})}let Ek=null,Ck=null,Mk=!1;function iP(e,t,r){return Ek==t&&Ck==r?Mk:(Ek=t,Ck=r,Mk=r=="up"||r=="down"?rP(e,t,r):oP(e,t,r))}const Tn=0,Tk=1,Fs=2,Oo=3;class Pd{constructor(t,r,n,o){this.parent=t,this.children=r,this.dom=n,this.contentDOM=o,this.dirty=Tn,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,r,n){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let r=0;ryr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(r==0)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&r==t.childNodes.length)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??n>0?this.posAtEnd:this.posAtStart}nearestDesc(t,r=!1){for(let n=!0,o=t;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!r||i.node))if(n&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(t.nodeType==1?t:t.parentNode):s==t))n=!1;else return i}}getDesc(t){let r=t.pmViewDesc;for(let n=r;n;n=n.parent)if(n==this)return r}posFromDOM(t,r,n){for(let o=t;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(t,r,n)}return-1}descAt(t){for(let r=0,n=0;rt||s instanceof $E){o=t-i;break}i=a}if(o)return this.children[n].domFromPos(o-this.children[n].border,r);for(let i;n&&!(i=this.children[n-1]).size&&i instanceof DE&&i.side>=0;n--);if(r<=0){let i,s=!0;for(;i=n?this.children[n-1]:null,!(!i||i.dom.parentNode==this.contentDOM);n--,s=!1);return i&&r&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,r):{node:this.contentDOM,offset:i?yr(i.dom)+1:0}}else{let i,s=!0;for(;i=n=u&&r<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,r,u);t=s;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=yr(f.dom)+1;break}t-=f.size}o==-1&&(o=0)}if(o>-1&&(c>r||a==this.children.length-1)){r=c;for(let u=a+1;up&&sr){let p=a;a=l,l=p}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,r){for(let n=0,o=0;o=n:tn){let a=n+i.border,l=s-i.border;if(t>=a&&r<=l){this.dirty=t==n||r==s?Fs:Tk,t==a&&r==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Oo:i.markDirty(t-a,r-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Fs:Oo}n=s}this.dirty=Fs}markParentsDirty(){let t=1;for(let r=this.parent;r;r=r.parent,t++){let n=t==1?Fs:Tk;r.dirty{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!r.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=r,this.widget=r,i=this}matchesWidget(t){return this.dirty==Tn&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let r=this.widget.spec.stopEvent;return r?r(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class sP extends Pd{constructor(t,r,n,o){super(t,[],r,null),this.textDOM=n,this.text=o}get size(){return this.text.length}localPosFromDOM(t,r){return t!=this.textDOM?this.posAtStart+(r?this.size:0):this.posAtStart+r}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class sa extends Pd{constructor(t,r,n,o){super(t,[],n,o),this.mark=r}static create(t,r,n,o){let i=o.nodeViews[r.type.name],s=i&&i(r,o,n);return(!s||!s.dom)&&(s=sn.renderSpec(document,r.type.spec.toDOM(r,n))),new sa(t,r,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&Oo||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Oo&&this.mark.eq(t)}markDirty(t,r){if(super.markDirty(t,r),this.dirty!=Tn){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty0&&(i=P1(i,0,t,n));for(let a=0;a{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},n,o),u=c&&c.dom,d=c&&c.contentDOM;if(r.isText){if(!u)u=document.createTextNode(r.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=sn.renderSpec(document,r.type.spec.toDOM(r)));!d&&!r.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),r.type.spec.draggable&&(u.draggable=!0));let f=u;return u=FE(u,n,r),c?l=new aP(t,r,n,o,u,d||null,f,c,i,s+1):r.isText?new Ph(t,r,n,o,u,f,i):new Vi(t,r,n,o,u,d||null,f,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let n=this.children[r];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}t.contentElement||(t.getContent=()=>R.empty)}return t}matchesNode(t,r,n){return this.dirty==Tn&&t.eq(this.node)&&R1(r,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,r){let n=this.node.inlineContent,o=r,i=t.composing?this.localCompositionInfo(t,r):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new cP(this,s&&s.node,t);fP(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,n,t):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?Te.none:this.node.child(u).marks,n,t),l.placeWidget(c,t,o)},(c,u,d,f)=>{l.syncToMarks(c.marks,n,t);let p;l.findNodeMatch(c,u,d,f)||a&&t.state.selection.from>o&&t.state.selection.to-1&&l.updateNodeAt(c,u,d,p,t)||l.updateNextNode(c,u,d,t,f,o)||l.addNode(c,u,d,t,o),o+=c.nodeSize}),l.syncToMarks([],n,t),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Fs)&&(s&&this.protectLocalComposition(t,s),HE(this.contentDOM,this.children,t),Nl&&pP(this.dom))}localCompositionInfo(t,r){let{from:n,to:o}=t.state.selection;if(!(t.state.selection instanceof le)||nr+this.node.content.size)return null;let i=t.domSelectionRange(),s=hP(i.focusNode,i.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,l=mP(this.node.content,a,n-r,o-r);return l<0?null:{node:s,pos:l,text:a}}else return{node:s,pos:-1,text:""}}protectLocalComposition(t,{node:r,pos:n,text:o}){if(this.getDesc(r))return;let i=r;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new sP(this,i,r,o);t.input.compositionNodes.push(s),this.children=P1(this.children,n,n+o.length,t,s)}update(t,r,n,o){return this.dirty==Oo||!t.sameMarkup(this.node)?!1:(this.updateInner(t,r,n,o),!0)}updateInner(t,r,n,o){this.updateOuterDeco(r),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=Tn}updateOuterDeco(t){if(R1(t,this.outerDeco))return;let r=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=BE(this.dom,this.nodeDOM,N1(this.outerDeco,this.node,r),N1(t,this.node,r)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Ok(e,t,r,n,o){FE(n,t,e);let i=new Vi(void 0,e,t,r,n,n,n,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Ph extends Vi{constructor(t,r,n,o,i,s,a){super(t,r,n,o,i,null,s,a,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,r,n,o){return this.dirty==Oo||this.dirty!=Tn&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(r),(this.dirty!=Tn||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=t,this.dirty=Tn,!0)}inParent(){let t=this.parent.contentDOM;for(let r=this.nodeDOM;r;r=r.parentNode)if(r==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,r,n){return t==this.nodeDOM?this.posAtStart+Math.min(r,this.node.text.length):super.localPosFromDOM(t,r,n)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,r,n){let o=this.node.cut(t,r),i=document.createTextNode(o.text);return new Ph(this.parent,o,this.outerDeco,this.innerDeco,i,i,n)}markDirty(t,r){super.markDirty(t,r),this.dom!=this.nodeDOM&&(t==0||r==this.nodeDOM.nodeValue.length)&&(this.dirty=Oo)}get domAtom(){return!1}}class $E extends Pd{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Tn&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class aP extends Vi{constructor(t,r,n,o,i,s,a,l,c,u){super(t,r,n,o,i,s,a,c,u),this.spec=l}update(t,r,n,o){if(this.dirty==Oo)return!1;if(this.spec.update){let i=this.spec.update(t,r,n);return i&&this.updateInner(t,r,n,o),i}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,r,n,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,r,n,o){this.spec.setSelection?this.spec.setSelection(t,r,n):super.setSelection(t,r,n,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function HE(e,t,r){let n=e.firstChild,o=!1;for(let i=0;i>1,s=Math.min(i,t.length);for(;o-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=sa.create(this.top,t[i],r,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(t,r,n,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(t,r,n))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(n){let c=r.children[n-1];if(c instanceof sa)r=c,n=c.children.length;else{a=c,n--;break}}else{if(r==t)break e;n=r.parent.children.indexOf(r),r=r.parent}let l=a.node;if(l){if(l!=e.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function dP(e,t){return e.type.side-t.type.side}function fP(e,t,r,n){let o=t.locals(e),i=0;if(o.length==0){for(let c=0;ci;)a.push(o[s++]);let h=i+f.nodeSize;if(f.isText){let b=h;s!b.inline):a.slice();n(f,m,t.forChild(i,f),p),i=h}}function pP(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function hP(e,t){for(;;){if(e.nodeType==3)return e;if(e.nodeType==1&&t>0){if(e.childNodes.length>t&&e.childNodes[t].nodeType==3)return e.childNodes[t];e=e.childNodes[t-1],t=yo(e)}else if(e.nodeType==1&&t=r){if(i>=n&&l.slice(n-t.length-a,n-a)==t)return n-t.length;let c=a=0&&c+t.length+a>=r)return a+c;if(r==n&&l.length>=n+t.length-a&&l.slice(n-a,n-a+t.length)==t)return n}}return-1}function P1(e,t,r,n,o){let i=[];for(let s=0,a=0;s=r||u<=t?i.push(l):(cr&&i.push(l.slice(r-c,l.size,n)))}return i}function Nv(e,t=null){let r=e.domSelectionRange(),n=e.state.doc;if(!r.focusNode)return null;let o=e.docView.nearestDesc(r.focusNode),i=o&&o.size==0,s=e.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(s<0)return null;let a=n.resolve(s),l,c;if(Rh(r)){for(l=a;o&&!o.node;)o=o.parent;let u=o.node;if(o&&u.isAtom&&ce.isSelectable(u)&&o.parent&&!(u.isInline&&HR(r.focusNode,r.focusOffset,o.dom))){let d=o.posBefore;c=new ce(s==d?a:n.resolve(d))}}else{let u=e.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(u<0)return null;l=n.resolve(u)}if(!c){let u=t=="pointer"||e.state.selection.head{(r.anchorNode!=n||r.anchorOffset!=o)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!VE(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function vP(e){let t=e.domSelection(),r=document.createRange(),n=e.cursorWrapper.dom,o=n.nodeName=="IMG";o?r.setEnd(n.parentNode,yr(n)+1):r.setEnd(n,0),r.collapse(!1),t.removeAllRanges(),t.addRange(r),!o&&!e.state.selection.visible&&Ir&&Fi<=11&&(n.disabled=!0,n.disabled=!1)}function jE(e,t){if(t instanceof ce){let r=e.docView.descAt(t.from);r!=e.lastSelectedViewDesc&&(Pk(e),r&&r.selectNode(),e.lastSelectedViewDesc=r)}else Pk(e)}function Pk(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Rv(e,t,r,n){return e.someProp("createSelectionBetween",o=>o(e,t,r))||le.between(t,r,n)}function zk(e){return e.editable&&!e.hasFocus()?!1:UE(e)}function UE(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function yP(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),r=e.domSelectionRange();return ia(t.node,t.offset,r.anchorNode,r.anchorOffset)}function z1(e,t){let{$anchor:r,$head:n}=e.selection,o=t>0?r.max(n):r.min(n),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&be.findFrom(i,t)}function Ti(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Lk(e,t,r){let n=e.state.selection;if(n instanceof le)if(r.indexOf("s")>-1){let{$head:o}=n,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=e.state.doc.resolve(o.pos+i.nodeSize*(t<0?-1:1));return Ti(e,new le(n.$anchor,s))}else if(n.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let o=z1(e.state,t);return o&&o instanceof ce?Ti(e,o):!1}else if(!(kn&&r.indexOf("m")>-1)){let o=n.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let a=t<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=e.docView.descAt(a))&&!s.contentDOM?ce.isSelectable(i)?Ti(e,new ce(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):Rd?Ti(e,new le(e.state.doc.resolve(t<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(n instanceof ce&&n.node.isInline)return Ti(e,new le(t>0?n.$to:n.$from));{let o=z1(e.state,t);return o?Ti(e,o):!1}}}function Ep(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function vu(e,t){let r=e.pmViewDesc;return r&&r.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function Aa(e,t){return t<0?bP(e):xP(e)}function bP(e){let t=e.domSelectionRange(),r=t.focusNode,n=t.focusOffset;if(!r)return;let o,i,s=!1;for(oo&&r.nodeType==1&&n0){if(r.nodeType!=1)break;{let a=r.childNodes[n-1];if(vu(a,-1))o=r,i=--n;else if(a.nodeType==3)r=a,n=r.nodeValue.length;else break}}else{if(WE(r))break;{let a=r.previousSibling;for(;a&&vu(a,-1);)o=r.parentNode,i=yr(a),a=a.previousSibling;if(a)r=a,n=Ep(r);else{if(r=r.parentNode,r==e.dom)break;n=0}}}s?L1(e,r,n):o&&L1(e,o,i)}function xP(e){let t=e.domSelectionRange(),r=t.focusNode,n=t.focusOffset;if(!r)return;let o=Ep(r),i,s;for(;;)if(n{e.state==o&&Qo(e)},50)}function Ik(e,t){let r=e.state.doc.resolve(t);if(!(ur||jR)&&r.parent.inlineContent){let o=e.coordsAtPos(t);if(t>r.start()){let i=e.coordsAtPos(t-1),s=(i.top+i.bottom)/2;if(s>o.top&&s1)return i.lefto.top&&s1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function Dk(e,t,r){let n=e.state.selection;if(n instanceof le&&!n.empty||r.indexOf("s")>-1||kn&&r.indexOf("m")>-1)return!1;let{$from:o,$to:i}=n;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=z1(e.state,t);if(s&&s instanceof ce)return Ti(e,s)}if(!o.parent.inlineContent){let s=t<0?o:i,a=n instanceof xr?be.near(s,t):be.findFrom(s,t);return a?Ti(e,a):!1}return!1}function $k(e,t){if(!(e.state.selection instanceof le))return!0;let{$head:r,$anchor:n,empty:o}=e.state.selection;if(!r.sameParent(n))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(i&&!i.isText){let s=e.state.tr;return t<0?s.delete(r.pos-i.nodeSize,r.pos):s.delete(r.pos,r.pos+i.nodeSize),e.dispatch(s),!0}return!1}function Hk(e,t,r){e.domObserver.stop(),t.contentEditable=r,e.domObserver.start()}function SP(e){if(!wr||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:r}=e.domSelectionRange();if(t&&t.nodeType==1&&r==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let n=t.firstChild;Hk(e,n,"true"),setTimeout(()=>Hk(e,n,"false"),20)}return!1}function EP(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function CP(e,t){let r=t.keyCode,n=EP(t);if(r==8||kn&&r==72&&n=="c")return $k(e,-1)||Aa(e,-1);if(r==46&&!t.shiftKey||kn&&r==68&&n=="c")return $k(e,1)||Aa(e,1);if(r==13||r==27)return!0;if(r==37||kn&&r==66&&n=="c"){let o=r==37?Ik(e,e.state.selection.from)=="ltr"?-1:1:-1;return Lk(e,o,n)||Aa(e,o)}else if(r==39||kn&&r==70&&n=="c"){let o=r==39?Ik(e,e.state.selection.from)=="ltr"?1:-1:1;return Lk(e,o,n)||Aa(e,o)}else{if(r==38||kn&&r==80&&n=="c")return Dk(e,-1,n)||Aa(e,-1);if(r==40||kn&&r==78&&n=="c")return SP(e)||Dk(e,1,n)||Aa(e,1);if(n==(kn?"m":"c")&&(r==66||r==73||r==89||r==90))return!0}return!1}function KE(e,t){e.someProp("transformCopied",p=>{t=p(t,e)});let r=[],{content:n,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&n.childCount==1&&n.firstChild.childCount==1;){o--,i--;let p=n.firstChild;r.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),n=p.content}let s=e.someProp("clipboardSerializer")||sn.fromSchema(e.state.schema),a=QE(),l=a.createElement("div");l.appendChild(s.serializeFragment(n,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=XE[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let h=a.createElement(u[p]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(r)}`);let f=e.someProp("clipboardTextSerializer",p=>p(t,e))||t.content.textBetween(0,t.content.size,` +other {Heading}}`,comment:"Label for heading command with support for levels."};var hR=Object.freeze({__proto__:null,LABEL:pR});const mR={id:"extension.command.undo.label",message:"Undo",comment:"Label for undo."},gR={id:"extension.command.undo.description",message:"Undo the most recent action",comment:"Description for undo."},vR={id:"extension.command.redo.label",message:"Redo",comment:"Label for redo."},yR={id:"extension.command.redo.description",message:"Redo the most recent action",comment:"Description for redo."};var Ep=Object.freeze({__proto__:null,REDO_DESCRIPTION:yR,REDO_LABEL:vR,UNDO_DESCRIPTION:gR,UNDO_LABEL:mR});const bR={id:"extension.command.insert-horizontal-rule.label",message:"Divider",comment:"Label for inserting a horizontal rule (divider) command."},xR={id:"extension.command.insert-horizontal-rule.description",message:"Separate content with a diving horizontal line",comment:"Description for inserting a horizontal rule (divider) command."};var vk=Object.freeze({__proto__:null,DESCRIPTION:xR,LABEL:bR});const kR={id:"extension.command.toggle-italic.label",message:"Italic",comment:"Label for italic formatting command."},wR={id:"extension.command.toggle-italic.description",message:"Italicize the selected text",comment:"Description for italic formatting command."};var yk=Object.freeze({__proto__:null,DESCRIPTION:wR,LABEL:kR});const SR={id:"extension.command.toggle-ordered-list.label",message:"Ordered list",comment:"Label for inserting an ordered list into the editor."},ER={id:"extension.command.toggle-bullet-list.description",message:"Bulleted list",comment:"Description for inserting a bullet list into the editor."},CR={id:"extension.command.toggle-task-list.description",message:"Tasked list",comment:"Description for inserting a task list into the editor."};var Nv=Object.freeze({__proto__:null,BULLET_LIST_LABEL:ER,ORDERED_LIST_LABEL:SR,TASK_LIST_LABEL:CR});const MR={id:"extension.command.increase-indent.label",message:"Increase indentation",comment:"Label for increasing the indentation level."},TR={id:"extension.command.decrease-indent.label",message:"Decrease indentation",comment:"Label for decreasing the indentation level of the current node block."},OR={id:"extension.command.center-align.label",message:"Center align",comment:"Center align the text in the current node."},_R={id:"extension.command.justify-align.label",message:"Justify",comment:"Justify the alignment of the selected nodes."},AR={id:"extension.command.right-align.label",message:"Right align",comment:"Right align the selected nodes."},NR={id:"extension.command.left-align.label",message:"Left align",comment:"Left align the selected nodes."};var nc=Object.freeze({__proto__:null,CENTER_ALIGN_LABEL:OR,DECREASE_INDENT_LABEL:TR,INCREASE_INDENT_LABEL:MR,JUSTIFY_ALIGN_LABEL:_R,LEFT_ALIGN_LABEL:NR,RIGHT_ALIGN_LABEL:AR});const RR={id:"extension.command.insert-paragraph.label",message:"Insert Paragraph",comment:"Label for inserting a paragraph."},PR={id:"extension.command.insert-paragraph.description",message:"Insert a new paragraph",comment:"Description for inserting a paragraph."},zR={id:"extension.command.convert-paragraph.label",message:"Convert Paragraph",comment:"Label for converting the current node into a paragraph."},LR={id:"extension.command.convert-paragraph.description",message:"Convert current block into a paragraph block.",comment:"Description for converting a paragraph."};var Cp=Object.freeze({__proto__:null,CONVERT_DESCRIPTION:LR,CONVERT_LABEL:zR,INSERT_DESCRIPTION:PR,INSERT_LABEL:RR});const IR={id:"extension.command.toggle-strike.label",message:"Strikethrough",comment:"Label for strike formatting command."},DR={id:"extension.command.toggle-strike.description",message:"Strikethrough the selected text",comment:"Description for strike formatting command."};var bk=Object.freeze({__proto__:null,DESCRIPTION:DR,LABEL:IR});const $R={id:"extension.command.toggle-underline.label",message:"Underline",comment:"Label for underline formatting command."},HR={id:"extension.command.toggle-underline.description",message:"Underline the selected text",comment:"Description for underline formatting command."};var xk=Object.freeze({__proto__:null,DESCRIPTION:HR,LABEL:$R});class wa{constructor(t,r){this.match=t,this.match=t,this.handler=typeof r=="string"?BR(r):r}}function BR(e){return function(t,r,n,o){let i=e;if(r[1]){let s=r[0].lastIndexOf(r[1]);i+=r[0].slice(s+r[1].length),n+=s;let a=n-o;a>0&&(i=r[0].slice(s-a,s)+i,n=o)}return t.tr.insertText(i,n,o)}}const FR=500;function VR({rules:e}){let t=new Ro({state:{init(){return null},apply(r,n){let o=r.getMeta(this);return o||(r.selectionSet||r.docChanged?null:n)}},props:{handleTextInput(r,n,o,i){return kk(r,n,o,i,e,t)},handleDOMEvents:{compositionend:r=>{setTimeout(()=>{let{$cursor:n}=r.state.selection;n&&kk(r,n.pos,n.pos,"",e,t)})}}},isInputRules:!0});return t}function kk(e,t,r,n,o,i){if(e.composing)return!1;let s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;let l=a.parent.textBetween(Math.max(0,a.parentOffset-FR),a.parentOffset,null,"")+n;for(let c=0;c{let r=e.plugins;for(let n=0;n=0;l--)s.step(a.steps[l].invert(a.docs[l]));if(i.text){let l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,e.schema.text(i.text,l))}else s.delete(i.from,i.to);t(s)}return!0}}return!1};function zh(e,t,r=null,n){return new wa(e,(o,i,s,a)=>{let l=r instanceof Function?r(i):r,c=o.tr.delete(s,a),u=c.doc.resolve(s),d=u.blockRange(),f=d&&Tv(d,t,l);if(!f)return null;c.wrap(d,f);let p=c.doc.resolve(s-1).nodeBefore;return p&&p.type==t&&Rd(c.doc,s-1)&&(!n||n(i,p))&&c.join(s-1),c})}function UR(e,t,r=null){return new wa(e,(n,o,i,s)=>{let a=n.doc.resolve(i),l=r instanceof Function?r(o):r;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t)?n.tr.delete(i,s).setBlockType(i,i,t,l):null})}const br=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Du=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let wk=null;const Fo=function(e,t,r){let n=wk||(wk=document.createRange());return n.setEnd(e,r??e.nodeValue.length),n.setStart(e,t||0),n},ia=function(e,t,r,n){return r&&(Sk(e,t,r,n,-1)||Sk(e,t,r,n,1))},WR=/^(img|br|input|textarea|hr)$/i;function Sk(e,t,r,n,o){for(;;){if(e==r&&t==n)return!0;if(t==(o<0?0:yo(e))){let i=e.parentNode;if(!i||i.nodeType!=1||Rv(e)||WR.test(e.nodeName)||e.contentEditable=="false")return!1;t=br(e)+(o<0?0:1),e=i}else if(e.nodeType==1){if(e=e.childNodes[t+(o<0?-1:0)],e.contentEditable=="false")return!1;t=o<0?yo(e):0}else return!1}}function yo(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function KR(e,t,r){for(let n=t==0,o=t==yo(e);n||o;){if(e==r)return!0;let i=br(e);if(e=e.parentNode,!e)return!1;n=n&&i==0,o=o&&i==yo(e)}}function Rv(e){let t;for(let r=e;r&&!(t=r.pmViewDesc);r=r.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const Lh=function(e){return e.focusNode&&ia(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function $s(e,t){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=e,r.key=r.code=t,r}function qR(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function GR(e,t,r){if(e.caretPositionFromPoint)try{let n=e.caretPositionFromPoint(t,r);if(n)return{node:n.offsetNode,offset:n.offset}}catch{}if(e.caretRangeFromPoint){let n=e.caretRangeFromPoint(t,r);if(n)return{node:n.startContainer,offset:n.startOffset}}}const To=typeof navigator<"u"?navigator:null,Ek=typeof document<"u"?document:null,ms=To&&To.userAgent||"",N1=/Edge\/(\d+)/.exec(ms),zE=/MSIE \d/.exec(ms),R1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ms),Ir=!!(zE||R1||N1),Fi=zE?document.documentMode:R1?+R1[1]:N1?+N1[1]:0,oo=!Ir&&/gecko\/(\d+)/i.test(ms);oo&&+(/Firefox\/(\d+)/.exec(ms)||[0,0])[1];const P1=!Ir&&/Chrome\/(\d+)/.exec(ms),dr=!!P1,YR=P1?+P1[1]:0,Sr=!Ir&&!!To&&/Apple Computer/.test(To.vendor),Nl=Sr&&(/Mobile\/\w+/.test(ms)||!!To&&To.maxTouchPoints>2),wn=Nl||(To?/Mac/.test(To.platform):!1),JR=To?/Win/.test(To.platform):!1,Jn=/Android \d/.test(ms),Pd=!!Ek&&"webkitFontSmoothing"in Ek.documentElement.style,XR=Pd?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function QR(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Lo(e,t){return typeof e=="number"?e:e[t]}function ZR(e){let t=e.getBoundingClientRect(),r=t.width/e.offsetWidth||1,n=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*r,top:t.top,bottom:t.top+e.clientHeight*n}}function Ck(e,t,r){let n=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=r||e.dom;s;s=Du(s)){if(s.nodeType!=1)continue;let a=s,l=a==i.body,c=l?QR(i):ZR(a),u=0,d=0;if(t.topc.bottom-Lo(n,"bottom")&&(d=t.bottom-t.top>c.bottom-c.top?t.top+Lo(o,"top")-c.top:t.bottom-c.bottom+Lo(o,"bottom")),t.leftc.right-Lo(n,"right")&&(u=t.right-c.right+Lo(o,"right")),u||d)if(l)i.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let h=a.scrollLeft-f,m=a.scrollTop-p;t={left:t.left-h,top:t.top-m,right:t.right-h,bottom:t.bottom-m}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function eP(e){let t=e.dom.getBoundingClientRect(),r=Math.max(0,t.top),n,o;for(let i=(t.left+t.right)/2,s=r+1;s=r-20){n=a,o=l.top;break}}return{refDOM:n,refTop:o,stack:LE(e.dom)}}function LE(e){let t=[],r=e.ownerDocument;for(let n=e;n&&(t.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),e!=r);n=Du(n));return t}function tP({refDOM:e,refTop:t,stack:r}){let n=e?e.getBoundingClientRect().top:0;IE(r,n==0?0:n-t)}function IE(e,t){for(let r=0;r=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);let m=h.left>t.left?h.left-t.left:h.right=(h.left+h.right)/2?1:0));continue}}else h.top>t.top&&!l&&h.left<=t.left&&h.right>=t.left&&(l=u,c={left:Math.max(h.left,Math.min(h.right,t.left)),top:h.top});!r&&(t.left>=h.right&&t.top>=h.top||t.left>=h.left&&t.top>=h.bottom)&&(i=d+1)}}return!r&&l&&(r=l,o=c,n=0),r&&r.nodeType==3?nP(r,o):!r||n&&r.nodeType==1?{node:e,offset:i}:DE(r,o)}function nP(e,t){let r=e.nodeValue.length,n=document.createRange();for(let o=0;o=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}function Pv(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function oP(e,t){let r=e.parentNode;return r&&/^li$/i.test(r.nodeName)&&t.left(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(n,o,i)}function sP(e,t,r,n){let o=-1;for(let i=t,s=!1;i!=e.dom;){let a=e.docView.nearestDesc(i,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent&&!s||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&!s&&(s=!0,l.left>n.left||l.top>n.top?o=a.posBefore:(l.right-1?o:e.docView.posFromDOM(t,r,-1)}function $E(e,t,r){let n=e.childNodes.length;if(n&&r.topt.top&&o++}let c;Pd&&o&&n.nodeType==1&&(c=n.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=t.top&&o--,n==e.dom&&o==n.childNodes.length-1&&n.lastChild.nodeType==1&&t.top>n.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(o==0||n.nodeType!=1||n.childNodes[o-1].nodeName!="BR")&&(a=sP(e,n,o,t))}a==null&&(a=iP(e,s,t));let l=e.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Mk(e){return e.top=0&&o==n.nodeValue.length?(l--,u=1):r<0?l--:c++,yc(ki(Fo(n,l,c),u),u<0)}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(i==null&&o&&(r<0||o==yo(n))){let l=n.childNodes[o-1];if(l.nodeType==1)return mg(l.getBoundingClientRect(),!1)}if(i==null&&o=0)}if(i==null&&o&&(r<0||o==yo(n))){let l=n.childNodes[o-1],c=l.nodeType==3?Fo(l,yo(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return yc(ki(c,1),!1)}if(i==null&&o=0)}function yc(e,t){if(e.width==0)return e;let r=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:r,right:r}}function mg(e,t){if(e.height==0)return e;let r=t?e.top:e.bottom;return{top:r,bottom:r,left:e.left,right:e.right}}function BE(e,t,r){let n=e.state,o=e.root.activeElement;n!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return r()}finally{n!=t&&e.updateState(n),o!=e.dom&&o&&o.focus()}}function cP(e,t,r){let n=t.selection,o=r=="up"?n.$from:n.$to;return BE(e,t,()=>{let{node:i}=e.docView.domFromPos(o.pos,r=="up"?-1:1);for(;;){let a=e.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=HE(e,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Fo(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(r=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const uP=/[\u0590-\u08ac]/;function dP(e,t,r){let{$head:n}=t.selection;if(!n.parent.isTextblock)return!1;let o=n.parentOffset,i=!o,s=o==n.parent.content.size,a=e.domSelection();return!uP.test(n.parent.textContent)||!a.modify?r=="left"||r=="backward"?i:s:BE(e,t,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=e.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",r,"character");let p=n.depth?e.docView.domAfterPos(n.before()):e.dom,{focusNode:h,focusOffset:m}=e.domSelectionRange(),b=h&&!p.contains(h.nodeType==1?h:h.parentNode)||l==h&&c==m;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),b})}let Tk=null,Ok=null,_k=!1;function fP(e,t,r){return Tk==t&&Ok==r?_k:(Tk=t,Ok=r,_k=r=="up"||r=="down"?cP(e,t,r):dP(e,t,r))}const _n=0,Ak=1,Fs=2,Oo=3;class zd{constructor(t,r,n,o){this.parent=t,this.children=r,this.dom=n,this.contentDOM=o,this.dirty=_n,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,r,n){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let r=0;rbr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(r==0)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&r==t.childNodes.length)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??n>0?this.posAtEnd:this.posAtStart}nearestDesc(t,r=!1){for(let n=!0,o=t;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!r||i.node))if(n&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(t.nodeType==1?t:t.parentNode):s==t))n=!1;else return i}}getDesc(t){let r=t.pmViewDesc;for(let n=r;n;n=n.parent)if(n==this)return r}posFromDOM(t,r,n){for(let o=t;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(t,r,n)}return-1}descAt(t){for(let r=0,n=0;rt||s instanceof VE){o=t-i;break}i=a}if(o)return this.children[n].domFromPos(o-this.children[n].border,r);for(let i;n&&!(i=this.children[n-1]).size&&i instanceof FE&&i.side>=0;n--);if(r<=0){let i,s=!0;for(;i=n?this.children[n-1]:null,!(!i||i.dom.parentNode==this.contentDOM);n--,s=!1);return i&&r&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,r):{node:this.contentDOM,offset:i?br(i.dom)+1:0}}else{let i,s=!0;for(;i=n=u&&r<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,r,u);t=s;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=br(f.dom)+1;break}t-=f.size}o==-1&&(o=0)}if(o>-1&&(c>r||a==this.children.length-1)){r=c;for(let u=a+1;up&&sr){let p=a;a=l,l=p}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,r){for(let n=0,o=0;o=n:tn){let a=n+i.border,l=s-i.border;if(t>=a&&r<=l){this.dirty=t==n||r==s?Fs:Ak,t==a&&r==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Oo:i.markDirty(t-a,r-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Fs:Oo}n=s}this.dirty=Fs}markParentsDirty(){let t=1;for(let r=this.parent;r;r=r.parent,t++){let n=t==1?Fs:Ak;r.dirty{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!r.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=r,this.widget=r,i=this}matchesWidget(t){return this.dirty==_n&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let r=this.widget.spec.stopEvent;return r?r(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class pP extends zd{constructor(t,r,n,o){super(t,[],r,null),this.textDOM=n,this.text=o}get size(){return this.text.length}localPosFromDOM(t,r){return t!=this.textDOM?this.posAtStart+(r?this.size:0):this.posAtStart+r}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class sa extends zd{constructor(t,r,n,o){super(t,[],n,o),this.mark=r}static create(t,r,n,o){let i=o.nodeViews[r.type.name],s=i&&i(r,o,n);return(!s||!s.dom)&&(s=an.renderSpec(document,r.type.spec.toDOM(r,n))),new sa(t,r,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&Oo||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Oo&&this.mark.eq(t)}markDirty(t,r){if(super.markDirty(t,r),this.dirty!=_n){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty0&&(i=I1(i,0,t,n));for(let a=0;a{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},n,o),u=c&&c.dom,d=c&&c.contentDOM;if(r.isText){if(!u)u=document.createTextNode(r.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=an.renderSpec(document,r.type.spec.toDOM(r)));!d&&!r.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),r.type.spec.draggable&&(u.draggable=!0));let f=u;return u=WE(u,n,r),c?l=new hP(t,r,n,o,u,d||null,f,c,i,s+1):r.isText?new Ih(t,r,n,o,u,f,i):new Vi(t,r,n,o,u,d||null,f,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let n=this.children[r];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}t.contentElement||(t.getContent=()=>R.empty)}return t}matchesNode(t,r,n){return this.dirty==_n&&t.eq(this.node)&&L1(r,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,r){let n=this.node.inlineContent,o=r,i=t.composing?this.localCompositionInfo(t,r):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new gP(this,s&&s.node,t);bP(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,n,t):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?Te.none:this.node.child(u).marks,n,t),l.placeWidget(c,t,o)},(c,u,d,f)=>{l.syncToMarks(c.marks,n,t);let p;l.findNodeMatch(c,u,d,f)||a&&t.state.selection.from>o&&t.state.selection.to-1&&l.updateNodeAt(c,u,d,p,t)||l.updateNextNode(c,u,d,t,f,o)||l.addNode(c,u,d,t,o),o+=c.nodeSize}),l.syncToMarks([],n,t),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Fs)&&(s&&this.protectLocalComposition(t,s),jE(this.contentDOM,this.children,t),Nl&&xP(this.dom))}localCompositionInfo(t,r){let{from:n,to:o}=t.state.selection;if(!(t.state.selection instanceof le)||nr+this.node.content.size)return null;let i=t.domSelectionRange(),s=kP(i.focusNode,i.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,l=wP(this.node.content,a,n-r,o-r);return l<0?null:{node:s,pos:l,text:a}}else return{node:s,pos:-1,text:""}}protectLocalComposition(t,{node:r,pos:n,text:o}){if(this.getDesc(r))return;let i=r;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new pP(this,i,r,o);t.input.compositionNodes.push(s),this.children=I1(this.children,n,n+o.length,t,s)}update(t,r,n,o){return this.dirty==Oo||!t.sameMarkup(this.node)?!1:(this.updateInner(t,r,n,o),!0)}updateInner(t,r,n,o){this.updateOuterDeco(r),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=_n}updateOuterDeco(t){if(L1(t,this.outerDeco))return;let r=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=UE(this.dom,this.nodeDOM,z1(this.outerDeco,this.node,r),z1(t,this.node,r)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Nk(e,t,r,n,o){WE(n,t,e);let i=new Vi(void 0,e,t,r,n,n,n,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Ih extends Vi{constructor(t,r,n,o,i,s,a){super(t,r,n,o,i,null,s,a,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,r,n,o){return this.dirty==Oo||this.dirty!=_n&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(r),(this.dirty!=_n||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=t,this.dirty=_n,!0)}inParent(){let t=this.parent.contentDOM;for(let r=this.nodeDOM;r;r=r.parentNode)if(r==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,r,n){return t==this.nodeDOM?this.posAtStart+Math.min(r,this.node.text.length):super.localPosFromDOM(t,r,n)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,r,n){let o=this.node.cut(t,r),i=document.createTextNode(o.text);return new Ih(this.parent,o,this.outerDeco,this.innerDeco,i,i,n)}markDirty(t,r){super.markDirty(t,r),this.dom!=this.nodeDOM&&(t==0||r==this.nodeDOM.nodeValue.length)&&(this.dirty=Oo)}get domAtom(){return!1}}class VE extends zd{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==_n&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class hP extends Vi{constructor(t,r,n,o,i,s,a,l,c,u){super(t,r,n,o,i,s,a,c,u),this.spec=l}update(t,r,n,o){if(this.dirty==Oo)return!1;if(this.spec.update){let i=this.spec.update(t,r,n);return i&&this.updateInner(t,r,n,o),i}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,r,n,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,r,n,o){this.spec.setSelection?this.spec.setSelection(t,r,n):super.setSelection(t,r,n,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function jE(e,t,r){let n=e.firstChild,o=!1;for(let i=0;i>1,s=Math.min(i,t.length);for(;o-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=sa.create(this.top,t[i],r,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(t,r,n,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(t,r,n))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(n){let c=r.children[n-1];if(c instanceof sa)r=c,n=c.children.length;else{a=c,n--;break}}else{if(r==t)break e;n=r.parent.children.indexOf(r),r=r.parent}let l=a.node;if(l){if(l!=e.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function yP(e,t){return e.type.side-t.type.side}function bP(e,t,r,n){let o=t.locals(e),i=0;if(o.length==0){for(let c=0;ci;)a.push(o[s++]);let h=i+f.nodeSize;if(f.isText){let b=h;s!b.inline):a.slice();n(f,m,t.forChild(i,f),p),i=h}}function xP(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function kP(e,t){for(;;){if(e.nodeType==3)return e;if(e.nodeType==1&&t>0){if(e.childNodes.length>t&&e.childNodes[t].nodeType==3)return e.childNodes[t];e=e.childNodes[t-1],t=yo(e)}else if(e.nodeType==1&&t=r){if(i>=n&&l.slice(n-t.length-a,n-a)==t)return n-t.length;let c=a=0&&c+t.length+a>=r)return a+c;if(r==n&&l.length>=n+t.length-a&&l.slice(n-a,n-a+t.length)==t)return n}}return-1}function I1(e,t,r,n,o){let i=[];for(let s=0,a=0;s=r||u<=t?i.push(l):(cr&&i.push(l.slice(r-c,l.size,n)))}return i}function zv(e,t=null){let r=e.domSelectionRange(),n=e.state.doc;if(!r.focusNode)return null;let o=e.docView.nearestDesc(r.focusNode),i=o&&o.size==0,s=e.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(s<0)return null;let a=n.resolve(s),l,c;if(Lh(r)){for(l=a;o&&!o.node;)o=o.parent;let u=o.node;if(o&&u.isAtom&&ce.isSelectable(u)&&o.parent&&!(u.isInline&&KR(r.focusNode,r.focusOffset,o.dom))){let d=o.posBefore;c=new ce(s==d?a:n.resolve(d))}}else{let u=e.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(u<0)return null;l=n.resolve(u)}if(!c){let u=t=="pointer"||e.state.selection.head{(r.anchorNode!=n||r.anchorOffset!=o)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!KE(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function EP(e){let t=e.domSelection(),r=document.createRange(),n=e.cursorWrapper.dom,o=n.nodeName=="IMG";o?r.setEnd(n.parentNode,br(n)+1):r.setEnd(n,0),r.collapse(!1),t.removeAllRanges(),t.addRange(r),!o&&!e.state.selection.visible&&Ir&&Fi<=11&&(n.disabled=!0,n.disabled=!1)}function qE(e,t){if(t instanceof ce){let r=e.docView.descAt(t.from);r!=e.lastSelectedViewDesc&&(Ik(e),r&&r.selectNode(),e.lastSelectedViewDesc=r)}else Ik(e)}function Ik(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Lv(e,t,r,n){return e.someProp("createSelectionBetween",o=>o(e,t,r))||le.between(t,r,n)}function Dk(e){return e.editable&&!e.hasFocus()?!1:GE(e)}function GE(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function CP(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),r=e.domSelectionRange();return ia(t.node,t.offset,r.anchorNode,r.anchorOffset)}function D1(e,t){let{$anchor:r,$head:n}=e.selection,o=t>0?r.max(n):r.min(n),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&be.findFrom(i,t)}function Ti(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function $k(e,t,r){let n=e.state.selection;if(n instanceof le)if(r.indexOf("s")>-1){let{$head:o}=n,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=e.state.doc.resolve(o.pos+i.nodeSize*(t<0?-1:1));return Ti(e,new le(n.$anchor,s))}else if(n.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let o=D1(e.state,t);return o&&o instanceof ce?Ti(e,o):!1}else if(!(wn&&r.indexOf("m")>-1)){let o=n.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let a=t<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=e.docView.descAt(a))&&!s.contentDOM?ce.isSelectable(i)?Ti(e,new ce(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):Pd?Ti(e,new le(e.state.doc.resolve(t<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(n instanceof ce&&n.node.isInline)return Ti(e,new le(t>0?n.$to:n.$from));{let o=D1(e.state,t);return o?Ti(e,o):!1}}}function Mp(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function yu(e,t){let r=e.pmViewDesc;return r&&r.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function Aa(e,t){return t<0?MP(e):TP(e)}function MP(e){let t=e.domSelectionRange(),r=t.focusNode,n=t.focusOffset;if(!r)return;let o,i,s=!1;for(oo&&r.nodeType==1&&n0){if(r.nodeType!=1)break;{let a=r.childNodes[n-1];if(yu(a,-1))o=r,i=--n;else if(a.nodeType==3)r=a,n=r.nodeValue.length;else break}}else{if(YE(r))break;{let a=r.previousSibling;for(;a&&yu(a,-1);)o=r.parentNode,i=br(a),a=a.previousSibling;if(a)r=a,n=Mp(r);else{if(r=r.parentNode,r==e.dom)break;n=0}}}s?$1(e,r,n):o&&$1(e,o,i)}function TP(e){let t=e.domSelectionRange(),r=t.focusNode,n=t.focusOffset;if(!r)return;let o=Mp(r),i,s;for(;;)if(n{e.state==o&&Qo(e)},50)}function Hk(e,t){let r=e.state.doc.resolve(t);if(!(dr||JR)&&r.parent.inlineContent){let o=e.coordsAtPos(t);if(t>r.start()){let i=e.coordsAtPos(t-1),s=(i.top+i.bottom)/2;if(s>o.top&&s1)return i.lefto.top&&s1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function Bk(e,t,r){let n=e.state.selection;if(n instanceof le&&!n.empty||r.indexOf("s")>-1||wn&&r.indexOf("m")>-1)return!1;let{$from:o,$to:i}=n;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=D1(e.state,t);if(s&&s instanceof ce)return Ti(e,s)}if(!o.parent.inlineContent){let s=t<0?o:i,a=n instanceof kr?be.near(s,t):be.findFrom(s,t);return a?Ti(e,a):!1}return!1}function Fk(e,t){if(!(e.state.selection instanceof le))return!0;let{$head:r,$anchor:n,empty:o}=e.state.selection;if(!r.sameParent(n))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(i&&!i.isText){let s=e.state.tr;return t<0?s.delete(r.pos-i.nodeSize,r.pos):s.delete(r.pos,r.pos+i.nodeSize),e.dispatch(s),!0}return!1}function Vk(e,t,r){e.domObserver.stop(),t.contentEditable=r,e.domObserver.start()}function AP(e){if(!Sr||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:r}=e.domSelectionRange();if(t&&t.nodeType==1&&r==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let n=t.firstChild;Vk(e,n,"true"),setTimeout(()=>Vk(e,n,"false"),20)}return!1}function NP(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function RP(e,t){let r=t.keyCode,n=NP(t);if(r==8||wn&&r==72&&n=="c")return Fk(e,-1)||Aa(e,-1);if(r==46&&!t.shiftKey||wn&&r==68&&n=="c")return Fk(e,1)||Aa(e,1);if(r==13||r==27)return!0;if(r==37||wn&&r==66&&n=="c"){let o=r==37?Hk(e,e.state.selection.from)=="ltr"?-1:1:-1;return $k(e,o,n)||Aa(e,o)}else if(r==39||wn&&r==70&&n=="c"){let o=r==39?Hk(e,e.state.selection.from)=="ltr"?1:-1:1;return $k(e,o,n)||Aa(e,o)}else{if(r==38||wn&&r==80&&n=="c")return Bk(e,-1,n)||Aa(e,-1);if(r==40||wn&&r==78&&n=="c")return AP(e)||Bk(e,1,n)||Aa(e,1);if(n==(wn?"m":"c")&&(r==66||r==73||r==89||r==90))return!0}return!1}function JE(e,t){e.someProp("transformCopied",p=>{t=p(t,e)});let r=[],{content:n,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&n.childCount==1&&n.firstChild.childCount==1;){o--,i--;let p=n.firstChild;r.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),n=p.content}let s=e.someProp("clipboardSerializer")||an.fromSchema(e.state.schema),a=rC(),l=a.createElement("div");l.appendChild(s.serializeFragment(n,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=tC[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let h=a.createElement(u[p]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(r)}`);let f=e.someProp("clipboardTextSerializer",p=>p(t,e))||t.content.textBetween(0,t.content.size,` -`);return{dom:l,text:f}}function qE(e,t,r,n,o){let i=o.parent.type.spec.code,s,a;if(!r&&!t)return null;let l=t&&(n||i||!r);if(l){if(e.someProp("transformPastedText",f=>{t=f(t,i||n,e)}),i)return t?new K(R.from(e.state.schema.text(t.replace(/\r\n?/g,` -`))),0,0):K.empty;let d=e.someProp("clipboardTextParser",f=>f(t,o,n,e));if(d)a=d;else{let f=o.marks(),{schema:p}=e.state,h=sn.fromSchema(p);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(m=>{let b=s.appendChild(document.createElement("p"));m&&b.appendChild(h.serializeNode(p.text(m,f)))})}}else e.someProp("transformPastedHTML",d=>{r=d(r,e)}),s=OP(r),Rd&&_P(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||wv.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!MP.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)a=AP(Bk(a,+u[1],+u[2]),u[4]);else if(a=K.maxOpen(TP(a.content,o),!0),a.openStart||a.openEnd){let d=0,f=0;for(let p=a.content.firstChild;d{a=d(a,e)}),a}const MP=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function TP(e,t){if(e.childCount<2)return e;for(let r=t.depth;r>=0;r--){let o=t.node(r).contentMatchAt(t.index(r)),i,s=[];if(e.forEach(a=>{if(!s)return;let l=o.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&i.length&&YE(l,i,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=JE(s[s.length-1],i.length));let u=GE(a,l);s.push(u),o=o.matchType(u.type),i=l}}),s)return R.from(s)}return e}function GE(e,t,r=0){for(let n=t.length-1;n>=r;n--)e=t[n].create(null,R.from(e));return e}function YE(e,t,r,n,o){if(o1&&(i=0),o=r&&(a=t<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(R.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Bk(e,t,r){return t]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let r=QE().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(e),o;if((o=n&&XE[n[1].toLowerCase()])&&(e=o.map(i=>"<"+i+">").join("")+e+o.map(i=>"").reverse().join("")),r.innerHTML=e,o)for(let i=0;i=0;a-=2){let l=r.nodes[n[a]];if(!l||l.hasRequiredAttrs())break;o=R.from(l.create(n[a+1],o)),i++,s++}return new K(o,i,s)}const Sr={},Er={},NP={touchstart:!0,touchmove:!0};class RP{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function PP(e){for(let t in Sr){let r=Sr[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=n=>{LP(e,n)&&!Pv(e,n)&&(e.editable||!(n.type in Er))&&r(e,n)},NP[t]?{passive:!0}:void 0)}wr&&e.dom.addEventListener("input",()=>null),D1(e)}function Ii(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function zP(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function D1(e){e.someProp("handleDOMEvents",t=>{for(let r in t)e.input.eventHandlers[r]||e.dom.addEventListener(r,e.input.eventHandlers[r]=n=>Pv(e,n))})}function Pv(e,t){return e.someProp("handleDOMEvents",r=>{let n=r[t.type];return n?n(e,t)||t.defaultPrevented:!1})}function LP(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let r=t.target;r!=e.dom;r=r.parentNode)if(!r||r.nodeType==11||r.pmViewDesc&&r.pmViewDesc.stopEvent(t))return!1;return!0}function IP(e,t){!Pv(e,t)&&Sr[t.type]&&(e.editable||!(t.type in Er))&&Sr[t.type](e,t)}Er.keydown=(e,t)=>{let r=t;if(e.input.shiftKey=r.keyCode==16||r.shiftKey,!e5(e,r)&&(e.input.lastKeyCode=r.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Yn&&ur&&r.keyCode==13)))if(r.keyCode!=229&&e.domObserver.forceFlush(),Nl&&r.keyCode==13&&!r.ctrlKey&&!r.altKey&&!r.metaKey){let n=Date.now();e.input.lastIOSEnter=n,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==n&&(e.someProp("handleKeyDown",o=>o(e,$s(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",n=>n(e,r))||CP(e,r)?r.preventDefault():Ii(e,"key")};Er.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Er.keypress=(e,t)=>{let r=t;if(e5(e,r)||!r.charCode||r.ctrlKey&&!r.altKey||kn&&r.metaKey)return;if(e.someProp("handleKeyPress",o=>o(e,r))){r.preventDefault();return}let n=e.state.selection;if(!(n instanceof le)||!n.$from.sameParent(n.$to)){let o=String.fromCharCode(r.charCode);!/[\r\n]/.test(o)&&!e.someProp("handleTextInput",i=>i(e,n.$from.pos,n.$to.pos,o))&&e.dispatch(e.state.tr.insertText(o).scrollIntoView()),r.preventDefault()}};function zh(e){return{left:e.clientX,top:e.clientY}}function DP(e,t){let r=t.x-e.clientX,n=t.y-e.clientY;return r*r+n*n<100}function zv(e,t,r,n,o){if(n==-1)return!1;let i=e.state.doc.resolve(n);for(let s=i.depth+1;s>0;s--)if(e.someProp(t,a=>s>i.depth?a(e,r,i.nodeAfter,i.before(s),o,!0):a(e,r,i.node(s),i.before(s),o,!1)))return!0;return!1}function pl(e,t,r){e.focused||e.focus();let n=e.state.tr.setSelection(t);r=="pointer"&&n.setMeta("pointer",!0),e.dispatch(n)}function $P(e,t){if(t==-1)return!1;let r=e.state.doc.resolve(t),n=r.nodeAfter;return n&&n.isAtom&&ce.isSelectable(n)?(pl(e,new ce(r),"pointer"),!0):!1}function HP(e,t){if(t==-1)return!1;let r=e.state.selection,n,o;r instanceof ce&&(n=r.node);let i=e.state.doc.resolve(t);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(ce.isSelectable(a)){n&&r.$from.depth>0&&s>=r.$from.depth&&i.before(r.$from.depth+1)==r.$from.pos?o=i.before(r.$from.depth):o=i.before(s);break}}return o!=null?(pl(e,ce.create(e.state.doc,o),"pointer"),!0):!1}function BP(e,t,r,n,o){return zv(e,"handleClickOn",t,r,n)||e.someProp("handleClick",i=>i(e,t,n))||(o?HP(e,r):$P(e,r))}function FP(e,t,r,n){return zv(e,"handleDoubleClickOn",t,r,n)||e.someProp("handleDoubleClick",o=>o(e,t,n))}function VP(e,t,r,n){return zv(e,"handleTripleClickOn",t,r,n)||e.someProp("handleTripleClick",o=>o(e,t,n))||jP(e,r,n)}function jP(e,t,r){if(r.button!=0)return!1;let n=e.state.doc;if(t==-1)return n.inlineContent?(pl(e,le.create(n,0,n.content.size),"pointer"),!0):!1;let o=n.resolve(t);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)pl(e,le.create(n,a+1,a+1+s.content.size),"pointer");else if(ce.isSelectable(s))pl(e,ce.create(n,a),"pointer");else continue;return!0}}function Lv(e){return Cp(e)}const ZE=kn?"metaKey":"ctrlKey";Sr.mousedown=(e,t)=>{let r=t;e.input.shiftKey=r.shiftKey;let n=Lv(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&DP(r,e.input.lastClick)&&!r[ZE]&&(e.input.lastClick.type=="singleClick"?i="doubleClick":e.input.lastClick.type=="doubleClick"&&(i="tripleClick")),e.input.lastClick={time:o,x:r.clientX,y:r.clientY,type:i};let s=e.posAtCoords(zh(r));s&&(i=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new UP(e,s,r,!!n)):(i=="doubleClick"?FP:VP)(e,s.pos,s.inside,r)?r.preventDefault():Ii(e,"pointer"))};class UP{constructor(t,r,n,o){this.view=t,this.pos=r,this.event=n,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[ZE],this.allowDefault=n.shiftKey;let i,s;if(r.inside>-1)i=t.state.doc.nodeAt(r.inside),s=r.inside;else{let u=t.state.doc.resolve(r.pos);i=u.parent,s=u.depth?u.before():0}const a=o?null:n.target,l=a?t.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:c}=t.state;(n.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof ce&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&oo&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ii(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Qo(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords(zh(t))),this.updateAllowDefault(t),this.allowDefault||!r?Ii(this.view,"pointer"):BP(this.view,r.pos,r.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||wr&&this.mightDrag&&!this.mightDrag.node.isAtom||ur&&!this.view.state.selection.visible&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(pl(this.view,be.near(this.view.state.doc.resolve(r.pos)),"pointer"),t.preventDefault()):Ii(this.view,"pointer")}move(t){this.updateAllowDefault(t),Ii(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}Sr.touchstart=e=>{e.input.lastTouch=Date.now(),Lv(e),Ii(e,"pointer")};Sr.touchmove=e=>{e.input.lastTouch=Date.now(),Ii(e,"pointer")};Sr.contextmenu=e=>Lv(e);function e5(e,t){return e.composing?!0:wr&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const WP=Yn?5e3:-1;Er.compositionstart=Er.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,r=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||r.marks(),Cp(e,!0),e.markCursor=null;else if(Cp(e),oo&&t.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let n=e.domSelectionRange();for(let o=n.focusNode,i=n.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){e.domSelection().collapse(s,s.nodeValue.length);break}else o=s,i=-1}}e.input.composing=!0}t5(e,WP)};Er.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,t5(e,20))};function t5(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Cp(e),t))}function r5(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=KP());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function KP(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Cp(e,t=!1){if(!(Yn&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),r5(e),t||e.docView&&e.docView.dirty){let r=Nv(e);return r&&!r.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(r)):e.updateState(e.state),!0}return!1}}function qP(e,t){if(!e.dom.parentNode)return;let r=e.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(t),r.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),n.removeAllRanges(),n.addRange(o),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),e.focus()},50)}const Rl=Ir&&Fi<15||Nl&&UR<604;Sr.copy=Er.cut=(e,t)=>{let r=t,n=e.state.selection,o=r.type=="cut";if(n.empty)return;let i=Rl?null:r.clipboardData,s=n.content(),{dom:a,text:l}=KE(e,s);i?(r.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):qP(e,a),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function GP(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function YP(e,t){if(!e.dom.parentNode)return;let r=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,n=e.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let o=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),n.parentNode&&n.parentNode.removeChild(n),r?Du(e,n.value,null,o,t):Du(e,n.textContent,n.innerHTML,o,t)},50)}function Du(e,t,r,n,o){let i=qE(e,t,r,n,e.state.selection.$from);if(e.someProp("handlePaste",l=>l(e,o,i||K.empty)))return!0;if(!i)return!1;let s=GP(i),a=s?e.state.tr.replaceSelectionWith(s,n):e.state.tr.replaceSelection(i);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Er.paste=(e,t)=>{let r=t;if(e.composing&&!Yn)return;let n=Rl?null:r.clipboardData,o=e.input.shiftKey&&e.input.lastKeyCode!=45;n&&Du(e,n.getData("text/plain"),n.getData("text/html"),o,r)?r.preventDefault():YP(e,r)};class JP{constructor(t,r){this.slice=t,this.move=r}}const n5=kn?"altKey":"ctrlKey";Sr.dragstart=(e,t)=>{let r=t,n=e.input.mouseDown;if(n&&n.done(),!r.dataTransfer)return;let o=e.state.selection,i=o.empty?null:e.posAtCoords(zh(r));if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof ce?o.to-1:o.to))){if(n&&n.mightDrag)e.dispatch(e.state.tr.setSelection(ce.create(e.state.doc,n.mightDrag.pos)));else if(r.target&&r.target.nodeType==1){let c=e.docView.nearestDesc(r.target,!0);c&&c.node.type.spec.draggable&&c!=e.docView&&e.dispatch(e.state.tr.setSelection(ce.create(e.state.doc,c.posBefore)))}}let s=e.state.selection.content(),{dom:a,text:l}=KE(e,s);r.dataTransfer.clearData(),r.dataTransfer.setData(Rl?"Text":"text/html",a.innerHTML),r.dataTransfer.effectAllowed="copyMove",Rl||r.dataTransfer.setData("text/plain",l),e.dragging=new JP(s,!r[n5])};Sr.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Er.dragover=Er.dragenter=(e,t)=>t.preventDefault();Er.drop=(e,t)=>{let r=t,n=e.dragging;if(e.dragging=null,!r.dataTransfer)return;let o=e.posAtCoords(zh(r));if(!o)return;let i=e.state.doc.resolve(o.pos),s=n&&n.slice;s?e.someProp("transformPasted",h=>{s=h(s,e)}):s=qE(e,r.dataTransfer.getData(Rl?"Text":"text/plain"),Rl?null:r.dataTransfer.getData("text/html"),!1,i);let a=!!(n&&!r[n5]);if(e.someProp("handleDrop",h=>h(e,r,s||K.empty,a))){r.preventDefault();return}if(!s)return;r.preventDefault();let l=s?YA(e.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=e.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&ce.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new ce(p));else{let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((m,b,v,g)=>h=g),c.setSelection(Rv(e,p,c.doc.resolve(h)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))};Sr.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Qo(e)},20))};Sr.blur=(e,t)=>{let r=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),r.relatedTarget&&e.dom.contains(r.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};Sr.beforeinput=(e,t)=>{if(ur&&Yn&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:n}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=n||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",i=>i(e,$s(8,"Backspace")))))return;let{$cursor:o}=e.state.selection;o&&o.pos>0&&e.dispatch(e.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let e in Er)Sr[e]=Er[e];function $u(e,t){if(e==t)return!0;for(let r in e)if(e[r]!==t[r])return!1;for(let r in t)if(!(r in e))return!1;return!0}class Mp{constructor(t,r){this.toDOM=t,this.spec=r||Js,this.side=this.spec.side||0}map(t,r,n,o){let{pos:i,deleted:s}=t.mapResult(r.from+o,this.side<0?-1:1);return s?null:new Ge(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof Mp&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&$u(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class ji{constructor(t,r){this.attrs=t,this.spec=r||Js}map(t,r,n,o){let i=t.map(r.from+o,this.spec.inclusiveStart?-1:1)-n,s=t.map(r.to+o,this.spec.inclusiveEnd?1:-1)-n;return i>=s?null:new Ge(i,s,this)}valid(t,r){return r.from=t&&(!i||i(a.spec))&&n.push(a.copy(a.from+o,a.to+o))}for(let s=0;st){let a=this.children[s]+1;this.children[s+2].findInner(t-a,r-a,n,o+a,i)}}map(t,r,n){return this==ar||t.maps.length==0?this:this.mapInner(t,r,0,0,n||Js)}mapInner(t,r,n,o,i){let s;for(let a=0;a{let c=l+n,u;if(u=i5(r,a,c)){for(o||(o=this.children.slice());ia&&d.to=t){this.children[a]==t&&(n=this.children[a+2]);break}let i=t+1,s=i+r.content.size;for(let a=0;ai&&l.type instanceof ji){let c=Math.max(i,l.from)-i,u=Math.min(s,l.to)-i;co.map(t,r,Js));return Ni.from(n)}forChild(t,r){if(r.isLeaf)return Ee.empty;let n=[];for(let o=0;or instanceof Ee)?t:t.reduce((r,n)=>r.concat(n instanceof Ee?n:n.members),[]))}}}function XP(e,t,r,n,o,i,s){let a=e.slice();for(let c=0,u=i;c{let b=m-h-(p-f);for(let v=0;vg+u-d)continue;let y=a[v]+u-d;p>=y?a[v+1]=f<=y?-2:-1:h>=o&&b&&(a[v]+=b,a[v+1]+=b)}d+=b}),u=r.maps[c].map(u,-1)}let l=!1;for(let c=0;c=n.content.size){l=!0;continue}let f=r.map(e[c+1]+i,-1),p=f-o,{index:h,offset:m}=n.content.findIndex(d),b=n.maybeChild(h);if(b&&m==d&&m+b.nodeSize==p){let v=a[c+2].mapInner(r,b,u+1,e[c]+i+1,s);v!=ar?(a[c]=d,a[c+1]=p,a[c+2]=v):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=QP(a,e,t,r,o,i,s),u=Tp(c,n,0,s);t=u.local;for(let d=0;dr&&s.to{let c=i5(e,a,l+r);if(c){i=!0;let u=Tp(c,a,r+l+1,n);u!=ar&&o.push(l,l+a.nodeSize,u)}});let s=o5(i?s5(e):e,-r).sort(Xs);for(let a=0;a0;)t++;e.splice(t,0,r)}function hg(e){let t=[];return e.someProp("decorations",r=>{let n=r(e.state);n&&n!=ar&&t.push(n)}),e.cursorWrapper&&t.push(Ee.create(e.state.doc,[e.cursorWrapper.deco])),Ni.from(t)}const ZP={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},e6=Ir&&Fi<=11;class t6{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class r6{constructor(t,r){this.view=t,this.handleDOMChange=r,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new t6,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let o=0;oo.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),e6&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,ZP)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let r=0;rthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(zk(this.view)){if(this.suppressingSelectionUpdates)return Qo(this.view);if(Ir&&Fi<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&ia(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let r=new Set,n;for(let i=t.focusNode;i;i=Iu(i))r.add(i);for(let i=t.anchorNode;i;i=Iu(i))if(r.has(i)){n=i;break}let o=n&&this.view.docView.nearestDesc(n);if(o&&o.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let r=this.pendingRecords();r.length&&(this.queue=[]);let n=t.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&zk(t)&&!this.ignoreSelectionChange(n),i=-1,s=-1,a=!1,l=[];if(t.editable)for(let u=0;u1){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let d=u[0],f=u[1];d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}}let c=null;i<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||o)&&(i>-1&&(t.docView.markDirty(i,s),n6(t)),this.handleDOMChange(i,s,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||Qo(t),this.currentSelection.set(n))}registerMutation(t,r){if(r.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(n==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!n||n.ignoreMutation(t))return null;if(t.type=="childList"){for(let u=0;uo;b--){let v=n.childNodes[b-1],g=v.pmViewDesc;if(v.nodeName=="BR"&&!g){i=b;break}if(!g||g.size)break}let d=e.state.doc,f=e.someProp("domParser")||wv.fromSchema(e.state.schema),p=d.resolve(s),h=null,m=f.parse(n,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:i,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:s6,context:p});if(c&&c[0].pos!=null){let b=c[0].pos,v=c[1]&&c[1].pos;v==null&&(v=b),h={anchor:b+s,head:v+s}}return{doc:m,sel:h,from:s,to:a}}function s6(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(wr&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(e.parentNode.lastChild==e||wr&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const a6=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function l6(e,t,r,n,o){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let C=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,T=Nv(e,C);if(T&&!e.state.selection.eq(T)){if(ur&&Yn&&e.input.lastKeyCode===13&&Date.now()-100F(e,$s(13,"Enter"))))return;let N=e.state.tr.setSelection(T);C=="pointer"?N.setMeta("pointer",!0):C=="key"&&N.scrollIntoView(),i&&N.setMeta("composition",i),e.dispatch(N)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(r);t=s.before(a+1),r=e.state.doc.resolve(r).after(a+1);let l=e.state.selection,c=i6(e,t,r),u=e.state.doc,d=u.slice(c.from,c.to),f,p;e.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Yn)&&o.some(C=>C.nodeType==1&&!a6.test(C.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",C=>C(e,$s(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!h)if(n&&l instanceof le&&!l.empty&&l.$head.sameParent(l.$anchor)&&!e.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let C=Wk(e,e.state.doc,c.sel);if(C&&!C.eq(e.state.selection)){let T=e.state.tr.setSelection(C);i&&T.setMeta("composition",i),e.dispatch(T)}}return}if(ur&&e.cursorWrapper&&c.sel&&c.sel.anchor==e.cursorWrapper.deco.from&&c.sel.head==c.sel.anchor){let C=h.endB-h.start;c.sel={anchor:c.sel.anchor+C,head:c.sel.anchor+C}}e.input.domChangeCount++,e.state.selection.frome.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=c.from?h.start=e.state.selection.from:h.endA=e.state.selection.to-2&&e.state.selection.to<=c.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),Ir&&Fi<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let m=c.doc.resolveNoCache(h.start-c.from),b=c.doc.resolveNoCache(h.endB-c.from),v=u.resolve(h.start),g=m.sameParent(b)&&m.parent.inlineContent&&v.end()>=h.endA,y;if((Nl&&e.input.lastIOSEnter>Date.now()-225&&(!g||o.some(C=>C.nodeName=="DIV"||C.nodeName=="P"))||!g&&m.posC(e,$s(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>h.start&&u6(u,h.start,h.endA,m,b)&&e.someProp("handleKeyDown",C=>C(e,$s(8,"Backspace")))){Yn&&ur&&e.domObserver.suppressSelectionUpdates();return}ur&&Yn&&h.endB==h.start&&(e.input.lastAndroidDelete=Date.now()),Yn&&!g&&m.start()!=b.start()&&b.parentOffset==0&&m.depth==b.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,b=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{e.someProp("handleKeyDown",function(C){return C(e,$s(13,"Enter"))})},20));let x=h.start,k=h.endA,w,E,M;if(g){if(m.pos==b.pos)Ir&&Fi<=11&&m.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Qo(e),20)),w=e.state.tr.delete(x,k),E=u.resolve(h.start).marksAcross(u.resolve(h.endA));else if(h.endA==h.endB&&(M=c6(m.parent.content.cut(m.parentOffset,b.parentOffset),v.parent.content.cut(v.parentOffset,h.endA-v.start()))))w=e.state.tr,M.type=="add"?w.addMark(x,k,M.mark):w.removeMark(x,k,M.mark);else if(m.parent.child(m.index()).isText&&m.index()==b.index()-(b.textOffset?0:1)){let C=m.parent.textBetween(m.parentOffset,b.parentOffset);if(e.someProp("handleTextInput",T=>T(e,x,k,C)))return;w=e.state.tr.insertText(C,x,k)}}if(w||(w=e.state.tr.replace(x,k,c.doc.slice(h.start-c.from,h.endB-c.from))),c.sel){let C=Wk(e,w.doc,c.sel);C&&!(ur&&Yn&&e.composing&&C.empty&&(h.start!=h.endB||e.input.lastAndroidDeletet.content.size?null:Rv(e,t.resolve(r.anchor),t.resolve(r.head))}function c6(e,t){let r=e.firstChild.marks,n=t.firstChild.marks,o=r,i=n,s,a,l;for(let u=0;uu.mark(a.addToSet(u.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;ur||mg(s,!0,!1)0&&(t||e.indexAfter(n)==e.node(n).childCount);)n--,o++,t=!1;if(r){let i=e.node(n).maybeChild(e.indexAfter(n));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function d6(e,t,r,n,o){let i=e.findDiffStart(t,r);if(i==null)return null;let{a:s,b:a}=e.findDiffEnd(t,r+e.size,r+t.size);if(o=="end"){let l=Math.max(0,i-Math.min(s,a));n-=s+l-i}if(s=s?i-n:0;i-=l,a=i+(a-s),s=i}else if(a=a?i-n:0;i-=l,s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}class f6{constructor(t,r){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new RP,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=r,this.state=r.state,this.directPlugins=r.plugins||[],this.directPlugins.forEach(Jk),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Gk(this),qk(this),this.nodeViews=Yk(this),this.docView=Ok(this.state.doc,Kk(this),hg(this),this.dom,this),this.domObserver=new r6(this,(n,o,i,s)=>l6(this,n,o,i,s)),this.domObserver.start(),PP(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let r in t)this._props[r]=t[r];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&D1(this);let r=this._props;this._props=t,t.plugins&&(t.plugins.forEach(Jk),this.directPlugins=t.plugins),this.updateStateInner(t.state,r)}setProps(t){let r={};for(let n in this._props)r[n]=this._props[n];r.state=this.state;for(let n in t)r[n]=t[n];this.update(r)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,r){let n=this.state,o=!1,i=!1;t.storedMarks&&this.composing&&(r5(this),i=!0),this.state=t;let s=n.plugins!=t.plugins||this._props.plugins!=r.plugins;if(s||this._props.plugins!=r.plugins||this._props.nodeViews!=r.nodeViews){let f=Yk(this);h6(f,this.nodeViews)&&(this.nodeViews=f,o=!0)}(s||r.handleDOMEvents!=this._props.handleDOMEvents)&&D1(this),this.editable=Gk(this),qk(this);let a=hg(this),l=Kk(this),c=n.plugins!=t.plugins&&!n.doc.eq(t.doc)?"reset":t.scrollToSelection>n.scrollToSelection?"to selection":"preserve",u=o||!this.docView.matchesNode(t.doc,l,a);(u||!t.selection.eq(n.selection))&&(i=!0);let d=c=="preserve"&&i&&this.dom.style.overflowAnchor==null&&qR(this);if(i){this.domObserver.stop();let f=u&&(Ir||ur)&&!this.composing&&!n.selection.empty&&!t.selection.empty&&p6(n.selection,t.selection);if(u){let p=ur?this.trackWrites=this.domSelectionRange().focusNode:null;(o||!this.docView.update(t.doc,l,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Ok(t.doc,l,a,this.dom,this)),p&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&yP(this))?Qo(this,f):(jE(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():d&&GR(d)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",r=>r(this)))if(this.state.selection instanceof ce){let r=this.docView.domAfterPos(this.state.selection.from);r.nodeType==1&&wk(this,r.getBoundingClientRect(),t)}else wk(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let r=0;rr.ownerDocument.getSelection()),this._root=r}return t||document}updateRoot(){this._root=null}posAtCoords(t){return eP(this,t)}coordsAtPos(t,r=1){return LE(this,t,r)}domAtPos(t,r=0){return this.docView.domFromPos(t,r)}nodeDOM(t){let r=this.docView.descAt(t);return r?r.nodeDOM:null}posAtDOM(t,r,n=-1){let o=this.docView.posFromDOM(t,r,n);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(t,r){return iP(this,r||this.state,t)}pasteHTML(t,r){return Du(this,"",t,!1,r||new ClipboardEvent("paste"))}pasteText(t,r){return Du(this,t,null,!0,r||new ClipboardEvent("paste"))}destroy(){this.docView&&(zP(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],hg(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(t){return IP(this,t)}dispatch(t){let r=this._props.dispatchTransaction;r?r.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return wr&&this.root.nodeType===11&&BR(this.dom.ownerDocument)==this.dom?o6(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function Kk(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",r=>{if(typeof r=="function"&&(r=r(e.state)),r)for(let n in r)n=="class"?t.class+=" "+r[n]:n=="style"?t.style=(t.style?t.style+";":"")+r[n]:!t[n]&&n!="contenteditable"&&n!="nodeName"&&(t[n]=String(r[n]))}),t.translate||(t.translate="no"),[Ge.node(0,e.state.doc.content.size,t)]}function qk(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Ge.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Gk(e){return!e.someProp("editable",t=>t(e.state)===!1)}function p6(e,t){let r=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(r)!=t.$anchor.start(r)}function Yk(e){let t=Object.create(null);function r(n){for(let o in n)Object.prototype.hasOwnProperty.call(t,o)||(t[o]=n[o])}return e.someProp("nodeViews",r),e.someProp("markViews",r),t}function h6(e,t){let r=0,n=0;for(let o in e){if(e[o]!=t[o])return!0;r++}for(let o in t)n++;return r!=n}function Jk(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var m6=e=>{if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")};const g6=Ln(m6);var a5=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},ge=(e,t,r)=>(a5(e,t,"read from private field"),r?r.call(e):t.get(e)),Io=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},qe=(e,t,r,n)=>(a5(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);function v6(e){return!!(e.prev&&e.next&&e.prev.text.full!==e.next.text.full)}function y6(e){return!!(e.prev&&e.next&&e.prev.range.cursor!==e.next.range.cursor)}function b6(e){return!!(!e.prev&&e.next)}function x6(e){return!!(e.prev&&!e.next)}function k6(e){return!!(e.prev&&e.next&&e.prev.range.from!==e.next.range.from)}function w6(e){return e==="invalid-exit-split"}var S6=["jump-backward-exit","jump-forward-exit"],E6=["jump-backward-change","jump-forward-change"];function C6(e){var t,r;return dr(S6,(t=e.exit)==null?void 0:t.exitReason)||dr(E6,(r=e.change)==null?void 0:r.changeReason)}function Xk(e){return!!(e&&e.query.full.length>=e.suggester.matchOffset)}function Qk(e){return Zt(e)&&e instanceof le}function Pr(e){const{match:t,changeReason:r,exitReason:n}=e;return{...t,changeReason:r,exitReason:n}}function M6(e,t){const{invalidPrefixCharacters:r,validPrefixCharacters:n}=t;return r?!new RegExp(H1(r)).test(e):new RegExp(H1(n)).test(e)}function T6(e){const{text:t,regexp:r,$pos:n,suggester:o}=e,i=n.start();let s;return xa(t,r).forEach(a=>{const l=a.input.slice(Math.max(0,a.index-1),a.index);if(M6(l,o)){const c=a.index+i,u=a[0],d=a[1];if(!ne(u)||!ne(d))return;const f=c+u.length,p=Math.min(f,n.pos),h=p-c;c=n.pos&&(s={range:{from:c,to:f,cursor:p},match:a,query:{partial:u.slice(d.length,h),full:u.slice(d.length)},text:{partial:u.slice(0,h),full:u},textAfter:n.doc.textBetween(f,n.end(),zi,zi),textBefore:n.doc.textBetween(i,c,zi,zi),suggester:o})}}),s}function l5(e){const{$pos:t,suggester:r}=e,{char:n,name:o,startOfLine:i,supportedCharacters:s,matchOffset:a,multiline:l,caseInsensitive:c,unicode:u}=r,d=I6({char:n,matchOffset:a,startOfLine:i,supportedCharacters:s,multiline:l,caseInsensitive:c,unicode:u}),f=t.doc.textBetween(t.before(),t.end(),zi,zi);return T6({suggester:r,text:f,regexp:d,$pos:t,char:n,name:o})}function c5(e){const{state:t,match:r}=e;try{return l5({$pos:t.doc.resolve(r.range.cursor),suggester:r.suggester})}catch{return}}function u5(e){const{prev:t,next:r,state:n}=e;return!r&&t.range.from>=n.doc.nodeSize?{exit:Pr({match:t,exitReason:"delete"})}:!r||!t.query.partial?{exit:Pr({match:t,exitReason:"invalid-exit-split"})}:t.range.to===r.range.cursor?{exit:Pr({match:r,exitReason:"exit-end"})}:t.query.partial?{exit:Pr({match:r,exitReason:"exit-split"})}:{}}function O6(e){const{prev:t,next:r,state:n}=e,o=ee(),i=c5({state:n,match:t}),{exit:s}=i&&i.query.full!==t.query.full?u5({prev:t,next:i,state:n}):o;return t.range.from=t.range.to)?{exit:Pr({match:t,exitReason:"selection-outside"})}:n.pos>t.range.to?{exit:Pr({match:t,exitReason:"move-end"})}:n.pos<=t.range.from?{exit:Pr({match:t,exitReason:"move-start"})}:{}}function A6(e){const{prev:t,next:r,state:n,$pos:o}=e,i=ee();if(!t&&!r)return i;const s={prev:t,next:r};return k6(s)?O6({prev:s.prev,next:s.next,state:n}):b6(s)?{change:Pr({match:s.next,changeReason:"start"})}:x6(s)?_6({$pos:o,match:s.prev,state:n}):v6(s)?{change:Pr({match:s.next,changeReason:"change-character"})}:y6(s)?{change:Pr({match:s.next,changeReason:n.selection.empty?"move":"selection-inside"})}:i}function Zk(e,t){for(let r=e.depth;r>0;r--){const n=e.node(r);if(t.includes(n.type.name))return!0}return!1}function $1(e,t){const{$from:r,$to:n}=e;return d5(e,t)?!0:kv(r.pos,n.pos).some(o=>N6(r.doc.resolve(o),t))}function d5(e,t){const{$from:r,$to:n}=e,o=new Set((r.marksAcross(n)??[]).map(i=>i.type.name));return t.some(i=>o.has(i))}function N6(e,t){const r=new Set(e.marks().map(n=>n.type.name));return t.some(n=>r.has(n))}function R6(e,t){const{$cursor:r}=t,{validMarks:n,validNodes:o,invalidMarks:i,invalidNodes:s}=e;return!n&&!o&&Mo(i)&&Mo(s)?!0:!(n&&!d5(t,n)||o&&!Zk(r,o)||!n&&$1(t,i)||!o&&Zk(r,s))}function e2(e){const{suggesters:t,$pos:r,selectionEmpty:n}=e;for(const o of t)if(!(o.emptySelectionsOnly&&!n))try{const i=l5({suggester:o,$pos:r});if(!i)continue;const s={$from:r.doc.resolve(i.range.from),$to:r.doc.resolve(i.range.to),$cursor:r};if(R6(o,s)&&o.isValidPosition(s,i))return i}catch{}}function H1(e){return tA(e)?e.source:e}function P6(e){return e?"^":""}function z6(e,t){return`(?:${H1(e)}){${t},}`}function L6(e){return ne(e)?new RegExp(g6(e)):e}function I6(e){const{char:t,matchOffset:r,startOfLine:n,supportedCharacters:o,captureChar:i=!0,caseInsensitive:s=!1,multiline:a=!1,unicode:l=!1}=e,c=`g${a?"m":""}${s?"i":""}${l?"u":""}`;let u=L6(t).source;return i&&(u=`(${u})`),new RegExp(`${P6(n)}${u}${z6(o,r)}`,c)}var D6={appendTransaction:!1,priority:50,ignoredTag:"span",matchOffset:0,disableDecorations:!1,startOfLine:!1,suggestClassName:"suggest",suggestTag:"span",supportedCharacters:/\w+/,validPrefixCharacters:/^[\s\0]?$/,invalidPrefixCharacters:null,ignoredClassName:null,invalidMarks:[],invalidNodes:[],validMarks:null,validNodes:null,isValidPosition:()=>!0,checkNextValidSelection:null,emptySelectionsOnly:!1,caseInsensitive:!1,multiline:!1,unicode:!1,captureChar:!0},f5="__ignore_prosemirror_suggest_update__",Lf,Ic,zt,wi,ja,po,Ot,Si,Ua,p5=class{constructor(e){Io(this,Lf,!1),Io(this,Ic,!1),Io(this,zt,void 0),Io(this,wi,void 0),Io(this,ja,void 0),Io(this,po,ee()),Io(this,Ot,Ee.empty),Io(this,Si,!1),Io(this,Ua,!1),this.setMarkRemoved=()=>{qe(this,Si,!0)},this.findNextTextSelection=r=>{const n=r.$from.doc,o=Math.min(n.nodeSize-2,r.to+1),i=n.resolve(o),s=be.findFrom(i,1,!0);if(Qk(s))return s},this.ignoreNextExit=()=>{qe(this,Ic,!0)},this.addIgnored=({from:r,name:n,specific:o=!1})=>{const i=ge(this,zt).find(u=>u.name===n);if(!i)throw new Error(`No suggester exists for the name provided: ${n}`);const s=ne(i.char)?i.char.length:1,a=r+s,l=i.ignoredClassName?{class:i.ignoredClassName}:{},c=Ge.inline(r,a,{nodeName:i.ignoredTag,...l},{name:n,specific:o,char:i.char});qe(this,Ot,ge(this,Ot).add(this.view.state.doc,[c]))},this.removeIgnored=({from:r,name:n})=>{const o=ge(this,zt).find(a=>a.name===n);if(!o)throw new Error(`No suggester exists for the name provided: ${n}`);const i=ne(o.char)?o.char.length:1,s=ge(this,Ot).find(r,r+i)[0];!s||s.spec.name!==n||qe(this,Ot,ge(this,Ot).remove([s]))},this.clearIgnored=r=>{if(!r){qe(this,Ot,Ee.empty);return}const o=ge(this,Ot).find().filter(({spec:i})=>i.name===r);qe(this,Ot,ge(this,Ot).remove(o))},this.findMatchAtPosition=(r,n)=>{const o=n?ge(this,zt).filter(i=>i.name===n):ge(this,zt);return e2({suggesters:o,$pos:r,docChanged:!1,selectionEmpty:!0})},this.setLastChangeFromAppend=()=>{qe(this,Ua,!0)};const t=t2();qe(this,zt,e.map(t)),qe(this,zt,ra(ge(this,zt),(r,n)=>n.priority-r.priority))}static create(e){return new p5(e)}get decorationSet(){return ge(this,Ot)}get removed(){return ge(this,Si)}get match(){return ge(this,wi)?ge(this,wi):ge(this,ja)&&ge(this,po).exit?ge(this,ja):void 0}init(e){return this.view=e,this}createProps(e){const{name:t,char:r}=e.suggester;return{view:this.view,addIgnored:this.addIgnored,clearIgnored:this.clearIgnored,ignoreNextExit:this.ignoreNextExit,setMarkRemoved:this.setMarkRemoved,name:t,char:r,...e}}shouldRunExit(){return ge(this,Ic)?(qe(this,Ic,!1),!1):!0}updateWithNextSelection(e){var t,r,n;const o=this.findNextTextSelection(e.selection);if(o)for(const i of ge(this,zt)){const s=(t=ge(this,po).change)==null?void 0:t.suggester.name,a=(r=ge(this,po).exit)==null?void 0:r.suggester.name;(n=i.checkNextValidSelection)==null||n.call(i,o.$from,e,{change:s,exit:a})}}changeHandler(e,t){const{change:r,exit:n}=ge(this,po),o=this.match;if(!r&&!n||!Xk(o))return;const i=t===(n==null?void 0:n.suggester.appendTransaction)&&this.shouldRunExit(),s=t===(r==null?void 0:r.suggester.appendTransaction);if(!(!i&&!s)){if(r&&n&&C6({change:r,exit:n})){const a=this.createProps(n),l=this.createProps(r),c=n.range.from{const a=ne(s.char)?s.char.length:1;return i-o!==a});qe(this,Ot,t.remove(n))}shouldIgnoreMatch({range:e,suggester:{name:t}}){return ge(this,Ot).find().some(({spec:o,from:i})=>i!==e.from?!1:o.specific?o.name===t:!0)}resetState(){qe(this,po,ee()),qe(this,wi,void 0),qe(this,Si,!1),qe(this,Ua,!1)}updateReasons(e){const{$pos:t,state:r}=e,n=ge(this,Lf),o=ge(this,zt),i=r.selection.empty,s=Qk(r.selection)?e2({suggesters:o,$pos:t,docChanged:n,selectionEmpty:i}):void 0;qe(this,wi,s&&this.shouldIgnoreMatch(s)?void 0:s),qe(this,po,A6({next:ge(this,wi),prev:ge(this,ja),state:r,$pos:t}))}addSuggester(e){const t=ge(this,zt).find(n=>n.name===e.name),r=t2();if(t)qe(this,zt,ge(this,zt).map(n=>n===t?r(e):n));else{const n=[...ge(this,zt),r(e)];qe(this,zt,ra(n,(o,i)=>i.priority-o.priority))}return()=>this.removeSuggester(e.name)}removeSuggester(e){const t=ne(e)?e:e.name;qe(this,zt,ge(this,zt).filter(r=>r.name!==t)),this.clearIgnored(t)}toJSON(){return this.match}apply(e){const{exit:t,change:r}=ge(this,po);if(ge(this,Ua)&&(qe(this,Ua,!1),!(t!=null&&t.suggester.appendTransaction)&&!(r!=null&&r.suggester.appendTransaction)))return this;const{tr:n,state:o}=e,i=n.docChanged||n.selectionSet;return n.getMeta(f5)||!i&&!ge(this,Si)?this:(qe(this,Lf,n.docChanged),this.mapIgnoredDecorations(n),t&&this.resetState(),qe(this,ja,ge(this,wi)),this.updateReasons({$pos:n.selection.$from,state:o}),this)}createDecorations(e){const t=this.match;if(!Xk(t))return ge(this,Ot);const{disableDecorations:r}=t.suggester;if(_e(r)?r(e,t):r)return ge(this,Ot);const{range:o,suggester:i}=t,{name:s,suggestTag:a,suggestClassName:l}=i,{from:c,to:u}=o;return this.shouldIgnoreMatch(t)?ge(this,Ot):ge(this,Ot).add(e.doc,[Ge.inline(c,u,{nodeName:a,class:s?`${l} suggest-${s}`:l},{name:s})])}},$6=p5;Lf=new WeakMap;Ic=new WeakMap;zt=new WeakMap;wi=new WeakMap;ja=new WeakMap;po=new WeakMap;Ot=new WeakMap;Si=new WeakMap;Ua=new WeakMap;function t2(){const e=new Set;return t=>{if(e.has(t.name))throw new Error(`A suggester already exists with the name '${t.name}'. The name provided must be unique.`);const r={...D6,...t};return e.add(t.name),r}}var h5=new ka("suggest");function $v(e){return h5.getState(e)}function r2(e,t){return $v(e).addSuggester(t)}function n2(e){e.setMeta(f5,!0)}function H6(e,t){return $v(e).removeSuggester(t)}function B6(...e){const t=$6.create(e);return new Ro({key:h5,view:r=>(t.init(r),{update:n=>t.changeHandler(n.state.tr,!1)}),state:{init:()=>t,apply:(r,n,o,i)=>t.apply({tr:r,state:i})},appendTransaction:(r,n,o)=>{const i=o.tr;return t.updateWithNextSelection(i),t.changeHandler(i,!0),i.docChanged||i.steps.length>0||i.selectionSet||i.storedMarksSet?(t.setLastChangeFromAppend(),i):null},props:{decorations:r=>t.createDecorations(r)}})}function Hv(e,t){const r=Object.getPrototypeOf(t);let n=e.selection,o=e.doc,i=e.storedMarks;const s=ee();for(const[a,l]of Object.entries(t))s[a]={value:l};return Object.create(r,{...s,storedMarks:{get(){return i}},selection:{get(){return n}},doc:{get(){return o}},tr:{get(){return n=e.selection,o=e.doc,i=e.storedMarks,e}}})}function yu(e){return({state:t,dispatch:r,view:n,tr:o})=>e(Hv(o,t),r,n)}function o2(e){return t=>{var r;return te(t.dispatch===void 0||t.dispatch===((r=t.view)==null?void 0:r.dispatch),{code:H.NON_CHAINABLE_COMMAND}),e(t)}}function F6(...e){return({state:t,dispatch:r,view:n,tr:o,...i})=>{for(const s of e)if(s({state:t,dispatch:r,view:n,tr:o,...i}))return!0;return!1}}var nn={get isBrowser(){return!!(typeof window<"u"&&typeof window.document<"u"&&window.navigator&&window.navigator.userAgent)},get isJSDOM(){return nn.isBrowser&&window.navigator.userAgent.includes("jsdom")},get isNode(){return typeof process<"u"&&process.versions!=null&&process.versions.node!=null},get isIos(){return nn.isBrowser&&/iPod|iPhone|iPad/.test(navigator.platform)},get isMac(){return nn.isBrowser&&/Mac|iPod|iPhone|iPad/.test(navigator.platform)},get isApple(){return nn.isNode?process.platform==="darwin":nn.isBrowser?/Mac|iPod|iPhone|iPad/.test(window.navigator.platform):!1},get isDevelopment(){return!1},get isTest(){return!1},get isProduction(){return!0}};function xn(e,t){var r;const n=O5(e);return((r=n==null?void 0:n.getComputedStyle(e))==null?void 0:r.getPropertyValue(t))??""}function sr(e,t){return Object.assign(e.style,t)}var V6=["px","rem","em","in","q","mm","cm","pt","pc","vh","vw","vmin","vmax"],j6=/[\d-.]+(\w+)$/;function If(e="0"){const t=e||"0",r=Number.parseFloat(t),n=t.match(j6),o=((n==null?void 0:n[1])??"px").toLowerCase();return[r,dr(V6,o)?o:"px"]}var Sn=96,hl=25.4,m5=72,g5=6;function Pl(e){if(Je(e))return xn(e,"font-size")||Pl(e.parentElement);const t=O5(e);return t?xn(t.document.documentElement,"font-size"):""}function U6(e){const t=A5(e),r=t.document.documentElement||t.document.body;return(n,o)=>{switch(o){case"rem":return n*Qs(Pl(r));case"em":return n*Qs(Pl(e),e==null?void 0:e.parentElement);case"in":return n*Sn;case"q":return n*Sn/hl/4;case"mm":return n*Sn/hl;case"cm":return n*Sn*10/hl;case"pt":return n*Sn/m5;case"pc":return n*Sn/g5;case"vh":return(n*t.innerHeight||r.clientWidth)/100;case"vw":return(n*t.innerWidth||r.clientHeight)/100;case"vmin":return n*Math.min(t.innerWidth||r.clientWidth,t.innerHeight||r.clientHeight)/100;case"vmax":return n*Math.max(t.innerWidth||r.clientWidth,t.innerHeight||r.clientHeight)/100;default:return n}}}var Df=/^([a-z]+)\((.+)\)$/i;function v5(e,t){if(!Df.test(e))return Number.NaN;const r=gN(e,{brackets:["()"],escape:"_",flat:!0});if(!r||r.length===0)return Number.NaN;function n(i){return i.replace(/_(\d+)_/g,(s,a)=>{const l=Number.parseFloat(a);return r[l]??""})}const o=Zo(r,0);for(const i of xa(o,Df)){const s=Zo(i,1),c=n(Zo(i,2)).split(/\s*,\s*/).map(u=>{if(Df.test(u)){const d=n(u);return v5(d,t)}return y5(u,t)});switch(s){case"min":return Math.min(...c);case"max":return Math.max(...c);case"clamp":{const[u,d,f]=c;if(Jt(u)&&Jt(d)&&Jt(f))return _d({min:u,max:f,value:d});break}case"calc":return Number.NaN;default:return Number.NaN}}return Number.NaN}function y5(e,t){const[r,n]=If(e);return t(r,n)}function Qs(e,t){const r=U6(t);return Df.test(e)?v5(e.toLowerCase(),r):y5(e,r)}function gg(e,t,r){const n=A5(r),o=n.document.documentElement||n.document.body,i=Qs(e,r);switch(t){case"px":return i;case"rem":return i/Qs(Pl(o));case"em":return i*Qs(Pl(r),r==null?void 0:r.parentElement);case"in":return i/Sn;case"q":return i/Sn*hl*4;case"mm":return i/Sn*hl;case"cm":return i/Sn/10*hl;case"pt":return i/Sn*m5;case"pc":return i/Sn*g5;case"vh":return i/(n.innerHeight||o.clientWidth)*100;case"vw":return i/(n.innerWidth||o.clientHeight)*100;case"vmin":return i/Math.min(n.innerWidth||o.clientWidth,n.innerHeight||o.clientHeight)*100;case"vmax":return i/Math.max(n.innerWidth||o.clientWidth,n.innerHeight||o.clientHeight)*100;default:return i}}function Op(e){return Zt(e)&&Jt(e.nodeType)&&ne(e.nodeName)}function Je(e){return Op(e)&&e.nodeType===1}function W6(e){return Op(e)&&e.nodeType===3}function Lh(e){const{types:t,node:r}=e;if(!r)return!1;const n=o=>o===r.type||o===r.type.name;return ct(t)?t.some(n):n(t)}function K6(e,t){const{tr:r}=t;return e.forEach(n=>{n.steps.forEach(o=>{r.step(o)})}),r}function q6({pos:e,tr:t}){const r=t.doc.nodeAt(e);return r&&t.delete(e,e+r.nodeSize),t}function G6({pos:e,tr:t,content:r}){const n=t.doc.nodeAt(e);return n&&t.replaceWith(e,e+n.nodeSize,r),t}function zd(e){const{predicate:t,selection:r}=e,n=k5(r)?r.selection.$from:Vv(r)?r.$from:r;for(let o=n.depth;o>0;o--){const i=n.node(o),s=o>0?n.before(o):0,a=n.start(o),l=s+i.nodeSize;if(t(i,s))return{pos:s,depth:o,node:i,start:a,end:l}}}function Y6(e){const{depth:t}=e,r=t>0?e.before(t):0,n=e.node(t),o=e.start(t),i=r+n.nodeSize;return{pos:r,start:o,node:n,end:i,depth:t}}function J6(e){const t=zd({predicate:()=>!0,selection:e});return te(t,{message:"No parent node found for the selection provided."}),t}function ts(e){const{types:t,selection:r}=e;return zd({predicate:n=>Lh({types:t,node:n}),selection:r})}function X6(e){const{types:t,selection:r}=e;if(!(!Id(r)||!Lh({types:t,node:r.node})))return{pos:r.$from.pos,depth:r.$from.depth,start:r.$from.start(),end:r.$from.pos+r.node.nodeSize,node:r.node}}function Bv(e){return Vv(e)?e.empty:e.selection.empty}function Q6(e){return e.docChanged||e.selectionSet}function b5(e){return!!Hu(e)}function Hu(e){const{state:t,type:r,attrs:n}=e,{selection:o,doc:i}=t,s=ne(r)?i.type.schema.nodes[r]:r;te(s,{code:H.SCHEMA,message:`No node exists for ${r}`});const a=X6({selection:o,types:r})??zd({predicate:l=>l.type===s,selection:o});return!n||hp(n)||!a||a.node.hasMarkup(s,{...a.node.attrs,...n})?a:void 0}function _p(...e){return t=>{if(!Yx(e))return!1;const[r,...n]=e;let o=!1;const i=(...l)=>()=>{if(!Yx(l))return!1;o=!0;const[,...c]=l;return _p(...l)({...t,next:i(...c)})},s=i(...n),a=r({...t,next:s});return o||a?a:s()}}function Z6(e,t){const r=new Map,n=ee();for(const o of e)for(const[i,s]of At(o)){const l=[...r.get(i)??[],s],c=_p(...l);r.set(i,l),n[i]=t(c)}return n}function ez(e){return Z6(e,t=>(r,n,o)=>t({state:r,dispatch:n,view:o,tr:r.tr,next:()=>!1}))}function Fv(e,t){const r=e.attrs??{};return Object.entries(t).every(([n,o])=>r[n]===o)}function tz(e){return S5(e,[Ko,bt,Dt,eo])}function nc(e){return Zt(e)}function oc(e,t){return ct(t)?dr(t,e[ti]):t===e[ti]}function rz(e){return Zt(e)&&e instanceof E1}function nz(e,t){return ne(e)?it(t.nodes,e):e}function x5(e){return Zt(e)&&e instanceof Ad}function oz(e,t){return ne(e)?it(t.marks,e):e}function Ld(e){return Zt(e)&&e instanceof Bi}function iz(e){return Zt(e)&&e instanceof R}function sz(e){return Zt(e)&&e instanceof Te}function k5(e){return Zt(e)&&e instanceof Bs}function gs(e){return Zt(e)&&e instanceof le}function az(e){return Zt(e)&&e instanceof xr}function Vv(e){return Zt(e)&&e instanceof be}function lz(e){return Zt(e)&&e instanceof Tl}function i2(e){const{trState:t,from:r,to:n,type:o,attrs:i={}}=e,{doc:s}=t,a=oz(o,s.type.schema);if(Object.keys(i).length===0)return s.rangeHasMark(r,n,a);let l=!1;return n>r&&s.nodesBetween(r,n,c=>l?!1:(l=(c.marks??[]).some(d=>d.type!==a?!1:Fv(d,i)),!l)),l}function Id(e){return Zt(e)&&e instanceof ce}function Ap(e){const{trState:t,type:r,attrs:n={},from:o,to:i}=e,{selection:s,doc:a,storedMarks:l}=t,c=ne(r)?a.type.schema.marks[r]:r;if(te(c,{code:H.SCHEMA,message:`Mark type: ${r} does not exist on the current schema.`}),o&&i)try{return Math.max(o,i)d.type!==r?!1:Fv(d,n??{})):i2({...e,from:s.from,to:s.to})}function jv(e,t={}){const r=cz(e.type.schema);if(!r)return!1;const{ignoreAttributes:n,ignoreDocAttributes:o}=t;return n?w5(r,e):o?r.content.eq(e.content):r.eq(e)}function w5(e,t){if(e===t)return!0;const r=e.type===t.type&&Te.sameSet(e.marks,t.marks);function n(){if(e.content===t.content)return!0;if(e.content.size!==t.content.size)return!1;const o=[],i=[];e.content.forEach(s=>o.push(s)),t.content.forEach(s=>i.push(s));for(const[s,a]of o.entries()){const l=i[s];if(!l||!w5(a,l))return!1}return!0}return r&&n()}function cz(e){var t;return((t=e.nodes.doc)==null?void 0:t.createAndFill())??void 0}function Ih(e){for(const t of Object.values(e.nodes))if(t.name!=="doc"&&(t.isBlock||t.isTextblock))return t;te(!1,{code:H.SCHEMA,message:"No default block node found for the provided schema."})}function uz(e){return e.type===Ih(e.type.schema)}function Dh(e){return!!e&&e.type.isBlock&&!e.textContent&&!e.childCount}function _o(e,t,r){const n=e.parent.childAfter(e.parentOffset);if(!n.node)return;const o=ne(t)?t:t.name,i=n.node.marks.find(({type:d})=>d.name===o);let s=e.index(),a=e.start()+n.offset,l=s+1,c=a+n.node.nodeSize;if(!i)return r&&c0&&i.isInSet(e.parent.child(s-1).marks);)s-=1,a-=e.parent.child(s).nodeSize;for(;l{t=f(t,i||n,e)}),i)return t?new K(R.from(e.state.schema.text(t.replace(/\r\n?/g,` +`))),0,0):K.empty;let d=e.someProp("clipboardTextParser",f=>f(t,o,n,e));if(d)a=d;else{let f=o.marks(),{schema:p}=e.state,h=an.fromSchema(p);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(m=>{let b=s.appendChild(document.createElement("p"));m&&b.appendChild(h.serializeNode(p.text(m,f)))})}}else e.someProp("transformPastedHTML",d=>{r=d(r,e)}),s=LP(r),Pd&&IP(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||Cv.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!PP.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)a=DP(jk(a,+u[1],+u[2]),u[4]);else if(a=K.maxOpen(zP(a.content,o),!0),a.openStart||a.openEnd){let d=0,f=0;for(let p=a.content.firstChild;d{a=d(a,e)}),a}const PP=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function zP(e,t){if(e.childCount<2)return e;for(let r=t.depth;r>=0;r--){let o=t.node(r).contentMatchAt(t.index(r)),i,s=[];if(e.forEach(a=>{if(!s)return;let l=o.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&i.length&&ZE(l,i,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=eC(s[s.length-1],i.length));let u=QE(a,l);s.push(u),o=o.matchType(u.type),i=l}}),s)return R.from(s)}return e}function QE(e,t,r=0){for(let n=t.length-1;n>=r;n--)e=t[n].create(null,R.from(e));return e}function ZE(e,t,r,n,o){if(o1&&(i=0),o=r&&(a=t<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(R.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function jk(e,t,r){return t]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let r=rC().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(e),o;if((o=n&&tC[n[1].toLowerCase()])&&(e=o.map(i=>"<"+i+">").join("")+e+o.map(i=>"").reverse().join("")),r.innerHTML=e,o)for(let i=0;i=0;a-=2){let l=r.nodes[n[a]];if(!l||l.hasRequiredAttrs())break;o=R.from(l.create(n[a+1],o)),i++,s++}return new K(o,i,s)}const Er={},Cr={},$P={touchstart:!0,touchmove:!0};class HP{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function BP(e){for(let t in Er){let r=Er[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=n=>{VP(e,n)&&!Iv(e,n)&&(e.editable||!(n.type in Cr))&&r(e,n)},$P[t]?{passive:!0}:void 0)}Sr&&e.dom.addEventListener("input",()=>null),B1(e)}function Ii(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function FP(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function B1(e){e.someProp("handleDOMEvents",t=>{for(let r in t)e.input.eventHandlers[r]||e.dom.addEventListener(r,e.input.eventHandlers[r]=n=>Iv(e,n))})}function Iv(e,t){return e.someProp("handleDOMEvents",r=>{let n=r[t.type];return n?n(e,t)||t.defaultPrevented:!1})}function VP(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let r=t.target;r!=e.dom;r=r.parentNode)if(!r||r.nodeType==11||r.pmViewDesc&&r.pmViewDesc.stopEvent(t))return!1;return!0}function jP(e,t){!Iv(e,t)&&Er[t.type]&&(e.editable||!(t.type in Cr))&&Er[t.type](e,t)}Cr.keydown=(e,t)=>{let r=t;if(e.input.shiftKey=r.keyCode==16||r.shiftKey,!oC(e,r)&&(e.input.lastKeyCode=r.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Jn&&dr&&r.keyCode==13)))if(r.keyCode!=229&&e.domObserver.forceFlush(),Nl&&r.keyCode==13&&!r.ctrlKey&&!r.altKey&&!r.metaKey){let n=Date.now();e.input.lastIOSEnter=n,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==n&&(e.someProp("handleKeyDown",o=>o(e,$s(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",n=>n(e,r))||RP(e,r)?r.preventDefault():Ii(e,"key")};Cr.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Cr.keypress=(e,t)=>{let r=t;if(oC(e,r)||!r.charCode||r.ctrlKey&&!r.altKey||wn&&r.metaKey)return;if(e.someProp("handleKeyPress",o=>o(e,r))){r.preventDefault();return}let n=e.state.selection;if(!(n instanceof le)||!n.$from.sameParent(n.$to)){let o=String.fromCharCode(r.charCode);!/[\r\n]/.test(o)&&!e.someProp("handleTextInput",i=>i(e,n.$from.pos,n.$to.pos,o))&&e.dispatch(e.state.tr.insertText(o).scrollIntoView()),r.preventDefault()}};function Dh(e){return{left:e.clientX,top:e.clientY}}function UP(e,t){let r=t.x-e.clientX,n=t.y-e.clientY;return r*r+n*n<100}function Dv(e,t,r,n,o){if(n==-1)return!1;let i=e.state.doc.resolve(n);for(let s=i.depth+1;s>0;s--)if(e.someProp(t,a=>s>i.depth?a(e,r,i.nodeAfter,i.before(s),o,!0):a(e,r,i.node(s),i.before(s),o,!1)))return!0;return!1}function pl(e,t,r){e.focused||e.focus();let n=e.state.tr.setSelection(t);r=="pointer"&&n.setMeta("pointer",!0),e.dispatch(n)}function WP(e,t){if(t==-1)return!1;let r=e.state.doc.resolve(t),n=r.nodeAfter;return n&&n.isAtom&&ce.isSelectable(n)?(pl(e,new ce(r),"pointer"),!0):!1}function KP(e,t){if(t==-1)return!1;let r=e.state.selection,n,o;r instanceof ce&&(n=r.node);let i=e.state.doc.resolve(t);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(ce.isSelectable(a)){n&&r.$from.depth>0&&s>=r.$from.depth&&i.before(r.$from.depth+1)==r.$from.pos?o=i.before(r.$from.depth):o=i.before(s);break}}return o!=null?(pl(e,ce.create(e.state.doc,o),"pointer"),!0):!1}function qP(e,t,r,n,o){return Dv(e,"handleClickOn",t,r,n)||e.someProp("handleClick",i=>i(e,t,n))||(o?KP(e,r):WP(e,r))}function GP(e,t,r,n){return Dv(e,"handleDoubleClickOn",t,r,n)||e.someProp("handleDoubleClick",o=>o(e,t,n))}function YP(e,t,r,n){return Dv(e,"handleTripleClickOn",t,r,n)||e.someProp("handleTripleClick",o=>o(e,t,n))||JP(e,r,n)}function JP(e,t,r){if(r.button!=0)return!1;let n=e.state.doc;if(t==-1)return n.inlineContent?(pl(e,le.create(n,0,n.content.size),"pointer"),!0):!1;let o=n.resolve(t);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)pl(e,le.create(n,a+1,a+1+s.content.size),"pointer");else if(ce.isSelectable(s))pl(e,ce.create(n,a),"pointer");else continue;return!0}}function $v(e){return Tp(e)}const nC=wn?"metaKey":"ctrlKey";Er.mousedown=(e,t)=>{let r=t;e.input.shiftKey=r.shiftKey;let n=$v(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&UP(r,e.input.lastClick)&&!r[nC]&&(e.input.lastClick.type=="singleClick"?i="doubleClick":e.input.lastClick.type=="doubleClick"&&(i="tripleClick")),e.input.lastClick={time:o,x:r.clientX,y:r.clientY,type:i};let s=e.posAtCoords(Dh(r));s&&(i=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new XP(e,s,r,!!n)):(i=="doubleClick"?GP:YP)(e,s.pos,s.inside,r)?r.preventDefault():Ii(e,"pointer"))};class XP{constructor(t,r,n,o){this.view=t,this.pos=r,this.event=n,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[nC],this.allowDefault=n.shiftKey;let i,s;if(r.inside>-1)i=t.state.doc.nodeAt(r.inside),s=r.inside;else{let u=t.state.doc.resolve(r.pos);i=u.parent,s=u.depth?u.before():0}const a=o?null:n.target,l=a?t.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:c}=t.state;(n.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof ce&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&oo&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ii(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Qo(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords(Dh(t))),this.updateAllowDefault(t),this.allowDefault||!r?Ii(this.view,"pointer"):qP(this.view,r.pos,r.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Sr&&this.mightDrag&&!this.mightDrag.node.isAtom||dr&&!this.view.state.selection.visible&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(pl(this.view,be.near(this.view.state.doc.resolve(r.pos)),"pointer"),t.preventDefault()):Ii(this.view,"pointer")}move(t){this.updateAllowDefault(t),Ii(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}Er.touchstart=e=>{e.input.lastTouch=Date.now(),$v(e),Ii(e,"pointer")};Er.touchmove=e=>{e.input.lastTouch=Date.now(),Ii(e,"pointer")};Er.contextmenu=e=>$v(e);function oC(e,t){return e.composing?!0:Sr&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const QP=Jn?5e3:-1;Cr.compositionstart=Cr.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,r=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||r.marks(),Tp(e,!0),e.markCursor=null;else if(Tp(e),oo&&t.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let n=e.domSelectionRange();for(let o=n.focusNode,i=n.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){e.domSelection().collapse(s,s.nodeValue.length);break}else o=s,i=-1}}e.input.composing=!0}iC(e,QP)};Cr.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,iC(e,20))};function iC(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Tp(e),t))}function sC(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=ZP());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function ZP(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Tp(e,t=!1){if(!(Jn&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),sC(e),t||e.docView&&e.docView.dirty){let r=zv(e);return r&&!r.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(r)):e.updateState(e.state),!0}return!1}}function e6(e,t){if(!e.dom.parentNode)return;let r=e.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(t),r.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),n.removeAllRanges(),n.addRange(o),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),e.focus()},50)}const Rl=Ir&&Fi<15||Nl&&XR<604;Er.copy=Cr.cut=(e,t)=>{let r=t,n=e.state.selection,o=r.type=="cut";if(n.empty)return;let i=Rl?null:r.clipboardData,s=n.content(),{dom:a,text:l}=JE(e,s);i?(r.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):e6(e,a),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function t6(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function r6(e,t){if(!e.dom.parentNode)return;let r=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,n=e.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let o=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),n.parentNode&&n.parentNode.removeChild(n),r?$u(e,n.value,null,o,t):$u(e,n.textContent,n.innerHTML,o,t)},50)}function $u(e,t,r,n,o){let i=XE(e,t,r,n,e.state.selection.$from);if(e.someProp("handlePaste",l=>l(e,o,i||K.empty)))return!0;if(!i)return!1;let s=t6(i),a=s?e.state.tr.replaceSelectionWith(s,n):e.state.tr.replaceSelection(i);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Cr.paste=(e,t)=>{let r=t;if(e.composing&&!Jn)return;let n=Rl?null:r.clipboardData,o=e.input.shiftKey&&e.input.lastKeyCode!=45;n&&$u(e,n.getData("text/plain"),n.getData("text/html"),o,r)?r.preventDefault():r6(e,r)};class n6{constructor(t,r){this.slice=t,this.move=r}}const aC=wn?"altKey":"ctrlKey";Er.dragstart=(e,t)=>{let r=t,n=e.input.mouseDown;if(n&&n.done(),!r.dataTransfer)return;let o=e.state.selection,i=o.empty?null:e.posAtCoords(Dh(r));if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof ce?o.to-1:o.to))){if(n&&n.mightDrag)e.dispatch(e.state.tr.setSelection(ce.create(e.state.doc,n.mightDrag.pos)));else if(r.target&&r.target.nodeType==1){let c=e.docView.nearestDesc(r.target,!0);c&&c.node.type.spec.draggable&&c!=e.docView&&e.dispatch(e.state.tr.setSelection(ce.create(e.state.doc,c.posBefore)))}}let s=e.state.selection.content(),{dom:a,text:l}=JE(e,s);r.dataTransfer.clearData(),r.dataTransfer.setData(Rl?"Text":"text/html",a.innerHTML),r.dataTransfer.effectAllowed="copyMove",Rl||r.dataTransfer.setData("text/plain",l),e.dragging=new n6(s,!r[aC])};Er.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Cr.dragover=Cr.dragenter=(e,t)=>t.preventDefault();Cr.drop=(e,t)=>{let r=t,n=e.dragging;if(e.dragging=null,!r.dataTransfer)return;let o=e.posAtCoords(Dh(r));if(!o)return;let i=e.state.doc.resolve(o.pos),s=n&&n.slice;s?e.someProp("transformPasted",h=>{s=h(s,e)}):s=XE(e,r.dataTransfer.getData(Rl?"Text":"text/plain"),Rl?null:r.dataTransfer.getData("text/html"),!1,i);let a=!!(n&&!r[aC]);if(e.someProp("handleDrop",h=>h(e,r,s||K.empty,a))){r.preventDefault();return}if(!s)return;r.preventDefault();let l=s?rN(e.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=e.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&ce.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new ce(p));else{let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((m,b,v,g)=>h=g),c.setSelection(Lv(e,p,c.doc.resolve(h)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))};Er.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Qo(e)},20))};Er.blur=(e,t)=>{let r=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),r.relatedTarget&&e.dom.contains(r.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};Er.beforeinput=(e,t)=>{if(dr&&Jn&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:n}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=n||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",i=>i(e,$s(8,"Backspace")))))return;let{$cursor:o}=e.state.selection;o&&o.pos>0&&e.dispatch(e.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let e in Cr)Er[e]=Cr[e];function Hu(e,t){if(e==t)return!0;for(let r in e)if(e[r]!==t[r])return!1;for(let r in t)if(!(r in e))return!1;return!0}class Op{constructor(t,r){this.toDOM=t,this.spec=r||Js,this.side=this.spec.side||0}map(t,r,n,o){let{pos:i,deleted:s}=t.mapResult(r.from+o,this.side<0?-1:1);return s?null:new Ge(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof Op&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Hu(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class ji{constructor(t,r){this.attrs=t,this.spec=r||Js}map(t,r,n,o){let i=t.map(r.from+o,this.spec.inclusiveStart?-1:1)-n,s=t.map(r.to+o,this.spec.inclusiveEnd?1:-1)-n;return i>=s?null:new Ge(i,s,this)}valid(t,r){return r.from=t&&(!i||i(a.spec))&&n.push(a.copy(a.from+o,a.to+o))}for(let s=0;st){let a=this.children[s]+1;this.children[s+2].findInner(t-a,r-a,n,o+a,i)}}map(t,r,n){return this==lr||t.maps.length==0?this:this.mapInner(t,r,0,0,n||Js)}mapInner(t,r,n,o,i){let s;for(let a=0;a{let c=l+n,u;if(u=cC(r,a,c)){for(o||(o=this.children.slice());ia&&d.to=t){this.children[a]==t&&(n=this.children[a+2]);break}let i=t+1,s=i+r.content.size;for(let a=0;ai&&l.type instanceof ji){let c=Math.max(i,l.from)-i,u=Math.min(s,l.to)-i;co.map(t,r,Js));return Ni.from(n)}forChild(t,r){if(r.isLeaf)return Ee.empty;let n=[];for(let o=0;or instanceof Ee)?t:t.reduce((r,n)=>r.concat(n instanceof Ee?n:n.members),[]))}}}function o6(e,t,r,n,o,i,s){let a=e.slice();for(let c=0,u=i;c{let b=m-h-(p-f);for(let v=0;vg+u-d)continue;let y=a[v]+u-d;p>=y?a[v+1]=f<=y?-2:-1:h>=o&&b&&(a[v]+=b,a[v+1]+=b)}d+=b}),u=r.maps[c].map(u,-1)}let l=!1;for(let c=0;c=n.content.size){l=!0;continue}let f=r.map(e[c+1]+i,-1),p=f-o,{index:h,offset:m}=n.content.findIndex(d),b=n.maybeChild(h);if(b&&m==d&&m+b.nodeSize==p){let v=a[c+2].mapInner(r,b,u+1,e[c]+i+1,s);v!=lr?(a[c]=d,a[c+1]=p,a[c+2]=v):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=i6(a,e,t,r,o,i,s),u=_p(c,n,0,s);t=u.local;for(let d=0;dr&&s.to{let c=cC(e,a,l+r);if(c){i=!0;let u=_p(c,a,r+l+1,n);u!=lr&&o.push(l,l+a.nodeSize,u)}});let s=lC(i?uC(e):e,-r).sort(Xs);for(let a=0;a0;)t++;e.splice(t,0,r)}function vg(e){let t=[];return e.someProp("decorations",r=>{let n=r(e.state);n&&n!=lr&&t.push(n)}),e.cursorWrapper&&t.push(Ee.create(e.state.doc,[e.cursorWrapper.deco])),Ni.from(t)}const s6={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},a6=Ir&&Fi<=11;class l6{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class c6{constructor(t,r){this.view=t,this.handleDOMChange=r,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new l6,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let o=0;oo.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),a6&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,s6)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let r=0;rthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Dk(this.view)){if(this.suppressingSelectionUpdates)return Qo(this.view);if(Ir&&Fi<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&ia(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let r=new Set,n;for(let i=t.focusNode;i;i=Du(i))r.add(i);for(let i=t.anchorNode;i;i=Du(i))if(r.has(i)){n=i;break}let o=n&&this.view.docView.nearestDesc(n);if(o&&o.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let r=this.pendingRecords();r.length&&(this.queue=[]);let n=t.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Dk(t)&&!this.ignoreSelectionChange(n),i=-1,s=-1,a=!1,l=[];if(t.editable)for(let u=0;u1){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let d=u[0],f=u[1];d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}}let c=null;i<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||o)&&(i>-1&&(t.docView.markDirty(i,s),u6(t)),this.handleDOMChange(i,s,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||Qo(t),this.currentSelection.set(n))}registerMutation(t,r){if(r.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(n==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!n||n.ignoreMutation(t))return null;if(t.type=="childList"){for(let u=0;uo;b--){let v=n.childNodes[b-1],g=v.pmViewDesc;if(v.nodeName=="BR"&&!g){i=b;break}if(!g||g.size)break}let d=e.state.doc,f=e.someProp("domParser")||Cv.fromSchema(e.state.schema),p=d.resolve(s),h=null,m=f.parse(n,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:i,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:p6,context:p});if(c&&c[0].pos!=null){let b=c[0].pos,v=c[1]&&c[1].pos;v==null&&(v=b),h={anchor:b+s,head:v+s}}return{doc:m,sel:h,from:s,to:a}}function p6(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(Sr&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(e.parentNode.lastChild==e||Sr&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const h6=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function m6(e,t,r,n,o){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let C=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,M=zv(e,C);if(M&&!e.state.selection.eq(M)){if(dr&&Jn&&e.input.lastKeyCode===13&&Date.now()-100F(e,$s(13,"Enter"))))return;let N=e.state.tr.setSelection(M);C=="pointer"?N.setMeta("pointer",!0):C=="key"&&N.scrollIntoView(),i&&N.setMeta("composition",i),e.dispatch(N)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(r);t=s.before(a+1),r=e.state.doc.resolve(r).after(a+1);let l=e.state.selection,c=f6(e,t,r),u=e.state.doc,d=u.slice(c.from,c.to),f,p;e.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Jn)&&o.some(C=>C.nodeType==1&&!h6.test(C.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",C=>C(e,$s(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!h)if(n&&l instanceof le&&!l.empty&&l.$head.sameParent(l.$anchor)&&!e.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let C=Gk(e,e.state.doc,c.sel);if(C&&!C.eq(e.state.selection)){let M=e.state.tr.setSelection(C);i&&M.setMeta("composition",i),e.dispatch(M)}}return}if(dr&&e.cursorWrapper&&c.sel&&c.sel.anchor==e.cursorWrapper.deco.from&&c.sel.head==c.sel.anchor){let C=h.endB-h.start;c.sel={anchor:c.sel.anchor+C,head:c.sel.anchor+C}}e.input.domChangeCount++,e.state.selection.frome.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=c.from?h.start=e.state.selection.from:h.endA=e.state.selection.to-2&&e.state.selection.to<=c.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),Ir&&Fi<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let m=c.doc.resolveNoCache(h.start-c.from),b=c.doc.resolveNoCache(h.endB-c.from),v=u.resolve(h.start),g=m.sameParent(b)&&m.parent.inlineContent&&v.end()>=h.endA,y;if((Nl&&e.input.lastIOSEnter>Date.now()-225&&(!g||o.some(C=>C.nodeName=="DIV"||C.nodeName=="P"))||!g&&m.posC(e,$s(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>h.start&&v6(u,h.start,h.endA,m,b)&&e.someProp("handleKeyDown",C=>C(e,$s(8,"Backspace")))){Jn&&dr&&e.domObserver.suppressSelectionUpdates();return}dr&&Jn&&h.endB==h.start&&(e.input.lastAndroidDelete=Date.now()),Jn&&!g&&m.start()!=b.start()&&b.parentOffset==0&&m.depth==b.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,b=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{e.someProp("handleKeyDown",function(C){return C(e,$s(13,"Enter"))})},20));let x=h.start,k=h.endA,w,E,T;if(g){if(m.pos==b.pos)Ir&&Fi<=11&&m.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Qo(e),20)),w=e.state.tr.delete(x,k),E=u.resolve(h.start).marksAcross(u.resolve(h.endA));else if(h.endA==h.endB&&(T=g6(m.parent.content.cut(m.parentOffset,b.parentOffset),v.parent.content.cut(v.parentOffset,h.endA-v.start()))))w=e.state.tr,T.type=="add"?w.addMark(x,k,T.mark):w.removeMark(x,k,T.mark);else if(m.parent.child(m.index()).isText&&m.index()==b.index()-(b.textOffset?0:1)){let C=m.parent.textBetween(m.parentOffset,b.parentOffset);if(e.someProp("handleTextInput",M=>M(e,x,k,C)))return;w=e.state.tr.insertText(C,x,k)}}if(w||(w=e.state.tr.replace(x,k,c.doc.slice(h.start-c.from,h.endB-c.from))),c.sel){let C=Gk(e,w.doc,c.sel);C&&!(dr&&Jn&&e.composing&&C.empty&&(h.start!=h.endB||e.input.lastAndroidDeletet.content.size?null:Lv(e,t.resolve(r.anchor),t.resolve(r.head))}function g6(e,t){let r=e.firstChild.marks,n=t.firstChild.marks,o=r,i=n,s,a,l;for(let u=0;uu.mark(a.addToSet(u.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;ur||yg(s,!0,!1)0&&(t||e.indexAfter(n)==e.node(n).childCount);)n--,o++,t=!1;if(r){let i=e.node(n).maybeChild(e.indexAfter(n));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function y6(e,t,r,n,o){let i=e.findDiffStart(t,r);if(i==null)return null;let{a:s,b:a}=e.findDiffEnd(t,r+e.size,r+t.size);if(o=="end"){let l=Math.max(0,i-Math.min(s,a));n-=s+l-i}if(s=s?i-n:0;i-=l,a=i+(a-s),s=i}else if(a=a?i-n:0;i-=l,s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}class b6{constructor(t,r){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new HP,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=r,this.state=r.state,this.directPlugins=r.plugins||[],this.directPlugins.forEach(Zk),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Xk(this),Jk(this),this.nodeViews=Qk(this),this.docView=Nk(this.state.doc,Yk(this),vg(this),this.dom,this),this.domObserver=new c6(this,(n,o,i,s)=>m6(this,n,o,i,s)),this.domObserver.start(),BP(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let r in t)this._props[r]=t[r];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&B1(this);let r=this._props;this._props=t,t.plugins&&(t.plugins.forEach(Zk),this.directPlugins=t.plugins),this.updateStateInner(t.state,r)}setProps(t){let r={};for(let n in this._props)r[n]=this._props[n];r.state=this.state;for(let n in t)r[n]=t[n];this.update(r)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,r){let n=this.state,o=!1,i=!1;t.storedMarks&&this.composing&&(sC(this),i=!0),this.state=t;let s=n.plugins!=t.plugins||this._props.plugins!=r.plugins;if(s||this._props.plugins!=r.plugins||this._props.nodeViews!=r.nodeViews){let f=Qk(this);k6(f,this.nodeViews)&&(this.nodeViews=f,o=!0)}(s||r.handleDOMEvents!=this._props.handleDOMEvents)&&B1(this),this.editable=Xk(this),Jk(this);let a=vg(this),l=Yk(this),c=n.plugins!=t.plugins&&!n.doc.eq(t.doc)?"reset":t.scrollToSelection>n.scrollToSelection?"to selection":"preserve",u=o||!this.docView.matchesNode(t.doc,l,a);(u||!t.selection.eq(n.selection))&&(i=!0);let d=c=="preserve"&&i&&this.dom.style.overflowAnchor==null&&eP(this);if(i){this.domObserver.stop();let f=u&&(Ir||dr)&&!this.composing&&!n.selection.empty&&!t.selection.empty&&x6(n.selection,t.selection);if(u){let p=dr?this.trackWrites=this.domSelectionRange().focusNode:null;(o||!this.docView.update(t.doc,l,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Nk(t.doc,l,a,this.dom,this)),p&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&CP(this))?Qo(this,f):(qE(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():d&&tP(d)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",r=>r(this)))if(this.state.selection instanceof ce){let r=this.docView.domAfterPos(this.state.selection.from);r.nodeType==1&&Ck(this,r.getBoundingClientRect(),t)}else Ck(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let r=0;rr.ownerDocument.getSelection()),this._root=r}return t||document}updateRoot(){this._root=null}posAtCoords(t){return aP(this,t)}coordsAtPos(t,r=1){return HE(this,t,r)}domAtPos(t,r=0){return this.docView.domFromPos(t,r)}nodeDOM(t){let r=this.docView.descAt(t);return r?r.nodeDOM:null}posAtDOM(t,r,n=-1){let o=this.docView.posFromDOM(t,r,n);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(t,r){return fP(this,r||this.state,t)}pasteHTML(t,r){return $u(this,"",t,!1,r||new ClipboardEvent("paste"))}pasteText(t,r){return $u(this,t,null,!0,r||new ClipboardEvent("paste"))}destroy(){this.docView&&(FP(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],vg(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(t){return jP(this,t)}dispatch(t){let r=this._props.dispatchTransaction;r?r.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return Sr&&this.root.nodeType===11&&qR(this.dom.ownerDocument)==this.dom?d6(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function Yk(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",r=>{if(typeof r=="function"&&(r=r(e.state)),r)for(let n in r)n=="class"?t.class+=" "+r[n]:n=="style"?t.style=(t.style?t.style+";":"")+r[n]:!t[n]&&n!="contenteditable"&&n!="nodeName"&&(t[n]=String(r[n]))}),t.translate||(t.translate="no"),[Ge.node(0,e.state.doc.content.size,t)]}function Jk(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Ge.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Xk(e){return!e.someProp("editable",t=>t(e.state)===!1)}function x6(e,t){let r=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(r)!=t.$anchor.start(r)}function Qk(e){let t=Object.create(null);function r(n){for(let o in n)Object.prototype.hasOwnProperty.call(t,o)||(t[o]=n[o])}return e.someProp("nodeViews",r),e.someProp("markViews",r),t}function k6(e,t){let r=0,n=0;for(let o in e){if(e[o]!=t[o])return!0;r++}for(let o in t)n++;return r!=n}function Zk(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var w6=e=>{if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")};const S6=Dn(w6);var dC=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},ge=(e,t,r)=>(dC(e,t,"read from private field"),r?r.call(e):t.get(e)),Io=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},qe=(e,t,r,n)=>(dC(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);function E6(e){return!!(e.prev&&e.next&&e.prev.text.full!==e.next.text.full)}function C6(e){return!!(e.prev&&e.next&&e.prev.range.cursor!==e.next.range.cursor)}function M6(e){return!!(!e.prev&&e.next)}function T6(e){return!!(e.prev&&!e.next)}function O6(e){return!!(e.prev&&e.next&&e.prev.range.from!==e.next.range.from)}function _6(e){return e==="invalid-exit-split"}var A6=["jump-backward-exit","jump-forward-exit"],N6=["jump-backward-change","jump-forward-change"];function R6(e){var t,r;return fr(A6,(t=e.exit)==null?void 0:t.exitReason)||fr(N6,(r=e.change)==null?void 0:r.changeReason)}function e2(e){return!!(e&&e.query.full.length>=e.suggester.matchOffset)}function t2(e){return Zt(e)&&e instanceof le}function Pr(e){const{match:t,changeReason:r,exitReason:n}=e;return{...t,changeReason:r,exitReason:n}}function P6(e,t){const{invalidPrefixCharacters:r,validPrefixCharacters:n}=t;return r?!new RegExp(V1(r)).test(e):new RegExp(V1(n)).test(e)}function z6(e){const{text:t,regexp:r,$pos:n,suggester:o}=e,i=n.start();let s;return xa(t,r).forEach(a=>{const l=a.input.slice(Math.max(0,a.index-1),a.index);if(P6(l,o)){const c=a.index+i,u=a[0],d=a[1];if(!ne(u)||!ne(d))return;const f=c+u.length,p=Math.min(f,n.pos),h=p-c;c=n.pos&&(s={range:{from:c,to:f,cursor:p},match:a,query:{partial:u.slice(d.length,h),full:u.slice(d.length)},text:{partial:u.slice(0,h),full:u},textAfter:n.doc.textBetween(f,n.end(),zi,zi),textBefore:n.doc.textBetween(i,c,zi,zi),suggester:o})}}),s}function fC(e){const{$pos:t,suggester:r}=e,{char:n,name:o,startOfLine:i,supportedCharacters:s,matchOffset:a,multiline:l,caseInsensitive:c,unicode:u}=r,d=j6({char:n,matchOffset:a,startOfLine:i,supportedCharacters:s,multiline:l,caseInsensitive:c,unicode:u}),f=t.doc.textBetween(t.before(),t.end(),zi,zi);return z6({suggester:r,text:f,regexp:d,$pos:t,char:n,name:o})}function pC(e){const{state:t,match:r}=e;try{return fC({$pos:t.doc.resolve(r.range.cursor),suggester:r.suggester})}catch{return}}function hC(e){const{prev:t,next:r,state:n}=e;return!r&&t.range.from>=n.doc.nodeSize?{exit:Pr({match:t,exitReason:"delete"})}:!r||!t.query.partial?{exit:Pr({match:t,exitReason:"invalid-exit-split"})}:t.range.to===r.range.cursor?{exit:Pr({match:r,exitReason:"exit-end"})}:t.query.partial?{exit:Pr({match:r,exitReason:"exit-split"})}:{}}function L6(e){const{prev:t,next:r,state:n}=e,o=ee(),i=pC({state:n,match:t}),{exit:s}=i&&i.query.full!==t.query.full?hC({prev:t,next:i,state:n}):o;return t.range.from=t.range.to)?{exit:Pr({match:t,exitReason:"selection-outside"})}:n.pos>t.range.to?{exit:Pr({match:t,exitReason:"move-end"})}:n.pos<=t.range.from?{exit:Pr({match:t,exitReason:"move-start"})}:{}}function D6(e){const{prev:t,next:r,state:n,$pos:o}=e,i=ee();if(!t&&!r)return i;const s={prev:t,next:r};return O6(s)?L6({prev:s.prev,next:s.next,state:n}):M6(s)?{change:Pr({match:s.next,changeReason:"start"})}:T6(s)?I6({$pos:o,match:s.prev,state:n}):E6(s)?{change:Pr({match:s.next,changeReason:"change-character"})}:C6(s)?{change:Pr({match:s.next,changeReason:n.selection.empty?"move":"selection-inside"})}:i}function r2(e,t){for(let r=e.depth;r>0;r--){const n=e.node(r);if(t.includes(n.type.name))return!0}return!1}function F1(e,t){const{$from:r,$to:n}=e;return mC(e,t)?!0:Ev(r.pos,n.pos).some(o=>$6(r.doc.resolve(o),t))}function mC(e,t){const{$from:r,$to:n}=e,o=new Set((r.marksAcross(n)??[]).map(i=>i.type.name));return t.some(i=>o.has(i))}function $6(e,t){const r=new Set(e.marks().map(n=>n.type.name));return t.some(n=>r.has(n))}function H6(e,t){const{$cursor:r}=t,{validMarks:n,validNodes:o,invalidMarks:i,invalidNodes:s}=e;return!n&&!o&&Mo(i)&&Mo(s)?!0:!(n&&!mC(t,n)||o&&!r2(r,o)||!n&&F1(t,i)||!o&&r2(r,s))}function n2(e){const{suggesters:t,$pos:r,selectionEmpty:n}=e;for(const o of t)if(!(o.emptySelectionsOnly&&!n))try{const i=fC({suggester:o,$pos:r});if(!i)continue;const s={$from:r.doc.resolve(i.range.from),$to:r.doc.resolve(i.range.to),$cursor:r};if(H6(o,s)&&o.isValidPosition(s,i))return i}catch{}}function V1(e){return lA(e)?e.source:e}function B6(e){return e?"^":""}function F6(e,t){return`(?:${V1(e)}){${t},}`}function V6(e){return ne(e)?new RegExp(S6(e)):e}function j6(e){const{char:t,matchOffset:r,startOfLine:n,supportedCharacters:o,captureChar:i=!0,caseInsensitive:s=!1,multiline:a=!1,unicode:l=!1}=e,c=`g${a?"m":""}${s?"i":""}${l?"u":""}`;let u=V6(t).source;return i&&(u=`(${u})`),new RegExp(`${B6(n)}${u}${F6(o,r)}`,c)}var U6={appendTransaction:!1,priority:50,ignoredTag:"span",matchOffset:0,disableDecorations:!1,startOfLine:!1,suggestClassName:"suggest",suggestTag:"span",supportedCharacters:/\w+/,validPrefixCharacters:/^[\s\0]?$/,invalidPrefixCharacters:null,ignoredClassName:null,invalidMarks:[],invalidNodes:[],validMarks:null,validNodes:null,isValidPosition:()=>!0,checkNextValidSelection:null,emptySelectionsOnly:!1,caseInsensitive:!1,multiline:!1,unicode:!1,captureChar:!0},gC="__ignore_prosemirror_suggest_update__",Df,Dc,zt,wi,ja,po,Ot,Si,Ua,vC=class{constructor(e){Io(this,Df,!1),Io(this,Dc,!1),Io(this,zt,void 0),Io(this,wi,void 0),Io(this,ja,void 0),Io(this,po,ee()),Io(this,Ot,Ee.empty),Io(this,Si,!1),Io(this,Ua,!1),this.setMarkRemoved=()=>{qe(this,Si,!0)},this.findNextTextSelection=r=>{const n=r.$from.doc,o=Math.min(n.nodeSize-2,r.to+1),i=n.resolve(o),s=be.findFrom(i,1,!0);if(t2(s))return s},this.ignoreNextExit=()=>{qe(this,Dc,!0)},this.addIgnored=({from:r,name:n,specific:o=!1})=>{const i=ge(this,zt).find(u=>u.name===n);if(!i)throw new Error(`No suggester exists for the name provided: ${n}`);const s=ne(i.char)?i.char.length:1,a=r+s,l=i.ignoredClassName?{class:i.ignoredClassName}:{},c=Ge.inline(r,a,{nodeName:i.ignoredTag,...l},{name:n,specific:o,char:i.char});qe(this,Ot,ge(this,Ot).add(this.view.state.doc,[c]))},this.removeIgnored=({from:r,name:n})=>{const o=ge(this,zt).find(a=>a.name===n);if(!o)throw new Error(`No suggester exists for the name provided: ${n}`);const i=ne(o.char)?o.char.length:1,s=ge(this,Ot).find(r,r+i)[0];!s||s.spec.name!==n||qe(this,Ot,ge(this,Ot).remove([s]))},this.clearIgnored=r=>{if(!r){qe(this,Ot,Ee.empty);return}const o=ge(this,Ot).find().filter(({spec:i})=>i.name===r);qe(this,Ot,ge(this,Ot).remove(o))},this.findMatchAtPosition=(r,n)=>{const o=n?ge(this,zt).filter(i=>i.name===n):ge(this,zt);return n2({suggesters:o,$pos:r,docChanged:!1,selectionEmpty:!0})},this.setLastChangeFromAppend=()=>{qe(this,Ua,!0)};const t=o2();qe(this,zt,e.map(t)),qe(this,zt,ra(ge(this,zt),(r,n)=>n.priority-r.priority))}static create(e){return new vC(e)}get decorationSet(){return ge(this,Ot)}get removed(){return ge(this,Si)}get match(){return ge(this,wi)?ge(this,wi):ge(this,ja)&&ge(this,po).exit?ge(this,ja):void 0}init(e){return this.view=e,this}createProps(e){const{name:t,char:r}=e.suggester;return{view:this.view,addIgnored:this.addIgnored,clearIgnored:this.clearIgnored,ignoreNextExit:this.ignoreNextExit,setMarkRemoved:this.setMarkRemoved,name:t,char:r,...e}}shouldRunExit(){return ge(this,Dc)?(qe(this,Dc,!1),!1):!0}updateWithNextSelection(e){var t,r,n;const o=this.findNextTextSelection(e.selection);if(o)for(const i of ge(this,zt)){const s=(t=ge(this,po).change)==null?void 0:t.suggester.name,a=(r=ge(this,po).exit)==null?void 0:r.suggester.name;(n=i.checkNextValidSelection)==null||n.call(i,o.$from,e,{change:s,exit:a})}}changeHandler(e,t){const{change:r,exit:n}=ge(this,po),o=this.match;if(!r&&!n||!e2(o))return;const i=t===(n==null?void 0:n.suggester.appendTransaction)&&this.shouldRunExit(),s=t===(r==null?void 0:r.suggester.appendTransaction);if(!(!i&&!s)){if(r&&n&&R6({change:r,exit:n})){const a=this.createProps(n),l=this.createProps(r),c=n.range.from{const a=ne(s.char)?s.char.length:1;return i-o!==a});qe(this,Ot,t.remove(n))}shouldIgnoreMatch({range:e,suggester:{name:t}}){return ge(this,Ot).find().some(({spec:o,from:i})=>i!==e.from?!1:o.specific?o.name===t:!0)}resetState(){qe(this,po,ee()),qe(this,wi,void 0),qe(this,Si,!1),qe(this,Ua,!1)}updateReasons(e){const{$pos:t,state:r}=e,n=ge(this,Df),o=ge(this,zt),i=r.selection.empty,s=t2(r.selection)?n2({suggesters:o,$pos:t,docChanged:n,selectionEmpty:i}):void 0;qe(this,wi,s&&this.shouldIgnoreMatch(s)?void 0:s),qe(this,po,D6({next:ge(this,wi),prev:ge(this,ja),state:r,$pos:t}))}addSuggester(e){const t=ge(this,zt).find(n=>n.name===e.name),r=o2();if(t)qe(this,zt,ge(this,zt).map(n=>n===t?r(e):n));else{const n=[...ge(this,zt),r(e)];qe(this,zt,ra(n,(o,i)=>i.priority-o.priority))}return()=>this.removeSuggester(e.name)}removeSuggester(e){const t=ne(e)?e:e.name;qe(this,zt,ge(this,zt).filter(r=>r.name!==t)),this.clearIgnored(t)}toJSON(){return this.match}apply(e){const{exit:t,change:r}=ge(this,po);if(ge(this,Ua)&&(qe(this,Ua,!1),!(t!=null&&t.suggester.appendTransaction)&&!(r!=null&&r.suggester.appendTransaction)))return this;const{tr:n,state:o}=e,i=n.docChanged||n.selectionSet;return n.getMeta(gC)||!i&&!ge(this,Si)?this:(qe(this,Df,n.docChanged),this.mapIgnoredDecorations(n),t&&this.resetState(),qe(this,ja,ge(this,wi)),this.updateReasons({$pos:n.selection.$from,state:o}),this)}createDecorations(e){const t=this.match;if(!e2(t))return ge(this,Ot);const{disableDecorations:r}=t.suggester;if(_e(r)?r(e,t):r)return ge(this,Ot);const{range:o,suggester:i}=t,{name:s,suggestTag:a,suggestClassName:l}=i,{from:c,to:u}=o;return this.shouldIgnoreMatch(t)?ge(this,Ot):ge(this,Ot).add(e.doc,[Ge.inline(c,u,{nodeName:a,class:s?`${l} suggest-${s}`:l},{name:s})])}},W6=vC;Df=new WeakMap;Dc=new WeakMap;zt=new WeakMap;wi=new WeakMap;ja=new WeakMap;po=new WeakMap;Ot=new WeakMap;Si=new WeakMap;Ua=new WeakMap;function o2(){const e=new Set;return t=>{if(e.has(t.name))throw new Error(`A suggester already exists with the name '${t.name}'. The name provided must be unique.`);const r={...U6,...t};return e.add(t.name),r}}var yC=new ka("suggest");function Fv(e){return yC.getState(e)}function i2(e,t){return Fv(e).addSuggester(t)}function s2(e){e.setMeta(gC,!0)}function K6(e,t){return Fv(e).removeSuggester(t)}function q6(...e){const t=W6.create(e);return new Ro({key:yC,view:r=>(t.init(r),{update:n=>t.changeHandler(n.state.tr,!1)}),state:{init:()=>t,apply:(r,n,o,i)=>t.apply({tr:r,state:i})},appendTransaction:(r,n,o)=>{const i=o.tr;return t.updateWithNextSelection(i),t.changeHandler(i,!0),i.docChanged||i.steps.length>0||i.selectionSet||i.storedMarksSet?(t.setLastChangeFromAppend(),i):null},props:{decorations:r=>t.createDecorations(r)}})}function Vv(e,t){const r=Object.getPrototypeOf(t);let n=e.selection,o=e.doc,i=e.storedMarks;const s=ee();for(const[a,l]of Object.entries(t))s[a]={value:l};return Object.create(r,{...s,storedMarks:{get(){return i}},selection:{get(){return n}},doc:{get(){return o}},tr:{get(){return n=e.selection,o=e.doc,i=e.storedMarks,e}}})}function bu(e){return({state:t,dispatch:r,view:n,tr:o})=>e(Vv(o,t),r,n)}function a2(e){return t=>{var r;return te(t.dispatch===void 0||t.dispatch===((r=t.view)==null?void 0:r.dispatch),{code:H.NON_CHAINABLE_COMMAND}),e(t)}}function G6(...e){return({state:t,dispatch:r,view:n,tr:o,...i})=>{for(const s of e)if(s({state:t,dispatch:r,view:n,tr:o,...i}))return!0;return!1}}var on={get isBrowser(){return!!(typeof window<"u"&&typeof window.document<"u"&&window.navigator&&window.navigator.userAgent)},get isJSDOM(){return on.isBrowser&&window.navigator.userAgent.includes("jsdom")},get isNode(){return typeof process<"u"&&process.versions!=null&&process.versions.node!=null},get isIos(){return on.isBrowser&&/iPod|iPhone|iPad/.test(navigator.platform)},get isMac(){return on.isBrowser&&/Mac|iPod|iPhone|iPad/.test(navigator.platform)},get isApple(){return on.isNode?process.platform==="darwin":on.isBrowser?/Mac|iPod|iPhone|iPad/.test(window.navigator.platform):!1},get isDevelopment(){return!1},get isTest(){return!1},get isProduction(){return!0}};function kn(e,t){var r;const n=RC(e);return((r=n==null?void 0:n.getComputedStyle(e))==null?void 0:r.getPropertyValue(t))??""}function ar(e,t){return Object.assign(e.style,t)}var Y6=["px","rem","em","in","q","mm","cm","pt","pc","vh","vw","vmin","vmax"],J6=/[\d-.]+(\w+)$/;function $f(e="0"){const t=e||"0",r=Number.parseFloat(t),n=t.match(J6),o=((n==null?void 0:n[1])??"px").toLowerCase();return[r,fr(Y6,o)?o:"px"]}var Cn=96,hl=25.4,bC=72,xC=6;function Pl(e){if(Je(e))return kn(e,"font-size")||Pl(e.parentElement);const t=RC(e);return t?kn(t.document.documentElement,"font-size"):""}function X6(e){const t=zC(e),r=t.document.documentElement||t.document.body;return(n,o)=>{switch(o){case"rem":return n*Qs(Pl(r));case"em":return n*Qs(Pl(e),e==null?void 0:e.parentElement);case"in":return n*Cn;case"q":return n*Cn/hl/4;case"mm":return n*Cn/hl;case"cm":return n*Cn*10/hl;case"pt":return n*Cn/bC;case"pc":return n*Cn/xC;case"vh":return(n*t.innerHeight||r.clientWidth)/100;case"vw":return(n*t.innerWidth||r.clientHeight)/100;case"vmin":return n*Math.min(t.innerWidth||r.clientWidth,t.innerHeight||r.clientHeight)/100;case"vmax":return n*Math.max(t.innerWidth||r.clientWidth,t.innerHeight||r.clientHeight)/100;default:return n}}}var Hf=/^([a-z]+)\((.+)\)$/i;function kC(e,t){if(!Hf.test(e))return Number.NaN;const r=SN(e,{brackets:["()"],escape:"_",flat:!0});if(!r||r.length===0)return Number.NaN;function n(i){return i.replace(/_(\d+)_/g,(s,a)=>{const l=Number.parseFloat(a);return r[l]??""})}const o=Zo(r,0);for(const i of xa(o,Hf)){const s=Zo(i,1),c=n(Zo(i,2)).split(/\s*,\s*/).map(u=>{if(Hf.test(u)){const d=n(u);return kC(d,t)}return wC(u,t)});switch(s){case"min":return Math.min(...c);case"max":return Math.max(...c);case"clamp":{const[u,d,f]=c;if(Jt(u)&&Jt(d)&&Jt(f))return Ad({min:u,max:f,value:d});break}case"calc":return Number.NaN;default:return Number.NaN}}return Number.NaN}function wC(e,t){const[r,n]=$f(e);return t(r,n)}function Qs(e,t){const r=X6(t);return Hf.test(e)?kC(e.toLowerCase(),r):wC(e,r)}function bg(e,t,r){const n=zC(r),o=n.document.documentElement||n.document.body,i=Qs(e,r);switch(t){case"px":return i;case"rem":return i/Qs(Pl(o));case"em":return i*Qs(Pl(r),r==null?void 0:r.parentElement);case"in":return i/Cn;case"q":return i/Cn*hl*4;case"mm":return i/Cn*hl;case"cm":return i/Cn/10*hl;case"pt":return i/Cn*bC;case"pc":return i/Cn*xC;case"vh":return i/(n.innerHeight||o.clientWidth)*100;case"vw":return i/(n.innerWidth||o.clientHeight)*100;case"vmin":return i/Math.min(n.innerWidth||o.clientWidth,n.innerHeight||o.clientHeight)*100;case"vmax":return i/Math.max(n.innerWidth||o.clientWidth,n.innerHeight||o.clientHeight)*100;default:return i}}function Ap(e){return Zt(e)&&Jt(e.nodeType)&&ne(e.nodeName)}function Je(e){return Ap(e)&&e.nodeType===1}function Q6(e){return Ap(e)&&e.nodeType===3}function $h(e){const{types:t,node:r}=e;if(!r)return!1;const n=o=>o===r.type||o===r.type.name;return ct(t)?t.some(n):n(t)}function Z6(e,t){const{tr:r}=t;return e.forEach(n=>{n.steps.forEach(o=>{r.step(o)})}),r}function ez({pos:e,tr:t}){const r=t.doc.nodeAt(e);return r&&t.delete(e,e+r.nodeSize),t}function tz({pos:e,tr:t,content:r}){const n=t.doc.nodeAt(e);return n&&t.replaceWith(e,e+n.nodeSize,r),t}function Ld(e){const{predicate:t,selection:r}=e,n=CC(r)?r.selection.$from:Wv(r)?r.$from:r;for(let o=n.depth;o>0;o--){const i=n.node(o),s=o>0?n.before(o):0,a=n.start(o),l=s+i.nodeSize;if(t(i,s))return{pos:s,depth:o,node:i,start:a,end:l}}}function rz(e){const{depth:t}=e,r=t>0?e.before(t):0,n=e.node(t),o=e.start(t),i=r+n.nodeSize;return{pos:r,start:o,node:n,end:i,depth:t}}function nz(e){const t=Ld({predicate:()=>!0,selection:e});return te(t,{message:"No parent node found for the selection provided."}),t}function ts(e){const{types:t,selection:r}=e;return Ld({predicate:n=>$h({types:t,node:n}),selection:r})}function oz(e){const{types:t,selection:r}=e;if(!(!Dd(r)||!$h({types:t,node:r.node})))return{pos:r.$from.pos,depth:r.$from.depth,start:r.$from.start(),end:r.$from.pos+r.node.nodeSize,node:r.node}}function jv(e){return Wv(e)?e.empty:e.selection.empty}function iz(e){return e.docChanged||e.selectionSet}function SC(e){return!!Bu(e)}function Bu(e){const{state:t,type:r,attrs:n}=e,{selection:o,doc:i}=t,s=ne(r)?i.type.schema.nodes[r]:r;te(s,{code:H.SCHEMA,message:`No node exists for ${r}`});const a=oz({selection:o,types:r})??Ld({predicate:l=>l.type===s,selection:o});return!n||gp(n)||!a||a.node.hasMarkup(s,{...a.node.attrs,...n})?a:void 0}function Np(...e){return t=>{if(!Qx(e))return!1;const[r,...n]=e;let o=!1;const i=(...l)=>()=>{if(!Qx(l))return!1;o=!0;const[,...c]=l;return Np(...l)({...t,next:i(...c)})},s=i(...n),a=r({...t,next:s});return o||a?a:s()}}function sz(e,t){const r=new Map,n=ee();for(const o of e)for(const[i,s]of At(o)){const l=[...r.get(i)??[],s],c=Np(...l);r.set(i,l),n[i]=t(c)}return n}function az(e){return sz(e,t=>(r,n,o)=>t({state:r,dispatch:n,view:o,tr:r.tr,next:()=>!1}))}function Uv(e,t){const r=e.attrs??{};return Object.entries(t).every(([n,o])=>r[n]===o)}function lz(e){return TC(e,[Ko,bt,Dt,eo])}function oc(e){return Zt(e)}function ic(e,t){return ct(t)?fr(t,e[ti]):t===e[ti]}function cz(e){return Zt(e)&&e instanceof T1}function uz(e,t){return ne(e)?it(t.nodes,e):e}function EC(e){return Zt(e)&&e instanceof Nd}function dz(e,t){return ne(e)?it(t.marks,e):e}function Id(e){return Zt(e)&&e instanceof Bi}function fz(e){return Zt(e)&&e instanceof R}function pz(e){return Zt(e)&&e instanceof Te}function CC(e){return Zt(e)&&e instanceof Bs}function gs(e){return Zt(e)&&e instanceof le}function hz(e){return Zt(e)&&e instanceof kr}function Wv(e){return Zt(e)&&e instanceof be}function mz(e){return Zt(e)&&e instanceof Tl}function l2(e){const{trState:t,from:r,to:n,type:o,attrs:i={}}=e,{doc:s}=t,a=dz(o,s.type.schema);if(Object.keys(i).length===0)return s.rangeHasMark(r,n,a);let l=!1;return n>r&&s.nodesBetween(r,n,c=>l?!1:(l=(c.marks??[]).some(d=>d.type!==a?!1:Uv(d,i)),!l)),l}function Dd(e){return Zt(e)&&e instanceof ce}function Rp(e){const{trState:t,type:r,attrs:n={},from:o,to:i}=e,{selection:s,doc:a,storedMarks:l}=t,c=ne(r)?a.type.schema.marks[r]:r;if(te(c,{code:H.SCHEMA,message:`Mark type: ${r} does not exist on the current schema.`}),o&&i)try{return Math.max(o,i)d.type!==r?!1:Uv(d,n??{})):l2({...e,from:s.from,to:s.to})}function Kv(e,t={}){const r=gz(e.type.schema);if(!r)return!1;const{ignoreAttributes:n,ignoreDocAttributes:o}=t;return n?MC(r,e):o?r.content.eq(e.content):r.eq(e)}function MC(e,t){if(e===t)return!0;const r=e.type===t.type&&Te.sameSet(e.marks,t.marks);function n(){if(e.content===t.content)return!0;if(e.content.size!==t.content.size)return!1;const o=[],i=[];e.content.forEach(s=>o.push(s)),t.content.forEach(s=>i.push(s));for(const[s,a]of o.entries()){const l=i[s];if(!l||!MC(a,l))return!1}return!0}return r&&n()}function gz(e){var t;return((t=e.nodes.doc)==null?void 0:t.createAndFill())??void 0}function Hh(e){for(const t of Object.values(e.nodes))if(t.name!=="doc"&&(t.isBlock||t.isTextblock))return t;te(!1,{code:H.SCHEMA,message:"No default block node found for the provided schema."})}function vz(e){return e.type===Hh(e.type.schema)}function Bh(e){return!!e&&e.type.isBlock&&!e.textContent&&!e.childCount}function _o(e,t,r){const n=e.parent.childAfter(e.parentOffset);if(!n.node)return;const o=ne(t)?t:t.name,i=n.node.marks.find(({type:d})=>d.name===o);let s=e.index(),a=e.start()+n.offset,l=s+1,c=a+n.node.nodeSize;if(!i)return r&&c0&&i.isInSet(e.parent.child(s-1).marks);)s-=1,a-=e.parent.child(s).nodeSize;for(;le instanceof r)}function fz(e){return Y4(e,({from:r,to:n,prevFrom:o,prevTo:i})=>`${r}_${n}_${o}_${i}`).filter((r,n,o)=>!o.some((i,s)=>n===s?!1:r.prevFrom>=i.prevFrom&&r.prevTo<=i.prevTo&&r.from>=i.from&&r.to<=i.to))}function E5(e,t=[]){const r=[],{steps:n,mapping:o}=e,i=o.invert();n.forEach((a,l)=>{if(!S5(a,t))return;const c=[],u=a.getMap(),d=o.slice(l);if(u.ranges.length===0&&tz(a)){const{from:f,to:p}=a;c.push({from:f,to:p})}else u.forEach((f,p)=>{c.push({from:f,to:p})});c.forEach(f=>{const p=d.map(f.from,-1),h=d.map(f.to);r.push({from:p,to:h,prevFrom:i.map(p,-1),prevTo:i.map(h)})})});const s=ra(r,(a,l)=>a.from-l.from);return fz(s)}function pz(e,t){const r=[],n=E5(e,t);for(const o of n)try{const i=e.doc.resolve(o.from),s=e.doc.resolve(o.to),a=i.blockRange(s);a&&r.push(a)}catch{}return r}function hz(e){var t;return((t=e.content.firstChild)==null?void 0:t.textContent)??""}function mz(e,t){if(!gs(e.selection))return;let{from:r,to:n}=e.selection;const o=(s,a)=>hz(le.between(e.doc.resolve(s),e.doc.resolve(a)).content());for(let s=o(r-1,r);s&&!t.test(s);r--,s=o(r-1,r));for(let s=o(n,n+1);s&&!t.test(s);n++,s=o(n,n+1));if(r===n)return;const i=e.doc.textBetween(r,n,yv,` +`);return{from:a,to:c,text:u,mark:i}}function yz(e,t){const r=[],{$from:n,$to:o}=e;let i=n;for(;;){const s=_o(i,t,o);if(!s)return r;if(r.push(s),s.toe instanceof r)}function bz(e){return Z4(e,({from:r,to:n,prevFrom:o,prevTo:i})=>`${r}_${n}_${o}_${i}`).filter((r,n,o)=>!o.some((i,s)=>n===s?!1:r.prevFrom>=i.prevFrom&&r.prevTo<=i.prevTo&&r.from>=i.from&&r.to<=i.to))}function OC(e,t=[]){const r=[],{steps:n,mapping:o}=e,i=o.invert();n.forEach((a,l)=>{if(!TC(a,t))return;const c=[],u=a.getMap(),d=o.slice(l);if(u.ranges.length===0&&lz(a)){const{from:f,to:p}=a;c.push({from:f,to:p})}else u.forEach((f,p)=>{c.push({from:f,to:p})});c.forEach(f=>{const p=d.map(f.from,-1),h=d.map(f.to);r.push({from:p,to:h,prevFrom:i.map(p,-1),prevTo:i.map(h)})})});const s=ra(r,(a,l)=>a.from-l.from);return bz(s)}function xz(e,t){const r=[],n=OC(e,t);for(const o of n)try{const i=e.doc.resolve(o.from),s=e.doc.resolve(o.to),a=i.blockRange(s);a&&r.push(a)}catch{}return r}function kz(e){var t;return((t=e.content.firstChild)==null?void 0:t.textContent)??""}function wz(e,t){if(!gs(e.selection))return;let{from:r,to:n}=e.selection;const o=(s,a)=>kz(le.between(e.doc.resolve(s),e.doc.resolve(a)).content());for(let s=o(r-1,r);s&&!t.test(s);r--,s=o(r-1,r));for(let s=o(n,n+1);s&&!t.test(s);n++,s=o(n,n+1));if(r===n)return;const i=e.doc.textBetween(r,n,kv,` -`);return{from:r,to:n,text:i}}function C5(e){return mz(e,/\W/)}function Zo(e,t=0){const r=ct(e)?e[t]:e;return B4(ne(r),`No match string found for match ${e}`),r??""}function gz(e){return gs(e)?e.$cursor:void 0}function vz(e,t){return Ld(e)?t?e.type===t.nodes.doc:e.type.name==="doc":!1}function yz(e){return Zt(e)&&Jt(e.anchor)&&Jt(e.head)}function jr(e,t){const r=t.nodeSize-2,n=0;let o;const i=l=>_d({min:n,max:r,value:l});if(Vv(e))return e;if(e==="all")return new xr(t);if(e==="start"?o=n:e==="end"?o=r:lz(e)?o=e.pos:o=e,Jt(o))return o=i(o),le.near(t.resolve(o));if(yz(o)){const l=i(o.anchor),c=i(o.head);return le.between(t.resolve(l),t.resolve(c))}const s=i(o.from),a=i(o.to);return le.between(t.resolve(s),t.resolve(a))}var bz=3;function M5(e){const{content:t,schema:r,document:n,stringHandler:o,onError:i,attempts:s=0}=e,a=i&&s<=bz||s===0;if(te(a,{code:H.INVALID_CONTENT,message:"The invalid content has been called recursively more than ${MAX_ATTEMPTS} times. The content is invalid and the error handler has not been able to recover properly."}),ne(t))return te(o,{code:H.INVALID_CONTENT,message:`The string '${t}' was added to the editor, but no \`stringHandler\` was added. Please provide a valid string handler which transforms your content to a \`ProsemirrorNode\` to prevent this error.`}),o({document:n,content:t,schema:r});if(k5(t))return t.doc;if(Ld(t))return t;try{return r.nodeFromJSON(t)}catch(l){const c=Ez({schema:r,error:l,json:t}),u=i==null?void 0:i(c);return te(u,{code:H.INVALID_CONTENT,message:`An error occurred when processing the content. Please provide an \`onError\` handler to process the invalid content: ${JSON.stringify(c.invalidContent,null,2)}`}),M5({...e,content:u,attempts:s+1})}}function $h(){const e=TE();if(e)return e;throw new Error(`Unable to retrieve the document from the global scope. +`);return{from:r,to:n,text:i}}function _C(e){return wz(e,/\W/)}function Zo(e,t=0){const r=ct(e)?e[t]:e;return U4(ne(r),`No match string found for match ${e}`),r??""}function Sz(e){return gs(e)?e.$cursor:void 0}function Ez(e,t){return Id(e)?t?e.type===t.nodes.doc:e.type.name==="doc":!1}function Cz(e){return Zt(e)&&Jt(e.anchor)&&Jt(e.head)}function jr(e,t){const r=t.nodeSize-2,n=0;let o;const i=l=>Ad({min:n,max:r,value:l});if(Wv(e))return e;if(e==="all")return new kr(t);if(e==="start"?o=n:e==="end"?o=r:mz(e)?o=e.pos:o=e,Jt(o))return o=i(o),le.near(t.resolve(o));if(Cz(o)){const l=i(o.anchor),c=i(o.head);return le.between(t.resolve(l),t.resolve(c))}const s=i(o.from),a=i(o.to);return le.between(t.resolve(s),t.resolve(a))}var Mz=3;function AC(e){const{content:t,schema:r,document:n,stringHandler:o,onError:i,attempts:s=0}=e,a=i&&s<=Mz||s===0;if(te(a,{code:H.INVALID_CONTENT,message:"The invalid content has been called recursively more than ${MAX_ATTEMPTS} times. The content is invalid and the error handler has not been able to recover properly."}),ne(t))return te(o,{code:H.INVALID_CONTENT,message:`The string '${t}' was added to the editor, but no \`stringHandler\` was added. Please provide a valid string handler which transforms your content to a \`ProsemirrorNode\` to prevent this error.`}),o({document:n,content:t,schema:r});if(CC(t))return t.doc;if(Id(t))return t;try{return r.nodeFromJSON(t)}catch(l){const c=Nz({schema:r,error:l,json:t}),u=i==null?void 0:i(c);return te(u,{code:H.INVALID_CONTENT,message:`An error occurred when processing the content. Please provide an \`onError\` handler to process the invalid content: ${JSON.stringify(c.invalidContent,null,2)}`}),AC({...e,content:u,attempts:s+1})}}function Fh(){const e=NE();if(e)return e;throw new Error(`Unable to retrieve the document from the global scope. It seems that you are running Remirror in a non-browser environment. Remirror need browser APIs to work. If you are using Jest (or other testing frameworks), make sure that you are using the JSDOM environment (https://jestjs.io/docs/29.0/configuration#testenvironment-string). If you are using Next.js (or other server-side rendering frameworks), please use dynamic import with \`ssr: false\` to load the editor component without rendering it on the server (https://nextjs.org/docs/advanced-features/dynamic-import#with-no-ssr). -If you are using Node.js, you can install JSDOM and Remirror will try to use it automatically, or you can create a fake document and pass it to Remirror`)}function T5(e){var t;return(e==null?void 0:e.defaultView)??(typeof window<"u"?window:void 0)??((t=TE())==null?void 0:t.defaultView)}function O5(e){return T5(e==null?void 0:e.ownerDocument)}function _5(e){const t=T5(e)??$h().defaultView;if(t)return t;throw new Error("Unable to retrieve the window from the global scope")}function A5(e){return _5(e==null?void 0:e.ownerDocument)}function xz(e,t=$h()){const r=vz(e,e.type.schema)?e.content:R.from(e);return sn.fromSchema(e.type.schema).serializeFragment(r,{document:t})}function kz(e,t){return new(_5(t)).DOMParser().parseFromString(`${e}`,"text/html").body}function wz(e,t=$h()){const r=t.createElement("div");return r.append(xz(e,t)),r.innerHTML}function B1(e){const{content:t,schema:r,document:n,fragment:o=!1,...i}=e,s=kz(t,n),a=wv.fromSchema(r);return o?a.parseSlice(s,{...s2,...i}).content:a.parse(s,{...s2,...i})}var s2={preserveWhitespace:!1};function Dd(e,t){const r=zu(t.defaults());return bv({...e},r)}function Uv(e,t){let r="";t&&(r=`${t.trim()}`);const n=pN(e);if(!n)return r;const o=(r.endsWith(";")," ");return`${r}${o}${n}`}var Sz={remove(e,t){let r=e;for(const n of t)n.invalidParentNode||(r=aA(n.path,r));return r}};function Ez({json:e,schema:t,...r}){const n=new Set(zu(t.marks)),o=new Set(zu(t.nodes)),i=N5({json:e,path:[],validNodes:o,validMarks:n});return{json:e,invalidContent:i,transformers:Sz,...r}}function N5(e){const{json:t,validMarks:r,validNodes:n,path:o=[]}=e,i={validMarks:r,validNodes:n},s=[],{type:a,marks:l,content:c}=t;let{invalidParentMark:u=!1,invalidParentNode:d=!1}=e;if(l){const f=[];for(const[p,h]of l.entries()){const m=ne(h)?h:h.type;r.has(m)||(f.unshift({name:m,path:[...o,"marks",`${p}`],type:"mark",invalidParentMark:u,invalidParentNode:d}),u=!0)}s.push(...f)}if(n.has(a)||(s.push({name:a,type:"node",path:o,invalidParentMark:u,invalidParentNode:d}),d=!0),c){const f=[];for(const[p,h]of c.entries())f.unshift(...N5({...i,json:h,path:[...o,"content",`${p}`],invalidParentMark:u,invalidParentNode:d}));s.unshift(...f)}return s}function Cz(e){return!!(gs(e)&&e.$cursor&&e.$cursor.parentOffset>=e.$cursor.parent.content.size)}function F1(e){return!!(gs(e)&&e.$cursor&&e.$cursor.parentOffset<=0)}function a2(e){const t=be.atStart(e.$anchor.doc);return!!(F1(e)&&t.anchor===e.anchor)}function Mz(e){return({dispatch:t,tr:r})=>{const{type:n,attrs:o=ee(),appendText:i,range:s}=e,a=s?le.between(r.doc.resolve(s.from),r.doc.resolve(s.to)):r.selection,{$from:l,from:c,to:u}=a;let d=l.depth===0?r.doc.type.allowsMarkType(n):!1;return r.doc.nodesBetween(c,u,f=>{if(d)return!1;if(f.inlineContent&&f.type.allowsMarkType(n)){d=!0;return}}),d?(t==null||t(r.addMark(c,u,n.create(o))&&i?r.insertText(i):r),!0):!1}}function Tz({tr:e,dispatch:t}){const{$from:r,$to:n}=e.selection,o=r.blockRange(n),i=o&&tc(o);return!Jt(i)||!o?!1:(t==null||t(e.lift(o,i).scrollIntoView()),!0)}function R5(e,t={},r){return function(n){const{tr:o,dispatch:i,state:s}=n,a=ne(e)?it(s.schema.nodes,e):e,{from:l,to:c}=jr(r??o.selection,o.doc),u=o.doc.resolve(l),d=o.doc.resolve(c),f=u.blockRange(d),p=f&&Ev(f,a,t);return!p||!f?!1:(i==null||i(o.wrap(f,p).scrollIntoView()),!0)}}function P5(e,t={},r){return n=>{const{tr:o,state:i}=n,s=ne(e)?it(i.schema.nodes,e):e;return Hu({state:o,type:s,attrs:t})?Tz(n):R5(e,t,r)(n)}}function Bu(e,t,r,n=!0){return function(o){const{tr:i,dispatch:s,state:a}=o,l=ne(e)?it(a.schema.nodes,e):e,{from:c,to:u}=jr(r??i.selection,i.doc);let d=!1,f;return i.doc.nodesBetween(c,u,(p,h)=>{if(d)return!1;if(!p.isTextblock||p.hasMarkup(l,t))return;if(p.type===l){d=!0,f=p.attrs;return}const m=i.doc.resolve(h),b=m.index();d=m.parent.canReplaceWith(b,b+1,l),d&&(f=m.parent.attrs)}),d?(s==null||s(i.setBlockType(c,u,l,{...n?f:{},...t}).scrollIntoView()),!0):!1}}function Wv(e){return t=>{const{tr:r,state:n}=t,{type:o,attrs:i,preserveAttrs:s=!0}=e,a=Hu({state:r,type:o,attrs:i}),l=e.toggleType??Ih(n.schema);if(a)return Bu(l,{...s?a.node.attrs:{},...i})(t);const c=Hu({state:r,type:l,attrs:i});return Bu(o,{...s?c==null?void 0:c.node.attrs:{},...i})(t)}}function Oz(e=0){const t=navigator.userAgent.match(/Chrom(e|ium)\/(\d+)\./);return t?Number.parseInt(it(t,2),10)>=e:!1}function _z(e,t){let{head:r,empty:n,anchor:o}=e;for(const i of t.steps)r=i.getMap().map(r);n?t.setSelection(le.near(t.doc.resolve(r))):t.setSelection(le.between(t.doc.resolve(o),t.doc.resolve(r)))}function Az(e){const{attrs:t={},appendText:r="",content:n="",keepSelection:o=!1,range:i}=e;return({state:s,tr:a,dispatch:l})=>{var c;const u=s.schema,d=jr(e.selection??i??a.selection,a.doc),f=d.$from.index(),{from:p,to:h,$from:m}=d,b=ne(e.type)?u.nodes[e.type]??u.marks[e.type]:e.type;if(te(ne(e.type)?b:!0,{code:H.SCHEMA,message:`Schema contains no marks or nodes with name ${b}`}),rz(b)){if(!m.parent.canReplaceWith(f,f,b))return!1;a.replaceWith(p,h,b.create(t,n?u.text(n):void 0))}else te(n,{message:"`replaceText` cannot be called without content when using a mark type"}),a.replaceWith(p,h,u.text(n,x5(b)?[b.create(t)]:void 0));return r&&a.insertText(r),o&&_z(s.selection,a),l&&(Oz(60)&&((c=document.getSelection())==null||c.empty()),l(a)),!0}}function z5(e,t){const r=e.parent.childAfter(e.parentOffset);if(!r.node)return;const{marks:n,nodeSize:o}=r.node;if(n[0])return n[0].type;const s=e.start()+r.offset+o;return z5(e.doc.resolve(s+1))}function L5(e){return({dispatch:t,tr:r,state:n})=>{const{type:o,expand:i=!0,range:s}=e,a=jr(e.selection??s??r.selection,r.doc);let{from:l,to:c,$from:u,$to:d}=a;const f=ne(o)?n.schema.marks[o]:o;f!==null&&te(f,{code:H.SCHEMA,message:`Mark type: ${o} does not exist on the current schema.`});const p=f??z5(u);if(!p)return!1;const h=_o(u,p,d);return i&&h&&(l=Math.max(0,Math.min(l,h.from)),c=Math.min(Math.max(c,h.to),r.doc.nodeSize-2)),t==null||t(r.removeMark(l,Jt(c)?c:l,x5(f)?f:void 0)),!0}}function Nz(e){const t=["command","cmd","meta"];return nn.isMac&&t.push("mod"),t.includes(e)}function Rz(e){const t=["control","ctrl"];return nn.isMac||t.push("mod"),t.includes(e)}function Pz(e){const t=[];for(let r of e.split("-")){if(r=r.toLowerCase(),Nz(r)){t.push({type:"modifier",symbol:"⌘",key:"command",i18n:Mt.COMMAND_KEY});continue}if(Rz(r)){t.push({type:"modifier",symbol:"⌃",key:"control",i18n:Mt.CONTROL_KEY});continue}switch(r){case"shift":t.push({type:"modifier",symbol:"⇧",key:r,i18n:Mt.SHIFT_KEY});continue;case"alt":t.push({type:"modifier",symbol:"⌥",key:r,i18n:Mt.ALT_KEY});continue;case` -`:case"\r":case"enter":t.push({type:"named",symbol:"↵",key:r,i18n:Mt.ENTER_KEY});continue;case"backspace":t.push({type:"named",symbol:"⌫",key:r,i18n:Mt.BACKSPACE_KEY});continue;case"delete":t.push({type:"named",symbol:"⌦",key:r,i18n:Mt.DELETE_KEY});continue;case"escape":t.push({type:"named",symbol:"␛",key:r,i18n:Mt.ESCAPE_KEY});continue;case"tab":t.push({type:"named",symbol:"⇥",key:r,i18n:Mt.TAB_KEY});continue;case"capslock":t.push({type:"named",symbol:"⇪",key:r,i18n:Mt.CAPS_LOCK_KEY});continue;case"space":t.push({type:"named",symbol:"␣",key:r,i18n:Mt.SPACE_KEY});continue;case"pageup":t.push({type:"named",symbol:"⤒",key:r,i18n:Mt.PAGE_UP_KEY});continue;case"pagedown":t.push({type:"named",symbol:"⤓",key:r,i18n:Mt.PAGE_DOWN_KEY});continue;case"home":t.push({type:"named",key:r,i18n:Mt.HOME_KEY});continue;case"end":t.push({type:"named",key:r,i18n:Mt.END_KEY});continue;case"arrowleft":t.push({type:"named",symbol:"←",key:r,i18n:Mt.ARROW_LEFT_KEY});continue;case"arrowright":t.push({type:"named",symbol:"→",key:r,i18n:Mt.ARROW_RIGHT_KEY});continue;case"arrowup":t.push({type:"named",symbol:"→",key:r,i18n:Mt.ARROW_UP_KEY});continue;case"arrowdown":t.push({type:"named",symbol:"↓",key:r,i18n:Mt.ARROW_DOWN_KEY});continue;default:t.push({type:"char",key:r});continue}}return t}function zz(e){const{node:t,predicate:r,descend:n=!0,action:o}=e;te(Ld(t),{code:H.INTERNAL,message:'Invalid "node" parameter passed to "findChildren".'}),te(_e(r),{code:H.INTERNAL,message:'Invalid "predicate" parameter passed to "findChildren".'});const i=[];return t.descendants((s,a)=>{const l={node:s,pos:a};return r(l)&&(i.push(l),o==null||o(l)),n}),i}function Lz(e){const{type:t,...r}=e;return zz({...r,predicate:n=>n.node.type===t})}function Iz(e,t={}){const{descend:r=!1,predicate:n,StepTypes:o}=t,i=pz(e,o),s=[];for(const a of i){const{start:l,end:c}=a;e.doc.nodesBetween(l,c,(u,d)=>(((n==null?void 0:n(u,d,a))??!0)&&s.push({node:u,pos:d}),r))}return s}function Fu(e){const{regexp:t,type:r,getAttributes:n,ignoreWhitespace:o=!1,beforeDispatch:i,updateCaptured:s,shouldSkip:a,invalidMarks:l}=e;let c;const u=new wa(t,(d,f,p,h)=>{const{tr:m,schema:b}=d;c||(c=ne(r)?b.marks[r]:r,te(c,{code:H.SCHEMA,message:`Mark type: ${r} does not exist on the current schema.`}));let v=f[1],g=f[0];const y=D5({captureGroup:v,fullMatch:g,end:h,start:p,rule:u,state:d,ignoreWhitespace:o,invalidMarks:l,shouldSkip:a,updateCaptured:s});if(!y)return null;({start:p,end:h,captureGroup:v,fullMatch:g}=y);const x=_e(n)?n(f):n;let k=h,w=[];if(v){const E=g.search(/\S/),M=p+g.indexOf(v),C=M+v.length;w=m.storedMarks??[],Cp&&m.delete(p+E,M),k=p+E+v.length}return m.addMark(p,k,c.create(x)),m.setStoredMarks(w),i==null||i({tr:m,match:f,start:p,end:h}),m});return u}function I5(e){const{regexp:t,type:r,getAttributes:n,beforeDispatch:o,shouldSkip:i,ignoreWhitespace:s=!1,updateCaptured:a,invalidMarks:l}=e,c=new wa(t,(u,d,f,p)=>{const h=_e(n)?n(d):n,{tr:m,schema:b}=u,v=ne(r)?b.nodes[r]:r;let g=d[1],y=d[0];const x=D5({captureGroup:g,fullMatch:y,end:p,start:f,rule:c,state:u,ignoreWhitespace:s,invalidMarks:l,shouldSkip:i,updateCaptured:a});if(!x)return null;({start:f,end:p,captureGroup:g,fullMatch:y}=x),te(v,{code:H.SCHEMA,message:`No node exists for ${r} in the schema.`});const k=v.createAndFill(h);return k&&(m.replaceRangeWith(v.isBlock?m.doc.resolve(f).before():f,p,k),o==null||o({tr:m,match:[y,g??""],start:f,end:p})),m});return c}function D5({captureGroup:e,fullMatch:t,end:r,start:n,rule:o,ignoreWhitespace:i,shouldSkip:s,updateCaptured:a,state:l,invalidMarks:c}){var u;if(t==null)return null;const d=(a==null?void 0:a({captureGroup:e,fullMatch:t,start:n,end:r}))??{};e=d.captureGroup??e,t=d.fullMatch??t,n=d.start??n,r=d.end??r;const f=l.doc.resolve(n),p=l.doc.resolve(r);return c&&$1({$from:f,$to:p},c)||o.invalidMarks&&$1({$from:f,$to:p},o.invalidMarks)||i&&(e==null?void 0:e.trim())===""||s!=null&&s({state:l,captureGroup:e,fullMatch:t,start:n,end:r,ruleType:"mark"})||(u=o.shouldSkip)!=null&&u.call(o,{state:l,captureGroup:e,fullMatch:t,start:n,end:r,ruleType:"mark"})?null:{captureGroup:e,end:r,fullMatch:t,start:n}}var Dz=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),r={},n=[];t.forEach(i=>{(i?i.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,l]=a.split("_");r[l]=a}else n.push(a)})});const o=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&o.push(r[i]);return o.push(...n),o.join(" ")},$z=Dz;const $5=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Hz(e,t){let{$cursor:r}=e.selection;return!r||(t?!t.endOfTextblock("backward",e):r.parentOffset>0)?null:r}const H5=(e,t,r)=>{let n=Hz(e,r);if(!n)return!1;let o=B5(n);if(!o){let s=n.blockRange(),a=s&&tc(s);return a==null?!1:(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&j5(e,o,t))return!0;if(n.parent.content.size==0&&(zl(i,"end")||ce.isSelectable(i))){let s=Cv(e.doc,n.before(),n.after(),K.empty);if(s&&s.slice.size{let{$head:n,empty:o}=e.selection,i=n;if(!o)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("backward",e):n.parentOffset>0)return!1;i=B5(n)}let s=i&&i.nodeBefore;return!s||!ce.isSelectable(s)?!1:(t&&t(e.tr.setSelection(ce.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function B5(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Fz(e,t){let{$cursor:r}=e.selection;return!r||(t?!t.endOfTextblock("forward",e):r.parentOffset{let n=Fz(e,r);if(!n)return!1;let o=F5(n);if(!o)return!1;let i=o.nodeAfter;if(j5(e,o,t))return!0;if(n.parent.content.size==0&&(zl(i,"start")||ce.isSelectable(i))){let s=Cv(e.doc,n.before(),n.after(),K.empty);if(s&&s.slice.size{let{$head:n,empty:o}=e.selection,i=n;if(!o)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("forward",e):n.parentOffset=0;t--){let r=e.node(t);if(e.index(t)+1{let{$head:r,$anchor:n}=e.selection;return!r.parent.type.spec.code||!r.sameParent(n)?!1:(t&&t(e.tr.insertText(` -`).scrollIntoView()),!0)};function Kv(e){for(let t=0;t{let{$head:r,$anchor:n}=e.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;let o=r.node(-1),i=r.indexAfter(-1),s=Kv(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let a=r.after(),l=e.tr.replaceWith(a,a,s.createAndFill());l.setSelection(be.near(l.doc.resolve(a),1)),t(l.scrollIntoView())}return!0},Wz=(e,t)=>{let r=e.selection,{$from:n,$to:o}=r;if(r instanceof xr||n.parent.inlineContent||o.parent.inlineContent)return!1;let i=Kv(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let s=(!n.parentOffset&&o.index(){let{$cursor:r}=e.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let i=r.before();if(dl(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let n=r.blockRange(),o=n&&tc(n);return o==null?!1:(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)};function qz(e){return(t,r)=>{let{$from:n,$to:o}=t.selection;if(t.selection instanceof ce&&t.selection.node.isBlock)return!n.parentOffset||!dl(t.doc,n.pos)?!1:(r&&r(t.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(r){let i=o.parentOffset==o.parent.content.size,s=t.tr;(t.selection instanceof le||t.selection instanceof xr)&&s.deleteSelection();let a=n.depth==0?null:Kv(n.node(-1).contentMatchAt(n.indexAfter(-1))),l=e&&e(o.parent,i),c=l?[l]:i&&a?[{type:a}]:void 0,u=dl(s.doc,s.mapping.map(n.pos),1,c);if(!c&&!u&&dl(s.doc,s.mapping.map(n.pos),1,a?[{type:a}]:void 0)&&(a&&(c=[{type:a}]),u=!0),u&&(s.split(s.mapping.map(n.pos),1,c),!i&&!n.parentOffset&&n.parent.type!=a)){let d=s.mapping.map(n.before()),f=s.doc.resolve(d);a&&n.node(-1).canReplaceWith(f.index(),f.index()+1,a)&&s.setNodeMarkup(s.mapping.map(n.before()),a)}r(s.scrollIntoView())}return!0}}const Gz=qz(),Yz=(e,t)=>{let{$from:r,to:n}=e.selection,o,i=r.sharedDepth(n);return i==0?!1:(o=r.before(i),t&&t(e.tr.setSelection(ce.create(e.doc,o))),!0)},Jz=(e,t)=>(t&&t(e.tr.setSelection(new xr(e.doc))),!0);function Xz(e,t,r){let n=t.nodeBefore,o=t.nodeAfter,i=t.index();return!n||!o||!n.type.compatibleContent(o.type)?!1:!n.content.size&&t.parent.canReplace(i-1,i)?(r&&r(e.tr.delete(t.pos-n.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(i,i+1)||!(o.isTextblock||Nd(e.doc,t.pos))?!1:(r&&r(e.tr.clearIncompatible(t.pos,n.type,n.contentMatchAt(n.childCount)).join(t.pos).scrollIntoView()),!0)}function j5(e,t,r){let n=t.nodeBefore,o=t.nodeAfter,i,s;if(n.type.spec.isolating||o.type.spec.isolating)return!1;if(Xz(e,t,r))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(i=(s=n.contentMatchAt(n.childCount)).findWrapping(o.type))&&s.matchType(i[0]||o.type).validEnd){if(r){let d=t.pos+o.nodeSize,f=R.empty;for(let m=i.length-1;m>=0;m--)f=R.from(i[m].create(null,f));f=R.from(n.copy(f));let p=e.tr.step(new bt(t.pos-1,d,t.pos,d,new K(f,1,0),i.length,!0)),h=d+2*i.length;Nd(p.doc,h)&&p.join(h),r(p.scrollIntoView())}return!0}let l=be.findFrom(t,1),c=l&&l.$from.blockRange(l.$to),u=c&&tc(c);if(u!=null&&u>=t.depth)return r&&r(e.tr.lift(c,u).scrollIntoView()),!0;if(a&&zl(o,"start",!0)&&zl(n,"end")){let d=n,f=[];for(;f.push(d),!d.isTextblock;)d=d.lastChild;let p=o,h=1;for(;!p.isTextblock;p=p.firstChild)h++;if(d.canReplace(d.childCount,d.childCount,p.content)){if(r){let m=R.empty;for(let v=f.length-1;v>=0;v--)m=R.from(f[v].copy(m));let b=e.tr.step(new bt(t.pos-f.length,t.pos+o.nodeSize,t.pos+h,t.pos+o.nodeSize-h,new K(m,f.length,0),0,!0));r(b.scrollIntoView())}return!0}}return!1}function U5(e){return function(t,r){let n=t.selection,o=e<0?n.$from:n.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(r&&r(t.tr.setSelection(le.create(t.doc,e<0?o.start(i):o.end(i)))),!0):!1}}const Qz=U5(-1),Zz=U5(1);function eL(e,t,r){for(let n=0;n{if(s)return!1;s=a.inlineContent&&a.type.allowsMarkType(r)}),s)return!0}return!1}function tL(e,t=null){return function(r,n){let{empty:o,$cursor:i,ranges:s}=r.selection;if(o&&!i||!eL(r.doc,s,e))return!1;if(n)if(i)e.isInSet(r.storedMarks||i.marks())?n(r.tr.removeStoredMark(e)):n(r.tr.addStoredMark(e.create(t)));else{let a=!1,l=r.tr;for(let c=0;!a&&c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},nL=typeof navigator<"u"&&/Mac/.test(navigator.platform),oL=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Yt=0;Yt<10;Yt++)rs[48+Yt]=rs[96+Yt]=String(Yt);for(var Yt=1;Yt<=24;Yt++)rs[Yt+111]="F"+Yt;for(var Yt=65;Yt<=90;Yt++)rs[Yt]=String.fromCharCode(Yt+32),Np[Yt]=String.fromCharCode(Yt);for(var bg in rs)Np.hasOwnProperty(bg)||(Np[bg]=rs[bg]);function iL(e){var t=nL&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||oL&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",r=!t&&e.key||(e.shiftKey?Np:rs)[e.keyCode]||e.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}const sL=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function aL(e){let t=e.split(/-(?!$)/),r=t[t.length-1];r=="Space"&&(r=" ");let n,o,i,s;for(let a=0;a127)&&(i=rs[n.keyCode])&&i!=o){let a=t[xg(i,n)];if(a&&a(r.state,r.dispatch,r))return!0}}return!1}}function cL(e){const t=ra(e,(i,s)=>(s.priority??Ae.Low)-(i.priority??Ae.Low)),r=[],n=[];for(const i of t)gL(i)?r.push(i):n.push(i);let o;return new Ro({key:uL,view:i=>(o=i,{}),props:{transformPasted:i=>{var s,a,l;const c=o.state.selection.$from,u=c.node().type.name,d=new Set(c.marks().map(f=>f.type.name));for(const f of r){if((s=f.ignoredNodes)!=null&&s.includes(u)||(a=f.ignoredMarks)!=null&&a.some(g=>d.has(g)))continue;const p=((l=i.content.firstChild)==null?void 0:l.textContent)??"",h=!o.state.selection.empty&&i.content.childCount===1&&p,m=xa(p,f.regexp)[0];if(h&&m&&f.type==="mark"&&f.replaceSelection){const{from:g,to:y}=o.state.selection,x=o.state.doc.slice(g,y),k=x.content.textBetween(0,x.content.size);if(typeof f.replaceSelection!="boolean"?f.replaceSelection(k):f.replaceSelection){const w=[],{getAttributes:E,markType:M}=f,C=_e(E)?E(m,!0):E,T=M.create(C);return x.content.forEach(N=>{if(N.isText){const F=T.addToSet(N.marks);w.push(N.mark(F))}}),K.maxOpen(R.fromArray(w))}}const{nodes:b,transformed:v}=hL(i.content,f,o.state.schema);v&&(i=f.type==="node"&&f.nodeType.isBlock?new K(R.fromArray(b),0,0):new K(R.fromArray(b),i.openStart,i.openEnd))}return xL(i)},handleDOMEvents:{paste:(i,s)=>{var a,l;const c=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{clipboardData:u}=c;if(!u)return!1;const d=[...u.items].map(p=>p.getAsFile()).filter(p=>!!p);if(d.length===0)return!1;const{selection:f}=i.state;for(const{fileHandler:p,regexp:h}of n){const m=h?d.filter(b=>h.test(b.type)):d;if(m.length!==0&&p({event:c,files:m,selection:f,view:i,type:"paste"}))return c.preventDefault(),!0}return!1},drop:(i,s)=>{var a,l,c;const u=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{dataTransfer:d,clientX:f,clientY:p}=u;if(!d)return!1;const h=bL(u);if(h.length===0)return!1;const m=((c=i.posAtCoords({left:f,top:p}))==null?void 0:c.pos)??i.state.selection.anchor;for(const{fileHandler:b,regexp:v}of n){const g=v?h.filter(y=>v.test(y.type)):h;if(g.length!==0&&b({event:u,files:g,pos:m,view:i,type:"drop"}))return u.preventDefault(),!0}return!1}}}})}var uL=new ka("pasteRule");function kg(e,t){return function r(n){const{fragment:o,rule:i,nodes:s}=n,{regexp:a,ignoreWhitespace:l,ignoredMarks:c,ignoredNodes:u}=i;let d=!1;return o.forEach(f=>{if(u!=null&&u.includes(f.type.name)||vL(f)){s.push(f);return}if(!f.isText){const m=r({fragment:f.content,rule:i,nodes:[]});d||(d=m.transformed);const b=R.fromArray(m.nodes);f.type.validContent(b)?s.push(f.copy(b)):s.push(...m.nodes);return}if(f.marks.some(m=>yL(m)||(c==null?void 0:c.includes(m.type.name)))){s.push(f);return}const p=f.text??"";let h=0;for(const m of xa(p,a)){const b=m[1],v=m[0];if(l&&(b==null?void 0:b.trim())===""||!v)return;const g=m.index,y=g+v.length;g>h&&s.push(f.cut(h,g));let x=f.cut(g,y);if(v&&b){const k=v.search(/\S/),w=g+v.indexOf(b),E=w+b.length;k&&s.push(f.cut(g,g+k)),x=f.cut(w,E)}e({nodes:s,rule:i,textNode:x,match:m,schema:t}),d=!0,h=y}p&&h0?[...n.files]:(r=n.items)!=null&&r.length?[...n.items].map(o=>o.getAsFile()).filter(o=>!!o):[]:[]}function xL(e){const t=K.maxOpen(e.content);return t.openStart({events:{},emit(e,...t){(this.events[e]||[]).forEach(r=>r(...t))},on(e,t){return(this.events[e]=this.events[e]||[]).push(t),()=>this.events[e]=(this.events[e]||[]).filter(r=>r!==t)}});var kL=Object.defineProperty,wL=Object.getOwnPropertyDescriptor,Z=(e,t,r,n)=>{for(var o=n>1?void 0:n?wL(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&kL(t,r,o),o},K5=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},G=(e,t,r)=>(K5(e,t,"read from private field"),r?r.call(e):t.get(e)),kt=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Lt=(e,t,r,n)=>(K5(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);function SL(e,t){return e===t}function c2(e){const{previousOptions:t,update:r,equals:n=SL}=e,o=Hs({...t,...r}),i=ee(),s=zu(t);for(const l of s){const c=t[l],u=o[l];if(n(c,u)){i[l]={changed:!1};continue}i[l]={changed:!0,previousValue:c,value:u}}const a=l=>{const c=ee();for(const u of l){const d=i[u];d!=null&&d.changed&&(c[u]=d.value)}return c};return{changes:Hs(i),options:o,pickChanged:a}}var EL={[H.DUPLICATE_HELPER_NAMES]:"helper method",[H.DUPLICATE_COMMAND_NAMES]:"command method"};function q5(e){const{name:t,set:r,code:n}=e,o=EL[n];te(!r.has(t),{code:n,message:`There is a naming conflict for the name: ${t} used in this '${o}'. Please rename or remove from the editor to avoid runtime errors.`}),r.add(t)}function Vu(...e){return Ml($z(...e).split(" ")).join(" ")}var u2="__IGNORE__",CL="__ALL__",ic=class{constructor(e,...[t]){this["~O"]={},this._mappedHandlers=ee(),this.populateMappedHandlers(),this._options=this._initialOptions=q4(e,this.constructor.defaultOptions,t??ee(),this.createDefaultHandlerOptions()),this._dynamicKeys=this.getDynamicKeys(),this.init()}get options(){return this._options}get dynamicKeys(){return this._dynamicKeys}get initialOptions(){return this._initialOptions}init(){}getDynamicKeys(){const e=[],{customHandlerKeys:t,handlerKeys:r,staticKeys:n}=this.constructor;for(const o of zu(this._options))n.includes(o)||r.includes(o)||t.includes(o)||e.push(o);return e}ensureAllKeysAreDynamic(e){}setOptions(e){var t;const r=this.getDynamicOptions();this.ensureAllKeysAreDynamic(e);const{changes:n,options:o,pickChanged:i}=c2({previousOptions:r,update:e});this.updateDynamicOptions(o),(t=this.onSetOptions)==null||t.call(this,{reason:"set",changes:n,options:o,pickChanged:i,initialOptions:this._initialOptions})}resetOptions(){var e;const t=this.getDynamicOptions(),{changes:r,options:n,pickChanged:o}=c2({previousOptions:t,update:this._initialOptions});this.updateDynamicOptions(n),(e=this.onSetOptions)==null||e.call(this,{reason:"reset",options:n,changes:r,pickChanged:o,initialOptions:this._initialOptions})}getDynamicOptions(){return bv(this._options,[...this.constructor.customHandlerKeys,...this.constructor.handlerKeys])}updateDynamicOptions(e){this._options={...this._options,...e}}populateMappedHandlers(){for(const e of this.constructor.handlerKeys)this._mappedHandlers[e]=[]}createDefaultHandlerOptions(){const e=ee();for(const t of this.constructor.handlerKeys)e[t]=(...r)=>{var n;const{handlerKeyOptions:o}=this.constructor,i=(n=o[t])==null?void 0:n.reducer;let s=i==null?void 0:i.getDefault(...r);for(const[,a]of this._mappedHandlers[t]){const l=a(...r);if(s=i?i.accumulator(s,l,...r):l,ML(o,s,t))return s}return s};return e}addHandler(e,t,r=Ae.Default){return this._mappedHandlers[e].push([r,t]),this.sortHandlers(e),()=>this._mappedHandlers[e]=this._mappedHandlers[e].filter(([,n])=>n!==t)}hasHandlers(e){return(this._mappedHandlers[e]??[]).length>0}sortHandlers(e){this._mappedHandlers[e]=ra(this._mappedHandlers[e],([t],[r])=>r-t)}addCustomHandler(e,t){var r;return((r=this.onAddCustomHandler)==null?void 0:r.call(this,{[e]:t}))??K4}};ic.defaultOptions={};ic.staticKeys=[];ic.handlerKeys=[];ic.handlerKeyOptions={};ic.customHandlerKeys=[];function ML(e,t,r){const{[CL]:n}=e,o=e[r];return!n&&!o?!1:!!(o&&o.earlyReturnValue!==u2&&(_e(o.earlyReturnValue)?o.earlyReturnValue(t)===!0:t===o.earlyReturnValue)||n&&n.earlyReturnValue!==u2&&(_e(n.earlyReturnValue)?n.earlyReturnValue(t)===!0:t===n.earlyReturnValue))}var Fh=class extends ic{constructor(...e){super(TL,...e),this["~E"]={},this._extensions=Y4(this.createExtensions(),t=>t.constructor),this.extensionMap=new Map;for(const t of this._extensions)this.extensionMap.set(t.constructor,t)}get priority(){return this.priorityOverride??this.options.priority??this.constructor.defaultPriority}get constructorName(){return`${$4(this.name)}Extension`}get store(){return te(this._store,{code:H.MANAGER_PHASE_ERROR,message:"An error occurred while attempting to access the 'extension.store' when the Manager has not yet set created the lifecycle methods."}),Hs(this._store,{requireKeys:!0})}get extensions(){return this._extensions}replaceChildExtension(e,t){this.extensionMap.has(e)&&(this.extensionMap.set(e,t),this._extensions=this.extensions.map(r=>t.constructor===e?t:r))}createExtensions(){return[]}getExtension(e){const t=this.extensionMap.get(e);return te(t,{code:H.INVALID_GET_EXTENSION,message:`'${e.name}' does not exist within the preset: '${this.name}'`}),t}isOfType(e){return this.constructor===e}setStore(e){this._store||(this._store=e)}clone(...e){return new this.constructor(...e)}setPriority(e){this.priorityOverride=e}};Fh.defaultPriority=Ae.Default;var Ve=class extends Fh{static get[ti](){return $t.PlainExtensionConstructor}get[ti](){return $t.PlainExtension}},li=class extends Fh{static get[ti](){return $t.MarkExtensionConstructor}get[ti](){return $t.MarkExtension}get type(){return it(this.store.schema.marks,this.name)}constructor(...e){super(...e)}};li.disableExtraAttributes=!1;var er=class extends Fh{static get[ti](){return $t.NodeExtensionConstructor}get[ti](){return $t.NodeExtension}get type(){return it(this.store.schema.nodes,this.name)}constructor(...e){super(...e)}};er.disableExtraAttributes=!1;var TL={priority:void 0,extraAttributes:{},disableExtraAttributes:!1,exclude:{}};function G5(e){return nc(e)&&oc(e,[$t.PlainExtension,$t.MarkExtension,$t.NodeExtension])}function OL(e){return nc(e)&&oc(e,[$t.PlainExtensionConstructor,$t.MarkExtensionConstructor,$t.NodeExtensionConstructor])}function Y5(e){return nc(e)&&oc(e,$t.PlainExtension)}function $d(e){return nc(e)&&oc(e,$t.NodeExtension)}function Vh(e){return nc(e)&&oc(e,$t.MarkExtension)}function me(e){return t=>{const{defaultOptions:r,customHandlerKeys:n,handlerKeys:o,staticKeys:i,defaultPriority:s,handlerKeyOptions:a,...l}=e,c=t;r&&(c.defaultOptions=r),s&&(c.defaultPriority=s),a&&(c.handlerKeyOptions=a),c.staticKeys=i??[],c.handlerKeys=o??[],c.customHandlerKeys=n??[];for(const[u,d]of Object.entries(l))c[u]||(c[u]=d);return c}}var _L=class extends Ve{constructor(){super(...arguments),this.attributeList=[],this.attributeObject=ee(),this.updateAttributes=(e=!0)=>{this.transformAttributes(),e&&this.store.commands.forceUpdate("attributes")}}get name(){return"attributes"}onCreate(){this.transformAttributes(),this.store.setExtensionStore("updateAttributes",this.updateAttributes)}transformAttributes(){var e,t,r;if(this.attributeObject=ee(),(e=this.store.managerSettings.exclude)!=null&&e.attributes){this.store.setStoreKey("attributes",this.attributeObject);return}this.attributeList=[];for(const n of this.store.extensions){if((t=n.options.exclude)!=null&&t.attributes)continue;const o=(r=n.createAttributes)==null?void 0:r.call(n),i={...o,class:Vu(...n.classNames??[],o==null?void 0:o.class)};this.attributeList.unshift(i)}for(const n of this.attributeList)this.attributeObject={...this.attributeObject,...n,class:Vu(this.attributeObject.class,n.class)};this.store.setStoreKey("attributes",this.attributeObject)}};function He(e={}){return(t,r,n)=>{(t.decoratedHelpers??(t.decoratedHelpers={}))[r]=e}}function U(e={}){return(t,r,n)=>{(t.decoratedCommands??(t.decoratedCommands={}))[r]=e}}function je(e){return(t,r,n)=>{(t.decoratedKeybindings??(t.decoratedKeybindings={}))[r]=e}}var AL=class{constructor(e){this.promiseCreator=e,this.failureHandlers=[],this.successHandlers=[],this.validateHandlers=[],this.generateCommand=()=>t=>{let r=!0;const{view:n,tr:o,dispatch:i}=t;if(!n)return!1;for(const a of this.validateHandlers)if(!a({...t,dispatch:()=>{}})){r=!1;break}return!i||!r?r:(this.promiseCreator(t).then(a=>{this.runHandlers(this.successHandlers,{value:a,state:n.state,tr:n.state.tr,dispatch:n.dispatch,view:n})}).catch(a=>{this.runHandlers(this.failureHandlers,{error:a,state:n.state,tr:n.state.tr,dispatch:n.dispatch,view:n})}),i(o),!0)}}validate(e,t="push"){return this.validateHandlers[t](e),this}success(e,t="push"){return this.successHandlers[t](e),this}failure(e,t="push"){return this.failureHandlers[t](e),this}runHandlers(e,t){var r;for(const n of e)if(!n({...t,dispatch:()=>{}}))break;(r=t.dispatch)==null||r.call(t,t.tr)}};function ns(e){const{type:t,attrs:r,range:n,selection:o}=e;return i=>{const{dispatch:s,tr:a,state:l}=i,c=ne(t)?l.schema.marks[t]:t;if(te(c,{code:H.SCHEMA,message:`Mark type: ${t} does not exist on the current schema.`}),n||o){const{from:u,to:d}=jr(o??n??a.selection,a.doc);return Ap({trState:a,type:t,...n})?s==null||s(a.removeMark(u,d,c)):s==null||s(a.addMark(u,d,c.create(r))),!0}return yu(tL(c,r))(i)}}function NL(e,t,r){for(const{$from:n,$to:o}of r){let i=n.depth===0?t.type.allowsMarkType(e):!1;if(t.nodesBetween(n.pos,o.pos,s=>{if(i)return!1;i=s.inlineContent&&s.type.allowsMarkType(e)}),i)return!0}return!1}function RL(e,t,r){return({tr:n,dispatch:o,state:i})=>{const s=jr(r??n.selection,n.doc),a=gz(s),l=ne(e)?i.schema.marks[e]:e;if(te(l,{code:H.SCHEMA,message:`Mark type: ${e} does not exist on the current schema.`}),s.empty&&!a||!NL(l,n.doc,s.ranges))return!1;if(!o)return!0;if(a)return n.removeStoredMark(l),t&&n.addStoredMark(l.create(t)),o(n),!0;let c=!1;for(const{$from:u,$to:d}of s.ranges){if(c)break;c=n.doc.rangeHasMark(u.pos,d.pos,l)}for(const{$from:u,$to:d}of s.ranges)c&&n.removeMark(u.pos,d.pos,l),t&&n.addMark(u.pos,d.pos,l.create(t));return o(n),!0}}function PL(e,t={}){return({tr:r,dispatch:n,state:o})=>{const i=o.schema,s=r.selection,{from:a=s.from,to:l=a??s.to,marks:c={}}=t;if(!n)return!0;r.insertText(e,a,l);const u=it(r.steps,r.steps.length-1).getMap().map(l);for(const[d,f]of At(c))r.addMark(a,u,it(i.marks,d).create(f));return n(r),!0}}var xe=class extends Ve{constructor(){super(...arguments),this.decorated=new Map,this.forceUpdateTransaction=(e,...t)=>{const{forcedUpdates:r}=this.getCommandMeta(e);return this.setCommandMeta(e,{forcedUpdates:Ml([...r,...t])}),e}}get name(){return"commands"}get transaction(){const e=this.store.getState();this._transaction||(this._transaction=e.tr);const t=this._transaction.before.eq(e.doc),r=!Mo(this._transaction.steps);if(!t){const n=e.tr;if(r)for(const o of this._transaction.steps)n.step(o);this._transaction=n}return this._transaction}onCreate(){this.store.setStoreKey("getForcedUpdates",this.getForcedUpdates.bind(this))}onView(e){var t;const{extensions:r,helpers:n}=this.store,o=ee(),i=new Set;let s=ee();const a=c=>{var u;const d=ee(),f=()=>c??this.transaction;let p=[];const h=()=>p;for(const[b,v]of Object.entries(o))(u=s[b])!=null&&u.disableChaining||(d[b]=this.chainedFactory({chain:d,command:v.original,getTr:f,getChain:h}));const m=b=>{te(b===f(),{message:"Chaining currently only supports `CommandFunction` methods which do not use the `state.tr` property. Instead you should use the provided `tr` property."})};return d.run=(b={})=>{const v=p;p=[];for(const g of v)if(!g(m)&&b.exitEarly)return;e.dispatch(f())},d.tr=()=>{const b=p;p=[];for(const v of b)v(m);return f()},d.enabled=()=>{for(const b of p)if(!b())return!1;return!0},d.new=b=>a(b),d};for(const c of r){const u=((t=c.createCommands)==null?void 0:t.call(c))??{},d=c.decoratedCommands??{},f={};s={...s,decoratedCommands:d};for(const[p,h]of Object.entries(d)){const m=ne(h.shortcut)&&h.shortcut.startsWith("_|")?{shortcut:n.getNamedShortcut(h.shortcut,c.options)}:void 0;this.updateDecorated(p,{...h,name:c.name,...m}),u[p]=c[p].bind(c),h.active&&(f[p]=()=>{var b;return((b=h.active)==null?void 0:b.call(h,c.options,this.store))??!1})}hp(u)||this.addCommands({active:f,names:i,commands:o,extensionCommands:u})}const l=a();for(const[c,u]of Object.entries(l))a[c]=u;this.store.setStoreKey("commands",o),this.store.setStoreKey("chain",a),this.store.setExtensionStore("commands",o),this.store.setExtensionStore("chain",a)}onStateUpdate({state:e}){this._transaction=e.tr}createPlugin(){return{}}customDispatch(e){return e}insertText(e,t={}){return ne(e)?PL(e,t):this.store.createPlaceholderCommand({promise:e,placeholder:{type:"inline"},onSuccess:(r,n,o)=>this.insertText(r,{...t,...n})(o)}).generateCommand()}selectText(e,t={}){return({tr:r,dispatch:n})=>{const o=jr(e,r.doc);return r.selection.anchor===o.anchor&&r.selection.head===o.head&&!t.forceUpdate?!1:(n==null||n(r.setSelection(o)),!0)}}selectMark(e){return t=>{const{tr:r}=t,n=_o(r.selection.$from,e);return n?this.store.commands.selectText.original({from:n.from,to:n.to})(t):!1}}delete(e){return({tr:t,dispatch:r})=>{const{from:n,to:o}=e??t.selection;return r==null||r(t.delete(n,o)),!0}}emptyUpdate(e){return({tr:t,dispatch:r})=>(r&&(e==null||e(),r(t)),!0)}forceUpdate(...e){return({tr:t,dispatch:r})=>(r==null||r(this.forceUpdateTransaction(t,...e)),!0)}updateNodeAttributes(e,t){return({tr:r,dispatch:n})=>(n==null||n(r.setNodeMarkup(e,void 0,t)),!0)}setContent(e,t){return r=>{const{tr:n,dispatch:o}=r,i=this.store.manager.createState({content:e,selection:t});return i?(o==null||o(n.replaceRangeWith(0,n.doc.nodeSize-2,i.doc)),!0):!1}}resetContent(){return e=>{const{tr:t,dispatch:r}=e,n=this.store.manager.createEmptyDoc();return n?this.setContent(n)(e):(r==null||r(t.delete(0,t.doc.nodeSize)),!0)}}emptySelection(){return({tr:e,dispatch:t})=>e.selection.empty?!1:(t==null||t(e.setSelection(le.near(e.selection.$anchor))),!0)}insertNewLine(){return({dispatch:e,tr:t})=>gs(t.selection)?(e==null||e(t.insertText(` -`)),!0):!1}insertNode(e,t={}){return({dispatch:r,tr:n,state:o})=>{var i;const{attrs:s,range:a,selection:l,replaceEmptyParentBlock:c=!1}=t,{from:u,to:d,$from:f}=jr(l??a??n.selection,n.doc);if(Ld(e)||iz(e)){const v=f.before(f.depth);return r==null||r(c&&u===d&&Dh(f.parent)?n.replaceWith(v,v+f.parent.nodeSize,e):n.replaceWith(u,d,e)),!0}const p=ne(e)?o.schema.nodes[e]:e;te(p,{code:H.SCHEMA,message:`The requested node type ${e} does not exist in the schema.`});const h=(i=t.marks)==null?void 0:i.map(v=>{if(v instanceof Te)return v;const g=ne(v)?o.schema.marks[v]:v;return te(g,{code:H.SCHEMA,message:`The requested mark type ${v} does not exist in the schema.`}),g.create()}),m=p.createAndFill(s,ne(t.content)?o.schema.text(t.content):t.content,h);if(!m)return!1;const b=u!==d;return r==null||r(b?n.replaceRangeWith(u,d,m):n.insert(u,m)),!0}}focus(e){return t=>{const{dispatch:r,tr:n}=t,{view:o}=this.store;if(e===!1||o.hasFocus()&&(e===void 0||e===!0))return!1;if(e===void 0||e===!0){const{from:i=0,to:s=i}=n.selection;e={from:i,to:s}}return r&&this.delayedFocus(),this.selectText(e)(t)}}blur(e){return t=>{const{view:r}=this.store;return r.hasFocus()?(requestAnimationFrame(()=>{r.dom.blur()}),e?this.selectText(e)(t):!0):!1}}setBlockNodeType(e,t,r,n=!0){return Bu(e,t,r,n)}toggleWrappingNode(e,t,r){return P5(e,t,r)}toggleBlockNodeItem(e){return Wv(e)}wrapInNode(e,t,r){return R5(e,t,r)}applyMark(e,t,r){return RL(e,t,r)}toggleMark(e){return ns(e)}removeMark(e){return L5(e)}setMeta(e,t){return({tr:r})=>(r.setMeta(e,t),!0)}selectAll(){return this.selectText("all")}copy(){return e=>e.tr.selection.empty?!1:(e.dispatch&&document.execCommand("copy"),!0)}paste(){return this.store.createPlaceholderCommand({promise:async()=>{var e;return(e=navigator.clipboard)!=null&&e.readText?await navigator.clipboard.readText():""},placeholder:{type:"inline"},onSuccess:(e,t,r)=>this.insertNode(B1({content:e,schema:r.state.schema}),{selection:t})(r)}).generateCommand()}cut(){return e=>e.tr.selection.empty?!1:(e.dispatch&&document.execCommand("cut"),!0)}replaceText(e){return Az(e)}getAllCommandOptions(){const e={};for(const[t,r]of this.decorated)hp(r)||(e[t]=r);return e}getCommandOptions(e){return this.decorated.get(e)}getCommandProp(){return{tr:this.transaction,dispatch:this.store.view.dispatch,state:this.store.view.state,view:this.store.view}}updateDecorated(e,t){if(!t){this.decorated.delete(e);return}const r=this.decorated.get(e)??{name:""};this.decorated.set(e,{...r,...t})}handleIosFocus(){nn.isIos&&this.store.view.dom.focus()}delayedFocus(){this.handleIosFocus(),requestAnimationFrame(()=>{this.store.view.focus(),this.store.view.dispatch(this.transaction.scrollIntoView())})}getForcedUpdates(e){return this.getCommandMeta(e).forcedUpdates}getCommandMeta(e){const t=e.getMeta(this.pluginKey)??{};return{...zL,...t}}setCommandMeta(e,t){const r=this.getCommandMeta(e);e.setMeta(this.pluginKey,{...r,...t})}addCommands(e){const{extensionCommands:t,commands:r,names:n,active:o}=e;for(const[i,s]of At(t))q5({name:i,set:n,code:H.DUPLICATE_COMMAND_NAMES}),te(!LL.has(i),{code:H.DUPLICATE_COMMAND_NAMES,message:"The command name you chose is forbidden."}),r[i]=this.createUnchainedCommand(s,o[i])}unchainedFactory(e){return(...t)=>{const{shouldDispatch:r=!0,command:n}=e,{view:o}=this.store,{state:i}=o;let s;return r&&(s=o.dispatch),n(...t)({state:i,dispatch:s,view:o,tr:i.tr})}}createUnchainedCommand(e,t){const r=this.unchainedFactory({command:e});return r.enabled=this.unchainedFactory({command:e,shouldDispatch:!1}),r.isEnabled=r.enabled,r.original=e,r.active=t,r}chainedFactory(e){return(...t)=>{const{chain:r,command:n,getTr:o,getChain:i}=e,s=i(),{view:a}=this.store,{state:l}=a;return s.push(c=>n(...t)({state:l,dispatch:c,view:a,tr:o()})),r}}};Z([U()],xe.prototype,"customDispatch",1);Z([U()],xe.prototype,"insertText",1);Z([U()],xe.prototype,"selectText",1);Z([U()],xe.prototype,"selectMark",1);Z([U()],xe.prototype,"delete",1);Z([U()],xe.prototype,"emptyUpdate",1);Z([U()],xe.prototype,"forceUpdate",1);Z([U()],xe.prototype,"updateNodeAttributes",1);Z([U()],xe.prototype,"setContent",1);Z([U()],xe.prototype,"resetContent",1);Z([U()],xe.prototype,"emptySelection",1);Z([U()],xe.prototype,"insertNewLine",1);Z([U()],xe.prototype,"insertNode",1);Z([U()],xe.prototype,"focus",1);Z([U()],xe.prototype,"blur",1);Z([U()],xe.prototype,"setBlockNodeType",1);Z([U()],xe.prototype,"toggleWrappingNode",1);Z([U()],xe.prototype,"toggleBlockNodeItem",1);Z([U()],xe.prototype,"wrapInNode",1);Z([U()],xe.prototype,"applyMark",1);Z([U()],xe.prototype,"toggleMark",1);Z([U()],xe.prototype,"removeMark",1);Z([U()],xe.prototype,"setMeta",1);Z([U({description:({t:e})=>e(es.SELECT_ALL_DESCRIPTION),label:({t:e})=>e(es.SELECT_ALL_LABEL),shortcut:D.SelectAll})],xe.prototype,"selectAll",1);Z([U({description:({t:e})=>e(es.COPY_DESCRIPTION),label:({t:e})=>e(es.COPY_LABEL),shortcut:D.Copy,icon:"fileCopyLine"})],xe.prototype,"copy",1);Z([U({description:({t:e})=>e(es.PASTE_DESCRIPTION),label:({t:e})=>e(es.PASTE_LABEL),shortcut:D.Paste,icon:"clipboardLine"})],xe.prototype,"paste",1);Z([U({description:({t:e})=>e(es.CUT_DESCRIPTION),label:({t:e})=>e(es.CUT_LABEL),shortcut:D.Cut,icon:"scissorsFill"})],xe.prototype,"cut",1);Z([U()],xe.prototype,"replaceText",1);Z([He()],xe.prototype,"getAllCommandOptions",1);Z([He()],xe.prototype,"getCommandOptions",1);Z([He()],xe.prototype,"getCommandProp",1);xe=Z([me({defaultPriority:Ae.Highest,defaultOptions:{trackerClassName:"remirror-tracker-position",trackerNodeName:"span"},staticKeys:["trackerClassName","trackerNodeName"]})],xe);var zL={forcedUpdates:[]},LL=new Set(["run","chain","original","raw","enabled","tr","new"]),io=class extends Ve{constructor(){super(...arguments),this.placeholders=Ee.empty,this.placeholderWidgets=new Map,this.createPlaceholderCommand=e=>{const t=Cl(),{promise:r,placeholder:n,onFailure:o,onSuccess:i}=e;return new AL(r).validate(s=>this.addPlaceholder(t,n)(s)).success(s=>{const{state:a,tr:l,dispatch:c,view:u,value:d}=s,f=this.store.helpers.findPlaceholder(t);if(!f){const p=new Error("The placeholder has been removed");return(o==null?void 0:o({error:p,state:a,tr:l,dispatch:c,view:u}))??!1}return this.removePlaceholder(t)({state:a,tr:l,view:u,dispatch:()=>{}}),i(d,f,{state:a,tr:l,dispatch:c,view:u})}).failure(s=>(this.removePlaceholder(t)({...s,dispatch:()=>{}}),(o==null?void 0:o(s))??!1))}}get name(){return"decorations"}onCreate(){this.store.setExtensionStore("createPlaceholderCommand",this.createPlaceholderCommand)}createPlugin(){return{state:{init:()=>{},apply:e=>{var t,r,n,o,i,s;const{added:a,clearTrackers:l,removed:c,updated:u}=this.getMeta(e);if(l){this.placeholders=Ee.empty;for(const[,d]of this.placeholderWidgets)(r=(t=d.spec).onDestroy)==null||r.call(t,this.store.view,d.spec.element);this.placeholderWidgets.clear();return}this.placeholders=this.placeholders.map(e.mapping,e.doc,{onRemove:d=>{var f,p;const h=this.placeholderWidgets.get(d.id);h&&((p=(f=h.spec).onDestroy)==null||p.call(f,this.store.view,h.spec.element))}});for(const[,d]of this.placeholderWidgets)(o=(n=d.spec).onUpdate)==null||o.call(n,this.store.view,d.from,d.spec.element,d.spec.data);for(const d of a){if(d.type==="inline"){this.addInlinePlaceholder(d,e);continue}if(d.type==="node"){this.addNodePlaceholder(d,e);continue}if(d.type==="widget"){this.addWidgetPlaceholder(d,e);continue}}for(const{id:d,data:f}of u){const p=this.placeholderWidgets.get(d);if(!p)continue;const h=Ge.widget(p.from,p.spec.element,{...p.spec,data:f});this.placeholders=this.placeholders.remove([p]).add(e.doc,[h]),this.placeholderWidgets.set(d,h)}for(const d of c){const f=this.placeholders.find(void 0,void 0,h=>h.id===d&&h.__type===Na),p=this.placeholderWidgets.get(d);p&&((s=(i=p.spec).onDestroy)==null||s.call(i,this.store.view,p.spec.element)),this.placeholders=this.placeholders.remove(f),this.placeholderWidgets.delete(d)}}},props:{decorations:e=>{let t=this.options.decorations(e);t=t.add(e.doc,this.placeholders.find());for(const r of this.store.extensions){if(!r.createDecorations)continue;const n=r.createDecorations(e).find();t=t.add(e.doc,n)}return t},handleDOMEvents:{blur:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(d2,!1)),!1),focus:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(d2,!0)),!1)}}}}updateDecorations(){return({tr:e,dispatch:t})=>(t==null||t(e),!0)}addPlaceholder(e,t,r){return({dispatch:n,tr:o})=>this.addPlaceholderTransaction(e,t,o,!n)?(n==null||n(r?o.deleteSelection():o),!0):!1}updatePlaceholder(e,t){return({dispatch:r,tr:n})=>this.updatePlaceholderTransaction({id:e,data:t,tr:n,checkOnly:!r})?(r==null||r(n),!0):!1}removePlaceholder(e){return({dispatch:t,tr:r})=>this.removePlaceholderTransaction({id:e,tr:r,checkOnly:!t})?(t==null||t(r),!0):!1}clearPlaceholders(){return({tr:e,dispatch:t})=>this.clearPlaceholdersTransaction({tr:e,checkOnly:!t})?(t==null||t(e),!0):!1}findPlaceholder(e){return this.findAllPlaceholders().get(e)}findAllPlaceholders(){const e=new Map,t=this.placeholders.find(void 0,void 0,r=>r.__type===Na);for(const r of t)e.set(r.spec.id,{from:r.from,to:r.to});return e}createDecorations(e){var t,r,n;const{persistentSelectionClass:o}=this.options;return!o||(t=this.store.view)!=null&&t.hasFocus()||(n=(r=this.store.helpers).isInteracting)!=null&&n.call(r)?Ee.empty:DL(e,Ee.empty,{class:ne(o)?o:"selection"})}onApplyState(){}addWidgetPlaceholder(e,t){const{pos:r,createElement:n,onDestroy:o,onUpdate:i,className:s,nodeName:a,id:l,type:c}=e,u=(n==null?void 0:n(this.store.view,r))??document.createElement(a);u.classList.add(s);const d=Ge.widget(r,u,{id:l,__type:Na,type:c,element:u,onDestroy:o,onUpdate:i});this.placeholderWidgets.set(l,d),this.placeholders=this.placeholders.add(t.doc,[d])}addInlinePlaceholder(e,t){const{from:r=t.selection.from,to:n=t.selection.to,className:o,nodeName:i,id:s,type:a}=e;let l;if(r===n){const c=document.createElement(i);c.classList.add(o),l=Ge.widget(r,c,{id:s,type:a,__type:Na,widget:c})}else l=Ge.inline(r,n,{nodeName:i,class:o},{id:s,__type:Na});this.placeholders=this.placeholders.add(t.doc,[l])}addNodePlaceholder(e,t){const{pos:r,className:n,nodeName:o,id:i}=e,s=Jt(r)?t.doc.resolve(r):t.selection.$from,a=Jt(r)?s.nodeAfter?{pos:r,end:s.nodeAfter.nodeSize}:void 0:Y6(s);if(!a)return;const l=Ge.node(a.pos,a.end,{nodeName:o,class:n},{id:i,__type:Na});this.placeholders=this.placeholders.add(t.doc,[l])}withRequiredBase(e,t){const{placeholderNodeName:r,placeholderClassName:n}=this.options,{nodeName:o=r,className:i,...s}=t,a=(i?[n,i]:[n]).join(" ");return{nodeName:o,className:a,...s,id:e}}getMeta(e){const t=e.getMeta(this.pluginKey)??{};return{...IL,...t}}setMeta(e,t){const r=this.getMeta(e);e.setMeta(this.pluginKey,{...r,...t})}addPlaceholderTransaction(e,t,r,n=!1){if(this.findPlaceholder(e))return!1;if(n)return!0;const{added:i}=this.getMeta(r);return this.setMeta(r,{added:[...i,this.withRequiredBase(e,t)]}),!0}updatePlaceholderTransaction(e){const{id:t,tr:r,checkOnly:n=!1,data:o}=e;if(!this.findPlaceholder(t))return!1;if(n)return!0;const{updated:s}=this.getMeta(r);return this.setMeta(r,{updated:Ml([...s,{id:t,data:o}])}),!0}removePlaceholderTransaction(e){const{id:t,tr:r,checkOnly:n=!1}=e;if(!this.findPlaceholder(t))return!1;if(n)return!0;const{removed:i}=this.getMeta(r);return this.setMeta(r,{removed:Ml([...i,t])}),!0}clearPlaceholdersTransaction(e){const{tr:t,checkOnly:r=!1}=e;return this.getPluginState()===Ee.empty?!1:(r||this.setMeta(t,{clearTrackers:!0}),!0)}};Z([U()],io.prototype,"updateDecorations",1);Z([U()],io.prototype,"addPlaceholder",1);Z([U()],io.prototype,"updatePlaceholder",1);Z([U()],io.prototype,"removePlaceholder",1);Z([U()],io.prototype,"clearPlaceholders",1);Z([He()],io.prototype,"findPlaceholder",1);Z([He()],io.prototype,"findAllPlaceholders",1);io=Z([me({defaultOptions:{persistentSelectionClass:void 0,placeholderClassName:"placeholder",placeholderNodeName:"span"},staticKeys:["placeholderClassName","placeholderNodeName"],handlerKeys:["decorations"],handlerKeyOptions:{decorations:{reducer:{accumulator:(e,t,r)=>e.add(r.doc,t.find()),getDefault:()=>Ee.empty}}},defaultPriority:Ae.Low})],io);var IL={added:[],updated:[],clearTrackers:!1,removed:[]},Na="placeholderDecoration",d2="persistentSelectionFocus";function DL(e,t,r){const{selection:n,doc:o}=e;if(n.empty)return t;const{from:i,to:s}=n,a=Id(n)?Ge.node(i,s,r):Ge.inline(i,s,r);return t.add(o,[a])}var V1=class extends Ve{get name(){return"docChanged"}onStateUpdate(e){const{firstUpdate:t,transactions:r,tr:n}=e;t||(r??[n]).some(o=>o==null?void 0:o.docChanged)&&this.options.docChanged(e)}};V1=Z([me({handlerKeys:["docChanged"],handlerKeyOptions:{docChanged:{earlyReturnValue:!1}},defaultPriority:Ae.Lowest})],V1);var An=class extends Ve{get name(){return"helpers"}onCreate(){var e;this.store.setStringHandler("text",this.textToProsemirrorNode.bind(this)),this.store.setStringHandler("html",B1);const t=ee(),r=ee(),n=ee(),o=new Set;for(const i of this.store.extensions){$d(i)&&(r[i.name]=a=>b5({state:this.store.getState(),type:i.type,attrs:a}),n[i.name]=a=>{var l;return(l=Hu({state:this.store.getState(),type:i.type,attrs:a}))==null?void 0:l.node.attrs}),Vh(i)&&(r[i.name]=a=>Ap({trState:this.store.getState(),type:i.type,attrs:a}),n[i.name]=a=>{const l=_o(this.store.getState().selection.$from,i.type);if(!l||!a)return l==null?void 0:l.mark.attrs;if(Fv(l.mark,a))return l.mark.attrs});const s=((e=i.createHelpers)==null?void 0:e.call(i))??{};for(const a of Object.keys(i.decoratedHelpers??{}))s[a]=i[a].bind(i);if(!hp(s))for(const[a,l]of At(s))q5({name:a,set:o,code:H.DUPLICATE_HELPER_NAMES}),t[a]=l}this.store.setStoreKey("attrs",n),this.store.setStoreKey("active",r),this.store.setStoreKey("helpers",t),this.store.setExtensionStore("attrs",n),this.store.setExtensionStore("active",r),this.store.setExtensionStore("helpers",t)}isSelectionEmpty(e=this.store.getState()){return Bv(e)}isViewEditable(e=this.store.getState()){var t,r;return((r=(t=this.store.view.props).editable)==null?void 0:r.call(t,e))??!1}getStateJSON(e=this.store.getState()){return e.toJSON()}getJSON(e=this.store.getState()){return e.doc.toJSON()}getRemirrorJSON(e=this.store.getState()){return this.getJSON(e)}insertHtml(e,t){return r=>{const{state:n}=r,o=B1({content:e,schema:n.schema,fragment:!0});return this.store.commands.insertNode.original(o,t)(r)}}getText({lineBreakDivider:e=` +If you are using Node.js, you can install JSDOM and Remirror will try to use it automatically, or you can create a fake document and pass it to Remirror`)}function NC(e){var t;return(e==null?void 0:e.defaultView)??(typeof window<"u"?window:void 0)??((t=NE())==null?void 0:t.defaultView)}function RC(e){return NC(e==null?void 0:e.ownerDocument)}function PC(e){const t=NC(e)??Fh().defaultView;if(t)return t;throw new Error("Unable to retrieve the window from the global scope")}function zC(e){return PC(e==null?void 0:e.ownerDocument)}function Tz(e,t=Fh()){const r=Ez(e,e.type.schema)?e.content:R.from(e);return an.fromSchema(e.type.schema).serializeFragment(r,{document:t})}function Oz(e,t){return new(PC(t)).DOMParser().parseFromString(`${e}`,"text/html").body}function _z(e,t=Fh()){const r=t.createElement("div");return r.append(Tz(e,t)),r.innerHTML}function j1(e){const{content:t,schema:r,document:n,fragment:o=!1,...i}=e,s=Oz(t,n),a=Cv.fromSchema(r);return o?a.parseSlice(s,{...c2,...i}).content:a.parse(s,{...c2,...i})}var c2={preserveWhitespace:!1};function $d(e,t){const r=Lu(t.defaults());return wv({...e},r)}function qv(e,t){let r="";t&&(r=`${t.trim()}`);const n=xN(e);if(!n)return r;const o=(r.endsWith(";")," ");return`${r}${o}${n}`}var Az={remove(e,t){let r=e;for(const n of t)n.invalidParentNode||(r=hA(n.path,r));return r}};function Nz({json:e,schema:t,...r}){const n=new Set(Lu(t.marks)),o=new Set(Lu(t.nodes)),i=LC({json:e,path:[],validNodes:o,validMarks:n});return{json:e,invalidContent:i,transformers:Az,...r}}function LC(e){const{json:t,validMarks:r,validNodes:n,path:o=[]}=e,i={validMarks:r,validNodes:n},s=[],{type:a,marks:l,content:c}=t;let{invalidParentMark:u=!1,invalidParentNode:d=!1}=e;if(l){const f=[];for(const[p,h]of l.entries()){const m=ne(h)?h:h.type;r.has(m)||(f.unshift({name:m,path:[...o,"marks",`${p}`],type:"mark",invalidParentMark:u,invalidParentNode:d}),u=!0)}s.push(...f)}if(n.has(a)||(s.push({name:a,type:"node",path:o,invalidParentMark:u,invalidParentNode:d}),d=!0),c){const f=[];for(const[p,h]of c.entries())f.unshift(...LC({...i,json:h,path:[...o,"content",`${p}`],invalidParentMark:u,invalidParentNode:d}));s.unshift(...f)}return s}function Rz(e){return!!(gs(e)&&e.$cursor&&e.$cursor.parentOffset>=e.$cursor.parent.content.size)}function U1(e){return!!(gs(e)&&e.$cursor&&e.$cursor.parentOffset<=0)}function u2(e){const t=be.atStart(e.$anchor.doc);return!!(U1(e)&&t.anchor===e.anchor)}function Pz(e){return({dispatch:t,tr:r})=>{const{type:n,attrs:o=ee(),appendText:i,range:s}=e,a=s?le.between(r.doc.resolve(s.from),r.doc.resolve(s.to)):r.selection,{$from:l,from:c,to:u}=a;let d=l.depth===0?r.doc.type.allowsMarkType(n):!1;return r.doc.nodesBetween(c,u,f=>{if(d)return!1;if(f.inlineContent&&f.type.allowsMarkType(n)){d=!0;return}}),d?(t==null||t(r.addMark(c,u,n.create(o))&&i?r.insertText(i):r),!0):!1}}function zz({tr:e,dispatch:t}){const{$from:r,$to:n}=e.selection,o=r.blockRange(n),i=o&&rc(o);return!Jt(i)||!o?!1:(t==null||t(e.lift(o,i).scrollIntoView()),!0)}function IC(e,t={},r){return function(n){const{tr:o,dispatch:i,state:s}=n,a=ne(e)?it(s.schema.nodes,e):e,{from:l,to:c}=jr(r??o.selection,o.doc),u=o.doc.resolve(l),d=o.doc.resolve(c),f=u.blockRange(d),p=f&&Tv(f,a,t);return!p||!f?!1:(i==null||i(o.wrap(f,p).scrollIntoView()),!0)}}function DC(e,t={},r){return n=>{const{tr:o,state:i}=n,s=ne(e)?it(i.schema.nodes,e):e;return Bu({state:o,type:s,attrs:t})?zz(n):IC(e,t,r)(n)}}function Fu(e,t,r,n=!0){return function(o){const{tr:i,dispatch:s,state:a}=o,l=ne(e)?it(a.schema.nodes,e):e,{from:c,to:u}=jr(r??i.selection,i.doc);let d=!1,f;return i.doc.nodesBetween(c,u,(p,h)=>{if(d)return!1;if(!p.isTextblock||p.hasMarkup(l,t))return;if(p.type===l){d=!0,f=p.attrs;return}const m=i.doc.resolve(h),b=m.index();d=m.parent.canReplaceWith(b,b+1,l),d&&(f=m.parent.attrs)}),d?(s==null||s(i.setBlockType(c,u,l,{...n?f:{},...t}).scrollIntoView()),!0):!1}}function Gv(e){return t=>{const{tr:r,state:n}=t,{type:o,attrs:i,preserveAttrs:s=!0}=e,a=Bu({state:r,type:o,attrs:i}),l=e.toggleType??Hh(n.schema);if(a)return Fu(l,{...s?a.node.attrs:{},...i})(t);const c=Bu({state:r,type:l,attrs:i});return Fu(o,{...s?c==null?void 0:c.node.attrs:{},...i})(t)}}function Lz(e=0){const t=navigator.userAgent.match(/Chrom(e|ium)\/(\d+)\./);return t?Number.parseInt(it(t,2),10)>=e:!1}function Iz(e,t){let{head:r,empty:n,anchor:o}=e;for(const i of t.steps)r=i.getMap().map(r);n?t.setSelection(le.near(t.doc.resolve(r))):t.setSelection(le.between(t.doc.resolve(o),t.doc.resolve(r)))}function Dz(e){const{attrs:t={},appendText:r="",content:n="",keepSelection:o=!1,range:i}=e;return({state:s,tr:a,dispatch:l})=>{var c;const u=s.schema,d=jr(e.selection??i??a.selection,a.doc),f=d.$from.index(),{from:p,to:h,$from:m}=d,b=ne(e.type)?u.nodes[e.type]??u.marks[e.type]:e.type;if(te(ne(e.type)?b:!0,{code:H.SCHEMA,message:`Schema contains no marks or nodes with name ${b}`}),cz(b)){if(!m.parent.canReplaceWith(f,f,b))return!1;a.replaceWith(p,h,b.create(t,n?u.text(n):void 0))}else te(n,{message:"`replaceText` cannot be called without content when using a mark type"}),a.replaceWith(p,h,u.text(n,EC(b)?[b.create(t)]:void 0));return r&&a.insertText(r),o&&Iz(s.selection,a),l&&(Lz(60)&&((c=document.getSelection())==null||c.empty()),l(a)),!0}}function $C(e,t){const r=e.parent.childAfter(e.parentOffset);if(!r.node)return;const{marks:n,nodeSize:o}=r.node;if(n[0])return n[0].type;const s=e.start()+r.offset+o;return $C(e.doc.resolve(s+1))}function HC(e){return({dispatch:t,tr:r,state:n})=>{const{type:o,expand:i=!0,range:s}=e,a=jr(e.selection??s??r.selection,r.doc);let{from:l,to:c,$from:u,$to:d}=a;const f=ne(o)?n.schema.marks[o]:o;f!==null&&te(f,{code:H.SCHEMA,message:`Mark type: ${o} does not exist on the current schema.`});const p=f??$C(u);if(!p)return!1;const h=_o(u,p,d);return i&&h&&(l=Math.max(0,Math.min(l,h.from)),c=Math.min(Math.max(c,h.to),r.doc.nodeSize-2)),t==null||t(r.removeMark(l,Jt(c)?c:l,EC(f)?f:void 0)),!0}}function $z(e){const t=["command","cmd","meta"];return on.isMac&&t.push("mod"),t.includes(e)}function Hz(e){const t=["control","ctrl"];return on.isMac||t.push("mod"),t.includes(e)}function Bz(e){const t=[];for(let r of e.split("-")){if(r=r.toLowerCase(),$z(r)){t.push({type:"modifier",symbol:"⌘",key:"command",i18n:Mt.COMMAND_KEY});continue}if(Hz(r)){t.push({type:"modifier",symbol:"⌃",key:"control",i18n:Mt.CONTROL_KEY});continue}switch(r){case"shift":t.push({type:"modifier",symbol:"⇧",key:r,i18n:Mt.SHIFT_KEY});continue;case"alt":t.push({type:"modifier",symbol:"⌥",key:r,i18n:Mt.ALT_KEY});continue;case` +`:case"\r":case"enter":t.push({type:"named",symbol:"↵",key:r,i18n:Mt.ENTER_KEY});continue;case"backspace":t.push({type:"named",symbol:"⌫",key:r,i18n:Mt.BACKSPACE_KEY});continue;case"delete":t.push({type:"named",symbol:"⌦",key:r,i18n:Mt.DELETE_KEY});continue;case"escape":t.push({type:"named",symbol:"␛",key:r,i18n:Mt.ESCAPE_KEY});continue;case"tab":t.push({type:"named",symbol:"⇥",key:r,i18n:Mt.TAB_KEY});continue;case"capslock":t.push({type:"named",symbol:"⇪",key:r,i18n:Mt.CAPS_LOCK_KEY});continue;case"space":t.push({type:"named",symbol:"␣",key:r,i18n:Mt.SPACE_KEY});continue;case"pageup":t.push({type:"named",symbol:"⤒",key:r,i18n:Mt.PAGE_UP_KEY});continue;case"pagedown":t.push({type:"named",symbol:"⤓",key:r,i18n:Mt.PAGE_DOWN_KEY});continue;case"home":t.push({type:"named",key:r,i18n:Mt.HOME_KEY});continue;case"end":t.push({type:"named",key:r,i18n:Mt.END_KEY});continue;case"arrowleft":t.push({type:"named",symbol:"←",key:r,i18n:Mt.ARROW_LEFT_KEY});continue;case"arrowright":t.push({type:"named",symbol:"→",key:r,i18n:Mt.ARROW_RIGHT_KEY});continue;case"arrowup":t.push({type:"named",symbol:"→",key:r,i18n:Mt.ARROW_UP_KEY});continue;case"arrowdown":t.push({type:"named",symbol:"↓",key:r,i18n:Mt.ARROW_DOWN_KEY});continue;default:t.push({type:"char",key:r});continue}}return t}function Fz(e){const{node:t,predicate:r,descend:n=!0,action:o}=e;te(Id(t),{code:H.INTERNAL,message:'Invalid "node" parameter passed to "findChildren".'}),te(_e(r),{code:H.INTERNAL,message:'Invalid "predicate" parameter passed to "findChildren".'});const i=[];return t.descendants((s,a)=>{const l={node:s,pos:a};return r(l)&&(i.push(l),o==null||o(l)),n}),i}function Vz(e){const{type:t,...r}=e;return Fz({...r,predicate:n=>n.node.type===t})}function jz(e,t={}){const{descend:r=!1,predicate:n,StepTypes:o}=t,i=xz(e,o),s=[];for(const a of i){const{start:l,end:c}=a;e.doc.nodesBetween(l,c,(u,d)=>(((n==null?void 0:n(u,d,a))??!0)&&s.push({node:u,pos:d}),r))}return s}function Vu(e){const{regexp:t,type:r,getAttributes:n,ignoreWhitespace:o=!1,beforeDispatch:i,updateCaptured:s,shouldSkip:a,invalidMarks:l}=e;let c;const u=new wa(t,(d,f,p,h)=>{const{tr:m,schema:b}=d;c||(c=ne(r)?b.marks[r]:r,te(c,{code:H.SCHEMA,message:`Mark type: ${r} does not exist on the current schema.`}));let v=f[1],g=f[0];const y=FC({captureGroup:v,fullMatch:g,end:h,start:p,rule:u,state:d,ignoreWhitespace:o,invalidMarks:l,shouldSkip:a,updateCaptured:s});if(!y)return null;({start:p,end:h,captureGroup:v,fullMatch:g}=y);const x=_e(n)?n(f):n;let k=h,w=[];if(v){const E=g.search(/\S/),T=p+g.indexOf(v),C=T+v.length;w=m.storedMarks??[],Cp&&m.delete(p+E,T),k=p+E+v.length}return m.addMark(p,k,c.create(x)),m.setStoredMarks(w),i==null||i({tr:m,match:f,start:p,end:h}),m});return u}function BC(e){const{regexp:t,type:r,getAttributes:n,beforeDispatch:o,shouldSkip:i,ignoreWhitespace:s=!1,updateCaptured:a,invalidMarks:l}=e,c=new wa(t,(u,d,f,p)=>{const h=_e(n)?n(d):n,{tr:m,schema:b}=u,v=ne(r)?b.nodes[r]:r;let g=d[1],y=d[0];const x=FC({captureGroup:g,fullMatch:y,end:p,start:f,rule:c,state:u,ignoreWhitespace:s,invalidMarks:l,shouldSkip:i,updateCaptured:a});if(!x)return null;({start:f,end:p,captureGroup:g,fullMatch:y}=x),te(v,{code:H.SCHEMA,message:`No node exists for ${r} in the schema.`});const k=v.createAndFill(h);return k&&(m.replaceRangeWith(v.isBlock?m.doc.resolve(f).before():f,p,k),o==null||o({tr:m,match:[y,g??""],start:f,end:p})),m});return c}function FC({captureGroup:e,fullMatch:t,end:r,start:n,rule:o,ignoreWhitespace:i,shouldSkip:s,updateCaptured:a,state:l,invalidMarks:c}){var u;if(t==null)return null;const d=(a==null?void 0:a({captureGroup:e,fullMatch:t,start:n,end:r}))??{};e=d.captureGroup??e,t=d.fullMatch??t,n=d.start??n,r=d.end??r;const f=l.doc.resolve(n),p=l.doc.resolve(r);return c&&F1({$from:f,$to:p},c)||o.invalidMarks&&F1({$from:f,$to:p},o.invalidMarks)||i&&(e==null?void 0:e.trim())===""||s!=null&&s({state:l,captureGroup:e,fullMatch:t,start:n,end:r,ruleType:"mark"})||(u=o.shouldSkip)!=null&&u.call(o,{state:l,captureGroup:e,fullMatch:t,start:n,end:r,ruleType:"mark"})?null:{captureGroup:e,end:r,fullMatch:t,start:n}}var Uz=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),r={},n=[];t.forEach(i=>{(i?i.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,l]=a.split("_");r[l]=a}else n.push(a)})});const o=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&o.push(r[i]);return o.push(...n),o.join(" ")},Wz=Uz;const VC=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Kz(e,t){let{$cursor:r}=e.selection;return!r||(t?!t.endOfTextblock("backward",e):r.parentOffset>0)?null:r}const jC=(e,t,r)=>{let n=Kz(e,r);if(!n)return!1;let o=UC(n);if(!o){let s=n.blockRange(),a=s&&rc(s);return a==null?!1:(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&qC(e,o,t))return!0;if(n.parent.content.size==0&&(zl(i,"end")||ce.isSelectable(i))){let s=Ov(e.doc,n.before(),n.after(),K.empty);if(s&&s.slice.size{let{$head:n,empty:o}=e.selection,i=n;if(!o)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("backward",e):n.parentOffset>0)return!1;i=UC(n)}let s=i&&i.nodeBefore;return!s||!ce.isSelectable(s)?!1:(t&&t(e.tr.setSelection(ce.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function UC(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Gz(e,t){let{$cursor:r}=e.selection;return!r||(t?!t.endOfTextblock("forward",e):r.parentOffset{let n=Gz(e,r);if(!n)return!1;let o=WC(n);if(!o)return!1;let i=o.nodeAfter;if(qC(e,o,t))return!0;if(n.parent.content.size==0&&(zl(i,"start")||ce.isSelectable(i))){let s=Ov(e.doc,n.before(),n.after(),K.empty);if(s&&s.slice.size{let{$head:n,empty:o}=e.selection,i=n;if(!o)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("forward",e):n.parentOffset=0;t--){let r=e.node(t);if(e.index(t)+1{let{$head:r,$anchor:n}=e.selection;return!r.parent.type.spec.code||!r.sameParent(n)?!1:(t&&t(e.tr.insertText(` +`).scrollIntoView()),!0)};function Yv(e){for(let t=0;t{let{$head:r,$anchor:n}=e.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;let o=r.node(-1),i=r.indexAfter(-1),s=Yv(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let a=r.after(),l=e.tr.replaceWith(a,a,s.createAndFill());l.setSelection(be.near(l.doc.resolve(a),1)),t(l.scrollIntoView())}return!0},Qz=(e,t)=>{let r=e.selection,{$from:n,$to:o}=r;if(r instanceof kr||n.parent.inlineContent||o.parent.inlineContent)return!1;let i=Yv(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let s=(!n.parentOffset&&o.index(){let{$cursor:r}=e.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let i=r.before();if(dl(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let n=r.blockRange(),o=n&&rc(n);return o==null?!1:(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)};function eL(e){return(t,r)=>{let{$from:n,$to:o}=t.selection;if(t.selection instanceof ce&&t.selection.node.isBlock)return!n.parentOffset||!dl(t.doc,n.pos)?!1:(r&&r(t.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(r){let i=o.parentOffset==o.parent.content.size,s=t.tr;(t.selection instanceof le||t.selection instanceof kr)&&s.deleteSelection();let a=n.depth==0?null:Yv(n.node(-1).contentMatchAt(n.indexAfter(-1))),l=e&&e(o.parent,i),c=l?[l]:i&&a?[{type:a}]:void 0,u=dl(s.doc,s.mapping.map(n.pos),1,c);if(!c&&!u&&dl(s.doc,s.mapping.map(n.pos),1,a?[{type:a}]:void 0)&&(a&&(c=[{type:a}]),u=!0),u&&(s.split(s.mapping.map(n.pos),1,c),!i&&!n.parentOffset&&n.parent.type!=a)){let d=s.mapping.map(n.before()),f=s.doc.resolve(d);a&&n.node(-1).canReplaceWith(f.index(),f.index()+1,a)&&s.setNodeMarkup(s.mapping.map(n.before()),a)}r(s.scrollIntoView())}return!0}}const tL=eL(),rL=(e,t)=>{let{$from:r,to:n}=e.selection,o,i=r.sharedDepth(n);return i==0?!1:(o=r.before(i),t&&t(e.tr.setSelection(ce.create(e.doc,o))),!0)},nL=(e,t)=>(t&&t(e.tr.setSelection(new kr(e.doc))),!0);function oL(e,t,r){let n=t.nodeBefore,o=t.nodeAfter,i=t.index();return!n||!o||!n.type.compatibleContent(o.type)?!1:!n.content.size&&t.parent.canReplace(i-1,i)?(r&&r(e.tr.delete(t.pos-n.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(i,i+1)||!(o.isTextblock||Rd(e.doc,t.pos))?!1:(r&&r(e.tr.clearIncompatible(t.pos,n.type,n.contentMatchAt(n.childCount)).join(t.pos).scrollIntoView()),!0)}function qC(e,t,r){let n=t.nodeBefore,o=t.nodeAfter,i,s;if(n.type.spec.isolating||o.type.spec.isolating)return!1;if(oL(e,t,r))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(i=(s=n.contentMatchAt(n.childCount)).findWrapping(o.type))&&s.matchType(i[0]||o.type).validEnd){if(r){let d=t.pos+o.nodeSize,f=R.empty;for(let m=i.length-1;m>=0;m--)f=R.from(i[m].create(null,f));f=R.from(n.copy(f));let p=e.tr.step(new bt(t.pos-1,d,t.pos,d,new K(f,1,0),i.length,!0)),h=d+2*i.length;Rd(p.doc,h)&&p.join(h),r(p.scrollIntoView())}return!0}let l=be.findFrom(t,1),c=l&&l.$from.blockRange(l.$to),u=c&&rc(c);if(u!=null&&u>=t.depth)return r&&r(e.tr.lift(c,u).scrollIntoView()),!0;if(a&&zl(o,"start",!0)&&zl(n,"end")){let d=n,f=[];for(;f.push(d),!d.isTextblock;)d=d.lastChild;let p=o,h=1;for(;!p.isTextblock;p=p.firstChild)h++;if(d.canReplace(d.childCount,d.childCount,p.content)){if(r){let m=R.empty;for(let v=f.length-1;v>=0;v--)m=R.from(f[v].copy(m));let b=e.tr.step(new bt(t.pos-f.length,t.pos+o.nodeSize,t.pos+h,t.pos+o.nodeSize-h,new K(m,f.length,0),0,!0));r(b.scrollIntoView())}return!0}}return!1}function GC(e){return function(t,r){let n=t.selection,o=e<0?n.$from:n.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(r&&r(t.tr.setSelection(le.create(t.doc,e<0?o.start(i):o.end(i)))),!0):!1}}const iL=GC(-1),sL=GC(1);function aL(e,t,r){for(let n=0;n{if(s)return!1;s=a.inlineContent&&a.type.allowsMarkType(r)}),s)return!0}return!1}function lL(e,t=null){return function(r,n){let{empty:o,$cursor:i,ranges:s}=r.selection;if(o&&!i||!aL(r.doc,s,e))return!1;if(n)if(i)e.isInSet(r.storedMarks||i.marks())?n(r.tr.removeStoredMark(e)):n(r.tr.addStoredMark(e.create(t)));else{let a=!1,l=r.tr;for(let c=0;!a&&c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},uL=typeof navigator<"u"&&/Mac/.test(navigator.platform),dL=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Yt=0;Yt<10;Yt++)rs[48+Yt]=rs[96+Yt]=String(Yt);for(var Yt=1;Yt<=24;Yt++)rs[Yt+111]="F"+Yt;for(var Yt=65;Yt<=90;Yt++)rs[Yt]=String.fromCharCode(Yt+32),Pp[Yt]=String.fromCharCode(Yt);for(var wg in rs)Pp.hasOwnProperty(wg)||(Pp[wg]=rs[wg]);function fL(e){var t=uL&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||dL&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",r=!t&&e.key||(e.shiftKey?Pp:rs)[e.keyCode]||e.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}const pL=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function hL(e){let t=e.split(/-(?!$)/),r=t[t.length-1];r=="Space"&&(r=" ");let n,o,i,s;for(let a=0;a127)&&(i=rs[n.keyCode])&&i!=o){let a=t[Sg(i,n)];if(a&&a(r.state,r.dispatch,r))return!0}}return!1}}function gL(e){const t=ra(e,(i,s)=>(s.priority??Ae.Low)-(i.priority??Ae.Low)),r=[],n=[];for(const i of t)SL(i)?r.push(i):n.push(i);let o;return new Ro({key:vL,view:i=>(o=i,{}),props:{transformPasted:i=>{var s,a,l;const c=o.state.selection.$from,u=c.node().type.name,d=new Set(c.marks().map(f=>f.type.name));for(const f of r){if((s=f.ignoredNodes)!=null&&s.includes(u)||(a=f.ignoredMarks)!=null&&a.some(g=>d.has(g)))continue;const p=((l=i.content.firstChild)==null?void 0:l.textContent)??"",h=!o.state.selection.empty&&i.content.childCount===1&&p,m=xa(p,f.regexp)[0];if(h&&m&&f.type==="mark"&&f.replaceSelection){const{from:g,to:y}=o.state.selection,x=o.state.doc.slice(g,y),k=x.content.textBetween(0,x.content.size);if(typeof f.replaceSelection!="boolean"?f.replaceSelection(k):f.replaceSelection){const w=[],{getAttributes:E,markType:T}=f,C=_e(E)?E(m,!0):E,M=T.create(C);return x.content.forEach(N=>{if(N.isText){const F=M.addToSet(N.marks);w.push(N.mark(F))}}),K.maxOpen(R.fromArray(w))}}const{nodes:b,transformed:v}=kL(i.content,f,o.state.schema);v&&(i=f.type==="node"&&f.nodeType.isBlock?new K(R.fromArray(b),0,0):new K(R.fromArray(b),i.openStart,i.openEnd))}return TL(i)},handleDOMEvents:{paste:(i,s)=>{var a,l;const c=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{clipboardData:u}=c;if(!u)return!1;const d=[...u.items].map(p=>p.getAsFile()).filter(p=>!!p);if(d.length===0)return!1;const{selection:f}=i.state;for(const{fileHandler:p,regexp:h}of n){const m=h?d.filter(b=>h.test(b.type)):d;if(m.length!==0&&p({event:c,files:m,selection:f,view:i,type:"paste"}))return c.preventDefault(),!0}return!1},drop:(i,s)=>{var a,l,c;const u=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{dataTransfer:d,clientX:f,clientY:p}=u;if(!d)return!1;const h=ML(u);if(h.length===0)return!1;const m=((c=i.posAtCoords({left:f,top:p}))==null?void 0:c.pos)??i.state.selection.anchor;for(const{fileHandler:b,regexp:v}of n){const g=v?h.filter(y=>v.test(y.type)):h;if(g.length!==0&&b({event:u,files:g,pos:m,view:i,type:"drop"}))return u.preventDefault(),!0}return!1}}}})}var vL=new ka("pasteRule");function Eg(e,t){return function r(n){const{fragment:o,rule:i,nodes:s}=n,{regexp:a,ignoreWhitespace:l,ignoredMarks:c,ignoredNodes:u}=i;let d=!1;return o.forEach(f=>{if(u!=null&&u.includes(f.type.name)||EL(f)){s.push(f);return}if(!f.isText){const m=r({fragment:f.content,rule:i,nodes:[]});d||(d=m.transformed);const b=R.fromArray(m.nodes);f.type.validContent(b)?s.push(f.copy(b)):s.push(...m.nodes);return}if(f.marks.some(m=>CL(m)||(c==null?void 0:c.includes(m.type.name)))){s.push(f);return}const p=f.text??"";let h=0;for(const m of xa(p,a)){const b=m[1],v=m[0];if(l&&(b==null?void 0:b.trim())===""||!v)return;const g=m.index,y=g+v.length;g>h&&s.push(f.cut(h,g));let x=f.cut(g,y);if(v&&b){const k=v.search(/\S/),w=g+v.indexOf(b),E=w+b.length;k&&s.push(f.cut(g,g+k)),x=f.cut(w,E)}e({nodes:s,rule:i,textNode:x,match:m,schema:t}),d=!0,h=y}p&&h0?[...n.files]:(r=n.items)!=null&&r.length?[...n.items].map(o=>o.getAsFile()).filter(o=>!!o):[]:[]}function TL(e){const t=K.maxOpen(e.content);return t.openStart({events:{},emit(e,...t){(this.events[e]||[]).forEach(r=>r(...t))},on(e,t){return(this.events[e]=this.events[e]||[]).push(t),()=>this.events[e]=(this.events[e]||[]).filter(r=>r!==t)}});var OL=Object.defineProperty,_L=Object.getOwnPropertyDescriptor,Z=(e,t,r,n)=>{for(var o=n>1?void 0:n?_L(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&OL(t,r,o),o},JC=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},G=(e,t,r)=>(JC(e,t,"read from private field"),r?r.call(e):t.get(e)),kt=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Lt=(e,t,r,n)=>(JC(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);function AL(e,t){return e===t}function f2(e){const{previousOptions:t,update:r,equals:n=AL}=e,o=Hs({...t,...r}),i=ee(),s=Lu(t);for(const l of s){const c=t[l],u=o[l];if(n(c,u)){i[l]={changed:!1};continue}i[l]={changed:!0,previousValue:c,value:u}}const a=l=>{const c=ee();for(const u of l){const d=i[u];d!=null&&d.changed&&(c[u]=d.value)}return c};return{changes:Hs(i),options:o,pickChanged:a}}var NL={[H.DUPLICATE_HELPER_NAMES]:"helper method",[H.DUPLICATE_COMMAND_NAMES]:"command method"};function XC(e){const{name:t,set:r,code:n}=e,o=NL[n];te(!r.has(t),{code:n,message:`There is a naming conflict for the name: ${t} used in this '${o}'. Please rename or remove from the editor to avoid runtime errors.`}),r.add(t)}function ju(...e){return Ml(Wz(...e).split(" ")).join(" ")}var p2="__IGNORE__",RL="__ALL__",sc=class{constructor(e,...[t]){this["~O"]={},this._mappedHandlers=ee(),this.populateMappedHandlers(),this._options=this._initialOptions=X4(e,this.constructor.defaultOptions,t??ee(),this.createDefaultHandlerOptions()),this._dynamicKeys=this.getDynamicKeys(),this.init()}get options(){return this._options}get dynamicKeys(){return this._dynamicKeys}get initialOptions(){return this._initialOptions}init(){}getDynamicKeys(){const e=[],{customHandlerKeys:t,handlerKeys:r,staticKeys:n}=this.constructor;for(const o of Lu(this._options))n.includes(o)||r.includes(o)||t.includes(o)||e.push(o);return e}ensureAllKeysAreDynamic(e){}setOptions(e){var t;const r=this.getDynamicOptions();this.ensureAllKeysAreDynamic(e);const{changes:n,options:o,pickChanged:i}=f2({previousOptions:r,update:e});this.updateDynamicOptions(o),(t=this.onSetOptions)==null||t.call(this,{reason:"set",changes:n,options:o,pickChanged:i,initialOptions:this._initialOptions})}resetOptions(){var e;const t=this.getDynamicOptions(),{changes:r,options:n,pickChanged:o}=f2({previousOptions:t,update:this._initialOptions});this.updateDynamicOptions(n),(e=this.onSetOptions)==null||e.call(this,{reason:"reset",options:n,changes:r,pickChanged:o,initialOptions:this._initialOptions})}getDynamicOptions(){return wv(this._options,[...this.constructor.customHandlerKeys,...this.constructor.handlerKeys])}updateDynamicOptions(e){this._options={...this._options,...e}}populateMappedHandlers(){for(const e of this.constructor.handlerKeys)this._mappedHandlers[e]=[]}createDefaultHandlerOptions(){const e=ee();for(const t of this.constructor.handlerKeys)e[t]=(...r)=>{var n;const{handlerKeyOptions:o}=this.constructor,i=(n=o[t])==null?void 0:n.reducer;let s=i==null?void 0:i.getDefault(...r);for(const[,a]of this._mappedHandlers[t]){const l=a(...r);if(s=i?i.accumulator(s,l,...r):l,PL(o,s,t))return s}return s};return e}addHandler(e,t,r=Ae.Default){return this._mappedHandlers[e].push([r,t]),this.sortHandlers(e),()=>this._mappedHandlers[e]=this._mappedHandlers[e].filter(([,n])=>n!==t)}hasHandlers(e){return(this._mappedHandlers[e]??[]).length>0}sortHandlers(e){this._mappedHandlers[e]=ra(this._mappedHandlers[e],([t],[r])=>r-t)}addCustomHandler(e,t){var r;return((r=this.onAddCustomHandler)==null?void 0:r.call(this,{[e]:t}))??J4}};sc.defaultOptions={};sc.staticKeys=[];sc.handlerKeys=[];sc.handlerKeyOptions={};sc.customHandlerKeys=[];function PL(e,t,r){const{[RL]:n}=e,o=e[r];return!n&&!o?!1:!!(o&&o.earlyReturnValue!==p2&&(_e(o.earlyReturnValue)?o.earlyReturnValue(t)===!0:t===o.earlyReturnValue)||n&&n.earlyReturnValue!==p2&&(_e(n.earlyReturnValue)?n.earlyReturnValue(t)===!0:t===n.earlyReturnValue))}var Uh=class extends sc{constructor(...e){super(zL,...e),this["~E"]={},this._extensions=Z4(this.createExtensions(),t=>t.constructor),this.extensionMap=new Map;for(const t of this._extensions)this.extensionMap.set(t.constructor,t)}get priority(){return this.priorityOverride??this.options.priority??this.constructor.defaultPriority}get constructorName(){return`${V4(this.name)}Extension`}get store(){return te(this._store,{code:H.MANAGER_PHASE_ERROR,message:"An error occurred while attempting to access the 'extension.store' when the Manager has not yet set created the lifecycle methods."}),Hs(this._store,{requireKeys:!0})}get extensions(){return this._extensions}replaceChildExtension(e,t){this.extensionMap.has(e)&&(this.extensionMap.set(e,t),this._extensions=this.extensions.map(r=>t.constructor===e?t:r))}createExtensions(){return[]}getExtension(e){const t=this.extensionMap.get(e);return te(t,{code:H.INVALID_GET_EXTENSION,message:`'${e.name}' does not exist within the preset: '${this.name}'`}),t}isOfType(e){return this.constructor===e}setStore(e){this._store||(this._store=e)}clone(...e){return new this.constructor(...e)}setPriority(e){this.priorityOverride=e}};Uh.defaultPriority=Ae.Default;var Ve=class extends Uh{static get[ti](){return $t.PlainExtensionConstructor}get[ti](){return $t.PlainExtension}},li=class extends Uh{static get[ti](){return $t.MarkExtensionConstructor}get[ti](){return $t.MarkExtension}get type(){return it(this.store.schema.marks,this.name)}constructor(...e){super(...e)}};li.disableExtraAttributes=!1;var er=class extends Uh{static get[ti](){return $t.NodeExtensionConstructor}get[ti](){return $t.NodeExtension}get type(){return it(this.store.schema.nodes,this.name)}constructor(...e){super(...e)}};er.disableExtraAttributes=!1;var zL={priority:void 0,extraAttributes:{},disableExtraAttributes:!1,exclude:{}};function QC(e){return oc(e)&&ic(e,[$t.PlainExtension,$t.MarkExtension,$t.NodeExtension])}function LL(e){return oc(e)&&ic(e,[$t.PlainExtensionConstructor,$t.MarkExtensionConstructor,$t.NodeExtensionConstructor])}function ZC(e){return oc(e)&&ic(e,$t.PlainExtension)}function Hd(e){return oc(e)&&ic(e,$t.NodeExtension)}function Wh(e){return oc(e)&&ic(e,$t.MarkExtension)}function pe(e){return t=>{const{defaultOptions:r,customHandlerKeys:n,handlerKeys:o,staticKeys:i,defaultPriority:s,handlerKeyOptions:a,...l}=e,c=t;r&&(c.defaultOptions=r),s&&(c.defaultPriority=s),a&&(c.handlerKeyOptions=a),c.staticKeys=i??[],c.handlerKeys=o??[],c.customHandlerKeys=n??[];for(const[u,d]of Object.entries(l))c[u]||(c[u]=d);return c}}var IL=class extends Ve{constructor(){super(...arguments),this.attributeList=[],this.attributeObject=ee(),this.updateAttributes=(e=!0)=>{this.transformAttributes(),e&&this.store.commands.forceUpdate("attributes")}}get name(){return"attributes"}onCreate(){this.transformAttributes(),this.store.setExtensionStore("updateAttributes",this.updateAttributes)}transformAttributes(){var e,t,r;if(this.attributeObject=ee(),(e=this.store.managerSettings.exclude)!=null&&e.attributes){this.store.setStoreKey("attributes",this.attributeObject);return}this.attributeList=[];for(const n of this.store.extensions){if((t=n.options.exclude)!=null&&t.attributes)continue;const o=(r=n.createAttributes)==null?void 0:r.call(n),i={...o,class:ju(...n.classNames??[],o==null?void 0:o.class)};this.attributeList.unshift(i)}for(const n of this.attributeList)this.attributeObject={...this.attributeObject,...n,class:ju(this.attributeObject.class,n.class)};this.store.setStoreKey("attributes",this.attributeObject)}};function He(e={}){return(t,r,n)=>{(t.decoratedHelpers??(t.decoratedHelpers={}))[r]=e}}function U(e={}){return(t,r,n)=>{(t.decoratedCommands??(t.decoratedCommands={}))[r]=e}}function je(e){return(t,r,n)=>{(t.decoratedKeybindings??(t.decoratedKeybindings={}))[r]=e}}var DL=class{constructor(e){this.promiseCreator=e,this.failureHandlers=[],this.successHandlers=[],this.validateHandlers=[],this.generateCommand=()=>t=>{let r=!0;const{view:n,tr:o,dispatch:i}=t;if(!n)return!1;for(const a of this.validateHandlers)if(!a({...t,dispatch:()=>{}})){r=!1;break}return!i||!r?r:(this.promiseCreator(t).then(a=>{this.runHandlers(this.successHandlers,{value:a,state:n.state,tr:n.state.tr,dispatch:n.dispatch,view:n})}).catch(a=>{this.runHandlers(this.failureHandlers,{error:a,state:n.state,tr:n.state.tr,dispatch:n.dispatch,view:n})}),i(o),!0)}}validate(e,t="push"){return this.validateHandlers[t](e),this}success(e,t="push"){return this.successHandlers[t](e),this}failure(e,t="push"){return this.failureHandlers[t](e),this}runHandlers(e,t){var r;for(const n of e)if(!n({...t,dispatch:()=>{}}))break;(r=t.dispatch)==null||r.call(t,t.tr)}};function ns(e){const{type:t,attrs:r,range:n,selection:o}=e;return i=>{const{dispatch:s,tr:a,state:l}=i,c=ne(t)?l.schema.marks[t]:t;if(te(c,{code:H.SCHEMA,message:`Mark type: ${t} does not exist on the current schema.`}),n||o){const{from:u,to:d}=jr(o??n??a.selection,a.doc);return Rp({trState:a,type:t,...n})?s==null||s(a.removeMark(u,d,c)):s==null||s(a.addMark(u,d,c.create(r))),!0}return bu(lL(c,r))(i)}}function $L(e,t,r){for(const{$from:n,$to:o}of r){let i=n.depth===0?t.type.allowsMarkType(e):!1;if(t.nodesBetween(n.pos,o.pos,s=>{if(i)return!1;i=s.inlineContent&&s.type.allowsMarkType(e)}),i)return!0}return!1}function HL(e,t,r){return({tr:n,dispatch:o,state:i})=>{const s=jr(r??n.selection,n.doc),a=Sz(s),l=ne(e)?i.schema.marks[e]:e;if(te(l,{code:H.SCHEMA,message:`Mark type: ${e} does not exist on the current schema.`}),s.empty&&!a||!$L(l,n.doc,s.ranges))return!1;if(!o)return!0;if(a)return n.removeStoredMark(l),t&&n.addStoredMark(l.create(t)),o(n),!0;let c=!1;for(const{$from:u,$to:d}of s.ranges){if(c)break;c=n.doc.rangeHasMark(u.pos,d.pos,l)}for(const{$from:u,$to:d}of s.ranges)c&&n.removeMark(u.pos,d.pos,l),t&&n.addMark(u.pos,d.pos,l.create(t));return o(n),!0}}function BL(e,t={}){return({tr:r,dispatch:n,state:o})=>{const i=o.schema,s=r.selection,{from:a=s.from,to:l=a??s.to,marks:c={}}=t;if(!n)return!0;r.insertText(e,a,l);const u=it(r.steps,r.steps.length-1).getMap().map(l);for(const[d,f]of At(c))r.addMark(a,u,it(i.marks,d).create(f));return n(r),!0}}var xe=class extends Ve{constructor(){super(...arguments),this.decorated=new Map,this.forceUpdateTransaction=(e,...t)=>{const{forcedUpdates:r}=this.getCommandMeta(e);return this.setCommandMeta(e,{forcedUpdates:Ml([...r,...t])}),e}}get name(){return"commands"}get transaction(){const e=this.store.getState();this._transaction||(this._transaction=e.tr);const t=this._transaction.before.eq(e.doc),r=!Mo(this._transaction.steps);if(!t){const n=e.tr;if(r)for(const o of this._transaction.steps)n.step(o);this._transaction=n}return this._transaction}onCreate(){this.store.setStoreKey("getForcedUpdates",this.getForcedUpdates.bind(this))}onView(e){var t;const{extensions:r,helpers:n}=this.store,o=ee(),i=new Set;let s=ee();const a=c=>{var u;const d=ee(),f=()=>c??this.transaction;let p=[];const h=()=>p;for(const[b,v]of Object.entries(o))(u=s[b])!=null&&u.disableChaining||(d[b]=this.chainedFactory({chain:d,command:v.original,getTr:f,getChain:h}));const m=b=>{te(b===f(),{message:"Chaining currently only supports `CommandFunction` methods which do not use the `state.tr` property. Instead you should use the provided `tr` property."})};return d.run=(b={})=>{const v=p;p=[];for(const g of v)if(!g(m)&&b.exitEarly)return;e.dispatch(f())},d.tr=()=>{const b=p;p=[];for(const v of b)v(m);return f()},d.enabled=()=>{for(const b of p)if(!b())return!1;return!0},d.new=b=>a(b),d};for(const c of r){const u=((t=c.createCommands)==null?void 0:t.call(c))??{},d=c.decoratedCommands??{},f={};s={...s,decoratedCommands:d};for(const[p,h]of Object.entries(d)){const m=ne(h.shortcut)&&h.shortcut.startsWith("_|")?{shortcut:n.getNamedShortcut(h.shortcut,c.options)}:void 0;this.updateDecorated(p,{...h,name:c.name,...m}),u[p]=c[p].bind(c),h.active&&(f[p]=()=>{var b;return((b=h.active)==null?void 0:b.call(h,c.options,this.store))??!1})}gp(u)||this.addCommands({active:f,names:i,commands:o,extensionCommands:u})}const l=a();for(const[c,u]of Object.entries(l))a[c]=u;this.store.setStoreKey("commands",o),this.store.setStoreKey("chain",a),this.store.setExtensionStore("commands",o),this.store.setExtensionStore("chain",a)}onStateUpdate({state:e}){this._transaction=e.tr}createPlugin(){return{}}customDispatch(e){return e}insertText(e,t={}){return ne(e)?BL(e,t):this.store.createPlaceholderCommand({promise:e,placeholder:{type:"inline"},onSuccess:(r,n,o)=>this.insertText(r,{...t,...n})(o)}).generateCommand()}selectText(e,t={}){return({tr:r,dispatch:n})=>{const o=jr(e,r.doc);return r.selection.anchor===o.anchor&&r.selection.head===o.head&&!t.forceUpdate?!1:(n==null||n(r.setSelection(o)),!0)}}selectMark(e){return t=>{const{tr:r}=t,n=_o(r.selection.$from,e);return n?this.store.commands.selectText.original({from:n.from,to:n.to})(t):!1}}delete(e){return({tr:t,dispatch:r})=>{const{from:n,to:o}=e??t.selection;return r==null||r(t.delete(n,o)),!0}}emptyUpdate(e){return({tr:t,dispatch:r})=>(r&&(e==null||e(),r(t)),!0)}forceUpdate(...e){return({tr:t,dispatch:r})=>(r==null||r(this.forceUpdateTransaction(t,...e)),!0)}updateNodeAttributes(e,t){return({tr:r,dispatch:n})=>(n==null||n(r.setNodeMarkup(e,void 0,t)),!0)}setContent(e,t){return r=>{const{tr:n,dispatch:o}=r,i=this.store.manager.createState({content:e,selection:t});return i?(o==null||o(n.replaceRangeWith(0,n.doc.nodeSize-2,i.doc)),!0):!1}}resetContent(){return e=>{const{tr:t,dispatch:r}=e,n=this.store.manager.createEmptyDoc();return n?this.setContent(n)(e):(r==null||r(t.delete(0,t.doc.nodeSize)),!0)}}emptySelection(){return({tr:e,dispatch:t})=>e.selection.empty?!1:(t==null||t(e.setSelection(le.near(e.selection.$anchor))),!0)}insertNewLine(){return({dispatch:e,tr:t})=>gs(t.selection)?(e==null||e(t.insertText(` +`)),!0):!1}insertNode(e,t={}){return({dispatch:r,tr:n,state:o})=>{var i;const{attrs:s,range:a,selection:l,replaceEmptyParentBlock:c=!1}=t,{from:u,to:d,$from:f}=jr(l??a??n.selection,n.doc);if(Id(e)||fz(e)){const v=f.before(f.depth);return r==null||r(c&&u===d&&Bh(f.parent)?n.replaceWith(v,v+f.parent.nodeSize,e):n.replaceWith(u,d,e)),!0}const p=ne(e)?o.schema.nodes[e]:e;te(p,{code:H.SCHEMA,message:`The requested node type ${e} does not exist in the schema.`});const h=(i=t.marks)==null?void 0:i.map(v=>{if(v instanceof Te)return v;const g=ne(v)?o.schema.marks[v]:v;return te(g,{code:H.SCHEMA,message:`The requested mark type ${v} does not exist in the schema.`}),g.create()}),m=p.createAndFill(s,ne(t.content)?o.schema.text(t.content):t.content,h);if(!m)return!1;const b=u!==d;return r==null||r(b?n.replaceRangeWith(u,d,m):n.insert(u,m)),!0}}focus(e){return t=>{const{dispatch:r,tr:n}=t,{view:o}=this.store;if(e===!1||o.hasFocus()&&(e===void 0||e===!0))return!1;if(e===void 0||e===!0){const{from:i=0,to:s=i}=n.selection;e={from:i,to:s}}return r&&this.delayedFocus(),this.selectText(e)(t)}}blur(e){return t=>{const{view:r}=this.store;return r.hasFocus()?(requestAnimationFrame(()=>{r.dom.blur()}),e?this.selectText(e)(t):!0):!1}}setBlockNodeType(e,t,r,n=!0){return Fu(e,t,r,n)}toggleWrappingNode(e,t,r){return DC(e,t,r)}toggleBlockNodeItem(e){return Gv(e)}wrapInNode(e,t,r){return IC(e,t,r)}applyMark(e,t,r){return HL(e,t,r)}toggleMark(e){return ns(e)}removeMark(e){return HC(e)}setMeta(e,t){return({tr:r})=>(r.setMeta(e,t),!0)}selectAll(){return this.selectText("all")}copy(){return e=>e.tr.selection.empty?!1:(e.dispatch&&document.execCommand("copy"),!0)}paste(){return this.store.createPlaceholderCommand({promise:async()=>{var e;return(e=navigator.clipboard)!=null&&e.readText?await navigator.clipboard.readText():""},placeholder:{type:"inline"},onSuccess:(e,t,r)=>this.insertNode(j1({content:e,schema:r.state.schema}),{selection:t})(r)}).generateCommand()}cut(){return e=>e.tr.selection.empty?!1:(e.dispatch&&document.execCommand("cut"),!0)}replaceText(e){return Dz(e)}getAllCommandOptions(){const e={};for(const[t,r]of this.decorated)gp(r)||(e[t]=r);return e}getCommandOptions(e){return this.decorated.get(e)}getCommandProp(){return{tr:this.transaction,dispatch:this.store.view.dispatch,state:this.store.view.state,view:this.store.view}}updateDecorated(e,t){if(!t){this.decorated.delete(e);return}const r=this.decorated.get(e)??{name:""};this.decorated.set(e,{...r,...t})}handleIosFocus(){on.isIos&&this.store.view.dom.focus()}delayedFocus(){this.handleIosFocus(),requestAnimationFrame(()=>{this.store.view.focus(),this.store.view.dispatch(this.transaction.scrollIntoView())})}getForcedUpdates(e){return this.getCommandMeta(e).forcedUpdates}getCommandMeta(e){const t=e.getMeta(this.pluginKey)??{};return{...FL,...t}}setCommandMeta(e,t){const r=this.getCommandMeta(e);e.setMeta(this.pluginKey,{...r,...t})}addCommands(e){const{extensionCommands:t,commands:r,names:n,active:o}=e;for(const[i,s]of At(t))XC({name:i,set:n,code:H.DUPLICATE_COMMAND_NAMES}),te(!VL.has(i),{code:H.DUPLICATE_COMMAND_NAMES,message:"The command name you chose is forbidden."}),r[i]=this.createUnchainedCommand(s,o[i])}unchainedFactory(e){return(...t)=>{const{shouldDispatch:r=!0,command:n}=e,{view:o}=this.store,{state:i}=o;let s;return r&&(s=o.dispatch),n(...t)({state:i,dispatch:s,view:o,tr:i.tr})}}createUnchainedCommand(e,t){const r=this.unchainedFactory({command:e});return r.enabled=this.unchainedFactory({command:e,shouldDispatch:!1}),r.isEnabled=r.enabled,r.original=e,r.active=t,r}chainedFactory(e){return(...t)=>{const{chain:r,command:n,getTr:o,getChain:i}=e,s=i(),{view:a}=this.store,{state:l}=a;return s.push(c=>n(...t)({state:l,dispatch:c,view:a,tr:o()})),r}}};Z([U()],xe.prototype,"customDispatch",1);Z([U()],xe.prototype,"insertText",1);Z([U()],xe.prototype,"selectText",1);Z([U()],xe.prototype,"selectMark",1);Z([U()],xe.prototype,"delete",1);Z([U()],xe.prototype,"emptyUpdate",1);Z([U()],xe.prototype,"forceUpdate",1);Z([U()],xe.prototype,"updateNodeAttributes",1);Z([U()],xe.prototype,"setContent",1);Z([U()],xe.prototype,"resetContent",1);Z([U()],xe.prototype,"emptySelection",1);Z([U()],xe.prototype,"insertNewLine",1);Z([U()],xe.prototype,"insertNode",1);Z([U()],xe.prototype,"focus",1);Z([U()],xe.prototype,"blur",1);Z([U()],xe.prototype,"setBlockNodeType",1);Z([U()],xe.prototype,"toggleWrappingNode",1);Z([U()],xe.prototype,"toggleBlockNodeItem",1);Z([U()],xe.prototype,"wrapInNode",1);Z([U()],xe.prototype,"applyMark",1);Z([U()],xe.prototype,"toggleMark",1);Z([U()],xe.prototype,"removeMark",1);Z([U()],xe.prototype,"setMeta",1);Z([U({description:({t:e})=>e(es.SELECT_ALL_DESCRIPTION),label:({t:e})=>e(es.SELECT_ALL_LABEL),shortcut:D.SelectAll})],xe.prototype,"selectAll",1);Z([U({description:({t:e})=>e(es.COPY_DESCRIPTION),label:({t:e})=>e(es.COPY_LABEL),shortcut:D.Copy,icon:"fileCopyLine"})],xe.prototype,"copy",1);Z([U({description:({t:e})=>e(es.PASTE_DESCRIPTION),label:({t:e})=>e(es.PASTE_LABEL),shortcut:D.Paste,icon:"clipboardLine"})],xe.prototype,"paste",1);Z([U({description:({t:e})=>e(es.CUT_DESCRIPTION),label:({t:e})=>e(es.CUT_LABEL),shortcut:D.Cut,icon:"scissorsFill"})],xe.prototype,"cut",1);Z([U()],xe.prototype,"replaceText",1);Z([He()],xe.prototype,"getAllCommandOptions",1);Z([He()],xe.prototype,"getCommandOptions",1);Z([He()],xe.prototype,"getCommandProp",1);xe=Z([pe({defaultPriority:Ae.Highest,defaultOptions:{trackerClassName:"remirror-tracker-position",trackerNodeName:"span"},staticKeys:["trackerClassName","trackerNodeName"]})],xe);var FL={forcedUpdates:[]},VL=new Set(["run","chain","original","raw","enabled","tr","new"]),io=class extends Ve{constructor(){super(...arguments),this.placeholders=Ee.empty,this.placeholderWidgets=new Map,this.createPlaceholderCommand=e=>{const t=Cl(),{promise:r,placeholder:n,onFailure:o,onSuccess:i}=e;return new DL(r).validate(s=>this.addPlaceholder(t,n)(s)).success(s=>{const{state:a,tr:l,dispatch:c,view:u,value:d}=s,f=this.store.helpers.findPlaceholder(t);if(!f){const p=new Error("The placeholder has been removed");return(o==null?void 0:o({error:p,state:a,tr:l,dispatch:c,view:u}))??!1}return this.removePlaceholder(t)({state:a,tr:l,view:u,dispatch:()=>{}}),i(d,f,{state:a,tr:l,dispatch:c,view:u})}).failure(s=>(this.removePlaceholder(t)({...s,dispatch:()=>{}}),(o==null?void 0:o(s))??!1))}}get name(){return"decorations"}onCreate(){this.store.setExtensionStore("createPlaceholderCommand",this.createPlaceholderCommand)}createPlugin(){return{state:{init:()=>{},apply:e=>{var t,r,n,o,i,s;const{added:a,clearTrackers:l,removed:c,updated:u}=this.getMeta(e);if(l){this.placeholders=Ee.empty;for(const[,d]of this.placeholderWidgets)(r=(t=d.spec).onDestroy)==null||r.call(t,this.store.view,d.spec.element);this.placeholderWidgets.clear();return}this.placeholders=this.placeholders.map(e.mapping,e.doc,{onRemove:d=>{var f,p;const h=this.placeholderWidgets.get(d.id);h&&((p=(f=h.spec).onDestroy)==null||p.call(f,this.store.view,h.spec.element))}});for(const[,d]of this.placeholderWidgets)(o=(n=d.spec).onUpdate)==null||o.call(n,this.store.view,d.from,d.spec.element,d.spec.data);for(const d of a){if(d.type==="inline"){this.addInlinePlaceholder(d,e);continue}if(d.type==="node"){this.addNodePlaceholder(d,e);continue}if(d.type==="widget"){this.addWidgetPlaceholder(d,e);continue}}for(const{id:d,data:f}of u){const p=this.placeholderWidgets.get(d);if(!p)continue;const h=Ge.widget(p.from,p.spec.element,{...p.spec,data:f});this.placeholders=this.placeholders.remove([p]).add(e.doc,[h]),this.placeholderWidgets.set(d,h)}for(const d of c){const f=this.placeholders.find(void 0,void 0,h=>h.id===d&&h.__type===Na),p=this.placeholderWidgets.get(d);p&&((s=(i=p.spec).onDestroy)==null||s.call(i,this.store.view,p.spec.element)),this.placeholders=this.placeholders.remove(f),this.placeholderWidgets.delete(d)}}},props:{decorations:e=>{let t=this.options.decorations(e);t=t.add(e.doc,this.placeholders.find());for(const r of this.store.extensions){if(!r.createDecorations)continue;const n=r.createDecorations(e).find();t=t.add(e.doc,n)}return t},handleDOMEvents:{blur:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(h2,!1)),!1),focus:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(h2,!0)),!1)}}}}updateDecorations(){return({tr:e,dispatch:t})=>(t==null||t(e),!0)}addPlaceholder(e,t,r){return({dispatch:n,tr:o})=>this.addPlaceholderTransaction(e,t,o,!n)?(n==null||n(r?o.deleteSelection():o),!0):!1}updatePlaceholder(e,t){return({dispatch:r,tr:n})=>this.updatePlaceholderTransaction({id:e,data:t,tr:n,checkOnly:!r})?(r==null||r(n),!0):!1}removePlaceholder(e){return({dispatch:t,tr:r})=>this.removePlaceholderTransaction({id:e,tr:r,checkOnly:!t})?(t==null||t(r),!0):!1}clearPlaceholders(){return({tr:e,dispatch:t})=>this.clearPlaceholdersTransaction({tr:e,checkOnly:!t})?(t==null||t(e),!0):!1}findPlaceholder(e){return this.findAllPlaceholders().get(e)}findAllPlaceholders(){const e=new Map,t=this.placeholders.find(void 0,void 0,r=>r.__type===Na);for(const r of t)e.set(r.spec.id,{from:r.from,to:r.to});return e}createDecorations(e){var t,r,n;const{persistentSelectionClass:o}=this.options;return!o||(t=this.store.view)!=null&&t.hasFocus()||(n=(r=this.store.helpers).isInteracting)!=null&&n.call(r)?Ee.empty:UL(e,Ee.empty,{class:ne(o)?o:"selection"})}onApplyState(){}addWidgetPlaceholder(e,t){const{pos:r,createElement:n,onDestroy:o,onUpdate:i,className:s,nodeName:a,id:l,type:c}=e,u=(n==null?void 0:n(this.store.view,r))??document.createElement(a);u.classList.add(s);const d=Ge.widget(r,u,{id:l,__type:Na,type:c,element:u,onDestroy:o,onUpdate:i});this.placeholderWidgets.set(l,d),this.placeholders=this.placeholders.add(t.doc,[d])}addInlinePlaceholder(e,t){const{from:r=t.selection.from,to:n=t.selection.to,className:o,nodeName:i,id:s,type:a}=e;let l;if(r===n){const c=document.createElement(i);c.classList.add(o),l=Ge.widget(r,c,{id:s,type:a,__type:Na,widget:c})}else l=Ge.inline(r,n,{nodeName:i,class:o},{id:s,__type:Na});this.placeholders=this.placeholders.add(t.doc,[l])}addNodePlaceholder(e,t){const{pos:r,className:n,nodeName:o,id:i}=e,s=Jt(r)?t.doc.resolve(r):t.selection.$from,a=Jt(r)?s.nodeAfter?{pos:r,end:s.nodeAfter.nodeSize}:void 0:rz(s);if(!a)return;const l=Ge.node(a.pos,a.end,{nodeName:o,class:n},{id:i,__type:Na});this.placeholders=this.placeholders.add(t.doc,[l])}withRequiredBase(e,t){const{placeholderNodeName:r,placeholderClassName:n}=this.options,{nodeName:o=r,className:i,...s}=t,a=(i?[n,i]:[n]).join(" ");return{nodeName:o,className:a,...s,id:e}}getMeta(e){const t=e.getMeta(this.pluginKey)??{};return{...jL,...t}}setMeta(e,t){const r=this.getMeta(e);e.setMeta(this.pluginKey,{...r,...t})}addPlaceholderTransaction(e,t,r,n=!1){if(this.findPlaceholder(e))return!1;if(n)return!0;const{added:i}=this.getMeta(r);return this.setMeta(r,{added:[...i,this.withRequiredBase(e,t)]}),!0}updatePlaceholderTransaction(e){const{id:t,tr:r,checkOnly:n=!1,data:o}=e;if(!this.findPlaceholder(t))return!1;if(n)return!0;const{updated:s}=this.getMeta(r);return this.setMeta(r,{updated:Ml([...s,{id:t,data:o}])}),!0}removePlaceholderTransaction(e){const{id:t,tr:r,checkOnly:n=!1}=e;if(!this.findPlaceholder(t))return!1;if(n)return!0;const{removed:i}=this.getMeta(r);return this.setMeta(r,{removed:Ml([...i,t])}),!0}clearPlaceholdersTransaction(e){const{tr:t,checkOnly:r=!1}=e;return this.getPluginState()===Ee.empty?!1:(r||this.setMeta(t,{clearTrackers:!0}),!0)}};Z([U()],io.prototype,"updateDecorations",1);Z([U()],io.prototype,"addPlaceholder",1);Z([U()],io.prototype,"updatePlaceholder",1);Z([U()],io.prototype,"removePlaceholder",1);Z([U()],io.prototype,"clearPlaceholders",1);Z([He()],io.prototype,"findPlaceholder",1);Z([He()],io.prototype,"findAllPlaceholders",1);io=Z([pe({defaultOptions:{persistentSelectionClass:void 0,placeholderClassName:"placeholder",placeholderNodeName:"span"},staticKeys:["placeholderClassName","placeholderNodeName"],handlerKeys:["decorations"],handlerKeyOptions:{decorations:{reducer:{accumulator:(e,t,r)=>e.add(r.doc,t.find()),getDefault:()=>Ee.empty}}},defaultPriority:Ae.Low})],io);var jL={added:[],updated:[],clearTrackers:!1,removed:[]},Na="placeholderDecoration",h2="persistentSelectionFocus";function UL(e,t,r){const{selection:n,doc:o}=e;if(n.empty)return t;const{from:i,to:s}=n,a=Dd(n)?Ge.node(i,s,r):Ge.inline(i,s,r);return t.add(o,[a])}var W1=class extends Ve{get name(){return"docChanged"}onStateUpdate(e){const{firstUpdate:t,transactions:r,tr:n}=e;t||(r??[n]).some(o=>o==null?void 0:o.docChanged)&&this.options.docChanged(e)}};W1=Z([pe({handlerKeys:["docChanged"],handlerKeyOptions:{docChanged:{earlyReturnValue:!1}},defaultPriority:Ae.Lowest})],W1);var Rn=class extends Ve{get name(){return"helpers"}onCreate(){var e;this.store.setStringHandler("text",this.textToProsemirrorNode.bind(this)),this.store.setStringHandler("html",j1);const t=ee(),r=ee(),n=ee(),o=new Set;for(const i of this.store.extensions){Hd(i)&&(r[i.name]=a=>SC({state:this.store.getState(),type:i.type,attrs:a}),n[i.name]=a=>{var l;return(l=Bu({state:this.store.getState(),type:i.type,attrs:a}))==null?void 0:l.node.attrs}),Wh(i)&&(r[i.name]=a=>Rp({trState:this.store.getState(),type:i.type,attrs:a}),n[i.name]=a=>{const l=_o(this.store.getState().selection.$from,i.type);if(!l||!a)return l==null?void 0:l.mark.attrs;if(Uv(l.mark,a))return l.mark.attrs});const s=((e=i.createHelpers)==null?void 0:e.call(i))??{};for(const a of Object.keys(i.decoratedHelpers??{}))s[a]=i[a].bind(i);if(!gp(s))for(const[a,l]of At(s))XC({name:a,set:o,code:H.DUPLICATE_HELPER_NAMES}),t[a]=l}this.store.setStoreKey("attrs",n),this.store.setStoreKey("active",r),this.store.setStoreKey("helpers",t),this.store.setExtensionStore("attrs",n),this.store.setExtensionStore("active",r),this.store.setExtensionStore("helpers",t)}isSelectionEmpty(e=this.store.getState()){return jv(e)}isViewEditable(e=this.store.getState()){var t,r;return((r=(t=this.store.view.props).editable)==null?void 0:r.call(t,e))??!1}getStateJSON(e=this.store.getState()){return e.toJSON()}getJSON(e=this.store.getState()){return e.doc.toJSON()}getRemirrorJSON(e=this.store.getState()){return this.getJSON(e)}insertHtml(e,t){return r=>{const{state:n}=r,o=j1({content:e,schema:n.schema,fragment:!0});return this.store.commands.insertNode.original(o,t)(r)}}getText({lineBreakDivider:e=` `,state:t=this.store.getState()}={}){return t.doc.textBetween(0,t.doc.content.size,e,zi)}getTextBetween(e,t,r=this.store.getState().doc){return r.textBetween(e,t,` -`,zi)}getHTML(e=this.store.getState()){return wz(e.doc,this.store.document)}textToProsemirrorNode(e){const t=`
    ${e.content}
    `;return this.store.stringHandlers.html({...e,content:t})}};Z([He()],An.prototype,"isSelectionEmpty",1);Z([He()],An.prototype,"isViewEditable",1);Z([He()],An.prototype,"getStateJSON",1);Z([He()],An.prototype,"getJSON",1);Z([He()],An.prototype,"getRemirrorJSON",1);Z([U()],An.prototype,"insertHtml",1);Z([He()],An.prototype,"getText",1);Z([He()],An.prototype,"getTextBetween",1);Z([He()],An.prototype,"getHTML",1);An=Z([me({})],An);var j1=class extends Ve{get name(){return"inputRules"}onCreate(){this.store.setExtensionStore("rebuildInputRules",this.rebuildInputRules.bind(this))}createExternalPlugins(){return[this.generateInputRulesPlugin()]}generateInputRulesPlugin(){var e,t;const r=[],n=this.store.markTags[oe.ExcludeInputRules];for(const o of this.store.extensions)if(!((e=this.store.managerSettings.exclude)!=null&&e.inputRules||!o.createInputRules||(t=o.options.exclude)!=null&&t.inputRules))for(const i of o.createInputRules())i.shouldSkip=this.options.shouldSkipInputRule,i.invalidMarks=n,r.push(i);return LR({rules:r})}rebuildInputRules(){this.store.updateExtensionPlugins(this)}};j1=Z([me({defaultPriority:Ae.Default,handlerKeys:["shouldSkipInputRule"],handlerKeyOptions:{shouldSkipInputRule:{earlyReturnValue:!0}}})],j1);var Qn=class extends Ve{constructor(){super(...arguments),this.extraKeyBindings=[],this.backwardMarkExitTracker=new Map,this.keydownHandler=null,this.onAddCustomHandler=({keymap:e})=>{var t,r;if(e)return this.extraKeyBindings=[...this.extraKeyBindings,e],(r=(t=this.store).rebuildKeymap)==null||r.call(t),()=>{var n,o;this.extraKeyBindings=this.extraKeyBindings.filter(i=>i!==e),(o=(n=this.store).rebuildKeymap)==null||o.call(n)}},this.rebuildKeymap=()=>{this.setupKeydownHandler()}}get name(){return"keymap"}get shortcutMap(){const{shortcuts:e}=this.options;return ne(e)?FL[e]:e}onCreate(){this.store.setExtensionStore("rebuildKeymap",this.rebuildKeymap)}createExternalPlugins(){var e;return(e=this.store.managerSettings.exclude)!=null&&e.keymap?[]:(this.setupKeydownHandler(),[new Ro({props:{handleKeyDown:(t,r)=>{var n;return(n=this.keydownHandler)==null?void 0:n.call(this,t,r)}}})])}setupKeydownHandler(){const e=this.generateKeymapBindings();this.keydownHandler=qv(e)}generateKeymapBindings(){var e;const t=[],r=this.shortcutMap,n=this.store.getExtension(xe),o=a=>l=>$f({shortcut:l,map:r,store:this.store,options:a.options});for(const a of this.store.extensions){const l=a.decoratedKeybindings??{};if(!((e=a.options.exclude)!=null&&e.keymap)){a.createKeymap&&t.push(HL(a.createKeymap(o(a)),r));for(const[c,u]of At(l)){if(u.isActive&&!u.isActive(a.options,this.store))continue;const d=a[c].bind(a),f=$f({shortcut:u.shortcut,map:r,options:a.options,store:this.store}),p=_e(u.priority)?u.priority(a.options,this.store):u.priority??Ae.Low,h=ee();for(const m of f)h[m]=d;t.push([p,h]),u.command&&n.updateDecorated(u.command,{shortcut:f})}}}const i=this.sortKeymaps([...this.extraKeyBindings,...t]);return ez(i)}arrowRightShortcut(e){const t=this.store.markTags[oe.PreventExits],r=this.store.nodeTags[oe.PreventExits];return this.exitMarkForwards(t,r)(e)}arrowLeftShortcut(e){const t=this.store.markTags[oe.PreventExits],r=this.store.nodeTags[oe.PreventExits];return _p(this.exitNodeBackwards(r),this.exitMarkBackwards(t,r))(e)}backspace(e){const t=this.store.markTags[oe.PreventExits],r=this.store.nodeTags[oe.PreventExits];return _p(this.exitNodeBackwards(r,!0),this.exitMarkBackwards(t,r,!0))(e)}createKeymap(){const{selectParentNodeOnEscape:e,undoInputRuleOnBackspace:t,excludeBaseKeymap:r}=this.options,n=ee();if(!r)for(const[o,i]of At(yg))n[o]=yu(i);return t&&yg.Backspace&&(n.Backspace=yu(Hh(IR,yg.Backspace))),e&&(n.Escape=yu(Yz)),[Ae.Low,n]}getNamedShortcut(e,t={}){return e.startsWith("_|")?$f({shortcut:e,map:this.shortcutMap,store:this.store,options:t}):[e]}onSetOptions(e){var t,r;const{changes:n}=e;(n.excludeBaseKeymap.changed||n.selectParentNodeOnEscape.changed||n.undoInputRuleOnBackspace.changed)&&((r=(t=this.store).rebuildKeymap)==null||r.call(t))}sortKeymaps(e){return ra(e.map(t=>ct(t)?t:[Ae.Default,t]),(t,r)=>r[0]-t[0]).map(t=>t[1])}exitMarkForwards(e,t){return r=>{const{tr:n,dispatch:o}=r;if(!Cz(n.selection)||ts({selection:n.selection,types:t}))return!1;const a=n.selection.$from.marks().filter(l=>!e.includes(l.type.name));if(Mo(a))return!1;if(!o)return!0;for(const l of a)n.removeStoredMark(l);return o(n.insertText(" ",n.selection.from)),!0}}exitNodeBackwards(e,t=!1){return r=>{const{tr:n}=r;if(!(t?a2:F1)(n.selection))return!1;const i=n.selection.$anchor.node();return!Dh(i)||uz(i)||e.includes(i.type.name)?!1:this.store.commands.toggleBlockNodeItem.original({type:i.type})(r)}}exitMarkBackwards(e,t,r=!1){return n=>{const{tr:o,dispatch:i}=n;if(!(r?a2:F1)(o.selection)||this.backwardMarkExitTracker.has(o.selection.anchor))return this.backwardMarkExitTracker.clear(),!1;if(ts({selection:o.selection,types:t}))return!1;const l=[...o.storedMarks??[],...o.selection.$from.marks()].filter(c=>!e.includes(c.type.name));if(Mo(l))return!1;if(!i)return!0;for(const c of l)o.removeStoredMark(c);return this.backwardMarkExitTracker.set(o.selection.anchor,!0),i(o),!0}}};Z([je({shortcut:"ArrowRight",isActive:e=>e.exitMarksOnArrowPress})],Qn.prototype,"arrowRightShortcut",1);Z([je({shortcut:"ArrowLeft",isActive:e=>e.exitMarksOnArrowPress})],Qn.prototype,"arrowLeftShortcut",1);Z([je({shortcut:"Backspace",isActive:e=>e.exitMarksOnArrowPress})],Qn.prototype,"backspace",1);Z([He()],Qn.prototype,"getNamedShortcut",1);Qn=Z([me({defaultPriority:Ae.Low,defaultOptions:{shortcuts:"default",undoInputRuleOnBackspace:!0,selectParentNodeOnEscape:!1,excludeBaseKeymap:!1,exitMarksOnArrowPress:!0},customHandlerKeys:["keymap"]})],Qn);function $L(e){return dr(Th(D),e)}function $f({shortcut:e,map:t,options:r,store:n}){return ne(e)?[U1(e,t)]:ct(e)?e.map(o=>U1(o,t)):(e=e(r,n),$f({shortcut:e,map:t,options:r,store:n}))}function U1(e,t){return $L(e)?t[e]:e}function HL(e,t){const r={};let n,o;ct(e)?[o,n]=e:n=e;for(const[i,s]of At(n))r[U1(i,t)]=s;return Oh(o)?r:[o,r]}var J5={[D.Copy]:"Mod-c",[D.Cut]:"Mod-x",[D.Paste]:"Mod-v",[D.PastePlain]:"Mod-Shift-v",[D.SelectAll]:"Mod-a",[D.Undo]:"Mod-z",[D.Redo]:nn.isMac?"Shift-Mod-z":"Mod-y",[D.Bold]:"Mod-b",[D.Italic]:"Mod-i",[D.Underline]:"Mod-u",[D.Strike]:"Mod-d",[D.Code]:"Mod-`",[D.Paragraph]:"Mod-Shift-0",[D.H1]:"Mod-Shift-1",[D.H2]:"Mod-Shift-2",[D.H3]:"Mod-Shift-3",[D.H4]:"Mod-Shift-4",[D.H5]:"Mod-Shift-5",[D.H6]:"Mod-Shift-6",[D.TaskList]:"Mod-Shift-7",[D.BulletList]:"Mod-Shift-8",[D.OrderedList]:"Mod-Shift-9",[D.Quote]:"Mod->",[D.Divider]:"Mod-Shift-|",[D.Codeblock]:"Mod-Shift-~",[D.ClearFormatting]:"Mod-Shift-C",[D.Superscript]:"Mod-.",[D.Subscript]:"Mod-,",[D.LeftAlignment]:"Mod-Shift-L",[D.CenterAlignment]:"Mod-Shift-E",[D.RightAlignment]:"Mod-Shift-R",[D.JustifyAlignment]:"Mod-Shift-J",[D.InsertLink]:"Mod-k",[D.Find]:"Mod-f",[D.FindBackwards]:"Mod-Shift-f",[D.FindReplace]:"Mod-Shift-H",[D.AddFootnote]:"Mod-Alt-f",[D.AddComment]:"Mod-Alt-m",[D.ContextMenu]:"Mod-Shift-\\",[D.IncreaseFontSize]:"Mod-Shift-.",[D.DecreaseFontSize]:"Mod-Shift-,",[D.IncreaseIndent]:"Tab",[D.DecreaseIndent]:"Shift-Tab",[D.Shortcuts]:"Mod-/",[D.Format]:nn.isMac?"Alt-Shift-f":"Shift-Ctrl-f"},BL={...J5,[D.Strike]:"Mod-Shift-S",[D.Code]:"Mod-Shift-M",[D.Paragraph]:"Mod-Alt-0",[D.H1]:"Mod-Alt-1",[D.H2]:"Mod-Alt-2",[D.H3]:"Mod-Alt-3",[D.H4]:"Mod-Alt-4",[D.H5]:"Mod-Alt-5",[D.H6]:"Mod-Alt-6",[D.OrderedList]:"Mod-Alt-7",[D.BulletList]:"Mod-Alt-8",[D.Quote]:"Mod-Alt-9",[D.ClearFormatting]:"Mod-\\",[D.IncreaseIndent]:"Mod-[",[D.DecreaseIndent]:"Mod-]"},FL={default:J5,googleDoc:BL},VL=class extends Ve{get name(){return"nodeViews"}createPlugin(){const e=[],t=ee();for(const r of this.store.extensions){if(!r.createNodeViews)continue;const n=r.createNodeViews();e.unshift(_e(n)?{[r.name]:n}:n)}e.unshift(this.store.managerSettings.nodeViews??{});for(const r of e)Object.assign(t,r);return{props:{nodeViews:t}}}},jL=class extends Ve{get name(){return"pasteRules"}createExternalPlugins(){return[this.generatePasteRulesPlugin()]}generatePasteRulesPlugin(){var e,t;const r=[];for(const n of this.store.extensions){if((e=this.store.managerSettings.exclude)!=null&&e.pasteRules||!n.createPasteRules||(t=n.options.exclude)!=null&&t.pasteRules)continue;const o=n.createPasteRules(),i=ct(o)?o:[o];r.push(...i)}return cL(r)}},Rp=class extends Ve{constructor(){super(...arguments),this.plugins=[],this.managerPlugins=[],this.applyStateHandlers=[],this.initStateHandlers=[],this.appendTransactionHandlers=[],this.pluginKeys=ee(),this.stateGetters=new Map,this.getPluginStateCreator=e=>t=>e.getState(t??this.store.getState()),this.getStateByName=e=>{const t=this.stateGetters.get(e);return te(t,{message:"No plugin exists for the requested extension name."}),t()}}get name(){return"plugins"}onCreate(){const{setStoreKey:e,setExtensionStore:t,managerSettings:r,extensions:n}=this.store;this.updateExtensionStore();const{plugins:o=[]}=r;this.updatePlugins(o,this.managerPlugins);for(const i of n)i.onApplyState&&this.applyStateHandlers.push(i.onApplyState.bind(i)),i.onInitState&&this.initStateHandlers.push(i.onInitState.bind(i)),i.onAppendTransaction&&this.appendTransactionHandlers.push(i.onAppendTransaction.bind(i)),this.extractExtensionPlugins(i);this.managerPlugins=o,this.store.setStoreKey("plugins",this.plugins),e("pluginKeys",this.pluginKeys),e("getPluginState",this.getStateByName),t("getPluginState",this.getStateByName)}createPlugin(){return{appendTransaction:(e,t,r)=>{const n=r.tr,o={previousState:t,tr:n,transactions:e,state:r};for(const i of this.appendTransactionHandlers)i(o);return this.options.appendTransaction(o),n.docChanged||n.steps.length>0||n.selectionSet||n.storedMarksSet?n:void 0},state:{init:(e,t)=>{for(const r of this.initStateHandlers)r(t)},apply:(e,t,r,n)=>{const o={previousState:r,state:n,tr:e};for(const i of this.applyStateHandlers)i(o);this.options.applyState(o)}}}}extractExtensionPlugins(e){var t,r;if(!(!e.createPlugin&&!e.createExternalPlugins||(t=this.store.managerSettings.exclude)!=null&&t.plugins||(r=e.options.exclude)!=null&&r.plugins)){if(e.createPlugin){const o=new ka(e.name);this.pluginKeys[e.name]=o;const i=this.getPluginStateCreator(o);e.pluginKey=o,e.getPluginState=i,this.stateGetters.set(e.name,i),this.stateGetters.set(e.constructor,i);const s={...e.createPlugin(),key:o},a=new Ro(s);this.updatePlugins([a],e.plugin?[e.plugin]:void 0),e.plugin=a}if(e.createExternalPlugins){const o=e.createExternalPlugins();this.updatePlugins(o,e.externalPlugins),e.externalPlugins=o}}}updatePlugins(e,t){if(!t||Mo(t)){this.plugins=[...this.plugins,...e];return}if(e.length!==t.length){this.plugins=[...this.plugins.filter(n=>!t.includes(n)),...e];return}const r=new Map;for(const[n,o]of e.entries())r.set(it(t,n),o);this.plugins=this.plugins.map(n=>t.includes(n)?r.get(n):n)}updateExtensionStore(){const{setExtensionStore:e}=this.store;e("updatePlugins",this.updatePlugins.bind(this)),e("dispatchPluginUpdate",this.dispatchPluginUpdate.bind(this)),e("updateExtensionPlugins",this.updateExtensionPlugins.bind(this))}updateExtensionPlugins(e){const t=G5(e)?e:OL(e)?this.store.manager.getExtension(e):this.store.extensions.find(r=>r.name===e);te(t,{code:H.INVALID_MANAGER_EXTENSION,message:`The extension ${e} does not exist within the editor.`}),this.extractExtensionPlugins(t),this.store.setStoreKey("plugins",this.plugins),this.dispatchPluginUpdate()}dispatchPluginUpdate(){te(this.store.phase>=Nr.EditorView,{code:H.MANAGER_PHASE_ERROR,message:"`dispatchPluginUpdate` should only be called after the view has been added to the manager."});const{view:e,updateState:t}=this.store,r=e.state.reconfigure({plugins:this.plugins});t(r)}};Rp=Z([me({defaultPriority:Ae.Highest,handlerKeys:["applyState","appendTransaction"]})],Rp);var W1=class extends Ve{constructor(){super(...arguments),this.dynamicAttributes={marks:ee(),nodes:ee()}}get name(){return"schema"}onCreate(){const{managerSettings:e,tags:t,markNames:r,nodeNames:n,extensions:o}=this.store,{defaultBlockNode:i,disableExtraAttributes:s,nodeOverride:a,markOverride:l}=e,c=h=>!!(h&&t[oe.Block].includes(h));if(e.schema){const{nodes:h,marks:m}=XL(e.schema);this.addSchema(e.schema,h,m);return}const u=c(i)?{doc:ee(),[i]:ee()}:ee(),d=ee(),f=UL({settings:e,gatheredSchemaAttributes:this.gatherExtraAttributes(o),nodeNames:n,markNames:r,tags:t});for(const h of o){f[h.name]={...f[h.name],...h.options.extraAttributes};const m=s===!0||h.options.disableExtraAttributes===!0||h.constructor.disableExtraAttributes===!0;if($d(h)){const{spec:b,dynamic:v}=f2({createExtensionSpec:(g,y)=>h.createNodeSpec(g,y),extraAttributes:it(f,h.name),override:{...a,...h.options.nodeOverride},ignoreExtraAttributes:m,name:h.constructorName,tags:h.tags});h.spec=b,u[h.name]=b,Object.keys(v).length>0&&(this.dynamicAttributes.nodes[h.name]=v)}if(Vh(h)){const{spec:b,dynamic:v}=f2({createExtensionSpec:(g,y)=>h.createMarkSpec(g,y),extraAttributes:it(f,h.name),override:{...l,...h.options.markOverride},ignoreExtraAttributes:m,name:h.constructorName,tags:h.tags??[]});h.spec=b,d[h.name]=b,Object.keys(v).length>0&&(this.dynamicAttributes.marks[h.name]=v)}}const p=new MA({nodes:u,marks:d,topNode:"doc"});this.addSchema(p,u,d)}createPlugin(){return{appendTransaction:(e,t,r)=>{const{tr:n}=r;return!e.some(i=>i.docChanged)||Object.keys(this.dynamicAttributes.nodes).length===0&&Object.keys(this.dynamicAttributes.marks).length===0?null:(n.doc.descendants((i,s)=>(this.checkAndUpdateDynamicNodes(i,s,n),this.checkAndUpdateDynamicMarks(i,s,n),!0)),n.steps.length>0?n:null)}}}addSchema(e,t,r){this.store.setStoreKey("nodes",t),this.store.setStoreKey("marks",r),this.store.setStoreKey("schema",e),this.store.setExtensionStore("schema",e),this.store.setStoreKey("defaultBlockNode",Ih(e).name);for(const n of Object.values(e.nodes))if(n.name!=="doc"&&(n.isBlock||n.isTextblock))break}checkAndUpdateDynamicNodes(e,t,r){for(const[n,o]of At(this.dynamicAttributes.nodes))if(e.type.name===n)for(const[i,s]of At(o)){if(!Zi(e.attrs[i]))continue;const a={...e.attrs,[i]:s(e)};r.setNodeMarkup(t,void 0,a),n2(r)}}checkAndUpdateDynamicMarks(e,t,r){for(const[n,o]of At(this.dynamicAttributes.marks)){const i=it(this.store.schema.marks,n),s=e.marks.find(a=>a.type.name===n);if(s)for(const[a,l]of At(o)){if(!Zi(s.attrs[a]))continue;const c=_o(r.doc.resolve(t),i);if(!c)continue;const{from:u,to:d}=c,f=i.create({...s.attrs,[a]:l(s)});r.removeMark(u,d,i).addMark(u,d,f),n2(r)}}}gatherExtraAttributes(e){const t=[];for(const r of e)r.createSchemaAttributes&&t.push(...r.createSchemaAttributes());return t}};W1=Z([me({defaultPriority:Ae.Highest})],W1);function UL(e){const{settings:t,gatheredSchemaAttributes:r,nodeNames:n,markNames:o,tags:i}=e,s=ee();if(t.disableExtraAttributes)return s;const a=[...r,...t.extraAttributes??[]];for(const l of a??[]){const c=KL({identifiers:l.identifiers,nodeNames:n,markNames:o,tags:i});for(const u of c){const d=s[u]??{};s[u]={...d,...l.attributes}}}return s}function WL(e){return hs(e)&&ct(e.tags)}function KL(e){const{identifiers:t,nodeNames:r,markNames:n,tags:o}=e;if(t==="nodes")return r;if(t==="marks")return n;if(t==="all")return[...r,...n];if(ct(t))return t;te(WL(t),{code:H.EXTENSION_EXTRA_ATTRIBUTES,message:"Invalid value passed as an identifier when creating `extraAttributes`."});const{tags:i=[],names:s=[],behavior:a="any",excludeNames:l,excludeTags:c,type:u}=t,d=new Set,f=u==="mark"?n:u==="node"?r:[...n,...r],p=m=>f.includes(m)&&!(l!=null&&l.includes(m));for(const m of s)p(m)&&d.add(m);const h=new Map;for(const m of i)if(!(c!=null&&c.includes(m)))for(const b of o[m]){if(!p(b))continue;if(a==="any"){d.add(b);continue}const v=h.get(b)??new Set;v.add(m),h.set(b,v)}for(const[m,b]of h)b.size===i.length&&d.add(m);return[...d]}function f2(e){var t;const{createExtensionSpec:r,extraAttributes:n,ignoreExtraAttributes:o,name:i,tags:s,override:a}=e,l=ee();function c(b,v){l[b]=v}let u=!1;function d(){u=!0}const f=qL(n,o,d,c),p=GL(n,o),h=YL(n,o),m=r({defaults:f,parse:p,dom:h},a);return te(o||u,{code:H.EXTENSION_SPEC,message:`When creating a node specification you must call the 'defaults', and parse, and 'dom' methods. To avoid this error you can set the static property 'disableExtraAttributes' of '${i}' to 'true'.`}),m.group=[...((t=m.group)==null?void 0:t.split(" "))??[],...s].join(" ")||void 0,{spec:m,dynamic:l}}function Gv(e){return ne(e)||_e(e)?{default:e}:(te(e,{message:`${F4(e)} is not supported`,code:H.EXTENSION_EXTRA_ATTRIBUTES}),e)}function qL(e,t,r,n){return()=>{r();const o=ee();if(t)return o;for(const[i,s]of At(e)){let l=Gv(s).default;_e(l)&&(n(i,l),l=null),o[i]=l===void 0?{}:{default:l}}return o}}function GL(e,t){return r=>{const n=ee();if(t)return n;for(const[o,i]of At(e)){const{parseDOM:s,...a}=Gv(i);if(Je(r)){if(Zi(s)){n[o]=r.getAttribute(o)??a.default;continue}if(_e(s)){n[o]=s(r)??a.default;continue}n[o]=r.getAttribute(s)??a.default}}return n}}function YL(e,t){return r=>{const n=ee();if(t)return n;function o(i,s){if(i){if(ne(i)){n[s]=i;return}if(ct(i)){const[a,l]=i;n[a]=l??r.attrs[s];return}for(const[a,l]of At(i))n[a]=l}}for(const[i,s]of At(e)){const{toDOM:a,parseDOM:l}=Gv(s);if(Zi(a)){const c=ne(l)?l:i;n[c]=r.attrs[i];continue}if(_e(a)){o(a(r.attrs,JL(r)),i);continue}o(a,i)}return n}}function JL(e){return Ld(e)?{node:e}:sz(e)?{mark:e}:{}}function XL(e){const t=ee(),r=ee();for(const[n,o]of Object.entries(e.nodes))t[n]=o.spec;for(const[n,o]of Object.entries(e.marks))r[n]=o.spec;return{nodes:t,marks:r}}var Ll=class extends Ve{constructor(){super(...arguments),this.onAddCustomHandler=({suggester:e})=>{var t;if(!(!e||(t=this.store.managerSettings.exclude)!=null&&t.suggesters))return r2(this.store.getState(),e)}}get name(){return"suggest"}onCreate(){this.store.setExtensionStore("addSuggester",e=>r2(this.store.getState(),e)),this.store.setExtensionStore("removeSuggester",e=>H6(this.store.getState(),e))}createExternalPlugins(){var e,t;const r=[];for(const n of this.store.extensions){if((e=this.store.managerSettings.exclude)!=null&&e.suggesters)break;if(!n.createSuggesters||(t=n.options.exclude)!=null&&t.suggesters)continue;const o=n.createSuggesters(),i=ct(o)?o:[o];r.push(...i)}return[B6(...r)]}getSuggestState(e){return $v(e??this.store.getState())}getSuggestMethods(){const{addIgnored:e,clearIgnored:t,removeIgnored:r,ignoreNextExit:n,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}=this.getSuggestState();return{addIgnored:e,clearIgnored:t,removeIgnored:r,ignoreNextExit:n,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}}isSuggesterActive(e){var t;return dr(ct(e)?e:[e],(t=this.getSuggestState().match)==null?void 0:t.suggester.name)}};Z([He()],Ll.prototype,"getSuggestState",1);Z([He()],Ll.prototype,"getSuggestMethods",1);Z([He()],Ll.prototype,"isSuggesterActive",1);Ll=Z([me({customHandlerKeys:["suggester"]})],Ll);var K1=class extends Ve{constructor(){super(...arguments),this.allTags=ee(),this.plainTags=ee(),this.markTags=ee(),this.nodeTags=ee()}get name(){return"tags"}onCreate(){this.resetTags();for(const e of this.store.extensions)this.updateTagForExtension(e);this.store.setStoreKey("tags",this.allTags),this.store.setExtensionStore("tags",this.allTags),this.store.setStoreKey("plainTags",this.plainTags),this.store.setExtensionStore("plainTags",this.plainTags),this.store.setStoreKey("markTags",this.markTags),this.store.setExtensionStore("markTags",this.markTags),this.store.setStoreKey("nodeTags",this.nodeTags),this.store.setExtensionStore("nodeTags",this.nodeTags)}resetTags(){const e=ee(),t=ee(),r=ee(),n=ee();for(const o of Th(oe))e[o]=[],t[o]=[],r[o]=[],n[o]=[];this.allTags=e,this.plainTags=t,this.markTags=r,this.nodeTags=n}updateTagForExtension(e){var t,r;const n=new Set([...e.tags??[],...((t=e.createTags)==null?void 0:t.call(e))??[],...e.options.extraTags??[],...((r=this.store.managerSettings.extraTags)==null?void 0:r[e.name])??[]]);for(const o of n)te(QL(o),{code:H.EXTENSION,message:`The tag provided by the extension: ${e.constructorName} is not supported by the editor. To add custom tags you can use the 'mutateTag' method.`}),this.allTags[o].push(e.name),Y5(e)&&this.plainTags[o].push(e.name),Vh(e)&&this.markTags[o].push(e.name),$d(e)&&this.nodeTags[o].push(e.name);e.tags=[...n]}};K1=Z([me({defaultPriority:Ae.Highest})],K1);function QL(e){return dr(Th(oe),e)}var ZL=new ka("remirrorFilePlaceholderPlugin");function eI(){const e=new Ro({key:ZL,state:{init(){return{set:Ee.empty,payloads:new Map}},apply(t,{set:r,payloads:n}){r=r.map(t.mapping,t.doc);const o=t.getMeta(e);if(o)if(o.type===0){const i=document.createElement("placeholder"),s=Ge.widget(o.pos,i,{id:o.id});r=r.add(t.doc,[s]),n.set(o.id,o.payload)}else o.type===1&&(r=r.remove(r.find(void 0,void 0,i=>i.id===o.id)),n.delete(o.id));return{set:r,payloads:n}}},props:{decorations(t){var r;return((r=e.getState(t))==null?void 0:r.set)??null}}});return e}var tI=class extends Ve{get name(){return"upload"}createExternalPlugins(){return[eI()]}};function rI(e={}){e={...{exitMarksOnArrowPress:Qn.defaultOptions.exitMarksOnArrowPress,excludeBaseKeymap:Qn.defaultOptions.excludeBaseKeymap,selectParentNodeOnEscape:Qn.defaultOptions.selectParentNodeOnEscape,undoInputRuleOnBackspace:Qn.defaultOptions.undoInputRuleOnBackspace,persistentSelectionClass:io.defaultOptions.persistentSelectionClass},...e};const r=b1(e,["excludeBaseKeymap","selectParentNodeOnEscape","undoInputRuleOnBackspace"]),n=b1(e,["persistentSelectionClass"]);return[new K1,new W1,new _L,new Rp,new j1,new jL,new VL,new Ll,new xe,new An,new Qn(r),new V1,new tI,new io(n)]}var p2=class extends Ve{get name(){return"meta"}onCreate(){if(this.store.setStoreKey("getCommandMeta",this.getCommandMeta.bind(this)),!!this.options.capture)for(const e of this.store.extensions)this.captureCommands(e),this.captureKeybindings(e)}createPlugin(){return{}}captureCommands(e){const t=e.decoratedCommands??{},r=e.createCommands;for(const n of Object.keys(t)){const o=e[n];e[n]=(...i)=>s=>{var a;const l=o(...i)(s);return s.dispatch&&l&&this.setCommandMeta(s.tr,{type:"command",chain:s.dispatch!==((a=s.view)==null?void 0:a.dispatch),name:n,extension:e.name,decorated:!0}),l}}r&&(e.createCommands=()=>{const n=r();for(const[o,i]of Object.entries(n))n[o]=(...s)=>a=>{var l;const c=i(...s)(a);return a.dispatch&&c&&this.setCommandMeta(a.tr,{type:"command",chain:a.dispatch!==((l=a.view)==null?void 0:l.dispatch),name:o,extension:e.name,decorated:!1}),c};return n})}captureKeybindings(e){}getCommandMeta(e){return e.getMeta(this.pluginKey)??[]}setCommandMeta(e,t){const r=this.getCommandMeta(e);e.setMeta(this.pluginKey,[...r,t])}};p2=Z([me({defaultOptions:{capture:nn.isDevelopment},staticKeys:["capture"],defaultPriority:Ae.Highest})],p2);var Hf,Dc,Bf,Wa,Ei,Ff,Vf,nI=class{constructor(e){kt(this,Hf,Cl()),kt(this,Dc,void 0),kt(this,Bf,void 0),kt(this,Wa,!0),kt(this,Ei,Bh()),kt(this,Ff,void 0),kt(this,Vf,void 0),this.getState=()=>this.view.state??this.initialEditorState,this.getPreviousState=()=>this.previousState,this.dispatchTransaction=i=>{var s,a;te(!this.manager.destroyed,{code:H.MANAGER_PHASE_ERROR,message:"A transaction was dispatched to a manager that has already been destroyed. Please check your set up, or open an issue."}),i=((a=(s=this.props).onDispatchTransaction)==null?void 0:a.call(s,i,this.getState()))??i;const l=this.getState(),{state:c,transactions:u}=l.applyTransaction(i);Lt(this,Bf,l),this.updateState({state:c,tr:i,transactions:u});const d=this.manager.store.getForcedUpdates(i);Mo(d)||this.updateViewProps(...d)},this.onChange=(i=ee())=>{var s,a;const l=this.eventListenerProps(i);G(this,Wa)&&Lt(this,Wa,!1),(a=(s=this.props).onChange)==null||a.call(s,l)},this.onBlur=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onBlur)==null||a.call(s,l,i),G(this,Ei).emit("blur",l,i)},this.onFocus=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onFocus)==null||a.call(s,l,i),G(this,Ei).emit("focus",l,i)},this.setContent=(i,{triggerChange:s=!1}={})=>{const{doc:a}=this.manager.createState({content:i}),l=this.getState(),{state:c}=this.getState().applyTransaction(l.tr.replaceRangeWith(0,l.doc.nodeSize-2,a));if(s)return this.updateState({state:c,triggerChange:s});this.view.updateState(c)},this.clearContent=({triggerChange:i=!1}={})=>{this.setContent(this.manager.createEmptyDoc(),{triggerChange:i})},this.createStateFromContent=(i,s)=>this.manager.createState({content:i,selection:s}),this.focus=i=>{this.manager.store.commands.focus(i)},this.blur=i=>{this.manager.store.commands.blur(i)};const{getProps:t,initialEditorState:r,element:n}=e;if(Lt(this,Dc,t),Lt(this,Vf,r),this.manager.attachFramework(this,this.updateListener.bind(this)),this.manager.view)return;const o=this.createView(r,n);this.manager.addView(o)}get addHandler(){return G(this,Ff)??Lt(this,Ff,G(this,Ei).on.bind(G(this,Ei)))}get updatableViewProps(){return{attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0}}get firstRender(){return G(this,Wa)}get props(){return G(this,Dc).call(this)}get previousState(){return this.previousStateOverride??G(this,Bf)??this.initialEditorState}get manager(){return this.props.manager}get view(){return this.manager.view}get uid(){return G(this,Hf)}get initialEditorState(){return G(this,Vf)}updateListener(e){const{state:t,tr:r}=e;return G(this,Ei).emit("updated",this.eventListenerProps({state:t,tr:r}))}update(e){const{getProps:t}=e;return Lt(this,Dc,t),this}updateViewProps(...e){const t=b1(this.updatableViewProps,e);this.view.setProps({...this.view.props,...t})}getAttributes(e){var t;const{attributes:r,autoFocus:n,classNames:o=[],label:i,editable:s}=this.props,a=(t=this.manager.store)==null?void 0:t.attributes,l=_e(r)?r(this.eventListenerProps()):r;let c={};(n||Jt(n))&&(c=e?{autoFocus:!0}:{autofocus:"true"});const u=Ml(Vu(e&&"Prosemirror","remirror-editor",a==null?void 0:a.class,...o).split(" ")).join(" "),d={role:"textbox",...c,"aria-multiline":"true",...s??!0?{}:{"aria-readonly":"true"},"aria-label":i??"",...a,class:u};return j4({...d,...l})}addFocusListeners(){this.view.dom.addEventListener("blur",this.onBlur),this.view.dom.addEventListener("focus",this.onFocus)}removeFocusListeners(){this.view.dom.removeEventListener("blur",this.onBlur),this.view.dom.removeEventListener("focus",this.onFocus)}destroy(){G(this,Ei).emit("destroy"),this.view&&this.removeFocusListeners()}eventListenerProps(e=ee()){const{state:t,tr:r,transactions:n}=e;return{tr:r,transactions:n,internalUpdate:!r,view:this.view,firstRender:G(this,Wa),state:t??this.getState(),createStateFromContent:this.createStateFromContent,previousState:this.previousState,helpers:this.manager.store.helpers}}get baseOutput(){return{manager:this.manager,...this.manager.store,addHandler:this.addHandler,focus:this.focus,blur:this.blur,uid:G(this,Hf),view:this.view,getState:this.getState,getPreviousState:this.getPreviousState,getExtension:this.manager.getExtension.bind(this.manager),hasExtension:this.manager.hasExtension.bind(this.manager),clearContent:this.clearContent,setContent:this.setContent}}};Hf=new WeakMap;Dc=new WeakMap;Bf=new WeakMap;Wa=new WeakMap;Ei=new WeakMap;Ff=new WeakMap;Vf=new WeakMap;function oI(e,t){const r=[],n=new WeakMap,o=[],i=new WeakMap;let s=[];const a={duplicateMap:i,parentExtensions:o,gatheredExtensions:s,settings:t};for(const d of e)X5(a,{extension:d});s=ra(s,(d,f)=>f.priority-d.priority);const l=new WeakSet,c=new Set;for(const d of s){const f=d.constructor,p=d.name,h=i.get(f);te(h,{message:`No entries were found for the ExtensionConstructor ${d.name}`,code:H.INTERNAL}),!(l.has(f)||c.has(p))&&(l.add(f),c.add(p),r.push(d),n.set(f,d),h.forEach(m=>m==null?void 0:m.replaceChildExtension(f,d)))}const u=[];for(const d of r)iI({extension:d,found:l,missing:u});return te(Mo(u),{code:H.MISSING_REQUIRED_EXTENSION,message:u.map(({Constructor:d,extension:f})=>`The extension '${f.name}' requires '${d.name} in order to run correctly.`).join(` -`)}),{extensions:r,extensionMap:n}}function X5(e,t){var r;const{gatheredExtensions:n,duplicateMap:o,parentExtensions:i,settings:s}=e,{extension:a,parentExtension:l}=t;let{names:c=[]}=t;te(G5(a),{code:H.INVALID_MANAGER_EXTENSION,message:`An invalid extension: ${a} was provided to the [[\`RemirrorManager\`]].`});const u=a.extensions;if(a.setPriority((r=s.priority)==null?void 0:r[a.name]),n.push(a),sI({duplicateMap:o,extension:a,parentExtension:l}),u.length!==0){if(c.includes(a.name)){`${c.join(" > ")}${a.name}`;return}c=[...c,a.name],i.push(a);for(const d of u)X5(e,{names:c,extension:d,parentExtension:a})}}function iI(e){const{extension:t,found:r,missing:n}=e;if(t.requiredExtensions)for(const o of t.requiredExtensions??[])r.has(o)||n.push({Constructor:o,extension:t})}function sI(e){const{duplicateMap:t,extension:r,parentExtension:n}=e,o=r.constructor,i=t.get(o),s=n?[n]:[];t.set(o,i?[...i,...s]:s)}function aI(e){var t,r,n,o;const{extension:i,nodeNames:s,markNames:a,plainNames:l,store:c,handlers:u}=e;i.setStore(c);const d=(t=i.onCreate)==null?void 0:t.bind(i),f=(r=i.onView)==null?void 0:r.bind(i),p=(n=i.onStateUpdate)==null?void 0:n.bind(i),h=(o=i.onDestroy)==null?void 0:o.bind(i);d&&u.create.push(d),f&&u.view.push(f),p&&u.update.push(p),h&&u.destroy.push(h),Vh(i)&&a.push(i.name),$d(i)&&i.name!=="doc"&&s.push(i.name),Y5(i)&&l.push(i.name)}var Ci,$c,Un,$o,Hc,Qr,Cs,Bc,Ms,Fc,Ts,Wn,Vc,jf=class{constructor(e,t={}){kt(this,Ci,void 0),kt(this,$c,ee()),kt(this,Un,ee()),kt(this,$o,void 0),kt(this,Hc,void 0),kt(this,Qr,Nr.None),kt(this,Cs,void 0),kt(this,Bc,!0),kt(this,Ms,{create:[],view:[],update:[],destroy:[]}),kt(this,Fc,[]),kt(this,Ts,Bh()),kt(this,Wn,void 0),kt(this,Vc,void 0),this.getState=()=>{var o;return G(this,Qr)>=Nr.EditorView?this.view.state:(te(G(this,Wn),{code:H.MANAGER_PHASE_ERROR,message:"`getState` can only be called after the `Framework` or the `EditorView` has been added to the manager`. Check your plugins to make sure that the decorations callback uses the state argument."}),(o=G(this,Wn))==null?void 0:o.initialEditorState)},this.updateState=o=>{const i=this.getState();this.view.updateState(o),this.onStateUpdate({previousState:i,state:o})};const{extensions:r,extensionMap:n}=oI(e,t);Lt(this,Cs,t),Lt(this,$o,Hs(r)),Lt(this,Hc,n),Lt(this,Ci,this.createExtensionStore()),Lt(this,Qr,Nr.Create),this.setupLifecycleHandlers();for(const o of G(this,Ms).create){const i=o();i&&G(this,Fc).push(i)}}static create(e,t={}){return new jf([...J4(e),...rI(t.builtin)],t)}get[ti](){return $t.Manager}get destroyed(){return G(this,Qr)===Nr.Destroy}get mounted(){return G(this,Qr)>=Nr.EditorView&&G(this,Qr)G(this,$o),enumerable:t},phase:{get:()=>G(this,Qr),enumerable:t},view:{get:()=>this.view,enumerable:t},managerSettings:{get:()=>Hs(G(this,Cs)),enumerable:t},getState:{value:this.getState,enumerable:t},updateState:{value:this.updateState,enumerable:t},isMounted:{value:()=>this.mounted,enumerable:t},getExtension:{value:this.getExtension.bind(this),enumerable:t},manager:{get:()=>this,enumerable:t},document:{get:()=>this.document,enumerable:t},stringHandlers:{get:()=>G(this,$c),enumerable:t},currentState:{get:()=>r??(r=this.getState()),set:o=>{r=o},enumerable:t},previousState:{get:()=>n,set:o=>{n=o},enumerable:t}}),e.getStoreKey=this.getStoreKey.bind(this),e.setStoreKey=this.setStoreKey.bind(this),e.setExtensionStore=this.setExtensionStore.bind(this),e.setStringHandler=this.setStringHandler.bind(this),e}addView(e){if(G(this,Qr)>=Nr.EditorView)return this;Lt(this,Bc,!0),Lt(this,Qr,Nr.EditorView),G(this,Un).view=e;for(const t of G(this,Ms).view){const r=t(e);r&&G(this,Fc).push(r)}return this}attachFramework(e,t){var r;G(this,Wn)!==e&&(G(this,Wn)&&(G(this,Wn).destroy(),(r=G(this,Vc))==null||r.call(this)),Lt(this,Wn,e),Lt(this,Vc,this.addHandler("stateUpdate",t)))}createEmptyDoc(){var e;const t=(e=this.schema.nodes.doc)==null?void 0:e.createAndFill();return te(t,{code:H.INVALID_CONTENT,message:"An empty node could not be created due to an invalid schema."}),t}createState(e={}){const{onError:t,defaultSelection:r="end"}=this.settings,{content:n=this.createEmptyDoc(),selection:o=r,stringHandler:i=this.settings.stringHandler}=e,{schema:s,plugins:a}=this.store,l=M5({stringHandler:ne(i)?this.stringHandlers[i]:i,document:this.document,content:n,onError:t,schema:s,selection:o});return Bs.create({schema:s,doc:l,plugins:a,selection:jr(o,l)})}addHandler(e,t){return G(this,Ts).on(e,t)}onStateUpdate(e){const t=G(this,Bc);G(this,Ci).currentState=e.state,G(this,Ci).previousState=e.previousState,t&&(Lt(this,Qr,Nr.Runtime),Lt(this,Bc,!1));const r={...e,firstUpdate:t};for(const n of G(this,Ms).update)n(r);G(this,Ts).emit("stateUpdate",r)}getExtension(e){const t=G(this,Hc).get(e);return te(t,{code:H.INVALID_MANAGER_EXTENSION,message:`'${e.name}' doesn't exist within this manager. Make sure it is properly added before attempting to use it.`}),t}hasExtension(e){return!!G(this,Hc).get(e)}clone(){const e=G(this,$o).map(r=>r.clone(r.options)),t=jf.create(()=>e,G(this,Cs));return G(this,Ts).emit("clone",t),t}recreate(e=[],t={}){const r=G(this,$o).map(o=>o.clone(o.initialOptions)),n=jf.create(()=>[...r,...e],t);return G(this,Ts).emit("recreate",n),n}destroy(){var e,t,r,n,o,i;Lt(this,Qr,Nr.Destroy);for(const s of((e=this.view)==null?void 0:e.state.plugins)??[])(r=(t=s.getState(this.view.state))==null?void 0:t.destroy)==null||r.call(t);(n=G(this,Wn))==null||n.destroy(),(o=G(this,Vc))==null||o.call(this);for(const s of G(this,Fc))s();for(const s of G(this,Ms).destroy)s();(i=this.view)==null||i.destroy(),G(this,Ts).emit("destroy")}includes(e){const t=[],r=[];for(const n of G(this,$o))t.push(n.name,n.constructorName),r.push(n.constructor);return e.every(n=>ne(n)?dr(t,n):dr(r,n))}},lI=jf;Ci=new WeakMap;$c=new WeakMap;Un=new WeakMap;$o=new WeakMap;Hc=new WeakMap;Qr=new WeakMap;Cs=new WeakMap;Bc=new WeakMap;Ms=new WeakMap;Fc=new WeakMap;Ts=new WeakMap;Wn=new WeakMap;Vc=new WeakMap;function cI(e,t){return!nc(e)||!oc(e,$t.Manager)?!1:t?e.includes(t):!0}var uI=Object.defineProperty,dI=Object.getOwnPropertyDescriptor,Hd=(e,t,r,n)=>{for(var o=n>1?void 0:n?dI(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&uI(t,r,o),o},Q5=/\S+/g;function Z5(e){return e.type.isTextblock?1:e.type.isText?e.textBetween(0,e.nodeSize).length:0}function fI({doc:e},t){let r=0,n=0;return e.nodesBetween(0,e.nodeSize-2,(o,i)=>{if(n>0)return!1;const s=Z5(o);return r+s>t?(n=i+1+(t-r),!1):(r+=s,!0)}),n}function pI({doc:e},t){let r=0,n=0;return e.nodesBetween(0,e.nodeSize-2,(o,i)=>{if(n>0)return!1;if(!o.type.isText)return!0;const s=o.textBetween(0,o.nodeSize),a=xa(s,Q5);if(r+a.length>t){const l=t-r,c=a[l];return n=i+((c==null?void 0:c.index)??0),!1}return r+=a.length,!0}),n}var is=class extends Ve{get name(){return"count"}getCountMaximum(){return this.options.maximum}getCharacterCount(e=this.store.getState()){let t=0;return e.doc.nodesBetween(0,e.doc.nodeSize-2,r=>(t+=Z5(r),!0)),Math.max(t-1,0)}getWordCount(e=this.store.getState()){const t=this.store.helpers.getText({lineBreakDivider:" ",state:e});return xa(t,Q5).length}isCountValid(e=this.store.getState()){const{maximumStrategy:t,maximum:r}=this.options;return r<1?!0:t==="CHARACTERS"?this.store.helpers.getCharacterCount(e)<=r:this.store.helpers.getWordCount(e)<=r}createDecorationSet(e){const{maximum:t=-1,maximumStrategy:r,maximumExceededClassName:n}=this.options,s=(r==="CHARACTERS"?fI:pI)(e,t);return Ee.create(e.doc,[Ge.inline(s,e.doc.nodeSize-2,{class:n})])}createExternalPlugins(){const{maximum:e}=this.options,t=new Ro({state:{init:(r,n)=>this.isCountValid(n)?{decorationSet:Ee.empty}:{decorationSet:this.createDecorationSet(n)},apply:(r,n,o,i)=>!r.docChanged||e<1?n:this.isCountValid(i)?{decorationSet:Ee.empty}:{decorationSet:this.createDecorationSet(i)}},props:{decorations(r){var n;return((n=t.getState(r))==null?void 0:n.decorationSet)??null}}});return[t]}};Hd([He()],is.prototype,"getCountMaximum",1);Hd([He()],is.prototype,"getCharacterCount",1);Hd([He()],is.prototype,"getWordCount",1);Hd([He()],is.prototype,"isCountValid",1);is=Hd([me({defaultOptions:{maximum:-1,maximumExceededClassName:"remirror-max-count-exceeded",maximumStrategy:"CHARACTERS"},staticKeys:["maximum","maximumStrategy","maximumExceededClassName"]})],is);var eC={exports:{}},pn={},tC={exports:{}},rC={};/** +`,zi)}getHTML(e=this.store.getState()){return _z(e.doc,this.store.document)}textToProsemirrorNode(e){const t=`
    ${e.content}
    `;return this.store.stringHandlers.html({...e,content:t})}};Z([He()],Rn.prototype,"isSelectionEmpty",1);Z([He()],Rn.prototype,"isViewEditable",1);Z([He()],Rn.prototype,"getStateJSON",1);Z([He()],Rn.prototype,"getJSON",1);Z([He()],Rn.prototype,"getRemirrorJSON",1);Z([U()],Rn.prototype,"insertHtml",1);Z([He()],Rn.prototype,"getText",1);Z([He()],Rn.prototype,"getTextBetween",1);Z([He()],Rn.prototype,"getHTML",1);Rn=Z([pe({})],Rn);var K1=class extends Ve{get name(){return"inputRules"}onCreate(){this.store.setExtensionStore("rebuildInputRules",this.rebuildInputRules.bind(this))}createExternalPlugins(){return[this.generateInputRulesPlugin()]}generateInputRulesPlugin(){var e,t;const r=[],n=this.store.markTags[oe.ExcludeInputRules];for(const o of this.store.extensions)if(!((e=this.store.managerSettings.exclude)!=null&&e.inputRules||!o.createInputRules||(t=o.options.exclude)!=null&&t.inputRules))for(const i of o.createInputRules())i.shouldSkip=this.options.shouldSkipInputRule,i.invalidMarks=n,r.push(i);return VR({rules:r})}rebuildInputRules(){this.store.updateExtensionPlugins(this)}};K1=Z([pe({defaultPriority:Ae.Default,handlerKeys:["shouldSkipInputRule"],handlerKeyOptions:{shouldSkipInputRule:{earlyReturnValue:!0}}})],K1);var Qn=class extends Ve{constructor(){super(...arguments),this.extraKeyBindings=[],this.backwardMarkExitTracker=new Map,this.keydownHandler=null,this.onAddCustomHandler=({keymap:e})=>{var t,r;if(e)return this.extraKeyBindings=[...this.extraKeyBindings,e],(r=(t=this.store).rebuildKeymap)==null||r.call(t),()=>{var n,o;this.extraKeyBindings=this.extraKeyBindings.filter(i=>i!==e),(o=(n=this.store).rebuildKeymap)==null||o.call(n)}},this.rebuildKeymap=()=>{this.setupKeydownHandler()}}get name(){return"keymap"}get shortcutMap(){const{shortcuts:e}=this.options;return ne(e)?GL[e]:e}onCreate(){this.store.setExtensionStore("rebuildKeymap",this.rebuildKeymap)}createExternalPlugins(){var e;return(e=this.store.managerSettings.exclude)!=null&&e.keymap?[]:(this.setupKeydownHandler(),[new Ro({props:{handleKeyDown:(t,r)=>{var n;return(n=this.keydownHandler)==null?void 0:n.call(this,t,r)}}})])}setupKeydownHandler(){const e=this.generateKeymapBindings();this.keydownHandler=Jv(e)}generateKeymapBindings(){var e;const t=[],r=this.shortcutMap,n=this.store.getExtension(xe),o=a=>l=>Bf({shortcut:l,map:r,store:this.store,options:a.options});for(const a of this.store.extensions){const l=a.decoratedKeybindings??{};if(!((e=a.options.exclude)!=null&&e.keymap)){a.createKeymap&&t.push(KL(a.createKeymap(o(a)),r));for(const[c,u]of At(l)){if(u.isActive&&!u.isActive(a.options,this.store))continue;const d=a[c].bind(a),f=Bf({shortcut:u.shortcut,map:r,options:a.options,store:this.store}),p=_e(u.priority)?u.priority(a.options,this.store):u.priority??Ae.Low,h=ee();for(const m of f)h[m]=d;t.push([p,h]),u.command&&n.updateDecorated(u.command,{shortcut:f})}}}const i=this.sortKeymaps([...this.extraKeyBindings,...t]);return az(i)}arrowRightShortcut(e){const t=this.store.markTags[oe.PreventExits],r=this.store.nodeTags[oe.PreventExits];return this.exitMarkForwards(t,r)(e)}arrowLeftShortcut(e){const t=this.store.markTags[oe.PreventExits],r=this.store.nodeTags[oe.PreventExits];return Np(this.exitNodeBackwards(r),this.exitMarkBackwards(t,r))(e)}backspace(e){const t=this.store.markTags[oe.PreventExits],r=this.store.nodeTags[oe.PreventExits];return Np(this.exitNodeBackwards(r,!0),this.exitMarkBackwards(t,r,!0))(e)}createKeymap(){const{selectParentNodeOnEscape:e,undoInputRuleOnBackspace:t,excludeBaseKeymap:r}=this.options,n=ee();if(!r)for(const[o,i]of At(kg))n[o]=bu(i);return t&&kg.Backspace&&(n.Backspace=bu(Vh(jR,kg.Backspace))),e&&(n.Escape=bu(rL)),[Ae.Low,n]}getNamedShortcut(e,t={}){return e.startsWith("_|")?Bf({shortcut:e,map:this.shortcutMap,store:this.store,options:t}):[e]}onSetOptions(e){var t,r;const{changes:n}=e;(n.excludeBaseKeymap.changed||n.selectParentNodeOnEscape.changed||n.undoInputRuleOnBackspace.changed)&&((r=(t=this.store).rebuildKeymap)==null||r.call(t))}sortKeymaps(e){return ra(e.map(t=>ct(t)?t:[Ae.Default,t]),(t,r)=>r[0]-t[0]).map(t=>t[1])}exitMarkForwards(e,t){return r=>{const{tr:n,dispatch:o}=r;if(!Rz(n.selection)||ts({selection:n.selection,types:t}))return!1;const a=n.selection.$from.marks().filter(l=>!e.includes(l.type.name));if(Mo(a))return!1;if(!o)return!0;for(const l of a)n.removeStoredMark(l);return o(n.insertText(" ",n.selection.from)),!0}}exitNodeBackwards(e,t=!1){return r=>{const{tr:n}=r;if(!(t?u2:U1)(n.selection))return!1;const i=n.selection.$anchor.node();return!Bh(i)||vz(i)||e.includes(i.type.name)?!1:this.store.commands.toggleBlockNodeItem.original({type:i.type})(r)}}exitMarkBackwards(e,t,r=!1){return n=>{const{tr:o,dispatch:i}=n;if(!(r?u2:U1)(o.selection)||this.backwardMarkExitTracker.has(o.selection.anchor))return this.backwardMarkExitTracker.clear(),!1;if(ts({selection:o.selection,types:t}))return!1;const l=[...o.storedMarks??[],...o.selection.$from.marks()].filter(c=>!e.includes(c.type.name));if(Mo(l))return!1;if(!i)return!0;for(const c of l)o.removeStoredMark(c);return this.backwardMarkExitTracker.set(o.selection.anchor,!0),i(o),!0}}};Z([je({shortcut:"ArrowRight",isActive:e=>e.exitMarksOnArrowPress})],Qn.prototype,"arrowRightShortcut",1);Z([je({shortcut:"ArrowLeft",isActive:e=>e.exitMarksOnArrowPress})],Qn.prototype,"arrowLeftShortcut",1);Z([je({shortcut:"Backspace",isActive:e=>e.exitMarksOnArrowPress})],Qn.prototype,"backspace",1);Z([He()],Qn.prototype,"getNamedShortcut",1);Qn=Z([pe({defaultPriority:Ae.Low,defaultOptions:{shortcuts:"default",undoInputRuleOnBackspace:!0,selectParentNodeOnEscape:!1,excludeBaseKeymap:!1,exitMarksOnArrowPress:!0},customHandlerKeys:["keymap"]})],Qn);function WL(e){return fr(Ah(D),e)}function Bf({shortcut:e,map:t,options:r,store:n}){return ne(e)?[q1(e,t)]:ct(e)?e.map(o=>q1(o,t)):(e=e(r,n),Bf({shortcut:e,map:t,options:r,store:n}))}function q1(e,t){return WL(e)?t[e]:e}function KL(e,t){const r={};let n,o;ct(e)?[o,n]=e:n=e;for(const[i,s]of At(n))r[q1(i,t)]=s;return Nh(o)?r:[o,r]}var e5={[D.Copy]:"Mod-c",[D.Cut]:"Mod-x",[D.Paste]:"Mod-v",[D.PastePlain]:"Mod-Shift-v",[D.SelectAll]:"Mod-a",[D.Undo]:"Mod-z",[D.Redo]:on.isMac?"Shift-Mod-z":"Mod-y",[D.Bold]:"Mod-b",[D.Italic]:"Mod-i",[D.Underline]:"Mod-u",[D.Strike]:"Mod-d",[D.Code]:"Mod-`",[D.Paragraph]:"Mod-Shift-0",[D.H1]:"Mod-Shift-1",[D.H2]:"Mod-Shift-2",[D.H3]:"Mod-Shift-3",[D.H4]:"Mod-Shift-4",[D.H5]:"Mod-Shift-5",[D.H6]:"Mod-Shift-6",[D.TaskList]:"Mod-Shift-7",[D.BulletList]:"Mod-Shift-8",[D.OrderedList]:"Mod-Shift-9",[D.Quote]:"Mod->",[D.Divider]:"Mod-Shift-|",[D.Codeblock]:"Mod-Shift-~",[D.ClearFormatting]:"Mod-Shift-C",[D.Superscript]:"Mod-.",[D.Subscript]:"Mod-,",[D.LeftAlignment]:"Mod-Shift-L",[D.CenterAlignment]:"Mod-Shift-E",[D.RightAlignment]:"Mod-Shift-R",[D.JustifyAlignment]:"Mod-Shift-J",[D.InsertLink]:"Mod-k",[D.Find]:"Mod-f",[D.FindBackwards]:"Mod-Shift-f",[D.FindReplace]:"Mod-Shift-H",[D.AddFootnote]:"Mod-Alt-f",[D.AddComment]:"Mod-Alt-m",[D.ContextMenu]:"Mod-Shift-\\",[D.IncreaseFontSize]:"Mod-Shift-.",[D.DecreaseFontSize]:"Mod-Shift-,",[D.IncreaseIndent]:"Tab",[D.DecreaseIndent]:"Shift-Tab",[D.Shortcuts]:"Mod-/",[D.Format]:on.isMac?"Alt-Shift-f":"Shift-Ctrl-f"},qL={...e5,[D.Strike]:"Mod-Shift-S",[D.Code]:"Mod-Shift-M",[D.Paragraph]:"Mod-Alt-0",[D.H1]:"Mod-Alt-1",[D.H2]:"Mod-Alt-2",[D.H3]:"Mod-Alt-3",[D.H4]:"Mod-Alt-4",[D.H5]:"Mod-Alt-5",[D.H6]:"Mod-Alt-6",[D.OrderedList]:"Mod-Alt-7",[D.BulletList]:"Mod-Alt-8",[D.Quote]:"Mod-Alt-9",[D.ClearFormatting]:"Mod-\\",[D.IncreaseIndent]:"Mod-[",[D.DecreaseIndent]:"Mod-]"},GL={default:e5,googleDoc:qL},YL=class extends Ve{get name(){return"nodeViews"}createPlugin(){const e=[],t=ee();for(const r of this.store.extensions){if(!r.createNodeViews)continue;const n=r.createNodeViews();e.unshift(_e(n)?{[r.name]:n}:n)}e.unshift(this.store.managerSettings.nodeViews??{});for(const r of e)Object.assign(t,r);return{props:{nodeViews:t}}}},JL=class extends Ve{get name(){return"pasteRules"}createExternalPlugins(){return[this.generatePasteRulesPlugin()]}generatePasteRulesPlugin(){var e,t;const r=[];for(const n of this.store.extensions){if((e=this.store.managerSettings.exclude)!=null&&e.pasteRules||!n.createPasteRules||(t=n.options.exclude)!=null&&t.pasteRules)continue;const o=n.createPasteRules(),i=ct(o)?o:[o];r.push(...i)}return gL(r)}},zp=class extends Ve{constructor(){super(...arguments),this.plugins=[],this.managerPlugins=[],this.applyStateHandlers=[],this.initStateHandlers=[],this.appendTransactionHandlers=[],this.pluginKeys=ee(),this.stateGetters=new Map,this.getPluginStateCreator=e=>t=>e.getState(t??this.store.getState()),this.getStateByName=e=>{const t=this.stateGetters.get(e);return te(t,{message:"No plugin exists for the requested extension name."}),t()}}get name(){return"plugins"}onCreate(){const{setStoreKey:e,setExtensionStore:t,managerSettings:r,extensions:n}=this.store;this.updateExtensionStore();const{plugins:o=[]}=r;this.updatePlugins(o,this.managerPlugins);for(const i of n)i.onApplyState&&this.applyStateHandlers.push(i.onApplyState.bind(i)),i.onInitState&&this.initStateHandlers.push(i.onInitState.bind(i)),i.onAppendTransaction&&this.appendTransactionHandlers.push(i.onAppendTransaction.bind(i)),this.extractExtensionPlugins(i);this.managerPlugins=o,this.store.setStoreKey("plugins",this.plugins),e("pluginKeys",this.pluginKeys),e("getPluginState",this.getStateByName),t("getPluginState",this.getStateByName)}createPlugin(){return{appendTransaction:(e,t,r)=>{const n=r.tr,o={previousState:t,tr:n,transactions:e,state:r};for(const i of this.appendTransactionHandlers)i(o);return this.options.appendTransaction(o),n.docChanged||n.steps.length>0||n.selectionSet||n.storedMarksSet?n:void 0},state:{init:(e,t)=>{for(const r of this.initStateHandlers)r(t)},apply:(e,t,r,n)=>{const o={previousState:r,state:n,tr:e};for(const i of this.applyStateHandlers)i(o);this.options.applyState(o)}}}}extractExtensionPlugins(e){var t,r;if(!(!e.createPlugin&&!e.createExternalPlugins||(t=this.store.managerSettings.exclude)!=null&&t.plugins||(r=e.options.exclude)!=null&&r.plugins)){if(e.createPlugin){const o=new ka(e.name);this.pluginKeys[e.name]=o;const i=this.getPluginStateCreator(o);e.pluginKey=o,e.getPluginState=i,this.stateGetters.set(e.name,i),this.stateGetters.set(e.constructor,i);const s={...e.createPlugin(),key:o},a=new Ro(s);this.updatePlugins([a],e.plugin?[e.plugin]:void 0),e.plugin=a}if(e.createExternalPlugins){const o=e.createExternalPlugins();this.updatePlugins(o,e.externalPlugins),e.externalPlugins=o}}}updatePlugins(e,t){if(!t||Mo(t)){this.plugins=[...this.plugins,...e];return}if(e.length!==t.length){this.plugins=[...this.plugins.filter(n=>!t.includes(n)),...e];return}const r=new Map;for(const[n,o]of e.entries())r.set(it(t,n),o);this.plugins=this.plugins.map(n=>t.includes(n)?r.get(n):n)}updateExtensionStore(){const{setExtensionStore:e}=this.store;e("updatePlugins",this.updatePlugins.bind(this)),e("dispatchPluginUpdate",this.dispatchPluginUpdate.bind(this)),e("updateExtensionPlugins",this.updateExtensionPlugins.bind(this))}updateExtensionPlugins(e){const t=QC(e)?e:LL(e)?this.store.manager.getExtension(e):this.store.extensions.find(r=>r.name===e);te(t,{code:H.INVALID_MANAGER_EXTENSION,message:`The extension ${e} does not exist within the editor.`}),this.extractExtensionPlugins(t),this.store.setStoreKey("plugins",this.plugins),this.dispatchPluginUpdate()}dispatchPluginUpdate(){te(this.store.phase>=Nr.EditorView,{code:H.MANAGER_PHASE_ERROR,message:"`dispatchPluginUpdate` should only be called after the view has been added to the manager."});const{view:e,updateState:t}=this.store,r=e.state.reconfigure({plugins:this.plugins});t(r)}};zp=Z([pe({defaultPriority:Ae.Highest,handlerKeys:["applyState","appendTransaction"]})],zp);var G1=class extends Ve{constructor(){super(...arguments),this.dynamicAttributes={marks:ee(),nodes:ee()}}get name(){return"schema"}onCreate(){const{managerSettings:e,tags:t,markNames:r,nodeNames:n,extensions:o}=this.store,{defaultBlockNode:i,disableExtraAttributes:s,nodeOverride:a,markOverride:l}=e,c=h=>!!(h&&t[oe.Block].includes(h));if(e.schema){const{nodes:h,marks:m}=oI(e.schema);this.addSchema(e.schema,h,m);return}const u=c(i)?{doc:ee(),[i]:ee()}:ee(),d=ee(),f=XL({settings:e,gatheredSchemaAttributes:this.gatherExtraAttributes(o),nodeNames:n,markNames:r,tags:t});for(const h of o){f[h.name]={...f[h.name],...h.options.extraAttributes};const m=s===!0||h.options.disableExtraAttributes===!0||h.constructor.disableExtraAttributes===!0;if(Hd(h)){const{spec:b,dynamic:v}=m2({createExtensionSpec:(g,y)=>h.createNodeSpec(g,y),extraAttributes:it(f,h.name),override:{...a,...h.options.nodeOverride},ignoreExtraAttributes:m,name:h.constructorName,tags:h.tags});h.spec=b,u[h.name]=b,Object.keys(v).length>0&&(this.dynamicAttributes.nodes[h.name]=v)}if(Wh(h)){const{spec:b,dynamic:v}=m2({createExtensionSpec:(g,y)=>h.createMarkSpec(g,y),extraAttributes:it(f,h.name),override:{...l,...h.options.markOverride},ignoreExtraAttributes:m,name:h.constructorName,tags:h.tags??[]});h.spec=b,d[h.name]=b,Object.keys(v).length>0&&(this.dynamicAttributes.marks[h.name]=v)}}const p=new PA({nodes:u,marks:d,topNode:"doc"});this.addSchema(p,u,d)}createPlugin(){return{appendTransaction:(e,t,r)=>{const{tr:n}=r;return!e.some(i=>i.docChanged)||Object.keys(this.dynamicAttributes.nodes).length===0&&Object.keys(this.dynamicAttributes.marks).length===0?null:(n.doc.descendants((i,s)=>(this.checkAndUpdateDynamicNodes(i,s,n),this.checkAndUpdateDynamicMarks(i,s,n),!0)),n.steps.length>0?n:null)}}}addSchema(e,t,r){this.store.setStoreKey("nodes",t),this.store.setStoreKey("marks",r),this.store.setStoreKey("schema",e),this.store.setExtensionStore("schema",e),this.store.setStoreKey("defaultBlockNode",Hh(e).name);for(const n of Object.values(e.nodes))if(n.name!=="doc"&&(n.isBlock||n.isTextblock))break}checkAndUpdateDynamicNodes(e,t,r){for(const[n,o]of At(this.dynamicAttributes.nodes))if(e.type.name===n)for(const[i,s]of At(o)){if(!Zi(e.attrs[i]))continue;const a={...e.attrs,[i]:s(e)};r.setNodeMarkup(t,void 0,a),s2(r)}}checkAndUpdateDynamicMarks(e,t,r){for(const[n,o]of At(this.dynamicAttributes.marks)){const i=it(this.store.schema.marks,n),s=e.marks.find(a=>a.type.name===n);if(s)for(const[a,l]of At(o)){if(!Zi(s.attrs[a]))continue;const c=_o(r.doc.resolve(t),i);if(!c)continue;const{from:u,to:d}=c,f=i.create({...s.attrs,[a]:l(s)});r.removeMark(u,d,i).addMark(u,d,f),s2(r)}}}gatherExtraAttributes(e){const t=[];for(const r of e)r.createSchemaAttributes&&t.push(...r.createSchemaAttributes());return t}};G1=Z([pe({defaultPriority:Ae.Highest})],G1);function XL(e){const{settings:t,gatheredSchemaAttributes:r,nodeNames:n,markNames:o,tags:i}=e,s=ee();if(t.disableExtraAttributes)return s;const a=[...r,...t.extraAttributes??[]];for(const l of a??[]){const c=ZL({identifiers:l.identifiers,nodeNames:n,markNames:o,tags:i});for(const u of c){const d=s[u]??{};s[u]={...d,...l.attributes}}}return s}function QL(e){return hs(e)&&ct(e.tags)}function ZL(e){const{identifiers:t,nodeNames:r,markNames:n,tags:o}=e;if(t==="nodes")return r;if(t==="marks")return n;if(t==="all")return[...r,...n];if(ct(t))return t;te(QL(t),{code:H.EXTENSION_EXTRA_ATTRIBUTES,message:"Invalid value passed as an identifier when creating `extraAttributes`."});const{tags:i=[],names:s=[],behavior:a="any",excludeNames:l,excludeTags:c,type:u}=t,d=new Set,f=u==="mark"?n:u==="node"?r:[...n,...r],p=m=>f.includes(m)&&!(l!=null&&l.includes(m));for(const m of s)p(m)&&d.add(m);const h=new Map;for(const m of i)if(!(c!=null&&c.includes(m)))for(const b of o[m]){if(!p(b))continue;if(a==="any"){d.add(b);continue}const v=h.get(b)??new Set;v.add(m),h.set(b,v)}for(const[m,b]of h)b.size===i.length&&d.add(m);return[...d]}function m2(e){var t;const{createExtensionSpec:r,extraAttributes:n,ignoreExtraAttributes:o,name:i,tags:s,override:a}=e,l=ee();function c(b,v){l[b]=v}let u=!1;function d(){u=!0}const f=eI(n,o,d,c),p=tI(n,o),h=rI(n,o),m=r({defaults:f,parse:p,dom:h},a);return te(o||u,{code:H.EXTENSION_SPEC,message:`When creating a node specification you must call the 'defaults', and parse, and 'dom' methods. To avoid this error you can set the static property 'disableExtraAttributes' of '${i}' to 'true'.`}),m.group=[...((t=m.group)==null?void 0:t.split(" "))??[],...s].join(" ")||void 0,{spec:m,dynamic:l}}function Xv(e){return ne(e)||_e(e)?{default:e}:(te(e,{message:`${W4(e)} is not supported`,code:H.EXTENSION_EXTRA_ATTRIBUTES}),e)}function eI(e,t,r,n){return()=>{r();const o=ee();if(t)return o;for(const[i,s]of At(e)){let l=Xv(s).default;_e(l)&&(n(i,l),l=null),o[i]=l===void 0?{}:{default:l}}return o}}function tI(e,t){return r=>{const n=ee();if(t)return n;for(const[o,i]of At(e)){const{parseDOM:s,...a}=Xv(i);if(Je(r)){if(Zi(s)){n[o]=r.getAttribute(o)??a.default;continue}if(_e(s)){n[o]=s(r)??a.default;continue}n[o]=r.getAttribute(s)??a.default}}return n}}function rI(e,t){return r=>{const n=ee();if(t)return n;function o(i,s){if(i){if(ne(i)){n[s]=i;return}if(ct(i)){const[a,l]=i;n[a]=l??r.attrs[s];return}for(const[a,l]of At(i))n[a]=l}}for(const[i,s]of At(e)){const{toDOM:a,parseDOM:l}=Xv(s);if(Zi(a)){const c=ne(l)?l:i;n[c]=r.attrs[i];continue}if(_e(a)){o(a(r.attrs,nI(r)),i);continue}o(a,i)}return n}}function nI(e){return Id(e)?{node:e}:pz(e)?{mark:e}:{}}function oI(e){const t=ee(),r=ee();for(const[n,o]of Object.entries(e.nodes))t[n]=o.spec;for(const[n,o]of Object.entries(e.marks))r[n]=o.spec;return{nodes:t,marks:r}}var Ll=class extends Ve{constructor(){super(...arguments),this.onAddCustomHandler=({suggester:e})=>{var t;if(!(!e||(t=this.store.managerSettings.exclude)!=null&&t.suggesters))return i2(this.store.getState(),e)}}get name(){return"suggest"}onCreate(){this.store.setExtensionStore("addSuggester",e=>i2(this.store.getState(),e)),this.store.setExtensionStore("removeSuggester",e=>K6(this.store.getState(),e))}createExternalPlugins(){var e,t;const r=[];for(const n of this.store.extensions){if((e=this.store.managerSettings.exclude)!=null&&e.suggesters)break;if(!n.createSuggesters||(t=n.options.exclude)!=null&&t.suggesters)continue;const o=n.createSuggesters(),i=ct(o)?o:[o];r.push(...i)}return[q6(...r)]}getSuggestState(e){return Fv(e??this.store.getState())}getSuggestMethods(){const{addIgnored:e,clearIgnored:t,removeIgnored:r,ignoreNextExit:n,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}=this.getSuggestState();return{addIgnored:e,clearIgnored:t,removeIgnored:r,ignoreNextExit:n,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}}isSuggesterActive(e){var t;return fr(ct(e)?e:[e],(t=this.getSuggestState().match)==null?void 0:t.suggester.name)}};Z([He()],Ll.prototype,"getSuggestState",1);Z([He()],Ll.prototype,"getSuggestMethods",1);Z([He()],Ll.prototype,"isSuggesterActive",1);Ll=Z([pe({customHandlerKeys:["suggester"]})],Ll);var Y1=class extends Ve{constructor(){super(...arguments),this.allTags=ee(),this.plainTags=ee(),this.markTags=ee(),this.nodeTags=ee()}get name(){return"tags"}onCreate(){this.resetTags();for(const e of this.store.extensions)this.updateTagForExtension(e);this.store.setStoreKey("tags",this.allTags),this.store.setExtensionStore("tags",this.allTags),this.store.setStoreKey("plainTags",this.plainTags),this.store.setExtensionStore("plainTags",this.plainTags),this.store.setStoreKey("markTags",this.markTags),this.store.setExtensionStore("markTags",this.markTags),this.store.setStoreKey("nodeTags",this.nodeTags),this.store.setExtensionStore("nodeTags",this.nodeTags)}resetTags(){const e=ee(),t=ee(),r=ee(),n=ee();for(const o of Ah(oe))e[o]=[],t[o]=[],r[o]=[],n[o]=[];this.allTags=e,this.plainTags=t,this.markTags=r,this.nodeTags=n}updateTagForExtension(e){var t,r;const n=new Set([...e.tags??[],...((t=e.createTags)==null?void 0:t.call(e))??[],...e.options.extraTags??[],...((r=this.store.managerSettings.extraTags)==null?void 0:r[e.name])??[]]);for(const o of n)te(iI(o),{code:H.EXTENSION,message:`The tag provided by the extension: ${e.constructorName} is not supported by the editor. To add custom tags you can use the 'mutateTag' method.`}),this.allTags[o].push(e.name),ZC(e)&&this.plainTags[o].push(e.name),Wh(e)&&this.markTags[o].push(e.name),Hd(e)&&this.nodeTags[o].push(e.name);e.tags=[...n]}};Y1=Z([pe({defaultPriority:Ae.Highest})],Y1);function iI(e){return fr(Ah(oe),e)}var sI=new ka("remirrorFilePlaceholderPlugin");function aI(){const e=new Ro({key:sI,state:{init(){return{set:Ee.empty,payloads:new Map}},apply(t,{set:r,payloads:n}){r=r.map(t.mapping,t.doc);const o=t.getMeta(e);if(o)if(o.type===0){const i=document.createElement("placeholder"),s=Ge.widget(o.pos,i,{id:o.id});r=r.add(t.doc,[s]),n.set(o.id,o.payload)}else o.type===1&&(r=r.remove(r.find(void 0,void 0,i=>i.id===o.id)),n.delete(o.id));return{set:r,payloads:n}}},props:{decorations(t){var r;return((r=e.getState(t))==null?void 0:r.set)??null}}});return e}var lI=class extends Ve{get name(){return"upload"}createExternalPlugins(){return[aI()]}};function cI(e={}){e={...{exitMarksOnArrowPress:Qn.defaultOptions.exitMarksOnArrowPress,excludeBaseKeymap:Qn.defaultOptions.excludeBaseKeymap,selectParentNodeOnEscape:Qn.defaultOptions.selectParentNodeOnEscape,undoInputRuleOnBackspace:Qn.defaultOptions.undoInputRuleOnBackspace,persistentSelectionClass:io.defaultOptions.persistentSelectionClass},...e};const r=w1(e,["excludeBaseKeymap","selectParentNodeOnEscape","undoInputRuleOnBackspace"]),n=w1(e,["persistentSelectionClass"]);return[new Y1,new G1,new IL,new zp,new K1,new JL,new YL,new Ll,new xe,new Rn,new Qn(r),new W1,new lI,new io(n)]}var g2=class extends Ve{get name(){return"meta"}onCreate(){if(this.store.setStoreKey("getCommandMeta",this.getCommandMeta.bind(this)),!!this.options.capture)for(const e of this.store.extensions)this.captureCommands(e),this.captureKeybindings(e)}createPlugin(){return{}}captureCommands(e){const t=e.decoratedCommands??{},r=e.createCommands;for(const n of Object.keys(t)){const o=e[n];e[n]=(...i)=>s=>{var a;const l=o(...i)(s);return s.dispatch&&l&&this.setCommandMeta(s.tr,{type:"command",chain:s.dispatch!==((a=s.view)==null?void 0:a.dispatch),name:n,extension:e.name,decorated:!0}),l}}r&&(e.createCommands=()=>{const n=r();for(const[o,i]of Object.entries(n))n[o]=(...s)=>a=>{var l;const c=i(...s)(a);return a.dispatch&&c&&this.setCommandMeta(a.tr,{type:"command",chain:a.dispatch!==((l=a.view)==null?void 0:l.dispatch),name:o,extension:e.name,decorated:!1}),c};return n})}captureKeybindings(e){}getCommandMeta(e){return e.getMeta(this.pluginKey)??[]}setCommandMeta(e,t){const r=this.getCommandMeta(e);e.setMeta(this.pluginKey,[...r,t])}};g2=Z([pe({defaultOptions:{capture:on.isDevelopment},staticKeys:["capture"],defaultPriority:Ae.Highest})],g2);var Ff,$c,Vf,Wa,Ei,jf,Uf,uI=class{constructor(e){kt(this,Ff,Cl()),kt(this,$c,void 0),kt(this,Vf,void 0),kt(this,Wa,!0),kt(this,Ei,jh()),kt(this,jf,void 0),kt(this,Uf,void 0),this.getState=()=>this.view.state??this.initialEditorState,this.getPreviousState=()=>this.previousState,this.dispatchTransaction=i=>{var s,a;te(!this.manager.destroyed,{code:H.MANAGER_PHASE_ERROR,message:"A transaction was dispatched to a manager that has already been destroyed. Please check your set up, or open an issue."}),i=((a=(s=this.props).onDispatchTransaction)==null?void 0:a.call(s,i,this.getState()))??i;const l=this.getState(),{state:c,transactions:u}=l.applyTransaction(i);Lt(this,Vf,l),this.updateState({state:c,tr:i,transactions:u});const d=this.manager.store.getForcedUpdates(i);Mo(d)||this.updateViewProps(...d)},this.onChange=(i=ee())=>{var s,a;const l=this.eventListenerProps(i);G(this,Wa)&&Lt(this,Wa,!1),(a=(s=this.props).onChange)==null||a.call(s,l)},this.onBlur=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onBlur)==null||a.call(s,l,i),G(this,Ei).emit("blur",l,i)},this.onFocus=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onFocus)==null||a.call(s,l,i),G(this,Ei).emit("focus",l,i)},this.setContent=(i,{triggerChange:s=!1}={})=>{const{doc:a}=this.manager.createState({content:i}),l=this.getState(),{state:c}=this.getState().applyTransaction(l.tr.replaceRangeWith(0,l.doc.nodeSize-2,a));if(s)return this.updateState({state:c,triggerChange:s});this.view.updateState(c)},this.clearContent=({triggerChange:i=!1}={})=>{this.setContent(this.manager.createEmptyDoc(),{triggerChange:i})},this.createStateFromContent=(i,s)=>this.manager.createState({content:i,selection:s}),this.focus=i=>{this.manager.store.commands.focus(i)},this.blur=i=>{this.manager.store.commands.blur(i)};const{getProps:t,initialEditorState:r,element:n}=e;if(Lt(this,$c,t),Lt(this,Uf,r),this.manager.attachFramework(this,this.updateListener.bind(this)),this.manager.view)return;const o=this.createView(r,n);this.manager.addView(o)}get addHandler(){return G(this,jf)??Lt(this,jf,G(this,Ei).on.bind(G(this,Ei)))}get updatableViewProps(){return{attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0}}get firstRender(){return G(this,Wa)}get props(){return G(this,$c).call(this)}get previousState(){return this.previousStateOverride??G(this,Vf)??this.initialEditorState}get manager(){return this.props.manager}get view(){return this.manager.view}get uid(){return G(this,Ff)}get initialEditorState(){return G(this,Uf)}updateListener(e){const{state:t,tr:r}=e;return G(this,Ei).emit("updated",this.eventListenerProps({state:t,tr:r}))}update(e){const{getProps:t}=e;return Lt(this,$c,t),this}updateViewProps(...e){const t=w1(this.updatableViewProps,e);this.view.setProps({...this.view.props,...t})}getAttributes(e){var t;const{attributes:r,autoFocus:n,classNames:o=[],label:i,editable:s}=this.props,a=(t=this.manager.store)==null?void 0:t.attributes,l=_e(r)?r(this.eventListenerProps()):r;let c={};(n||Jt(n))&&(c=e?{autoFocus:!0}:{autofocus:"true"});const u=Ml(ju(e&&"Prosemirror","remirror-editor",a==null?void 0:a.class,...o).split(" ")).join(" "),d={role:"textbox",...c,"aria-multiline":"true",...s??!0?{}:{"aria-readonly":"true"},"aria-label":i??"",...a,class:u};return q4({...d,...l})}addFocusListeners(){this.view.dom.addEventListener("blur",this.onBlur),this.view.dom.addEventListener("focus",this.onFocus)}removeFocusListeners(){this.view.dom.removeEventListener("blur",this.onBlur),this.view.dom.removeEventListener("focus",this.onFocus)}destroy(){G(this,Ei).emit("destroy"),this.view&&this.removeFocusListeners()}eventListenerProps(e=ee()){const{state:t,tr:r,transactions:n}=e;return{tr:r,transactions:n,internalUpdate:!r,view:this.view,firstRender:G(this,Wa),state:t??this.getState(),createStateFromContent:this.createStateFromContent,previousState:this.previousState,helpers:this.manager.store.helpers}}get baseOutput(){return{manager:this.manager,...this.manager.store,addHandler:this.addHandler,focus:this.focus,blur:this.blur,uid:G(this,Ff),view:this.view,getState:this.getState,getPreviousState:this.getPreviousState,getExtension:this.manager.getExtension.bind(this.manager),hasExtension:this.manager.hasExtension.bind(this.manager),clearContent:this.clearContent,setContent:this.setContent}}};Ff=new WeakMap;$c=new WeakMap;Vf=new WeakMap;Wa=new WeakMap;Ei=new WeakMap;jf=new WeakMap;Uf=new WeakMap;function dI(e,t){const r=[],n=new WeakMap,o=[],i=new WeakMap;let s=[];const a={duplicateMap:i,parentExtensions:o,gatheredExtensions:s,settings:t};for(const d of e)t5(a,{extension:d});s=ra(s,(d,f)=>f.priority-d.priority);const l=new WeakSet,c=new Set;for(const d of s){const f=d.constructor,p=d.name,h=i.get(f);te(h,{message:`No entries were found for the ExtensionConstructor ${d.name}`,code:H.INTERNAL}),!(l.has(f)||c.has(p))&&(l.add(f),c.add(p),r.push(d),n.set(f,d),h.forEach(m=>m==null?void 0:m.replaceChildExtension(f,d)))}const u=[];for(const d of r)fI({extension:d,found:l,missing:u});return te(Mo(u),{code:H.MISSING_REQUIRED_EXTENSION,message:u.map(({Constructor:d,extension:f})=>`The extension '${f.name}' requires '${d.name} in order to run correctly.`).join(` +`)}),{extensions:r,extensionMap:n}}function t5(e,t){var r;const{gatheredExtensions:n,duplicateMap:o,parentExtensions:i,settings:s}=e,{extension:a,parentExtension:l}=t;let{names:c=[]}=t;te(QC(a),{code:H.INVALID_MANAGER_EXTENSION,message:`An invalid extension: ${a} was provided to the [[\`RemirrorManager\`]].`});const u=a.extensions;if(a.setPriority((r=s.priority)==null?void 0:r[a.name]),n.push(a),pI({duplicateMap:o,extension:a,parentExtension:l}),u.length!==0){if(c.includes(a.name)){`${c.join(" > ")}${a.name}`;return}c=[...c,a.name],i.push(a);for(const d of u)t5(e,{names:c,extension:d,parentExtension:a})}}function fI(e){const{extension:t,found:r,missing:n}=e;if(t.requiredExtensions)for(const o of t.requiredExtensions??[])r.has(o)||n.push({Constructor:o,extension:t})}function pI(e){const{duplicateMap:t,extension:r,parentExtension:n}=e,o=r.constructor,i=t.get(o),s=n?[n]:[];t.set(o,i?[...i,...s]:s)}function hI(e){var t,r,n,o;const{extension:i,nodeNames:s,markNames:a,plainNames:l,store:c,handlers:u}=e;i.setStore(c);const d=(t=i.onCreate)==null?void 0:t.bind(i),f=(r=i.onView)==null?void 0:r.bind(i),p=(n=i.onStateUpdate)==null?void 0:n.bind(i),h=(o=i.onDestroy)==null?void 0:o.bind(i);d&&u.create.push(d),f&&u.view.push(f),p&&u.update.push(p),h&&u.destroy.push(h),Wh(i)&&a.push(i.name),Hd(i)&&i.name!=="doc"&&s.push(i.name),ZC(i)&&l.push(i.name)}var Ci,Hc,Wn,$o,Bc,Zr,Cs,Fc,Ms,Vc,Ts,Kn,jc,Wf=class{constructor(e,t={}){kt(this,Ci,void 0),kt(this,Hc,ee()),kt(this,Wn,ee()),kt(this,$o,void 0),kt(this,Bc,void 0),kt(this,Zr,Nr.None),kt(this,Cs,void 0),kt(this,Fc,!0),kt(this,Ms,{create:[],view:[],update:[],destroy:[]}),kt(this,Vc,[]),kt(this,Ts,jh()),kt(this,Kn,void 0),kt(this,jc,void 0),this.getState=()=>{var o;return G(this,Zr)>=Nr.EditorView?this.view.state:(te(G(this,Kn),{code:H.MANAGER_PHASE_ERROR,message:"`getState` can only be called after the `Framework` or the `EditorView` has been added to the manager`. Check your plugins to make sure that the decorations callback uses the state argument."}),(o=G(this,Kn))==null?void 0:o.initialEditorState)},this.updateState=o=>{const i=this.getState();this.view.updateState(o),this.onStateUpdate({previousState:i,state:o})};const{extensions:r,extensionMap:n}=dI(e,t);Lt(this,Cs,t),Lt(this,$o,Hs(r)),Lt(this,Bc,n),Lt(this,Ci,this.createExtensionStore()),Lt(this,Zr,Nr.Create),this.setupLifecycleHandlers();for(const o of G(this,Ms).create){const i=o();i&&G(this,Vc).push(i)}}static create(e,t={}){return new Wf([...eE(e),...cI(t.builtin)],t)}get[ti](){return $t.Manager}get destroyed(){return G(this,Zr)===Nr.Destroy}get mounted(){return G(this,Zr)>=Nr.EditorView&&G(this,Zr)G(this,$o),enumerable:t},phase:{get:()=>G(this,Zr),enumerable:t},view:{get:()=>this.view,enumerable:t},managerSettings:{get:()=>Hs(G(this,Cs)),enumerable:t},getState:{value:this.getState,enumerable:t},updateState:{value:this.updateState,enumerable:t},isMounted:{value:()=>this.mounted,enumerable:t},getExtension:{value:this.getExtension.bind(this),enumerable:t},manager:{get:()=>this,enumerable:t},document:{get:()=>this.document,enumerable:t},stringHandlers:{get:()=>G(this,Hc),enumerable:t},currentState:{get:()=>r??(r=this.getState()),set:o=>{r=o},enumerable:t},previousState:{get:()=>n,set:o=>{n=o},enumerable:t}}),e.getStoreKey=this.getStoreKey.bind(this),e.setStoreKey=this.setStoreKey.bind(this),e.setExtensionStore=this.setExtensionStore.bind(this),e.setStringHandler=this.setStringHandler.bind(this),e}addView(e){if(G(this,Zr)>=Nr.EditorView)return this;Lt(this,Fc,!0),Lt(this,Zr,Nr.EditorView),G(this,Wn).view=e;for(const t of G(this,Ms).view){const r=t(e);r&&G(this,Vc).push(r)}return this}attachFramework(e,t){var r;G(this,Kn)!==e&&(G(this,Kn)&&(G(this,Kn).destroy(),(r=G(this,jc))==null||r.call(this)),Lt(this,Kn,e),Lt(this,jc,this.addHandler("stateUpdate",t)))}createEmptyDoc(){var e;const t=(e=this.schema.nodes.doc)==null?void 0:e.createAndFill();return te(t,{code:H.INVALID_CONTENT,message:"An empty node could not be created due to an invalid schema."}),t}createState(e={}){const{onError:t,defaultSelection:r="end"}=this.settings,{content:n=this.createEmptyDoc(),selection:o=r,stringHandler:i=this.settings.stringHandler}=e,{schema:s,plugins:a}=this.store,l=AC({stringHandler:ne(i)?this.stringHandlers[i]:i,document:this.document,content:n,onError:t,schema:s,selection:o});return Bs.create({schema:s,doc:l,plugins:a,selection:jr(o,l)})}addHandler(e,t){return G(this,Ts).on(e,t)}onStateUpdate(e){const t=G(this,Fc);G(this,Ci).currentState=e.state,G(this,Ci).previousState=e.previousState,t&&(Lt(this,Zr,Nr.Runtime),Lt(this,Fc,!1));const r={...e,firstUpdate:t};for(const n of G(this,Ms).update)n(r);G(this,Ts).emit("stateUpdate",r)}getExtension(e){const t=G(this,Bc).get(e);return te(t,{code:H.INVALID_MANAGER_EXTENSION,message:`'${e.name}' doesn't exist within this manager. Make sure it is properly added before attempting to use it.`}),t}hasExtension(e){return!!G(this,Bc).get(e)}clone(){const e=G(this,$o).map(r=>r.clone(r.options)),t=Wf.create(()=>e,G(this,Cs));return G(this,Ts).emit("clone",t),t}recreate(e=[],t={}){const r=G(this,$o).map(o=>o.clone(o.initialOptions)),n=Wf.create(()=>[...r,...e],t);return G(this,Ts).emit("recreate",n),n}destroy(){var e,t,r,n,o,i;Lt(this,Zr,Nr.Destroy);for(const s of((e=this.view)==null?void 0:e.state.plugins)??[])(r=(t=s.getState(this.view.state))==null?void 0:t.destroy)==null||r.call(t);(n=G(this,Kn))==null||n.destroy(),(o=G(this,jc))==null||o.call(this);for(const s of G(this,Vc))s();for(const s of G(this,Ms).destroy)s();(i=this.view)==null||i.destroy(),G(this,Ts).emit("destroy")}includes(e){const t=[],r=[];for(const n of G(this,$o))t.push(n.name,n.constructorName),r.push(n.constructor);return e.every(n=>ne(n)?fr(t,n):fr(r,n))}},mI=Wf;Ci=new WeakMap;Hc=new WeakMap;Wn=new WeakMap;$o=new WeakMap;Bc=new WeakMap;Zr=new WeakMap;Cs=new WeakMap;Fc=new WeakMap;Ms=new WeakMap;Vc=new WeakMap;Ts=new WeakMap;Kn=new WeakMap;jc=new WeakMap;function gI(e,t){return!oc(e)||!ic(e,$t.Manager)?!1:t?e.includes(t):!0}var vI=Object.defineProperty,yI=Object.getOwnPropertyDescriptor,Bd=(e,t,r,n)=>{for(var o=n>1?void 0:n?yI(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&vI(t,r,o),o},r5=/\S+/g;function n5(e){return e.type.isTextblock?1:e.type.isText?e.textBetween(0,e.nodeSize).length:0}function bI({doc:e},t){let r=0,n=0;return e.nodesBetween(0,e.nodeSize-2,(o,i)=>{if(n>0)return!1;const s=n5(o);return r+s>t?(n=i+1+(t-r),!1):(r+=s,!0)}),n}function xI({doc:e},t){let r=0,n=0;return e.nodesBetween(0,e.nodeSize-2,(o,i)=>{if(n>0)return!1;if(!o.type.isText)return!0;const s=o.textBetween(0,o.nodeSize),a=xa(s,r5);if(r+a.length>t){const l=t-r,c=a[l];return n=i+((c==null?void 0:c.index)??0),!1}return r+=a.length,!0}),n}var is=class extends Ve{get name(){return"count"}getCountMaximum(){return this.options.maximum}getCharacterCount(e=this.store.getState()){let t=0;return e.doc.nodesBetween(0,e.doc.nodeSize-2,r=>(t+=n5(r),!0)),Math.max(t-1,0)}getWordCount(e=this.store.getState()){const t=this.store.helpers.getText({lineBreakDivider:" ",state:e});return xa(t,r5).length}isCountValid(e=this.store.getState()){const{maximumStrategy:t,maximum:r}=this.options;return r<1?!0:t==="CHARACTERS"?this.store.helpers.getCharacterCount(e)<=r:this.store.helpers.getWordCount(e)<=r}createDecorationSet(e){const{maximum:t=-1,maximumStrategy:r,maximumExceededClassName:n}=this.options,s=(r==="CHARACTERS"?bI:xI)(e,t);return Ee.create(e.doc,[Ge.inline(s,e.doc.nodeSize-2,{class:n})])}createExternalPlugins(){const{maximum:e}=this.options,t=new Ro({state:{init:(r,n)=>this.isCountValid(n)?{decorationSet:Ee.empty}:{decorationSet:this.createDecorationSet(n)},apply:(r,n,o,i)=>!r.docChanged||e<1?n:this.isCountValid(i)?{decorationSet:Ee.empty}:{decorationSet:this.createDecorationSet(i)}},props:{decorations(r){var n;return((n=t.getState(r))==null?void 0:n.decorationSet)??null}}});return[t]}};Bd([He()],is.prototype,"getCountMaximum",1);Bd([He()],is.prototype,"getCharacterCount",1);Bd([He()],is.prototype,"getWordCount",1);Bd([He()],is.prototype,"isCountValid",1);is=Bd([pe({defaultOptions:{maximum:-1,maximumExceededClassName:"remirror-max-count-exceeded",maximumStrategy:"CHARACTERS"},staticKeys:["maximum","maximumStrategy","maximumExceededClassName"]})],is);var o5={exports:{}},hn={},i5={exports:{}},s5={};/** * @license React * scheduler.production.min.js * @@ -80,7 +80,7 @@ If you are using Node.js, you can install JSDOM and Remirror will try to use it * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(A,P){var B=A.length;A.push(P);e:for(;0>>1,J=A[Y];if(0>>1;Yo(ue,B))deo(he,ue)?(A[Y]=he,A[de]=B,Y=de):(A[Y]=ue,A[ie]=B,Y=ie);else if(deo(he,B))A[Y]=he,A[de]=B,Y=de;else break e}}return P}function o(A,P){var B=A.sortIndex-P.sortIndex;return B!==0?B:A.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,d=null,f=3,p=!1,h=!1,m=!1,b=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(A){for(var P=r(c);P!==null;){if(P.callback===null)n(c);else if(P.startTime<=A)n(c),P.sortIndex=P.expirationTime,t(l,P);else break;P=r(c)}}function x(A){if(m=!1,y(A),!h)if(r(l)!==null)h=!0,z(k);else{var P=r(c);P!==null&&q(x,P.startTime-A)}}function k(A,P){h=!1,m&&(m=!1,v(M),M=-1),p=!0;var B=f;try{for(y(P),d=r(l);d!==null&&(!(d.expirationTime>P)||A&&!N());){var Y=d.callback;if(typeof Y=="function"){d.callback=null,f=d.priorityLevel;var J=Y(d.expirationTime<=P);P=e.unstable_now(),typeof J=="function"?d.callback=J:d===r(l)&&n(l),y(P)}else n(l);d=r(l)}if(d!==null)var Ne=!0;else{var ie=r(c);ie!==null&&q(x,ie.startTime-P),Ne=!1}return Ne}finally{d=null,f=B,p=!1}}var w=!1,E=null,M=-1,C=5,T=-1;function N(){return!(e.unstable_now()-TA||125Y?(A.sortIndex=B,t(c,A),r(l)===null&&A===r(c)&&(m?(v(M),M=-1):m=!0,q(x,B-Y))):(A.sortIndex=J,t(l,A),h||p||(h=!0,z(k))),A},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(A){var P=f;return function(){var B=f;f=P;try{return A.apply(this,arguments)}finally{f=B}}}})(rC);tC.exports=rC;var hI=tC.exports;/** + */(function(e){function t(A,P){var B=A.length;A.push(P);e:for(;0>>1,J=A[Y];if(0>>1;Yo(ue,B))deo(me,ue)?(A[Y]=me,A[de]=B,Y=de):(A[Y]=ue,A[ie]=B,Y=ie);else if(deo(me,B))A[Y]=me,A[de]=B,Y=de;else break e}}return P}function o(A,P){var B=A.sortIndex-P.sortIndex;return B!==0?B:A.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,d=null,f=3,p=!1,h=!1,m=!1,b=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(A){for(var P=r(c);P!==null;){if(P.callback===null)n(c);else if(P.startTime<=A)n(c),P.sortIndex=P.expirationTime,t(l,P);else break;P=r(c)}}function x(A){if(m=!1,y(A),!h)if(r(l)!==null)h=!0,z(k);else{var P=r(c);P!==null&&q(x,P.startTime-A)}}function k(A,P){h=!1,m&&(m=!1,v(T),T=-1),p=!0;var B=f;try{for(y(P),d=r(l);d!==null&&(!(d.expirationTime>P)||A&&!N());){var Y=d.callback;if(typeof Y=="function"){d.callback=null,f=d.priorityLevel;var J=Y(d.expirationTime<=P);P=e.unstable_now(),typeof J=="function"?d.callback=J:d===r(l)&&n(l),y(P)}else n(l);d=r(l)}if(d!==null)var Ne=!0;else{var ie=r(c);ie!==null&&q(x,ie.startTime-P),Ne=!1}return Ne}finally{d=null,f=B,p=!1}}var w=!1,E=null,T=-1,C=5,M=-1;function N(){return!(e.unstable_now()-MA||125Y?(A.sortIndex=B,t(c,A),r(l)===null&&A===r(c)&&(m?(v(T),T=-1):m=!0,q(x,B-Y))):(A.sortIndex=J,t(l,A),h||p||(h=!0,z(k))),A},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(A){var P=f;return function(){var B=f;f=P;try{return A.apply(this,arguments)}finally{f=B}}}})(s5);i5.exports=s5;var kI=i5.exports;/** * @license React * react-dom.production.min.js * @@ -88,16 +88,16 @@ If you are using Node.js, you can install JSDOM and Remirror will try to use it * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var nC=S,dn=hI;function $(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),q1=Object.prototype.hasOwnProperty,mI=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h2={},m2={};function gI(e){return q1.call(m2,e)?!0:q1.call(h2,e)?!1:mI.test(e)?m2[e]=!0:(h2[e]=!0,!1)}function vI(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function yI(e,t,r,n){if(t===null||typeof t>"u"||vI(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Mr(e,t,r,n,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Qt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Qt[e]=new Mr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Qt[t]=new Mr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Qt[e]=new Mr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Qt[e]=new Mr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Qt[e]=new Mr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Qt[e]=new Mr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Qt[e]=new Mr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Qt[e]=new Mr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Qt[e]=new Mr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Yv=/[\-:]([a-z])/g;function Jv(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Yv,Jv);Qt[t]=new Mr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Yv,Jv);Qt[t]=new Mr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Yv,Jv);Qt[t]=new Mr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Qt[e]=new Mr(e,1,!1,e.toLowerCase(),null,!1,!1)});Qt.xlinkHref=new Mr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Qt[e]=new Mr(e,1,!1,e.toLowerCase(),null,!0,!0)});function Xv(e,t,r,n){var o=Qt.hasOwnProperty(t)?Qt[t]:null;(o!==null?o.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),J1=Object.prototype.hasOwnProperty,wI=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,v2={},y2={};function SI(e){return J1.call(y2,e)?!0:J1.call(v2,e)?!1:wI.test(e)?y2[e]=!0:(v2[e]=!0,!1)}function EI(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function CI(e,t,r,n){if(t===null||typeof t>"u"||EI(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Tr(e,t,r,n,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Qt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Qt[e]=new Tr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Qt[t]=new Tr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Qt[e]=new Tr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Qt[e]=new Tr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Qt[e]=new Tr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Qt[e]=new Tr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Qt[e]=new Tr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Qt[e]=new Tr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Qt[e]=new Tr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Qv=/[\-:]([a-z])/g;function Zv(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Qv,Zv);Qt[t]=new Tr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Qv,Zv);Qt[t]=new Tr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Qv,Zv);Qt[t]=new Tr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Qt[e]=new Tr(e,1,!1,e.toLowerCase(),null,!1,!1)});Qt.xlinkHref=new Tr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Qt[e]=new Tr(e,1,!1,e.toLowerCase(),null,!0,!0)});function ey(e,t,r,n){var o=Qt.hasOwnProperty(t)?Qt[t]:null;(o!==null?o.type!==0:n||!(2a||o[s]!==i[a]){var l=` -`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Sg=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?jc(e):""}function bI(e){switch(e.tag){case 5:return jc(e.type);case 16:return jc("Lazy");case 13:return jc("Suspense");case 19:return jc("SuspenseList");case 0:case 2:case 15:return e=Eg(e.type,!1),e;case 11:return e=Eg(e.type.render,!1),e;case 1:return e=Eg(e.type,!0),e;default:return""}}function X1(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Za:return"Fragment";case Qa:return"Portal";case G1:return"Profiler";case Qv:return"StrictMode";case Y1:return"Suspense";case J1:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case sC:return(e.displayName||"Context")+".Consumer";case iC:return(e._context.displayName||"Context")+".Provider";case Zv:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ey:return t=e.displayName||null,t!==null?t:X1(e.type)||"Memo";case Oi:t=e._payload,e=e._init;try{return X1(e(t))}catch{}}return null}function xI(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return X1(t);case 8:return t===Qv?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ss(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function lC(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function kI(e){var t=lC(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){n=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function of(e){e._valueTracker||(e._valueTracker=kI(e))}function cC(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=lC(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Pp(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Q1(e,t){var r=t.checked;return ut({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function v2(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=ss(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function uC(e,t){t=t.checked,t!=null&&Xv(e,"checked",t,!1)}function Z1(e,t){uC(e,t);var r=ss(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?e0(e,t.type,r):t.hasOwnProperty("defaultValue")&&e0(e,t.type,ss(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function y2(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function e0(e,t,r){(t!=="number"||Pp(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Uc=Array.isArray;function ml(e,t,r,n){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=sf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Uu(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var bu={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},wI=["Webkit","ms","Moz","O"];Object.keys(bu).forEach(function(e){wI.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),bu[t]=bu[e]})});function hC(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||bu.hasOwnProperty(e)&&bu[e]?(""+t).trim():t+"px"}function mC(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,o=hC(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}var SI=ut({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function n0(e,t){if(t){if(SI[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error($(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error($(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error($(61))}if(t.style!=null&&typeof t.style!="object")throw Error($(62))}}function o0(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var i0=null;function ty(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var s0=null,gl=null,vl=null;function k2(e){if(e=Vd(e)){if(typeof s0!="function")throw Error($(280));var t=e.stateNode;t&&(t=qh(t),s0(e.stateNode,e.type,t))}}function gC(e){gl?vl?vl.push(e):vl=[e]:gl=e}function vC(){if(gl){var e=gl,t=vl;if(vl=gl=null,k2(e),t)for(e=0;e>>=0,e===0?32:31-(zI(e)/LI|0)|0}var af=64,lf=4194304;function Wc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Dp(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,o=e.suspendedLanes,i=e.pingedLanes,s=r&268435455;if(s!==0){var a=s&~o;a!==0?n=Wc(a):(i&=s,i!==0&&(n=Wc(i)))}else s=r&~o,s!==0?n=Wc(s):i!==0&&(n=Wc(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&o)&&(o=n&-n,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Bd(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-to(t),e[t]=r}function HI(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=ku),A2=String.fromCharCode(32),N2=!1;function DC(e,t){switch(e){case"keyup":return p8.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $C(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var el=!1;function m8(e,t){switch(e){case"compositionend":return $C(t);case"keypress":return t.which!==32?null:(N2=!0,A2);case"textInput":return e=t.data,e===A2&&N2?null:e;default:return null}}function g8(e,t){if(el)return e==="compositionend"||!cy&&DC(e,t)?(e=LC(),Wf=sy=Di=null,el=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=L2(r)}}function VC(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?VC(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jC(){for(var e=window,t=Pp();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Pp(e.document)}return t}function uy(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function C8(e){var t=jC(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&VC(r.ownerDocument.documentElement,r)){if(n!==null&&uy(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=r.textContent.length,i=Math.min(n.start,o);n=n.end===void 0?i:Math.min(n.end,o),!e.extend&&i>n&&(o=n,n=i,i=o),o=I2(r,i);var s=I2(r,n);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,tl=null,f0=null,Su=null,p0=!1;function D2(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;p0||tl==null||tl!==Pp(n)||(n=tl,"selectionStart"in n&&uy(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Su&&Ju(Su,n)||(Su=n,n=Bp(f0,"onSelect"),0ol||(e.current=b0[ol],b0[ol]=null,ol--)}function Ye(e,t){ol++,b0[ol]=e.current,e.current=t}var as={},fr=ys(as),Dr=ys(!1),aa=as;function Dl(e,t){var r=e.type.contextTypes;if(!r)return as;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in r)o[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function $r(e){return e=e.childContextTypes,e!=null}function Vp(){tt(Dr),tt(fr)}function U2(e,t,r){if(fr.current!==as)throw Error($(168));Ye(fr,t),Ye(Dr,r)}function QC(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var o in n)if(!(o in t))throw Error($(108,xI(e)||"Unknown",o));return ut({},r,n)}function jp(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||as,aa=fr.current,Ye(fr,e),Ye(Dr,Dr.current),!0}function W2(e,t,r){var n=e.stateNode;if(!n)throw Error($(169));r?(e=QC(e,t,aa),n.__reactInternalMemoizedMergedChildContext=e,tt(Dr),tt(fr),Ye(fr,e)):tt(Dr),Ye(Dr,r)}var Uo=null,Gh=!1,$g=!1;function ZC(e){Uo===null?Uo=[e]:Uo.push(e)}function D8(e){Gh=!0,ZC(e)}function bs(){if(!$g&&Uo!==null){$g=!0;var e=0,t=$e;try{var r=Uo;for($e=1;e>=s,o-=s,qo=1<<32-to(t)+o|r<M?(C=E,E=null):C=E.sibling;var T=f(v,E,y[M],x);if(T===null){E===null&&(E=C);break}e&&E&&T.alternate===null&&t(v,E),g=i(T,g,M),w===null?k=T:w.sibling=T,w=T,E=C}if(M===y.length)return r(v,E),ot&&Os(v,M),k;if(E===null){for(;MM?(C=E,E=null):C=E.sibling;var N=f(v,E,T.value,x);if(N===null){E===null&&(E=C);break}e&&E&&N.alternate===null&&t(v,E),g=i(N,g,M),w===null?k=N:w.sibling=N,w=N,E=C}if(T.done)return r(v,E),ot&&Os(v,M),k;if(E===null){for(;!T.done;M++,T=y.next())T=d(v,T.value,x),T!==null&&(g=i(T,g,M),w===null?k=T:w.sibling=T,w=T);return ot&&Os(v,M),k}for(E=n(v,E);!T.done;M++,T=y.next())T=p(E,v,M,T.value,x),T!==null&&(e&&T.alternate!==null&&E.delete(T.key===null?M:T.key),g=i(T,g,M),w===null?k=T:w.sibling=T,w=T);return e&&E.forEach(function(F){return t(v,F)}),ot&&Os(v,M),k}function b(v,g,y,x){if(typeof y=="object"&&y!==null&&y.type===Za&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case nf:e:{for(var k=y.key,w=g;w!==null;){if(w.key===k){if(k=y.type,k===Za){if(w.tag===7){r(v,w.sibling),g=o(w,y.props.children),g.return=v,v=g;break e}}else if(w.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Oi&&Q2(k)===w.type){r(v,w.sibling),g=o(w,y.props),g.ref=Sc(v,w,y),g.return=v,v=g;break e}r(v,w);break}else t(v,w);w=w.sibling}y.type===Za?(g=ea(y.props.children,v.mode,x,y.key),g.return=v,v=g):(x=Zf(y.type,y.key,y.props,null,v.mode,x),x.ref=Sc(v,g,y),x.return=v,v=x)}return s(v);case Qa:e:{for(w=y.key;g!==null;){if(g.key===w)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){r(v,g.sibling),g=o(g,y.children||[]),g.return=v,v=g;break e}else{r(v,g);break}else t(v,g);g=g.sibling}g=Kg(y,v.mode,x),g.return=v,v=g}return s(v);case Oi:return w=y._init,b(v,g,w(y._payload),x)}if(Uc(y))return h(v,g,y,x);if(yc(y))return m(v,g,y,x);mf(v,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,g!==null&&g.tag===6?(r(v,g.sibling),g=o(g,y),g.return=v,v=g):(r(v,g),g=Wg(y,v.mode,x),g.return=v,v=g),s(v)):r(v,g)}return b}var Hl=aM(!0),lM=aM(!1),jd={},wo=ys(jd),ed=ys(jd),td=ys(jd);function Ws(e){if(e===jd)throw Error($(174));return e}function by(e,t){switch(Ye(td,t),Ye(ed,e),Ye(wo,jd),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:r0(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=r0(t,e)}tt(wo),Ye(wo,t)}function Bl(){tt(wo),tt(ed),tt(td)}function cM(e){Ws(td.current);var t=Ws(wo.current),r=r0(t,e.type);t!==r&&(Ye(ed,e),Ye(wo,r))}function xy(e){ed.current===e&&(tt(wo),tt(ed))}var at=ys(0);function Yp(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Hg=[];function ky(){for(var e=0;er?r:4,e(!0);var n=Bg.transition;Bg.transition={};try{e(!1),t()}finally{$e=r,Bg.transition=n}}function CM(){return Rn().memoizedState}function F8(e,t,r){var n=Ji(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},MM(e))TM(t,r);else if(r=nM(e,t,r,n),r!==null){var o=kr();ro(r,e,n,o),OM(r,t,n)}}function V8(e,t,r){var n=Ji(e),o={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(MM(e))TM(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,r);if(o.hasEagerState=!0,o.eagerState=a,so(a,s)){var l=t.interleaved;l===null?(o.next=o,vy(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}r=nM(e,t,o,n),r!==null&&(o=kr(),ro(r,e,n,o),OM(r,t,n))}}function MM(e){var t=e.alternate;return e===lt||t!==null&&t===lt}function TM(e,t){Eu=Jp=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function OM(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,ny(e,r)}}var Xp={readContext:Nn,useCallback:nr,useContext:nr,useEffect:nr,useImperativeHandle:nr,useInsertionEffect:nr,useLayoutEffect:nr,useMemo:nr,useReducer:nr,useRef:nr,useState:nr,useDebugValue:nr,useDeferredValue:nr,useTransition:nr,useMutableSource:nr,useSyncExternalStore:nr,useId:nr,unstable_isNewReconciler:!1},j8={readContext:Nn,useCallback:function(e,t){return ho().memoizedState=[e,t===void 0?null:t],e},useContext:Nn,useEffect:ew,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Yf(4194308,4,xM.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Yf(4194308,4,e,t)},useInsertionEffect:function(e,t){return Yf(4,2,e,t)},useMemo:function(e,t){var r=ho();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ho();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=F8.bind(null,lt,e),[n.memoizedState,e]},useRef:function(e){var t=ho();return e={current:e},t.memoizedState=e},useState:Z2,useDebugValue:My,useDeferredValue:function(e){return ho().memoizedState=e},useTransition:function(){var e=Z2(!1),t=e[0];return e=B8.bind(null,e[1]),ho().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=lt,o=ho();if(ot){if(r===void 0)throw Error($(407));r=r()}else{if(r=t(),Ht===null)throw Error($(349));ca&30||fM(n,t,r)}o.memoizedState=r;var i={value:r,getSnapshot:t};return o.queue=i,ew(hM.bind(null,n,i,e),[e]),n.flags|=2048,od(9,pM.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=ho(),t=Ht.identifierPrefix;if(ot){var r=Go,n=qo;r=(n&~(1<<32-to(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=rd++,0")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Mg=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Uc(e):""}function MI(e){switch(e.tag){case 5:return Uc(e.type);case 16:return Uc("Lazy");case 13:return Uc("Suspense");case 19:return Uc("SuspenseList");case 0:case 2:case 15:return e=Tg(e.type,!1),e;case 11:return e=Tg(e.type.render,!1),e;case 1:return e=Tg(e.type,!0),e;default:return""}}function e0(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Za:return"Fragment";case Qa:return"Portal";case X1:return"Profiler";case ty:return"StrictMode";case Q1:return"Suspense";case Z1:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case u5:return(e.displayName||"Context")+".Consumer";case c5:return(e._context.displayName||"Context")+".Provider";case ry:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ny:return t=e.displayName||null,t!==null?t:e0(e.type)||"Memo";case Oi:t=e._payload,e=e._init;try{return e0(e(t))}catch{}}return null}function TI(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return e0(t);case 8:return t===ty?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ss(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function f5(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function OI(e){var t=f5(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){n=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function af(e){e._valueTracker||(e._valueTracker=OI(e))}function p5(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=f5(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Lp(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function t0(e,t){var r=t.checked;return ut({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function x2(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=ss(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function h5(e,t){t=t.checked,t!=null&&ey(e,"checked",t,!1)}function r0(e,t){h5(e,t);var r=ss(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?n0(e,t.type,r):t.hasOwnProperty("defaultValue")&&n0(e,t.type,ss(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function k2(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function n0(e,t,r){(t!=="number"||Lp(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Wc=Array.isArray;function ml(e,t,r,n){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=lf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Wu(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var xu={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},_I=["Webkit","ms","Moz","O"];Object.keys(xu).forEach(function(e){_I.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xu[t]=xu[e]})});function y5(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||xu.hasOwnProperty(e)&&xu[e]?(""+t).trim():t+"px"}function b5(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,o=y5(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}var AI=ut({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function s0(e,t){if(t){if(AI[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error($(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error($(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error($(61))}if(t.style!=null&&typeof t.style!="object")throw Error($(62))}}function a0(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var l0=null;function oy(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var c0=null,gl=null,vl=null;function E2(e){if(e=jd(e)){if(typeof c0!="function")throw Error($(280));var t=e.stateNode;t&&(t=Jh(t),c0(e.stateNode,e.type,t))}}function x5(e){gl?vl?vl.push(e):vl=[e]:gl=e}function k5(){if(gl){var e=gl,t=vl;if(vl=gl=null,E2(e),t)for(e=0;e>>=0,e===0?32:31-(FI(e)/VI|0)|0}var cf=64,uf=4194304;function Kc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Hp(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,o=e.suspendedLanes,i=e.pingedLanes,s=r&268435455;if(s!==0){var a=s&~o;a!==0?n=Kc(a):(i&=s,i!==0&&(n=Kc(i)))}else s=r&~o,s!==0?n=Kc(s):i!==0&&(n=Kc(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&o)&&(o=n&-n,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Fd(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-to(t),e[t]=r}function KI(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=wu),P2=String.fromCharCode(32),z2=!1;function F5(e,t){switch(e){case"keyup":return x8.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function V5(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var el=!1;function w8(e,t){switch(e){case"compositionend":return V5(t);case"keypress":return t.which!==32?null:(z2=!0,P2);case"textInput":return e=t.data,e===P2&&z2?null:e;default:return null}}function S8(e,t){if(el)return e==="compositionend"||!fy&&F5(e,t)?(e=H5(),qf=cy=Di=null,el=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=$2(r)}}function K5(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?K5(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function q5(){for(var e=window,t=Lp();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Lp(e.document)}return t}function py(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function R8(e){var t=q5(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&K5(r.ownerDocument.documentElement,r)){if(n!==null&&py(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=r.textContent.length,i=Math.min(n.start,o);n=n.end===void 0?i:Math.min(n.end,o),!e.extend&&i>n&&(o=n,n=i,i=o),o=H2(r,i);var s=H2(r,n);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,tl=null,m0=null,Eu=null,g0=!1;function B2(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;g0||tl==null||tl!==Lp(n)||(n=tl,"selectionStart"in n&&py(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Eu&&Xu(Eu,n)||(Eu=n,n=Vp(m0,"onSelect"),0ol||(e.current=w0[ol],w0[ol]=null,ol--)}function Ye(e,t){ol++,w0[ol]=e.current,e.current=t}var as={},pr=ys(as),Dr=ys(!1),aa=as;function Dl(e,t){var r=e.type.contextTypes;if(!r)return as;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in r)o[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function $r(e){return e=e.childContextTypes,e!=null}function Up(){tt(Dr),tt(pr)}function q2(e,t,r){if(pr.current!==as)throw Error($(168));Ye(pr,t),Ye(Dr,r)}function rM(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var o in n)if(!(o in t))throw Error($(108,TI(e)||"Unknown",o));return ut({},r,n)}function Wp(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||as,aa=pr.current,Ye(pr,e),Ye(Dr,Dr.current),!0}function G2(e,t,r){var n=e.stateNode;if(!n)throw Error($(169));r?(e=rM(e,t,aa),n.__reactInternalMemoizedMergedChildContext=e,tt(Dr),tt(pr),Ye(pr,e)):tt(Dr),Ye(Dr,r)}var Uo=null,Xh=!1,Fg=!1;function nM(e){Uo===null?Uo=[e]:Uo.push(e)}function U8(e){Xh=!0,nM(e)}function bs(){if(!Fg&&Uo!==null){Fg=!0;var e=0,t=$e;try{var r=Uo;for($e=1;e>=s,o-=s,qo=1<<32-to(t)+o|r<T?(C=E,E=null):C=E.sibling;var M=f(v,E,y[T],x);if(M===null){E===null&&(E=C);break}e&&E&&M.alternate===null&&t(v,E),g=i(M,g,T),w===null?k=M:w.sibling=M,w=M,E=C}if(T===y.length)return r(v,E),ot&&Os(v,T),k;if(E===null){for(;TT?(C=E,E=null):C=E.sibling;var N=f(v,E,M.value,x);if(N===null){E===null&&(E=C);break}e&&E&&N.alternate===null&&t(v,E),g=i(N,g,T),w===null?k=N:w.sibling=N,w=N,E=C}if(M.done)return r(v,E),ot&&Os(v,T),k;if(E===null){for(;!M.done;T++,M=y.next())M=d(v,M.value,x),M!==null&&(g=i(M,g,T),w===null?k=M:w.sibling=M,w=M);return ot&&Os(v,T),k}for(E=n(v,E);!M.done;T++,M=y.next())M=p(E,v,T,M.value,x),M!==null&&(e&&M.alternate!==null&&E.delete(M.key===null?T:M.key),g=i(M,g,T),w===null?k=M:w.sibling=M,w=M);return e&&E.forEach(function(F){return t(v,F)}),ot&&Os(v,T),k}function b(v,g,y,x){if(typeof y=="object"&&y!==null&&y.type===Za&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case sf:e:{for(var k=y.key,w=g;w!==null;){if(w.key===k){if(k=y.type,k===Za){if(w.tag===7){r(v,w.sibling),g=o(w,y.props.children),g.return=v,v=g;break e}}else if(w.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Oi&&tw(k)===w.type){r(v,w.sibling),g=o(w,y.props),g.ref=Ec(v,w,y),g.return=v,v=g;break e}r(v,w);break}else t(v,w);w=w.sibling}y.type===Za?(g=ea(y.props.children,v.mode,x,y.key),g.return=v,v=g):(x=tp(y.type,y.key,y.props,null,v.mode,x),x.ref=Ec(v,g,y),x.return=v,v=x)}return s(v);case Qa:e:{for(w=y.key;g!==null;){if(g.key===w)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){r(v,g.sibling),g=o(g,y.children||[]),g.return=v,v=g;break e}else{r(v,g);break}else t(v,g);g=g.sibling}g=Yg(y,v.mode,x),g.return=v,v=g}return s(v);case Oi:return w=y._init,b(v,g,w(y._payload),x)}if(Wc(y))return h(v,g,y,x);if(bc(y))return m(v,g,y,x);vf(v,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,g!==null&&g.tag===6?(r(v,g.sibling),g=o(g,y),g.return=v,v=g):(r(v,g),g=Gg(y,v.mode,x),g.return=v,v=g),s(v)):r(v,g)}return b}var Hl=dM(!0),fM=dM(!1),Ud={},wo=ys(Ud),td=ys(Ud),rd=ys(Ud);function Ws(e){if(e===Ud)throw Error($(174));return e}function wy(e,t){switch(Ye(rd,t),Ye(td,e),Ye(wo,Ud),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:i0(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=i0(t,e)}tt(wo),Ye(wo,t)}function Bl(){tt(wo),tt(td),tt(rd)}function pM(e){Ws(rd.current);var t=Ws(wo.current),r=i0(t,e.type);t!==r&&(Ye(td,e),Ye(wo,r))}function Sy(e){td.current===e&&(tt(wo),tt(td))}var at=ys(0);function Xp(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Vg=[];function Ey(){for(var e=0;er?r:4,e(!0);var n=jg.transition;jg.transition={};try{e(!1),t()}finally{$e=r,jg.transition=n}}function _M(){return zn().memoizedState}function G8(e,t,r){var n=Ji(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},AM(e))NM(t,r);else if(r=aM(e,t,r,n),r!==null){var o=wr();ro(r,e,n,o),RM(r,t,n)}}function Y8(e,t,r){var n=Ji(e),o={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(AM(e))NM(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,r);if(o.hasEagerState=!0,o.eagerState=a,so(a,s)){var l=t.interleaved;l===null?(o.next=o,xy(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}r=aM(e,t,o,n),r!==null&&(o=wr(),ro(r,e,n,o),RM(r,t,n))}}function AM(e){var t=e.alternate;return e===lt||t!==null&&t===lt}function NM(e,t){Cu=Qp=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function RM(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,sy(e,r)}}var Zp={readContext:Pn,useCallback:or,useContext:or,useEffect:or,useImperativeHandle:or,useInsertionEffect:or,useLayoutEffect:or,useMemo:or,useReducer:or,useRef:or,useState:or,useDebugValue:or,useDeferredValue:or,useTransition:or,useMutableSource:or,useSyncExternalStore:or,useId:or,unstable_isNewReconciler:!1},J8={readContext:Pn,useCallback:function(e,t){return ho().memoizedState=[e,t===void 0?null:t],e},useContext:Pn,useEffect:nw,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Xf(4194308,4,EM.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Xf(4194308,4,e,t)},useInsertionEffect:function(e,t){return Xf(4,2,e,t)},useMemo:function(e,t){var r=ho();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ho();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=G8.bind(null,lt,e),[n.memoizedState,e]},useRef:function(e){var t=ho();return e={current:e},t.memoizedState=e},useState:rw,useDebugValue:_y,useDeferredValue:function(e){return ho().memoizedState=e},useTransition:function(){var e=rw(!1),t=e[0];return e=q8.bind(null,e[1]),ho().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=lt,o=ho();if(ot){if(r===void 0)throw Error($(407));r=r()}else{if(r=t(),Ht===null)throw Error($(349));ca&30||gM(n,t,r)}o.memoizedState=r;var i={value:r,getSnapshot:t};return o.queue=i,nw(yM.bind(null,n,i,e),[e]),n.flags|=2048,id(9,vM.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=ho(),t=Ht.identifierPrefix;if(ot){var r=Go,n=qo;r=(n&~(1<<32-to(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=nd++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=s.createElement(r,{is:n.is}):(e=s.createElement(r),r==="select"&&(s=e,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):e=s.createElementNS(e,r),e[bo]=t,e[Zu]=n,DM(e,t,!1,!1),t.stateNode=e;e:{switch(s=o0(r,n),r){case"dialog":et("cancel",e),et("close",e),o=n;break;case"iframe":case"object":case"embed":et("load",e),o=n;break;case"video":case"audio":for(o=0;oVl&&(t.flags|=128,n=!0,Ec(i,!1),t.lanes=4194304)}else{if(!n)if(e=Yp(s),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ec(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!ot)return or(t),null}else 2*vt()-i.renderingStartTime>Vl&&r!==1073741824&&(t.flags|=128,n=!0,Ec(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(r=i.last,r!==null?r.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=vt(),t.sibling=null,r=at.current,Ye(at,n?r&1|2:r&1),t):(or(t),null);case 22:case 23:return Ry(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?en&1073741824&&(or(t),t.subtreeFlags&6&&(t.flags|=8192)):or(t),null;case 24:return null;case 25:return null}throw Error($(156,t.tag))}function X8(e,t){switch(fy(t),t.tag){case 1:return $r(t.type)&&Vp(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bl(),tt(Dr),tt(fr),ky(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return xy(t),null;case 13:if(tt(at),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error($(340));$l()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return tt(at),null;case 4:return Bl(),null;case 10:return gy(t.type._context),null;case 22:case 23:return Ry(),null;case 24:return null;default:return null}}var vf=!1,cr=!1,Q8=typeof WeakSet=="function"?WeakSet:Set,X=null;function ll(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){mt(e,t,n)}else r.current=null}function N0(e,t,r){try{r()}catch(n){mt(e,t,n)}}var cw=!1;function Z8(e,t){if(h0=$p,e=jC(),uy(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var o=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var p;d!==r||o!==0&&d.nodeType!==3||(a=s+o),d!==i||n!==0&&d.nodeType!==3||(l=s+n),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===r&&++c===o&&(a=s),f===i&&++u===n&&(l=s),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(m0={focusedElem:e,selectionRange:r},$p=!1,X=t;X!==null;)if(t=X,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,X=e;else for(;X!==null;){t=X;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var m=h.memoizedProps,b=h.memoizedState,v=t.stateNode,g=v.getSnapshotBeforeUpdate(t.elementType===t.type?m:qn(t.type,m),b);v.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error($(163))}}catch(x){mt(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,X=e;break}X=t.return}return h=cw,cw=!1,h}function Cu(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&N0(t,r,i)}o=o.next}while(o!==n)}}function Xh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function R0(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function BM(e){var t=e.alternate;t!==null&&(e.alternate=null,BM(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[bo],delete t[Zu],delete t[y0],delete t[L8],delete t[I8])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function FM(e){return e.tag===5||e.tag===3||e.tag===4}function uw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||FM(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function P0(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Fp));else if(n!==4&&(e=e.child,e!==null))for(P0(e,t,r),e=e.sibling;e!==null;)P0(e,t,r),e=e.sibling}function z0(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(z0(e,t,r),e=e.sibling;e!==null;)z0(e,t,r),e=e.sibling}var qt=null,Gn=!1;function vi(e,t,r){for(r=r.child;r!==null;)VM(e,t,r),r=r.sibling}function VM(e,t,r){if(ko&&typeof ko.onCommitFiberUnmount=="function")try{ko.onCommitFiberUnmount(jh,r)}catch{}switch(r.tag){case 5:cr||ll(r,t);case 6:var n=qt,o=Gn;qt=null,vi(e,t,r),qt=n,Gn=o,qt!==null&&(Gn?(e=qt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):qt.removeChild(r.stateNode));break;case 18:qt!==null&&(Gn?(e=qt,r=r.stateNode,e.nodeType===8?Dg(e.parentNode,r):e.nodeType===1&&Dg(e,r),Gu(e)):Dg(qt,r.stateNode));break;case 4:n=qt,o=Gn,qt=r.stateNode.containerInfo,Gn=!0,vi(e,t,r),qt=n,Gn=o;break;case 0:case 11:case 14:case 15:if(!cr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){o=n=n.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&N0(r,t,s),o=o.next}while(o!==n)}vi(e,t,r);break;case 1:if(!cr&&(ll(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){mt(r,t,a)}vi(e,t,r);break;case 21:vi(e,t,r);break;case 22:r.mode&1?(cr=(n=cr)||r.memoizedState!==null,vi(e,t,r),cr=n):vi(e,t,r);break;default:vi(e,t,r)}}function dw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Q8),t.forEach(function(n){var o=l9.bind(null,e,n);r.has(n)||(r.add(n),n.then(o,o))})}}function jn(e,t){var r=t.deletions;if(r!==null)for(var n=0;no&&(o=s),n&=~i}if(n=o,n=vt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*t9(n/1960))-n,10e?16:e,$i===null)var n=!1;else{if(e=$i,$i=null,eh=0,Oe&6)throw Error($(331));var o=Oe;for(Oe|=4,X=e.current;X!==null;){var i=X,s=i.child;if(X.flags&16){var a=i.deletions;if(a!==null){for(var l=0;lvt()-Ay?Zs(e,0):_y|=r),Hr(e,t)}function JM(e,t){t===0&&(e.mode&1?(t=lf,lf<<=1,!(lf&130023424)&&(lf=4194304)):t=1);var r=kr();e=oi(e,t),e!==null&&(Bd(e,t,r),Hr(e,r))}function a9(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),JM(e,r)}function l9(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:n=e.stateNode;break;default:throw Error($(314))}n!==null&&n.delete(t),JM(e,r)}var XM;XM=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Dr.current)zr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return zr=!1,Y8(e,t,r);zr=!!(e.flags&131072)}else zr=!1,ot&&t.flags&1048576&&eM(t,Wp,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Jf(e,t),e=t.pendingProps;var o=Dl(t,fr.current);bl(t,r),o=Sy(null,t,n,e,o,r);var i=Ey();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,$r(n)?(i=!0,jp(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,yy(t),o.updater=Yh,t.stateNode=o,o._reactInternals=t,E0(t,n,e,r),t=T0(null,t,n,!0,i,r)):(t.tag=0,ot&&i&&dy(t),vr(null,t,o,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Jf(e,t),e=t.pendingProps,o=n._init,n=o(n._payload),t.type=n,o=t.tag=u9(n),e=qn(n,e),o){case 0:t=M0(null,t,n,e,r);break e;case 1:t=sw(null,t,n,e,r);break e;case 11:t=ow(null,t,n,e,r);break e;case 14:t=iw(null,t,n,qn(n.type,e),r);break e}throw Error($(306,n,""))}return t;case 0:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:qn(n,o),M0(e,t,n,o,r);case 1:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:qn(n,o),sw(e,t,n,o,r);case 3:e:{if(zM(t),e===null)throw Error($(387));n=t.pendingProps,i=t.memoizedState,o=i.element,oM(e,t),Gp(t,n,null,r);var s=t.memoizedState;if(n=s.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Fl(Error($(423)),t),t=aw(e,t,n,r,o);break e}else if(n!==o){o=Fl(Error($(424)),t),t=aw(e,t,n,r,o);break e}else for(an=qi(t.stateNode.containerInfo.firstChild),ln=t,ot=!0,Jn=null,r=lM(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if($l(),n===o){t=ii(e,t,r);break e}vr(e,t,n,r)}t=t.child}return t;case 5:return cM(t),e===null&&k0(t),n=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,g0(n,o)?s=null:i!==null&&g0(n,i)&&(t.flags|=32),PM(e,t),vr(e,t,s,r),t.child;case 6:return e===null&&k0(t),null;case 13:return LM(e,t,r);case 4:return by(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Hl(t,null,n,r):vr(e,t,n,r),t.child;case 11:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:qn(n,o),ow(e,t,n,o,r);case 7:return vr(e,t,t.pendingProps,r),t.child;case 8:return vr(e,t,t.pendingProps.children,r),t.child;case 12:return vr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,Ye(Kp,n._currentValue),n._currentValue=s,i!==null)if(so(i.value,s)){if(i.children===o.children&&!Dr.current){t=ii(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=ei(-1,r&-r),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),w0(i.return,r,t),a.lanes|=r;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error($(341));s.lanes|=r,a=s.alternate,a!==null&&(a.lanes|=r),w0(s,r,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}vr(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,n=t.pendingProps.children,bl(t,r),o=Nn(o),n=n(o),t.flags|=1,vr(e,t,n,r),t.child;case 14:return n=t.type,o=qn(n,t.pendingProps),o=qn(n.type,o),iw(e,t,n,o,r);case 15:return NM(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:qn(n,o),Jf(e,t),t.tag=1,$r(n)?(e=!0,jp(t)):e=!1,bl(t,r),sM(t,n,o),E0(t,n,o,r),T0(null,t,n,!0,e,r);case 19:return IM(e,t,r);case 22:return RM(e,t,r)}throw Error($(156,t.tag))};function QM(e,t){return EC(e,t)}function c9(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mn(e,t,r,n){return new c9(e,t,r,n)}function zy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function u9(e){if(typeof e=="function")return zy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Zv)return 11;if(e===ey)return 14}return 2}function Xi(e,t){var r=e.alternate;return r===null?(r=Mn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Zf(e,t,r,n,o,i){var s=2;if(n=e,typeof e=="function")zy(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Za:return ea(r.children,o,i,t);case Qv:s=8,o|=8;break;case G1:return e=Mn(12,r,t,o|2),e.elementType=G1,e.lanes=i,e;case Y1:return e=Mn(13,r,t,o),e.elementType=Y1,e.lanes=i,e;case J1:return e=Mn(19,r,t,o),e.elementType=J1,e.lanes=i,e;case aC:return Zh(r,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case iC:s=10;break e;case sC:s=9;break e;case Zv:s=11;break e;case ey:s=14;break e;case Oi:s=16,n=null;break e}throw Error($(130,e==null?e:typeof e,""))}return t=Mn(s,r,t,o),t.elementType=e,t.type=n,t.lanes=i,t}function ea(e,t,r,n){return e=Mn(7,e,n,t),e.lanes=r,e}function Zh(e,t,r,n){return e=Mn(22,e,n,t),e.elementType=aC,e.lanes=r,e.stateNode={isHidden:!1},e}function Wg(e,t,r){return e=Mn(6,e,null,t),e.lanes=r,e}function Kg(e,t,r){return t=Mn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function d9(e,t,r,n,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Mg(0),this.expirationTimes=Mg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Mg(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Ly(e,t,r,n,o,i,s,a,l){return e=new d9(e,t,r,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Mn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},yy(i),e}function f9(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(rT)}catch(e){console.error(e)}}rT(),eC.exports=pn;var om=eC.exports;const xf=Ln(om);var v9=Object.defineProperty,y9=Object.getOwnPropertyDescriptor,b9=(e,t,r,n)=>{for(var o=n>1?void 0:n?y9(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&v9(t,r,o),o},nT=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},re=(e,t,r)=>(nT(e,t,"read from private field"),r?r.call(e):t.get(e)),Zr=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Xr=(e,t,r,n)=>(nT(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),qc,x9=class{constructor(){this.portals=new Map,Zr(this,qc,Bh()),this.on=e=>re(this,qc).on("update",e),this.once=e=>{const t=re(this,qc).on("update",r=>{t(),e(r)});return t}}update(){re(this,qc).emit("update",this.portals)}render({Component:e,container:t}){const r=this.portals.get(t);this.portals.set(t,{Component:e,key:(r==null?void 0:r.key)??Cl()}),this.update()}forceUpdate(){for(const[e,{Component:t}]of this.portals)this.portals.set(e,{Component:t,key:Cl()})}remove(e){this.portals.delete(e),this.update()}};qc=new WeakMap;var k9=e=>{const{portals:t}=e;return L.createElement(L.Fragment,null,t.map(([r,{Component:n,key:o}])=>om.createPortal(L.createElement(n,null),r,o)))};function w9(e){const[t,r]=S.useState(()=>Array.from(e.portals.entries()));return S.useEffect(()=>e.on(n=>{r(Array.from(n.entries()))}),[e]),S.useMemo(()=>t,[t])}var st,Gc,As,Yc,ep,Jc,Ka,Xc,tp,Ho,gr,H0,oT=class{constructor({getPosition:e,node:t,portalContainer:r,view:n,ReactComponent:o,options:i}){Zr(this,st,void 0),Zr(this,Gc,[]),Zr(this,As,void 0),Zr(this,Yc,void 0),Zr(this,ep,void 0),Zr(this,Jc,void 0),Zr(this,Ka,void 0),Zr(this,Xc,!1),Zr(this,tp,void 0),Zr(this,Ho,void 0),Zr(this,gr,void 0),Zr(this,H0,l=>{l&&(te(re(this,Ho),{code:H.REACT_NODE_VIEW,message:`You have applied a ref to a node view provided for '${re(this,st).type.name}' which doesn't support content.`}),l.append(re(this,Ho)))}),this.Component=()=>{const l=re(this,ep);return te(l,{code:H.REACT_NODE_VIEW,message:`The custom react node view provided for ${re(this,st).type.name} doesn't have a valid ReactComponent`}),L.createElement(l,{updateAttributes:this.updateAttributes,selected:this.selected,view:re(this,As),getPosition:re(this,Jc),node:re(this,st),forwardRef:re(this,H0),decorations:re(this,Gc)})},this.updateAttributes=l=>{if(!re(this,As).editable)return;const c=re(this,Jc).call(this);if(c==null)return;const u=re(this,As).state.tr.setNodeMarkup(c,void 0,{...re(this,st).attrs,...l});re(this,As).dispatch(u)},te(_e(e),{message:"You are attempting to use a node view for a mark type. This is not supported yet. Please check your configuration."}),Xr(this,st,t),Xr(this,As,n),Xr(this,Yc,r),Xr(this,ep,o),Xr(this,Jc,e),Xr(this,Ka,i),Xr(this,gr,this.createDom());const{contentDOM:s,wrapper:a}=this.createContentDom()??{};Xr(this,tp,s??void 0),Xr(this,Ho,a),re(this,Ho)&&re(this,gr).append(re(this,Ho)),this.setDomAttributes(re(this,st),re(this,gr)),this.Component.displayName=$4(`${re(this,st).type.name}NodeView`),this.renderComponent()}static create(e){const{portalContainer:t,ReactComponent:r,options:n}=e;return(o,i,s)=>new oT({options:n,node:o,view:i,getPosition:s,portalContainer:t,ReactComponent:r})}get selected(){return re(this,Xc)}get contentDOM(){return re(this,tp)}get dom(){return re(this,gr)}renderComponent(){re(this,Yc).render({Component:this.Component,container:re(this,gr)})}createDom(){const{defaultBlockNode:e,defaultInlineNode:t}=re(this,Ka),r=re(this,st).isInline?document.createElement(t):document.createElement(e);return r.classList.add(`${Gx(re(this,st).type.name)}-node-view-wrapper`),r}createContentDom(){var e,t;if(re(this,st).isLeaf)return;const r=(t=(e=re(this,st).type.spec).toDOM)==null?void 0:t.call(e,re(this,st));if(!r)return;const{contentDOM:n,dom:o}=sn.renderSpec(document,r);let i;if(Je(o))return i=o,o===n&&(i=document.createElement("span"),i.classList.add(`${Gx(re(this,st).type.name)}-node-view-content-wrapper`),i.append(n)),Je(n),{wrapper:i,contentDOM:n}}update(e,t){return Lh({types:re(this,st).type,node:e})?(re(this,st)===e&&re(this,Gc)===t||(re(this,st).sameMarkup(e)||this.setDomAttributes(e,re(this,gr)),Xr(this,st,e),Xr(this,Gc,t),this.renderComponent()),!0):!1}setDomAttributes(e,t){const{toDOM:r}=re(this,st).type.spec;let n=e.attrs;if(r){const o=r(e);if(ne(o)||S9(o))return;hs(o[1])&&(n=o[1])}for(const[o,i]of At(n))t.setAttribute(o,i)}selectNode(){Xr(this,Xc,!0),re(this,gr)&&re(this,gr).classList.add(Ux),this.renderComponent()}deselectNode(){Xr(this,Xc,!1),re(this,gr)&&re(this,gr).classList.remove(Ux),this.renderComponent()}destroy(){re(this,Yc).remove(re(this,gr))}ignoreMutation(e){return e.type==="selection"?!re(this,st).type.spec.selectable:re(this,Ho)?!re(this,Ho).contains(e.target):!0}stopEvent(e){var t;if(!re(this,gr))return!1;if(_e(re(this,Ka).stopEvent))return re(this,Ka).stopEvent({event:e});const r=e.target;if(!(re(this,gr).contains(r)&&!((t=this.contentDOM)!=null&&t.contains(r))))return!1;const o=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!o)return!0;const s=!!re(this,st).type.spec.draggable,a=ce.isSelectable(re(this,st)),l=e.type==="copy",c=e.type==="paste",u=e.type==="cut",d=e.type==="mousedown",f=e.type.startsWith("drag");return!s&&a&&f&&e.preventDefault(),!(f||o||l||c||u||d&&a)}},bw=oT;st=new WeakMap;Gc=new WeakMap;As=new WeakMap;Yc=new WeakMap;ep=new WeakMap;Jc=new WeakMap;Ka=new WeakMap;Xc=new WeakMap;tp=new WeakMap;Ho=new WeakMap;gr=new WeakMap;H0=new WeakMap;function S9(e){return Op(e)||hs(e)&&Op(e.dom)}var sd=class extends Ve{constructor(){super(...arguments),this.portalContainer=new x9}get name(){return"reactComponent"}onCreate(){this.store.setStoreKey("portalContainer",this.portalContainer)}createNodeViews(){const e=ee(),t=this.store.managerSettings.nodeViewComponents??{};for(const n of this.store.extensions)!n.ReactComponent||!$d(n)||n.reactComponentEnvironment==="ssr"||(e[n.name]=bw.create({options:this.options,ReactComponent:n.ReactComponent,portalContainer:this.portalContainer}));const r=At({...this.options.nodeViewComponents,...t});for(const[n,o]of r)e[n]=bw.create({options:this.options,ReactComponent:o,portalContainer:this.portalContainer});return e}};sd=b9([me({defaultOptions:{defaultBlockNode:"div",defaultInlineNode:"span",defaultContentNode:"span",defaultEnvironment:"both",nodeViewComponents:{},stopEvent:null},staticKeys:["defaultBlockNode","defaultInlineNode","defaultContentNode","defaultEnvironment"]})],sd);function E9(e){const t=S.createContext(null),r=C9(t);return[o=>{const i=e(o);return L.createElement(t.Provider,{value:i},o.children)},r,t]}function C9(e){return(t,r)=>{const n=S.useContext(e),o=M9(n);if(!n)throw new Error("`useContextHook` must be placed inside the `Provider` returned by the `createContextState` method");if(!t)return n;if(typeof t!="function")throw new TypeError("invalid arguments passed to `useContextHook`. This hook must be called with zero arguments, a getter function or a path string.");const i=t(n);if(!o||!r)return i;const s=t(o);return r(s,i)?s:i}}function M9(e){const t=S.useRef();return T9(()=>{t.current=e}),t.current}var T9=typeof document<"u"?S.useLayoutEffect:S.useEffect;function O9(e,t){return E9(r=>{const n=S.useRef(null),o=S.useRef(),i=t==null?void 0:t(r),[s,a]=S.useState(()=>e({get:xw(n),set:kw(o),previousContext:void 0,props:r,state:i})),l=[...Object.values(r),i];return S.useEffect(()=>{l.length!==0&&a(c=>e({get:xw(n),set:kw(o),previousContext:c,props:r,state:i}))},l),n.current=s,o.current=a,s})}function xw(e){return t=>{if(!e.current)throw new Error("`get` called outside of function scope. `get` can only be called within a function.");if(!t)return e.current;if(typeof t!="function")throw new TypeError("Invalid arguments passed to `useContextHook`. The hook must be called with zero arguments, a getter function or a path string.");return t(e.current)}}function kw(e){return t=>{if(!e.current)throw new Error("`set` called outside of function scope. `set` can only be called within a function.");e.current(r=>({...r,...typeof t=="function"?t(r):t}))}}var iT={},sT={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.errorMessages=e.ErrorType=void 0;var t;(function(r){r.MalformedUnicode="MALFORMED_UNICODE",r.MalformedHexadecimal="MALFORMED_HEXADECIMAL",r.CodePointLimit="CODE_POINT_LIMIT",r.OctalDeprecation="OCTAL_DEPRECATION",r.EndOfString="END_OF_STRING"})(t=e.ErrorType||(e.ErrorType={})),e.errorMessages=new Map([[t.MalformedUnicode,"malformed Unicode character escape sequence"],[t.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[t.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[t.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[t.EndOfString,"malformed escape sequence at end of string"]])})(sT);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.unraw=e.errorMessages=e.ErrorType=void 0;const t=sT;Object.defineProperty(e,"ErrorType",{enumerable:!0,get:function(){return t.ErrorType}}),Object.defineProperty(e,"errorMessages",{enumerable:!0,get:function(){return t.errorMessages}});function r(p){return!p.match(/[^a-f0-9]/i)?parseInt(p,16):NaN}function n(p,h,m){const b=r(p);if(Number.isNaN(b)||m!==void 0&&m!==p.length)throw new SyntaxError(t.errorMessages.get(h));return b}function o(p){const h=n(p,t.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(h)}function i(p,h){const m=n(p,t.ErrorType.MalformedUnicode,4);if(h!==void 0){const b=n(h,t.ErrorType.MalformedUnicode,4);return String.fromCharCode(m,b)}return String.fromCharCode(m)}function s(p){return p.charAt(0)==="{"&&p.charAt(p.length-1)==="}"}function a(p){if(!s(p))throw new SyntaxError(t.errorMessages.get(t.ErrorType.MalformedUnicode));const h=p.slice(1,-1),m=n(h,t.ErrorType.MalformedUnicode);try{return String.fromCodePoint(m)}catch(b){throw b instanceof RangeError?new SyntaxError(t.errorMessages.get(t.ErrorType.CodePointLimit)):b}}function l(p,h=!1){if(h)throw new SyntaxError(t.errorMessages.get(t.ErrorType.OctalDeprecation));const m=parseInt(p,8);return String.fromCharCode(m)}const c=new Map([["b","\b"],["f","\f"],["n",` -`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function u(p){return c.get(p)||p}const d=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function f(p,h=!1){return p.replace(d,function(m,b,v,g,y,x,k,w,E){if(b!==void 0)return"\\";if(v!==void 0)return o(v);if(g!==void 0)return a(g);if(y!==void 0)return i(y,x);if(k!==void 0)return i(k);if(w==="0")return"\0";if(w!==void 0)return l(w,!h);if(E!==void 0)return u(E);throw new SyntaxError(t.errorMessages.get(t.ErrorType.EndOfString))})}e.unraw=f,e.default=f})(iT);const _9=Ln(iT),Yo=e=>typeof e=="string",A9=e=>typeof e=="function",ww=new Map;function Hy(e){return[...Array.isArray(e)?e:[e],"en"]}function aT(e,t,r){const n=Hy(e);return nh(()=>oh("date",n,r),()=>new Intl.DateTimeFormat(n,r)).format(Yo(t)?new Date(t):t)}function B0(e,t,r){const n=Hy(e);return nh(()=>oh("number",n,r),()=>new Intl.NumberFormat(n,r)).format(t)}function Sw(e,t,r,{offset:n=0,...o}){const i=Hy(e),s=t?nh(()=>oh("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):nh(()=>oh("plural-cardinal",i),()=>new Intl.PluralRules(i,{type:"cardinal"}));return o[r]??o[s.select(r-n)]??o.other}function nh(e,t){const r=e();let n=ww.get(r);return n||(n=t(),ww.set(r,n)),n}function oh(e,t,r){const n=t.join("-");return`${e}-${n}-${JSON.stringify(r)}`}const lT=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g,N9=(e,t,r={})=>{t=t||e;const n=i=>Yo(i)?r[i]||{style:i}:i,o=(i,s)=>{const a=Object.keys(r).length?n("number"):{},l=B0(t,i,a);return s.replace("#",l)};return{plural:(i,s)=>{const{offset:a=0}=s,l=Sw(t,!1,i,s);return o(i-a,l)},selectordinal:(i,s)=>{const{offset:a=0}=s,l=Sw(t,!0,i,s);return o(i-a,l)},select:(i,s)=>s[i]??s.other,number:(i,s)=>B0(t,i,n(s)),date:(i,s)=>aT(t,i,n(s)),undefined:i=>i}};function R9(e,t,r){return(n,o={})=>{const i=N9(t,r,o),s=l=>Array.isArray(l)?l.reduce((c,u)=>{if(Yo(u))return c+u;const[d,f,p]=u;let h={};p!=null&&!Yo(p)?Object.keys(p).forEach(b=>{h[b]=s(p[b])}):h=p;const m=i[f](n[d],h);return m==null?c:c+m},""):l,a=s(e);return Yo(a)&&lT.test(a)?_9(a.trim()):Yo(a)?a.trim():a}}var P9=Object.defineProperty,z9=(e,t,r)=>t in e?P9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,L9=(e,t,r)=>(z9(e,typeof t!="symbol"?t+"":t,r),r);class I9{constructor(){L9(this,"_events",{})}on(t,r){return this._hasEvent(t)||(this._events[t]=[]),this._events[t].push(r),()=>this.removeListener(t,r)}removeListener(t,r){if(!this._hasEvent(t))return;const n=this._events[t].indexOf(r);~n&&this._events[t].splice(n,1)}emit(t,...r){this._hasEvent(t)&&this._events[t].map(n=>n.apply(this,r))}_hasEvent(t){return Array.isArray(this._events[t])}}var D9=Object.defineProperty,$9=(e,t,r)=>t in e?D9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pa=(e,t,r)=>($9(e,typeof t!="symbol"?t+"":t,r),r);class H9 extends I9{constructor(t){super(),Pa(this,"_locale"),Pa(this,"_locales"),Pa(this,"_localeData"),Pa(this,"_messages"),Pa(this,"_missing"),Pa(this,"t",this._.bind(this)),this._messages={},this._localeData={},t.missing!=null&&(this._missing=t.missing),t.messages!=null&&this.load(t.messages),t.localeData!=null&&this.loadLocaleData(t.localeData),(t.locale!=null||t.locales!=null)&&this.activate(t.locale,t.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(t,r){this._localeData[t]==null?this._localeData[t]=r:Object.assign(this._localeData[t],r)}loadLocaleData(t,r){r!=null?this._loadLocaleData(t,r):Object.keys(t).forEach(n=>this._loadLocaleData(n,t[n])),this.emit("change")}_load(t,r){this._messages[t]==null?this._messages[t]=r:Object.assign(this._messages[t],r)}load(t,r){r!=null?this._load(t,r):Object.keys(t).forEach(n=>this._load(n,t[n])),this.emit("change")}loadAndActivate({locale:t,locales:r,messages:n}){this._locale=t,this._locales=r||void 0,this._messages[this._locale]=n,this.emit("change")}activate(t,r){this._locale=t,this._locales=r,this.emit("change")}_(t,r={},{message:n,formats:o}={}){Yo(t)||(r=t.values||r,n=t.message,t=t.id);const i=!this.messages[t],s=this._missing;if(s&&i)return A9(s)?s(this._locale,t):s;i&&this.emit("missing",{id:t,locale:this._locale});let a=this.messages[t]||n||t;return Yo(a)&&lT.test(a)?JSON.parse(`"${a}"`):Yo(a)?a:R9(a,this._locale,this._locales)(r,o)}date(t,r){return aT(this._locales||this._locale,t,r)}number(t,r){return B0(this._locales||this._locale,t,r)}}function B9(e={}){return new H9(e)}const im=B9();function W(e,t){return t?"other":e==1?"one":"other"}function ui(e,t){return t?"other":e==0||e==1?"one":"other"}function Kr(e,t){var r=String(e).split("."),n=!r[1];return t?"other":e==1&&n?"one":"other"}function Le(e,t){return"other"}function xs(e,t){return t?"other":e==1?"one":e==2?"two":"other"}const F9=Le,V9=W,j9=ui;function U9(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const W9=W;function K9(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2);return t?"other":e==0?"zero":e==1?"one":e==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function q9(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2);return t?"other":e==0?"zero":e==1?"one":e==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function G9(e,t){return t?e==1||e==5||e==7||e==8||e==9||e==10?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const Y9=W,J9=Kr;function X9(e,t){var r=String(e).split("."),n=r[0],o=n.slice(-1),i=n.slice(-2),s=n.slice(-3);return t?o==1||o==2||o==5||o==7||o==8||i==20||i==50||i==70||i==80?"one":o==3||o==4||s==100||s==200||s==300||s==400||s==500||s==600||s==700||s==800||s==900?"few":n==0||o==6||i==40||i==60||i==90?"many":"other":e==1?"one":"other"}function Q9(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2);return t?(o==2||o==3)&&i!=12&&i!=13?"few":"other":o==1&&i!=11?"one":o>=2&&o<=4&&(i<12||i>14)?"few":n&&o==0||o>=5&&o<=9||i>=11&&i<=14?"many":"other"}const Z9=W,eD=W,tD=W,rD=ui,nD=Le;function oD(e,t){return t?e==1||e==5||e==7||e==8||e==9||e==10?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const iD=Le;function sD(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2),s=n&&r[0].slice(-6);return t?"other":o==1&&i!=11&&i!=71&&i!=91?"one":o==2&&i!=12&&i!=72&&i!=92?"two":(o==3||o==4||o==9)&&(i<10||i>19)&&(i<70||i>79)&&(i<90||i>99)?"few":e!=0&&n&&s==0?"many":"other"}const aD=W;function lD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function cD(e,t){var r=String(e).split("."),n=!r[1];return t?e==1||e==3?"one":e==2?"two":e==4?"few":"other":e==1&&n?"one":"other"}const uD=W;function dD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?"other":i&&(n==1||n==2||n==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const fD=W,pD=W,hD=W;function mD(e,t){var r=String(e).split("."),n=r[0],o=!r[1];return t?"other":e==1&&o?"one":n>=2&&n<=4&&o?"few":o?"other":"many"}function gD(e,t){return t?e==0||e==7||e==8||e==9?"zero":e==1?"one":e==2?"two":e==3||e==4?"few":e==5||e==6?"many":"other":e==0?"zero":e==1?"one":e==2?"two":e==3?"few":e==6?"many":"other"}function vD(e,t){var r=String(e).split("."),n=r[0],o=Number(r[0])==e;return t?"other":e==1||!o&&(n==0||n==1)?"one":"other"}const yD=Kr;function bD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-2),a=o.slice(-2);return t?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}const xD=W,kD=Le,wD=W,SD=W;function ED(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?i==1&&s!=11?"one":i==2&&s!=12?"two":i==3&&s!=13?"few":"other":e==1&&n?"one":"other"}const CD=W,MD=W,TD=Kr,OD=W;function _D(e,t){return t?"other":e>=0&&e<=1?"one":"other"}function AD(e,t){return t?"other":e>=0&&e<2?"one":"other"}const ND=Kr;function RD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?e==1?"one":"other":i&&(n==1||n==2||n==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const PD=W;function zD(e,t){return t?e==1?"one":"other":e>=0&&e<2?"one":"other"}const LD=W,ID=Kr;function DD(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?e==1?"one":"other":e==1?"one":e==2?"two":n&&e>=3&&e<=6?"few":n&&e>=7&&e<=10?"many":"other"}function $D(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?e==1||e==11?"one":e==2||e==12?"two":e==3||e==13?"few":"other":e==1||e==11?"one":e==2||e==12?"two":n&&e>=3&&e<=10||n&&e>=13&&e<=19?"few":"other"}const HD=Kr,BD=W;function FD(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const VD=ui;function jD(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":o&&i==1?"one":o&&i==2?"two":o&&(s==0||s==20||s==40||s==60||s==80)?"few":o?"other":"many"}const UD=W,WD=W;function KD(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1);return t?"other":e==1&&o?"one":n==2&&o?"two":o&&(e<0||e>10)&&i&&s==0?"many":"other"}function qD(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}function GD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function YD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-2),a=o.slice(-2);return t?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}function JD(e,t){return t?e==1||e==5?"one":"other":e==1?"one":"other"}function XD(e,t){return t?e==1?"one":"other":e>=0&&e<2?"one":"other"}const QD=Kr,ZD=Le,e7=Le,t7=Le,r7=Kr;function n7(e,t){var r=String(e).split("."),n=r[0],o=Number(r[0])==e,i=n.slice(-1),s=n.slice(-2);return t?"other":o&&i==1&&s!=11||!o?"one":"other"}function o7(e,t){var r=String(e).split("."),n=!r[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&n?"one":"other"}const i7=xs;function s7(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1);return t?"other":e==1&&o?"one":n==2&&o?"two":o&&(e<0||e>10)&&i&&s==0?"many":"other"}const a7=Le,l7=Le,c7=W,u7=Kr,d7=W,f7=Le,p7=Le;function h7(e,t){var r=String(e).split("."),n=r[0],o=n.slice(-2);return t?n==1?"one":n==0||o>=2&&o<=20||o==40||o==60||o==80?"many":"other":e==1?"one":"other"}function m7(e,t){return t?"other":e>=0&&e<2?"one":"other"}const g7=W,v7=W,y7=Le,b7=Le;function x7(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1);return t?o==6||o==9||n&&o==0&&e!=0?"many":"other":e==1?"one":"other"}const k7=W,w7=W,S7=Le;function E7(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const C7=Le,M7=W,T7=W;function O7(e,t){return t?"other":e==0?"zero":e==1?"one":"other"}const _7=W;function A7(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2),i=n&&r[0].slice(-3),s=n&&r[0].slice(-5),a=n&&r[0].slice(-6);return t?n&&e>=1&&e<=4||o>=1&&o<=4||o>=21&&o<=24||o>=41&&o<=44||o>=61&&o<=64||o>=81&&o<=84?"one":e==5||o==5?"many":"other":e==0?"zero":e==1?"one":o==2||o==22||o==42||o==62||o==82||n&&i==0&&(s>=1e3&&s<=2e4||s==4e4||s==6e4||s==8e4)||e!=0&&a==1e5?"two":o==3||o==23||o==43||o==63||o==83?"few":e!=1&&(o==1||o==21||o==41||o==61||o==81)?"many":"other"}const N7=W;function R7(e,t){var r=String(e).split("."),n=r[0];return t?"other":e==0?"zero":(n==0||n==1)&&e!=0?"one":"other"}const P7=W,z7=W,L7=Le,I7=ui;function D7(e,t){return t&&e==1?"one":"other"}function $7(e,t){var r=String(e).split("."),n=r[1]||"",o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?"other":i==1&&(s<11||s>19)?"one":i>=2&&i<=9&&(s<11||s>19)?"few":n!=0?"many":"other"}function H7(e,t){var r=String(e).split("."),n=r[1]||"",o=n.length,i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-2),c=n.slice(-1);return t?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const B7=W,F7=ui,V7=W;function j7(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?s==1&&a!=11?"one":s==2&&a!=12?"two":(s==7||s==8)&&a!=17&&a!=18?"many":"other":i&&s==1&&a!=11||l==1&&c!=11?"one":"other"}const U7=W,W7=W;function K7(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-2);return t?e==1?"one":"other":e==1&&n?"one":!n||e==0||i>=2&&i<=19?"few":"other"}function q7(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":"other":e==1?"one":"other"}function G7(e,t){return t&&e==1?"one":"other"}function Y7(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2);return t?"other":e==1?"one":e==0||o>=2&&o<=10?"few":o>=11&&o<=19?"many":"other"}const J7=Le,X7=W,Q7=xs,Z7=W,e$=W;function t$(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?n&&e>=1&&e<=4?"one":"other":e==1?"one":"other"}const r$=Kr,n$=W,o$=W,i$=W,s$=Le,a$=W,l$=ui,c$=W,u$=W,d$=W;function f$(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?e==1||e==5||n&&e>=7&&e<=9?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e==1?"one":"other"}const p$=W,h$=Le,m$=ui,g$=W;function v$(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":e==1&&o?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&n!=1&&(i==0||i==1)||o&&i>=5&&i<=9||o&&s>=12&&s<=14?"many":"other"}function y$(e,t){var r=String(e).split("."),n=r[1]||"",o=n.length,i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-2),c=n.slice(-1);return t?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const b$=W;function x$(e,t){var r=String(e).split("."),n=r[0];return t?"other":n==0||n==1?"one":"other"}const k$=Kr,w$=W;function S$(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-2);return t?e==1?"one":"other":e==1&&n?"one":!n||e==0||i>=2&&i<=19?"few":"other"}const E$=W,C$=Le;function M$(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":o&&i==1&&s!=11?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&i==0||o&&i>=5&&i<=9||o&&s>=11&&s<=14?"many":"other"}const T$=W,O$=Le,_$=W;function A$(e,t){var r=String(e).split("."),n=!r[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&n?"one":"other"}function N$(e,t){var r=String(e).split("."),n=!r[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&n?"one":"other"}const R$=W,P$=W,z$=xs,L$=W,I$=Le,D$=Le;function $$(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function H$(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?"other":e>=0&&e<=1?"one":n&&e>=2&&e<=10?"few":"other"}function B$(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"";return t?"other":e==0||e==1||n==0&&o==1?"one":"other"}function F$(e,t){var r=String(e).split("."),n=r[0],o=!r[1];return t?"other":e==1&&o?"one":n>=2&&n<=4&&o?"few":o?"other":"many"}function V$(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-2);return t?"other":o&&i==1?"one":o&&i==2?"two":o&&(i==3||i==4)||!o?"few":"other"}const j$=xs,U$=xs,W$=xs,K$=xs,q$=xs,G$=W,Y$=W;function J$(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2);return t?e==1?"one":o==4&&i!=14?"many":"other":e==1?"one":"other"}function X$(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}const Q$=W,Z$=W,eH=W,tH=Le;function rH(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?(i==1||i==2)&&s!=11&&s!=12?"one":"other":e==1&&n?"one":"other"}const nH=Kr,oH=W,iH=W,sH=W,aH=W,lH=Le,cH=ui,uH=W;function dH(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1);return t?o==6||o==9||e==10?"few":"other":e==1?"one":"other"}function fH(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?e==1?"one":"other":i&&(n==1||n==2||n==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const pH=W,hH=Le,mH=W,gH=W;function vH(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?"other":e==0||e==1||n&&e>=11&&e<=99?"one":"other"}const yH=W;function bH(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-1),c=n.slice(-2);return t?s==3&&a!=13?"few":"other":o&&l==1&&c!=11?"one":o&&l>=2&&l<=4&&(c<12||c>14)?"few":o&&l==0||o&&l>=5&&l<=9||o&&c>=11&&c<=14?"many":"other"}const xH=Kr,kH=W,wH=W;function SH(e,t){return t&&e==1?"one":"other"}const EH=W,CH=W,MH=ui,TH=W,OH=Le,_H=W,AH=W,NH=Kr,RH=Le,PH=Le,zH=Le;function LH(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const IH=Object.freeze(Object.defineProperty({__proto__:null,_in:F9,af:V9,ak:j9,am:U9,an:W9,ar:K9,ars:q9,as:G9,asa:Y9,ast:J9,az:X9,be:Q9,bem:Z9,bez:eD,bg:tD,bho:rD,bm:nD,bn:oD,bo:iD,br:sD,brx:aD,bs:lD,ca:cD,ce:uD,ceb:dD,cgg:fD,chr:pD,ckb:hD,cs:mD,cy:gD,da:vD,de:yD,dsb:bD,dv:xD,dz:kD,ee:wD,el:SD,en:ED,eo:CD,es:MD,et:TD,eu:OD,fa:_D,ff:AD,fi:ND,fil:RD,fo:PD,fr:zD,fur:LD,fy:ID,ga:DD,gd:$D,gl:HD,gsw:BD,gu:FD,guw:VD,gv:jD,ha:UD,haw:WD,he:KD,hi:qD,hr:GD,hsb:YD,hu:JD,hy:XD,ia:QD,id:ZD,ig:e7,ii:t7,io:r7,is:n7,it:o7,iu:i7,iw:s7,ja:a7,jbo:l7,jgo:c7,ji:u7,jmc:d7,jv:f7,jw:p7,ka:h7,kab:m7,kaj:g7,kcg:v7,kde:y7,kea:b7,kk:x7,kkj:k7,kl:w7,km:S7,kn:E7,ko:C7,ks:M7,ksb:T7,ksh:O7,ku:_7,kw:A7,ky:N7,lag:R7,lb:P7,lg:z7,lkt:L7,ln:I7,lo:D7,lt:$7,lv:H7,mas:B7,mg:F7,mgo:V7,mk:j7,ml:U7,mn:W7,mo:K7,mr:q7,ms:G7,mt:Y7,my:J7,nah:X7,naq:Q7,nb:Z7,nd:e$,ne:t$,nl:r$,nn:n$,nnh:o$,no:i$,nqo:s$,nr:a$,nso:l$,ny:c$,nyn:u$,om:d$,or:f$,os:p$,osa:h$,pa:m$,pap:g$,pl:v$,prg:y$,ps:b$,pt:x$,pt_PT:k$,rm:w$,ro:S$,rof:E$,root:C$,ru:M$,rwk:T$,sah:O$,saq:_$,sc:A$,scn:N$,sd:R$,sdh:P$,se:z$,seh:L$,ses:I$,sg:D$,sh:$$,shi:H$,si:B$,sk:F$,sl:V$,sma:j$,smi:U$,smj:W$,smn:K$,sms:q$,sn:G$,so:Y$,sq:J$,sr:X$,ss:Q$,ssy:Z$,st:eH,su:tH,sv:rH,sw:nH,syr:oH,ta:iH,te:sH,teo:aH,th:lH,ti:cH,tig:uH,tk:dH,tl:fH,tn:pH,to:hH,tr:mH,ts:gH,tzm:vH,ug:yH,uk:bH,ur:xH,uz:kH,ve:wH,vi:SH,vo:EH,vun:CH,wa:MH,wae:TH,wo:OH,xh:_H,xog:AH,yi:NH,yo:RH,yue:PH,zh:zH,zu:LH},Symbol.toStringTag,{value:"Module"}));var DH=Object.defineProperty,$H=Object.getOwnPropertyDescriptor,HH=Object.getOwnPropertyNames,BH=Object.prototype.hasOwnProperty,Ew=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of HH(t))!BH.call(e,o)&&o!==r&&DH(e,o,{get:()=>t[o],enumerable:!(n=$H(t,o))||n.enumerable});return e},FH=(e,t,r)=>(Ew(e,t,"default"),r&&Ew(r,t,"default")),VH=JSON.parse('{"extension.command.toggle-upper-case.label":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"extension.table.column_count":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"extension.table.row_count":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.toggle-columns.description":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"extension.command.toggle-columns.label":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"extension.command.set-text-direction.label":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"extension.command.set-text-direction.description":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"extension.command.toggle-heading.label":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"extension.command.toggle-callout.description":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"extension.command.toggle-callout.label":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"extension.command.toggle-code-block.description":"Add a code block","extension.command.add-annotation.label":"Add annotation","extension.command.toggle-blockquote.description":"Add blockquote formatting to the selected text","extension.command.toggle-bold.description":"Add bold formatting to the selected text","extension.command.toggle-code.description":"Add inline code formatting to the selected text","keyboard.shortcut.alt":"Alt","keyboard.shortcut.arrowDown":"Arrow Down","keyboard.shortcut.arrowLeft":"Arrow Left","keyboard.shortcut.arrowRight":"Arrow Right","keyboard.shortcut.arrowUp":"Arrow Up","keyboard.shortcut.backspace":"Backspace","ui.text-color.black":"Black","extension.command.toggle-blockquote.label":"Blockquote","ui.text-color.blue":"Blue","ui.text-color.blue.hue":["Blue ",["hue"]],"extension.command.toggle-bold.label":"Bold","extension.command.toggle-bullet-list.description":"Bulleted list","keyboard.shortcut.capsLock":"Caps Lock","extension.command.center-align.label":"Center align","extension.command.toggle-code.label":"Code","extension.command.toggle-code-block.label":"Codeblock","keyboard.shortcut.command":"Command","QcPNd6":"Image description","ogrUzJ":"Add a short description here.","yqdyzr":"Image","6/02F4":"Image source","X8H91v":"Image","zhQ7Zt":"Italic","ZL7E7l":"Underline","keyboard.shortcut.control":"Control","extension.command.convert-paragraph.description":"Convert current block into a paragraph block.","extension.command.convert-paragraph.label":"Convert Paragraph","extension.command.copy.label":"Copy","extension.command.copy.description":"Copy the selected text","extension.command.create-table.description":"Create a table with set number of rows and columns.","extension.command.create-table.label":"Create table","extension.command.cut.label":"Cut","extension.command.cut.description":"Cut the selected text","ui.text-color.cyan":"Cyan","ui.text-color.cyan.hue":["Cyan ",["hue"]],"extension.command.decrease-font-size.label":"Decrease","extension.command.decrease-indent.label":"Decrease indentation","extension.command.decrease-font-size.description":"Decrease the font size.","keyboard.shortcut.delete":"Delete","extension.command.insert-horizontal-rule.label":"Divider","keyboard.shortcut.end":"End","keyboard.shortcut.escape":"Enter","keyboard.shortcut.enter":"Enter","6PjrOF":"Add annotation","OTq5WC":"Center align","oeZ3ox":"Convert current block into a paragraph block.","m1khs+":"Convert Paragraph","w/1U+3":"Copy the selected text","kdodi0":"Copy","k0KR/u":"Create a table with set number of rows and columns.","zrwMyD":"Create table","D/nWxh":"Cut the selected text","jHPv5m":"Cut","5cNgRx":"Decrease the font size.","vyRNWx":"Decrease","Jgiol4":"Decrease indentation","1gJSHH":"Increase the font size","OQXJXz":"Increase","72TLhr":"Increase indentation","HFlfzJ":"Insert Emoji","RPq9fY":"Separate content with a diving horizontal line","OKQF+e":"Divider","zjYb9C":"Insert a new paragraph","4M4sXC":"Insert Paragraph","1Q+eVc":"Justify","ejWWtP":"Left align","wVqrpS":"Paste content into the editor","07v9aw":"Paste","zUYfou":"Redo the most recent action","9Nq9zr":"Redo","0uxaZe":"Remove annotation","iJWZAz":"Right align","g5WpPn":"Select all content within the editor","2+pZDT":"Select all","yChCR1":"Set text case","GMzAC/":"Set the font size for the selected text.","vzEyrv":"Font size","7VCkJ8":"Set the text color for the selected text.","qjWFaR":"Text color","LVWgFu":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"WXwRy1":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"G/o315":"Set the text highlight color for the selected text.","xtHg6d":"Text highlight","1p1W/p":"Add blockquote formatting to the selected text","6+rh6I":"Blockquote","0yB3LV":"Add bold formatting to the selected text","sFMo4Z":"Bold","SMKG/s":"Bulleted list","/BYCMi":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"V+3IBe":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"hbIo4L":"Add a code block","7GkMcx":"Codeblock","2r4JYl":"Add inline code formatting to the selected text","Up8Tpe":"Code","ATHSPS":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"7DC1VE":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"hnrBeo":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"NkZAcw":"Italicize the selected text","2fTW9e":"Italic","c759Ra":"Ordered list","uQwrZu":"Strikethrough the selected text","pT3qly":"Strikethrough","BHk+zu":"Subscript","18BVwM":"Superscript","tOIVCV":"Tasked list","4Janx3":"Underline the selected text","dCHt+D":"Underline","YYAprs":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"tczyZL":"Show hidden whitespace characters in your editor.","0qAX23":"Toggle Whitespace","ezMADU":"Undo the most recent action","N3P7EC":"Undo","2nj/+s":"Update annotation","dWD7u4":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"qXqgVT":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.set-font-size.label":"Font size","ui.text-color.grape":"Grape","ui.text-color.grape.hue":["Grape ",["hue"]],"ui.text-color.gray":"Gray","ui.text-color.gray.hue":["Gray ",["hue"]],"ui.text-color.green":"Green","ui.text-color.green.hue":["Green ",["hue"]],"keyboard.shortcut.home":"Home","extension.command.increase-font-size.label":"Increase","extension.command.increase-indent.label":"Increase indentation","extension.command.increase-font-size.description":"Increase the font size","ui.text-color.indigo":"Indigo","ui.text-color.indigo.hue":["Indigo ",["hue"]],"extension.command.insert-paragraph.description":"Insert a new paragraph","extension.command.insert-emoji.label":"Insert Emoji","extension.command.insert-paragraph.label":"Insert Paragraph","extension.command.toggle-italic.label":"Italic","extension.command.toggle-italic.description":"Italicize the selected text","extension.command.justify-align.label":"Justify","R7NlCw":"Alt","RbDiK5":"Arrow Down","Dgyd+E":"Arrow Left","8pdCk4":"Arrow Right","Gp/343":"Arrow Up","PFPV0A":"Backspace","0IRYvp":"Caps Lock","X7HX0D":"Command","zq0AdD":"Control","8SfToN":"Delete","Ys/uah":"End","3K5hww":"Enter","veQt1j":"Enter","ySv7i+":"Home","e6RUI1":"Page Down","EEJk31":"Page Up","7sbhAU":"Shift","Q4eplT":"Space","SUhVVC":"Tab","extension.command.left-align.label":"Left align","ui.text-color.lime":"Lime","ui.text-color.lime.hue":["Lime ",["hue"]],"react-components.mention-atom-component.zero-items":"No items available","ui.text-color.orange":"Orange","ui.text-color.orange.hue":["Orange ",["hue"]],"extension.command.toggle-ordered-list.label":"Ordered list","keyboard.shortcut.pageDown":"Page Down","keyboard.shortcut.pageUp":"Page Up","extension.command.paste.label":"Paste","extension.command.paste.description":"Paste content into the editor","ui.text-color.pink":"Pink","ui.text-color.pink.hue":["Pink ",["hue"]],"zvMfIA":"No items available","pEjhti":"Static Menu","ui.text-color.red":"Red","ui.text-color.red.hue":["Red ",["hue"]],"extension.command.redo.label":"Redo","extension.command.redo.description":"Redo the most recent action","extension.command.remove-annotation.label":"Remove annotation","extension.command.right-align.label":"Right align","extension.command.select-all.label":"Select all","extension.command.select-all.description":"Select all content within the editor","extension.command.insert-horizontal-rule.description":"Separate content with a diving horizontal line","extension.command.set-casing.label":"Set text case","extension.command.set-font-size.description":"Set the font size for the selected text.","extension.command.set-text-color.description":"Set the text color for the selected text.","extension.command.set-text-highlight.description":"Set the text highlight color for the selected text.","keyboard.shortcut.shift":"Shift","extension.command.toggle-whitespace.description":"Show hidden whitespace characters in your editor.","keyboard.shortcut.space":"Space","extension.command.toggle-strike.label":"Strikethrough","extension.command.toggle-strike.description":"Strikethrough the selected text","extension.command.toggle-subscript.label":"Subscript","extension.command.toggle-superscript.label":"Superscript","keyboard.shortcut.tab":"Tab","extension.command.toggle-task-list.description":"Tasked list","ui.text-color.teal":"Teal","ui.text-color.teal.hue":["Teal ",["hue"]],"extension.command.set-text-color.label":"Text color","extension.command.set-text-highlight.label":"Text highlight","extension.command.toggle-whitespace.label":"Toggle Whitespace","ui.text-color.transparent":"Transparent","slrB1c":"Black","6QML30":"Blue","xw+keN":["Blue ",["hue"]],"38RHqP":"Cyan","D89yPf":["Cyan ",["hue"]],"VjBLnd":"Grape","Rp40yv":["Grape ",["hue"]],"5Dm9D1":"Gray","HGjXjC":["Gray ",["hue"]],"b9fz+n":"Green","18jo3M":["Green ",["hue"]],"CFzqCV":"Indigo","aVlDku":["Indigo ",["hue"]],"04PfLc":"Lime","KRTK6Y":["Lime ",["hue"]],"pSnXFd":"Orange","ve/MJZ":["Orange ",["hue"]],"OvCgDa":"Pink","l7NqyT":["Pink ",["hue"]],"IT9k0j":"Red","AdyJ7/":["Red ",["hue"]],"3D2UWc":"Teal","Dcq0Y1":["Teal ",["hue"]],"bsi2ik":"Transparent","Tj3PRR":"Violet","xxMH5N":["Violet ",["hue"]],"Rum0ah":"White","4gaw/Q":"Yellow","hhauc3":["Yellow ",["hue"]],"extension.command.toggle-underline.label":"Underline","extension.command.toggle-underline.description":"Underline the selected text","extension.command.undo.label":"Undo","extension.command.undo.description":"Undo the most recent action","extension.command.update-annotation.label":"Update annotation","ui.text-color.violet":"Violet","ui.text-color.violet.hue":["Violet ",["hue"]],"ui.text-color.white":"White","ui.text-color.yellow":"Yellow","ui.text-color.yellow.hue":["Yellow ",["hue"]]}'),cT={};FH(cT,IH);im.loadLocaleData("en",{plurals:cT.en});im.load("en",VH);im.activate("en");var jH=Object.defineProperty,UH=Object.getOwnPropertyDescriptor,By=(e,t,r,n)=>{for(var o=n>1?void 0:n?UH(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&jH(t,r,o),o},jl=class extends er{get name(){return"doc"}createNodeSpec(e,t){const{docAttributes:r,content:n}=this.options,o=ee();if(hs(r))for(const[i,s]of At(r))o[i]={default:s};else for(const i of r)o[i]={default:null};return{attrs:o,content:n,...t}}setDocAttributes(e){return({tr:t,dispatch:r})=>{if(r){for(const[n,o]of Object.entries(e))t.step(new ad(n,o));r(t)}return!0}}isDefaultDocNode({state:e=this.store.getState(),options:t}={}){return jv(e.doc,t)}};By([U()],jl.prototype,"setDocAttributes",1);By([He()],jl.prototype,"isDefaultDocNode",1);jl=By([me({defaultOptions:{content:"block+",docAttributes:[]},defaultPriority:Ae.Medium,staticKeys:["content","docAttributes"],disableExtraAttributes:!0})],jl);var uT="SetDocAttribute",dT="RevertSetDocAttribute",ad=class extends Rt{constructor(e,t,r=uT){super(),this.stepType=r,this.key=e,this.value=t}static fromJSON(e,t){return new ad(t.key,t.value,t.stepType)}apply(e){this.previous=e.attrs[this.key];const t={...e.attrs,[this.key]:this.value};return yt.ok(e.type.create(t,e.content,e.marks))}invert(){return new ad(this.key,this.previous,dT)}map(){return this}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}};try{Rt.jsonID(uT,ad),Rt.jsonID(dT,ad)}catch(e){if(!e.message.startsWith("Duplicate use of step JSON ID"))throw e}var WH=Object.defineProperty,KH=Object.getOwnPropertyDescriptor,fT=(e,t,r,n)=>{for(var o=n>1?void 0:n?KH(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&WH(t,r,o),o};function qH(e,t,r,n){const o=e.docView.posFromDOM(t,r,n);return o===null||o<0?null:o}function GH(e,t){const r=t.target;if(r){const n=qH(e,r,0);if(n!==null){const o=e.state.doc.resolve(n),i=o.node().isLeaf?0:1,s=o.start()-i;return{pos:n,inside:s}}}return e.posAtCoords({left:t.clientX,top:t.clientY})??void 0}var ih=class extends Ve{constructor(){super(...arguments),this.mousedown=!1,this.mouseover=!1,this.createMouseEventHandler=e=>(t,r)=>{const n=r,o=GH(t,n);if(!o)return!1;const i=[],s=[],{inside:a,pos:l}=o;if(a===-1)return!1;const c=t.state.doc.resolve(l),u=c.depth+1;for(const d of kv(u,1))i.push({node:d>c.depth&&c.nodeAfter?c.nodeAfter:c.node(d),pos:c.before(d)});for(const{type:d}of c.marksAcross(c)??[]){const f=_o(c,d);f&&s.push(f)}return e(n,{view:t,nodes:i,marks:s,getMark:d=>{const f=ne(d)?t.state.schema.marks[d]:d;return te(f,{code:H.EXTENSION,message:`The mark ${d} being checked does not exist within the editor schema.`}),s.find(p=>p.mark.type===f)},getNode:d=>{var f;const p=ne(d)?t.state.schema.nodes[d]:d;te(p,{code:H.EXTENSION,message:"The node being checked does not exist"});const h=i.find(({node:m})=>m.type===p);if(h)return{...h,isRoot:!!((f=i[0])!=null&&f.node.eq(h.node))}}})}}get name(){return"events"}onView(){var e,t;if(!((e=this.store.managerSettings.exclude)!=null&&e.clickHandler))for(const r of this.store.extensions){if(!r.createEventHandlers||(t=r.options.exclude)!=null&&t.clickHandler)continue;const n=r.createEventHandlers();for(const[o,i]of At(n))this.addHandler(o,i)}}createPlugin(){const e=new WeakMap,t=(r,n,o,i,s,a,l,c)=>{const u=this.store.currentState,{schema:d,doc:f}=u,p=f.resolve(i),h=e.has(l),m=YH({$pos:p,handled:h,view:o,state:u});let b=!1;h||(b=r(l,m)||b);const v={...m,pos:i,direct:c,nodeWithPosition:{node:s,pos:a},getNode:g=>{const y=ne(g)?d.nodes[g]:g;return te(y,{code:H.EXTENSION,message:"The node being checked does not exist"}),y===s.type?{node:s,pos:a}:void 0}};return e.set(l,!0),n(l,v)||b};return{props:{handleKeyPress:(r,n)=>this.options.keypress(n)||!1,handleKeyDown:(r,n)=>this.options.keydown(n)||!1,handleTextInput:(r,n,o,i)=>this.options.textInput({from:n,to:o,text:i})||!1,handleClickOn:(r,n,o,i,s,a)=>t(this.options.clickMark,this.options.click,r,n,o,i,s,a),handleDoubleClickOn:(r,n,o,i,s,a)=>t(this.options.doubleClickMark,this.options.doubleClick,r,n,o,i,s,a),handleTripleClickOn:(r,n,o,i,s,a)=>t(this.options.tripleClickMark,this.options.tripleClick,r,n,o,i,s,a),handleDOMEvents:{focus:(r,n)=>this.options.focus(n)||!1,blur:(r,n)=>this.options.blur(n)||!1,mousedown:(r,n)=>(this.startMouseover(),this.options.mousedown(n)||!1),mouseup:(r,n)=>(this.endMouseover(),this.options.mouseup(n)||!1),mouseleave:(r,n)=>(this.mouseover=!1,this.options.mouseleave(n)||!1),mouseenter:(r,n)=>(this.mouseover=!0,this.options.mouseenter(n)||!1),keyup:(r,n)=>this.options.keyup(n)||!1,mouseout:this.createMouseEventHandler((r,n)=>{const o={...n,hovering:!1};return this.options.hover(r,o)||!1}),mouseover:this.createMouseEventHandler((r,n)=>{const o={...n,hovering:!0};return this.options.hover(r,o)||!1}),contextmenu:this.createMouseEventHandler((r,n)=>this.options.contextmenu(r,n)||!1),scroll:(r,n)=>this.options.scroll(n)||!1,copy:(r,n)=>this.options.copy(n)||!1,cut:(r,n)=>this.options.cut(n)||!1,paste:(r,n)=>this.options.paste(n)||!1}},view:r=>{let n=r.editable;const o=this.options;return{update(i){const s=i.editable;s!==n&&(o.editable(s),n=s)}}}}}isInteracting(){return this.mousedown&&this.mouseover}startMouseover(){this.mouseover=!0,!this.mousedown&&(this.mousedown=!0,this.store.document.documentElement.addEventListener("mouseup",()=>{this.endMouseover()},{once:!0}))}endMouseover(){this.mousedown&&(this.mousedown=!1,this.store.commands.emptyUpdate())}};fT([He()],ih.prototype,"isInteracting",1);ih=fT([me({handlerKeys:["blur","focus","mousedown","mouseup","mouseenter","mouseleave","textInput","keypress","keyup","keydown","click","clickMark","doubleClick","doubleClickMark","tripleClick","tripleClickMark","contextmenu","hover","scroll","copy","cut","paste","editable"],handlerKeyOptions:{blur:{earlyReturnValue:!0},focus:{earlyReturnValue:!0},mousedown:{earlyReturnValue:!0},mouseleave:{earlyReturnValue:!0},mouseup:{earlyReturnValue:!0},click:{earlyReturnValue:!0},doubleClick:{earlyReturnValue:!0},tripleClick:{earlyReturnValue:!0},hover:{earlyReturnValue:!0},contextmenu:{earlyReturnValue:!0},scroll:{earlyReturnValue:!0},copy:{earlyReturnValue:!0},cut:{earlyReturnValue:!0},paste:{earlyReturnValue:!0}},defaultPriority:Ae.High})],ih);function YH(e){const{handled:t,view:r,$pos:n,state:o}=e,i={getMark:K4,markRanges:[],view:r,state:o};if(t)return i;for(const{type:s}of n.marksAcross(n)??[]){const a=_o(n,s);a&&i.markRanges.push(a)}return i.getMark=s=>{const a=ne(s)?o.schema.marks[s]:s;return te(a,{code:H.EXTENSION,message:`The mark ${s} being checked does not exist within the editor schema.`}),i.markRanges.find(l=>l.mark.type===a)},i}class gt extends be{constructor(t){super(t,t)}map(t,r){let n=t.resolve(r.map(this.head));return gt.valid(n)?new gt(n):be.near(n)}content(){return K.empty}eq(t){return t instanceof gt&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new gt(t.resolve(r.pos))}getBookmark(){return new Fy(this.anchor)}static valid(t){let r=t.parent;if(r.isTextblock||!JH(t)||!XH(t))return!1;let n=r.type.spec.allowGapCursor;if(n!=null)return n;let o=r.contentMatchAt(t.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(t,r,n=!1){e:for(;;){if(!n&>.valid(t))return t;let o=t.pos,i=null;for(let s=t.depth;;s--){let a=t.node(s);if(r>0?t.indexAfter(s)0){i=a.child(r>0?t.indexAfter(s):t.index(s)-1);break}else if(s==0)return null;o+=r;let l=t.doc.resolve(o);if(gt.valid(l))return l}for(;;){let s=r>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!ce.isSelectable(i)){t=t.doc.resolve(o+i.nodeSize*r),n=!1;continue e}break}i=s,o+=r;let a=t.doc.resolve(o);if(gt.valid(a))return a}return null}}}gt.prototype.visible=!1;gt.findFrom=gt.findGapCursorFrom;be.jsonID("gapcursor",gt);class Fy{constructor(t){this.pos=t}map(t){return new Fy(t.map(this.pos))}resolve(t){let r=t.resolve(this.pos);return gt.valid(r)?new gt(r):be.near(r)}}function JH(e){for(let t=e.depth;t>=0;t--){let r=e.index(t),n=e.node(t);if(r==0){if(n.type.spec.isolating)return!0;continue}for(let o=n.child(r-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function XH(e){for(let t=e.depth;t>=0;t--){let r=e.indexAfter(t),n=e.node(t);if(r==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let o=n.child(r);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function QH(){return new Ro({props:{decorations:rB,createSelectionBetween(e,t,r){return t.pos==r.pos&>.valid(r)?new gt(r):null},handleClick:eB,handleKeyDown:ZH,handleDOMEvents:{beforeinput:tB}}})}const ZH=qv({ArrowLeft:kf("horiz",-1),ArrowRight:kf("horiz",1),ArrowUp:kf("vert",-1),ArrowDown:kf("vert",1)});function kf(e,t){const r=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(n,o,i){let s=n.selection,a=t>0?s.$to:s.$from,l=s.empty;if(s instanceof le){if(!i.endOfTextblock(r)||a.depth==0)return!1;l=!1,a=n.doc.resolve(t>0?a.after():a.before())}let c=gt.findGapCursorFrom(a,t,l);return c?(o&&o(n.tr.setSelection(new gt(c))),!0):!1}}function eB(e,t,r){if(!e||!e.editable)return!1;let n=e.state.doc.resolve(t);if(!gt.valid(n))return!1;let o=e.posAtCoords({left:r.clientX,top:r.clientY});return o&&o.inside>-1&&ce.isSelectable(e.state.doc.nodeAt(o.inside))?!1:(e.dispatch(e.state.tr.setSelection(new gt(n))),!0)}function tB(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof gt))return!1;let{$from:r}=e.state.selection,n=r.parent.contentMatchAt(r.index()).findWrapping(e.state.schema.nodes.text);if(!n)return!1;let o=R.empty;for(let s=n.length-1;s>=0;s--)o=R.from(n[s].createAndFill(null,o));let i=e.state.tr.replace(r.pos,r.pos,new K(o,0,0));return i.setSelection(le.near(i.doc.resolve(r.pos+1))),e.dispatch(i),!1}function rB(e){if(!(e.selection instanceof gt))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Ee.create(e.doc,[Ge.widget(e.selection.head,t,{key:"gapcursor"})])}var nB=Object.defineProperty,oB=Object.getOwnPropertyDescriptor,iB=(e,t,r,n)=>{for(var o=n>1?void 0:n?oB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&nB(t,r,o),o},F0=class extends Ve{get name(){return"gapCursor"}createExternalPlugins(){return[QH()]}};F0=iB([me({})],F0);var sh=200,Bt=function(){};Bt.prototype.append=function(t){return t.length?(t=Bt.from(t),!this.length&&t||t.length=r?Bt.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,r))};Bt.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Bt.prototype.forEach=function(t,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length),r<=n?this.forEachInner(t,r,n,0):this.forEachInvertedInner(t,r,n,0)};Bt.prototype.map=function(t,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length);var o=[];return this.forEach(function(i,s){return o.push(t(i,s))},r,n),o};Bt.from=function(t){return t instanceof Bt?t:t&&t.length?new pT(t):Bt.empty};var pT=function(e){function t(n){e.call(this),this.values=n}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new t(this.values.slice(o,i))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,i,s,a){for(var l=i;l=s;l--)if(o(this.values[l],a+l)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=sh)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=sh)return new t(o.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(t.prototype,r),t}(Bt);Bt.empty=new pT([]);var sB=function(e){function t(r,n){e.call(this),this.left=r,this.right=n,this.length=r.length+n.length,this.depth=Math.max(r.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(n){return na&&this.right.forEachInner(n,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(n,o,i,s){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(n,o-a,Math.max(i,a)-a,s+a)===!1||i=i?this.right.slice(n-i,o-i):this.left.slice(n,i).append(this.right.slice(0,o-i))},t.prototype.leafAppend=function(n){var o=this.right.leafAppend(n);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(n){var o=this.left.leafPrepend(n);if(o)return new t(o,this.right)},t.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new t(this.left,new t(this.right,n)):new t(this,n)},t}(Bt);const aB=500;class Zn{constructor(t,r){this.items=t,this.eventCount=r}popEvent(t,r){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let o,i;r&&(o=this.remapping(n,this.items.length),i=o.maps.length);let s=t.tr,a,l,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(n,f+1),i=o.maps.length),i--,u.push(d);return}if(o){u.push(new mo(d.map));let p=d.step.map(o.slice(i)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new mo(h,void 0,void 0,c.length+u.length))),i--,h&&o.appendMap(h,i)}else s.maybeStep(d.step);if(d.selection)return a=o?d.selection.map(o.slice(i)):d.selection,l=new Zn(this.items.slice(0,n).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(t,r,n,o){let i=[],s=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let u=0;ucB&&(a=lB(a,c),s-=c),new Zn(a.append(i),s)}remapping(t,r){let n=new ul;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=t?n.maps.length-o.mirrorOffset:void 0;n.appendMap(o.map,s)},t,r),n}addMaps(t){return this.eventCount==0?this:new Zn(this.items.append(t.map(r=>new mo(r))),this.eventCount)}rebased(t,r){if(!this.eventCount)return this;let n=[],o=Math.max(0,this.items.length-r),i=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},o);let l=r;this.items.forEach(f=>{let p=i.getMirror(--l);if(p==null)return;s=Math.min(s,p);let h=i.maps[p];if(f.step){let m=t.steps[p].invert(t.docs[p]),b=f.selection&&f.selection.map(i.slice(l+1,p));b&&a++,n.push(new mo(h,m,b))}else n.push(new mo(h))},o);let c=[];for(let f=r;faB&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let t=0;return this.items.forEach(r=>{r.step||t++}),t}compress(t=this.items.length){let r=this.remapping(0,t),n=r.maps.length,o=[],i=0;return this.items.forEach((s,a)=>{if(a>=t)o.push(s),s.selection&&i++;else if(s.step){let l=s.step.map(r.slice(n)),c=l&&l.getMap();if(n--,c&&r.appendMap(c,n),l){let u=s.selection&&s.selection.map(r.slice(n));u&&i++;let d=new mo(c.invert(),l,u),f,p=o.length-1;(f=o.length&&o[p].merge(d))?o[p]=f:o.push(d)}}else s.map&&n--},this.items.length,0),new Zn(Bt.from(o.reverse()),i)}}Zn.empty=new Zn(Bt.empty,0);function lB(e,t){let r;return e.forEach((n,o)=>{if(n.selection&&t--==0)return r=o,!1}),e.slice(r)}class mo{constructor(t,r,n,o){this.map=t,this.step=r,this.selection=n,this.mirrorOffset=o}merge(t){if(this.step&&t.step&&!t.selection){let r=t.step.merge(this.step);if(r)return new mo(r.getMap().invert(),r,this.selection)}}}class Ai{constructor(t,r,n,o,i){this.done=t,this.undone=r,this.prevRanges=n,this.prevTime=o,this.prevComposition=i}}const cB=20;function uB(e,t,r,n){let o=r.getMeta(So),i;if(o)return o.historyState;r.getMeta(fB)&&(e=new Ai(e.done,e.undone,null,0,-1));let s=r.getMeta("appendedTransaction");if(r.steps.length==0)return e;if(s&&s.getMeta(So))return s.getMeta(So).redo?new Ai(e.done.addTransform(r,void 0,n,rp(t)),e.undone,Cw(r.mapping.maps[r.steps.length-1]),e.prevTime,e.prevComposition):new Ai(e.done,e.undone.addTransform(r,void 0,n,rp(t)),null,e.prevTime,e.prevComposition);if(r.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=r.getMeta("composition"),l=e.prevTime==0||!s&&e.prevComposition!=a&&(e.prevTime<(r.time||0)-n.newGroupDelay||!dB(r,e.prevRanges)),c=s?qg(e.prevRanges,r.mapping):Cw(r.mapping.maps[r.steps.length-1]);return new Ai(e.done.addTransform(r,l?t.selection.getBookmark():void 0,n,rp(t)),Zn.empty,c,r.time,a??e.prevComposition)}else return(i=r.getMeta("rebased"))?new Ai(e.done.rebased(r,i),e.undone.rebased(r,i),qg(e.prevRanges,r.mapping),e.prevTime,e.prevComposition):new Ai(e.done.addMaps(r.mapping.maps),e.undone.addMaps(r.mapping.maps),qg(e.prevRanges,r.mapping),e.prevTime,e.prevComposition)}function dB(e,t){if(!t)return!1;if(!e.docChanged)return!0;let r=!1;return e.mapping.maps[0].forEach((n,o)=>{for(let i=0;i=t[i]&&(r=!0)}),r}function Cw(e){let t=[];return e.forEach((r,n,o,i)=>t.push(o,i)),t}function qg(e,t){if(!e)return null;let r=[];for(let n=0;n{let r=So.getState(e);return!r||r.done.eventCount==0?!1:(t&&hT(r,e,t,!1),!0)},Qc=(e,t)=>{let r=So.getState(e);return!r||r.undone.eventCount==0?!1:(t&&hT(r,e,t,!0),!0)};function V0(e){let t=So.getState(e);return t?t.done.eventCount:0}function hB(e){let t=So.getState(e);return t?t.undone.eventCount:0}var mB=Object.defineProperty,gB=Object.getOwnPropertyDescriptor,Ca=(e,t,r,n)=>{for(var o=n>1?void 0:n?gB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&mB(t,r,o),o},Ao=class extends Ve{constructor(){super(...arguments),this.wrapMethod=(e,t)=>({state:r,dispatch:n,view:o})=>{const{getState:i,getDispatch:s}=this.options,a=_e(i)?i():r,l=_e(s)&&n?s():n,c=e(a,l,o);return t==null||t(c),c}}get name(){return"history"}createKeymap(){return{"Mod-y":nn.isMac?()=>!1:this.wrapMethod(Qc,this.options.onRedo),"Mod-z":this.wrapMethod(np,this.options.onUndo),"Shift-Mod-z":this.wrapMethod(Qc,this.options.onRedo)}}undoShortcut(e){return this.wrapMethod(np,this.options.onUndo)(e)}redoShortcut(e){return this.wrapMethod(Qc,this.options.onRedo)(e)}createExternalPlugins(){const{depth:e,newGroupDelay:t}=this.options;return[pB({depth:e,newGroupDelay:t})]}undo(){return o2(this.wrapMethod(np,this.options.onUndo))}redo(){return o2(this.wrapMethod(Qc,this.options.onRedo))}undoDepth(e=this.store.getState()){return V0(e)}redoDepth(e=this.store.getState()){return hB(e)}};Ca([je({shortcut:D.Undo,command:"undo"})],Ao.prototype,"undoShortcut",1);Ca([je({shortcut:D.Redo,command:"redo"})],Ao.prototype,"redoShortcut",1);Ca([U({disableChaining:!0,description:({t:e})=>e(wp.UNDO_DESCRIPTION),label:({t:e})=>e(wp.UNDO_LABEL),icon:"arrowGoBackFill"})],Ao.prototype,"undo",1);Ca([U({disableChaining:!0,description:({t:e})=>e(wp.REDO_DESCRIPTION),label:({t:e})=>e(wp.REDO_LABEL),icon:"arrowGoForwardFill"})],Ao.prototype,"redo",1);Ca([He()],Ao.prototype,"undoDepth",1);Ca([He()],Ao.prototype,"redoDepth",1);Ao=Ca([me({defaultOptions:{depth:100,newGroupDelay:500,getDispatch:void 0,getState:void 0},staticKeys:["depth","newGroupDelay"],handlerKeys:["onUndo","onRedo"]})],Ao);var vB=Object.defineProperty,yB=Object.getOwnPropertyDescriptor,sm=(e,t,r,n)=>{for(var o=n>1?void 0:n?yB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&vB(t,r,o),o},bB={icon:"paragraph",label:({t:e})=>e(Sp.INSERT_LABEL),description:({t:e})=>e(Sp.INSERT_DESCRIPTION)},xB={icon:"paragraph",label:({t:e})=>e(Sp.CONVERT_LABEL),description:({t:e})=>e(Sp.CONVERT_DESCRIPTION)},fa=class extends er{get name(){return"paragraph"}createTags(){return[oe.LastNodeCompatible,oe.TextBlock,oe.Block,oe.FormattingNode]}createNodeSpec(e,t){return{content:"inline*",draggable:!1,...t,attrs:{...e.defaults()},parseDOM:[{tag:"p",getAttrs:r=>({...e.parse(r)})},...t.parseDOM??[]],toDOM:r=>["p",e.dom(r),0]}}convertParagraph(e={}){const{attrs:t,selection:r,preserveAttrs:n}=e;return this.store.commands.setBlockNodeType.original(this.type,t,r,n)}insertParagraph(e,t={}){const{selection:r,attrs:n}=t;return this.store.commands.insertNode.original(this.type,{content:e,selection:r,attrs:n})}shortcut(e){return this.convertParagraph()(e)}};sm([U(xB)],fa.prototype,"convertParagraph",1);sm([U(bB)],fa.prototype,"insertParagraph",1);sm([je({shortcut:D.Paragraph,command:"convertParagraph"})],fa.prototype,"shortcut",1);fa=sm([me({defaultPriority:Ae.Medium})],fa);function Jo(e,t,r){return Math.min(Math.max(e,r),t)}class kB extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var Zc=kB;function Vy(e){if(typeof e!="string")throw new Zc(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=_B.test(e)?EB(e):e;const r=CB.exec(t);if(r){const s=Array.from(r).slice(1);return[...s.slice(0,3).map(a=>parseInt(ld(a,2),16)),parseInt(ld(s[3]||"f",2),16)/255]}const n=MB.exec(t);if(n){const s=Array.from(n).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,16)),parseInt(s[3]||"ff",16)/255]}const o=TB.exec(t);if(o){const s=Array.from(o).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,10)),parseFloat(s[3]||"1")]}const i=OB.exec(t);if(i){const[s,a,l,c]=Array.from(i).slice(1).map(parseFloat);if(Jo(0,100,a)!==a)throw new Zc(e);if(Jo(0,100,l)!==l)throw new Zc(e);return[...AB(s,a,l),Number.isNaN(c)?1:c]}throw new Zc(e)}function wB(e){let t=5381,r=e.length;for(;r;)t=t*33^e.charCodeAt(--r);return(t>>>0)%2341}const Tw=e=>parseInt(e.replace(/_/g,""),36),SB="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const r=Tw(t.substring(0,3)),n=Tw(t.substring(3)).toString(16);let o="";for(let i=0;i<6-n.length;i++)o+="0";return e[r]=`${o}${n}`,e},{});function EB(e){const t=e.toLowerCase().trim(),r=SB[wB(t)];if(!r)throw new Zc(e);return`#${r}`}const ld=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),CB=new RegExp(`^#${ld("([a-f0-9])",3)}([a-f0-9])?$`,"i"),MB=new RegExp(`^#${ld("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),TB=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${ld(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),OB=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,_B=/^[a-z]+$/i,Ow=e=>Math.round(e*255),AB=(e,t,r)=>{let n=r/100;if(t===0)return[n,n,n].map(Ow);const o=(e%360+360)%360/60,i=(1-Math.abs(2*n-1))*(t/100),s=i*(1-Math.abs(o%2-1));let a=0,l=0,c=0;o>=0&&o<1?(a=i,l=s):o>=1&&o<2?(a=s,l=i):o>=2&&o<3?(l=i,c=s):o>=3&&o<4?(l=s,c=i):o>=4&&o<5?(a=s,c=i):o>=5&&o<6&&(a=i,c=s);const u=n-i/2,d=a+u,f=l+u,p=c+u;return[d,f,p].map(Ow)};function NB(e){const[t,r,n,o]=Vy(e).map((d,f)=>f===3?d:d/255),i=Math.max(t,r,n),s=Math.min(t,r,n),a=(i+s)/2;if(i===s)return[0,0,a,o];const l=i-s,c=a>.5?l/(2-i-s):l/(i+s);return[60*(t===i?(r-n)/l+(r.179}function kl(e){return LB(e)?"#000":"#fff"}const IB="remirror-editor-wrapper",DB="remirror-button-active",$B="remirror-button",HB="remirror-composite",BB="remirror-dialog",FB="remirror-dialog-backdrop",VB="remirror-form",jB="remirror-form-message",UB="remirror-form-label",WB="remirror-form-group",KB="remirror-group",qB="remirror-input",GB="remirror-menu",YB="remirror-menu-pane",JB="remirror-menu-pane-active",XB="remirror-menu-dropdown-label",QB="remirror-menu-pane-icon",ZB="remirror-menu-pane-label",eF="remirror-menu-pane-shortcut",tF="remirror-menu-button-left",rF="remirror-menu-button-right",nF="remirror-menu-button-nested-left",oF="remirror-menu-button-nested-right",iF="remirror-menu-button",sF="remirror-menu-bar",aF="remirror-flex-column",lF="remirror-flex-row",cF="remirror-menu-item",uF="remirror-menu-item-row",dF="remirror-menu-item-column",fF="remirror-menu-item-checkbox",pF="remirror-menu-item-radio",hF="remirror-menu-group",mF="remirror-floating-popover",gF="remirror-popover",vF="remirror-animated-popover",yF="remirror-role",bF="remirror-separator",xF="remirror-tab",kF="remirror-tab-list",wF="remirror-tabbable",SF="remirror-toolbar",EF="remirror-tooltip",CF="remirror-table-size-editor",MF="remirror-table-size-editor-body",TF="remirror-table-size-editor-cell",OF="remirror-table-size-editor-cell-selected",_F="remirror-table-size-editor-footer",AF="remirror-color-picker",NF="remirror-color-picker-cell",RF="remirror-color-picker-cell-selected";var PF=Object.freeze({__proto__:null,ANIMATED_POPOVER:vF,BUTTON:$B,BUTTON_ACTIVE:DB,COLOR_PICKER:AF,COLOR_PICKER_CELL:NF,COLOR_PICKER_CELL_SELECTED:RF,COMPOSITE:HB,DIALOG:BB,DIALOG_BACKDROP:FB,EDITOR_WRAPPER:IB,FLEX_COLUMN:aF,FLEX_ROW:lF,FLOATING_POPOVER:mF,FORM:VB,FORM_GROUP:WB,FORM_LABEL:UB,FORM_MESSAGE:jB,GROUP:KB,INPUT:qB,MENU:GB,MENU_BAR:sF,MENU_BUTTON:iF,MENU_BUTTON_LEFT:tF,MENU_BUTTON_NESTED_LEFT:nF,MENU_BUTTON_NESTED_RIGHT:oF,MENU_BUTTON_RIGHT:rF,MENU_DROPDOWN_LABEL:XB,MENU_GROUP:hF,MENU_ITEM:cF,MENU_ITEM_CHECKBOX:fF,MENU_ITEM_COLUMN:dF,MENU_ITEM_RADIO:pF,MENU_ITEM_ROW:uF,MENU_PANE:YB,MENU_PANE_ACTIVE:JB,MENU_PANE_ICON:QB,MENU_PANE_LABEL:ZB,MENU_PANE_SHORTCUT:eF,POPOVER:gF,ROLE:yF,SEPARATOR:bF,TAB:xF,TABBABLE:wF,TABLE_SIZE_EDITOR:CF,TABLE_SIZE_EDITOR_BODY:MF,TABLE_SIZE_EDITOR_CELL:TF,TABLE_SIZE_EDITOR_CELL_SELECTED:OF,TABLE_SIZE_EDITOR_FOOTER:_F,TAB_LIST:kF,TOOLBAR:SF,TOOLTIP:EF});const zF="remirror-wrap",LF="remirror-language-select-positioner",IF="remirror-language-select-width",DF="remirror-a11y-dark",$F="remirror-atom-dark",HF="remirror-base16-ateliersulphurpool-light",BF="remirror-cb",FF="remirror-darcula",VF="remirror-dracula",jF="remirror-duotone-dark",UF="remirror-duotone-earth",WF="remirror-duotone-forest",KF="remirror-duotone-light",qF="remirror-duotone-sea",GF="remirror-duotone-space",YF="remirror-gh-colors",JF="remirror-hopscotch",XF="remirror-pojoaque",QF="remirror-vs",ZF="remirror-xonokai";var eV=Object.freeze({__proto__:null,A11Y_DARK:DF,ATOM_DARK:$F,BASE16_ATELIERSULPHURPOOL_LIGHT:HF,CB:BF,DARCULA:FF,DRACULA:VF,DUOTONE_DARK:jF,DUOTONE_EARTH:UF,DUOTONE_FOREST:WF,DUOTONE_LIGHT:KF,DUOTONE_SEA:qF,DUOTONE_SPACE:GF,GH_COLORS:YF,HOPSCOTCH:JF,LANGUAGE_SELECT_POSITIONER:LF,LANGUAGE_SELECT_WIDTH:IF,POJOAQUE:XF,VS:QF,WRAP:zF,XONOKAI:ZF});const tV="remirror-image-loader";var rV=Object.freeze({__proto__:null,IMAGE_LOADER:tV});const nV="remirror-list-item-with-custom-mark",oV="remirror-ul-list-content",iV="remirror-editor",sV="remirror-list-item-marker-container",aV="remirror-list-item-checkbox",lV="remirror-collapsible-list-item-closed",cV="remirror-collapsible-list-item-button",uV="remirror-list-spine";var ls=Object.freeze({__proto__:null,COLLAPSIBLE_LIST_ITEM_BUTTON:cV,COLLAPSIBLE_LIST_ITEM_CLOSED:lV,EDITOR:iV,LIST_ITEM_CHECKBOX:aV,LIST_ITEM_MARKER_CONTAINER:sV,LIST_ITEM_WITH_CUSTOM_MARKER:nV,LIST_SPINE:uV,UL_LIST_CONTENT:oV});const dV="remirror-is-empty";var fV=Object.freeze({__proto__:null,IS_EMPTY:dV});const pV="remirror-editor",hV="remirror-positioner",mV="remirror-positioner-widget";var gV=Object.freeze({__proto__:null,EDITOR:pV,POSITIONER:hV,POSITIONER_WIDGET:mV});const vV="remirror-theme";function yV(e={}){const t=[],r={};function n(o,i){if(typeof i=="string"||typeof i=="number"){t.push(`${_w(o)}: ${i};`),r[_w(o)]=i;return}if(!(typeof i!="object"||!i))for(const[s,a]of Object.entries(i))n([...o,s],a)}for(const[o,i]of Object.entries(e))n([o],i);return{css:t.join(` -`),styles:r}}function bV(e){return e.replace(/([a-z])([\dA-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function _w(e){return`--rmr-${e.map(bV).join("-")}`}const Kn={gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},Xo="#000000",jy="#ffffff",xV="#252103",Uy=ah(Xo,.75),am="#7963d2",Wy="#bcd263",kV="#fff",wV="#fff",Ky=Kn.gray[1],Aw="rgba(10,31,68,0.08)",Nw="rgba(10,31,68,0.10)",Rw="rgba(10,31,68,0.12)",SV=op(ah(Xo,.1),.13),qy={background:jy,border:Uy,foreground:Xo,muted:Ky,primary:am,secondary:Wy,primaryText:kV,secondaryText:wV,text:xV,faded:SV},EV={...qy,background:tn(jy,.15),border:tn(Uy,.15),foreground:tn(Xo,.15),muted:tn(Ky,.15),primary:tn(am,.15),secondary:tn(Wy,.15),get text(){return kl(this.background)},get primaryText(){return kl(this.primary)},get secondaryText(){return kl(this.secondary)}},CV={...qy,background:tn(jy,.075),border:tn(Uy,.075),foreground:tn(Xo,.075),muted:tn(Ky,.075),primary:tn(am,.075),secondary:tn(Wy,.075),get text(){return kl(this.background)},get primaryText(){return kl(this.primary)},get secondaryText(){return kl(this.secondary)}},Ss={color:{...qy,active:EV,hover:CV,shadow1:Aw,shadow2:Nw,shadow3:Rw,backdrop:ah(Xo,.1),outline:ah(am,.6),table:{default:{border:op(Xo,.8),cell:op(Xo,.4),controller:Kn.gray[3]},selected:{border:Kn.blue[7],cell:Kn.blue[1],controller:Kn.blue[5]},preselect:{border:Kn.blue[7],cell:op(Xo,.4),controller:Kn.blue[5]},predelete:{border:Kn.red[7],cell:Kn.red[1],controller:Kn.red[5]},mark:"#91919196"}},hue:Kn,radius:{border:"0.25rem",extra:"0.5rem",circle:"50%"},fontFamily:{default:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif',heading:"inherit",mono:"Menlo, monospace"},fontSize:{0:"12px",1:"14px",2:"16px",3:"20px",4:"24px",5:"32px",6:"48px",7:"64px",8:"96px",default:"16px"},space:{1:"4px",2:"8px",3:"16px",4:"32px",5:"64px",6:"128px",7:"256px",8:"512px"},fontWeight:{bold:"700",default:"400",heading:"700"},letterSpacing:{tight:"-1px",default:"normal",loose:"1px",wide:"3px"},lineHeight:{heading:"1.25em",default:"1.5em"},boxShadow:{1:`0 1px 1px ${Aw}`,2:`0 1px 1px ${Nw}`,3:`0 1px 1px ${Rw}`}};var MV=Object.defineProperty,TV=Object.getOwnPropertyDescriptor,Gy=(e,t,r,n)=>{for(var o=n>1?void 0:n?TV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&MV(t,r,o),o},mT=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},Tt=(e,t,r)=>(mT(e,t,"read from private field"),r?r.call(e):t.get(e)),Do=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},yi=(e,t,r,n)=>(mT(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),eu,tu,qa,ru,ip,nu,ou,iu,su,sp=class{constructor(e){Do(this,eu,Bh()),Do(this,tu,[]),Do(this,qa,new Map),Do(this,ru,[]),Do(this,ip,!1),Do(this,nu,void 0),Do(this,ou,void 0),Do(this,iu,void 0),Do(this,su,void 0),this.addListener=(t,r)=>Tt(this,eu).on(t,r),yi(this,nu,e),yi(this,ou,e.getActive),yi(this,su,e.getPosition),yi(this,iu,e.getID),this.hasChanged=e.hasChanged,this.events=e.events??["state","scroll"]}static create(e){return new sp(e)}static fromPositioner(e,t){return sp.create({...e.basePositioner,...t})}get basePositioner(){return{getActive:Tt(this,ou),getPosition:Tt(this,su),hasChanged:this.hasChanged,events:this.events,getID:Tt(this,iu)}}onActiveChanged(e){this.recentUpdate=e;const t=Tt(this,ou).call(this,e);yi(this,tu,t),yi(this,qa,new Map),yi(this,ip,!1),yi(this,ru,[]);const r=[];for(const[n,o]of t.entries()){const i=this.getID(o,n);Tt(this,ru).push(i),r.push({setElement:s=>this.addProps({...e,data:o,element:s},n),id:i,data:o})}Tt(this,eu).emit("update",r)}getID(e,t){var r;return((r=Tt(this,iu))==null?void 0:r.call(this,e,t))??t.toString()}addProps(e,t){if(Tt(this,ip)||(Tt(this,qa).set(t,e),Tt(this,qa).sizee;return this.clone(r=>({getActive:n=>r.getActive(n).filter(t)}))}},no=sp;eu=new WeakMap;tu=new WeakMap;qa=new WeakMap;ru=new WeakMap;ip=new WeakMap;nu=new WeakMap;ou=new WeakMap;iu=new WeakMap;su=new WeakMap;no.EMPTY=[];function OV(e,t=bT){const{key:r}=(e==null?void 0:e.getMeta(yT))??{};return r===t}function gT(e){const{tr:t,state:r,previousState:n}=e;return!n||t&&OV(t)?!0:t?Q6(t):!r.doc.eq(n.doc)||!r.selection.eq(n.selection)}function vT(e,t,r={}){const n=t.getBoundingClientRect(),{accountForPadding:o=!1}=r;let i=0,s=0,a=0,l=0;if(Je(t)&&o){const u=Number.parseFloat(xn(t,"padding-left").replace("px","")),d=Number.parseFloat(xn(t,"padding-right").replace("px","")),f=Number.parseFloat(xn(t,"padding-top").replace("px","")),p=Number.parseFloat(xn(t,"padding-bottom").replace("px","")),h=Number.parseFloat(xn(t,"border-left").replace("px","")),m=Number.parseFloat(xn(t,"border-right").replace("px","")),b=Number.parseFloat(xn(t,"border-top").replace("px","")),v=Number.parseFloat(xn(t,"border-bottom").replace("px","")),g=t.offsetWidth-t.clientWidth,y=t.offsetHeight-t.clientHeight;i+=u+h+(t.dir==="rtl"?g:0),s+=d+m+(t.dir==="rtl"?0:g),a+=f+b,l+=p+v+y}const c=new DOMRect(n.left+i,n.top+a,n.width-s,n.height-l);for(const[u,d]of[[e.top,e.left],[e.top,e.right],[e.bottom,e.left],[e.bottom,e.right]])if(Jx(u,c.top,c.bottom)&&Jx(d,c.left,c.right))return!0;return!1}var _V="remirror-positioner-widget",yT="positionerUpdate",bT="__all_positioners__",xT={y:-999999,x:-999999,width:0,height:0},Pw={...xT,left:-999999,top:-999999,bottom:-999999,right:-999999},Yy={...xT,rect:{...Pw,toJSON:()=>Pw},visible:!1},kT=no.create({hasChanged:gT,getActive(e){const{state:t}=e;if(!Bv(t)||t.selection.$anchor.depth>2)return no.EMPTY;const r=zd({predicate:n=>n.type.isBlock,selection:t});return r?[r]:no.EMPTY},getPosition(e){const{view:t,data:r}=e,n=t.nodeDOM(r.pos);if(!Je(n))return Yy;const o=n.getBoundingClientRect(),i=t.dom.getBoundingClientRect(),s=o.height,a=o.width,l=t.dom.scrollLeft+o.left-i.left,c=t.dom.scrollTop+o.top-i.top,u=vT(o,t.dom);return{y:c,x:l,height:s,width:a,rect:o,visible:u}}}),Jy=kT.clone(({getActive:e})=>({getActive:t=>{const[r]=e(t);return r&&Dh(r.node)&&r.node.type===Ih(t.state.schema)?[r]:no.EMPTY}})),AV=Jy.clone(({getPosition:e})=>({getPosition:t=>({...e(t),width:1})})),NV=Jy.clone(({getPosition:e})=>({getPosition:t=>{const{width:r,x:n,y:o,height:i}=e(t);return{...e(t),width:1,x:r+n,rect:new DOMRect(r+n,o,1,i)}}}));function Xy(e){return no.create({hasChanged:gT,getActive:t=>{const{state:r,view:n}=t;if(!e(r)||!gs(r.selection))return no.EMPTY;try{const{head:o,anchor:i}=r.selection;return[{from:n.coordsAtPos(i),to:n.coordsAtPos(o)}]}catch{return no.EMPTY}},getPosition(t){const{element:r,data:n,view:o}=t,{from:i,to:s}=n,a=r.offsetParent??o.dom,l=a.getBoundingClientRect(),c=Math.abs(s.bottom-i.top),u=c>i.bottom-i.top,d=Math.min(i.left,s.left),f=Math.min(i.top,s.top),p=a.scrollLeft+(u?s.left-l.left:d-l.left),h=a.scrollTop+f-l.top,m=u?1:Math.abs(i.left-s.right),b=new DOMRect(u?s.left:d,f,m,c),v=vT(b,o.dom);return{rect:b,y:h,x:p,height:c,width:m,visible:v}}})}var wT=Xy(e=>!e.selection.empty),RV=Xy(e=>e.selection.empty),PV=Xy(()=>!0),zV=wT.clone(()=>({getActive:e=>{const{state:t,view:r}=e;if(!t.selection.empty)return no.EMPTY;const n=C5(t);if(!n)return no.EMPTY;try{return[{from:r.coordsAtPos(n.from),to:r.coordsAtPos(n.to)}]}catch{return no.EMPTY}}})),LV={selection:wT,cursor:RV,always:PV,block:kT,emptyBlock:Jy,emptyBlockStart:AV,emptyBlockEnd:NV,nearestWord:zV},Ul=class extends Ve{constructor(){super(...arguments),this.positioners=[],this.onAddCustomHandler=({positioner:e})=>{if(e)return this.positioners=[...this.positioners,e],this.store.commands.forceUpdate(),()=>{this.positioners=this.positioners.filter(t=>t!==e)}}}get name(){return"positioner"}createAttributes(){return{class:gV.EDITOR}}init(){this.onScroll=H4(this.options.scrollDebounce,this.onScroll.bind(this))}createEventHandlers(){return{scroll:()=>(this.onScroll(),!1),hover:(e,t)=>(this.positioner(this.getBaseProps("hover",{hover:t})),!1),contextmenu:(e,t)=>(this.positioner(this.getBaseProps("contextmenu",{contextmenu:t})),!1)}}onStateUpdate(e){this.positioner({...e,previousState:e.firstUpdate?void 0:e.previousState,event:"state",helpers:this.store.helpers})}createDecorations(e){if(this.element??(this.element=this.createElement()),!this.element.hasChildNodes())return Ee.empty;const t=Ge.widget(0,this.element,{key:"positioner-widget",side:-1,stopEvent:()=>!0});return Ee.create(e.doc,[t])}forceUpdatePositioners(e=bT){return({tr:t,dispatch:r})=>(r==null||r(t.setMeta(yT,{key:e})),!0)}getPositionerWidget(){return this.element??(this.element=this.createElement())}createElement(){const e=document.createElement("span");return e.dataset.id=_V,e.setAttribute("role","presentation"),e}triggerPositioner(e,t){e.hasChanged(t)&&e.onActiveChanged({...t,view:this.store.view})}positioner(e){for(const t of this.positioners)t.events.includes(e.event)&&this.triggerPositioner(t,e)}getBaseProps(e,t){const r=this.store.getState(),n=this.store.previousState;return{helpers:this.store.helpers,event:e,firstUpdate:!1,previousState:n,state:r,...t}}onScroll(){this.positioner(this.getBaseProps("scroll",{scroll:{scrollTop:this.store.view.dom.scrollTop}}))}};Gy([U()],Ul.prototype,"forceUpdatePositioners",1);Gy([He()],Ul.prototype,"getPositionerWidget",1);Ul=Gy([me({defaultOptions:{scrollDebounce:100},customHandlerKeys:["positioner"],staticKeys:["scrollDebounce"]})],Ul);function j0(e){return ne(e)?LV[e].clone():_e(e)?e().clone():e.clone()}var IV=Object.defineProperty,DV=Object.getOwnPropertyDescriptor,$V=(e,t,r,n)=>{for(var o=n>1?void 0:n?DV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&IV(t,r,o),o},U0=class extends er{get name(){return"text"}createTags(){return[oe.InlineNode]}createNodeSpec(){return{}}};U0=$V([me({disableExtraAttributes:!0,defaultPriority:Ae.Medium})],U0);var HV={...jl.defaultOptions,...fa.defaultOptions,...Ao.defaultOptions,excludeExtensions:[]};function BV(e={}){e={...HV,...e};const{content:t,depth:r,getDispatch:n,getState:o,newGroupDelay:i,excludeExtensions:s}=e,a={};for(const c of s??[])a[c]=!0;const l=[];if(!a.history){const c=new Ao({depth:r,getDispatch:n,getState:o,newGroupDelay:i});l.push(c)}return a.doc||l.push(new jl({content:t})),a.text||l.push(new U0),a.paragraph||l.push(new fa),a.positioner||l.push(new Ul),a.gapCursor||l.push(new F0),a.events||l.push(new ih),l}var FV=Object.defineProperty,VV=Object.getOwnPropertyDescriptor,jV=(e,t,r,n)=>{for(var o=n>1?void 0:n?VV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&FV(t,r,o),o},pa=class extends Ve{get name(){return"placeholder"}createAttributes(){return{"aria-placeholder":this.options.placeholder}}createPlugin(){return{state:{init:(e,t)=>({...this.options,empty:jv(t.doc,{ignoreAttributes:!0})}),apply:(e,t,r,n)=>UV({pluginState:t,tr:e,extension:this,state:n})},props:{decorations:e=>WV({state:e,extension:this})}}}onSetOptions(e){const{changes:t}=e;t.placeholder.changed&&this.store.phase>=Nr.EditorView&&this.store.updateAttributes()}};pa=jV([me({defaultOptions:{emptyNodeClass:fV.IS_EMPTY,placeholder:""}})],pa);function UV(e){const{pluginState:t,extension:r,tr:n,state:o}=e;return n.docChanged?{...r.options,empty:jv(o.doc)}:t}function WV(e){const{extension:t,state:r}=e,{empty:n}=t.pluginKey.getState(r),{emptyNodeClass:o,placeholder:i}=t.options;if(!n)return null;const s=[];return r.doc.descendants((a,l)=>{const c=Ge.node(l,l+a.nodeSize,{class:o,"data-placeholder":i});s.push(c)}),Ee.create(r.doc,s)}var KV=Object.defineProperty,qV=Object.getOwnPropertyDescriptor,GV=(e,t,r,n)=>{for(var o=n>1?void 0:n?qV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&KV(t,r,o),o},YV={...pa.defaultOptions,...sd.defaultOptions},JV=[...pa.staticKeys,...sd.staticKeys],cd=class extends Ve{get name(){return"react"}onSetOptions(e){const{pickChanged:t}=e;this.getExtension(pa).setOptions(t(["placeholder"]))}createExtensions(){const{emptyNodeClass:e,placeholder:t,defaultBlockNode:r,defaultContentNode:n,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s}=this.options;return[new pa({emptyNodeClass:e,placeholder:t,priority:Ae.Low}),new sd({defaultBlockNode:r,defaultContentNode:n,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s})]}};cd=GV([me({defaultOptions:YV,staticKeys:JV})],cd);var ST={};Object.defineProperty(ST,"__esModule",{value:!0});function XV(){for(var e=[],t=0;t{if(!t.has(e))throw TypeError("Cannot "+r)},Yg=(e,t,r)=>(ET(e,t,"read from private field"),r?r.call(e):t.get(e)),QV=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},ZV=(e,t,r,n)=>(ET(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);function ej(){const[,e]=S.useState(ee());return S.useCallback(()=>{e(ee())},[])}var CT=S.createContext(null);function di(e){const t=S.useContext(CT),r=S.useRef(ej());te(t,{code:H.REACT_PROVIDER_CONTEXT});const{addHandler:n}=t;return S.useEffect(()=>{let o=e;if(o){if(hs(o)){const{autoUpdate:i}=o;o=i?()=>r.current():void 0}if(_e(o))return n("updated",o)}},[n,e]),t}function In(e=!0){return di({autoUpdate:e}).active}function tj(e=!1){return di(e?{autoUpdate:!0}:void 0).attrs}function lc(){return di().chain.new()}function Tr(){return di().commands}function Qy(){return di({autoUpdate:!0}).getState().selection}function Zy(e,t=void 0,r){const{getExtension:n}=di(),o=S.useMemo(()=>n(e),[e,n]);let i;if(_e(t)?i=r?[o,...r]:[o,t]:i=t?[o,...Object.values(t)]:[],S.useEffect(()=>{_e(t)||!t||o.setOptions(t)},i),S.useEffect(()=>{if(_e(t))return t({addHandler:o.addHandler.bind(o),addCustomHandler:o.addCustomHandler.bind(o),extension:o})},i),!t)return o}function rj(e,t,r){const n=S.useCallback(({addHandler:o})=>o(t,r),[r,t]);return Zy(e,n)}function lm(e=!1){return di(e?{autoUpdate:!0}:void 0).helpers}var[nj,oj]=O9(({props:e})=>{const t=e.locale??"en",r=e.i18n??im,n=e.supportedLocales??[t],o=r._.bind(r);return{locale:t,i18n:r,supportedLocales:n,t:o}});function Dw(e,t={}){const{core:r,react:n,...o}=t;return cI(e)?e:lI.create(()=>[...J4(e),new cd(n),...BV(r)],o)}function ij(e,t={}){const r=S.useRef(e),n=S.useRef(t),[o,i]=S.useState(()=>Dw(e,t));return r.current=e,n.current=t,S.useEffect(()=>o.addHandler("destroy",()=>{i(()=>Dw(r.current,n.current))}),[o]),o}var sj=typeof br=="object"&&br.__esModule&&br.default?br.default:br,Ga,aj=class extends nI{constructor(e){if(super(e),QV(this,Ga,void 0),this.rootPropsConfig={called:!1,count:0},this.getRootProps=t=>this.internalGetRootProps(t,null),this.internalGetRootProps=(t,r)=>{this.rootPropsConfig.called=!0;const{refKey:n="ref",ref:o,...i}=t??ee();return{[n]:sj(o,this.onRef),key:this.uid,...i,children:r}},this.onRef=t=>{t&&(this.rootPropsConfig.count+=1,te(this.rootPropsConfig.count<=1,{code:H.REACT_GET_ROOT_PROPS,message:`Called ${this.rootPropsConfig.count} times`}),ZV(this,Ga,t),this.onRefLoad())},this.manager.view){this.manager.view.setProps({state:this.manager.view.state,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0});return}this.manager.getExtension(pa).setOptions({placeholder:this.props.placeholder??""})}get name(){return"react"}update(e){return super.update(e),this}createView(e){return new f6(null,{state:e,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0,plugins:[]})}updateState({state:e,...t}){const{triggerChange:r=!0,tr:n,transactions:o}=t;if(this.props.state){const{onChange:i}=this.props;te(i,{code:H.REACT_CONTROLLED,message:"You are required to provide the `onChange` handler when creating a controlled editor."}),te(r,{code:H.REACT_CONTROLLED,message:"Controlled editors do not support `clearContent` or `setContent` where `triggerChange` is `true`. Update the `state` prop instead."}),this.previousStateOverride||(this.previousStateOverride=this.getState()),this.onChange({state:e,tr:n,transactions:o});return}!n&&!o&&(e=e.apply(e.tr.setMeta(Wx,{}))),this.view.updateState(e),r&&(o==null?void 0:o.length)!==0&&this.onChange({state:e,tr:n,transactions:o}),this.manager.onStateUpdate({previousState:this.previousState,state:e,tr:n,transactions:o})}updateControlledState(e,t){this.previousStateOverride=t,e=e.apply(e.tr.setMeta(Wx,{})),this.view.updateState(e),this.manager.onStateUpdate({previousState:this.previousState,state:e}),this.previousStateOverride=void 0}addProsemirrorViewToDom(e,t){this.props.insertPosition==="start"?e.insertBefore(t,e.firstChild):e.append(t)}onRefLoad(){te(Yg(this,Ga),{code:H.REACT_EDITOR_VIEW,message:"Something went wrong when initializing the text editor. Please check your setup."});const{autoFocus:e}=this.props;this.addProsemirrorViewToDom(Yg(this,Ga),this.view.dom),e&&this.focus(e),this.onChange(),this.addFocusListeners()}onUpdate(){this.view&&Yg(this,Ga)&&this.view.setProps({...this.view.props,editable:()=>this.props.editable??!0})}get frameworkOutput(){return{...this.baseOutput,getRootProps:this.getRootProps,portalContainer:this.manager.store.portalContainer}}resetRender(){this.rootPropsConfig.called=!1,this.rootPropsConfig.count=0}};Ga=new WeakMap;var MT=typeof document<"u"?S.useLayoutEffect:S.useEffect;function lj(e){const t=S.useRef();return MT(()=>{t.current=e}),t.current}function cj(e){const{manager:t,state:r}=e,{placeholder:n,editable:o}=e;S.useRef(!0).current&&!Zi(n)&&t.getExtension(cd).setOptions({placeholder:n}),S.useEffect(()=>{n!=null&&t.getExtension(cd).setOptions({placeholder:n})},[n,t]);const[s]=S.useState(()=>{if(r)return r;const l=t.createEmptyDoc(),[c,u]=ct(e.initialContent)?e.initialContent:[e.initialContent??l];return t.createState({content:c,selection:u})}),a=uj({initialEditorState:s,getProps:()=>e});return S.useEffect(()=>()=>{a.destroy()},[a]),S.useEffect(()=>{a.onUpdate()},[o,a]),dj(a),a.frameworkOutput}function uj(e){const t=S.useRef(e);t.current=e;const r=S.useMemo(()=>new aj(t.current),[]);return r.update(e),r}function dj(e){const{state:t}=e.props,r=S.useRef(!!t),n=lj(t);MT(()=>{const o=t?r.current===!0:r.current===!1;te(o,{code:H.REACT_CONTROLLED,message:r.current?"You have attempted to switch from a controlled to an uncontrolled editor. Once you set up an editor as a controlled editor it must always provide a `state` prop.":"You have provided a `state` prop to an uncontrolled editor. In order to set up your editor as controlled you must provide the `state` prop from the very first render."}),!(!t||t===n)&&e.updateControlledState(t,n??void 0)},[t,n,e])}function fj(e={}){const{content:t,document:r,selection:n,extensions:o,...i}=e,s=ij(o??(()=>[]),i),[a,l]=S.useState(()=>s.createState({selection:n,content:t??s.createEmptyDoc()})),c=S.useCallback(({state:d})=>{l(d)},[]),u=S.useCallback(()=>s.output,[s]);return S.useMemo(()=>({state:a,setState:l,manager:s,onChange:c,getContext:u}),[u,s,c,a])}var $w={doc:!1,selection:!1,storedMark:!1};function pj(){const[e,t]=S.useState($w);return rj(Rp,"applyState",S.useCallback(({tr:r})=>{const n={...$w};r.docChanged&&(n.doc=!0),r.selectionSet&&(n.selection=!0),r.storedMarksSet&&(n.storedMark=!0),t(n)},[])),e}var W0=()=>L.createElement("div",{className:PF.EDITOR_WRAPPER,...di().getRootProps()}),hj=e=>(e.hook(),null);function mj(e){const{children:t,autoRender:r,i18n:n,locale:o,supportedLocales:i,hooks:s=[],...a}=e,l=cj(a),c=w9(l.portalContainer),u=r==="start"||r===!0||!t&&Zi(r),d=r==="end";return L.createElement(nj,{i18n:n,locale:o,supportedLocales:i},L.createElement(CT.Provider,{value:l},L.createElement(k9,{portals:c}),s.map((f,p)=>L.createElement(hj,{hook:f,key:p})),u&&L.createElement(W0,null),t,d&&L.createElement(W0,null)))}const gj={black:"#000",white:"#fff"},ud=gj,vj={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},za=vj,yj={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},La=yj,bj={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Ia=bj,xj={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},Da=xj,kj={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},$a=kj,wj={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},Mc=wj,Sj={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Ej=Sj;function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t{t[r]=TT(e[r])}),t}function cn(e,t,r={clone:!0}){const n=r.clone?_({},e):e;return Wo(e)&&Wo(t)&&Object.keys(t).forEach(o=>{o!=="__proto__"&&(Wo(t[o])&&o in e&&Wo(e[o])?n[o]=cn(e[o],t[o],r):r.clone?n[o]=Wo(t[o])?TT(t[o]):t[o]:n[o]=t[o])}),n}function Wl(e){let t="https://mui.com/production-error/?code="+e;for(let r=1;r<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=s.createElement(r,{is:n.is}):(e=s.createElement(r),r==="select"&&(s=e,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):e=s.createElementNS(e,r),e[bo]=t,e[ed]=n,FM(e,t,!1,!1),t.stateNode=e;e:{switch(s=a0(r,n),r){case"dialog":et("cancel",e),et("close",e),o=n;break;case"iframe":case"object":case"embed":et("load",e),o=n;break;case"video":case"audio":for(o=0;oVl&&(t.flags|=128,n=!0,Cc(i,!1),t.lanes=4194304)}else{if(!n)if(e=Xp(s),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Cc(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!ot)return ir(t),null}else 2*vt()-i.renderingStartTime>Vl&&r!==1073741824&&(t.flags|=128,n=!0,Cc(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(r=i.last,r!==null?r.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=vt(),t.sibling=null,r=at.current,Ye(at,n?r&1|2:r&1),t):(ir(t),null);case 22:case 23:return Ly(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?tn&1073741824&&(ir(t),t.subtreeFlags&6&&(t.flags|=8192)):ir(t),null;case 24:return null;case 25:return null}throw Error($(156,t.tag))}function o9(e,t){switch(my(t),t.tag){case 1:return $r(t.type)&&Up(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bl(),tt(Dr),tt(pr),Ey(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Sy(t),null;case 13:if(tt(at),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error($(340));$l()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return tt(at),null;case 4:return Bl(),null;case 10:return by(t.type._context),null;case 22:case 23:return Ly(),null;case 24:return null;default:return null}}var bf=!1,ur=!1,i9=typeof WeakSet=="function"?WeakSet:Set,X=null;function ll(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){mt(e,t,n)}else r.current=null}function z0(e,t,r){try{r()}catch(n){mt(e,t,n)}}var fw=!1;function s9(e,t){if(v0=Bp,e=q5(),py(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var o=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var p;d!==r||o!==0&&d.nodeType!==3||(a=s+o),d!==i||n!==0&&d.nodeType!==3||(l=s+n),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===r&&++c===o&&(a=s),f===i&&++u===n&&(l=s),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(y0={focusedElem:e,selectionRange:r},Bp=!1,X=t;X!==null;)if(t=X,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,X=e;else for(;X!==null;){t=X;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var m=h.memoizedProps,b=h.memoizedState,v=t.stateNode,g=v.getSnapshotBeforeUpdate(t.elementType===t.type?m:Gn(t.type,m),b);v.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error($(163))}}catch(x){mt(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,X=e;break}X=t.return}return h=fw,fw=!1,h}function Mu(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&z0(t,r,i)}o=o.next}while(o!==n)}}function em(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function L0(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function UM(e){var t=e.alternate;t!==null&&(e.alternate=null,UM(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[bo],delete t[ed],delete t[k0],delete t[V8],delete t[j8])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function WM(e){return e.tag===5||e.tag===3||e.tag===4}function pw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||WM(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function I0(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=jp));else if(n!==4&&(e=e.child,e!==null))for(I0(e,t,r),e=e.sibling;e!==null;)I0(e,t,r),e=e.sibling}function D0(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(D0(e,t,r),e=e.sibling;e!==null;)D0(e,t,r),e=e.sibling}var qt=null,Yn=!1;function vi(e,t,r){for(r=r.child;r!==null;)KM(e,t,r),r=r.sibling}function KM(e,t,r){if(ko&&typeof ko.onCommitFiberUnmount=="function")try{ko.onCommitFiberUnmount(Kh,r)}catch{}switch(r.tag){case 5:ur||ll(r,t);case 6:var n=qt,o=Yn;qt=null,vi(e,t,r),qt=n,Yn=o,qt!==null&&(Yn?(e=qt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):qt.removeChild(r.stateNode));break;case 18:qt!==null&&(Yn?(e=qt,r=r.stateNode,e.nodeType===8?Bg(e.parentNode,r):e.nodeType===1&&Bg(e,r),Yu(e)):Bg(qt,r.stateNode));break;case 4:n=qt,o=Yn,qt=r.stateNode.containerInfo,Yn=!0,vi(e,t,r),qt=n,Yn=o;break;case 0:case 11:case 14:case 15:if(!ur&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){o=n=n.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&z0(r,t,s),o=o.next}while(o!==n)}vi(e,t,r);break;case 1:if(!ur&&(ll(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){mt(r,t,a)}vi(e,t,r);break;case 21:vi(e,t,r);break;case 22:r.mode&1?(ur=(n=ur)||r.memoizedState!==null,vi(e,t,r),ur=n):vi(e,t,r);break;default:vi(e,t,r)}}function hw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new i9),t.forEach(function(n){var o=m9.bind(null,e,n);r.has(n)||(r.add(n),n.then(o,o))})}}function Un(e,t){var r=t.deletions;if(r!==null)for(var n=0;no&&(o=s),n&=~i}if(n=o,n=vt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*l9(n/1960))-n,10e?16:e,$i===null)var n=!1;else{if(e=$i,$i=null,rh=0,Oe&6)throw Error($(331));var o=Oe;for(Oe|=4,X=e.current;X!==null;){var i=X,s=i.child;if(X.flags&16){var a=i.deletions;if(a!==null){for(var l=0;lvt()-Py?Zs(e,0):Ry|=r),Hr(e,t)}function eT(e,t){t===0&&(e.mode&1?(t=uf,uf<<=1,!(uf&130023424)&&(uf=4194304)):t=1);var r=wr();e=oi(e,t),e!==null&&(Fd(e,t,r),Hr(e,r))}function h9(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),eT(e,r)}function m9(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:n=e.stateNode;break;default:throw Error($(314))}n!==null&&n.delete(t),eT(e,r)}var tT;tT=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Dr.current)zr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return zr=!1,r9(e,t,r);zr=!!(e.flags&131072)}else zr=!1,ot&&t.flags&1048576&&oM(t,qp,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Qf(e,t),e=t.pendingProps;var o=Dl(t,pr.current);bl(t,r),o=My(null,t,n,e,o,r);var i=Ty();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,$r(n)?(i=!0,Wp(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,ky(t),o.updater=Qh,t.stateNode=o,o._reactInternals=t,T0(t,n,e,r),t=A0(null,t,n,!0,i,r)):(t.tag=0,ot&&i&&hy(t),yr(null,t,o,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Qf(e,t),e=t.pendingProps,o=n._init,n=o(n._payload),t.type=n,o=t.tag=v9(n),e=Gn(n,e),o){case 0:t=_0(null,t,n,e,r);break e;case 1:t=cw(null,t,n,e,r);break e;case 11:t=aw(null,t,n,e,r);break e;case 14:t=lw(null,t,n,Gn(n.type,e),r);break e}throw Error($(306,n,""))}return t;case 0:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Gn(n,o),_0(e,t,n,o,r);case 1:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Gn(n,o),cw(e,t,n,o,r);case 3:e:{if($M(t),e===null)throw Error($(387));n=t.pendingProps,i=t.memoizedState,o=i.element,lM(e,t),Jp(t,n,null,r);var s=t.memoizedState;if(n=s.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Fl(Error($(423)),t),t=uw(e,t,n,r,o);break e}else if(n!==o){o=Fl(Error($(424)),t),t=uw(e,t,n,r,o);break e}else for(ln=qi(t.stateNode.containerInfo.firstChild),cn=t,ot=!0,Xn=null,r=fM(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if($l(),n===o){t=ii(e,t,r);break e}yr(e,t,n,r)}t=t.child}return t;case 5:return pM(t),e===null&&E0(t),n=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,b0(n,o)?s=null:i!==null&&b0(n,i)&&(t.flags|=32),DM(e,t),yr(e,t,s,r),t.child;case 6:return e===null&&E0(t),null;case 13:return HM(e,t,r);case 4:return wy(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Hl(t,null,n,r):yr(e,t,n,r),t.child;case 11:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Gn(n,o),aw(e,t,n,o,r);case 7:return yr(e,t,t.pendingProps,r),t.child;case 8:return yr(e,t,t.pendingProps.children,r),t.child;case 12:return yr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,Ye(Gp,n._currentValue),n._currentValue=s,i!==null)if(so(i.value,s)){if(i.children===o.children&&!Dr.current){t=ii(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=ei(-1,r&-r),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),C0(i.return,r,t),a.lanes|=r;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error($(341));s.lanes|=r,a=s.alternate,a!==null&&(a.lanes|=r),C0(s,r,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}yr(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,n=t.pendingProps.children,bl(t,r),o=Pn(o),n=n(o),t.flags|=1,yr(e,t,n,r),t.child;case 14:return n=t.type,o=Gn(n,t.pendingProps),o=Gn(n.type,o),lw(e,t,n,o,r);case 15:return LM(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Gn(n,o),Qf(e,t),t.tag=1,$r(n)?(e=!0,Wp(t)):e=!1,bl(t,r),uM(t,n,o),T0(t,n,o,r),A0(null,t,n,!0,e,r);case 19:return BM(e,t,r);case 22:return IM(e,t,r)}throw Error($(156,t.tag))};function rT(e,t){return O5(e,t)}function g9(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function On(e,t,r,n){return new g9(e,t,r,n)}function Dy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function v9(e){if(typeof e=="function")return Dy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ry)return 11;if(e===ny)return 14}return 2}function Xi(e,t){var r=e.alternate;return r===null?(r=On(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function tp(e,t,r,n,o,i){var s=2;if(n=e,typeof e=="function")Dy(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Za:return ea(r.children,o,i,t);case ty:s=8,o|=8;break;case X1:return e=On(12,r,t,o|2),e.elementType=X1,e.lanes=i,e;case Q1:return e=On(13,r,t,o),e.elementType=Q1,e.lanes=i,e;case Z1:return e=On(19,r,t,o),e.elementType=Z1,e.lanes=i,e;case d5:return rm(r,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case c5:s=10;break e;case u5:s=9;break e;case ry:s=11;break e;case ny:s=14;break e;case Oi:s=16,n=null;break e}throw Error($(130,e==null?e:typeof e,""))}return t=On(s,r,t,o),t.elementType=e,t.type=n,t.lanes=i,t}function ea(e,t,r,n){return e=On(7,e,n,t),e.lanes=r,e}function rm(e,t,r,n){return e=On(22,e,n,t),e.elementType=d5,e.lanes=r,e.stateNode={isHidden:!1},e}function Gg(e,t,r){return e=On(6,e,null,t),e.lanes=r,e}function Yg(e,t,r){return t=On(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function y9(e,t,r,n,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=_g(0),this.expirationTimes=_g(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_g(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function $y(e,t,r,n,o,i,s,a,l){return e=new y9(e,t,r,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=On(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},ky(i),e}function b9(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(sT)}catch(e){console.error(e)}}sT(),o5.exports=hn;var am=o5.exports;const wf=Dn(am);var E9=Object.defineProperty,C9=Object.getOwnPropertyDescriptor,M9=(e,t,r,n)=>{for(var o=n>1?void 0:n?C9(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&E9(t,r,o),o},aT=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},re=(e,t,r)=>(aT(e,t,"read from private field"),r?r.call(e):t.get(e)),en=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Qr=(e,t,r,n)=>(aT(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Gc,T9=class{constructor(){this.portals=new Map,en(this,Gc,jh()),this.on=e=>re(this,Gc).on("update",e),this.once=e=>{const t=re(this,Gc).on("update",r=>{t(),e(r)});return t}}update(){re(this,Gc).emit("update",this.portals)}render({Component:e,container:t}){const r=this.portals.get(t);this.portals.set(t,{Component:e,key:(r==null?void 0:r.key)??Cl()}),this.update()}forceUpdate(){for(const[e,{Component:t}]of this.portals)this.portals.set(e,{Component:t,key:Cl()})}remove(e){this.portals.delete(e),this.update()}};Gc=new WeakMap;var O9=e=>{const{portals:t}=e;return L.createElement(L.Fragment,null,t.map(([r,{Component:n,key:o}])=>am.createPortal(L.createElement(n,null),r,o)))};function _9(e){const[t,r]=S.useState(()=>Array.from(e.portals.entries()));return S.useEffect(()=>e.on(n=>{r(Array.from(n.entries()))}),[e]),S.useMemo(()=>t,[t])}var st,Yc,As,Jc,rp,Xc,Ka,Qc,np,Ho,vr,V0,lT=class{constructor({getPosition:e,node:t,portalContainer:r,view:n,ReactComponent:o,options:i}){en(this,st,void 0),en(this,Yc,[]),en(this,As,void 0),en(this,Jc,void 0),en(this,rp,void 0),en(this,Xc,void 0),en(this,Ka,void 0),en(this,Qc,!1),en(this,np,void 0),en(this,Ho,void 0),en(this,vr,void 0),en(this,V0,l=>{l&&(te(re(this,Ho),{code:H.REACT_NODE_VIEW,message:`You have applied a ref to a node view provided for '${re(this,st).type.name}' which doesn't support content.`}),l.append(re(this,Ho)))}),this.Component=()=>{const l=re(this,rp);return te(l,{code:H.REACT_NODE_VIEW,message:`The custom react node view provided for ${re(this,st).type.name} doesn't have a valid ReactComponent`}),L.createElement(l,{updateAttributes:this.updateAttributes,selected:this.selected,view:re(this,As),getPosition:re(this,Xc),node:re(this,st),forwardRef:re(this,V0),decorations:re(this,Yc)})},this.updateAttributes=l=>{if(!re(this,As).editable)return;const c=re(this,Xc).call(this);if(c==null)return;const u=re(this,As).state.tr.setNodeMarkup(c,void 0,{...re(this,st).attrs,...l});re(this,As).dispatch(u)},te(_e(e),{message:"You are attempting to use a node view for a mark type. This is not supported yet. Please check your configuration."}),Qr(this,st,t),Qr(this,As,n),Qr(this,Jc,r),Qr(this,rp,o),Qr(this,Xc,e),Qr(this,Ka,i),Qr(this,vr,this.createDom());const{contentDOM:s,wrapper:a}=this.createContentDom()??{};Qr(this,np,s??void 0),Qr(this,Ho,a),re(this,Ho)&&re(this,vr).append(re(this,Ho)),this.setDomAttributes(re(this,st),re(this,vr)),this.Component.displayName=V4(`${re(this,st).type.name}NodeView`),this.renderComponent()}static create(e){const{portalContainer:t,ReactComponent:r,options:n}=e;return(o,i,s)=>new lT({options:n,node:o,view:i,getPosition:s,portalContainer:t,ReactComponent:r})}get selected(){return re(this,Qc)}get contentDOM(){return re(this,np)}get dom(){return re(this,vr)}renderComponent(){re(this,Jc).render({Component:this.Component,container:re(this,vr)})}createDom(){const{defaultBlockNode:e,defaultInlineNode:t}=re(this,Ka),r=re(this,st).isInline?document.createElement(t):document.createElement(e);return r.classList.add(`${Xx(re(this,st).type.name)}-node-view-wrapper`),r}createContentDom(){var e,t;if(re(this,st).isLeaf)return;const r=(t=(e=re(this,st).type.spec).toDOM)==null?void 0:t.call(e,re(this,st));if(!r)return;const{contentDOM:n,dom:o}=an.renderSpec(document,r);let i;if(Je(o))return i=o,o===n&&(i=document.createElement("span"),i.classList.add(`${Xx(re(this,st).type.name)}-node-view-content-wrapper`),i.append(n)),Je(n),{wrapper:i,contentDOM:n}}update(e,t){return $h({types:re(this,st).type,node:e})?(re(this,st)===e&&re(this,Yc)===t||(re(this,st).sameMarkup(e)||this.setDomAttributes(e,re(this,vr)),Qr(this,st,e),Qr(this,Yc,t),this.renderComponent()),!0):!1}setDomAttributes(e,t){const{toDOM:r}=re(this,st).type.spec;let n=e.attrs;if(r){const o=r(e);if(ne(o)||A9(o))return;hs(o[1])&&(n=o[1])}for(const[o,i]of At(n))t.setAttribute(o,i)}selectNode(){Qr(this,Qc,!0),re(this,vr)&&re(this,vr).classList.add(qx),this.renderComponent()}deselectNode(){Qr(this,Qc,!1),re(this,vr)&&re(this,vr).classList.remove(qx),this.renderComponent()}destroy(){re(this,Jc).remove(re(this,vr))}ignoreMutation(e){return e.type==="selection"?!re(this,st).type.spec.selectable:re(this,Ho)?!re(this,Ho).contains(e.target):!0}stopEvent(e){var t;if(!re(this,vr))return!1;if(_e(re(this,Ka).stopEvent))return re(this,Ka).stopEvent({event:e});const r=e.target;if(!(re(this,vr).contains(r)&&!((t=this.contentDOM)!=null&&t.contains(r))))return!1;const o=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!o)return!0;const s=!!re(this,st).type.spec.draggable,a=ce.isSelectable(re(this,st)),l=e.type==="copy",c=e.type==="paste",u=e.type==="cut",d=e.type==="mousedown",f=e.type.startsWith("drag");return!s&&a&&f&&e.preventDefault(),!(f||o||l||c||u||d&&a)}},ww=lT;st=new WeakMap;Yc=new WeakMap;As=new WeakMap;Jc=new WeakMap;rp=new WeakMap;Xc=new WeakMap;Ka=new WeakMap;Qc=new WeakMap;np=new WeakMap;Ho=new WeakMap;vr=new WeakMap;V0=new WeakMap;function A9(e){return Ap(e)||hs(e)&&Ap(e.dom)}var ad=class extends Ve{constructor(){super(...arguments),this.portalContainer=new T9}get name(){return"reactComponent"}onCreate(){this.store.setStoreKey("portalContainer",this.portalContainer)}createNodeViews(){const e=ee(),t=this.store.managerSettings.nodeViewComponents??{};for(const n of this.store.extensions)!n.ReactComponent||!Hd(n)||n.reactComponentEnvironment==="ssr"||(e[n.name]=ww.create({options:this.options,ReactComponent:n.ReactComponent,portalContainer:this.portalContainer}));const r=At({...this.options.nodeViewComponents,...t});for(const[n,o]of r)e[n]=ww.create({options:this.options,ReactComponent:o,portalContainer:this.portalContainer});return e}};ad=M9([pe({defaultOptions:{defaultBlockNode:"div",defaultInlineNode:"span",defaultContentNode:"span",defaultEnvironment:"both",nodeViewComponents:{},stopEvent:null},staticKeys:["defaultBlockNode","defaultInlineNode","defaultContentNode","defaultEnvironment"]})],ad);function N9(e){const t=S.createContext(null),r=R9(t);return[o=>{const i=e(o);return L.createElement(t.Provider,{value:i},o.children)},r,t]}function R9(e){return(t,r)=>{const n=S.useContext(e),o=P9(n);if(!n)throw new Error("`useContextHook` must be placed inside the `Provider` returned by the `createContextState` method");if(!t)return n;if(typeof t!="function")throw new TypeError("invalid arguments passed to `useContextHook`. This hook must be called with zero arguments, a getter function or a path string.");const i=t(n);if(!o||!r)return i;const s=t(o);return r(s,i)?s:i}}function P9(e){const t=S.useRef();return z9(()=>{t.current=e}),t.current}var z9=typeof document<"u"?S.useLayoutEffect:S.useEffect;function L9(e,t){return N9(r=>{const n=S.useRef(null),o=S.useRef(),i=t==null?void 0:t(r),[s,a]=S.useState(()=>e({get:Sw(n),set:Ew(o),previousContext:void 0,props:r,state:i})),l=[...Object.values(r),i];return S.useEffect(()=>{l.length!==0&&a(c=>e({get:Sw(n),set:Ew(o),previousContext:c,props:r,state:i}))},l),n.current=s,o.current=a,s})}function Sw(e){return t=>{if(!e.current)throw new Error("`get` called outside of function scope. `get` can only be called within a function.");if(!t)return e.current;if(typeof t!="function")throw new TypeError("Invalid arguments passed to `useContextHook`. The hook must be called with zero arguments, a getter function or a path string.");return t(e.current)}}function Ew(e){return t=>{if(!e.current)throw new Error("`set` called outside of function scope. `set` can only be called within a function.");e.current(r=>({...r,...typeof t=="function"?t(r):t}))}}var cT={},uT={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.errorMessages=e.ErrorType=void 0;var t;(function(r){r.MalformedUnicode="MALFORMED_UNICODE",r.MalformedHexadecimal="MALFORMED_HEXADECIMAL",r.CodePointLimit="CODE_POINT_LIMIT",r.OctalDeprecation="OCTAL_DEPRECATION",r.EndOfString="END_OF_STRING"})(t=e.ErrorType||(e.ErrorType={})),e.errorMessages=new Map([[t.MalformedUnicode,"malformed Unicode character escape sequence"],[t.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[t.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[t.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[t.EndOfString,"malformed escape sequence at end of string"]])})(uT);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.unraw=e.errorMessages=e.ErrorType=void 0;const t=uT;Object.defineProperty(e,"ErrorType",{enumerable:!0,get:function(){return t.ErrorType}}),Object.defineProperty(e,"errorMessages",{enumerable:!0,get:function(){return t.errorMessages}});function r(p){return!p.match(/[^a-f0-9]/i)?parseInt(p,16):NaN}function n(p,h,m){const b=r(p);if(Number.isNaN(b)||m!==void 0&&m!==p.length)throw new SyntaxError(t.errorMessages.get(h));return b}function o(p){const h=n(p,t.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(h)}function i(p,h){const m=n(p,t.ErrorType.MalformedUnicode,4);if(h!==void 0){const b=n(h,t.ErrorType.MalformedUnicode,4);return String.fromCharCode(m,b)}return String.fromCharCode(m)}function s(p){return p.charAt(0)==="{"&&p.charAt(p.length-1)==="}"}function a(p){if(!s(p))throw new SyntaxError(t.errorMessages.get(t.ErrorType.MalformedUnicode));const h=p.slice(1,-1),m=n(h,t.ErrorType.MalformedUnicode);try{return String.fromCodePoint(m)}catch(b){throw b instanceof RangeError?new SyntaxError(t.errorMessages.get(t.ErrorType.CodePointLimit)):b}}function l(p,h=!1){if(h)throw new SyntaxError(t.errorMessages.get(t.ErrorType.OctalDeprecation));const m=parseInt(p,8);return String.fromCharCode(m)}const c=new Map([["b","\b"],["f","\f"],["n",` +`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function u(p){return c.get(p)||p}const d=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function f(p,h=!1){return p.replace(d,function(m,b,v,g,y,x,k,w,E){if(b!==void 0)return"\\";if(v!==void 0)return o(v);if(g!==void 0)return a(g);if(y!==void 0)return i(y,x);if(k!==void 0)return i(k);if(w==="0")return"\0";if(w!==void 0)return l(w,!h);if(E!==void 0)return u(E);throw new SyntaxError(t.errorMessages.get(t.ErrorType.EndOfString))})}e.unraw=f,e.default=f})(cT);const I9=Dn(cT),Yo=e=>typeof e=="string",D9=e=>typeof e=="function",Cw=new Map;function Vy(e){return[...Array.isArray(e)?e:[e],"en"]}function dT(e,t,r){const n=Vy(e);return ih(()=>sh("date",n,r),()=>new Intl.DateTimeFormat(n,r)).format(Yo(t)?new Date(t):t)}function j0(e,t,r){const n=Vy(e);return ih(()=>sh("number",n,r),()=>new Intl.NumberFormat(n,r)).format(t)}function Mw(e,t,r,{offset:n=0,...o}){const i=Vy(e),s=t?ih(()=>sh("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):ih(()=>sh("plural-cardinal",i),()=>new Intl.PluralRules(i,{type:"cardinal"}));return o[r]??o[s.select(r-n)]??o.other}function ih(e,t){const r=e();let n=Cw.get(r);return n||(n=t(),Cw.set(r,n)),n}function sh(e,t,r){const n=t.join("-");return`${e}-${n}-${JSON.stringify(r)}`}const fT=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g,$9=(e,t,r={})=>{t=t||e;const n=i=>Yo(i)?r[i]||{style:i}:i,o=(i,s)=>{const a=Object.keys(r).length?n("number"):{},l=j0(t,i,a);return s.replace("#",l)};return{plural:(i,s)=>{const{offset:a=0}=s,l=Mw(t,!1,i,s);return o(i-a,l)},selectordinal:(i,s)=>{const{offset:a=0}=s,l=Mw(t,!0,i,s);return o(i-a,l)},select:(i,s)=>s[i]??s.other,number:(i,s)=>j0(t,i,n(s)),date:(i,s)=>dT(t,i,n(s)),undefined:i=>i}};function H9(e,t,r){return(n,o={})=>{const i=$9(t,r,o),s=l=>Array.isArray(l)?l.reduce((c,u)=>{if(Yo(u))return c+u;const[d,f,p]=u;let h={};p!=null&&!Yo(p)?Object.keys(p).forEach(b=>{h[b]=s(p[b])}):h=p;const m=i[f](n[d],h);return m==null?c:c+m},""):l,a=s(e);return Yo(a)&&fT.test(a)?I9(a.trim()):Yo(a)?a.trim():a}}var B9=Object.defineProperty,F9=(e,t,r)=>t in e?B9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,V9=(e,t,r)=>(F9(e,typeof t!="symbol"?t+"":t,r),r);class j9{constructor(){V9(this,"_events",{})}on(t,r){return this._hasEvent(t)||(this._events[t]=[]),this._events[t].push(r),()=>this.removeListener(t,r)}removeListener(t,r){if(!this._hasEvent(t))return;const n=this._events[t].indexOf(r);~n&&this._events[t].splice(n,1)}emit(t,...r){this._hasEvent(t)&&this._events[t].map(n=>n.apply(this,r))}_hasEvent(t){return Array.isArray(this._events[t])}}var U9=Object.defineProperty,W9=(e,t,r)=>t in e?U9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pa=(e,t,r)=>(W9(e,typeof t!="symbol"?t+"":t,r),r);class K9 extends j9{constructor(t){super(),Pa(this,"_locale"),Pa(this,"_locales"),Pa(this,"_localeData"),Pa(this,"_messages"),Pa(this,"_missing"),Pa(this,"t",this._.bind(this)),this._messages={},this._localeData={},t.missing!=null&&(this._missing=t.missing),t.messages!=null&&this.load(t.messages),t.localeData!=null&&this.loadLocaleData(t.localeData),(t.locale!=null||t.locales!=null)&&this.activate(t.locale,t.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(t,r){this._localeData[t]==null?this._localeData[t]=r:Object.assign(this._localeData[t],r)}loadLocaleData(t,r){r!=null?this._loadLocaleData(t,r):Object.keys(t).forEach(n=>this._loadLocaleData(n,t[n])),this.emit("change")}_load(t,r){this._messages[t]==null?this._messages[t]=r:Object.assign(this._messages[t],r)}load(t,r){r!=null?this._load(t,r):Object.keys(t).forEach(n=>this._load(n,t[n])),this.emit("change")}loadAndActivate({locale:t,locales:r,messages:n}){this._locale=t,this._locales=r||void 0,this._messages[this._locale]=n,this.emit("change")}activate(t,r){this._locale=t,this._locales=r,this.emit("change")}_(t,r={},{message:n,formats:o}={}){Yo(t)||(r=t.values||r,n=t.message,t=t.id);const i=!this.messages[t],s=this._missing;if(s&&i)return D9(s)?s(this._locale,t):s;i&&this.emit("missing",{id:t,locale:this._locale});let a=this.messages[t]||n||t;return Yo(a)&&fT.test(a)?JSON.parse(`"${a}"`):Yo(a)?a:H9(a,this._locale,this._locales)(r,o)}date(t,r){return dT(this._locales||this._locale,t,r)}number(t,r){return j0(this._locales||this._locale,t,r)}}function q9(e={}){return new K9(e)}const lm=q9();function W(e,t){return t?"other":e==1?"one":"other"}function ui(e,t){return t?"other":e==0||e==1?"one":"other"}function Kr(e,t){var r=String(e).split("."),n=!r[1];return t?"other":e==1&&n?"one":"other"}function Le(e,t){return"other"}function xs(e,t){return t?"other":e==1?"one":e==2?"two":"other"}const G9=Le,Y9=W,J9=ui;function X9(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const Q9=W;function Z9(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2);return t?"other":e==0?"zero":e==1?"one":e==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function eD(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2);return t?"other":e==0?"zero":e==1?"one":e==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function tD(e,t){return t?e==1||e==5||e==7||e==8||e==9||e==10?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const rD=W,nD=Kr;function oD(e,t){var r=String(e).split("."),n=r[0],o=n.slice(-1),i=n.slice(-2),s=n.slice(-3);return t?o==1||o==2||o==5||o==7||o==8||i==20||i==50||i==70||i==80?"one":o==3||o==4||s==100||s==200||s==300||s==400||s==500||s==600||s==700||s==800||s==900?"few":n==0||o==6||i==40||i==60||i==90?"many":"other":e==1?"one":"other"}function iD(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2);return t?(o==2||o==3)&&i!=12&&i!=13?"few":"other":o==1&&i!=11?"one":o>=2&&o<=4&&(i<12||i>14)?"few":n&&o==0||o>=5&&o<=9||i>=11&&i<=14?"many":"other"}const sD=W,aD=W,lD=W,cD=ui,uD=Le;function dD(e,t){return t?e==1||e==5||e==7||e==8||e==9||e==10?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const fD=Le;function pD(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2),s=n&&r[0].slice(-6);return t?"other":o==1&&i!=11&&i!=71&&i!=91?"one":o==2&&i!=12&&i!=72&&i!=92?"two":(o==3||o==4||o==9)&&(i<10||i>19)&&(i<70||i>79)&&(i<90||i>99)?"few":e!=0&&n&&s==0?"many":"other"}const hD=W;function mD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function gD(e,t){var r=String(e).split("."),n=!r[1];return t?e==1||e==3?"one":e==2?"two":e==4?"few":"other":e==1&&n?"one":"other"}const vD=W;function yD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?"other":i&&(n==1||n==2||n==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const bD=W,xD=W,kD=W;function wD(e,t){var r=String(e).split("."),n=r[0],o=!r[1];return t?"other":e==1&&o?"one":n>=2&&n<=4&&o?"few":o?"other":"many"}function SD(e,t){return t?e==0||e==7||e==8||e==9?"zero":e==1?"one":e==2?"two":e==3||e==4?"few":e==5||e==6?"many":"other":e==0?"zero":e==1?"one":e==2?"two":e==3?"few":e==6?"many":"other"}function ED(e,t){var r=String(e).split("."),n=r[0],o=Number(r[0])==e;return t?"other":e==1||!o&&(n==0||n==1)?"one":"other"}const CD=Kr;function MD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-2),a=o.slice(-2);return t?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}const TD=W,OD=Le,_D=W,AD=W;function ND(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?i==1&&s!=11?"one":i==2&&s!=12?"two":i==3&&s!=13?"few":"other":e==1&&n?"one":"other"}const RD=W,PD=W,zD=Kr,LD=W;function ID(e,t){return t?"other":e>=0&&e<=1?"one":"other"}function DD(e,t){return t?"other":e>=0&&e<2?"one":"other"}const $D=Kr;function HD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?e==1?"one":"other":i&&(n==1||n==2||n==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const BD=W;function FD(e,t){return t?e==1?"one":"other":e>=0&&e<2?"one":"other"}const VD=W,jD=Kr;function UD(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?e==1?"one":"other":e==1?"one":e==2?"two":n&&e>=3&&e<=6?"few":n&&e>=7&&e<=10?"many":"other"}function WD(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?e==1||e==11?"one":e==2||e==12?"two":e==3||e==13?"few":"other":e==1||e==11?"one":e==2||e==12?"two":n&&e>=3&&e<=10||n&&e>=13&&e<=19?"few":"other"}const KD=Kr,qD=W;function GD(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const YD=ui;function JD(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":o&&i==1?"one":o&&i==2?"two":o&&(s==0||s==20||s==40||s==60||s==80)?"few":o?"other":"many"}const XD=W,QD=W;function ZD(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1);return t?"other":e==1&&o?"one":n==2&&o?"two":o&&(e<0||e>10)&&i&&s==0?"many":"other"}function e7(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}function t7(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function r7(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-2),a=o.slice(-2);return t?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}function n7(e,t){return t?e==1||e==5?"one":"other":e==1?"one":"other"}function o7(e,t){return t?e==1?"one":"other":e>=0&&e<2?"one":"other"}const i7=Kr,s7=Le,a7=Le,l7=Le,c7=Kr;function u7(e,t){var r=String(e).split("."),n=r[0],o=Number(r[0])==e,i=n.slice(-1),s=n.slice(-2);return t?"other":o&&i==1&&s!=11||!o?"one":"other"}function d7(e,t){var r=String(e).split("."),n=!r[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&n?"one":"other"}const f7=xs;function p7(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1);return t?"other":e==1&&o?"one":n==2&&o?"two":o&&(e<0||e>10)&&i&&s==0?"many":"other"}const h7=Le,m7=Le,g7=W,v7=Kr,y7=W,b7=Le,x7=Le;function k7(e,t){var r=String(e).split("."),n=r[0],o=n.slice(-2);return t?n==1?"one":n==0||o>=2&&o<=20||o==40||o==60||o==80?"many":"other":e==1?"one":"other"}function w7(e,t){return t?"other":e>=0&&e<2?"one":"other"}const S7=W,E7=W,C7=Le,M7=Le;function T7(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1);return t?o==6||o==9||n&&o==0&&e!=0?"many":"other":e==1?"one":"other"}const O7=W,_7=W,A7=Le;function N7(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const R7=Le,P7=W,z7=W;function L7(e,t){return t?"other":e==0?"zero":e==1?"one":"other"}const I7=W;function D7(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2),i=n&&r[0].slice(-3),s=n&&r[0].slice(-5),a=n&&r[0].slice(-6);return t?n&&e>=1&&e<=4||o>=1&&o<=4||o>=21&&o<=24||o>=41&&o<=44||o>=61&&o<=64||o>=81&&o<=84?"one":e==5||o==5?"many":"other":e==0?"zero":e==1?"one":o==2||o==22||o==42||o==62||o==82||n&&i==0&&(s>=1e3&&s<=2e4||s==4e4||s==6e4||s==8e4)||e!=0&&a==1e5?"two":o==3||o==23||o==43||o==63||o==83?"few":e!=1&&(o==1||o==21||o==41||o==61||o==81)?"many":"other"}const $7=W;function H7(e,t){var r=String(e).split("."),n=r[0];return t?"other":e==0?"zero":(n==0||n==1)&&e!=0?"one":"other"}const B7=W,F7=W,V7=Le,j7=ui;function U7(e,t){return t&&e==1?"one":"other"}function W7(e,t){var r=String(e).split("."),n=r[1]||"",o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?"other":i==1&&(s<11||s>19)?"one":i>=2&&i<=9&&(s<11||s>19)?"few":n!=0?"many":"other"}function K7(e,t){var r=String(e).split("."),n=r[1]||"",o=n.length,i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-2),c=n.slice(-1);return t?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const q7=W,G7=ui,Y7=W;function J7(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?s==1&&a!=11?"one":s==2&&a!=12?"two":(s==7||s==8)&&a!=17&&a!=18?"many":"other":i&&s==1&&a!=11||l==1&&c!=11?"one":"other"}const X7=W,Q7=W;function Z7(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-2);return t?e==1?"one":"other":e==1&&n?"one":!n||e==0||i>=2&&i<=19?"few":"other"}function e$(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":"other":e==1?"one":"other"}function t$(e,t){return t&&e==1?"one":"other"}function r$(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2);return t?"other":e==1?"one":e==0||o>=2&&o<=10?"few":o>=11&&o<=19?"many":"other"}const n$=Le,o$=W,i$=xs,s$=W,a$=W;function l$(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?n&&e>=1&&e<=4?"one":"other":e==1?"one":"other"}const c$=Kr,u$=W,d$=W,f$=W,p$=Le,h$=W,m$=ui,g$=W,v$=W,y$=W;function b$(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?e==1||e==5||n&&e>=7&&e<=9?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e==1?"one":"other"}const x$=W,k$=Le,w$=ui,S$=W;function E$(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":e==1&&o?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&n!=1&&(i==0||i==1)||o&&i>=5&&i<=9||o&&s>=12&&s<=14?"many":"other"}function C$(e,t){var r=String(e).split("."),n=r[1]||"",o=n.length,i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-2),c=n.slice(-1);return t?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const M$=W;function T$(e,t){var r=String(e).split("."),n=r[0];return t?"other":n==0||n==1?"one":"other"}const O$=Kr,_$=W;function A$(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-2);return t?e==1?"one":"other":e==1&&n?"one":!n||e==0||i>=2&&i<=19?"few":"other"}const N$=W,R$=Le;function P$(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":o&&i==1&&s!=11?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&i==0||o&&i>=5&&i<=9||o&&s>=11&&s<=14?"many":"other"}const z$=W,L$=Le,I$=W;function D$(e,t){var r=String(e).split("."),n=!r[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&n?"one":"other"}function $$(e,t){var r=String(e).split("."),n=!r[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&n?"one":"other"}const H$=W,B$=W,F$=xs,V$=W,j$=Le,U$=Le;function W$(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function K$(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?"other":e>=0&&e<=1?"one":n&&e>=2&&e<=10?"few":"other"}function q$(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"";return t?"other":e==0||e==1||n==0&&o==1?"one":"other"}function G$(e,t){var r=String(e).split("."),n=r[0],o=!r[1];return t?"other":e==1&&o?"one":n>=2&&n<=4&&o?"few":o?"other":"many"}function Y$(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-2);return t?"other":o&&i==1?"one":o&&i==2?"two":o&&(i==3||i==4)||!o?"few":"other"}const J$=xs,X$=xs,Q$=xs,Z$=xs,eH=xs,tH=W,rH=W;function nH(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2);return t?e==1?"one":o==4&&i!=14?"many":"other":e==1?"one":"other"}function oH(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}const iH=W,sH=W,aH=W,lH=Le;function cH(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?(i==1||i==2)&&s!=11&&s!=12?"one":"other":e==1&&n?"one":"other"}const uH=Kr,dH=W,fH=W,pH=W,hH=W,mH=Le,gH=ui,vH=W;function yH(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1);return t?o==6||o==9||e==10?"few":"other":e==1?"one":"other"}function bH(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?e==1?"one":"other":i&&(n==1||n==2||n==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const xH=W,kH=Le,wH=W,SH=W;function EH(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?"other":e==0||e==1||n&&e>=11&&e<=99?"one":"other"}const CH=W;function MH(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-1),c=n.slice(-2);return t?s==3&&a!=13?"few":"other":o&&l==1&&c!=11?"one":o&&l>=2&&l<=4&&(c<12||c>14)?"few":o&&l==0||o&&l>=5&&l<=9||o&&c>=11&&c<=14?"many":"other"}const TH=Kr,OH=W,_H=W;function AH(e,t){return t&&e==1?"one":"other"}const NH=W,RH=W,PH=ui,zH=W,LH=Le,IH=W,DH=W,$H=Kr,HH=Le,BH=Le,FH=Le;function VH(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const jH=Object.freeze(Object.defineProperty({__proto__:null,_in:G9,af:Y9,ak:J9,am:X9,an:Q9,ar:Z9,ars:eD,as:tD,asa:rD,ast:nD,az:oD,be:iD,bem:sD,bez:aD,bg:lD,bho:cD,bm:uD,bn:dD,bo:fD,br:pD,brx:hD,bs:mD,ca:gD,ce:vD,ceb:yD,cgg:bD,chr:xD,ckb:kD,cs:wD,cy:SD,da:ED,de:CD,dsb:MD,dv:TD,dz:OD,ee:_D,el:AD,en:ND,eo:RD,es:PD,et:zD,eu:LD,fa:ID,ff:DD,fi:$D,fil:HD,fo:BD,fr:FD,fur:VD,fy:jD,ga:UD,gd:WD,gl:KD,gsw:qD,gu:GD,guw:YD,gv:JD,ha:XD,haw:QD,he:ZD,hi:e7,hr:t7,hsb:r7,hu:n7,hy:o7,ia:i7,id:s7,ig:a7,ii:l7,io:c7,is:u7,it:d7,iu:f7,iw:p7,ja:h7,jbo:m7,jgo:g7,ji:v7,jmc:y7,jv:b7,jw:x7,ka:k7,kab:w7,kaj:S7,kcg:E7,kde:C7,kea:M7,kk:T7,kkj:O7,kl:_7,km:A7,kn:N7,ko:R7,ks:P7,ksb:z7,ksh:L7,ku:I7,kw:D7,ky:$7,lag:H7,lb:B7,lg:F7,lkt:V7,ln:j7,lo:U7,lt:W7,lv:K7,mas:q7,mg:G7,mgo:Y7,mk:J7,ml:X7,mn:Q7,mo:Z7,mr:e$,ms:t$,mt:r$,my:n$,nah:o$,naq:i$,nb:s$,nd:a$,ne:l$,nl:c$,nn:u$,nnh:d$,no:f$,nqo:p$,nr:h$,nso:m$,ny:g$,nyn:v$,om:y$,or:b$,os:x$,osa:k$,pa:w$,pap:S$,pl:E$,prg:C$,ps:M$,pt:T$,pt_PT:O$,rm:_$,ro:A$,rof:N$,root:R$,ru:P$,rwk:z$,sah:L$,saq:I$,sc:D$,scn:$$,sd:H$,sdh:B$,se:F$,seh:V$,ses:j$,sg:U$,sh:W$,shi:K$,si:q$,sk:G$,sl:Y$,sma:J$,smi:X$,smj:Q$,smn:Z$,sms:eH,sn:tH,so:rH,sq:nH,sr:oH,ss:iH,ssy:sH,st:aH,su:lH,sv:cH,sw:uH,syr:dH,ta:fH,te:pH,teo:hH,th:mH,ti:gH,tig:vH,tk:yH,tl:bH,tn:xH,to:kH,tr:wH,ts:SH,tzm:EH,ug:CH,uk:MH,ur:TH,uz:OH,ve:_H,vi:AH,vo:NH,vun:RH,wa:PH,wae:zH,wo:LH,xh:IH,xog:DH,yi:$H,yo:HH,yue:BH,zh:FH,zu:VH},Symbol.toStringTag,{value:"Module"}));var UH=Object.defineProperty,WH=Object.getOwnPropertyDescriptor,KH=Object.getOwnPropertyNames,qH=Object.prototype.hasOwnProperty,Tw=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of KH(t))!qH.call(e,o)&&o!==r&&UH(e,o,{get:()=>t[o],enumerable:!(n=WH(t,o))||n.enumerable});return e},GH=(e,t,r)=>(Tw(e,t,"default"),r&&Tw(r,t,"default")),YH=JSON.parse('{"extension.command.toggle-upper-case.label":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"extension.table.column_count":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"extension.table.row_count":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.toggle-columns.description":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"extension.command.toggle-columns.label":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"extension.command.set-text-direction.label":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"extension.command.set-text-direction.description":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"extension.command.toggle-heading.label":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"extension.command.toggle-callout.description":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"extension.command.toggle-callout.label":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"extension.command.toggle-code-block.description":"Add a code block","extension.command.add-annotation.label":"Add annotation","extension.command.toggle-blockquote.description":"Add blockquote formatting to the selected text","extension.command.toggle-bold.description":"Add bold formatting to the selected text","extension.command.toggle-code.description":"Add inline code formatting to the selected text","keyboard.shortcut.alt":"Alt","keyboard.shortcut.arrowDown":"Arrow Down","keyboard.shortcut.arrowLeft":"Arrow Left","keyboard.shortcut.arrowRight":"Arrow Right","keyboard.shortcut.arrowUp":"Arrow Up","keyboard.shortcut.backspace":"Backspace","ui.text-color.black":"Black","extension.command.toggle-blockquote.label":"Blockquote","ui.text-color.blue":"Blue","ui.text-color.blue.hue":["Blue ",["hue"]],"extension.command.toggle-bold.label":"Bold","extension.command.toggle-bullet-list.description":"Bulleted list","keyboard.shortcut.capsLock":"Caps Lock","extension.command.center-align.label":"Center align","extension.command.toggle-code.label":"Code","extension.command.toggle-code-block.label":"Codeblock","keyboard.shortcut.command":"Command","QcPNd6":"Image description","ogrUzJ":"Add a short description here.","yqdyzr":"Image","6/02F4":"Image source","X8H91v":"Image","zhQ7Zt":"Italic","ZL7E7l":"Underline","keyboard.shortcut.control":"Control","extension.command.convert-paragraph.description":"Convert current block into a paragraph block.","extension.command.convert-paragraph.label":"Convert Paragraph","extension.command.copy.label":"Copy","extension.command.copy.description":"Copy the selected text","extension.command.create-table.description":"Create a table with set number of rows and columns.","extension.command.create-table.label":"Create table","extension.command.cut.label":"Cut","extension.command.cut.description":"Cut the selected text","ui.text-color.cyan":"Cyan","ui.text-color.cyan.hue":["Cyan ",["hue"]],"extension.command.decrease-font-size.label":"Decrease","extension.command.decrease-indent.label":"Decrease indentation","extension.command.decrease-font-size.description":"Decrease the font size.","keyboard.shortcut.delete":"Delete","extension.command.insert-horizontal-rule.label":"Divider","keyboard.shortcut.end":"End","keyboard.shortcut.escape":"Enter","keyboard.shortcut.enter":"Enter","6PjrOF":"Add annotation","OTq5WC":"Center align","oeZ3ox":"Convert current block into a paragraph block.","m1khs+":"Convert Paragraph","w/1U+3":"Copy the selected text","kdodi0":"Copy","k0KR/u":"Create a table with set number of rows and columns.","zrwMyD":"Create table","D/nWxh":"Cut the selected text","jHPv5m":"Cut","5cNgRx":"Decrease the font size.","vyRNWx":"Decrease","Jgiol4":"Decrease indentation","1gJSHH":"Increase the font size","OQXJXz":"Increase","72TLhr":"Increase indentation","HFlfzJ":"Insert Emoji","RPq9fY":"Separate content with a diving horizontal line","OKQF+e":"Divider","zjYb9C":"Insert a new paragraph","4M4sXC":"Insert Paragraph","1Q+eVc":"Justify","ejWWtP":"Left align","wVqrpS":"Paste content into the editor","07v9aw":"Paste","zUYfou":"Redo the most recent action","9Nq9zr":"Redo","0uxaZe":"Remove annotation","iJWZAz":"Right align","g5WpPn":"Select all content within the editor","2+pZDT":"Select all","yChCR1":"Set text case","GMzAC/":"Set the font size for the selected text.","vzEyrv":"Font size","7VCkJ8":"Set the text color for the selected text.","qjWFaR":"Text color","LVWgFu":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"WXwRy1":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"G/o315":"Set the text highlight color for the selected text.","xtHg6d":"Text highlight","1p1W/p":"Add blockquote formatting to the selected text","6+rh6I":"Blockquote","0yB3LV":"Add bold formatting to the selected text","sFMo4Z":"Bold","SMKG/s":"Bulleted list","/BYCMi":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"V+3IBe":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"hbIo4L":"Add a code block","7GkMcx":"Codeblock","2r4JYl":"Add inline code formatting to the selected text","Up8Tpe":"Code","ATHSPS":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"7DC1VE":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"hnrBeo":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"NkZAcw":"Italicize the selected text","2fTW9e":"Italic","c759Ra":"Ordered list","uQwrZu":"Strikethrough the selected text","pT3qly":"Strikethrough","BHk+zu":"Subscript","18BVwM":"Superscript","tOIVCV":"Tasked list","4Janx3":"Underline the selected text","dCHt+D":"Underline","YYAprs":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"tczyZL":"Show hidden whitespace characters in your editor.","0qAX23":"Toggle Whitespace","ezMADU":"Undo the most recent action","N3P7EC":"Undo","2nj/+s":"Update annotation","dWD7u4":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"qXqgVT":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.set-font-size.label":"Font size","ui.text-color.grape":"Grape","ui.text-color.grape.hue":["Grape ",["hue"]],"ui.text-color.gray":"Gray","ui.text-color.gray.hue":["Gray ",["hue"]],"ui.text-color.green":"Green","ui.text-color.green.hue":["Green ",["hue"]],"keyboard.shortcut.home":"Home","extension.command.increase-font-size.label":"Increase","extension.command.increase-indent.label":"Increase indentation","extension.command.increase-font-size.description":"Increase the font size","ui.text-color.indigo":"Indigo","ui.text-color.indigo.hue":["Indigo ",["hue"]],"extension.command.insert-paragraph.description":"Insert a new paragraph","extension.command.insert-emoji.label":"Insert Emoji","extension.command.insert-paragraph.label":"Insert Paragraph","extension.command.toggle-italic.label":"Italic","extension.command.toggle-italic.description":"Italicize the selected text","extension.command.justify-align.label":"Justify","R7NlCw":"Alt","RbDiK5":"Arrow Down","Dgyd+E":"Arrow Left","8pdCk4":"Arrow Right","Gp/343":"Arrow Up","PFPV0A":"Backspace","0IRYvp":"Caps Lock","X7HX0D":"Command","zq0AdD":"Control","8SfToN":"Delete","Ys/uah":"End","3K5hww":"Enter","veQt1j":"Enter","ySv7i+":"Home","e6RUI1":"Page Down","EEJk31":"Page Up","7sbhAU":"Shift","Q4eplT":"Space","SUhVVC":"Tab","extension.command.left-align.label":"Left align","ui.text-color.lime":"Lime","ui.text-color.lime.hue":["Lime ",["hue"]],"react-components.mention-atom-component.zero-items":"No items available","ui.text-color.orange":"Orange","ui.text-color.orange.hue":["Orange ",["hue"]],"extension.command.toggle-ordered-list.label":"Ordered list","keyboard.shortcut.pageDown":"Page Down","keyboard.shortcut.pageUp":"Page Up","extension.command.paste.label":"Paste","extension.command.paste.description":"Paste content into the editor","ui.text-color.pink":"Pink","ui.text-color.pink.hue":["Pink ",["hue"]],"zvMfIA":"No items available","pEjhti":"Static Menu","ui.text-color.red":"Red","ui.text-color.red.hue":["Red ",["hue"]],"extension.command.redo.label":"Redo","extension.command.redo.description":"Redo the most recent action","extension.command.remove-annotation.label":"Remove annotation","extension.command.right-align.label":"Right align","extension.command.select-all.label":"Select all","extension.command.select-all.description":"Select all content within the editor","extension.command.insert-horizontal-rule.description":"Separate content with a diving horizontal line","extension.command.set-casing.label":"Set text case","extension.command.set-font-size.description":"Set the font size for the selected text.","extension.command.set-text-color.description":"Set the text color for the selected text.","extension.command.set-text-highlight.description":"Set the text highlight color for the selected text.","keyboard.shortcut.shift":"Shift","extension.command.toggle-whitespace.description":"Show hidden whitespace characters in your editor.","keyboard.shortcut.space":"Space","extension.command.toggle-strike.label":"Strikethrough","extension.command.toggle-strike.description":"Strikethrough the selected text","extension.command.toggle-subscript.label":"Subscript","extension.command.toggle-superscript.label":"Superscript","keyboard.shortcut.tab":"Tab","extension.command.toggle-task-list.description":"Tasked list","ui.text-color.teal":"Teal","ui.text-color.teal.hue":["Teal ",["hue"]],"extension.command.set-text-color.label":"Text color","extension.command.set-text-highlight.label":"Text highlight","extension.command.toggle-whitespace.label":"Toggle Whitespace","ui.text-color.transparent":"Transparent","slrB1c":"Black","6QML30":"Blue","xw+keN":["Blue ",["hue"]],"38RHqP":"Cyan","D89yPf":["Cyan ",["hue"]],"VjBLnd":"Grape","Rp40yv":["Grape ",["hue"]],"5Dm9D1":"Gray","HGjXjC":["Gray ",["hue"]],"b9fz+n":"Green","18jo3M":["Green ",["hue"]],"CFzqCV":"Indigo","aVlDku":["Indigo ",["hue"]],"04PfLc":"Lime","KRTK6Y":["Lime ",["hue"]],"pSnXFd":"Orange","ve/MJZ":["Orange ",["hue"]],"OvCgDa":"Pink","l7NqyT":["Pink ",["hue"]],"IT9k0j":"Red","AdyJ7/":["Red ",["hue"]],"3D2UWc":"Teal","Dcq0Y1":["Teal ",["hue"]],"bsi2ik":"Transparent","Tj3PRR":"Violet","xxMH5N":["Violet ",["hue"]],"Rum0ah":"White","4gaw/Q":"Yellow","hhauc3":["Yellow ",["hue"]],"extension.command.toggle-underline.label":"Underline","extension.command.toggle-underline.description":"Underline the selected text","extension.command.undo.label":"Undo","extension.command.undo.description":"Undo the most recent action","extension.command.update-annotation.label":"Update annotation","ui.text-color.violet":"Violet","ui.text-color.violet.hue":["Violet ",["hue"]],"ui.text-color.white":"White","ui.text-color.yellow":"Yellow","ui.text-color.yellow.hue":["Yellow ",["hue"]]}'),pT={};GH(pT,jH);lm.loadLocaleData("en",{plurals:pT.en});lm.load("en",YH);lm.activate("en");var JH=Object.defineProperty,XH=Object.getOwnPropertyDescriptor,jy=(e,t,r,n)=>{for(var o=n>1?void 0:n?XH(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&JH(t,r,o),o},jl=class extends er{get name(){return"doc"}createNodeSpec(e,t){const{docAttributes:r,content:n}=this.options,o=ee();if(hs(r))for(const[i,s]of At(r))o[i]={default:s};else for(const i of r)o[i]={default:null};return{attrs:o,content:n,...t}}setDocAttributes(e){return({tr:t,dispatch:r})=>{if(r){for(const[n,o]of Object.entries(e))t.step(new ld(n,o));r(t)}return!0}}isDefaultDocNode({state:e=this.store.getState(),options:t}={}){return Kv(e.doc,t)}};jy([U()],jl.prototype,"setDocAttributes",1);jy([He()],jl.prototype,"isDefaultDocNode",1);jl=jy([pe({defaultOptions:{content:"block+",docAttributes:[]},defaultPriority:Ae.Medium,staticKeys:["content","docAttributes"],disableExtraAttributes:!0})],jl);var hT="SetDocAttribute",mT="RevertSetDocAttribute",ld=class extends Rt{constructor(e,t,r=hT){super(),this.stepType=r,this.key=e,this.value=t}static fromJSON(e,t){return new ld(t.key,t.value,t.stepType)}apply(e){this.previous=e.attrs[this.key];const t={...e.attrs,[this.key]:this.value};return yt.ok(e.type.create(t,e.content,e.marks))}invert(){return new ld(this.key,this.previous,mT)}map(){return this}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}};try{Rt.jsonID(hT,ld),Rt.jsonID(mT,ld)}catch(e){if(!e.message.startsWith("Duplicate use of step JSON ID"))throw e}var QH=Object.defineProperty,ZH=Object.getOwnPropertyDescriptor,gT=(e,t,r,n)=>{for(var o=n>1?void 0:n?ZH(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&QH(t,r,o),o};function eB(e,t,r,n){const o=e.docView.posFromDOM(t,r,n);return o===null||o<0?null:o}function tB(e,t){const r=t.target;if(r){const n=eB(e,r,0);if(n!==null){const o=e.state.doc.resolve(n),i=o.node().isLeaf?0:1,s=o.start()-i;return{pos:n,inside:s}}}return e.posAtCoords({left:t.clientX,top:t.clientY})??void 0}var ah=class extends Ve{constructor(){super(...arguments),this.mousedown=!1,this.mouseover=!1,this.createMouseEventHandler=e=>(t,r)=>{const n=r,o=tB(t,n);if(!o)return!1;const i=[],s=[],{inside:a,pos:l}=o;if(a===-1)return!1;const c=t.state.doc.resolve(l),u=c.depth+1;for(const d of Ev(u,1))i.push({node:d>c.depth&&c.nodeAfter?c.nodeAfter:c.node(d),pos:c.before(d)});for(const{type:d}of c.marksAcross(c)??[]){const f=_o(c,d);f&&s.push(f)}return e(n,{view:t,nodes:i,marks:s,getMark:d=>{const f=ne(d)?t.state.schema.marks[d]:d;return te(f,{code:H.EXTENSION,message:`The mark ${d} being checked does not exist within the editor schema.`}),s.find(p=>p.mark.type===f)},getNode:d=>{var f;const p=ne(d)?t.state.schema.nodes[d]:d;te(p,{code:H.EXTENSION,message:"The node being checked does not exist"});const h=i.find(({node:m})=>m.type===p);if(h)return{...h,isRoot:!!((f=i[0])!=null&&f.node.eq(h.node))}}})}}get name(){return"events"}onView(){var e,t;if(!((e=this.store.managerSettings.exclude)!=null&&e.clickHandler))for(const r of this.store.extensions){if(!r.createEventHandlers||(t=r.options.exclude)!=null&&t.clickHandler)continue;const n=r.createEventHandlers();for(const[o,i]of At(n))this.addHandler(o,i)}}createPlugin(){const e=new WeakMap,t=(r,n,o,i,s,a,l,c)=>{const u=this.store.currentState,{schema:d,doc:f}=u,p=f.resolve(i),h=e.has(l),m=rB({$pos:p,handled:h,view:o,state:u});let b=!1;h||(b=r(l,m)||b);const v={...m,pos:i,direct:c,nodeWithPosition:{node:s,pos:a},getNode:g=>{const y=ne(g)?d.nodes[g]:g;return te(y,{code:H.EXTENSION,message:"The node being checked does not exist"}),y===s.type?{node:s,pos:a}:void 0}};return e.set(l,!0),n(l,v)||b};return{props:{handleKeyPress:(r,n)=>this.options.keypress(n)||!1,handleKeyDown:(r,n)=>this.options.keydown(n)||!1,handleTextInput:(r,n,o,i)=>this.options.textInput({from:n,to:o,text:i})||!1,handleClickOn:(r,n,o,i,s,a)=>t(this.options.clickMark,this.options.click,r,n,o,i,s,a),handleDoubleClickOn:(r,n,o,i,s,a)=>t(this.options.doubleClickMark,this.options.doubleClick,r,n,o,i,s,a),handleTripleClickOn:(r,n,o,i,s,a)=>t(this.options.tripleClickMark,this.options.tripleClick,r,n,o,i,s,a),handleDOMEvents:{focus:(r,n)=>this.options.focus(n)||!1,blur:(r,n)=>this.options.blur(n)||!1,mousedown:(r,n)=>(this.startMouseover(),this.options.mousedown(n)||!1),mouseup:(r,n)=>(this.endMouseover(),this.options.mouseup(n)||!1),mouseleave:(r,n)=>(this.mouseover=!1,this.options.mouseleave(n)||!1),mouseenter:(r,n)=>(this.mouseover=!0,this.options.mouseenter(n)||!1),keyup:(r,n)=>this.options.keyup(n)||!1,mouseout:this.createMouseEventHandler((r,n)=>{const o={...n,hovering:!1};return this.options.hover(r,o)||!1}),mouseover:this.createMouseEventHandler((r,n)=>{const o={...n,hovering:!0};return this.options.hover(r,o)||!1}),contextmenu:this.createMouseEventHandler((r,n)=>this.options.contextmenu(r,n)||!1),scroll:(r,n)=>this.options.scroll(n)||!1,copy:(r,n)=>this.options.copy(n)||!1,cut:(r,n)=>this.options.cut(n)||!1,paste:(r,n)=>this.options.paste(n)||!1}},view:r=>{let n=r.editable;const o=this.options;return{update(i){const s=i.editable;s!==n&&(o.editable(s),n=s)}}}}}isInteracting(){return this.mousedown&&this.mouseover}startMouseover(){this.mouseover=!0,!this.mousedown&&(this.mousedown=!0,this.store.document.documentElement.addEventListener("mouseup",()=>{this.endMouseover()},{once:!0}))}endMouseover(){this.mousedown&&(this.mousedown=!1,this.store.commands.emptyUpdate())}};gT([He()],ah.prototype,"isInteracting",1);ah=gT([pe({handlerKeys:["blur","focus","mousedown","mouseup","mouseenter","mouseleave","textInput","keypress","keyup","keydown","click","clickMark","doubleClick","doubleClickMark","tripleClick","tripleClickMark","contextmenu","hover","scroll","copy","cut","paste","editable"],handlerKeyOptions:{blur:{earlyReturnValue:!0},focus:{earlyReturnValue:!0},mousedown:{earlyReturnValue:!0},mouseleave:{earlyReturnValue:!0},mouseup:{earlyReturnValue:!0},click:{earlyReturnValue:!0},doubleClick:{earlyReturnValue:!0},tripleClick:{earlyReturnValue:!0},hover:{earlyReturnValue:!0},contextmenu:{earlyReturnValue:!0},scroll:{earlyReturnValue:!0},copy:{earlyReturnValue:!0},cut:{earlyReturnValue:!0},paste:{earlyReturnValue:!0}},defaultPriority:Ae.High})],ah);function rB(e){const{handled:t,view:r,$pos:n,state:o}=e,i={getMark:J4,markRanges:[],view:r,state:o};if(t)return i;for(const{type:s}of n.marksAcross(n)??[]){const a=_o(n,s);a&&i.markRanges.push(a)}return i.getMark=s=>{const a=ne(s)?o.schema.marks[s]:s;return te(a,{code:H.EXTENSION,message:`The mark ${s} being checked does not exist within the editor schema.`}),i.markRanges.find(l=>l.mark.type===a)},i}class gt extends be{constructor(t){super(t,t)}map(t,r){let n=t.resolve(r.map(this.head));return gt.valid(n)?new gt(n):be.near(n)}content(){return K.empty}eq(t){return t instanceof gt&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new gt(t.resolve(r.pos))}getBookmark(){return new Uy(this.anchor)}static valid(t){let r=t.parent;if(r.isTextblock||!nB(t)||!oB(t))return!1;let n=r.type.spec.allowGapCursor;if(n!=null)return n;let o=r.contentMatchAt(t.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(t,r,n=!1){e:for(;;){if(!n&>.valid(t))return t;let o=t.pos,i=null;for(let s=t.depth;;s--){let a=t.node(s);if(r>0?t.indexAfter(s)0){i=a.child(r>0?t.indexAfter(s):t.index(s)-1);break}else if(s==0)return null;o+=r;let l=t.doc.resolve(o);if(gt.valid(l))return l}for(;;){let s=r>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!ce.isSelectable(i)){t=t.doc.resolve(o+i.nodeSize*r),n=!1;continue e}break}i=s,o+=r;let a=t.doc.resolve(o);if(gt.valid(a))return a}return null}}}gt.prototype.visible=!1;gt.findFrom=gt.findGapCursorFrom;be.jsonID("gapcursor",gt);class Uy{constructor(t){this.pos=t}map(t){return new Uy(t.map(this.pos))}resolve(t){let r=t.resolve(this.pos);return gt.valid(r)?new gt(r):be.near(r)}}function nB(e){for(let t=e.depth;t>=0;t--){let r=e.index(t),n=e.node(t);if(r==0){if(n.type.spec.isolating)return!0;continue}for(let o=n.child(r-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function oB(e){for(let t=e.depth;t>=0;t--){let r=e.indexAfter(t),n=e.node(t);if(r==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let o=n.child(r);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function iB(){return new Ro({props:{decorations:cB,createSelectionBetween(e,t,r){return t.pos==r.pos&>.valid(r)?new gt(r):null},handleClick:aB,handleKeyDown:sB,handleDOMEvents:{beforeinput:lB}}})}const sB=Jv({ArrowLeft:Sf("horiz",-1),ArrowRight:Sf("horiz",1),ArrowUp:Sf("vert",-1),ArrowDown:Sf("vert",1)});function Sf(e,t){const r=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(n,o,i){let s=n.selection,a=t>0?s.$to:s.$from,l=s.empty;if(s instanceof le){if(!i.endOfTextblock(r)||a.depth==0)return!1;l=!1,a=n.doc.resolve(t>0?a.after():a.before())}let c=gt.findGapCursorFrom(a,t,l);return c?(o&&o(n.tr.setSelection(new gt(c))),!0):!1}}function aB(e,t,r){if(!e||!e.editable)return!1;let n=e.state.doc.resolve(t);if(!gt.valid(n))return!1;let o=e.posAtCoords({left:r.clientX,top:r.clientY});return o&&o.inside>-1&&ce.isSelectable(e.state.doc.nodeAt(o.inside))?!1:(e.dispatch(e.state.tr.setSelection(new gt(n))),!0)}function lB(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof gt))return!1;let{$from:r}=e.state.selection,n=r.parent.contentMatchAt(r.index()).findWrapping(e.state.schema.nodes.text);if(!n)return!1;let o=R.empty;for(let s=n.length-1;s>=0;s--)o=R.from(n[s].createAndFill(null,o));let i=e.state.tr.replace(r.pos,r.pos,new K(o,0,0));return i.setSelection(le.near(i.doc.resolve(r.pos+1))),e.dispatch(i),!1}function cB(e){if(!(e.selection instanceof gt))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Ee.create(e.doc,[Ge.widget(e.selection.head,t,{key:"gapcursor"})])}var uB=Object.defineProperty,dB=Object.getOwnPropertyDescriptor,fB=(e,t,r,n)=>{for(var o=n>1?void 0:n?dB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&uB(t,r,o),o},U0=class extends Ve{get name(){return"gapCursor"}createExternalPlugins(){return[iB()]}};U0=fB([pe({})],U0);var lh=200,Bt=function(){};Bt.prototype.append=function(t){return t.length?(t=Bt.from(t),!this.length&&t||t.length=r?Bt.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,r))};Bt.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Bt.prototype.forEach=function(t,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length),r<=n?this.forEachInner(t,r,n,0):this.forEachInvertedInner(t,r,n,0)};Bt.prototype.map=function(t,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length);var o=[];return this.forEach(function(i,s){return o.push(t(i,s))},r,n),o};Bt.from=function(t){return t instanceof Bt?t:t&&t.length?new vT(t):Bt.empty};var vT=function(e){function t(n){e.call(this),this.values=n}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new t(this.values.slice(o,i))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,i,s,a){for(var l=i;l=s;l--)if(o(this.values[l],a+l)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=lh)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=lh)return new t(o.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(t.prototype,r),t}(Bt);Bt.empty=new vT([]);var pB=function(e){function t(r,n){e.call(this),this.left=r,this.right=n,this.length=r.length+n.length,this.depth=Math.max(r.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(n){return na&&this.right.forEachInner(n,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(n,o,i,s){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(n,o-a,Math.max(i,a)-a,s+a)===!1||i=i?this.right.slice(n-i,o-i):this.left.slice(n,i).append(this.right.slice(0,o-i))},t.prototype.leafAppend=function(n){var o=this.right.leafAppend(n);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(n){var o=this.left.leafPrepend(n);if(o)return new t(o,this.right)},t.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new t(this.left,new t(this.right,n)):new t(this,n)},t}(Bt);const hB=500;class Zn{constructor(t,r){this.items=t,this.eventCount=r}popEvent(t,r){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let o,i;r&&(o=this.remapping(n,this.items.length),i=o.maps.length);let s=t.tr,a,l,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(n,f+1),i=o.maps.length),i--,u.push(d);return}if(o){u.push(new mo(d.map));let p=d.step.map(o.slice(i)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new mo(h,void 0,void 0,c.length+u.length))),i--,h&&o.appendMap(h,i)}else s.maybeStep(d.step);if(d.selection)return a=o?d.selection.map(o.slice(i)):d.selection,l=new Zn(this.items.slice(0,n).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(t,r,n,o){let i=[],s=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let u=0;ugB&&(a=mB(a,c),s-=c),new Zn(a.append(i),s)}remapping(t,r){let n=new ul;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=t?n.maps.length-o.mirrorOffset:void 0;n.appendMap(o.map,s)},t,r),n}addMaps(t){return this.eventCount==0?this:new Zn(this.items.append(t.map(r=>new mo(r))),this.eventCount)}rebased(t,r){if(!this.eventCount)return this;let n=[],o=Math.max(0,this.items.length-r),i=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},o);let l=r;this.items.forEach(f=>{let p=i.getMirror(--l);if(p==null)return;s=Math.min(s,p);let h=i.maps[p];if(f.step){let m=t.steps[p].invert(t.docs[p]),b=f.selection&&f.selection.map(i.slice(l+1,p));b&&a++,n.push(new mo(h,m,b))}else n.push(new mo(h))},o);let c=[];for(let f=r;fhB&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let t=0;return this.items.forEach(r=>{r.step||t++}),t}compress(t=this.items.length){let r=this.remapping(0,t),n=r.maps.length,o=[],i=0;return this.items.forEach((s,a)=>{if(a>=t)o.push(s),s.selection&&i++;else if(s.step){let l=s.step.map(r.slice(n)),c=l&&l.getMap();if(n--,c&&r.appendMap(c,n),l){let u=s.selection&&s.selection.map(r.slice(n));u&&i++;let d=new mo(c.invert(),l,u),f,p=o.length-1;(f=o.length&&o[p].merge(d))?o[p]=f:o.push(d)}}else s.map&&n--},this.items.length,0),new Zn(Bt.from(o.reverse()),i)}}Zn.empty=new Zn(Bt.empty,0);function mB(e,t){let r;return e.forEach((n,o)=>{if(n.selection&&t--==0)return r=o,!1}),e.slice(r)}class mo{constructor(t,r,n,o){this.map=t,this.step=r,this.selection=n,this.mirrorOffset=o}merge(t){if(this.step&&t.step&&!t.selection){let r=t.step.merge(this.step);if(r)return new mo(r.getMap().invert(),r,this.selection)}}}class Ai{constructor(t,r,n,o,i){this.done=t,this.undone=r,this.prevRanges=n,this.prevTime=o,this.prevComposition=i}}const gB=20;function vB(e,t,r,n){let o=r.getMeta(So),i;if(o)return o.historyState;r.getMeta(bB)&&(e=new Ai(e.done,e.undone,null,0,-1));let s=r.getMeta("appendedTransaction");if(r.steps.length==0)return e;if(s&&s.getMeta(So))return s.getMeta(So).redo?new Ai(e.done.addTransform(r,void 0,n,op(t)),e.undone,Ow(r.mapping.maps[r.steps.length-1]),e.prevTime,e.prevComposition):new Ai(e.done,e.undone.addTransform(r,void 0,n,op(t)),null,e.prevTime,e.prevComposition);if(r.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=r.getMeta("composition"),l=e.prevTime==0||!s&&e.prevComposition!=a&&(e.prevTime<(r.time||0)-n.newGroupDelay||!yB(r,e.prevRanges)),c=s?Jg(e.prevRanges,r.mapping):Ow(r.mapping.maps[r.steps.length-1]);return new Ai(e.done.addTransform(r,l?t.selection.getBookmark():void 0,n,op(t)),Zn.empty,c,r.time,a??e.prevComposition)}else return(i=r.getMeta("rebased"))?new Ai(e.done.rebased(r,i),e.undone.rebased(r,i),Jg(e.prevRanges,r.mapping),e.prevTime,e.prevComposition):new Ai(e.done.addMaps(r.mapping.maps),e.undone.addMaps(r.mapping.maps),Jg(e.prevRanges,r.mapping),e.prevTime,e.prevComposition)}function yB(e,t){if(!t)return!1;if(!e.docChanged)return!0;let r=!1;return e.mapping.maps[0].forEach((n,o)=>{for(let i=0;i=t[i]&&(r=!0)}),r}function Ow(e){let t=[];return e.forEach((r,n,o,i)=>t.push(o,i)),t}function Jg(e,t){if(!e)return null;let r=[];for(let n=0;n{let r=So.getState(e);return!r||r.done.eventCount==0?!1:(t&&yT(r,e,t,!1),!0)},Zc=(e,t)=>{let r=So.getState(e);return!r||r.undone.eventCount==0?!1:(t&&yT(r,e,t,!0),!0)};function W0(e){let t=So.getState(e);return t?t.done.eventCount:0}function kB(e){let t=So.getState(e);return t?t.undone.eventCount:0}var wB=Object.defineProperty,SB=Object.getOwnPropertyDescriptor,Ca=(e,t,r,n)=>{for(var o=n>1?void 0:n?SB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&wB(t,r,o),o},Ao=class extends Ve{constructor(){super(...arguments),this.wrapMethod=(e,t)=>({state:r,dispatch:n,view:o})=>{const{getState:i,getDispatch:s}=this.options,a=_e(i)?i():r,l=_e(s)&&n?s():n,c=e(a,l,o);return t==null||t(c),c}}get name(){return"history"}createKeymap(){return{"Mod-y":on.isMac?()=>!1:this.wrapMethod(Zc,this.options.onRedo),"Mod-z":this.wrapMethod(ip,this.options.onUndo),"Shift-Mod-z":this.wrapMethod(Zc,this.options.onRedo)}}undoShortcut(e){return this.wrapMethod(ip,this.options.onUndo)(e)}redoShortcut(e){return this.wrapMethod(Zc,this.options.onRedo)(e)}createExternalPlugins(){const{depth:e,newGroupDelay:t}=this.options;return[xB({depth:e,newGroupDelay:t})]}undo(){return a2(this.wrapMethod(ip,this.options.onUndo))}redo(){return a2(this.wrapMethod(Zc,this.options.onRedo))}undoDepth(e=this.store.getState()){return W0(e)}redoDepth(e=this.store.getState()){return kB(e)}};Ca([je({shortcut:D.Undo,command:"undo"})],Ao.prototype,"undoShortcut",1);Ca([je({shortcut:D.Redo,command:"redo"})],Ao.prototype,"redoShortcut",1);Ca([U({disableChaining:!0,description:({t:e})=>e(Ep.UNDO_DESCRIPTION),label:({t:e})=>e(Ep.UNDO_LABEL),icon:"arrowGoBackFill"})],Ao.prototype,"undo",1);Ca([U({disableChaining:!0,description:({t:e})=>e(Ep.REDO_DESCRIPTION),label:({t:e})=>e(Ep.REDO_LABEL),icon:"arrowGoForwardFill"})],Ao.prototype,"redo",1);Ca([He()],Ao.prototype,"undoDepth",1);Ca([He()],Ao.prototype,"redoDepth",1);Ao=Ca([pe({defaultOptions:{depth:100,newGroupDelay:500,getDispatch:void 0,getState:void 0},staticKeys:["depth","newGroupDelay"],handlerKeys:["onUndo","onRedo"]})],Ao);var EB=Object.defineProperty,CB=Object.getOwnPropertyDescriptor,cm=(e,t,r,n)=>{for(var o=n>1?void 0:n?CB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&EB(t,r,o),o},MB={icon:"paragraph",label:({t:e})=>e(Cp.INSERT_LABEL),description:({t:e})=>e(Cp.INSERT_DESCRIPTION)},TB={icon:"paragraph",label:({t:e})=>e(Cp.CONVERT_LABEL),description:({t:e})=>e(Cp.CONVERT_DESCRIPTION)},fa=class extends er{get name(){return"paragraph"}createTags(){return[oe.LastNodeCompatible,oe.TextBlock,oe.Block,oe.FormattingNode]}createNodeSpec(e,t){return{content:"inline*",draggable:!1,...t,attrs:{...e.defaults()},parseDOM:[{tag:"p",getAttrs:r=>({...e.parse(r)})},...t.parseDOM??[]],toDOM:r=>["p",e.dom(r),0]}}convertParagraph(e={}){const{attrs:t,selection:r,preserveAttrs:n}=e;return this.store.commands.setBlockNodeType.original(this.type,t,r,n)}insertParagraph(e,t={}){const{selection:r,attrs:n}=t;return this.store.commands.insertNode.original(this.type,{content:e,selection:r,attrs:n})}shortcut(e){return this.convertParagraph()(e)}};cm([U(TB)],fa.prototype,"convertParagraph",1);cm([U(MB)],fa.prototype,"insertParagraph",1);cm([je({shortcut:D.Paragraph,command:"convertParagraph"})],fa.prototype,"shortcut",1);fa=cm([pe({defaultPriority:Ae.Medium})],fa);function Jo(e,t,r){return Math.min(Math.max(e,r),t)}class OB extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var eu=OB;function Wy(e){if(typeof e!="string")throw new eu(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=IB.test(e)?NB(e):e;const r=RB.exec(t);if(r){const s=Array.from(r).slice(1);return[...s.slice(0,3).map(a=>parseInt(cd(a,2),16)),parseInt(cd(s[3]||"f",2),16)/255]}const n=PB.exec(t);if(n){const s=Array.from(n).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,16)),parseInt(s[3]||"ff",16)/255]}const o=zB.exec(t);if(o){const s=Array.from(o).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,10)),parseFloat(s[3]||"1")]}const i=LB.exec(t);if(i){const[s,a,l,c]=Array.from(i).slice(1).map(parseFloat);if(Jo(0,100,a)!==a)throw new eu(e);if(Jo(0,100,l)!==l)throw new eu(e);return[...DB(s,a,l),Number.isNaN(c)?1:c]}throw new eu(e)}function _B(e){let t=5381,r=e.length;for(;r;)t=t*33^e.charCodeAt(--r);return(t>>>0)%2341}const Aw=e=>parseInt(e.replace(/_/g,""),36),AB="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const r=Aw(t.substring(0,3)),n=Aw(t.substring(3)).toString(16);let o="";for(let i=0;i<6-n.length;i++)o+="0";return e[r]=`${o}${n}`,e},{});function NB(e){const t=e.toLowerCase().trim(),r=AB[_B(t)];if(!r)throw new eu(e);return`#${r}`}const cd=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),RB=new RegExp(`^#${cd("([a-f0-9])",3)}([a-f0-9])?$`,"i"),PB=new RegExp(`^#${cd("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),zB=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${cd(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),LB=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,IB=/^[a-z]+$/i,Nw=e=>Math.round(e*255),DB=(e,t,r)=>{let n=r/100;if(t===0)return[n,n,n].map(Nw);const o=(e%360+360)%360/60,i=(1-Math.abs(2*n-1))*(t/100),s=i*(1-Math.abs(o%2-1));let a=0,l=0,c=0;o>=0&&o<1?(a=i,l=s):o>=1&&o<2?(a=s,l=i):o>=2&&o<3?(l=i,c=s):o>=3&&o<4?(l=s,c=i):o>=4&&o<5?(a=s,c=i):o>=5&&o<6&&(a=i,c=s);const u=n-i/2,d=a+u,f=l+u,p=c+u;return[d,f,p].map(Nw)};function $B(e){const[t,r,n,o]=Wy(e).map((d,f)=>f===3?d:d/255),i=Math.max(t,r,n),s=Math.min(t,r,n),a=(i+s)/2;if(i===s)return[0,0,a,o];const l=i-s,c=a>.5?l/(2-i-s):l/(i+s);return[60*(t===i?(r-n)/l+(r.179}function kl(e){return VB(e)?"#000":"#fff"}const jB="remirror-editor-wrapper",UB="remirror-button-active",WB="remirror-button",KB="remirror-composite",qB="remirror-dialog",GB="remirror-dialog-backdrop",YB="remirror-form",JB="remirror-form-message",XB="remirror-form-label",QB="remirror-form-group",ZB="remirror-group",eF="remirror-input",tF="remirror-menu",rF="remirror-menu-pane",nF="remirror-menu-pane-active",oF="remirror-menu-dropdown-label",iF="remirror-menu-pane-icon",sF="remirror-menu-pane-label",aF="remirror-menu-pane-shortcut",lF="remirror-menu-button-left",cF="remirror-menu-button-right",uF="remirror-menu-button-nested-left",dF="remirror-menu-button-nested-right",fF="remirror-menu-button",pF="remirror-menu-bar",hF="remirror-flex-column",mF="remirror-flex-row",gF="remirror-menu-item",vF="remirror-menu-item-row",yF="remirror-menu-item-column",bF="remirror-menu-item-checkbox",xF="remirror-menu-item-radio",kF="remirror-menu-group",wF="remirror-floating-popover",SF="remirror-popover",EF="remirror-animated-popover",CF="remirror-role",MF="remirror-separator",TF="remirror-tab",OF="remirror-tab-list",_F="remirror-tabbable",AF="remirror-toolbar",NF="remirror-tooltip",RF="remirror-table-size-editor",PF="remirror-table-size-editor-body",zF="remirror-table-size-editor-cell",LF="remirror-table-size-editor-cell-selected",IF="remirror-table-size-editor-footer",DF="remirror-color-picker",$F="remirror-color-picker-cell",HF="remirror-color-picker-cell-selected";var BF=Object.freeze({__proto__:null,ANIMATED_POPOVER:EF,BUTTON:WB,BUTTON_ACTIVE:UB,COLOR_PICKER:DF,COLOR_PICKER_CELL:$F,COLOR_PICKER_CELL_SELECTED:HF,COMPOSITE:KB,DIALOG:qB,DIALOG_BACKDROP:GB,EDITOR_WRAPPER:jB,FLEX_COLUMN:hF,FLEX_ROW:mF,FLOATING_POPOVER:wF,FORM:YB,FORM_GROUP:QB,FORM_LABEL:XB,FORM_MESSAGE:JB,GROUP:ZB,INPUT:eF,MENU:tF,MENU_BAR:pF,MENU_BUTTON:fF,MENU_BUTTON_LEFT:lF,MENU_BUTTON_NESTED_LEFT:uF,MENU_BUTTON_NESTED_RIGHT:dF,MENU_BUTTON_RIGHT:cF,MENU_DROPDOWN_LABEL:oF,MENU_GROUP:kF,MENU_ITEM:gF,MENU_ITEM_CHECKBOX:bF,MENU_ITEM_COLUMN:yF,MENU_ITEM_RADIO:xF,MENU_ITEM_ROW:vF,MENU_PANE:rF,MENU_PANE_ACTIVE:nF,MENU_PANE_ICON:iF,MENU_PANE_LABEL:sF,MENU_PANE_SHORTCUT:aF,POPOVER:SF,ROLE:CF,SEPARATOR:MF,TAB:TF,TABBABLE:_F,TABLE_SIZE_EDITOR:RF,TABLE_SIZE_EDITOR_BODY:PF,TABLE_SIZE_EDITOR_CELL:zF,TABLE_SIZE_EDITOR_CELL_SELECTED:LF,TABLE_SIZE_EDITOR_FOOTER:IF,TAB_LIST:OF,TOOLBAR:AF,TOOLTIP:NF});const FF="remirror-wrap",VF="remirror-language-select-positioner",jF="remirror-language-select-width",UF="remirror-a11y-dark",WF="remirror-atom-dark",KF="remirror-base16-ateliersulphurpool-light",qF="remirror-cb",GF="remirror-darcula",YF="remirror-dracula",JF="remirror-duotone-dark",XF="remirror-duotone-earth",QF="remirror-duotone-forest",ZF="remirror-duotone-light",eV="remirror-duotone-sea",tV="remirror-duotone-space",rV="remirror-gh-colors",nV="remirror-hopscotch",oV="remirror-pojoaque",iV="remirror-vs",sV="remirror-xonokai";var aV=Object.freeze({__proto__:null,A11Y_DARK:UF,ATOM_DARK:WF,BASE16_ATELIERSULPHURPOOL_LIGHT:KF,CB:qF,DARCULA:GF,DRACULA:YF,DUOTONE_DARK:JF,DUOTONE_EARTH:XF,DUOTONE_FOREST:QF,DUOTONE_LIGHT:ZF,DUOTONE_SEA:eV,DUOTONE_SPACE:tV,GH_COLORS:rV,HOPSCOTCH:nV,LANGUAGE_SELECT_POSITIONER:VF,LANGUAGE_SELECT_WIDTH:jF,POJOAQUE:oV,VS:iV,WRAP:FF,XONOKAI:sV});const lV="remirror-image-loader";var cV=Object.freeze({__proto__:null,IMAGE_LOADER:lV});const uV="remirror-list-item-with-custom-mark",dV="remirror-ul-list-content",fV="remirror-editor",pV="remirror-list-item-marker-container",hV="remirror-list-item-checkbox",mV="remirror-collapsible-list-item-closed",gV="remirror-collapsible-list-item-button",vV="remirror-list-spine";var ls=Object.freeze({__proto__:null,COLLAPSIBLE_LIST_ITEM_BUTTON:gV,COLLAPSIBLE_LIST_ITEM_CLOSED:mV,EDITOR:fV,LIST_ITEM_CHECKBOX:hV,LIST_ITEM_MARKER_CONTAINER:pV,LIST_ITEM_WITH_CUSTOM_MARKER:uV,LIST_SPINE:vV,UL_LIST_CONTENT:dV});const yV="remirror-is-empty";var bV=Object.freeze({__proto__:null,IS_EMPTY:yV});const xV="remirror-editor",kV="remirror-positioner",wV="remirror-positioner-widget";var SV=Object.freeze({__proto__:null,EDITOR:xV,POSITIONER:kV,POSITIONER_WIDGET:wV});const EV="remirror-theme";function CV(e={}){const t=[],r={};function n(o,i){if(typeof i=="string"||typeof i=="number"){t.push(`${Rw(o)}: ${i};`),r[Rw(o)]=i;return}if(!(typeof i!="object"||!i))for(const[s,a]of Object.entries(i))n([...o,s],a)}for(const[o,i]of Object.entries(e))n([o],i);return{css:t.join(` +`),styles:r}}function MV(e){return e.replace(/([a-z])([\dA-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function Rw(e){return`--rmr-${e.map(MV).join("-")}`}const qn={gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},Xo="#000000",Ky="#ffffff",TV="#252103",qy=ch(Xo,.75),um="#7963d2",Gy="#bcd263",OV="#fff",_V="#fff",Yy=qn.gray[1],Pw="rgba(10,31,68,0.08)",zw="rgba(10,31,68,0.10)",Lw="rgba(10,31,68,0.12)",AV=sp(ch(Xo,.1),.13),Jy={background:Ky,border:qy,foreground:Xo,muted:Yy,primary:um,secondary:Gy,primaryText:OV,secondaryText:_V,text:TV,faded:AV},NV={...Jy,background:rn(Ky,.15),border:rn(qy,.15),foreground:rn(Xo,.15),muted:rn(Yy,.15),primary:rn(um,.15),secondary:rn(Gy,.15),get text(){return kl(this.background)},get primaryText(){return kl(this.primary)},get secondaryText(){return kl(this.secondary)}},RV={...Jy,background:rn(Ky,.075),border:rn(qy,.075),foreground:rn(Xo,.075),muted:rn(Yy,.075),primary:rn(um,.075),secondary:rn(Gy,.075),get text(){return kl(this.background)},get primaryText(){return kl(this.primary)},get secondaryText(){return kl(this.secondary)}},Ss={color:{...Jy,active:NV,hover:RV,shadow1:Pw,shadow2:zw,shadow3:Lw,backdrop:ch(Xo,.1),outline:ch(um,.6),table:{default:{border:sp(Xo,.8),cell:sp(Xo,.4),controller:qn.gray[3]},selected:{border:qn.blue[7],cell:qn.blue[1],controller:qn.blue[5]},preselect:{border:qn.blue[7],cell:sp(Xo,.4),controller:qn.blue[5]},predelete:{border:qn.red[7],cell:qn.red[1],controller:qn.red[5]},mark:"#91919196"}},hue:qn,radius:{border:"0.25rem",extra:"0.5rem",circle:"50%"},fontFamily:{default:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif',heading:"inherit",mono:"Menlo, monospace"},fontSize:{0:"12px",1:"14px",2:"16px",3:"20px",4:"24px",5:"32px",6:"48px",7:"64px",8:"96px",default:"16px"},space:{1:"4px",2:"8px",3:"16px",4:"32px",5:"64px",6:"128px",7:"256px",8:"512px"},fontWeight:{bold:"700",default:"400",heading:"700"},letterSpacing:{tight:"-1px",default:"normal",loose:"1px",wide:"3px"},lineHeight:{heading:"1.25em",default:"1.5em"},boxShadow:{1:`0 1px 1px ${Pw}`,2:`0 1px 1px ${zw}`,3:`0 1px 1px ${Lw}`}};var PV=Object.defineProperty,zV=Object.getOwnPropertyDescriptor,Xy=(e,t,r,n)=>{for(var o=n>1?void 0:n?zV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&PV(t,r,o),o},bT=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},Tt=(e,t,r)=>(bT(e,t,"read from private field"),r?r.call(e):t.get(e)),Do=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},yi=(e,t,r,n)=>(bT(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),tu,ru,qa,nu,ap,ou,iu,su,au,lp=class{constructor(e){Do(this,tu,jh()),Do(this,ru,[]),Do(this,qa,new Map),Do(this,nu,[]),Do(this,ap,!1),Do(this,ou,void 0),Do(this,iu,void 0),Do(this,su,void 0),Do(this,au,void 0),this.addListener=(t,r)=>Tt(this,tu).on(t,r),yi(this,ou,e),yi(this,iu,e.getActive),yi(this,au,e.getPosition),yi(this,su,e.getID),this.hasChanged=e.hasChanged,this.events=e.events??["state","scroll"]}static create(e){return new lp(e)}static fromPositioner(e,t){return lp.create({...e.basePositioner,...t})}get basePositioner(){return{getActive:Tt(this,iu),getPosition:Tt(this,au),hasChanged:this.hasChanged,events:this.events,getID:Tt(this,su)}}onActiveChanged(e){this.recentUpdate=e;const t=Tt(this,iu).call(this,e);yi(this,ru,t),yi(this,qa,new Map),yi(this,ap,!1),yi(this,nu,[]);const r=[];for(const[n,o]of t.entries()){const i=this.getID(o,n);Tt(this,nu).push(i),r.push({setElement:s=>this.addProps({...e,data:o,element:s},n),id:i,data:o})}Tt(this,tu).emit("update",r)}getID(e,t){var r;return((r=Tt(this,su))==null?void 0:r.call(this,e,t))??t.toString()}addProps(e,t){if(Tt(this,ap)||(Tt(this,qa).set(t,e),Tt(this,qa).sizee;return this.clone(r=>({getActive:n=>r.getActive(n).filter(t)}))}},no=lp;tu=new WeakMap;ru=new WeakMap;qa=new WeakMap;nu=new WeakMap;ap=new WeakMap;ou=new WeakMap;iu=new WeakMap;su=new WeakMap;au=new WeakMap;no.EMPTY=[];function LV(e,t=ST){const{key:r}=(e==null?void 0:e.getMeta(wT))??{};return r===t}function xT(e){const{tr:t,state:r,previousState:n}=e;return!n||t&&LV(t)?!0:t?iz(t):!r.doc.eq(n.doc)||!r.selection.eq(n.selection)}function kT(e,t,r={}){const n=t.getBoundingClientRect(),{accountForPadding:o=!1}=r;let i=0,s=0,a=0,l=0;if(Je(t)&&o){const u=Number.parseFloat(kn(t,"padding-left").replace("px","")),d=Number.parseFloat(kn(t,"padding-right").replace("px","")),f=Number.parseFloat(kn(t,"padding-top").replace("px","")),p=Number.parseFloat(kn(t,"padding-bottom").replace("px","")),h=Number.parseFloat(kn(t,"border-left").replace("px","")),m=Number.parseFloat(kn(t,"border-right").replace("px","")),b=Number.parseFloat(kn(t,"border-top").replace("px","")),v=Number.parseFloat(kn(t,"border-bottom").replace("px","")),g=t.offsetWidth-t.clientWidth,y=t.offsetHeight-t.clientHeight;i+=u+h+(t.dir==="rtl"?g:0),s+=d+m+(t.dir==="rtl"?0:g),a+=f+b,l+=p+v+y}const c=new DOMRect(n.left+i,n.top+a,n.width-s,n.height-l);for(const[u,d]of[[e.top,e.left],[e.top,e.right],[e.bottom,e.left],[e.bottom,e.right]])if(Zx(u,c.top,c.bottom)&&Zx(d,c.left,c.right))return!0;return!1}var IV="remirror-positioner-widget",wT="positionerUpdate",ST="__all_positioners__",ET={y:-999999,x:-999999,width:0,height:0},Iw={...ET,left:-999999,top:-999999,bottom:-999999,right:-999999},Qy={...ET,rect:{...Iw,toJSON:()=>Iw},visible:!1},CT=no.create({hasChanged:xT,getActive(e){const{state:t}=e;if(!jv(t)||t.selection.$anchor.depth>2)return no.EMPTY;const r=Ld({predicate:n=>n.type.isBlock,selection:t});return r?[r]:no.EMPTY},getPosition(e){const{view:t,data:r}=e,n=t.nodeDOM(r.pos);if(!Je(n))return Qy;const o=n.getBoundingClientRect(),i=t.dom.getBoundingClientRect(),s=o.height,a=o.width,l=t.dom.scrollLeft+o.left-i.left,c=t.dom.scrollTop+o.top-i.top,u=kT(o,t.dom);return{y:c,x:l,height:s,width:a,rect:o,visible:u}}}),Zy=CT.clone(({getActive:e})=>({getActive:t=>{const[r]=e(t);return r&&Bh(r.node)&&r.node.type===Hh(t.state.schema)?[r]:no.EMPTY}})),DV=Zy.clone(({getPosition:e})=>({getPosition:t=>({...e(t),width:1})})),$V=Zy.clone(({getPosition:e})=>({getPosition:t=>{const{width:r,x:n,y:o,height:i}=e(t);return{...e(t),width:1,x:r+n,rect:new DOMRect(r+n,o,1,i)}}}));function eb(e){return no.create({hasChanged:xT,getActive:t=>{const{state:r,view:n}=t;if(!e(r)||!gs(r.selection))return no.EMPTY;try{const{head:o,anchor:i}=r.selection;return[{from:n.coordsAtPos(i),to:n.coordsAtPos(o)}]}catch{return no.EMPTY}},getPosition(t){const{element:r,data:n,view:o}=t,{from:i,to:s}=n,a=r.offsetParent??o.dom,l=a.getBoundingClientRect(),c=Math.abs(s.bottom-i.top),u=c>i.bottom-i.top,d=Math.min(i.left,s.left),f=Math.min(i.top,s.top),p=a.scrollLeft+(u?s.left-l.left:d-l.left),h=a.scrollTop+f-l.top,m=u?1:Math.abs(i.left-s.right),b=new DOMRect(u?s.left:d,f,m,c),v=kT(b,o.dom);return{rect:b,y:h,x:p,height:c,width:m,visible:v}}})}var MT=eb(e=>!e.selection.empty),HV=eb(e=>e.selection.empty),BV=eb(()=>!0),FV=MT.clone(()=>({getActive:e=>{const{state:t,view:r}=e;if(!t.selection.empty)return no.EMPTY;const n=_C(t);if(!n)return no.EMPTY;try{return[{from:r.coordsAtPos(n.from),to:r.coordsAtPos(n.to)}]}catch{return no.EMPTY}}})),VV={selection:MT,cursor:HV,always:BV,block:CT,emptyBlock:Zy,emptyBlockStart:DV,emptyBlockEnd:$V,nearestWord:FV},Ul=class extends Ve{constructor(){super(...arguments),this.positioners=[],this.onAddCustomHandler=({positioner:e})=>{if(e)return this.positioners=[...this.positioners,e],this.store.commands.forceUpdate(),()=>{this.positioners=this.positioners.filter(t=>t!==e)}}}get name(){return"positioner"}createAttributes(){return{class:SV.EDITOR}}init(){this.onScroll=j4(this.options.scrollDebounce,this.onScroll.bind(this))}createEventHandlers(){return{scroll:()=>(this.onScroll(),!1),hover:(e,t)=>(this.positioner(this.getBaseProps("hover",{hover:t})),!1),contextmenu:(e,t)=>(this.positioner(this.getBaseProps("contextmenu",{contextmenu:t})),!1)}}onStateUpdate(e){this.positioner({...e,previousState:e.firstUpdate?void 0:e.previousState,event:"state",helpers:this.store.helpers})}createDecorations(e){if(this.element??(this.element=this.createElement()),!this.element.hasChildNodes())return Ee.empty;const t=Ge.widget(0,this.element,{key:"positioner-widget",side:-1,stopEvent:()=>!0});return Ee.create(e.doc,[t])}forceUpdatePositioners(e=ST){return({tr:t,dispatch:r})=>(r==null||r(t.setMeta(wT,{key:e})),!0)}getPositionerWidget(){return this.element??(this.element=this.createElement())}createElement(){const e=document.createElement("span");return e.dataset.id=IV,e.setAttribute("role","presentation"),e}triggerPositioner(e,t){e.hasChanged(t)&&e.onActiveChanged({...t,view:this.store.view})}positioner(e){for(const t of this.positioners)t.events.includes(e.event)&&this.triggerPositioner(t,e)}getBaseProps(e,t){const r=this.store.getState(),n=this.store.previousState;return{helpers:this.store.helpers,event:e,firstUpdate:!1,previousState:n,state:r,...t}}onScroll(){this.positioner(this.getBaseProps("scroll",{scroll:{scrollTop:this.store.view.dom.scrollTop}}))}};Xy([U()],Ul.prototype,"forceUpdatePositioners",1);Xy([He()],Ul.prototype,"getPositionerWidget",1);Ul=Xy([pe({defaultOptions:{scrollDebounce:100},customHandlerKeys:["positioner"],staticKeys:["scrollDebounce"]})],Ul);function K0(e){return ne(e)?VV[e].clone():_e(e)?e().clone():e.clone()}var jV=Object.defineProperty,UV=Object.getOwnPropertyDescriptor,WV=(e,t,r,n)=>{for(var o=n>1?void 0:n?UV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&jV(t,r,o),o},q0=class extends er{get name(){return"text"}createTags(){return[oe.InlineNode]}createNodeSpec(){return{}}};q0=WV([pe({disableExtraAttributes:!0,defaultPriority:Ae.Medium})],q0);var KV={...jl.defaultOptions,...fa.defaultOptions,...Ao.defaultOptions,excludeExtensions:[]};function qV(e={}){e={...KV,...e};const{content:t,depth:r,getDispatch:n,getState:o,newGroupDelay:i,excludeExtensions:s}=e,a={};for(const c of s??[])a[c]=!0;const l=[];if(!a.history){const c=new Ao({depth:r,getDispatch:n,getState:o,newGroupDelay:i});l.push(c)}return a.doc||l.push(new jl({content:t})),a.text||l.push(new q0),a.paragraph||l.push(new fa),a.positioner||l.push(new Ul),a.gapCursor||l.push(new U0),a.events||l.push(new ah),l}var GV=Object.defineProperty,YV=Object.getOwnPropertyDescriptor,JV=(e,t,r,n)=>{for(var o=n>1?void 0:n?YV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&GV(t,r,o),o},pa=class extends Ve{get name(){return"placeholder"}createAttributes(){return{"aria-placeholder":this.options.placeholder}}createPlugin(){return{state:{init:(e,t)=>({...this.options,empty:Kv(t.doc,{ignoreAttributes:!0})}),apply:(e,t,r,n)=>XV({pluginState:t,tr:e,extension:this,state:n})},props:{decorations:e=>QV({state:e,extension:this})}}}onSetOptions(e){const{changes:t}=e;t.placeholder.changed&&this.store.phase>=Nr.EditorView&&this.store.updateAttributes()}};pa=JV([pe({defaultOptions:{emptyNodeClass:bV.IS_EMPTY,placeholder:""}})],pa);function XV(e){const{pluginState:t,extension:r,tr:n,state:o}=e;return n.docChanged?{...r.options,empty:Kv(o.doc)}:t}function QV(e){const{extension:t,state:r}=e,{empty:n}=t.pluginKey.getState(r),{emptyNodeClass:o,placeholder:i}=t.options;if(!n)return null;const s=[];return r.doc.descendants((a,l)=>{const c=Ge.node(l,l+a.nodeSize,{class:o,"data-placeholder":i});s.push(c)}),Ee.create(r.doc,s)}var ZV=Object.defineProperty,ej=Object.getOwnPropertyDescriptor,tj=(e,t,r,n)=>{for(var o=n>1?void 0:n?ej(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&ZV(t,r,o),o},rj={...pa.defaultOptions,...ad.defaultOptions},nj=[...pa.staticKeys,...ad.staticKeys],ud=class extends Ve{get name(){return"react"}onSetOptions(e){const{pickChanged:t}=e;this.getExtension(pa).setOptions(t(["placeholder"]))}createExtensions(){const{emptyNodeClass:e,placeholder:t,defaultBlockNode:r,defaultContentNode:n,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s}=this.options;return[new pa({emptyNodeClass:e,placeholder:t,priority:Ae.Low}),new ad({defaultBlockNode:r,defaultContentNode:n,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s})]}};ud=tj([pe({defaultOptions:rj,staticKeys:nj})],ud);var TT={};Object.defineProperty(TT,"__esModule",{value:!0});function oj(){for(var e=[],t=0;t{if(!t.has(e))throw TypeError("Cannot "+r)},Qg=(e,t,r)=>(OT(e,t,"read from private field"),r?r.call(e):t.get(e)),ij=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},sj=(e,t,r,n)=>(OT(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);function aj(){const[,e]=S.useState(ee());return S.useCallback(()=>{e(ee())},[])}var _T=S.createContext(null);function di(e){const t=S.useContext(_T),r=S.useRef(aj());te(t,{code:H.REACT_PROVIDER_CONTEXT});const{addHandler:n}=t;return S.useEffect(()=>{let o=e;if(o){if(hs(o)){const{autoUpdate:i}=o;o=i?()=>r.current():void 0}if(_e(o))return n("updated",o)}},[n,e]),t}function qr(e=!0){return di({autoUpdate:e}).active}function lj(e=!1){return di(e?{autoUpdate:!0}:void 0).attrs}function cc(){return di().chain.new()}function tr(){return di().commands}function tb(){return di({autoUpdate:!0}).getState().selection}function Wd(e,t=void 0,r){const{getExtension:n}=di(),o=S.useMemo(()=>n(e),[e,n]);let i;if(_e(t)?i=r?[o,...r]:[o,t]:i=t?[o,...Object.values(t)]:[],S.useEffect(()=>{_e(t)||!t||o.setOptions(t)},i),S.useEffect(()=>{if(_e(t))return t({addHandler:o.addHandler.bind(o),addCustomHandler:o.addCustomHandler.bind(o),extension:o})},i),!t)return o}function cj(e,t,r){const n=S.useCallback(({addHandler:o})=>o(t,r),[r,t]);return Wd(e,n)}function dm(e=!1){return di(e?{autoUpdate:!0}:void 0).helpers}var[uj,dj]=L9(({props:e})=>{const t=e.locale??"en",r=e.i18n??lm,n=e.supportedLocales??[t],o=r._.bind(r);return{locale:t,i18n:r,supportedLocales:n,t:o}});function Bw(e,t={}){const{core:r,react:n,...o}=t;return gI(e)?e:mI.create(()=>[...eE(e),new ud(n),...qV(r)],o)}function fj(e,t={}){const r=S.useRef(e),n=S.useRef(t),[o,i]=S.useState(()=>Bw(e,t));return r.current=e,n.current=t,S.useEffect(()=>o.addHandler("destroy",()=>{i(()=>Bw(r.current,n.current))}),[o]),o}var pj=typeof xr=="object"&&xr.__esModule&&xr.default?xr.default:xr,Ga,hj=class extends uI{constructor(e){if(super(e),ij(this,Ga,void 0),this.rootPropsConfig={called:!1,count:0},this.getRootProps=t=>this.internalGetRootProps(t,null),this.internalGetRootProps=(t,r)=>{this.rootPropsConfig.called=!0;const{refKey:n="ref",ref:o,...i}=t??ee();return{[n]:pj(o,this.onRef),key:this.uid,...i,children:r}},this.onRef=t=>{t&&(this.rootPropsConfig.count+=1,te(this.rootPropsConfig.count<=1,{code:H.REACT_GET_ROOT_PROPS,message:`Called ${this.rootPropsConfig.count} times`}),sj(this,Ga,t),this.onRefLoad())},this.manager.view){this.manager.view.setProps({state:this.manager.view.state,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0});return}this.manager.getExtension(pa).setOptions({placeholder:this.props.placeholder??""})}get name(){return"react"}update(e){return super.update(e),this}createView(e){return new b6(null,{state:e,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0,plugins:[]})}updateState({state:e,...t}){const{triggerChange:r=!0,tr:n,transactions:o}=t;if(this.props.state){const{onChange:i}=this.props;te(i,{code:H.REACT_CONTROLLED,message:"You are required to provide the `onChange` handler when creating a controlled editor."}),te(r,{code:H.REACT_CONTROLLED,message:"Controlled editors do not support `clearContent` or `setContent` where `triggerChange` is `true`. Update the `state` prop instead."}),this.previousStateOverride||(this.previousStateOverride=this.getState()),this.onChange({state:e,tr:n,transactions:o});return}!n&&!o&&(e=e.apply(e.tr.setMeta(Gx,{}))),this.view.updateState(e),r&&(o==null?void 0:o.length)!==0&&this.onChange({state:e,tr:n,transactions:o}),this.manager.onStateUpdate({previousState:this.previousState,state:e,tr:n,transactions:o})}updateControlledState(e,t){this.previousStateOverride=t,e=e.apply(e.tr.setMeta(Gx,{})),this.view.updateState(e),this.manager.onStateUpdate({previousState:this.previousState,state:e}),this.previousStateOverride=void 0}addProsemirrorViewToDom(e,t){this.props.insertPosition==="start"?e.insertBefore(t,e.firstChild):e.append(t)}onRefLoad(){te(Qg(this,Ga),{code:H.REACT_EDITOR_VIEW,message:"Something went wrong when initializing the text editor. Please check your setup."});const{autoFocus:e}=this.props;this.addProsemirrorViewToDom(Qg(this,Ga),this.view.dom),e&&this.focus(e),this.onChange(),this.addFocusListeners()}onUpdate(){this.view&&Qg(this,Ga)&&this.view.setProps({...this.view.props,editable:()=>this.props.editable??!0})}get frameworkOutput(){return{...this.baseOutput,getRootProps:this.getRootProps,portalContainer:this.manager.store.portalContainer}}resetRender(){this.rootPropsConfig.called=!1,this.rootPropsConfig.count=0}};Ga=new WeakMap;var AT=typeof document<"u"?S.useLayoutEffect:S.useEffect;function mj(e){const t=S.useRef();return AT(()=>{t.current=e}),t.current}function gj(e){const{manager:t,state:r}=e,{placeholder:n,editable:o}=e;S.useRef(!0).current&&!Zi(n)&&t.getExtension(ud).setOptions({placeholder:n}),S.useEffect(()=>{n!=null&&t.getExtension(ud).setOptions({placeholder:n})},[n,t]);const[s]=S.useState(()=>{if(r)return r;const l=t.createEmptyDoc(),[c,u]=ct(e.initialContent)?e.initialContent:[e.initialContent??l];return t.createState({content:c,selection:u})}),a=vj({initialEditorState:s,getProps:()=>e});return S.useEffect(()=>()=>{a.destroy()},[a]),S.useEffect(()=>{a.onUpdate()},[o,a]),yj(a),a.frameworkOutput}function vj(e){const t=S.useRef(e);t.current=e;const r=S.useMemo(()=>new hj(t.current),[]);return r.update(e),r}function yj(e){const{state:t}=e.props,r=S.useRef(!!t),n=mj(t);AT(()=>{const o=t?r.current===!0:r.current===!1;te(o,{code:H.REACT_CONTROLLED,message:r.current?"You have attempted to switch from a controlled to an uncontrolled editor. Once you set up an editor as a controlled editor it must always provide a `state` prop.":"You have provided a `state` prop to an uncontrolled editor. In order to set up your editor as controlled you must provide the `state` prop from the very first render."}),!(!t||t===n)&&e.updateControlledState(t,n??void 0)},[t,n,e])}function bj(e={}){const{content:t,document:r,selection:n,extensions:o,...i}=e,s=fj(o??(()=>[]),i),[a,l]=S.useState(()=>s.createState({selection:n,content:t??s.createEmptyDoc()})),c=S.useCallback(({state:d})=>{l(d)},[]),u=S.useCallback(()=>s.output,[s]);return S.useMemo(()=>({state:a,setState:l,manager:s,onChange:c,getContext:u}),[u,s,c,a])}var Fw={doc:!1,selection:!1,storedMark:!1};function xj(){const[e,t]=S.useState(Fw);return cj(zp,"applyState",S.useCallback(({tr:r})=>{const n={...Fw};r.docChanged&&(n.doc=!0),r.selectionSet&&(n.selection=!0),r.storedMarksSet&&(n.storedMark=!0),t(n)},[])),e}var G0=()=>L.createElement("div",{className:BF.EDITOR_WRAPPER,...di().getRootProps()}),kj=e=>(e.hook(),null);function wj(e){const{children:t,autoRender:r,i18n:n,locale:o,supportedLocales:i,hooks:s=[],...a}=e,l=gj(a),c=_9(l.portalContainer),u=r==="start"||r===!0||!t&&Zi(r),d=r==="end";return L.createElement(uj,{i18n:n,locale:o,supportedLocales:i},L.createElement(_T.Provider,{value:l},L.createElement(O9,{portals:c}),s.map((f,p)=>L.createElement(kj,{hook:f,key:p})),u&&L.createElement(G0,null),t,d&&L.createElement(G0,null)))}const Sj={black:"#000",white:"#fff"},dd=Sj,Ej={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},za=Ej,Cj={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},La=Cj,Mj={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Ia=Mj,Tj={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},Da=Tj,Oj={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},$a=Oj,_j={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},Tc=_j,Aj={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Nj=Aj;function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t{t[r]=NT(e[r])}),t}function un(e,t,r={clone:!0}){const n=r.clone?_({},e):e;return Wo(e)&&Wo(t)&&Object.keys(t).forEach(o=>{o!=="__proto__"&&(Wo(t[o])&&o in e&&Wo(e[o])?n[o]=un(e[o],t[o],r):r.clone?n[o]=Wo(t[o])?NT(t[o]):t[o]:n[o]=t[o])}),n}function Wl(e){let t="https://mui.com/production-error/?code="+e;for(let r=1;rr==null?t:function(...o){t.apply(this,o),r.apply(this,o)},()=>{})}function Tj(e,t=166){let r;function n(...o){const i=()=>{e.apply(this,o)};clearTimeout(r),r=setTimeout(i,t)}return n.clear=()=>{clearTimeout(r)},n}function Br(e){return e&&e.ownerDocument||document}function dd(e){return Br(e).defaultView||window}function K0(e,t){typeof e=="function"?e(t):e&&(e.current=t)}const Oj=typeof window<"u"?S.useLayoutEffect:S.useEffect,ha=Oj;let Bw=0;function _j(e){const[t,r]=S.useState(e),n=e||t;return S.useEffect(()=>{t==null&&(Bw+=1,r(`mui-${Bw}`))},[t]),n}const Fw=v1["useId".toString()];function Aj(e){if(Fw!==void 0){const t=Fw();return e??t}return _j(e)}function Nj({controlled:e,default:t,name:r,state:n="value"}){const{current:o}=S.useRef(e!==void 0),[i,s]=S.useState(t),a=o?e:i,l=S.useCallback(c=>{o||s(c)},[]);return[a,l]}function Ks(e){const t=S.useRef(e);return ha(()=>{t.current=e}),S.useCallback((...r)=>(0,t.current)(...r),[])}function Ur(...e){return S.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(r=>{K0(r,t)})},e)}let bm=!0,q0=!1,Vw;const Rj={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function Pj(e){const{type:t,tagName:r}=e;return!!(r==="INPUT"&&Rj[t]&&!e.readOnly||r==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function zj(e){e.metaKey||e.altKey||e.ctrlKey||(bm=!0)}function Jg(){bm=!1}function Lj(){this.visibilityState==="hidden"&&q0&&(bm=!0)}function Ij(e){e.addEventListener("keydown",zj,!0),e.addEventListener("mousedown",Jg,!0),e.addEventListener("pointerdown",Jg,!0),e.addEventListener("touchstart",Jg,!0),e.addEventListener("visibilitychange",Lj,!0)}function Dj(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return bm||Pj(t)}function _T(){const e=S.useCallback(o=>{o!=null&&Ij(o.ownerDocument)},[]),t=S.useRef(!1);function r(){return t.current?(q0=!0,window.clearTimeout(Vw),Vw=window.setTimeout(()=>{q0=!1},100),t.current=!1,!0):!1}function n(o){return Dj(o)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:n,onBlur:r,ref:e}}function AT(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}const $j=e=>{const t=S.useRef({});return S.useEffect(()=>{t.current=e}),t.current},NT=$j;function RT(e,t){const r=_({},t);return Object.keys(e).forEach(n=>{if(n.toString().match(/^(components|slots)$/))r[n]=_({},e[n],r[n]);else if(n.toString().match(/^(componentsProps|slotProps)$/)){const o=e[n]||{},i=t[n];r[n]={},!i||!Object.keys(i)?r[n]=o:!o||!Object.keys(o)?r[n]=i:(r[n]=_({},i),Object.keys(o).forEach(s=>{r[n][s]=RT(o[s],i[s])}))}else r[n]===void 0&&(r[n]=e[n])}),r}function tr(e,t,r=void 0){const n={};return Object.keys(e).forEach(o=>{n[o]=e[o].reduce((i,s)=>{if(s){const a=t(s);a!==""&&i.push(a),r&&r[s]&&i.push(r[s])}return i},[]).join(" ")}),n}const jw=e=>e,Hj=()=>{let e=jw;return{configure(t){e=t},generate(t){return e(t)},reset(){e=jw}}},Bj=Hj(),PT=Bj,Fj={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Vt(e,t,r="Mui"){const n=Fj[t];return n?`${r}-${n}`:`${PT.generate(e)}-${t}`}function jt(e,t,r="Mui"){const n={};return t.forEach(o=>{n[o]=Vt(e,o,r)}),n}const Kl="$$material";function ve(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i=0)&&(r[o]=e[o]);return r}function zT(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Vj=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,jj=zT(function(e){return Vj.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91});function Uj(e){if(e.sheet)return e.sheet;for(var t=0;t0?Gt(cc,--Wr):0,ql--,wt===10&&(ql=1,km--),wt}function un(){return wt=Wr<$T?Gt(cc,Wr++):0,ql++,wt===10&&(ql=1,km++),wt}function Eo(){return Gt(cc,Wr)}function ap(){return Wr}function Ud(e,t){return fd(cc,e,t)}function pd(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function HT(e){return km=ql=1,$T=go(cc=e),Wr=0,[]}function BT(e){return cc="",e}function lp(e){return DT(Ud(Wr-1,Y0(e===91?e+2:e===40?e+1:e)))}function rU(e){for(;(wt=Eo())&&wt<33;)un();return pd(e)>2||pd(wt)>3?"":" "}function nU(e,t){for(;--t&&un()&&!(wt<48||wt>102||wt>57&&wt<65||wt>70&&wt<97););return Ud(e,ap()+(t<6&&Eo()==32&&un()==32))}function Y0(e){for(;un();)switch(wt){case e:return Wr;case 34:case 39:e!==34&&e!==39&&Y0(wt);break;case 40:e===41&&Y0(e);break;case 92:un();break}return Wr}function oU(e,t){for(;un()&&e+wt!==47+10;)if(e+wt===42+42&&Eo()===47)break;return"/*"+Ud(t,Wr-1)+"*"+xm(e===47?e:un())}function iU(e){for(;!pd(Eo());)un();return Ud(e,Wr)}function sU(e){return BT(cp("",null,null,null,[""],e=HT(e),0,[0],e))}function cp(e,t,r,n,o,i,s,a,l){for(var c=0,u=0,d=s,f=0,p=0,h=0,m=1,b=1,v=1,g=0,y="",x=o,k=i,w=n,E=y;b;)switch(h=g,g=un()){case 40:if(h!=108&&Gt(E,d-1)==58){G0(E+=Pe(lp(g),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:E+=lp(g);break;case 9:case 10:case 13:case 32:E+=rU(h);break;case 92:E+=nU(ap()-1,7);continue;case 47:switch(Eo()){case 42:case 47:wf(aU(oU(un(),ap()),t,r),l);break;default:E+="/"}break;case 123*m:a[c++]=go(E)*v;case 125*m:case 59:case 0:switch(g){case 0:case 125:b=0;case 59+u:v==-1&&(E=Pe(E,/\f/g,"")),p>0&&go(E)-d&&wf(p>32?Ww(E+";",n,r,d-1):Ww(Pe(E," ","")+";",n,r,d-2),l);break;case 59:E+=";";default:if(wf(w=Uw(E,t,r,c,u,o,a,y,x=[],k=[],d),i),g===123)if(u===0)cp(E,t,w,w,x,i,d,a,k);else switch(f===99&&Gt(E,3)===110?100:f){case 100:case 108:case 109:case 115:cp(e,w,w,n&&wf(Uw(e,w,w,0,0,o,a,y,o,x=[],d),k),o,k,d,a,n?x:k);break;default:cp(E,w,w,w,[""],k,0,a,k)}}c=u=p=0,m=v=1,y=E="",d=s;break;case 58:d=1+go(E),p=h;default:if(m<1){if(g==123)--m;else if(g==125&&m++==0&&tU()==125)continue}switch(E+=xm(g),g*m){case 38:v=u>0?1:(E+="\f",-1);break;case 44:a[c++]=(go(E)-1)*v,v=1;break;case 64:Eo()===45&&(E+=lp(un())),f=Eo(),u=d=go(y=E+=iU(ap())),g++;break;case 45:h===45&&go(E)==2&&(m=0)}}return i}function Uw(e,t,r,n,o,i,s,a,l,c,u){for(var d=o-1,f=o===0?i:[""],p=ob(f),h=0,m=0,b=0;h0?f[v]+" "+g:Pe(g,/&\f/g,f[v])))&&(l[b++]=y);return wm(e,t,r,o===0?rb:a,l,c,u)}function aU(e,t,r){return wm(e,t,r,LT,xm(eU()),fd(e,2,-2),0)}function Ww(e,t,r,n){return wm(e,t,r,nb,fd(e,0,n),fd(e,n+1,-1),n)}function wl(e,t){for(var r="",n=ob(e),o=0;o6)switch(Gt(e,t+1)){case 109:if(Gt(e,t+4)!==45)break;case 102:return Pe(e,/(.+:)(.+)-([^]+)/,"$1"+Re+"$2-$3$1"+lh+(Gt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~G0(e,"stretch")?FT(Pe(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Gt(e,t+1)!==115)break;case 6444:switch(Gt(e,go(e)-3-(~G0(e,"!important")&&10))){case 107:return Pe(e,":",":"+Re)+e;case 101:return Pe(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Re+(Gt(e,14)===45?"inline-":"")+"box$3$1"+Re+"$2$3$1"+ir+"$2box$3")+e}break;case 5936:switch(Gt(e,t+11)){case 114:return Re+e+ir+Pe(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Re+e+ir+Pe(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Re+e+ir+Pe(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Re+e+ir+e+e}return e}var gU=function(t,r,n,o){if(t.length>-1&&!t.return)switch(t.type){case nb:t.return=FT(t.value,t.length);break;case IT:return wl([Tc(t,{value:Pe(t.value,"@","@"+Re)})],o);case rb:if(t.length)return Zj(t.props,function(i){switch(Qj(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return wl([Tc(t,{props:[Pe(i,/:(read-\w+)/,":"+lh+"$1")]})],o);case"::placeholder":return wl([Tc(t,{props:[Pe(i,/:(plac\w+)/,":"+Re+"input-$1")]}),Tc(t,{props:[Pe(i,/:(plac\w+)/,":"+lh+"$1")]}),Tc(t,{props:[Pe(i,/:(plac\w+)/,ir+"input-$1")]})],o)}return""})}},vU=[gU],yU=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(m){var b=m.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var o=t.stylisPlugins||vU,i={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(m){for(var b=m.getAttribute("data-emotion").split(" "),v=1;vr==null?t:function(...o){t.apply(this,o),r.apply(this,o)},()=>{})}function zj(e,t=166){let r;function n(...o){const i=()=>{e.apply(this,o)};clearTimeout(r),r=setTimeout(i,t)}return n.clear=()=>{clearTimeout(r)},n}function Br(e){return e&&e.ownerDocument||document}function fd(e){return Br(e).defaultView||window}function Y0(e,t){typeof e=="function"?e(t):e&&(e.current=t)}const Lj=typeof window<"u"?S.useLayoutEffect:S.useEffect,ha=Lj;let jw=0;function Ij(e){const[t,r]=S.useState(e),n=e||t;return S.useEffect(()=>{t==null&&(jw+=1,r(`mui-${jw}`))},[t]),n}const Uw=x1["useId".toString()];function Dj(e){if(Uw!==void 0){const t=Uw();return e??t}return Ij(e)}function $j({controlled:e,default:t,name:r,state:n="value"}){const{current:o}=S.useRef(e!==void 0),[i,s]=S.useState(t),a=o?e:i,l=S.useCallback(c=>{o||s(c)},[]);return[a,l]}function Ks(e){const t=S.useRef(e);return ha(()=>{t.current=e}),S.useCallback((...r)=>(0,t.current)(...r),[])}function Ur(...e){return S.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(r=>{Y0(r,t)})},e)}let wm=!0,J0=!1,Ww;const Hj={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function Bj(e){const{type:t,tagName:r}=e;return!!(r==="INPUT"&&Hj[t]&&!e.readOnly||r==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function Fj(e){e.metaKey||e.altKey||e.ctrlKey||(wm=!0)}function Zg(){wm=!1}function Vj(){this.visibilityState==="hidden"&&J0&&(wm=!0)}function jj(e){e.addEventListener("keydown",Fj,!0),e.addEventListener("mousedown",Zg,!0),e.addEventListener("pointerdown",Zg,!0),e.addEventListener("touchstart",Zg,!0),e.addEventListener("visibilitychange",Vj,!0)}function Uj(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return wm||Bj(t)}function PT(){const e=S.useCallback(o=>{o!=null&&jj(o.ownerDocument)},[]),t=S.useRef(!1);function r(){return t.current?(J0=!0,window.clearTimeout(Ww),Ww=window.setTimeout(()=>{J0=!1},100),t.current=!1,!0):!1}function n(o){return Uj(o)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:n,onBlur:r,ref:e}}function zT(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}const Wj=e=>{const t=S.useRef({});return S.useEffect(()=>{t.current=e}),t.current},LT=Wj;function IT(e,t){const r=_({},t);return Object.keys(e).forEach(n=>{if(n.toString().match(/^(components|slots)$/))r[n]=_({},e[n],r[n]);else if(n.toString().match(/^(componentsProps|slotProps)$/)){const o=e[n]||{},i=t[n];r[n]={},!i||!Object.keys(i)?r[n]=o:!o||!Object.keys(o)?r[n]=i:(r[n]=_({},i),Object.keys(o).forEach(s=>{r[n][s]=IT(o[s],i[s])}))}else r[n]===void 0&&(r[n]=e[n])}),r}function rr(e,t,r=void 0){const n={};return Object.keys(e).forEach(o=>{n[o]=e[o].reduce((i,s)=>{if(s){const a=t(s);a!==""&&i.push(a),r&&r[s]&&i.push(r[s])}return i},[]).join(" ")}),n}const Kw=e=>e,Kj=()=>{let e=Kw;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Kw}}},qj=Kj(),DT=qj,Gj={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Vt(e,t,r="Mui"){const n=Gj[t];return n?`${r}-${n}`:`${DT.generate(e)}-${t}`}function jt(e,t,r="Mui"){const n={};return t.forEach(o=>{n[o]=Vt(e,o,r)}),n}const Kl="$$material";function ve(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i=0)&&(r[o]=e[o]);return r}function $T(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Yj=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Jj=$T(function(e){return Yj.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91});function Xj(e){if(e.sheet)return e.sheet;for(var t=0;t0?Gt(uc,--Wr):0,ql--,wt===10&&(ql=1,Em--),wt}function dn(){return wt=Wr2||hd(wt)>3?"":" "}function uU(e,t){for(;--t&&dn()&&!(wt<48||wt>102||wt>57&&wt<65||wt>70&&wt<97););return Kd(e,cp()+(t<6&&Eo()==32&&dn()==32))}function Q0(e){for(;dn();)switch(wt){case e:return Wr;case 34:case 39:e!==34&&e!==39&&Q0(wt);break;case 40:e===41&&Q0(e);break;case 92:dn();break}return Wr}function dU(e,t){for(;dn()&&e+wt!==47+10;)if(e+wt===42+42&&Eo()===47)break;return"/*"+Kd(t,Wr-1)+"*"+Sm(e===47?e:dn())}function fU(e){for(;!hd(Eo());)dn();return Kd(e,Wr)}function pU(e){return UT(dp("",null,null,null,[""],e=jT(e),0,[0],e))}function dp(e,t,r,n,o,i,s,a,l){for(var c=0,u=0,d=s,f=0,p=0,h=0,m=1,b=1,v=1,g=0,y="",x=o,k=i,w=n,E=y;b;)switch(h=g,g=dn()){case 40:if(h!=108&&Gt(E,d-1)==58){X0(E+=Pe(up(g),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:E+=up(g);break;case 9:case 10:case 13:case 32:E+=cU(h);break;case 92:E+=uU(cp()-1,7);continue;case 47:switch(Eo()){case 42:case 47:Ef(hU(dU(dn(),cp()),t,r),l);break;default:E+="/"}break;case 123*m:a[c++]=go(E)*v;case 125*m:case 59:case 0:switch(g){case 0:case 125:b=0;case 59+u:v==-1&&(E=Pe(E,/\f/g,"")),p>0&&go(E)-d&&Ef(p>32?Gw(E+";",n,r,d-1):Gw(Pe(E," ","")+";",n,r,d-2),l);break;case 59:E+=";";default:if(Ef(w=qw(E,t,r,c,u,o,a,y,x=[],k=[],d),i),g===123)if(u===0)dp(E,t,w,w,x,i,d,a,k);else switch(f===99&&Gt(E,3)===110?100:f){case 100:case 108:case 109:case 115:dp(e,w,w,n&&Ef(qw(e,w,w,0,0,o,a,y,o,x=[],d),k),o,k,d,a,n?x:k);break;default:dp(E,w,w,w,[""],k,0,a,k)}}c=u=p=0,m=v=1,y=E="",d=s;break;case 58:d=1+go(E),p=h;default:if(m<1){if(g==123)--m;else if(g==125&&m++==0&&lU()==125)continue}switch(E+=Sm(g),g*m){case 38:v=u>0?1:(E+="\f",-1);break;case 44:a[c++]=(go(E)-1)*v,v=1;break;case 64:Eo()===45&&(E+=up(dn())),f=Eo(),u=d=go(y=E+=fU(cp())),g++;break;case 45:h===45&&go(E)==2&&(m=0)}}return i}function qw(e,t,r,n,o,i,s,a,l,c,u){for(var d=o-1,f=o===0?i:[""],p=sb(f),h=0,m=0,b=0;h0?f[v]+" "+g:Pe(g,/&\f/g,f[v])))&&(l[b++]=y);return Cm(e,t,r,o===0?ob:a,l,c,u)}function hU(e,t,r){return Cm(e,t,r,HT,Sm(aU()),pd(e,2,-2),0)}function Gw(e,t,r,n){return Cm(e,t,r,ib,pd(e,0,n),pd(e,n+1,-1),n)}function wl(e,t){for(var r="",n=sb(e),o=0;o6)switch(Gt(e,t+1)){case 109:if(Gt(e,t+4)!==45)break;case 102:return Pe(e,/(.+:)(.+)-([^]+)/,"$1"+Re+"$2-$3$1"+uh+(Gt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~X0(e,"stretch")?WT(Pe(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Gt(e,t+1)!==115)break;case 6444:switch(Gt(e,go(e)-3-(~X0(e,"!important")&&10))){case 107:return Pe(e,":",":"+Re)+e;case 101:return Pe(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Re+(Gt(e,14)===45?"inline-":"")+"box$3$1"+Re+"$2$3$1"+sr+"$2box$3")+e}break;case 5936:switch(Gt(e,t+11)){case 114:return Re+e+sr+Pe(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Re+e+sr+Pe(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Re+e+sr+Pe(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Re+e+sr+e+e}return e}var SU=function(t,r,n,o){if(t.length>-1&&!t.return)switch(t.type){case ib:t.return=WT(t.value,t.length);break;case BT:return wl([Oc(t,{value:Pe(t.value,"@","@"+Re)})],o);case ob:if(t.length)return sU(t.props,function(i){switch(iU(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return wl([Oc(t,{props:[Pe(i,/:(read-\w+)/,":"+uh+"$1")]})],o);case"::placeholder":return wl([Oc(t,{props:[Pe(i,/:(plac\w+)/,":"+Re+"input-$1")]}),Oc(t,{props:[Pe(i,/:(plac\w+)/,":"+uh+"$1")]}),Oc(t,{props:[Pe(i,/:(plac\w+)/,sr+"input-$1")]})],o)}return""})}},EU=[SU],CU=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(m){var b=m.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var o=t.stylisPlugins||EU,i={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(m){for(var b=m.getAttribute("data-emotion").split(" "),v=1;v=4;++n,o-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var NU={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},RU=/[A-Z]|^ms/g,PU=/_EMO_([^_]+?)_([^]*?)_EMO_/g,qT=function(t){return t.charCodeAt(1)===45},qw=function(t){return t!=null&&typeof t!="boolean"},Xg=zT(function(e){return qT(e)?e:e.replace(RU,"-$&").toLowerCase()}),Gw=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(PU,function(n,o,i){return vo={name:o,styles:i,next:vo},o})}return NU[t]!==1&&!qT(t)&&typeof r=="number"&&r!==0?r+"px":r};function hd(e,t,r){if(r==null)return"";if(r.__emotion_styles!==void 0)return r;switch(typeof r){case"boolean":return"";case"object":{if(r.anim===1)return vo={name:r.name,styles:r.styles,next:vo},r.name;if(r.styles!==void 0){var n=r.next;if(n!==void 0)for(;n!==void 0;)vo={name:n.name,styles:n.styles,next:vo},n=n.next;var o=r.styles+";";return o}return zU(e,t,r)}case"function":{if(e!==void 0){var i=vo,s=r(e);return vo=i,hd(e,t,s)}break}}if(t==null)return r;var a=t[r];return a!==void 0?a:r}function zU(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o96?HU:BU},Xw=function(t,r,n){var o;if(r){var i=r.shouldForwardProp;o=t.__emotion_forwardProp&&i?function(s){return t.__emotion_forwardProp(s)&&i(s)}:i}return typeof o!="function"&&n&&(o=t.__emotion_forwardProp),o},FU=function(t){var r=t.cache,n=t.serialized,o=t.isStringTag;return KT(r,n,o),DU(function(){return _U(r,n,o)}),null},VU=function e(t,r){var n=t.__emotion_real===t,o=n&&t.__emotion_base||t,i,s;r!==void 0&&(i=r.label,s=r.target);var a=Xw(t,r,n),l=a||Jw(o),c=!l("as");return function(){var u=arguments,d=n&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&d.push("label:"+i+";"),u[0]==null||u[0].raw===void 0)d.push.apply(d,u);else{d.push(u[0][0]);for(var f=u.length,p=1;p=4;++n,o-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var $U={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},HU=/[A-Z]|^ms/g,BU=/_EMO_([^_]+?)_([^]*?)_EMO_/g,XT=function(t){return t.charCodeAt(1)===45},Jw=function(t){return t!=null&&typeof t!="boolean"},e1=$T(function(e){return XT(e)?e:e.replace(HU,"-$&").toLowerCase()}),Xw=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(BU,function(n,o,i){return vo={name:o,styles:i,next:vo},o})}return $U[t]!==1&&!XT(t)&&typeof r=="number"&&r!==0?r+"px":r};function md(e,t,r){if(r==null)return"";if(r.__emotion_styles!==void 0)return r;switch(typeof r){case"boolean":return"";case"object":{if(r.anim===1)return vo={name:r.name,styles:r.styles,next:vo},r.name;if(r.styles!==void 0){var n=r.next;if(n!==void 0)for(;n!==void 0;)vo={name:n.name,styles:n.styles,next:vo},n=n.next;var o=r.styles+";";return o}return FU(e,t,r)}case"function":{if(e!==void 0){var i=vo,s=r(e);return vo=i,md(e,t,s)}break}}if(t==null)return r;var a=t[r];return a!==void 0?a:r}function FU(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o96?KU:qU},eS=function(t,r,n){var o;if(r){var i=r.shouldForwardProp;o=t.__emotion_forwardProp&&i?function(s){return t.__emotion_forwardProp(s)&&i(s)}:i}return typeof o!="function"&&n&&(o=t.__emotion_forwardProp),o},GU=function(t){var r=t.cache,n=t.serialized,o=t.isStringTag;return JT(r,n,o),UU(function(){return IU(r,n,o)}),null},YU=function e(t,r){var n=t.__emotion_real===t,o=n&&t.__emotion_base||t,i,s;r!==void 0&&(i=r.label,s=r.target);var a=eS(t,r,n),l=a||Zw(o),c=!l("as");return function(){var u=arguments,d=n&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&d.push("label:"+i+";"),u[0]==null||u[0].raw===void 0)d.push.apply(d,u);else{d.push(u[0][0]);for(var f=u.length,p=1;p{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))},WU=["values","unit","step"],KU=e=>{const t=Object.keys(e).map(r=>({key:r,val:e[r]}))||[];return t.sort((r,n)=>r.val-n.val),t.reduce((r,n)=>_({},r,{[n.key]:n.val}),{})};function qU(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5}=e,o=ve(e,WU),i=KU(t),s=Object.keys(i);function a(f){return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r})`}function l(f){return`@media (max-width:${(typeof t[f]=="number"?t[f]:f)-n/100}${r})`}function c(f,p){const h=s.indexOf(p);return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r}) and (max-width:${(h!==-1&&typeof t[s[h]]=="number"?t[s[h]]:p)-n/100}${r})`}function u(f){return s.indexOf(f)+1`@media (min-width:${ub[e]}px)`};function ao(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const i=n.breakpoints||Qw;return t.reduce((s,a,l)=>(s[i.up(i.keys[l])]=r(t[l]),s),{})}if(typeof t=="object"){const i=n.breakpoints||Qw;return Object.keys(t).reduce((s,a)=>{if(Object.keys(i.values||ub).indexOf(a)!==-1){const l=i.up(a);s[l]=r(t[a],a)}else{const l=a;s[l]=t[l]}return s},{})}return r(t)}function XT(e={}){var t;return((t=e.keys)==null?void 0:t.reduce((n,o)=>{const i=e.up(o);return n[i]={},n},{}))||{}}function QT(e,t){return e.reduce((r,n)=>{const o=r[n];return(!o||Object.keys(o).length===0)&&delete r[n],r},t)}function JU(e,...t){const r=XT(e),n=[r,...t].reduce((o,i)=>cn(o,i),{});return QT(Object.keys(r),n)}function XU(e,t){if(typeof e!="object")return{};const r={},n=Object.keys(t);return Array.isArray(e)?n.forEach((o,i)=>{i{e[o]!=null&&(r[o]=!0)}),r}function Qg({values:e,breakpoints:t,base:r}){const n=r||XU(e,t),o=Object.keys(n);if(o.length===0)return e;let i;return o.reduce((s,a,l)=>(Array.isArray(e)?(s[a]=e[l]!=null?e[l]:e[i],i=l):typeof e=="object"?(s[a]=e[a]!=null?e[a]:e[i],i=a):s[a]=e,s),{})}function Pm(e,t,r=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&r){const n=`vars.${t}`.split(".").reduce((o,i)=>o&&o[i]?o[i]:null,e);if(n!=null)return n}return t.split(".").reduce((n,o)=>n&&n[o]!=null?n[o]:null,e)}function uh(e,t,r,n=r){let o;return typeof e=="function"?o=e(r):Array.isArray(e)?o=e[r]||n:o=Pm(e,r)||n,t&&(o=t(o,n,e)),o}function Ie(e){const{prop:t,cssProperty:r=e.prop,themeKey:n,transform:o}=e,i=s=>{if(s[t]==null)return null;const a=s[t],l=s.theme,c=Pm(l,n)||{};return ao(s,a,d=>{let f=uh(c,o,d);return d===f&&typeof d=="string"&&(f=uh(c,o,`${t}${d==="default"?"":Fe(d)}`,d)),r===!1?f:{[r]:f}})};return i.propTypes={},i.filterProps=[t],i}function QU(e){const t={};return r=>(t[r]===void 0&&(t[r]=e(r)),t[r])}const ZU={m:"margin",p:"padding"},eW={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Zw={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},tW=QU(e=>{if(e.length>2)if(Zw[e])e=Zw[e];else return[e];const[t,r]=e.split(""),n=ZU[t],o=eW[r]||"";return Array.isArray(o)?o.map(i=>n+i):[n+o]}),db=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],fb=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...db,...fb];function Wd(e,t,r,n){var o;const i=(o=Pm(e,t,!1))!=null?o:r;return typeof i=="number"?s=>typeof s=="string"?s:i*s:Array.isArray(i)?s=>typeof s=="string"?s:i[s]:typeof i=="function"?i:()=>{}}function pb(e){return Wd(e,"spacing",8)}function ma(e,t){if(typeof t=="string"||t==null)return t;const r=Math.abs(t),n=e(r);return t>=0?n:typeof n=="number"?-n:`-${n}`}function rW(e,t){return r=>e.reduce((n,o)=>(n[o]=ma(t,r),n),{})}function nW(e,t,r,n){if(t.indexOf(r)===-1)return null;const o=tW(r),i=rW(o,n),s=e[r];return ao(e,s,i)}function ZT(e,t){const r=pb(e.theme);return Object.keys(e).map(n=>nW(e,t,n,r)).reduce(Ou,{})}function pt(e){return ZT(e,db)}pt.propTypes={};pt.filterProps=db;function ht(e){return ZT(e,fb)}ht.propTypes={};ht.filterProps=fb;function oW(e=8){if(e.mui)return e;const t=pb({spacing:e}),r=(...n)=>(n.length===0?[1]:n).map(i=>{const s=t(i);return typeof s=="number"?`${s}px`:s}).join(" ");return r.mui=!0,r}function zm(...e){const t=e.reduce((n,o)=>(o.filterProps.forEach(i=>{n[i]=o}),n),{}),r=n=>Object.keys(n).reduce((o,i)=>t[i]?Ou(o,t[i](n)):o,{});return r.propTypes={},r.filterProps=e.reduce((n,o)=>n.concat(o.filterProps),[]),r}function xo(e){return typeof e!="number"?e:`${e}px solid`}const iW=Ie({prop:"border",themeKey:"borders",transform:xo}),sW=Ie({prop:"borderTop",themeKey:"borders",transform:xo}),aW=Ie({prop:"borderRight",themeKey:"borders",transform:xo}),lW=Ie({prop:"borderBottom",themeKey:"borders",transform:xo}),cW=Ie({prop:"borderLeft",themeKey:"borders",transform:xo}),uW=Ie({prop:"borderColor",themeKey:"palette"}),dW=Ie({prop:"borderTopColor",themeKey:"palette"}),fW=Ie({prop:"borderRightColor",themeKey:"palette"}),pW=Ie({prop:"borderBottomColor",themeKey:"palette"}),hW=Ie({prop:"borderLeftColor",themeKey:"palette"}),Lm=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Wd(e.theme,"shape.borderRadius",4),r=n=>({borderRadius:ma(t,n)});return ao(e,e.borderRadius,r)}return null};Lm.propTypes={};Lm.filterProps=["borderRadius"];zm(iW,sW,aW,lW,cW,uW,dW,fW,pW,hW,Lm);const Im=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Wd(e.theme,"spacing",8),r=n=>({gap:ma(t,n)});return ao(e,e.gap,r)}return null};Im.propTypes={};Im.filterProps=["gap"];const Dm=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Wd(e.theme,"spacing",8),r=n=>({columnGap:ma(t,n)});return ao(e,e.columnGap,r)}return null};Dm.propTypes={};Dm.filterProps=["columnGap"];const $m=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Wd(e.theme,"spacing",8),r=n=>({rowGap:ma(t,n)});return ao(e,e.rowGap,r)}return null};$m.propTypes={};$m.filterProps=["rowGap"];const mW=Ie({prop:"gridColumn"}),gW=Ie({prop:"gridRow"}),vW=Ie({prop:"gridAutoFlow"}),yW=Ie({prop:"gridAutoColumns"}),bW=Ie({prop:"gridAutoRows"}),xW=Ie({prop:"gridTemplateColumns"}),kW=Ie({prop:"gridTemplateRows"}),wW=Ie({prop:"gridTemplateAreas"}),SW=Ie({prop:"gridArea"});zm(Im,Dm,$m,mW,gW,vW,yW,bW,xW,kW,wW,SW);function Sl(e,t){return t==="grey"?t:e}const EW=Ie({prop:"color",themeKey:"palette",transform:Sl}),CW=Ie({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Sl}),MW=Ie({prop:"backgroundColor",themeKey:"palette",transform:Sl});zm(EW,CW,MW);function on(e){return e<=1&&e!==0?`${e*100}%`:e}const TW=Ie({prop:"width",transform:on}),hb=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=r=>{var n,o;const i=((n=e.theme)==null||(n=n.breakpoints)==null||(n=n.values)==null?void 0:n[r])||ub[r];return i?((o=e.theme)==null||(o=o.breakpoints)==null?void 0:o.unit)!=="px"?{maxWidth:`${i}${e.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:on(r)}};return ao(e,e.maxWidth,t)}return null};hb.filterProps=["maxWidth"];const OW=Ie({prop:"minWidth",transform:on}),_W=Ie({prop:"height",transform:on}),AW=Ie({prop:"maxHeight",transform:on}),NW=Ie({prop:"minHeight",transform:on});Ie({prop:"size",cssProperty:"width",transform:on});Ie({prop:"size",cssProperty:"height",transform:on});const RW=Ie({prop:"boxSizing"});zm(TW,hb,OW,_W,AW,NW,RW);const PW={border:{themeKey:"borders",transform:xo},borderTop:{themeKey:"borders",transform:xo},borderRight:{themeKey:"borders",transform:xo},borderBottom:{themeKey:"borders",transform:xo},borderLeft:{themeKey:"borders",transform:xo},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Lm},color:{themeKey:"palette",transform:Sl},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Sl},backgroundColor:{themeKey:"palette",transform:Sl},p:{style:ht},pt:{style:ht},pr:{style:ht},pb:{style:ht},pl:{style:ht},px:{style:ht},py:{style:ht},padding:{style:ht},paddingTop:{style:ht},paddingRight:{style:ht},paddingBottom:{style:ht},paddingLeft:{style:ht},paddingX:{style:ht},paddingY:{style:ht},paddingInline:{style:ht},paddingInlineStart:{style:ht},paddingInlineEnd:{style:ht},paddingBlock:{style:ht},paddingBlockStart:{style:ht},paddingBlockEnd:{style:ht},m:{style:pt},mt:{style:pt},mr:{style:pt},mb:{style:pt},ml:{style:pt},mx:{style:pt},my:{style:pt},margin:{style:pt},marginTop:{style:pt},marginRight:{style:pt},marginBottom:{style:pt},marginLeft:{style:pt},marginX:{style:pt},marginY:{style:pt},marginInline:{style:pt},marginInlineStart:{style:pt},marginInlineEnd:{style:pt},marginBlock:{style:pt},marginBlockStart:{style:pt},marginBlockEnd:{style:pt},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Im},rowGap:{style:$m},columnGap:{style:Dm},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:on},maxWidth:{style:hb},minWidth:{transform:on},height:{transform:on},maxHeight:{transform:on},minHeight:{transform:on},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},Hm=PW;function zW(...e){const t=e.reduce((n,o)=>n.concat(Object.keys(o)),[]),r=new Set(t);return e.every(n=>r.size===Object.keys(n).length)}function LW(e,t){return typeof e=="function"?e(t):e}function IW(){function e(r,n,o,i){const s={[r]:n,theme:o},a=i[r];if(!a)return{[r]:n};const{cssProperty:l=r,themeKey:c,transform:u,style:d}=a;if(n==null)return null;if(c==="typography"&&n==="inherit")return{[r]:n};const f=Pm(o,c)||{};return d?d(s):ao(s,n,h=>{let m=uh(f,u,h);return h===m&&typeof h=="string"&&(m=uh(f,u,`${r}${h==="default"?"":Fe(h)}`,h)),l===!1?m:{[l]:m}})}function t(r){var n;const{sx:o,theme:i={}}=r||{};if(!o)return null;const s=(n=i.unstable_sxConfig)!=null?n:Hm;function a(l){let c=l;if(typeof l=="function")c=l(i);else if(typeof l!="object")return l;if(!c)return null;const u=XT(i.breakpoints),d=Object.keys(u);let f=u;return Object.keys(c).forEach(p=>{const h=LW(c[p],i);if(h!=null)if(typeof h=="object")if(s[p])f=Ou(f,e(p,h,i,s));else{const m=ao({theme:i},h,b=>({[p]:b}));zW(m,h)?f[p]=t({sx:h,theme:i}):f=Ou(f,m)}else f=Ou(f,e(p,h,i,s))}),QT(d,f)}return Array.isArray(o)?o.map(a):a(o)}return t}const e3=IW();e3.filterProps=["sx"];const Bm=e3,DW=["breakpoints","palette","spacing","shape"];function Fm(e={},...t){const{breakpoints:r={},palette:n={},spacing:o,shape:i={}}=e,s=ve(e,DW),a=qU(r),l=oW(o);let c=cn({breakpoints:a,direction:"ltr",components:{},palette:_({mode:"light"},n),spacing:l,shape:_({},YU,i)},s);return c=t.reduce((u,d)=>cn(u,d),c),c.unstable_sxConfig=_({},Hm,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(d){return Bm({sx:d,theme:this})},c}function $W(e){return Object.keys(e).length===0}function mb(e=null){const t=S.useContext(lb);return!t||$W(t)?e:t}const HW=Fm();function gb(e=HW){return mb(e)}const BW=["sx"],FW=e=>{var t,r;const n={systemProps:{},otherProps:{}},o=(t=e==null||(r=e.theme)==null?void 0:r.unstable_sxConfig)!=null?t:Hm;return Object.keys(e).forEach(i=>{o[i]?n.systemProps[i]=e[i]:n.otherProps[i]=e[i]}),n};function vb(e){const{sx:t}=e,r=ve(e,BW),{systemProps:n,otherProps:o}=FW(r);let i;return Array.isArray(t)?i=[n,...t]:typeof t=="function"?i=(...s)=>{const a=t(...s);return Wo(a)?_({},n,a):n}:i=_({},n,t),_({},o,{sx:i})}function t3(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ta!=="theme"&&a!=="sx"&&a!=="as"})(Bm);return S.forwardRef(function(l,c){const u=gb(r),d=vb(l),{className:f,component:p="div"}=d,h=ve(d,VW);return O.jsx(i,_({as:p,ref:c,className:Ce(f,o?o(n):n),theme:t&&u[t]||u},h))})}const UW=["variant"];function eS(e){return e.length===0}function r3(e){const{variant:t}=e,r=ve(e,UW);let n=t||"";return Object.keys(r).sort().forEach(o=>{o==="color"?n+=eS(n)?e[o]:Fe(e[o]):n+=`${eS(n)?o:Fe(o)}${Fe(e[o].toString())}`}),n}const WW=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function KW(e){return Object.keys(e).length===0}function qW(e){return typeof e=="string"&&e.charCodeAt(0)>96}const GW=(e,t)=>t.components&&t.components[e]&&t.components[e].styleOverrides?t.components[e].styleOverrides:null,dh=e=>{const t={};return e&&e.forEach(r=>{const n=r3(r.props);t[n]=r.style}),t},YW=(e,t)=>{let r=[];return t&&t.components&&t.components[e]&&t.components[e].variants&&(r=t.components[e].variants),dh(r)},fh=(e,t,r)=>{const{ownerState:n={}}=e,o=[];return r&&r.forEach(i=>{let s=!0;Object.keys(i.props).forEach(a=>{n[a]!==i.props[a]&&e[a]!==i.props[a]&&(s=!1)}),s&&o.push(t[r3(i.props)])}),o},JW=(e,t,r,n)=>{var o;const i=r==null||(o=r.components)==null||(o=o[n])==null?void 0:o.variants;return fh(e,t,i)};function up(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const XW=Fm(),QW=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function dp({defaultTheme:e,theme:t,themeId:r}){return KW(t)?e:t[r]||t}function ZW(e){return e?(t,r)=>r[e]:null}const tS=({styledArg:e,props:t,defaultTheme:r,themeId:n})=>{const o=e(_({},t,{theme:dp(_({},t,{defaultTheme:r,themeId:n}))}));let i;if(o&&o.variants&&(i=o.variants,delete o.variants),i){const s=fh(t,dh(i),i);return[o,...s]}return o};function n3(e={}){const{themeId:t,defaultTheme:r=XW,rootShouldForwardProp:n=up,slotShouldForwardProp:o=up}=e,i=s=>Bm(_({},s,{theme:dp(_({},s,{defaultTheme:r,themeId:t}))}));return i.__mui_systemSx=!0,(s,a={})=>{UU(s,x=>x.filter(k=>!(k!=null&&k.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:d,overridesResolver:f=ZW(QW(c))}=a,p=ve(a,WW),h=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,m=d||!1;let b,v=up;c==="Root"||c==="root"?v=n:c?v=o:qW(s)&&(v=void 0);const g=JT(s,_({shouldForwardProp:v,label:b},p)),y=(x,...k)=>{const w=k?k.map(T=>{if(typeof T=="function"&&T.__emotion_real!==T)return N=>tS({styledArg:T,props:N,defaultTheme:r,themeId:t});if(Wo(T)){let N=T,F;return T&&T.variants&&(F=T.variants,delete N.variants,N=I=>{let V=T;return fh(I,dh(F),F).forEach(z=>{V=cn(V,z)}),V}),N}return T}):[];let E=x;if(Wo(x)){let T;x&&x.variants&&(T=x.variants,delete E.variants,E=N=>{let F=x;return fh(N,dh(T),T).forEach(V=>{F=cn(F,V)}),F})}else typeof x=="function"&&x.__emotion_real!==x&&(E=T=>tS({styledArg:x,props:T,defaultTheme:r,themeId:t}));l&&f&&w.push(T=>{const N=dp(_({},T,{defaultTheme:r,themeId:t})),F=GW(l,N);if(F){const I={};return Object.entries(F).forEach(([V,j])=>{I[V]=typeof j=="function"?j(_({},T,{theme:N})):j}),f(T,I)}return null}),l&&!h&&w.push(T=>{const N=dp(_({},T,{defaultTheme:r,themeId:t}));return JW(T,YW(l,N),N,l)}),m||w.push(i);const M=w.length-k.length;if(Array.isArray(x)&&M>0){const T=new Array(M).fill("");E=[...x,...T],E.raw=[...x.raw,...T]}const C=g(E,...w);return s.muiName&&(C.muiName=s.muiName),C};return g.withConfig&&(y.withConfig=g.withConfig),y}}const eK=n3(),tK=eK;function rK(e){const{theme:t,name:r,props:n}=e;return!t||!t.components||!t.components[r]||!t.components[r].defaultProps?n:RT(t.components[r].defaultProps,n)}function o3({props:e,name:t,defaultTheme:r,themeId:n}){let o=gb(r);return n&&(o=o[n]||o),rK({theme:o,name:t,props:e})}function yb(e,t=0,r=1){return Math.min(Math.max(t,e),r)}function nK(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let r=e.match(t);return r&&r[0].length===1&&(r=r.map(n=>n+n)),r?`rgb${r.length===4?"a":""}(${r.map((n,o)=>o<3?parseInt(n,16):Math.round(parseInt(n,16)/255*1e3)/1e3).join(", ")})`:""}function ga(e){if(e.type)return e;if(e.charAt(0)==="#")return ga(nK(e));const t=e.indexOf("("),r=e.substring(0,t);if(["rgb","rgba","hsl","hsla","color"].indexOf(r)===-1)throw new Error(Wl(9,e));let n=e.substring(t+1,e.length-1),o;if(r==="color"){if(n=n.split(" "),o=n.shift(),n.length===4&&n[3].charAt(0)==="/"&&(n[3]=n[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(o)===-1)throw new Error(Wl(10,o))}else n=n.split(",");return n=n.map(i=>parseFloat(i)),{type:r,values:n,colorSpace:o}}function Vm(e){const{type:t,colorSpace:r}=e;let{values:n}=e;return t.indexOf("rgb")!==-1?n=n.map((o,i)=>i<3?parseInt(o,10):o):t.indexOf("hsl")!==-1&&(n[1]=`${n[1]}%`,n[2]=`${n[2]}%`),t.indexOf("color")!==-1?n=`${r} ${n.join(" ")}`:n=`${n.join(", ")}`,`${t}(${n})`}function oK(e){e=ga(e);const{values:t}=e,r=t[0],n=t[1]/100,o=t[2]/100,i=n*Math.min(o,1-o),s=(c,u=(c+r/30)%12)=>o-i*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return e.type==="hsla"&&(a+="a",l.push(t[3])),Vm({type:a,values:l})}function rS(e){e=ga(e);let t=e.type==="hsl"||e.type==="hsla"?ga(oK(e)).values:e.values;return t=t.map(r=>(e.type!=="color"&&(r/=255),r<=.03928?r/12.92:((r+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function iK(e,t){const r=rS(e),n=rS(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}function Lr(e,t){return e=ga(e),t=yb(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Vm(e)}function sK(e,t){if(e=ga(e),t=yb(t),e.type.indexOf("hsl")!==-1)e.values[2]*=1-t;else if(e.type.indexOf("rgb")!==-1||e.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)e.values[r]*=1-t;return Vm(e)}function aK(e,t){if(e=ga(e),t=yb(t),e.type.indexOf("hsl")!==-1)e.values[2]+=(100-e.values[2])*t;else if(e.type.indexOf("rgb")!==-1)for(let r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(e.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return Vm(e)}const lK=S.createContext(null),i3=lK;function s3(){return S.useContext(i3)}const cK=typeof Symbol=="function"&&Symbol.for,uK=cK?Symbol.for("mui.nested"):"__THEME_NESTED__";function dK(e,t){return typeof t=="function"?t(e):_({},e,t)}function fK(e){const{children:t,theme:r}=e,n=s3(),o=S.useMemo(()=>{const i=n===null?r:dK(n,r);return i!=null&&(i[uK]=n!==null),i},[r,n]);return O.jsx(i3.Provider,{value:o,children:t})}const nS={};function oS(e,t,r,n=!1){return S.useMemo(()=>{const o=e&&t[e]||t;if(typeof r=="function"){const i=r(o),s=e?_({},t,{[e]:i}):i;return n?()=>s:s}return e?_({},t,{[e]:r}):_({},t,r)},[e,t,r,n])}function pK(e){const{children:t,theme:r,themeId:n}=e,o=mb(nS),i=s3()||nS,s=oS(n,o,r),a=oS(n,i,r,!0);return O.jsx(fK,{theme:a,children:O.jsx(lb.Provider,{value:s,children:t})})}const hK=["component","direction","spacing","divider","children","className","useFlexGap"],mK=Fm(),gK=tK("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root});function vK(e){return o3({props:e,name:"MuiStack",defaultTheme:mK})}function yK(e,t){const r=S.Children.toArray(e).filter(Boolean);return r.reduce((n,o,i)=>(n.push(o),i({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],xK=({ownerState:e,theme:t})=>{let r=_({display:"flex",flexDirection:"column"},ao({theme:t},Qg({values:e.direction,breakpoints:t.breakpoints.values}),n=>({flexDirection:n})));if(e.spacing){const n=pb(t),o=Object.keys(t.breakpoints.values).reduce((l,c)=>((typeof e.spacing=="object"&&e.spacing[c]!=null||typeof e.direction=="object"&&e.direction[c]!=null)&&(l[c]=!0),l),{}),i=Qg({values:e.direction,base:o}),s=Qg({values:e.spacing,base:o});typeof i=="object"&&Object.keys(i).forEach((l,c,u)=>{if(!i[l]){const f=c>0?i[u[c-1]]:"column";i[l]=f}}),r=cn(r,ao({theme:t},s,(l,c)=>e.useFlexGap?{gap:ma(n,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${bK(c?i[c]:e.direction)}`]:ma(n,l)}}))}return r=JU(t.breakpoints,r),r};function kK(e={}){const{createStyledComponent:t=gK,useThemeProps:r=vK,componentName:n="MuiStack"}=e,o=()=>tr({root:["root"]},l=>Vt(n,l),{}),i=t(xK);return S.forwardRef(function(l,c){const u=r(l),d=vb(u),{component:f="div",direction:p="column",spacing:h=0,divider:m,children:b,className:v,useFlexGap:g=!1}=d,y=ve(d,hK),x={direction:p,spacing:h,useFlexGap:g},k=o();return O.jsx(i,_({as:f,ownerState:x,ref:c,className:Ce(k.root,v)},y,{children:m?yK(b,m):b}))})}function wK(e,t){return _({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},t)}const SK=["mode","contrastThreshold","tonalOffset"],iS={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:ud.white,default:ud.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},Zg={text:{primary:ud.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:ud.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function sS(e,t,r,n){const o=n.light||n,i=n.dark||n*1.5;e[t]||(e.hasOwnProperty(r)?e[t]=e[r]:t==="light"?e.light=aK(e.main,o):t==="dark"&&(e.dark=sK(e.main,i)))}function EK(e="light"){return e==="dark"?{main:Ia[200],light:Ia[50],dark:Ia[400]}:{main:Ia[700],light:Ia[400],dark:Ia[800]}}function CK(e="light"){return e==="dark"?{main:La[200],light:La[50],dark:La[400]}:{main:La[500],light:La[300],dark:La[700]}}function MK(e="light"){return e==="dark"?{main:za[500],light:za[300],dark:za[700]}:{main:za[700],light:za[400],dark:za[800]}}function TK(e="light"){return e==="dark"?{main:Da[400],light:Da[300],dark:Da[700]}:{main:Da[700],light:Da[500],dark:Da[900]}}function OK(e="light"){return e==="dark"?{main:$a[400],light:$a[300],dark:$a[700]}:{main:$a[800],light:$a[500],dark:$a[900]}}function _K(e="light"){return e==="dark"?{main:Mc[400],light:Mc[300],dark:Mc[700]}:{main:"#ed6c02",light:Mc[500],dark:Mc[900]}}function AK(e){const{mode:t="light",contrastThreshold:r=3,tonalOffset:n=.2}=e,o=ve(e,SK),i=e.primary||EK(t),s=e.secondary||CK(t),a=e.error||MK(t),l=e.info||TK(t),c=e.success||OK(t),u=e.warning||_K(t);function d(m){return iK(m,Zg.text.primary)>=r?Zg.text.primary:iS.text.primary}const f=({color:m,name:b,mainShade:v=500,lightShade:g=300,darkShade:y=700})=>{if(m=_({},m),!m.main&&m[v]&&(m.main=m[v]),!m.hasOwnProperty("main"))throw new Error(Wl(11,b?` (${b})`:"",v));if(typeof m.main!="string")throw new Error(Wl(12,b?` (${b})`:"",JSON.stringify(m.main)));return sS(m,"light",g,n),sS(m,"dark",y,n),m.contrastText||(m.contrastText=d(m.main)),m},p={dark:Zg,light:iS};return cn(_({common:_({},ud),mode:t,primary:f({color:i,name:"primary"}),secondary:f({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:f({color:a,name:"error"}),warning:f({color:u,name:"warning"}),info:f({color:l,name:"info"}),success:f({color:c,name:"success"}),grey:Ej,contrastThreshold:r,getContrastText:d,augmentColor:f,tonalOffset:n},p[t]),o)}const NK=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function RK(e){return Math.round(e*1e5)/1e5}const aS={textTransform:"uppercase"},lS='"Roboto", "Helvetica", "Arial", sans-serif';function PK(e,t){const r=typeof t=="function"?t(e):t,{fontFamily:n=lS,fontSize:o=14,fontWeightLight:i=300,fontWeightRegular:s=400,fontWeightMedium:a=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:d}=r,f=ve(r,NK),p=o/14,h=d||(v=>`${v/c*p}rem`),m=(v,g,y,x,k)=>_({fontFamily:n,fontWeight:v,fontSize:h(g),lineHeight:y},n===lS?{letterSpacing:`${RK(x/g)}em`}:{},k,u),b={h1:m(i,96,1.167,-1.5),h2:m(i,60,1.2,-.5),h3:m(s,48,1.167,0),h4:m(s,34,1.235,.25),h5:m(s,24,1.334,0),h6:m(a,20,1.6,.15),subtitle1:m(s,16,1.75,.15),subtitle2:m(a,14,1.57,.1),body1:m(s,16,1.5,.15),body2:m(s,14,1.43,.15),button:m(a,14,1.75,.4,aS),caption:m(s,12,1.66,.4),overline:m(s,12,2.66,1,aS),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return cn(_({htmlFontSize:c,pxToRem:h,fontFamily:n,fontSize:o,fontWeightLight:i,fontWeightRegular:s,fontWeightMedium:a,fontWeightBold:l},b),f,{clone:!1})}const zK=.2,LK=.14,IK=.12;function nt(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${zK})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${LK})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${IK})`].join(",")}const DK=["none",nt(0,2,1,-1,0,1,1,0,0,1,3,0),nt(0,3,1,-2,0,2,2,0,0,1,5,0),nt(0,3,3,-2,0,3,4,0,0,1,8,0),nt(0,2,4,-1,0,4,5,0,0,1,10,0),nt(0,3,5,-1,0,5,8,0,0,1,14,0),nt(0,3,5,-1,0,6,10,0,0,1,18,0),nt(0,4,5,-2,0,7,10,1,0,2,16,1),nt(0,5,5,-3,0,8,10,1,0,3,14,2),nt(0,5,6,-3,0,9,12,1,0,3,16,2),nt(0,6,6,-3,0,10,14,1,0,4,18,3),nt(0,6,7,-4,0,11,15,1,0,4,20,3),nt(0,7,8,-4,0,12,17,2,0,5,22,4),nt(0,7,8,-4,0,13,19,2,0,5,24,4),nt(0,7,9,-4,0,14,21,2,0,5,26,4),nt(0,8,9,-5,0,15,22,2,0,6,28,5),nt(0,8,10,-5,0,16,24,2,0,6,30,5),nt(0,8,11,-5,0,17,26,2,0,6,32,5),nt(0,9,11,-5,0,18,28,2,0,7,34,6),nt(0,9,12,-6,0,19,29,2,0,7,36,6),nt(0,10,13,-6,0,20,31,3,0,8,38,7),nt(0,10,13,-6,0,21,33,3,0,8,40,7),nt(0,10,14,-6,0,22,35,3,0,8,42,7),nt(0,11,14,-7,0,23,36,3,0,9,44,8),nt(0,11,15,-7,0,24,38,3,0,9,46,8)],$K=DK,HK=["duration","easing","delay"],BK={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},FK={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function cS(e){return`${Math.round(e)}ms`}function VK(e){if(!e)return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function jK(e){const t=_({},BK,e.easing),r=_({},FK,e.duration);return _({getAutoHeightDuration:VK,create:(o=["all"],i={})=>{const{duration:s=r.standard,easing:a=t.easeInOut,delay:l=0}=i;return ve(i,HK),(Array.isArray(o)?o:[o]).map(c=>`${c} ${typeof s=="string"?s:cS(s)} ${a} ${typeof l=="string"?l:cS(l)}`).join(",")}},e,{easing:t,duration:r})}const UK={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},WK=UK,KK=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function bb(e={},...t){const{mixins:r={},palette:n={},transitions:o={},typography:i={}}=e,s=ve(e,KK);if(e.vars)throw new Error(Wl(18));const a=AK(n),l=Fm(e);let c=cn(l,{mixins:wK(l.breakpoints,r),palette:a,shadows:$K.slice(),typography:PK(a,i),transitions:jK(o),zIndex:_({},WK)});return c=cn(c,s),c=t.reduce((u,d)=>cn(u,d),c),c.unstable_sxConfig=_({},Hm,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(d){return Bm({sx:d,theme:this})},c}const qK=bb(),xb=qK;function jm(){const e=gb(xb);return e[Kl]||e}function Wt({props:e,name:t}){return o3({props:e,name:t,defaultTheme:xb,themeId:Kl})}const kb=e=>up(e)&&e!=="classes",GK=n3({themeId:Kl,defaultTheme:xb,rootShouldForwardProp:kb}),Xe=GK,YK=["theme"];function JK(e){let{theme:t}=e,r=ve(e,YK);const n=t[Kl];return O.jsx(pK,_({},r,{themeId:n?Kl:void 0,theme:n||t}))}const XK=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)},uS=XK;function J0(e,t){return J0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},J0(e,t)}function a3(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,J0(e,t)}const dS={disabled:!1},ph=L.createContext(null);var QK=function(t){return t.scrollTop},au="unmounted",Ns="exited",Rs="entering",Ya="entered",X0="exiting",fi=function(e){a3(t,e);function t(n,o){var i;i=e.call(this,n,o)||this;var s=o,a=s&&!s.isMounting?n.enter:n.appear,l;return i.appearStatus=null,n.in?a?(l=Ns,i.appearStatus=Rs):l=Ya:n.unmountOnExit||n.mountOnEnter?l=au:l=Ns,i.state={status:l},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var s=o.in;return s&&i.status===au?{status:Ns}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(o){var i=null;if(o!==this.props){var s=this.state.status;this.props.in?s!==Rs&&s!==Ya&&(i=Rs):(s===Rs||s===Ya)&&(i=X0)}this.updateStatus(!1,i)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var o=this.props.timeout,i,s,a;return i=s=a=o,o!=null&&typeof o!="number"&&(i=o.exit,s=o.enter,a=o.appear!==void 0?o.appear:s),{exit:i,enter:s,appear:a}},r.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===Rs){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:xf.findDOMNode(this);s&&QK(s)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ns&&this.setState({status:au})},r.performEnter=function(o){var i=this,s=this.props.enter,a=this.context?this.context.isMounting:o,l=this.props.nodeRef?[a]:[xf.findDOMNode(this),a],c=l[0],u=l[1],d=this.getTimeouts(),f=a?d.appear:d.enter;if(!o&&!s||dS.disabled){this.safeSetState({status:Ya},function(){i.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:Rs},function(){i.props.onEntering(c,u),i.onTransitionEnd(f,function(){i.safeSetState({status:Ya},function(){i.props.onEntered(c,u)})})})},r.performExit=function(){var o=this,i=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:xf.findDOMNode(this);if(!i||dS.disabled){this.safeSetState({status:Ns},function(){o.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:X0},function(){o.props.onExiting(a),o.onTransitionEnd(s.exit,function(){o.safeSetState({status:Ns},function(){o.props.onExited(a)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},r.setNextCallback=function(o){var i=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,i.nextCallback=null,o(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},r.onTransitionEnd=function(o,i){this.setNextCallback(i);var s=this.props.nodeRef?this.props.nodeRef.current:xf.findDOMNode(this),a=o==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}o!=null&&setTimeout(this.nextCallback,o)},r.render=function(){var o=this.state.status;if(o===au)return null;var i=this.props,s=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var a=ve(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return L.createElement(ph.Provider,{value:null},typeof s=="function"?s(o,a):L.cloneElement(L.Children.only(s),a))},t}(L.Component);fi.contextType=ph;fi.propTypes={};function Ha(){}fi.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ha,onEntering:Ha,onEntered:Ha,onExit:Ha,onExiting:Ha,onExited:Ha};fi.UNMOUNTED=au;fi.EXITED=Ns;fi.ENTERING=Rs;fi.ENTERED=Ya;fi.EXITING=X0;const l3=fi;function ZK(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wb(e,t){var r=function(i){return t&&S.isValidElement(i)?t(i):i},n=Object.create(null);return e&&S.Children.map(e,function(o){return o}).forEach(function(o){n[o.key]=r(o)}),n}function eq(e,t){e=e||{},t=t||{};function r(u){return u in t?t[u]:e[u]}var n=Object.create(null),o=[];for(var i in e)i in t?o.length&&(n[i]=o,o=[]):o.push(i);var s,a={};for(var l in t){if(n[l])for(s=0;se.scrollTop;function hh(e,t){var r,n;const{timeout:o,easing:i,style:s={}}=e;return{duration:(r=s.transitionDuration)!=null?r:typeof o=="number"?o:o[t.mode]||0,easing:(n=s.transitionTimingFunction)!=null?n:typeof i=="object"?i[t.mode]:i,delay:s.transitionDelay}}function sq(e){return Vt("MuiPaper",e)}jt("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const aq=["className","component","elevation","square","variant"],lq=e=>{const{square:t,elevation:r,variant:n,classes:o}=e,i={root:["root",n,!t&&"rounded",n==="elevation"&&`elevation${r}`]};return tr(i,sq,o)},cq=Xe("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],!r.square&&t.rounded,r.variant==="elevation"&&t[`elevation${r.elevation}`]]}})(({theme:e,ownerState:t})=>{var r;return _({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!t.square&&{borderRadius:e.shape.borderRadius},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.divider}`},t.variant==="elevation"&&_({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&e.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${Lr("#fff",uS(t.elevation))}, ${Lr("#fff",uS(t.elevation))})`},e.vars&&{backgroundImage:(r=e.vars.overlays)==null?void 0:r[t.elevation]}))}),uq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiPaper"}),{className:o,component:i="div",elevation:s=1,square:a=!1,variant:l="elevation"}=n,c=ve(n,aq),u=_({},n,{component:i,elevation:s,square:a,variant:l}),d=lq(u);return O.jsx(cq,_({as:i,ownerState:u,className:Ce(d.root,o),ref:r},c))}),dq=uq;function fq(e){const{className:t,classes:r,pulsate:n=!1,rippleX:o,rippleY:i,rippleSize:s,in:a,onExited:l,timeout:c}=e,[u,d]=S.useState(!1),f=Ce(t,r.ripple,r.rippleVisible,n&&r.ripplePulsate),p={width:s,height:s,top:-(s/2)+i,left:-(s/2)+o},h=Ce(r.child,u&&r.childLeaving,n&&r.childPulsate);return!a&&!u&&d(!0),S.useEffect(()=>{if(!a&&l!=null){const m=setTimeout(l,c);return()=>{clearTimeout(m)}}},[l,a,c]),O.jsx("span",{className:f,style:p,children:O.jsx("span",{className:h})})}const pq=jt("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),wn=pq,hq=["center","classes","className"];let Um=e=>e,fS,pS,hS,mS;const Q0=550,mq=80,gq=cb(fS||(fS=Um` + */function e3(e,t){return dh(e,t)}const XU=(e,t)=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))},QU=["values","unit","step"],ZU=e=>{const t=Object.keys(e).map(r=>({key:r,val:e[r]}))||[];return t.sort((r,n)=>r.val-n.val),t.reduce((r,n)=>_({},r,{[n.key]:n.val}),{})};function eW(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5}=e,o=ve(e,QU),i=ZU(t),s=Object.keys(i);function a(f){return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r})`}function l(f){return`@media (max-width:${(typeof t[f]=="number"?t[f]:f)-n/100}${r})`}function c(f,p){const h=s.indexOf(p);return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r}) and (max-width:${(h!==-1&&typeof t[s[h]]=="number"?t[s[h]]:p)-n/100}${r})`}function u(f){return s.indexOf(f)+1`@media (min-width:${fb[e]}px)`};function ao(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const i=n.breakpoints||tS;return t.reduce((s,a,l)=>(s[i.up(i.keys[l])]=r(t[l]),s),{})}if(typeof t=="object"){const i=n.breakpoints||tS;return Object.keys(t).reduce((s,a)=>{if(Object.keys(i.values||fb).indexOf(a)!==-1){const l=i.up(a);s[l]=r(t[a],a)}else{const l=a;s[l]=t[l]}return s},{})}return r(t)}function t3(e={}){var t;return((t=e.keys)==null?void 0:t.reduce((n,o)=>{const i=e.up(o);return n[i]={},n},{}))||{}}function r3(e,t){return e.reduce((r,n)=>{const o=r[n];return(!o||Object.keys(o).length===0)&&delete r[n],r},t)}function nW(e,...t){const r=t3(e),n=[r,...t].reduce((o,i)=>un(o,i),{});return r3(Object.keys(r),n)}function oW(e,t){if(typeof e!="object")return{};const r={},n=Object.keys(t);return Array.isArray(e)?n.forEach((o,i)=>{i{e[o]!=null&&(r[o]=!0)}),r}function t1({values:e,breakpoints:t,base:r}){const n=r||oW(e,t),o=Object.keys(n);if(o.length===0)return e;let i;return o.reduce((s,a,l)=>(Array.isArray(e)?(s[a]=e[l]!=null?e[l]:e[i],i=l):typeof e=="object"?(s[a]=e[a]!=null?e[a]:e[i],i=a):s[a]=e,s),{})}function Im(e,t,r=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&r){const n=`vars.${t}`.split(".").reduce((o,i)=>o&&o[i]?o[i]:null,e);if(n!=null)return n}return t.split(".").reduce((n,o)=>n&&n[o]!=null?n[o]:null,e)}function fh(e,t,r,n=r){let o;return typeof e=="function"?o=e(r):Array.isArray(e)?o=e[r]||n:o=Im(e,r)||n,t&&(o=t(o,n,e)),o}function Ie(e){const{prop:t,cssProperty:r=e.prop,themeKey:n,transform:o}=e,i=s=>{if(s[t]==null)return null;const a=s[t],l=s.theme,c=Im(l,n)||{};return ao(s,a,d=>{let f=fh(c,o,d);return d===f&&typeof d=="string"&&(f=fh(c,o,`${t}${d==="default"?"":Fe(d)}`,d)),r===!1?f:{[r]:f}})};return i.propTypes={},i.filterProps=[t],i}function iW(e){const t={};return r=>(t[r]===void 0&&(t[r]=e(r)),t[r])}const sW={m:"margin",p:"padding"},aW={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},rS={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},lW=iW(e=>{if(e.length>2)if(rS[e])e=rS[e];else return[e];const[t,r]=e.split(""),n=sW[t],o=aW[r]||"";return Array.isArray(o)?o.map(i=>n+i):[n+o]}),pb=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],hb=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...pb,...hb];function qd(e,t,r,n){var o;const i=(o=Im(e,t,!1))!=null?o:r;return typeof i=="number"?s=>typeof s=="string"?s:i*s:Array.isArray(i)?s=>typeof s=="string"?s:i[s]:typeof i=="function"?i:()=>{}}function mb(e){return qd(e,"spacing",8)}function ma(e,t){if(typeof t=="string"||t==null)return t;const r=Math.abs(t),n=e(r);return t>=0?n:typeof n=="number"?-n:`-${n}`}function cW(e,t){return r=>e.reduce((n,o)=>(n[o]=ma(t,r),n),{})}function uW(e,t,r,n){if(t.indexOf(r)===-1)return null;const o=lW(r),i=cW(o,n),s=e[r];return ao(e,s,i)}function n3(e,t){const r=mb(e.theme);return Object.keys(e).map(n=>uW(e,t,n,r)).reduce(_u,{})}function pt(e){return n3(e,pb)}pt.propTypes={};pt.filterProps=pb;function ht(e){return n3(e,hb)}ht.propTypes={};ht.filterProps=hb;function dW(e=8){if(e.mui)return e;const t=mb({spacing:e}),r=(...n)=>(n.length===0?[1]:n).map(i=>{const s=t(i);return typeof s=="number"?`${s}px`:s}).join(" ");return r.mui=!0,r}function Dm(...e){const t=e.reduce((n,o)=>(o.filterProps.forEach(i=>{n[i]=o}),n),{}),r=n=>Object.keys(n).reduce((o,i)=>t[i]?_u(o,t[i](n)):o,{});return r.propTypes={},r.filterProps=e.reduce((n,o)=>n.concat(o.filterProps),[]),r}function xo(e){return typeof e!="number"?e:`${e}px solid`}const fW=Ie({prop:"border",themeKey:"borders",transform:xo}),pW=Ie({prop:"borderTop",themeKey:"borders",transform:xo}),hW=Ie({prop:"borderRight",themeKey:"borders",transform:xo}),mW=Ie({prop:"borderBottom",themeKey:"borders",transform:xo}),gW=Ie({prop:"borderLeft",themeKey:"borders",transform:xo}),vW=Ie({prop:"borderColor",themeKey:"palette"}),yW=Ie({prop:"borderTopColor",themeKey:"palette"}),bW=Ie({prop:"borderRightColor",themeKey:"palette"}),xW=Ie({prop:"borderBottomColor",themeKey:"palette"}),kW=Ie({prop:"borderLeftColor",themeKey:"palette"}),$m=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=qd(e.theme,"shape.borderRadius",4),r=n=>({borderRadius:ma(t,n)});return ao(e,e.borderRadius,r)}return null};$m.propTypes={};$m.filterProps=["borderRadius"];Dm(fW,pW,hW,mW,gW,vW,yW,bW,xW,kW,$m);const Hm=e=>{if(e.gap!==void 0&&e.gap!==null){const t=qd(e.theme,"spacing",8),r=n=>({gap:ma(t,n)});return ao(e,e.gap,r)}return null};Hm.propTypes={};Hm.filterProps=["gap"];const Bm=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=qd(e.theme,"spacing",8),r=n=>({columnGap:ma(t,n)});return ao(e,e.columnGap,r)}return null};Bm.propTypes={};Bm.filterProps=["columnGap"];const Fm=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=qd(e.theme,"spacing",8),r=n=>({rowGap:ma(t,n)});return ao(e,e.rowGap,r)}return null};Fm.propTypes={};Fm.filterProps=["rowGap"];const wW=Ie({prop:"gridColumn"}),SW=Ie({prop:"gridRow"}),EW=Ie({prop:"gridAutoFlow"}),CW=Ie({prop:"gridAutoColumns"}),MW=Ie({prop:"gridAutoRows"}),TW=Ie({prop:"gridTemplateColumns"}),OW=Ie({prop:"gridTemplateRows"}),_W=Ie({prop:"gridTemplateAreas"}),AW=Ie({prop:"gridArea"});Dm(Hm,Bm,Fm,wW,SW,EW,CW,MW,TW,OW,_W,AW);function Sl(e,t){return t==="grey"?t:e}const NW=Ie({prop:"color",themeKey:"palette",transform:Sl}),RW=Ie({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Sl}),PW=Ie({prop:"backgroundColor",themeKey:"palette",transform:Sl});Dm(NW,RW,PW);function sn(e){return e<=1&&e!==0?`${e*100}%`:e}const zW=Ie({prop:"width",transform:sn}),gb=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=r=>{var n,o;const i=((n=e.theme)==null||(n=n.breakpoints)==null||(n=n.values)==null?void 0:n[r])||fb[r];return i?((o=e.theme)==null||(o=o.breakpoints)==null?void 0:o.unit)!=="px"?{maxWidth:`${i}${e.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:sn(r)}};return ao(e,e.maxWidth,t)}return null};gb.filterProps=["maxWidth"];const LW=Ie({prop:"minWidth",transform:sn}),IW=Ie({prop:"height",transform:sn}),DW=Ie({prop:"maxHeight",transform:sn}),$W=Ie({prop:"minHeight",transform:sn});Ie({prop:"size",cssProperty:"width",transform:sn});Ie({prop:"size",cssProperty:"height",transform:sn});const HW=Ie({prop:"boxSizing"});Dm(zW,gb,LW,IW,DW,$W,HW);const BW={border:{themeKey:"borders",transform:xo},borderTop:{themeKey:"borders",transform:xo},borderRight:{themeKey:"borders",transform:xo},borderBottom:{themeKey:"borders",transform:xo},borderLeft:{themeKey:"borders",transform:xo},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:$m},color:{themeKey:"palette",transform:Sl},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Sl},backgroundColor:{themeKey:"palette",transform:Sl},p:{style:ht},pt:{style:ht},pr:{style:ht},pb:{style:ht},pl:{style:ht},px:{style:ht},py:{style:ht},padding:{style:ht},paddingTop:{style:ht},paddingRight:{style:ht},paddingBottom:{style:ht},paddingLeft:{style:ht},paddingX:{style:ht},paddingY:{style:ht},paddingInline:{style:ht},paddingInlineStart:{style:ht},paddingInlineEnd:{style:ht},paddingBlock:{style:ht},paddingBlockStart:{style:ht},paddingBlockEnd:{style:ht},m:{style:pt},mt:{style:pt},mr:{style:pt},mb:{style:pt},ml:{style:pt},mx:{style:pt},my:{style:pt},margin:{style:pt},marginTop:{style:pt},marginRight:{style:pt},marginBottom:{style:pt},marginLeft:{style:pt},marginX:{style:pt},marginY:{style:pt},marginInline:{style:pt},marginInlineStart:{style:pt},marginInlineEnd:{style:pt},marginBlock:{style:pt},marginBlockStart:{style:pt},marginBlockEnd:{style:pt},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Hm},rowGap:{style:Fm},columnGap:{style:Bm},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:sn},maxWidth:{style:gb},minWidth:{transform:sn},height:{transform:sn},maxHeight:{transform:sn},minHeight:{transform:sn},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},Vm=BW;function FW(...e){const t=e.reduce((n,o)=>n.concat(Object.keys(o)),[]),r=new Set(t);return e.every(n=>r.size===Object.keys(n).length)}function VW(e,t){return typeof e=="function"?e(t):e}function jW(){function e(r,n,o,i){const s={[r]:n,theme:o},a=i[r];if(!a)return{[r]:n};const{cssProperty:l=r,themeKey:c,transform:u,style:d}=a;if(n==null)return null;if(c==="typography"&&n==="inherit")return{[r]:n};const f=Im(o,c)||{};return d?d(s):ao(s,n,h=>{let m=fh(f,u,h);return h===m&&typeof h=="string"&&(m=fh(f,u,`${r}${h==="default"?"":Fe(h)}`,h)),l===!1?m:{[l]:m}})}function t(r){var n;const{sx:o,theme:i={}}=r||{};if(!o)return null;const s=(n=i.unstable_sxConfig)!=null?n:Vm;function a(l){let c=l;if(typeof l=="function")c=l(i);else if(typeof l!="object")return l;if(!c)return null;const u=t3(i.breakpoints),d=Object.keys(u);let f=u;return Object.keys(c).forEach(p=>{const h=VW(c[p],i);if(h!=null)if(typeof h=="object")if(s[p])f=_u(f,e(p,h,i,s));else{const m=ao({theme:i},h,b=>({[p]:b}));FW(m,h)?f[p]=t({sx:h,theme:i}):f=_u(f,m)}else f=_u(f,e(p,h,i,s))}),r3(d,f)}return Array.isArray(o)?o.map(a):a(o)}return t}const o3=jW();o3.filterProps=["sx"];const jm=o3,UW=["breakpoints","palette","spacing","shape"];function Um(e={},...t){const{breakpoints:r={},palette:n={},spacing:o,shape:i={}}=e,s=ve(e,UW),a=eW(r),l=dW(o);let c=un({breakpoints:a,direction:"ltr",components:{},palette:_({mode:"light"},n),spacing:l,shape:_({},rW,i)},s);return c=t.reduce((u,d)=>un(u,d),c),c.unstable_sxConfig=_({},Vm,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(d){return jm({sx:d,theme:this})},c}function WW(e){return Object.keys(e).length===0}function vb(e=null){const t=S.useContext(ub);return!t||WW(t)?e:t}const KW=Um();function yb(e=KW){return vb(e)}const qW=["sx"],GW=e=>{var t,r;const n={systemProps:{},otherProps:{}},o=(t=e==null||(r=e.theme)==null?void 0:r.unstable_sxConfig)!=null?t:Vm;return Object.keys(e).forEach(i=>{o[i]?n.systemProps[i]=e[i]:n.otherProps[i]=e[i]}),n};function bb(e){const{sx:t}=e,r=ve(e,qW),{systemProps:n,otherProps:o}=GW(r);let i;return Array.isArray(t)?i=[n,...t]:typeof t=="function"?i=(...s)=>{const a=t(...s);return Wo(a)?_({},n,a):n}:i=_({},n,t),_({},o,{sx:i})}function i3(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ta!=="theme"&&a!=="sx"&&a!=="as"})(jm);return S.forwardRef(function(l,c){const u=yb(r),d=bb(l),{className:f,component:p="div"}=d,h=ve(d,YW);return O.jsx(i,_({as:p,ref:c,className:Ce(f,o?o(n):n),theme:t&&u[t]||u},h))})}const XW=["variant"];function nS(e){return e.length===0}function s3(e){const{variant:t}=e,r=ve(e,XW);let n=t||"";return Object.keys(r).sort().forEach(o=>{o==="color"?n+=nS(n)?e[o]:Fe(e[o]):n+=`${nS(n)?o:Fe(o)}${Fe(e[o].toString())}`}),n}const QW=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function ZW(e){return Object.keys(e).length===0}function eK(e){return typeof e=="string"&&e.charCodeAt(0)>96}const tK=(e,t)=>t.components&&t.components[e]&&t.components[e].styleOverrides?t.components[e].styleOverrides:null,ph=e=>{const t={};return e&&e.forEach(r=>{const n=s3(r.props);t[n]=r.style}),t},rK=(e,t)=>{let r=[];return t&&t.components&&t.components[e]&&t.components[e].variants&&(r=t.components[e].variants),ph(r)},hh=(e,t,r)=>{const{ownerState:n={}}=e,o=[];return r&&r.forEach(i=>{let s=!0;Object.keys(i.props).forEach(a=>{n[a]!==i.props[a]&&e[a]!==i.props[a]&&(s=!1)}),s&&o.push(t[s3(i.props)])}),o},nK=(e,t,r,n)=>{var o;const i=r==null||(o=r.components)==null||(o=o[n])==null?void 0:o.variants;return hh(e,t,i)};function fp(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const oK=Um(),iK=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function pp({defaultTheme:e,theme:t,themeId:r}){return ZW(t)?e:t[r]||t}function sK(e){return e?(t,r)=>r[e]:null}const oS=({styledArg:e,props:t,defaultTheme:r,themeId:n})=>{const o=e(_({},t,{theme:pp(_({},t,{defaultTheme:r,themeId:n}))}));let i;if(o&&o.variants&&(i=o.variants,delete o.variants),i){const s=hh(t,ph(i),i);return[o,...s]}return o};function a3(e={}){const{themeId:t,defaultTheme:r=oK,rootShouldForwardProp:n=fp,slotShouldForwardProp:o=fp}=e,i=s=>jm(_({},s,{theme:pp(_({},s,{defaultTheme:r,themeId:t}))}));return i.__mui_systemSx=!0,(s,a={})=>{XU(s,x=>x.filter(k=>!(k!=null&&k.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:d,overridesResolver:f=sK(iK(c))}=a,p=ve(a,QW),h=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,m=d||!1;let b,v=fp;c==="Root"||c==="root"?v=n:c?v=o:eK(s)&&(v=void 0);const g=e3(s,_({shouldForwardProp:v,label:b},p)),y=(x,...k)=>{const w=k?k.map(M=>{if(typeof M=="function"&&M.__emotion_real!==M)return N=>oS({styledArg:M,props:N,defaultTheme:r,themeId:t});if(Wo(M)){let N=M,F;return M&&M.variants&&(F=M.variants,delete N.variants,N=I=>{let V=M;return hh(I,ph(F),F).forEach(z=>{V=un(V,z)}),V}),N}return M}):[];let E=x;if(Wo(x)){let M;x&&x.variants&&(M=x.variants,delete E.variants,E=N=>{let F=x;return hh(N,ph(M),M).forEach(V=>{F=un(F,V)}),F})}else typeof x=="function"&&x.__emotion_real!==x&&(E=M=>oS({styledArg:x,props:M,defaultTheme:r,themeId:t}));l&&f&&w.push(M=>{const N=pp(_({},M,{defaultTheme:r,themeId:t})),F=tK(l,N);if(F){const I={};return Object.entries(F).forEach(([V,j])=>{I[V]=typeof j=="function"?j(_({},M,{theme:N})):j}),f(M,I)}return null}),l&&!h&&w.push(M=>{const N=pp(_({},M,{defaultTheme:r,themeId:t}));return nK(M,rK(l,N),N,l)}),m||w.push(i);const T=w.length-k.length;if(Array.isArray(x)&&T>0){const M=new Array(T).fill("");E=[...x,...M],E.raw=[...x.raw,...M]}const C=g(E,...w);return s.muiName&&(C.muiName=s.muiName),C};return g.withConfig&&(y.withConfig=g.withConfig),y}}const aK=a3(),lK=aK;function cK(e){const{theme:t,name:r,props:n}=e;return!t||!t.components||!t.components[r]||!t.components[r].defaultProps?n:IT(t.components[r].defaultProps,n)}function l3({props:e,name:t,defaultTheme:r,themeId:n}){let o=yb(r);return n&&(o=o[n]||o),cK({theme:o,name:t,props:e})}function xb(e,t=0,r=1){return Math.min(Math.max(t,e),r)}function uK(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let r=e.match(t);return r&&r[0].length===1&&(r=r.map(n=>n+n)),r?`rgb${r.length===4?"a":""}(${r.map((n,o)=>o<3?parseInt(n,16):Math.round(parseInt(n,16)/255*1e3)/1e3).join(", ")})`:""}function ga(e){if(e.type)return e;if(e.charAt(0)==="#")return ga(uK(e));const t=e.indexOf("("),r=e.substring(0,t);if(["rgb","rgba","hsl","hsla","color"].indexOf(r)===-1)throw new Error(Wl(9,e));let n=e.substring(t+1,e.length-1),o;if(r==="color"){if(n=n.split(" "),o=n.shift(),n.length===4&&n[3].charAt(0)==="/"&&(n[3]=n[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(o)===-1)throw new Error(Wl(10,o))}else n=n.split(",");return n=n.map(i=>parseFloat(i)),{type:r,values:n,colorSpace:o}}function Wm(e){const{type:t,colorSpace:r}=e;let{values:n}=e;return t.indexOf("rgb")!==-1?n=n.map((o,i)=>i<3?parseInt(o,10):o):t.indexOf("hsl")!==-1&&(n[1]=`${n[1]}%`,n[2]=`${n[2]}%`),t.indexOf("color")!==-1?n=`${r} ${n.join(" ")}`:n=`${n.join(", ")}`,`${t}(${n})`}function dK(e){e=ga(e);const{values:t}=e,r=t[0],n=t[1]/100,o=t[2]/100,i=n*Math.min(o,1-o),s=(c,u=(c+r/30)%12)=>o-i*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return e.type==="hsla"&&(a+="a",l.push(t[3])),Wm({type:a,values:l})}function iS(e){e=ga(e);let t=e.type==="hsl"||e.type==="hsla"?ga(dK(e)).values:e.values;return t=t.map(r=>(e.type!=="color"&&(r/=255),r<=.03928?r/12.92:((r+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function fK(e,t){const r=iS(e),n=iS(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}function Lr(e,t){return e=ga(e),t=xb(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Wm(e)}function pK(e,t){if(e=ga(e),t=xb(t),e.type.indexOf("hsl")!==-1)e.values[2]*=1-t;else if(e.type.indexOf("rgb")!==-1||e.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)e.values[r]*=1-t;return Wm(e)}function hK(e,t){if(e=ga(e),t=xb(t),e.type.indexOf("hsl")!==-1)e.values[2]+=(100-e.values[2])*t;else if(e.type.indexOf("rgb")!==-1)for(let r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(e.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return Wm(e)}const mK=S.createContext(null),c3=mK;function u3(){return S.useContext(c3)}const gK=typeof Symbol=="function"&&Symbol.for,vK=gK?Symbol.for("mui.nested"):"__THEME_NESTED__";function yK(e,t){return typeof t=="function"?t(e):_({},e,t)}function bK(e){const{children:t,theme:r}=e,n=u3(),o=S.useMemo(()=>{const i=n===null?r:yK(n,r);return i!=null&&(i[vK]=n!==null),i},[r,n]);return O.jsx(c3.Provider,{value:o,children:t})}const sS={};function aS(e,t,r,n=!1){return S.useMemo(()=>{const o=e&&t[e]||t;if(typeof r=="function"){const i=r(o),s=e?_({},t,{[e]:i}):i;return n?()=>s:s}return e?_({},t,{[e]:r}):_({},t,r)},[e,t,r,n])}function xK(e){const{children:t,theme:r,themeId:n}=e,o=vb(sS),i=u3()||sS,s=aS(n,o,r),a=aS(n,i,r,!0);return O.jsx(bK,{theme:a,children:O.jsx(ub.Provider,{value:s,children:t})})}const kK=["component","direction","spacing","divider","children","className","useFlexGap"],wK=Um(),SK=lK("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root});function EK(e){return l3({props:e,name:"MuiStack",defaultTheme:wK})}function CK(e,t){const r=S.Children.toArray(e).filter(Boolean);return r.reduce((n,o,i)=>(n.push(o),i({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],TK=({ownerState:e,theme:t})=>{let r=_({display:"flex",flexDirection:"column"},ao({theme:t},t1({values:e.direction,breakpoints:t.breakpoints.values}),n=>({flexDirection:n})));if(e.spacing){const n=mb(t),o=Object.keys(t.breakpoints.values).reduce((l,c)=>((typeof e.spacing=="object"&&e.spacing[c]!=null||typeof e.direction=="object"&&e.direction[c]!=null)&&(l[c]=!0),l),{}),i=t1({values:e.direction,base:o}),s=t1({values:e.spacing,base:o});typeof i=="object"&&Object.keys(i).forEach((l,c,u)=>{if(!i[l]){const f=c>0?i[u[c-1]]:"column";i[l]=f}}),r=un(r,ao({theme:t},s,(l,c)=>e.useFlexGap?{gap:ma(n,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${MK(c?i[c]:e.direction)}`]:ma(n,l)}}))}return r=nW(t.breakpoints,r),r};function OK(e={}){const{createStyledComponent:t=SK,useThemeProps:r=EK,componentName:n="MuiStack"}=e,o=()=>rr({root:["root"]},l=>Vt(n,l),{}),i=t(TK);return S.forwardRef(function(l,c){const u=r(l),d=bb(u),{component:f="div",direction:p="column",spacing:h=0,divider:m,children:b,className:v,useFlexGap:g=!1}=d,y=ve(d,kK),x={direction:p,spacing:h,useFlexGap:g},k=o();return O.jsx(i,_({as:f,ownerState:x,ref:c,className:Ce(k.root,v)},y,{children:m?CK(b,m):b}))})}function _K(e,t){return _({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},t)}const AK=["mode","contrastThreshold","tonalOffset"],lS={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:dd.white,default:dd.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},r1={text:{primary:dd.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:dd.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function cS(e,t,r,n){const o=n.light||n,i=n.dark||n*1.5;e[t]||(e.hasOwnProperty(r)?e[t]=e[r]:t==="light"?e.light=hK(e.main,o):t==="dark"&&(e.dark=pK(e.main,i)))}function NK(e="light"){return e==="dark"?{main:Ia[200],light:Ia[50],dark:Ia[400]}:{main:Ia[700],light:Ia[400],dark:Ia[800]}}function RK(e="light"){return e==="dark"?{main:La[200],light:La[50],dark:La[400]}:{main:La[500],light:La[300],dark:La[700]}}function PK(e="light"){return e==="dark"?{main:za[500],light:za[300],dark:za[700]}:{main:za[700],light:za[400],dark:za[800]}}function zK(e="light"){return e==="dark"?{main:Da[400],light:Da[300],dark:Da[700]}:{main:Da[700],light:Da[500],dark:Da[900]}}function LK(e="light"){return e==="dark"?{main:$a[400],light:$a[300],dark:$a[700]}:{main:$a[800],light:$a[500],dark:$a[900]}}function IK(e="light"){return e==="dark"?{main:Tc[400],light:Tc[300],dark:Tc[700]}:{main:"#ed6c02",light:Tc[500],dark:Tc[900]}}function DK(e){const{mode:t="light",contrastThreshold:r=3,tonalOffset:n=.2}=e,o=ve(e,AK),i=e.primary||NK(t),s=e.secondary||RK(t),a=e.error||PK(t),l=e.info||zK(t),c=e.success||LK(t),u=e.warning||IK(t);function d(m){return fK(m,r1.text.primary)>=r?r1.text.primary:lS.text.primary}const f=({color:m,name:b,mainShade:v=500,lightShade:g=300,darkShade:y=700})=>{if(m=_({},m),!m.main&&m[v]&&(m.main=m[v]),!m.hasOwnProperty("main"))throw new Error(Wl(11,b?` (${b})`:"",v));if(typeof m.main!="string")throw new Error(Wl(12,b?` (${b})`:"",JSON.stringify(m.main)));return cS(m,"light",g,n),cS(m,"dark",y,n),m.contrastText||(m.contrastText=d(m.main)),m},p={dark:r1,light:lS};return un(_({common:_({},dd),mode:t,primary:f({color:i,name:"primary"}),secondary:f({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:f({color:a,name:"error"}),warning:f({color:u,name:"warning"}),info:f({color:l,name:"info"}),success:f({color:c,name:"success"}),grey:Nj,contrastThreshold:r,getContrastText:d,augmentColor:f,tonalOffset:n},p[t]),o)}const $K=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function HK(e){return Math.round(e*1e5)/1e5}const uS={textTransform:"uppercase"},dS='"Roboto", "Helvetica", "Arial", sans-serif';function BK(e,t){const r=typeof t=="function"?t(e):t,{fontFamily:n=dS,fontSize:o=14,fontWeightLight:i=300,fontWeightRegular:s=400,fontWeightMedium:a=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:d}=r,f=ve(r,$K),p=o/14,h=d||(v=>`${v/c*p}rem`),m=(v,g,y,x,k)=>_({fontFamily:n,fontWeight:v,fontSize:h(g),lineHeight:y},n===dS?{letterSpacing:`${HK(x/g)}em`}:{},k,u),b={h1:m(i,96,1.167,-1.5),h2:m(i,60,1.2,-.5),h3:m(s,48,1.167,0),h4:m(s,34,1.235,.25),h5:m(s,24,1.334,0),h6:m(a,20,1.6,.15),subtitle1:m(s,16,1.75,.15),subtitle2:m(a,14,1.57,.1),body1:m(s,16,1.5,.15),body2:m(s,14,1.43,.15),button:m(a,14,1.75,.4,uS),caption:m(s,12,1.66,.4),overline:m(s,12,2.66,1,uS),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return un(_({htmlFontSize:c,pxToRem:h,fontFamily:n,fontSize:o,fontWeightLight:i,fontWeightRegular:s,fontWeightMedium:a,fontWeightBold:l},b),f,{clone:!1})}const FK=.2,VK=.14,jK=.12;function nt(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${FK})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${VK})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${jK})`].join(",")}const UK=["none",nt(0,2,1,-1,0,1,1,0,0,1,3,0),nt(0,3,1,-2,0,2,2,0,0,1,5,0),nt(0,3,3,-2,0,3,4,0,0,1,8,0),nt(0,2,4,-1,0,4,5,0,0,1,10,0),nt(0,3,5,-1,0,5,8,0,0,1,14,0),nt(0,3,5,-1,0,6,10,0,0,1,18,0),nt(0,4,5,-2,0,7,10,1,0,2,16,1),nt(0,5,5,-3,0,8,10,1,0,3,14,2),nt(0,5,6,-3,0,9,12,1,0,3,16,2),nt(0,6,6,-3,0,10,14,1,0,4,18,3),nt(0,6,7,-4,0,11,15,1,0,4,20,3),nt(0,7,8,-4,0,12,17,2,0,5,22,4),nt(0,7,8,-4,0,13,19,2,0,5,24,4),nt(0,7,9,-4,0,14,21,2,0,5,26,4),nt(0,8,9,-5,0,15,22,2,0,6,28,5),nt(0,8,10,-5,0,16,24,2,0,6,30,5),nt(0,8,11,-5,0,17,26,2,0,6,32,5),nt(0,9,11,-5,0,18,28,2,0,7,34,6),nt(0,9,12,-6,0,19,29,2,0,7,36,6),nt(0,10,13,-6,0,20,31,3,0,8,38,7),nt(0,10,13,-6,0,21,33,3,0,8,40,7),nt(0,10,14,-6,0,22,35,3,0,8,42,7),nt(0,11,14,-7,0,23,36,3,0,9,44,8),nt(0,11,15,-7,0,24,38,3,0,9,46,8)],WK=UK,KK=["duration","easing","delay"],qK={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},GK={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function fS(e){return`${Math.round(e)}ms`}function YK(e){if(!e)return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function JK(e){const t=_({},qK,e.easing),r=_({},GK,e.duration);return _({getAutoHeightDuration:YK,create:(o=["all"],i={})=>{const{duration:s=r.standard,easing:a=t.easeInOut,delay:l=0}=i;return ve(i,KK),(Array.isArray(o)?o:[o]).map(c=>`${c} ${typeof s=="string"?s:fS(s)} ${a} ${typeof l=="string"?l:fS(l)}`).join(",")}},e,{easing:t,duration:r})}const XK={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},QK=XK,ZK=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function kb(e={},...t){const{mixins:r={},palette:n={},transitions:o={},typography:i={}}=e,s=ve(e,ZK);if(e.vars)throw new Error(Wl(18));const a=DK(n),l=Um(e);let c=un(l,{mixins:_K(l.breakpoints,r),palette:a,shadows:WK.slice(),typography:BK(a,i),transitions:JK(o),zIndex:_({},QK)});return c=un(c,s),c=t.reduce((u,d)=>un(u,d),c),c.unstable_sxConfig=_({},Vm,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(d){return jm({sx:d,theme:this})},c}const eq=kb(),wb=eq;function Km(){const e=yb(wb);return e[Kl]||e}function Wt({props:e,name:t}){return l3({props:e,name:t,defaultTheme:wb,themeId:Kl})}const Sb=e=>fp(e)&&e!=="classes",tq=a3({themeId:Kl,defaultTheme:wb,rootShouldForwardProp:Sb}),Xe=tq,rq=["theme"];function nq(e){let{theme:t}=e,r=ve(e,rq);const n=t[Kl];return O.jsx(xK,_({},r,{themeId:n?Kl:void 0,theme:n||t}))}const oq=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)},pS=oq;function Z0(e,t){return Z0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Z0(e,t)}function d3(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Z0(e,t)}const hS={disabled:!1},mh=L.createContext(null);var iq=function(t){return t.scrollTop},lu="unmounted",Ns="exited",Rs="entering",Ya="entered",ev="exiting",fi=function(e){d3(t,e);function t(n,o){var i;i=e.call(this,n,o)||this;var s=o,a=s&&!s.isMounting?n.enter:n.appear,l;return i.appearStatus=null,n.in?a?(l=Ns,i.appearStatus=Rs):l=Ya:n.unmountOnExit||n.mountOnEnter?l=lu:l=Ns,i.state={status:l},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var s=o.in;return s&&i.status===lu?{status:Ns}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(o){var i=null;if(o!==this.props){var s=this.state.status;this.props.in?s!==Rs&&s!==Ya&&(i=Rs):(s===Rs||s===Ya)&&(i=ev)}this.updateStatus(!1,i)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var o=this.props.timeout,i,s,a;return i=s=a=o,o!=null&&typeof o!="number"&&(i=o.exit,s=o.enter,a=o.appear!==void 0?o.appear:s),{exit:i,enter:s,appear:a}},r.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===Rs){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:wf.findDOMNode(this);s&&iq(s)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ns&&this.setState({status:lu})},r.performEnter=function(o){var i=this,s=this.props.enter,a=this.context?this.context.isMounting:o,l=this.props.nodeRef?[a]:[wf.findDOMNode(this),a],c=l[0],u=l[1],d=this.getTimeouts(),f=a?d.appear:d.enter;if(!o&&!s||hS.disabled){this.safeSetState({status:Ya},function(){i.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:Rs},function(){i.props.onEntering(c,u),i.onTransitionEnd(f,function(){i.safeSetState({status:Ya},function(){i.props.onEntered(c,u)})})})},r.performExit=function(){var o=this,i=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:wf.findDOMNode(this);if(!i||hS.disabled){this.safeSetState({status:Ns},function(){o.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:ev},function(){o.props.onExiting(a),o.onTransitionEnd(s.exit,function(){o.safeSetState({status:Ns},function(){o.props.onExited(a)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},r.setNextCallback=function(o){var i=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,i.nextCallback=null,o(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},r.onTransitionEnd=function(o,i){this.setNextCallback(i);var s=this.props.nodeRef?this.props.nodeRef.current:wf.findDOMNode(this),a=o==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}o!=null&&setTimeout(this.nextCallback,o)},r.render=function(){var o=this.state.status;if(o===lu)return null;var i=this.props,s=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var a=ve(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return L.createElement(mh.Provider,{value:null},typeof s=="function"?s(o,a):L.cloneElement(L.Children.only(s),a))},t}(L.Component);fi.contextType=mh;fi.propTypes={};function Ha(){}fi.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ha,onEntering:Ha,onEntered:Ha,onExit:Ha,onExiting:Ha,onExited:Ha};fi.UNMOUNTED=lu;fi.EXITED=Ns;fi.ENTERING=Rs;fi.ENTERED=Ya;fi.EXITING=ev;const f3=fi;function sq(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Eb(e,t){var r=function(i){return t&&S.isValidElement(i)?t(i):i},n=Object.create(null);return e&&S.Children.map(e,function(o){return o}).forEach(function(o){n[o.key]=r(o)}),n}function aq(e,t){e=e||{},t=t||{};function r(u){return u in t?t[u]:e[u]}var n=Object.create(null),o=[];for(var i in e)i in t?o.length&&(n[i]=o,o=[]):o.push(i);var s,a={};for(var l in t){if(n[l])for(s=0;se.scrollTop;function gh(e,t){var r,n;const{timeout:o,easing:i,style:s={}}=e;return{duration:(r=s.transitionDuration)!=null?r:typeof o=="number"?o:o[t.mode]||0,easing:(n=s.transitionTimingFunction)!=null?n:typeof i=="object"?i[t.mode]:i,delay:s.transitionDelay}}function pq(e){return Vt("MuiPaper",e)}jt("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const hq=["className","component","elevation","square","variant"],mq=e=>{const{square:t,elevation:r,variant:n,classes:o}=e,i={root:["root",n,!t&&"rounded",n==="elevation"&&`elevation${r}`]};return rr(i,pq,o)},gq=Xe("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],!r.square&&t.rounded,r.variant==="elevation"&&t[`elevation${r.elevation}`]]}})(({theme:e,ownerState:t})=>{var r;return _({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!t.square&&{borderRadius:e.shape.borderRadius},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.divider}`},t.variant==="elevation"&&_({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&e.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${Lr("#fff",pS(t.elevation))}, ${Lr("#fff",pS(t.elevation))})`},e.vars&&{backgroundImage:(r=e.vars.overlays)==null?void 0:r[t.elevation]}))}),vq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiPaper"}),{className:o,component:i="div",elevation:s=1,square:a=!1,variant:l="elevation"}=n,c=ve(n,hq),u=_({},n,{component:i,elevation:s,square:a,variant:l}),d=mq(u);return O.jsx(gq,_({as:i,ownerState:u,className:Ce(d.root,o),ref:r},c))}),yq=vq;function bq(e){const{className:t,classes:r,pulsate:n=!1,rippleX:o,rippleY:i,rippleSize:s,in:a,onExited:l,timeout:c}=e,[u,d]=S.useState(!1),f=Ce(t,r.ripple,r.rippleVisible,n&&r.ripplePulsate),p={width:s,height:s,top:-(s/2)+i,left:-(s/2)+o},h=Ce(r.child,u&&r.childLeaving,n&&r.childPulsate);return!a&&!u&&d(!0),S.useEffect(()=>{if(!a&&l!=null){const m=setTimeout(l,c);return()=>{clearTimeout(m)}}},[l,a,c]),O.jsx("span",{className:f,style:p,children:O.jsx("span",{className:h})})}const xq=jt("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Sn=xq,kq=["center","classes","className"];let qm=e=>e,mS,gS,vS,yS;const tv=550,wq=80,Sq=db(mS||(mS=qm` 0% { transform: scale(0); opacity: 0.1; @@ -128,7 +128,7 @@ Error generating stack: `+i.message+` transform: scale(1); opacity: 0.3; } -`)),vq=cb(pS||(pS=Um` +`)),Eq=db(gS||(gS=qm` 0% { opacity: 1; } @@ -136,7 +136,7 @@ Error generating stack: `+i.message+` 100% { opacity: 0; } -`)),yq=cb(hS||(hS=Um` +`)),Cq=db(vS||(vS=qm` 0% { transform: scale(1); } @@ -148,7 +148,7 @@ Error generating stack: `+i.message+` 100% { transform: scale(1); } -`)),bq=Xe("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),xq=Xe(fq,{name:"MuiTouchRipple",slot:"Ripple"})(mS||(mS=Um` +`)),Mq=Xe("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),Tq=Xe(bq,{name:"MuiTouchRipple",slot:"Ripple"})(yS||(yS=qm` opacity: 0; position: absolute; @@ -191,7 +191,7 @@ Error generating stack: `+i.message+` animation-iteration-count: infinite; animation-delay: 200ms; } -`),wn.rippleVisible,gq,Q0,({theme:e})=>e.transitions.easing.easeInOut,wn.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,wn.child,wn.childLeaving,vq,Q0,({theme:e})=>e.transitions.easing.easeInOut,wn.childPulsate,yq,({theme:e})=>e.transitions.easing.easeInOut),kq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiTouchRipple"}),{center:o=!1,classes:i={},className:s}=n,a=ve(n,hq),[l,c]=S.useState([]),u=S.useRef(0),d=S.useRef(null);S.useEffect(()=>{d.current&&(d.current(),d.current=null)},[l]);const f=S.useRef(!1),p=S.useRef(0),h=S.useRef(null),m=S.useRef(null);S.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const b=S.useCallback(x=>{const{pulsate:k,rippleX:w,rippleY:E,rippleSize:M,cb:C}=x;c(T=>[...T,O.jsx(xq,{classes:{ripple:Ce(i.ripple,wn.ripple),rippleVisible:Ce(i.rippleVisible,wn.rippleVisible),ripplePulsate:Ce(i.ripplePulsate,wn.ripplePulsate),child:Ce(i.child,wn.child),childLeaving:Ce(i.childLeaving,wn.childLeaving),childPulsate:Ce(i.childPulsate,wn.childPulsate)},timeout:Q0,pulsate:k,rippleX:w,rippleY:E,rippleSize:M},u.current)]),u.current+=1,d.current=C},[i]),v=S.useCallback((x={},k={},w=()=>{})=>{const{pulsate:E=!1,center:M=o||k.pulsate,fakeElement:C=!1}=k;if((x==null?void 0:x.type)==="mousedown"&&f.current){f.current=!1;return}(x==null?void 0:x.type)==="touchstart"&&(f.current=!0);const T=C?null:m.current,N=T?T.getBoundingClientRect():{width:0,height:0,left:0,top:0};let F,I,V;if(M||x===void 0||x.clientX===0&&x.clientY===0||!x.clientX&&!x.touches)F=Math.round(N.width/2),I=Math.round(N.height/2);else{const{clientX:j,clientY:z}=x.touches&&x.touches.length>0?x.touches[0]:x;F=Math.round(j-N.left),I=Math.round(z-N.top)}if(M)V=Math.sqrt((2*N.width**2+N.height**2)/3),V%2===0&&(V+=1);else{const j=Math.max(Math.abs((T?T.clientWidth:0)-F),F)*2+2,z=Math.max(Math.abs((T?T.clientHeight:0)-I),I)*2+2;V=Math.sqrt(j**2+z**2)}x!=null&&x.touches?h.current===null&&(h.current=()=>{b({pulsate:E,rippleX:F,rippleY:I,rippleSize:V,cb:w})},p.current=setTimeout(()=>{h.current&&(h.current(),h.current=null)},mq)):b({pulsate:E,rippleX:F,rippleY:I,rippleSize:V,cb:w})},[o,b]),g=S.useCallback(()=>{v({},{pulsate:!0})},[v]),y=S.useCallback((x,k)=>{if(clearTimeout(p.current),(x==null?void 0:x.type)==="touchend"&&h.current){h.current(),h.current=null,p.current=setTimeout(()=>{y(x,k)});return}h.current=null,c(w=>w.length>0?w.slice(1):w),d.current=k},[]);return S.useImperativeHandle(r,()=>({pulsate:g,start:v,stop:y}),[g,v,y]),O.jsx(bq,_({className:Ce(wn.root,i.root,s),ref:m},a,{children:O.jsx(iq,{component:null,exit:!0,children:l})}))}),wq=kq;function Sq(e){return Vt("MuiButtonBase",e)}const Eq=jt("MuiButtonBase",["root","disabled","focusVisible"]),Cq=Eq,Mq=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],Tq=e=>{const{disabled:t,focusVisible:r,focusVisibleClassName:n,classes:o}=e,s=tr({root:["root",t&&"disabled",r&&"focusVisible"]},Sq,o);return r&&n&&(s.root+=` ${n}`),s},Oq=Xe("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Cq.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),_q=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiButtonBase"}),{action:o,centerRipple:i=!1,children:s,className:a,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:d=!1,focusRipple:f=!1,LinkComponent:p="a",onBlur:h,onClick:m,onContextMenu:b,onDragLeave:v,onFocus:g,onFocusVisible:y,onKeyDown:x,onKeyUp:k,onMouseDown:w,onMouseLeave:E,onMouseUp:M,onTouchEnd:C,onTouchMove:T,onTouchStart:N,tabIndex:F=0,TouchRippleProps:I,touchRippleRef:V,type:j}=n,z=ve(n,Mq),q=S.useRef(null),A=S.useRef(null),P=Ur(A,V),{isFocusVisibleRef:B,onFocus:Y,onBlur:J,ref:Ne}=_T(),[ie,ue]=S.useState(!1);c&&ie&&ue(!1),S.useImperativeHandle(o,()=>({focusVisible:()=>{ue(!0),q.current.focus()}}),[]);const[de,he]=S.useState(!1);S.useEffect(()=>{he(!0)},[]);const Me=de&&!u&&!c;S.useEffect(()=>{ie&&f&&!u&&de&&A.current.pulsate()},[u,f,ie,de]);function Se(fe,yn,dc=d){return Ks(gi=>(yn&&yn(gi),!dc&&A.current&&A.current[fe](gi),!0))}const ft=Se("start",w),rt=Se("stop",b),Or=Se("stop",v),pe=Se("stop",M),De=Se("stop",fe=>{ie&&fe.preventDefault(),E&&E(fe)}),Ke=Se("start",N),Bn=Se("stop",C),qr=Se("stop",T),rr=Se("stop",fe=>{J(fe),B.current===!1&&ue(!1),h&&h(fe)},!1),zo=Ks(fe=>{q.current||(q.current=fe.currentTarget),Y(fe),B.current===!0&&(ue(!0),y&&y(fe)),g&&g(fe)}),Pt=()=>{const fe=q.current;return l&&l!=="button"&&!(fe.tagName==="A"&&fe.href)},Gr=S.useRef(!1),gn=Ks(fe=>{f&&!Gr.current&&ie&&A.current&&fe.key===" "&&(Gr.current=!0,A.current.stop(fe,()=>{A.current.start(fe)})),fe.target===fe.currentTarget&&Pt()&&fe.key===" "&&fe.preventDefault(),x&&x(fe),fe.target===fe.currentTarget&&Pt()&&fe.key==="Enter"&&!c&&(fe.preventDefault(),m&&m(fe))}),Fn=Ks(fe=>{f&&fe.key===" "&&A.current&&ie&&!fe.defaultPrevented&&(Gr.current=!1,A.current.stop(fe,()=>{A.current.pulsate(fe)})),k&&k(fe),m&&fe.target===fe.currentTarget&&Pt()&&fe.key===" "&&!fe.defaultPrevented&&m(fe)});let Qe=l;Qe==="button"&&(z.href||z.to)&&(Qe=p);const Yr={};Qe==="button"?(Yr.type=j===void 0?"button":j,Yr.disabled=c):(!z.href&&!z.to&&(Yr.role="button"),c&&(Yr["aria-disabled"]=c));const vn=Ur(r,Ne,q),mi=_({},n,{centerRipple:i,component:l,disabled:c,disableRipple:u,disableTouchRipple:d,focusRipple:f,tabIndex:F,focusVisible:ie}),Oa=Tq(mi);return O.jsxs(Oq,_({as:Qe,className:Ce(Oa.root,a),ownerState:mi,onBlur:rr,onClick:m,onContextMenu:rt,onFocus:zo,onKeyDown:gn,onKeyUp:Fn,onMouseDown:ft,onMouseLeave:De,onMouseUp:pe,onDragLeave:Or,onTouchEnd:Bn,onTouchMove:qr,onTouchStart:Ke,ref:vn,tabIndex:c?-1:F,type:j},Yr,z,{children:[s,Me?O.jsx(wq,_({ref:P,center:i},I)):null]}))}),Eb=_q;function Aq(e){return Vt("MuiIconButton",e)}const Nq=jt("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),Rq=Nq,Pq=["edge","children","className","color","disabled","disableFocusRipple","size"],zq=e=>{const{classes:t,disabled:r,color:n,edge:o,size:i}=e,s={root:["root",r&&"disabled",n!=="default"&&`color${Fe(n)}`,o&&`edge${Fe(o)}`,`size${Fe(i)}`]};return tr(s,Aq,t)},Lq=Xe(Eb,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.color!=="default"&&t[`color${Fe(r.color)}`],r.edge&&t[`edge${Fe(r.edge)}`],t[`size${Fe(r.size)}`]]}})(({theme:e,ownerState:t})=>_({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Lr(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12}),({theme:e,ownerState:t})=>{var r;const n=(r=(e.vars||e).palette)==null?void 0:r[t.color];return _({},t.color==="inherit"&&{color:"inherit"},t.color!=="inherit"&&t.color!=="default"&&_({color:n==null?void 0:n.main},!t.disableRipple&&{"&:hover":_({},n&&{backgroundColor:e.vars?`rgba(${n.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Lr(n.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),t.size==="small"&&{padding:5,fontSize:e.typography.pxToRem(18)},t.size==="large"&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${Rq.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})}),Iq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiIconButton"}),{edge:o=!1,children:i,className:s,color:a="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium"}=n,d=ve(n,Pq),f=_({},n,{edge:o,color:a,disabled:l,disableFocusRipple:c,size:u}),p=zq(f);return O.jsx(Lq,_({className:Ce(p.root,s),centerRipple:!0,focusRipple:!c,disabled:l,ref:r,ownerState:f},d,{children:i}))}),Dq=Iq;function $q(e){return Vt("MuiTypography",e)}jt("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const Hq=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],Bq=e=>{const{align:t,gutterBottom:r,noWrap:n,paragraph:o,variant:i,classes:s}=e,a={root:["root",i,e.align!=="inherit"&&`align${Fe(t)}`,r&&"gutterBottom",n&&"noWrap",o&&"paragraph"]};return tr(a,$q,s)},Fq=Xe("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.variant&&t[r.variant],r.align!=="inherit"&&t[`align${Fe(r.align)}`],r.noWrap&&t.noWrap,r.gutterBottom&&t.gutterBottom,r.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>_({margin:0},t.variant==="inherit"&&{font:"inherit"},t.variant!=="inherit"&&e.typography[t.variant],t.align!=="inherit"&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),gS={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Vq={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},jq=e=>Vq[e]||e,Uq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiTypography"}),o=jq(n.color),i=vb(_({},n,{color:o})),{align:s="inherit",className:a,component:l,gutterBottom:c=!1,noWrap:u=!1,paragraph:d=!1,variant:f="body1",variantMapping:p=gS}=i,h=ve(i,Hq),m=_({},i,{align:s,color:o,className:a,component:l,gutterBottom:c,noWrap:u,paragraph:d,variant:f,variantMapping:p}),b=l||(d?"p":p[f]||gS[f])||"span",v=Bq(m);return O.jsx(Fq,_({as:b,ref:r,ownerState:m,className:Ce(v.root,a)},h))}),lu=Uq;function u3(e){return typeof e=="string"}function cu(e,t,r){return e===void 0||u3(e)?t:_({},t,{ownerState:_({},t.ownerState,r)})}const Wq={disableDefaultClasses:!1},Kq=S.createContext(Wq);function qq(e){const{disableDefaultClasses:t}=S.useContext(Kq);return r=>t?"":e(r)}function d3(e,t=[]){if(e===void 0)return{};const r={};return Object.keys(e).filter(n=>n.match(/^on[A-Z]/)&&typeof e[n]=="function"&&!t.includes(n)).forEach(n=>{r[n]=e[n]}),r}function Gq(e,t,r){return typeof e=="function"?e(t,r):e}function vS(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(r=>!(r.match(/^on[A-Z]/)&&typeof e[r]=="function")).forEach(r=>{t[r]=e[r]}),t}function Yq(e){const{getSlotProps:t,additionalProps:r,externalSlotProps:n,externalForwardedProps:o,className:i}=e;if(!t){const p=Ce(o==null?void 0:o.className,n==null?void 0:n.className,i,r==null?void 0:r.className),h=_({},r==null?void 0:r.style,o==null?void 0:o.style,n==null?void 0:n.style),m=_({},r,o,n);return p.length>0&&(m.className=p),Object.keys(h).length>0&&(m.style=h),{props:m,internalRef:void 0}}const s=d3(_({},o,n)),a=vS(n),l=vS(o),c=t(s),u=Ce(c==null?void 0:c.className,r==null?void 0:r.className,i,o==null?void 0:o.className,n==null?void 0:n.className),d=_({},c==null?void 0:c.style,r==null?void 0:r.style,o==null?void 0:o.style,n==null?void 0:n.style),f=_({},c,r,l,a);return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:c.ref}}const Jq=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function si(e){var t;const{elementType:r,externalSlotProps:n,ownerState:o,skipResolvingSlotProps:i=!1}=e,s=ve(e,Jq),a=i?{}:Gq(n,o),{props:l,internalRef:c}=Yq(_({},s,{externalSlotProps:a})),u=Ur(c,a==null?void 0:a.ref,(t=e.additionalProps)==null?void 0:t.ref);return cu(r,_({},l,{ref:u}),o)}function Xq(e){const{badgeContent:t,invisible:r=!1,max:n=99,showZero:o=!1}=e,i=NT({badgeContent:t,max:n});let s=r;r===!1&&t===0&&!o&&(s=!0);const{badgeContent:a,max:l=n}=s?i:e,c=a&&Number(a)>l?`${l}+`:a;return{badgeContent:a,invisible:s,max:l,displayValue:c}}const Qq=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function Zq(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function eG(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=n=>e.ownerDocument.querySelector(`input[type="radio"]${n}`);let r=t(`[name="${e.name}"]:checked`);return r||(r=t(`[name="${e.name}"]`)),r!==e}function tG(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||eG(e))}function rG(e){const t=[],r=[];return Array.from(e.querySelectorAll(Qq)).forEach((n,o)=>{const i=Zq(n);i===-1||!tG(n)||(i===0?t.push(n):r.push({documentOrder:o,tabIndex:i,node:n}))}),r.sort((n,o)=>n.tabIndex===o.tabIndex?n.documentOrder-o.documentOrder:n.tabIndex-o.tabIndex).map(n=>n.node).concat(t)}function nG(){return!0}function oG(e){const{children:t,disableAutoFocus:r=!1,disableEnforceFocus:n=!1,disableRestoreFocus:o=!1,getTabbable:i=rG,isEnabled:s=nG,open:a}=e,l=S.useRef(!1),c=S.useRef(null),u=S.useRef(null),d=S.useRef(null),f=S.useRef(null),p=S.useRef(!1),h=S.useRef(null),m=Ur(t.ref,h),b=S.useRef(null);S.useEffect(()=>{!a||!h.current||(p.current=!r)},[r,a]),S.useEffect(()=>{if(!a||!h.current)return;const y=Br(h.current);return h.current.contains(y.activeElement)||(h.current.hasAttribute("tabIndex")||h.current.setAttribute("tabIndex","-1"),p.current&&h.current.focus()),()=>{o||(d.current&&d.current.focus&&(l.current=!0,d.current.focus()),d.current=null)}},[a]),S.useEffect(()=>{if(!a||!h.current)return;const y=Br(h.current),x=E=>{b.current=E,!(n||!s()||E.key!=="Tab")&&y.activeElement===h.current&&E.shiftKey&&(l.current=!0,u.current&&u.current.focus())},k=()=>{const E=h.current;if(E===null)return;if(!y.hasFocus()||!s()||l.current){l.current=!1;return}if(E.contains(y.activeElement)||n&&y.activeElement!==c.current&&y.activeElement!==u.current)return;if(y.activeElement!==f.current)f.current=null;else if(f.current!==null)return;if(!p.current)return;let M=[];if((y.activeElement===c.current||y.activeElement===u.current)&&(M=i(h.current)),M.length>0){var C,T;const N=!!((C=b.current)!=null&&C.shiftKey&&((T=b.current)==null?void 0:T.key)==="Tab"),F=M[0],I=M[M.length-1];typeof F!="string"&&typeof I!="string"&&(N?I.focus():F.focus())}else E.focus()};y.addEventListener("focusin",k),y.addEventListener("keydown",x,!0);const w=setInterval(()=>{y.activeElement&&y.activeElement.tagName==="BODY"&&k()},50);return()=>{clearInterval(w),y.removeEventListener("focusin",k),y.removeEventListener("keydown",x,!0)}},[r,n,o,s,a,i]);const v=y=>{d.current===null&&(d.current=y.relatedTarget),p.current=!0,f.current=y.target;const x=t.props.onFocus;x&&x(y)},g=y=>{d.current===null&&(d.current=y.relatedTarget),p.current=!0};return O.jsxs(S.Fragment,{children:[O.jsx("div",{tabIndex:a?0:-1,onFocus:g,ref:c,"data-testid":"sentinelStart"}),S.cloneElement(t,{ref:m,onFocus:v}),O.jsx("div",{tabIndex:a?0:-1,onFocus:g,ref:u,"data-testid":"sentinelEnd"})]})}var Fr="top",Pn="bottom",zn="right",Vr="left",Cb="auto",Kd=[Fr,Pn,zn,Vr],Gl="start",md="end",iG="clippingParents",f3="viewport",Oc="popper",sG="reference",yS=Kd.reduce(function(e,t){return e.concat([t+"-"+Gl,t+"-"+md])},[]),p3=[].concat(Kd,[Cb]).reduce(function(e,t){return e.concat([t,t+"-"+Gl,t+"-"+md])},[]),aG="beforeRead",lG="read",cG="afterRead",uG="beforeMain",dG="main",fG="afterMain",pG="beforeWrite",hG="write",mG="afterWrite",gG=[aG,lG,cG,uG,dG,fG,pG,hG,mG];function No(e){return e?(e.nodeName||"").toLowerCase():null}function fn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function va(e){var t=fn(e).Element;return e instanceof t||e instanceof Element}function _n(e){var t=fn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Mb(e){if(typeof ShadowRoot>"u")return!1;var t=fn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function vG(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},o=t.attributes[r]||{},i=t.elements[r];!_n(i)||!No(i)||(Object.assign(i.style,n),Object.keys(o).forEach(function(s){var a=o[s];a===!1?i.removeAttribute(s):i.setAttribute(s,a===!0?"":a)}))})}function yG(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var o=t.elements[n],i=t.attributes[n]||{},s=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),a=s.reduce(function(l,c){return l[c]="",l},{});!_n(o)||!No(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const bG={name:"applyStyles",enabled:!0,phase:"write",fn:vG,effect:yG,requires:["computeStyles"]};function Co(e){return e.split("-")[0]}var ta=Math.max,mh=Math.min,Yl=Math.round;function Z0(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function h3(){return!/^((?!chrome|android).)*safari/i.test(Z0())}function Jl(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),o=1,i=1;t&&_n(e)&&(o=e.offsetWidth>0&&Yl(n.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Yl(n.height)/e.offsetHeight||1);var s=va(e)?fn(e):window,a=s.visualViewport,l=!h3()&&r,c=(n.left+(l&&a?a.offsetLeft:0))/o,u=(n.top+(l&&a?a.offsetTop:0))/i,d=n.width/o,f=n.height/i;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function Tb(e){var t=Jl(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function m3(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&Mb(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function ai(e){return fn(e).getComputedStyle(e)}function xG(e){return["table","td","th"].indexOf(No(e))>=0}function ks(e){return((va(e)?e.ownerDocument:e.document)||window.document).documentElement}function Wm(e){return No(e)==="html"?e:e.assignedSlot||e.parentNode||(Mb(e)?e.host:null)||ks(e)}function bS(e){return!_n(e)||ai(e).position==="fixed"?null:e.offsetParent}function kG(e){var t=/firefox/i.test(Z0()),r=/Trident/i.test(Z0());if(r&&_n(e)){var n=ai(e);if(n.position==="fixed")return null}var o=Wm(e);for(Mb(o)&&(o=o.host);_n(o)&&["html","body"].indexOf(No(o))<0;){var i=ai(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function qd(e){for(var t=fn(e),r=bS(e);r&&xG(r)&&ai(r).position==="static";)r=bS(r);return r&&(No(r)==="html"||No(r)==="body"&&ai(r).position==="static")?t:r||kG(e)||t}function Ob(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function _u(e,t,r){return ta(e,mh(t,r))}function wG(e,t,r){var n=_u(e,t,r);return n>r?r:n}function g3(){return{top:0,right:0,bottom:0,left:0}}function v3(e){return Object.assign({},g3(),e)}function y3(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var SG=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,v3(typeof t!="number"?t:y3(t,Kd))};function EG(e){var t,r=e.state,n=e.name,o=e.options,i=r.elements.arrow,s=r.modifiersData.popperOffsets,a=Co(r.placement),l=Ob(a),c=[Vr,zn].indexOf(a)>=0,u=c?"height":"width";if(!(!i||!s)){var d=SG(o.padding,r),f=Tb(i),p=l==="y"?Fr:Vr,h=l==="y"?Pn:zn,m=r.rects.reference[u]+r.rects.reference[l]-s[l]-r.rects.popper[u],b=s[l]-r.rects.reference[l],v=qd(i),g=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,y=m/2-b/2,x=d[p],k=g-f[u]-d[h],w=g/2-f[u]/2+y,E=_u(x,w,k),M=l;r.modifiersData[n]=(t={},t[M]=E,t.centerOffset=E-w,t)}}function CG(e){var t=e.state,r=e.options,n=r.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||m3(t.elements.popper,o)&&(t.elements.arrow=o))}const MG={name:"arrow",enabled:!0,phase:"main",fn:EG,effect:CG,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Xl(e){return e.split("-")[1]}var TG={top:"auto",right:"auto",bottom:"auto",left:"auto"};function OG(e,t){var r=e.x,n=e.y,o=t.devicePixelRatio||1;return{x:Yl(r*o)/o||0,y:Yl(n*o)/o||0}}function xS(e){var t,r=e.popper,n=e.popperRect,o=e.placement,i=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=s.x,p=f===void 0?0:f,h=s.y,m=h===void 0?0:h,b=typeof u=="function"?u({x:p,y:m}):{x:p,y:m};p=b.x,m=b.y;var v=s.hasOwnProperty("x"),g=s.hasOwnProperty("y"),y=Vr,x=Fr,k=window;if(c){var w=qd(r),E="clientHeight",M="clientWidth";if(w===fn(r)&&(w=ks(r),ai(w).position!=="static"&&a==="absolute"&&(E="scrollHeight",M="scrollWidth")),w=w,o===Fr||(o===Vr||o===zn)&&i===md){x=Pn;var C=d&&w===k&&k.visualViewport?k.visualViewport.height:w[E];m-=C-n.height,m*=l?1:-1}if(o===Vr||(o===Fr||o===Pn)&&i===md){y=zn;var T=d&&w===k&&k.visualViewport?k.visualViewport.width:w[M];p-=T-n.width,p*=l?1:-1}}var N=Object.assign({position:a},c&&TG),F=u===!0?OG({x:p,y:m},fn(r)):{x:p,y:m};if(p=F.x,m=F.y,l){var I;return Object.assign({},N,(I={},I[x]=g?"0":"",I[y]=v?"0":"",I.transform=(k.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",I))}return Object.assign({},N,(t={},t[x]=g?m+"px":"",t[y]=v?p+"px":"",t.transform="",t))}function _G(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=n===void 0?!0:n,i=r.adaptive,s=i===void 0?!0:i,a=r.roundOffsets,l=a===void 0?!0:a,c={placement:Co(t.placement),variation:Xl(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,xS(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,xS(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const AG={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:_G,data:{}};var Sf={passive:!0};function NG(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,i=o===void 0?!0:o,s=n.resize,a=s===void 0?!0:s,l=fn(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",r.update,Sf)}),a&&l.addEventListener("resize",r.update,Sf),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",r.update,Sf)}),a&&l.removeEventListener("resize",r.update,Sf)}}const RG={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:NG,data:{}};var PG={left:"right",right:"left",bottom:"top",top:"bottom"};function fp(e){return e.replace(/left|right|bottom|top/g,function(t){return PG[t]})}var zG={start:"end",end:"start"};function kS(e){return e.replace(/start|end/g,function(t){return zG[t]})}function _b(e){var t=fn(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function Ab(e){return Jl(ks(e)).left+_b(e).scrollLeft}function LG(e,t){var r=fn(e),n=ks(e),o=r.visualViewport,i=n.clientWidth,s=n.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;var c=h3();(c||!c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a+Ab(e),y:l}}function IG(e){var t,r=ks(e),n=_b(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=ta(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=ta(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-n.scrollLeft+Ab(e),l=-n.scrollTop;return ai(o||r).direction==="rtl"&&(a+=ta(r.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function Nb(e){var t=ai(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function b3(e){return["html","body","#document"].indexOf(No(e))>=0?e.ownerDocument.body:_n(e)&&Nb(e)?e:b3(Wm(e))}function Au(e,t){var r;t===void 0&&(t=[]);var n=b3(e),o=n===((r=e.ownerDocument)==null?void 0:r.body),i=fn(n),s=o?[i].concat(i.visualViewport||[],Nb(n)?n:[]):n,a=t.concat(s);return o?a:a.concat(Au(Wm(s)))}function ev(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function DG(e,t){var r=Jl(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function wS(e,t,r){return t===f3?ev(LG(e,r)):va(t)?DG(t,r):ev(IG(ks(e)))}function $G(e){var t=Au(Wm(e)),r=["absolute","fixed"].indexOf(ai(e).position)>=0,n=r&&_n(e)?qd(e):e;return va(n)?t.filter(function(o){return va(o)&&m3(o,n)&&No(o)!=="body"}):[]}function HG(e,t,r,n){var o=t==="clippingParents"?$G(e):[].concat(t),i=[].concat(o,[r]),s=i[0],a=i.reduce(function(l,c){var u=wS(e,c,n);return l.top=ta(u.top,l.top),l.right=mh(u.right,l.right),l.bottom=mh(u.bottom,l.bottom),l.left=ta(u.left,l.left),l},wS(e,s,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function x3(e){var t=e.reference,r=e.element,n=e.placement,o=n?Co(n):null,i=n?Xl(n):null,s=t.x+t.width/2-r.width/2,a=t.y+t.height/2-r.height/2,l;switch(o){case Fr:l={x:s,y:t.y-r.height};break;case Pn:l={x:s,y:t.y+t.height};break;case zn:l={x:t.x+t.width,y:a};break;case Vr:l={x:t.x-r.width,y:a};break;default:l={x:t.x,y:t.y}}var c=o?Ob(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case Gl:l[c]=l[c]-(t[u]/2-r[u]/2);break;case md:l[c]=l[c]+(t[u]/2-r[u]/2);break}}return l}function gd(e,t){t===void 0&&(t={});var r=t,n=r.placement,o=n===void 0?e.placement:n,i=r.strategy,s=i===void 0?e.strategy:i,a=r.boundary,l=a===void 0?iG:a,c=r.rootBoundary,u=c===void 0?f3:c,d=r.elementContext,f=d===void 0?Oc:d,p=r.altBoundary,h=p===void 0?!1:p,m=r.padding,b=m===void 0?0:m,v=v3(typeof b!="number"?b:y3(b,Kd)),g=f===Oc?sG:Oc,y=e.rects.popper,x=e.elements[h?g:f],k=HG(va(x)?x:x.contextElement||ks(e.elements.popper),l,u,s),w=Jl(e.elements.reference),E=x3({reference:w,element:y,strategy:"absolute",placement:o}),M=ev(Object.assign({},y,E)),C=f===Oc?M:w,T={top:k.top-C.top+v.top,bottom:C.bottom-k.bottom+v.bottom,left:k.left-C.left+v.left,right:C.right-k.right+v.right},N=e.modifiersData.offset;if(f===Oc&&N){var F=N[o];Object.keys(T).forEach(function(I){var V=[zn,Pn].indexOf(I)>=0?1:-1,j=[Fr,Pn].indexOf(I)>=0?"y":"x";T[I]+=F[j]*V})}return T}function BG(e,t){t===void 0&&(t={});var r=t,n=r.placement,o=r.boundary,i=r.rootBoundary,s=r.padding,a=r.flipVariations,l=r.allowedAutoPlacements,c=l===void 0?p3:l,u=Xl(n),d=u?a?yS:yS.filter(function(h){return Xl(h)===u}):Kd,f=d.filter(function(h){return c.indexOf(h)>=0});f.length===0&&(f=d);var p=f.reduce(function(h,m){return h[m]=gd(e,{placement:m,boundary:o,rootBoundary:i,padding:s})[Co(m)],h},{});return Object.keys(p).sort(function(h,m){return p[h]-p[m]})}function FG(e){if(Co(e)===Cb)return[];var t=fp(e);return[kS(e),t,kS(t)]}function VG(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=r.mainAxis,i=o===void 0?!0:o,s=r.altAxis,a=s===void 0?!0:s,l=r.fallbackPlacements,c=r.padding,u=r.boundary,d=r.rootBoundary,f=r.altBoundary,p=r.flipVariations,h=p===void 0?!0:p,m=r.allowedAutoPlacements,b=t.options.placement,v=Co(b),g=v===b,y=l||(g||!h?[fp(b)]:FG(b)),x=[b].concat(y).reduce(function(ie,ue){return ie.concat(Co(ue)===Cb?BG(t,{placement:ue,boundary:u,rootBoundary:d,padding:c,flipVariations:h,allowedAutoPlacements:m}):ue)},[]),k=t.rects.reference,w=t.rects.popper,E=new Map,M=!0,C=x[0],T=0;T=0,j=V?"width":"height",z=gd(t,{placement:N,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),q=V?I?zn:Vr:I?Pn:Fr;k[j]>w[j]&&(q=fp(q));var A=fp(q),P=[];if(i&&P.push(z[F]<=0),a&&P.push(z[q]<=0,z[A]<=0),P.every(function(ie){return ie})){C=N,M=!1;break}E.set(N,P)}if(M)for(var B=h?3:1,Y=function(ue){var de=x.find(function(he){var Me=E.get(he);if(Me)return Me.slice(0,ue).every(function(Se){return Se})});if(de)return C=de,"break"},J=B;J>0;J--){var Ne=Y(J);if(Ne==="break")break}t.placement!==C&&(t.modifiersData[n]._skip=!0,t.placement=C,t.reset=!0)}}const jG={name:"flip",enabled:!0,phase:"main",fn:VG,requiresIfExists:["offset"],data:{_skip:!1}};function SS(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function ES(e){return[Fr,zn,Pn,Vr].some(function(t){return e[t]>=0})}function UG(e){var t=e.state,r=e.name,n=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=gd(t,{elementContext:"reference"}),a=gd(t,{altBoundary:!0}),l=SS(s,n),c=SS(a,o,i),u=ES(l),d=ES(c);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const WG={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:UG};function KG(e,t,r){var n=Co(e),o=[Vr,Fr].indexOf(n)>=0?-1:1,i=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Vr,zn].indexOf(n)>=0?{x:a,y:s}:{x:s,y:a}}function qG(e){var t=e.state,r=e.options,n=e.name,o=r.offset,i=o===void 0?[0,0]:o,s=p3.reduce(function(u,d){return u[d]=KG(d,t.rects,i),u},{}),a=s[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=s}const GG={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:qG};function YG(e){var t=e.state,r=e.name;t.modifiersData[r]=x3({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const JG={name:"popperOffsets",enabled:!0,phase:"read",fn:YG,data:{}};function XG(e){return e==="x"?"y":"x"}function QG(e){var t=e.state,r=e.options,n=e.name,o=r.mainAxis,i=o===void 0?!0:o,s=r.altAxis,a=s===void 0?!1:s,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,d=r.padding,f=r.tether,p=f===void 0?!0:f,h=r.tetherOffset,m=h===void 0?0:h,b=gd(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),v=Co(t.placement),g=Xl(t.placement),y=!g,x=Ob(v),k=XG(x),w=t.modifiersData.popperOffsets,E=t.rects.reference,M=t.rects.popper,C=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,T=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,F={x:0,y:0};if(w){if(i){var I,V=x==="y"?Fr:Vr,j=x==="y"?Pn:zn,z=x==="y"?"height":"width",q=w[x],A=q+b[V],P=q-b[j],B=p?-M[z]/2:0,Y=g===Gl?E[z]:M[z],J=g===Gl?-M[z]:-E[z],Ne=t.elements.arrow,ie=p&&Ne?Tb(Ne):{width:0,height:0},ue=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:g3(),de=ue[V],he=ue[j],Me=_u(0,E[z],ie[z]),Se=y?E[z]/2-B-Me-de-T.mainAxis:Y-Me-de-T.mainAxis,ft=y?-E[z]/2+B+Me+he+T.mainAxis:J+Me+he+T.mainAxis,rt=t.elements.arrow&&qd(t.elements.arrow),Or=rt?x==="y"?rt.clientTop||0:rt.clientLeft||0:0,pe=(I=N==null?void 0:N[x])!=null?I:0,De=q+Se-pe-Or,Ke=q+ft-pe,Bn=_u(p?mh(A,De):A,q,p?ta(P,Ke):P);w[x]=Bn,F[x]=Bn-q}if(a){var qr,rr=x==="x"?Fr:Vr,zo=x==="x"?Pn:zn,Pt=w[k],Gr=k==="y"?"height":"width",gn=Pt+b[rr],Fn=Pt-b[zo],Qe=[Fr,Vr].indexOf(v)!==-1,Yr=(qr=N==null?void 0:N[k])!=null?qr:0,vn=Qe?gn:Pt-E[Gr]-M[Gr]-Yr+T.altAxis,mi=Qe?Pt+E[Gr]+M[Gr]-Yr-T.altAxis:Fn,Oa=p&&Qe?wG(vn,Pt,mi):_u(p?vn:gn,Pt,p?mi:Fn);w[k]=Oa,F[k]=Oa-Pt}t.modifiersData[n]=F}}const ZG={name:"preventOverflow",enabled:!0,phase:"main",fn:QG,requiresIfExists:["offset"]};function eY(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function tY(e){return e===fn(e)||!_n(e)?_b(e):eY(e)}function rY(e){var t=e.getBoundingClientRect(),r=Yl(t.width)/e.offsetWidth||1,n=Yl(t.height)/e.offsetHeight||1;return r!==1||n!==1}function nY(e,t,r){r===void 0&&(r=!1);var n=_n(t),o=_n(t)&&rY(t),i=ks(t),s=Jl(e,o,r),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!r)&&((No(t)!=="body"||Nb(i))&&(a=tY(t)),_n(t)?(l=Jl(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=Ab(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function oY(e){var t=new Map,r=new Set,n=[];e.forEach(function(i){t.set(i.name,i)});function o(i){r.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!r.has(a)){var l=t.get(a);l&&o(l)}}),n.push(i)}return e.forEach(function(i){r.has(i.name)||o(i)}),n}function iY(e){var t=oY(e);return gG.reduce(function(r,n){return r.concat(t.filter(function(o){return o.phase===n}))},[])}function sY(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function aY(e){var t=e.reduce(function(r,n){var o=r[n.name];return r[n.name]=o?Object.assign({},o,n,{options:Object.assign({},o.options,n.options),data:Object.assign({},o.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var CS={placement:"bottom",modifiers:[],strategy:"absolute"};function MS(){for(var e=arguments.length,t=new Array(e),r=0;r{i||a(dY(o)||document.body)},[o,i]),ha(()=>{if(s&&!i)return K0(r,s),()=>{K0(r,null)}},[r,s,i]),i){if(S.isValidElement(n)){const c={ref:l};return S.cloneElement(n,c)}return O.jsx(S.Fragment,{children:n})}return O.jsx(S.Fragment,{children:s&&om.createPortal(n,s)})});function fY(e){return Vt("MuiPopper",e)}jt("MuiPopper",["root"]);const pY=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],hY=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function mY(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function tv(e){return typeof e=="function"?e():e}function gY(e){return e.nodeType!==void 0}const vY=()=>tr({root:["root"]},qq(fY)),yY={},bY=S.forwardRef(function(t,r){var n;const{anchorEl:o,children:i,direction:s,disablePortal:a,modifiers:l,open:c,placement:u,popperOptions:d,popperRef:f,slotProps:p={},slots:h={},TransitionProps:m}=t,b=ve(t,pY),v=S.useRef(null),g=Ur(v,r),y=S.useRef(null),x=Ur(y,f),k=S.useRef(x);ha(()=>{k.current=x},[x]),S.useImperativeHandle(f,()=>y.current,[]);const w=mY(u,s),[E,M]=S.useState(w),[C,T]=S.useState(tv(o));S.useEffect(()=>{y.current&&y.current.forceUpdate()}),S.useEffect(()=>{o&&T(tv(o))},[o]),ha(()=>{if(!C||!c)return;const j=A=>{M(A.placement)};let z=[{name:"preventOverflow",options:{altBoundary:a}},{name:"flip",options:{altBoundary:a}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:A})=>{j(A)}}];l!=null&&(z=z.concat(l)),d&&d.modifiers!=null&&(z=z.concat(d.modifiers));const q=uY(C,v.current,_({placement:w},d,{modifiers:z}));return k.current(q),()=>{q.destroy(),k.current(null)}},[C,a,l,c,d,w]);const N={placement:E};m!==null&&(N.TransitionProps=m);const F=vY(),I=(n=h.root)!=null?n:"div",V=si({elementType:I,externalSlotProps:p.root,externalForwardedProps:b,additionalProps:{role:"tooltip",ref:g},ownerState:t,className:F.root});return O.jsx(I,_({},V,{children:typeof i=="function"?i(N):i}))}),xY=S.forwardRef(function(t,r){const{anchorEl:n,children:o,container:i,direction:s="ltr",disablePortal:a=!1,keepMounted:l=!1,modifiers:c,open:u,placement:d="bottom",popperOptions:f=yY,popperRef:p,style:h,transition:m=!1,slotProps:b={},slots:v={}}=t,g=ve(t,hY),[y,x]=S.useState(!0),k=()=>{x(!1)},w=()=>{x(!0)};if(!l&&!u&&(!m||y))return null;let E;if(i)E=i;else if(n){const T=tv(n);E=T&&gY(T)?Br(T).body:Br(null).body}const M=!u&&l&&(!m||y)?"none":void 0,C=m?{in:u,onEnter:k,onExited:w}:void 0;return O.jsx(k3,{disablePortal:a,container:E,children:O.jsx(bY,_({anchorEl:n,direction:s,disablePortal:a,modifiers:c,ref:r,open:m?!y:u,placement:d,popperOptions:f,popperRef:p,slotProps:b,slots:v},g,{style:_({position:"fixed",top:0,left:0,display:M},h),TransitionProps:C,children:o}))})});function kY(e){const t=Br(e);return t.body===e?dd(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function Nu(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function TS(e){return parseInt(dd(e).getComputedStyle(e).paddingRight,10)||0}function wY(e){const r=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName)!==-1,n=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return r||n}function OS(e,t,r,n,o){const i=[t,r,...n];[].forEach.call(e.children,s=>{const a=i.indexOf(s)===-1,l=!wY(s);a&&l&&Nu(s,o)})}function e1(e,t){let r=-1;return e.some((n,o)=>t(n)?(r=o,!0):!1),r}function SY(e,t){const r=[],n=e.container;if(!t.disableScrollLock){if(kY(n)){const s=AT(Br(n));r.push({value:n.style.paddingRight,property:"padding-right",el:n}),n.style.paddingRight=`${TS(n)+s}px`;const a=Br(n).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{r.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${TS(l)+s}px`})}let i;if(n.parentNode instanceof DocumentFragment)i=Br(n).body;else{const s=n.parentElement,a=dd(n);i=(s==null?void 0:s.nodeName)==="HTML"&&a.getComputedStyle(s).overflowY==="scroll"?s:n}r.push({value:i.style.overflow,property:"overflow",el:i},{value:i.style.overflowX,property:"overflow-x",el:i},{value:i.style.overflowY,property:"overflow-y",el:i}),i.style.overflow="hidden"}return()=>{r.forEach(({value:i,el:s,property:a})=>{i?s.style.setProperty(a,i):s.style.removeProperty(a)})}}function EY(e){const t=[];return[].forEach.call(e.children,r=>{r.getAttribute("aria-hidden")==="true"&&t.push(r)}),t}class CY{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(t,r){let n=this.modals.indexOf(t);if(n!==-1)return n;n=this.modals.length,this.modals.push(t),t.modalRef&&Nu(t.modalRef,!1);const o=EY(r);OS(r,t.mount,t.modalRef,o,!0);const i=e1(this.containers,s=>s.container===r);return i!==-1?(this.containers[i].modals.push(t),n):(this.containers.push({modals:[t],container:r,restore:null,hiddenSiblings:o}),n)}mount(t,r){const n=e1(this.containers,i=>i.modals.indexOf(t)!==-1),o=this.containers[n];o.restore||(o.restore=SY(o,r))}remove(t,r=!0){const n=this.modals.indexOf(t);if(n===-1)return n;const o=e1(this.containers,s=>s.modals.indexOf(t)!==-1),i=this.containers[o];if(i.modals.splice(i.modals.indexOf(t),1),this.modals.splice(n,1),i.modals.length===0)i.restore&&i.restore(),t.modalRef&&Nu(t.modalRef,r),OS(i.container,t.mount,t.modalRef,i.hiddenSiblings,!1),this.containers.splice(o,1);else{const s=i.modals[i.modals.length-1];s.modalRef&&Nu(s.modalRef,!1)}return n}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function MY(e){return typeof e=="function"?e():e}function TY(e){return e?e.props.hasOwnProperty("in"):!1}const OY=new CY;function _Y(e){const{container:t,disableEscapeKeyDown:r=!1,disableScrollLock:n=!1,manager:o=OY,closeAfterTransition:i=!1,onTransitionEnter:s,onTransitionExited:a,children:l,onClose:c,open:u,rootRef:d}=e,f=S.useRef({}),p=S.useRef(null),h=S.useRef(null),m=Ur(h,d),[b,v]=S.useState(!u),g=TY(l);let y=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(y=!1);const x=()=>Br(p.current),k=()=>(f.current.modalRef=h.current,f.current.mount=p.current,f.current),w=()=>{o.mount(k(),{disableScrollLock:n}),h.current&&(h.current.scrollTop=0)},E=Ks(()=>{const z=MY(t)||x().body;o.add(k(),z),h.current&&w()}),M=S.useCallback(()=>o.isTopModal(k()),[o]),C=Ks(z=>{p.current=z,z&&(u&&M()?w():h.current&&Nu(h.current,y))}),T=S.useCallback(()=>{o.remove(k(),y)},[y,o]);S.useEffect(()=>()=>{T()},[T]),S.useEffect(()=>{u?E():(!g||!i)&&T()},[u,T,g,i,E]);const N=z=>q=>{var A;(A=z.onKeyDown)==null||A.call(z,q),!(q.key!=="Escape"||!M())&&(r||(q.stopPropagation(),c&&c(q,"escapeKeyDown")))},F=z=>q=>{var A;(A=z.onClick)==null||A.call(z,q),q.target===q.currentTarget&&c&&c(q,"backdropClick")};return{getRootProps:(z={})=>{const q=d3(e);delete q.onTransitionEnter,delete q.onTransitionExited;const A=_({},q,z);return _({role:"presentation"},A,{onKeyDown:N(A),ref:m})},getBackdropProps:(z={})=>{const q=z;return _({"aria-hidden":!0},q,{onClick:F(q),open:u})},getTransitionProps:()=>{const z=()=>{v(!1),s&&s()},q=()=>{v(!0),a&&a(),i&&T()};return{onEnter:Hw(z,l==null?void 0:l.props.onEnter),onExited:Hw(q,l==null?void 0:l.props.onExited)}},rootRef:m,portalRef:C,isTopModal:M,exited:b,hasTransition:g}}const AY=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],NY=Xe(xY,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),RY=S.forwardRef(function(t,r){var n;const o=mb(),i=Wt({props:t,name:"MuiPopper"}),{anchorEl:s,component:a,components:l,componentsProps:c,container:u,disablePortal:d,keepMounted:f,modifiers:p,open:h,placement:m,popperOptions:b,popperRef:v,transition:g,slots:y,slotProps:x}=i,k=ve(i,AY),w=(n=y==null?void 0:y.root)!=null?n:l==null?void 0:l.Root,E=_({anchorEl:s,container:u,disablePortal:d,keepMounted:f,modifiers:p,open:h,placement:m,popperOptions:b,popperRef:v,transition:g},k);return O.jsx(NY,_({as:a,direction:o==null?void 0:o.direction,slots:{root:w},slotProps:x??c},E,{ref:r}))}),Rb=RY,PY=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],zY={entering:{opacity:1},entered:{opacity:1}},LY=S.forwardRef(function(t,r){const n=jm(),o={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:s=!0,children:a,easing:l,in:c,onEnter:u,onEntered:d,onEntering:f,onExit:p,onExited:h,onExiting:m,style:b,timeout:v=o,TransitionComponent:g=l3}=t,y=ve(t,PY),x=S.useRef(null),k=Ur(x,a.ref,r),w=V=>j=>{if(V){const z=x.current;j===void 0?V(z):V(z,j)}},E=w(f),M=w((V,j)=>{c3(V);const z=hh({style:b,timeout:v,easing:l},{mode:"enter"});V.style.webkitTransition=n.transitions.create("opacity",z),V.style.transition=n.transitions.create("opacity",z),u&&u(V,j)}),C=w(d),T=w(m),N=w(V=>{const j=hh({style:b,timeout:v,easing:l},{mode:"exit"});V.style.webkitTransition=n.transitions.create("opacity",j),V.style.transition=n.transitions.create("opacity",j),p&&p(V)}),F=w(h),I=V=>{i&&i(x.current,V)};return O.jsx(g,_({appear:s,in:c,nodeRef:x,onEnter:M,onEntered:C,onEntering:E,onExit:N,onExited:F,onExiting:T,addEndListener:I,timeout:v},y,{children:(V,j)=>S.cloneElement(a,_({style:_({opacity:0,visibility:V==="exited"&&!c?"hidden":void 0},zY[V],b,a.props.style),ref:k},j))}))}),IY=LY;function DY(e){return Vt("MuiBackdrop",e)}jt("MuiBackdrop",["root","invisible"]);const $Y=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],HY=e=>{const{classes:t,invisible:r}=e;return tr({root:["root",r&&"invisible"]},DY,t)},BY=Xe("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.invisible&&t.invisible]}})(({ownerState:e})=>_({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},e.invisible&&{backgroundColor:"transparent"})),FY=S.forwardRef(function(t,r){var n,o,i;const s=Wt({props:t,name:"MuiBackdrop"}),{children:a,className:l,component:c="div",components:u={},componentsProps:d={},invisible:f=!1,open:p,slotProps:h={},slots:m={},TransitionComponent:b=IY,transitionDuration:v}=s,g=ve(s,$Y),y=_({},s,{component:c,invisible:f}),x=HY(y),k=(n=h.root)!=null?n:d.root;return O.jsx(b,_({in:p,timeout:v},g,{children:O.jsx(BY,_({"aria-hidden":!0},k,{as:(o=(i=m.root)!=null?i:u.Root)!=null?o:c,className:Ce(x.root,l,k==null?void 0:k.className),ownerState:_({},y,k==null?void 0:k.ownerState),classes:x,ref:r,children:a}))}))}),VY=FY;function jY(e){return Vt("MuiBadge",e)}const UY=jt("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),bi=UY,WY=["anchorOrigin","className","classes","component","components","componentsProps","children","overlap","color","invisible","max","badgeContent","slots","slotProps","showZero","variant"],t1=10,r1=4,KY=e=>{const{color:t,anchorOrigin:r,invisible:n,overlap:o,variant:i,classes:s={}}=e,a={root:["root"],badge:["badge",i,n&&"invisible",`anchorOrigin${Fe(r.vertical)}${Fe(r.horizontal)}`,`anchorOrigin${Fe(r.vertical)}${Fe(r.horizontal)}${Fe(o)}`,`overlap${Fe(o)}`,t!=="default"&&`color${Fe(t)}`]};return tr(a,jY,s)},qY=Xe("span",{name:"MuiBadge",slot:"Root",overridesResolver:(e,t)=>t.root})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),GY=Xe("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.badge,t[r.variant],t[`anchorOrigin${Fe(r.anchorOrigin.vertical)}${Fe(r.anchorOrigin.horizontal)}${Fe(r.overlap)}`],r.color!=="default"&&t[`color${Fe(r.color)}`],r.invisible&&t.invisible]}})(({theme:e,ownerState:t})=>_({display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(12),minWidth:t1*2,lineHeight:1,padding:"0 6px",height:t1*2,borderRadius:t1,zIndex:1,transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.enteringScreen})},t.color!=="default"&&{backgroundColor:(e.vars||e).palette[t.color].main,color:(e.vars||e).palette[t.color].contrastText},t.variant==="dot"&&{borderRadius:r1,height:r1*2,minWidth:r1*2,padding:0},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular"&&{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular"&&{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular"&&{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular"&&{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular"&&{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular"&&{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular"&&{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular"&&{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}},t.invisible&&{transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.leavingScreen})})),YY=S.forwardRef(function(t,r){var n,o,i,s,a,l;const c=Wt({props:t,name:"MuiBadge"}),{anchorOrigin:u={vertical:"top",horizontal:"right"},className:d,component:f,components:p={},componentsProps:h={},children:m,overlap:b="rectangular",color:v="default",invisible:g=!1,max:y=99,badgeContent:x,slots:k,slotProps:w,showZero:E=!1,variant:M="standard"}=c,C=ve(c,WY),{badgeContent:T,invisible:N,max:F,displayValue:I}=Xq({max:y,invisible:g,badgeContent:x,showZero:E}),V=NT({anchorOrigin:u,color:v,overlap:b,variant:M,badgeContent:x}),j=N||T==null&&M!=="dot",{color:z=v,overlap:q=b,anchorOrigin:A=u,variant:P=M}=j?V:c,B=P!=="dot"?I:void 0,Y=_({},c,{badgeContent:T,invisible:j,max:F,displayValue:B,showZero:E,anchorOrigin:A,color:z,overlap:q,variant:P}),J=KY(Y),Ne=(n=(o=k==null?void 0:k.root)!=null?o:p.Root)!=null?n:qY,ie=(i=(s=k==null?void 0:k.badge)!=null?s:p.Badge)!=null?i:GY,ue=(a=w==null?void 0:w.root)!=null?a:h.root,de=(l=w==null?void 0:w.badge)!=null?l:h.badge,he=si({elementType:Ne,externalSlotProps:ue,externalForwardedProps:C,additionalProps:{ref:r,as:f},ownerState:Y,className:Ce(ue==null?void 0:ue.className,J.root,d)}),Me=si({elementType:ie,externalSlotProps:de,ownerState:Y,className:Ce(J.badge,de==null?void 0:de.className)});return O.jsxs(Ne,_({},he,{children:[m,O.jsx(ie,_({},Me,{children:B}))]}))}),JY=YY,XY=bb(),QY=jW({themeId:Kl,defaultTheme:XY,defaultClassName:"MuiBox-root",generateClassName:PT.generate}),w3=QY;function ZY(e){return Vt("MuiModal",e)}jt("MuiModal",["root","hidden","backdrop"]);const eJ=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],tJ=e=>{const{open:t,exited:r,classes:n}=e;return tr({root:["root",!t&&r&&"hidden"],backdrop:["backdrop"]},ZY,n)},rJ=Xe("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.open&&r.exited&&t.hidden]}})(({theme:e,ownerState:t})=>_({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),nJ=Xe(VY,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),oJ=S.forwardRef(function(t,r){var n,o,i,s,a,l;const c=Wt({name:"MuiModal",props:t}),{BackdropComponent:u=nJ,BackdropProps:d,className:f,closeAfterTransition:p=!1,children:h,container:m,component:b,components:v={},componentsProps:g={},disableAutoFocus:y=!1,disableEnforceFocus:x=!1,disableEscapeKeyDown:k=!1,disablePortal:w=!1,disableRestoreFocus:E=!1,disableScrollLock:M=!1,hideBackdrop:C=!1,keepMounted:T=!1,onBackdropClick:N,open:F,slotProps:I,slots:V}=c,j=ve(c,eJ),z=_({},c,{closeAfterTransition:p,disableAutoFocus:y,disableEnforceFocus:x,disableEscapeKeyDown:k,disablePortal:w,disableRestoreFocus:E,disableScrollLock:M,hideBackdrop:C,keepMounted:T}),{getRootProps:q,getBackdropProps:A,getTransitionProps:P,portalRef:B,isTopModal:Y,exited:J,hasTransition:Ne}=_Y(_({},z,{rootRef:r})),ie=_({},z,{exited:J}),ue=tJ(ie),de={};if(h.props.tabIndex===void 0&&(de.tabIndex="-1"),Ne){const{onEnter:pe,onExited:De}=P();de.onEnter=pe,de.onExited=De}const he=(n=(o=V==null?void 0:V.root)!=null?o:v.Root)!=null?n:rJ,Me=(i=(s=V==null?void 0:V.backdrop)!=null?s:v.Backdrop)!=null?i:u,Se=(a=I==null?void 0:I.root)!=null?a:g.root,ft=(l=I==null?void 0:I.backdrop)!=null?l:g.backdrop,rt=si({elementType:he,externalSlotProps:Se,externalForwardedProps:j,getSlotProps:q,additionalProps:{ref:r,as:b},ownerState:ie,className:Ce(f,Se==null?void 0:Se.className,ue==null?void 0:ue.root,!ie.open&&ie.exited&&(ue==null?void 0:ue.hidden))}),Or=si({elementType:Me,externalSlotProps:ft,additionalProps:d,getSlotProps:pe=>A(_({},pe,{onClick:De=>{N&&N(De),pe!=null&&pe.onClick&&pe.onClick(De)}})),className:Ce(ft==null?void 0:ft.className,d==null?void 0:d.className,ue==null?void 0:ue.backdrop),ownerState:ie});return!T&&!F&&(!Ne||J)?null:O.jsx(k3,{ref:B,container:m,disablePortal:w,children:O.jsxs(he,_({},rt,{children:[!C&&u?O.jsx(Me,_({},Or)):null,O.jsx(oG,{disableEnforceFocus:x,disableAutoFocus:y,disableRestoreFocus:E,isEnabled:Y,open:F,children:S.cloneElement(h,de)})]}))})}),iJ=oJ,sJ=jt("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),_S=sJ,aJ=kK({createStyledComponent:Xe("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>Wt({props:e,name:"MuiStack"})}),lJ=aJ,cJ=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function rv(e){return`scale(${e}, ${e**2})`}const uJ={entering:{opacity:1,transform:rv(1)},entered:{opacity:1,transform:"none"}},n1=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),S3=S.forwardRef(function(t,r){const{addEndListener:n,appear:o=!0,children:i,easing:s,in:a,onEnter:l,onEntered:c,onEntering:u,onExit:d,onExited:f,onExiting:p,style:h,timeout:m="auto",TransitionComponent:b=l3}=t,v=ve(t,cJ),g=S.useRef(),y=S.useRef(),x=jm(),k=S.useRef(null),w=Ur(k,i.ref,r),E=j=>z=>{if(j){const q=k.current;z===void 0?j(q):j(q,z)}},M=E(u),C=E((j,z)=>{c3(j);const{duration:q,delay:A,easing:P}=hh({style:h,timeout:m,easing:s},{mode:"enter"});let B;m==="auto"?(B=x.transitions.getAutoHeightDuration(j.clientHeight),y.current=B):B=q,j.style.transition=[x.transitions.create("opacity",{duration:B,delay:A}),x.transitions.create("transform",{duration:n1?B:B*.666,delay:A,easing:P})].join(","),l&&l(j,z)}),T=E(c),N=E(p),F=E(j=>{const{duration:z,delay:q,easing:A}=hh({style:h,timeout:m,easing:s},{mode:"exit"});let P;m==="auto"?(P=x.transitions.getAutoHeightDuration(j.clientHeight),y.current=P):P=z,j.style.transition=[x.transitions.create("opacity",{duration:P,delay:q}),x.transitions.create("transform",{duration:n1?P:P*.666,delay:n1?q:q||P*.333,easing:A})].join(","),j.style.opacity=0,j.style.transform=rv(.75),d&&d(j)}),I=E(f),V=j=>{m==="auto"&&(g.current=setTimeout(j,y.current||0)),n&&n(k.current,j)};return S.useEffect(()=>()=>{clearTimeout(g.current)},[]),O.jsx(b,_({appear:o,in:a,nodeRef:k,onEnter:C,onEntered:T,onEntering:M,onExit:F,onExited:I,onExiting:N,addEndListener:V,timeout:m==="auto"?null:m},v,{children:(j,z)=>S.cloneElement(i,_({style:_({opacity:0,transform:rv(.75),visibility:j==="exited"&&!a?"hidden":void 0},uJ[j],h,i.props.style),ref:w},z))}))});S3.muiSupportAuto=!0;const nv=S3,dJ=S.createContext({}),vd=dJ;function fJ(e){return Vt("MuiList",e)}jt("MuiList",["root","padding","dense","subheader"]);const pJ=["children","className","component","dense","disablePadding","subheader"],hJ=e=>{const{classes:t,disablePadding:r,dense:n,subheader:o}=e;return tr({root:["root",!r&&"padding",n&&"dense",o&&"subheader"]},fJ,t)},mJ=Xe("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disablePadding&&t.padding,r.dense&&t.dense,r.subheader&&t.subheader]}})(({ownerState:e})=>_({listStyle:"none",margin:0,padding:0,position:"relative"},!e.disablePadding&&{paddingTop:8,paddingBottom:8},e.subheader&&{paddingTop:0})),gJ=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiList"}),{children:o,className:i,component:s="ul",dense:a=!1,disablePadding:l=!1,subheader:c}=n,u=ve(n,pJ),d=S.useMemo(()=>({dense:a}),[a]),f=_({},n,{component:s,dense:a,disablePadding:l}),p=hJ(f);return O.jsx(vd.Provider,{value:d,children:O.jsxs(mJ,_({as:s,className:Ce(p.root,i),ref:r,ownerState:f},u,{children:[c,o]}))})}),vJ=gJ;function yJ(e){return Vt("MuiListItemIcon",e)}const bJ=jt("MuiListItemIcon",["root","alignItemsFlexStart"]),AS=bJ,xJ=["className"],kJ=e=>{const{alignItems:t,classes:r}=e;return tr({root:["root",t==="flex-start"&&"alignItemsFlexStart"]},yJ,r)},wJ=Xe("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.alignItems==="flex-start"&&t.alignItemsFlexStart]}})(({theme:e,ownerState:t})=>_({minWidth:56,color:(e.vars||e).palette.action.active,flexShrink:0,display:"inline-flex"},t.alignItems==="flex-start"&&{marginTop:8})),SJ=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiListItemIcon"}),{className:o}=n,i=ve(n,xJ),s=S.useContext(vd),a=_({},n,{alignItems:s.alignItems}),l=kJ(a);return O.jsx(wJ,_({className:Ce(l.root,o),ownerState:a,ref:r},i))}),EJ=SJ;function CJ(e){return Vt("MuiListItemText",e)}const MJ=jt("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),gh=MJ,TJ=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],OJ=e=>{const{classes:t,inset:r,primary:n,secondary:o,dense:i}=e;return tr({root:["root",r&&"inset",i&&"dense",n&&o&&"multiline"],primary:["primary"],secondary:["secondary"]},CJ,t)},_J=Xe("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${gh.primary}`]:t.primary},{[`& .${gh.secondary}`]:t.secondary},t.root,r.inset&&t.inset,r.primary&&r.secondary&&t.multiline,r.dense&&t.dense]}})(({ownerState:e})=>_({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},e.primary&&e.secondary&&{marginTop:6,marginBottom:6},e.inset&&{paddingLeft:56})),AJ=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiListItemText"}),{children:o,className:i,disableTypography:s=!1,inset:a=!1,primary:l,primaryTypographyProps:c,secondary:u,secondaryTypographyProps:d}=n,f=ve(n,TJ),{dense:p}=S.useContext(vd);let h=l??o,m=u;const b=_({},n,{disableTypography:s,inset:a,primary:!!h,secondary:!!m,dense:p}),v=OJ(b);return h!=null&&h.type!==lu&&!s&&(h=O.jsx(lu,_({variant:p?"body2":"body1",className:v.primary,component:c!=null&&c.variant?void 0:"span",display:"block"},c,{children:h}))),m!=null&&m.type!==lu&&!s&&(m=O.jsx(lu,_({variant:"body2",className:v.secondary,color:"text.secondary",display:"block"},d,{children:m}))),O.jsxs(_J,_({className:Ce(v.root,i),ownerState:b,ref:r},f,{children:[h,m]}))}),NJ=AJ,RJ=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function o1(e,t,r){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:r?null:e.firstChild}function NS(e,t,r){return e===t?r?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:r?null:e.lastChild}function E3(e,t){if(t===void 0)return!0;let r=e.innerText;return r===void 0&&(r=e.textContent),r=r.trim().toLowerCase(),r.length===0?!1:t.repeating?r[0]===t.keys[0]:r.indexOf(t.keys.join(""))===0}function _c(e,t,r,n,o,i){let s=!1,a=o(e,t,t?r:!1);for(;a;){if(a===e.firstChild){if(s)return!1;s=!0}const l=n?!1:a.disabled||a.getAttribute("aria-disabled")==="true";if(!a.hasAttribute("tabindex")||!E3(a,i)||l)a=o(e,a,r);else return a.focus(),!0}return!1}const PJ=S.forwardRef(function(t,r){const{actions:n,autoFocus:o=!1,autoFocusItem:i=!1,children:s,className:a,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:d="selectedMenu"}=t,f=ve(t,RJ),p=S.useRef(null),h=S.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});ha(()=>{o&&p.current.focus()},[o]),S.useImperativeHandle(n,()=>({adjustStyleForScrollbar:(y,x)=>{const k=!p.current.style.width;if(y.clientHeight{const x=p.current,k=y.key,w=Br(x).activeElement;if(k==="ArrowDown")y.preventDefault(),_c(x,w,c,l,o1);else if(k==="ArrowUp")y.preventDefault(),_c(x,w,c,l,NS);else if(k==="Home")y.preventDefault(),_c(x,null,c,l,o1);else if(k==="End")y.preventDefault(),_c(x,null,c,l,NS);else if(k.length===1){const E=h.current,M=k.toLowerCase(),C=performance.now();E.keys.length>0&&(C-E.lastTime>500?(E.keys=[],E.repeating=!0,E.previousKeyMatched=!0):E.repeating&&M!==E.keys[0]&&(E.repeating=!1)),E.lastTime=C,E.keys.push(M);const T=w&&!E.repeating&&E3(w,E);E.previousKeyMatched&&(T||_c(x,w,!1,l,o1,E))?y.preventDefault():E.previousKeyMatched=!1}u&&u(y)},b=Ur(p,r);let v=-1;S.Children.forEach(s,(y,x)=>{if(!S.isValidElement(y)){v===x&&(v+=1,v>=s.length&&(v=-1));return}y.props.disabled||(d==="selectedMenu"&&y.props.selected||v===-1)&&(v=x),v===x&&(y.props.disabled||y.props.muiSkipListHighlight||y.type.muiSkipListHighlight)&&(v+=1,v>=s.length&&(v=-1))});const g=S.Children.map(s,(y,x)=>{if(x===v){const k={};return i&&(k.autoFocus=!0),y.props.tabIndex===void 0&&d==="selectedMenu"&&(k.tabIndex=0),S.cloneElement(y,k)}return y});return O.jsx(vJ,_({role:"menu",ref:b,className:a,onKeyDown:m,tabIndex:o?0:-1},f,{children:g}))}),zJ=PJ;function LJ(e){return Vt("MuiPopover",e)}jt("MuiPopover",["root","paper"]);const IJ=["onEntering"],DJ=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],$J=["slotProps"];function RS(e,t){let r=0;return typeof t=="number"?r=t:t==="center"?r=e.height/2:t==="bottom"&&(r=e.height),r}function PS(e,t){let r=0;return typeof t=="number"?r=t:t==="center"?r=e.width/2:t==="right"&&(r=e.width),r}function zS(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function i1(e){return typeof e=="function"?e():e}const HJ=e=>{const{classes:t}=e;return tr({root:["root"],paper:["paper"]},LJ,t)},BJ=Xe(iJ,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),C3=Xe(dq,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),FJ=S.forwardRef(function(t,r){var n,o,i;const s=Wt({props:t,name:"MuiPopover"}),{action:a,anchorEl:l,anchorOrigin:c={vertical:"top",horizontal:"left"},anchorPosition:u,anchorReference:d="anchorEl",children:f,className:p,container:h,elevation:m=8,marginThreshold:b=16,open:v,PaperProps:g={},slots:y,slotProps:x,transformOrigin:k={vertical:"top",horizontal:"left"},TransitionComponent:w=nv,transitionDuration:E="auto",TransitionProps:{onEntering:M}={},disableScrollLock:C=!1}=s,T=ve(s.TransitionProps,IJ),N=ve(s,DJ),F=(n=x==null?void 0:x.paper)!=null?n:g,I=S.useRef(),V=Ur(I,F.ref),j=_({},s,{anchorOrigin:c,anchorReference:d,elevation:m,marginThreshold:b,externalPaperSlotProps:F,transformOrigin:k,TransitionComponent:w,transitionDuration:E,TransitionProps:T}),z=HJ(j),q=S.useCallback(()=>{if(d==="anchorPosition")return u;const pe=i1(l),Ke=(pe&&pe.nodeType===1?pe:Br(I.current).body).getBoundingClientRect();return{top:Ke.top+RS(Ke,c.vertical),left:Ke.left+PS(Ke,c.horizontal)}},[l,c.horizontal,c.vertical,u,d]),A=S.useCallback(pe=>({vertical:RS(pe,k.vertical),horizontal:PS(pe,k.horizontal)}),[k.horizontal,k.vertical]),P=S.useCallback(pe=>{const De={width:pe.offsetWidth,height:pe.offsetHeight},Ke=A(De);if(d==="none")return{top:null,left:null,transformOrigin:zS(Ke)};const Bn=q();let qr=Bn.top-Ke.vertical,rr=Bn.left-Ke.horizontal;const zo=qr+De.height,Pt=rr+De.width,Gr=dd(i1(l)),gn=Gr.innerHeight-b,Fn=Gr.innerWidth-b;if(b!==null&&qrgn){const Qe=zo-gn;qr-=Qe,Ke.vertical+=Qe}if(b!==null&&rrFn){const Qe=Pt-Fn;rr-=Qe,Ke.horizontal+=Qe}return{top:`${Math.round(qr)}px`,left:`${Math.round(rr)}px`,transformOrigin:zS(Ke)}},[l,d,q,A,b]),[B,Y]=S.useState(v),J=S.useCallback(()=>{const pe=I.current;if(!pe)return;const De=P(pe);De.top!==null&&(pe.style.top=De.top),De.left!==null&&(pe.style.left=De.left),pe.style.transformOrigin=De.transformOrigin,Y(!0)},[P]);S.useEffect(()=>(C&&window.addEventListener("scroll",J),()=>window.removeEventListener("scroll",J)),[l,C,J]);const Ne=(pe,De)=>{M&&M(pe,De),J()},ie=()=>{Y(!1)};S.useEffect(()=>{v&&J()}),S.useImperativeHandle(a,()=>v?{updatePosition:()=>{J()}}:null,[v,J]),S.useEffect(()=>{if(!v)return;const pe=Tj(()=>{J()}),De=dd(l);return De.addEventListener("resize",pe),()=>{pe.clear(),De.removeEventListener("resize",pe)}},[l,v,J]);let ue=E;E==="auto"&&!w.muiSupportAuto&&(ue=void 0);const de=h||(l?Br(i1(l)).body:void 0),he=(o=y==null?void 0:y.root)!=null?o:BJ,Me=(i=y==null?void 0:y.paper)!=null?i:C3,Se=si({elementType:Me,externalSlotProps:_({},F,{style:B?F.style:_({},F.style,{opacity:0})}),additionalProps:{elevation:m,ref:V},ownerState:j,className:Ce(z.paper,F==null?void 0:F.className)}),ft=si({elementType:he,externalSlotProps:(x==null?void 0:x.root)||{},externalForwardedProps:N,additionalProps:{ref:r,slotProps:{backdrop:{invisible:!0}},container:de,open:v},ownerState:j,className:Ce(z.root,p)}),{slotProps:rt}=ft,Or=ve(ft,$J);return O.jsx(he,_({},Or,!u3(he)&&{slotProps:rt,disableScrollLock:C},{children:O.jsx(w,_({appear:!0,in:v,onEntering:Ne,onExited:ie,timeout:ue},T,{children:O.jsx(Me,_({},Se,{children:f}))}))}))}),VJ=FJ;function jJ(e){return Vt("MuiMenu",e)}jt("MuiMenu",["root","paper","list"]);const UJ=["onEntering"],WJ=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],KJ={vertical:"top",horizontal:"right"},qJ={vertical:"top",horizontal:"left"},GJ=e=>{const{classes:t}=e;return tr({root:["root"],paper:["paper"],list:["list"]},jJ,t)},YJ=Xe(VJ,{shouldForwardProp:e=>kb(e)||e==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),JJ=Xe(C3,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),XJ=Xe(zJ,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),QJ=S.forwardRef(function(t,r){var n,o;const i=Wt({props:t,name:"MuiMenu"}),{autoFocus:s=!0,children:a,className:l,disableAutoFocusItem:c=!1,MenuListProps:u={},onClose:d,open:f,PaperProps:p={},PopoverClasses:h,transitionDuration:m="auto",TransitionProps:{onEntering:b}={},variant:v="selectedMenu",slots:g={},slotProps:y={}}=i,x=ve(i.TransitionProps,UJ),k=ve(i,WJ),w=jm(),E=w.direction==="rtl",M=_({},i,{autoFocus:s,disableAutoFocusItem:c,MenuListProps:u,onEntering:b,PaperProps:p,transitionDuration:m,TransitionProps:x,variant:v}),C=GJ(M),T=s&&!c&&f,N=S.useRef(null),F=(P,B)=>{N.current&&N.current.adjustStyleForScrollbar(P,w),b&&b(P,B)},I=P=>{P.key==="Tab"&&(P.preventDefault(),d&&d(P,"tabKeyDown"))};let V=-1;S.Children.map(a,(P,B)=>{S.isValidElement(P)&&(P.props.disabled||(v==="selectedMenu"&&P.props.selected||V===-1)&&(V=B))});const j=(n=g.paper)!=null?n:JJ,z=(o=y.paper)!=null?o:p,q=si({elementType:g.root,externalSlotProps:y.root,ownerState:M,className:[C.root,l]}),A=si({elementType:j,externalSlotProps:z,ownerState:M,className:C.paper});return O.jsx(YJ,_({onClose:d,anchorOrigin:{vertical:"bottom",horizontal:E?"right":"left"},transformOrigin:E?KJ:qJ,slots:{paper:j,root:g.root},slotProps:{root:q,paper:A},open:f,ref:r,transitionDuration:m,TransitionProps:_({onEntering:F},x),ownerState:M},k,{classes:h,children:O.jsx(XJ,_({onKeyDown:I,actions:N,autoFocus:s&&(V===-1||c),autoFocusItem:T,variant:v},u,{className:Ce(C.list,u.className),children:a}))}))}),ZJ=QJ;function eX(e){return Vt("MuiMenuItem",e)}const tX=jt("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),Ac=tX,rX=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],nX=(e,t)=>{const{ownerState:r}=e;return[t.root,r.dense&&t.dense,r.divider&&t.divider,!r.disableGutters&&t.gutters]},oX=e=>{const{disabled:t,dense:r,divider:n,disableGutters:o,selected:i,classes:s}=e,l=tr({root:["root",r&&"dense",t&&"disabled",!o&&"gutters",n&&"divider",i&&"selected"]},eX,s);return _({},s,l)},iX=Xe(Eb,{shouldForwardProp:e=>kb(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:nX})(({theme:e,ownerState:t})=>_({},e.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Ac.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${Ac.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${Ac.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${Ac.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Ac.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${_S.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${_S.inset}`]:{marginLeft:52},[`& .${gh.root}`]:{marginTop:0,marginBottom:0},[`& .${gh.inset}`]:{paddingLeft:36},[`& .${AS.root}`]:{minWidth:36}},!t.dense&&{[e.breakpoints.up("sm")]:{minHeight:"auto"}},t.dense&&_({minHeight:32,paddingTop:4,paddingBottom:4},e.typography.body2,{[`& .${AS.root} svg`]:{fontSize:"1.25rem"}}))),sX=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiMenuItem"}),{autoFocus:o=!1,component:i="li",dense:s=!1,divider:a=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:d,className:f}=n,p=ve(n,rX),h=S.useContext(vd),m=S.useMemo(()=>({dense:s||h.dense||!1,disableGutters:l}),[h.dense,s,l]),b=S.useRef(null);ha(()=>{o&&b.current&&b.current.focus()},[o]);const v=_({},n,{dense:m.dense,divider:a,disableGutters:l}),g=oX(n),y=Ur(b,r);let x;return n.disabled||(x=d!==void 0?d:-1),O.jsx(vd.Provider,{value:m,children:O.jsx(iX,_({ref:y,role:u,tabIndex:x,component:i,focusVisibleClassName:Ce(g.focusVisible,c),className:Ce(g.root,f)},p,{ownerState:v,classes:g}))})}),aX=sX;function lX(e){return Vt("MuiTooltip",e)}const cX=jt("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),Hi=cX,uX=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","slotProps","slots","title","TransitionComponent","TransitionProps"];function dX(e){return Math.round(e*1e5)/1e5}const fX=e=>{const{classes:t,disableInteractive:r,arrow:n,touch:o,placement:i}=e,s={popper:["popper",!r&&"popperInteractive",n&&"popperArrow"],tooltip:["tooltip",n&&"tooltipArrow",o&&"touch",`tooltipPlacement${Fe(i.split("-")[0])}`],arrow:["arrow"]};return tr(s,lX,t)},pX=Xe(Rb,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.popper,!r.disableInteractive&&t.popperInteractive,r.arrow&&t.popperArrow,!r.open&&t.popperClose]}})(({theme:e,ownerState:t,open:r})=>_({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none"},!t.disableInteractive&&{pointerEvents:"auto"},!r&&{pointerEvents:"none"},t.arrow&&{[`&[data-popper-placement*="bottom"] .${Hi.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Hi.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Hi.arrow}`]:_({},t.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}}),[`&[data-popper-placement*="left"] .${Hi.arrow}`]:_({},t.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})),hX=Xe("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.tooltip,r.touch&&t.touch,r.arrow&&t.tooltipArrow,t[`tooltipPlacement${Fe(r.placement.split("-")[0])}`]]}})(({theme:e,ownerState:t})=>_({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:Lr(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},t.arrow&&{position:"relative",margin:0},t.touch&&{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${dX(16/14)}em`,fontWeight:e.typography.fontWeightRegular},{[`.${Hi.popper}[data-popper-placement*="left"] &`]:_({transformOrigin:"right center"},t.isRtl?_({marginLeft:"14px"},t.touch&&{marginLeft:"24px"}):_({marginRight:"14px"},t.touch&&{marginRight:"24px"})),[`.${Hi.popper}[data-popper-placement*="right"] &`]:_({transformOrigin:"left center"},t.isRtl?_({marginRight:"14px"},t.touch&&{marginRight:"24px"}):_({marginLeft:"14px"},t.touch&&{marginLeft:"24px"})),[`.${Hi.popper}[data-popper-placement*="top"] &`]:_({transformOrigin:"center bottom",marginBottom:"14px"},t.touch&&{marginBottom:"24px"}),[`.${Hi.popper}[data-popper-placement*="bottom"] &`]:_({transformOrigin:"center top",marginTop:"14px"},t.touch&&{marginTop:"24px"})})),mX=Xe("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:Lr(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}));let Ef=!1,s1=null,Nc={x:0,y:0};function Cf(e,t){return r=>{t&&t(r),e(r)}}const gX=S.forwardRef(function(t,r){var n,o,i,s,a,l,c,u,d,f,p,h,m,b,v,g,y,x,k;const w=Wt({props:t,name:"MuiTooltip"}),{arrow:E=!1,children:M,components:C={},componentsProps:T={},describeChild:N=!1,disableFocusListener:F=!1,disableHoverListener:I=!1,disableInteractive:V=!1,disableTouchListener:j=!1,enterDelay:z=100,enterNextDelay:q=0,enterTouchDelay:A=700,followCursor:P=!1,id:B,leaveDelay:Y=0,leaveTouchDelay:J=1500,onClose:Ne,onOpen:ie,open:ue,placement:de="bottom",PopperComponent:he,PopperProps:Me={},slotProps:Se={},slots:ft={},title:rt,TransitionComponent:Or=nv,TransitionProps:pe}=w,De=ve(w,uX),Ke=S.isValidElement(M)?M:O.jsx("span",{children:M}),Bn=jm(),qr=Bn.direction==="rtl",[rr,zo]=S.useState(),[Pt,Gr]=S.useState(null),gn=S.useRef(!1),Fn=V||P,Qe=S.useRef(),Yr=S.useRef(),vn=S.useRef(),mi=S.useRef(),[Oa,fe]=Nj({controlled:ue,default:!1,name:"Tooltip",state:"open"});let yn=Oa;const dc=Aj(B),gi=S.useRef(),fc=S.useCallback(()=>{gi.current!==void 0&&(document.body.style.WebkitUserSelect=gi.current,gi.current=void 0),clearTimeout(mi.current)},[]);S.useEffect(()=>()=>{clearTimeout(Qe.current),clearTimeout(Yr.current),clearTimeout(vn.current),fc()},[fc]);const Ox=ke=>{clearTimeout(s1),Ef=!0,fe(!0),ie&&!yn&&ie(ke)},Qd=Ks(ke=>{clearTimeout(s1),s1=setTimeout(()=>{Ef=!1},800+Y),fe(!1),Ne&&yn&&Ne(ke),clearTimeout(Qe.current),Qe.current=setTimeout(()=>{gn.current=!1},Bn.transitions.duration.shortest)}),Jm=ke=>{gn.current&&ke.type!=="touchstart"||(rr&&rr.removeAttribute("title"),clearTimeout(Yr.current),clearTimeout(vn.current),z||Ef&&q?Yr.current=setTimeout(()=>{Ox(ke)},Ef?q:z):Ox(ke))},_x=ke=>{clearTimeout(Yr.current),clearTimeout(vn.current),vn.current=setTimeout(()=>{Qd(ke)},Y)},{isFocusVisibleRef:Ax,onBlur:FO,onFocus:VO,ref:jO}=_T(),[,Nx]=S.useState(!1),Rx=ke=>{FO(ke),Ax.current===!1&&(Nx(!1),_x(ke))},Px=ke=>{rr||zo(ke.currentTarget),VO(ke),Ax.current===!0&&(Nx(!0),Jm(ke))},zx=ke=>{gn.current=!0;const Jr=Ke.props;Jr.onTouchStart&&Jr.onTouchStart(ke)},Lx=Jm,Ix=_x,UO=ke=>{zx(ke),clearTimeout(vn.current),clearTimeout(Qe.current),fc(),gi.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",mi.current=setTimeout(()=>{document.body.style.WebkitUserSelect=gi.current,Jm(ke)},A)},WO=ke=>{Ke.props.onTouchEnd&&Ke.props.onTouchEnd(ke),fc(),clearTimeout(vn.current),vn.current=setTimeout(()=>{Qd(ke)},J)};S.useEffect(()=>{if(!yn)return;function ke(Jr){(Jr.key==="Escape"||Jr.key==="Esc")&&Qd(Jr)}return document.addEventListener("keydown",ke),()=>{document.removeEventListener("keydown",ke)}},[Qd,yn]);const KO=Ur(Ke.ref,jO,zo,r);!rt&&rt!==0&&(yn=!1);const Xm=S.useRef(),qO=ke=>{const Jr=Ke.props;Jr.onMouseMove&&Jr.onMouseMove(ke),Nc={x:ke.clientX,y:ke.clientY},Xm.current&&Xm.current.update()},pc={},Qm=typeof rt=="string";N?(pc.title=!yn&&Qm&&!I?rt:null,pc["aria-describedby"]=yn?dc:null):(pc["aria-label"]=Qm?rt:null,pc["aria-labelledby"]=yn&&!Qm?dc:null);const Vn=_({},pc,De,Ke.props,{className:Ce(De.className,Ke.props.className),onTouchStart:zx,ref:KO},P?{onMouseMove:qO}:{}),hc={};j||(Vn.onTouchStart=UO,Vn.onTouchEnd=WO),I||(Vn.onMouseOver=Cf(Lx,Vn.onMouseOver),Vn.onMouseLeave=Cf(Ix,Vn.onMouseLeave),Fn||(hc.onMouseOver=Lx,hc.onMouseLeave=Ix)),F||(Vn.onFocus=Cf(Px,Vn.onFocus),Vn.onBlur=Cf(Rx,Vn.onBlur),Fn||(hc.onFocus=Px,hc.onBlur=Rx));const GO=S.useMemo(()=>{var ke;let Jr=[{name:"arrow",enabled:!!Pt,options:{element:Pt,padding:4}}];return(ke=Me.popperOptions)!=null&&ke.modifiers&&(Jr=Jr.concat(Me.popperOptions.modifiers)),_({},Me.popperOptions,{modifiers:Jr})},[Pt,Me]),mc=_({},w,{isRtl:qr,arrow:E,disableInteractive:Fn,placement:de,PopperComponentProp:he,touch:gn.current}),Zm=fX(mc),Dx=(n=(o=ft.popper)!=null?o:C.Popper)!=null?n:pX,$x=(i=(s=(a=ft.transition)!=null?a:C.Transition)!=null?s:Or)!=null?i:nv,Hx=(l=(c=ft.tooltip)!=null?c:C.Tooltip)!=null?l:hX,Bx=(u=(d=ft.arrow)!=null?d:C.Arrow)!=null?u:mX,YO=cu(Dx,_({},Me,(f=Se.popper)!=null?f:T.popper,{className:Ce(Zm.popper,Me==null?void 0:Me.className,(p=(h=Se.popper)!=null?h:T.popper)==null?void 0:p.className)}),mc),JO=cu($x,_({},pe,(m=Se.transition)!=null?m:T.transition),mc),XO=cu(Hx,_({},(b=Se.tooltip)!=null?b:T.tooltip,{className:Ce(Zm.tooltip,(v=(g=Se.tooltip)!=null?g:T.tooltip)==null?void 0:v.className)}),mc),QO=cu(Bx,_({},(y=Se.arrow)!=null?y:T.arrow,{className:Ce(Zm.arrow,(x=(k=Se.arrow)!=null?k:T.arrow)==null?void 0:x.className)}),mc);return O.jsxs(S.Fragment,{children:[S.cloneElement(Ke,Vn),O.jsx(Dx,_({as:he??Rb,placement:de,anchorEl:P?{getBoundingClientRect:()=>({top:Nc.y,left:Nc.x,right:Nc.x,bottom:Nc.y,width:0,height:0})}:rr,popperRef:Xm,open:rr?yn:!1,id:dc,transition:!0},hc,YO,{popperOptions:GO,children:({TransitionProps:ke})=>O.jsx($x,_({timeout:Bn.transitions.duration.shorter},ke,JO,{children:O.jsxs(Hx,_({},XO,{children:[rt,E?O.jsx(Bx,_({},QO,{ref:Gr})):null]}))}))}))]})}),M3=gX;function vX(e){return Vt("MuiToggleButton",e)}const yX=jt("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge"]),LS=yX,bX=["children","className","color","disabled","disableFocusRipple","fullWidth","onChange","onClick","selected","size","value"],xX=e=>{const{classes:t,fullWidth:r,selected:n,disabled:o,size:i,color:s}=e,a={root:["root",n&&"selected",o&&"disabled",r&&"fullWidth",`size${Fe(i)}`,s]};return tr(a,vX,t)},kX=Xe(Eb,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`size${Fe(r.size)}`]]}})(({theme:e,ownerState:t})=>{let r=t.color==="standard"?e.palette.text.primary:e.palette[t.color].main,n;return e.vars&&(r=t.color==="standard"?e.vars.palette.text.primary:e.vars.palette[t.color].main,n=t.color==="standard"?e.vars.palette.text.primaryChannel:e.vars.palette[t.color].mainChannel),_({},e.typography.button,{borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active},t.fullWidth&&{width:"100%"},{[`&.${LS.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Lr(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${LS.selected}`]:{color:r,backgroundColor:e.vars?`rgba(${n} / ${e.vars.palette.action.selectedOpacity})`:Lr(r,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${n} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Lr(r,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${n} / ${e.vars.palette.action.selectedOpacity})`:Lr(r,e.palette.action.selectedOpacity)}}}},t.size==="small"&&{padding:7,fontSize:e.typography.pxToRem(13)},t.size==="large"&&{padding:15,fontSize:e.typography.pxToRem(15)})}),wX=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiToggleButton"}),{children:o,className:i,color:s="standard",disabled:a=!1,disableFocusRipple:l=!1,fullWidth:c=!1,onChange:u,onClick:d,selected:f,size:p="medium",value:h}=n,m=ve(n,bX),b=_({},n,{color:s,disabled:a,disableFocusRipple:l,fullWidth:c,size:p}),v=xX(b),g=y=>{d&&(d(y,h),y.defaultPrevented)||u&&u(y,h)};return O.jsx(kX,_({className:Ce(v.root,i),disabled:a,focusRipple:!l,ref:r,onClick:g,onChange:u,value:h,ownerState:b,"aria-pressed":f},m,{children:o}))}),SX=wX;var EX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 15v2c0 1.054.95 2 2 2h3v2H7a4 4 0 0 1-4-4v-2h2zm13-5l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16 10h2zm-1 2.885L15.753 16h2.492L17 12.885zM3 3h6a3 3 0 0 1 2.235 5A3 3 0 0 1 9 13H3V3zm6 6H5v2h4a1 1 0 0 0 0-2zm8-6a4 4 0 0 1 4 4v2h-2V7a2 2 0 0 0-2-2h-3V3h3zM9 5H5v2h4a1 1 0 1 0 0-2z"}}],CX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"}}],MX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"}}],TX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0zm-8.66 16h15.588L12 5.5 4.206 19zM11 16h2v2h-2v-2zm0-7h2v5h-2V9z"}}],OX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 19h18v2H3v-2zm5-6h3l-4 4-4-4h3V3h2v10zm10 0h3l-4 4-4-4h3V3h2v10z"}}],_X=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm2 15h14v2H5v-2zm-2-5h18v2H3v-2zm2-5h14v2H5V9z"}}],AX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h18v2H3v-2zm0-5h18v2H3v-2zm0-5h18v2H3V9z"}}],NX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h14v2H3v-2zm0-5h18v2H3v-2zm0-5h14v2H3V9z"}}],RX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm4 15h14v2H7v-2zm-4-5h18v2H3v-2zm4-5h14v2H7V9z"}}],PX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 3h18v2H3V3zm5 8v10H6V11H3l4-4 4 4H8zm10 0v10h-2V11h-3l4-4 4 4h-3z"}}],zX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 11h18v2H3v-2zm15 7v3h-2v-3h-3l4-4 4 4h-3zM8 18v3H6v-3H3l4-4 4 4H8zM18 6h3l-4 4-4-4h3V3h2v3zM8 6h3l-4 4-4-4h3V3h2v3z"}}],LX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M6.75 2.5A4.25 4.25 0 0 1 11 6.75V11H6.75a4.25 4.25 0 1 1 0-8.5zM9 9V6.75A2.25 2.25 0 1 0 6.75 9H9zm-2.25 4H11v4.25A4.25 4.25 0 1 1 6.75 13zm0 2A2.25 2.25 0 1 0 9 17.25V15H6.75zm10.5-12.5a4.25 4.25 0 1 1 0 8.5H13V6.75a4.25 4.25 0 0 1 4.25-4.25zm0 6.5A2.25 2.25 0 1 0 15 6.75V9h2.25zM13 13h4.25A4.25 4.25 0 1 1 13 17.25V13zm2 2v2.25A2.25 2.25 0 1 0 17.25 15H15z"}}],IX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 16l-6-6h12z"}}],DX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 7v4L2 6l6-5v4h5a8 8 0 1 1 0 16H4v-2h9a6 6 0 1 0 0-12H8z"}}],$X=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 7h-5a6 6 0 1 0 0 12h9v2h-9a8 8 0 1 1 0-16h5V1l6 5-6 5V7z"}}],HX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 12l6-6v12z"}}],BX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 12l-6 6V6z"}}],FX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 8l6 6H6z"}}],VX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 3v7.267l6.294-3.633 1 1.732-6.293 3.633 6.293 3.635-1 1.732L13 13.732V21h-2v-7.268l-6.294 3.634-1-1.732L9.999 12 3.706 8.366l1-1.732L11 10.267V3z"}}],jX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14.828 7.757l-5.656 5.657a1 1 0 1 0 1.414 1.414l5.657-5.656A3 3 0 1 0 12 4.929l-5.657 5.657a5 5 0 1 0 7.071 7.07L19.071 12l1.414 1.414-5.657 5.657a7 7 0 1 1-9.9-9.9l5.658-5.656a5 5 0 0 1 7.07 7.07L12 16.244A3 3 0 1 1 7.757 12l5.657-5.657 1.414 1.414z"}}],UX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 11h4.5a2.5 2.5 0 1 0 0-5H8v5zm10 4.5a4.5 4.5 0 0 1-4.5 4.5H6V4h6.5a4.5 4.5 0 0 1 3.256 7.606A4.498 4.498 0 0 1 18 15.5zM8 13v5h5.5a2.5 2.5 0 1 0 0-5H8z"}}],WX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12 2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3zm16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5z"}}],KX=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M14 3c.552 0 1 .448 1 1v5h5c.552 0 1 .448 1 1v10c0 .552-.448 1-1 1H10c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h10zm-1 2H5v8h8V5z"}}],qX=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M11 3c.552 0 1 .448 1 1v2h5c.552 0 1 .448 1 1v5h2c.552 0 1 .448 1 1v7c0 .552-.448 1-1 1h-7c-.552 0-1-.448-1-1v-2H7c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h7zm5 5H8v8h8V8z"}}],GX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 3v2H4v13.385L5.763 17H20v-7h2v8a1 1 0 0 1-1 1H6.455L2 22.5V4a1 1 0 0 1 1-1h11zm5 0V0h2v3h3v2h-3v3h-2V5h-3V3h3z"}}],YX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-.997-4L6.76 11.757l1.414-1.414 2.829 2.829 5.656-5.657 1.415 1.414L11.003 16z"}}],JX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M7 7V3a1 1 0 0 1 1-1h13a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-4v3.993c0 .556-.449 1.007-1.007 1.007H3.007A1.006 1.006 0 0 1 2 20.993l.003-12.986C2.003 7.451 2.452 7 3.01 7H7zm2 0h6.993C16.549 7 17 7.449 17 8.007V15h3V4H9v3zm6 2H4.003L4 20h11V9zm-6.497 9l-3.536-3.536 1.414-1.414 2.122 2.122 4.242-4.243 1.414 1.414L8.503 18z"}}],XX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M6 4v4h12V4h2.007c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.994.994 0 0 1 3 21.007V4.993C3 4.445 3.445 4 3.993 4H6zm2-2h8v4H8V2z"}}],QX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 4V2h10v2h3.007c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.994.994 0 0 1 3 21.007V4.993C3 4.445 3.445 4 3.993 4H7zm0 2H5v14h14V6h-2v2H7V6zm2-2v2h6V4H9z"}}],ZX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm0-9.414l2.828-2.829 1.415 1.415L13.414 12l2.829 2.828-1.415 1.415L12 13.414l-2.828 2.829-1.415-1.415L10.586 12 7.757 9.172l1.415-1.415L12 10.586z"}}],eQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"}}],tQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"}}],rQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M23 12l-7.071 7.071-1.414-1.414L20.172 12l-5.657-5.657 1.414-1.414L23 12zM3.828 12l5.657 5.657-1.414 1.414L1 12l7.071-7.071 1.414 1.414L3.828 12z"}}],nQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16.95 8.464l1.414-1.414 4.95 4.95-4.95 4.95-1.414-1.414L20.485 12 16.95 8.464zm-9.9 0L3.515 12l3.535 3.536-1.414 1.414L.686 12l4.95-4.95L7.05 8.464z"}}],oQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 6h5v2h-2v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V8H2V6h5V3a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v3zm-8 5v6h2v-6H9zm4 0v6h2v-6h-2zM9 4v2h6V4H9z"}}],iQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 6h5v2h-2v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V8H2V6h5V3a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v3zm1 2H6v12h12V8zm-9 3h2v6H9v-6zm4 0h2v6h-2v-6zM9 4v2h6V4H9z"}}],sQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M12 3c.552 0 1 .448 1 1v8c.835-.628 1.874-1 3-1 2.761 0 5 2.239 5 5s-2.239 5-5 5c-1.032 0-1.99-.313-2.787-.848L13 20c0 .552-.448 1-1 1H6c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zm-1 2H7v14h4V5zm8 10h-6v2h6v-2z"}}],aQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 5c.552 0 1 .448 1 1v6c0 .552-.448 1-1 1 .628.835 1 1.874 1 3 0 2.761-2.239 5-5 5s-5-2.239-5-5c0-1.126.372-2.165 1-3H4c-.552 0-1-.448-1-1V6c0-.552.448-1 1-1h16zm-7 10v2h6v-2h-6zm6-8H5v4h14V7z"}}],lQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4.583 17.321C3.553 16.227 3 15 3 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 0 1-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179zm10 0C13.553 16.227 13 15 13 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 0 1-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179z"}}],cQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19.417 6.679C20.447 7.773 21 9 21 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311-1.804-.167-3.226-1.648-3.226-3.489a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179zm-10 0C10.447 7.773 11 9 11 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311C4.591 12.322 3.17 10.841 3.17 9a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179z"}}],uQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 19h16v-7h2v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-8h2v7zM14 9h5l-7 7-7-7h5V3h4v6z"}}],dQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M16 13l6.964 4.062-2.973.85 2.125 3.681-1.732 1-2.125-3.68-2.223 2.15L16 13zm-2-7h2v2h5a1 1 0 0 1 1 1v4h-2v-3H10v10h4v2H9a1 1 0 0 1-1-1v-5H6v-2h2V9a1 1 0 0 1 1-1h5V6zM4 14v2H2v-2h2zm0-4v2H2v-2h2zm0-4v2H2V6h2zm0-4v2H2V2h2zm4 0v2H6V2h2zm4 0v2h-2V2h2zm4 0v2h-2V2h2z"}}],fQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 19a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm-5.5 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm11 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zM13 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.621 6.302 14.685 14.685 0 0 0 5.327 3.042l-.536 1.93A16.685 16.685 0 0 1 12 13.726a16.696 16.696 0 0 1-6.202 3.547l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042 18.077 18.077 0 0 1-2.822-4.3h2.24A16.031 16.031 0 0 0 12 10.876a16.168 16.168 0 0 0 2.91-4.876L5 6V4h6V2h2z"}}],pQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 19a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm-5.5 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm11 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zM18 3v2H8v4h9v2H8v4h10v2H6V3h12z"}}],hQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 10h2v.757a4.5 4.5 0 0 1 7 3.743V20h-2v-5.5c0-1.43-1.175-2.5-2.5-2.5S16 13.07 16 14.5V20h-2V10zm-2-6v2H4v5h8v2H4v5h8v2H2V4h10z"}}],mQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-1-5h2v2h-2v-2zm0-8h2v6h-2V7z"}}],gQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6zm11-3v9l-3.794-3.793-5.999 6-1.414-1.414 5.999-6L12 3h9z"}}],vQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1.001 1.001 0 0 1 3 21l.003-14c0-.552.45-1 1.007-1H7zM5.003 8L5 20h10V8H5.003zM9 6h8v10h2V4H9v2z"}}],yQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M6 21.5c-1.933 0-3.5-1.567-3.5-3.5s1.567-3.5 3.5-3.5c1.585 0 2.924 1.054 3.355 2.5H15v-2h2V9.242L14.757 7H9V9H3V3h6v2h5.757L18 1.756 22.243 6 19 9.241V15L21 15v6h-6v-2H9.355c-.43 1.446-1.77 2.5-3.355 2.5zm0-5c-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5-.672-1.5-1.5-1.5zm13 .5h-2v2h2v-2zM18 4.586L16.586 6 18 7.414 19.414 6 18 4.586zM7 5H5v2h2V5z"}}],bQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15.246 14H8.754l-1.6 4H5l6-15h2l6 15h-2.154l-1.6-4zm-.8-2L12 5.885 9.554 12h4.892zM3 20h18v2H3v-2z"}}],xQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M10 6v15H8V6H2V4h14v2h-6zm8 8v7h-2v-7h-3v-2h8v2h-3z"}}],kQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11.246 15H4.754l-2 5H.6L7 4h2l6.4 16h-2.154l-2-5zm-.8-2L8 6.885 5.554 13h4.892zM21 12.535V12h2v8h-2v-.535a4 4 0 1 1 0-6.93zM19 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"}}],wQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12.651 14.065L11.605 20H9.574l1.35-7.661-7.41-7.41L4.93 3.515 20.485 19.07l-1.414 1.414-6.42-6.42zm-.878-6.535l.27-1.53h-1.8l-2-2H20v2h-5.927L13.5 9.257 11.773 7.53z"}}],SQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z"}}],EQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 3h2v6h-2V5h-4V3h4zM4 3h4v2H4v4H2V3h2zm16 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z"}}],CQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 18l7.68-6L5 6V4h14v2H8.263L16 12l-7.737 6H19v2H5v-2z"}}],MQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 1v4H4v14h16V3h1.008c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3H6V1h2zm4 7l4 4h-3v4h-2v-4H8l4-4zm6-7v4h-8V3h6V1h2z"}}],TQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M13 20h-2v-7H4v7H2V4h2v7h7V4h2v16zm8-12v12h-2v-9.796l-2 .536V8.67L19.5 8H21z"}}],OQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M4 4v7h7V4h2v16h-2v-7H4v7H2V4h2zm14.5 4c2.071 0 3.75 1.679 3.75 3.75 0 .857-.288 1.648-.772 2.28l-.148.18L18.034 18H22v2h-7v-1.556l4.82-5.546c.268-.307.43-.709.43-1.148 0-.966-.784-1.75-1.75-1.75-.918 0-1.671.707-1.744 1.606l-.006.144h-2C14.75 9.679 16.429 8 18.5 8z"}}],_Q=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M22 8l-.002 2-2.505 2.883c1.59.435 2.757 1.89 2.757 3.617 0 2.071-1.679 3.75-3.75 3.75-1.826 0-3.347-1.305-3.682-3.033l1.964-.382c.156.806.866 1.415 1.718 1.415.966 0 1.75-.784 1.75-1.75s-.784-1.75-1.75-1.75c-.286 0-.556.069-.794.19l-1.307-1.547L19.35 10H15V8h7zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2z"}}],AQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M13 20h-2v-7H4v7H2V4h2v7h7V4h2v16zm9-12v8h1.5v2H22v2h-2v-2h-5.5v-1.34l5-8.66H22zm-2 3.133L17.19 16H20v-4.867z"}}],NQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M22 8v2h-4.323l-.464 2.636c.33-.089.678-.136 1.037-.136 2.21 0 4 1.79 4 4s-1.79 4-4 4c-1.827 0-3.367-1.224-3.846-2.897l1.923-.551c.24.836 1.01 1.448 1.923 1.448 1.105 0 2-.895 2-2s-.895-2-2-2c-.63 0-1.193.292-1.56.748l-1.81-.904L16 8h6zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2z"}}],RQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M21.097 8l-2.598 4.5c2.21 0 4.001 1.79 4.001 4s-1.79 4-4 4-4-1.79-4-4c0-.736.199-1.426.546-2.019L18.788 8h2.309zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2zm14.5 10.5c-1.105 0-2 .895-2 2s.895 2 2 2 2-.895 2-2-.895-2-2-2z"}}],PQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7.784 14l.42-4H4V8h4.415l.525-5h2.011l-.525 5h3.989l.525-5h2.011l-.525 5H20v2h-3.784l-.42 4H20v2h-4.415l-.525 5h-2.011l.525-5H9.585l-.525 5H7.049l.525-5H4v-2h3.784zm2.011 0h3.99l.42-4h-3.99l-.42 4z"}}],zQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 11V4h2v17h-2v-8H7v8H5V4h2v7z"}}],LQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 15v3h3v2h-3v3h-2v-3h-3v-2h3v-3h2zm.008-12c.548 0 .992.445.992.993V13h-2V5H4v13.999L14 9l3 3v2.829l-3-3L6.827 19H14v2H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016zM8 7a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"}}],IQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v1.757l-2 2V5H5v8.1l4-4 4.328 4.329-1.415 1.413L9 11.93l-4 3.999V19h10.533l.708.001 1.329-1.33L18.9 19h.1v-2.758l2-2V20c0 .552-.448 1-1 1H4c-.55 0-1-.45-1-1V4c0-.552.448-1 1-1h16zm1.778 4.808l1.414 1.414L15.414 17l-1.416-.002.002-1.412 7.778-7.778zM15.5 7c.828 0 1.5.672 1.5 1.5s-.672 1.5-1.5 1.5S14 9.328 14 8.5 14.672 7 15.5 7z"}}],DQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4.828 21l-.02.02-.021-.02H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H4.828zM20 15V5H4v14L14 9l6 6zm0 2.828l-6-6L6.828 19H20v-1.172zM8 11a2 2 0 1 1 0-4 2 2 0 0 1 0 4z"}}],$Q=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h18v2H3v-2zm8-5h10v2H11v-2zm0-5h10v2H11V9zm-8 3.5L7 9v7l-4-3.5z"}}],HQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h18v2H3v-2zm8-5h10v2H11v-2zm0-5h10v2H11V9zm-4 3.5L3 16V9l4 3.5z"}}],BQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM11 7h2v2h-2V7zm0 4h2v6h-2v-6z"}}],FQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 21v-2h3V5H8V3h8v2h-3v14h3v2H8zM18.05 7.05L23 12l-4.95 4.95-1.414-1.414L20.172 12l-3.536-3.536L18.05 7.05zm-12.1 0l1.414 1.414L3.828 12l3.536 3.536L5.95 16.95 1 12l4.95-4.95z"}}],VQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zm-1 2h-4v14h4V5zM6 7c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2H5v1.999L3 11v2l2-.001V15h2v-2.001L9 13v-2l-2-.001V9z"}}],jQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M10 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zM9 5H5v14h4V5zm9 2c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2h-2v1.999L15 11v2l2-.001V15h2v-2.001L21 13v-2l-2-.001V9z"}}],UQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M12 13c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2h-2v1.999L9 17v2l2-.001V21h2v-2.001L15 19v-2l-2-.001V15zm7-12c.552 0 1 .448 1 1v6c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zM5 5v4h14V5H5z"}}],WQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 13c.552 0 1 .448 1 1v6c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1v-6c0-.552.448-1 1-1h16zm-1 2H5v4h14v-4zM12 1c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2h-2v1.999L9 5v2l2-.001V9h2V6.999L15 7V5l-2-.001V3z"}}],KQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 20H7v-2h2.927l2.116-12H9V4h8v2h-2.927l-2.116 12H15z"}}],qQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M11 5H5v14h6V5zm2 0v14h6V5h-6zM4 3h16a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"}}],GQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 4h10v2H11V4zM6 7v4H4V7H1l4-4 4 4H6zm0 10h3l-4 4-4-4h3v-4h2v4zm5 1h10v2H11v-2zm-2-7h12v2H9v-2z"}}],YQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.657 14.828l-1.414-1.414L17.657 12A4 4 0 1 0 12 6.343l-1.414 1.414-1.414-1.414 1.414-1.414a6 6 0 0 1 8.485 8.485l-1.414 1.414zm-2.829 2.829l-1.414 1.414a6 6 0 1 1-8.485-8.485l1.414-1.414 1.414 1.414L6.343 12A4 4 0 1 0 12 17.657l1.414-1.414 1.414 1.414zm0-9.9l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"}}],JQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.657 14.828l-1.414-1.414L17.657 12A4 4 0 1 0 12 6.343l-1.414 1.414-1.414-1.414 1.414-1.414a6 6 0 0 1 8.485 8.485l-1.414 1.414zm-2.829 2.829l-1.414 1.414a6 6 0 1 1-8.485-8.485l1.414-1.414 1.414 1.414L6.343 12A4 4 0 1 0 12 17.657l1.414-1.414 1.414 1.414zm0-9.9l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07zM5.775 2.293l1.932-.518L8.742 5.64l-1.931.518-1.036-3.864zm9.483 16.068l1.931-.518 1.036 3.864-1.932.518-1.035-3.864zM2.293 5.775l3.864 1.036-.518 1.931-3.864-1.035.518-1.932zm16.068 9.483l3.864 1.035-.518 1.932-3.864-1.036.518-1.931z"}}],XQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 17h5v2h-3v3h-2v-5zM7 7H2V5h3V2h2v5zm11.364 8.536L16.95 14.12l1.414-1.414a5 5 0 1 0-7.071-7.071L9.879 7.05 8.464 5.636 9.88 4.222a7 7 0 0 1 9.9 9.9l-1.415 1.414zm-2.828 2.828l-1.415 1.414a7 7 0 0 1-9.9-9.9l1.415-1.414L7.05 9.88l-1.414 1.414a5 5 0 1 0 7.071 7.071l1.414-1.414 1.415 1.414zm-.708-10.607l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"}}],QQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18.364 15.536L16.95 14.12l1.414-1.414a5 5 0 1 0-7.071-7.071L9.879 7.05 8.464 5.636 9.88 4.222a7 7 0 0 1 9.9 9.9l-1.415 1.414zm-2.828 2.828l-1.415 1.414a7 7 0 0 1-9.9-9.9l1.415-1.414L7.05 9.88l-1.414 1.414a5 5 0 1 0 7.071 7.071l1.414-1.414 1.415 1.414zm-.708-10.607l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"}}],ZQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 4h10v2H11V4zm0 4h6v2h-6V8zm0 6h10v2H11v-2zm0 4h6v2h-6v-2zM3 4h6v6H3V4zm2 2v2h2V6H5zm-2 8h6v6H3v-6zm2 2v2h2v-2H5z"}}],eZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 4h13v2H8V4zm-5-.5h3v3H3v-3zm0 7h3v3H3v-3zm0 7h3v3H3v-3zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"}}],tZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 4h13v2H8V4zM5 3v3h1v1H3V6h1V4H3V3h2zM3 14v-2.5h2V11H3v-1h3v2.5H4v.5h2v1H3zm2 5.5H3v-1h2V18H3v-1h3v4H3v-1h2v-.5zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"}}],rZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 4h13v2H8V4zM4.5 6.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 6.9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"}}],nZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15.243 4.515l-6.738 6.737-.707 2.121-1.04 1.041 2.828 2.829 1.04-1.041 2.122-.707 6.737-6.738-4.242-4.242zm6.364 3.535a1 1 0 0 1 0 1.414l-7.779 7.779-2.12.707-1.415 1.414a1 1 0 0 1-1.414 0l-4.243-4.243a1 1 0 0 1 0-1.414l1.414-1.414.707-2.121 7.779-7.779a1 1 0 0 1 1.414 0l5.657 5.657zm-6.364-.707l1.414 1.414-4.95 4.95-1.414-1.414 4.95-4.95zM4.283 16.89l2.828 2.829-1.414 1.414-4.243-1.414 2.828-2.829z"}}],oZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm4 12.5v-4l2 2 2-2v4h2v-7h-2l-2 2-2-2H5v7h2zm11-3v-4h-2v4h-2l3 3 3-3h-2z"}}],iZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm1 2v14h16V5H4zm3 10.5H5v-7h2l2 2 2-2h2v7h-2v-4l-2 2-2-2v4zm11-3h2l-3 3-3-3h2v-4h2v4z"}}],sZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zm-9 2H5v5.999h2V9l3 3-3 3v-2H5v6h6v-2h2v2h6v-6h-2v2l-3-3 3-3v1.999h2V5h-6v2h-2V5zm2 8v2h-2v-2h2zm0-4v2h-2V9h2z"}}],aZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M21 20c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16c.552 0 1 .448 1 1v16zm-2-9V5h-5.999v2H15l-3 3-3-3h2V5H5v6h2v2H5v6h6v-2H9l3-3 3 3h-1.999v2H19v-6h-2v-2h2zm-8 2H9v-2h2v2zm4 0h-2v-2h2v2z"}}],lZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M18 3c1.657 0 3 1.343 3 3s-1.343 3-3 3h-3c-1.306 0-2.417-.834-2.829-2H11c-1.1 0-2 .9-2 2v.171c1.166.412 2 1.523 2 2.829 0 1.306-.834 2.417-2 2.829V15c0 1.1.9 2 2 2h1.17c.412-1.165 1.524-2 2.83-2h3c1.657 0 3 1.343 3 3s-1.343 3-3 3h-3c-1.306 0-2.417-.834-2.829-2H11c-2.21 0-4-1.79-4-4H5c-1.657 0-3-1.343-3-3s1.343-3 3-3h2c0-2.21 1.79-4 4-4h1.17c.412-1.165 1.524-2 2.83-2h3zm0 14h-3c-.552 0-1 .448-1 1s.448 1 1 1h3c.552 0 1-.448 1-1s-.448-1-1-1zM8 11H5c-.552 0-1 .448-1 1s.448 1 1 1h3c.552 0 1-.448 1-1s-.448-1-1-1zm10-6h-3c-.552 0-1 .448-1 1s.448 1 1 1h3c.552 0 1-.448 1-1s-.448-1-1-1z"}}],cZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm14 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-7 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}}],uZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M10 2c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1H8v2h5V9c0-.552.448-1 1-1h6c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1v-1H8v6h5v-1c0-.552.448-1 1-1h6c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1v-1H7c-.552 0-1-.448-1-1V8H4c-.552 0-1-.448-1-1V3c0-.552.448-1 1-1h6zm9 16h-4v2h4v-2zm0-8h-4v2h4v-2zM9 4H5v2h4V4z"}}],dZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 1.5c1.321 0 2.484.348 3.447.994.963.645 1.726 1.588 2.249 2.778.522 1.19.804 2.625.804 4.257v4.942c0 1.632-.282 3.068-.804 4.257-.523 1.19-1.286 2.133-2.25 2.778-.962.646-2.125.994-3.446.994-1.321 0-2.484-.348-3.447-.994-.963-.645-1.726-1.588-2.249-2.778-.522-1.19-.804-2.625-.804-4.257V9.529c0-1.632.282-3.068.804-4.257.523-1.19 1.286-2.133 2.25-2.778C9.515 1.848 10.678 1.5 12 1.5zm0 2c-.916 0-1.694.226-2.333.655-.637.427-1.158 1.07-1.532 1.92-.412.94-.635 2.108-.635 3.454v4.942c0 1.346.223 2.514.635 3.453.374.851.895 1.494 1.532 1.921.639.429 1.417.655 2.333.655.916 0 1.694-.226 2.333-.655.637-.427 1.158-1.07 1.532-1.92.412-.94.635-2.108.635-3.454V9.529c0-1.346-.223-2.514-.635-3.453-.374-.851-.895-1.494-1.532-1.921C13.694 3.726 12.916 3.5 12 3.5z"}}],fZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 1.5V22h-2V3.704L7.5 4.91V2.839l5-1.339z"}}],pZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 7.5a4 4 0 1 0-8 0H6a6 6 0 1 1 10.663 3.776l-7.32 8.723L18 20v2H6v-1.127l9.064-10.802A3.982 3.982 0 0 0 16 7.5z"}}],hZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18 2v1.362L12.809 9.55a6.501 6.501 0 1 1-7.116 8.028l1.94-.486A4.502 4.502 0 0 0 16.5 16a4.5 4.5 0 0 0-6.505-4.03l-.228.122-.69-1.207L14.855 4 6.5 4V2H18z"}}],mZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 1.5V16h3v2h-3v4h-2v-4H4v-1.102L14 1.5h2zM14 16V5.171L6.968 16H14z"}}],gZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18 2v2H9.3l-.677 6.445a6.5 6.5 0 1 1-2.93 7.133l1.94-.486A4.502 4.502 0 0 0 16.5 16a4.5 4.5 0 0 0-4.5-4.5c-2.022 0-3.278.639-3.96 1.53l-1.575-1.182L7.5 2H18z"}}],vZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14.886 2l-4.438 7.686A6.5 6.5 0 1 1 6.4 12.7L12.576 2h2.31zM12 11.5a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9z"}}],yZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 2v1.5L10.763 22H8.574l8.013-18H6V2z"}}],bZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 1.5a5.5 5.5 0 0 1 3.352 9.86C17.24 12.41 18.5 14.32 18.5 16.5c0 3.314-2.91 6-6.5 6s-6.5-2.686-6.5-6c0-2.181 1.261-4.09 3.147-5.141A5.5 5.5 0 0 1 12 1.5zm0 11c-2.52 0-4.5 1.828-4.5 4 0 2.172 1.98 4 4.5 4s4.5-1.828 4.5-4c0-2.172-1.98-4-4.5-4zm0-9a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7z"}}],xZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 1.5a6.5 6.5 0 0 1 5.619 9.77l-6.196 10.729H9.114l4.439-7.686A6.5 6.5 0 1 1 12 1.5zm0 2a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9z"}}],kZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M14 20v-2.157c1.863-1.192 3.5-3.875 3.5-6.959 0-3.073-2-6.029-5.5-6.029s-5.5 2.956-5.5 6.03c0 3.083 1.637 5.766 3.5 6.958V20H3v-2h4.76C5.666 16.505 4 13.989 4 10.884 4 6.247 7.5 3 12 3s8 3.247 8 7.884c0 3.105-1.666 5.621-3.76 7.116H21v2h-7z"}}],wZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M15 3c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-2v2h4c.552 0 1 .448 1 1v3h2c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1v-4c0-.552.448-1 1-1h2v-2H8v2h2c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1v-4c0-.552.448-1 1-1h2v-3c0-.552.448-1 1-1h4V9H9c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zM9 17H5v2h4v-2zm10 0h-4v2h4v-2zM14 5h-4v2h4V5z"}}],SZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 21v-4H7v4H5v-5a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v5h-2zM7 3v4h10V3h2v5a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V3h2zM2 9l4 3-4 3V9zm20 0v6l-4-3 4-3z"}}],EZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 6v15h-2v-5a6 6 0 1 1 0-12h10v2h-3v15h-2V6h-3zm-2 0a4 4 0 1 0 0 8V6z"}}],CZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12.9 6.858l4.242 4.243L7.242 21H3v-4.243l9.9-9.9zm1.414-1.414l2.121-2.122a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414l-2.122 2.121-4.242-4.242z"}}],MZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15.728 9.686l-1.414-1.414L5 17.586V19h1.414l9.314-9.314zm1.414-1.414l1.414-1.414-1.414-1.414-1.414 1.414 1.414 1.414zM7.242 21H3v-4.243L16.435 3.322a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414L7.243 21z"}}],TZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.934 3.036l1.732 1L18.531 6H21v2h-2v4h2v2h-2v7h-2v-7h-3.084c-.325 2.862-1.564 5.394-3.37 7.193l-1.562-1.27c1.52-1.438 2.596-3.522 2.917-5.922L10 14v-2l2-.001V8h-2V6h2.467l-1.133-1.964 1.732-1L14.777 6h1.444l1.713-2.964zM5 13.803l-2 .536v-2.071l2-.536V8H3V6h2V3h2v3h2v2H7v3.197l2-.536v2.07l-2 .536V18.5A2.5 2.5 0 0 1 4.5 21H3v-2h1.5a.5.5 0 0 0 .492-.41L5 18.5v-4.697zM17 8h-3v4h3V8z"}}],OZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M12 19c.828 0 1.5.672 1.5 1.5S12.828 22 12 22s-1.5-.672-1.5-1.5.672-1.5 1.5-1.5zm0-17c3.314 0 6 2.686 6 6 0 2.165-.753 3.29-2.674 4.923C13.399 14.56 13 15.297 13 17h-2c0-2.474.787-3.695 3.031-5.601C15.548 10.11 16 9.434 16 8c0-2.21-1.79-4-4-4S8 5.79 8 8v1H6V8c0-3.314 2.686-6 6-6z"}}],_Z=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M21 19v2h-2v-2h2zm-4 0v2h-2v-2h2zm-4 0v2h-2v-2h2zm-4 0v2H7v-2h2zm-4 0v2H3v-2h2zm16-4v2h-2v-2h2zM5 15v2H3v-2h2zm0-4v2H3v-2h2zm11-8c2.687 0 4.882 2.124 4.995 4.783L21 8v5h-2V8c0-1.591-1.255-2.903-2.824-2.995L16 5h-5V3h5zM5 7v2H3V7h2zm0-4v2H3V3h2zm4 0v2H7V3h2z"}}],AZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M9.683 7.562L12 9.88l6.374-6.375a2 2 0 0 1 2.829 0l.707.707L9.683 16.438a4 4 0 1 1-2.121-2.121L9.88 12 7.562 9.683a4 4 0 1 1 2.121-2.121zM6 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 12a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm9.535-6.587l6.375 6.376-.707.707a2 2 0 0 1-2.829 0l-4.96-4.961 2.12-2.122z"}}],NZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M14 3c.552 0 1 .448 1 1v5h5c.552 0 1 .448 1 1v10c0 .552-.448 1-1 1H10c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h10zm-1 2H5v8h4v-3c0-.552.448-1 1-1h3V5z"}}],RZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M11 3c.552 0 1 .448 1 1v2h5c.552 0 1 .448 1 1v5h2c.552 0 1 .448 1 1v7c0 .552-.448 1-1 1h-7c-.552 0-1-.448-1-1v-2H7c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h7zm5 5h-4v3c0 .552-.448 1-1 1H8v4h4v-3c0-.552.448-1 1-1h3V8z"}}],PZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M2 11h2v2H2v-2zm4 0h12v2H6v-2zm14 0h2v2h-2v-2z"}}],zZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M9.583 17.321C8.553 16.227 8 15 8 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 0 1-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179z"}}],LZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14.417 6.679C15.447 7.773 16 9 16 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311C9.591 12.322 8.17 10.841 8.17 9a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179z"}}],IZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M19 3l4 5h-3v12h-2V8h-3l4-5zm-5 15v2H3v-2h11zm0-7v2H3v-2h11zm-2-7v2H3V4h9z"}}],DZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 4v12h3l-4 5-4-5h3V4h2zm-8 14v2H3v-2h9zm2-7v2H3v-2h11zm0-7v2H3V4h11z"}}],$Z=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 9v4h16V9h2v5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V9h2z"}}],HZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M17.5 2.5L23 12l-5.5 9.5h-11L1 12l5.5-9.5h11zm-1.153 2H7.653L3.311 12l4.342 7.5h8.694l4.342-7.5-4.342-7.5zM11 15h2v2h-2v-2zm0-8h2v6h-2V7z"}}],BZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zm-9 2H5v14h6v-4h2v4h6V5h-6v4h-2V5zm4 4l3 3-3 3v-2H9v2l-3-3 3-3v2h6V9z"}}],FZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zm-1 2H5v5.999L9 11v2H5v6h14v-6h-4v-2l4-.001V5zm-7 1l3 3h-2v6h2l-3 3-3-3h2V9H9l3-3z"}}],VZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 9h-2V6H5V4h14v2h-6v3zm0 6v5h-2v-5h2zM3 11h18v2H3v-2z"}}],jZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.154 14c.23.516.346 1.09.346 1.72 0 1.342-.524 2.392-1.571 3.147C14.88 19.622 13.433 20 11.586 20c-1.64 0-3.263-.381-4.87-1.144V16.6c1.52.877 3.075 1.316 4.666 1.316 2.551 0 3.83-.732 3.839-2.197a2.21 2.21 0 0 0-.648-1.603l-.12-.117H3v-2h18v2h-3.846zm-4.078-3H7.629a4.086 4.086 0 0 1-.481-.522C6.716 9.92 6.5 9.246 6.5 8.452c0-1.236.466-2.287 1.397-3.153C8.83 4.433 10.271 4 12.222 4c1.471 0 2.879.328 4.222.984v2.152c-1.2-.687-2.515-1.03-3.946-1.03-2.48 0-3.719.782-3.719 2.346 0 .42.218.786.654 1.099.436.313.974.562 1.613.75.62.18 1.297.414 2.03.699z"}}],UZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 6v13H9V6H3V4h14v2h-6zm8.55 10.58a.8.8 0 1 0-1.32-.36l-1.154.33A2.001 2.001 0 0 1 19 14a2 2 0 0 1 1.373 3.454L18.744 19H21v1h-4v-1l2.55-2.42z"}}],WZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5.596 4L10.5 9.928 15.404 4H18l-6.202 7.497L18 18.994V19h-2.59l-4.91-5.934L5.59 19H3v-.006l6.202-7.497L3 4h2.596zM21.55 16.58a.8.8 0 1 0-1.32-.36l-1.155.33A2.001 2.001 0 0 1 21 14a2 2 0 0 1 1.373 3.454L20.744 19H23v1h-4v-1l2.55-2.42z"}}],KZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 11h14v2H5z"}}],qZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 7v13H9V7H3V5h12v2h-4zm8.55-.42a.8.8 0 1 0-1.32-.36l-1.154.33A2.001 2.001 0 0 1 19 4a2 2 0 0 1 1.373 3.454L18.744 9H21v1h-4V9l2.55-2.42z"}}],GZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5.596 5l4.904 5.928L15.404 5H18l-6.202 7.497L18 19.994V20h-2.59l-4.91-5.934L5.59 20H3v-.006l6.202-7.497L3 5h2.596zM21.55 6.58a.8.8 0 1 0-1.32-.36l-1.155.33A2.001 2.001 0 0 1 21 4a2 2 0 0 1 1.373 3.454L20.744 9H23v1h-4V9l2.55-2.42z"}}],YZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M13 10v4h6v-4h-6zm-2 0H5v4h6v-4zm2 9h6v-3h-6v3zm-2 0v-3H5v3h6zm2-14v3h6V5h-6zm-2 0H5v3h6V5zM4 3h16a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"}}],JZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 8h16V5H4v3zm10 11v-9h-4v9h4zm2 0h4v-9h-4v9zm-8 0v-9H4v9h4zM3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"}}],XZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 5v10H9v-4a4 4 0 1 1 0-8h8v2h-2v10h-2V5h-2zM9 5a2 2 0 1 0 0 4V5zm8 12v-2.5l4 3.5-4 3.5V19H5v-2h12z"}}],QZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 5v10H9v-4a4 4 0 1 1 0-8h8v2h-2v10h-2V5h-2zM9 5a2 2 0 1 0 0 4V5zM7 17h12v2H7v2.5L3 18l4-3.5V17z"}}],ZZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 17h10v-2.5l3.5 3.5-3.5 3.5V19H7v2.5L3.5 18 7 14.5V17zm6-11v9h-2V6H5V4h14v2h-6z"}}],eee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 18h1.5a2.5 2.5 0 1 0 0-5H3v-2h13.5a4.5 4.5 0 1 1 0 9H15v2l-4-3 4-3v2zM3 4h18v2H3V4zm6 14v2H3v-2h6z"}}],tee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 6v15h-2V6H5V4h14v2z"}}],ree=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301 14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"}}],nee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 15v2a2 2 0 0 0 1.85 1.995L7 19h3v2H7a4 4 0 0 1-4-4v-2h2zm13-5l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16 10h2zm-1 2.885L15.753 16h2.492L17 12.885zM8 2v2h4v7H8v3H6v-3H2V4h4V2h2zm9 1a4 4 0 0 1 4 4v2h-2V7a2 2 0 0 0-2-2h-3V3h3zM6 6H4v3h2V6zm4 0H8v3h2V6z"}}],oee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 3v9a4 4 0 1 0 8 0V3h2v9a6 6 0 1 1-12 0V3h2zM4 20h16v2H4v-2z"}}],iee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 19h16v-7h2v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-8h2v7zM14 9v6h-4V9H5l7-7 7 7h-5z"}}],see=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 3.993C3 3.445 3.445 3 3.993 3h16.014c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.994.994 0 0 1 3 20.007V3.993zM5 5v14h14V5H5zm5.622 3.415l4.879 3.252a.4.4 0 0 1 0 .666l-4.88 3.252a.4.4 0 0 1-.621-.332V8.747a.4.4 0 0 1 .622-.332z"}}],aee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 21v-2h3.662l1.234-7H5v-2h3.249l.881-5H4V3h16v2h-8.839l-.882 5H18v9h3v2H3zm13-9H9.927l-1.235 7H16v-7z"}}];const lee=Object.freeze(Object.defineProperty({__proto__:null,ab:EX,addFill:CX,addLine:MX,alertLine:TX,alignBottom:OX,alignCenter:_X,alignJustify:AX,alignLeft:NX,alignRight:RX,alignTop:PX,alignVertically:zX,appsLine:LX,arrowDownSFill:IX,arrowGoBackFill:DX,arrowGoForwardFill:$X,arrowLeftSFill:HX,arrowRightSFill:BX,arrowUpSFill:FX,asterisk:VX,attachment2:jX,bold:UX,bracesLine:WX,bringForward:KX,bringToFront:qX,chatNewLine:GX,checkboxCircleLine:YX,checkboxMultipleLine:JX,clipboardFill:XX,clipboardLine:QX,closeCircleLine:ZX,closeFill:eQ,closeLine:tQ,codeLine:rQ,codeView:nQ,deleteBinFill:oQ,deleteBinLine:iQ,deleteColumn:sQ,deleteRow:aQ,doubleQuotesL:lQ,doubleQuotesR:cQ,download2Fill:uQ,dragDropLine:dQ,emphasis:pQ,emphasisCn:fQ,englishInput:hQ,errorWarningLine:mQ,externalLinkFill:gQ,fileCopyLine:vQ,flowChart:yQ,fontColor:bQ,fontSize:kQ,fontSize2:xQ,formatClear:wQ,fullscreenExitLine:SQ,fullscreenLine:EQ,functions:CQ,galleryUploadLine:MQ,h1:TQ,h2:OQ,h3:_Q,h4:AQ,h5:NQ,h6:RQ,hashtag:PQ,heading:zQ,imageAddLine:LQ,imageEditLine:IQ,imageLine:DQ,indentDecrease:$Q,indentIncrease:HQ,informationLine:BQ,inputCursorMove:FQ,insertColumnLeft:VQ,insertColumnRight:jQ,insertRowBottom:UQ,insertRowTop:WQ,italic:KQ,layoutColumnLine:qQ,lineHeight:GQ,link:QQ,linkM:YQ,linkUnlink:XQ,linkUnlinkM:JQ,listCheck:eZ,listCheck2:ZQ,listOrdered:tZ,listUnordered:rZ,markPenLine:nZ,markdownFill:oZ,markdownLine:iZ,mergeCellsHorizontal:sZ,mergeCellsVertical:aZ,mindMap:lZ,moreFill:cZ,nodeTree:uZ,number0:dZ,number1:fZ,number2:pZ,number3:hZ,number4:mZ,number5:gZ,number6:vZ,number7:yZ,number8:bZ,number9:xZ,omega:kZ,organizationChart:wZ,pageSeparator:SZ,paragraph:EZ,pencilFill:CZ,pencilLine:MZ,pinyinInput:TZ,questionMark:OZ,roundedCorner:_Z,scissorsFill:AZ,sendBackward:NZ,sendToBack:RZ,separator:PZ,singleQuotesL:zZ,singleQuotesR:LZ,sortAsc:IZ,sortDesc:DZ,space:$Z,spamLine:HZ,splitCellsHorizontal:BZ,splitCellsVertical:FZ,strikethrough:jZ,strikethrough2:VZ,subscript:WZ,subscript2:UZ,subtractLine:KZ,superscript:GZ,superscript2:qZ,table2:YZ,tableLine:JZ,text:tee,textDirectionL:XZ,textDirectionR:QZ,textSpacing:ZZ,textWrap:eee,translate:nee,translate2:ree,underline:oee,upload2Fill:iee,videoLine:see,wubiInput:aee},Symbol.toStringTag,{value:"Module"}));function cee(e,t=null){return function(r,n){let{$from:o,$to:i}=r.selection,s=o.blockRange(i),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(e)&&s.startIndex==0){if(o.index(s.depth-1)==0)return!1;let u=r.doc.resolve(s.start-2);l=new na(u,u,s.depth),s.endIndex=0;u--)i=R.from(r[u].type.create(r[u].attrs,i));e.step(new bt(t.start-(n?2:0),t.end,t.start,t.end,new K(i,0,0),r.length,!0));let s=0;for(let u=0;us.childCount>0&&s.firstChild.type==e);return i?r?n.node(i.depth-1).type==e?fee(t,r,e,i):pee(t,r,i):!0:!1}}function fee(e,t,r,n){let o=e.tr,i=n.end,s=n.$to.end(n.depth);im;h--)p-=o.child(h).nodeSize,n.delete(p-1,p+1);let i=n.doc.resolve(r.start),s=i.nodeAfter;if(n.mapping.map(r.end)!=r.start+i.nodeAfter.nodeSize)return!1;let a=r.startIndex==0,l=r.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?R.empty:R.from(o))))return!1;let d=i.pos,f=d+s.nodeSize;return n.step(new bt(d-(a?1:0),f+(l?1:0),d+1,f-1,new K((a?R.empty:R.from(o.copy(R.empty))).append(l?R.empty:R.from(o.copy(R.empty))),a?0:1,l?0:1),a?0:1)),t(n.scrollIntoView()),!0}var hee=Object.defineProperty,mee=Object.getOwnPropertyDescriptor,$n=(e,t,r,n)=>{for(var o=n>1?void 0:n?mee(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&hee(t,r,o),o};function ov(e){var t;return!!((t=e.spec.group)!=null&&t.includes(oe.ListContainerNode))}function gee(e){var t;return!!((t=e.spec.group)!=null&&t.includes(oe.ListItemNode))}function cs(e){return ov(e.type)}function Qi(e){return gee(e.type)}function Pb(e,t){return r=>{const{dispatch:n,tr:o}=r,i=Hv(o,r.state),{$from:s,$to:a}=o.selection,l=s.blockRange(a);if(!l)return!1;const c=zd({predicate:u=>ov(u.type),selection:o.selection});if(c&&l.depth-c.depth<=1&&l.startIndex===0){if(c.node.type===e)return _3(t)(r);if(ov(c.node.type))return e.validContent(c.node.content)?(n==null||n(o.setNodeMarkup(c.pos,e)),!0):vee(o,c,e,t)?(n==null||n(o.scrollIntoView()),!0):!1}return cee(e)(i,n)}}function T3(e,t=["checked"]){return function({tr:r,dispatch:n,state:o}){var i,s;const a=nz(e,o.schema),{$from:l,$to:c}=r.selection;if(Id(r.selection)&&r.selection.node.isBlock||l.depth<2||!l.sameParent(c))return!1;const u=l.node(-1);if(u.type!==a)return!1;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(n){const m=l.index(-1)>0;let b=R.empty;for(let y=l.depth-(m?1:2);y>=l.depth-3;y--)b=R.from(l.node(y).copy(b));const v=((i=a.contentMatch.defaultType)==null?void 0:i.createAndFill())||void 0;b=b.append(R.from(a.createAndFill(null,v)||void 0));const g=l.indexAfter(-1)!t.includes(m))),f=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,p={...l.node().attrs};r.delete(l.pos,c.pos);const h=f?[{type:a,attrs:d},{type:f,attrs:p}]:[{type:a,attrs:d}];return dl(r.doc,l.pos,2)?(n&&n(r.split(l.pos,2,h).scrollIntoView()),!0):!1}}function vee(e,t,r,n){const o=t.node,i=e.doc.resolve(t.start),s=i.node(-1),a=i.index(-1);if(!s||!s.canReplace(a,a+1,R.from(r.create())))return!1;const l=[];for(let p=0;pb;m--)h-=o.child(m).nodeSize,n.delete(h-1,h+1);const s=n.doc.resolve(r.start),a=s.nodeAfter;if(!a||n.mapping.slice(i).map(r.end)!==r.start+a.nodeSize)return!1;const l=r.startIndex===0,c=r.endIndex===o.childCount,u=s.node(-1),d=s.index(-1);if(!u.canReplace(d+(l?0:1),d+1,a.content.append(c?R.empty:R.from(o))))return!1;const f=s.pos,p=f+a.nodeSize;return n.step(new bt(f-(l?1:0),p+(c?1:0),f+1,p-1,new K((l?R.empty:R.from(o.copy(R.empty))).append(c?R.empty:R.from(o.copy(R.empty))),l?0:1,c?0:1),l?0:1)),t(n.scrollIntoView()),!0}function O3(e,t){const r=t||e.selection.$from;let n=[],o,i,s,a;for(let c=r.depth;c>=0;c--){if(i=r.node(c),o=r.index(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&cs(s)){const u=r.before(c+1);n.push(u)}if(o=r.indexAfter(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&cs(s)){const u=r.after(c+1);n.push(u)}}n=[...new Set(n)].sort((c,u)=>u-c);let l=!1;for(const c of n)Nd(e.doc,c)&&(e.join(c),l=!0);return l}function _3(e){return t=>{const{dispatch:r,tr:n}=t,o=Hv(n,t.state),i=xee(e,n.selection);return i?(r&&bee(o,r,i),!0):!1}}function xee(e,t){const{$from:r,$to:n}=t;return r.blockRange(n,i=>{var s;return((s=i.firstChild)==null?void 0:s.type)===e})}function vh(e){const{$from:t,$to:r}=e;return t.blockRange(r,cs)}function kee(e){const t=e.selection.$from,r=t.blockRange();if(!r||!Qi(r.parent)||r.startIndex!==0)return!1;const n=t.node(r.depth-2),o=t.index(r.depth),i=t.index(r.depth-1),s=t.index(r.depth-2),a=n.maybeChild(s-1),l=a==null?void 0:a.lastChild;if(o!==0||i!==0)return!1;if(a&&cs(a)&&l&&Qi(l))return Ql({listType:a.type,itemType:l.type,tr:e});if(Qi(n)){const c=n,u=t.node(r.depth-3);if(cs(u))return Ql({listType:u.type,itemType:c.type,tr:e})}return!1}function IS({view:e}){if(!e)return!1;{const t=e.state.selection.$cursor;if(!t||t.parentOffset>0)return!1;const r=t.blockRange();if(!r||!Qi(r.parent)||r.startIndex!==0)return!1}{const t=e.state.tr;kee(t)&&e.dispatch(t)}{const t=e.state.selection.$cursor;if(!t||t.parentOffset>0)return!1;const r=t.blockRange();if(!r||!Qi(r.parent)||r.startIndex!==0)return!1;const n=t.index(r.depth),o=t.index(r.depth-1),i=t.index(r.depth-2),s=r.depth-2>=1&&Qi(t.node(r.depth-2));n===0&&o===0&&i<=1&&s&&dee(r.parent.type)(e.state,e.dispatch)}return H5(e.state,e.dispatch,e),!0}function A3({node:e,mark:t,updateDOM:r,updateMark:n}){const o=document.createElement("label");o.contentEditable="false",o.classList.add(ls.LIST_ITEM_MARKER_CONTAINER),o.append(t);const i=document.createElement("div"),s=document.createElement("li");s.classList.add(ls.LIST_ITEM_WITH_CUSTOM_MARKER),s.append(o),s.append(i);const a=l=>l.type!==e.type?!1:(e=l,r(e,s),n(e,t),!0);return a(e),{dom:s,contentDOM:i,update:a}}function wee(e,t){const r=e.node(t.depth-1),n=e.node(t.depth-2);return!Qi(r)||!cs(n)?!1:{parentItem:r,parentList:n}}function See(e,t){const r=t.parent,n=t.parent.child(t.endIndex-1),o=t.end,i=t.$to.end(t.depth);return oMee(e)?(t==null||t(e.scrollIntoView()),!0):!1;function Oee(e,t,r){let n,o,i,s;const a=t.doc;if(r.startIndex>=1){n=e.child(r.startIndex-1),o=e,s=a.resolve(r.start).start(r.depth),i=s+1;for(let l=0;l=1){const c=t.node(r.depth-1),u=t.start(r.depth-1);if(o=c.child(l-1),!cs(o))return!1;s=u+1;for(let d=0;d=r.depth+2?t.end(r.depth+2):r.end-1,a=r.end;return s+1>=a?(n=e.slice(i,a),o=null):(n=e.slice(i,s),o=e.slice(s+1,a-1)),{selectedSlice:n,unselectedSlice:o}}function Aee(e){const{$from:t,$to:r}=e.selection,n=vh(e.selection);if(!n)return!1;const o=e.doc.resolve(n.start).node();if(!cs(o))return!1;const i=Oee(o,t,n);if(!i)return!1;const{previousItem:s,previousList:a,previousItemStart:l}=i,{selectedSlice:c,unselectedSlice:u}=_ee(e.doc,r,n),d=s.content.append(R.fromArray([o.copy(c.content)])).append(u?u.content:R.empty);e.deleteRange(n.start,n.end);const f=l+s.nodeSize-2,p=s.copy(d);return p.check(),e.replaceRangeWith(l-1,f+1,p),e.setSelection(a===o?le.between(e.doc.resolve(t.pos),e.doc.resolve(r.pos)):le.between(e.doc.resolve(t.pos-2),e.doc.resolve(r.pos-2))),!0}var Nee=({tr:e,dispatch:t})=>Aee(e)?(t==null||t(e.scrollIntoView()),!0):!1,N3=class extends Ve{get name(){return"listItemShared"}createKeymap(){const e={Tab:Nee,"Shift-Tab":Tee,Backspace:IS,"Mod-Backspace":IS};if(nn.isMac){const t={"Ctrl-h":e.Backspace,"Alt-Backspace":e["Mod-Backspace"]};return{...e,...t}}return e}createPlugin(){return{appendTransaction:(e,t,r)=>{const n=r.tr;return O3(n)?n:null}}}},ya=class extends er{get name(){return"listItem"}createTags(){return[oe.ListItemNode]}createNodeSpec(e,t){return{content:"paragraph block*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),closed:{default:!1},nested:{default:!1}},parseDOM:[{tag:"li",getAttrs:e.parse,priority:Ae.Lowest},...t.parseDOM??[]],toDOM:r=>["li",e.dom(r),0]}}createNodeViews(){return this.options.enableCollapsible?(e,t,r)=>{const n=document.createElement("div");return n.classList.add(ls.COLLAPSIBLE_LIST_ITEM_BUTTON),n.contentEditable="false",n.addEventListener("click",()=>{if(n.classList.contains("disabled"))return;const o=r(),i=ce.create(t.state.doc,o);return t.dispatch(t.state.tr.setSelection(i)),this.store.commands.toggleListItemClosed(),!0}),A3({mark:n,node:e,updateDOM:Ree,updateMark:Pee})}:{}}createKeymap(){return{Enter:T3(this.type)}}createExtensions(){return[new N3]}toggleListItemClosed(e){return({state:{tr:t,selection:r},dispatch:n})=>{if(!Id(r)||r.node.type.name!==this.name)return!1;const{node:o,from:i}=r;return e=k1(e)?e:!o.attrs.closed,n==null||n(t.setNodeMarkup(i,void 0,{...o.attrs,closed:e})),!0}}liftListItemOutOfList(e){return _3(e??this.type)}};$n([U()],ya.prototype,"toggleListItemClosed",1);$n([U()],ya.prototype,"liftListItemOutOfList",1);ya=$n([me({defaultOptions:{enableCollapsible:!1},staticKeys:["enableCollapsible"]})],ya);function Ree(e,t){e.attrs.closed?t.classList.add(ls.COLLAPSIBLE_LIST_ITEM_CLOSED):t.classList.remove(ls.COLLAPSIBLE_LIST_ITEM_CLOSED)}function Pee(e,t){e.childCount<=1?t.classList.add("disabled"):t.classList.remove("disabled")}var yd=class extends er{get name(){return"bulletList"}createTags(){return[oe.Block,oe.ListContainerNode]}createNodeSpec(e,t){return{content:"listItem+",...t,attrs:e.defaults(),parseDOM:[{tag:"ul",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["ul",e.dom(r),0]}}createNodeViews(){return this.options.enableSpine?(e,t,r)=>{var n;const o=document.createElement("div");o.style.position="relative";const i=r(),s=t.state.doc.resolve(i+1),a=s.node(s.depth-1);if(!(((n=a==null?void 0:a.type)==null?void 0:n.name)!=="listItem")){const u=document.createElement("div");u.contentEditable="false",u.classList.add(ls.LIST_SPINE),u.addEventListener("click",d=>{const f=r(),p=t.state.doc.resolve(f+1),h=p.start(p.depth-1),m=ce.create(t.state.doc,h-1);t.dispatch(t.state.tr.setSelection(m)),this.store.commands.toggleListItemClosed(),d.preventDefault(),d.stopPropagation()}),o.append(u)}const c=document.createElement("ul");return c.classList.add(ls.UL_LIST_CONTENT),o.append(c),{dom:o,contentDOM:c}}:{}}createExtensions(){return[new ya({priority:Ae.Low,enableCollapsible:this.options.enableSpine})]}toggleBulletList(){return Pb(this.type,it(this.store.schema.nodes,"listItem"))}listShortcut(e){return this.toggleBulletList()(e)}createInputRules(){const e=/^\s*([*+-])\s$/;return[Nh(e,this.type),new wa(e,(t,r,n,o)=>{const i=t.tr;return i.deleteRange(n,o),Ql({listType:this.type,itemType:it(this.store.schema.nodes,"listItem"),tr:i})?i:null})]}};$n([U({icon:"listUnordered",label:({t:e})=>e(Ov.BULLET_LIST_LABEL)})],yd.prototype,"toggleBulletList",1);$n([je({shortcut:D.BulletList,command:"toggleBulletList"})],yd.prototype,"listShortcut",1);yd=$n([me({defaultOptions:{enableSpine:!1},staticKeys:["enableSpine"]})],yd);var bd=class extends er{get name(){return"orderedList"}createTags(){return[oe.Block,oe.ListContainerNode]}createNodeSpec(e,t){return{content:"listItem+",...t,attrs:{...e.defaults(),order:{default:1}},parseDOM:[{tag:"ol",getAttrs:r=>Je(r)?{...e.parse(r),order:+(r.getAttribute("start")??1)}:{}},...t.parseDOM??[]],toDOM:r=>{const n=e.dom(r);return r.attrs.order===1?["ol",n,0]:["ol",{...n,start:r.attrs.order},0]}}}createExtensions(){return[new ya({priority:Ae.Low})]}toggleOrderedList(){return Pb(this.type,it(this.store.schema.nodes,"listItem"))}listShortcut(e){return this.toggleOrderedList()(e)}createInputRules(){const e=/^(\d+)\.\s$/;return[Nh(e,this.type,t=>({order:+it(t,1)}),(t,r)=>r.childCount+r.attrs.order===+it(t,1)),new wa(e,(t,r,n,o)=>{const i=t.tr;if(i.deleteRange(n,o),!Ql({listType:this.type,itemType:it(this.store.schema.nodes,"listItem"),tr:i}))return null;const a=+it(r,1);if(a!==1){const l=ts({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{order:a})}return i})]}};$n([U({icon:"listOrdered",label:({t:e})=>e(Ov.ORDERED_LIST_LABEL)})],bd.prototype,"toggleOrderedList",1);$n([je({shortcut:D.OrderedList,command:"toggleOrderedList"})],bd.prototype,"listShortcut",1);bd=$n([me({})],bd);var R3=class extends er{get name(){return"taskListItem"}createTags(){return[oe.ListItemNode]}createNodeSpec(e,t){return{content:"paragraph block*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),checked:{default:!1}},parseDOM:[{tag:"li[data-task-list-item]",getAttrs:r=>{let n=!1;return Je(r)&&r.getAttribute("data-checked")!==null&&(n=!0),{checked:n,...e.parse(r)}},priority:Ae.Medium},...t.parseDOM??[]],toDOM:r=>["li",{...e.dom(r),"data-task-list-item":"","data-checked":r.attrs.checked?"":void 0},0]}}createNodeViews(){return(e,t,r)=>{const n=document.createElement("input");return n.type="checkbox",n.classList.add(ls.LIST_ITEM_CHECKBOX),n.contentEditable="false",n.addEventListener("click",o=>{t.editable||o.preventDefault()}),n.addEventListener("change",()=>{const o=r(),i=t.state.doc.resolve(o+1);this.store.commands.toggleCheckboxChecked({$pos:i})}),n.checked=e.attrs.checked,A3({node:e,mark:n,updateDOM:zee,updateMark:Lee})}}createKeymap(){return{Enter:T3(this.type)}}createExtensions(){return[new N3]}toggleCheckboxChecked(e){let t,r;return typeof e=="boolean"?t=e:e&&(t=e.checked,r=e.$pos),({tr:n,dispatch:o})=>{const i=ts({selection:r??n.selection.$from,types:this.type});if(!i)return!1;const{node:s,pos:a}=i,l={...s.attrs,checked:t??!s.attrs.checked};return o==null||o(n.setNodeMarkup(a,void 0,l)),!0}}createInputRules(){const e=/^\s*(\[( ?|x|X)]\s)$/;return[Nh(e,this.type,t=>({checked:["x","X"].includes(Zo(t,2))})),new wa(e,(t,r,n,o)=>{const i=t.tr;if(i.deleteRange(n,o),!Ql({listType:it(this.store.schema.nodes,"taskList"),itemType:this.type,tr:i}))return null;const a=["x","X"].includes(Zo(r,2));if(a){const l=ts({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{checked:a})}return i})]}};$n([U()],R3.prototype,"toggleCheckboxChecked",1);function zee(e,t){e.attrs.checked?t.setAttribute("data-checked",""):t.removeAttribute("data-checked"),t.setAttribute("data-task-list-item","")}function Lee(e,t){t.checked=!!e.attrs.checked}var P3=class extends er{get name(){return"taskList"}createTags(){return[oe.Block,oe.ListContainerNode]}createNodeSpec(e,t){return{content:"taskListItem+",...t,attrs:e.defaults(),parseDOM:[{tag:"ul[data-task-list]",getAttrs:e.parse,priority:Ae.Medium},...t.parseDOM??[]],toDOM:r=>["ul",{...e.dom(r),"data-task-list":""},0]}}createExtensions(){return[new R3({})]}toggleTaskList(){return Pb(this.type,it(this.store.schema.nodes,"taskListItem"))}listShortcut(e){return this.toggleTaskList()(e)}};$n([U({icon:"checkboxMultipleLine",label:({t:e})=>e(Ov.TASK_LIST_LABEL)})],P3.prototype,"toggleTaskList",1);$n([je({shortcut:D.TaskList,command:"toggleTaskList"})],P3.prototype,"listShortcut",1);var fo,Iee=(e=document)=>fo||(fo=e.createElement("div"),fo.setAttribute("id","a11y-status-message"),fo.setAttribute("role","status"),fo.setAttribute("aria-live","polite"),fo.setAttribute("aria-relevant","additions text"),Object.assign(fo.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.append(fo),fo);H4(500,()=>{Iee().textContent=""});function DS(e){return typeof e=="object"&&e!=null&&e.nodeType===1}function $S(e,t){return(!t||e!=="hidden")&&e!=="visible"&&e!=="clip"}function a1(e,t){if(e.clientHeightt||i>e&&s=t&&a>=r?i-e-n:s>t&&ar?s-t+o:0}var Dee=function(e,t){var r=window,n=t.scrollMode,o=t.block,i=t.inline,s=t.boundary,a=t.skipOverflowHiddenElements,l=typeof s=="function"?s:function(De){return De!==s};if(!DS(e))throw new TypeError("Invalid target");for(var c,u,d=document.scrollingElement||document.documentElement,f=[],p=e;DS(p)&&l(p);){if((p=(u=(c=p).parentElement)==null?c.getRootNode().host||null:u)===d){f.push(p);break}p!=null&&p===document.body&&a1(p)&&!a1(document.documentElement)||p!=null&&a1(p,a)&&f.push(p)}for(var h=r.visualViewport?r.visualViewport.width:innerWidth,m=r.visualViewport?r.visualViewport.height:innerHeight,b=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,g=e.getBoundingClientRect(),y=g.height,x=g.width,k=g.top,w=g.right,E=g.bottom,M=g.left,C=o==="start"||o==="nearest"?k:o==="end"?E:k+y/2,T=i==="center"?M+x/2:i==="end"?w:M,N=[],F=0;F=0&&M>=0&&E<=m&&w<=h&&k>=q&&E<=P&&M>=B&&w<=A)return N;var Y=getComputedStyle(I),J=parseInt(Y.borderLeftWidth,10),Ne=parseInt(Y.borderTopWidth,10),ie=parseInt(Y.borderRightWidth,10),ue=parseInt(Y.borderBottomWidth,10),de=0,he=0,Me="offsetWidth"in I?I.offsetWidth-I.clientWidth-J-ie:0,Se="offsetHeight"in I?I.offsetHeight-I.clientHeight-Ne-ue:0,ft="offsetWidth"in I?I.offsetWidth===0?0:z/I.offsetWidth:0,rt="offsetHeight"in I?I.offsetHeight===0?0:j/I.offsetHeight:0;if(d===I)de=o==="start"?C:o==="end"?C-m:o==="nearest"?Mf(v,v+m,m,Ne,ue,v+C,v+C+y,y):C-m/2,he=i==="start"?T:i==="center"?T-h/2:i==="end"?T-h:Mf(b,b+h,h,J,ie,b+T,b+T+x,x),de=Math.max(0,de+v),he=Math.max(0,he+b);else{de=o==="start"?C-q-Ne:o==="end"?C-P+ue+Se:o==="nearest"?Mf(q,P,j,Ne,ue+Se,C,C+y,y):C-(q+j/2)+Se/2,he=i==="start"?T-B-J:i==="center"?T-(B+z/2)+Me/2:i==="end"?T-A+ie+Me:Mf(B,A,z,J,ie+Me,T,T+x,x);var Or=I.scrollLeft,pe=I.scrollTop;C+=pe-(de=Math.max(0,Math.min(pe+de/rt,I.scrollHeight-j/rt+Se))),T+=Or-(he=Math.max(0,Math.min(Or+he/ft,I.scrollWidth-z/ft+Me)))}N.push({el:I,top:de,left:he})}return N};typeof br=="object"&&br.__esModule&&br.default&&br.default;_h(Dee);var $ee=typeof document<"u"?S.useLayoutEffect:S.useEffect;function Hee(e){const t=S.useRef();return $ee(()=>{t.current=e}),t.current}function Bee(e,t){const[r,n]=S.useState([]),[o,i]=S.useState(()=>j0(e)),[s,a]=S.useState([]),l=S.useRef(e),c=Hee(o);return l.current=e,Zy(Ul,({addCustomHandler:u})=>{const d=j0(l.current),f=u("positioner",d);return i(d),f},t),S.useLayoutEffect(()=>{const u=o.addListener("update",f=>{const p=[];for(const{id:h,data:m,setElement:b}of f){const v=g=>{g&&b(g)};p.push({id:h,data:m,ref:v})}a(p)}),d=o.addListener("done",f=>{n(f)});return c!=null&&c.recentUpdate&&o.onActiveChanged(c==null?void 0:c.recentUpdate),()=>{u(),d()}},[o,c]),S.useMemo(()=>{const u=[];for(const[d,{ref:f,data:p,id:h}]of s.entries()){const m=r[d],{element:b,position:v={}}=m??{},g={...Yy,...j4(v)};u.push({ref:f,element:b,data:p,key:h,...g})}return u},[s,r])}function Fee(e,t){const r=t==null||k1(t)?[e]:t,n=k1(t)?t:!0,o=S.useRef(Cl()),s=Bee(e,r)[0];return S.useMemo(()=>s&&n?{...s,active:!0}:{...Yy,ref:void 0,data:{},active:!1,key:o.current},[n,s])}function l1(e,t){return _e(e)?e(t):e}function Vee(e){return ne(e[0])}function jee(e,t){var r;return ne(e)?e:ct(e)?Vee(e)?e[0]??"":((r=e.find(n=>U4(n.attrs,t))??e[0])==null?void 0:r.shortcut)??"":e.shortcut}var Uee={title:e=>oA(e),upper:e=>e.toLocaleUpperCase(),lower:e=>e.toLocaleLowerCase()};function Wee(e,t){const{casing:r="title",namedAsSymbol:n=!1,modifierAsSymbol:o=!0,separator:i=" ",t:s}=t,a=Pz(e),l=[],c=Uee[r];for(const u of a){if(u.type==="char"){l.push(c(u.key));continue}if(u.type==="named"){const f=n===!0||ct(n)&&dr(n,u.key)?u.symbol??s(u.i18n):s(u.i18n);l.push(c(f));continue}const d=o===!0||ct(o)&&dr(o,u.key)?u.symbol:s(u.i18n);l.push(c(d))}return l.join(i)}var z3=({commandName:e,active:t,enabled:r,attrs:n})=>{const{t:o}=oj(),{getCommandOptions:i}=lm(),s=i(e),{description:a,label:l,icon:c,shortcut:u}=s||{},d=S.useMemo(()=>({active:t,attrs:n,enabled:r,t:o}),[t,n,r,o]),f=S.useMemo(()=>{if(u)return Wee(jee(u,n??{}),{t:o,separator:""})},[u,n,o]);return S.useMemo(()=>({description:l1(a,d),label:l1(l,d),icon:l1(c,d),shortcut:f}),[d,a,l,c,f])},Kee={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},L3=S.createContext(Kee);L3.Provider;function I3(e){return e.map((t,r)=>S.createElement(t.tag,{key:r,...t.attr},I3(t.child??[])))}var Km=e=>{const{name:t}=e;return L.createElement(qee,{...e},I3(lee[t]))},qee=e=>{const t=r=>{const n=e.size??r.size??"1em";let o;r.className&&(o=r.className),e.className&&(o=(o?`${o} `:"")+e.className);const{title:i,...s}=e;return L.createElement("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",...r.attr,...s,className:o,style:{color:e.color??r.color,...r.style,...e.style},height:n,width:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},i&&L.createElement("title",null,i),e.children)};return L.createElement(L3.Consumer,null,t)},Gee=e=>hs(e)?!!e.name:!1,Yee=({icon:e})=>ne(e)?L.createElement(Km,{name:e,size:"1rem"}):e,Jee=({icon:e,children:t})=>{if(!Gee(e))return L.createElement(L.Fragment,null,t);const{sub:r,sup:n}=e,o=r??n,i=r!==void 0;return o===void 0?L.createElement(L.Fragment,null,t):L.createElement(JY,{anchorOrigin:{vertical:i?"bottom":"top",horizontal:"right"},badgeContent:o,sx:{"& > .MuiBadge-badge":{bgcolor:"background.paper",color:"text.secondary",minWidth:12,height:12,margin:"2px 0",padding:"1px"}}},t)},dt=({commandName:e,active:t=!1,enabled:r,attrs:n,onSelect:o,onChange:i,icon:s,displayShortcut:a=!0,"aria-label":l,label:c,...u})=>{const d=S.useCallback((g,y)=>{o(),i==null||i(g,y)},[o,i]),f=S.useCallback(g=>{g.preventDefault()},[]),p=z3({commandName:e,active:t,enabled:r,attrs:n});let h=null;p.icon&&(h=ne(p.icon)?p.icon:p.icon.name);const m=l??p.label??"",b=c??m,v=a&&p.shortcut?` (${p.shortcut})`:"";return L.createElement(M3,{title:`${b}${v}`},L.createElement(w3,{component:"span",sx:{"&:not(:first-of-type)":{marginLeft:"-1px"}}},L.createElement(SX,{"aria-label":m,selected:t,disabled:!r,onMouseDown:f,color:"primary",size:"small",sx:{padding:"6px 12px","&.Mui-selected":{backgroundColor:"primary.main",color:"primary.contrastText"},"&.Mui-selected:hover":{backgroundColor:"primary.dark",color:"primary.contrastText"},"&:not(:first-of-type)":{borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:last-of-type)":{borderTopRightRadius:0,borderBottomRightRadius:0}},...u,value:e,onChange:d},L.createElement(Jee,{icon:p.icon},L.createElement(Yee,{icon:s??h})))))},Xee=({icon:e})=>ne(e)?L.createElement(Km,{name:e,size:"1rem"}):e,Qee=({label:e,"aria-label":t,icon:r,children:n,onClose:o,...i})=>{const s=S.useRef(Cl()),[a,l]=S.useState(null),c=!!a,u=S.useCallback(p=>{p.preventDefault()},[]),d=S.useCallback(p=>{l(p.currentTarget)},[]),f=S.useCallback((p,h)=>{l(null),o==null||o(p,h)},[o]);return L.createElement(L.Fragment,null,L.createElement(M3,{title:e??t},L.createElement(Dq,{"aria-label":t,"aria-controls":c?s.current:void 0,"aria-haspopup":!0,"aria-expanded":c?"true":void 0,onMouseDown:u,onClick:d,size:"small",sx:p=>({border:`1px solid ${p.palette.divider}`,borderRadius:`${p.shape.borderRadius}px`,padding:"6px 12px","&:not(:first-of-type)":{marginLeft:"-1px",borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:last-of-type)":{borderTopRightRadius:0,borderBottomRightRadius:0}})},r&&L.createElement(Xee,{icon:r}),L.createElement(Km,{name:"arrowDownSFill",size:"1rem"}))),L.createElement(ZJ,{...i,id:s.current,anchorEl:a,open:c,onClose:f},n))},Zee=e=>{const{insertHorizontalRule:t}=Tr();Qy();const r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=t.enabled();return L.createElement(dt,{...e,commandName:"insertHorizontalRule",enabled:n,onSelect:r})},ete=e=>{const{redo:t}=Tr(),{redoDepth:r}=lm(!0),n=S.useCallback(()=>{t.enabled()&&t()},[t]),o=r()>0;return L.createElement(dt,{...e,commandName:"redo",active:!1,enabled:o,onSelect:n})},tte=e=>{const{toggleBlockquote:t}=Tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=In().blockquote(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleBlockquote",active:n,enabled:o,onSelect:r})},iv=e=>{const{toggleBold:t}=Tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=In().bold(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleBold",active:n,enabled:o,onSelect:r})},rte=e=>{const{toggleBulletList:t}=Tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=In().bulletList(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleBulletList",active:n,enabled:o,onSelect:r})},nte=({attrs:e={},...t})=>{const{toggleCodeBlock:r}=Tr(),n=S.useCallback(()=>{r.enabled(e)&&r(e)},[r,e]),o=In().codeBlock(),i=r.enabled(e);return L.createElement(dt,{...t,commandName:"toggleCodeBlock",active:o,enabled:i,attrs:e,onSelect:n})},sv=e=>{const{toggleCode:t}=Tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=In().code(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleCode",active:n,enabled:o,onSelect:r})},c1=({attrs:e,...t})=>{const{toggleHeading:r}=Tr(),n=S.useCallback(()=>{r.enabled(e)&&r(e)},[r,e]),o=In().heading(e),i=r.enabled(e);return L.createElement(dt,{...t,commandName:"toggleHeading",active:o,enabled:i,attrs:e,onSelect:n})},av=e=>{const{toggleItalic:t}=Tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=In().italic(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleItalic",active:n,enabled:o,onSelect:r})},ote=e=>{const{toggleOrderedList:t}=Tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=In().orderedList(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleOrderedList",active:n,enabled:o,onSelect:r})},ite=e=>{const{toggleStrike:t}=Tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=In().strike(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleStrike",active:n,enabled:o,onSelect:r})},lv=e=>{const{toggleUnderline:t}=Tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=In().underline(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleUnderline",active:n,enabled:o,onSelect:r})},ste=e=>{const{undo:t}=Tr(),{undoDepth:r}=lm(!0),n=S.useCallback(()=>{t.enabled()&&t()},[t]),o=r()>0;return L.createElement(dt,{...e,commandName:"undo",active:!1,enabled:o,onSelect:n})},Xn=e=>L.createElement(w3,{sx:{display:"flex",alignItems:"center",width:"fit-content",bgcolor:"background.paper",color:"text.secondary"},...e}),ate=({children:e})=>L.createElement(Xn,null,L.createElement(iv,null),L.createElement(av,null),L.createElement(lv,null),L.createElement(ite,null),L.createElement(sv,null),e),lte=({icon:e})=>e?L.createElement(EJ,null,ne(e)?L.createElement(Km,{name:e,size:"1rem"}):L.createElement(L.Fragment,null,e)):null,cte=({commandName:e,active:t=!1,enabled:r,attrs:n,onSelect:o,onClick:i,icon:s,displayShortcut:a=!0,label:l,description:c,displayDescription:u=!0,...d})=>{const f=S.useCallback(g=>{o(),i==null||i(g)},[o,i]),p=S.useCallback(g=>{g.preventDefault()},[]),h=z3({commandName:e,active:t,enabled:r,attrs:n});let m=null;h.icon&&(m=ne(h.icon)?h.icon:h.icon.name);const b=l??h.label??"",v=u&&(c??h.description);return L.createElement(aX,{selected:t,disabled:!r,onMouseDown:p,...d,onClick:f},s!==null&&L.createElement(lte,{icon:s??m}),L.createElement(NJ,{primary:b,secondary:v}),a&&h.shortcut&&L.createElement(lu,{variant:"body2",color:"text.secondary",sx:{ml:2}},h.shortcut))},Tf=({attrs:e,...t})=>{const{toggleHeading:r}=Tr(),n=S.useCallback(()=>{r.enabled(e)&&r(e)},[r,e]),o=In().heading(e),i=r.enabled(e);return L.createElement(cte,{...t,commandName:"toggleHeading",active:o,enabled:i,attrs:e,onSelect:n})},ute={level:1},dte={level:2},HS={level:3},fte={level:4},pte={level:5},hte={level:6},mte=({showAll:e=!1,children:t})=>L.createElement(Xn,null,L.createElement(c1,{attrs:ute}),L.createElement(c1,{attrs:dte}),e?L.createElement(Qee,{"aria-label":"More heading options"},L.createElement(Tf,{attrs:HS}),L.createElement(Tf,{attrs:fte}),L.createElement(Tf,{attrs:pte}),L.createElement(Tf,{attrs:hte})):L.createElement(c1,{attrs:HS}),t),gte=({children:e})=>L.createElement(Xn,null,L.createElement(ste,null),L.createElement(ete,null),e);typeof br=="object"&&br.__esModule&&br.default&&br.default;var D3=S.createContext({});function vte(e={}){const t=S.useContext(D3),r=S.useMemo(()=>q4(t,e.theme??{}),[t,e.theme]),n=S.useMemo(()=>yV(r).styles,[r]),o=Vu(vV,e.className);return S.useMemo(()=>({style:n,className:o,theme:r}),[n,o,r])}var yte=e=>{var t,r,n,o,i,s,a,l;const{children:c,as:u="div"}=e,{theme:d,style:f,className:p}=vte({theme:e.theme??Ss}),h=bb({palette:{primary:{main:((t=d.color)==null?void 0:t.primary)??Ss.color.primary,dark:((n=(r=d.color)==null?void 0:r.hover)==null?void 0:n.primary)??Ss.color.hover.primary,contrastText:((o=d.color)==null?void 0:o.primaryText)??Ss.color.primaryText},secondary:{main:((i=d.color)==null?void 0:i.secondary)??Ss.color.secondary,dark:((a=(s=d.color)==null?void 0:s.hover)==null?void 0:a.secondary)??Ss.color.hover.secondary,contrastText:((l=d.color)==null?void 0:l.secondaryText)??Ss.color.secondaryText}}});return L.createElement(JK,{theme:h},L.createElement(D3.Provider,{value:d},L.createElement(u,{style:f,className:p},c)))},$3=e=>L.createElement(lJ,{direction:"row",spacing:1,sx:{backgroundColor:"background.paper",overflowX:"auto"},...e}),bte=[{name:"offset",options:{offset:[0,8]}}],xte=({positioner:e="selection",children:t,...r})=>{const{ref:n,x:o,y:i,width:s,height:a,active:l}=Fee(()=>j0(e),[e]),[c,u]=S.useState(null),d=S.useMemo(()=>({position:"absolute",pointerEvents:"none",left:o,top:i,width:s,height:a}),[o,i,s,a]),f=S.useCallback(p=>{u(p),n==null||n(p)},[n]);return L.createElement(L.Fragment,null,L.createElement("div",{ref:f,style:d}),L.createElement(Rb,{placement:"top",modifiers:bte,...r,open:l,anchorEl:c},L.createElement($3,null,t?L.createElement(L.Fragment,null,t):L.createElement(ate,null))))},Ct=_h(ch),zb=xt` +`),Sn.rippleVisible,Sq,tv,({theme:e})=>e.transitions.easing.easeInOut,Sn.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,Sn.child,Sn.childLeaving,Eq,tv,({theme:e})=>e.transitions.easing.easeInOut,Sn.childPulsate,Cq,({theme:e})=>e.transitions.easing.easeInOut),Oq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiTouchRipple"}),{center:o=!1,classes:i={},className:s}=n,a=ve(n,kq),[l,c]=S.useState([]),u=S.useRef(0),d=S.useRef(null);S.useEffect(()=>{d.current&&(d.current(),d.current=null)},[l]);const f=S.useRef(!1),p=S.useRef(0),h=S.useRef(null),m=S.useRef(null);S.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const b=S.useCallback(x=>{const{pulsate:k,rippleX:w,rippleY:E,rippleSize:T,cb:C}=x;c(M=>[...M,O.jsx(Tq,{classes:{ripple:Ce(i.ripple,Sn.ripple),rippleVisible:Ce(i.rippleVisible,Sn.rippleVisible),ripplePulsate:Ce(i.ripplePulsate,Sn.ripplePulsate),child:Ce(i.child,Sn.child),childLeaving:Ce(i.childLeaving,Sn.childLeaving),childPulsate:Ce(i.childPulsate,Sn.childPulsate)},timeout:tv,pulsate:k,rippleX:w,rippleY:E,rippleSize:T},u.current)]),u.current+=1,d.current=C},[i]),v=S.useCallback((x={},k={},w=()=>{})=>{const{pulsate:E=!1,center:T=o||k.pulsate,fakeElement:C=!1}=k;if((x==null?void 0:x.type)==="mousedown"&&f.current){f.current=!1;return}(x==null?void 0:x.type)==="touchstart"&&(f.current=!0);const M=C?null:m.current,N=M?M.getBoundingClientRect():{width:0,height:0,left:0,top:0};let F,I,V;if(T||x===void 0||x.clientX===0&&x.clientY===0||!x.clientX&&!x.touches)F=Math.round(N.width/2),I=Math.round(N.height/2);else{const{clientX:j,clientY:z}=x.touches&&x.touches.length>0?x.touches[0]:x;F=Math.round(j-N.left),I=Math.round(z-N.top)}if(T)V=Math.sqrt((2*N.width**2+N.height**2)/3),V%2===0&&(V+=1);else{const j=Math.max(Math.abs((M?M.clientWidth:0)-F),F)*2+2,z=Math.max(Math.abs((M?M.clientHeight:0)-I),I)*2+2;V=Math.sqrt(j**2+z**2)}x!=null&&x.touches?h.current===null&&(h.current=()=>{b({pulsate:E,rippleX:F,rippleY:I,rippleSize:V,cb:w})},p.current=setTimeout(()=>{h.current&&(h.current(),h.current=null)},wq)):b({pulsate:E,rippleX:F,rippleY:I,rippleSize:V,cb:w})},[o,b]),g=S.useCallback(()=>{v({},{pulsate:!0})},[v]),y=S.useCallback((x,k)=>{if(clearTimeout(p.current),(x==null?void 0:x.type)==="touchend"&&h.current){h.current(),h.current=null,p.current=setTimeout(()=>{y(x,k)});return}h.current=null,c(w=>w.length>0?w.slice(1):w),d.current=k},[]);return S.useImperativeHandle(r,()=>({pulsate:g,start:v,stop:y}),[g,v,y]),O.jsx(Mq,_({className:Ce(Sn.root,i.root,s),ref:m},a,{children:O.jsx(fq,{component:null,exit:!0,children:l})}))}),_q=Oq;function Aq(e){return Vt("MuiButtonBase",e)}const Nq=jt("MuiButtonBase",["root","disabled","focusVisible"]),Rq=Nq,Pq=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],zq=e=>{const{disabled:t,focusVisible:r,focusVisibleClassName:n,classes:o}=e,s=rr({root:["root",t&&"disabled",r&&"focusVisible"]},Aq,o);return r&&n&&(s.root+=` ${n}`),s},Lq=Xe("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Rq.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),Iq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiButtonBase"}),{action:o,centerRipple:i=!1,children:s,className:a,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:d=!1,focusRipple:f=!1,LinkComponent:p="a",onBlur:h,onClick:m,onContextMenu:b,onDragLeave:v,onFocus:g,onFocusVisible:y,onKeyDown:x,onKeyUp:k,onMouseDown:w,onMouseLeave:E,onMouseUp:T,onTouchEnd:C,onTouchMove:M,onTouchStart:N,tabIndex:F=0,TouchRippleProps:I,touchRippleRef:V,type:j}=n,z=ve(n,Pq),q=S.useRef(null),A=S.useRef(null),P=Ur(A,V),{isFocusVisibleRef:B,onFocus:Y,onBlur:J,ref:Ne}=PT(),[ie,ue]=S.useState(!1);c&&ie&&ue(!1),S.useImperativeHandle(o,()=>({focusVisible:()=>{ue(!0),q.current.focus()}}),[]);const[de,me]=S.useState(!1);S.useEffect(()=>{me(!0)},[]);const Me=de&&!u&&!c;S.useEffect(()=>{ie&&f&&!u&&de&&A.current.pulsate()},[u,f,ie,de]);function Se(fe,bn,fc=d){return Ks(gi=>(bn&&bn(gi),!fc&&A.current&&A.current[fe](gi),!0))}const ft=Se("start",w),rt=Se("stop",b),Or=Se("stop",v),he=Se("stop",T),De=Se("stop",fe=>{ie&&fe.preventDefault(),E&&E(fe)}),Ke=Se("start",N),Fn=Se("stop",C),Gr=Se("stop",M),nr=Se("stop",fe=>{J(fe),B.current===!1&&ue(!1),h&&h(fe)},!1),zo=Ks(fe=>{q.current||(q.current=fe.currentTarget),Y(fe),B.current===!0&&(ue(!0),y&&y(fe)),g&&g(fe)}),Pt=()=>{const fe=q.current;return l&&l!=="button"&&!(fe.tagName==="A"&&fe.href)},Yr=S.useRef(!1),vn=Ks(fe=>{f&&!Yr.current&&ie&&A.current&&fe.key===" "&&(Yr.current=!0,A.current.stop(fe,()=>{A.current.start(fe)})),fe.target===fe.currentTarget&&Pt()&&fe.key===" "&&fe.preventDefault(),x&&x(fe),fe.target===fe.currentTarget&&Pt()&&fe.key==="Enter"&&!c&&(fe.preventDefault(),m&&m(fe))}),Vn=Ks(fe=>{f&&fe.key===" "&&A.current&&ie&&!fe.defaultPrevented&&(Yr.current=!1,A.current.stop(fe,()=>{A.current.pulsate(fe)})),k&&k(fe),m&&fe.target===fe.currentTarget&&Pt()&&fe.key===" "&&!fe.defaultPrevented&&m(fe)});let Qe=l;Qe==="button"&&(z.href||z.to)&&(Qe=p);const Jr={};Qe==="button"?(Jr.type=j===void 0?"button":j,Jr.disabled=c):(!z.href&&!z.to&&(Jr.role="button"),c&&(Jr["aria-disabled"]=c));const yn=Ur(r,Ne,q),mi=_({},n,{centerRipple:i,component:l,disabled:c,disableRipple:u,disableTouchRipple:d,focusRipple:f,tabIndex:F,focusVisible:ie}),Oa=zq(mi);return O.jsxs(Lq,_({as:Qe,className:Ce(Oa.root,a),ownerState:mi,onBlur:nr,onClick:m,onContextMenu:rt,onFocus:zo,onKeyDown:vn,onKeyUp:Vn,onMouseDown:ft,onMouseLeave:De,onMouseUp:he,onDragLeave:Or,onTouchEnd:Fn,onTouchMove:Gr,onTouchStart:Ke,ref:yn,tabIndex:c?-1:F,type:j},Jr,z,{children:[s,Me?O.jsx(_q,_({ref:P,center:i},I)):null]}))}),Mb=Iq;function Dq(e){return Vt("MuiIconButton",e)}const $q=jt("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),Hq=$q,Bq=["edge","children","className","color","disabled","disableFocusRipple","size"],Fq=e=>{const{classes:t,disabled:r,color:n,edge:o,size:i}=e,s={root:["root",r&&"disabled",n!=="default"&&`color${Fe(n)}`,o&&`edge${Fe(o)}`,`size${Fe(i)}`]};return rr(s,Dq,t)},Vq=Xe(Mb,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.color!=="default"&&t[`color${Fe(r.color)}`],r.edge&&t[`edge${Fe(r.edge)}`],t[`size${Fe(r.size)}`]]}})(({theme:e,ownerState:t})=>_({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Lr(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12}),({theme:e,ownerState:t})=>{var r;const n=(r=(e.vars||e).palette)==null?void 0:r[t.color];return _({},t.color==="inherit"&&{color:"inherit"},t.color!=="inherit"&&t.color!=="default"&&_({color:n==null?void 0:n.main},!t.disableRipple&&{"&:hover":_({},n&&{backgroundColor:e.vars?`rgba(${n.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Lr(n.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),t.size==="small"&&{padding:5,fontSize:e.typography.pxToRem(18)},t.size==="large"&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${Hq.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})}),jq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiIconButton"}),{edge:o=!1,children:i,className:s,color:a="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium"}=n,d=ve(n,Bq),f=_({},n,{edge:o,color:a,disabled:l,disableFocusRipple:c,size:u}),p=Fq(f);return O.jsx(Vq,_({className:Ce(p.root,s),centerRipple:!0,focusRipple:!c,disabled:l,ref:r,ownerState:f},d,{children:i}))}),Uq=jq;function Wq(e){return Vt("MuiTypography",e)}jt("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const Kq=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],qq=e=>{const{align:t,gutterBottom:r,noWrap:n,paragraph:o,variant:i,classes:s}=e,a={root:["root",i,e.align!=="inherit"&&`align${Fe(t)}`,r&&"gutterBottom",n&&"noWrap",o&&"paragraph"]};return rr(a,Wq,s)},Gq=Xe("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.variant&&t[r.variant],r.align!=="inherit"&&t[`align${Fe(r.align)}`],r.noWrap&&t.noWrap,r.gutterBottom&&t.gutterBottom,r.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>_({margin:0},t.variant==="inherit"&&{font:"inherit"},t.variant!=="inherit"&&e.typography[t.variant],t.align!=="inherit"&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),bS={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Yq={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Jq=e=>Yq[e]||e,Xq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiTypography"}),o=Jq(n.color),i=bb(_({},n,{color:o})),{align:s="inherit",className:a,component:l,gutterBottom:c=!1,noWrap:u=!1,paragraph:d=!1,variant:f="body1",variantMapping:p=bS}=i,h=ve(i,Kq),m=_({},i,{align:s,color:o,className:a,component:l,gutterBottom:c,noWrap:u,paragraph:d,variant:f,variantMapping:p}),b=l||(d?"p":p[f]||bS[f])||"span",v=qq(m);return O.jsx(Gq,_({as:b,ref:r,ownerState:m,className:Ce(v.root,a)},h))}),cu=Xq;function h3(e){return typeof e=="string"}function uu(e,t,r){return e===void 0||h3(e)?t:_({},t,{ownerState:_({},t.ownerState,r)})}const Qq={disableDefaultClasses:!1},Zq=S.createContext(Qq);function eG(e){const{disableDefaultClasses:t}=S.useContext(Zq);return r=>t?"":e(r)}function m3(e,t=[]){if(e===void 0)return{};const r={};return Object.keys(e).filter(n=>n.match(/^on[A-Z]/)&&typeof e[n]=="function"&&!t.includes(n)).forEach(n=>{r[n]=e[n]}),r}function tG(e,t,r){return typeof e=="function"?e(t,r):e}function xS(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(r=>!(r.match(/^on[A-Z]/)&&typeof e[r]=="function")).forEach(r=>{t[r]=e[r]}),t}function rG(e){const{getSlotProps:t,additionalProps:r,externalSlotProps:n,externalForwardedProps:o,className:i}=e;if(!t){const p=Ce(o==null?void 0:o.className,n==null?void 0:n.className,i,r==null?void 0:r.className),h=_({},r==null?void 0:r.style,o==null?void 0:o.style,n==null?void 0:n.style),m=_({},r,o,n);return p.length>0&&(m.className=p),Object.keys(h).length>0&&(m.style=h),{props:m,internalRef:void 0}}const s=m3(_({},o,n)),a=xS(n),l=xS(o),c=t(s),u=Ce(c==null?void 0:c.className,r==null?void 0:r.className,i,o==null?void 0:o.className,n==null?void 0:n.className),d=_({},c==null?void 0:c.style,r==null?void 0:r.style,o==null?void 0:o.style,n==null?void 0:n.style),f=_({},c,r,l,a);return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:c.ref}}const nG=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function si(e){var t;const{elementType:r,externalSlotProps:n,ownerState:o,skipResolvingSlotProps:i=!1}=e,s=ve(e,nG),a=i?{}:tG(n,o),{props:l,internalRef:c}=rG(_({},s,{externalSlotProps:a})),u=Ur(c,a==null?void 0:a.ref,(t=e.additionalProps)==null?void 0:t.ref);return uu(r,_({},l,{ref:u}),o)}function oG(e){const{badgeContent:t,invisible:r=!1,max:n=99,showZero:o=!1}=e,i=LT({badgeContent:t,max:n});let s=r;r===!1&&t===0&&!o&&(s=!0);const{badgeContent:a,max:l=n}=s?i:e,c=a&&Number(a)>l?`${l}+`:a;return{badgeContent:a,invisible:s,max:l,displayValue:c}}const iG=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function sG(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function aG(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=n=>e.ownerDocument.querySelector(`input[type="radio"]${n}`);let r=t(`[name="${e.name}"]:checked`);return r||(r=t(`[name="${e.name}"]`)),r!==e}function lG(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||aG(e))}function cG(e){const t=[],r=[];return Array.from(e.querySelectorAll(iG)).forEach((n,o)=>{const i=sG(n);i===-1||!lG(n)||(i===0?t.push(n):r.push({documentOrder:o,tabIndex:i,node:n}))}),r.sort((n,o)=>n.tabIndex===o.tabIndex?n.documentOrder-o.documentOrder:n.tabIndex-o.tabIndex).map(n=>n.node).concat(t)}function uG(){return!0}function dG(e){const{children:t,disableAutoFocus:r=!1,disableEnforceFocus:n=!1,disableRestoreFocus:o=!1,getTabbable:i=cG,isEnabled:s=uG,open:a}=e,l=S.useRef(!1),c=S.useRef(null),u=S.useRef(null),d=S.useRef(null),f=S.useRef(null),p=S.useRef(!1),h=S.useRef(null),m=Ur(t.ref,h),b=S.useRef(null);S.useEffect(()=>{!a||!h.current||(p.current=!r)},[r,a]),S.useEffect(()=>{if(!a||!h.current)return;const y=Br(h.current);return h.current.contains(y.activeElement)||(h.current.hasAttribute("tabIndex")||h.current.setAttribute("tabIndex","-1"),p.current&&h.current.focus()),()=>{o||(d.current&&d.current.focus&&(l.current=!0,d.current.focus()),d.current=null)}},[a]),S.useEffect(()=>{if(!a||!h.current)return;const y=Br(h.current),x=E=>{b.current=E,!(n||!s()||E.key!=="Tab")&&y.activeElement===h.current&&E.shiftKey&&(l.current=!0,u.current&&u.current.focus())},k=()=>{const E=h.current;if(E===null)return;if(!y.hasFocus()||!s()||l.current){l.current=!1;return}if(E.contains(y.activeElement)||n&&y.activeElement!==c.current&&y.activeElement!==u.current)return;if(y.activeElement!==f.current)f.current=null;else if(f.current!==null)return;if(!p.current)return;let T=[];if((y.activeElement===c.current||y.activeElement===u.current)&&(T=i(h.current)),T.length>0){var C,M;const N=!!((C=b.current)!=null&&C.shiftKey&&((M=b.current)==null?void 0:M.key)==="Tab"),F=T[0],I=T[T.length-1];typeof F!="string"&&typeof I!="string"&&(N?I.focus():F.focus())}else E.focus()};y.addEventListener("focusin",k),y.addEventListener("keydown",x,!0);const w=setInterval(()=>{y.activeElement&&y.activeElement.tagName==="BODY"&&k()},50);return()=>{clearInterval(w),y.removeEventListener("focusin",k),y.removeEventListener("keydown",x,!0)}},[r,n,o,s,a,i]);const v=y=>{d.current===null&&(d.current=y.relatedTarget),p.current=!0,f.current=y.target;const x=t.props.onFocus;x&&x(y)},g=y=>{d.current===null&&(d.current=y.relatedTarget),p.current=!0};return O.jsxs(S.Fragment,{children:[O.jsx("div",{tabIndex:a?0:-1,onFocus:g,ref:c,"data-testid":"sentinelStart"}),S.cloneElement(t,{ref:m,onFocus:v}),O.jsx("div",{tabIndex:a?0:-1,onFocus:g,ref:u,"data-testid":"sentinelEnd"})]})}var Fr="top",Ln="bottom",In="right",Vr="left",Tb="auto",Gd=[Fr,Ln,In,Vr],Gl="start",gd="end",fG="clippingParents",g3="viewport",_c="popper",pG="reference",kS=Gd.reduce(function(e,t){return e.concat([t+"-"+Gl,t+"-"+gd])},[]),v3=[].concat(Gd,[Tb]).reduce(function(e,t){return e.concat([t,t+"-"+Gl,t+"-"+gd])},[]),hG="beforeRead",mG="read",gG="afterRead",vG="beforeMain",yG="main",bG="afterMain",xG="beforeWrite",kG="write",wG="afterWrite",SG=[hG,mG,gG,vG,yG,bG,xG,kG,wG];function No(e){return e?(e.nodeName||"").toLowerCase():null}function pn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function va(e){var t=pn(e).Element;return e instanceof t||e instanceof Element}function Nn(e){var t=pn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Ob(e){if(typeof ShadowRoot>"u")return!1;var t=pn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function EG(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},o=t.attributes[r]||{},i=t.elements[r];!Nn(i)||!No(i)||(Object.assign(i.style,n),Object.keys(o).forEach(function(s){var a=o[s];a===!1?i.removeAttribute(s):i.setAttribute(s,a===!0?"":a)}))})}function CG(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var o=t.elements[n],i=t.attributes[n]||{},s=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),a=s.reduce(function(l,c){return l[c]="",l},{});!Nn(o)||!No(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const MG={name:"applyStyles",enabled:!0,phase:"write",fn:EG,effect:CG,requires:["computeStyles"]};function Co(e){return e.split("-")[0]}var ta=Math.max,vh=Math.min,Yl=Math.round;function rv(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function y3(){return!/^((?!chrome|android).)*safari/i.test(rv())}function Jl(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),o=1,i=1;t&&Nn(e)&&(o=e.offsetWidth>0&&Yl(n.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Yl(n.height)/e.offsetHeight||1);var s=va(e)?pn(e):window,a=s.visualViewport,l=!y3()&&r,c=(n.left+(l&&a?a.offsetLeft:0))/o,u=(n.top+(l&&a?a.offsetTop:0))/i,d=n.width/o,f=n.height/i;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function _b(e){var t=Jl(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function b3(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&Ob(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function ai(e){return pn(e).getComputedStyle(e)}function TG(e){return["table","td","th"].indexOf(No(e))>=0}function ks(e){return((va(e)?e.ownerDocument:e.document)||window.document).documentElement}function Gm(e){return No(e)==="html"?e:e.assignedSlot||e.parentNode||(Ob(e)?e.host:null)||ks(e)}function wS(e){return!Nn(e)||ai(e).position==="fixed"?null:e.offsetParent}function OG(e){var t=/firefox/i.test(rv()),r=/Trident/i.test(rv());if(r&&Nn(e)){var n=ai(e);if(n.position==="fixed")return null}var o=Gm(e);for(Ob(o)&&(o=o.host);Nn(o)&&["html","body"].indexOf(No(o))<0;){var i=ai(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function Yd(e){for(var t=pn(e),r=wS(e);r&&TG(r)&&ai(r).position==="static";)r=wS(r);return r&&(No(r)==="html"||No(r)==="body"&&ai(r).position==="static")?t:r||OG(e)||t}function Ab(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Au(e,t,r){return ta(e,vh(t,r))}function _G(e,t,r){var n=Au(e,t,r);return n>r?r:n}function x3(){return{top:0,right:0,bottom:0,left:0}}function k3(e){return Object.assign({},x3(),e)}function w3(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var AG=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,k3(typeof t!="number"?t:w3(t,Gd))};function NG(e){var t,r=e.state,n=e.name,o=e.options,i=r.elements.arrow,s=r.modifiersData.popperOffsets,a=Co(r.placement),l=Ab(a),c=[Vr,In].indexOf(a)>=0,u=c?"height":"width";if(!(!i||!s)){var d=AG(o.padding,r),f=_b(i),p=l==="y"?Fr:Vr,h=l==="y"?Ln:In,m=r.rects.reference[u]+r.rects.reference[l]-s[l]-r.rects.popper[u],b=s[l]-r.rects.reference[l],v=Yd(i),g=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,y=m/2-b/2,x=d[p],k=g-f[u]-d[h],w=g/2-f[u]/2+y,E=Au(x,w,k),T=l;r.modifiersData[n]=(t={},t[T]=E,t.centerOffset=E-w,t)}}function RG(e){var t=e.state,r=e.options,n=r.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||b3(t.elements.popper,o)&&(t.elements.arrow=o))}const PG={name:"arrow",enabled:!0,phase:"main",fn:NG,effect:RG,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Xl(e){return e.split("-")[1]}var zG={top:"auto",right:"auto",bottom:"auto",left:"auto"};function LG(e,t){var r=e.x,n=e.y,o=t.devicePixelRatio||1;return{x:Yl(r*o)/o||0,y:Yl(n*o)/o||0}}function SS(e){var t,r=e.popper,n=e.popperRect,o=e.placement,i=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=s.x,p=f===void 0?0:f,h=s.y,m=h===void 0?0:h,b=typeof u=="function"?u({x:p,y:m}):{x:p,y:m};p=b.x,m=b.y;var v=s.hasOwnProperty("x"),g=s.hasOwnProperty("y"),y=Vr,x=Fr,k=window;if(c){var w=Yd(r),E="clientHeight",T="clientWidth";if(w===pn(r)&&(w=ks(r),ai(w).position!=="static"&&a==="absolute"&&(E="scrollHeight",T="scrollWidth")),w=w,o===Fr||(o===Vr||o===In)&&i===gd){x=Ln;var C=d&&w===k&&k.visualViewport?k.visualViewport.height:w[E];m-=C-n.height,m*=l?1:-1}if(o===Vr||(o===Fr||o===Ln)&&i===gd){y=In;var M=d&&w===k&&k.visualViewport?k.visualViewport.width:w[T];p-=M-n.width,p*=l?1:-1}}var N=Object.assign({position:a},c&&zG),F=u===!0?LG({x:p,y:m},pn(r)):{x:p,y:m};if(p=F.x,m=F.y,l){var I;return Object.assign({},N,(I={},I[x]=g?"0":"",I[y]=v?"0":"",I.transform=(k.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",I))}return Object.assign({},N,(t={},t[x]=g?m+"px":"",t[y]=v?p+"px":"",t.transform="",t))}function IG(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=n===void 0?!0:n,i=r.adaptive,s=i===void 0?!0:i,a=r.roundOffsets,l=a===void 0?!0:a,c={placement:Co(t.placement),variation:Xl(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,SS(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,SS(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const DG={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:IG,data:{}};var Cf={passive:!0};function $G(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,i=o===void 0?!0:o,s=n.resize,a=s===void 0?!0:s,l=pn(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",r.update,Cf)}),a&&l.addEventListener("resize",r.update,Cf),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",r.update,Cf)}),a&&l.removeEventListener("resize",r.update,Cf)}}const HG={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:$G,data:{}};var BG={left:"right",right:"left",bottom:"top",top:"bottom"};function hp(e){return e.replace(/left|right|bottom|top/g,function(t){return BG[t]})}var FG={start:"end",end:"start"};function ES(e){return e.replace(/start|end/g,function(t){return FG[t]})}function Nb(e){var t=pn(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function Rb(e){return Jl(ks(e)).left+Nb(e).scrollLeft}function VG(e,t){var r=pn(e),n=ks(e),o=r.visualViewport,i=n.clientWidth,s=n.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;var c=y3();(c||!c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a+Rb(e),y:l}}function jG(e){var t,r=ks(e),n=Nb(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=ta(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=ta(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-n.scrollLeft+Rb(e),l=-n.scrollTop;return ai(o||r).direction==="rtl"&&(a+=ta(r.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function Pb(e){var t=ai(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function S3(e){return["html","body","#document"].indexOf(No(e))>=0?e.ownerDocument.body:Nn(e)&&Pb(e)?e:S3(Gm(e))}function Nu(e,t){var r;t===void 0&&(t=[]);var n=S3(e),o=n===((r=e.ownerDocument)==null?void 0:r.body),i=pn(n),s=o?[i].concat(i.visualViewport||[],Pb(n)?n:[]):n,a=t.concat(s);return o?a:a.concat(Nu(Gm(s)))}function nv(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function UG(e,t){var r=Jl(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function CS(e,t,r){return t===g3?nv(VG(e,r)):va(t)?UG(t,r):nv(jG(ks(e)))}function WG(e){var t=Nu(Gm(e)),r=["absolute","fixed"].indexOf(ai(e).position)>=0,n=r&&Nn(e)?Yd(e):e;return va(n)?t.filter(function(o){return va(o)&&b3(o,n)&&No(o)!=="body"}):[]}function KG(e,t,r,n){var o=t==="clippingParents"?WG(e):[].concat(t),i=[].concat(o,[r]),s=i[0],a=i.reduce(function(l,c){var u=CS(e,c,n);return l.top=ta(u.top,l.top),l.right=vh(u.right,l.right),l.bottom=vh(u.bottom,l.bottom),l.left=ta(u.left,l.left),l},CS(e,s,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function E3(e){var t=e.reference,r=e.element,n=e.placement,o=n?Co(n):null,i=n?Xl(n):null,s=t.x+t.width/2-r.width/2,a=t.y+t.height/2-r.height/2,l;switch(o){case Fr:l={x:s,y:t.y-r.height};break;case Ln:l={x:s,y:t.y+t.height};break;case In:l={x:t.x+t.width,y:a};break;case Vr:l={x:t.x-r.width,y:a};break;default:l={x:t.x,y:t.y}}var c=o?Ab(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case Gl:l[c]=l[c]-(t[u]/2-r[u]/2);break;case gd:l[c]=l[c]+(t[u]/2-r[u]/2);break}}return l}function vd(e,t){t===void 0&&(t={});var r=t,n=r.placement,o=n===void 0?e.placement:n,i=r.strategy,s=i===void 0?e.strategy:i,a=r.boundary,l=a===void 0?fG:a,c=r.rootBoundary,u=c===void 0?g3:c,d=r.elementContext,f=d===void 0?_c:d,p=r.altBoundary,h=p===void 0?!1:p,m=r.padding,b=m===void 0?0:m,v=k3(typeof b!="number"?b:w3(b,Gd)),g=f===_c?pG:_c,y=e.rects.popper,x=e.elements[h?g:f],k=KG(va(x)?x:x.contextElement||ks(e.elements.popper),l,u,s),w=Jl(e.elements.reference),E=E3({reference:w,element:y,strategy:"absolute",placement:o}),T=nv(Object.assign({},y,E)),C=f===_c?T:w,M={top:k.top-C.top+v.top,bottom:C.bottom-k.bottom+v.bottom,left:k.left-C.left+v.left,right:C.right-k.right+v.right},N=e.modifiersData.offset;if(f===_c&&N){var F=N[o];Object.keys(M).forEach(function(I){var V=[In,Ln].indexOf(I)>=0?1:-1,j=[Fr,Ln].indexOf(I)>=0?"y":"x";M[I]+=F[j]*V})}return M}function qG(e,t){t===void 0&&(t={});var r=t,n=r.placement,o=r.boundary,i=r.rootBoundary,s=r.padding,a=r.flipVariations,l=r.allowedAutoPlacements,c=l===void 0?v3:l,u=Xl(n),d=u?a?kS:kS.filter(function(h){return Xl(h)===u}):Gd,f=d.filter(function(h){return c.indexOf(h)>=0});f.length===0&&(f=d);var p=f.reduce(function(h,m){return h[m]=vd(e,{placement:m,boundary:o,rootBoundary:i,padding:s})[Co(m)],h},{});return Object.keys(p).sort(function(h,m){return p[h]-p[m]})}function GG(e){if(Co(e)===Tb)return[];var t=hp(e);return[ES(e),t,ES(t)]}function YG(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=r.mainAxis,i=o===void 0?!0:o,s=r.altAxis,a=s===void 0?!0:s,l=r.fallbackPlacements,c=r.padding,u=r.boundary,d=r.rootBoundary,f=r.altBoundary,p=r.flipVariations,h=p===void 0?!0:p,m=r.allowedAutoPlacements,b=t.options.placement,v=Co(b),g=v===b,y=l||(g||!h?[hp(b)]:GG(b)),x=[b].concat(y).reduce(function(ie,ue){return ie.concat(Co(ue)===Tb?qG(t,{placement:ue,boundary:u,rootBoundary:d,padding:c,flipVariations:h,allowedAutoPlacements:m}):ue)},[]),k=t.rects.reference,w=t.rects.popper,E=new Map,T=!0,C=x[0],M=0;M=0,j=V?"width":"height",z=vd(t,{placement:N,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),q=V?I?In:Vr:I?Ln:Fr;k[j]>w[j]&&(q=hp(q));var A=hp(q),P=[];if(i&&P.push(z[F]<=0),a&&P.push(z[q]<=0,z[A]<=0),P.every(function(ie){return ie})){C=N,T=!1;break}E.set(N,P)}if(T)for(var B=h?3:1,Y=function(ue){var de=x.find(function(me){var Me=E.get(me);if(Me)return Me.slice(0,ue).every(function(Se){return Se})});if(de)return C=de,"break"},J=B;J>0;J--){var Ne=Y(J);if(Ne==="break")break}t.placement!==C&&(t.modifiersData[n]._skip=!0,t.placement=C,t.reset=!0)}}const JG={name:"flip",enabled:!0,phase:"main",fn:YG,requiresIfExists:["offset"],data:{_skip:!1}};function MS(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function TS(e){return[Fr,In,Ln,Vr].some(function(t){return e[t]>=0})}function XG(e){var t=e.state,r=e.name,n=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=vd(t,{elementContext:"reference"}),a=vd(t,{altBoundary:!0}),l=MS(s,n),c=MS(a,o,i),u=TS(l),d=TS(c);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const QG={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:XG};function ZG(e,t,r){var n=Co(e),o=[Vr,Fr].indexOf(n)>=0?-1:1,i=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Vr,In].indexOf(n)>=0?{x:a,y:s}:{x:s,y:a}}function eY(e){var t=e.state,r=e.options,n=e.name,o=r.offset,i=o===void 0?[0,0]:o,s=v3.reduce(function(u,d){return u[d]=ZG(d,t.rects,i),u},{}),a=s[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=s}const tY={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:eY};function rY(e){var t=e.state,r=e.name;t.modifiersData[r]=E3({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const nY={name:"popperOffsets",enabled:!0,phase:"read",fn:rY,data:{}};function oY(e){return e==="x"?"y":"x"}function iY(e){var t=e.state,r=e.options,n=e.name,o=r.mainAxis,i=o===void 0?!0:o,s=r.altAxis,a=s===void 0?!1:s,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,d=r.padding,f=r.tether,p=f===void 0?!0:f,h=r.tetherOffset,m=h===void 0?0:h,b=vd(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),v=Co(t.placement),g=Xl(t.placement),y=!g,x=Ab(v),k=oY(x),w=t.modifiersData.popperOffsets,E=t.rects.reference,T=t.rects.popper,C=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,M=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,F={x:0,y:0};if(w){if(i){var I,V=x==="y"?Fr:Vr,j=x==="y"?Ln:In,z=x==="y"?"height":"width",q=w[x],A=q+b[V],P=q-b[j],B=p?-T[z]/2:0,Y=g===Gl?E[z]:T[z],J=g===Gl?-T[z]:-E[z],Ne=t.elements.arrow,ie=p&&Ne?_b(Ne):{width:0,height:0},ue=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:x3(),de=ue[V],me=ue[j],Me=Au(0,E[z],ie[z]),Se=y?E[z]/2-B-Me-de-M.mainAxis:Y-Me-de-M.mainAxis,ft=y?-E[z]/2+B+Me+me+M.mainAxis:J+Me+me+M.mainAxis,rt=t.elements.arrow&&Yd(t.elements.arrow),Or=rt?x==="y"?rt.clientTop||0:rt.clientLeft||0:0,he=(I=N==null?void 0:N[x])!=null?I:0,De=q+Se-he-Or,Ke=q+ft-he,Fn=Au(p?vh(A,De):A,q,p?ta(P,Ke):P);w[x]=Fn,F[x]=Fn-q}if(a){var Gr,nr=x==="x"?Fr:Vr,zo=x==="x"?Ln:In,Pt=w[k],Yr=k==="y"?"height":"width",vn=Pt+b[nr],Vn=Pt-b[zo],Qe=[Fr,Vr].indexOf(v)!==-1,Jr=(Gr=N==null?void 0:N[k])!=null?Gr:0,yn=Qe?vn:Pt-E[Yr]-T[Yr]-Jr+M.altAxis,mi=Qe?Pt+E[Yr]+T[Yr]-Jr-M.altAxis:Vn,Oa=p&&Qe?_G(yn,Pt,mi):Au(p?yn:vn,Pt,p?mi:Vn);w[k]=Oa,F[k]=Oa-Pt}t.modifiersData[n]=F}}const sY={name:"preventOverflow",enabled:!0,phase:"main",fn:iY,requiresIfExists:["offset"]};function aY(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function lY(e){return e===pn(e)||!Nn(e)?Nb(e):aY(e)}function cY(e){var t=e.getBoundingClientRect(),r=Yl(t.width)/e.offsetWidth||1,n=Yl(t.height)/e.offsetHeight||1;return r!==1||n!==1}function uY(e,t,r){r===void 0&&(r=!1);var n=Nn(t),o=Nn(t)&&cY(t),i=ks(t),s=Jl(e,o,r),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!r)&&((No(t)!=="body"||Pb(i))&&(a=lY(t)),Nn(t)?(l=Jl(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=Rb(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function dY(e){var t=new Map,r=new Set,n=[];e.forEach(function(i){t.set(i.name,i)});function o(i){r.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!r.has(a)){var l=t.get(a);l&&o(l)}}),n.push(i)}return e.forEach(function(i){r.has(i.name)||o(i)}),n}function fY(e){var t=dY(e);return SG.reduce(function(r,n){return r.concat(t.filter(function(o){return o.phase===n}))},[])}function pY(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function hY(e){var t=e.reduce(function(r,n){var o=r[n.name];return r[n.name]=o?Object.assign({},o,n,{options:Object.assign({},o.options,n.options),data:Object.assign({},o.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var OS={placement:"bottom",modifiers:[],strategy:"absolute"};function _S(){for(var e=arguments.length,t=new Array(e),r=0;r{i||a(yY(o)||document.body)},[o,i]),ha(()=>{if(s&&!i)return Y0(r,s),()=>{Y0(r,null)}},[r,s,i]),i){if(S.isValidElement(n)){const c={ref:l};return S.cloneElement(n,c)}return O.jsx(S.Fragment,{children:n})}return O.jsx(S.Fragment,{children:s&&am.createPortal(n,s)})});function bY(e){return Vt("MuiPopper",e)}jt("MuiPopper",["root"]);const xY=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],kY=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function wY(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function ov(e){return typeof e=="function"?e():e}function SY(e){return e.nodeType!==void 0}const EY=()=>rr({root:["root"]},eG(bY)),CY={},MY=S.forwardRef(function(t,r){var n;const{anchorEl:o,children:i,direction:s,disablePortal:a,modifiers:l,open:c,placement:u,popperOptions:d,popperRef:f,slotProps:p={},slots:h={},TransitionProps:m}=t,b=ve(t,xY),v=S.useRef(null),g=Ur(v,r),y=S.useRef(null),x=Ur(y,f),k=S.useRef(x);ha(()=>{k.current=x},[x]),S.useImperativeHandle(f,()=>y.current,[]);const w=wY(u,s),[E,T]=S.useState(w),[C,M]=S.useState(ov(o));S.useEffect(()=>{y.current&&y.current.forceUpdate()}),S.useEffect(()=>{o&&M(ov(o))},[o]),ha(()=>{if(!C||!c)return;const j=A=>{T(A.placement)};let z=[{name:"preventOverflow",options:{altBoundary:a}},{name:"flip",options:{altBoundary:a}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:A})=>{j(A)}}];l!=null&&(z=z.concat(l)),d&&d.modifiers!=null&&(z=z.concat(d.modifiers));const q=vY(C,v.current,_({placement:w},d,{modifiers:z}));return k.current(q),()=>{q.destroy(),k.current(null)}},[C,a,l,c,d,w]);const N={placement:E};m!==null&&(N.TransitionProps=m);const F=EY(),I=(n=h.root)!=null?n:"div",V=si({elementType:I,externalSlotProps:p.root,externalForwardedProps:b,additionalProps:{role:"tooltip",ref:g},ownerState:t,className:F.root});return O.jsx(I,_({},V,{children:typeof i=="function"?i(N):i}))}),TY=S.forwardRef(function(t,r){const{anchorEl:n,children:o,container:i,direction:s="ltr",disablePortal:a=!1,keepMounted:l=!1,modifiers:c,open:u,placement:d="bottom",popperOptions:f=CY,popperRef:p,style:h,transition:m=!1,slotProps:b={},slots:v={}}=t,g=ve(t,kY),[y,x]=S.useState(!0),k=()=>{x(!1)},w=()=>{x(!0)};if(!l&&!u&&(!m||y))return null;let E;if(i)E=i;else if(n){const M=ov(n);E=M&&SY(M)?Br(M).body:Br(null).body}const T=!u&&l&&(!m||y)?"none":void 0,C=m?{in:u,onEnter:k,onExited:w}:void 0;return O.jsx(C3,{disablePortal:a,container:E,children:O.jsx(MY,_({anchorEl:n,direction:s,disablePortal:a,modifiers:c,ref:r,open:m?!y:u,placement:d,popperOptions:f,popperRef:p,slotProps:b,slots:v},g,{style:_({position:"fixed",top:0,left:0,display:T},h),TransitionProps:C,children:o}))})});function OY(e){const t=Br(e);return t.body===e?fd(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function Ru(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function AS(e){return parseInt(fd(e).getComputedStyle(e).paddingRight,10)||0}function _Y(e){const r=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName)!==-1,n=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return r||n}function NS(e,t,r,n,o){const i=[t,r,...n];[].forEach.call(e.children,s=>{const a=i.indexOf(s)===-1,l=!_Y(s);a&&l&&Ru(s,o)})}function n1(e,t){let r=-1;return e.some((n,o)=>t(n)?(r=o,!0):!1),r}function AY(e,t){const r=[],n=e.container;if(!t.disableScrollLock){if(OY(n)){const s=zT(Br(n));r.push({value:n.style.paddingRight,property:"padding-right",el:n}),n.style.paddingRight=`${AS(n)+s}px`;const a=Br(n).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{r.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${AS(l)+s}px`})}let i;if(n.parentNode instanceof DocumentFragment)i=Br(n).body;else{const s=n.parentElement,a=fd(n);i=(s==null?void 0:s.nodeName)==="HTML"&&a.getComputedStyle(s).overflowY==="scroll"?s:n}r.push({value:i.style.overflow,property:"overflow",el:i},{value:i.style.overflowX,property:"overflow-x",el:i},{value:i.style.overflowY,property:"overflow-y",el:i}),i.style.overflow="hidden"}return()=>{r.forEach(({value:i,el:s,property:a})=>{i?s.style.setProperty(a,i):s.style.removeProperty(a)})}}function NY(e){const t=[];return[].forEach.call(e.children,r=>{r.getAttribute("aria-hidden")==="true"&&t.push(r)}),t}class RY{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(t,r){let n=this.modals.indexOf(t);if(n!==-1)return n;n=this.modals.length,this.modals.push(t),t.modalRef&&Ru(t.modalRef,!1);const o=NY(r);NS(r,t.mount,t.modalRef,o,!0);const i=n1(this.containers,s=>s.container===r);return i!==-1?(this.containers[i].modals.push(t),n):(this.containers.push({modals:[t],container:r,restore:null,hiddenSiblings:o}),n)}mount(t,r){const n=n1(this.containers,i=>i.modals.indexOf(t)!==-1),o=this.containers[n];o.restore||(o.restore=AY(o,r))}remove(t,r=!0){const n=this.modals.indexOf(t);if(n===-1)return n;const o=n1(this.containers,s=>s.modals.indexOf(t)!==-1),i=this.containers[o];if(i.modals.splice(i.modals.indexOf(t),1),this.modals.splice(n,1),i.modals.length===0)i.restore&&i.restore(),t.modalRef&&Ru(t.modalRef,r),NS(i.container,t.mount,t.modalRef,i.hiddenSiblings,!1),this.containers.splice(o,1);else{const s=i.modals[i.modals.length-1];s.modalRef&&Ru(s.modalRef,!1)}return n}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function PY(e){return typeof e=="function"?e():e}function zY(e){return e?e.props.hasOwnProperty("in"):!1}const LY=new RY;function IY(e){const{container:t,disableEscapeKeyDown:r=!1,disableScrollLock:n=!1,manager:o=LY,closeAfterTransition:i=!1,onTransitionEnter:s,onTransitionExited:a,children:l,onClose:c,open:u,rootRef:d}=e,f=S.useRef({}),p=S.useRef(null),h=S.useRef(null),m=Ur(h,d),[b,v]=S.useState(!u),g=zY(l);let y=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(y=!1);const x=()=>Br(p.current),k=()=>(f.current.modalRef=h.current,f.current.mount=p.current,f.current),w=()=>{o.mount(k(),{disableScrollLock:n}),h.current&&(h.current.scrollTop=0)},E=Ks(()=>{const z=PY(t)||x().body;o.add(k(),z),h.current&&w()}),T=S.useCallback(()=>o.isTopModal(k()),[o]),C=Ks(z=>{p.current=z,z&&(u&&T()?w():h.current&&Ru(h.current,y))}),M=S.useCallback(()=>{o.remove(k(),y)},[y,o]);S.useEffect(()=>()=>{M()},[M]),S.useEffect(()=>{u?E():(!g||!i)&&M()},[u,M,g,i,E]);const N=z=>q=>{var A;(A=z.onKeyDown)==null||A.call(z,q),!(q.key!=="Escape"||!T())&&(r||(q.stopPropagation(),c&&c(q,"escapeKeyDown")))},F=z=>q=>{var A;(A=z.onClick)==null||A.call(z,q),q.target===q.currentTarget&&c&&c(q,"backdropClick")};return{getRootProps:(z={})=>{const q=m3(e);delete q.onTransitionEnter,delete q.onTransitionExited;const A=_({},q,z);return _({role:"presentation"},A,{onKeyDown:N(A),ref:m})},getBackdropProps:(z={})=>{const q=z;return _({"aria-hidden":!0},q,{onClick:F(q),open:u})},getTransitionProps:()=>{const z=()=>{v(!1),s&&s()},q=()=>{v(!0),a&&a(),i&&M()};return{onEnter:Vw(z,l==null?void 0:l.props.onEnter),onExited:Vw(q,l==null?void 0:l.props.onExited)}},rootRef:m,portalRef:C,isTopModal:T,exited:b,hasTransition:g}}const DY=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],$Y=Xe(TY,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),HY=S.forwardRef(function(t,r){var n;const o=vb(),i=Wt({props:t,name:"MuiPopper"}),{anchorEl:s,component:a,components:l,componentsProps:c,container:u,disablePortal:d,keepMounted:f,modifiers:p,open:h,placement:m,popperOptions:b,popperRef:v,transition:g,slots:y,slotProps:x}=i,k=ve(i,DY),w=(n=y==null?void 0:y.root)!=null?n:l==null?void 0:l.Root,E=_({anchorEl:s,container:u,disablePortal:d,keepMounted:f,modifiers:p,open:h,placement:m,popperOptions:b,popperRef:v,transition:g},k);return O.jsx($Y,_({as:a,direction:o==null?void 0:o.direction,slots:{root:w},slotProps:x??c},E,{ref:r}))}),zb=HY,BY=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],FY={entering:{opacity:1},entered:{opacity:1}},VY=S.forwardRef(function(t,r){const n=Km(),o={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:s=!0,children:a,easing:l,in:c,onEnter:u,onEntered:d,onEntering:f,onExit:p,onExited:h,onExiting:m,style:b,timeout:v=o,TransitionComponent:g=f3}=t,y=ve(t,BY),x=S.useRef(null),k=Ur(x,a.ref,r),w=V=>j=>{if(V){const z=x.current;j===void 0?V(z):V(z,j)}},E=w(f),T=w((V,j)=>{p3(V);const z=gh({style:b,timeout:v,easing:l},{mode:"enter"});V.style.webkitTransition=n.transitions.create("opacity",z),V.style.transition=n.transitions.create("opacity",z),u&&u(V,j)}),C=w(d),M=w(m),N=w(V=>{const j=gh({style:b,timeout:v,easing:l},{mode:"exit"});V.style.webkitTransition=n.transitions.create("opacity",j),V.style.transition=n.transitions.create("opacity",j),p&&p(V)}),F=w(h),I=V=>{i&&i(x.current,V)};return O.jsx(g,_({appear:s,in:c,nodeRef:x,onEnter:T,onEntered:C,onEntering:E,onExit:N,onExited:F,onExiting:M,addEndListener:I,timeout:v},y,{children:(V,j)=>S.cloneElement(a,_({style:_({opacity:0,visibility:V==="exited"&&!c?"hidden":void 0},FY[V],b,a.props.style),ref:k},j))}))}),jY=VY;function UY(e){return Vt("MuiBackdrop",e)}jt("MuiBackdrop",["root","invisible"]);const WY=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],KY=e=>{const{classes:t,invisible:r}=e;return rr({root:["root",r&&"invisible"]},UY,t)},qY=Xe("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.invisible&&t.invisible]}})(({ownerState:e})=>_({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},e.invisible&&{backgroundColor:"transparent"})),GY=S.forwardRef(function(t,r){var n,o,i;const s=Wt({props:t,name:"MuiBackdrop"}),{children:a,className:l,component:c="div",components:u={},componentsProps:d={},invisible:f=!1,open:p,slotProps:h={},slots:m={},TransitionComponent:b=jY,transitionDuration:v}=s,g=ve(s,WY),y=_({},s,{component:c,invisible:f}),x=KY(y),k=(n=h.root)!=null?n:d.root;return O.jsx(b,_({in:p,timeout:v},g,{children:O.jsx(qY,_({"aria-hidden":!0},k,{as:(o=(i=m.root)!=null?i:u.Root)!=null?o:c,className:Ce(x.root,l,k==null?void 0:k.className),ownerState:_({},y,k==null?void 0:k.ownerState),classes:x,ref:r,children:a}))}))}),YY=GY;function JY(e){return Vt("MuiBadge",e)}const XY=jt("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),bi=XY,QY=["anchorOrigin","className","classes","component","components","componentsProps","children","overlap","color","invisible","max","badgeContent","slots","slotProps","showZero","variant"],o1=10,i1=4,ZY=e=>{const{color:t,anchorOrigin:r,invisible:n,overlap:o,variant:i,classes:s={}}=e,a={root:["root"],badge:["badge",i,n&&"invisible",`anchorOrigin${Fe(r.vertical)}${Fe(r.horizontal)}`,`anchorOrigin${Fe(r.vertical)}${Fe(r.horizontal)}${Fe(o)}`,`overlap${Fe(o)}`,t!=="default"&&`color${Fe(t)}`]};return rr(a,JY,s)},eJ=Xe("span",{name:"MuiBadge",slot:"Root",overridesResolver:(e,t)=>t.root})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),tJ=Xe("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.badge,t[r.variant],t[`anchorOrigin${Fe(r.anchorOrigin.vertical)}${Fe(r.anchorOrigin.horizontal)}${Fe(r.overlap)}`],r.color!=="default"&&t[`color${Fe(r.color)}`],r.invisible&&t.invisible]}})(({theme:e,ownerState:t})=>_({display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(12),minWidth:o1*2,lineHeight:1,padding:"0 6px",height:o1*2,borderRadius:o1,zIndex:1,transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.enteringScreen})},t.color!=="default"&&{backgroundColor:(e.vars||e).palette[t.color].main,color:(e.vars||e).palette[t.color].contrastText},t.variant==="dot"&&{borderRadius:i1,height:i1*2,minWidth:i1*2,padding:0},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular"&&{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular"&&{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular"&&{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular"&&{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular"&&{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular"&&{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular"&&{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular"&&{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}},t.invisible&&{transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.leavingScreen})})),rJ=S.forwardRef(function(t,r){var n,o,i,s,a,l;const c=Wt({props:t,name:"MuiBadge"}),{anchorOrigin:u={vertical:"top",horizontal:"right"},className:d,component:f,components:p={},componentsProps:h={},children:m,overlap:b="rectangular",color:v="default",invisible:g=!1,max:y=99,badgeContent:x,slots:k,slotProps:w,showZero:E=!1,variant:T="standard"}=c,C=ve(c,QY),{badgeContent:M,invisible:N,max:F,displayValue:I}=oG({max:y,invisible:g,badgeContent:x,showZero:E}),V=LT({anchorOrigin:u,color:v,overlap:b,variant:T,badgeContent:x}),j=N||M==null&&T!=="dot",{color:z=v,overlap:q=b,anchorOrigin:A=u,variant:P=T}=j?V:c,B=P!=="dot"?I:void 0,Y=_({},c,{badgeContent:M,invisible:j,max:F,displayValue:B,showZero:E,anchorOrigin:A,color:z,overlap:q,variant:P}),J=ZY(Y),Ne=(n=(o=k==null?void 0:k.root)!=null?o:p.Root)!=null?n:eJ,ie=(i=(s=k==null?void 0:k.badge)!=null?s:p.Badge)!=null?i:tJ,ue=(a=w==null?void 0:w.root)!=null?a:h.root,de=(l=w==null?void 0:w.badge)!=null?l:h.badge,me=si({elementType:Ne,externalSlotProps:ue,externalForwardedProps:C,additionalProps:{ref:r,as:f},ownerState:Y,className:Ce(ue==null?void 0:ue.className,J.root,d)}),Me=si({elementType:ie,externalSlotProps:de,ownerState:Y,className:Ce(J.badge,de==null?void 0:de.className)});return O.jsxs(Ne,_({},me,{children:[m,O.jsx(ie,_({},Me,{children:B}))]}))}),nJ=rJ,oJ=kb(),iJ=JW({themeId:Kl,defaultTheme:oJ,defaultClassName:"MuiBox-root",generateClassName:DT.generate}),M3=iJ;function sJ(e){return Vt("MuiModal",e)}jt("MuiModal",["root","hidden","backdrop"]);const aJ=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],lJ=e=>{const{open:t,exited:r,classes:n}=e;return rr({root:["root",!t&&r&&"hidden"],backdrop:["backdrop"]},sJ,n)},cJ=Xe("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.open&&r.exited&&t.hidden]}})(({theme:e,ownerState:t})=>_({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),uJ=Xe(YY,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),dJ=S.forwardRef(function(t,r){var n,o,i,s,a,l;const c=Wt({name:"MuiModal",props:t}),{BackdropComponent:u=uJ,BackdropProps:d,className:f,closeAfterTransition:p=!1,children:h,container:m,component:b,components:v={},componentsProps:g={},disableAutoFocus:y=!1,disableEnforceFocus:x=!1,disableEscapeKeyDown:k=!1,disablePortal:w=!1,disableRestoreFocus:E=!1,disableScrollLock:T=!1,hideBackdrop:C=!1,keepMounted:M=!1,onBackdropClick:N,open:F,slotProps:I,slots:V}=c,j=ve(c,aJ),z=_({},c,{closeAfterTransition:p,disableAutoFocus:y,disableEnforceFocus:x,disableEscapeKeyDown:k,disablePortal:w,disableRestoreFocus:E,disableScrollLock:T,hideBackdrop:C,keepMounted:M}),{getRootProps:q,getBackdropProps:A,getTransitionProps:P,portalRef:B,isTopModal:Y,exited:J,hasTransition:Ne}=IY(_({},z,{rootRef:r})),ie=_({},z,{exited:J}),ue=lJ(ie),de={};if(h.props.tabIndex===void 0&&(de.tabIndex="-1"),Ne){const{onEnter:he,onExited:De}=P();de.onEnter=he,de.onExited=De}const me=(n=(o=V==null?void 0:V.root)!=null?o:v.Root)!=null?n:cJ,Me=(i=(s=V==null?void 0:V.backdrop)!=null?s:v.Backdrop)!=null?i:u,Se=(a=I==null?void 0:I.root)!=null?a:g.root,ft=(l=I==null?void 0:I.backdrop)!=null?l:g.backdrop,rt=si({elementType:me,externalSlotProps:Se,externalForwardedProps:j,getSlotProps:q,additionalProps:{ref:r,as:b},ownerState:ie,className:Ce(f,Se==null?void 0:Se.className,ue==null?void 0:ue.root,!ie.open&&ie.exited&&(ue==null?void 0:ue.hidden))}),Or=si({elementType:Me,externalSlotProps:ft,additionalProps:d,getSlotProps:he=>A(_({},he,{onClick:De=>{N&&N(De),he!=null&&he.onClick&&he.onClick(De)}})),className:Ce(ft==null?void 0:ft.className,d==null?void 0:d.className,ue==null?void 0:ue.backdrop),ownerState:ie});return!M&&!F&&(!Ne||J)?null:O.jsx(C3,{ref:B,container:m,disablePortal:w,children:O.jsxs(me,_({},rt,{children:[!C&&u?O.jsx(Me,_({},Or)):null,O.jsx(dG,{disableEnforceFocus:x,disableAutoFocus:y,disableRestoreFocus:E,isEnabled:Y,open:F,children:S.cloneElement(h,de)})]}))})}),fJ=dJ,pJ=jt("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),RS=pJ,hJ=OK({createStyledComponent:Xe("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>Wt({props:e,name:"MuiStack"})}),mJ=hJ,gJ=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function iv(e){return`scale(${e}, ${e**2})`}const vJ={entering:{opacity:1,transform:iv(1)},entered:{opacity:1,transform:"none"}},s1=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),T3=S.forwardRef(function(t,r){const{addEndListener:n,appear:o=!0,children:i,easing:s,in:a,onEnter:l,onEntered:c,onEntering:u,onExit:d,onExited:f,onExiting:p,style:h,timeout:m="auto",TransitionComponent:b=f3}=t,v=ve(t,gJ),g=S.useRef(),y=S.useRef(),x=Km(),k=S.useRef(null),w=Ur(k,i.ref,r),E=j=>z=>{if(j){const q=k.current;z===void 0?j(q):j(q,z)}},T=E(u),C=E((j,z)=>{p3(j);const{duration:q,delay:A,easing:P}=gh({style:h,timeout:m,easing:s},{mode:"enter"});let B;m==="auto"?(B=x.transitions.getAutoHeightDuration(j.clientHeight),y.current=B):B=q,j.style.transition=[x.transitions.create("opacity",{duration:B,delay:A}),x.transitions.create("transform",{duration:s1?B:B*.666,delay:A,easing:P})].join(","),l&&l(j,z)}),M=E(c),N=E(p),F=E(j=>{const{duration:z,delay:q,easing:A}=gh({style:h,timeout:m,easing:s},{mode:"exit"});let P;m==="auto"?(P=x.transitions.getAutoHeightDuration(j.clientHeight),y.current=P):P=z,j.style.transition=[x.transitions.create("opacity",{duration:P,delay:q}),x.transitions.create("transform",{duration:s1?P:P*.666,delay:s1?q:q||P*.333,easing:A})].join(","),j.style.opacity=0,j.style.transform=iv(.75),d&&d(j)}),I=E(f),V=j=>{m==="auto"&&(g.current=setTimeout(j,y.current||0)),n&&n(k.current,j)};return S.useEffect(()=>()=>{clearTimeout(g.current)},[]),O.jsx(b,_({appear:o,in:a,nodeRef:k,onEnter:C,onEntered:M,onEntering:T,onExit:F,onExited:I,onExiting:N,addEndListener:V,timeout:m==="auto"?null:m},v,{children:(j,z)=>S.cloneElement(i,_({style:_({opacity:0,transform:iv(.75),visibility:j==="exited"&&!a?"hidden":void 0},vJ[j],h,i.props.style),ref:w},z))}))});T3.muiSupportAuto=!0;const sv=T3,yJ=S.createContext({}),yd=yJ;function bJ(e){return Vt("MuiList",e)}jt("MuiList",["root","padding","dense","subheader"]);const xJ=["children","className","component","dense","disablePadding","subheader"],kJ=e=>{const{classes:t,disablePadding:r,dense:n,subheader:o}=e;return rr({root:["root",!r&&"padding",n&&"dense",o&&"subheader"]},bJ,t)},wJ=Xe("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disablePadding&&t.padding,r.dense&&t.dense,r.subheader&&t.subheader]}})(({ownerState:e})=>_({listStyle:"none",margin:0,padding:0,position:"relative"},!e.disablePadding&&{paddingTop:8,paddingBottom:8},e.subheader&&{paddingTop:0})),SJ=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiList"}),{children:o,className:i,component:s="ul",dense:a=!1,disablePadding:l=!1,subheader:c}=n,u=ve(n,xJ),d=S.useMemo(()=>({dense:a}),[a]),f=_({},n,{component:s,dense:a,disablePadding:l}),p=kJ(f);return O.jsx(yd.Provider,{value:d,children:O.jsxs(wJ,_({as:s,className:Ce(p.root,i),ref:r,ownerState:f},u,{children:[c,o]}))})}),EJ=SJ;function CJ(e){return Vt("MuiListItemIcon",e)}const MJ=jt("MuiListItemIcon",["root","alignItemsFlexStart"]),PS=MJ,TJ=["className"],OJ=e=>{const{alignItems:t,classes:r}=e;return rr({root:["root",t==="flex-start"&&"alignItemsFlexStart"]},CJ,r)},_J=Xe("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.alignItems==="flex-start"&&t.alignItemsFlexStart]}})(({theme:e,ownerState:t})=>_({minWidth:56,color:(e.vars||e).palette.action.active,flexShrink:0,display:"inline-flex"},t.alignItems==="flex-start"&&{marginTop:8})),AJ=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiListItemIcon"}),{className:o}=n,i=ve(n,TJ),s=S.useContext(yd),a=_({},n,{alignItems:s.alignItems}),l=OJ(a);return O.jsx(_J,_({className:Ce(l.root,o),ownerState:a,ref:r},i))}),NJ=AJ;function RJ(e){return Vt("MuiListItemText",e)}const PJ=jt("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),yh=PJ,zJ=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],LJ=e=>{const{classes:t,inset:r,primary:n,secondary:o,dense:i}=e;return rr({root:["root",r&&"inset",i&&"dense",n&&o&&"multiline"],primary:["primary"],secondary:["secondary"]},RJ,t)},IJ=Xe("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${yh.primary}`]:t.primary},{[`& .${yh.secondary}`]:t.secondary},t.root,r.inset&&t.inset,r.primary&&r.secondary&&t.multiline,r.dense&&t.dense]}})(({ownerState:e})=>_({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},e.primary&&e.secondary&&{marginTop:6,marginBottom:6},e.inset&&{paddingLeft:56})),DJ=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiListItemText"}),{children:o,className:i,disableTypography:s=!1,inset:a=!1,primary:l,primaryTypographyProps:c,secondary:u,secondaryTypographyProps:d}=n,f=ve(n,zJ),{dense:p}=S.useContext(yd);let h=l??o,m=u;const b=_({},n,{disableTypography:s,inset:a,primary:!!h,secondary:!!m,dense:p}),v=LJ(b);return h!=null&&h.type!==cu&&!s&&(h=O.jsx(cu,_({variant:p?"body2":"body1",className:v.primary,component:c!=null&&c.variant?void 0:"span",display:"block"},c,{children:h}))),m!=null&&m.type!==cu&&!s&&(m=O.jsx(cu,_({variant:"body2",className:v.secondary,color:"text.secondary",display:"block"},d,{children:m}))),O.jsxs(IJ,_({className:Ce(v.root,i),ownerState:b,ref:r},f,{children:[h,m]}))}),$J=DJ,HJ=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function a1(e,t,r){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:r?null:e.firstChild}function zS(e,t,r){return e===t?r?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:r?null:e.lastChild}function O3(e,t){if(t===void 0)return!0;let r=e.innerText;return r===void 0&&(r=e.textContent),r=r.trim().toLowerCase(),r.length===0?!1:t.repeating?r[0]===t.keys[0]:r.indexOf(t.keys.join(""))===0}function Ac(e,t,r,n,o,i){let s=!1,a=o(e,t,t?r:!1);for(;a;){if(a===e.firstChild){if(s)return!1;s=!0}const l=n?!1:a.disabled||a.getAttribute("aria-disabled")==="true";if(!a.hasAttribute("tabindex")||!O3(a,i)||l)a=o(e,a,r);else return a.focus(),!0}return!1}const BJ=S.forwardRef(function(t,r){const{actions:n,autoFocus:o=!1,autoFocusItem:i=!1,children:s,className:a,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:d="selectedMenu"}=t,f=ve(t,HJ),p=S.useRef(null),h=S.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});ha(()=>{o&&p.current.focus()},[o]),S.useImperativeHandle(n,()=>({adjustStyleForScrollbar:(y,x)=>{const k=!p.current.style.width;if(y.clientHeight{const x=p.current,k=y.key,w=Br(x).activeElement;if(k==="ArrowDown")y.preventDefault(),Ac(x,w,c,l,a1);else if(k==="ArrowUp")y.preventDefault(),Ac(x,w,c,l,zS);else if(k==="Home")y.preventDefault(),Ac(x,null,c,l,a1);else if(k==="End")y.preventDefault(),Ac(x,null,c,l,zS);else if(k.length===1){const E=h.current,T=k.toLowerCase(),C=performance.now();E.keys.length>0&&(C-E.lastTime>500?(E.keys=[],E.repeating=!0,E.previousKeyMatched=!0):E.repeating&&T!==E.keys[0]&&(E.repeating=!1)),E.lastTime=C,E.keys.push(T);const M=w&&!E.repeating&&O3(w,E);E.previousKeyMatched&&(M||Ac(x,w,!1,l,a1,E))?y.preventDefault():E.previousKeyMatched=!1}u&&u(y)},b=Ur(p,r);let v=-1;S.Children.forEach(s,(y,x)=>{if(!S.isValidElement(y)){v===x&&(v+=1,v>=s.length&&(v=-1));return}y.props.disabled||(d==="selectedMenu"&&y.props.selected||v===-1)&&(v=x),v===x&&(y.props.disabled||y.props.muiSkipListHighlight||y.type.muiSkipListHighlight)&&(v+=1,v>=s.length&&(v=-1))});const g=S.Children.map(s,(y,x)=>{if(x===v){const k={};return i&&(k.autoFocus=!0),y.props.tabIndex===void 0&&d==="selectedMenu"&&(k.tabIndex=0),S.cloneElement(y,k)}return y});return O.jsx(EJ,_({role:"menu",ref:b,className:a,onKeyDown:m,tabIndex:o?0:-1},f,{children:g}))}),FJ=BJ;function VJ(e){return Vt("MuiPopover",e)}jt("MuiPopover",["root","paper"]);const jJ=["onEntering"],UJ=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],WJ=["slotProps"];function LS(e,t){let r=0;return typeof t=="number"?r=t:t==="center"?r=e.height/2:t==="bottom"&&(r=e.height),r}function IS(e,t){let r=0;return typeof t=="number"?r=t:t==="center"?r=e.width/2:t==="right"&&(r=e.width),r}function DS(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function l1(e){return typeof e=="function"?e():e}const KJ=e=>{const{classes:t}=e;return rr({root:["root"],paper:["paper"]},VJ,t)},qJ=Xe(fJ,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),_3=Xe(yq,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),GJ=S.forwardRef(function(t,r){var n,o,i;const s=Wt({props:t,name:"MuiPopover"}),{action:a,anchorEl:l,anchorOrigin:c={vertical:"top",horizontal:"left"},anchorPosition:u,anchorReference:d="anchorEl",children:f,className:p,container:h,elevation:m=8,marginThreshold:b=16,open:v,PaperProps:g={},slots:y,slotProps:x,transformOrigin:k={vertical:"top",horizontal:"left"},TransitionComponent:w=sv,transitionDuration:E="auto",TransitionProps:{onEntering:T}={},disableScrollLock:C=!1}=s,M=ve(s.TransitionProps,jJ),N=ve(s,UJ),F=(n=x==null?void 0:x.paper)!=null?n:g,I=S.useRef(),V=Ur(I,F.ref),j=_({},s,{anchorOrigin:c,anchorReference:d,elevation:m,marginThreshold:b,externalPaperSlotProps:F,transformOrigin:k,TransitionComponent:w,transitionDuration:E,TransitionProps:M}),z=KJ(j),q=S.useCallback(()=>{if(d==="anchorPosition")return u;const he=l1(l),Ke=(he&&he.nodeType===1?he:Br(I.current).body).getBoundingClientRect();return{top:Ke.top+LS(Ke,c.vertical),left:Ke.left+IS(Ke,c.horizontal)}},[l,c.horizontal,c.vertical,u,d]),A=S.useCallback(he=>({vertical:LS(he,k.vertical),horizontal:IS(he,k.horizontal)}),[k.horizontal,k.vertical]),P=S.useCallback(he=>{const De={width:he.offsetWidth,height:he.offsetHeight},Ke=A(De);if(d==="none")return{top:null,left:null,transformOrigin:DS(Ke)};const Fn=q();let Gr=Fn.top-Ke.vertical,nr=Fn.left-Ke.horizontal;const zo=Gr+De.height,Pt=nr+De.width,Yr=fd(l1(l)),vn=Yr.innerHeight-b,Vn=Yr.innerWidth-b;if(b!==null&&Grvn){const Qe=zo-vn;Gr-=Qe,Ke.vertical+=Qe}if(b!==null&&nrVn){const Qe=Pt-Vn;nr-=Qe,Ke.horizontal+=Qe}return{top:`${Math.round(Gr)}px`,left:`${Math.round(nr)}px`,transformOrigin:DS(Ke)}},[l,d,q,A,b]),[B,Y]=S.useState(v),J=S.useCallback(()=>{const he=I.current;if(!he)return;const De=P(he);De.top!==null&&(he.style.top=De.top),De.left!==null&&(he.style.left=De.left),he.style.transformOrigin=De.transformOrigin,Y(!0)},[P]);S.useEffect(()=>(C&&window.addEventListener("scroll",J),()=>window.removeEventListener("scroll",J)),[l,C,J]);const Ne=(he,De)=>{T&&T(he,De),J()},ie=()=>{Y(!1)};S.useEffect(()=>{v&&J()}),S.useImperativeHandle(a,()=>v?{updatePosition:()=>{J()}}:null,[v,J]),S.useEffect(()=>{if(!v)return;const he=zj(()=>{J()}),De=fd(l);return De.addEventListener("resize",he),()=>{he.clear(),De.removeEventListener("resize",he)}},[l,v,J]);let ue=E;E==="auto"&&!w.muiSupportAuto&&(ue=void 0);const de=h||(l?Br(l1(l)).body:void 0),me=(o=y==null?void 0:y.root)!=null?o:qJ,Me=(i=y==null?void 0:y.paper)!=null?i:_3,Se=si({elementType:Me,externalSlotProps:_({},F,{style:B?F.style:_({},F.style,{opacity:0})}),additionalProps:{elevation:m,ref:V},ownerState:j,className:Ce(z.paper,F==null?void 0:F.className)}),ft=si({elementType:me,externalSlotProps:(x==null?void 0:x.root)||{},externalForwardedProps:N,additionalProps:{ref:r,slotProps:{backdrop:{invisible:!0}},container:de,open:v},ownerState:j,className:Ce(z.root,p)}),{slotProps:rt}=ft,Or=ve(ft,WJ);return O.jsx(me,_({},Or,!h3(me)&&{slotProps:rt,disableScrollLock:C},{children:O.jsx(w,_({appear:!0,in:v,onEntering:Ne,onExited:ie,timeout:ue},M,{children:O.jsx(Me,_({},Se,{children:f}))}))}))}),YJ=GJ;function JJ(e){return Vt("MuiMenu",e)}jt("MuiMenu",["root","paper","list"]);const XJ=["onEntering"],QJ=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],ZJ={vertical:"top",horizontal:"right"},eX={vertical:"top",horizontal:"left"},tX=e=>{const{classes:t}=e;return rr({root:["root"],paper:["paper"],list:["list"]},JJ,t)},rX=Xe(YJ,{shouldForwardProp:e=>Sb(e)||e==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),nX=Xe(_3,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),oX=Xe(FJ,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),iX=S.forwardRef(function(t,r){var n,o;const i=Wt({props:t,name:"MuiMenu"}),{autoFocus:s=!0,children:a,className:l,disableAutoFocusItem:c=!1,MenuListProps:u={},onClose:d,open:f,PaperProps:p={},PopoverClasses:h,transitionDuration:m="auto",TransitionProps:{onEntering:b}={},variant:v="selectedMenu",slots:g={},slotProps:y={}}=i,x=ve(i.TransitionProps,XJ),k=ve(i,QJ),w=Km(),E=w.direction==="rtl",T=_({},i,{autoFocus:s,disableAutoFocusItem:c,MenuListProps:u,onEntering:b,PaperProps:p,transitionDuration:m,TransitionProps:x,variant:v}),C=tX(T),M=s&&!c&&f,N=S.useRef(null),F=(P,B)=>{N.current&&N.current.adjustStyleForScrollbar(P,w),b&&b(P,B)},I=P=>{P.key==="Tab"&&(P.preventDefault(),d&&d(P,"tabKeyDown"))};let V=-1;S.Children.map(a,(P,B)=>{S.isValidElement(P)&&(P.props.disabled||(v==="selectedMenu"&&P.props.selected||V===-1)&&(V=B))});const j=(n=g.paper)!=null?n:nX,z=(o=y.paper)!=null?o:p,q=si({elementType:g.root,externalSlotProps:y.root,ownerState:T,className:[C.root,l]}),A=si({elementType:j,externalSlotProps:z,ownerState:T,className:C.paper});return O.jsx(rX,_({onClose:d,anchorOrigin:{vertical:"bottom",horizontal:E?"right":"left"},transformOrigin:E?ZJ:eX,slots:{paper:j,root:g.root},slotProps:{root:q,paper:A},open:f,ref:r,transitionDuration:m,TransitionProps:_({onEntering:F},x),ownerState:T},k,{classes:h,children:O.jsx(oX,_({onKeyDown:I,actions:N,autoFocus:s&&(V===-1||c),autoFocusItem:M,variant:v},u,{className:Ce(C.list,u.className),children:a}))}))}),sX=iX;function aX(e){return Vt("MuiMenuItem",e)}const lX=jt("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),Nc=lX,cX=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],uX=(e,t)=>{const{ownerState:r}=e;return[t.root,r.dense&&t.dense,r.divider&&t.divider,!r.disableGutters&&t.gutters]},dX=e=>{const{disabled:t,dense:r,divider:n,disableGutters:o,selected:i,classes:s}=e,l=rr({root:["root",r&&"dense",t&&"disabled",!o&&"gutters",n&&"divider",i&&"selected"]},aX,s);return _({},s,l)},fX=Xe(Mb,{shouldForwardProp:e=>Sb(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:uX})(({theme:e,ownerState:t})=>_({},e.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Nc.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${Nc.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${Nc.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${Nc.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Nc.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${RS.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${RS.inset}`]:{marginLeft:52},[`& .${yh.root}`]:{marginTop:0,marginBottom:0},[`& .${yh.inset}`]:{paddingLeft:36},[`& .${PS.root}`]:{minWidth:36}},!t.dense&&{[e.breakpoints.up("sm")]:{minHeight:"auto"}},t.dense&&_({minHeight:32,paddingTop:4,paddingBottom:4},e.typography.body2,{[`& .${PS.root} svg`]:{fontSize:"1.25rem"}}))),pX=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiMenuItem"}),{autoFocus:o=!1,component:i="li",dense:s=!1,divider:a=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:d,className:f}=n,p=ve(n,cX),h=S.useContext(yd),m=S.useMemo(()=>({dense:s||h.dense||!1,disableGutters:l}),[h.dense,s,l]),b=S.useRef(null);ha(()=>{o&&b.current&&b.current.focus()},[o]);const v=_({},n,{dense:m.dense,divider:a,disableGutters:l}),g=dX(n),y=Ur(b,r);let x;return n.disabled||(x=d!==void 0?d:-1),O.jsx(yd.Provider,{value:m,children:O.jsx(fX,_({ref:y,role:u,tabIndex:x,component:i,focusVisibleClassName:Ce(g.focusVisible,c),className:Ce(g.root,f)},p,{ownerState:v,classes:g}))})}),hX=pX;function mX(e){return Vt("MuiTooltip",e)}const gX=jt("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),Hi=gX,vX=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","slotProps","slots","title","TransitionComponent","TransitionProps"];function yX(e){return Math.round(e*1e5)/1e5}const bX=e=>{const{classes:t,disableInteractive:r,arrow:n,touch:o,placement:i}=e,s={popper:["popper",!r&&"popperInteractive",n&&"popperArrow"],tooltip:["tooltip",n&&"tooltipArrow",o&&"touch",`tooltipPlacement${Fe(i.split("-")[0])}`],arrow:["arrow"]};return rr(s,mX,t)},xX=Xe(zb,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.popper,!r.disableInteractive&&t.popperInteractive,r.arrow&&t.popperArrow,!r.open&&t.popperClose]}})(({theme:e,ownerState:t,open:r})=>_({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none"},!t.disableInteractive&&{pointerEvents:"auto"},!r&&{pointerEvents:"none"},t.arrow&&{[`&[data-popper-placement*="bottom"] .${Hi.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Hi.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Hi.arrow}`]:_({},t.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}}),[`&[data-popper-placement*="left"] .${Hi.arrow}`]:_({},t.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})),kX=Xe("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.tooltip,r.touch&&t.touch,r.arrow&&t.tooltipArrow,t[`tooltipPlacement${Fe(r.placement.split("-")[0])}`]]}})(({theme:e,ownerState:t})=>_({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:Lr(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},t.arrow&&{position:"relative",margin:0},t.touch&&{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${yX(16/14)}em`,fontWeight:e.typography.fontWeightRegular},{[`.${Hi.popper}[data-popper-placement*="left"] &`]:_({transformOrigin:"right center"},t.isRtl?_({marginLeft:"14px"},t.touch&&{marginLeft:"24px"}):_({marginRight:"14px"},t.touch&&{marginRight:"24px"})),[`.${Hi.popper}[data-popper-placement*="right"] &`]:_({transformOrigin:"left center"},t.isRtl?_({marginRight:"14px"},t.touch&&{marginRight:"24px"}):_({marginLeft:"14px"},t.touch&&{marginLeft:"24px"})),[`.${Hi.popper}[data-popper-placement*="top"] &`]:_({transformOrigin:"center bottom",marginBottom:"14px"},t.touch&&{marginBottom:"24px"}),[`.${Hi.popper}[data-popper-placement*="bottom"] &`]:_({transformOrigin:"center top",marginTop:"14px"},t.touch&&{marginTop:"24px"})})),wX=Xe("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:Lr(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}));let Mf=!1,c1=null,Rc={x:0,y:0};function Tf(e,t){return r=>{t&&t(r),e(r)}}const SX=S.forwardRef(function(t,r){var n,o,i,s,a,l,c,u,d,f,p,h,m,b,v,g,y,x,k;const w=Wt({props:t,name:"MuiTooltip"}),{arrow:E=!1,children:T,components:C={},componentsProps:M={},describeChild:N=!1,disableFocusListener:F=!1,disableHoverListener:I=!1,disableInteractive:V=!1,disableTouchListener:j=!1,enterDelay:z=100,enterNextDelay:q=0,enterTouchDelay:A=700,followCursor:P=!1,id:B,leaveDelay:Y=0,leaveTouchDelay:J=1500,onClose:Ne,onOpen:ie,open:ue,placement:de="bottom",PopperComponent:me,PopperProps:Me={},slotProps:Se={},slots:ft={},title:rt,TransitionComponent:Or=sv,TransitionProps:he}=w,De=ve(w,vX),Ke=S.isValidElement(T)?T:O.jsx("span",{children:T}),Fn=Km(),Gr=Fn.direction==="rtl",[nr,zo]=S.useState(),[Pt,Yr]=S.useState(null),vn=S.useRef(!1),Vn=V||P,Qe=S.useRef(),Jr=S.useRef(),yn=S.useRef(),mi=S.useRef(),[Oa,fe]=$j({controlled:ue,default:!1,name:"Tooltip",state:"open"});let bn=Oa;const fc=Dj(B),gi=S.useRef(),pc=S.useCallback(()=>{gi.current!==void 0&&(document.body.style.WebkitUserSelect=gi.current,gi.current=void 0),clearTimeout(mi.current)},[]);S.useEffect(()=>()=>{clearTimeout(Qe.current),clearTimeout(Jr.current),clearTimeout(yn.current),pc()},[pc]);const Nx=ke=>{clearTimeout(c1),Mf=!0,fe(!0),ie&&!bn&&ie(ke)},ef=Ks(ke=>{clearTimeout(c1),c1=setTimeout(()=>{Mf=!1},800+Y),fe(!1),Ne&&bn&&Ne(ke),clearTimeout(Qe.current),Qe.current=setTimeout(()=>{vn.current=!1},Fn.transitions.duration.shortest)}),Zm=ke=>{vn.current&&ke.type!=="touchstart"||(nr&&nr.removeAttribute("title"),clearTimeout(Jr.current),clearTimeout(yn.current),z||Mf&&q?Jr.current=setTimeout(()=>{Nx(ke)},Mf?q:z):Nx(ke))},Rx=ke=>{clearTimeout(Jr.current),clearTimeout(yn.current),yn.current=setTimeout(()=>{ef(ke)},Y)},{isFocusVisibleRef:Px,onBlur:GO,onFocus:YO,ref:JO}=PT(),[,zx]=S.useState(!1),Lx=ke=>{GO(ke),Px.current===!1&&(zx(!1),Rx(ke))},Ix=ke=>{nr||zo(ke.currentTarget),YO(ke),Px.current===!0&&(zx(!0),Zm(ke))},Dx=ke=>{vn.current=!0;const Xr=Ke.props;Xr.onTouchStart&&Xr.onTouchStart(ke)},$x=Zm,Hx=Rx,XO=ke=>{Dx(ke),clearTimeout(yn.current),clearTimeout(Qe.current),pc(),gi.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",mi.current=setTimeout(()=>{document.body.style.WebkitUserSelect=gi.current,Zm(ke)},A)},QO=ke=>{Ke.props.onTouchEnd&&Ke.props.onTouchEnd(ke),pc(),clearTimeout(yn.current),yn.current=setTimeout(()=>{ef(ke)},J)};S.useEffect(()=>{if(!bn)return;function ke(Xr){(Xr.key==="Escape"||Xr.key==="Esc")&&ef(Xr)}return document.addEventListener("keydown",ke),()=>{document.removeEventListener("keydown",ke)}},[ef,bn]);const ZO=Ur(Ke.ref,JO,zo,r);!rt&&rt!==0&&(bn=!1);const eg=S.useRef(),e_=ke=>{const Xr=Ke.props;Xr.onMouseMove&&Xr.onMouseMove(ke),Rc={x:ke.clientX,y:ke.clientY},eg.current&&eg.current.update()},hc={},tg=typeof rt=="string";N?(hc.title=!bn&&tg&&!I?rt:null,hc["aria-describedby"]=bn?fc:null):(hc["aria-label"]=tg?rt:null,hc["aria-labelledby"]=bn&&!tg?fc:null);const jn=_({},hc,De,Ke.props,{className:Ce(De.className,Ke.props.className),onTouchStart:Dx,ref:ZO},P?{onMouseMove:e_}:{}),mc={};j||(jn.onTouchStart=XO,jn.onTouchEnd=QO),I||(jn.onMouseOver=Tf($x,jn.onMouseOver),jn.onMouseLeave=Tf(Hx,jn.onMouseLeave),Vn||(mc.onMouseOver=$x,mc.onMouseLeave=Hx)),F||(jn.onFocus=Tf(Ix,jn.onFocus),jn.onBlur=Tf(Lx,jn.onBlur),Vn||(mc.onFocus=Ix,mc.onBlur=Lx));const t_=S.useMemo(()=>{var ke;let Xr=[{name:"arrow",enabled:!!Pt,options:{element:Pt,padding:4}}];return(ke=Me.popperOptions)!=null&&ke.modifiers&&(Xr=Xr.concat(Me.popperOptions.modifiers)),_({},Me.popperOptions,{modifiers:Xr})},[Pt,Me]),gc=_({},w,{isRtl:Gr,arrow:E,disableInteractive:Vn,placement:de,PopperComponentProp:me,touch:vn.current}),rg=bX(gc),Bx=(n=(o=ft.popper)!=null?o:C.Popper)!=null?n:xX,Fx=(i=(s=(a=ft.transition)!=null?a:C.Transition)!=null?s:Or)!=null?i:sv,Vx=(l=(c=ft.tooltip)!=null?c:C.Tooltip)!=null?l:kX,jx=(u=(d=ft.arrow)!=null?d:C.Arrow)!=null?u:wX,r_=uu(Bx,_({},Me,(f=Se.popper)!=null?f:M.popper,{className:Ce(rg.popper,Me==null?void 0:Me.className,(p=(h=Se.popper)!=null?h:M.popper)==null?void 0:p.className)}),gc),n_=uu(Fx,_({},he,(m=Se.transition)!=null?m:M.transition),gc),o_=uu(Vx,_({},(b=Se.tooltip)!=null?b:M.tooltip,{className:Ce(rg.tooltip,(v=(g=Se.tooltip)!=null?g:M.tooltip)==null?void 0:v.className)}),gc),i_=uu(jx,_({},(y=Se.arrow)!=null?y:M.arrow,{className:Ce(rg.arrow,(x=(k=Se.arrow)!=null?k:M.arrow)==null?void 0:x.className)}),gc);return O.jsxs(S.Fragment,{children:[S.cloneElement(Ke,jn),O.jsx(Bx,_({as:me??zb,placement:de,anchorEl:P?{getBoundingClientRect:()=>({top:Rc.y,left:Rc.x,right:Rc.x,bottom:Rc.y,width:0,height:0})}:nr,popperRef:eg,open:nr?bn:!1,id:fc,transition:!0},mc,r_,{popperOptions:t_,children:({TransitionProps:ke})=>O.jsx(Fx,_({timeout:Fn.transitions.duration.shorter},ke,n_,{children:O.jsxs(Vx,_({},o_,{children:[rt,E?O.jsx(jx,_({},i_,{ref:Yr})):null]}))}))}))]})}),A3=SX;function EX(e){return Vt("MuiToggleButton",e)}const CX=jt("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge"]),$S=CX,MX=["children","className","color","disabled","disableFocusRipple","fullWidth","onChange","onClick","selected","size","value"],TX=e=>{const{classes:t,fullWidth:r,selected:n,disabled:o,size:i,color:s}=e,a={root:["root",n&&"selected",o&&"disabled",r&&"fullWidth",`size${Fe(i)}`,s]};return rr(a,EX,t)},OX=Xe(Mb,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`size${Fe(r.size)}`]]}})(({theme:e,ownerState:t})=>{let r=t.color==="standard"?e.palette.text.primary:e.palette[t.color].main,n;return e.vars&&(r=t.color==="standard"?e.vars.palette.text.primary:e.vars.palette[t.color].main,n=t.color==="standard"?e.vars.palette.text.primaryChannel:e.vars.palette[t.color].mainChannel),_({},e.typography.button,{borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active},t.fullWidth&&{width:"100%"},{[`&.${$S.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Lr(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${$S.selected}`]:{color:r,backgroundColor:e.vars?`rgba(${n} / ${e.vars.palette.action.selectedOpacity})`:Lr(r,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${n} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Lr(r,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${n} / ${e.vars.palette.action.selectedOpacity})`:Lr(r,e.palette.action.selectedOpacity)}}}},t.size==="small"&&{padding:7,fontSize:e.typography.pxToRem(13)},t.size==="large"&&{padding:15,fontSize:e.typography.pxToRem(15)})}),_X=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiToggleButton"}),{children:o,className:i,color:s="standard",disabled:a=!1,disableFocusRipple:l=!1,fullWidth:c=!1,onChange:u,onClick:d,selected:f,size:p="medium",value:h}=n,m=ve(n,MX),b=_({},n,{color:s,disabled:a,disableFocusRipple:l,fullWidth:c,size:p}),v=TX(b),g=y=>{d&&(d(y,h),y.defaultPrevented)||u&&u(y,h)};return O.jsx(OX,_({className:Ce(v.root,i),disabled:a,focusRipple:!l,ref:r,onClick:g,onChange:u,value:h,ownerState:b,"aria-pressed":f},m,{children:o}))}),AX=_X;var NX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 15v2c0 1.054.95 2 2 2h3v2H7a4 4 0 0 1-4-4v-2h2zm13-5l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16 10h2zm-1 2.885L15.753 16h2.492L17 12.885zM3 3h6a3 3 0 0 1 2.235 5A3 3 0 0 1 9 13H3V3zm6 6H5v2h4a1 1 0 0 0 0-2zm8-6a4 4 0 0 1 4 4v2h-2V7a2 2 0 0 0-2-2h-3V3h3zM9 5H5v2h4a1 1 0 1 0 0-2z"}}],RX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"}}],PX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"}}],zX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0zm-8.66 16h15.588L12 5.5 4.206 19zM11 16h2v2h-2v-2zm0-7h2v5h-2V9z"}}],LX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 19h18v2H3v-2zm5-6h3l-4 4-4-4h3V3h2v10zm10 0h3l-4 4-4-4h3V3h2v10z"}}],IX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm2 15h14v2H5v-2zm-2-5h18v2H3v-2zm2-5h14v2H5V9z"}}],DX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h18v2H3v-2zm0-5h18v2H3v-2zm0-5h18v2H3V9z"}}],$X=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h14v2H3v-2zm0-5h18v2H3v-2zm0-5h14v2H3V9z"}}],HX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm4 15h14v2H7v-2zm-4-5h18v2H3v-2zm4-5h14v2H7V9z"}}],BX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 3h18v2H3V3zm5 8v10H6V11H3l4-4 4 4H8zm10 0v10h-2V11h-3l4-4 4 4h-3z"}}],FX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 11h18v2H3v-2zm15 7v3h-2v-3h-3l4-4 4 4h-3zM8 18v3H6v-3H3l4-4 4 4H8zM18 6h3l-4 4-4-4h3V3h2v3zM8 6h3l-4 4-4-4h3V3h2v3z"}}],VX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M6.75 2.5A4.25 4.25 0 0 1 11 6.75V11H6.75a4.25 4.25 0 1 1 0-8.5zM9 9V6.75A2.25 2.25 0 1 0 6.75 9H9zm-2.25 4H11v4.25A4.25 4.25 0 1 1 6.75 13zm0 2A2.25 2.25 0 1 0 9 17.25V15H6.75zm10.5-12.5a4.25 4.25 0 1 1 0 8.5H13V6.75a4.25 4.25 0 0 1 4.25-4.25zm0 6.5A2.25 2.25 0 1 0 15 6.75V9h2.25zM13 13h4.25A4.25 4.25 0 1 1 13 17.25V13zm2 2v2.25A2.25 2.25 0 1 0 17.25 15H15z"}}],jX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 16l-6-6h12z"}}],UX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 7v4L2 6l6-5v4h5a8 8 0 1 1 0 16H4v-2h9a6 6 0 1 0 0-12H8z"}}],WX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 7h-5a6 6 0 1 0 0 12h9v2h-9a8 8 0 1 1 0-16h5V1l6 5-6 5V7z"}}],KX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 12l6-6v12z"}}],qX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 12l-6 6V6z"}}],GX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 8l6 6H6z"}}],YX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 3v7.267l6.294-3.633 1 1.732-6.293 3.633 6.293 3.635-1 1.732L13 13.732V21h-2v-7.268l-6.294 3.634-1-1.732L9.999 12 3.706 8.366l1-1.732L11 10.267V3z"}}],JX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14.828 7.757l-5.656 5.657a1 1 0 1 0 1.414 1.414l5.657-5.656A3 3 0 1 0 12 4.929l-5.657 5.657a5 5 0 1 0 7.071 7.07L19.071 12l1.414 1.414-5.657 5.657a7 7 0 1 1-9.9-9.9l5.658-5.656a5 5 0 0 1 7.07 7.07L12 16.244A3 3 0 1 1 7.757 12l5.657-5.657 1.414 1.414z"}}],XX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 11h4.5a2.5 2.5 0 1 0 0-5H8v5zm10 4.5a4.5 4.5 0 0 1-4.5 4.5H6V4h6.5a4.5 4.5 0 0 1 3.256 7.606A4.498 4.498 0 0 1 18 15.5zM8 13v5h5.5a2.5 2.5 0 1 0 0-5H8z"}}],QX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12 2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3zm16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5z"}}],ZX=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M14 3c.552 0 1 .448 1 1v5h5c.552 0 1 .448 1 1v10c0 .552-.448 1-1 1H10c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h10zm-1 2H5v8h8V5z"}}],eQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M11 3c.552 0 1 .448 1 1v2h5c.552 0 1 .448 1 1v5h2c.552 0 1 .448 1 1v7c0 .552-.448 1-1 1h-7c-.552 0-1-.448-1-1v-2H7c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h7zm5 5H8v8h8V8z"}}],tQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 3v2H4v13.385L5.763 17H20v-7h2v8a1 1 0 0 1-1 1H6.455L2 22.5V4a1 1 0 0 1 1-1h11zm5 0V0h2v3h3v2h-3v3h-2V5h-3V3h3z"}}],rQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-.997-4L6.76 11.757l1.414-1.414 2.829 2.829 5.656-5.657 1.415 1.414L11.003 16z"}}],nQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M7 7V3a1 1 0 0 1 1-1h13a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-4v3.993c0 .556-.449 1.007-1.007 1.007H3.007A1.006 1.006 0 0 1 2 20.993l.003-12.986C2.003 7.451 2.452 7 3.01 7H7zm2 0h6.993C16.549 7 17 7.449 17 8.007V15h3V4H9v3zm6 2H4.003L4 20h11V9zm-6.497 9l-3.536-3.536 1.414-1.414 2.122 2.122 4.242-4.243 1.414 1.414L8.503 18z"}}],oQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M6 4v4h12V4h2.007c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.994.994 0 0 1 3 21.007V4.993C3 4.445 3.445 4 3.993 4H6zm2-2h8v4H8V2z"}}],iQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 4V2h10v2h3.007c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.994.994 0 0 1 3 21.007V4.993C3 4.445 3.445 4 3.993 4H7zm0 2H5v14h14V6h-2v2H7V6zm2-2v2h6V4H9z"}}],sQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm0-9.414l2.828-2.829 1.415 1.415L13.414 12l2.829 2.828-1.415 1.415L12 13.414l-2.828 2.829-1.415-1.415L10.586 12 7.757 9.172l1.415-1.415L12 10.586z"}}],aQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"}}],lQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"}}],cQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M23 12l-7.071 7.071-1.414-1.414L20.172 12l-5.657-5.657 1.414-1.414L23 12zM3.828 12l5.657 5.657-1.414 1.414L1 12l7.071-7.071 1.414 1.414L3.828 12z"}}],uQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16.95 8.464l1.414-1.414 4.95 4.95-4.95 4.95-1.414-1.414L20.485 12 16.95 8.464zm-9.9 0L3.515 12l3.535 3.536-1.414 1.414L.686 12l4.95-4.95L7.05 8.464z"}}],dQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 6h5v2h-2v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V8H2V6h5V3a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v3zm-8 5v6h2v-6H9zm4 0v6h2v-6h-2zM9 4v2h6V4H9z"}}],fQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 6h5v2h-2v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V8H2V6h5V3a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v3zm1 2H6v12h12V8zm-9 3h2v6H9v-6zm4 0h2v6h-2v-6zM9 4v2h6V4H9z"}}],pQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M12 3c.552 0 1 .448 1 1v8c.835-.628 1.874-1 3-1 2.761 0 5 2.239 5 5s-2.239 5-5 5c-1.032 0-1.99-.313-2.787-.848L13 20c0 .552-.448 1-1 1H6c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zm-1 2H7v14h4V5zm8 10h-6v2h6v-2z"}}],hQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 5c.552 0 1 .448 1 1v6c0 .552-.448 1-1 1 .628.835 1 1.874 1 3 0 2.761-2.239 5-5 5s-5-2.239-5-5c0-1.126.372-2.165 1-3H4c-.552 0-1-.448-1-1V6c0-.552.448-1 1-1h16zm-7 10v2h6v-2h-6zm6-8H5v4h14V7z"}}],mQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4.583 17.321C3.553 16.227 3 15 3 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 0 1-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179zm10 0C13.553 16.227 13 15 13 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 0 1-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179z"}}],gQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19.417 6.679C20.447 7.773 21 9 21 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311-1.804-.167-3.226-1.648-3.226-3.489a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179zm-10 0C10.447 7.773 11 9 11 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311C4.591 12.322 3.17 10.841 3.17 9a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179z"}}],vQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 19h16v-7h2v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-8h2v7zM14 9h5l-7 7-7-7h5V3h4v6z"}}],yQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M16 13l6.964 4.062-2.973.85 2.125 3.681-1.732 1-2.125-3.68-2.223 2.15L16 13zm-2-7h2v2h5a1 1 0 0 1 1 1v4h-2v-3H10v10h4v2H9a1 1 0 0 1-1-1v-5H6v-2h2V9a1 1 0 0 1 1-1h5V6zM4 14v2H2v-2h2zm0-4v2H2v-2h2zm0-4v2H2V6h2zm0-4v2H2V2h2zm4 0v2H6V2h2zm4 0v2h-2V2h2zm4 0v2h-2V2h2z"}}],bQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 19a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm-5.5 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm11 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zM13 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.621 6.302 14.685 14.685 0 0 0 5.327 3.042l-.536 1.93A16.685 16.685 0 0 1 12 13.726a16.696 16.696 0 0 1-6.202 3.547l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042 18.077 18.077 0 0 1-2.822-4.3h2.24A16.031 16.031 0 0 0 12 10.876a16.168 16.168 0 0 0 2.91-4.876L5 6V4h6V2h2z"}}],xQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 19a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm-5.5 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm11 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zM18 3v2H8v4h9v2H8v4h10v2H6V3h12z"}}],kQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 10h2v.757a4.5 4.5 0 0 1 7 3.743V20h-2v-5.5c0-1.43-1.175-2.5-2.5-2.5S16 13.07 16 14.5V20h-2V10zm-2-6v2H4v5h8v2H4v5h8v2H2V4h10z"}}],wQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-1-5h2v2h-2v-2zm0-8h2v6h-2V7z"}}],SQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6zm11-3v9l-3.794-3.793-5.999 6-1.414-1.414 5.999-6L12 3h9z"}}],EQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1.001 1.001 0 0 1 3 21l.003-14c0-.552.45-1 1.007-1H7zM5.003 8L5 20h10V8H5.003zM9 6h8v10h2V4H9v2z"}}],CQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M6 21.5c-1.933 0-3.5-1.567-3.5-3.5s1.567-3.5 3.5-3.5c1.585 0 2.924 1.054 3.355 2.5H15v-2h2V9.242L14.757 7H9V9H3V3h6v2h5.757L18 1.756 22.243 6 19 9.241V15L21 15v6h-6v-2H9.355c-.43 1.446-1.77 2.5-3.355 2.5zm0-5c-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5-.672-1.5-1.5-1.5zm13 .5h-2v2h2v-2zM18 4.586L16.586 6 18 7.414 19.414 6 18 4.586zM7 5H5v2h2V5z"}}],MQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15.246 14H8.754l-1.6 4H5l6-15h2l6 15h-2.154l-1.6-4zm-.8-2L12 5.885 9.554 12h4.892zM3 20h18v2H3v-2z"}}],TQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M10 6v15H8V6H2V4h14v2h-6zm8 8v7h-2v-7h-3v-2h8v2h-3z"}}],OQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11.246 15H4.754l-2 5H.6L7 4h2l6.4 16h-2.154l-2-5zm-.8-2L8 6.885 5.554 13h4.892zM21 12.535V12h2v8h-2v-.535a4 4 0 1 1 0-6.93zM19 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"}}],_Q=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12.651 14.065L11.605 20H9.574l1.35-7.661-7.41-7.41L4.93 3.515 20.485 19.07l-1.414 1.414-6.42-6.42zm-.878-6.535l.27-1.53h-1.8l-2-2H20v2h-5.927L13.5 9.257 11.773 7.53z"}}],AQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z"}}],NQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 3h2v6h-2V5h-4V3h4zM4 3h4v2H4v4H2V3h2zm16 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z"}}],RQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 18l7.68-6L5 6V4h14v2H8.263L16 12l-7.737 6H19v2H5v-2z"}}],PQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 1v4H4v14h16V3h1.008c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3H6V1h2zm4 7l4 4h-3v4h-2v-4H8l4-4zm6-7v4h-8V3h6V1h2z"}}],zQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M13 20h-2v-7H4v7H2V4h2v7h7V4h2v16zm8-12v12h-2v-9.796l-2 .536V8.67L19.5 8H21z"}}],LQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M4 4v7h7V4h2v16h-2v-7H4v7H2V4h2zm14.5 4c2.071 0 3.75 1.679 3.75 3.75 0 .857-.288 1.648-.772 2.28l-.148.18L18.034 18H22v2h-7v-1.556l4.82-5.546c.268-.307.43-.709.43-1.148 0-.966-.784-1.75-1.75-1.75-.918 0-1.671.707-1.744 1.606l-.006.144h-2C14.75 9.679 16.429 8 18.5 8z"}}],IQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M22 8l-.002 2-2.505 2.883c1.59.435 2.757 1.89 2.757 3.617 0 2.071-1.679 3.75-3.75 3.75-1.826 0-3.347-1.305-3.682-3.033l1.964-.382c.156.806.866 1.415 1.718 1.415.966 0 1.75-.784 1.75-1.75s-.784-1.75-1.75-1.75c-.286 0-.556.069-.794.19l-1.307-1.547L19.35 10H15V8h7zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2z"}}],DQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M13 20h-2v-7H4v7H2V4h2v7h7V4h2v16zm9-12v8h1.5v2H22v2h-2v-2h-5.5v-1.34l5-8.66H22zm-2 3.133L17.19 16H20v-4.867z"}}],$Q=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M22 8v2h-4.323l-.464 2.636c.33-.089.678-.136 1.037-.136 2.21 0 4 1.79 4 4s-1.79 4-4 4c-1.827 0-3.367-1.224-3.846-2.897l1.923-.551c.24.836 1.01 1.448 1.923 1.448 1.105 0 2-.895 2-2s-.895-2-2-2c-.63 0-1.193.292-1.56.748l-1.81-.904L16 8h6zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2z"}}],HQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M21.097 8l-2.598 4.5c2.21 0 4.001 1.79 4.001 4s-1.79 4-4 4-4-1.79-4-4c0-.736.199-1.426.546-2.019L18.788 8h2.309zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2zm14.5 10.5c-1.105 0-2 .895-2 2s.895 2 2 2 2-.895 2-2-.895-2-2-2z"}}],BQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7.784 14l.42-4H4V8h4.415l.525-5h2.011l-.525 5h3.989l.525-5h2.011l-.525 5H20v2h-3.784l-.42 4H20v2h-4.415l-.525 5h-2.011l.525-5H9.585l-.525 5H7.049l.525-5H4v-2h3.784zm2.011 0h3.99l.42-4h-3.99l-.42 4z"}}],FQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 11V4h2v17h-2v-8H7v8H5V4h2v7z"}}],VQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 15v3h3v2h-3v3h-2v-3h-3v-2h3v-3h2zm.008-12c.548 0 .992.445.992.993V13h-2V5H4v13.999L14 9l3 3v2.829l-3-3L6.827 19H14v2H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016zM8 7a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"}}],jQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v1.757l-2 2V5H5v8.1l4-4 4.328 4.329-1.415 1.413L9 11.93l-4 3.999V19h10.533l.708.001 1.329-1.33L18.9 19h.1v-2.758l2-2V20c0 .552-.448 1-1 1H4c-.55 0-1-.45-1-1V4c0-.552.448-1 1-1h16zm1.778 4.808l1.414 1.414L15.414 17l-1.416-.002.002-1.412 7.778-7.778zM15.5 7c.828 0 1.5.672 1.5 1.5s-.672 1.5-1.5 1.5S14 9.328 14 8.5 14.672 7 15.5 7z"}}],UQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4.828 21l-.02.02-.021-.02H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H4.828zM20 15V5H4v14L14 9l6 6zm0 2.828l-6-6L6.828 19H20v-1.172zM8 11a2 2 0 1 1 0-4 2 2 0 0 1 0 4z"}}],WQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h18v2H3v-2zm8-5h10v2H11v-2zm0-5h10v2H11V9zm-8 3.5L7 9v7l-4-3.5z"}}],KQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h18v2H3v-2zm8-5h10v2H11v-2zm0-5h10v2H11V9zm-4 3.5L3 16V9l4 3.5z"}}],qQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM11 7h2v2h-2V7zm0 4h2v6h-2v-6z"}}],GQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 21v-2h3V5H8V3h8v2h-3v14h3v2H8zM18.05 7.05L23 12l-4.95 4.95-1.414-1.414L20.172 12l-3.536-3.536L18.05 7.05zm-12.1 0l1.414 1.414L3.828 12l3.536 3.536L5.95 16.95 1 12l4.95-4.95z"}}],YQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zm-1 2h-4v14h4V5zM6 7c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2H5v1.999L3 11v2l2-.001V15h2v-2.001L9 13v-2l-2-.001V9z"}}],JQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M10 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zM9 5H5v14h4V5zm9 2c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2h-2v1.999L15 11v2l2-.001V15h2v-2.001L21 13v-2l-2-.001V9z"}}],XQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M12 13c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2h-2v1.999L9 17v2l2-.001V21h2v-2.001L15 19v-2l-2-.001V15zm7-12c.552 0 1 .448 1 1v6c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zM5 5v4h14V5H5z"}}],QQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 13c.552 0 1 .448 1 1v6c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1v-6c0-.552.448-1 1-1h16zm-1 2H5v4h14v-4zM12 1c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2h-2v1.999L9 5v2l2-.001V9h2V6.999L15 7V5l-2-.001V3z"}}],ZQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 20H7v-2h2.927l2.116-12H9V4h8v2h-2.927l-2.116 12H15z"}}],eZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M11 5H5v14h6V5zm2 0v14h6V5h-6zM4 3h16a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"}}],tZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 4h10v2H11V4zM6 7v4H4V7H1l4-4 4 4H6zm0 10h3l-4 4-4-4h3v-4h2v4zm5 1h10v2H11v-2zm-2-7h12v2H9v-2z"}}],rZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.657 14.828l-1.414-1.414L17.657 12A4 4 0 1 0 12 6.343l-1.414 1.414-1.414-1.414 1.414-1.414a6 6 0 0 1 8.485 8.485l-1.414 1.414zm-2.829 2.829l-1.414 1.414a6 6 0 1 1-8.485-8.485l1.414-1.414 1.414 1.414L6.343 12A4 4 0 1 0 12 17.657l1.414-1.414 1.414 1.414zm0-9.9l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"}}],nZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.657 14.828l-1.414-1.414L17.657 12A4 4 0 1 0 12 6.343l-1.414 1.414-1.414-1.414 1.414-1.414a6 6 0 0 1 8.485 8.485l-1.414 1.414zm-2.829 2.829l-1.414 1.414a6 6 0 1 1-8.485-8.485l1.414-1.414 1.414 1.414L6.343 12A4 4 0 1 0 12 17.657l1.414-1.414 1.414 1.414zm0-9.9l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07zM5.775 2.293l1.932-.518L8.742 5.64l-1.931.518-1.036-3.864zm9.483 16.068l1.931-.518 1.036 3.864-1.932.518-1.035-3.864zM2.293 5.775l3.864 1.036-.518 1.931-3.864-1.035.518-1.932zm16.068 9.483l3.864 1.035-.518 1.932-3.864-1.036.518-1.931z"}}],oZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 17h5v2h-3v3h-2v-5zM7 7H2V5h3V2h2v5zm11.364 8.536L16.95 14.12l1.414-1.414a5 5 0 1 0-7.071-7.071L9.879 7.05 8.464 5.636 9.88 4.222a7 7 0 0 1 9.9 9.9l-1.415 1.414zm-2.828 2.828l-1.415 1.414a7 7 0 0 1-9.9-9.9l1.415-1.414L7.05 9.88l-1.414 1.414a5 5 0 1 0 7.071 7.071l1.414-1.414 1.415 1.414zm-.708-10.607l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"}}],iZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18.364 15.536L16.95 14.12l1.414-1.414a5 5 0 1 0-7.071-7.071L9.879 7.05 8.464 5.636 9.88 4.222a7 7 0 0 1 9.9 9.9l-1.415 1.414zm-2.828 2.828l-1.415 1.414a7 7 0 0 1-9.9-9.9l1.415-1.414L7.05 9.88l-1.414 1.414a5 5 0 1 0 7.071 7.071l1.414-1.414 1.415 1.414zm-.708-10.607l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"}}],sZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 4h10v2H11V4zm0 4h6v2h-6V8zm0 6h10v2H11v-2zm0 4h6v2h-6v-2zM3 4h6v6H3V4zm2 2v2h2V6H5zm-2 8h6v6H3v-6zm2 2v2h2v-2H5z"}}],aZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 4h13v2H8V4zm-5-.5h3v3H3v-3zm0 7h3v3H3v-3zm0 7h3v3H3v-3zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"}}],lZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 4h13v2H8V4zM5 3v3h1v1H3V6h1V4H3V3h2zM3 14v-2.5h2V11H3v-1h3v2.5H4v.5h2v1H3zm2 5.5H3v-1h2V18H3v-1h3v4H3v-1h2v-.5zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"}}],cZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 4h13v2H8V4zM4.5 6.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 6.9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"}}],uZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15.243 4.515l-6.738 6.737-.707 2.121-1.04 1.041 2.828 2.829 1.04-1.041 2.122-.707 6.737-6.738-4.242-4.242zm6.364 3.535a1 1 0 0 1 0 1.414l-7.779 7.779-2.12.707-1.415 1.414a1 1 0 0 1-1.414 0l-4.243-4.243a1 1 0 0 1 0-1.414l1.414-1.414.707-2.121 7.779-7.779a1 1 0 0 1 1.414 0l5.657 5.657zm-6.364-.707l1.414 1.414-4.95 4.95-1.414-1.414 4.95-4.95zM4.283 16.89l2.828 2.829-1.414 1.414-4.243-1.414 2.828-2.829z"}}],dZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm4 12.5v-4l2 2 2-2v4h2v-7h-2l-2 2-2-2H5v7h2zm11-3v-4h-2v4h-2l3 3 3-3h-2z"}}],fZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm1 2v14h16V5H4zm3 10.5H5v-7h2l2 2 2-2h2v7h-2v-4l-2 2-2-2v4zm11-3h2l-3 3-3-3h2v-4h2v4z"}}],pZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zm-9 2H5v5.999h2V9l3 3-3 3v-2H5v6h6v-2h2v2h6v-6h-2v2l-3-3 3-3v1.999h2V5h-6v2h-2V5zm2 8v2h-2v-2h2zm0-4v2h-2V9h2z"}}],hZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M21 20c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16c.552 0 1 .448 1 1v16zm-2-9V5h-5.999v2H15l-3 3-3-3h2V5H5v6h2v2H5v6h6v-2H9l3-3 3 3h-1.999v2H19v-6h-2v-2h2zm-8 2H9v-2h2v2zm4 0h-2v-2h2v2z"}}],mZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M18 3c1.657 0 3 1.343 3 3s-1.343 3-3 3h-3c-1.306 0-2.417-.834-2.829-2H11c-1.1 0-2 .9-2 2v.171c1.166.412 2 1.523 2 2.829 0 1.306-.834 2.417-2 2.829V15c0 1.1.9 2 2 2h1.17c.412-1.165 1.524-2 2.83-2h3c1.657 0 3 1.343 3 3s-1.343 3-3 3h-3c-1.306 0-2.417-.834-2.829-2H11c-2.21 0-4-1.79-4-4H5c-1.657 0-3-1.343-3-3s1.343-3 3-3h2c0-2.21 1.79-4 4-4h1.17c.412-1.165 1.524-2 2.83-2h3zm0 14h-3c-.552 0-1 .448-1 1s.448 1 1 1h3c.552 0 1-.448 1-1s-.448-1-1-1zM8 11H5c-.552 0-1 .448-1 1s.448 1 1 1h3c.552 0 1-.448 1-1s-.448-1-1-1zm10-6h-3c-.552 0-1 .448-1 1s.448 1 1 1h3c.552 0 1-.448 1-1s-.448-1-1-1z"}}],gZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm14 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-7 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}}],vZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M10 2c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1H8v2h5V9c0-.552.448-1 1-1h6c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1v-1H8v6h5v-1c0-.552.448-1 1-1h6c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1v-1H7c-.552 0-1-.448-1-1V8H4c-.552 0-1-.448-1-1V3c0-.552.448-1 1-1h6zm9 16h-4v2h4v-2zm0-8h-4v2h4v-2zM9 4H5v2h4V4z"}}],yZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 1.5c1.321 0 2.484.348 3.447.994.963.645 1.726 1.588 2.249 2.778.522 1.19.804 2.625.804 4.257v4.942c0 1.632-.282 3.068-.804 4.257-.523 1.19-1.286 2.133-2.25 2.778-.962.646-2.125.994-3.446.994-1.321 0-2.484-.348-3.447-.994-.963-.645-1.726-1.588-2.249-2.778-.522-1.19-.804-2.625-.804-4.257V9.529c0-1.632.282-3.068.804-4.257.523-1.19 1.286-2.133 2.25-2.778C9.515 1.848 10.678 1.5 12 1.5zm0 2c-.916 0-1.694.226-2.333.655-.637.427-1.158 1.07-1.532 1.92-.412.94-.635 2.108-.635 3.454v4.942c0 1.346.223 2.514.635 3.453.374.851.895 1.494 1.532 1.921.639.429 1.417.655 2.333.655.916 0 1.694-.226 2.333-.655.637-.427 1.158-1.07 1.532-1.92.412-.94.635-2.108.635-3.454V9.529c0-1.346-.223-2.514-.635-3.453-.374-.851-.895-1.494-1.532-1.921C13.694 3.726 12.916 3.5 12 3.5z"}}],bZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 1.5V22h-2V3.704L7.5 4.91V2.839l5-1.339z"}}],xZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 7.5a4 4 0 1 0-8 0H6a6 6 0 1 1 10.663 3.776l-7.32 8.723L18 20v2H6v-1.127l9.064-10.802A3.982 3.982 0 0 0 16 7.5z"}}],kZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18 2v1.362L12.809 9.55a6.501 6.501 0 1 1-7.116 8.028l1.94-.486A4.502 4.502 0 0 0 16.5 16a4.5 4.5 0 0 0-6.505-4.03l-.228.122-.69-1.207L14.855 4 6.5 4V2H18z"}}],wZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 1.5V16h3v2h-3v4h-2v-4H4v-1.102L14 1.5h2zM14 16V5.171L6.968 16H14z"}}],SZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18 2v2H9.3l-.677 6.445a6.5 6.5 0 1 1-2.93 7.133l1.94-.486A4.502 4.502 0 0 0 16.5 16a4.5 4.5 0 0 0-4.5-4.5c-2.022 0-3.278.639-3.96 1.53l-1.575-1.182L7.5 2H18z"}}],EZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14.886 2l-4.438 7.686A6.5 6.5 0 1 1 6.4 12.7L12.576 2h2.31zM12 11.5a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9z"}}],CZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 2v1.5L10.763 22H8.574l8.013-18H6V2z"}}],MZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 1.5a5.5 5.5 0 0 1 3.352 9.86C17.24 12.41 18.5 14.32 18.5 16.5c0 3.314-2.91 6-6.5 6s-6.5-2.686-6.5-6c0-2.181 1.261-4.09 3.147-5.141A5.5 5.5 0 0 1 12 1.5zm0 11c-2.52 0-4.5 1.828-4.5 4 0 2.172 1.98 4 4.5 4s4.5-1.828 4.5-4c0-2.172-1.98-4-4.5-4zm0-9a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7z"}}],TZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 1.5a6.5 6.5 0 0 1 5.619 9.77l-6.196 10.729H9.114l4.439-7.686A6.5 6.5 0 1 1 12 1.5zm0 2a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9z"}}],OZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M14 20v-2.157c1.863-1.192 3.5-3.875 3.5-6.959 0-3.073-2-6.029-5.5-6.029s-5.5 2.956-5.5 6.03c0 3.083 1.637 5.766 3.5 6.958V20H3v-2h4.76C5.666 16.505 4 13.989 4 10.884 4 6.247 7.5 3 12 3s8 3.247 8 7.884c0 3.105-1.666 5.621-3.76 7.116H21v2h-7z"}}],_Z=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M15 3c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-2v2h4c.552 0 1 .448 1 1v3h2c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1v-4c0-.552.448-1 1-1h2v-2H8v2h2c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1v-4c0-.552.448-1 1-1h2v-3c0-.552.448-1 1-1h4V9H9c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zM9 17H5v2h4v-2zm10 0h-4v2h4v-2zM14 5h-4v2h4V5z"}}],AZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 21v-4H7v4H5v-5a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v5h-2zM7 3v4h10V3h2v5a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V3h2zM2 9l4 3-4 3V9zm20 0v6l-4-3 4-3z"}}],NZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 6v15h-2v-5a6 6 0 1 1 0-12h10v2h-3v15h-2V6h-3zm-2 0a4 4 0 1 0 0 8V6z"}}],RZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12.9 6.858l4.242 4.243L7.242 21H3v-4.243l9.9-9.9zm1.414-1.414l2.121-2.122a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414l-2.122 2.121-4.242-4.242z"}}],PZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15.728 9.686l-1.414-1.414L5 17.586V19h1.414l9.314-9.314zm1.414-1.414l1.414-1.414-1.414-1.414-1.414 1.414 1.414 1.414zM7.242 21H3v-4.243L16.435 3.322a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414L7.243 21z"}}],zZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.934 3.036l1.732 1L18.531 6H21v2h-2v4h2v2h-2v7h-2v-7h-3.084c-.325 2.862-1.564 5.394-3.37 7.193l-1.562-1.27c1.52-1.438 2.596-3.522 2.917-5.922L10 14v-2l2-.001V8h-2V6h2.467l-1.133-1.964 1.732-1L14.777 6h1.444l1.713-2.964zM5 13.803l-2 .536v-2.071l2-.536V8H3V6h2V3h2v3h2v2H7v3.197l2-.536v2.07l-2 .536V18.5A2.5 2.5 0 0 1 4.5 21H3v-2h1.5a.5.5 0 0 0 .492-.41L5 18.5v-4.697zM17 8h-3v4h3V8z"}}],LZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M12 19c.828 0 1.5.672 1.5 1.5S12.828 22 12 22s-1.5-.672-1.5-1.5.672-1.5 1.5-1.5zm0-17c3.314 0 6 2.686 6 6 0 2.165-.753 3.29-2.674 4.923C13.399 14.56 13 15.297 13 17h-2c0-2.474.787-3.695 3.031-5.601C15.548 10.11 16 9.434 16 8c0-2.21-1.79-4-4-4S8 5.79 8 8v1H6V8c0-3.314 2.686-6 6-6z"}}],IZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M21 19v2h-2v-2h2zm-4 0v2h-2v-2h2zm-4 0v2h-2v-2h2zm-4 0v2H7v-2h2zm-4 0v2H3v-2h2zm16-4v2h-2v-2h2zM5 15v2H3v-2h2zm0-4v2H3v-2h2zm11-8c2.687 0 4.882 2.124 4.995 4.783L21 8v5h-2V8c0-1.591-1.255-2.903-2.824-2.995L16 5h-5V3h5zM5 7v2H3V7h2zm0-4v2H3V3h2zm4 0v2H7V3h2z"}}],DZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M9.683 7.562L12 9.88l6.374-6.375a2 2 0 0 1 2.829 0l.707.707L9.683 16.438a4 4 0 1 1-2.121-2.121L9.88 12 7.562 9.683a4 4 0 1 1 2.121-2.121zM6 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 12a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm9.535-6.587l6.375 6.376-.707.707a2 2 0 0 1-2.829 0l-4.96-4.961 2.12-2.122z"}}],$Z=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M14 3c.552 0 1 .448 1 1v5h5c.552 0 1 .448 1 1v10c0 .552-.448 1-1 1H10c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h10zm-1 2H5v8h4v-3c0-.552.448-1 1-1h3V5z"}}],HZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M11 3c.552 0 1 .448 1 1v2h5c.552 0 1 .448 1 1v5h2c.552 0 1 .448 1 1v7c0 .552-.448 1-1 1h-7c-.552 0-1-.448-1-1v-2H7c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h7zm5 5h-4v3c0 .552-.448 1-1 1H8v4h4v-3c0-.552.448-1 1-1h3V8z"}}],BZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M2 11h2v2H2v-2zm4 0h12v2H6v-2zm14 0h2v2h-2v-2z"}}],FZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M9.583 17.321C8.553 16.227 8 15 8 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 0 1-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179z"}}],VZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14.417 6.679C15.447 7.773 16 9 16 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311C9.591 12.322 8.17 10.841 8.17 9a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179z"}}],jZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M19 3l4 5h-3v12h-2V8h-3l4-5zm-5 15v2H3v-2h11zm0-7v2H3v-2h11zm-2-7v2H3V4h9z"}}],UZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 4v12h3l-4 5-4-5h3V4h2zm-8 14v2H3v-2h9zm2-7v2H3v-2h11zm0-7v2H3V4h11z"}}],WZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 9v4h16V9h2v5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V9h2z"}}],KZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M17.5 2.5L23 12l-5.5 9.5h-11L1 12l5.5-9.5h11zm-1.153 2H7.653L3.311 12l4.342 7.5h8.694l4.342-7.5-4.342-7.5zM11 15h2v2h-2v-2zm0-8h2v6h-2V7z"}}],qZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zm-9 2H5v14h6v-4h2v4h6V5h-6v4h-2V5zm4 4l3 3-3 3v-2H9v2l-3-3 3-3v2h6V9z"}}],GZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zm-1 2H5v5.999L9 11v2H5v6h14v-6h-4v-2l4-.001V5zm-7 1l3 3h-2v6h2l-3 3-3-3h2V9H9l3-3z"}}],YZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 9h-2V6H5V4h14v2h-6v3zm0 6v5h-2v-5h2zM3 11h18v2H3v-2z"}}],JZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.154 14c.23.516.346 1.09.346 1.72 0 1.342-.524 2.392-1.571 3.147C14.88 19.622 13.433 20 11.586 20c-1.64 0-3.263-.381-4.87-1.144V16.6c1.52.877 3.075 1.316 4.666 1.316 2.551 0 3.83-.732 3.839-2.197a2.21 2.21 0 0 0-.648-1.603l-.12-.117H3v-2h18v2h-3.846zm-4.078-3H7.629a4.086 4.086 0 0 1-.481-.522C6.716 9.92 6.5 9.246 6.5 8.452c0-1.236.466-2.287 1.397-3.153C8.83 4.433 10.271 4 12.222 4c1.471 0 2.879.328 4.222.984v2.152c-1.2-.687-2.515-1.03-3.946-1.03-2.48 0-3.719.782-3.719 2.346 0 .42.218.786.654 1.099.436.313.974.562 1.613.75.62.18 1.297.414 2.03.699z"}}],XZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 6v13H9V6H3V4h14v2h-6zm8.55 10.58a.8.8 0 1 0-1.32-.36l-1.154.33A2.001 2.001 0 0 1 19 14a2 2 0 0 1 1.373 3.454L18.744 19H21v1h-4v-1l2.55-2.42z"}}],QZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5.596 4L10.5 9.928 15.404 4H18l-6.202 7.497L18 18.994V19h-2.59l-4.91-5.934L5.59 19H3v-.006l6.202-7.497L3 4h2.596zM21.55 16.58a.8.8 0 1 0-1.32-.36l-1.155.33A2.001 2.001 0 0 1 21 14a2 2 0 0 1 1.373 3.454L20.744 19H23v1h-4v-1l2.55-2.42z"}}],ZZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 11h14v2H5z"}}],eee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 7v13H9V7H3V5h12v2h-4zm8.55-.42a.8.8 0 1 0-1.32-.36l-1.154.33A2.001 2.001 0 0 1 19 4a2 2 0 0 1 1.373 3.454L18.744 9H21v1h-4V9l2.55-2.42z"}}],tee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5.596 5l4.904 5.928L15.404 5H18l-6.202 7.497L18 19.994V20h-2.59l-4.91-5.934L5.59 20H3v-.006l6.202-7.497L3 5h2.596zM21.55 6.58a.8.8 0 1 0-1.32-.36l-1.155.33A2.001 2.001 0 0 1 21 4a2 2 0 0 1 1.373 3.454L20.744 9H23v1h-4V9l2.55-2.42z"}}],ree=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M13 10v4h6v-4h-6zm-2 0H5v4h6v-4zm2 9h6v-3h-6v3zm-2 0v-3H5v3h6zm2-14v3h6V5h-6zm-2 0H5v3h6V5zM4 3h16a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"}}],nee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 8h16V5H4v3zm10 11v-9h-4v9h4zm2 0h4v-9h-4v9zm-8 0v-9H4v9h4zM3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"}}],oee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 5v10H9v-4a4 4 0 1 1 0-8h8v2h-2v10h-2V5h-2zM9 5a2 2 0 1 0 0 4V5zm8 12v-2.5l4 3.5-4 3.5V19H5v-2h12z"}}],iee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 5v10H9v-4a4 4 0 1 1 0-8h8v2h-2v10h-2V5h-2zM9 5a2 2 0 1 0 0 4V5zM7 17h12v2H7v2.5L3 18l4-3.5V17z"}}],see=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 17h10v-2.5l3.5 3.5-3.5 3.5V19H7v2.5L3.5 18 7 14.5V17zm6-11v9h-2V6H5V4h14v2h-6z"}}],aee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 18h1.5a2.5 2.5 0 1 0 0-5H3v-2h13.5a4.5 4.5 0 1 1 0 9H15v2l-4-3 4-3v2zM3 4h18v2H3V4zm6 14v2H3v-2h6z"}}],lee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 6v15h-2V6H5V4h14v2z"}}],cee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301 14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"}}],uee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 15v2a2 2 0 0 0 1.85 1.995L7 19h3v2H7a4 4 0 0 1-4-4v-2h2zm13-5l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16 10h2zm-1 2.885L15.753 16h2.492L17 12.885zM8 2v2h4v7H8v3H6v-3H2V4h4V2h2zm9 1a4 4 0 0 1 4 4v2h-2V7a2 2 0 0 0-2-2h-3V3h3zM6 6H4v3h2V6zm4 0H8v3h2V6z"}}],dee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 3v9a4 4 0 1 0 8 0V3h2v9a6 6 0 1 1-12 0V3h2zM4 20h16v2H4v-2z"}}],fee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 19h16v-7h2v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-8h2v7zM14 9v6h-4V9H5l7-7 7 7h-5z"}}],pee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 3.993C3 3.445 3.445 3 3.993 3h16.014c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.994.994 0 0 1 3 20.007V3.993zM5 5v14h14V5H5zm5.622 3.415l4.879 3.252a.4.4 0 0 1 0 .666l-4.88 3.252a.4.4 0 0 1-.621-.332V8.747a.4.4 0 0 1 .622-.332z"}}],hee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 21v-2h3.662l1.234-7H5v-2h3.249l.881-5H4V3h16v2h-8.839l-.882 5H18v9h3v2H3zm13-9H9.927l-1.235 7H16v-7z"}}];const mee=Object.freeze(Object.defineProperty({__proto__:null,ab:NX,addFill:RX,addLine:PX,alertLine:zX,alignBottom:LX,alignCenter:IX,alignJustify:DX,alignLeft:$X,alignRight:HX,alignTop:BX,alignVertically:FX,appsLine:VX,arrowDownSFill:jX,arrowGoBackFill:UX,arrowGoForwardFill:WX,arrowLeftSFill:KX,arrowRightSFill:qX,arrowUpSFill:GX,asterisk:YX,attachment2:JX,bold:XX,bracesLine:QX,bringForward:ZX,bringToFront:eQ,chatNewLine:tQ,checkboxCircleLine:rQ,checkboxMultipleLine:nQ,clipboardFill:oQ,clipboardLine:iQ,closeCircleLine:sQ,closeFill:aQ,closeLine:lQ,codeLine:cQ,codeView:uQ,deleteBinFill:dQ,deleteBinLine:fQ,deleteColumn:pQ,deleteRow:hQ,doubleQuotesL:mQ,doubleQuotesR:gQ,download2Fill:vQ,dragDropLine:yQ,emphasis:xQ,emphasisCn:bQ,englishInput:kQ,errorWarningLine:wQ,externalLinkFill:SQ,fileCopyLine:EQ,flowChart:CQ,fontColor:MQ,fontSize:OQ,fontSize2:TQ,formatClear:_Q,fullscreenExitLine:AQ,fullscreenLine:NQ,functions:RQ,galleryUploadLine:PQ,h1:zQ,h2:LQ,h3:IQ,h4:DQ,h5:$Q,h6:HQ,hashtag:BQ,heading:FQ,imageAddLine:VQ,imageEditLine:jQ,imageLine:UQ,indentDecrease:WQ,indentIncrease:KQ,informationLine:qQ,inputCursorMove:GQ,insertColumnLeft:YQ,insertColumnRight:JQ,insertRowBottom:XQ,insertRowTop:QQ,italic:ZQ,layoutColumnLine:eZ,lineHeight:tZ,link:iZ,linkM:rZ,linkUnlink:oZ,linkUnlinkM:nZ,listCheck:aZ,listCheck2:sZ,listOrdered:lZ,listUnordered:cZ,markPenLine:uZ,markdownFill:dZ,markdownLine:fZ,mergeCellsHorizontal:pZ,mergeCellsVertical:hZ,mindMap:mZ,moreFill:gZ,nodeTree:vZ,number0:yZ,number1:bZ,number2:xZ,number3:kZ,number4:wZ,number5:SZ,number6:EZ,number7:CZ,number8:MZ,number9:TZ,omega:OZ,organizationChart:_Z,pageSeparator:AZ,paragraph:NZ,pencilFill:RZ,pencilLine:PZ,pinyinInput:zZ,questionMark:LZ,roundedCorner:IZ,scissorsFill:DZ,sendBackward:$Z,sendToBack:HZ,separator:BZ,singleQuotesL:FZ,singleQuotesR:VZ,sortAsc:jZ,sortDesc:UZ,space:WZ,spamLine:KZ,splitCellsHorizontal:qZ,splitCellsVertical:GZ,strikethrough:JZ,strikethrough2:YZ,subscript:QZ,subscript2:XZ,subtractLine:ZZ,superscript:tee,superscript2:eee,table2:ree,tableLine:nee,text:lee,textDirectionL:oee,textDirectionR:iee,textSpacing:see,textWrap:aee,translate:uee,translate2:cee,underline:dee,upload2Fill:fee,videoLine:pee,wubiInput:hee},Symbol.toStringTag,{value:"Module"}));function gee(e,t=null){return function(r,n){let{$from:o,$to:i}=r.selection,s=o.blockRange(i),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(e)&&s.startIndex==0){if(o.index(s.depth-1)==0)return!1;let u=r.doc.resolve(s.start-2);l=new na(u,u,s.depth),s.endIndex=0;u--)i=R.from(r[u].type.create(r[u].attrs,i));e.step(new bt(t.start-(n?2:0),t.end,t.start,t.end,new K(i,0,0),r.length,!0));let s=0;for(let u=0;us.childCount>0&&s.firstChild.type==e);return i?r?n.node(i.depth-1).type==e?bee(t,r,e,i):xee(t,r,i):!0:!1}}function bee(e,t,r,n){let o=e.tr,i=n.end,s=n.$to.end(n.depth);im;h--)p-=o.child(h).nodeSize,n.delete(p-1,p+1);let i=n.doc.resolve(r.start),s=i.nodeAfter;if(n.mapping.map(r.end)!=r.start+i.nodeAfter.nodeSize)return!1;let a=r.startIndex==0,l=r.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?R.empty:R.from(o))))return!1;let d=i.pos,f=d+s.nodeSize;return n.step(new bt(d-(a?1:0),f+(l?1:0),d+1,f-1,new K((a?R.empty:R.from(o.copy(R.empty))).append(l?R.empty:R.from(o.copy(R.empty))),a?0:1,l?0:1),a?0:1)),t(n.scrollIntoView()),!0}var kee=Object.defineProperty,wee=Object.getOwnPropertyDescriptor,Hn=(e,t,r,n)=>{for(var o=n>1?void 0:n?wee(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&kee(t,r,o),o};function av(e){var t;return!!((t=e.spec.group)!=null&&t.includes(oe.ListContainerNode))}function See(e){var t;return!!((t=e.spec.group)!=null&&t.includes(oe.ListItemNode))}function cs(e){return av(e.type)}function Qi(e){return See(e.type)}function Lb(e,t){return r=>{const{dispatch:n,tr:o}=r,i=Vv(o,r.state),{$from:s,$to:a}=o.selection,l=s.blockRange(a);if(!l)return!1;const c=Ld({predicate:u=>av(u.type),selection:o.selection});if(c&&l.depth-c.depth<=1&&l.startIndex===0){if(c.node.type===e)return P3(t)(r);if(av(c.node.type))return e.validContent(c.node.content)?(n==null||n(o.setNodeMarkup(c.pos,e)),!0):Eee(o,c,e,t)?(n==null||n(o.scrollIntoView()),!0):!1}return gee(e)(i,n)}}function N3(e,t=["checked"]){return function({tr:r,dispatch:n,state:o}){var i,s;const a=uz(e,o.schema),{$from:l,$to:c}=r.selection;if(Dd(r.selection)&&r.selection.node.isBlock||l.depth<2||!l.sameParent(c))return!1;const u=l.node(-1);if(u.type!==a)return!1;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(n){const m=l.index(-1)>0;let b=R.empty;for(let y=l.depth-(m?1:2);y>=l.depth-3;y--)b=R.from(l.node(y).copy(b));const v=((i=a.contentMatch.defaultType)==null?void 0:i.createAndFill())||void 0;b=b.append(R.from(a.createAndFill(null,v)||void 0));const g=l.indexAfter(-1)!t.includes(m))),f=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,p={...l.node().attrs};r.delete(l.pos,c.pos);const h=f?[{type:a,attrs:d},{type:f,attrs:p}]:[{type:a,attrs:d}];return dl(r.doc,l.pos,2)?(n&&n(r.split(l.pos,2,h).scrollIntoView()),!0):!1}}function Eee(e,t,r,n){const o=t.node,i=e.doc.resolve(t.start),s=i.node(-1),a=i.index(-1);if(!s||!s.canReplace(a,a+1,R.from(r.create())))return!1;const l=[];for(let p=0;pb;m--)h-=o.child(m).nodeSize,n.delete(h-1,h+1);const s=n.doc.resolve(r.start),a=s.nodeAfter;if(!a||n.mapping.slice(i).map(r.end)!==r.start+a.nodeSize)return!1;const l=r.startIndex===0,c=r.endIndex===o.childCount,u=s.node(-1),d=s.index(-1);if(!u.canReplace(d+(l?0:1),d+1,a.content.append(c?R.empty:R.from(o))))return!1;const f=s.pos,p=f+a.nodeSize;return n.step(new bt(f-(l?1:0),p+(c?1:0),f+1,p-1,new K((l?R.empty:R.from(o.copy(R.empty))).append(c?R.empty:R.from(o.copy(R.empty))),l?0:1,c?0:1),l?0:1)),t(n.scrollIntoView()),!0}function R3(e,t){const r=t||e.selection.$from;let n=[],o,i,s,a;for(let c=r.depth;c>=0;c--){if(i=r.node(c),o=r.index(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&cs(s)){const u=r.before(c+1);n.push(u)}if(o=r.indexAfter(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&cs(s)){const u=r.after(c+1);n.push(u)}}n=[...new Set(n)].sort((c,u)=>u-c);let l=!1;for(const c of n)Rd(e.doc,c)&&(e.join(c),l=!0);return l}function P3(e){return t=>{const{dispatch:r,tr:n}=t,o=Vv(n,t.state),i=Tee(e,n.selection);return i?(r&&Mee(o,r,i),!0):!1}}function Tee(e,t){const{$from:r,$to:n}=t;return r.blockRange(n,i=>{var s;return((s=i.firstChild)==null?void 0:s.type)===e})}function bh(e){const{$from:t,$to:r}=e;return t.blockRange(r,cs)}function Oee(e){const t=e.selection.$from,r=t.blockRange();if(!r||!Qi(r.parent)||r.startIndex!==0)return!1;const n=t.node(r.depth-2),o=t.index(r.depth),i=t.index(r.depth-1),s=t.index(r.depth-2),a=n.maybeChild(s-1),l=a==null?void 0:a.lastChild;if(o!==0||i!==0)return!1;if(a&&cs(a)&&l&&Qi(l))return Ql({listType:a.type,itemType:l.type,tr:e});if(Qi(n)){const c=n,u=t.node(r.depth-3);if(cs(u))return Ql({listType:u.type,itemType:c.type,tr:e})}return!1}function HS({view:e}){if(!e)return!1;{const t=e.state.selection.$cursor;if(!t||t.parentOffset>0)return!1;const r=t.blockRange();if(!r||!Qi(r.parent)||r.startIndex!==0)return!1}{const t=e.state.tr;Oee(t)&&e.dispatch(t)}{const t=e.state.selection.$cursor;if(!t||t.parentOffset>0)return!1;const r=t.blockRange();if(!r||!Qi(r.parent)||r.startIndex!==0)return!1;const n=t.index(r.depth),o=t.index(r.depth-1),i=t.index(r.depth-2),s=r.depth-2>=1&&Qi(t.node(r.depth-2));n===0&&o===0&&i<=1&&s&&yee(r.parent.type)(e.state,e.dispatch)}return jC(e.state,e.dispatch,e),!0}function z3({node:e,mark:t,updateDOM:r,updateMark:n}){const o=document.createElement("label");o.contentEditable="false",o.classList.add(ls.LIST_ITEM_MARKER_CONTAINER),o.append(t);const i=document.createElement("div"),s=document.createElement("li");s.classList.add(ls.LIST_ITEM_WITH_CUSTOM_MARKER),s.append(o),s.append(i);const a=l=>l.type!==e.type?!1:(e=l,r(e,s),n(e,t),!0);return a(e),{dom:s,contentDOM:i,update:a}}function _ee(e,t){const r=e.node(t.depth-1),n=e.node(t.depth-2);return!Qi(r)||!cs(n)?!1:{parentItem:r,parentList:n}}function Aee(e,t){const r=t.parent,n=t.parent.child(t.endIndex-1),o=t.end,i=t.$to.end(t.depth);return oPee(e)?(t==null||t(e.scrollIntoView()),!0):!1;function Lee(e,t,r){let n,o,i,s;const a=t.doc;if(r.startIndex>=1){n=e.child(r.startIndex-1),o=e,s=a.resolve(r.start).start(r.depth),i=s+1;for(let l=0;l=1){const c=t.node(r.depth-1),u=t.start(r.depth-1);if(o=c.child(l-1),!cs(o))return!1;s=u+1;for(let d=0;d=r.depth+2?t.end(r.depth+2):r.end-1,a=r.end;return s+1>=a?(n=e.slice(i,a),o=null):(n=e.slice(i,s),o=e.slice(s+1,a-1)),{selectedSlice:n,unselectedSlice:o}}function Dee(e){const{$from:t,$to:r}=e.selection,n=bh(e.selection);if(!n)return!1;const o=e.doc.resolve(n.start).node();if(!cs(o))return!1;const i=Lee(o,t,n);if(!i)return!1;const{previousItem:s,previousList:a,previousItemStart:l}=i,{selectedSlice:c,unselectedSlice:u}=Iee(e.doc,r,n),d=s.content.append(R.fromArray([o.copy(c.content)])).append(u?u.content:R.empty);e.deleteRange(n.start,n.end);const f=l+s.nodeSize-2,p=s.copy(d);return p.check(),e.replaceRangeWith(l-1,f+1,p),e.setSelection(a===o?le.between(e.doc.resolve(t.pos),e.doc.resolve(r.pos)):le.between(e.doc.resolve(t.pos-2),e.doc.resolve(r.pos-2))),!0}var $ee=({tr:e,dispatch:t})=>Dee(e)?(t==null||t(e.scrollIntoView()),!0):!1,L3=class extends Ve{get name(){return"listItemShared"}createKeymap(){const e={Tab:$ee,"Shift-Tab":zee,Backspace:HS,"Mod-Backspace":HS};if(on.isMac){const t={"Ctrl-h":e.Backspace,"Alt-Backspace":e["Mod-Backspace"]};return{...e,...t}}return e}createPlugin(){return{appendTransaction:(e,t,r)=>{const n=r.tr;return R3(n)?n:null}}}},ya=class extends er{get name(){return"listItem"}createTags(){return[oe.ListItemNode]}createNodeSpec(e,t){return{content:"paragraph block*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),closed:{default:!1},nested:{default:!1}},parseDOM:[{tag:"li",getAttrs:e.parse,priority:Ae.Lowest},...t.parseDOM??[]],toDOM:r=>["li",e.dom(r),0]}}createNodeViews(){return this.options.enableCollapsible?(e,t,r)=>{const n=document.createElement("div");return n.classList.add(ls.COLLAPSIBLE_LIST_ITEM_BUTTON),n.contentEditable="false",n.addEventListener("click",()=>{if(n.classList.contains("disabled"))return;const o=r(),i=ce.create(t.state.doc,o);return t.dispatch(t.state.tr.setSelection(i)),this.store.commands.toggleListItemClosed(),!0}),z3({mark:n,node:e,updateDOM:Hee,updateMark:Bee})}:{}}createKeymap(){return{Enter:N3(this.type)}}createExtensions(){return[new L3]}toggleListItemClosed(e){return({state:{tr:t,selection:r},dispatch:n})=>{if(!Dd(r)||r.node.type.name!==this.name)return!1;const{node:o,from:i}=r;return e=E1(e)?e:!o.attrs.closed,n==null||n(t.setNodeMarkup(i,void 0,{...o.attrs,closed:e})),!0}}liftListItemOutOfList(e){return P3(e??this.type)}};Hn([U()],ya.prototype,"toggleListItemClosed",1);Hn([U()],ya.prototype,"liftListItemOutOfList",1);ya=Hn([pe({defaultOptions:{enableCollapsible:!1},staticKeys:["enableCollapsible"]})],ya);function Hee(e,t){e.attrs.closed?t.classList.add(ls.COLLAPSIBLE_LIST_ITEM_CLOSED):t.classList.remove(ls.COLLAPSIBLE_LIST_ITEM_CLOSED)}function Bee(e,t){e.childCount<=1?t.classList.add("disabled"):t.classList.remove("disabled")}var bd=class extends er{get name(){return"bulletList"}createTags(){return[oe.Block,oe.ListContainerNode]}createNodeSpec(e,t){return{content:"listItem+",...t,attrs:e.defaults(),parseDOM:[{tag:"ul",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["ul",e.dom(r),0]}}createNodeViews(){return this.options.enableSpine?(e,t,r)=>{var n;const o=document.createElement("div");o.style.position="relative";const i=r(),s=t.state.doc.resolve(i+1),a=s.node(s.depth-1);if(!(((n=a==null?void 0:a.type)==null?void 0:n.name)!=="listItem")){const u=document.createElement("div");u.contentEditable="false",u.classList.add(ls.LIST_SPINE),u.addEventListener("click",d=>{const f=r(),p=t.state.doc.resolve(f+1),h=p.start(p.depth-1),m=ce.create(t.state.doc,h-1);t.dispatch(t.state.tr.setSelection(m)),this.store.commands.toggleListItemClosed(),d.preventDefault(),d.stopPropagation()}),o.append(u)}const c=document.createElement("ul");return c.classList.add(ls.UL_LIST_CONTENT),o.append(c),{dom:o,contentDOM:c}}:{}}createExtensions(){return[new ya({priority:Ae.Low,enableCollapsible:this.options.enableSpine})]}toggleBulletList(){return Lb(this.type,it(this.store.schema.nodes,"listItem"))}listShortcut(e){return this.toggleBulletList()(e)}createInputRules(){const e=/^\s*([*+-])\s$/;return[zh(e,this.type),new wa(e,(t,r,n,o)=>{const i=t.tr;return i.deleteRange(n,o),Ql({listType:this.type,itemType:it(this.store.schema.nodes,"listItem"),tr:i})?i:null})]}};Hn([U({icon:"listUnordered",label:({t:e})=>e(Nv.BULLET_LIST_LABEL)})],bd.prototype,"toggleBulletList",1);Hn([je({shortcut:D.BulletList,command:"toggleBulletList"})],bd.prototype,"listShortcut",1);bd=Hn([pe({defaultOptions:{enableSpine:!1},staticKeys:["enableSpine"]})],bd);var xd=class extends er{get name(){return"orderedList"}createTags(){return[oe.Block,oe.ListContainerNode]}createNodeSpec(e,t){return{content:"listItem+",...t,attrs:{...e.defaults(),order:{default:1}},parseDOM:[{tag:"ol",getAttrs:r=>Je(r)?{...e.parse(r),order:+(r.getAttribute("start")??1)}:{}},...t.parseDOM??[]],toDOM:r=>{const n=e.dom(r);return r.attrs.order===1?["ol",n,0]:["ol",{...n,start:r.attrs.order},0]}}}createExtensions(){return[new ya({priority:Ae.Low})]}toggleOrderedList(){return Lb(this.type,it(this.store.schema.nodes,"listItem"))}listShortcut(e){return this.toggleOrderedList()(e)}createInputRules(){const e=/^(\d+)\.\s$/;return[zh(e,this.type,t=>({order:+it(t,1)}),(t,r)=>r.childCount+r.attrs.order===+it(t,1)),new wa(e,(t,r,n,o)=>{const i=t.tr;if(i.deleteRange(n,o),!Ql({listType:this.type,itemType:it(this.store.schema.nodes,"listItem"),tr:i}))return null;const a=+it(r,1);if(a!==1){const l=ts({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{order:a})}return i})]}};Hn([U({icon:"listOrdered",label:({t:e})=>e(Nv.ORDERED_LIST_LABEL)})],xd.prototype,"toggleOrderedList",1);Hn([je({shortcut:D.OrderedList,command:"toggleOrderedList"})],xd.prototype,"listShortcut",1);xd=Hn([pe({})],xd);var I3=class extends er{get name(){return"taskListItem"}createTags(){return[oe.ListItemNode]}createNodeSpec(e,t){return{content:"paragraph block*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),checked:{default:!1}},parseDOM:[{tag:"li[data-task-list-item]",getAttrs:r=>{let n=!1;return Je(r)&&r.getAttribute("data-checked")!==null&&(n=!0),{checked:n,...e.parse(r)}},priority:Ae.Medium},...t.parseDOM??[]],toDOM:r=>["li",{...e.dom(r),"data-task-list-item":"","data-checked":r.attrs.checked?"":void 0},0]}}createNodeViews(){return(e,t,r)=>{const n=document.createElement("input");return n.type="checkbox",n.classList.add(ls.LIST_ITEM_CHECKBOX),n.contentEditable="false",n.addEventListener("click",o=>{t.editable||o.preventDefault()}),n.addEventListener("change",()=>{const o=r(),i=t.state.doc.resolve(o+1);this.store.commands.toggleCheckboxChecked({$pos:i})}),n.checked=e.attrs.checked,z3({node:e,mark:n,updateDOM:Fee,updateMark:Vee})}}createKeymap(){return{Enter:N3(this.type)}}createExtensions(){return[new L3]}toggleCheckboxChecked(e){let t,r;return typeof e=="boolean"?t=e:e&&(t=e.checked,r=e.$pos),({tr:n,dispatch:o})=>{const i=ts({selection:r??n.selection.$from,types:this.type});if(!i)return!1;const{node:s,pos:a}=i,l={...s.attrs,checked:t??!s.attrs.checked};return o==null||o(n.setNodeMarkup(a,void 0,l)),!0}}createInputRules(){const e=/^\s*(\[( ?|x|X)]\s)$/;return[zh(e,this.type,t=>({checked:["x","X"].includes(Zo(t,2))})),new wa(e,(t,r,n,o)=>{const i=t.tr;if(i.deleteRange(n,o),!Ql({listType:it(this.store.schema.nodes,"taskList"),itemType:this.type,tr:i}))return null;const a=["x","X"].includes(Zo(r,2));if(a){const l=ts({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{checked:a})}return i})]}};Hn([U()],I3.prototype,"toggleCheckboxChecked",1);function Fee(e,t){e.attrs.checked?t.setAttribute("data-checked",""):t.removeAttribute("data-checked"),t.setAttribute("data-task-list-item","")}function Vee(e,t){t.checked=!!e.attrs.checked}var D3=class extends er{get name(){return"taskList"}createTags(){return[oe.Block,oe.ListContainerNode]}createNodeSpec(e,t){return{content:"taskListItem+",...t,attrs:e.defaults(),parseDOM:[{tag:"ul[data-task-list]",getAttrs:e.parse,priority:Ae.Medium},...t.parseDOM??[]],toDOM:r=>["ul",{...e.dom(r),"data-task-list":""},0]}}createExtensions(){return[new I3({})]}toggleTaskList(){return Lb(this.type,it(this.store.schema.nodes,"taskListItem"))}listShortcut(e){return this.toggleTaskList()(e)}};Hn([U({icon:"checkboxMultipleLine",label:({t:e})=>e(Nv.TASK_LIST_LABEL)})],D3.prototype,"toggleTaskList",1);Hn([je({shortcut:D.TaskList,command:"toggleTaskList"})],D3.prototype,"listShortcut",1);var fo,jee=(e=document)=>fo||(fo=e.createElement("div"),fo.setAttribute("id","a11y-status-message"),fo.setAttribute("role","status"),fo.setAttribute("aria-live","polite"),fo.setAttribute("aria-relevant","additions text"),Object.assign(fo.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.append(fo),fo);j4(500,()=>{jee().textContent=""});function BS(e){return typeof e=="object"&&e!=null&&e.nodeType===1}function FS(e,t){return(!t||e!=="hidden")&&e!=="visible"&&e!=="clip"}function u1(e,t){if(e.clientHeightt||i>e&&s=t&&a>=r?i-e-n:s>t&&ar?s-t+o:0}var Uee=function(e,t){var r=window,n=t.scrollMode,o=t.block,i=t.inline,s=t.boundary,a=t.skipOverflowHiddenElements,l=typeof s=="function"?s:function(De){return De!==s};if(!BS(e))throw new TypeError("Invalid target");for(var c,u,d=document.scrollingElement||document.documentElement,f=[],p=e;BS(p)&&l(p);){if((p=(u=(c=p).parentElement)==null?c.getRootNode().host||null:u)===d){f.push(p);break}p!=null&&p===document.body&&u1(p)&&!u1(document.documentElement)||p!=null&&u1(p,a)&&f.push(p)}for(var h=r.visualViewport?r.visualViewport.width:innerWidth,m=r.visualViewport?r.visualViewport.height:innerHeight,b=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,g=e.getBoundingClientRect(),y=g.height,x=g.width,k=g.top,w=g.right,E=g.bottom,T=g.left,C=o==="start"||o==="nearest"?k:o==="end"?E:k+y/2,M=i==="center"?T+x/2:i==="end"?w:T,N=[],F=0;F=0&&T>=0&&E<=m&&w<=h&&k>=q&&E<=P&&T>=B&&w<=A)return N;var Y=getComputedStyle(I),J=parseInt(Y.borderLeftWidth,10),Ne=parseInt(Y.borderTopWidth,10),ie=parseInt(Y.borderRightWidth,10),ue=parseInt(Y.borderBottomWidth,10),de=0,me=0,Me="offsetWidth"in I?I.offsetWidth-I.clientWidth-J-ie:0,Se="offsetHeight"in I?I.offsetHeight-I.clientHeight-Ne-ue:0,ft="offsetWidth"in I?I.offsetWidth===0?0:z/I.offsetWidth:0,rt="offsetHeight"in I?I.offsetHeight===0?0:j/I.offsetHeight:0;if(d===I)de=o==="start"?C:o==="end"?C-m:o==="nearest"?Of(v,v+m,m,Ne,ue,v+C,v+C+y,y):C-m/2,me=i==="start"?M:i==="center"?M-h/2:i==="end"?M-h:Of(b,b+h,h,J,ie,b+M,b+M+x,x),de=Math.max(0,de+v),me=Math.max(0,me+b);else{de=o==="start"?C-q-Ne:o==="end"?C-P+ue+Se:o==="nearest"?Of(q,P,j,Ne,ue+Se,C,C+y,y):C-(q+j/2)+Se/2,me=i==="start"?M-B-J:i==="center"?M-(B+z/2)+Me/2:i==="end"?M-A+ie+Me:Of(B,A,z,J,ie+Me,M,M+x,x);var Or=I.scrollLeft,he=I.scrollTop;C+=he-(de=Math.max(0,Math.min(he+de/rt,I.scrollHeight-j/rt+Se))),M+=Or-(me=Math.max(0,Math.min(Or+me/ft,I.scrollWidth-z/ft+Me)))}N.push({el:I,top:de,left:me})}return N};typeof xr=="object"&&xr.__esModule&&xr.default&&xr.default;Rh(Uee);var Wee=typeof document<"u"?S.useLayoutEffect:S.useEffect;function Kee(e){const t=S.useRef();return Wee(()=>{t.current=e}),t.current}function qee(e,t){const[r,n]=S.useState([]),[o,i]=S.useState(()=>K0(e)),[s,a]=S.useState([]),l=S.useRef(e),c=Kee(o);return l.current=e,Wd(Ul,({addCustomHandler:u})=>{const d=K0(l.current),f=u("positioner",d);return i(d),f},t),S.useLayoutEffect(()=>{const u=o.addListener("update",f=>{const p=[];for(const{id:h,data:m,setElement:b}of f){const v=g=>{g&&b(g)};p.push({id:h,data:m,ref:v})}a(p)}),d=o.addListener("done",f=>{n(f)});return c!=null&&c.recentUpdate&&o.onActiveChanged(c==null?void 0:c.recentUpdate),()=>{u(),d()}},[o,c]),S.useMemo(()=>{const u=[];for(const[d,{ref:f,data:p,id:h}]of s.entries()){const m=r[d],{element:b,position:v={}}=m??{},g={...Qy,...q4(v)};u.push({ref:f,element:b,data:p,key:h,...g})}return u},[s,r])}function Gee(e,t){const r=t==null||E1(t)?[e]:t,n=E1(t)?t:!0,o=S.useRef(Cl()),s=qee(e,r)[0];return S.useMemo(()=>s&&n?{...s,active:!0}:{...Qy,ref:void 0,data:{},active:!1,key:o.current},[n,s])}function d1(e,t){return _e(e)?e(t):e}function Yee(e){return ne(e[0])}function Jee(e,t){var r;return ne(e)?e:ct(e)?Yee(e)?e[0]??"":((r=e.find(n=>G4(n.attrs,t))??e[0])==null?void 0:r.shortcut)??"":e.shortcut}var Xee={title:e=>dA(e),upper:e=>e.toLocaleUpperCase(),lower:e=>e.toLocaleLowerCase()};function Qee(e,t){const{casing:r="title",namedAsSymbol:n=!1,modifierAsSymbol:o=!0,separator:i=" ",t:s}=t,a=Bz(e),l=[],c=Xee[r];for(const u of a){if(u.type==="char"){l.push(c(u.key));continue}if(u.type==="named"){const f=n===!0||ct(n)&&fr(n,u.key)?u.symbol??s(u.i18n):s(u.i18n);l.push(c(f));continue}const d=o===!0||ct(o)&&fr(o,u.key)?u.symbol:s(u.i18n);l.push(c(d))}return l.join(i)}var $3=({commandName:e,active:t,enabled:r,attrs:n})=>{const{t:o}=dj(),{getCommandOptions:i}=dm(),s=i(e),{description:a,label:l,icon:c,shortcut:u}=s||{},d=S.useMemo(()=>({active:t,attrs:n,enabled:r,t:o}),[t,n,r,o]),f=S.useMemo(()=>{if(u)return Qee(Jee(u,n??{}),{t:o,separator:""})},[u,n,o]);return S.useMemo(()=>({description:d1(a,d),label:d1(l,d),icon:d1(c,d),shortcut:f}),[d,a,l,c,f])},Zee={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},H3=S.createContext(Zee);H3.Provider;function B3(e){return e.map((t,r)=>S.createElement(t.tag,{key:r,...t.attr},B3(t.child??[])))}var Ym=e=>{const{name:t}=e;return L.createElement(ete,{...e},B3(mee[t]))},ete=e=>{const t=r=>{const n=e.size??r.size??"1em";let o;r.className&&(o=r.className),e.className&&(o=(o?`${o} `:"")+e.className);const{title:i,...s}=e;return L.createElement("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",...r.attr,...s,className:o,style:{color:e.color??r.color,...r.style,...e.style},height:n,width:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},i&&L.createElement("title",null,i),e.children)};return L.createElement(H3.Consumer,null,t)},tte=e=>hs(e)?!!e.name:!1,rte=({icon:e})=>ne(e)?L.createElement(Ym,{name:e,size:"1rem"}):e,nte=({icon:e,children:t})=>{if(!tte(e))return L.createElement(L.Fragment,null,t);const{sub:r,sup:n}=e,o=r??n,i=r!==void 0;return o===void 0?L.createElement(L.Fragment,null,t):L.createElement(nJ,{anchorOrigin:{vertical:i?"bottom":"top",horizontal:"right"},badgeContent:o,sx:{"& > .MuiBadge-badge":{bgcolor:"background.paper",color:"text.secondary",minWidth:12,height:12,margin:"2px 0",padding:"1px"}}},t)},dt=({commandName:e,active:t=!1,enabled:r,attrs:n,onSelect:o,onChange:i,icon:s,displayShortcut:a=!0,"aria-label":l,label:c,...u})=>{const d=S.useCallback((g,y)=>{o(),i==null||i(g,y)},[o,i]),f=S.useCallback(g=>{g.preventDefault()},[]),p=$3({commandName:e,active:t,enabled:r,attrs:n});let h=null;p.icon&&(h=ne(p.icon)?p.icon:p.icon.name);const m=l??p.label??"",b=c??m,v=a&&p.shortcut?` (${p.shortcut})`:"";return L.createElement(A3,{title:`${b}${v}`},L.createElement(M3,{component:"span",sx:{"&:not(:first-of-type)":{marginLeft:"-1px"}}},L.createElement(AX,{"aria-label":m,selected:t,disabled:!r,onMouseDown:f,color:"primary",size:"small",sx:{padding:"6px 12px","&.Mui-selected":{backgroundColor:"primary.main",color:"primary.contrastText"},"&.Mui-selected:hover":{backgroundColor:"primary.dark",color:"primary.contrastText"},"&:not(:first-of-type)":{borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:last-of-type)":{borderTopRightRadius:0,borderBottomRightRadius:0}},...u,value:e,onChange:d},L.createElement(nte,{icon:p.icon},L.createElement(rte,{icon:s??h})))))},ote=({icon:e})=>ne(e)?L.createElement(Ym,{name:e,size:"1rem"}):e,F3=({label:e,"aria-label":t,icon:r,children:n,onClose:o,...i})=>{const s=S.useRef(Cl()),[a,l]=S.useState(null),c=!!a,u=S.useCallback(p=>{p.preventDefault()},[]),d=S.useCallback(p=>{l(p.currentTarget)},[]),f=S.useCallback((p,h)=>{l(null),o==null||o(p,h)},[o]);return L.createElement(L.Fragment,null,L.createElement(A3,{title:e??t},L.createElement(Uq,{"aria-label":t,"aria-controls":c?s.current:void 0,"aria-haspopup":!0,"aria-expanded":c?"true":void 0,onMouseDown:u,onClick:d,size:"small",sx:p=>({border:`1px solid ${p.palette.divider}`,borderRadius:`${p.shape.borderRadius}px`,padding:"6px 12px","&:not(:first-of-type)":{marginLeft:"-1px",borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:last-of-type)":{borderTopRightRadius:0,borderBottomRightRadius:0}})},r&&L.createElement(ote,{icon:r}),L.createElement(Ym,{name:"arrowDownSFill",size:"1rem"}))),L.createElement(sX,{...i,id:s.current,anchorEl:a,open:c,onClose:f},n))},ite=e=>{const{insertHorizontalRule:t}=tr();tb();const r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=t.enabled();return L.createElement(dt,{...e,commandName:"insertHorizontalRule",enabled:n,onSelect:r})},ste=e=>{const{redo:t}=tr(),{redoDepth:r}=dm(!0),n=S.useCallback(()=>{t.enabled()&&t()},[t]),o=r()>0;return L.createElement(dt,{...e,commandName:"redo",active:!1,enabled:o,onSelect:n})},ate=e=>{const{toggleBlockquote:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().blockquote(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleBlockquote",active:n,enabled:o,onSelect:r})},lv=e=>{const{toggleBold:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().bold(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleBold",active:n,enabled:o,onSelect:r})},lte=e=>{const{toggleBulletList:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().bulletList(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleBulletList",active:n,enabled:o,onSelect:r})},cte=({attrs:e={},...t})=>{const{toggleCodeBlock:r}=tr(),n=S.useCallback(()=>{r.enabled(e)&&r(e)},[r,e]),o=qr().codeBlock(),i=r.enabled(e);return L.createElement(dt,{...t,commandName:"toggleCodeBlock",active:o,enabled:i,attrs:e,onSelect:n})},cv=e=>{const{toggleCode:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().code(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleCode",active:n,enabled:o,onSelect:r})},f1=({attrs:e,...t})=>{const{toggleHeading:r}=tr(),n=S.useCallback(()=>{r.enabled(e)&&r(e)},[r,e]),o=qr().heading(e),i=r.enabled(e);return L.createElement(dt,{...t,commandName:"toggleHeading",active:o,enabled:i,attrs:e,onSelect:n})},uv=e=>{const{toggleItalic:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().italic(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleItalic",active:n,enabled:o,onSelect:r})},ute=e=>{const{toggleOrderedList:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().orderedList(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleOrderedList",active:n,enabled:o,onSelect:r})},dte=e=>{const{toggleStrike:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().strike(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleStrike",active:n,enabled:o,onSelect:r})},dv=e=>{const{toggleUnderline:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().underline(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleUnderline",active:n,enabled:o,onSelect:r})},fte=e=>{const{undo:t}=tr(),{undoDepth:r}=dm(!0),n=S.useCallback(()=>{t.enabled()&&t()},[t]),o=r()>0;return L.createElement(dt,{...e,commandName:"undo",active:!1,enabled:o,onSelect:n})},En=e=>L.createElement(M3,{sx:{display:"flex",alignItems:"center",width:"fit-content",bgcolor:"background.paper",color:"text.secondary"},...e}),pte=({children:e})=>L.createElement(En,null,L.createElement(lv,null),L.createElement(uv,null),L.createElement(dv,null),L.createElement(dte,null),L.createElement(cv,null),e),hte=({icon:e})=>e?L.createElement(NJ,null,ne(e)?L.createElement(Ym,{name:e,size:"1rem"}):L.createElement(L.Fragment,null,e)):null,Ib=({commandName:e,active:t=!1,enabled:r,attrs:n,onSelect:o,onClick:i,icon:s,displayShortcut:a=!0,label:l,description:c,displayDescription:u=!0,...d})=>{const f=S.useCallback(g=>{o(),i==null||i(g)},[o,i]),p=S.useCallback(g=>{g.preventDefault()},[]),h=$3({commandName:e,active:t,enabled:r,attrs:n});let m=null;h.icon&&(m=ne(h.icon)?h.icon:h.icon.name);const b=l??h.label??"",v=u&&(c??h.description);return L.createElement(hX,{selected:t,disabled:!r,onMouseDown:p,...d,onClick:f},s!==null&&L.createElement(hte,{icon:s??m}),L.createElement($J,{primary:b,secondary:v}),a&&h.shortcut&&L.createElement(cu,{variant:"body2",color:"text.secondary",sx:{ml:2}},h.shortcut))},_f=({attrs:e,...t})=>{const{toggleHeading:r}=tr(),n=S.useCallback(()=>{r.enabled(e)&&r(e)},[r,e]),o=qr().heading(e),i=r.enabled(e);return L.createElement(Ib,{...t,commandName:"toggleHeading",active:o,enabled:i,attrs:e,onSelect:n})},mte={level:1},gte={level:2},VS={level:3},vte={level:4},yte={level:5},bte={level:6},xte=({showAll:e=!1,children:t})=>L.createElement(En,null,L.createElement(f1,{attrs:mte}),L.createElement(f1,{attrs:gte}),e?L.createElement(F3,{"aria-label":"More heading options"},L.createElement(_f,{attrs:VS}),L.createElement(_f,{attrs:vte}),L.createElement(_f,{attrs:yte}),L.createElement(_f,{attrs:bte})):L.createElement(f1,{attrs:VS}),t),kte=({children:e})=>L.createElement(En,null,L.createElement(fte,null),L.createElement(ste,null),e);typeof xr=="object"&&xr.__esModule&&xr.default&&xr.default;var V3=S.createContext({});function wte(e={}){const t=S.useContext(V3),r=S.useMemo(()=>X4(t,e.theme??{}),[t,e.theme]),n=S.useMemo(()=>CV(r).styles,[r]),o=ju(EV,e.className);return S.useMemo(()=>({style:n,className:o,theme:r}),[n,o,r])}var Ste=e=>{var t,r,n,o,i,s,a,l;const{children:c,as:u="div"}=e,{theme:d,style:f,className:p}=wte({theme:e.theme??Ss}),h=kb({palette:{primary:{main:((t=d.color)==null?void 0:t.primary)??Ss.color.primary,dark:((n=(r=d.color)==null?void 0:r.hover)==null?void 0:n.primary)??Ss.color.hover.primary,contrastText:((o=d.color)==null?void 0:o.primaryText)??Ss.color.primaryText},secondary:{main:((i=d.color)==null?void 0:i.secondary)??Ss.color.secondary,dark:((a=(s=d.color)==null?void 0:s.hover)==null?void 0:a.secondary)??Ss.color.hover.secondary,contrastText:((l=d.color)==null?void 0:l.secondaryText)??Ss.color.secondaryText}}});return L.createElement(nq,{theme:h},L.createElement(V3.Provider,{value:d},L.createElement(u,{style:f,className:p},c)))},j3=e=>L.createElement(mJ,{direction:"row",spacing:1,sx:{backgroundColor:"background.paper",overflowX:"auto"},...e}),Ete=[{name:"offset",options:{offset:[0,8]}}],Cte=({positioner:e="selection",children:t,...r})=>{const{ref:n,x:o,y:i,width:s,height:a,active:l}=Gee(()=>K0(e),[e]),[c,u]=S.useState(null),d=S.useMemo(()=>({position:"absolute",pointerEvents:"none",left:o,top:i,width:s,height:a}),[o,i,s,a]),f=S.useCallback(p=>{u(p),n==null||n(p)},[n]);return L.createElement(L.Fragment,null,L.createElement("div",{ref:f,style:d}),L.createElement(zb,{placement:"top",modifiers:Ete,...r,open:l,anchorEl:c},L.createElement(j3,null,t?L.createElement(L.Fragment,null,t):L.createElement(pte,null))))},Ct=Rh(dh),Db=xt` /** * Styles extracted from: packages/remirror__theme/src/components-theme.ts */ @@ -771,8 +771,8 @@ Error generating stack: `+i.message+` .remirror-color-picker-cell-selected { } `;Ct.div` - ${zb} -`;var Lb=xt` + ${Db} +`;var $b=xt` /** * Styles extracted from: packages/remirror__theme/src/core-theme.ts */ @@ -838,8 +838,8 @@ Error generating stack: `+i.message+` pointer-events: none; } `;Ct.div` - ${Lb} -`;var Ib=xt` + ${$b} +`;var Hb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-blockquote-theme.ts */ @@ -854,8 +854,8 @@ Error generating stack: `+i.message+` color: #888; } `;Ct.div` - ${Ib} -`;var Db=xt` + ${Hb} +`;var Bb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-callout-theme.ts */ @@ -891,8 +891,8 @@ Error generating stack: `+i.message+` background: #f8f8f8; } `;Ct.div` - ${Db} -`;var $b=xt` + ${Bb} +`;var Fb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-code-block-theme.ts */ @@ -3689,8 +3689,8 @@ Error generating stack: `+i.message+` bottom: 0.4em; } `;Ct.div` - ${$b} -`;var Hb=xt` + ${Fb} +`;var Vb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-count-theme.ts */ @@ -3698,8 +3698,8 @@ Error generating stack: `+i.message+` background-color: var(--rmr-hue-red-4); } `;Ct.div` - ${Hb} -`;var Bb=xt` + ${Vb} +`;var jb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-emoji-theme.ts */ @@ -3757,8 +3757,8 @@ Error generating stack: `+i.message+` padding-right: 5px; } `;Ct.div` - ${Bb} -`;var Fb=xt` + ${jb} +`;var Ub=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-file-theme.ts */ @@ -3810,8 +3810,8 @@ Error generating stack: `+i.message+` color: #000; } `;Ct.div` - ${Fb} -`;var Vb=xt` + ${Ub} +`;var Wb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-gap-cursor-theme.ts */ @@ -3839,8 +3839,8 @@ Error generating stack: `+i.message+` display: block; } `;Ct.div` - ${Vb} -`;var jb=xt` + ${Wb} +`;var Kb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-image-theme.ts */ @@ -3862,8 +3862,8 @@ Error generating stack: `+i.message+` } } `;Ct.div` - ${jb} -`;var Ub=xt` + ${Kb} +`;var qb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-list-theme.ts */ @@ -3958,8 +3958,8 @@ Error generating stack: `+i.message+` border-left-color: var(--rmr-color-primary); } `;Ct.div` - ${Ub} -`;var Wb=xt` + ${qb} +`;var Gb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-mention-atom-theme.ts */ @@ -4024,16 +4024,16 @@ Error generating stack: `+i.message+` padding-right: 5px; } `;Ct.div` - ${Wb} -`;var Kb=xt` + ${Gb} +`;var Yb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-node-formatting-theme.ts */ .remirror-editor.ProseMirror { } `;Ct.div` - ${Kb} -`;var qb=xt` + ${Yb} +`;var Jb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-placeholder-theme.ts */ @@ -4046,8 +4046,8 @@ Error generating stack: `+i.message+` content: attr(data-placeholder); } `;Ct.div` - ${qb} -`;var Gb=xt` + ${Jb} +`;var Xb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-positioner-theme.ts */ @@ -4074,8 +4074,8 @@ Error generating stack: `+i.message+` position: absolute; } `;Ct.div` - ${Gb} -`;var Yb=xt` + ${Xb} +`;var Qb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-tables-theme.ts */ @@ -4442,8 +4442,8 @@ Error generating stack: `+i.message+` background-color: var(--rmr-color-table-predelete-controller) !important; } `;Ct.div` - ${Yb} -`;var Jb=xt` + ${Qb} +`;var Zb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-whitespace-theme.ts */ @@ -4473,8 +4473,8 @@ Error generating stack: `+i.message+` content: '¶'; } `;Ct.div` - ${Jb} -`;var Xb=xt` + ${Zb} +`;var ex=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-yjs-theme.ts */ @@ -4518,8 +4518,8 @@ Error generating stack: `+i.message+` display: inline-block; } `;Ct.div` - ${Xb} -`;var Qb=xt` + ${ex} +`;var tx=xt` /** * Styles extracted from: packages/remirror__theme/src/theme.ts */ @@ -4821,11 +4821,8 @@ Error generating stack: `+i.message+` /* margin-bottom: var(--rmr-space-2); */ } `;Ct.div` - ${Qb} + ${tx} `;xt` - ${zb} - ${Lb} - ${Ib} ${Db} ${$b} ${Hb} @@ -4842,10 +4839,10 @@ Error generating stack: `+i.message+` ${Jb} ${Xb} ${Qb} -`;var kte=Ct.div` - ${zb} - ${Lb} - ${Ib} + ${Zb} + ${ex} + ${tx} +`;var Mte=Ct.div` ${Db} ${$b} ${Hb} @@ -4862,63 +4859,66 @@ Error generating stack: `+i.message+` ${Jb} ${Xb} ${Qb} -`,wte=Object.defineProperty,Ste=Object.getOwnPropertyDescriptor,H3=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ste(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&wte(t,r,o),o},Zb=class extends er{get name(){return"blockquote"}createTags(){return[oe.Block,oe.FormattingNode]}createNodeSpec(e,t){return{content:"block+",defining:!0,draggable:!1,...t,attrs:e.defaults(),parseDOM:[{tag:"blockquote",getAttrs:e.parse,priority:100},...t.parseDOM??[]],toDOM:r=>["blockquote",e.dom(r),0]}}toggleBlockquote(){return P5(this.type)}shortcut(e){return this.toggleBlockquote()(e)}createInputRules(){return[Nh(/^\s*>\s$/,this.type)]}createPasteRules(){return{type:"node",nodeType:this.type,regexp:/^\s*>\s$/,startOfTextBlock:!0}}};H3([U({icon:"doubleQuotesL",description:({t:e})=>e(fk.DESCRIPTION),label:({t:e})=>e(fk.LABEL)})],Zb.prototype,"toggleBlockquote",1);H3([je({shortcut:"Ctrl->",command:"toggleBlockquote"})],Zb.prototype,"shortcut",1);var Ete=Object.defineProperty,Cte=Object.getOwnPropertyDescriptor,Gd=(e,t,r,n)=>{for(var o=n>1?void 0:n?Cte(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ete(t,r,o),o},Mte={icon:"bold",label:({t:e})=>e(pk.LABEL),description:({t:e})=>e(pk.DESCRIPTION)},ba=class extends li{get name(){return"bold"}createTags(){return[oe.FormattingMark,oe.FontStyle]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"strong",getAttrs:e.parse},{tag:"b",getAttrs:r=>Je(r)&&r.style.fontWeight!=="normal"?e.parse(r):!1},{style:"font-weight",getAttrs:r=>ne(r)&&/^(bold(er)?|[5-9]\d{2,})$/.test(r)?null:!1},...t.parseDOM??[]],toDOM:r=>{const{weight:n}=this.options;return n?["strong",{"font-weight":n.toString()},0]:["strong",e.dom(r),0]}}}createInputRules(){return[Fu({regexp:/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,type:this.type,ignoreWhitespace:!0})]}toggleBold(e){return ns({type:this.type,selection:e})}setBold(e){return({tr:t,dispatch:r})=>{const{from:n,to:o}=jr(e??t.selection,t.doc);return r==null||r(t.addMark(n,o,this.type.create())),!0}}removeBold(e){return({tr:t,dispatch:r})=>{const{from:n,to:o}=jr(e??t.selection,t.doc);return t.doc.rangeHasMark(n,o,this.type)?(r==null||r(t.removeMark(n,o,this.type)),!0):!1}}shortcut(e){return this.toggleBold()(e)}};Gd([U(Mte)],ba.prototype,"toggleBold",1);Gd([U()],ba.prototype,"setBold",1);Gd([U()],ba.prototype,"removeBold",1);Gd([je({shortcut:D.Bold,command:"toggleBold"})],ba.prototype,"shortcut",1);ba=Gd([me({defaultOptions:{weight:void 0},staticKeys:["weight"]})],ba);var Tte=Object.defineProperty,Ote=Object.getOwnPropertyDescriptor,ex=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ote(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Tte(t,r,o),o},{DESCRIPTION:_te,LABEL:Ate}=ZN,Nte={icon:"codeLine",description:({t:e})=>e(_te),label:({t:e})=>e(Ate)},xd=class extends li{get name(){return"code"}createTags(){return[oe.Code,oe.ExcludeInputRules]}createMarkSpec(e,t){return{excludes:"_",...t,attrs:e.defaults(),parseDOM:[{tag:"code",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["code",{spellcheck:"false",...e.dom(r)},0]}}createKeymap(){return{"Mod-`":ns({type:this.type})}}keyboardShortcut(e){return this.toggleCode()(e)}toggleCode(){return ns({type:this.type})}createInputRules(){return[Fu({regexp:new RegExp(`(?:\`)([^\`${yv}]+)(?:\`)$`),type:this.type,ignoreWhitespace:!0})]}createPasteRules(){return[{type:"mark",regexp:/`([^`]+)`/g,markType:this.type}]}};ex([je({shortcut:D.Code,command:"toggleCode"})],xd.prototype,"keyboardShortcut",1);ex([U(Nte)],xd.prototype,"toggleCode",1);xd=ex([me({})],xd);var Rte=zte,Pte=Object.prototype.hasOwnProperty;function zte(){for(var e={},t=0;t4&&r.slice(0,4)===ix&&kre.test(t)&&(t.charAt(4)==="-"?n=Ere(t):t=Cre(t),o=yre),new o(n,t))}function Ere(e){var t=e.slice(5).replace(G3,Tre);return ix+t.charAt(0).toUpperCase()+t.slice(1)}function Cre(e){var t=e.slice(4);return G3.test(t)?e:(t=t.replace(wre,Mre),t.charAt(0)!=="-"&&(t="-"+t),ix+t)}function Mre(e){return"-"+e.toLowerCase()}function Tre(e){return e.charAt(1).toUpperCase()}var Ore=_re,US=/[#.]/g;function _re(e,t){for(var r=e||"",n=t||"div",o={},i=0,s,a,l;i=48&&t<=57}var Xoe=Qoe;function Qoe(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}var Zoe=eie;function eie(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}var tie=Zoe,rie=X3,nie=oie;function oie(e){return tie(e)||rie(e)}var _f,iie=59,sie=aie;function aie(e){var t="&"+e+";",r;return _f=_f||document.createElement("i"),_f.innerHTML=t,r=_f.textContent,r.charCodeAt(r.length-1)===iie&&e!=="semi"||r===t?!1:r}var XS=Goe,QS=Yoe,lie=X3,cie=Xoe,Q3=nie,uie=sie,die=Eie,fie={}.hasOwnProperty,Ba=String.fromCharCode,pie=Function.prototype,ZS={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:!1,nonTerminated:!0},hie=9,e4=10,mie=12,gie=32,t4=38,vie=59,yie=60,bie=61,xie=35,kie=88,wie=120,Sie=65533,Ja="named",lx="hexadecimal",cx="decimal",ux={};ux[lx]=16;ux[cx]=10;var qm={};qm[Ja]=Q3;qm[cx]=lie;qm[lx]=cie;var Z3=1,eO=2,tO=3,rO=4,nO=5,uv=6,oO=7,ws={};ws[Z3]="Named character references must be terminated by a semicolon";ws[eO]="Numeric character references must be terminated by a semicolon";ws[tO]="Named character references cannot be empty";ws[rO]="Numeric character references cannot be empty";ws[nO]="Named character references must be known";ws[uv]="Numeric character references cannot be disallowed";ws[oO]="Numeric character references cannot be outside the permissible Unicode range";function Eie(e,t){var r={},n,o;t||(t={});for(o in ZS)n=t[o],r[o]=n??ZS[o];return(r.position.indent||r.position.start)&&(r.indent=r.position.indent||[],r.position=r.position.start),Cie(e,r)}function Cie(e,t){var r=t.additional,n=t.nonTerminated,o=t.text,i=t.reference,s=t.warning,a=t.textContext,l=t.referenceContext,c=t.warningContext,u=t.position,d=t.indent||[],f=e.length,p=0,h=-1,m=u.column||1,b=u.line||1,v="",g=[],y,x,k,w,E,M,C,T,N,F,I,V,j,z,q,A,P,B,Y;for(typeof r=="string"&&(r=r.charCodeAt(0)),A=J(),T=s?Ne:pie,p--,f++;++p65535&&(M-=65536,F+=Ba(M>>>10|55296),M=56320|M&1023),M=F+Ba(M))):z!==Ja&&T(rO,B)),M?(ie(),A=J(),p=Y-1,m+=Y-j+1,g.push(M),P=J(),P.offset++,i&&i.call(l,M,{start:A,end:P},e.slice(j-1,Y)),A=P):(w=e.slice(j-1,Y),v+=w,m+=w.length,p=Y-1)}else E===10&&(b++,h++,m=0),E===E?(v+=Ba(E),m++):ie();return g.join("");function J(){return{line:b,column:m,offset:p+(u.offset||0)}}function Ne(ue,de){var he=J();he.column+=de,he.offset+=de,s.call(c,ws[ue],he,ue)}function ie(){v&&(g.push(v),o&&o.call(a,v,{start:A,end:J()}),v="")}}function Mie(e){return e>=55296&&e<=57343||e>1114111}function Tie(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var iO={exports:{}};(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/** + ${Zb} + ${ex} + ${tx} +`,Tte=Object.defineProperty,Ote=Object.getOwnPropertyDescriptor,U3=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ote(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Tte(t,r,o),o},rx=class extends er{get name(){return"blockquote"}createTags(){return[oe.Block,oe.FormattingNode]}createNodeSpec(e,t){return{content:"block+",defining:!0,draggable:!1,...t,attrs:e.defaults(),parseDOM:[{tag:"blockquote",getAttrs:e.parse,priority:100},...t.parseDOM??[]],toDOM:r=>["blockquote",e.dom(r),0]}}toggleBlockquote(){return DC(this.type)}shortcut(e){return this.toggleBlockquote()(e)}createInputRules(){return[zh(/^\s*>\s$/,this.type)]}createPasteRules(){return{type:"node",nodeType:this.type,regexp:/^\s*>\s$/,startOfTextBlock:!0}}};U3([U({icon:"doubleQuotesL",description:({t:e})=>e(mk.DESCRIPTION),label:({t:e})=>e(mk.LABEL)})],rx.prototype,"toggleBlockquote",1);U3([je({shortcut:"Ctrl->",command:"toggleBlockquote"})],rx.prototype,"shortcut",1);var _te=Object.defineProperty,Ate=Object.getOwnPropertyDescriptor,Jd=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ate(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&_te(t,r,o),o},Nte={icon:"bold",label:({t:e})=>e(gk.LABEL),description:({t:e})=>e(gk.DESCRIPTION)},ba=class extends li{get name(){return"bold"}createTags(){return[oe.FormattingMark,oe.FontStyle]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"strong",getAttrs:e.parse},{tag:"b",getAttrs:r=>Je(r)&&r.style.fontWeight!=="normal"?e.parse(r):!1},{style:"font-weight",getAttrs:r=>ne(r)&&/^(bold(er)?|[5-9]\d{2,})$/.test(r)?null:!1},...t.parseDOM??[]],toDOM:r=>{const{weight:n}=this.options;return n?["strong",{"font-weight":n.toString()},0]:["strong",e.dom(r),0]}}}createInputRules(){return[Vu({regexp:/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,type:this.type,ignoreWhitespace:!0})]}toggleBold(e){return ns({type:this.type,selection:e})}setBold(e){return({tr:t,dispatch:r})=>{const{from:n,to:o}=jr(e??t.selection,t.doc);return r==null||r(t.addMark(n,o,this.type.create())),!0}}removeBold(e){return({tr:t,dispatch:r})=>{const{from:n,to:o}=jr(e??t.selection,t.doc);return t.doc.rangeHasMark(n,o,this.type)?(r==null||r(t.removeMark(n,o,this.type)),!0):!1}}shortcut(e){return this.toggleBold()(e)}};Jd([U(Nte)],ba.prototype,"toggleBold",1);Jd([U()],ba.prototype,"setBold",1);Jd([U()],ba.prototype,"removeBold",1);Jd([je({shortcut:D.Bold,command:"toggleBold"})],ba.prototype,"shortcut",1);ba=Jd([pe({defaultOptions:{weight:void 0},staticKeys:["weight"]})],ba);var Rte=Object.defineProperty,Pte=Object.getOwnPropertyDescriptor,nx=(e,t,r,n)=>{for(var o=n>1?void 0:n?Pte(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Rte(t,r,o),o},{DESCRIPTION:zte,LABEL:Lte}=sR,Ite={icon:"codeLine",description:({t:e})=>e(zte),label:({t:e})=>e(Lte)},kd=class extends li{get name(){return"code"}createTags(){return[oe.Code,oe.ExcludeInputRules]}createMarkSpec(e,t){return{excludes:"_",...t,attrs:e.defaults(),parseDOM:[{tag:"code",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["code",{spellcheck:"false",...e.dom(r)},0]}}createKeymap(){return{"Mod-`":ns({type:this.type})}}keyboardShortcut(e){return this.toggleCode()(e)}toggleCode(){return ns({type:this.type})}createInputRules(){return[Vu({regexp:new RegExp(`(?:\`)([^\`${kv}]+)(?:\`)$`),type:this.type,ignoreWhitespace:!0})]}createPasteRules(){return[{type:"mark",regexp:/`([^`]+)`/g,markType:this.type}]}};nx([je({shortcut:D.Code,command:"toggleCode"})],kd.prototype,"keyboardShortcut",1);nx([U(Ite)],kd.prototype,"toggleCode",1);kd=nx([pe({})],kd);var Dte=Hte,$te=Object.prototype.hasOwnProperty;function Hte(){for(var e={},t=0;t4&&r.slice(0,4)===lx&&Mre.test(t)&&(t.charAt(4)==="-"?n=_re(t):t=Are(t),o=Sre),new o(n,t))}function _re(e){var t=e.slice(5).replace(Z3,Rre);return lx+t.charAt(0).toUpperCase()+t.slice(1)}function Are(e){var t=e.slice(4);return Z3.test(t)?e:(t=t.replace(Tre,Nre),t.charAt(0)!=="-"&&(t="-"+t),lx+t)}function Nre(e){return"-"+e.toLowerCase()}function Rre(e){return e.charAt(1).toUpperCase()}var Pre=zre,qS=/[#.]/g;function zre(e,t){for(var r=e||"",n=t||"div",o={},i=0,s,a,l;i=48&&t<=57}var rie=nie;function nie(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}var oie=iie;function iie(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}var sie=oie,aie=rO,lie=cie;function cie(e){return sie(e)||aie(e)}var Nf,uie=59,die=fie;function fie(e){var t="&"+e+";",r;return Nf=Nf||document.createElement("i"),Nf.innerHTML=t,r=Nf.textContent,r.charCodeAt(r.length-1)===uie&&e!=="semi"||r===t?!1:r}var e4=Zoe,t4=eie,pie=rO,hie=rie,nO=lie,mie=die,gie=_ie,vie={}.hasOwnProperty,Ba=String.fromCharCode,yie=Function.prototype,r4={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:!1,nonTerminated:!0},bie=9,n4=10,xie=12,kie=32,o4=38,wie=59,Sie=60,Eie=61,Cie=35,Mie=88,Tie=120,Oie=65533,Ja="named",dx="hexadecimal",fx="decimal",px={};px[dx]=16;px[fx]=10;var Jm={};Jm[Ja]=nO;Jm[fx]=pie;Jm[dx]=hie;var oO=1,iO=2,sO=3,aO=4,lO=5,pv=6,cO=7,ws={};ws[oO]="Named character references must be terminated by a semicolon";ws[iO]="Numeric character references must be terminated by a semicolon";ws[sO]="Named character references cannot be empty";ws[aO]="Numeric character references cannot be empty";ws[lO]="Named character references must be known";ws[pv]="Numeric character references cannot be disallowed";ws[cO]="Numeric character references cannot be outside the permissible Unicode range";function _ie(e,t){var r={},n,o;t||(t={});for(o in r4)n=t[o],r[o]=n??r4[o];return(r.position.indent||r.position.start)&&(r.indent=r.position.indent||[],r.position=r.position.start),Aie(e,r)}function Aie(e,t){var r=t.additional,n=t.nonTerminated,o=t.text,i=t.reference,s=t.warning,a=t.textContext,l=t.referenceContext,c=t.warningContext,u=t.position,d=t.indent||[],f=e.length,p=0,h=-1,m=u.column||1,b=u.line||1,v="",g=[],y,x,k,w,E,T,C,M,N,F,I,V,j,z,q,A,P,B,Y;for(typeof r=="string"&&(r=r.charCodeAt(0)),A=J(),M=s?Ne:yie,p--,f++;++p65535&&(T-=65536,F+=Ba(T>>>10|55296),T=56320|T&1023),T=F+Ba(T))):z!==Ja&&M(aO,B)),T?(ie(),A=J(),p=Y-1,m+=Y-j+1,g.push(T),P=J(),P.offset++,i&&i.call(l,T,{start:A,end:P},e.slice(j-1,Y)),A=P):(w=e.slice(j-1,Y),v+=w,m+=w.length,p=Y-1)}else E===10&&(b++,h++,m=0),E===E?(v+=Ba(E),m++):ie();return g.join("");function J(){return{line:b,column:m,offset:p+(u.offset||0)}}function Ne(ue,de){var me=J();me.column+=de,me.offset+=de,s.call(c,ws[ue],me,ue)}function ie(){v&&(g.push(v),o&&o.call(a,v,{start:A,end:J()}),v="")}}function Nie(e){return e>=55296&&e<=57343||e>1114111}function Rie(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var uO={exports:{}};(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/** * Prism: Lightweight, robust, elegant syntax highlighting * * @license MIT * @author Lea Verou * @namespace * @public - */var r=function(n){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,s={},a={manual:n.Prism&&n.Prism.manual,disableWorkerMessageHandler:n.Prism&&n.Prism.disableWorkerMessageHandler,util:{encode:function g(y){return y instanceof l?new l(y.type,g(y.content),y.alias):Array.isArray(y)?y.map(g):y.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(k){var g=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(k.stack)||[])[1];if(g){var y=document.getElementsByTagName("script");for(var x in y)if(y[x].src==g)return y[x]}return null}},isActive:function(g,y,x){for(var k="no-"+y;g;){var w=g.classList;if(w.contains(y))return!0;if(w.contains(k))return!1;g=g.parentElement}return!!x}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(g,y){var x=a.util.clone(a.languages[g]);for(var k in y)x[k]=y[k];return x},insertBefore:function(g,y,x,k){k=k||a.languages;var w=k[g],E={};for(var M in w)if(w.hasOwnProperty(M)){if(M==y)for(var C in x)x.hasOwnProperty(C)&&(E[C]=x[C]);x.hasOwnProperty(M)||(E[M]=w[M])}var T=k[g];return k[g]=E,a.languages.DFS(a.languages,function(N,F){F===T&&N!=g&&(this[N]=E)}),E},DFS:function g(y,x,k,w){w=w||{};var E=a.util.objId;for(var M in y)if(y.hasOwnProperty(M)){x.call(y,M,y[M],k||M);var C=y[M],T=a.util.type(C);T==="Object"&&!w[E(C)]?(w[E(C)]=!0,g(C,x,null,w)):T==="Array"&&!w[E(C)]&&(w[E(C)]=!0,g(C,x,M,w))}}},plugins:{},highlightAll:function(g,y){a.highlightAllUnder(document,g,y)},highlightAllUnder:function(g,y,x){var k={callback:x,container:g,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",k),k.elements=Array.prototype.slice.apply(k.container.querySelectorAll(k.selector)),a.hooks.run("before-all-elements-highlight",k);for(var w=0,E;E=k.elements[w++];)a.highlightElement(E,y===!0,k.callback)},highlightElement:function(g,y,x){var k=a.util.getLanguage(g),w=a.languages[k];a.util.setLanguage(g,k);var E=g.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(E,k);var M=g.textContent,C={element:g,language:k,grammar:w,code:M};function T(F){C.highlightedCode=F,a.hooks.run("before-insert",C),C.element.innerHTML=C.highlightedCode,a.hooks.run("after-highlight",C),a.hooks.run("complete",C),x&&x.call(C.element)}if(a.hooks.run("before-sanity-check",C),E=C.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!C.code){a.hooks.run("complete",C),x&&x.call(C.element);return}if(a.hooks.run("before-highlight",C),!C.grammar){T(a.util.encode(C.code));return}if(y&&n.Worker){var N=new Worker(a.filename);N.onmessage=function(F){T(F.data)},N.postMessage(JSON.stringify({language:C.language,code:C.code,immediateClose:!0}))}else T(a.highlight(C.code,C.grammar,C.language))},highlight:function(g,y,x){var k={code:g,grammar:y,language:x};if(a.hooks.run("before-tokenize",k),!k.grammar)throw new Error('The language "'+k.language+'" has no grammar.');return k.tokens=a.tokenize(k.code,k.grammar),a.hooks.run("after-tokenize",k),l.stringify(a.util.encode(k.tokens),k.language)},tokenize:function(g,y){var x=y.rest;if(x){for(var k in x)y[k]=x[k];delete y.rest}var w=new d;return f(w,w.head,g),u(g,w,y,w.head,0),h(w)},hooks:{all:{},add:function(g,y){var x=a.hooks.all;x[g]=x[g]||[],x[g].push(y)},run:function(g,y){var x=a.hooks.all[g];if(!(!x||!x.length))for(var k=0,w;w=x[k++];)w(y)}},Token:l};n.Prism=a;function l(g,y,x,k){this.type=g,this.content=y,this.alias=x,this.length=(k||"").length|0}l.stringify=function g(y,x){if(typeof y=="string")return y;if(Array.isArray(y)){var k="";return y.forEach(function(T){k+=g(T,x)}),k}var w={type:y.type,content:g(y.content,x),tag:"span",classes:["token",y.type],attributes:{},language:x},E=y.alias;E&&(Array.isArray(E)?Array.prototype.push.apply(w.classes,E):w.classes.push(E)),a.hooks.run("wrap",w);var M="";for(var C in w.attributes)M+=" "+C+'="'+(w.attributes[C]||"").replace(/"/g,""")+'"';return"<"+w.tag+' class="'+w.classes.join(" ")+'"'+M+">"+w.content+""};function c(g,y,x,k){g.lastIndex=y;var w=g.exec(x);if(w&&k&&w[1]){var E=w[1].length;w.index+=E,w[0]=w[0].slice(E)}return w}function u(g,y,x,k,w,E){for(var M in x)if(!(!x.hasOwnProperty(M)||!x[M])){var C=x[M];C=Array.isArray(C)?C:[C];for(var T=0;T=E.reach);P+=A.value.length,A=A.next){var B=A.value;if(y.length>g.length)return;if(!(B instanceof l)){var Y=1,J;if(V){if(J=c(q,P,g,I),!J||J.index>=g.length)break;var de=J.index,Ne=J.index+J[0].length,ie=P;for(ie+=A.value.length;de>=ie;)A=A.next,ie+=A.value.length;if(ie-=A.value.length,P=ie,A.value instanceof l)continue;for(var ue=A;ue!==y.tail&&(ieE.reach&&(E.reach=ft);var rt=A.prev;Me&&(rt=f(y,rt,Me),P+=Me.length),p(y,rt,Y);var Or=new l(M,F?a.tokenize(he,F):he,j,he);if(A=f(y,rt,Or),Se&&f(y,A,Se),Y>1){var pe={cause:M+","+T,reach:ft};u(g,y,x,A.prev,P,pe),E&&pe.reach>E.reach&&(E.reach=pe.reach)}}}}}}function d(){var g={value:null,prev:null,next:null},y={value:null,prev:g,next:null};g.next=y,this.head=g,this.tail=y,this.length=0}function f(g,y,x){var k=y.next,w={value:x,prev:y,next:k};return y.next=w,k.prev=w,g.length++,w}function p(g,y,x){for(var k=y.next,w=0;w/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(r,n){var o={};o["language-"+n]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[n]},o.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:o}};i["language-"+n]={pattern:/[\s\S]+/,inside:e.languages[n]};var s={};s[r]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return r}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",s)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,r){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[r,"language-"+r],inside:e.languages[r]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}var Aie=fx;fx.displayName="css";fx.aliases=[];function fx(e){(function(t){var r=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+r.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+r.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+r.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:r,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var n=t.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))})(e)}var Nie=px;px.displayName="clike";px.aliases=[];function px(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}var Rie=hx;hx.displayName="javascript";hx.aliases=["js"];function hx(e){e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}var du=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof Ru=="object"?Ru:{},Pie=Yie();du.Prism={manual:!0,disableWorkerMessageHandler:!0};var zie=Yre,Lie=die,sO=Oie,Iie=_ie,Die=Aie,$ie=Nie,Hie=Rie;Pie();var mx={}.hasOwnProperty;function aO(){}aO.prototype=sO;var Et=new aO,Bie=Et;Et.highlight=Vie;Et.register=Jd;Et.alias=Fie;Et.registered=jie;Et.listLanguages=Uie;Jd(Iie);Jd(Die);Jd($ie);Jd(Hie);Et.util.encode=qie;Et.Token.stringify=Wie;function Jd(e){if(typeof e!="function"||!e.displayName)throw new Error("Expected `function` for `grammar`, got `"+e+"`");Et.languages[e.displayName]===void 0&&e(Et)}function Fie(e,t){var r=Et.languages,n=e,o,i,s,a;t&&(n={},n[e]=t);for(o in n)for(i=n[o],i=typeof i=="string"?[i]:i,s=i.length,a=-1;++a{for(var o=n>1?void 0:n?Xie(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Jie(t,r,o),o},lO=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},xi=(e,t,r)=>(lO(e,t,"read from private field"),r?r.call(e):t.get(e)),u1=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},d1=(e,t,r,n)=>(lO(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),cO="data-code-block-language";function uO(e,t,r=[]){return e.map(n=>{const o=[...r];return n.type==="element"&&n.properties.className?o.push(...n.properties.className):n.type==="text"&&o.length===0&&t&&o.push(t),n.type==="element"?uO(n.children,t,o):{text:n.value,classes:o}})}function Qie(e,t){var r;const{node:n,pos:o}=e,i=yh({language:(r=n.attrs.language)==null?void 0:r.replace("language-",""),fallback:"markup"}),s=gx.highlight(n.textContent??"",i),a=uO(s,t);let l=o+1;function c(u){const d=l,f=d+u.text.length;return l=f,{...u,from:d,to:f}}return W4(a).map(c)}function r4(e){const{blocks:t,skipLast:r,plainTextClassName:n}=e,o=[];for(const i of t){const s=Qie(i,n),a=r?s.length-1:s.length;for(const l of kv(a)){const c=s[l],u=c==null?void 0:c.classes;if(!c||!(u!=null&&u.length))continue;const d=Ge.inline(c.from,c.to,{class:u.join(" ")});o.push(d)}}return o}function Zie(e){return!!(e&&Zt(e)&&ne(e.language)&&e.language.length>0)}function ese(e){return t=>({state:{tr:r,selection:n},dispatch:o})=>{if(!Zie(t))throw new Error("Invalid attrs passed to the updateAttributes method");const i=ts({types:e,selection:n});return!i||U4(t,i.node.attrs)?!1:(r.setNodeMarkup(i.pos,e,{...i.node.attrs,...t}),o&&o(r),!0)}}function yh(e){const{language:t,fallback:r}=e;if(!t)return r;const n=gx.listLanguages();for(const o of n)if(o.toLowerCase()===t.toLowerCase())return o;return r}function tse(e,t){const{language:r,wrap:n}=Dd(e.attrs,t),{style:o,...i}=t.dom(e);let s=i.style;return n&&(s=Uv({whiteSpace:"pre-wrap",wordBreak:"break-all"},s)),["pre",{spellcheck:"false",...i,class:Vu(i.class,`language-${r}`)},["code",{[cO]:r,style:s},0]]}function rse(e){return({pos:t}=ee())=>({tr:r,dispatch:n})=>{const{type:o,formatter:i,defaultLanguage:s}=e,{from:a,to:l}=t?{from:t,to:t}:r.selection,c=ts({types:o,selection:r.selection});if(!c)return!1;const{node:{attrs:u,textContent:d},start:f}=c,p=a-f,h=l-f,m=yh({language:u.language,fallback:s}),b=i({source:d,language:m,cursorOffset:p});let v;if(p!==h&&(v=i({source:d,language:m,cursorOffset:h})),!b)return!1;const{cursorOffset:g,formatted:y}=b;if(y===d)return!1;const x=f+d.length;r.insertText(y,f,x);const k=f+g,w=v?f+v.cursorOffset:void 0;return r.setSelection(le.between(r.doc.resolve(k),r.doc.resolve(w??k))),n&&n(r),!0}}function nse(e){var t;return(t=e.getAttribute(cO)??e.classList[0])==null?void 0:t.replace("language-","")}var{DESCRIPTION:ose,LABEL:ise}=JN,sse={icon:"bracesLine",description:({t:e})=>e(ose),label:({t:e})=>e(ise)},Ps,fu,pu,ase=class{constructor(e,t){u1(this,Ps,void 0),u1(this,fu,void 0),u1(this,pu,!1),d1(this,fu,e),d1(this,Ps,t)}init(e){const t=Lz({node:e.doc,type:xi(this,fu)});return this.refreshDecorationSet(e.doc,t),this}refreshDecorationSet(e,t){const r=r4({blocks:t,skipLast:xi(this,pu),defaultLanguage:xi(this,Ps).options.defaultLanguage,plainTextClassName:xi(this,Ps).options.plainTextClassName??void 0});this.decorationSet=Ee.create(e,r)}apply(e,t){if(!e.docChanged)return this;this.decorationSet=this.decorationSet.map(e.mapping,e.doc);const r=Iz(e,{descend:!0,predicate:n=>n.type===xi(this,fu),StepTypes:[]});return this.updateDecorationSet(e,r),this}updateDecorationSet(e,t){if(t.length===0)return;let r=this.decorationSet;for(const{node:n,pos:o}of t)r=this.decorationSet.remove(this.decorationSet.find(o,o+n.nodeSize));this.decorationSet=r.add(e.doc,r4({blocks:t,skipLast:xi(this,pu),defaultLanguage:xi(this,Ps).options.defaultLanguage,plainTextClassName:xi(this,Ps).options.plainTextClassName??void 0}))}setDeleted(e){d1(this,pu,e)}};Ps=new WeakMap;fu=new WeakMap;pu=new WeakMap;var lo=class extends er{get name(){return"codeBlock"}createTags(){return[oe.Block,oe.Code]}init(){this.registerLanguages()}createNodeSpec(e,t){const r=/highlight-(?:text|source)-([\da-z]+)/;return{content:"text*",marks:"",defining:!0,draggable:!1,...t,code:!0,attrs:{...e.defaults(),language:{default:this.options.defaultLanguage},wrap:{default:this.options.defaultWrap}},parseDOM:[{tag:"div.highlight",preserveWhitespace:"full",getAttrs:n=>{var o,i;if(!Je(n))return!1;const s=n.querySelector("pre.code");if(!Je(s))return!1;const a=xn(s,"white-space")==="pre-wrap",l=(i=(o=n.className.match(r))==null?void 0:o[1])==null?void 0:i.replace("language-","");return{...e.parse(n),language:l,wrap:a}}},{tag:"pre",preserveWhitespace:"full",getAttrs:n=>{if(!Je(n))return!1;const o=n.querySelector("code");if(!Je(o))return!1;const i=xn(o,"white-space")==="pre-wrap",s=this.options.getLanguageFromDom(o,n);return{...e.parse(n),language:s,wrap:i}}},...t.parseDOM??[]],toDOM:n=>tse(n,e)}}createAttributes(){return{class:eV[this.options.syntaxTheme.toUpperCase()]}}createInputRules(){const e=/^```([\dA-Za-z]*) $/,t=r=>({language:yh({language:Zo(r,1),fallback:this.options.defaultLanguage})});return[I5({regexp:e,type:this.type,beforeDispatch:({tr:r,start:n})=>{const o=r.doc.resolve(n);r.setSelection(le.near(o))},getAttributes:t})]}onSetOptions(e){const{changes:t}=e;t.supportedLanguages.changed&&this.registerLanguages(),t.syntaxTheme.changed&&this.store.updateAttributes()}createPlugin(){const e=new ase(this.type,this),t=()=>(e.setDeleted(!0),!1);return{state:{init(r,n){return e.init(n)},apply(r,n,o,i){return e.apply(r,i)}},props:{handleKeyDown:qv({Backspace:t,"Mod-Backspace":t,Delete:t,"Mod-Delete":t,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t}),decorations(){return e.setDeleted(!1),e.decorationSet}}}}toggleCodeBlock(e={}){return Wv({type:this.type,toggleType:this.options.toggleName,attrs:{language:this.options.defaultLanguage,...e}})}createCodeBlock(e){return Bu(this.type,e)}updateCodeBlock(e){return ese(this.type)(e)}formatCodeBlock(e){return rse({type:this.type,formatter:this.options.formatter,defaultLanguage:this.options.defaultLanguage})(e)}tabKey({state:e,dispatch:t}){const{selection:r,tr:n,schema:o}=e,{node:i}=J6(r);if(!Lh({node:i,types:this.type}))return!1;if(r.empty)n.insertText(" ");else{const{from:s,to:a}=r;n.replaceWith(s,a,o.text(" "))}return t&&t(n),!0}backspaceKey({dispatch:e,tr:t,state:r}){if(!t.selection.empty)return!1;const n=ts({types:this.type,selection:t.selection});if((n==null?void 0:n.start)!==t.selection.from)return!1;const{pos:o,node:i,start:s}=n,a=it(r.schema.nodes,this.options.toggleName);return i.textContent.trim()===""?t.doc.lastChild===i&&t.doc.firstChild===i?G6({pos:o,tr:t,content:a.create()}):q6({pos:o,tr:t}):s>2?t.setSelection(le.near(t.doc.resolve(s-2))):(t.insert(0,a.create()),t.setSelection(le.near(t.doc.resolve(1)))),e&&e(t),!0}enterKey({dispatch:e,tr:t}){if(!(gs(t.selection)&&t.selection.empty))return!1;const{nodeBefore:r,parent:n}=t.selection.$anchor;if(!(r!=null&&r.isText)||!n.type.isTextblock)return!1;const o=/^```([A-Za-z]*)?$/,{text:i,nodeSize:s}=r,{textContent:a}=n;if(!i)return!1;const l=i.match(o),c=a.match(o);if(!l||!c)return!1;const[,u]=l,d=yh({language:u,fallback:this.options.defaultLanguage}),f=t.selection.$from.before(),p=f+s+1;return t.replaceWith(f,p,this.type.create({language:d})),t.setSelection(le.near(t.doc.resolve(f+1))),e&&e(t),!0}formatShortcut({tr:e}){const t=this.store.commands;if(!b5({type:this.type,state:e}))return!1;const r=t.formatCodeBlock.isEnabled();return r&&t.formatCodeBlock(),r}registerLanguages(){for(const e of this.options.supportedLanguages)gx.register(e)}};pi([U(sse)],lo.prototype,"toggleCodeBlock",1);pi([U()],lo.prototype,"createCodeBlock",1);pi([U()],lo.prototype,"updateCodeBlock",1);pi([U()],lo.prototype,"formatCodeBlock",1);pi([je({shortcut:"Tab"})],lo.prototype,"tabKey",1);pi([je({shortcut:"Backspace"})],lo.prototype,"backspaceKey",1);pi([je({shortcut:"Enter"})],lo.prototype,"enterKey",1);pi([je({shortcut:D.Format})],lo.prototype,"formatShortcut",1);lo=pi([me({defaultOptions:{supportedLanguages:[],toggleName:"paragraph",formatter:({source:e})=>({cursorOffset:0,formatted:e}),syntaxTheme:"a11y_dark",defaultLanguage:"markup",defaultWrap:!1,plainTextClassName:"",getLanguageFromDom:nse},staticKeys:["getLanguageFromDom"]})],lo);var dO=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},ze=(e,t,r)=>(dO(e,t,"read from private field"),r?r.call(e):t.get(e)),Xa=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Mi=(e,t,r,n)=>(dO(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),lse='',cse='',use=encodeURIComponent(lse),dse=encodeURIComponent(cse),Ar,fse=class{constructor(e){Xa(this,Ar,void 0);const t=document.createElement("div"),r=document.createElement("div");this.dom=t,Mi(this,Ar,r),this.type=e,this.createHandle(e)}createHandle(e){switch(sr(this.dom,{position:"absolute",pointerEvents:"auto",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"100"}),sr(ze(this,Ar),{opacity:"0",transition:"opacity 300ms ease-in 0s"}),ze(this,Ar).dataset.dragging="",e){case 0:sr(this.dom,{right:"0px",top:"0px",height:"100%",width:"15px",cursor:"col-resize"}),sr(ze(this,Ar),{width:" 4px",height:"36px",maxHeight:"50%",boxSizing:"content-box",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 1:sr(this.dom,{left:"0px",top:"0px",height:"100%",width:"15px",cursor:"col-resize"}),sr(ze(this,Ar),{width:" 4px",height:"36px",maxHeight:"50%",boxSizing:"content-box",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 2:sr(this.dom,{bottom:"0px",width:"100%",height:"14px",cursor:"row-resize"}),sr(ze(this,Ar),{width:" 42px",height:"4px",boxSizing:"content-box",maxWidth:"50%",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 3:sr(this.dom,{right:"-1px",bottom:"-2px",width:"30px",height:"30px",cursor:"nwse-resize",zIndex:"101"}),sr(ze(this,Ar),{height:"22px",width:"22px",backgroundRepeat:"no-repeat",backgroundImage:`url("data:image/svg+xml,${dse}") `});break;case 4:sr(this.dom,{left:"-1px",bottom:"-2px",width:"30px",height:"30px",cursor:"nesw-resize",zIndex:"101"}),sr(ze(this,Ar),{height:"22px",width:"22px",backgroundRepeat:"no-repeat",backgroundImage:`url("data:image/svg+xml,${use}") `});break}this.dom.append(ze(this,Ar))}setHandleVisibility(e){const t=e||!!ze(this,Ar).dataset.dragging;ze(this,Ar).style.opacity=t?"1":"0"}dataSetDragging(e){ze(this,Ar).dataset.dragging=e?"true":""}};Ar=new WeakMap;var Af=50,fO=(e=>(e[e.Fixed=0]="Fixed",e[e.Flexible=1]="Flexible",e))(fO||{}),zs,Ls,Is,Bo,Ds,pse=class{constructor({node:e,view:t,getPos:r,aspectRatio:n=0,options:o,initialSize:i}){Xa(this,zs,void 0),Xa(this,Ls,void 0),Xa(this,Is,[]),Xa(this,Bo,void 0),Xa(this,Ds,void 0);const s=this.createWrapper(e,i),a=this.createElement({node:e,view:t,getPos:r,options:o}),c=(n===1?[0,1,2,3,4]:[0,1]).map(f=>new fse(f));for(const f of c){const p=h=>{this.startResizing(h,t,r,f)};f.dom.addEventListener("mousedown",p),ze(this,Is).push(()=>f.dom.removeEventListener("mousedown",p)),s.append(f.dom)}const u=()=>{c.forEach(f=>f.setHandleVisibility(!0))},d=()=>{c.forEach(f=>f.setHandleVisibility(!1))};s.addEventListener("mouseover",u),s.addEventListener("mouseout",d),ze(this,Is).push(()=>s.removeEventListener("mouseover",u),()=>s.removeEventListener("mouseout",d)),s.append(a),this.dom=s,Mi(this,Ls,e),Mi(this,zs,a),this.aspectRatio=n}createWrapper(e,t){const r=document.createElement("div");return r.classList.add("remirror-resizable-view"),r.style.position="relative",t?sr(r,{width:n4(t.width),aspectRatio:`${t.width} / ${t.height}`}):sr(r,{width:n4(e.attrs.width),aspectRatio:`${e.attrs.width} / ${e.attrs.height}`}),sr(r,{maxWidth:"100%",minWidth:`${Af}px`,verticalAlign:"bottom",display:"inline-block",lineHeight:"0",transition:"width 0.15s ease-out, height 0.15s ease-out"}),r}startResizing(e,t,r,n){var o,i;e.preventDefault(),n.dataSetDragging(!0),ze(this,zs).style.pointerEvents="none";const s=e.pageX,a=e.pageY,l=((o=ze(this,zs))==null?void 0:o.getBoundingClientRect().width)||0,c=((i=ze(this,zs))==null?void 0:i.getBoundingClientRect().height)||0,u=x1(100,!1,f=>{const p=f.pageX,h=f.pageY,m=p-s,b=h-a;let v=null,g=null;if(this.aspectRatio===0&&l&&c)switch(n.type){case 0:case 3:v=l+m,g=c/l*v;break;case 1:case 4:v=l-m,g=c/l*v;break;case 2:g=c+b,v=l/c*g;break}else if(this.aspectRatio===1)switch(n.type){case 0:v=l+m;break;case 1:v=l-m;break;case 2:g=c+b;break;case 3:v=l+m,g=c+b;break;case 4:v=l-m,g=c+b;break}typeof v=="number"&&v{f.preventDefault(),n.dataSetDragging(!1),n.setHandleVisibility(!1),ze(this,zs).style.pointerEvents="auto",document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",d);const p=r(),h=t.state.tr.setNodeMarkup(p,void 0,{...ze(this,Ls).attrs,width:ze(this,Bo),height:ze(this,Ds)});t.dispatch(h)};document.addEventListener("mousemove",u),document.addEventListener("mouseup",d),ze(this,Is).push(()=>document.removeEventListener("mousemove",u)),ze(this,Is).push(()=>document.removeEventListener("mouseup",d))}update(e){return e.type!==ze(this,Ls).type||this.aspectRatio===0&&e.attrs.width&&e.attrs.width!==ze(this,Bo)||this.aspectRatio===1&&e.attrs.width&&e.attrs.height&&e.attrs.width!==ze(this,Bo)&&e.attrs.height!==ze(this,Ds)||!hse(ze(this,Ls),e,["width","height"])?!1:(Mi(this,Ls,e),Mi(this,Bo,e.attrs.width),Mi(this,Ds,e.attrs.height),!0)}destroy(){ze(this,Is).forEach(e=>e())}};zs=new WeakMap;Ls=new WeakMap;Is=new WeakMap;Bo=new WeakMap;Ds=new WeakMap;function hse(e,t,r){return e===t||mse(e,t,r)&&e.content.eq(t.content)}function mse(e,t,r){const n=e.attrs,o=t.attrs,i={};for(const a of r)i[a]=null;e.attrs={...n,...i},t.attrs={...o,...i};const s=e.sameMarkup(t);return e.attrs=n,t.attrs=o,s}function n4(e){return typeof e=="number"?`${e}px`:e||void 0}var pO={exports:{}},gse=Number.isNaN||function(e){return e!==e},vse=gse,vx=Number.isFinite||function(e){return!(typeof e!="number"||vse(e)||e===1/0||e===-1/0)},yse=vx,bse=Number.isInteger||function(e){return typeof e=="number"&&yse(e)&&Math.floor(e)===e},xse=vx,kse=bse,wse=function(t,r){if(!xse(t))throw new Error("Value must be a finite number");if(!kse(r)||r<0)throw new Error("Precision must be a non-negative integer");return parseFloat(t.toFixed(r))},Sse=/^(-?\d?\.?\d+)e([\+\-]\d)+/,Ese=function(t){var r=t.match(Sse);if(!r)throw new Error("Invalid exponential");return r.slice(1)},Cse=vx,Mse=Ese,Tse=function(t){if(!Cse(t))throw new Error("Value must be a finite number");var r=Mse(t.toExponential()),n=r[0],o=parseInt(r[1],10),i=(n.split(".")[1]||"").length;return!i&&o>0?0:i+-1*o};(function(e,t){var r=wse,n=Tse;e.exports=i;var o={down:"floor",up:"ceil"};function i(s,a,l){if(a=a||1,l){if(!o.hasOwnProperty(l))throw new Error("invalid direction");var c=o[l];return r(Math[c](s/a)*a,n(a))}var u=i(s,a,"down"),d=i(s,a,"up");return s-u{for(var o=n>1?void 0:n?Nse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ase(t,r,o),o},Rse={icon:"fontSize",description:({t:e})=>e(Al.SET_DESCRIPTION),label:({t:e})=>e(Al.SET_LABEL)},Pse={icon:"addLine",description:({t:e})=>e(Al.INCREASE_DESCRIPTION),label:({t:e})=>e(Al.INCREASE_LABEL)},zse={icon:"subtractLine",description:({t:e})=>e(Al.DECREASE_DESCRIPTION),label:({t:e})=>e(Al.DECREASE_LABEL)},f1="data-font-size-mark",co=class extends li{get name(){return"fontSize"}createTags(){return[oe.FormattingMark,oe.FontStyle]}createMarkSpec(e,t){return{...t,attrs:{...e.defaults(),size:{default:this.options.defaultSize}},parseDOM:[{tag:`span[${f1}]`,getAttrs:r=>{if(!Je(r))return null;let n=r.getAttribute(f1);return n?(n=`${gg(n,this.options.unit,r)}${this.options.unit}`,{...e.parse(r),size:n}):null}},{style:"font-size",priority:Ae.Low,getAttrs:r=>ne(r)?(r=this.getFontSize(r),{size:r}):null},...t.parseDOM??[]],toDOM:r=>{const{size:n,...o}=Dd(r.attrs,e),i=e.dom(r);let s=i.style,a;return n&&(s=Uv({fontSize:this.getFontSize(n)},s)),["span",{...o,...i,style:s,[f1]:a},0]}}}getFontSize(e){var t;const{unit:r,roundingMultiple:n,max:o,min:i,defaultSize:s}=this.options,a=gg(e,r,(t=this.store.view)==null?void 0:t.dom);return Number.isNaN(a)?s||"1rem":`${_d({value:_se(a,n),max:o,min:i})}${r}`}setFontSize(e,t){return this.store.commands.applyMark.original(this.type,{size:String(e)},t==null?void 0:t.selection)}increaseFontSize(e){const{increment:t}=this.options;return r=>{const[n]=this.getFontSizeForSelection(e==null?void 0:e.selection);let[o]=n;return o+=_e(t)?t(n,1):t,this.setFontSize(o,e)(r)}}decreaseFontSize(e){const{increment:t}=this.options;return r=>{const[n]=this.getFontSizeForSelection(e==null?void 0:e.selection);let[o]=n;return o-=_e(t)?t(n,-1):t,this.setFontSize(o,e)(r)}}removeFontSize(e){return this.store.commands.removeMark.original({type:this.type,expand:!1,...e})}increaseFontSizeShortcut(e){return this.increaseFontSize()(e)}decreaseFontSizeShortcut(e){return this.decreaseFontSize()(e)}getFontSizeForSelection(e){const t=this.store.getState(),r=jr(e??t.selection,t.doc),[n,...o]=dz(r,this.type);if(n)return[If(n.mark.attrs.size),...o.map(l=>If(l.mark.attrs.size))];const{defaultSize:i,unit:s}=this.options;return[[gg(i,s),s]]}getFontSizeFromDom(e){const t=this.store.getState(),r=jr(e??t.selection,t.doc),n=this.store.view.domAtPos(r.from),o=Je(n.node)?n.node:this.store.view.dom;return If(Pl(o))}};hi([U(Rse)],co.prototype,"setFontSize",1);hi([U(Pse)],co.prototype,"increaseFontSize",1);hi([U(zse)],co.prototype,"decreaseFontSize",1);hi([U()],co.prototype,"removeFontSize",1);hi([je({shortcut:D.IncreaseFontSize,command:"increaseFontSize"})],co.prototype,"increaseFontSizeShortcut",1);hi([je({shortcut:D.IncreaseFontSize,command:"decreaseFontSize"})],co.prototype,"decreaseFontSizeShortcut",1);hi([He()],co.prototype,"getFontSizeForSelection",1);hi([He()],co.prototype,"getFontSizeFromDom",1);co=hi([me({defaultOptions:{defaultSize:"",unit:"pt",increment:1,max:100,min:1,roundingMultiple:.5},staticKeys:["defaultSize"]})],co);var Lse=Object.defineProperty,Ise=Object.getOwnPropertyDescriptor,hO=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ise(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Lse(t,r,o),o},bh=class extends er{get name(){return"hardBreak"}createTags(){return[oe.InlineNode]}createNodeSpec(e,t){return{inline:!0,selectable:!1,atom:!0,leafText:()=>` -`,...t,attrs:e.defaults(),parseDOM:[{tag:"br",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["br",e.dom(r)]}}createKeymap(){const e=F6(yu(V5),()=>(this.store.commands.insertHardBreak(),!0));return{"Mod-Enter":e,"Shift-Enter":e}}insertHardBreak(){return e=>{const{tr:t,dispatch:r}=e;return r==null||r(t.replaceSelectionWith(this.type.create()).scrollIntoView()),!0}}};hO([U()],bh.prototype,"insertHardBreak",1);bh=hO([me({defaultPriority:Ae.Low})],bh);var Dse=Object.defineProperty,$se=Object.getOwnPropertyDescriptor,mO=(e,t,r,n)=>{for(var o=n>1?void 0:n?$se(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Dse(t,r,o),o},{LABEL:Hse}=aR,Bse={icon:({attrs:e})=>`h${(e==null?void 0:e.level)??"1"}`,label:({t:e,attrs:t})=>e({...Hse,values:{level:t==null?void 0:t.level}})},Fse=[D.H1,D.H2,D.H3,D.H4,D.H5,D.H6],xh=class extends er{get name(){return"heading"}createTags(){return[oe.Block,oe.TextBlock,oe.FormattingNode]}createNodeSpec(e,t){return{content:"inline*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),level:{default:this.options.defaultLevel}},parseDOM:[...this.options.levels.map(r=>({tag:`h${r}`,getAttrs:n=>({...e.parse(n),level:r})})),...t.parseDOM??[]],toDOM:r=>this.options.levels.includes(r.attrs.level)?[`h${r.attrs.level}`,e.dom(r),0]:[`h${this.options.defaultLevel}`,e.dom(r),0]}}toggleHeading(e={}){return Wv({type:this.type,toggleType:"paragraph",attrs:e})}createKeymap(e){const t=this.store.getExtension(xe),r=ee(),n=[];for(const o of this.options.levels){const i=Fse[o-1]??D.H1;r[i]=Bu(this.type,{level:o}),n.push({attrs:{level:o},shortcut:e(i)[0]})}return t.updateDecorated("toggleHeading",{shortcut:n}),r}createInputRules(){return this.options.levels.map(e=>DR(new RegExp(`^(#{1,${e}})\\s$`),this.type,()=>({level:e})))}createPasteRules(){return this.options.levels.map(e=>({type:"node",nodeType:this.type,regexp:new RegExp(`^#{${e}}\\s([\\s\\w]+)$`),getAttributes:()=>({level:e}),startOfTextBlock:!0}))}};mO([U(Bse)],xh.prototype,"toggleHeading",1);xh=mO([me({defaultOptions:{levels:[1,2,3,4,5,6],defaultLevel:1},staticKeys:["defaultLevel","levels"]})],xh);var Vse=Object.defineProperty,jse=Object.getOwnPropertyDescriptor,gO=(e,t,r,n)=>{for(var o=n>1?void 0:n?jse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Vse(t,r,o),o},Use={icon:"separator",label:({t:e})=>e(hk.LABEL),description:({t:e})=>e(hk.DESCRIPTION)},kh=class extends er{get name(){return"horizontalRule"}createTags(){return[oe.Block]}createNodeSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"hr",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["hr",e.dom(r)]}}insertHorizontalRule(){return e=>{const{tr:t,dispatch:r}=e,n=t.selection.$anchor,o=n.parent;return o.type.name==="doc"||o.isAtom||o.isLeaf?!1:(r&&(t.selection.empty&&Dh(o)&&t.insert(n.pos+1,o),t.replaceSelectionWith(this.type.create()),this.updateFromNodeSelection(t),r(t.scrollIntoView())),!0)}}createInputRules(){return[I5({regexp:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type,beforeDispatch:({tr:e})=>{this.updateFromNodeSelection(e)}})]}updateFromNodeSelection(e){if(!Id(e.selection)||e.selection.node.type.name!==this.name)return;const t=e.selection.$from.pos+1,{insertionNode:r}=this.options;if(!r)return;const n=this.store.schema.nodes[r];te(n,{code:H.EXTENSION,message:`'${r}' node provided as the insertionNode to the '${this.constructorName}' does not exist.`});const o=n.create();e.insert(t,o),e.setSelection(le.near(e.doc.resolve(t+1)))}};gO([U(Use)],kh.prototype,"insertHorizontalRule",1);kh=gO([me({defaultOptions:{insertionNode:"paragraph"}})],kh);var Wse=Object.defineProperty,Kse=Object.getOwnPropertyDescriptor,yx=(e,t,r,n)=>{for(var o=n>1?void 0:n?Kse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Wse(t,r,o),o},qse=class extends pse{constructor(e,t,r){super({node:e,view:t,getPos:r,aspectRatio:fO.Fixed})}createElement({node:e}){const t=document.createElement("img");return t.setAttribute("src",e.attrs.src),sr(t,{width:"100%",minWidth:"50px",objectFit:"contain"}),t}},kd=class extends er{get name(){return"image"}createTags(){return[oe.InlineNode,oe.Media]}createNodeSpec(e,t){const{preferPastedTextContent:r}=this.options;return{inline:!0,draggable:!0,selectable:!1,...t,attrs:{...e.defaults(),alt:{default:""},crop:{default:null},height:{default:null},width:{default:null},rotate:{default:null},src:{default:null},title:{default:""},fileName:{default:null},resizable:{default:!1}},parseDOM:[{tag:"img[src]",getAttrs:n=>{var o;if(Je(n)){const i=Yse({element:n,parse:e.parse});return r&&((o=i.src)!=null&&o.startsWith("file:///"))?!1:i}return{}}},...t.parseDOM??[]],toDOM:n=>{const o=Dd(n.attrs,e);return["img",{...e.dom(n),...o}]}}}insertImage(e,t){return({tr:r,dispatch:n})=>{const{from:o,to:i}=jr(t??r.selection,r.doc),s=this.type.create(e);return n==null||n(r.replaceRangeWith(o,i,s)),!0}}uploadImage(e,t){const{updatePlaceholder:r,destroyPlaceholder:n,createPlaceholder:o}=this.options;return i=>{const{tr:s}=i;let a=s.selection.from;return this.store.createPlaceholderCommand({promise:e,placeholder:{type:"widget",get pos(){return a},createElement:(l,c)=>{const u=o(l,c);return t==null||t(u),u},onUpdate:(l,c,u,d)=>{r(l,c,u,d)},onDestroy:(l,c)=>{n(l,c)}},onSuccess:(l,c,u)=>this.insertImage(l,c)(u)}).validate(({tr:l,dispatch:c})=>{const u=xE(l.doc,a,this.type);return u==null?!1:(a=u,l.selection.empty||c==null||c(l.deleteSelection()),!0)},"unshift").generateCommand()(i)}}fileUploadFileHandler(e,t,r){var n;const{preferPastedTextContent:o,uploadHandler:i}=this.options;if(o&&Qse(t)&&((n=t.clipboardData)!=null&&n.getData("text/plain")))return!1;const{commands:s,chain:a}=this.store,l=e.map((u,d)=>({file:u,progress:f=>{s.updatePlaceholder(c[d],f)}})),c=i(l);Jt(r)&&a.selectText(r);for(const u of c)a.uploadImage(u);return a.run(),!0}createPasteRules(){return[{type:"file",regexp:/image/i,fileHandler:e=>{const t=e.type==="drop"?e.pos:void 0;return this.fileUploadFileHandler(e.files,e.event,t)}}]}createNodeViews(){return this.options.enableResizing?(e,t,r)=>new qse(e,t,r):{}}};yx([U()],kd.prototype,"insertImage",1);yx([U()],kd.prototype,"uploadImage",1);kd=yx([me({defaultOptions:{createPlaceholder:Jse,updatePlaceholder:()=>{},destroyPlaceholder:()=>{},uploadHandler:Xse,enableResizing:!1,preferPastedTextContent:!0}})],kd);function Gse(e){let{width:t,height:r}=e.style;return t=t||e.getAttribute("width")||"",r=r||e.getAttribute("height")||"",{width:t,height:r}}function Yse({element:e,parse:t}){const{width:r,height:n}=Gse(e);return{...t(e),alt:e.getAttribute("alt")??"",height:Number.parseInt(n||"0",10)||null,src:e.getAttribute("src")??null,title:e.getAttribute("title")??"",width:Number.parseInt(r||"0",10)||null,fileName:e.getAttribute("data-file-name")??null}}function Jse(e,t){const r=document.createElement("div");return r.classList.add(rV.IMAGE_LOADER),r}function Xse(e){te(e.length>0,{code:H.EXTENSION,message:"The upload handler was applied for the image extension without any valid files"});let t=0;const r=[];for(const{file:n,progress:o}of e)r.push(()=>new Promise(i=>{const s=new FileReader;s.addEventListener("load",a=>{var l;t+=1,o(t/e.length),i({src:(l=a.target)==null?void 0:l.result,fileName:n.name})},{once:!0}),s.readAsDataURL(n)}));return r}function Qse(e){return e.clipboardData!==void 0}var Zse=Object.defineProperty,eae=Object.getOwnPropertyDescriptor,bx=(e,t,r,n)=>{for(var o=n>1?void 0:n?eae(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Zse(t,r,o),o},tae={icon:"italic",label:({t:e})=>e(mk.LABEL),description:({t:e})=>e(mk.DESCRIPTION)},wd=class extends li{get name(){return"italic"}createTags(){return[oe.FontStyle,oe.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"i",getAttrs:e.parse},{tag:"em",getAttrs:e.parse},{style:"font-style=italic"},...t.parseDOM??[]],toDOM:r=>["em",e.dom(r),0]}}createKeymap(){return{"Mod-i":ns({type:this.type})}}createInputRules(){return[Fu({regexp:/(?:^|[^*])\*([^*]+)\*$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:e,start:t})=>e.startsWith("*")?{}:{fullMatch:e.slice(1),start:t+1}}),Fu({regexp:/(?:^|\W)_([^_]+)_$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:e,start:t})=>e.startsWith("_")?{}:{fullMatch:e.slice(1),start:t+1}})]}createPasteRules(){return[{type:"mark",markType:this.type,regexp:/(?:^|\W)_([^_]+)_/g},{type:"mark",markType:this.type,regexp:/\*([^*]+)\*/g}]}toggleItalic(e){return ns({type:this.type,selection:e})}shortcut(e){return this.toggleItalic()(e)}};bx([U(tae)],wd.prototype,"toggleItalic",1);bx([je({shortcut:D.Italic,command:"toggleItalic"})],wd.prototype,"shortcut",1);wd=bx([me({})],wd);var vO={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(typeof self<"u"?self:Ru,function(){return function(r){function n(i){if(o[i])return o[i].exports;var s=o[i]={i,l:!1,exports:{}};return r[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}var o={};return n.m=r,n.c=o,n.d=function(i,s,a){n.o(i,s)||Object.defineProperty(i,s,{configurable:!1,enumerable:!0,get:a})},n.n=function(i){var s=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(s,"a",s),s},n.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)},n.p="",n(n.s=0)}([function(r,n,o){function i(){throw new TypeError("The given URL is not a string. Please verify your string|array.")}function s(c){typeof c!="string"&&i();for(var u=0,d=0,f=0,p=c.length,h=0;p--&&++h&&!(u&&-1f?"":c.slice(f,u)}var a=["/",":","?","#"],l=[".","/","@"];r.exports=function(c){if(typeof c=="string")return s(c);if(Array.isArray(c)){var u=[],d,f=0;for(d=c.length;f{for(var o=n>1?void 0:n?iae(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&oae(t,r,o),o},sae=["com","de","net","org","uk","cn","ga","nl","cf","ml","tk","ru","br","gq","xyz","fr","eu","info","co","au","ca","it","in","ch","pl","es","online","us","top","be","jp","biz","se","at","dk","cz","za","me","ir","icu","shop","kr","site","mx","hu","io","cc","club","no","cyou"],o4="updateLink",aae=/(?:(?:(?:https?|ftp):)?\/\/)?(?:\S+(?::\S*)?@)?(?:(?:[\da-z\u00A1-\uFFFF][\w\u00A1-\uFFFF-]{0,62})?[\da-z\u00A1-\uFFFF]\.)*(?:(?:\d(?!\.)|[a-z\u00A1-\uFFFF])(?:[\da-z\u00A1-\uFFFF][\w\u00A1-\uFFFF-]{0,62})?[\da-z\u00A1-\uFFFF]\.)+[a-z\u00A1-\uFFFF]{2,}(?::\d{2,5})?(?:[#/?]\S*)?/gi,us=class extends li{constructor(){super(...arguments),this._autoLinkRegexNonGlobal=void 0}get name(){return"link"}createTags(){return[oe.Link,oe.ExcludeInputRules]}createMarkSpec(e,t){const r="data-link-auto",n=o=>{const{defaultTarget:i,supportedTargets:s}=this.options,a=i?[...s,i]:s;return o&&dr(a,o)?{target:o}:void 0};return{inclusive:!1,excludes:"_",...t,attrs:{...e.defaults(),href:{},target:{default:this.options.defaultTarget},auto:{default:!1}},parseDOM:[{tag:"a[href]",getAttrs:o=>{if(!Je(o))return!1;const i=o.getAttribute("href"),s=o.textContent,a=this.options.autoLink&&(o.hasAttribute(r)||i===s||(i==null?void 0:i.replace(`${this.options.defaultProtocol}//`,""))===s);return{...e.parse(o),href:i,auto:a,...n(o.getAttribute("target"))}}},...t.parseDOM??[]],toDOM:o=>{const{auto:i,target:s,...a}=Dd(o.attrs,e),l=o.attrs.auto?{[r]:""}:{},c="noopener noreferrer nofollow";return["a",{...e.dom(o),...a,rel:c,...l,...n(o.attrs.target)},0]}}}onCreate(){const{autoLinkRegex:e}=this.options;this._autoLinkRegexNonGlobal=new RegExp(`^${e.source}$`,e.flags.replace("g",""))}shortcut({tr:e}){let t="",{from:r,to:n,empty:o,$from:i}=e.selection,s=!1;const a=_o(i,this.type);if(o){const l=a??C5(e);if(!l)return!1;({text:t,from:r,to:n}=l),s=!0}return r===n?!1:(s||(t=e.doc.textBetween(r,n)),this.options.onActivateLink(t),this.options.onShortcut({activeLink:a?{attrs:a.mark.attrs,from:a.from,to:a.to}:void 0,selectedText:t,from:r,to:n}),!0)}updateLink(e,t){return r=>{const{tr:n}=r;return!(gs(n.selection)&&!Bv(n.selection)||az(n.selection)||Ap({trState:n,type:this.type}))&&!t?!1:(n.setMeta(this.name,{command:o4,attrs:e,range:t}),Mz({type:this.type,attrs:e,range:t})(r))}}selectLink(){return this.store.commands.selectMark.original(this.type)}removeLink(e){return t=>{const{tr:r}=t;return Ap({trState:r,type:this.type,...e})?L5({type:this.type,expand:!0,range:e})(t):!1}}createPasteRules(){return[{type:"mark",regexp:this.options.autoLinkRegex,markType:this.type,getAttributes:(e,t)=>({href:this.buildHref(Zo(e)),auto:!t}),transformMatch:e=>{const t=Zo(e);return!t||!this.isValidUrl(t)?!1:t}}]}createEventHandlers(){return{clickMark:(e,t)=>{const r=t.getMark(this.type);if(!r)return;const n=r.mark.attrs,o={...n,...r};if(this.options.onClick(e,o))return!0;if(!this.store.view.editable)return;let i=!1;if(this.options.openLinkOnClick){i=!0;const s=n.href;window.open(s,"_blank")}return this.options.selectTextOnClick&&(i=!0,this.store.commands.selectText(r)),i}}}createPlugin(){return{appendTransaction:(e,t,r)=>{if(e.filter(p=>!!p.getMeta(this.name)).forEach(p=>{const h=p.getMeta(this.name);if(h.command===o4){const{range:m,attrs:b}=h,{selection:v,doc:g}=r,y={range:m,selection:v,doc:g,attrs:b},{from:x,to:k}=m??v;this.options.onUpdateLink(g.textBetween(x,k),y)}}),!this.options.autoLink||V0(t)-V0(r)===1||!e.some(p=>p.docChanged))return;const s=K6(e,t),a=E5(s,[bt,Dt]),{mapping:l}=s,{tr:c,doc:u}=r,{updateLink:d,removeLink:f}=this.store.chain(c);if(a.forEach(({prevFrom:p,prevTo:h,from:m,to:b})=>{const v=[],g=b-m===2,y=this.getLinkMarksInRange(t.doc,p,h,!0).filter(x=>x.mark.type===this.type).map(({from:x,to:k,text:w})=>({mappedFrom:l.map(x),mappedTo:l.map(k),text:w,from:x,to:k}));y.forEach(({mappedFrom:x,mappedTo:k,from:w,to:E},M)=>this.getLinkMarksInRange(u,x,k,!0).filter(C=>C.mark.type===this.type).forEach(C=>{const T=t.doc.textBetween(w,E,void 0," "),N=u.textBetween(C.from,C.to+1,void 0," ").trim(),F=this.isValidUrl(T);this.isValidUrl(N)||(F&&(f({from:C.from,to:C.to}).tr(),y.splice(M,1)),!g&&m===b&&this.findAutoLinks(N).map(V=>this.addLinkProperties({...V,from:x+V.start,to:x+V.end})).forEach(({attrs:V,range:j,text:z})=>{d(V,j).tr(),v.push({attrs:V,range:j,text:z})}))})),this.findTextBlocksInRange(u,{from:m,to:b}).forEach(({text:x,positionStart:k})=>{this.findAutoLinks(x).map(w=>this.addLinkProperties({...w,from:k+w.start+1,to:k+w.end+1})).filter(({range:w})=>{const E=m>=w.from&&m<=w.to,M=b>=w.from&&b<=w.to;return E||M||g}).filter(({range:w})=>this.getLinkMarksInRange(c.doc,w.from,w.to,!1).length===0).filter(({range:{from:w},text:E})=>!y.some(({text:M,mappedFrom:C})=>C===w&&M===E)).forEach(({attrs:w,text:E,range:M})=>{d(w,M).tr(),v.push({attrs:w,range:M,text:E})})}),window.requestAnimationFrame(()=>{v.forEach(({attrs:x,range:k,text:w})=>{const{doc:E,selection:M}=c;this.options.onUpdateLink(w,{attrs:x,doc:E,range:k,selection:M})})})}),c.steps.length!==0)return c}}}buildHref(e){return this.options.extractHref({url:e,defaultProtocol:this.options.defaultProtocol})}getLinkMarksInRange(e,t,r,n){const o=[];if(t===r){const i=Math.max(t-1,0),s=e.resolve(i),a=_o(s,this.type);(a==null?void 0:a.mark.attrs.auto)===n&&o.push(a)}else e.nodesBetween(t,r,(i,s)=>{const l=(i.marks??[]).find(({type:c,attrs:u})=>c===this.type&&u.auto===n);l&&o.push({from:s,to:s+i.nodeSize,mark:l,text:i.textContent})});return o}findTextBlocksInRange(e,t){const r=[];return e.nodesBetween(t.from,t.to,(n,o)=>{!n.isTextblock||!n.type.allowsMarkType(this.type)||r.push({node:n,pos:o})}),r.map(n=>({text:e.textBetween(n.pos,n.pos+n.node.nodeSize,void 0," "),positionStart:n.pos}))}addLinkProperties({from:e,to:t,href:r,...n}){return{...n,range:{from:e,to:t},attrs:{href:r,auto:!0}}}findAutoLinks(e){if(this.options.findAutoLinks)return this.options.findAutoLinks(e,this.options.defaultProtocol);const t=[];for(const r of xa(e,this.options.autoLinkRegex)){const n=Zo(r);if(!n)continue;const o=this.buildHref(n);!this.isValidTLD(o)&&!o.startsWith("tel:")||t.push({text:n,href:o,start:r.index,end:r.index+n.length})}return t}isValidUrl(e){var t;return this.options.isValidUrl?this.options.isValidUrl(e,this.options.defaultProtocol):this.isValidTLD(this.buildHref(e))&&!!((t=this._autoLinkRegexNonGlobal)!=null&&t.test(e))}isValidTLD(e){const{autoLinkAllowedTLDs:t}=this.options;if(t.length===0)return!0;const r=nae(e);if(r==="")return!0;const n=G4(r.split("."));return t.includes(n)}};Xd([je({shortcut:D.InsertLink})],us.prototype,"shortcut",1);Xd([U()],us.prototype,"updateLink",1);Xd([U()],us.prototype,"selectLink",1);Xd([U()],us.prototype,"removeLink",1);us=Xd([me({defaultOptions:{autoLink:!1,defaultProtocol:"",selectTextOnClick:!1,openLinkOnClick:!1,autoLinkRegex:aae,autoLinkAllowedTLDs:sae,findAutoLinks:void 0,isValidUrl:void 0,defaultTarget:null,supportedTargets:[],extractHref:lae},staticKeys:["autoLinkRegex"],handlerKeyOptions:{onClick:{earlyReturnValue:!0}},handlerKeys:["onActivateLink","onShortcut","onUpdateLink","onClick"],defaultPriority:Ae.Medium})],us);function lae({url:e,defaultProtocol:t}){const r=/^((?:https?|ftp)?:)\/\//.test(e);return!r&&e.includes("@")?`mailto:${e}`:r?e:`${t}//${e}`}function cae(e){for(var t=1;t0&&e[t-1]===` -`;)t--;return e.substring(0,t)}var fae=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function xx(e){return kx(e,fae)}var yO=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function bO(e){return kx(e,yO)}function pae(e){return kO(e,yO)}var xO=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function hae(e){return kx(e,xO)}function mae(e){return kO(e,xO)}function kx(e,t){return t.indexOf(e.nodeName)>=0}function kO(e,t){return e.getElementsByTagName&&t.some(function(r){return e.getElementsByTagName(r).length})}var pr={};pr.paragraph={filter:"p",replacement:function(e){return` + */var r=function(n){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,s={},a={manual:n.Prism&&n.Prism.manual,disableWorkerMessageHandler:n.Prism&&n.Prism.disableWorkerMessageHandler,util:{encode:function g(y){return y instanceof l?new l(y.type,g(y.content),y.alias):Array.isArray(y)?y.map(g):y.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(k){var g=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(k.stack)||[])[1];if(g){var y=document.getElementsByTagName("script");for(var x in y)if(y[x].src==g)return y[x]}return null}},isActive:function(g,y,x){for(var k="no-"+y;g;){var w=g.classList;if(w.contains(y))return!0;if(w.contains(k))return!1;g=g.parentElement}return!!x}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(g,y){var x=a.util.clone(a.languages[g]);for(var k in y)x[k]=y[k];return x},insertBefore:function(g,y,x,k){k=k||a.languages;var w=k[g],E={};for(var T in w)if(w.hasOwnProperty(T)){if(T==y)for(var C in x)x.hasOwnProperty(C)&&(E[C]=x[C]);x.hasOwnProperty(T)||(E[T]=w[T])}var M=k[g];return k[g]=E,a.languages.DFS(a.languages,function(N,F){F===M&&N!=g&&(this[N]=E)}),E},DFS:function g(y,x,k,w){w=w||{};var E=a.util.objId;for(var T in y)if(y.hasOwnProperty(T)){x.call(y,T,y[T],k||T);var C=y[T],M=a.util.type(C);M==="Object"&&!w[E(C)]?(w[E(C)]=!0,g(C,x,null,w)):M==="Array"&&!w[E(C)]&&(w[E(C)]=!0,g(C,x,T,w))}}},plugins:{},highlightAll:function(g,y){a.highlightAllUnder(document,g,y)},highlightAllUnder:function(g,y,x){var k={callback:x,container:g,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",k),k.elements=Array.prototype.slice.apply(k.container.querySelectorAll(k.selector)),a.hooks.run("before-all-elements-highlight",k);for(var w=0,E;E=k.elements[w++];)a.highlightElement(E,y===!0,k.callback)},highlightElement:function(g,y,x){var k=a.util.getLanguage(g),w=a.languages[k];a.util.setLanguage(g,k);var E=g.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(E,k);var T=g.textContent,C={element:g,language:k,grammar:w,code:T};function M(F){C.highlightedCode=F,a.hooks.run("before-insert",C),C.element.innerHTML=C.highlightedCode,a.hooks.run("after-highlight",C),a.hooks.run("complete",C),x&&x.call(C.element)}if(a.hooks.run("before-sanity-check",C),E=C.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!C.code){a.hooks.run("complete",C),x&&x.call(C.element);return}if(a.hooks.run("before-highlight",C),!C.grammar){M(a.util.encode(C.code));return}if(y&&n.Worker){var N=new Worker(a.filename);N.onmessage=function(F){M(F.data)},N.postMessage(JSON.stringify({language:C.language,code:C.code,immediateClose:!0}))}else M(a.highlight(C.code,C.grammar,C.language))},highlight:function(g,y,x){var k={code:g,grammar:y,language:x};if(a.hooks.run("before-tokenize",k),!k.grammar)throw new Error('The language "'+k.language+'" has no grammar.');return k.tokens=a.tokenize(k.code,k.grammar),a.hooks.run("after-tokenize",k),l.stringify(a.util.encode(k.tokens),k.language)},tokenize:function(g,y){var x=y.rest;if(x){for(var k in x)y[k]=x[k];delete y.rest}var w=new d;return f(w,w.head,g),u(g,w,y,w.head,0),h(w)},hooks:{all:{},add:function(g,y){var x=a.hooks.all;x[g]=x[g]||[],x[g].push(y)},run:function(g,y){var x=a.hooks.all[g];if(!(!x||!x.length))for(var k=0,w;w=x[k++];)w(y)}},Token:l};n.Prism=a;function l(g,y,x,k){this.type=g,this.content=y,this.alias=x,this.length=(k||"").length|0}l.stringify=function g(y,x){if(typeof y=="string")return y;if(Array.isArray(y)){var k="";return y.forEach(function(M){k+=g(M,x)}),k}var w={type:y.type,content:g(y.content,x),tag:"span",classes:["token",y.type],attributes:{},language:x},E=y.alias;E&&(Array.isArray(E)?Array.prototype.push.apply(w.classes,E):w.classes.push(E)),a.hooks.run("wrap",w);var T="";for(var C in w.attributes)T+=" "+C+'="'+(w.attributes[C]||"").replace(/"/g,""")+'"';return"<"+w.tag+' class="'+w.classes.join(" ")+'"'+T+">"+w.content+""};function c(g,y,x,k){g.lastIndex=y;var w=g.exec(x);if(w&&k&&w[1]){var E=w[1].length;w.index+=E,w[0]=w[0].slice(E)}return w}function u(g,y,x,k,w,E){for(var T in x)if(!(!x.hasOwnProperty(T)||!x[T])){var C=x[T];C=Array.isArray(C)?C:[C];for(var M=0;M=E.reach);P+=A.value.length,A=A.next){var B=A.value;if(y.length>g.length)return;if(!(B instanceof l)){var Y=1,J;if(V){if(J=c(q,P,g,I),!J||J.index>=g.length)break;var de=J.index,Ne=J.index+J[0].length,ie=P;for(ie+=A.value.length;de>=ie;)A=A.next,ie+=A.value.length;if(ie-=A.value.length,P=ie,A.value instanceof l)continue;for(var ue=A;ue!==y.tail&&(ieE.reach&&(E.reach=ft);var rt=A.prev;Me&&(rt=f(y,rt,Me),P+=Me.length),p(y,rt,Y);var Or=new l(T,F?a.tokenize(me,F):me,j,me);if(A=f(y,rt,Or),Se&&f(y,A,Se),Y>1){var he={cause:T+","+M,reach:ft};u(g,y,x,A.prev,P,he),E&&he.reach>E.reach&&(E.reach=he.reach)}}}}}}function d(){var g={value:null,prev:null,next:null},y={value:null,prev:g,next:null};g.next=y,this.head=g,this.tail=y,this.length=0}function f(g,y,x){var k=y.next,w={value:x,prev:y,next:k};return y.next=w,k.prev=w,g.length++,w}function p(g,y,x){for(var k=y.next,w=0;w/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(r,n){var o={};o["language-"+n]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[n]},o.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:o}};i["language-"+n]={pattern:/[\s\S]+/,inside:e.languages[n]};var s={};s[r]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return r}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",s)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,r){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[r,"language-"+r],inside:e.languages[r]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}var Lie=mx;mx.displayName="css";mx.aliases=[];function mx(e){(function(t){var r=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+r.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+r.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+r.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:r,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var n=t.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))})(e)}var Iie=gx;gx.displayName="clike";gx.aliases=[];function gx(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}var Die=vx;vx.displayName="javascript";vx.aliases=["js"];function vx(e){e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}var fu=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof Pu=="object"?Pu:{},$ie=ese();fu.Prism={manual:!0,disableWorkerMessageHandler:!0};var Hie=ene,Bie=gie,dO=Pie,Fie=zie,Vie=Lie,jie=Iie,Uie=Die;$ie();var yx={}.hasOwnProperty;function fO(){}fO.prototype=dO;var Et=new fO,Wie=Et;Et.highlight=qie;Et.register=Qd;Et.alias=Kie;Et.registered=Gie;Et.listLanguages=Yie;Qd(Fie);Qd(Vie);Qd(jie);Qd(Uie);Et.util.encode=Qie;Et.Token.stringify=Jie;function Qd(e){if(typeof e!="function"||!e.displayName)throw new Error("Expected `function` for `grammar`, got `"+e+"`");Et.languages[e.displayName]===void 0&&e(Et)}function Kie(e,t){var r=Et.languages,n=e,o,i,s,a;t&&(n={},n[e]=t);for(o in n)for(i=n[o],i=typeof i=="string"?[i]:i,s=i.length,a=-1;++a{for(var o=n>1?void 0:n?rse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&tse(t,r,o),o},pO=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},xi=(e,t,r)=>(pO(e,t,"read from private field"),r?r.call(e):t.get(e)),p1=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},h1=(e,t,r,n)=>(pO(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),hO="data-code-block-language";function mO(e,t,r=[]){return e.map(n=>{const o=[...r];return n.type==="element"&&n.properties.className?o.push(...n.properties.className):n.type==="text"&&o.length===0&&t&&o.push(t),n.type==="element"?mO(n.children,t,o):{text:n.value,classes:o}})}function nse(e,t){var r;const{node:n,pos:o}=e,i=xh({language:(r=n.attrs.language)==null?void 0:r.replace("language-",""),fallback:"markup"}),s=bx.highlight(n.textContent??"",i),a=mO(s,t);let l=o+1;function c(u){const d=l,f=d+u.text.length;return l=f,{...u,from:d,to:f}}return Y4(a).map(c)}function i4(e){const{blocks:t,skipLast:r,plainTextClassName:n}=e,o=[];for(const i of t){const s=nse(i,n),a=r?s.length-1:s.length;for(const l of Ev(a)){const c=s[l],u=c==null?void 0:c.classes;if(!c||!(u!=null&&u.length))continue;const d=Ge.inline(c.from,c.to,{class:u.join(" ")});o.push(d)}}return o}function ose(e){return!!(e&&Zt(e)&&ne(e.language)&&e.language.length>0)}function ise(e){return t=>({state:{tr:r,selection:n},dispatch:o})=>{if(!ose(t))throw new Error("Invalid attrs passed to the updateAttributes method");const i=ts({types:e,selection:n});return!i||G4(t,i.node.attrs)?!1:(r.setNodeMarkup(i.pos,e,{...i.node.attrs,...t}),o&&o(r),!0)}}function xh(e){const{language:t,fallback:r}=e;if(!t)return r;const n=bx.listLanguages();for(const o of n)if(o.toLowerCase()===t.toLowerCase())return o;return r}function sse(e,t){const{language:r,wrap:n}=$d(e.attrs,t),{style:o,...i}=t.dom(e);let s=i.style;return n&&(s=qv({whiteSpace:"pre-wrap",wordBreak:"break-all"},s)),["pre",{spellcheck:"false",...i,class:ju(i.class,`language-${r}`)},["code",{[hO]:r,style:s},0]]}function ase(e){return({pos:t}=ee())=>({tr:r,dispatch:n})=>{const{type:o,formatter:i,defaultLanguage:s}=e,{from:a,to:l}=t?{from:t,to:t}:r.selection,c=ts({types:o,selection:r.selection});if(!c)return!1;const{node:{attrs:u,textContent:d},start:f}=c,p=a-f,h=l-f,m=xh({language:u.language,fallback:s}),b=i({source:d,language:m,cursorOffset:p});let v;if(p!==h&&(v=i({source:d,language:m,cursorOffset:h})),!b)return!1;const{cursorOffset:g,formatted:y}=b;if(y===d)return!1;const x=f+d.length;r.insertText(y,f,x);const k=f+g,w=v?f+v.cursorOffset:void 0;return r.setSelection(le.between(r.doc.resolve(k),r.doc.resolve(w??k))),n&&n(r),!0}}function lse(e){var t;return(t=e.getAttribute(hO)??e.classList[0])==null?void 0:t.replace("language-","")}var{DESCRIPTION:cse,LABEL:use}=nR,dse={icon:"bracesLine",description:({t:e})=>e(cse),label:({t:e})=>e(use)},Ps,pu,hu,fse=class{constructor(e,t){p1(this,Ps,void 0),p1(this,pu,void 0),p1(this,hu,!1),h1(this,pu,e),h1(this,Ps,t)}init(e){const t=Vz({node:e.doc,type:xi(this,pu)});return this.refreshDecorationSet(e.doc,t),this}refreshDecorationSet(e,t){const r=i4({blocks:t,skipLast:xi(this,hu),defaultLanguage:xi(this,Ps).options.defaultLanguage,plainTextClassName:xi(this,Ps).options.plainTextClassName??void 0});this.decorationSet=Ee.create(e,r)}apply(e,t){if(!e.docChanged)return this;this.decorationSet=this.decorationSet.map(e.mapping,e.doc);const r=jz(e,{descend:!0,predicate:n=>n.type===xi(this,pu),StepTypes:[]});return this.updateDecorationSet(e,r),this}updateDecorationSet(e,t){if(t.length===0)return;let r=this.decorationSet;for(const{node:n,pos:o}of t)r=this.decorationSet.remove(this.decorationSet.find(o,o+n.nodeSize));this.decorationSet=r.add(e.doc,i4({blocks:t,skipLast:xi(this,hu),defaultLanguage:xi(this,Ps).options.defaultLanguage,plainTextClassName:xi(this,Ps).options.plainTextClassName??void 0}))}setDeleted(e){h1(this,hu,e)}};Ps=new WeakMap;pu=new WeakMap;hu=new WeakMap;var lo=class extends er{get name(){return"codeBlock"}createTags(){return[oe.Block,oe.Code]}init(){this.registerLanguages()}createNodeSpec(e,t){const r=/highlight-(?:text|source)-([\da-z]+)/;return{content:"text*",marks:"",defining:!0,draggable:!1,...t,code:!0,attrs:{...e.defaults(),language:{default:this.options.defaultLanguage},wrap:{default:this.options.defaultWrap}},parseDOM:[{tag:"div.highlight",preserveWhitespace:"full",getAttrs:n=>{var o,i;if(!Je(n))return!1;const s=n.querySelector("pre.code");if(!Je(s))return!1;const a=kn(s,"white-space")==="pre-wrap",l=(i=(o=n.className.match(r))==null?void 0:o[1])==null?void 0:i.replace("language-","");return{...e.parse(n),language:l,wrap:a}}},{tag:"pre",preserveWhitespace:"full",getAttrs:n=>{if(!Je(n))return!1;const o=n.querySelector("code");if(!Je(o))return!1;const i=kn(o,"white-space")==="pre-wrap",s=this.options.getLanguageFromDom(o,n);return{...e.parse(n),language:s,wrap:i}}},...t.parseDOM??[]],toDOM:n=>sse(n,e)}}createAttributes(){return{class:aV[this.options.syntaxTheme.toUpperCase()]}}createInputRules(){const e=/^```([\dA-Za-z]*) $/,t=r=>({language:xh({language:Zo(r,1),fallback:this.options.defaultLanguage})});return[BC({regexp:e,type:this.type,beforeDispatch:({tr:r,start:n})=>{const o=r.doc.resolve(n);r.setSelection(le.near(o))},getAttributes:t})]}onSetOptions(e){const{changes:t}=e;t.supportedLanguages.changed&&this.registerLanguages(),t.syntaxTheme.changed&&this.store.updateAttributes()}createPlugin(){const e=new fse(this.type,this),t=()=>(e.setDeleted(!0),!1);return{state:{init(r,n){return e.init(n)},apply(r,n,o,i){return e.apply(r,i)}},props:{handleKeyDown:Jv({Backspace:t,"Mod-Backspace":t,Delete:t,"Mod-Delete":t,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t}),decorations(){return e.setDeleted(!1),e.decorationSet}}}}toggleCodeBlock(e={}){return Gv({type:this.type,toggleType:this.options.toggleName,attrs:{language:this.options.defaultLanguage,...e}})}createCodeBlock(e){return Fu(this.type,e)}updateCodeBlock(e){return ise(this.type)(e)}formatCodeBlock(e){return ase({type:this.type,formatter:this.options.formatter,defaultLanguage:this.options.defaultLanguage})(e)}tabKey({state:e,dispatch:t}){const{selection:r,tr:n,schema:o}=e,{node:i}=nz(r);if(!$h({node:i,types:this.type}))return!1;if(r.empty)n.insertText(" ");else{const{from:s,to:a}=r;n.replaceWith(s,a,o.text(" "))}return t&&t(n),!0}backspaceKey({dispatch:e,tr:t,state:r}){if(!t.selection.empty)return!1;const n=ts({types:this.type,selection:t.selection});if((n==null?void 0:n.start)!==t.selection.from)return!1;const{pos:o,node:i,start:s}=n,a=it(r.schema.nodes,this.options.toggleName);return i.textContent.trim()===""?t.doc.lastChild===i&&t.doc.firstChild===i?tz({pos:o,tr:t,content:a.create()}):ez({pos:o,tr:t}):s>2?t.setSelection(le.near(t.doc.resolve(s-2))):(t.insert(0,a.create()),t.setSelection(le.near(t.doc.resolve(1)))),e&&e(t),!0}enterKey({dispatch:e,tr:t}){if(!(gs(t.selection)&&t.selection.empty))return!1;const{nodeBefore:r,parent:n}=t.selection.$anchor;if(!(r!=null&&r.isText)||!n.type.isTextblock)return!1;const o=/^```([A-Za-z]*)?$/,{text:i,nodeSize:s}=r,{textContent:a}=n;if(!i)return!1;const l=i.match(o),c=a.match(o);if(!l||!c)return!1;const[,u]=l,d=xh({language:u,fallback:this.options.defaultLanguage}),f=t.selection.$from.before(),p=f+s+1;return t.replaceWith(f,p,this.type.create({language:d})),t.setSelection(le.near(t.doc.resolve(f+1))),e&&e(t),!0}formatShortcut({tr:e}){const t=this.store.commands;if(!SC({type:this.type,state:e}))return!1;const r=t.formatCodeBlock.isEnabled();return r&&t.formatCodeBlock(),r}registerLanguages(){for(const e of this.options.supportedLanguages)bx.register(e)}};pi([U(dse)],lo.prototype,"toggleCodeBlock",1);pi([U()],lo.prototype,"createCodeBlock",1);pi([U()],lo.prototype,"updateCodeBlock",1);pi([U()],lo.prototype,"formatCodeBlock",1);pi([je({shortcut:"Tab"})],lo.prototype,"tabKey",1);pi([je({shortcut:"Backspace"})],lo.prototype,"backspaceKey",1);pi([je({shortcut:"Enter"})],lo.prototype,"enterKey",1);pi([je({shortcut:D.Format})],lo.prototype,"formatShortcut",1);lo=pi([pe({defaultOptions:{supportedLanguages:[],toggleName:"paragraph",formatter:({source:e})=>({cursorOffset:0,formatted:e}),syntaxTheme:"a11y_dark",defaultLanguage:"markup",defaultWrap:!1,plainTextClassName:"",getLanguageFromDom:lse},staticKeys:["getLanguageFromDom"]})],lo);var gO=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},ze=(e,t,r)=>(gO(e,t,"read from private field"),r?r.call(e):t.get(e)),Xa=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Mi=(e,t,r,n)=>(gO(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),pse='',hse='',mse=encodeURIComponent(pse),gse=encodeURIComponent(hse),Ar,vse=class{constructor(e){Xa(this,Ar,void 0);const t=document.createElement("div"),r=document.createElement("div");this.dom=t,Mi(this,Ar,r),this.type=e,this.createHandle(e)}createHandle(e){switch(ar(this.dom,{position:"absolute",pointerEvents:"auto",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"100"}),ar(ze(this,Ar),{opacity:"0",transition:"opacity 300ms ease-in 0s"}),ze(this,Ar).dataset.dragging="",e){case 0:ar(this.dom,{right:"0px",top:"0px",height:"100%",width:"15px",cursor:"col-resize"}),ar(ze(this,Ar),{width:" 4px",height:"36px",maxHeight:"50%",boxSizing:"content-box",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 1:ar(this.dom,{left:"0px",top:"0px",height:"100%",width:"15px",cursor:"col-resize"}),ar(ze(this,Ar),{width:" 4px",height:"36px",maxHeight:"50%",boxSizing:"content-box",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 2:ar(this.dom,{bottom:"0px",width:"100%",height:"14px",cursor:"row-resize"}),ar(ze(this,Ar),{width:" 42px",height:"4px",boxSizing:"content-box",maxWidth:"50%",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 3:ar(this.dom,{right:"-1px",bottom:"-2px",width:"30px",height:"30px",cursor:"nwse-resize",zIndex:"101"}),ar(ze(this,Ar),{height:"22px",width:"22px",backgroundRepeat:"no-repeat",backgroundImage:`url("data:image/svg+xml,${gse}") `});break;case 4:ar(this.dom,{left:"-1px",bottom:"-2px",width:"30px",height:"30px",cursor:"nesw-resize",zIndex:"101"}),ar(ze(this,Ar),{height:"22px",width:"22px",backgroundRepeat:"no-repeat",backgroundImage:`url("data:image/svg+xml,${mse}") `});break}this.dom.append(ze(this,Ar))}setHandleVisibility(e){const t=e||!!ze(this,Ar).dataset.dragging;ze(this,Ar).style.opacity=t?"1":"0"}dataSetDragging(e){ze(this,Ar).dataset.dragging=e?"true":""}};Ar=new WeakMap;var Rf=50,vO=(e=>(e[e.Fixed=0]="Fixed",e[e.Flexible=1]="Flexible",e))(vO||{}),zs,Ls,Is,Bo,Ds,yse=class{constructor({node:e,view:t,getPos:r,aspectRatio:n=0,options:o,initialSize:i}){Xa(this,zs,void 0),Xa(this,Ls,void 0),Xa(this,Is,[]),Xa(this,Bo,void 0),Xa(this,Ds,void 0);const s=this.createWrapper(e,i),a=this.createElement({node:e,view:t,getPos:r,options:o}),c=(n===1?[0,1,2,3,4]:[0,1]).map(f=>new vse(f));for(const f of c){const p=h=>{this.startResizing(h,t,r,f)};f.dom.addEventListener("mousedown",p),ze(this,Is).push(()=>f.dom.removeEventListener("mousedown",p)),s.append(f.dom)}const u=()=>{c.forEach(f=>f.setHandleVisibility(!0))},d=()=>{c.forEach(f=>f.setHandleVisibility(!1))};s.addEventListener("mouseover",u),s.addEventListener("mouseout",d),ze(this,Is).push(()=>s.removeEventListener("mouseover",u),()=>s.removeEventListener("mouseout",d)),s.append(a),this.dom=s,Mi(this,Ls,e),Mi(this,zs,a),this.aspectRatio=n}createWrapper(e,t){const r=document.createElement("div");return r.classList.add("remirror-resizable-view"),r.style.position="relative",t?ar(r,{width:s4(t.width),aspectRatio:`${t.width} / ${t.height}`}):ar(r,{width:s4(e.attrs.width),aspectRatio:`${e.attrs.width} / ${e.attrs.height}`}),ar(r,{maxWidth:"100%",minWidth:`${Rf}px`,verticalAlign:"bottom",display:"inline-block",lineHeight:"0",transition:"width 0.15s ease-out, height 0.15s ease-out"}),r}startResizing(e,t,r,n){var o,i;e.preventDefault(),n.dataSetDragging(!0),ze(this,zs).style.pointerEvents="none";const s=e.pageX,a=e.pageY,l=((o=ze(this,zs))==null?void 0:o.getBoundingClientRect().width)||0,c=((i=ze(this,zs))==null?void 0:i.getBoundingClientRect().height)||0,u=S1(100,!1,f=>{const p=f.pageX,h=f.pageY,m=p-s,b=h-a;let v=null,g=null;if(this.aspectRatio===0&&l&&c)switch(n.type){case 0:case 3:v=l+m,g=c/l*v;break;case 1:case 4:v=l-m,g=c/l*v;break;case 2:g=c+b,v=l/c*g;break}else if(this.aspectRatio===1)switch(n.type){case 0:v=l+m;break;case 1:v=l-m;break;case 2:g=c+b;break;case 3:v=l+m,g=c+b;break;case 4:v=l-m,g=c+b;break}typeof v=="number"&&v{f.preventDefault(),n.dataSetDragging(!1),n.setHandleVisibility(!1),ze(this,zs).style.pointerEvents="auto",document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",d);const p=r(),h=t.state.tr.setNodeMarkup(p,void 0,{...ze(this,Ls).attrs,width:ze(this,Bo),height:ze(this,Ds)});t.dispatch(h)};document.addEventListener("mousemove",u),document.addEventListener("mouseup",d),ze(this,Is).push(()=>document.removeEventListener("mousemove",u)),ze(this,Is).push(()=>document.removeEventListener("mouseup",d))}update(e){return e.type!==ze(this,Ls).type||this.aspectRatio===0&&e.attrs.width&&e.attrs.width!==ze(this,Bo)||this.aspectRatio===1&&e.attrs.width&&e.attrs.height&&e.attrs.width!==ze(this,Bo)&&e.attrs.height!==ze(this,Ds)||!bse(ze(this,Ls),e,["width","height"])?!1:(Mi(this,Ls,e),Mi(this,Bo,e.attrs.width),Mi(this,Ds,e.attrs.height),!0)}destroy(){ze(this,Is).forEach(e=>e())}};zs=new WeakMap;Ls=new WeakMap;Is=new WeakMap;Bo=new WeakMap;Ds=new WeakMap;function bse(e,t,r){return e===t||xse(e,t,r)&&e.content.eq(t.content)}function xse(e,t,r){const n=e.attrs,o=t.attrs,i={};for(const a of r)i[a]=null;e.attrs={...n,...i},t.attrs={...o,...i};const s=e.sameMarkup(t);return e.attrs=n,t.attrs=o,s}function s4(e){return typeof e=="number"?`${e}px`:e||void 0}var yO={exports:{}},kse=Number.isNaN||function(e){return e!==e},wse=kse,xx=Number.isFinite||function(e){return!(typeof e!="number"||wse(e)||e===1/0||e===-1/0)},Sse=xx,Ese=Number.isInteger||function(e){return typeof e=="number"&&Sse(e)&&Math.floor(e)===e},Cse=xx,Mse=Ese,Tse=function(t,r){if(!Cse(t))throw new Error("Value must be a finite number");if(!Mse(r)||r<0)throw new Error("Precision must be a non-negative integer");return parseFloat(t.toFixed(r))},Ose=/^(-?\d?\.?\d+)e([\+\-]\d)+/,_se=function(t){var r=t.match(Ose);if(!r)throw new Error("Invalid exponential");return r.slice(1)},Ase=xx,Nse=_se,Rse=function(t){if(!Ase(t))throw new Error("Value must be a finite number");var r=Nse(t.toExponential()),n=r[0],o=parseInt(r[1],10),i=(n.split(".")[1]||"").length;return!i&&o>0?0:i+-1*o};(function(e,t){var r=Tse,n=Rse;e.exports=i;var o={down:"floor",up:"ceil"};function i(s,a,l){if(a=a||1,l){if(!o.hasOwnProperty(l))throw new Error("invalid direction");var c=o[l];return r(Math[c](s/a)*a,n(a))}var u=i(s,a,"down"),d=i(s,a,"up");return s-u{for(var o=n>1?void 0:n?Ise(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Lse(t,r,o),o},Dse={icon:"fontSize",description:({t:e})=>e(Al.SET_DESCRIPTION),label:({t:e})=>e(Al.SET_LABEL)},$se={icon:"addLine",description:({t:e})=>e(Al.INCREASE_DESCRIPTION),label:({t:e})=>e(Al.INCREASE_LABEL)},Hse={icon:"subtractLine",description:({t:e})=>e(Al.DECREASE_DESCRIPTION),label:({t:e})=>e(Al.DECREASE_LABEL)},m1="data-font-size-mark",co=class extends li{get name(){return"fontSize"}createTags(){return[oe.FormattingMark,oe.FontStyle]}createMarkSpec(e,t){return{...t,attrs:{...e.defaults(),size:{default:this.options.defaultSize}},parseDOM:[{tag:`span[${m1}]`,getAttrs:r=>{if(!Je(r))return null;let n=r.getAttribute(m1);return n?(n=`${bg(n,this.options.unit,r)}${this.options.unit}`,{...e.parse(r),size:n}):null}},{style:"font-size",priority:Ae.Low,getAttrs:r=>ne(r)?(r=this.getFontSize(r),{size:r}):null},...t.parseDOM??[]],toDOM:r=>{const{size:n,...o}=$d(r.attrs,e),i=e.dom(r);let s=i.style,a;return n&&(s=qv({fontSize:this.getFontSize(n)},s)),["span",{...o,...i,style:s,[m1]:a},0]}}}getFontSize(e){var t;const{unit:r,roundingMultiple:n,max:o,min:i,defaultSize:s}=this.options,a=bg(e,r,(t=this.store.view)==null?void 0:t.dom);return Number.isNaN(a)?s||"1rem":`${Ad({value:zse(a,n),max:o,min:i})}${r}`}setFontSize(e,t){return this.store.commands.applyMark.original(this.type,{size:String(e)},t==null?void 0:t.selection)}increaseFontSize(e){const{increment:t}=this.options;return r=>{const[n]=this.getFontSizeForSelection(e==null?void 0:e.selection);let[o]=n;return o+=_e(t)?t(n,1):t,this.setFontSize(o,e)(r)}}decreaseFontSize(e){const{increment:t}=this.options;return r=>{const[n]=this.getFontSizeForSelection(e==null?void 0:e.selection);let[o]=n;return o-=_e(t)?t(n,-1):t,this.setFontSize(o,e)(r)}}removeFontSize(e){return this.store.commands.removeMark.original({type:this.type,expand:!1,...e})}increaseFontSizeShortcut(e){return this.increaseFontSize()(e)}decreaseFontSizeShortcut(e){return this.decreaseFontSize()(e)}getFontSizeForSelection(e){const t=this.store.getState(),r=jr(e??t.selection,t.doc),[n,...o]=yz(r,this.type);if(n)return[$f(n.mark.attrs.size),...o.map(l=>$f(l.mark.attrs.size))];const{defaultSize:i,unit:s}=this.options;return[[bg(i,s),s]]}getFontSizeFromDom(e){const t=this.store.getState(),r=jr(e??t.selection,t.doc),n=this.store.view.domAtPos(r.from),o=Je(n.node)?n.node:this.store.view.dom;return $f(Pl(o))}};hi([U(Dse)],co.prototype,"setFontSize",1);hi([U($se)],co.prototype,"increaseFontSize",1);hi([U(Hse)],co.prototype,"decreaseFontSize",1);hi([U()],co.prototype,"removeFontSize",1);hi([je({shortcut:D.IncreaseFontSize,command:"increaseFontSize"})],co.prototype,"increaseFontSizeShortcut",1);hi([je({shortcut:D.IncreaseFontSize,command:"decreaseFontSize"})],co.prototype,"decreaseFontSizeShortcut",1);hi([He()],co.prototype,"getFontSizeForSelection",1);hi([He()],co.prototype,"getFontSizeFromDom",1);co=hi([pe({defaultOptions:{defaultSize:"",unit:"pt",increment:1,max:100,min:1,roundingMultiple:.5},staticKeys:["defaultSize"]})],co);var Bse=Object.defineProperty,Fse=Object.getOwnPropertyDescriptor,bO=(e,t,r,n)=>{for(var o=n>1?void 0:n?Fse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Bse(t,r,o),o},kh=class extends er{get name(){return"hardBreak"}createTags(){return[oe.InlineNode]}createNodeSpec(e,t){return{inline:!0,selectable:!1,atom:!0,leafText:()=>` +`,...t,attrs:e.defaults(),parseDOM:[{tag:"br",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["br",e.dom(r)]}}createKeymap(){const e=G6(bu(KC),()=>(this.store.commands.insertHardBreak(),!0));return{"Mod-Enter":e,"Shift-Enter":e}}insertHardBreak(){return e=>{const{tr:t,dispatch:r}=e;return r==null||r(t.replaceSelectionWith(this.type.create()).scrollIntoView()),!0}}};bO([U()],kh.prototype,"insertHardBreak",1);kh=bO([pe({defaultPriority:Ae.Low})],kh);var Vse=Object.defineProperty,jse=Object.getOwnPropertyDescriptor,xO=(e,t,r,n)=>{for(var o=n>1?void 0:n?jse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Vse(t,r,o),o},{LABEL:Use}=hR,Wse={icon:({attrs:e})=>`h${(e==null?void 0:e.level)??"1"}`,label:({t:e,attrs:t})=>e({...Use,values:{level:t==null?void 0:t.level}})},Kse=[D.H1,D.H2,D.H3,D.H4,D.H5,D.H6],wh=class extends er{get name(){return"heading"}createTags(){return[oe.Block,oe.TextBlock,oe.FormattingNode]}createNodeSpec(e,t){return{content:"inline*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),level:{default:this.options.defaultLevel}},parseDOM:[...this.options.levels.map(r=>({tag:`h${r}`,getAttrs:n=>({...e.parse(n),level:r})})),...t.parseDOM??[]],toDOM:r=>this.options.levels.includes(r.attrs.level)?[`h${r.attrs.level}`,e.dom(r),0]:[`h${this.options.defaultLevel}`,e.dom(r),0]}}toggleHeading(e={}){return Gv({type:this.type,toggleType:"paragraph",attrs:e})}createKeymap(e){const t=this.store.getExtension(xe),r=ee(),n=[];for(const o of this.options.levels){const i=Kse[o-1]??D.H1;r[i]=Fu(this.type,{level:o}),n.push({attrs:{level:o},shortcut:e(i)[0]})}return t.updateDecorated("toggleHeading",{shortcut:n}),r}createInputRules(){return this.options.levels.map(e=>UR(new RegExp(`^(#{1,${e}})\\s$`),this.type,()=>({level:e})))}createPasteRules(){return this.options.levels.map(e=>({type:"node",nodeType:this.type,regexp:new RegExp(`^#{${e}}\\s([\\s\\w]+)$`),getAttributes:()=>({level:e}),startOfTextBlock:!0}))}};xO([U(Wse)],wh.prototype,"toggleHeading",1);wh=xO([pe({defaultOptions:{levels:[1,2,3,4,5,6],defaultLevel:1},staticKeys:["defaultLevel","levels"]})],wh);var qse=Object.defineProperty,Gse=Object.getOwnPropertyDescriptor,kO=(e,t,r,n)=>{for(var o=n>1?void 0:n?Gse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&qse(t,r,o),o},Yse={icon:"separator",label:({t:e})=>e(vk.LABEL),description:({t:e})=>e(vk.DESCRIPTION)},Sh=class extends er{get name(){return"horizontalRule"}createTags(){return[oe.Block]}createNodeSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"hr",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["hr",e.dom(r)]}}insertHorizontalRule(){return e=>{const{tr:t,dispatch:r}=e,n=t.selection.$anchor,o=n.parent;return o.type.name==="doc"||o.isAtom||o.isLeaf?!1:(r&&(t.selection.empty&&Bh(o)&&t.insert(n.pos+1,o),t.replaceSelectionWith(this.type.create()),this.updateFromNodeSelection(t),r(t.scrollIntoView())),!0)}}createInputRules(){return[BC({regexp:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type,beforeDispatch:({tr:e})=>{this.updateFromNodeSelection(e)}})]}updateFromNodeSelection(e){if(!Dd(e.selection)||e.selection.node.type.name!==this.name)return;const t=e.selection.$from.pos+1,{insertionNode:r}=this.options;if(!r)return;const n=this.store.schema.nodes[r];te(n,{code:H.EXTENSION,message:`'${r}' node provided as the insertionNode to the '${this.constructorName}' does not exist.`});const o=n.create();e.insert(t,o),e.setSelection(le.near(e.doc.resolve(t+1)))}};kO([U(Yse)],Sh.prototype,"insertHorizontalRule",1);Sh=kO([pe({defaultOptions:{insertionNode:"paragraph"}})],Sh);var Jse=Object.defineProperty,Xse=Object.getOwnPropertyDescriptor,kx=(e,t,r,n)=>{for(var o=n>1?void 0:n?Xse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Jse(t,r,o),o},Qse=class extends yse{constructor(e,t,r){super({node:e,view:t,getPos:r,aspectRatio:vO.Fixed})}createElement({node:e}){const t=document.createElement("img");return t.setAttribute("src",e.attrs.src),ar(t,{width:"100%",minWidth:"50px",objectFit:"contain"}),t}},wd=class extends er{get name(){return"image"}createTags(){return[oe.InlineNode,oe.Media]}createNodeSpec(e,t){const{preferPastedTextContent:r}=this.options;return{inline:!0,draggable:!0,selectable:!1,...t,attrs:{...e.defaults(),alt:{default:""},crop:{default:null},height:{default:null},width:{default:null},rotate:{default:null},src:{default:null},title:{default:""},fileName:{default:null},resizable:{default:!1}},parseDOM:[{tag:"img[src]",getAttrs:n=>{var o;if(Je(n)){const i=eae({element:n,parse:e.parse});return r&&((o=i.src)!=null&&o.startsWith("file:///"))?!1:i}return{}}},...t.parseDOM??[]],toDOM:n=>{const o=$d(n.attrs,e);return["img",{...e.dom(n),...o}]}}}insertImage(e,t){return({tr:r,dispatch:n})=>{const{from:o,to:i}=jr(t??r.selection,r.doc),s=this.type.create(e);return n==null||n(r.replaceRangeWith(o,i,s)),!0}}uploadImage(e,t){const{updatePlaceholder:r,destroyPlaceholder:n,createPlaceholder:o}=this.options;return i=>{const{tr:s}=i;let a=s.selection.from;return this.store.createPlaceholderCommand({promise:e,placeholder:{type:"widget",get pos(){return a},createElement:(l,c)=>{const u=o(l,c);return t==null||t(u),u},onUpdate:(l,c,u,d)=>{r(l,c,u,d)},onDestroy:(l,c)=>{n(l,c)}},onSuccess:(l,c,u)=>this.insertImage(l,c)(u)}).validate(({tr:l,dispatch:c})=>{const u=EE(l.doc,a,this.type);return u==null?!1:(a=u,l.selection.empty||c==null||c(l.deleteSelection()),!0)},"unshift").generateCommand()(i)}}fileUploadFileHandler(e,t,r){var n;const{preferPastedTextContent:o,uploadHandler:i}=this.options;if(o&&nae(t)&&((n=t.clipboardData)!=null&&n.getData("text/plain")))return!1;const{commands:s,chain:a}=this.store,l=e.map((u,d)=>({file:u,progress:f=>{s.updatePlaceholder(c[d],f)}})),c=i(l);Jt(r)&&a.selectText(r);for(const u of c)a.uploadImage(u);return a.run(),!0}createPasteRules(){return[{type:"file",regexp:/image/i,fileHandler:e=>{const t=e.type==="drop"?e.pos:void 0;return this.fileUploadFileHandler(e.files,e.event,t)}}]}createNodeViews(){return this.options.enableResizing?(e,t,r)=>new Qse(e,t,r):{}}};kx([U()],wd.prototype,"insertImage",1);kx([U()],wd.prototype,"uploadImage",1);wd=kx([pe({defaultOptions:{createPlaceholder:tae,updatePlaceholder:()=>{},destroyPlaceholder:()=>{},uploadHandler:rae,enableResizing:!1,preferPastedTextContent:!0}})],wd);function Zse(e){let{width:t,height:r}=e.style;return t=t||e.getAttribute("width")||"",r=r||e.getAttribute("height")||"",{width:t,height:r}}function eae({element:e,parse:t}){const{width:r,height:n}=Zse(e);return{...t(e),alt:e.getAttribute("alt")??"",height:Number.parseInt(n||"0",10)||null,src:e.getAttribute("src")??null,title:e.getAttribute("title")??"",width:Number.parseInt(r||"0",10)||null,fileName:e.getAttribute("data-file-name")??null}}function tae(e,t){const r=document.createElement("div");return r.classList.add(cV.IMAGE_LOADER),r}function rae(e){te(e.length>0,{code:H.EXTENSION,message:"The upload handler was applied for the image extension without any valid files"});let t=0;const r=[];for(const{file:n,progress:o}of e)r.push(()=>new Promise(i=>{const s=new FileReader;s.addEventListener("load",a=>{var l;t+=1,o(t/e.length),i({src:(l=a.target)==null?void 0:l.result,fileName:n.name})},{once:!0}),s.readAsDataURL(n)}));return r}function nae(e){return e.clipboardData!==void 0}var oae=Object.defineProperty,iae=Object.getOwnPropertyDescriptor,wx=(e,t,r,n)=>{for(var o=n>1?void 0:n?iae(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&oae(t,r,o),o},sae={icon:"italic",label:({t:e})=>e(yk.LABEL),description:({t:e})=>e(yk.DESCRIPTION)},Sd=class extends li{get name(){return"italic"}createTags(){return[oe.FontStyle,oe.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"i",getAttrs:e.parse},{tag:"em",getAttrs:e.parse},{style:"font-style=italic"},...t.parseDOM??[]],toDOM:r=>["em",e.dom(r),0]}}createKeymap(){return{"Mod-i":ns({type:this.type})}}createInputRules(){return[Vu({regexp:/(?:^|[^*])\*([^*]+)\*$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:e,start:t})=>e.startsWith("*")?{}:{fullMatch:e.slice(1),start:t+1}}),Vu({regexp:/(?:^|\W)_([^_]+)_$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:e,start:t})=>e.startsWith("_")?{}:{fullMatch:e.slice(1),start:t+1}})]}createPasteRules(){return[{type:"mark",markType:this.type,regexp:/(?:^|\W)_([^_]+)_/g},{type:"mark",markType:this.type,regexp:/\*([^*]+)\*/g}]}toggleItalic(e){return ns({type:this.type,selection:e})}shortcut(e){return this.toggleItalic()(e)}};wx([U(sae)],Sd.prototype,"toggleItalic",1);wx([je({shortcut:D.Italic,command:"toggleItalic"})],Sd.prototype,"shortcut",1);Sd=wx([pe({})],Sd);var wO={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(typeof self<"u"?self:Pu,function(){return function(r){function n(i){if(o[i])return o[i].exports;var s=o[i]={i,l:!1,exports:{}};return r[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}var o={};return n.m=r,n.c=o,n.d=function(i,s,a){n.o(i,s)||Object.defineProperty(i,s,{configurable:!1,enumerable:!0,get:a})},n.n=function(i){var s=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(s,"a",s),s},n.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)},n.p="",n(n.s=0)}([function(r,n,o){function i(){throw new TypeError("The given URL is not a string. Please verify your string|array.")}function s(c){typeof c!="string"&&i();for(var u=0,d=0,f=0,p=c.length,h=0;p--&&++h&&!(u&&-1f?"":c.slice(f,u)}var a=["/",":","?","#"],l=[".","/","@"];r.exports=function(c){if(typeof c=="string")return s(c);if(Array.isArray(c)){var u=[],d,f=0;for(d=c.length;f{for(var o=n>1?void 0:n?uae(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&cae(t,r,o),o},dae=["com","de","net","org","uk","cn","ga","nl","cf","ml","tk","ru","br","gq","xyz","fr","eu","info","co","au","ca","it","in","ch","pl","es","online","us","top","be","jp","biz","se","at","dk","cz","za","me","ir","icu","shop","kr","site","mx","hu","io","cc","club","no","cyou"],a4="updateLink",fae=/(?:(?:(?:https?|ftp):)?\/\/)?(?:\S+(?::\S*)?@)?(?:(?:[\da-z\u00A1-\uFFFF][\w\u00A1-\uFFFF-]{0,62})?[\da-z\u00A1-\uFFFF]\.)*(?:(?:\d(?!\.)|[a-z\u00A1-\uFFFF])(?:[\da-z\u00A1-\uFFFF][\w\u00A1-\uFFFF-]{0,62})?[\da-z\u00A1-\uFFFF]\.)+[a-z\u00A1-\uFFFF]{2,}(?::\d{2,5})?(?:[#/?]\S*)?/gi,us=class extends li{constructor(){super(...arguments),this._autoLinkRegexNonGlobal=void 0}get name(){return"link"}createTags(){return[oe.Link,oe.ExcludeInputRules]}createMarkSpec(e,t){const r="data-link-auto",n=o=>{const{defaultTarget:i,supportedTargets:s}=this.options,a=i?[...s,i]:s;return o&&fr(a,o)?{target:o}:void 0};return{inclusive:!1,excludes:"_",...t,attrs:{...e.defaults(),href:{},target:{default:this.options.defaultTarget},auto:{default:!1}},parseDOM:[{tag:"a[href]",getAttrs:o=>{if(!Je(o))return!1;const i=o.getAttribute("href"),s=o.textContent,a=this.options.autoLink&&(o.hasAttribute(r)||i===s||(i==null?void 0:i.replace(`${this.options.defaultProtocol}//`,""))===s);return{...e.parse(o),href:i,auto:a,...n(o.getAttribute("target"))}}},...t.parseDOM??[]],toDOM:o=>{const{auto:i,target:s,...a}=$d(o.attrs,e),l=o.attrs.auto?{[r]:""}:{},c="noopener noreferrer nofollow";return["a",{...e.dom(o),...a,rel:c,...l,...n(o.attrs.target)},0]}}}onCreate(){const{autoLinkRegex:e}=this.options;this._autoLinkRegexNonGlobal=new RegExp(`^${e.source}$`,e.flags.replace("g",""))}shortcut({tr:e}){let t="",{from:r,to:n,empty:o,$from:i}=e.selection,s=!1;const a=_o(i,this.type);if(o){const l=a??_C(e);if(!l)return!1;({text:t,from:r,to:n}=l),s=!0}return r===n?!1:(s||(t=e.doc.textBetween(r,n)),this.options.onActivateLink(t),this.options.onShortcut({activeLink:a?{attrs:a.mark.attrs,from:a.from,to:a.to}:void 0,selectedText:t,from:r,to:n}),!0)}updateLink(e,t){return r=>{const{tr:n}=r;return!(gs(n.selection)&&!jv(n.selection)||hz(n.selection)||Rp({trState:n,type:this.type}))&&!t?!1:(n.setMeta(this.name,{command:a4,attrs:e,range:t}),Pz({type:this.type,attrs:e,range:t})(r))}}selectLink(){return this.store.commands.selectMark.original(this.type)}removeLink(e){return t=>{const{tr:r}=t;return Rp({trState:r,type:this.type,...e})?HC({type:this.type,expand:!0,range:e})(t):!1}}createPasteRules(){return[{type:"mark",regexp:this.options.autoLinkRegex,markType:this.type,getAttributes:(e,t)=>({href:this.buildHref(Zo(e)),auto:!t}),transformMatch:e=>{const t=Zo(e);return!t||!this.isValidUrl(t)?!1:t}}]}createEventHandlers(){return{clickMark:(e,t)=>{const r=t.getMark(this.type);if(!r)return;const n=r.mark.attrs,o={...n,...r};if(this.options.onClick(e,o))return!0;if(!this.store.view.editable)return;let i=!1;if(this.options.openLinkOnClick){i=!0;const s=n.href;window.open(s,"_blank")}return this.options.selectTextOnClick&&(i=!0,this.store.commands.selectText(r)),i}}}createPlugin(){return{appendTransaction:(e,t,r)=>{if(e.filter(p=>!!p.getMeta(this.name)).forEach(p=>{const h=p.getMeta(this.name);if(h.command===a4){const{range:m,attrs:b}=h,{selection:v,doc:g}=r,y={range:m,selection:v,doc:g,attrs:b},{from:x,to:k}=m??v;this.options.onUpdateLink(g.textBetween(x,k),y)}}),!this.options.autoLink||W0(t)-W0(r)===1||!e.some(p=>p.docChanged))return;const s=Z6(e,t),a=OC(s,[bt,Dt]),{mapping:l}=s,{tr:c,doc:u}=r,{updateLink:d,removeLink:f}=this.store.chain(c);if(a.forEach(({prevFrom:p,prevTo:h,from:m,to:b})=>{const v=[],g=b-m===2,y=this.getLinkMarksInRange(t.doc,p,h,!0).filter(x=>x.mark.type===this.type).map(({from:x,to:k,text:w})=>({mappedFrom:l.map(x),mappedTo:l.map(k),text:w,from:x,to:k}));y.forEach(({mappedFrom:x,mappedTo:k,from:w,to:E},T)=>this.getLinkMarksInRange(u,x,k,!0).filter(C=>C.mark.type===this.type).forEach(C=>{const M=t.doc.textBetween(w,E,void 0," "),N=u.textBetween(C.from,C.to+1,void 0," ").trim(),F=this.isValidUrl(M);this.isValidUrl(N)||(F&&(f({from:C.from,to:C.to}).tr(),y.splice(T,1)),!g&&m===b&&this.findAutoLinks(N).map(V=>this.addLinkProperties({...V,from:x+V.start,to:x+V.end})).forEach(({attrs:V,range:j,text:z})=>{d(V,j).tr(),v.push({attrs:V,range:j,text:z})}))})),this.findTextBlocksInRange(u,{from:m,to:b}).forEach(({text:x,positionStart:k})=>{this.findAutoLinks(x).map(w=>this.addLinkProperties({...w,from:k+w.start+1,to:k+w.end+1})).filter(({range:w})=>{const E=m>=w.from&&m<=w.to,T=b>=w.from&&b<=w.to;return E||T||g}).filter(({range:w})=>this.getLinkMarksInRange(c.doc,w.from,w.to,!1).length===0).filter(({range:{from:w},text:E})=>!y.some(({text:T,mappedFrom:C})=>C===w&&T===E)).forEach(({attrs:w,text:E,range:T})=>{d(w,T).tr(),v.push({attrs:w,range:T,text:E})})}),window.requestAnimationFrame(()=>{v.forEach(({attrs:x,range:k,text:w})=>{const{doc:E,selection:T}=c;this.options.onUpdateLink(w,{attrs:x,doc:E,range:k,selection:T})})})}),c.steps.length!==0)return c}}}buildHref(e){return this.options.extractHref({url:e,defaultProtocol:this.options.defaultProtocol})}getLinkMarksInRange(e,t,r,n){const o=[];if(t===r){const i=Math.max(t-1,0),s=e.resolve(i),a=_o(s,this.type);(a==null?void 0:a.mark.attrs.auto)===n&&o.push(a)}else e.nodesBetween(t,r,(i,s)=>{const l=(i.marks??[]).find(({type:c,attrs:u})=>c===this.type&&u.auto===n);l&&o.push({from:s,to:s+i.nodeSize,mark:l,text:i.textContent})});return o}findTextBlocksInRange(e,t){const r=[];return e.nodesBetween(t.from,t.to,(n,o)=>{!n.isTextblock||!n.type.allowsMarkType(this.type)||r.push({node:n,pos:o})}),r.map(n=>({text:e.textBetween(n.pos,n.pos+n.node.nodeSize,void 0," "),positionStart:n.pos}))}addLinkProperties({from:e,to:t,href:r,...n}){return{...n,range:{from:e,to:t},attrs:{href:r,auto:!0}}}findAutoLinks(e){if(this.options.findAutoLinks)return this.options.findAutoLinks(e,this.options.defaultProtocol);const t=[];for(const r of xa(e,this.options.autoLinkRegex)){const n=Zo(r);if(!n)continue;const o=this.buildHref(n);!this.isValidTLD(o)&&!o.startsWith("tel:")||t.push({text:n,href:o,start:r.index,end:r.index+n.length})}return t}isValidUrl(e){var t;return this.options.isValidUrl?this.options.isValidUrl(e,this.options.defaultProtocol):this.isValidTLD(this.buildHref(e))&&!!((t=this._autoLinkRegexNonGlobal)!=null&&t.test(e))}isValidTLD(e){const{autoLinkAllowedTLDs:t}=this.options;if(t.length===0)return!0;const r=lae(e);if(r==="")return!0;const n=Q4(r.split("."));return t.includes(n)}};Zd([je({shortcut:D.InsertLink})],us.prototype,"shortcut",1);Zd([U()],us.prototype,"updateLink",1);Zd([U()],us.prototype,"selectLink",1);Zd([U()],us.prototype,"removeLink",1);us=Zd([pe({defaultOptions:{autoLink:!1,defaultProtocol:"",selectTextOnClick:!1,openLinkOnClick:!1,autoLinkRegex:fae,autoLinkAllowedTLDs:dae,findAutoLinks:void 0,isValidUrl:void 0,defaultTarget:null,supportedTargets:[],extractHref:pae},staticKeys:["autoLinkRegex"],handlerKeyOptions:{onClick:{earlyReturnValue:!0}},handlerKeys:["onActivateLink","onShortcut","onUpdateLink","onClick"],defaultPriority:Ae.Medium})],us);function pae({url:e,defaultProtocol:t}){const r=/^((?:https?|ftp)?:)\/\//.test(e);return!r&&e.includes("@")?`mailto:${e}`:r?e:`${t}//${e}`}function hae(e){for(var t=1;t0&&e[t-1]===` +`;)t--;return e.substring(0,t)}var vae=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function Sx(e){return Ex(e,vae)}var SO=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function EO(e){return Ex(e,SO)}function yae(e){return MO(e,SO)}var CO=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function bae(e){return Ex(e,CO)}function xae(e){return MO(e,CO)}function Ex(e,t){return t.indexOf(e.nodeName)>=0}function MO(e,t){return e.getElementsByTagName&&t.some(function(r){return e.getElementsByTagName(r).length})}var hr={};hr.paragraph={filter:"p",replacement:function(e){return` `+e+` -`}};pr.lineBreak={filter:"br",replacement:function(e,t,r){return r.br+` -`}};pr.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,r){var n=Number(t.nodeName.charAt(1));if(r.headingStyle==="setext"&&n<3){var o=dv(n===1?"=":"-",e.length);return` +`}};hr.lineBreak={filter:"br",replacement:function(e,t,r){return r.br+` +`}};hr.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,r){var n=Number(t.nodeName.charAt(1));if(r.headingStyle==="setext"&&n<3){var o=hv(n===1?"=":"-",e.length);return` `+e+` `+o+` `}else return` -`+dv("#",n)+" "+e+` +`+hv("#",n)+" "+e+` -`}};pr.blockquote={filter:"blockquote",replacement:function(e){return e=e.replace(/^\n+|\n+$/g,""),e=e.replace(/^/gm,"> "),` +`}};hr.blockquote={filter:"blockquote",replacement:function(e){return e=e.replace(/^\n+|\n+$/g,""),e=e.replace(/^/gm,"> "),` `+e+` -`}};pr.list={filter:["ul","ol"],replacement:function(e,t){var r=t.parentNode;return r.nodeName==="LI"&&r.lastElementChild===t?` +`}};hr.list={filter:["ul","ol"],replacement:function(e,t){var r=t.parentNode;return r.nodeName==="LI"&&r.lastElementChild===t?` `+e:` `+e+` -`}};pr.listItem={filter:"li",replacement:function(e,t,r){e=e.replace(/^\n+/,"").replace(/\n+$/,` +`}};hr.listItem={filter:"li",replacement:function(e,t,r){e=e.replace(/^\n+/,"").replace(/\n+$/,` `).replace(/\n/gm,` `);var n=r.bulletListMarker+" ",o=t.parentNode;if(o.nodeName==="OL"){var i=o.getAttribute("start"),s=Array.prototype.indexOf.call(o.children,t);n=(i?Number(i)+s:s+1)+". "}return n+e+(t.nextSibling&&!/\n$/.test(e)?` -`:"")}};pr.indentedCodeBlock={filter:function(e,t){return t.codeBlockStyle==="indented"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,t,r){return` +`:"")}};hr.indentedCodeBlock={filter:function(e,t){return t.codeBlockStyle==="indented"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,t,r){return` `+t.firstChild.textContent.replace(/\n/g,` `)+` -`}};pr.fencedCodeBlock={filter:function(e,t){return t.codeBlockStyle==="fenced"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,t,r){for(var n=t.firstChild.getAttribute("class")||"",o=(n.match(/language-(\S+)/)||[null,""])[1],i=t.firstChild.textContent,s=r.fence.charAt(0),a=3,l=new RegExp("^"+s+"{3,}","gm"),c;c=l.exec(i);)c[0].length>=a&&(a=c[0].length+1);var u=dv(s,a);return` +`}};hr.fencedCodeBlock={filter:function(e,t){return t.codeBlockStyle==="fenced"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,t,r){for(var n=t.firstChild.getAttribute("class")||"",o=(n.match(/language-(\S+)/)||[null,""])[1],i=t.firstChild.textContent,s=r.fence.charAt(0),a=3,l=new RegExp("^"+s+"{3,}","gm"),c;c=l.exec(i);)c[0].length>=a&&(a=c[0].length+1);var u=hv(s,a);return` `+u+o+` `+i.replace(/\n$/,"")+` `+u+` -`}};pr.horizontalRule={filter:"hr",replacement:function(e,t,r){return` +`}};hr.horizontalRule={filter:"hr",replacement:function(e,t,r){return` `+r.hr+` -`}};pr.inlineLink={filter:function(e,t){return t.linkStyle==="inlined"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t){var r=t.getAttribute("href"),n=wh(t.getAttribute("title"));return n&&(n=' "'+n+'"'),"["+e+"]("+r+n+")"}};pr.referenceLink={filter:function(e,t){return t.linkStyle==="referenced"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t,r){var n=t.getAttribute("href"),o=wh(t.getAttribute("title"));o&&(o=' "'+o+'"');var i,s;switch(r.linkReferenceStyle){case"collapsed":i="["+e+"][]",s="["+e+"]: "+n+o;break;case"shortcut":i="["+e+"]",s="["+e+"]: "+n+o;break;default:var a=this.references.length+1;i="["+e+"]["+a+"]",s="["+a+"]: "+n+o}return this.references.push(s),i},references:[],append:function(e){var t="";return this.references.length&&(t=` +`}};hr.inlineLink={filter:function(e,t){return t.linkStyle==="inlined"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t){var r=t.getAttribute("href"),n=Eh(t.getAttribute("title"));return n&&(n=' "'+n+'"'),"["+e+"]("+r+n+")"}};hr.referenceLink={filter:function(e,t){return t.linkStyle==="referenced"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t,r){var n=t.getAttribute("href"),o=Eh(t.getAttribute("title"));o&&(o=' "'+o+'"');var i,s;switch(r.linkReferenceStyle){case"collapsed":i="["+e+"][]",s="["+e+"]: "+n+o;break;case"shortcut":i="["+e+"]",s="["+e+"]: "+n+o;break;default:var a=this.references.length+1;i="["+e+"]["+a+"]",s="["+a+"]: "+n+o}return this.references.push(s),i},references:[],append:function(e){var t="";return this.references.length&&(t=` `+this.references.join(` `)+` -`,this.references=[]),t}};pr.emphasis={filter:["em","i"],replacement:function(e,t,r){return e.trim()?r.emDelimiter+e+r.emDelimiter:""}};pr.strong={filter:["strong","b"],replacement:function(e,t,r){return e.trim()?r.strongDelimiter+e+r.strongDelimiter:""}};pr.code={filter:function(e){var t=e.previousSibling||e.nextSibling,r=e.parentNode.nodeName==="PRE"&&!t;return e.nodeName==="CODE"&&!r},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",r="`",n=e.match(/`+/gm)||[];n.indexOf(r)!==-1;)r=r+"`";return r+t+e+t+r}};pr.image={filter:"img",replacement:function(e,t){var r=wh(t.getAttribute("alt")),n=t.getAttribute("src")||"",o=wh(t.getAttribute("title")),i=o?' "'+o+'"':"";return n?"!["+r+"]("+n+i+")":""}};function wh(e){return e?e.replace(/(\n+\s*)+/g,` -`):""}function wO(e){this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[];for(var t in e.rules)this.array.push(e.rules[t])}wO.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){if(e.isBlank)return this.blankRule;var t;return(t=p1(this.array,e,this.options))||(t=p1(this._keep,e,this.options))||(t=p1(this._remove,e,this.options))?t:this.defaultRule},forEach:function(e){for(var t=0;t-1)return!0}else if(typeof n=="function"){if(n.call(e,t,r))return!0}else throw new TypeError("`filter` needs to be a string, array, or function")}function vae(e){var t=e.element,r=e.isBlock,n=e.isVoid,o=e.isPre||function(d){return d.nodeName==="PRE"};if(!(!t.firstChild||o(t))){for(var i=null,s=!1,a=null,l=i4(a,t,o);l!==t;){if(l.nodeType===3||l.nodeType===4){var c=l.data.replace(/[ \r\n\t]+/g," ");if((!i||/ $/.test(i.data))&&!s&&c[0]===" "&&(c=c.substr(1)),!c){l=h1(l);continue}l.data=c,i=l}else if(l.nodeType===1)r(l)||l.nodeName==="BR"?(i&&(i.data=i.data.replace(/ $/,"")),i=null,s=!1):n(l)||o(l)?(i=null,s=!0):i&&(s=!1);else{l=h1(l);continue}var u=i4(a,l,o);a=l,l=u}i&&(i.data=i.data.replace(/ $/,""),i.data||h1(i))}}function h1(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function i4(e,t,r){return e&&e.parentNode===t||r(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}var SO=typeof window<"u"?window:{};function yae(){var e=SO.DOMParser,t=!1;try{new e().parseFromString("","text/html")&&(t=!0)}catch{}return t}function bae(){var e=function(){};return xae()?e.prototype.parseFromString=function(t){var r=new window.ActiveXObject("htmlfile");return r.designMode="on",r.open(),r.write(t),r.close(),r}:e.prototype.parseFromString=function(t){var r=document.implementation.createHTMLDocument("");return r.open(),r.write(t),r.close(),r},e}function xae(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch{window.ActiveXObject&&(e=!0)}return e}var kae=yae()?SO.DOMParser:bae();function wae(e,t){var r;if(typeof e=="string"){var n=Sae().parseFromString(''+e+"","text/html");r=n.getElementById("turndown-root")}else r=e.cloneNode(!0);return vae({element:r,isBlock:xx,isVoid:bO,isPre:t.preformattedCode?Eae:null}),r}var m1;function Sae(){return m1=m1||new kae,m1}function Eae(e){return e.nodeName==="PRE"||e.nodeName==="CODE"}function Cae(e,t){return e.isBlock=xx(e),e.isCode=e.nodeName==="CODE"||e.parentNode.isCode,e.isBlank=Mae(e),e.flankingWhitespace=Tae(e,t),e}function Mae(e){return!bO(e)&&!hae(e)&&/^\s*$/i.test(e.textContent)&&!pae(e)&&!mae(e)}function Tae(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var r=Oae(e.textContent);return r.leadingAscii&&s4("left",e,t)&&(r.leading=r.leadingNonAscii),r.trailingAscii&&s4("right",e,t)&&(r.trailing=r.trailingNonAscii),{leading:r.leading,trailing:r.trailing}}function Oae(e){var t=e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:t[1],leadingAscii:t[2],leadingNonAscii:t[3],trailing:t[4],trailingNonAscii:t[5],trailingAscii:t[6]}}function s4(e,t,r){var n,o,i;return e==="left"?(n=t.previousSibling,o=/ $/):(n=t.nextSibling,o=/^ /),n&&(n.nodeType===3?i=o.test(n.nodeValue):r.preformattedCode&&n.nodeName==="CODE"?i=!1:n.nodeType===1&&!xx(n)&&(i=o.test(n.textContent))),i}var _ae=Array.prototype.reduce,Aae=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function Sd(e){if(!(this instanceof Sd))return new Sd(e);var t={rules:pr,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(r,n){return n.isBlock?` +`,this.references=[]),t}};hr.emphasis={filter:["em","i"],replacement:function(e,t,r){return e.trim()?r.emDelimiter+e+r.emDelimiter:""}};hr.strong={filter:["strong","b"],replacement:function(e,t,r){return e.trim()?r.strongDelimiter+e+r.strongDelimiter:""}};hr.code={filter:function(e){var t=e.previousSibling||e.nextSibling,r=e.parentNode.nodeName==="PRE"&&!t;return e.nodeName==="CODE"&&!r},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",r="`",n=e.match(/`+/gm)||[];n.indexOf(r)!==-1;)r=r+"`";return r+t+e+t+r}};hr.image={filter:"img",replacement:function(e,t){var r=Eh(t.getAttribute("alt")),n=t.getAttribute("src")||"",o=Eh(t.getAttribute("title")),i=o?' "'+o+'"':"";return n?"!["+r+"]("+n+i+")":""}};function Eh(e){return e?e.replace(/(\n+\s*)+/g,` +`):""}function TO(e){this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[];for(var t in e.rules)this.array.push(e.rules[t])}TO.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){if(e.isBlank)return this.blankRule;var t;return(t=g1(this.array,e,this.options))||(t=g1(this._keep,e,this.options))||(t=g1(this._remove,e,this.options))?t:this.defaultRule},forEach:function(e){for(var t=0;t-1)return!0}else if(typeof n=="function"){if(n.call(e,t,r))return!0}else throw new TypeError("`filter` needs to be a string, array, or function")}function wae(e){var t=e.element,r=e.isBlock,n=e.isVoid,o=e.isPre||function(d){return d.nodeName==="PRE"};if(!(!t.firstChild||o(t))){for(var i=null,s=!1,a=null,l=l4(a,t,o);l!==t;){if(l.nodeType===3||l.nodeType===4){var c=l.data.replace(/[ \r\n\t]+/g," ");if((!i||/ $/.test(i.data))&&!s&&c[0]===" "&&(c=c.substr(1)),!c){l=v1(l);continue}l.data=c,i=l}else if(l.nodeType===1)r(l)||l.nodeName==="BR"?(i&&(i.data=i.data.replace(/ $/,"")),i=null,s=!1):n(l)||o(l)?(i=null,s=!0):i&&(s=!1);else{l=v1(l);continue}var u=l4(a,l,o);a=l,l=u}i&&(i.data=i.data.replace(/ $/,""),i.data||v1(i))}}function v1(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function l4(e,t,r){return e&&e.parentNode===t||r(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}var OO=typeof window<"u"?window:{};function Sae(){var e=OO.DOMParser,t=!1;try{new e().parseFromString("","text/html")&&(t=!0)}catch{}return t}function Eae(){var e=function(){};return Cae()?e.prototype.parseFromString=function(t){var r=new window.ActiveXObject("htmlfile");return r.designMode="on",r.open(),r.write(t),r.close(),r}:e.prototype.parseFromString=function(t){var r=document.implementation.createHTMLDocument("");return r.open(),r.write(t),r.close(),r},e}function Cae(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch{window.ActiveXObject&&(e=!0)}return e}var Mae=Sae()?OO.DOMParser:Eae();function Tae(e,t){var r;if(typeof e=="string"){var n=Oae().parseFromString(''+e+"","text/html");r=n.getElementById("turndown-root")}else r=e.cloneNode(!0);return wae({element:r,isBlock:Sx,isVoid:EO,isPre:t.preformattedCode?_ae:null}),r}var y1;function Oae(){return y1=y1||new Mae,y1}function _ae(e){return e.nodeName==="PRE"||e.nodeName==="CODE"}function Aae(e,t){return e.isBlock=Sx(e),e.isCode=e.nodeName==="CODE"||e.parentNode.isCode,e.isBlank=Nae(e),e.flankingWhitespace=Rae(e,t),e}function Nae(e){return!EO(e)&&!bae(e)&&/^\s*$/i.test(e.textContent)&&!yae(e)&&!xae(e)}function Rae(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var r=Pae(e.textContent);return r.leadingAscii&&c4("left",e,t)&&(r.leading=r.leadingNonAscii),r.trailingAscii&&c4("right",e,t)&&(r.trailing=r.trailingNonAscii),{leading:r.leading,trailing:r.trailing}}function Pae(e){var t=e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:t[1],leadingAscii:t[2],leadingNonAscii:t[3],trailing:t[4],trailingNonAscii:t[5],trailingAscii:t[6]}}function c4(e,t,r){var n,o,i;return e==="left"?(n=t.previousSibling,o=/ $/):(n=t.nextSibling,o=/^ /),n&&(n.nodeType===3?i=o.test(n.nodeValue):r.preformattedCode&&n.nodeName==="CODE"?i=!1:n.nodeType===1&&!Sx(n)&&(i=o.test(n.textContent))),i}var zae=Array.prototype.reduce,Lae=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function Ed(e){if(!(this instanceof Ed))return new Ed(e);var t={rules:hr,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(r,n){return n.isBlock?` `:""},keepReplacement:function(r,n){return n.isBlock?` @@ -4928,22 +4928,22 @@ Error generating stack: `+i.message+` `+r+` -`:r}};this.options=cae({},t,e),this.rules=new wO(this.options)}Sd.prototype={turndown:function(e){if(!Pae(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(e==="")return"";var t=EO.call(this,new wae(e,this.options));return Nae.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t"']/,Lae=new RegExp(TO.source,"g"),OO=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Iae=new RegExp(OO.source,"g"),Dae={"&":"&","<":"<",">":">",'"':""","'":"'"},a4=e=>Dae[e];function lr(e,t){if(t){if(TO.test(e))return e.replace(Lae,a4)}else if(OO.test(e))return e.replace(Iae,a4);return e}const $ae=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function _O(e){return e.replace($ae,(t,r)=>(r=r.toLowerCase(),r==="colon"?":":r.charAt(0)==="#"?r.charAt(1)==="x"?String.fromCharCode(parseInt(r.substring(2),16)):String.fromCharCode(+r.substring(1)):""))}const Hae=/(^|[^\[])\^/g;function We(e,t){e=typeof e=="string"?e:e.source,t=t||"";const r={replace:(n,o)=>(o=o.source||o,o=o.replace(Hae,"$1"),e=e.replace(n,o),r),getRegex:()=>new RegExp(e,t)};return r}const Bae=/[^\w:]/g,Fae=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function l4(e,t,r){if(e){let n;try{n=decodeURIComponent(_O(r)).replace(Bae,"").toLowerCase()}catch{return null}if(n.indexOf("javascript:")===0||n.indexOf("vbscript:")===0||n.indexOf("data:")===0)return null}t&&!Fae.test(r)&&(r=Wae(t,r));try{r=encodeURI(r).replace(/%25/g,"%")}catch{return null}return r}const Nf={},Vae=/^[^:]+:\/*[^/]*$/,jae=/^([^:]+:)[\s\S]*$/,Uae=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Wae(e,t){Nf[" "+e]||(Vae.test(e)?Nf[" "+e]=e+"/":Nf[" "+e]=pp(e,"/",!0)),e=Nf[" "+e];const r=e.indexOf(":")===-1;return t.substring(0,2)==="//"?r?t:e.replace(jae,"$1")+t:t.charAt(0)==="/"?r?t:e.replace(Uae,"$1")+t:e+t}const Sh={exec:function(){}};function c4(e,t){const r=e.replace(/\|/g,(i,s,a)=>{let l=!1,c=s;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),n=r.split(/ \|/);let o=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length1;)t&1&&(r+=e),t>>=1,e+=e;return r+e}function d4(e,t,r,n){const o=t.href,i=t.title?lr(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){n.state.inLink=!0;const a={type:"link",raw:r,href:o,title:i,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,a}return{type:"image",raw:r,href:o,title:i,text:lr(s)}}function Gae(e,t){const r=e.match(/^(\s+)(?:```)/);if(r===null)return t;const n=r[1];return t.split(` +`.substring(0,o);return r+i+n}function $ae(e){return e!=null&&(typeof e=="string"||e.nodeType&&(e.nodeType===1||e.nodeType===9||e.nodeType===11))}function NO(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Ta=NO();function Hae(e){Ta=e}const RO=/[&<>"']/,Bae=new RegExp(RO.source,"g"),PO=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Fae=new RegExp(PO.source,"g"),Vae={"&":"&","<":"<",">":">",'"':""","'":"'"},u4=e=>Vae[e];function cr(e,t){if(t){if(RO.test(e))return e.replace(Bae,u4)}else if(PO.test(e))return e.replace(Fae,u4);return e}const jae=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function zO(e){return e.replace(jae,(t,r)=>(r=r.toLowerCase(),r==="colon"?":":r.charAt(0)==="#"?r.charAt(1)==="x"?String.fromCharCode(parseInt(r.substring(2),16)):String.fromCharCode(+r.substring(1)):""))}const Uae=/(^|[^\[])\^/g;function We(e,t){e=typeof e=="string"?e:e.source,t=t||"";const r={replace:(n,o)=>(o=o.source||o,o=o.replace(Uae,"$1"),e=e.replace(n,o),r),getRegex:()=>new RegExp(e,t)};return r}const Wae=/[^\w:]/g,Kae=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function d4(e,t,r){if(e){let n;try{n=decodeURIComponent(zO(r)).replace(Wae,"").toLowerCase()}catch{return null}if(n.indexOf("javascript:")===0||n.indexOf("vbscript:")===0||n.indexOf("data:")===0)return null}t&&!Kae.test(r)&&(r=Jae(t,r));try{r=encodeURI(r).replace(/%25/g,"%")}catch{return null}return r}const Pf={},qae=/^[^:]+:\/*[^/]*$/,Gae=/^([^:]+:)[\s\S]*$/,Yae=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Jae(e,t){Pf[" "+e]||(qae.test(e)?Pf[" "+e]=e+"/":Pf[" "+e]=mp(e,"/",!0)),e=Pf[" "+e];const r=e.indexOf(":")===-1;return t.substring(0,2)==="//"?r?t:e.replace(Gae,"$1")+t:t.charAt(0)==="/"?r?t:e.replace(Yae,"$1")+t:e+t}const Ch={exec:function(){}};function f4(e,t){const r=e.replace(/\|/g,(i,s,a)=>{let l=!1,c=s;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),n=r.split(/ \|/);let o=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length1;)t&1&&(r+=e),t>>=1,e+=e;return r+e}function h4(e,t,r,n){const o=t.href,i=t.title?cr(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){n.state.inLink=!0;const a={type:"link",raw:r,href:o,title:i,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,a}return{type:"image",raw:r,href:o,title:i,text:cr(s)}}function Zae(e,t){const r=e.match(/^(\s+)(?:```)/);if(r===null)return t;const n=r[1];return t.split(` `).map(o=>{const i=o.match(/^\s+/);if(i===null)return o;const[s]=i;return s.length>=n.length?o.slice(n.length):o}).join(` -`)}class wx{constructor(t){this.options=t||Ta}space(t){const r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){const r=this.rules.block.code.exec(t);if(r){const n=r[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:pp(n,` -`)}}}fences(t){const r=this.rules.block.fences.exec(t);if(r){const n=r[0],o=Gae(n,r[3]||"");return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline._escapes,"$1"):r[2],text:o}}}heading(t){const r=this.rules.block.heading.exec(t);if(r){let n=r[2].trim();if(/#$/.test(n)){const o=pp(n,"#");(this.options.pedantic||!o||/ $/.test(o))&&(n=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){const r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:r[0]}}blockquote(t){const r=this.rules.block.blockquote.exec(t);if(r){const n=r[0].replace(/^ *>[ \t]?/gm,""),o=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(n);return this.lexer.state.top=o,{type:"blockquote",raw:r[0],tokens:i,text:n}}}list(t){let r=this.rules.block.list.exec(t);if(r){let n,o,i,s,a,l,c,u,d,f,p,h,m=r[1].trim();const b=m.length>1,v={type:"list",raw:"",ordered:b,start:b?+m.slice(0,-1):"",loose:!1,items:[]};m=b?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=b?m:"[*+-]");const g=new RegExp(`^( {0,3}${m})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(h=!1,!(!(r=g.exec(t))||this.rules.block.hr.test(t)));){if(n=r[0],t=t.substring(n.length),u=r[2].split(` +`)}class Cx{constructor(t){this.options=t||Ta}space(t){const r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){const r=this.rules.block.code.exec(t);if(r){const n=r[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:mp(n,` +`)}}}fences(t){const r=this.rules.block.fences.exec(t);if(r){const n=r[0],o=Zae(n,r[3]||"");return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline._escapes,"$1"):r[2],text:o}}}heading(t){const r=this.rules.block.heading.exec(t);if(r){let n=r[2].trim();if(/#$/.test(n)){const o=mp(n,"#");(this.options.pedantic||!o||/ $/.test(o))&&(n=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){const r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:r[0]}}blockquote(t){const r=this.rules.block.blockquote.exec(t);if(r){const n=r[0].replace(/^ *>[ \t]?/gm,""),o=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(n);return this.lexer.state.top=o,{type:"blockquote",raw:r[0],tokens:i,text:n}}}list(t){let r=this.rules.block.list.exec(t);if(r){let n,o,i,s,a,l,c,u,d,f,p,h,m=r[1].trim();const b=m.length>1,v={type:"list",raw:"",ordered:b,start:b?+m.slice(0,-1):"",loose:!1,items:[]};m=b?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=b?m:"[*+-]");const g=new RegExp(`^( {0,3}${m})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(h=!1,!(!(r=g.exec(t))||this.rules.block.hr.test(t)));){if(n=r[0],t=t.substring(n.length),u=r[2].split(` `,1)[0].replace(/^\t+/,x=>" ".repeat(3*x.length)),d=t.split(` `,1)[0],this.options.pedantic?(s=2,p=u.trimLeft()):(s=r[2].search(/[^ ]/),s=s>4?1:s,p=u.slice(s),s+=r[1].length),l=!1,!u&&/^ *$/.test(d)&&(n+=d+` `,t=t.substring(d.length+1),h=!0),!h){const x=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),k=new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),w=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),E=new RegExp(`^ {0,${Math.min(3,s-1)}}#`);for(;t&&(f=t.split(` `,1)[0],d=f,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(w.test(d)||E.test(d)||x.test(d)||k.test(t)));){if(d.search(/[^ ]/)>=s||!d.trim())p+=` `+d.slice(s);else{if(l||u.search(/[^ ]/)>=4||w.test(u)||E.test(u)||k.test(u))break;p+=` `+d}!l&&!d.trim()&&(l=!0),n+=f+` -`,t=t.substring(f.length+1),u=d.slice(s)}}v.loose||(c?v.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(o=/^\[[ xX]\] /.exec(p),o&&(i=o[0]!=="[ ] ",p=p.replace(/^\[[ xX]\] +/,""))),v.items.push({type:"list_item",raw:n,task:!!o,checked:i,loose:!1,text:p}),v.raw+=n}v.items[v.items.length-1].raw=n.trimRight(),v.items[v.items.length-1].text=p.trimRight(),v.raw=v.raw.trimRight();const y=v.items.length;for(a=0;aw.type==="space"),k=x.length>0&&x.some(w=>/\n.*\n/.test(w.raw));v.loose=k}if(v.loose)for(a=0;a$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline._escapes,"$1"):r[3];return{type:"def",tag:n,raw:r[0],href:o,title:i}}}table(t){const r=this.rules.block.table.exec(t);if(r){const n={type:"table",header:c4(r[1]).map(o=>({text:o})),align:r[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:r[3]&&r[3].trim()?r[3].replace(/\n[ \t]*$/,"").split(` -`):[]};if(n.header.length===n.align.length){n.raw=r[0];let o=n.align.length,i,s,a,l;for(i=0;i({text:c}));for(o=n.header.length,s=0;s/i.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):lr(r[0]):r[0]}}link(t){const r=this.rules.inline.link.exec(t);if(r){const n=r[2].trim();if(!this.options.pedantic&&/^$/.test(n))return;const s=pp(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{const s=Kae(r[2],"()");if(s>-1){const l=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,l).trim(),r[3]=""}}let o=r[2],i="";if(this.options.pedantic){const s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);s&&(o=s[1],i=s[3])}else i=r[3]?r[3].slice(1,-1):"";return o=o.trim(),/^$/.test(n)?o=o.slice(1):o=o.slice(1,-1)),d4(r,{href:o&&o.replace(this.rules.inline._escapes,"$1"),title:i&&i.replace(this.rules.inline._escapes,"$1")},r[0],this.lexer)}}reflink(t,r){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let o=(n[2]||n[1]).replace(/\s+/g," ");if(o=r[o.toLowerCase()],!o){const i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return d4(n,o,n[0],this.lexer)}}emStrong(t,r,n=""){let o=this.rules.inline.emStrong.lDelim.exec(t);if(!o||o[3]&&n.match(/[\p{L}\p{N}]/u))return;const i=o[1]||o[2]||"";if(!i||i&&(n===""||this.rules.inline.punctuation.exec(n))){const s=o[0].length-1;let a,l,c=s,u=0;const d=o[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,r=r.slice(-1*t.length+s);(o=d.exec(r))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(l=a.length,o[3]||o[4]){c+=l;continue}else if((o[5]||o[6])&&s%3&&!((s+l)%3)){u+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+u);const f=t.slice(0,s+o.index+(o[0].length-a.length)+l);if(Math.min(s,l)%2){const h=f.slice(1,-1);return{type:"em",raw:f,text:h,tokens:this.lexer.inlineTokens(h)}}const p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(t){const r=this.rules.inline.code.exec(t);if(r){let n=r[2].replace(/\n/g," ");const o=/[^ ]/.test(n),i=/^ /.test(n)&&/ $/.test(n);return o&&i&&(n=n.substring(1,n.length-1)),n=lr(n,!0),{type:"codespan",raw:r[0],text:n}}}br(t){const r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){const r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t,r){const n=this.rules.inline.autolink.exec(t);if(n){let o,i;return n[2]==="@"?(o=lr(this.options.mangle?r(n[1]):n[1]),i="mailto:"+o):(o=lr(n[1]),i=o),{type:"link",raw:n[0],text:o,href:i,tokens:[{type:"text",raw:o,text:o}]}}}url(t,r){let n;if(n=this.rules.inline.url.exec(t)){let o,i;if(n[2]==="@")o=lr(this.options.mangle?r(n[0]):n[0]),i="mailto:"+o;else{let s;do s=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0];while(s!==n[0]);o=lr(n[0]),n[1]==="www."?i="http://"+n[0]:i=n[0]}return{type:"link",raw:n[0],text:o,href:i,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(t,r){const n=this.rules.inline.text.exec(t);if(n){let o;return this.lexer.state.inRawBlock?o=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):lr(n[0]):n[0]:o=lr(this.options.smartypants?r(n[0]):n[0]),{type:"text",raw:n[0],text:o}}}}const ae={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Sh,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};ae._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;ae._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;ae.def=We(ae.def).replace("label",ae._label).replace("title",ae._title).getRegex();ae.bullet=/(?:[*+-]|\d{1,9}[.)])/;ae.listItemStart=We(/^( *)(bull) */).replace("bull",ae.bullet).getRegex();ae.list=We(ae.list).replace(/bull/g,ae.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ae.def.source+")").getRegex();ae._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";ae._comment=/|$)/;ae.html=We(ae.html,"i").replace("comment",ae._comment).replace("tag",ae._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();ae.paragraph=We(ae._paragraph).replace("hr",ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ae._tag).getRegex();ae.blockquote=We(ae.blockquote).replace("paragraph",ae.paragraph).getRegex();ae.normal={...ae};ae.gfm={...ae.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};ae.gfm.table=We(ae.gfm.table).replace("hr",ae.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ae._tag).getRegex();ae.gfm.paragraph=We(ae._paragraph).replace("hr",ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",ae.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ae._tag).getRegex();ae.pedantic={...ae.normal,html:We(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ae._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Sh,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:We(ae.normal._paragraph).replace("hr",ae.hr).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",ae.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Sh,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Sh,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";Q.punctuation=We(Q.punctuation).replace(/punctuation/g,Q._punctuation).getRegex();Q.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;Q.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;Q._comment=We(ae._comment).replace("(?:-->|$)","-->").getRegex();Q.emStrong.lDelim=We(Q.emStrong.lDelim).replace(/punct/g,Q._punctuation).getRegex();Q.emStrong.rDelimAst=We(Q.emStrong.rDelimAst,"g").replace(/punct/g,Q._punctuation).getRegex();Q.emStrong.rDelimUnd=We(Q.emStrong.rDelimUnd,"g").replace(/punct/g,Q._punctuation).getRegex();Q._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;Q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;Q._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;Q.autolink=We(Q.autolink).replace("scheme",Q._scheme).replace("email",Q._email).getRegex();Q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;Q.tag=We(Q.tag).replace("comment",Q._comment).replace("attribute",Q._attribute).getRegex();Q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;Q._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;Q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;Q.link=We(Q.link).replace("label",Q._label).replace("href",Q._href).replace("title",Q._title).getRegex();Q.reflink=We(Q.reflink).replace("label",Q._label).replace("ref",ae._label).getRegex();Q.nolink=We(Q.nolink).replace("ref",ae._label).getRegex();Q.reflinkSearch=We(Q.reflinkSearch,"g").replace("reflink",Q.reflink).replace("nolink",Q.nolink).getRegex();Q.normal={...Q};Q.pedantic={...Q.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:We(/^!?\[(label)\]\((.*?)\)/).replace("label",Q._label).getRegex(),reflink:We(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Q._label).getRegex()};Q.gfm={...Q.normal,escape:We(Q.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),t+="&#"+n+";";return t}class ds{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ta,this.options.tokenizer=this.options.tokenizer||new wx,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={block:ae.normal,inline:Q.normal};this.options.pedantic?(r.block=ae.pedantic,r.inline=Q.pedantic):this.options.gfm&&(r.block=ae.gfm,this.options.breaks?r.inline=Q.breaks:r.inline=Q.gfm),this.tokenizer.rules=r}static get rules(){return{block:ae,inline:Q}}static lex(t,r){return new ds(r).lex(t)}static lexInline(t,r){return new ds(r).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,` +`,t=t.substring(f.length+1),u=d.slice(s)}}v.loose||(c?v.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(o=/^\[[ xX]\] /.exec(p),o&&(i=o[0]!=="[ ] ",p=p.replace(/^\[[ xX]\] +/,""))),v.items.push({type:"list_item",raw:n,task:!!o,checked:i,loose:!1,text:p}),v.raw+=n}v.items[v.items.length-1].raw=n.trimRight(),v.items[v.items.length-1].text=p.trimRight(),v.raw=v.raw.trimRight();const y=v.items.length;for(a=0;aw.type==="space"),k=x.length>0&&x.some(w=>/\n.*\n/.test(w.raw));v.loose=k}if(v.loose)for(a=0;a$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline._escapes,"$1"):r[3];return{type:"def",tag:n,raw:r[0],href:o,title:i}}}table(t){const r=this.rules.block.table.exec(t);if(r){const n={type:"table",header:f4(r[1]).map(o=>({text:o})),align:r[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:r[3]&&r[3].trim()?r[3].replace(/\n[ \t]*$/,"").split(` +`):[]};if(n.header.length===n.align.length){n.raw=r[0];let o=n.align.length,i,s,a,l;for(i=0;i({text:c}));for(o=n.header.length,s=0;s/i.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):cr(r[0]):r[0]}}link(t){const r=this.rules.inline.link.exec(t);if(r){const n=r[2].trim();if(!this.options.pedantic&&/^$/.test(n))return;const s=mp(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{const s=Xae(r[2],"()");if(s>-1){const l=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,l).trim(),r[3]=""}}let o=r[2],i="";if(this.options.pedantic){const s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);s&&(o=s[1],i=s[3])}else i=r[3]?r[3].slice(1,-1):"";return o=o.trim(),/^$/.test(n)?o=o.slice(1):o=o.slice(1,-1)),h4(r,{href:o&&o.replace(this.rules.inline._escapes,"$1"),title:i&&i.replace(this.rules.inline._escapes,"$1")},r[0],this.lexer)}}reflink(t,r){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let o=(n[2]||n[1]).replace(/\s+/g," ");if(o=r[o.toLowerCase()],!o){const i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return h4(n,o,n[0],this.lexer)}}emStrong(t,r,n=""){let o=this.rules.inline.emStrong.lDelim.exec(t);if(!o||o[3]&&n.match(/[\p{L}\p{N}]/u))return;const i=o[1]||o[2]||"";if(!i||i&&(n===""||this.rules.inline.punctuation.exec(n))){const s=o[0].length-1;let a,l,c=s,u=0;const d=o[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,r=r.slice(-1*t.length+s);(o=d.exec(r))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(l=a.length,o[3]||o[4]){c+=l;continue}else if((o[5]||o[6])&&s%3&&!((s+l)%3)){u+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+u);const f=t.slice(0,s+o.index+(o[0].length-a.length)+l);if(Math.min(s,l)%2){const h=f.slice(1,-1);return{type:"em",raw:f,text:h,tokens:this.lexer.inlineTokens(h)}}const p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(t){const r=this.rules.inline.code.exec(t);if(r){let n=r[2].replace(/\n/g," ");const o=/[^ ]/.test(n),i=/^ /.test(n)&&/ $/.test(n);return o&&i&&(n=n.substring(1,n.length-1)),n=cr(n,!0),{type:"codespan",raw:r[0],text:n}}}br(t){const r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){const r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t,r){const n=this.rules.inline.autolink.exec(t);if(n){let o,i;return n[2]==="@"?(o=cr(this.options.mangle?r(n[1]):n[1]),i="mailto:"+o):(o=cr(n[1]),i=o),{type:"link",raw:n[0],text:o,href:i,tokens:[{type:"text",raw:o,text:o}]}}}url(t,r){let n;if(n=this.rules.inline.url.exec(t)){let o,i;if(n[2]==="@")o=cr(this.options.mangle?r(n[0]):n[0]),i="mailto:"+o;else{let s;do s=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0];while(s!==n[0]);o=cr(n[0]),n[1]==="www."?i="http://"+n[0]:i=n[0]}return{type:"link",raw:n[0],text:o,href:i,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(t,r){const n=this.rules.inline.text.exec(t);if(n){let o;return this.lexer.state.inRawBlock?o=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):cr(n[0]):n[0]:o=cr(this.options.smartypants?r(n[0]):n[0]),{type:"text",raw:n[0],text:o}}}}const ae={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Ch,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};ae._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;ae._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;ae.def=We(ae.def).replace("label",ae._label).replace("title",ae._title).getRegex();ae.bullet=/(?:[*+-]|\d{1,9}[.)])/;ae.listItemStart=We(/^( *)(bull) */).replace("bull",ae.bullet).getRegex();ae.list=We(ae.list).replace(/bull/g,ae.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ae.def.source+")").getRegex();ae._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";ae._comment=/|$)/;ae.html=We(ae.html,"i").replace("comment",ae._comment).replace("tag",ae._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();ae.paragraph=We(ae._paragraph).replace("hr",ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ae._tag).getRegex();ae.blockquote=We(ae.blockquote).replace("paragraph",ae.paragraph).getRegex();ae.normal={...ae};ae.gfm={...ae.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};ae.gfm.table=We(ae.gfm.table).replace("hr",ae.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ae._tag).getRegex();ae.gfm.paragraph=We(ae._paragraph).replace("hr",ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",ae.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ae._tag).getRegex();ae.pedantic={...ae.normal,html:We(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ae._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ch,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:We(ae.normal._paragraph).replace("hr",ae.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",ae.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ch,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ch,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";Q.punctuation=We(Q.punctuation).replace(/punctuation/g,Q._punctuation).getRegex();Q.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;Q.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;Q._comment=We(ae._comment).replace("(?:-->|$)","-->").getRegex();Q.emStrong.lDelim=We(Q.emStrong.lDelim).replace(/punct/g,Q._punctuation).getRegex();Q.emStrong.rDelimAst=We(Q.emStrong.rDelimAst,"g").replace(/punct/g,Q._punctuation).getRegex();Q.emStrong.rDelimUnd=We(Q.emStrong.rDelimUnd,"g").replace(/punct/g,Q._punctuation).getRegex();Q._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;Q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;Q._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;Q.autolink=We(Q.autolink).replace("scheme",Q._scheme).replace("email",Q._email).getRegex();Q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;Q.tag=We(Q.tag).replace("comment",Q._comment).replace("attribute",Q._attribute).getRegex();Q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;Q._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;Q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;Q.link=We(Q.link).replace("label",Q._label).replace("href",Q._href).replace("title",Q._title).getRegex();Q.reflink=We(Q.reflink).replace("label",Q._label).replace("ref",ae._label).getRegex();Q.nolink=We(Q.nolink).replace("ref",ae._label).getRegex();Q.reflinkSearch=We(Q.reflinkSearch,"g").replace("reflink",Q.reflink).replace("nolink",Q.nolink).getRegex();Q.normal={...Q};Q.pedantic={...Q.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:We(/^!?\[(label)\]\((.*?)\)/).replace("label",Q._label).getRegex(),reflink:We(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Q._label).getRegex()};Q.gfm={...Q.normal,escape:We(Q.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),t+="&#"+n+";";return t}class ds{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ta,this.options.tokenizer=this.options.tokenizer||new Cx,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={block:ae.normal,inline:Q.normal};this.options.pedantic?(r.block=ae.pedantic,r.inline=Q.pedantic):this.options.gfm&&(r.block=ae.gfm,this.options.breaks?r.inline=Q.breaks:r.inline=Q.gfm),this.tokenizer.rules=r}static get rules(){return{block:ae,inline:Q}}static lex(t,r){return new ds(r).lex(t)}static lexInline(t,r){return new ds(r).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,` `),this.blockTokens(t,this.tokens);let r;for(;r=this.inlineQueue.shift();)this.inlineTokens(r.src,r.tokens);return this.tokens}blockTokens(t,r=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(a,l,c)=>l+" ".repeat(c.length));let n,o,i,s;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(n=a.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length),n.raw.length===1&&r.length>0?r[r.length-1].raw+=` `:r.push(n);continue}if(n=this.tokenizer.code(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=` `+n.raw,o.text+=` @@ -4953,9 +4953,9 @@ Error generating stack: `+i.message+` `+n.raw,o.text+=` `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n),s=i.length!==t.length,t=t.substring(n.raw.length);continue}if(n=this.tokenizer.text(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&o.type==="text"?(o.raw+=` `+n.raw,o.text+=` -`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let n,o,i,s=t,a,l,c;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)u.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+u4("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,a.index)+"["+u4("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(s))!=null;)s=s.slice(0,a.index+a[0].length-2)+"++"+s.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;t;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(n=u.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.escape(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.tag(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(n=this.tokenizer.link(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(n.raw.length),o=r[r.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(n=this.tokenizer.emStrong(t,s,c)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.codespan(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.br(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.del(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.autolink(t,f4)){t=t.substring(n.raw.length),r.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(t,f4))){t=t.substring(n.raw.length),r.push(n);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let u=1/0;const d=t.slice(1);let f;this.options.extensions.startInline.forEach(function(p){f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(i=t.substring(0,u+1))}if(n=this.tokenizer.inlineText(i,Yae)){t=t.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(c=n.raw.slice(-1)),l=!0,o=r[r.length-1],o&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(t){const u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return r}}class Sx{constructor(t){this.options=t||Ta}code(t,r,n){const o=(r||"").match(/\S*/)[0];if(this.options.highlight){const i=this.options.highlight(t,o);i!=null&&i!==t&&(n=!0,t=i)}return t=t.replace(/\n$/,"")+` -`,o?'
    '+(n?t:lr(t,!0))+`
    -`:"
    "+(n?t:lr(t,!0))+`
    +`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let n,o,i,s=t,a,l,c;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)u.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+p4("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,a.index)+"["+p4("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(s))!=null;)s=s.slice(0,a.index+a[0].length-2)+"++"+s.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;t;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(n=u.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.escape(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.tag(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(n=this.tokenizer.link(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(n.raw.length),o=r[r.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(n=this.tokenizer.emStrong(t,s,c)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.codespan(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.br(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.del(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.autolink(t,m4)){t=t.substring(n.raw.length),r.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(t,m4))){t=t.substring(n.raw.length),r.push(n);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let u=1/0;const d=t.slice(1);let f;this.options.extensions.startInline.forEach(function(p){f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(i=t.substring(0,u+1))}if(n=this.tokenizer.inlineText(i,ele)){t=t.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(c=n.raw.slice(-1)),l=!0,o=r[r.length-1],o&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(t){const u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return r}}class Mx{constructor(t){this.options=t||Ta}code(t,r,n){const o=(r||"").match(/\S*/)[0];if(this.options.highlight){const i=this.options.highlight(t,o);i!=null&&i!==t&&(n=!0,t=i)}return t=t.replace(/\n$/,"")+` +`,o?'
    '+(n?t:cr(t,!0))+`
    +`:"
    "+(n?t:cr(t,!0))+`
    `}blockquote(t){return`
    ${t}
    `}html(t){return t}heading(t,r,n,o){if(this.options.headerIds){const i=this.options.headerPrefix+o.slug(n);return`${t} @@ -4973,18 +4973,18 @@ ${t} `}tablerow(t){return` ${t} `}tablecell(t,r){const n=r.header?"th":"td";return(r.align?`<${n} align="${r.align}">`:`<${n}>`)+t+` -`}strong(t){return`${t}`}em(t){return`${t}`}codespan(t){return`${t}`}br(){return this.options.xhtml?"
    ":"
    "}del(t){return`${t}`}link(t,r,n){if(t=l4(this.options.sanitize,this.options.baseUrl,t),t===null)return n;let o='",o}image(t,r,n){if(t=l4(this.options.sanitize,this.options.baseUrl,t),t===null)return n;let o=`${n}":">",o}text(t){return t}}class AO{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,r,n){return""+n}image(t,r,n){return""+n}br(){return""}}class NO{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,r){let n=t,o=0;if(this.seen.hasOwnProperty(n)){o=this.seen[t];do o++,n=t+"-"+o;while(this.seen.hasOwnProperty(n))}return r||(this.seen[t]=o,this.seen[n]=0),n}slug(t,r={}){const n=this.serialize(t);return this.getNextSafeSlug(n,r.dryrun)}}class fs{constructor(t){this.options=t||Ta,this.options.renderer=this.options.renderer||new Sx,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new AO,this.slugger=new NO}static parse(t,r){return new fs(r).parse(t)}static parseInline(t,r){return new fs(r).parseInline(t)}parse(t,r=!0){let n="",o,i,s,a,l,c,u,d,f,p,h,m,b,v,g,y,x,k,w;const E=t.length;for(o=0;o0&&g.tokens[0].type==="paragraph"?(g.tokens[0].text=k+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&g.tokens[0].tokens[0].type==="text"&&(g.tokens[0].tokens[0].text=k+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:k}):v+=k),v+=this.parse(g.tokens,b),f+=this.renderer.listitem(v,x,y);n+=this.renderer.list(f,h,m);continue}case"html":{n+=this.renderer.html(p.text);continue}case"paragraph":{n+=this.renderer.paragraph(this.parseInline(p.tokens));continue}case"text":{for(f=p.tokens?this.parseInline(p.tokens):p.text;o+1{if(n.message+=` -Please report this to https://github.com/markedjs/marked.`,e){const o="

    An error occurred:

    "+lr(n.message+"",!0)+"
    ";if(t)return Promise.resolve(o);if(r){r(null,o);return}return o}if(t)return Promise.reject(n);if(r){r(n);return}throw n}}function RO(e,t){return(r,n,o)=>{typeof n=="function"&&(o=n,n=null);const i={...n};n={...se.defaults,...i};const s=Jae(n.silent,n.async,o);if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(qae(n),n.hooks&&(n.hooks.options=n),o){const a=n.highlight;let l;try{n.hooks&&(r=n.hooks.preprocess(r)),l=e(r,n)}catch(d){return s(d)}const c=function(d){let f;if(!d)try{n.walkTokens&&se.walkTokens(l,n.walkTokens),f=t(l,n),n.hooks&&(f=n.hooks.postprocess(f))}catch(p){d=p}return n.highlight=a,d?s(d):o(null,f)};if(!a||a.length<3||(delete n.highlight,!l.length))return c();let u=0;se.walkTokens(l,function(d){d.type==="code"&&(u++,setTimeout(()=>{a(d.text,d.lang,function(f,p){if(f)return c(f);p!=null&&p!==d.text&&(d.text=p,d.escaped=!0),u--,u===0&&c()})},0))}),u===0&&c();return}if(n.async)return Promise.resolve(n.hooks?n.hooks.preprocess(r):r).then(a=>e(a,n)).then(a=>n.walkTokens?Promise.all(se.walkTokens(a,n.walkTokens)).then(()=>a):a).then(a=>t(a,n)).then(a=>n.hooks?n.hooks.postprocess(a):a).catch(s);try{n.hooks&&(r=n.hooks.preprocess(r));const a=e(r,n);n.walkTokens&&se.walkTokens(a,n.walkTokens);let l=t(a,n);return n.hooks&&(l=n.hooks.postprocess(l)),l}catch(a){return s(a)}}}function se(e,t,r){return RO(ds.lex,fs.parse)(e,t,r)}se.options=se.setOptions=function(e){return se.defaults={...se.defaults,...e},zae(se.defaults),se};se.getDefaults=MO;se.defaults=Ta;se.use=function(...e){const t=se.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(r=>{const n={...r};if(n.async=se.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if(o.renderer){const i=t.renderers[o.name];i?t.renderers[o.name]=function(...s){let a=o.renderer.apply(this,s);return a===!1&&(a=i.apply(this,s)),a}:t.renderers[o.name]=o.renderer}if(o.tokenizer){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[o.level]?t[o.level].unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),n.extensions=t),r.renderer){const o=se.defaults.renderer||new Sx;for(const i in r.renderer){const s=o[i];o[i]=(...a)=>{let l=r.renderer[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}n.renderer=o}if(r.tokenizer){const o=se.defaults.tokenizer||new wx;for(const i in r.tokenizer){const s=o[i];o[i]=(...a)=>{let l=r.tokenizer[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}n.tokenizer=o}if(r.hooks){const o=se.defaults.hooks||new Eh;for(const i in r.hooks){const s=o[i];Eh.passThroughHooks.has(i)?o[i]=a=>{if(se.defaults.async)return Promise.resolve(r.hooks[i].call(o,a)).then(c=>s.call(o,c));const l=r.hooks[i].call(o,a);return s.call(o,l)}:o[i]=(...a)=>{let l=r.hooks[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}n.hooks=o}if(r.walkTokens){const o=se.defaults.walkTokens;n.walkTokens=function(i){let s=[];return s.push(r.walkTokens.call(this,i)),o&&(s=s.concat(o.call(this,i))),s}}se.setOptions(n)})};se.walkTokens=function(e,t){let r=[];for(const n of e)switch(r=r.concat(t.call(se,n)),n.type){case"table":{for(const o of n.header)r=r.concat(se.walkTokens(o.tokens,t));for(const o of n.rows)for(const i of o)r=r.concat(se.walkTokens(i.tokens,t));break}case"list":{r=r.concat(se.walkTokens(n.items,t));break}default:se.defaults.extensions&&se.defaults.extensions.childTokens&&se.defaults.extensions.childTokens[n.type]?se.defaults.extensions.childTokens[n.type].forEach(function(o){r=r.concat(se.walkTokens(n[o],t))}):n.tokens&&(r=r.concat(se.walkTokens(n.tokens,t)))}return r};se.parseInline=RO(ds.lexInline,fs.parseInline);se.Parser=fs;se.parser=fs.parse;se.Renderer=Sx;se.TextRenderer=AO;se.Lexer=ds;se.lexer=ds.lex;se.Tokenizer=wx;se.Slugger=NO;se.Hooks=Eh;se.parse=se;se.options;se.setOptions;se.use;se.walkTokens;se.parseInline;fs.parse;ds.lex;var Xae=Object.defineProperty,Qae=Object.getOwnPropertyDescriptor,Gm=(e,t,r,n)=>{for(var o=n>1?void 0:n?Qae(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Xae(t,r,o),o},Zae=_h(Sd);function ele(e){return rle.turndown(e)}function g1(e){const t=e.parentNode;if(!Je(t))return!1;if(t.nodeName==="THEAD")return!0;if(t.nodeName!=="TABLE"&&!PO(t))return!1;const r=[...e.childNodes];return r.every(n=>n.nodeName==="TH")&&r.some(n=>!!n.textContent)}function Ch(e){return Je(e)&&e.matches("th[data-controller-cell]")}function tle(e){const t=e.parentNode;return!Je(t)||t.nodeName!=="TABLE"&&!PO(t)?!1:[...e.childNodes].every(n=>Ch(n))}function PO(e){var t;if(e.nodeName!=="TBODY")return!1;const r=e.previousSibling;return r?Je(r)&&r.nodeName==="THEAD"&&!((t=r.textContent)!=null&&t.trim()):!0}function p4(e){const t=e.closest("table");if(!t)return!1;const{parentNode:r}=t;return r?!!r.closest("table"):!0}function h4(e,t){var r;const n=[];for(const s of((r=t.parentNode)==null?void 0:r.childNodes)??[])Ch(s)||n.push(s);return`${(n.indexOf(t)===0?"| ":" ")+e.trim()} |`}var rle=new Zae({codeBlockStyle:"fenced",headingStyle:"atx"}).addRule("taskListItems",{filter:e=>e.nodeName==="LI"&&e.hasAttribute("data-task-list-item"),replacement:(e,t)=>`- ${t.hasAttribute("data-checked")?"[x]":"[ ]"} ${e.trimStart()}`}).addRule("tableCell",{filter:["th","td"],replacement:(e,t)=>Ch(t)?"":h4(e,t)}).addRule("tableRow",{filter:"tr",replacement:(e,t)=>{let r="";const n={left:":--",right:"--:",center:":-:"},o=[...t.childNodes].filter(i=>!Ch(i));if(g1(t))for(const i of o){if(!Je(i))continue;let s="---";const a=(i.getAttribute("align")??"").toLowerCase();a&&(s=n[a]||s),r+=h4(s,i)}return` +`}strong(t){return`${t}`}em(t){return`${t}`}codespan(t){return`${t}`}br(){return this.options.xhtml?"
    ":"
    "}del(t){return`${t}`}link(t,r,n){if(t=d4(this.options.sanitize,this.options.baseUrl,t),t===null)return n;let o='
    ",o}image(t,r,n){if(t=d4(this.options.sanitize,this.options.baseUrl,t),t===null)return n;let o=`${n}":">",o}text(t){return t}}class LO{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,r,n){return""+n}image(t,r,n){return""+n}br(){return""}}class IO{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,r){let n=t,o=0;if(this.seen.hasOwnProperty(n)){o=this.seen[t];do o++,n=t+"-"+o;while(this.seen.hasOwnProperty(n))}return r||(this.seen[t]=o,this.seen[n]=0),n}slug(t,r={}){const n=this.serialize(t);return this.getNextSafeSlug(n,r.dryrun)}}class fs{constructor(t){this.options=t||Ta,this.options.renderer=this.options.renderer||new Mx,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new LO,this.slugger=new IO}static parse(t,r){return new fs(r).parse(t)}static parseInline(t,r){return new fs(r).parseInline(t)}parse(t,r=!0){let n="",o,i,s,a,l,c,u,d,f,p,h,m,b,v,g,y,x,k,w;const E=t.length;for(o=0;o0&&g.tokens[0].type==="paragraph"?(g.tokens[0].text=k+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&g.tokens[0].tokens[0].type==="text"&&(g.tokens[0].tokens[0].text=k+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:k}):v+=k),v+=this.parse(g.tokens,b),f+=this.renderer.listitem(v,x,y);n+=this.renderer.list(f,h,m);continue}case"html":{n+=this.renderer.html(p.text);continue}case"paragraph":{n+=this.renderer.paragraph(this.parseInline(p.tokens));continue}case"text":{for(f=p.tokens?this.parseInline(p.tokens):p.text;o+1{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,e){const o="

    An error occurred:

    "+cr(n.message+"",!0)+"
    ";if(t)return Promise.resolve(o);if(r){r(null,o);return}return o}if(t)return Promise.reject(n);if(r){r(n);return}throw n}}function DO(e,t){return(r,n,o)=>{typeof n=="function"&&(o=n,n=null);const i={...n};n={...se.defaults,...i};const s=tle(n.silent,n.async,o);if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(Qae(n),n.hooks&&(n.hooks.options=n),o){const a=n.highlight;let l;try{n.hooks&&(r=n.hooks.preprocess(r)),l=e(r,n)}catch(d){return s(d)}const c=function(d){let f;if(!d)try{n.walkTokens&&se.walkTokens(l,n.walkTokens),f=t(l,n),n.hooks&&(f=n.hooks.postprocess(f))}catch(p){d=p}return n.highlight=a,d?s(d):o(null,f)};if(!a||a.length<3||(delete n.highlight,!l.length))return c();let u=0;se.walkTokens(l,function(d){d.type==="code"&&(u++,setTimeout(()=>{a(d.text,d.lang,function(f,p){if(f)return c(f);p!=null&&p!==d.text&&(d.text=p,d.escaped=!0),u--,u===0&&c()})},0))}),u===0&&c();return}if(n.async)return Promise.resolve(n.hooks?n.hooks.preprocess(r):r).then(a=>e(a,n)).then(a=>n.walkTokens?Promise.all(se.walkTokens(a,n.walkTokens)).then(()=>a):a).then(a=>t(a,n)).then(a=>n.hooks?n.hooks.postprocess(a):a).catch(s);try{n.hooks&&(r=n.hooks.preprocess(r));const a=e(r,n);n.walkTokens&&se.walkTokens(a,n.walkTokens);let l=t(a,n);return n.hooks&&(l=n.hooks.postprocess(l)),l}catch(a){return s(a)}}}function se(e,t,r){return DO(ds.lex,fs.parse)(e,t,r)}se.options=se.setOptions=function(e){return se.defaults={...se.defaults,...e},Hae(se.defaults),se};se.getDefaults=NO;se.defaults=Ta;se.use=function(...e){const t=se.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(r=>{const n={...r};if(n.async=se.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if(o.renderer){const i=t.renderers[o.name];i?t.renderers[o.name]=function(...s){let a=o.renderer.apply(this,s);return a===!1&&(a=i.apply(this,s)),a}:t.renderers[o.name]=o.renderer}if(o.tokenizer){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[o.level]?t[o.level].unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),n.extensions=t),r.renderer){const o=se.defaults.renderer||new Mx;for(const i in r.renderer){const s=o[i];o[i]=(...a)=>{let l=r.renderer[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}n.renderer=o}if(r.tokenizer){const o=se.defaults.tokenizer||new Cx;for(const i in r.tokenizer){const s=o[i];o[i]=(...a)=>{let l=r.tokenizer[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}n.tokenizer=o}if(r.hooks){const o=se.defaults.hooks||new Mh;for(const i in r.hooks){const s=o[i];Mh.passThroughHooks.has(i)?o[i]=a=>{if(se.defaults.async)return Promise.resolve(r.hooks[i].call(o,a)).then(c=>s.call(o,c));const l=r.hooks[i].call(o,a);return s.call(o,l)}:o[i]=(...a)=>{let l=r.hooks[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}n.hooks=o}if(r.walkTokens){const o=se.defaults.walkTokens;n.walkTokens=function(i){let s=[];return s.push(r.walkTokens.call(this,i)),o&&(s=s.concat(o.call(this,i))),s}}se.setOptions(n)})};se.walkTokens=function(e,t){let r=[];for(const n of e)switch(r=r.concat(t.call(se,n)),n.type){case"table":{for(const o of n.header)r=r.concat(se.walkTokens(o.tokens,t));for(const o of n.rows)for(const i of o)r=r.concat(se.walkTokens(i.tokens,t));break}case"list":{r=r.concat(se.walkTokens(n.items,t));break}default:se.defaults.extensions&&se.defaults.extensions.childTokens&&se.defaults.extensions.childTokens[n.type]?se.defaults.extensions.childTokens[n.type].forEach(function(o){r=r.concat(se.walkTokens(n[o],t))}):n.tokens&&(r=r.concat(se.walkTokens(n.tokens,t)))}return r};se.parseInline=DO(ds.lexInline,fs.parseInline);se.Parser=fs;se.parser=fs.parse;se.Renderer=Mx;se.TextRenderer=LO;se.Lexer=ds;se.lexer=ds.lex;se.Tokenizer=Cx;se.Slugger=IO;se.Hooks=Mh;se.parse=se;se.options;se.setOptions;se.use;se.walkTokens;se.parseInline;fs.parse;ds.lex;var rle=Object.defineProperty,nle=Object.getOwnPropertyDescriptor,Xm=(e,t,r,n)=>{for(var o=n>1?void 0:n?nle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&rle(t,r,o),o},ole=Rh(Ed);function ile(e){return ale.turndown(e)}function b1(e){const t=e.parentNode;if(!Je(t))return!1;if(t.nodeName==="THEAD")return!0;if(t.nodeName!=="TABLE"&&!$O(t))return!1;const r=[...e.childNodes];return r.every(n=>n.nodeName==="TH")&&r.some(n=>!!n.textContent)}function Th(e){return Je(e)&&e.matches("th[data-controller-cell]")}function sle(e){const t=e.parentNode;return!Je(t)||t.nodeName!=="TABLE"&&!$O(t)?!1:[...e.childNodes].every(n=>Th(n))}function $O(e){var t;if(e.nodeName!=="TBODY")return!1;const r=e.previousSibling;return r?Je(r)&&r.nodeName==="THEAD"&&!((t=r.textContent)!=null&&t.trim()):!0}function g4(e){const t=e.closest("table");if(!t)return!1;const{parentNode:r}=t;return r?!!r.closest("table"):!0}function v4(e,t){var r;const n=[];for(const s of((r=t.parentNode)==null?void 0:r.childNodes)??[])Th(s)||n.push(s);return`${(n.indexOf(t)===0?"| ":" ")+e.trim()} |`}var ale=new ole({codeBlockStyle:"fenced",headingStyle:"atx"}).addRule("taskListItems",{filter:e=>e.nodeName==="LI"&&e.hasAttribute("data-task-list-item"),replacement:(e,t)=>`- ${t.hasAttribute("data-checked")?"[x]":"[ ]"} ${e.trimStart()}`}).addRule("tableCell",{filter:["th","td"],replacement:(e,t)=>Th(t)?"":v4(e,t)}).addRule("tableRow",{filter:"tr",replacement:(e,t)=>{let r="";const n={left:":--",right:"--:",center:":-:"},o=[...t.childNodes].filter(i=>!Th(i));if(b1(t))for(const i of o){if(!Je(i))continue;let s="---";const a=(i.getAttribute("align")??"").toLowerCase();a&&(s=n[a]||s),r+=v4(s,i)}return` ${e}${r?` -${r}`:""}`}}).addRule("table",{filter:e=>{if(e.nodeName!=="TABLE"||p4(e))return!1;const t=[...e.rows].filter(r=>!tle(r));return g1(t[0])},replacement:e=>(e=e.replace(` +${r}`:""}`}}).addRule("table",{filter:e=>{if(e.nodeName!=="TABLE"||g4(e))return!1;const t=[...e.rows].filter(r=>!sle(r));return b1(t[0])},replacement:e=>(e=e.replace(` `,` `),` ${e} -`)}).addRule("tableSection",{filter:["thead","tbody","tfoot"],replacement:function(e){return e}}).keep(e=>e.nodeName==="TABLE"&&!g1(e.rows[0])).keep(e=>e.nodeName==="TABLE"&&p4(e)).addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return`~${e}~`}}).addRule("fencedCodeBlock",{filter:(e,t)=>!!(t.codeBlockStyle==="fenced"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"),replacement:(e,t,r)=>{var n,o;te(Je(t.firstChild),{code:H.EXTENSION,message:`Invalid node \`${(n=t.firstChild)==null?void 0:n.nodeName}\` encountered for codeblock when converting html to markdown.`});const s=((o=(t.firstChild.getAttribute("class")??"").match(/(?:lang|language)-(\S+)/))==null?void 0:o[1])??t.firstChild.getAttribute("data-code-block-language")??"";return` +`)}).addRule("tableSection",{filter:["thead","tbody","tfoot"],replacement:function(e){return e}}).keep(e=>e.nodeName==="TABLE"&&!b1(e.rows[0])).keep(e=>e.nodeName==="TABLE"&&g4(e)).addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return`~${e}~`}}).addRule("fencedCodeBlock",{filter:(e,t)=>!!(t.codeBlockStyle==="fenced"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"),replacement:(e,t,r)=>{var n,o;te(Je(t.firstChild),{code:H.EXTENSION,message:`Invalid node \`${(n=t.firstChild)==null?void 0:n.nodeName}\` encountered for codeblock when converting html to markdown.`});const s=((o=(t.firstChild.getAttribute("class")??"").match(/(?:lang|language)-(\S+)/))==null?void 0:o[1])??t.firstChild.getAttribute("data-code-block-language")??"";return` ${r.fence}${s} ${t.firstChild.textContent} @@ -4996,6 +4996,20 @@ ${e} ${e} `},listitem(e,t,r){return t?`
  • ${e}
  • `:`
  • ${e}
  • -`}}});function nle(e,t){return se(e,{gfm:!0,smartLists:!0,xhtml:!0,sanitizer:t})}function ole(e){te(typeof document,{code:H.EXTENSION,message:"Attempting to sanitize html within a non-browser environment. Please provide your own `sanitizeHtml` method to the `MarkdownExtension`."});const t=new DOMParser().parseFromString(`${e}`,"text/html");return t.normalize(),zO(t.body),t.body.innerHTML}function zO(e){if(!W6(e)){if(!Je(e)||/^(script|iframe|object|embed|svg)$/i.test(e.tagName))return e==null?void 0:e.remove();for(const{name:t}of e.attributes)/^(class|id|name|href|src|alt|align|valign)$/i.test(t)||e.attributes.removeNamedItem(t);for(const t of e.childNodes)zO(t)}}var Zl=class extends Ve{get name(){return"markdown"}onCreate(){this.store.setStringHandler("markdown",this.markdownToProsemirrorNode.bind(this))}createPlugin(){return{props:{clipboardTextSerializer:this.options.copyAsMarkdown?t=>{const r=document.createElement("div"),n=sn.fromSchema(this.store.schema);return r.append(n.serializeFragment(t.content)),this.options.htmlToMarkdown(r.innerHTML)}:void 0}}}markdownToProsemirrorNode(e){return this.store.stringHandlers.html({...e,content:this.options.markdownToHtml(e.content,this.options.htmlSanitizer)})}insertMarkdown(e,t){return r=>{const{state:n}=r;let o=this.options.markdownToHtml(e,this.options.htmlSanitizer);o=!(t!=null&&t.alwaysWrapInBlock)&&o.startsWith("

    <")&&o.endsWith(`

    -`)?o.slice(3,-5):`
    ${o}
    `;const i=this.store.stringHandlers.html({content:o,schema:n.schema,fragment:!0});return this.store.commands.insertNode.original(i,{...t,replaceEmptyParentBlock:!0})(r)}}getMarkdown(e){return this.options.htmlToMarkdown(this.store.helpers.getHTML(e))}toggleBoldMarkdown(){return e=>!1}};Gm([U()],Zl.prototype,"insertMarkdown",1);Gm([He()],Zl.prototype,"getMarkdown",1);Gm([U()],Zl.prototype,"toggleBoldMarkdown",1);Zl=Gm([me({defaultOptions:{htmlToMarkdown:ele,markdownToHtml:nle,htmlSanitizer:ole,activeNodes:[oe.Code],copyAsMarkdown:!1},staticKeys:["htmlToMarkdown","markdownToHtml","htmlSanitizer"]})],Zl);var ile=Object.defineProperty,sle=Object.getOwnPropertyDescriptor,hr=(e,t,r,n)=>{for(var o=n>1?void 0:n?sle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&ile(t,r,o),o},ale={label:({t:e})=>e(rc.INCREASE_INDENT_LABEL),icon:"indentIncrease"},lle={label:({t:e})=>e(rc.DECREASE_INDENT_LABEL),icon:"indentDecrease"},cle={label:({t:e})=>e(rc.CENTER_ALIGN_LABEL),icon:"alignCenter",active:Ym(({node:e})=>e.attrs.nodeTextAlignment==="center")},ule={label:({t:e})=>e(rc.JUSTIFY_ALIGN_LABEL),icon:"alignJustify",active:Ym(({node:e})=>e.attrs.nodeTextAlignment==="justify")},dle={label:({t:e})=>e(rc.RIGHT_ALIGN_LABEL),icon:"alignRight",active:Ym(({node:e})=>e.attrs.nodeTextAlignment==="right")},fle={label:({t:e})=>e(rc.LEFT_ALIGN_LABEL),icon:"alignLeft",active:Ym(({node:e})=>{const{nodeTextAlignment:t}=e.attrs;return t==="left"||t===""})};function Ym(e){return({excludeNodes:t},r)=>{const{getState:n,nodeTags:o}=r;return LO(n(),o.formattingNode,t).some(e)}}function m4(e,t,r){return r.includes(e.name)?!1:t.includes(e.name)}function LO(e,t,r){const n=[],{$from:o,$to:i}=e.selection,s=o.blockRange(i);if(!s)return[];const{parent:a,start:l,end:c}=s;return a.nodeSize-2===c-l&&m4(a.type,t,r)?[{node:a,pos:l-1}]:(e.doc.nodesBetween(l,c,(d,f)=>{if(!(fc)&&m4(d.type,t,r))return n.push({node:d,pos:f}),!1}),n)}var g4="data-node-indent",v4="data-node-text-align",y4="data-line-height-align";function ple(e,t){const r=Qs(G4(e)),n=Qs(t??"0"),o=e.length??1,i=r/o;return _d({max:o,min:0,value:Math.floor(n/i)})}var hle=/^\d+(?:\.\d+)?$/,mle=/^(\d+(?:\.\d+)?)%$/;function b4(e){if(Jt(e))return e;if(!e)return null;const t=e.trim(),r=t.match(mle);if(r)return Number.parseFloat(r[1])/100;const n=t.match(hle);return n?Number.parseFloat(n[0]):null}var Ft=class extends Ve{get name(){return"nodeFormatting"}createSchemaAttributes(){return[{identifiers:{type:"node",tags:[oe.FormattingNode],excludeNames:this.options.excludeNodes},attributes:{nodeIndent:this.nodeIndent(),nodeTextAlignment:this.nodeTextAlignment(),nodeLineHeight:this.nodeLineHeight(),style:{default:"",parseDOM:()=>"",toDOM:({nodeIndent:e,nodeTextAlignment:t,nodeLineHeight:r,style:n})=>{const o=e?this.options.indents[e]:void 0;return{style:Uv({marginLeft:o,textAlign:t&&t!=="none"?t:void 0,lineHeight:r||void 0},n)}}}}}]}setLineHeight(e){return this.setNodeAttribute(({node:t})=>{if(e!==t.attrs.nodeLineHeight)return{nodeLineHeight:e}})}setTextAlignment(e){return this.setNodeAttribute(({node:t})=>{if(e!==t.attrs.nodeTextAlignment)return{nodeTextAlignment:e}})}setIndent(e){return this.setNodeAttribute(({node:t})=>{const r=t.attrs.nodeIndent??0,n=e==="-1"?r-1:e==="+1"?r+1:e,o=_d({min:0,max:this.options.indents.length-1,value:n});if(o!==r)return{nodeIndent:o}})}centerAlign(){return this.setTextAlignment("center")}justifyAlign(){return this.setTextAlignment("justify")}leftAlign(){return this.setTextAlignment("left")}rightAlign(){return this.setTextAlignment("right")}increaseIndent(){return e=>this.setIndent("+1")(e)}decreaseIndent(){return e=>this.setIndent("-1")(e)}centerAlignShortcut(e){return this.centerAlign()(e)}justifyAlignShortcut(e){return this.justifyAlign()(e)}leftAlignShortcut(e){return this.leftAlign()(e)}rightAlignShortcut(e){return this.rightAlign()(e)}increaseIndentShortcut(e){return this.increaseIndent()(e)}decreaseIndentShortcut(e){return this.decreaseIndent()(e)}nodeIndent(){return{default:null,parseDOM:e=>e.getAttribute(g4)??ple(this.options.indents,e.style.marginLeft),toDOM:e=>{if(!e.nodeIndent)return;const t=`${e.nodeIndent}`;if(this.options.indents[e.nodeIndent])return{[g4]:t}}}}nodeTextAlignment(){return{default:null,parseDOM:e=>e.getAttribute(v4)??e.style.textAlign,toDOM:e=>{const t=e.nodeTextAlignment;if(!(!t||t==="none"))return{[v4]:t}}}}nodeLineHeight(){return{default:null,parseDOM:e=>{const t=e.getAttribute(y4);return b4(t)??b4(e.style.lineHeight)},toDOM:e=>{const t=e.nodeLineHeight;if(t)return{[y4]:t.toString()}}}}setNodeAttribute(e){return t=>{const{tr:r,dispatch:n}=t,o=LO(r,this.store.nodeTags.formattingNode,this.options.excludeNodes);if(Mo(o))return!1;if(!n)return!0;const i=[];for(const s of o){const{node:a,pos:l}=s,c=e(s);c&&i.push([l,{...a.attrs,...c}])}if(Mo(i))return!1;if(!n)return!0;for(const[s,a]of i)r.setNodeMarkup(s,void 0,a);return n(r),!0}}};hr([U()],Ft.prototype,"setLineHeight",1);hr([U()],Ft.prototype,"setTextAlignment",1);hr([U()],Ft.prototype,"setIndent",1);hr([U(cle)],Ft.prototype,"centerAlign",1);hr([U(ule)],Ft.prototype,"justifyAlign",1);hr([U(fle)],Ft.prototype,"leftAlign",1);hr([U(dle)],Ft.prototype,"rightAlign",1);hr([U(ale)],Ft.prototype,"increaseIndent",1);hr([U(lle)],Ft.prototype,"decreaseIndent",1);hr([je({shortcut:D.CenterAlignment,command:"centerAlign"})],Ft.prototype,"centerAlignShortcut",1);hr([je({shortcut:D.JustifyAlignment,command:"justifyAlign"})],Ft.prototype,"justifyAlignShortcut",1);hr([je({shortcut:D.LeftAlignment,command:"leftAlign"})],Ft.prototype,"leftAlignShortcut",1);hr([je({shortcut:D.RightAlignment,command:"rightAlign"})],Ft.prototype,"rightAlignShortcut",1);hr([je({shortcut:D.IncreaseIndent,command:"increaseIndent",priority:Ae.Low})],Ft.prototype,"increaseIndentShortcut",1);hr([je({shortcut:D.DecreaseIndent,command:"decreaseIndent",priority:Ae.Medium})],Ft.prototype,"decreaseIndentShortcut",1);Ft=hr([me({defaultOptions:{indents:["0","20px","40px","60px","80px","100px","120px","140px","160px","180px","200px"],excludeNodes:[]},staticKeys:["indents"]})],Ft);var gle=Object.defineProperty,vle=Object.getOwnPropertyDescriptor,Ex=(e,t,r,n)=>{for(var o=n>1?void 0:n?vle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&gle(t,r,o),o},yle={icon:"strikethrough",label:({t:e})=>e(gk.LABEL),description:({t:e})=>e(gk.DESCRIPTION)},Ed=class extends li{get name(){return"strike"}createTags(){return[oe.FontStyle,oe.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"s",getAttrs:e.parse},{tag:"del",getAttrs:e.parse},{tag:"strike",getAttrs:e.parse},{style:"text-decoration",getAttrs:r=>r==="line-through"?{}:!1},...t.parseDOM??[]],toDOM:r=>["s",e.dom(r),0]}}toggleStrike(){return ns({type:this.type})}shortcut(e){return this.toggleStrike()(e)}createInputRules(){return[Fu({regexp:/~([^~]+)~$/,type:this.type,ignoreWhitespace:!0})]}createPasteRules(){return[{regexp:/~([^~]+)~/g,type:"mark",markType:this.type}]}};Ex([U(yle)],Ed.prototype,"toggleStrike",1);Ex([je({shortcut:D.Strike,command:"toggleStrike"})],Ed.prototype,"shortcut",1);Ed=Ex([me({})],Ed);var x4=new ka("trailingNode");function ble(e){const{ignoredNodes:t=[],nodeName:r="paragraph"}=e??{},n=Ml([...t,r]);let o,i;return new Ro({key:x4,appendTransaction(s,a,l){const{doc:c,tr:u}=l,d=x4.getState(l),f=c.content.size;if(d)return u.insert(f,o.create())},state:{init:(s,{doc:a,schema:l})=>{var c;const u=l.nodes[r];if(!u)throw new Error(`Invalid node being used for trailing node extension: '${r}'`);return o=u,i=Object.values(l.nodes).map(d=>d).filter(d=>!n.includes(d.name)),dr(i,(c=a.lastChild)==null?void 0:c.type)},apply:(s,a)=>{var l;return s.docChanged?dr(i,(l=s.doc.lastChild)==null?void 0:l.type):a}}})}var xle=Object.defineProperty,kle=Object.getOwnPropertyDescriptor,wle=(e,t,r,n)=>{for(var o=n>1?void 0:n?kle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&xle(t,r,o),o},fv=class extends Ve{get name(){return"trailingNode"}onSetOptions(e){const{changes:t}=e;(t.disableTags.changed||t.ignoredNodes.changed||t.nodeName.changed)&&this.store.updateExtensionPlugins(this)}createExternalPlugins(){const{tags:e}=this.store,{disableTags:t,nodeName:r}=this.options,n=t?[...this.options.ignoredNodes]:[...this.options.ignoredNodes,...e.lastNodeCompatible];return[ble({ignoredNodes:n,nodeName:r})]}};fv=wle([me({defaultOptions:{ignoredNodes:[],disableTags:!1,nodeName:"paragraph"}})],fv);var Sle=Object.defineProperty,Ele=Object.getOwnPropertyDescriptor,Cx=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ele(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Sle(t,r,o),o},Cle={icon:"underline",label:({t:e})=>e(vk.LABEL),description:({t:e})=>e(vk.DESCRIPTION)},Cd=class extends li{get name(){return"underline"}createTags(){return[oe.FontStyle,oe.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"u",getAttrs:e.parse},{style:"text-decoration",getAttrs:r=>r==="underline"?{}:!1},...t.parseDOM??[]],toDOM:r=>["u",e.dom(r),0]}}toggleUnderline(e){return ns({type:this.type,selection:e})}shortcut(e){return this.toggleUnderline()(e)}};Cx([U(Cle)],Cd.prototype,"toggleUnderline",1);Cx([je({shortcut:D.Underline,command:"toggleUnderline"})],Cd.prototype,"shortcut",1);Cd=Cx([me({})],Cd);const Mle=({onSelectAIText:e})=>{const t=lc(),r=S.useCallback(async()=>{const n=await e();Tle(n)&&n.length>0&&t.insertText(n),t.run()},[t,e]);return O.jsx(dt,{commandName:"addImage",enabled:!0,onSelect:r,label:"Add AI generated Text",icon:O.jsx("span",{style:{height:"16px",lineHeight:"16px"},children:"AI"})})};function Tle(e){return typeof e=="string"||e instanceof String}const ps=e=>{const{type:t}=e;return t==="Assets"?O.jsxs("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 28 28",children:[O.jsx("path",{d:"M21.875 28h-15.75c-3.413 0-6.125-2.713-6.125-6.125v-15.75c0-3.413 2.712-6.125 6.125-6.125h15.75c3.412 0 6.125 2.712 6.125 6.125v15.75c0 3.412-2.713 6.125-6.125 6.125zM6.125 1.75c-2.45 0-4.375 1.925-4.375 4.375v15.75c0 2.45 1.925 4.375 4.375 4.375h15.75c2.45 0 4.375-1.925 4.375-4.375v-15.75c0-2.45-1.925-4.375-4.375-4.375h-15.75z"}),O.jsx("path",{d:"M21.088 23.537h-11.988c-0.35 0-0.612-0.175-0.787-0.525s-0.088-0.7 0.088-0.962l8.225-9.713c0.175-0.175 0.438-0.35 0.7-0.35s0.525 0.175 0.7 0.35l5.25 7.525c0.088 0.087 0.088 0.175 0.088 0.262 0.438 1.225 0.087 2.012-0.175 2.45-0.613 0.875-1.925 0.963-2.1 0.963zM11.025 21.787h10.15c0.175 0 0.612-0.088 0.7-0.262 0.088-0.088 0.088-0.35 0-0.7l-4.55-6.475-6.3 7.438z"}),O.jsx("path",{d:"M9.1 13.737c-2.1 0-3.85-1.75-3.85-3.85s1.75-3.85 3.85-3.85 3.85 1.75 3.85 3.85-1.663 3.85-3.85 3.85zM9.1 7.788c-1.138 0-2.1 0.875-2.1 2.1s0.962 2.1 2.1 2.1 2.1-0.962 2.1-2.1-0.875-2.1-2.1-2.1z"})]}):t==="Contents"?O.jsxs("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 28 28",children:[O.jsx("path",{d:"M21.875 28h-15.75c-3.413 0-6.125-2.713-6.125-6.125v-15.75c0-3.413 2.712-6.125 6.125-6.125h15.75c3.412 0 6.125 2.712 6.125 6.125v15.75c0 3.412-2.713 6.125-6.125 6.125zM6.125 1.75c-2.45 0-4.375 1.925-4.375 4.375v15.75c0 2.45 1.925 4.375 4.375 4.375h15.75c2.45 0 4.375-1.925 4.375-4.375v-15.75c0-2.45-1.925-4.375-4.375-4.375h-15.75z"}),O.jsx("path",{d:"M13.125 12.25h-5.775c-1.575 0-2.888-1.313-2.888-2.888v-2.013c0-1.575 1.313-2.888 2.888-2.888h5.775c1.575 0 2.887 1.313 2.887 2.888v2.013c0 1.575-1.312 2.888-2.887 2.888zM7.35 6.212c-0.613 0-1.138 0.525-1.138 1.138v2.012c0 0.612 0.525 1.138 1.138 1.138h5.775c0.612 0 1.138-0.525 1.138-1.138v-2.013c0-0.612-0.525-1.138-1.138-1.138h-5.775z"}),O.jsx("path",{d:"M22.662 16.713h-17.325c-0.525 0-0.875-0.35-0.875-0.875s0.35-0.875 0.875-0.875h17.237c0.525 0 0.875 0.35 0.875 0.875s-0.35 0.875-0.787 0.875z"}),O.jsx("path",{d:"M15.138 21.262h-9.8c-0.525 0-0.875-0.35-0.875-0.875s0.35-0.875 0.875-0.875h9.713c0.525 0 0.875 0.35 0.875 0.875s-0.35 0.875-0.787 0.875z"})]}):t==="Check"?O.jsx("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960",width:"1rem",height:"1rem",children:O.jsx("path",{d:"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"})}):t==="Cancel"?O.jsx("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960",width:"1rem",height:"1rem",children:O.jsx("path",{d:"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"})}):t==="Edit"?O.jsx("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1rem",height:"1rem",children:O.jsx("path",{d:"M15.728 9.686l-1.414-1.414L5 17.586V19h1.414l9.314-9.314zm1.414-1.414l1.414-1.414-1.414-1.414-1.414 1.414 1.414 1.414zM7.242 21H3v-4.243L16.435 3.322a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414L7.243 21z"})}):null},Ole=({onSelectAssets:e})=>{const t=lc(),r=S.useCallback(async()=>{const n=await e();for(const o of n){if(o.mimeType.startsWith("image/")){const i={src:o.src,alt:o.alt,title:o.fileName};t.insertImage(i)}else t.insertText(o.fileName,{marks:{link:{href:o.src}}});t.insertText(" ")}t.run()},[t,e]);return O.jsx(dt,{commandName:"addImage",enabled:!0,onSelect:r,label:"Add Asset",icon:O.jsx(ps,{type:"Assets"})})},_le=({onSelectContents:e})=>{const t=lc(),r=S.useCallback(async()=>{const n=await e();for(const o of n)t.insertNode("content-link",{attrs:{contentId:o.id,contentTitle:o.title,schemaName:o.schemaName}}),t.insertText(" ");t.run()},[t,e]);return O.jsx(dt,{commandName:"addContent",enabled:!0,onSelect:r,label:"Add Content",icon:O.jsx(ps,{type:"Contents"})})},Ale=()=>{const e=lc(),t=S.useCallback(async()=>{e.insertNode("plain-html",{attrs:{content:""}}).run()},[e]);return O.jsx(dt,{commandName:"addImage",enabled:!0,onSelect:t,label:"Add HTML",icon:O.jsx("span",{style:{height:"16px",lineHeight:"16px"},children:"HTML"})})};var Nle=Object.defineProperty,Rle=Object.getOwnPropertyDescriptor,Mx=(e,t,r,n)=>{for(var o=n>1?void 0:n?Rle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Nle(t,r,o),o};let Md=class extends li{get name(){return"className"}createTags(){return[oe.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:{...e.defaults(),className:{}},parseDOM:[{tag:"*",getAttrs:r=>{if(!Je(r))return!1;for(const n of r.classList)if(this.options.classNames.indexOf(n)>=0)return{...e.parse(r),className:n};return!1}},...t.parseDOM??[]],toDOM:r=>{const{className:n,...o}=Dd(r.attrs,e),i=e.dom(r),s=i.className,a=Ple(n,s);return["span",{...o,...i,className:a},0]}}}setClassName(e,t){return this.store.commands.applyMark.original(this.type,{className:e},t)}removeClassName(e){return this.store.commands.removeMark.original({type:this.type,selection:e,expand:!0})}};Mx([U({})],Md.prototype,"setClassName",1);Mx([U({})],Md.prototype,"removeClassName",1);Md=Mx([me({defaultOptions:{classNames:[]}})],Md);function Ple(e,t){return e&&t?`${e} ${t}`:e||t}const zle=_h(Sd);function IO(e){const[t,r]=S.useState(e),n=S.useRef(e);return n.current=t,[t,r,n]}const Tx=new zle({hr:"---"});Tx.addRule("link2",{filter:(e,t)=>t.linkStyle==="inlined"&&e.nodeName==="A"&&!!e.getAttribute("href"),replacement:function(e,t){const r=t,n=r.getAttribute("href");if(!n)return"";const o=pv(r.getAttribute("title"));return o?`[${e}](${n} '${o}')`:`[${e}](${n})`}});Tx.addRule("link2",{filter:"img",replacement:(e,t)=>{const r=t,n=r.getAttribute("src")||"";if(!n)return"";const o=pv(r.getAttribute("alt")),i=pv(r.getAttribute("title"));return i?`![${o}](${n} '${i}')`:`![${o}](${n})`}});function pv(e){return(e==null?void 0:e.replace(/(\n+\s*)+/g,` -`))||""}function Lle(e){return Tx.turndown(e)}function Ile(e,t,r){if(!e)return;const n=`${t}/api/assets/${r}/`;if(e.startsWith(n)){const o=e.substring(n.length).split(/[/?]+/);return o.length<1?null:{id:o[0]}}return null}function Dle(e,t,r){if(!e)return;const n=`${t}/api/content/${r}/`;if(e.startsWith(n)){const o=e.substring(n.length).split(/[/?]+/);return o.length<2?null:{schemaName:o[0],id:o[1]}}return null}class $le extends er{constructor(r){super({...r,disableExtraAttributes:!0});gc(this,"ReactComponent",r=>O.jsx(Hle,{...r,...this.options}))}get name(){return"content-link"}createTags(){return[oe.Block]}createNodeSpec(){return{attrs:{contentId:{default:""},contentTitle:{default:""},schemaName:{default:""}},toDOM:r=>["a",{href:`${this.options.baseUrl}/api/content/${this.options.appName}/${r.attrs.schemaName}/${r.attrs.contentId}`},r.attrs.contentTitle],parseDOM:[{tag:"a[href]",getAttrs:r=>{if(!Je(r))return!1;const n=r.getAttribute("href");if(!n)return!1;const o=Dle(n,this.options.baseUrl,this.options.appName);return o?{contentId:o.id,contentTitle:r.innerText,schemaName:o.schemaName}:!1},priority:1e4}]}}}const Hle=({appName:e,baseUrl:t,node:r})=>{const n=r.attrs.contentId,o=r.attrs.contentTitle,i=r.attrs.schemaName,s=S.useMemo(()=>`${t}/app/${e}/content/${i}/${n}`,[e,t,n,i]);return O.jsxs("div",{className:"squidex-editor-content-link",children:[O.jsx("a",{href:s,target:"_blank",className:"squidex-editor-button",children:O.jsx(ps,{type:"Contents"})}),O.jsx("div",{className:"squidex-editor-content-schema",children:i}),O.jsx("div",{className:"squidex-editor-content-name",children:o})]})},Ble=()=>{const e=Zy(is);return O.jsxs("div",{className:"squidex-editor-counter",children:["Words: ",O.jsx("strong",{children:e.getWordCount()}),", Characters: ",O.jsx("strong",{children:e.getCharacterCount()})]})},Fle=({appName:e,baseUrl:t,node:r,onEdit:n,getPosition:o})=>{const i=Ile(r.attrs.src,t,e);return O.jsxs("div",{style:{position:"relative"},className:"squidex-editor-image-view",children:[O.jsx("img",{className:"squidex-editor-image-element",src:r.attrs.src}),O.jsx("button",{style:{position:"absolute"},className:"squidex-editor-button",onClick:()=>n({node:r,getPos:o}),children:O.jsx(ps,{type:"Edit"})}),i&&O.jsx("div",{style:{position:"absolute"},className:"squidex-editor-image-info",children:"Asset"})]})};class Vle extends Ve{get name(){return"html-copy"}createPlugin(){return{props:{clipboardTextSerializer:this.options.copyAsHtml?r=>{const n=document.createElement("div");return n.append(sn.fromSchema(this.store.schema).serializeFragment(r.content)),n.innerHTML}:void 0}}}}const k4=({onEdit:e})=>{const t=lc(),n=In().link(),o=Qy(),i=S.useCallback(()=>{t.removeLink().focus().run()},[t]);return O.jsxs(O.Fragment,{children:[O.jsx(dt,{commandName:"updateLink",enabled:!o.empty,label:"Add or Edit Link",onSelect:e,icon:"link"}),O.jsx(dt,{commandName:"removeLink",enabled:n,label:"Remove Link",onSelect:i,icon:"linkUnlink"})]})},DO=e=>{const t=S.useRef(null);return S.useEffect(()=>{const r=window.requestAnimationFrame(()=>{var n;(n=t.current)==null||n.focus()});return()=>{window.cancelAnimationFrame(r)}},[]),O.jsx("input",{className:"squidex-editor-input",ref:t,...e})},$O=({children:e,title:t})=>O.jsxs("div",{className:"squidex-editor-modal-wrapper",children:[O.jsx("div",{className:"squidex-editor-modal-backdrop"}),O.jsxs("div",{className:"squidex-editor-modal-window",children:[t&&O.jsx("div",{className:"squidex-editor-modal-title",children:t}),O.jsx("div",{className:"squidex-editor-modal-body",children:e})]})]}),jle=({onClose:e})=>{const[t,r,n]=IO(""),o=lc(),i=tj(!0).link(),s=(i==null?void 0:i.href)??"",a=Qy();S.useEffect(()=>{r(s)},[s,a,r]);const l=S.useCallback(()=>{const d=n.current;d?o.updateLink({href:d,auto:!1}):o.removeLink(),o.focus(a.to).run(),e()},[o,n,e,a.to]),c=S.useCallback(d=>{r(d.target.value)},[r]),u=S.useCallback(d=>{const{code:f}=d;f==="Enter"&&l(),f==="Escape"&&e()},[e,l]);return O.jsxs($O,{title:"Change Link",children:[O.jsx(DO,{value:t,onChange:c,onKeyDown:u,placeholder:"Enter Link..."}),O.jsxs(Xn,{children:[O.jsx(dt,{commandName:"submitLink",enabled:!0,onSelect:l,icon:O.jsx(ps,{type:"Check"})}),O.jsx(dt,{commandName:"cancelLink",enabled:!0,onSelect:e,icon:O.jsx(ps,{type:"Cancel"})})]})]})},Ule=({mode:e,onChange:t,state:r,value:n})=>{const{setContent:o}=di(),{getMarkdown:i,getHTML:s}=lm(),a=S.useRef(null),l=S.useRef(!1),c=S.useRef(0),u=pj();return S.useEffect(()=>{c.current+=1},[u]),S.useEffect(()=>{l.current=!!n&&n.length>0,a.current!==n&&(a.current=n,o(n||""),c.current=-1)},[o,n]),S.useEffect(()=>{if(!t)return;function d(){switch(e){case"Markdown":return i(r);default:return s(r)}}if(c.current<=0)return;let f=d().trim();f==="

    "&&(f=""),a.current!==f&&(!l.current&&f.length===0?t(void 0):t(f),a.current=f,l.current=!!f&&f.length>0)},[s,i,e,t,r]),null};class Wle extends er{constructor(){super({disableExtraAttributes:!0});gc(this,"ReactComponent",Kle)}get name(){return"plain-html"}createTags(){return[oe.Block]}createNodeSpec(){return{attrs:{html:{default:""}},toDOM:r=>{const n=r.attrs.html;return["div",{class:"raw-content"},...qle(n)]},parseDOM:[{tag:"div[class~=raw-content]",getAttrs:r=>({content:r.innerHTML}),priority:1e4}]}}}const Kle=({node:e,getPosition:t,view:r})=>{const n=S.useCallback(o=>{const i=r.state.tr.setNodeAttribute(t(),"html",o.target.value);r.dispatch(i)},[t,r]);return O.jsxs("div",{className:"squidex-editor-html",children:[O.jsx("div",{className:"squidex-editor-html-label",children:"Plain HTML"}),O.jsx("textarea",{spellCheck:"false",value:e.attrs.content,onChange:n})]})};function qle(e){if(!e)return[""];const t=document.createElement("div");return t.innerHTML=e,HO(t)}function Gle(e){const t={};for(let r=0;r{const[r,n,o]=IO(""),i=Tr();S.useEffect(()=>{n(t.node.attrs.title||"")},[t,n]);const s=S.useCallback(c=>{n(c.target.value)},[n]),a=S.useCallback(()=>{i.updateNodeAttributes(t.getPos()||0,{...t.node.attrs||{},title:o.current}),e()},[i,t,e,o]),l=S.useCallback(c=>{const{code:u}=c;u==="Enter"&&a(),u==="Escape"&&e()},[e,a]);return O.jsxs($O,{title:"Change Image Title",children:[O.jsx(DO,{value:r,onChange:s,onKeyDown:l,placeholder:"Enter Title..."}),O.jsxs(Xn,{children:[O.jsx(dt,{commandName:"submitLink",enabled:!0,onSelect:a,icon:O.jsx(ps,{type:"Check"})}),O.jsx(dt,{commandName:"cancelLink",enabled:!0,onSelect:e,icon:O.jsx(ps,{type:"Cancel"})})]})]})};const Jle=!1,Xle=e=>{const{appName:t,canSelectAIText:r,canSelectAssets:n,canSelectContents:o,isDisabled:i,mode:s,onChange:a,onSelectAIText:l,onSelectAssets:c,onSelectContents:u,onUpload:d,value:f}=e,p=S.useMemo(()=>{let C=e.baseUrl;return C.endsWith("/")&&(C=C.substring(0,C.length-1)),C},[e.baseUrl]),[h,m]=S.useState(),[b,v]=S.useState(!1),g=S.useCallback(()=>{v(!0)},[]),y=S.useCallback(()=>{v(!1)},[]),x=S.useCallback(()=>{m(null)},[]),k=S.useCallback(()=>[new Zb,new ba({}),new yd({enableSpine:!0}),new Md,new lo({}),new xd,new $le({appName:t,baseUrl:p}),new is({}),new co,new bh,new xh({}),new kh,new Vle({copyAsHtml:s==="Html"}),new kd({uploadHandler:d}),new wd,new us({autoLink:!0}),new us({autoLink:!0}),new ya({enableCollapsible:!0}),new Zl({copyAsMarkdown:s==="Markdown",htmlToMarkdown:Lle}),new Ft,new bd,new Wle,new Ed,new fv,new Cd],[t,p,s,d]),{manager:w,state:E,setState:M}=fj({extensions:k,stringHandler:s==="Markdown"?"markdown":"html",content:f,nodeViewComponents:{image:C=>O.jsx(Fle,{...C,appName:t,baseUrl:p,onEdit:m})}});return O.jsx(kte,{children:O.jsx(yte,{theme:{color:{primary:"#3389ff",active:{primary:"#3389ff"}}},children:O.jsxs(mj,{classNames:i?["squidex-editor-disabled"]:[],manager:w,state:E,onChange:C=>M(C.state),children:[O.jsx("div",{className:"squidex-editor-menu",children:O.jsxs($3,{children:[O.jsx(gte,{}),O.jsx(mte,{showAll:!0}),O.jsxs(Xn,{children:[O.jsx(iv,{}),O.jsx(av,{}),O.jsx(lv,{}),O.jsx(sv,{})]}),O.jsxs(Xn,{children:[O.jsx(tte,{}),O.jsx(nte,{}),O.jsx(Zee,{})]}),O.jsxs(Xn,{children:[O.jsx(rte,{}),O.jsx(ote,{})]}),Jle,O.jsx(Xn,{children:O.jsx(k4,{onEdit:g})}),O.jsxs(Xn,{children:[n&&c&&O.jsx(Ole,{onSelectAssets:c}),o&&u&&O.jsx(_le,{onSelectContents:u}),r&&l&&O.jsx(Mle,{onSelectAIText:l})]}),s==="Html"&&O.jsx(Xn,{children:O.jsx(Ale,{})})]})}),O.jsx(Ule,{mode:s,onChange:a,state:E,value:f}),O.jsx(W0,{}),b?O.jsx(jle,{onClose:y}):h?O.jsx(Yle,{node:h,onClose:x}):O.jsxs(xte,{className:"squidex-editor-floating",children:[O.jsx(iv,{}),O.jsx(av,{}),O.jsx(lv,{}),O.jsx(sv,{}),O.jsx(k4,{onEdit:g})]}),O.jsx(Ble,{})]})})})};var BO,w4=om;BO=w4.createRoot,w4.hydrateRoot;class Qle{constructor(t,r){gc(this,"root");this.element=t,this.props=r,this.root=BO(this.element),this.render()}update(t){this.props={...this.props,...t},this.render()}setValue(t){this.update({value:t})}setIsDisabled(t){this.update({isDisabled:t})}destroy(){this.root.unmount()}render(){this.root.render(O.jsx(Xle,{...this.props}))}}window.SquidexEditorWrapper=Qle; +`}}});function lle(e,t){return se(e,{gfm:!0,smartLists:!0,xhtml:!0,sanitizer:t})}function cle(e){te(typeof document,{code:H.EXTENSION,message:"Attempting to sanitize html within a non-browser environment. Please provide your own `sanitizeHtml` method to the `MarkdownExtension`."});const t=new DOMParser().parseFromString(`${e}`,"text/html");return t.normalize(),HO(t.body),t.body.innerHTML}function HO(e){if(!Q6(e)){if(!Je(e)||/^(script|iframe|object|embed|svg)$/i.test(e.tagName))return e==null?void 0:e.remove();for(const{name:t}of e.attributes)/^(class|id|name|href|src|alt|align|valign)$/i.test(t)||e.attributes.removeNamedItem(t);for(const t of e.childNodes)HO(t)}}var Zl=class extends Ve{get name(){return"markdown"}onCreate(){this.store.setStringHandler("markdown",this.markdownToProsemirrorNode.bind(this))}createPlugin(){return{props:{clipboardTextSerializer:this.options.copyAsMarkdown?t=>{const r=document.createElement("div"),n=an.fromSchema(this.store.schema);return r.append(n.serializeFragment(t.content)),this.options.htmlToMarkdown(r.innerHTML)}:void 0}}}markdownToProsemirrorNode(e){return this.store.stringHandlers.html({...e,content:this.options.markdownToHtml(e.content,this.options.htmlSanitizer)})}insertMarkdown(e,t){return r=>{const{state:n}=r;let o=this.options.markdownToHtml(e,this.options.htmlSanitizer);o=!(t!=null&&t.alwaysWrapInBlock)&&o.startsWith("

    <")&&o.endsWith(`

    +`)?o.slice(3,-5):`
    ${o}
    `;const i=this.store.stringHandlers.html({content:o,schema:n.schema,fragment:!0});return this.store.commands.insertNode.original(i,{...t,replaceEmptyParentBlock:!0})(r)}}getMarkdown(e){return this.options.htmlToMarkdown(this.store.helpers.getHTML(e))}toggleBoldMarkdown(){return e=>!1}};Xm([U()],Zl.prototype,"insertMarkdown",1);Xm([He()],Zl.prototype,"getMarkdown",1);Xm([U()],Zl.prototype,"toggleBoldMarkdown",1);Zl=Xm([pe({defaultOptions:{htmlToMarkdown:ile,markdownToHtml:lle,htmlSanitizer:cle,activeNodes:[oe.Code],copyAsMarkdown:!1},staticKeys:["htmlToMarkdown","markdownToHtml","htmlSanitizer"]})],Zl);var ule=Object.defineProperty,dle=Object.getOwnPropertyDescriptor,mr=(e,t,r,n)=>{for(var o=n>1?void 0:n?dle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&ule(t,r,o),o},fle={label:({t:e})=>e(nc.INCREASE_INDENT_LABEL),icon:"indentIncrease"},ple={label:({t:e})=>e(nc.DECREASE_INDENT_LABEL),icon:"indentDecrease"},hle={label:({t:e})=>e(nc.CENTER_ALIGN_LABEL),icon:"alignCenter",active:Qm(({node:e})=>e.attrs.nodeTextAlignment==="center")},mle={label:({t:e})=>e(nc.JUSTIFY_ALIGN_LABEL),icon:"alignJustify",active:Qm(({node:e})=>e.attrs.nodeTextAlignment==="justify")},gle={label:({t:e})=>e(nc.RIGHT_ALIGN_LABEL),icon:"alignRight",active:Qm(({node:e})=>e.attrs.nodeTextAlignment==="right")},vle={label:({t:e})=>e(nc.LEFT_ALIGN_LABEL),icon:"alignLeft",active:Qm(({node:e})=>{const{nodeTextAlignment:t}=e.attrs;return t==="left"||t===""})};function Qm(e){return({excludeNodes:t},r)=>{const{getState:n,nodeTags:o}=r;return BO(n(),o.formattingNode,t).some(e)}}function y4(e,t,r){return r.includes(e.name)?!1:t.includes(e.name)}function BO(e,t,r){const n=[],{$from:o,$to:i}=e.selection,s=o.blockRange(i);if(!s)return[];const{parent:a,start:l,end:c}=s;return a.nodeSize-2===c-l&&y4(a.type,t,r)?[{node:a,pos:l-1}]:(e.doc.nodesBetween(l,c,(d,f)=>{if(!(fc)&&y4(d.type,t,r))return n.push({node:d,pos:f}),!1}),n)}var b4="data-node-indent",x4="data-node-text-align",k4="data-line-height-align";function yle(e,t){const r=Qs(Q4(e)),n=Qs(t??"0"),o=e.length??1,i=r/o;return Ad({max:o,min:0,value:Math.floor(n/i)})}var ble=/^\d+(?:\.\d+)?$/,xle=/^(\d+(?:\.\d+)?)%$/;function w4(e){if(Jt(e))return e;if(!e)return null;const t=e.trim(),r=t.match(xle);if(r)return Number.parseFloat(r[1])/100;const n=t.match(ble);return n?Number.parseFloat(n[0]):null}var Ft=class extends Ve{get name(){return"nodeFormatting"}createSchemaAttributes(){return[{identifiers:{type:"node",tags:[oe.FormattingNode],excludeNames:this.options.excludeNodes},attributes:{nodeIndent:this.nodeIndent(),nodeTextAlignment:this.nodeTextAlignment(),nodeLineHeight:this.nodeLineHeight(),style:{default:"",parseDOM:()=>"",toDOM:({nodeIndent:e,nodeTextAlignment:t,nodeLineHeight:r,style:n})=>{const o=e?this.options.indents[e]:void 0;return{style:qv({marginLeft:o,textAlign:t&&t!=="none"?t:void 0,lineHeight:r||void 0},n)}}}}}]}setLineHeight(e){return this.setNodeAttribute(({node:t})=>{if(e!==t.attrs.nodeLineHeight)return{nodeLineHeight:e}})}setTextAlignment(e){return this.setNodeAttribute(({node:t})=>{if(e!==t.attrs.nodeTextAlignment)return{nodeTextAlignment:e}})}setIndent(e){return this.setNodeAttribute(({node:t})=>{const r=t.attrs.nodeIndent??0,n=e==="-1"?r-1:e==="+1"?r+1:e,o=Ad({min:0,max:this.options.indents.length-1,value:n});if(o!==r)return{nodeIndent:o}})}centerAlign(){return this.setTextAlignment("center")}justifyAlign(){return this.setTextAlignment("justify")}leftAlign(){return this.setTextAlignment("left")}rightAlign(){return this.setTextAlignment("right")}increaseIndent(){return e=>this.setIndent("+1")(e)}decreaseIndent(){return e=>this.setIndent("-1")(e)}centerAlignShortcut(e){return this.centerAlign()(e)}justifyAlignShortcut(e){return this.justifyAlign()(e)}leftAlignShortcut(e){return this.leftAlign()(e)}rightAlignShortcut(e){return this.rightAlign()(e)}increaseIndentShortcut(e){return this.increaseIndent()(e)}decreaseIndentShortcut(e){return this.decreaseIndent()(e)}nodeIndent(){return{default:null,parseDOM:e=>e.getAttribute(b4)??yle(this.options.indents,e.style.marginLeft),toDOM:e=>{if(!e.nodeIndent)return;const t=`${e.nodeIndent}`;if(this.options.indents[e.nodeIndent])return{[b4]:t}}}}nodeTextAlignment(){return{default:null,parseDOM:e=>e.getAttribute(x4)??e.style.textAlign,toDOM:e=>{const t=e.nodeTextAlignment;if(!(!t||t==="none"))return{[x4]:t}}}}nodeLineHeight(){return{default:null,parseDOM:e=>{const t=e.getAttribute(k4);return w4(t)??w4(e.style.lineHeight)},toDOM:e=>{const t=e.nodeLineHeight;if(t)return{[k4]:t.toString()}}}}setNodeAttribute(e){return t=>{const{tr:r,dispatch:n}=t,o=BO(r,this.store.nodeTags.formattingNode,this.options.excludeNodes);if(Mo(o))return!1;if(!n)return!0;const i=[];for(const s of o){const{node:a,pos:l}=s,c=e(s);c&&i.push([l,{...a.attrs,...c}])}if(Mo(i))return!1;if(!n)return!0;for(const[s,a]of i)r.setNodeMarkup(s,void 0,a);return n(r),!0}}};mr([U()],Ft.prototype,"setLineHeight",1);mr([U()],Ft.prototype,"setTextAlignment",1);mr([U()],Ft.prototype,"setIndent",1);mr([U(hle)],Ft.prototype,"centerAlign",1);mr([U(mle)],Ft.prototype,"justifyAlign",1);mr([U(vle)],Ft.prototype,"leftAlign",1);mr([U(gle)],Ft.prototype,"rightAlign",1);mr([U(fle)],Ft.prototype,"increaseIndent",1);mr([U(ple)],Ft.prototype,"decreaseIndent",1);mr([je({shortcut:D.CenterAlignment,command:"centerAlign"})],Ft.prototype,"centerAlignShortcut",1);mr([je({shortcut:D.JustifyAlignment,command:"justifyAlign"})],Ft.prototype,"justifyAlignShortcut",1);mr([je({shortcut:D.LeftAlignment,command:"leftAlign"})],Ft.prototype,"leftAlignShortcut",1);mr([je({shortcut:D.RightAlignment,command:"rightAlign"})],Ft.prototype,"rightAlignShortcut",1);mr([je({shortcut:D.IncreaseIndent,command:"increaseIndent",priority:Ae.Low})],Ft.prototype,"increaseIndentShortcut",1);mr([je({shortcut:D.DecreaseIndent,command:"decreaseIndent",priority:Ae.Medium})],Ft.prototype,"decreaseIndentShortcut",1);Ft=mr([pe({defaultOptions:{indents:["0","20px","40px","60px","80px","100px","120px","140px","160px","180px","200px"],excludeNodes:[]},staticKeys:["indents"]})],Ft);var kle=Object.defineProperty,wle=Object.getOwnPropertyDescriptor,Tx=(e,t,r,n)=>{for(var o=n>1?void 0:n?wle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&kle(t,r,o),o},Sle={icon:"strikethrough",label:({t:e})=>e(bk.LABEL),description:({t:e})=>e(bk.DESCRIPTION)},Cd=class extends li{get name(){return"strike"}createTags(){return[oe.FontStyle,oe.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"s",getAttrs:e.parse},{tag:"del",getAttrs:e.parse},{tag:"strike",getAttrs:e.parse},{style:"text-decoration",getAttrs:r=>r==="line-through"?{}:!1},...t.parseDOM??[]],toDOM:r=>["s",e.dom(r),0]}}toggleStrike(){return ns({type:this.type})}shortcut(e){return this.toggleStrike()(e)}createInputRules(){return[Vu({regexp:/~([^~]+)~$/,type:this.type,ignoreWhitespace:!0})]}createPasteRules(){return[{regexp:/~([^~]+)~/g,type:"mark",markType:this.type}]}};Tx([U(Sle)],Cd.prototype,"toggleStrike",1);Tx([je({shortcut:D.Strike,command:"toggleStrike"})],Cd.prototype,"shortcut",1);Cd=Tx([pe({})],Cd);var S4=new ka("trailingNode");function Ele(e){const{ignoredNodes:t=[],nodeName:r="paragraph"}=e??{},n=Ml([...t,r]);let o,i;return new Ro({key:S4,appendTransaction(s,a,l){const{doc:c,tr:u}=l,d=S4.getState(l),f=c.content.size;if(d)return u.insert(f,o.create())},state:{init:(s,{doc:a,schema:l})=>{var c;const u=l.nodes[r];if(!u)throw new Error(`Invalid node being used for trailing node extension: '${r}'`);return o=u,i=Object.values(l.nodes).map(d=>d).filter(d=>!n.includes(d.name)),fr(i,(c=a.lastChild)==null?void 0:c.type)},apply:(s,a)=>{var l;return s.docChanged?fr(i,(l=s.doc.lastChild)==null?void 0:l.type):a}}})}var Cle=Object.defineProperty,Mle=Object.getOwnPropertyDescriptor,Tle=(e,t,r,n)=>{for(var o=n>1?void 0:n?Mle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Cle(t,r,o),o},mv=class extends Ve{get name(){return"trailingNode"}onSetOptions(e){const{changes:t}=e;(t.disableTags.changed||t.ignoredNodes.changed||t.nodeName.changed)&&this.store.updateExtensionPlugins(this)}createExternalPlugins(){const{tags:e}=this.store,{disableTags:t,nodeName:r}=this.options,n=t?[...this.options.ignoredNodes]:[...this.options.ignoredNodes,...e.lastNodeCompatible];return[Ele({ignoredNodes:n,nodeName:r})]}};mv=Tle([pe({defaultOptions:{ignoredNodes:[],disableTags:!1,nodeName:"paragraph"}})],mv);var Ole=Object.defineProperty,_le=Object.getOwnPropertyDescriptor,Ox=(e,t,r,n)=>{for(var o=n>1?void 0:n?_le(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ole(t,r,o),o},Ale={icon:"underline",label:({t:e})=>e(xk.LABEL),description:({t:e})=>e(xk.DESCRIPTION)},Md=class extends li{get name(){return"underline"}createTags(){return[oe.FontStyle,oe.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"u",getAttrs:e.parse},{style:"text-decoration",getAttrs:r=>r==="underline"?{}:!1},...t.parseDOM??[]],toDOM:r=>["u",e.dom(r),0]}}toggleUnderline(e){return ns({type:this.type,selection:e})}shortcut(e){return this.toggleUnderline()(e)}};Ox([U(Ale)],Md.prototype,"toggleUnderline",1);Ox([je({shortcut:D.Underline,command:"toggleUnderline"})],Md.prototype,"shortcut",1);Md=Ox([pe({})],Md);const E4={};function Nle(e){if(E4[e])return;const t=document.createElement("style"),r=Rle(e)/1e4,n=Ple({h:Math.abs(r),s:.6,v:.6}),o=zle(n);t.type="text/css",t.textContent=` + .remirror-editor-wrapper .__editor_${e}::before { + content: '[${e}]'; + font-family: monospace; + font-size: 90%; + color: ${o}; + } + + .remirror-editor-wrapper .__editor_${e}::after { + content: '[/${e}]'; + font-family: monospace; + font-size: 90%; + color: ${o}; + } + `,document.head.appendChild(t),E4[e]=!0}function Rle(e){let t=0;if(!e||e.length===0)return t;for(let r=0;r{for(var o=n>1?void 0:n?Ile(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Lle(t,r,o),o};let ec=class extends li{get name(){return"className"}constructor(e){super(e);for(const t of e.classNames||[])Nle(t)}createTags(){return[oe.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:{...e.defaults(),className:{}},parseDOM:[{tag:"*",getAttrs:r=>{if(!Je(r))return!1;for(const n of r.classList)if(this.options.classNames.indexOf(n)>=0)return{...e.parse(r),className:n};return!1}},...t.parseDOM??[]],toDOM:r=>{const{className:n,...o}=$d(r.attrs,e),i=e.dom(r),s=i.className,a=Dle(n,s);return["span",{...o,...i,class:a},0]}}}setClassName(e,t){return this.store.commands.applyMark.original(this.type,{className:e},t)}removeClassName(e){return this.store.commands.removeMark.original({type:this.type,selection:e,expand:!0})}};_x([U({})],ec.prototype,"setClassName",1);_x([U({})],ec.prototype,"removeClassName",1);ec=_x([pe({defaultOptions:{classNames:[]}})],ec);function Dle(e,t){return e&&(e=`__editor_${e}`),e&&t?`${e} ${t}`:e||t}function FO(e){const[t,r]=S.useState(e),n=S.useRef(e);return n.current=t,[t,r,n]}function $le(e,t,r){if(!e)return;const n=`${t}/api/assets/${r}/`;if(e.startsWith(n)){const o=e.substring(n.length).split(/[/?]+/);return o.length<1?null:{id:o[0]}}return null}function Hle(e,t,r){if(!e)return;const n=`${t}/api/content/${r}/`;if(e.startsWith(n)){const o=e.substring(n.length).split(/[/?]+/);return o.length<2?null:{schemaName:o[0],id:o[1]}}return null}const Ble=Rh(Ed),Ax=new Ble({hr:"---"});Ax.addRule("link2",{filter:(e,t)=>t.linkStyle==="inlined"&&e.nodeName==="A"&&!!e.getAttribute("href"),replacement:function(e,t){const r=t,n=r.getAttribute("href");if(!n)return"";const o=gv(r.getAttribute("title"));return o?`[${e}](${n} '${o}')`:`[${e}](${n})`}});Ax.addRule("link2",{filter:"img",replacement:(e,t)=>{const r=t,n=r.getAttribute("src")||"";if(!n)return"";const o=gv(r.getAttribute("alt")),i=gv(r.getAttribute("title"));return i?`![${o}](${n} '${i}')`:`![${o}](${n})`}});function gv(e){return(e==null?void 0:e.replace(/(\n+\s*)+/g,` +`))||""}function Fle(e){return Ax.turndown(e)}const ps=e=>{const{type:t}=e;return t==="Assets"?O.jsxs("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 28 28",children:[O.jsx("path",{d:"M21.875 28h-15.75c-3.413 0-6.125-2.713-6.125-6.125v-15.75c0-3.413 2.712-6.125 6.125-6.125h15.75c3.412 0 6.125 2.712 6.125 6.125v15.75c0 3.412-2.713 6.125-6.125 6.125zM6.125 1.75c-2.45 0-4.375 1.925-4.375 4.375v15.75c0 2.45 1.925 4.375 4.375 4.375h15.75c2.45 0 4.375-1.925 4.375-4.375v-15.75c0-2.45-1.925-4.375-4.375-4.375h-15.75z"}),O.jsx("path",{d:"M21.088 23.537h-11.988c-0.35 0-0.612-0.175-0.787-0.525s-0.088-0.7 0.088-0.962l8.225-9.713c0.175-0.175 0.438-0.35 0.7-0.35s0.525 0.175 0.7 0.35l5.25 7.525c0.088 0.087 0.088 0.175 0.088 0.262 0.438 1.225 0.087 2.012-0.175 2.45-0.613 0.875-1.925 0.963-2.1 0.963zM11.025 21.787h10.15c0.175 0 0.612-0.088 0.7-0.262 0.088-0.088 0.088-0.35 0-0.7l-4.55-6.475-6.3 7.438z"}),O.jsx("path",{d:"M9.1 13.737c-2.1 0-3.85-1.75-3.85-3.85s1.75-3.85 3.85-3.85 3.85 1.75 3.85 3.85-1.663 3.85-3.85 3.85zM9.1 7.788c-1.138 0-2.1 0.875-2.1 2.1s0.962 2.1 2.1 2.1 2.1-0.962 2.1-2.1-0.875-2.1-2.1-2.1z"})]}):t==="Contents"?O.jsxs("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 28 28",children:[O.jsx("path",{d:"M21.875 28h-15.75c-3.413 0-6.125-2.713-6.125-6.125v-15.75c0-3.413 2.712-6.125 6.125-6.125h15.75c3.412 0 6.125 2.712 6.125 6.125v15.75c0 3.412-2.713 6.125-6.125 6.125zM6.125 1.75c-2.45 0-4.375 1.925-4.375 4.375v15.75c0 2.45 1.925 4.375 4.375 4.375h15.75c2.45 0 4.375-1.925 4.375-4.375v-15.75c0-2.45-1.925-4.375-4.375-4.375h-15.75z"}),O.jsx("path",{d:"M13.125 12.25h-5.775c-1.575 0-2.888-1.313-2.888-2.888v-2.013c0-1.575 1.313-2.888 2.888-2.888h5.775c1.575 0 2.887 1.313 2.887 2.888v2.013c0 1.575-1.312 2.888-2.887 2.888zM7.35 6.212c-0.613 0-1.138 0.525-1.138 1.138v2.012c0 0.612 0.525 1.138 1.138 1.138h5.775c0.612 0 1.138-0.525 1.138-1.138v-2.013c0-0.612-0.525-1.138-1.138-1.138h-5.775z"}),O.jsx("path",{d:"M22.662 16.713h-17.325c-0.525 0-0.875-0.35-0.875-0.875s0.35-0.875 0.875-0.875h17.237c0.525 0 0.875 0.35 0.875 0.875s-0.35 0.875-0.787 0.875z"}),O.jsx("path",{d:"M15.138 21.262h-9.8c-0.525 0-0.875-0.35-0.875-0.875s0.35-0.875 0.875-0.875h9.713c0.525 0 0.875 0.35 0.875 0.875s-0.35 0.875-0.787 0.875z"})]}):t==="Check"?O.jsx("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960",width:"1rem",height:"1rem",children:O.jsx("path",{d:"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"})}):t==="Cancel"?O.jsx("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960",width:"1rem",height:"1rem",children:O.jsx("path",{d:"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"})}):t==="Edit"?O.jsx("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1rem",height:"1rem",children:O.jsx("path",{d:"M15.728 9.686l-1.414-1.414L5 17.586V19h1.414l9.314-9.314zm1.414-1.414l1.414-1.414-1.414-1.414-1.414 1.414 1.414 1.414zM7.242 21H3v-4.243L16.435 3.322a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414L7.243 21z"})}):null},Vle=({node:e})=>{const t=Wd(Td),r=e.attrs.contentId,n=e.attrs.contentTitle,o=e.attrs.schemaName,i=S.useMemo(()=>`${t.options.baseUrl}/app/${t.options.appName}/content/${o}/${r}`,[r,t.options.appName,t.options.baseUrl,o]);return O.jsxs("div",{className:"squidex-editor-content-link",children:[O.jsx("a",{href:i,target:"_blank",className:"squidex-editor-button",children:O.jsx(ps,{type:"Contents"})}),O.jsx("div",{className:"squidex-editor-content-schema",children:o}),O.jsx("div",{className:"squidex-editor-content-name",children:n})]})};var jle=Object.defineProperty,Ule=Object.getOwnPropertyDescriptor,VO=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ule(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&jle(t,r,o),o};let Td=class extends er{constructor(t){super({...t,disableExtraAttributes:!0});vc(this,"ReactComponent",Vle)}get name(){return"contentLink"}createTags(){return[oe.Block]}createNodeSpec(){return{attrs:{contentId:{default:""},contentTitle:{default:""},schemaName:{default:""}},toDOM:t=>["a",{href:`${this.options.baseUrl}/api/content/${this.options.appName}/${t.attrs.schemaName}/${t.attrs.contentId}`},t.attrs.contentTitle],parseDOM:[{tag:"a[href]",getAttrs:t=>{if(!Je(t))return!1;const r=t.getAttribute("href");if(!r)return!1;const n=Hle(r,this.options.baseUrl,this.options.appName);return n?{contentId:n.id,contentTitle:t.innerText,schemaName:n.schemaName}:!1},priority:1e4}]}}addContent(t,r){return this.store.commands.insertNode.original(this.type,{attrs:{contentId:t,contentTitle:t.title,schemaName:t.schemaName},selection:r})}};VO([U({})],Td.prototype,"addContent",1);Td=VO([pe({defaultOptions:{baseUrl:"url",appName:"app"}})],Td);const Wle=({appName:e,baseUrl:t,node:r,onEdit:n,getPosition:o})=>{const i=$le(r.attrs.src,t,e);return O.jsxs("div",{style:{position:"relative"},className:"squidex-editor-image-view",children:[O.jsx("img",{className:"squidex-editor-image-element",src:r.attrs.src}),O.jsx("button",{style:{position:"absolute"},className:"squidex-editor-button",onClick:()=>n({node:r,getPos:o}),children:O.jsx(ps,{type:"Edit"})}),i&&O.jsx("div",{style:{position:"absolute"},className:"squidex-editor-image-info",children:"Asset"})]})};class Kle extends Ve{get name(){return"htmlCopy"}createPlugin(){return{props:{clipboardTextSerializer:this.options.copyAsHtml?r=>{const n=document.createElement("div");return n.append(an.fromSchema(this.store.schema).serializeFragment(r.content)),n.innerHTML}:void 0}}}}const qle=({mode:e,onChange:t,state:r,value:n})=>{const{setContent:o}=di(),{getMarkdown:i,getHTML:s}=dm(),a=S.useRef(null),l=S.useRef(!1),c=S.useRef(0),u=xj();return S.useEffect(()=>{c.current+=1},[u]),S.useEffect(()=>{l.current=!!n&&n.length>0,a.current!==n&&(a.current=n,o(n||""),c.current=-1)},[o,n]),S.useEffect(()=>{if(!t)return;function d(){switch(e){case"Markdown":return i(r);default:return s(r)}}if(c.current<=0)return;let f=d().trim();f==="

    "&&(f=""),a.current!==f&&(!l.current&&f.length===0?t(void 0):t(f),a.current=f,l.current=!!f&&f.length>0)},[s,i,e,t,r]),null},Gle=({node:e,getPosition:t,view:r})=>{const n=S.useCallback(o=>{const i=r.state.tr.setNodeAttribute(t(),"html",o.target.value);r.dispatch(i)},[t,r]);return O.jsxs("div",{className:"squidex-editor-html",children:[O.jsx("div",{className:"squidex-editor-html-label",children:"Plain HTML"}),O.jsx("textarea",{spellCheck:"false",value:e.attrs.content,onChange:n})]})};var Yle=Object.defineProperty,Jle=Object.getOwnPropertyDescriptor,jO=(e,t,r,n)=>{for(var o=n>1?void 0:n?Jle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Yle(t,r,o),o};let Oh=class extends er{constructor(){super({disableExtraAttributes:!0});vc(this,"ReactComponent",Gle)}get name(){return"plainHtml"}createTags(){return[oe.Block]}createNodeSpec(){return{attrs:{html:{default:""}},toDOM:t=>{const r=t.attrs.html;return["div",{class:"__editor_html"},...Xle(r)]},parseDOM:[{tag:"div[class~=__editor_html]",getAttrs:t=>({content:t.innerHTML}),priority:1e4}]}}insertPlainHtml(t){return this.store.commands.insertNode.original(this.type,{attrs:{content:""},selection:t})}};jO([U({})],Oh.prototype,"insertPlainHtml",1);Oh=jO([pe({defaultOptions:{}})],Oh);function Xle(e){if(!e)return[""];const t=document.createElement("div");return t.innerHTML=e,UO(t)}function Qle(e){const t={};for(let r=0;r{const t=cc(),r=S.useCallback(async()=>{const n=await e();ece(n)&&n.length>0&&t.insertText(n),t.run()},[t,e]);return O.jsx(dt,{commandName:"addImage",enabled:!0,onSelect:r,label:"Add AI generated Text",icon:O.jsx("span",{style:{height:"16px",lineHeight:"16px"},children:"AI"})})};function ece(e){return typeof e=="string"||e instanceof String}const WO=e=>{const t=S.useRef(null);return S.useEffect(()=>{const r=window.requestAnimationFrame(()=>{var n;(n=t.current)==null||n.focus()});return()=>{window.cancelAnimationFrame(r)}},[]),O.jsx("input",{className:"squidex-editor-input",ref:t,...e})},KO=({children:e,title:t})=>O.jsxs("div",{className:"squidex-editor-modal-wrapper",children:[O.jsx("div",{className:"squidex-editor-modal-backdrop"}),O.jsxs("div",{className:"squidex-editor-modal-window",children:[t&&O.jsx("div",{className:"squidex-editor-modal-title",children:t}),O.jsx("div",{className:"squidex-editor-modal-body",children:e})]})]}),tce=({onSelectAssets:e})=>{const t=cc(),r=S.useCallback(async()=>{const n=await e();for(const o of n){if(o.mimeType.startsWith("image/")){const i={src:o.src,alt:o.alt,title:o.fileName};t.insertImage(i)}else t.insertAsset(o);t.insertText(" ")}t.run()},[t,e]);return O.jsx(dt,{commandName:"addImage",enabled:!0,onSelect:r,label:"Add Asset",icon:O.jsx(ps,{type:"Assets"})})},rce=({onSelectContents:e})=>{const t=cc(),r=S.useCallback(async()=>{const n=await e();for(const o of n)t.insertNode("content-link",{attrs:{contentId:o.id,contentTitle:o.title,schemaName:o.schemaName}}),t.insertText(" ");t.run()},[t,e]);return O.jsx(dt,{commandName:"addContent",enabled:!0,onSelect:r,label:"Add Content",icon:O.jsx(ps,{type:"Contents"})})},nce=()=>{const e=cc(),t=S.useCallback(async()=>{e.insertPlainHtml().run()},[e]);return O.jsx(dt,{commandName:"addImage",enabled:!0,onSelect:t,label:"Add HTML",icon:O.jsx("span",{style:{height:"16px",lineHeight:"16px"},children:"HTML"})})},oce=({attrs:e,...t})=>{const{setClassName:r}=tr(),n=S.useCallback(()=>{r(e.className)},[e.className,r]),o=qr().className(e);return O.jsx(Ib,{...t,commandName:"toggleClass",active:o,attrs:e,enabled:!0,onSelect:n,label:(e==null?void 0:e.className)||"No Class"})},ice=({...e})=>{const{removeClassName:t}=tr(),r=S.useCallback(()=>{t()},[t]),n=!qr().className();return O.jsx(Ib,{...e,commandName:"removeClass",active:n,attrs:{},enabled:!0,onSelect:r,label:"No Class"})},sce=()=>{const e=Wd(ec);return!e.options.classNames||e.options.classNames.length===0?null:O.jsxs(F3,{"aria-label":"Class Name",icon:O.jsx("span",{style:{height:"14px",lineHeight:"14px",fontSize:"14px"},children:"Class"}),children:[O.jsx(ice,{}),e.options.classNames.map(t=>O.jsx(oce,{attrs:{className:t}},t))]})},ace=()=>{const e=Wd(is);return O.jsxs("div",{className:"squidex-editor-counter",children:["Words: ",O.jsx("strong",{children:e.getWordCount()}),", Characters: ",O.jsx("strong",{children:e.getCharacterCount()})]})},C4=({onEdit:e})=>{const t=cc(),n=qr().link(),o=tb(),i=S.useCallback(()=>{t.removeLink().focus().run()},[t]);return O.jsxs(O.Fragment,{children:[O.jsx(dt,{commandName:"updateLink",enabled:!o.empty,label:"Add or Edit Link",onSelect:e,icon:"link"}),O.jsx(dt,{commandName:"removeLink",enabled:n,label:"Remove Link",onSelect:i,icon:"linkUnlink"})]})},lce=({onClose:e})=>{const[t,r,n]=FO(""),o=cc(),i=lj(!0).link(),s=(i==null?void 0:i.href)??"",a=tb();S.useEffect(()=>{r(s)},[s,a,r]);const l=S.useCallback(()=>{const d=n.current;d?o.updateLink({href:d,auto:!1}):o.removeLink(),o.focus(a.to).run(),e()},[o,n,e,a.to]),c=S.useCallback(d=>{r(d.target.value)},[r]),u=S.useCallback(d=>{const{code:f}=d;f==="Enter"&&l(),f==="Escape"&&e()},[e,l]);return O.jsxs(KO,{title:"Change Link",children:[O.jsx(WO,{value:t,onChange:c,onKeyDown:u,placeholder:"Enter Link..."}),O.jsxs(En,{children:[O.jsx(dt,{commandName:"submitLink",enabled:!0,onSelect:l,icon:O.jsx(ps,{type:"Check"})}),O.jsx(dt,{commandName:"cancelLink",enabled:!0,onSelect:e,icon:O.jsx(ps,{type:"Cancel"})})]})]})},cce=({onClose:e,node:t})=>{const[r,n,o]=FO(""),i=tr();S.useEffect(()=>{n(t.node.attrs.title||"")},[t,n]);const s=S.useCallback(c=>{n(c.target.value)},[n]),a=S.useCallback(()=>{i.updateNodeAttributes(t.getPos()||0,{...t.node.attrs||{},title:o.current}),e()},[i,t,e,o]),l=S.useCallback(c=>{const{code:u}=c;u==="Enter"&&a(),u==="Escape"&&e()},[e,a]);return O.jsxs(KO,{title:"Change Image Title",children:[O.jsx(WO,{value:r,onChange:s,onKeyDown:l,placeholder:"Enter Title..."}),O.jsxs(En,{children:[O.jsx(dt,{commandName:"submitLink",enabled:!0,onSelect:a,icon:O.jsx(ps,{type:"Check"})}),O.jsx(dt,{commandName:"cancelLink",enabled:!0,onSelect:e,icon:O.jsx(ps,{type:"Cancel"})})]})]})};const uce=e=>{const{appName:t,classNames:r,canSelectAIText:n,canSelectAssets:o,canSelectContents:i,isDisabled:s,mode:a,onChange:l,onSelectAIText:c,onSelectAssets:u,onSelectContents:d,onUpload:f,value:p}=e,h=S.useMemo(()=>{let M=e.baseUrl;return M.endsWith("/")&&(M=M.substring(0,M.length-1)),M},[e.baseUrl]),[m,b]=S.useState(),[v,g]=S.useState(!1),y=S.useCallback(()=>{g(!0)},[]),x=S.useCallback(()=>{g(!1)},[]),k=S.useCallback(()=>{b(null)},[]),w=S.useCallback(()=>[new rx,new ba({}),new bd({enableSpine:!0}),new ec({classNames:r}),new lo({}),new kd,new Td({appName:t,baseUrl:h}),new is({}),new co,new kh,new wh({}),new Sh,new Kle({copyAsHtml:a==="Html"}),new wd({uploadHandler:f}),new Sd,new us({autoLink:!0}),new us({autoLink:!0}),new ya({enableCollapsible:!0}),new Zl({copyAsMarkdown:a==="Markdown",htmlToMarkdown:Fle}),new Ft,new xd,new Oh,new Cd,new mv,new Md],[t,h,r,a,f]),{manager:E,state:T,setState:C}=bj({stringHandler:a==="Markdown"?"markdown":"html",content:p,nodeViewComponents:{image:M=>O.jsx(Wle,{...M,appName:t,baseUrl:h,onEdit:b})},extensions:w});return O.jsx(Mte,{children:O.jsx(Ste,{theme:{color:{primary:"#3389ff",active:{primary:"#3389ff"}}},children:O.jsxs(wj,{classNames:s?["squidex-editor-disabled"]:[],manager:E,state:T,onChange:M=>C(M.state),children:[O.jsx("div",{className:"squidex-editor-menu",children:O.jsxs(j3,{children:[O.jsx(kte,{}),O.jsx(xte,{showAll:!0}),O.jsxs(En,{children:[O.jsx(lv,{}),O.jsx(uv,{}),O.jsx(dv,{}),O.jsx(cv,{})]}),O.jsxs(En,{children:[O.jsx(ate,{}),O.jsx(cte,{}),O.jsx(ite,{})]}),O.jsxs(En,{children:[O.jsx(lte,{}),O.jsx(ute,{})]}),a==="Html"&&r&&r.length>0&&O.jsx(En,{children:O.jsx(sce,{})}),O.jsx(En,{children:O.jsx(C4,{onEdit:y})}),O.jsxs(En,{children:[o&&u&&O.jsx(tce,{onSelectAssets:u}),i&&d&&O.jsx(rce,{onSelectContents:d}),n&&c&&O.jsx(Zle,{onSelectAIText:c})]}),a==="Html"&&O.jsx(En,{children:O.jsx(nce,{})})]})}),O.jsx(qle,{mode:a,onChange:l,state:T,value:p}),O.jsx(G0,{}),v?O.jsx(lce,{onClose:x}):m?O.jsx(cce,{node:m,onClose:k}):O.jsxs(Cte,{className:"squidex-editor-floating",children:[O.jsx(lv,{}),O.jsx(uv,{}),O.jsx(dv,{}),O.jsx(cv,{}),O.jsx(C4,{onEdit:y})]}),O.jsx(ace,{})]})})})};var qO,M4=am;qO=M4.createRoot,M4.hydrateRoot;class dce{constructor(t,r){vc(this,"root");this.element=t,this.props=r,this.root=qO(this.element),this.render()}update(t){this.props={...this.props,...t},this.render()}setValue(t){this.update({value:t})}setIsDisabled(t){this.update({isDisabled:t})}destroy(){this.root.unmount()}render(){this.root.render(O.jsx(uce,{...this.props}))}}window.SquidexEditorWrapper=dce; diff --git a/frontend/src/app/declarations.d.ts b/frontend/src/app/declarations.d.ts index 352cc72ff..a518b4802 100644 --- a/frontend/src/app/declarations.d.ts +++ b/frontend/src/app/declarations.d.ts @@ -74,6 +74,9 @@ interface EditorProps { // The name to the app. appName: string; + // The class names. + classNames?: ReadonlyArray; + // Called when the value has been changed. onChange?: OnChange; diff --git a/frontend/src/app/features/content/shared/forms/field-editor.component.html b/frontend/src/app/features/content/shared/forms/field-editor.component.html index 14384464c..82d9e6b04 100644 --- a/frontend/src/app/features/content/shared/forms/field-editor.component.html +++ b/frontend/src/app/features/content/shared/forms/field-editor.component.html @@ -195,6 +195,7 @@
    +
    + + +
    + + + + {{ 'schemas.fieldTypes.string.classNamesHint' | sqxTranslate }} + +
    +
    +
    diff --git a/frontend/src/app/features/schemas/pages/schema/fields/types/string-ui.component.ts b/frontend/src/app/features/schemas/pages/schema/fields/types/string-ui.component.ts index 12d59f424..24f89b1e4 100644 --- a/frontend/src/app/features/schemas/pages/schema/fields/types/string-ui.component.ts +++ b/frontend/src/app/features/schemas/pages/schema/fields/types/string-ui.component.ts @@ -30,6 +30,7 @@ export class StringUIComponent { public properties!: StringFieldPropertiesDto; public hideAllowedValues?: Observable; + public hideClassNames?: Observable; public hideInlineEditable?: Observable; public hideSchemaIds?: Observable; @@ -47,6 +48,9 @@ export class StringUIComponent { this.hideAllowedValues = valueProjection$(editor, x => !(x && (x === 'Radio' || x === 'Dropdown'))); + this.hideClassNames = + valueProjection$(editor, x => !(x && (x === 'RichText'))); + this.hideInlineEditable = valueProjection$(editor, x => !(x && (x === 'Input' || x === 'Dropdown' || x === 'Slug'))); diff --git a/frontend/src/app/shared/components/forms/rich-editor.component.ts b/frontend/src/app/shared/components/forms/rich-editor.component.ts index eebb6b52d..89fc8172a 100644 --- a/frontend/src/app/shared/components/forms/rich-editor.component.ts +++ b/frontend/src/app/shared/components/forms/rich-editor.component.ts @@ -48,6 +48,9 @@ export class RichEditorComponent extends StatefulControlComponent<{}, string> im @Input() public folderId = ''; + @Input({ required: true }) + public classNames?: ReadonlyArray; + @Input({ required: true }) public mode: SquidexEditorMode = 'Html'; @@ -128,6 +131,7 @@ export class RichEditorComponent extends StatefulControlComponent<{}, string> im canSelectAIText: this.hasChatBot, canSelectAssets: true, canSelectContents: !!this.schemaIds, + classNames: this.classNames, mode: this.mode, }); }); @@ -212,7 +216,7 @@ export class RichEditorComponent extends StatefulControlComponent<{}, string> im } private buildAsset(asset: AssetDto): Asset { - return { type: asset.mimeType, src: asset.fullUrl(this.apiUrl), fileName: asset.fileName }; + return { ...asset, src: asset.fullUrl(this.apiUrl) }; } private buildContent(content: ContentDto): Content { diff --git a/frontend/src/app/shared/services/schemas.types.ts b/frontend/src/app/shared/services/schemas.types.ts index 6f0c348ff..6b62c7aa2 100644 --- a/frontend/src/app/shared/services/schemas.types.ts +++ b/frontend/src/app/shared/services/schemas.types.ts @@ -433,6 +433,7 @@ export class StringFieldPropertiesDto extends FieldPropertiesDto { public readonly fieldType = 'String'; public readonly allowedValues?: ReadonlyArray; + public readonly classNames?: ReadonlyArray; public readonly contentType?: StringContentType; public readonly createEnum: boolean = false; public readonly defaultValue?: string; diff --git a/frontend/src/app/shared/state/schemas.forms.ts b/frontend/src/app/shared/state/schemas.forms.ts index 83227059a..f7c46e3d2 100644 --- a/frontend/src/app/shared/state/schemas.forms.ts +++ b/frontend/src/app/shared/state/schemas.forms.ts @@ -333,6 +333,7 @@ export class EditFieldFormVisitor implements FieldPropertiesVisitor { public visitString() { this.config['allowedValues'] = new UntypedFormControl(undefined); + this.config['classNames'] = new UntypedFormControl(undefined); this.config['contentType'] = new UntypedFormControl(undefined); this.config['createEnum'] = new UntypedFormControl(undefined); this.config['defaultValue'] = new UntypedFormControl(undefined); From 8f149db852d984489e6ca1a07af988dac917ab56 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sun, 29 Oct 2023 08:05:24 +0100 Subject: [PATCH 35/35] Update editor. --- .../Config/IdentityServerServices.cs | 14 -- .../Squidex/wwwroot/editor/squidex-editor.css | 2 +- .../Squidex/wwwroot/editor/squidex-editor.js | 224 +++++++++--------- frontend/src/app/declarations.d.ts | 7 + .../forms/rich-editor.component.html | 6 +- .../components/forms/rich-editor.component.ts | 30 ++- 6 files changed, 152 insertions(+), 131 deletions(-) diff --git a/backend/src/Squidex/Areas/IdentityServer/Config/IdentityServerServices.cs b/backend/src/Squidex/Areas/IdentityServer/Config/IdentityServerServices.cs index 79d356fa3..c25e7736e 100644 --- a/backend/src/Squidex/Areas/IdentityServer/Config/IdentityServerServices.cs +++ b/backend/src/Squidex/Areas/IdentityServer/Config/IdentityServerServices.cs @@ -81,12 +81,6 @@ public static class IdentityServerServices }) .AddServer(builder => { - builder.AddEventHandler(builder => - { - builder.UseSingletonHandler() - .SetOrder(int.MinValue); - }); - builder.AddEventHandler(builder => { builder.UseSingletonHandler() @@ -177,11 +171,3 @@ public static class IdentityServerServices endpointUris.Add(uri); } } - -public sealed class TestHandler : IOpenIddictServerHandler -{ - public ValueTask HandleAsync(ValidateTokenRequestContext context) - { - return default; - } -} diff --git a/backend/src/Squidex/wwwroot/editor/squidex-editor.css b/backend/src/Squidex/wwwroot/editor/squidex-editor.css index f1bd3efb4..5a4692ecd 100644 --- a/backend/src/Squidex/wwwroot/editor/squidex-editor.css +++ b/backend/src/Squidex/wwwroot/editor/squidex-editor.css @@ -1 +1 @@ -.remirror-theme{width:100%}.remirror-theme{position:relative}.remirror-theme *{box-sizing:border-box}.remirror-editor{min-height:300px!important;max-height:500px}.MuiStack-root>.MuiBox-root{margin-right:5px}.MuiBox-root>.MuiButtonBase-root{border-color:#dedfe3!important;border-radius:0}.MuiBox-root>.MuiButtonBase-root{border-left-width:0!important}.MuiBox-root>.MuiBox-root:first-child>.MuiButtonBase-root{border-left-width:1px!important}.MuiStack-root>.MuiBox-root>.MuiButtonBase-root:first-child{border-left-width:1px!important}.MuiButtonBase-root.Mui-selected:hover{background-color:#3284f4!important}.remirror-editor-wrapper{padding-top:0!important}.custom-icon path{fill:#0000008a}.remirror-theme div.ProseMirror{border:1px solid #dedfe3!important;border-radius:0!important;box-shadow:none!important}.MuiTooltip-popper>div{background-color:#1a2129;border-radius:0;font-size:85%;font-weight:400;padding:.5rem}.MuiMenu-paper{transform:none!important}.squidex-editor-disabled{pointer-events:none}.squidex-editor-menu{border:1px solid #dedfe3;border-bottom:0;padding:5px}.squidex-editor-counter{border:1px solid #dedfe3;border-top:0;font-size:85%;font-weight:400;opacity:.8;padding:4px 10px 4px 4px;text-align:right}.squidex-editor-image-view{border:1px solid #dedfe3;border-radius:0;display:inline-block;margin-top:15px;margin-bottom:15px;overflow:hidden}.squidex-editor-image-view .squidex-editor-button{bottom:10px;left:10px;position:absolute}.squidex-editor-image-element{display:block;max-width:400px;max-height:400px}.squidex-editor-image-info{left:10px;top:10px;position:absolute;background-color:#3284f4;color:#fff;font-size:85%;font-weight:400;padding:2px 6px}.squidex-editor-content-link{align-items:center;border-radius:2px;border:1px solid #dedfe3;padding:10px;display:flex;flex-direction:row;flex-wrap:nowrap;margin-top:10px;margin-bottom:10px}.squidex-editor-content-schema{display:block;overflow-x:hidden;overflow-y:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;min-width:0;width:auto;border-right:1px solid #c2c4cc;color:#8b8f9d;flex-shrink:0;padding-left:10px;padding-right:10px;width:200px}.squidex-editor-content-name{display:block;overflow-x:hidden;overflow-y:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;min-width:0;width:auto;padding-left:10px;padding-right:0}.squidex-editor-html{margin-bottom:10px;margin-top:10px;position:relative}.squidex-editor-html-label{left:6px;top:0;position:absolute;color:#8b8f9d;font-size:85%;font-weight:400}.squidex-editor-html textarea{font-family:monospace;padding:30px 20px 20px}.squidex-editor-button{background-color:#fff;border-radius:0;border:1px solid #dedfe3;bottom:10px;font-size:85%;font-weight:400;line-height:1;padding:6px 12px}.squidex-editor-button:hover{background-color:#f5f5f5}.squidex-editor-input{border:1px solid #dedfe3;border-radius:0;box-sizing:border-box;height:30px;margin-left:0;margin-right:5px;outline:none;padding:6px 12px}.squidex-editor-input:active{border-color:#3284f4}.squidex-editor-floating{border:1px solid #dedfe3}.squidex-editor-floating .MuiBox-root{margin-right:0!important}.squidex-editor-floating .MuiButtonBase-root{height:30px}.squidex-editor-modal-wrapper,.squidex-editor-modal-backdrop{bottom:0;left:0;right:0;top:0;position:absolute}.squidex-editor-modal-backdrop{background-color:#00000003}.squidex-editor-modal-window{left:50%;top:50%;background-color:#fff;border:0;border-radius:.25rem;box-sizing:border-box;box-shadow:0 3px 16px #0003;margin-top:-50px;margin-left:-150px;position:absolute;width:350px}.squidex-editor-modal-body{display:flex;flex-direction:row;flex-grow:1;padding-top:0!important}.squidex-editor-modal-body,.squidex-editor-modal-title{padding:15px}.squidex-editor-modal-title{font-size:85%}.squidex-editor-modal-window input{flex-grow:1}.b:before{content:"";font-family:monospace;font-size:90%}.b:after{content:"";font-family:monospace;font-size:90%} +.remirror-theme{width:100%}.remirror-theme{position:relative}.remirror-theme *{box-sizing:border-box}.remirror-editor{min-height:300px!important;max-height:500px}.MuiStack-root>.MuiBox-root{margin-right:5px}.MuiBox-root>.MuiButtonBase-root{border-color:#dedfe3!important;border-radius:0}.MuiBox-root>.MuiButtonBase-root{border-left-width:0!important}.MuiBox-root>.MuiBox-root:first-child>.MuiButtonBase-root{border-left-width:1px!important}.MuiStack-root>.MuiBox-root>.MuiButtonBase-root:first-child{border-left-width:1px!important}.MuiButtonBase-root.Mui-selected:hover{background-color:#3284f4!important}.remirror-editor-wrapper{padding-top:0!important}.custom-icon path{fill:#0000008a}.remirror-theme div.ProseMirror{border:1px solid #dedfe3!important;border-radius:0!important;box-shadow:none!important}.MuiTooltip-popper>div{background-color:#1a2129;border-radius:0;font-size:85%;font-weight:400;padding:.5rem}.MuiMenu-paper{transform:none!important}.squidex-editor-disabled{pointer-events:none}.squidex-editor-menu{border:1px solid #dedfe3;border-bottom:0;padding:5px}.squidex-editor-counter{border:1px solid #dedfe3;border-top:0;font-size:85%;font-weight:400;opacity:.8;padding:4px 10px 4px 4px;text-align:right}.squidex-editor-image-view{border:1px solid #dedfe3;border-radius:0;display:inline-block;margin-top:15px;margin-bottom:15px;overflow:hidden}.squidex-editor-image-buttons{bottom:10px;left:10px;position:absolute}.squidex-editor-image-element{display:block;max-width:400px;max-height:400px}.squidex-editor-image-info{left:10px;top:10px;position:absolute;background-color:#3284f4;color:#fff;font-size:85%;font-weight:400;padding:2px 6px}.squidex-editor-content-link{align-items:center;border-radius:2px;border:1px solid #dedfe3;padding:10px;display:flex;flex-direction:row;flex-wrap:nowrap;margin-top:10px;margin-bottom:10px}.squidex-editor-content-schema{display:block;overflow-x:hidden;overflow-y:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;min-width:0;width:auto;border-right:1px solid #c2c4cc;color:#8b8f9d;flex-shrink:0;padding-left:10px;padding-right:10px;width:200px}.squidex-editor-content-name{display:block;overflow-x:hidden;overflow-y:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;min-width:0;width:auto;padding-left:10px;padding-right:0}.squidex-editor-html{margin-bottom:10px;margin-top:10px;position:relative}.squidex-editor-html-label{left:6px;top:0;position:absolute;color:#8b8f9d;font-size:85%;font-weight:400}.squidex-editor-html textarea{font-family:monospace;padding:30px 20px 20px}.squidex-editor-button{align-items:center;background-color:#fff;border-radius:0;border:1px solid #dedfe3;bottom:10px;display:inline-flex;font-size:85%;font-weight:400;margin-right:5px;padding:6px 12px}.squidex-editor-button:hover{background-color:#f5f5f5}.squidex-editor-input{border:1px solid #dedfe3;border-radius:0;box-sizing:border-box;height:30px;margin-left:0;margin-right:5px;outline:none;padding:6px 12px}.squidex-editor-input:active{border-color:#3284f4}.squidex-editor-floating{border:1px solid #dedfe3}.squidex-editor-floating .MuiBox-root{margin-right:0!important}.squidex-editor-floating .MuiButtonBase-root{height:30px}.squidex-editor-modal-wrapper,.squidex-editor-modal-backdrop{bottom:0;left:0;right:0;top:0;position:absolute}.squidex-editor-modal-backdrop{background-color:#00000003}.squidex-editor-modal-window{left:50%;top:50%;background-color:#fff;border:0;border-radius:.25rem;box-sizing:border-box;box-shadow:0 3px 16px #0003;margin-top:-50px;margin-left:-150px;position:absolute;width:350px}.squidex-editor-modal-body{display:flex;flex-direction:row;flex-grow:1;padding-top:0!important}.squidex-editor-modal-body,.squidex-editor-modal-title{padding:15px}.squidex-editor-modal-title{font-size:85%}.squidex-editor-modal-window input{flex-grow:1}.b:before{content:"";font-family:monospace;font-size:90%}.b:after{content:"";font-family:monospace;font-size:90%} diff --git a/backend/src/Squidex/wwwroot/editor/squidex-editor.js b/backend/src/Squidex/wwwroot/editor/squidex-editor.js index aec7c0e7e..18ba2ea5d 100644 --- a/backend/src/Squidex/wwwroot/editor/squidex-editor.js +++ b/backend/src/Squidex/wwwroot/editor/squidex-editor.js @@ -1,4 +1,4 @@ -var s_=Object.defineProperty;var a_=(e,t,r)=>t in e?s_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var vc=(e,t,r)=>(a_(e,typeof t!="symbol"?t+"":t,r),r);function l_(e,t){for(var r=0;rn[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(o){if(o.ep)return;o.ep=!0;const i=r(o);fetch(o.href,i)}})();var Pu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var T4={exports:{}},_h={},O4={exports:{}},we={};/** +var a_=Object.defineProperty;var l_=(e,t,r)=>t in e?a_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var vc=(e,t,r)=>(l_(e,typeof t!="symbol"?t+"":t,r),r);function c_(e,t){for(var r=0;rn[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(o){if(o.ep)return;o.ep=!0;const i=r(o);fetch(o.href,i)}})();var Pu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var O4={exports:{}},Ah={},_4={exports:{}},we={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var s_=Object.defineProperty;var a_=(e,t,r)=>t in e?s_(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Od=Symbol.for("react.element"),c_=Symbol.for("react.portal"),u_=Symbol.for("react.fragment"),d_=Symbol.for("react.strict_mode"),f_=Symbol.for("react.profiler"),p_=Symbol.for("react.provider"),h_=Symbol.for("react.context"),m_=Symbol.for("react.forward_ref"),g_=Symbol.for("react.suspense"),v_=Symbol.for("react.memo"),y_=Symbol.for("react.lazy"),Ux=Symbol.iterator;function b_(e){return e===null||typeof e!="object"?null:(e=Ux&&e[Ux]||e["@@iterator"],typeof e=="function"?e:null)}var _4={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A4=Object.assign,N4={};function tc(e,t,r){this.props=e,this.context=t,this.refs=N4,this.updater=r||_4}tc.prototype.isReactComponent={};tc.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};tc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function R4(){}R4.prototype=tc.prototype;function vv(e,t,r){this.props=e,this.context=t,this.refs=N4,this.updater=r||_4}var yv=vv.prototype=new R4;yv.constructor=vv;A4(yv,tc.prototype);yv.isPureReactComponent=!0;var Wx=Array.isArray,P4=Object.prototype.hasOwnProperty,bv={current:null},z4={key:!0,ref:!0,__self:!0,__source:!0};function L4(e,t,r){var n,o={},i=null,s=null;if(t!=null)for(n in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)P4.call(t,n)&&!z4.hasOwnProperty(n)&&(o[n]=t[n]);var a=arguments.length-2;if(a===1)o.children=r;else if(1t in e?s_(e,t,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var E_=S,C_=Symbol.for("react.element"),M_=Symbol.for("react.fragment"),T_=Object.prototype.hasOwnProperty,O_=E_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,__={key:!0,ref:!0,__self:!0,__source:!0};function I4(e,t,r){var n,o={},i=null,s=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(n in t)T_.call(t,n)&&!__.hasOwnProperty(n)&&(o[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)o[n]===void 0&&(o[n]=t[n]);return{$$typeof:C_,type:e,key:i,ref:s,props:o,_owner:O_.current}}_h.Fragment=M_;_h.jsx=I4;_h.jsxs=I4;T4.exports=_h;var O=T4.exports,k1={exports:{}};(function(e,t){var r=typeof Reflect<"u"?Reflect.construct:void 0,n=Object.defineProperty,o=Error.captureStackTrace;o===void 0&&(o=function(c){var u=new Error;n(c,"stack",{configurable:!0,get:function(){var f=u.stack;return n(this,"stack",{configurable:!0,value:f,writable:!0}),f},set:function(f){n(c,"stack",{configurable:!0,value:f,writable:!0})}})});function i(l){l!==void 0&&n(this,"message",{configurable:!0,value:l,writable:!0});var c=this.constructor.name;c!==void 0&&c!==this.name&&n(this,"name",{configurable:!0,value:c,writable:!0}),o(this,this.constructor)}i.prototype=Object.create(Error.prototype,{constructor:{configurable:!0,value:i,writable:!0}});var s=function(){function l(u,d){return n(u,"name",{configurable:!0,value:d})}try{var c=function(){};if(l(c,"foo"),c.name==="foo")return l}catch{}}();function a(l,c){if(c==null||c===Error)c=i;else if(typeof c!="function")throw new TypeError("super_ should be a function");var u;if(typeof l=="string")u=l,l=r!==void 0?function(){return r(c,arguments,this.constructor)}:function(){c.apply(this,arguments)},s!==void 0&&(s(l,u),u=void 0);else if(typeof l!="function")throw new TypeError("constructor should be either a string or a function");l.super_=l.super=c;var d={constructor:{configurable:!0,value:l,writable:!0}};return u!==void 0&&(d.name={configurable:!0,value:u,writable:!0}),l.prototype=Object.create(c.prototype,d),l}t=e.exports=a,t.BaseError=i})(k1,k1.exports);var D4=k1.exports,qx="ProseMirror-selectednode",kv="",zi="\0",Gx="__state_override__",A_={LastNodeCompatible:"lastNodeCompatible",FormattingMark:"formattingMark",FormattingNode:"formattingNode",NodeCursor:"nodeCursor",FontStyle:"fontStyle",Link:"link",Color:"color",Alignment:"alignment",Indentation:"indentation",Behavior:"behavior",Code:"code",InlineNode:"inline",ListContainerNode:"listContainer",ListItemNode:"listItemNode",Block:"block",BlockNode:"block",TextBlock:"textBlock",ExcludeInputRules:"excludeFromInputRules",PreventExits:"preventsExits",Media:"media"},oe=A_,ti=Symbol.for("__remirror__"),$t=(e=>(e.PlainExtension="RemirrorPlainExtension",e.NodeExtension="RemirrorNodeExtension",e.MarkExtension="RemirrorMarkExtension",e.PlainExtensionConstructor="RemirrorPlainExtensionConstructor",e.NodeExtensionConstructor="RemirrorNodeExtensionConstructor",e.MarkExtensionConstructor="RemirrorMarkExtensionConstructor",e.Manager="RemirrorManager",e.Preset="RemirrorPreset",e.PresetConstructor="RemirrorPresetConstructor",e))($t||{}),Ae=(e=>(e[e.Critical=1e6]="Critical",e[e.Highest=1e5]="Highest",e[e.High=1e4]="High",e[e.Medium=1e3]="Medium",e[e.Default=100]="Default",e[e.Low=10]="Low",e[e.Lowest=0]="Lowest",e))(Ae||{}),Nr=(e=>(e[e.None=0]="None",e[e.Create=1]="Create",e[e.EditorView=2]="EditorView",e[e.Runtime=3]="Runtime",e[e.Destroy=4]="Destroy",e))(Nr||{}),D=(e=>(e.Undo="_|undo|_",e.Redo="_|redo|_",e.Bold="_|bold|_",e.Italic="_|italic|_",e.Underline="_|underline|_",e.Strike="_|strike|_",e.Code="_|code|_",e.Paragraph="_|paragraph|_",e.H1="_|h1|_",e.H2="_|h2|_",e.H3="_|h3|_",e.H4="_|h4|_",e.H5="_|h5|_",e.H6="_|h6|_",e.TaskList="_|task|_",e.BulletList="_|bullet|_",e.OrderedList="_|number|_",e.Quote="_|quote|_",e.Divider="_|divider|_",e.Codeblock="_|codeblock|_",e.ClearFormatting="_|clear|_",e.Superscript="_|sup|_",e.Subscript="_|sub|_",e.LeftAlignment="_|left-align|_",e.CenterAlignment="_|center-align|_",e.RightAlignment="_|right-align|_",e.JustifyAlignment="_|justify-align|_",e.InsertLink="_|link|_",e.Find="_|find|_",e.FindBackwards="_|find-backwards|_",e.FindReplace="_|find-replace|_",e.AddFootnote="_|footnote|_",e.AddComment="_|comment|_",e.ContextMenu="_|context-menu|_",e.IncreaseFontSize="_|inc-font-size|_",e.DecreaseFontSize="_|dec-font-size|_",e.IncreaseIndent="_|indent|_",e.DecreaseIndent="_|dedent|_",e.Shortcuts="_|shortcuts|_",e.Copy="_|copy|_",e.Cut="_|cut|_",e.Paste="_|paste|_",e.PastePlain="_|paste-plain|_",e.SelectAll="_|select-all|_",e.Format="_|format|_",e))(D||{}),H=(e=>(e.PROD="RMR0000",e.UNKNOWN="RMR0001",e.INVALID_COMMAND_ARGUMENTS="RMR0002",e.CUSTOM="RMR0003",e.CORE_HELPERS="RMR0004",e.MUTATION="RMR0005",e.INTERNAL="RMR0006",e.MISSING_REQUIRED_EXTENSION="RMR0007",e.MANAGER_PHASE_ERROR="RMR0008",e.INVALID_GET_EXTENSION="RMR0010",e.INVALID_MANAGER_ARGUMENTS="RMR0011",e.SCHEMA="RMR0012",e.HELPERS_CALLED_IN_OUTER_SCOPE="RMR0013",e.INVALID_MANAGER_EXTENSION="RMR0014",e.DUPLICATE_COMMAND_NAMES="RMR0016",e.DUPLICATE_HELPER_NAMES="RMR0017",e.NON_CHAINABLE_COMMAND="RMR0018",e.INVALID_EXTENSION="RMR0019",e.INVALID_CONTENT="RMR0021",e.INVALID_NAME="RMR0050",e.EXTENSION="RMR0100",e.EXTENSION_SPEC="RMR0101",e.EXTENSION_EXTRA_ATTRIBUTES="RMR0102",e.INVALID_SET_EXTENSION_OPTIONS="RMR0103",e.REACT_PROVIDER_CONTEXT="RMR0200",e.REACT_GET_ROOT_PROPS="RMR0201",e.REACT_EDITOR_VIEW="RMR0202",e.REACT_CONTROLLED="RMR0203",e.REACT_NODE_VIEW="RMR0204",e.REACT_GET_CONTEXT="RMR0205",e.REACT_COMPONENTS="RMR0206",e.REACT_HOOKS="RMR0207",e.I18N_CONTEXT="RMR0300",e))(H||{}),N_=function(t){return R_(t)&&!P_(t)};function R_(e){return!!e&&typeof e=="object"}function P_(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||I_(e)}var z_=typeof Symbol=="function"&&Symbol.for,L_=z_?Symbol.for("react.element"):60103;function I_(e){return e.$$typeof===L_}function D_(e){return Array.isArray(e)?[]:{}}function zu(e,t){return t.clone!==!1&&t.isMergeableObject(e)?El(D_(e),e,t):e}function $_(e,t,r){return e.concat(t).map(function(n){return zu(n,r)})}function H_(e,t){if(!t.customMerge)return El;var r=t.customMerge(e);return typeof r=="function"?r:El}function B_(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function Yx(e){return Object.keys(e).concat(B_(e))}function $4(e,t){try{return t in e}catch{return!1}}function F_(e,t){return $4(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function V_(e,t,r){var n={};return r.isMergeableObject(e)&&Yx(e).forEach(function(o){n[o]=zu(e[o],r)}),Yx(t).forEach(function(o){F_(e,o)||($4(e,o)&&r.isMergeableObject(t[o])?n[o]=H_(o,r)(e[o],t[o],r):n[o]=zu(t[o],r))}),n}function El(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||$_,r.isMergeableObject=r.isMergeableObject||N_,r.cloneUnlessOtherwiseSpecified=zu;var n=Array.isArray(t),o=Array.isArray(e),i=n===o;return i?n?r.arrayMerge(e,t,r):V_(e,t,r):zu(t,r)}El.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,o){return El(n,o,r)},{})};var j_=El,U_=j_;const W_=Dn(U_);var K_=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r};const q_=Dn(K_);/*! + */var C_=S,M_=Symbol.for("react.element"),T_=Symbol.for("react.fragment"),O_=Object.prototype.hasOwnProperty,__=C_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,A_={key:!0,ref:!0,__self:!0,__source:!0};function D4(e,t,r){var n,o={},i=null,s=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(n in t)O_.call(t,n)&&!A_.hasOwnProperty(n)&&(o[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)o[n]===void 0&&(o[n]=t[n]);return{$$typeof:M_,type:e,key:i,ref:s,props:o,_owner:__.current}}Ah.Fragment=T_;Ah.jsx=D4;Ah.jsxs=D4;O4.exports=Ah;var O=O4.exports,w1={exports:{}};(function(e,t){var r=typeof Reflect<"u"?Reflect.construct:void 0,n=Object.defineProperty,o=Error.captureStackTrace;o===void 0&&(o=function(c){var u=new Error;n(c,"stack",{configurable:!0,get:function(){var f=u.stack;return n(this,"stack",{configurable:!0,value:f,writable:!0}),f},set:function(f){n(c,"stack",{configurable:!0,value:f,writable:!0})}})});function i(l){l!==void 0&&n(this,"message",{configurable:!0,value:l,writable:!0});var c=this.constructor.name;c!==void 0&&c!==this.name&&n(this,"name",{configurable:!0,value:c,writable:!0}),o(this,this.constructor)}i.prototype=Object.create(Error.prototype,{constructor:{configurable:!0,value:i,writable:!0}});var s=function(){function l(u,d){return n(u,"name",{configurable:!0,value:d})}try{var c=function(){};if(l(c,"foo"),c.name==="foo")return l}catch{}}();function a(l,c){if(c==null||c===Error)c=i;else if(typeof c!="function")throw new TypeError("super_ should be a function");var u;if(typeof l=="string")u=l,l=r!==void 0?function(){return r(c,arguments,this.constructor)}:function(){c.apply(this,arguments)},s!==void 0&&(s(l,u),u=void 0);else if(typeof l!="function")throw new TypeError("constructor should be either a string or a function");l.super_=l.super=c;var d={constructor:{configurable:!0,value:l,writable:!0}};return u!==void 0&&(d.name={configurable:!0,value:u,writable:!0}),l.prototype=Object.create(c.prototype,d),l}t=e.exports=a,t.BaseError=i})(w1,w1.exports);var $4=w1.exports,Gx="ProseMirror-selectednode",wv="",Li="\0",Yx="__state_override__",N_={LastNodeCompatible:"lastNodeCompatible",FormattingMark:"formattingMark",FormattingNode:"formattingNode",NodeCursor:"nodeCursor",FontStyle:"fontStyle",Link:"link",Color:"color",Alignment:"alignment",Indentation:"indentation",Behavior:"behavior",Code:"code",InlineNode:"inline",ListContainerNode:"listContainer",ListItemNode:"listItemNode",Block:"block",BlockNode:"block",TextBlock:"textBlock",ExcludeInputRules:"excludeFromInputRules",PreventExits:"preventsExits",Media:"media"},te=N_,ti=Symbol.for("__remirror__"),$t=(e=>(e.PlainExtension="RemirrorPlainExtension",e.NodeExtension="RemirrorNodeExtension",e.MarkExtension="RemirrorMarkExtension",e.PlainExtensionConstructor="RemirrorPlainExtensionConstructor",e.NodeExtensionConstructor="RemirrorNodeExtensionConstructor",e.MarkExtensionConstructor="RemirrorMarkExtensionConstructor",e.Manager="RemirrorManager",e.Preset="RemirrorPreset",e.PresetConstructor="RemirrorPresetConstructor",e))($t||{}),Ae=(e=>(e[e.Critical=1e6]="Critical",e[e.Highest=1e5]="Highest",e[e.High=1e4]="High",e[e.Medium=1e3]="Medium",e[e.Default=100]="Default",e[e.Low=10]="Low",e[e.Lowest=0]="Lowest",e))(Ae||{}),Nr=(e=>(e[e.None=0]="None",e[e.Create=1]="Create",e[e.EditorView=2]="EditorView",e[e.Runtime=3]="Runtime",e[e.Destroy=4]="Destroy",e))(Nr||{}),$=(e=>(e.Undo="_|undo|_",e.Redo="_|redo|_",e.Bold="_|bold|_",e.Italic="_|italic|_",e.Underline="_|underline|_",e.Strike="_|strike|_",e.Code="_|code|_",e.Paragraph="_|paragraph|_",e.H1="_|h1|_",e.H2="_|h2|_",e.H3="_|h3|_",e.H4="_|h4|_",e.H5="_|h5|_",e.H6="_|h6|_",e.TaskList="_|task|_",e.BulletList="_|bullet|_",e.OrderedList="_|number|_",e.Quote="_|quote|_",e.Divider="_|divider|_",e.Codeblock="_|codeblock|_",e.ClearFormatting="_|clear|_",e.Superscript="_|sup|_",e.Subscript="_|sub|_",e.LeftAlignment="_|left-align|_",e.CenterAlignment="_|center-align|_",e.RightAlignment="_|right-align|_",e.JustifyAlignment="_|justify-align|_",e.InsertLink="_|link|_",e.Find="_|find|_",e.FindBackwards="_|find-backwards|_",e.FindReplace="_|find-replace|_",e.AddFootnote="_|footnote|_",e.AddComment="_|comment|_",e.ContextMenu="_|context-menu|_",e.IncreaseFontSize="_|inc-font-size|_",e.DecreaseFontSize="_|dec-font-size|_",e.IncreaseIndent="_|indent|_",e.DecreaseIndent="_|dedent|_",e.Shortcuts="_|shortcuts|_",e.Copy="_|copy|_",e.Cut="_|cut|_",e.Paste="_|paste|_",e.PastePlain="_|paste-plain|_",e.SelectAll="_|select-all|_",e.Format="_|format|_",e))($||{}),B=(e=>(e.PROD="RMR0000",e.UNKNOWN="RMR0001",e.INVALID_COMMAND_ARGUMENTS="RMR0002",e.CUSTOM="RMR0003",e.CORE_HELPERS="RMR0004",e.MUTATION="RMR0005",e.INTERNAL="RMR0006",e.MISSING_REQUIRED_EXTENSION="RMR0007",e.MANAGER_PHASE_ERROR="RMR0008",e.INVALID_GET_EXTENSION="RMR0010",e.INVALID_MANAGER_ARGUMENTS="RMR0011",e.SCHEMA="RMR0012",e.HELPERS_CALLED_IN_OUTER_SCOPE="RMR0013",e.INVALID_MANAGER_EXTENSION="RMR0014",e.DUPLICATE_COMMAND_NAMES="RMR0016",e.DUPLICATE_HELPER_NAMES="RMR0017",e.NON_CHAINABLE_COMMAND="RMR0018",e.INVALID_EXTENSION="RMR0019",e.INVALID_CONTENT="RMR0021",e.INVALID_NAME="RMR0050",e.EXTENSION="RMR0100",e.EXTENSION_SPEC="RMR0101",e.EXTENSION_EXTRA_ATTRIBUTES="RMR0102",e.INVALID_SET_EXTENSION_OPTIONS="RMR0103",e.REACT_PROVIDER_CONTEXT="RMR0200",e.REACT_GET_ROOT_PROPS="RMR0201",e.REACT_EDITOR_VIEW="RMR0202",e.REACT_CONTROLLED="RMR0203",e.REACT_NODE_VIEW="RMR0204",e.REACT_GET_CONTEXT="RMR0205",e.REACT_COMPONENTS="RMR0206",e.REACT_HOOKS="RMR0207",e.I18N_CONTEXT="RMR0300",e))(B||{}),R_=function(t){return P_(t)&&!z_(t)};function P_(e){return!!e&&typeof e=="object"}function z_(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||D_(e)}var L_=typeof Symbol=="function"&&Symbol.for,I_=L_?Symbol.for("react.element"):60103;function D_(e){return e.$$typeof===I_}function $_(e){return Array.isArray(e)?[]:{}}function zu(e,t){return t.clone!==!1&&t.isMergeableObject(e)?El($_(e),e,t):e}function H_(e,t,r){return e.concat(t).map(function(n){return zu(n,r)})}function B_(e,t){if(!t.customMerge)return El;var r=t.customMerge(e);return typeof r=="function"?r:El}function F_(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function Jx(e){return Object.keys(e).concat(F_(e))}function H4(e,t){try{return t in e}catch{return!1}}function V_(e,t){return H4(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function j_(e,t,r){var n={};return r.isMergeableObject(e)&&Jx(e).forEach(function(o){n[o]=zu(e[o],r)}),Jx(t).forEach(function(o){V_(e,o)||(H4(e,o)&&r.isMergeableObject(t[o])?n[o]=B_(o,r)(e[o],t[o],r):n[o]=zu(t[o],r))}),n}function El(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||H_,r.isMergeableObject=r.isMergeableObject||R_,r.cloneUnlessOtherwiseSpecified=zu;var n=Array.isArray(t),o=Array.isArray(e),i=n===o;return i?n?r.arrayMerge(e,t,r):j_(e,t,r):zu(t,r)}El.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,o){return El(n,o,r)},{})};var U_=El,W_=U_;const K_=Dn(W_);var q_=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r};const G_=Dn(q_);/*! * isobject * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. - */var H4=function(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===!1};/*! + */var B4=function(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===!1};/*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. - */var G_=H4;function Jx(e){return G_(e)===!0&&Object.prototype.toString.call(e)==="[object Object]"}var Y_=function(t){var r,n;return!(Jx(t)===!1||(r=t.constructor,typeof r!="function")||(n=r.prototype,Jx(n)===!1)||n.hasOwnProperty("isPrototypeOf")===!1)};/*! + */var Y_=B4;function Xx(e){return Y_(e)===!0&&Object.prototype.toString.call(e)==="[object Object]"}var J_=function(t){var r,n;return!(Xx(t)===!1||(r=t.constructor,typeof r!="function")||(n=r.prototype,Xx(n)===!1)||n.hasOwnProperty("isPrototypeOf")===!1)};/*! * is-extendable * * Copyright (c) 2015-2017, Jon Schlinkert. * Released under the MIT License. - */var J_=Y_,X_=function(t){return J_(t)||typeof t=="function"||Array.isArray(t)};/*! + */var X_=J_,Q_=function(t){return X_(t)||typeof t=="function"||Array.isArray(t)};/*! * object.omit * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. - */var Q_=X_,Z_=function(t,r,n){if(!Q_(t))return{};typeof r=="function"&&(n=r,r=[]),typeof r=="string"&&(r=[r]);for(var o=typeof n=="function",i=Object.keys(t),s={},a=0;a * * Copyright (c) 2014-2015 Jon Schlinkert, contributors. * Licensed under the MIT License - */var eA=H4,tA=function(t,r){if(!eA(t)&&typeof t!="function")return{};var n={};if(typeof r=="string")return r in t&&(n[r]=t[r]),n;for(var o=r.length,i=-1;++i{let d=l.prefixes[u]||"",f=c;return r===!1&&(n&&(f=f.normalize("NFD").replace(new RegExp(`[^a-zA-ZØßø0-9${n.join("")}]`,"g"),"")),n||(f=f.normalize("NFD").replace(/[^a-zA-ZØßø0-9]/g,""),d="")),n&&(d=d.replace(new RegExp(`[^${n.join("")}]`,"g"),"")),u===0?d+f:!d&&!f?"":s&&!d&&o.match(/\s/)?" "+f:(d||o)+f}).filter(Boolean)}function oA(e){const t=e.matchAll(B4).next().value,r=t?t.index:0;return e.slice(0,r+1).toUpperCase()+e.slice(r+1).toLowerCase()}function V4(e,t){return F4(e,t).reduce((r,n)=>r+oA(n),"")}function Xx(e,t){return F4(e,{...t,prefix:"-"}).join("").toLowerCase()}function S1(e,t,r,n){var o,i=!1,s=0;function a(){o&&clearTimeout(o)}function l(){a(),i=!0}typeof t!="boolean"&&(n=r,r=t,t=void 0);function c(){for(var u=arguments.length,d=new Array(u),f=0;fe?m():t!==!0&&(o=setTimeout(n?b:m,n===void 0?e-h:e))}return c.cancel=l,c}function j4(e,t,r){return r===void 0?S1(e,t,!1):S1(e,r,t!==!1)}function it(e,t,r){const n=e[t];return U4(!Nh(n),r),n}function U4(e,t){if(!e)throw new iA(t)}var iA=class extends D4.BaseError{constructor(){super(...arguments),this.name="AssertionError"}};function At(e){return Object.entries(e)}function Lu(e){return Object.keys(e)}function Ah(e){return Object.values(e)}function fr(e,t,r){return e.includes(t,r)}function ee(e){return Object.assign(Object.create(null),e)}function W4(e){return Object.prototype.toString.call(e)}function K4(e){return W4(e).slice(8,-1)}function _d(e,t){return r=>typeof r!==e?!1:t?t(r):!0}function Sv(e){return t=>K4(t)===e}var Nh=_d("undefined"),ne=_d("string"),Jt=_d("number",e=>!Number.isNaN(e)),_e=_d("function");function sA(e){return e===null}function E1(e){return e===!0||e===!1}function hs(e){if(K4(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})}function aA(e){return e==null||/^[bns]/.test(typeof e)}function Zi(e){return sA(e)||Nh(e)}function Zt(e){return!Zi(e)&&(_e(e)||_d("object")(e))}var lA=Sv("RegExp");function cA(e){return Sv("Map")(e)}function uA(e){return Sv("Set")(e)}function gp(e){return Zt(e)&&!cA(e)&&!uA(e)&&Object.keys(e).length===0}var ct=Array.isArray;function Mo(e){return ct(e)&&e.length===0}function Qx(e){return ct(e)&&e.length>0}function dA(e){return e.charAt(0).toUpperCase()+e.slice(1)}function xa(e,t,r=n=>!!n){t.lastIndex=0;const n=[],o=t.flags;let i;o.includes("g")||(t=new RegExp(t.source,`g${o}`));do i=t.exec(e),i&&n.push(i);while(r(i));return t.lastIndex=0,n}function vp(){const e=Date.now(),t=vp.last||e;return vp.last=e>t?e:t+1}vp.last=0;function Cl(e=""){return`${e}${vp().toString(36)}`}function q4(e){return wv(e,t=>!Nh(t))}function fA(e){if(!hs(e))throw new Error("An invalid value was passed into this clone utility. Expected a plain object");return{...e}}var G4=q_;function Ml(e,t=!1){const r=t?[...e].reverse():e,n=new Set(r);return t?[...n].reverse():[...n]}function Y4(e){const t=[];for(const r of e){const n=ct(r)?Y4(r):[r];t.push(...n)}return t}function J4(){}function X4(...e){return W_.all(e,{isMergeableObject:hs})}function Ad({min:e,max:t,value:r}){return rt?t:r}function Q4(e){return e[e.length-1]}function ra(e,t){return[...e].map((r,n)=>({value:r,index:n})).sort((r,n)=>t(r.value,n.value)||r.index-n.index).map(({value:r})=>r)}function pA(e,t,r){try{if(ne(t)&&t in e)return e[t];ct(t)&&(t=`['${t.join("']['")}']`);let n=e;return t.replace(/\[\s*(["'])(.*?)\1\s*]|^\s*(\w+)\s*(?=\.|\[|$)|\.\s*(\w*)\s*(?=\.|\[|$)|\[\s*(-?\d+)\s*]/g,(o,i,s,a,l,c)=>(n=n[s||a||l||c],"")),n===void 0?r:n}catch{return r}}function hA(e,t){const r=fA(t);let n=r;for(const[o,i]of e.entries()){const s=o>=e.length-1;let a=n[i];if(s){if(ct(n)){const l=Number.parseInt(i.toString(),10);Jt(l)&&n.splice(l,1)}else Reflect.deleteProperty(n,i);return r}if(aA(a))return r;a=ct(a)?[...a]:{...a},n[i]=a,n=a}return r}function mA(e){return t=>pA(t,e)}function Z4(e,t,r=!1){const n=[],o=new Set,i=_e(t)?t:mA(t),s=r?[...e].reverse():e;for(const a of s){const l=i(a);o.has(l)||(o.add(l),n.push(a))}return r?n.reverse():n}function Ev(e,t){const r=ct(e)?e[0]:e;return Jt(t)?r<=t?Array.from({length:t+1-r},(n,o)=>o+r):Array.from({length:r+1-t},(n,o)=>-1*o+r):Array.from({length:Math.abs(r)},(n,o)=>(r<0?-1:1)*o)}function Zx(e,...t){const r=t.filter(Jt);return e>=Math.min(...r)&&e<=Math.max(...r)}function eE(e){return _e(e)?e():e}var tE="https://remirror.io/docs/errors",gA={[H.UNKNOWN]:"An error occurred but we're not quite sure why. 🧐",[H.INVALID_COMMAND_ARGUMENTS]:"The arguments passed to the command method were invalid.",[H.CUSTOM]:"This is a custom error, possibly thrown by an external library.",[H.CORE_HELPERS]:"An error occurred in a function called from the `@remirror/core-helpers` library.",[H.MUTATION]:"Mutation of immutable value detected.",[H.INTERNAL]:"This is an error which should not occur and is internal to the remirror codebase.",[H.MISSING_REQUIRED_EXTENSION]:"Your editor is missing a required extension.",[H.MANAGER_PHASE_ERROR]:"This occurs when accessing a method or property before it is available.",[H.INVALID_GET_EXTENSION]:"The user requested an invalid extension from the getExtensions method. Please check the `createExtensions` return method is returning an extension with the defined constructor.",[H.INVALID_MANAGER_ARGUMENTS]:"Invalid value(s) passed into `Manager` constructor. Only `Presets` and `Extensions` are supported.",[H.SCHEMA]:"There is a problem with the schema or you are trying to access a node / mark that doesn't exists.",[H.HELPERS_CALLED_IN_OUTER_SCOPE]:"The `helpers` method which is passed into the ``create*` method should only be called within returned method since it relies on an active view (not present in the outer scope).",[H.INVALID_MANAGER_EXTENSION]:"You requested an invalid extension from the manager.",[H.DUPLICATE_COMMAND_NAMES]:"Command method names must be unique within the editor.",[H.DUPLICATE_HELPER_NAMES]:"Helper method names must be unique within the editor.",[H.NON_CHAINABLE_COMMAND]:"Attempted to chain a non chainable command.",[H.INVALID_EXTENSION]:"The provided extension is invalid.",[H.INVALID_CONTENT]:"The content provided to the editor is not supported.",[H.INVALID_NAME]:"An invalid name was used for the extension.",[H.EXTENSION]:"An error occurred within an extension. More details should be made available.",[H.EXTENSION_SPEC]:"The spec was defined without calling the `defaults`, `parse` or `dom` methods.",[H.EXTENSION_EXTRA_ATTRIBUTES]:"Extra attributes must either be a string or an object.",[H.INVALID_SET_EXTENSION_OPTIONS]:"A call to `extension.setOptions` was made with invalid keys.",[H.REACT_PROVIDER_CONTEXT]:"`useRemirrorContext` was called outside of the `remirror` context. It can only be used within an active remirror context created by the ``.",[H.REACT_GET_ROOT_PROPS]:"`getRootProps` has been attached to the DOM more than once. It should only be attached to the dom once per editor.",[H.REACT_EDITOR_VIEW]:"A problem occurred adding the editor view to the dom.",[H.REACT_CONTROLLED]:"There is a problem with your controlled editor setup.",[H.REACT_NODE_VIEW]:"Something went wrong with your custom ReactNodeView Component.",[H.REACT_GET_CONTEXT]:"You attempted to call `getContext` provided by the `useRemirror` prop during the first render of the editor. This is not possible and should only be after the editor first mounts.",[H.REACT_COMPONENTS]:"An error occurred within a remirror component.",[H.REACT_HOOKS]:"An error occurred within a remirror hook.",[H.I18N_CONTEXT]:"You called `useI18n()` outside of an `I18nProvider` context."};function vA(e){return ne(e)&&fr(Ah(H),e)}function yA(e,t){const r=gA[e],n=r?`${r} + */var tA=B4,rA=function(t,r){if(!tA(t)&&typeof t!="function")return{};var n={};if(typeof r=="string")return r in t&&(n[r]=t[r]),n;for(var o=r.length,i=-1;++i{let d=l.prefixes[u]||"",f=c;return r===!1&&(n&&(f=f.normalize("NFD").replace(new RegExp(`[^a-zA-ZØßø0-9${n.join("")}]`,"g"),"")),n||(f=f.normalize("NFD").replace(/[^a-zA-ZØßø0-9]/g,""),d="")),n&&(d=d.replace(new RegExp(`[^${n.join("")}]`,"g"),"")),u===0?d+f:!d&&!f?"":s&&!d&&o.match(/\s/)?" "+f:(d||o)+f}).filter(Boolean)}function iA(e){const t=e.matchAll(F4).next().value,r=t?t.index:0;return e.slice(0,r+1).toUpperCase()+e.slice(r+1).toLowerCase()}function j4(e,t){return V4(e,t).reduce((r,n)=>r+iA(n),"")}function Qx(e,t){return V4(e,{...t,prefix:"-"}).join("").toLowerCase()}function E1(e,t,r,n){var o,i=!1,s=0;function a(){o&&clearTimeout(o)}function l(){a(),i=!0}typeof t!="boolean"&&(n=r,r=t,t=void 0);function c(){for(var u=arguments.length,d=new Array(u),f=0;fe?m():t!==!0&&(o=setTimeout(n?b:m,n===void 0?e-h:e))}return c.cancel=l,c}function U4(e,t,r){return r===void 0?E1(e,t,!1):E1(e,r,t!==!1)}function it(e,t,r){const n=e[t];return W4(!Rh(n),r),n}function W4(e,t){if(!e)throw new sA(t)}var sA=class extends $4.BaseError{constructor(){super(...arguments),this.name="AssertionError"}};function At(e){return Object.entries(e)}function Lu(e){return Object.keys(e)}function Nh(e){return Object.values(e)}function fr(e,t,r){return e.includes(t,r)}function ee(e){return Object.assign(Object.create(null),e)}function K4(e){return Object.prototype.toString.call(e)}function q4(e){return K4(e).slice(8,-1)}function _d(e,t){return r=>typeof r!==e?!1:t?t(r):!0}function Ev(e){return t=>q4(t)===e}var Rh=_d("undefined"),oe=_d("string"),Jt=_d("number",e=>!Number.isNaN(e)),_e=_d("function");function aA(e){return e===null}function C1(e){return e===!0||e===!1}function ps(e){if(q4(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})}function lA(e){return e==null||/^[bns]/.test(typeof e)}function es(e){return aA(e)||Rh(e)}function Zt(e){return!es(e)&&(_e(e)||_d("object")(e))}var cA=Ev("RegExp");function uA(e){return Ev("Map")(e)}function dA(e){return Ev("Set")(e)}function vp(e){return Zt(e)&&!uA(e)&&!dA(e)&&Object.keys(e).length===0}var ct=Array.isArray;function Mo(e){return ct(e)&&e.length===0}function Zx(e){return ct(e)&&e.length>0}function fA(e){return e.charAt(0).toUpperCase()+e.slice(1)}function xa(e,t,r=n=>!!n){t.lastIndex=0;const n=[],o=t.flags;let i;o.includes("g")||(t=new RegExp(t.source,`g${o}`));do i=t.exec(e),i&&n.push(i);while(r(i));return t.lastIndex=0,n}function yp(){const e=Date.now(),t=yp.last||e;return yp.last=e>t?e:t+1}yp.last=0;function Cl(e=""){return`${e}${yp().toString(36)}`}function G4(e){return Sv(e,t=>!Rh(t))}function pA(e){if(!ps(e))throw new Error("An invalid value was passed into this clone utility. Expected a plain object");return{...e}}var Y4=G_;function Ml(e,t=!1){const r=t?[...e].reverse():e,n=new Set(r);return t?[...n].reverse():[...n]}function J4(e){const t=[];for(const r of e){const n=ct(r)?J4(r):[r];t.push(...n)}return t}function X4(){}function Q4(...e){return K_.all(e,{isMergeableObject:ps})}function Ad({min:e,max:t,value:r}){return rt?t:r}function Z4(e){return e[e.length-1]}function ta(e,t){return[...e].map((r,n)=>({value:r,index:n})).sort((r,n)=>t(r.value,n.value)||r.index-n.index).map(({value:r})=>r)}function hA(e,t,r){try{if(oe(t)&&t in e)return e[t];ct(t)&&(t=`['${t.join("']['")}']`);let n=e;return t.replace(/\[\s*(["'])(.*?)\1\s*]|^\s*(\w+)\s*(?=\.|\[|$)|\.\s*(\w*)\s*(?=\.|\[|$)|\[\s*(-?\d+)\s*]/g,(o,i,s,a,l,c)=>(n=n[s||a||l||c],"")),n===void 0?r:n}catch{return r}}function mA(e,t){const r=pA(t);let n=r;for(const[o,i]of e.entries()){const s=o>=e.length-1;let a=n[i];if(s){if(ct(n)){const l=Number.parseInt(i.toString(),10);Jt(l)&&n.splice(l,1)}else Reflect.deleteProperty(n,i);return r}if(lA(a))return r;a=ct(a)?[...a]:{...a},n[i]=a,n=a}return r}function gA(e){return t=>hA(t,e)}function eE(e,t,r=!1){const n=[],o=new Set,i=_e(t)?t:gA(t),s=r?[...e].reverse():e;for(const a of s){const l=i(a);o.has(l)||(o.add(l),n.push(a))}return r?n.reverse():n}function Cv(e,t){const r=ct(e)?e[0]:e;return Jt(t)?r<=t?Array.from({length:t+1-r},(n,o)=>o+r):Array.from({length:r+1-t},(n,o)=>-1*o+r):Array.from({length:Math.abs(r)},(n,o)=>(r<0?-1:1)*o)}function ek(e,...t){const r=t.filter(Jt);return e>=Math.min(...r)&&e<=Math.max(...r)}function tE(e){return _e(e)?e():e}var rE="https://remirror.io/docs/errors",vA={[B.UNKNOWN]:"An error occurred but we're not quite sure why. 🧐",[B.INVALID_COMMAND_ARGUMENTS]:"The arguments passed to the command method were invalid.",[B.CUSTOM]:"This is a custom error, possibly thrown by an external library.",[B.CORE_HELPERS]:"An error occurred in a function called from the `@remirror/core-helpers` library.",[B.MUTATION]:"Mutation of immutable value detected.",[B.INTERNAL]:"This is an error which should not occur and is internal to the remirror codebase.",[B.MISSING_REQUIRED_EXTENSION]:"Your editor is missing a required extension.",[B.MANAGER_PHASE_ERROR]:"This occurs when accessing a method or property before it is available.",[B.INVALID_GET_EXTENSION]:"The user requested an invalid extension from the getExtensions method. Please check the `createExtensions` return method is returning an extension with the defined constructor.",[B.INVALID_MANAGER_ARGUMENTS]:"Invalid value(s) passed into `Manager` constructor. Only `Presets` and `Extensions` are supported.",[B.SCHEMA]:"There is a problem with the schema or you are trying to access a node / mark that doesn't exists.",[B.HELPERS_CALLED_IN_OUTER_SCOPE]:"The `helpers` method which is passed into the ``create*` method should only be called within returned method since it relies on an active view (not present in the outer scope).",[B.INVALID_MANAGER_EXTENSION]:"You requested an invalid extension from the manager.",[B.DUPLICATE_COMMAND_NAMES]:"Command method names must be unique within the editor.",[B.DUPLICATE_HELPER_NAMES]:"Helper method names must be unique within the editor.",[B.NON_CHAINABLE_COMMAND]:"Attempted to chain a non chainable command.",[B.INVALID_EXTENSION]:"The provided extension is invalid.",[B.INVALID_CONTENT]:"The content provided to the editor is not supported.",[B.INVALID_NAME]:"An invalid name was used for the extension.",[B.EXTENSION]:"An error occurred within an extension. More details should be made available.",[B.EXTENSION_SPEC]:"The spec was defined without calling the `defaults`, `parse` or `dom` methods.",[B.EXTENSION_EXTRA_ATTRIBUTES]:"Extra attributes must either be a string or an object.",[B.INVALID_SET_EXTENSION_OPTIONS]:"A call to `extension.setOptions` was made with invalid keys.",[B.REACT_PROVIDER_CONTEXT]:"`useRemirrorContext` was called outside of the `remirror` context. It can only be used within an active remirror context created by the ``.",[B.REACT_GET_ROOT_PROPS]:"`getRootProps` has been attached to the DOM more than once. It should only be attached to the dom once per editor.",[B.REACT_EDITOR_VIEW]:"A problem occurred adding the editor view to the dom.",[B.REACT_CONTROLLED]:"There is a problem with your controlled editor setup.",[B.REACT_NODE_VIEW]:"Something went wrong with your custom ReactNodeView Component.",[B.REACT_GET_CONTEXT]:"You attempted to call `getContext` provided by the `useRemirror` prop during the first render of the editor. This is not possible and should only be after the editor first mounts.",[B.REACT_COMPONENTS]:"An error occurred within a remirror component.",[B.REACT_HOOKS]:"An error occurred within a remirror hook.",[B.I18N_CONTEXT]:"You called `useI18n()` outside of an `I18nProvider` context."};function yA(e){return oe(e)&&fr(Nh(B),e)}function bA(e,t){const r=vA[e],n=r?`${r} `:"",o=t?`${t} -`:"";return`${n}${o}For more information visit ${tE}#${e.toLowerCase()}`}var rE=class extends D4.BaseError{constructor({code:e,message:t,disableLogging:r=!1}={}){const n=vA(e)?e:H.CUSTOM;super(yA(n,t)),this.errorCode=n,this.url=`${tE}#${n.toLowerCase()}`,r||console.error(this.message)}static create(e={}){return new rE(e)}};function te(e,t){if(!e)throw rE.create(t)}function Rh(e){if(typeof e!="object"||e===null)return e;const t=Symbol.toStringTag in e&&e[Symbol.toStringTag]==="Module"?e.default??e:e;return t&&typeof e=="object"&&"__esModule"in t&&t.__esModule&&t.default!==void 0?t.default:t}function Hs(e,t={}){return e}function Kt(e){this.content=e}Kt.prototype={constructor:Kt,find:function(e){for(var t=0;t>1}};Kt.from=function(e){if(e instanceof Kt)return e;var t=[];if(e)for(var r in e)t.push(r,e[r]);return new Kt(t)};function nE(e,t,r){for(let n=0;;n++){if(n==e.childCount||n==t.childCount)return e.childCount==t.childCount?null:r;let o=e.child(n),i=t.child(n);if(o==i){r+=o.nodeSize;continue}if(!o.sameMarkup(i))return r;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)r++;return r}if(o.content.size||i.content.size){let s=nE(o.content,i.content,r+1);if(s!=null)return s}r+=o.nodeSize}}function oE(e,t,r,n){for(let o=e.childCount,i=t.childCount;;){if(o==0||i==0)return o==i?null:{a:r,b:n};let s=e.child(--o),a=t.child(--i),l=s.nodeSize;if(s==a){r-=l,n-=l;continue}if(!s.sameMarkup(a))return{a:r,b:n};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;ct&&n(l,o+a,i||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,t-u),Math.min(l.content.size,r-u),n,o+u)}a=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,r,n,o){let i="",s=!0;return this.nodesBetween(t,r,(a,l)=>{a.isText?(i+=a.text.slice(Math.max(t,l)-l,r-l),s=!n):a.isLeaf?(o?i+=typeof o=="function"?o(a):o:a.type.spec.leafText&&(i+=a.type.spec.leafText(a)),s=!n):!s&&a.isBlock&&(i+=n,s=!0)},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let r=this.lastChild,n=t.firstChild,o=this.content.slice(),i=0;for(r.isText&&r.sameMarkup(n)&&(o[o.length-1]=r.withText(r.text+n.text),i=1);it)for(let i=0,s=0;st&&((sr)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,r-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,r-s-1))),n.push(a),o+=a.nodeSize),s=l}return new R(n,o)}cutByIndex(t,r){return t==r?R.empty:t==0&&r==this.content.length?this:new R(this.content.slice(t,r))}replaceChild(t,r){let n=this.content[t];if(n==r)return this;let o=this.content.slice(),i=this.size+r.nodeSize-n.nodeSize;return o[t]=r,new R(o,i)}addToStart(t){return new R([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new R(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let r=0;rthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,o=0;;n++){let i=this.child(n),s=o+i.nodeSize;if(s>=t)return s==t||r>0?rf(n+1,s):rf(n,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,r){if(!r)return R.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new R(r.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return R.empty;let r,n=0;for(let o=0;othis.type.rank&&(r||(r=t.slice(0,o)),r.push(this),n=!0),r&&r.push(i)}}return r||(r=t.slice()),n||r.push(this),r}removeFromSet(t){for(let r=0;rn.type.rank-o.type.rank),r}}Te.none=[];class bp extends Error{}class K{constructor(t,r,n){this.content=t,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,r){let n=sE(this.content,t+this.openStart,r);return n&&new K(n,this.openStart,this.openEnd)}removeBetween(t,r){return new K(iE(this.content,t+this.openStart,r+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,r){if(!r)return K.empty;let n=r.openStart||0,o=r.openEnd||0;if(typeof n!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new K(R.fromJSON(t,r.content),n,o)}static maxOpen(t,r=!0){let n=0,o=0;for(let i=t.firstChild;i&&!i.isLeaf&&(r||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=t.lastChild;i&&!i.isLeaf&&(r||!i.type.spec.isolating);i=i.lastChild)o++;return new K(t,n,o)}}K.empty=new K(R.empty,0,0);function iE(e,t,r){let{index:n,offset:o}=e.findIndex(t),i=e.maybeChild(n),{index:s,offset:a}=e.findIndex(r);if(o==t||i.isText){if(a!=r&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(r))}if(n!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(n,i.copy(iE(i.content,t-o-1,r-o-1)))}function sE(e,t,r,n){let{index:o,offset:i}=e.findIndex(t),s=e.maybeChild(o);if(i==t||s.isText)return n&&!n.canReplace(o,o,r)?null:e.cut(0,t).append(r).append(e.cut(t));let a=sE(s.content,t-i-1,r);return a&&e.replaceChild(o,s.copy(a))}function bA(e,t,r){if(r.openStart>e.depth)throw new bp("Inserted content deeper than insertion position");if(e.depth-r.openStart!=t.depth-r.openEnd)throw new bp("Inconsistent open depths");return aE(e,t,r,0)}function aE(e,t,r,n){let o=e.index(n),i=e.node(n);if(o==t.index(n)&&n=0&&e.isText&&e.sameMarkup(t[r])?t[r]=e.withText(t[r].text+e.text):t.push(e)}function mu(e,t,r,n){let o=(t||e).node(r),i=0,s=t?t.index(r):o.childCount;e&&(i=e.index(r),e.depth>r?i++:e.textOffset&&(Gs(e.nodeAfter,n),i++));for(let a=i;ao&&C1(e,t,o+1),s=n.depth>o&&C1(r,n,o+1),a=[];return mu(null,e,o,a),i&&s&&t.index(o)==r.index(o)?(lE(i,s),Gs(Ys(i,cE(e,t,r,n,o+1)),a)):(i&&Gs(Ys(i,xp(e,t,o+1)),a),mu(t,r,o,a),s&&Gs(Ys(s,xp(r,n,o+1)),a)),mu(n,null,o,a),new R(a)}function xp(e,t,r){let n=[];if(mu(null,e,r,n),e.depth>r){let o=C1(e,t,r+1);Gs(Ys(o,xp(e,t,r+1)),n)}return mu(t,null,r,n),new R(n)}function xA(e,t){let r=t.depth-e.openStart,o=t.node(r).copy(e.content);for(let i=r-1;i>=0;i--)o=t.node(i).copy(R.from(o));return{start:o.resolveNoCache(e.openStart+r),end:o.resolveNoCache(o.content.size-e.openEnd-r)}}class Tl{constructor(t,r,n){this.pos=t,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,r=this.index(this.depth);if(r==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],o=t.child(r);return n?t.child(r).cut(n):o}get nodeBefore(){let t=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(t).cut(0,r):t==0?null:this.parent.child(t-1)}posAtIndex(t,r){r=this.resolveDepth(r);let n=this.path[r*3],o=r==0?0:this.path[r*3-1]+1;for(let i=0;i0;r--)if(this.start(r)<=t&&this.end(r)>=t)return r;return 0}blockRange(t=this,r){if(t.pos=0;n--)if(t.pos<=this.end(n)&&(!r||r(this.node(n))))return new na(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&r<=t.content.size))throw new RangeError("Position "+r+" out of range");let n=[],o=0,i=r;for(let s=t;;){let{index:a,offset:l}=s.content.findIndex(i),c=i-l;if(n.push(s,a,o+l),!c||(s=s.child(a),s.isText))break;i=c-1,o+=l+1}return new Tl(r,n,i)}static resolveCached(t,r){for(let o=0;ot&&this.nodesBetween(t,r,i=>(n.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),uE(this.marks,t)}contentMatchAt(t){let r=this.type.contentMatch.matchFragment(this.content,0,t);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(t,r,n=R.empty,o=0,i=n.childCount){let s=this.contentMatchAt(t).matchFragment(n,o,i),a=s&&s.matchFragment(this.content,r);if(!a||!a.validEnd)return!1;for(let l=o;lr.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let t={type:this.type.name};for(let r in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(r=>r.toJSON())),t}static fromJSON(t,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(t.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(r.text,n)}let o=R.fromJSON(t,r.content);return t.nodeType(r.type).create(r.attrs,o,n)}};Bi.prototype.text=void 0;class kp extends Bi{constructor(t,r,n,o){if(super(t,r,null,o),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):uE(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,r){return this.text.slice(t,r)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new kp(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new kp(this.type,this.attrs,t,this.marks)}cut(t=0,r=this.text.length){return t==0&&r==this.text.length?this:this.withText(this.text.slice(t,r))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function uE(e,t){for(let r=e.length-1;r>=0;r--)t=e[r].type.name+"("+t+")";return t}class oa{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,r){let n=new SA(t,r);if(n.next==null)return oa.empty;let o=dE(n);n.next&&n.err("Unexpected trailing text");let i=AA(_A(o));return NA(i,n),i}matchType(t){for(let r=0;rc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function r(n){t.push(n);for(let o=0;o{let i=o+(n.validEnd?"*":" ")+" ";for(let s=0;s"+t.indexOf(n.next[s].next);return i}).join(` -`)}}oa.empty=new oa(!0);class SA{constructor(t,r){this.string=t,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function dE(e){let t=[];do t.push(EA(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function EA(e){let t=[];do t.push(CA(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function CA(e){let t=OA(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=MA(e,t);else break;return t}function ek(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function MA(e,t){let r=ek(e),n=r;return e.eat(",")&&(e.next!="}"?n=ek(e):n=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:t}}function TA(e,t){let r=e.nodeTypes,n=r[t];if(n)return[n];let o=[];for(let i in r){let s=r[i];s.groups.indexOf(t)>-1&&o.push(s)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function OA(e){if(e.eat("(")){let t=dE(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=TA(e,e.next).map(r=>(e.inline==null?e.inline=r.isInline:e.inline!=r.isInline&&e.err("Mixing inline and block content"),{type:"name",value:r}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function _A(e){let t=[[]];return o(i(e,0),r()),t;function r(){return t.push([])-1}function n(s,a,l){let c={term:l,to:a};return t[s].push(c),c}function o(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=r())}else if(s.type=="star"){let l=r();return n(a,l),o(i(s.expr,l),l),[n(l)]}else if(s.type=="plus"){let l=r();return o(i(s.expr,a),l),o(i(s.expr,l),l),[n(l)]}else{if(s.type=="opt")return[n(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c{e[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u{c||o.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=t[n.join(",")]=new oa(n.indexOf(e.length-1)>-1);for(let s=0;s-1}allowsMarks(t){if(this.markSet==null)return!0;for(let r=0;rn[i]=new gE(i,r,s));let o=r.spec.topNode||"doc";if(!n[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let i in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};class RA{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Nd{constructor(t,r,n,o){this.name=t,this.rank=r,this.schema=n,this.spec=o,this.attrs=mE(o.attrs),this.excluded=null;let i=pE(this.attrs);this.instance=i?new Te(this,i):null}create(t=null){return!t&&this.instance?this.instance:new Te(this,hE(this.attrs,t))}static compile(t,r){let n=Object.create(null),o=0;return t.forEach((i,s)=>n[i]=new Nd(i,o++,r,s)),n}removeFromSet(t){for(var r=0;r-1}}let PA=class{constructor(t){this.cached=Object.create(null);let r=this.spec={};for(let o in t)r[o]=t[o];r.nodes=Kt.from(t.nodes),r.marks=Kt.from(t.marks||{}),this.nodes=T1.compile(this.spec.nodes,this),this.marks=Nd.compile(this.spec.marks,this);let n=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=n[s]||(n[s]=oa.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=a=="_"?null:a?rk(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:rk(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,r=null,n,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof T1){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(r,n,o)}text(t,r){let n=this.nodes.text;return new kp(n,n.defaultAttrs,t,Te.setFrom(r))}mark(t,r){return typeof t=="string"&&(t=this.marks[t]),t.create(r)}nodeFromJSON(t){return Bi.fromJSON(this,t)}markFromJSON(t){return Te.fromJSON(this,t)}nodeType(t){let r=this.nodes[t];if(!r)throw new RangeError("Unknown node type: "+t);return r}};function rk(e,t){let r=[];for(let n=0;n-1)&&r.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[n]+"'")}return r}let Cv=class O1{constructor(t,r){this.schema=t,this.rules=r,this.tags=[],this.styles=[],r.forEach(n=>{n.tag?this.tags.push(n):n.style&&this.styles.push(n)}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let o=t.nodes[n.node];return o.contentMatch.matchType(o)})}parse(t,r={}){let n=new ok(this,r,!1);return n.addAll(t,r.from,r.to),n.finish()}parseSlice(t,r={}){let n=new ok(this,r,!0);return n.addAll(t,r.from,r.to),K.maxOpen(n.finish())}matchTag(t,r,n){for(let o=n?this.tags.indexOf(n)+1:0;ot.length&&(a.charCodeAt(t.length)!=61||a.slice(t.length+1)!=r))){if(s.getAttrs){let l=s.getAttrs(r);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(t){let r=[];function n(o){let i=o.priority==null?50:o.priority,s=0;for(;s{n(s=ik(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in t.nodes){let i=t.nodes[o].spec.parseDOM;i&&i.forEach(s=>{n(s=ik(s)),s.node||s.ignore||s.mark||(s.node=o)})}return r}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new O1(t,O1.schemaRules(t)))}};const vE={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},zA={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},yE={ol:!0,ul:!0},wp=1,Sp=2,gu=4;function nk(e,t,r){return t!=null?(t?wp:0)|(t==="full"?Sp:0):e&&e.whitespace=="pre"?wp|Sp:r&~gu}class nf{constructor(t,r,n,o,i,s,a){this.type=t,this.attrs=r,this.marks=n,this.pendingMarks=o,this.solid=i,this.options=a,this.content=[],this.activeMarks=Te.none,this.stashMarks=[],this.match=s||(a&gu?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let r=this.type.contentMatch.fillBefore(R.from(t));if(r)this.match=this.type.contentMatch.matchFragment(r);else{let n=this.type.contentMatch,o;return(o=n.findWrapping(t.type))?(this.match=n,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&wp)){let n=this.content[this.content.length-1],o;if(n&&n.isText&&(o=/[ \t\r\n\u000c]+$/.exec(n.text))){let i=n;n.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let r=R.from(this.content);return!t&&this.match&&(r=r.append(this.match.fillBefore(R.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}popFromStashMark(t){for(let r=this.stashMarks.length-1;r>=0;r--)if(t.eq(this.stashMarks[r]))return this.stashMarks.splice(r,1)[0]}applyPending(t){for(let r=0,n=this.pendingMarks;rthis.addAll(t)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(t,()=>{this.addElementByRule(t,i,i.consuming===!1?o:void 0)})}leafFallback(t){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(` -`))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let r=Te.none,n=Te.none;for(let o=0;o{s.clearMark(a)&&(n=a.addToSet(n))}):r=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(r),s.consuming===!1)i=s;else break}return[r,n]}addElementByRule(t,r,n){let o,i,s;r.node?(i=this.parser.schema.nodes[r.node],i.isLeaf?this.insertNode(i.create(r.attrs))||this.leafFallback(t):o=this.enter(i,r.attrs||null,r.preserveWhitespace)):(s=this.parser.schema.marks[r.mark].create(r.attrs),this.addPendingMark(s));let a=this.top;if(i&&i.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(r.getContent)this.findInside(t),r.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=t;typeof r.contentElement=="string"?l=t.querySelector(r.contentElement):typeof r.contentElement=="function"?l=r.contentElement(t):r.contentElement&&(l=r.contentElement),this.findAround(t,l,!0),this.addAll(l)}o&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(t,r,n){let o=r||0;for(let i=r?t.childNodes[r]:t.firstChild,s=n==null?null:t.childNodes[n];i!=s;i=i.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(i);this.findAtPoint(t,o)}findPlace(t){let r,n;for(let o=this.open;o>=0;o--){let i=this.nodes[o],s=i.findWrapping(t);if(s&&(!r||r.length>s.length)&&(r=s,n=i,!s.length)||i.solid)break}if(!r)return!1;this.sync(n);for(let o=0;othis.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let r=this.open;r>=0;r--)if(this.nodes[r]==t)return this.open=r,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let o=n.length-1;o>=0;o--)t+=n[o].nodeSize;r&&t++}return t}findAtPoint(t,r){if(this.find)for(let n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let r=t.split("/"),n=this.options.context,o=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(o?0:1),s=(a,l)=>{for(;a>=0;a--){let c=r[a];if(c==""){if(a==r.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&o?this.nodes[l].type:n&&l>=i?n.node(l-i).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;l--}}return!0};return s(r.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let r=t.depth;r>=0;r--){let n=t.node(r).contentMatchAt(t.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}addPendingMark(t){let r=HA(t,this.top.pendingMarks);r&&this.top.stashMarks.push(r),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,r){for(let n=this.open;n>=0;n--){let o=this.nodes[n];if(o.pendingMarks.lastIndexOf(t)>-1)o.pendingMarks=t.removeFromSet(o.pendingMarks);else{o.activeMarks=t.removeFromSet(o.activeMarks);let s=o.popFromStashMark(t);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==r)break}}}function LA(e){for(let t=e.firstChild,r=null;t;t=t.nextSibling){let n=t.nodeType==1?t.nodeName.toLowerCase():null;n&&yE.hasOwnProperty(n)&&r?(r.appendChild(t),t=r):n=="li"?r=t:n&&(r=null)}}function IA(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function DA(e){let t=/\s*([\w-]+)\s*:\s*([^;]+)/g,r,n=[];for(;r=t.exec(e);)n.push(r[1],r[2].trim());return n}function ik(e){let t={};for(let r in e)t[r]=e[r];return t}function $A(e,t){let r=t.schema.nodes;for(let n in r){let o=r[n];if(!o.allowsMarkType(e))continue;let i=[],s=a=>{i.push(a);for(let l=0;l{if(i.length||s.marks.length){let a=0,l=0;for(;a=0;o--){let i=this.serializeMark(t.marks[o],t.isInline,r);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,r,n={}){let o=this.marks[t.type.name];return o&&an.renderSpec(ag(n),o(t,r))}static renderSpec(t,r,n=null){if(typeof r=="string")return{dom:t.createTextNode(r)};if(r.nodeType!=null)return{dom:r};if(r.dom&&r.dom.nodeType!=null)return r;let o=r[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let s,a=n?t.createElementNS(n,o):t.createElement(o),l=r[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(let u in l)if(l[u]!=null){let d=u.indexOf(" ");d>0?a.setAttributeNS(u.slice(0,d),u.slice(d+1),l[u]):a.setAttribute(u,l[u])}}for(let u=c;uc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:f,contentDOM:p}=an.renderSpec(t,d,n);if(a.appendChild(f),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:a,contentDOM:s}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new an(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let r=sk(t.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(t){return sk(t.marks)}}function sk(e){let t={};for(let r in e){let n=e[r].spec.toDOM;n&&(t[r]=n)}return t}function ag(e){return e.document||window.document}const bE=65535,xE=Math.pow(2,16);function BA(e,t){return e+t*xE}function ak(e){return e&bE}function FA(e){return(e-(e&bE))/xE}const kE=1,wE=2,If=4,SE=8;class _1{constructor(t,r,n){this.pos=t,this.delInfo=r,this.recover=n}get deleted(){return(this.delInfo&SE)>0}get deletedBefore(){return(this.delInfo&(kE|If))>0}get deletedAfter(){return(this.delInfo&(wE|If))>0}get deletedAcross(){return(this.delInfo&If)>0}}class nn{constructor(t,r=!1){if(this.ranges=t,this.inverted=r,!t.length&&nn.empty)return nn.empty}recover(t){let r=0,n=ak(t);if(!this.inverted)for(let o=0;ot)break;let c=this.ranges[a+i],u=this.ranges[a+s],d=l+c;if(t<=d){let f=c?t==l?-1:t==d?1:r:r,p=l+o+(f<0?0:u);if(n)return p;let h=t==(r<0?l:d)?null:BA(a/3,t-l),m=t==l?wE:t==d?kE:If;return(r<0?t!=l:t!=d)&&(m|=SE),new _1(p,m,h)}o+=u-c}return n?t+o:new _1(t+o,0,null)}touches(t,r){let n=0,o=ak(r),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;at)break;let c=this.ranges[a+i],u=l+c;if(t<=u&&a==o*3)return!0;n+=this.ranges[a+s]-c}return!1}forEach(t){let r=this.inverted?2:1,n=this.inverted?1:2;for(let o=0,i=0;o=0;r--){let o=t.getMirror(r);this.appendMap(t.maps[r].invert(),o!=null&&o>r?n-o-1:void 0)}}invert(){let t=new ul;return t.appendMappingInverted(this),t}map(t,r=1){if(this.mirror)return this._map(t,r,!0);for(let n=this.from;ni&&l!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),r.openStart,r.openEnd);return yt.fromReplace(t,this.from,this.to,i)}invert(){return new eo(this.from,this.to,this.mark)}map(t){let r=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new Ko(r.pos,n.pos,this.mark)}merge(t){return t instanceof Ko&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ko(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ko(r.from,r.to,t.markFromJSON(r.mark))}}Rt.jsonID("addMark",Ko);class eo extends Rt{constructor(t,r,n){super(),this.from=t,this.to=r,this.mark=n}apply(t){let r=t.slice(this.from,this.to),n=new K(Mv(r.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),r.openStart,r.openEnd);return yt.fromReplace(t,this.from,this.to,n)}invert(){return new Ko(this.from,this.to,this.mark)}map(t){let r=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new eo(r.pos,n.pos,this.mark)}merge(t){return t instanceof eo&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new eo(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new eo(r.from,r.to,t.markFromJSON(r.mark))}}Rt.jsonID("removeMark",eo);class Li extends Rt{constructor(t,r){super(),this.pos=t,this.mark=r}apply(t){let r=t.nodeAt(this.pos);if(!r)return yt.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.addToSet(r.marks));return yt.fromReplace(t,this.pos,this.pos+1,new K(R.from(n),0,r.isLeaf?0:1))}invert(t){let r=t.nodeAt(this.pos);if(r){let n=this.mark.addToSet(r.marks);if(n.length==r.marks.length){for(let o=0;on.pos?null:new bt(r.pos,n.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number"||typeof r.gapFrom!="number"||typeof r.gapTo!="number"||typeof r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new bt(r.from,r.to,r.gapFrom,r.gapTo,K.fromJSON(t,r.slice),r.insert,!!r.structure)}}Rt.jsonID("replaceAround",bt);function A1(e,t,r){let n=e.resolve(t),o=r-t,i=n.depth;for(;o>0&&i>0&&n.indexAfter(i)==n.node(i).childCount;)i--,o--;if(o>0){let s=n.node(i).maybeChild(n.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function VA(e,t,r,n){let o=[],i=[],s,a;e.doc.nodesBetween(t,r,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!n.isInSet(d)&&u.type.allowsMarkType(n.type)){let f=Math.max(c,t),p=Math.min(c+l.nodeSize,r),h=n.addToSet(d);for(let m=0;me.step(l)),i.forEach(l=>e.step(l))}function jA(e,t,r,n){let o=[],i=0;e.doc.nodesBetween(t,r,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(n instanceof Nd){let c=s.marks,u;for(;u=n.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else n?n.isInSet(s.marks)&&(l=[n]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,r);for(let u=0;ue.step(new eo(s.from,s.to,s.style)))}function UA(e,t,r,n=r.contentMatch){let o=e.doc.nodeAt(t),i=[],s=t+1;for(let a=0;a=0;a--)e.step(i[a])}function WA(e,t,r){return(t==0||e.canReplace(t,e.childCount))&&(r==e.childCount||e.canReplace(0,r))}function rc(e){let r=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let o=e.$from.node(n),i=e.$from.index(n),s=e.$to.indexAfter(n);if(nr;h--)m||n.index(h)>0?(m=!0,u=R.from(n.node(h).copy(u)),d++):l--;let f=R.empty,p=0;for(let h=i,m=!1;h>r;h--)m||o.after(h+1)=0;s--){if(n.size){let a=r[s].type.contentMatch.matchFragment(n);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=R.from(r[s].type.create(r[s].attrs,n))}let o=t.start,i=t.end;e.step(new bt(o,i,o,i,new K(n,0,0),r.length,!0))}function JA(e,t,r,n,o){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,r,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(n,o)&&XA(e.doc,e.mapping.slice(i).map(a),n)){e.clearIncompatible(e.mapping.slice(i).map(a,1),n);let l=e.mapping.slice(i),c=l.map(a,1),u=l.map(a+s.nodeSize,1);return e.step(new bt(c,u,c+1,u-1,new K(R.from(n.create(o,null,s.marks)),0,0),1,!0)),!1}})}function XA(e,t,r){let n=e.resolve(t),o=n.index();return n.parent.canReplaceWith(o,o+1,r)}function QA(e,t,r,n,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");r||(r=i.type);let s=r.create(n,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!r.validContent(i.content))throw new RangeError("Invalid content for node type "+r.name);e.step(new bt(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new K(R.from(s),0,0),1,!0))}function dl(e,t,r=1,n){let o=e.resolve(t),i=o.depth-r,s=n&&n[n.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=r-2;c>i;c--,u--){let d=o.node(c),f=o.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=n&&n[u+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let m=n&&n[u]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(p))return!1}let a=o.indexAfter(i),l=n&&n[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function ZA(e,t,r=1,n){let o=e.doc.resolve(t),i=R.empty,s=R.empty;for(let a=o.depth,l=o.depth-r,c=r-1;a>l;a--,c--){i=R.from(o.node(a).copy(i));let u=n&&n[c];s=R.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}e.step(new Dt(t,t,new K(i.append(s),r,r),!0))}function Rd(e,t){let r=e.resolve(t),n=r.index();return eN(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function eN(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function tN(e,t,r){let n=new Dt(t-r,t+r,K.empty,!0);e.step(n)}function EE(e,t,r){let n=e.resolve(t);if(n.parent.canReplaceWith(n.index(),n.index(),r))return t;if(n.parentOffset==0)for(let o=n.depth-1;o>=0;o--){let i=n.index(o);if(n.node(o).canReplaceWith(i,i,r))return n.before(o+1);if(i>0)return null}if(n.parentOffset==n.parent.content.size)for(let o=n.depth-1;o>=0;o--){let i=n.indexAfter(o);if(n.node(o).canReplaceWith(i,i,r))return n.after(o+1);if(i=0;s--){let a=s==n.depth?0:n.pos<=(n.start(s+1)+n.end(s+1))/2?-1:1,l=n.index(s)+(a>0?1:0),c=n.node(s),u=!1;if(i==1)u=c.canReplace(l,l,o);else{let d=c.contentMatchAt(l).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?n.pos:a<0?n.before(s+1):n.after(s+1)}return null}function Ov(e,t,r=t,n=K.empty){if(t==r&&!n.size)return null;let o=e.resolve(t),i=e.resolve(r);return CE(o,i,n)?new Dt(t,r,n):new nN(o,i,n).fit()}function CE(e,t,r){return!r.openStart&&!r.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),r.content)}class nN{constructor(t,r,n){this.$from=t,this.$to=r,this.unplaced=n,this.frontier=[],this.placed=R.empty;for(let o=0;o<=t.depth;o++){let i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=R.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,n=this.$from,o=this.close(t<0?this.$to:n.doc.resolve(t));if(!o)return null;let i=this.placed,s=n.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new K(i,s,a);return t>-1?new bt(n.pos,t,this.$to.pos,this.$to.end(),l,r):l.size||n.pos!=this.$to.pos?new Dt(n.pos,o.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let r=this.unplaced.content,n=0,o=this.unplaced.openEnd;n1&&(o=0),i.type.spec.isolating&&o<=n){t=n;break}r=i.content}for(let r=1;r<=2;r++)for(let n=r==1?t:this.unplaced.openStart;n>=0;n--){let o,i=null;n?(i=cg(this.unplaced.content,n-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(r==1&&(s?c.matchType(s.type)||(d=c.fillBefore(R.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:n,frontierDepth:a,parent:i,inject:d};if(r==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:n,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:t,openStart:r,openEnd:n}=this.unplaced,o=cg(t,r);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new K(t,r+1,Math.max(n,o.size+r>=t.size-n?r+1:0)),!0)}dropNode(){let{content:t,openStart:r,openEnd:n}=this.unplaced,o=cg(t,r);if(o.childCount<=1&&r>0){let i=t.size-r<=r+o.size;this.unplaced=new K(zc(t,r-1,1),r-1,i?r-1:n)}else this.unplaced=new K(zc(t,r,1),r,n)}placeNodes({sliceDepth:t,frontierDepth:r,parent:n,inject:o,wrap:i}){for(;this.depth>r;)this.closeFrontierNode();if(i)for(let m=0;m1||l==0||m.content.size)&&(d=b,u.push(ME(m.mark(f.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?p:-1)))}let h=c==a.childCount;h||(p=-1),this.placed=Lc(this.placed,r,R.from(u)),this.frontier[r].match=d,h&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,b=a;m1&&o==this.$to.end(--n);)++o;return o}findCloseLevel(t){e:for(let r=Math.min(this.depth,t.depth);r>=0;r--){let{match:n,type:o}=this.frontier[r],i=r=0;a--){let{match:l,type:c}=this.frontier[a],u=ug(t,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:r,fit:s,move:i?t.doc.resolve(t.after(r+1)):t}}}}close(t){let r=this.findCloseLevel(t);if(!r)return null;for(;this.depth>r.depth;)this.closeFrontierNode();r.fit.childCount&&(this.placed=Lc(this.placed,r.depth,r.fit)),t=r.move;for(let n=r.depth+1;n<=t.depth;n++){let o=t.node(n),i=o.type.contentMatch.fillBefore(o.content,!0,t.index(n));this.openFrontierNode(o.type,o.attrs,i)}return t}openFrontierNode(t,r=null,n){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=Lc(this.placed,this.depth,R.from(t.create(r,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let r=this.frontier.pop().match.fillBefore(R.empty,!0);r.childCount&&(this.placed=Lc(this.placed,this.frontier.length,r))}}function zc(e,t,r){return t==0?e.cutByIndex(r,e.childCount):e.replaceChild(0,e.firstChild.copy(zc(e.firstChild.content,t-1,r)))}function Lc(e,t,r){return t==0?e.append(r):e.replaceChild(e.childCount-1,e.lastChild.copy(Lc(e.lastChild.content,t-1,r)))}function cg(e,t){for(let r=0;r1&&(n=n.replaceChild(0,ME(n.firstChild,t-1,n.childCount==1?r-1:0))),t>0&&(n=e.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(e.type.contentMatch.matchFragment(n).fillBefore(R.empty,!0)))),e.copy(n)}function ug(e,t,r,n,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!r.compatibleContent(i.type))return null;let a=n.fillBefore(i.content,!0,s);return a&&!oN(r,i.content,s)?a:null}function oN(e,t,r){for(let n=r;n0;f--,p--){let h=o.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(f)>-1?a=f:o.before(f)==p&&s.splice(1,0,-f)}let l=s.indexOf(a),c=[],u=n.openStart;for(let f=n.content,p=0;;p++){let h=f.firstChild;if(c.push(h),p==n.openStart)break;f=h.content}for(let f=u-1;f>=0;f--){let p=c[f],h=iN(p.type);if(h&&!p.sameMarkup(o.node(Math.abs(a)-1)))u=f;else if(h||!p.type.isTextblock)break}for(let f=n.openStart;f>=0;f--){let p=(f+u+1)%(n.openStart+1),h=c[p];if(h)for(let m=0;m=0&&(e.replace(t,r,n),!(e.steps.length>d));f--){let p=s[f];p<0||(t=o.before(p),r=i.after(p))}}function TE(e,t,r,n,o){if(tn){let i=o.contentMatchAt(0),s=i.fillBefore(e).append(e);e=s.append(i.matchFragment(s).fillBefore(R.empty,!0))}return e}function aN(e,t,r,n){if(!n.isInline&&t==r&&e.doc.resolve(t).parent.content.size){let o=EE(e.doc,t,n.type);o!=null&&(t=r=o)}e.replaceRange(t,r,new K(R.from(n),0,0))}function lN(e,t,r){let n=e.doc.resolve(t),o=e.doc.resolve(r),i=OE(n,o);for(let s=0;s0&&(l||n.node(a-1).canReplace(n.index(a-1),o.indexAfter(a-1))))return e.delete(n.before(a),o.after(a))}for(let s=1;s<=n.depth&&s<=o.depth;s++)if(t-n.start(s)==n.depth-s&&r>n.end(s)&&o.end(s)-r!=o.depth-s)return e.delete(n.before(s),r);e.delete(t,r)}function OE(e,t){let r=[],n=Math.min(e.depth,t.depth);for(let o=n;o>=0;o--){let i=e.start(o);if(it.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(i==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==i-1)&&r.push(o)}return r}class fl extends Rt{constructor(t,r,n){super(),this.pos=t,this.attr=r,this.value=n}apply(t){let r=t.nodeAt(this.pos);if(!r)return yt.fail("No node at attribute step's position");let n=Object.create(null);for(let i in r.attrs)n[i]=r.attrs[i];n[this.attr]=this.value;let o=r.type.create(n,null,r.marks);return yt.fromReplace(t,this.pos,this.pos+1,new K(R.from(o),0,r.isLeaf?0:1))}getMap(){return nn.empty}invert(t){return new fl(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let r=t.mapResult(this.pos,1);return r.deletedAfter?null:new fl(r.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,r){if(typeof r.pos!="number"||typeof r.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new fl(r.pos,r.attr,r.value)}}Rt.jsonID("attr",fl);class Iu extends Rt{constructor(t,r){super(),this.attr=t,this.value=r}apply(t){let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let n=t.type.create(r,t.content,t.marks);return yt.ok(n)}getMap(){return nn.empty}invert(t){return new Iu(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,r){if(typeof r.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Iu(r.attr,r.value)}}Rt.jsonID("docAttr",Iu);let _l=class extends Error{};_l=function e(t){let r=Error.call(this,t);return r.__proto__=e.prototype,r};_l.prototype=Object.create(Error.prototype);_l.prototype.constructor=_l;_l.prototype.name="TransformError";class cN{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new ul}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let r=this.maybeStep(t);if(r.failed)throw new _l(r.failed);return this}maybeStep(t){let r=t.apply(this.doc);return r.failed||this.addStep(t,r.doc),r}get docChanged(){return this.steps.length>0}addStep(t,r){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=r}replace(t,r=t,n=K.empty){let o=Ov(this.doc,t,r,n);return o&&this.step(o),this}replaceWith(t,r,n){return this.replace(t,r,new K(R.from(n),0,0))}delete(t,r){return this.replace(t,r,K.empty)}insert(t,r){return this.replaceWith(t,t,r)}replaceRange(t,r,n){return sN(this,t,r,n),this}replaceRangeWith(t,r,n){return aN(this,t,r,n),this}deleteRange(t,r){return lN(this,t,r),this}lift(t,r){return KA(this,t,r),this}join(t,r=1){return tN(this,t,r),this}wrap(t,r){return YA(this,t,r),this}setBlockType(t,r=t,n,o=null){return JA(this,t,r,n,o),this}setNodeMarkup(t,r,n=null,o){return QA(this,t,r,n,o),this}setNodeAttribute(t,r,n){return this.step(new fl(t,r,n)),this}setDocAttribute(t,r){return this.step(new Iu(t,r)),this}addNodeMark(t,r){return this.step(new Li(t,r)),this}removeNodeMark(t,r){if(!(r instanceof Te)){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(r=r.isInSet(n.marks),!r)return this}return this.step(new Ol(t,r)),this}split(t,r=1,n){return ZA(this,t,r,n),this}addMark(t,r,n){return VA(this,t,r,n),this}removeMark(t,r,n){return jA(this,t,r,n),this}clearIncompatible(t,r,n){return UA(this,t,r,n),this}}const dg=Object.create(null);class be{constructor(t,r,n){this.$anchor=t,this.$head=r,this.ranges=n||[new uN(t.min(r),t.max(r))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let r=0;r=0;i--){let s=r<0?Fa(t.node(0),t.node(i),t.before(i+1),t.index(i),r,n):Fa(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,r,n);if(s)return s}return null}static near(t,r=1){return this.findFrom(t,r)||this.findFrom(t,-r)||new kr(t.node(0))}static atStart(t){return Fa(t,t,0,0,1)||new kr(t)}static atEnd(t){return Fa(t,t,t.content.size,t.childCount,-1)||new kr(t)}static fromJSON(t,r){if(!r||!r.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=dg[r.type];if(!n)throw new RangeError(`No selection type ${r.type} defined`);return n.fromJSON(t,r)}static jsonID(t,r){if(t in dg)throw new RangeError("Duplicate use of selection JSON ID "+t);return dg[t]=r,r.prototype.jsonID=t,r}getBookmark(){return le.between(this.$anchor,this.$head).getBookmark()}}be.prototype.visible=!0;class uN{constructor(t,r){this.$from=t,this.$to=r}}let ck=!1;function uk(e){!ck&&!e.parent.inlineContent&&(ck=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class le extends be{constructor(t,r=t){uk(t),uk(r),super(t,r)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,r){let n=t.resolve(r.map(this.head));if(!n.parent.inlineContent)return be.near(n);let o=t.resolve(r.map(this.anchor));return new le(o.parent.inlineContent?o:n,n)}replace(t,r=K.empty){if(super.replace(t,r),r==K.empty){let n=this.$from.marksAcross(this.$to);n&&t.ensureMarks(n)}}eq(t){return t instanceof le&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Ph(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,r){if(typeof r.anchor!="number"||typeof r.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new le(t.resolve(r.anchor),t.resolve(r.head))}static create(t,r,n=r){let o=t.resolve(r);return new this(o,n==r?o:t.resolve(n))}static between(t,r,n){let o=t.pos-r.pos;if((!n||o)&&(n=o>=0?1:-1),!r.parent.inlineContent){let i=be.findFrom(r,n,!0)||be.findFrom(r,-n,!0);if(i)r=i.$head;else return be.near(r,n)}return t.parent.inlineContent||(o==0?t=r:(t=(be.findFrom(t,-n,!0)||be.findFrom(t,n,!0)).$anchor,t.pos0?0:1);o>0?s=0;s+=o){let a=t.child(s);if(a.isAtom){if(!i&&ce.isSelectable(a))return ce.create(e,r-(o<0?a.nodeSize:0))}else{let l=Fa(e,a,r+o,o<0?a.childCount:0,o,i);if(l)return l}r+=a.nodeSize*o}return null}function dk(e,t,r){let n=e.steps.length-1;if(n{s==null&&(s=u)}),e.setSelection(be.near(e.doc.resolve(s),r))}const fk=1,of=2,pk=4;class fN extends cN{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=of,this}ensureMarks(t){return Te.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&of)>0}addStep(t,r){super.addStep(t,r),this.updated=this.updated&~of,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,r=!0){let n=this.selection;return r&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Te.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,r,n){let o=this.doc.type.schema;if(r==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(n==null&&(n=r),n=n??r,!t)return this.deleteRange(r,n);let i=this.storedMarks;if(!i){let s=this.doc.resolve(r);i=n==r?s.marks():s.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(r,n,o.text(t,i)),this.selection.empty||this.setSelection(be.near(this.selection.$to)),this}}setMeta(t,r){return this.meta[typeof t=="string"?t:t.key]=r,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=pk,this}get scrolledIntoView(){return(this.updated&pk)>0}}function hk(e,t){return!t||!e?e:e.bind(t)}class Ic{constructor(t,r,n){this.name=t,this.init=hk(r.init,n),this.apply=hk(r.apply,n)}}const pN=[new Ic("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Ic("selection",{init(e,t){return e.selection||be.atStart(t.doc)},apply(e){return e.selection}}),new Ic("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,r,n){return n.selection.$cursor?e.storedMarks:null}}),new Ic("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class fg{constructor(t,r){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=pN.slice(),r&&r.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new Ic(n.key,n.spec.state,n))})}}class Bs{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,r=-1){for(let n=0;nn.toJSON())),t&&typeof t=="object")for(let n in t){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[n],i=o.spec.state;i&&i.toJSON&&(r[n]=i.toJSON.call(o,this[o.key]))}return r}static fromJSON(t,r,n){if(!r)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new fg(t.schema,t.plugins),i=new Bs(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=Bi.fromJSON(t.schema,r.doc);else if(s.name=="selection")i.selection=be.fromJSON(i.doc,r.selection);else if(s.name=="storedMarks")r.storedMarks&&(i.storedMarks=r.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let a in n){let l=n[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(r,a)){i[s.name]=c.fromJSON.call(l,t,r[a],i);return}}i[s.name]=s.init(t,i)}}),i}}function _E(e,t,r){for(let n in e){let o=e[n];o instanceof Function?o=o.bind(t):n=="handleDOMEvents"&&(o=_E(o,t,{})),r[n]=o}return r}class Ro{constructor(t){this.spec=t,this.props={},t.props&&_E(t.props,this,this.props),this.key=t.key?t.key.key:AE("plugin")}getState(t){return t[this.key]}}const pg=Object.create(null);function AE(e){return e in pg?e+"$"+ ++pg[e]:(pg[e]=0,e+"$")}class ka{constructor(t="key"){this.key=AE(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}var hN=/[A-Z]/g,mN=/^ms-/,hg={};function gN(e){return"-"+e.toLowerCase()}function vN(e){if(hg.hasOwnProperty(e))return hg[e];var t=e.replace(hN,gN);return hg[e]=mN.test(t)?"-"+t:t}function yN(e){return vN(e)}function bN(e,t){return yN(e)+":"+t}function xN(e){var t="";for(var r in e){var n=e[r];typeof n!="string"&&typeof n!="number"||(t&&(t+=";"),t+=bN(r,n))}return t}function kN(){return typeof document<"u"?document:null}var NE=kN;function RE(e,t){if(typeof e!="string")return[e];var r=[e];typeof t=="string"||Array.isArray(t)?t={brackets:t}:t||(t={});var n=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],o=t.escape||"___",i=!!t.flat;n.forEach(function(l){var c=new RegExp(["\\",l[0],"[^\\",l[0],"\\",l[1],"]*\\",l[1]].join("")),u=[];function d(f,p,h){var m=r.push(f.slice(l[0].length,-l[1].length))-1;return u.push(m),o+m+o}r.forEach(function(f,p){for(var h,m=0;f!=h;)if(h=f,f=f.replace(c,d),m++>1e4)throw Error("References have circular dependency. Please, check them.");r[p]=f}),u=u.reverse(),r=r.map(function(f){return u.forEach(function(p){f=f.replace(new RegExp("(\\"+o+p+"\\"+o+")","g"),l[0]+"$1"+l[1])}),f})});var s=new RegExp("\\"+o+"([0-9]+)\\"+o);function a(l,c,u){for(var d=[],f,p=0;f=s.exec(l);){if(p++>1e4)throw Error("Circular references in parenthesis");d.push(l.slice(0,f.index)),d.push(a(c[f[1]],c)),l=l.slice(f.index+f[0].length)}return d.push(l),d}return i?r:a(r[0],r)}function PE(e,t){if(t&&t.flat){var r=t&&t.escape||"___",n=e[0],o;if(!n)return"";for(var i=new RegExp("\\"+r+"([0-9]+)\\"+r),s=0;n!=o;){if(s++>1e4)throw Error("Circular references in "+e);o=n,n=n.replace(i,a)}return n}return e.reduce(function l(c,u){return Array.isArray(u)&&(u=u.reduce(l,"")),c+u},"");function a(l,c){if(e[c]==null)throw Error("Reference "+c+"is undefined");return e[c]}}function Av(e,t){return Array.isArray(e)?PE(e,t):RE(e,t)}Av.parse=RE;Av.stringify=PE;var wN=Av;const SN=Dn(wN),EN={id:"extension.command.copy.label",message:"Copy",comment:"Label for copy command."},CN={id:"extension.command.copy.description",message:"Copy the selected text",comment:"Description for copy command."},MN={id:"extension.command.cut.label",message:"Cut",comment:"Label for cut command."},TN={id:"extension.command.cut.description",message:"Cut the selected text",comment:"Description for cut command."},ON={id:"extension.command.paste.label",message:"Paste",comment:"Label for paste command."},_N={id:"extension.command.paste.description",message:"Paste content into the editor",comment:"Description for paste command."},AN={id:"extension.command.select-all.label",message:"Select all",comment:"Label for select all command."},NN={id:"extension.command.select-all.description",message:"Select all content within the editor",comment:"Description for select all command."};var es=Object.freeze({__proto__:null,COPY_DESCRIPTION:CN,COPY_LABEL:EN,CUT_DESCRIPTION:TN,CUT_LABEL:MN,PASTE_DESCRIPTION:_N,PASTE_LABEL:ON,SELECT_ALL_DESCRIPTION:NN,SELECT_ALL_LABEL:AN});const RN={id:"keyboard.shortcut.escape",message:"Enter",comment:"Label for escape key in shortcuts."},PN={id:"keyboard.shortcut.command",message:"Command",comment:"Label for command key in shortcuts."},zN={id:"keyboard.shortcut.control",message:"Control",comment:"Label for control key in shortcuts."},LN={id:"keyboard.shortcut.enter",message:"Enter",comment:"Label for enter key in shortcuts."},IN={id:"keyboard.shortcut.shift",message:"Shift",comment:"Label for shift key in shortcuts."},DN={id:"keyboard.shortcut.alt",message:"Alt",comment:"Label for alt key in shortcuts."},$N={id:"keyboard.shortcut.capsLock",message:"Caps Lock",comment:"Label for caps lock key in shortcuts."},HN={id:"keyboard.shortcut.backspace",message:"Backspace",comment:"Label for backspace key in shortcuts."},BN={id:"keyboard.shortcut.tab",message:"Tab",comment:"Label for tab key in shortcuts."},FN={id:"keyboard.shortcut.space",message:"Space",comment:"Label for space key in shortcuts."},VN={id:"keyboard.shortcut.delete",message:"Delete",comment:"Label for delete key in shortcuts."},jN={id:"keyboard.shortcut.pageUp",message:"Page Up",comment:"Label for page up key in shortcuts."},UN={id:"keyboard.shortcut.pageDown",message:"Page Down",comment:"Label for page down key in shortcuts."},WN={id:"keyboard.shortcut.home",message:"Home",comment:"Label for home key in shortcuts."},KN={id:"keyboard.shortcut.end",message:"End",comment:"Label for end key in shortcuts."},qN={id:"keyboard.shortcut.arrowLeft",message:"Arrow Left",comment:"Label for arrow left key in shortcuts."},GN={id:"keyboard.shortcut.arrowRight",message:"Arrow Right",comment:"Label for arrow right key in shortcuts."},YN={id:"keyboard.shortcut.arrowUp",message:"Arrow Up",comment:"Label for arrow up key in shortcuts."},JN={id:"keyboard.shortcut.arrowDown",message:"Arrow Down",comment:"Label for arrowDown key in shortcuts."};var Mt=Object.freeze({__proto__:null,ALT_KEY:DN,ARROW_DOWN_KEY:JN,ARROW_LEFT_KEY:qN,ARROW_RIGHT_KEY:GN,ARROW_UP_KEY:YN,BACKSPACE_KEY:HN,CAPS_LOCK_KEY:$N,COMMAND_KEY:PN,CONTROL_KEY:zN,DELETE_KEY:VN,END_KEY:KN,ENTER_KEY:LN,ESCAPE_KEY:RN,HOME_KEY:WN,PAGE_DOWN_KEY:UN,PAGE_UP_KEY:jN,SHIFT_KEY:IN,SPACE_KEY:FN,TAB_KEY:BN});const XN={id:"extension.command.toggle-blockquote.label",message:"Blockquote",comment:"Label for blockquote formatting command."},QN={id:"extension.command.toggle-blockquote.description",message:"Add blockquote formatting to the selected text",comment:"Description for blockquote formatting command."};var mk=Object.freeze({__proto__:null,DESCRIPTION:QN,LABEL:XN});const ZN={id:"extension.command.toggle-bold.label",message:"Bold",comment:"Label for bold formatting command."},eR={id:"extension.command.toggle-bold.description",message:"Add bold formatting to the selected text",comment:"Description for bold formatting command."};var gk=Object.freeze({__proto__:null,DESCRIPTION:eR,LABEL:ZN});const tR={id:"extension.command.toggle-code-block.label",message:"Codeblock",comment:"Label for the code block command."},rR={id:"extension.command.toggle-code-block.description",message:"Add a code block",comment:"Description for the code block command."};var nR=Object.freeze({__proto__:null,DESCRIPTION:rR,LABEL:tR});const oR={id:"extension.command.toggle-code.label",message:"Code",comment:"Label for the inline code formatting."},iR={id:"extension.command.toggle-code.description",message:"Add inline code formatting to the selected text",comment:"Description for the inline code formatting command."};var sR=Object.freeze({__proto__:null,DESCRIPTION:iR,LABEL:oR});const aR={id:"extension.command.set-font-size.label",message:"Font size",comment:"Label for adding a font size."},lR={id:"extension.command.set-font-size.description",message:"Set the font size for the selected text.",comment:"Description for adding a font size."},cR={id:"extension.command.increase-font-size.label",message:"Increase",comment:"Label for increasing the font size."},uR={id:"extension.command.increase-font-size.description",message:"Increase the font size",comment:"Description for increasing the font size."},dR={id:"extension.command.decrease-font-size.label",message:"Decrease",comment:"Label for decreasing the font size."},fR={id:"extension.command.decrease-font-size.description",message:"Decrease the font size.",comment:"Description for decreasing the font size."};var Al=Object.freeze({__proto__:null,DECREASE_DESCRIPTION:fR,DECREASE_LABEL:dR,INCREASE_DESCRIPTION:uR,INCREASE_LABEL:cR,SET_DESCRIPTION:lR,SET_LABEL:aR});const pR={id:"extension.command.toggle-heading.label",message:`{level, select, 1 {Heading 1} +`:"";return`${n}${o}For more information visit ${rE}#${e.toLowerCase()}`}var nE=class extends $4.BaseError{constructor({code:e,message:t,disableLogging:r=!1}={}){const n=yA(e)?e:B.CUSTOM;super(bA(n,t)),this.errorCode=n,this.url=`${rE}#${n.toLowerCase()}`,r||console.error(this.message)}static create(e={}){return new nE(e)}};function re(e,t){if(!e)throw nE.create(t)}function Ph(e){if(typeof e!="object"||e===null)return e;const t=Symbol.toStringTag in e&&e[Symbol.toStringTag]==="Module"?e.default??e:e;return t&&typeof e=="object"&&"__esModule"in t&&t.__esModule&&t.default!==void 0?t.default:t}function $s(e,t={}){return e}function Kt(e){this.content=e}Kt.prototype={constructor:Kt,find:function(e){for(var t=0;t>1}};Kt.from=function(e){if(e instanceof Kt)return e;var t=[];if(e)for(var r in e)t.push(r,e[r]);return new Kt(t)};function oE(e,t,r){for(let n=0;;n++){if(n==e.childCount||n==t.childCount)return e.childCount==t.childCount?null:r;let o=e.child(n),i=t.child(n);if(o==i){r+=o.nodeSize;continue}if(!o.sameMarkup(i))return r;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)r++;return r}if(o.content.size||i.content.size){let s=oE(o.content,i.content,r+1);if(s!=null)return s}r+=o.nodeSize}}function iE(e,t,r,n){for(let o=e.childCount,i=t.childCount;;){if(o==0||i==0)return o==i?null:{a:r,b:n};let s=e.child(--o),a=t.child(--i),l=s.nodeSize;if(s==a){r-=l,n-=l;continue}if(!s.sameMarkup(a))return{a:r,b:n};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;ct&&n(l,o+a,i||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,t-u),Math.min(l.content.size,r-u),n,o+u)}a=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,r,n,o){let i="",s=!0;return this.nodesBetween(t,r,(a,l)=>{a.isText?(i+=a.text.slice(Math.max(t,l)-l,r-l),s=!n):a.isLeaf?(o?i+=typeof o=="function"?o(a):o:a.type.spec.leafText&&(i+=a.type.spec.leafText(a)),s=!n):!s&&a.isBlock&&(i+=n,s=!0)},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let r=this.lastChild,n=t.firstChild,o=this.content.slice(),i=0;for(r.isText&&r.sameMarkup(n)&&(o[o.length-1]=r.withText(r.text+n.text),i=1);it)for(let i=0,s=0;st&&((sr)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,r-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,r-s-1))),n.push(a),o+=a.nodeSize),s=l}return new R(n,o)}cutByIndex(t,r){return t==r?R.empty:t==0&&r==this.content.length?this:new R(this.content.slice(t,r))}replaceChild(t,r){let n=this.content[t];if(n==r)return this;let o=this.content.slice(),i=this.size+r.nodeSize-n.nodeSize;return o[t]=r,new R(o,i)}addToStart(t){return new R([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new R(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let r=0;rthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,o=0;;n++){let i=this.child(n),s=o+i.nodeSize;if(s>=t)return s==t||r>0?rf(n+1,s):rf(n,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,r){if(!r)return R.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new R(r.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return R.empty;let r,n=0;for(let o=0;othis.type.rank&&(r||(r=t.slice(0,o)),r.push(this),n=!0),r&&r.push(i)}}return r||(r=t.slice()),n||r.push(this),r}removeFromSet(t){for(let r=0;rn.type.rank-o.type.rank),r}}Te.none=[];class xp extends Error{}class K{constructor(t,r,n){this.content=t,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,r){let n=aE(this.content,t+this.openStart,r);return n&&new K(n,this.openStart,this.openEnd)}removeBetween(t,r){return new K(sE(this.content,t+this.openStart,r+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,r){if(!r)return K.empty;let n=r.openStart||0,o=r.openEnd||0;if(typeof n!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new K(R.fromJSON(t,r.content),n,o)}static maxOpen(t,r=!0){let n=0,o=0;for(let i=t.firstChild;i&&!i.isLeaf&&(r||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=t.lastChild;i&&!i.isLeaf&&(r||!i.type.spec.isolating);i=i.lastChild)o++;return new K(t,n,o)}}K.empty=new K(R.empty,0,0);function sE(e,t,r){let{index:n,offset:o}=e.findIndex(t),i=e.maybeChild(n),{index:s,offset:a}=e.findIndex(r);if(o==t||i.isText){if(a!=r&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(r))}if(n!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(n,i.copy(sE(i.content,t-o-1,r-o-1)))}function aE(e,t,r,n){let{index:o,offset:i}=e.findIndex(t),s=e.maybeChild(o);if(i==t||s.isText)return n&&!n.canReplace(o,o,r)?null:e.cut(0,t).append(r).append(e.cut(t));let a=aE(s.content,t-i-1,r);return a&&e.replaceChild(o,s.copy(a))}function xA(e,t,r){if(r.openStart>e.depth)throw new xp("Inserted content deeper than insertion position");if(e.depth-r.openStart!=t.depth-r.openEnd)throw new xp("Inconsistent open depths");return lE(e,t,r,0)}function lE(e,t,r,n){let o=e.index(n),i=e.node(n);if(o==t.index(n)&&n=0&&e.isText&&e.sameMarkup(t[r])?t[r]=e.withText(t[r].text+e.text):t.push(e)}function mu(e,t,r,n){let o=(t||e).node(r),i=0,s=t?t.index(r):o.childCount;e&&(i=e.index(r),e.depth>r?i++:e.textOffset&&(qs(e.nodeAfter,n),i++));for(let a=i;ao&&M1(e,t,o+1),s=n.depth>o&&M1(r,n,o+1),a=[];return mu(null,e,o,a),i&&s&&t.index(o)==r.index(o)?(cE(i,s),qs(Gs(i,uE(e,t,r,n,o+1)),a)):(i&&qs(Gs(i,kp(e,t,o+1)),a),mu(t,r,o,a),s&&qs(Gs(s,kp(r,n,o+1)),a)),mu(n,null,o,a),new R(a)}function kp(e,t,r){let n=[];if(mu(null,e,r,n),e.depth>r){let o=M1(e,t,r+1);qs(Gs(o,kp(e,t,r+1)),n)}return mu(t,null,r,n),new R(n)}function kA(e,t){let r=t.depth-e.openStart,o=t.node(r).copy(e.content);for(let i=r-1;i>=0;i--)o=t.node(i).copy(R.from(o));return{start:o.resolveNoCache(e.openStart+r),end:o.resolveNoCache(o.content.size-e.openEnd-r)}}class Tl{constructor(t,r,n){this.pos=t,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,r=this.index(this.depth);if(r==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],o=t.child(r);return n?t.child(r).cut(n):o}get nodeBefore(){let t=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(t).cut(0,r):t==0?null:this.parent.child(t-1)}posAtIndex(t,r){r=this.resolveDepth(r);let n=this.path[r*3],o=r==0?0:this.path[r*3-1]+1;for(let i=0;i0;r--)if(this.start(r)<=t&&this.end(r)>=t)return r;return 0}blockRange(t=this,r){if(t.pos=0;n--)if(t.pos<=this.end(n)&&(!r||r(this.node(n))))return new ra(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&r<=t.content.size))throw new RangeError("Position "+r+" out of range");let n=[],o=0,i=r;for(let s=t;;){let{index:a,offset:l}=s.content.findIndex(i),c=i-l;if(n.push(s,a,o+l),!c||(s=s.child(a),s.isText))break;i=c-1,o+=l+1}return new Tl(r,n,i)}static resolveCached(t,r){for(let o=0;ot&&this.nodesBetween(t,r,i=>(n.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),dE(this.marks,t)}contentMatchAt(t){let r=this.type.contentMatch.matchFragment(this.content,0,t);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(t,r,n=R.empty,o=0,i=n.childCount){let s=this.contentMatchAt(t).matchFragment(n,o,i),a=s&&s.matchFragment(this.content,r);if(!a||!a.validEnd)return!1;for(let l=o;lr.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let t={type:this.type.name};for(let r in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(r=>r.toJSON())),t}static fromJSON(t,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(t.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(r.text,n)}let o=R.fromJSON(t,r.content);return t.nodeType(r.type).create(r.attrs,o,n)}};Fi.prototype.text=void 0;class wp extends Fi{constructor(t,r,n,o){if(super(t,r,null,o),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):dE(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,r){return this.text.slice(t,r)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new wp(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new wp(this.type,this.attrs,t,this.marks)}cut(t=0,r=this.text.length){return t==0&&r==this.text.length?this:this.withText(this.text.slice(t,r))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function dE(e,t){for(let r=e.length-1;r>=0;r--)t=e[r].type.name+"("+t+")";return t}class na{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,r){let n=new EA(t,r);if(n.next==null)return na.empty;let o=fE(n);n.next&&n.err("Unexpected trailing text");let i=NA(AA(o));return RA(i,n),i}matchType(t){for(let r=0;rc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function r(n){t.push(n);for(let o=0;o{let i=o+(n.validEnd?"*":" ")+" ";for(let s=0;s"+t.indexOf(n.next[s].next);return i}).join(` +`)}}na.empty=new na(!0);class EA{constructor(t,r){this.string=t,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function fE(e){let t=[];do t.push(CA(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function CA(e){let t=[];do t.push(MA(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function MA(e){let t=_A(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=TA(e,t);else break;return t}function tk(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function TA(e,t){let r=tk(e),n=r;return e.eat(",")&&(e.next!="}"?n=tk(e):n=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:t}}function OA(e,t){let r=e.nodeTypes,n=r[t];if(n)return[n];let o=[];for(let i in r){let s=r[i];s.groups.indexOf(t)>-1&&o.push(s)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function _A(e){if(e.eat("(")){let t=fE(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=OA(e,e.next).map(r=>(e.inline==null?e.inline=r.isInline:e.inline!=r.isInline&&e.err("Mixing inline and block content"),{type:"name",value:r}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function AA(e){let t=[[]];return o(i(e,0),r()),t;function r(){return t.push([])-1}function n(s,a,l){let c={term:l,to:a};return t[s].push(c),c}function o(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=r())}else if(s.type=="star"){let l=r();return n(a,l),o(i(s.expr,l),l),[n(l)]}else if(s.type=="plus"){let l=r();return o(i(s.expr,a),l),o(i(s.expr,l),l),[n(l)]}else{if(s.type=="opt")return[n(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c{e[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u{c||o.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=t[n.join(",")]=new na(n.indexOf(e.length-1)>-1);for(let s=0;s-1}allowsMarks(t){if(this.markSet==null)return!0;for(let r=0;rn[i]=new vE(i,r,s));let o=r.spec.topNode||"doc";if(!n[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let i in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};class PA{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class Nd{constructor(t,r,n,o){this.name=t,this.rank=r,this.schema=n,this.spec=o,this.attrs=gE(o.attrs),this.excluded=null;let i=hE(this.attrs);this.instance=i?new Te(this,i):null}create(t=null){return!t&&this.instance?this.instance:new Te(this,mE(this.attrs,t))}static compile(t,r){let n=Object.create(null),o=0;return t.forEach((i,s)=>n[i]=new Nd(i,o++,r,s)),n}removeFromSet(t){for(var r=0;r-1}}let zA=class{constructor(t){this.cached=Object.create(null);let r=this.spec={};for(let o in t)r[o]=t[o];r.nodes=Kt.from(t.nodes),r.marks=Kt.from(t.marks||{}),this.nodes=O1.compile(this.spec.nodes,this),this.marks=Nd.compile(this.spec.marks,this);let n=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=n[s]||(n[s]=na.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=a=="_"?null:a?nk(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:nk(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,r=null,n,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof O1){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(r,n,o)}text(t,r){let n=this.nodes.text;return new wp(n,n.defaultAttrs,t,Te.setFrom(r))}mark(t,r){return typeof t=="string"&&(t=this.marks[t]),t.create(r)}nodeFromJSON(t){return Fi.fromJSON(this,t)}markFromJSON(t){return Te.fromJSON(this,t)}nodeType(t){let r=this.nodes[t];if(!r)throw new RangeError("Unknown node type: "+t);return r}};function nk(e,t){let r=[];for(let n=0;n-1)&&r.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[n]+"'")}return r}let Mv=class _1{constructor(t,r){this.schema=t,this.rules=r,this.tags=[],this.styles=[],r.forEach(n=>{n.tag?this.tags.push(n):n.style&&this.styles.push(n)}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let o=t.nodes[n.node];return o.contentMatch.matchType(o)})}parse(t,r={}){let n=new ik(this,r,!1);return n.addAll(t,r.from,r.to),n.finish()}parseSlice(t,r={}){let n=new ik(this,r,!0);return n.addAll(t,r.from,r.to),K.maxOpen(n.finish())}matchTag(t,r,n){for(let o=n?this.tags.indexOf(n)+1:0;ot.length&&(a.charCodeAt(t.length)!=61||a.slice(t.length+1)!=r))){if(s.getAttrs){let l=s.getAttrs(r);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(t){let r=[];function n(o){let i=o.priority==null?50:o.priority,s=0;for(;s{n(s=sk(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in t.nodes){let i=t.nodes[o].spec.parseDOM;i&&i.forEach(s=>{n(s=sk(s)),s.node||s.ignore||s.mark||(s.node=o)})}return r}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new _1(t,_1.schemaRules(t)))}};const yE={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},LA={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},bE={ol:!0,ul:!0},Sp=1,Ep=2,gu=4;function ok(e,t,r){return t!=null?(t?Sp:0)|(t==="full"?Ep:0):e&&e.whitespace=="pre"?Sp|Ep:r&~gu}class nf{constructor(t,r,n,o,i,s,a){this.type=t,this.attrs=r,this.marks=n,this.pendingMarks=o,this.solid=i,this.options=a,this.content=[],this.activeMarks=Te.none,this.stashMarks=[],this.match=s||(a&gu?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let r=this.type.contentMatch.fillBefore(R.from(t));if(r)this.match=this.type.contentMatch.matchFragment(r);else{let n=this.type.contentMatch,o;return(o=n.findWrapping(t.type))?(this.match=n,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Sp)){let n=this.content[this.content.length-1],o;if(n&&n.isText&&(o=/[ \t\r\n\u000c]+$/.exec(n.text))){let i=n;n.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let r=R.from(this.content);return!t&&this.match&&(r=r.append(this.match.fillBefore(R.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}popFromStashMark(t){for(let r=this.stashMarks.length-1;r>=0;r--)if(t.eq(this.stashMarks[r]))return this.stashMarks.splice(r,1)[0]}applyPending(t){for(let r=0,n=this.pendingMarks;rthis.addAll(t)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(t,()=>{this.addElementByRule(t,i,i.consuming===!1?o:void 0)})}leafFallback(t){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(` +`))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let r=Te.none,n=Te.none;for(let o=0;o{s.clearMark(a)&&(n=a.addToSet(n))}):r=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(r),s.consuming===!1)i=s;else break}return[r,n]}addElementByRule(t,r,n){let o,i,s;r.node?(i=this.parser.schema.nodes[r.node],i.isLeaf?this.insertNode(i.create(r.attrs))||this.leafFallback(t):o=this.enter(i,r.attrs||null,r.preserveWhitespace)):(s=this.parser.schema.marks[r.mark].create(r.attrs),this.addPendingMark(s));let a=this.top;if(i&&i.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(r.getContent)this.findInside(t),r.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=t;typeof r.contentElement=="string"?l=t.querySelector(r.contentElement):typeof r.contentElement=="function"?l=r.contentElement(t):r.contentElement&&(l=r.contentElement),this.findAround(t,l,!0),this.addAll(l)}o&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(t,r,n){let o=r||0;for(let i=r?t.childNodes[r]:t.firstChild,s=n==null?null:t.childNodes[n];i!=s;i=i.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(i);this.findAtPoint(t,o)}findPlace(t){let r,n;for(let o=this.open;o>=0;o--){let i=this.nodes[o],s=i.findWrapping(t);if(s&&(!r||r.length>s.length)&&(r=s,n=i,!s.length)||i.solid)break}if(!r)return!1;this.sync(n);for(let o=0;othis.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let r=this.open;r>=0;r--)if(this.nodes[r]==t)return this.open=r,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let o=n.length-1;o>=0;o--)t+=n[o].nodeSize;r&&t++}return t}findAtPoint(t,r){if(this.find)for(let n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let r=t.split("/"),n=this.options.context,o=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(o?0:1),s=(a,l)=>{for(;a>=0;a--){let c=r[a];if(c==""){if(a==r.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&o?this.nodes[l].type:n&&l>=i?n.node(l-i).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;l--}}return!0};return s(r.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let r=t.depth;r>=0;r--){let n=t.node(r).contentMatchAt(t.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}addPendingMark(t){let r=BA(t,this.top.pendingMarks);r&&this.top.stashMarks.push(r),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,r){for(let n=this.open;n>=0;n--){let o=this.nodes[n];if(o.pendingMarks.lastIndexOf(t)>-1)o.pendingMarks=t.removeFromSet(o.pendingMarks);else{o.activeMarks=t.removeFromSet(o.activeMarks);let s=o.popFromStashMark(t);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==r)break}}}function IA(e){for(let t=e.firstChild,r=null;t;t=t.nextSibling){let n=t.nodeType==1?t.nodeName.toLowerCase():null;n&&bE.hasOwnProperty(n)&&r?(r.appendChild(t),t=r):n=="li"?r=t:n&&(r=null)}}function DA(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function $A(e){let t=/\s*([\w-]+)\s*:\s*([^;]+)/g,r,n=[];for(;r=t.exec(e);)n.push(r[1],r[2].trim());return n}function sk(e){let t={};for(let r in e)t[r]=e[r];return t}function HA(e,t){let r=t.schema.nodes;for(let n in r){let o=r[n];if(!o.allowsMarkType(e))continue;let i=[],s=a=>{i.push(a);for(let l=0;l{if(i.length||s.marks.length){let a=0,l=0;for(;a=0;o--){let i=this.serializeMark(t.marks[o],t.isInline,r);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,r,n={}){let o=this.marks[t.type.name];return o&&an.renderSpec(lg(n),o(t,r))}static renderSpec(t,r,n=null){if(typeof r=="string")return{dom:t.createTextNode(r)};if(r.nodeType!=null)return{dom:r};if(r.dom&&r.dom.nodeType!=null)return r;let o=r[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let s,a=n?t.createElementNS(n,o):t.createElement(o),l=r[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(let u in l)if(l[u]!=null){let d=u.indexOf(" ");d>0?a.setAttributeNS(u.slice(0,d),u.slice(d+1),l[u]):a.setAttribute(u,l[u])}}for(let u=c;uc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:f,contentDOM:p}=an.renderSpec(t,d,n);if(a.appendChild(f),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:a,contentDOM:s}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new an(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let r=ak(t.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(t){return ak(t.marks)}}function ak(e){let t={};for(let r in e){let n=e[r].spec.toDOM;n&&(t[r]=n)}return t}function lg(e){return e.document||window.document}const xE=65535,kE=Math.pow(2,16);function FA(e,t){return e+t*kE}function lk(e){return e&xE}function VA(e){return(e-(e&xE))/kE}const wE=1,SE=2,If=4,EE=8;class A1{constructor(t,r,n){this.pos=t,this.delInfo=r,this.recover=n}get deleted(){return(this.delInfo&EE)>0}get deletedBefore(){return(this.delInfo&(wE|If))>0}get deletedAfter(){return(this.delInfo&(SE|If))>0}get deletedAcross(){return(this.delInfo&If)>0}}class nn{constructor(t,r=!1){if(this.ranges=t,this.inverted=r,!t.length&&nn.empty)return nn.empty}recover(t){let r=0,n=lk(t);if(!this.inverted)for(let o=0;ot)break;let c=this.ranges[a+i],u=this.ranges[a+s],d=l+c;if(t<=d){let f=c?t==l?-1:t==d?1:r:r,p=l+o+(f<0?0:u);if(n)return p;let h=t==(r<0?l:d)?null:FA(a/3,t-l),m=t==l?SE:t==d?wE:If;return(r<0?t!=l:t!=d)&&(m|=EE),new A1(p,m,h)}o+=u-c}return n?t+o:new A1(t+o,0,null)}touches(t,r){let n=0,o=lk(r),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;at)break;let c=this.ranges[a+i],u=l+c;if(t<=u&&a==o*3)return!0;n+=this.ranges[a+s]-c}return!1}forEach(t){let r=this.inverted?2:1,n=this.inverted?1:2;for(let o=0,i=0;o=0;r--){let o=t.getMirror(r);this.appendMap(t.maps[r].invert(),o!=null&&o>r?n-o-1:void 0)}}invert(){let t=new ul;return t.appendMappingInverted(this),t}map(t,r=1){if(this.mirror)return this._map(t,r,!0);for(let n=this.from;ni&&l!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),r.openStart,r.openEnd);return yt.fromReplace(t,this.from,this.to,i)}invert(){return new eo(this.from,this.to,this.mark)}map(t){let r=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new Ko(r.pos,n.pos,this.mark)}merge(t){return t instanceof Ko&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ko(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ko(r.from,r.to,t.markFromJSON(r.mark))}}Rt.jsonID("addMark",Ko);class eo extends Rt{constructor(t,r,n){super(),this.from=t,this.to=r,this.mark=n}apply(t){let r=t.slice(this.from,this.to),n=new K(Tv(r.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),r.openStart,r.openEnd);return yt.fromReplace(t,this.from,this.to,n)}invert(){return new Ko(this.from,this.to,this.mark)}map(t){let r=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new eo(r.pos,n.pos,this.mark)}merge(t){return t instanceof eo&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new eo(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new eo(r.from,r.to,t.markFromJSON(r.mark))}}Rt.jsonID("removeMark",eo);class Ii extends Rt{constructor(t,r){super(),this.pos=t,this.mark=r}apply(t){let r=t.nodeAt(this.pos);if(!r)return yt.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.addToSet(r.marks));return yt.fromReplace(t,this.pos,this.pos+1,new K(R.from(n),0,r.isLeaf?0:1))}invert(t){let r=t.nodeAt(this.pos);if(r){let n=this.mark.addToSet(r.marks);if(n.length==r.marks.length){for(let o=0;on.pos?null:new bt(r.pos,n.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,r){if(typeof r.from!="number"||typeof r.to!="number"||typeof r.gapFrom!="number"||typeof r.gapTo!="number"||typeof r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new bt(r.from,r.to,r.gapFrom,r.gapTo,K.fromJSON(t,r.slice),r.insert,!!r.structure)}}Rt.jsonID("replaceAround",bt);function N1(e,t,r){let n=e.resolve(t),o=r-t,i=n.depth;for(;o>0&&i>0&&n.indexAfter(i)==n.node(i).childCount;)i--,o--;if(o>0){let s=n.node(i).maybeChild(n.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function jA(e,t,r,n){let o=[],i=[],s,a;e.doc.nodesBetween(t,r,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!n.isInSet(d)&&u.type.allowsMarkType(n.type)){let f=Math.max(c,t),p=Math.min(c+l.nodeSize,r),h=n.addToSet(d);for(let m=0;me.step(l)),i.forEach(l=>e.step(l))}function UA(e,t,r,n){let o=[],i=0;e.doc.nodesBetween(t,r,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(n instanceof Nd){let c=s.marks,u;for(;u=n.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else n?n.isInSet(s.marks)&&(l=[n]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,r);for(let u=0;ue.step(new eo(s.from,s.to,s.style)))}function WA(e,t,r,n=r.contentMatch){let o=e.doc.nodeAt(t),i=[],s=t+1;for(let a=0;a=0;a--)e.step(i[a])}function KA(e,t,r){return(t==0||e.canReplace(t,e.childCount))&&(r==e.childCount||e.canReplace(0,r))}function rc(e){let r=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let o=e.$from.node(n),i=e.$from.index(n),s=e.$to.indexAfter(n);if(nr;h--)m||n.index(h)>0?(m=!0,u=R.from(n.node(h).copy(u)),d++):l--;let f=R.empty,p=0;for(let h=i,m=!1;h>r;h--)m||o.after(h+1)=0;s--){if(n.size){let a=r[s].type.contentMatch.matchFragment(n);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=R.from(r[s].type.create(r[s].attrs,n))}let o=t.start,i=t.end;e.step(new bt(o,i,o,i,new K(n,0,0),r.length,!0))}function XA(e,t,r,n,o){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,r,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(n,o)&&QA(e.doc,e.mapping.slice(i).map(a),n)){e.clearIncompatible(e.mapping.slice(i).map(a,1),n);let l=e.mapping.slice(i),c=l.map(a,1),u=l.map(a+s.nodeSize,1);return e.step(new bt(c,u,c+1,u-1,new K(R.from(n.create(o,null,s.marks)),0,0),1,!0)),!1}})}function QA(e,t,r){let n=e.resolve(t),o=n.index();return n.parent.canReplaceWith(o,o+1,r)}function ZA(e,t,r,n,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");r||(r=i.type);let s=r.create(n,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!r.validContent(i.content))throw new RangeError("Invalid content for node type "+r.name);e.step(new bt(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new K(R.from(s),0,0),1,!0))}function dl(e,t,r=1,n){let o=e.resolve(t),i=o.depth-r,s=n&&n[n.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=r-2;c>i;c--,u--){let d=o.node(c),f=o.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=n&&n[u+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let m=n&&n[u]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(p))return!1}let a=o.indexAfter(i),l=n&&n[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function eN(e,t,r=1,n){let o=e.doc.resolve(t),i=R.empty,s=R.empty;for(let a=o.depth,l=o.depth-r,c=r-1;a>l;a--,c--){i=R.from(o.node(a).copy(i));let u=n&&n[c];s=R.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}e.step(new Dt(t,t,new K(i.append(s),r,r),!0))}function Rd(e,t){let r=e.resolve(t),n=r.index();return tN(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function tN(e,t){return!!(e&&t&&!e.isLeaf&&e.canAppend(t))}function rN(e,t,r){let n=new Dt(t-r,t+r,K.empty,!0);e.step(n)}function CE(e,t,r){let n=e.resolve(t);if(n.parent.canReplaceWith(n.index(),n.index(),r))return t;if(n.parentOffset==0)for(let o=n.depth-1;o>=0;o--){let i=n.index(o);if(n.node(o).canReplaceWith(i,i,r))return n.before(o+1);if(i>0)return null}if(n.parentOffset==n.parent.content.size)for(let o=n.depth-1;o>=0;o--){let i=n.indexAfter(o);if(n.node(o).canReplaceWith(i,i,r))return n.after(o+1);if(i=0;s--){let a=s==n.depth?0:n.pos<=(n.start(s+1)+n.end(s+1))/2?-1:1,l=n.index(s)+(a>0?1:0),c=n.node(s),u=!1;if(i==1)u=c.canReplace(l,l,o);else{let d=c.contentMatchAt(l).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?n.pos:a<0?n.before(s+1):n.after(s+1)}return null}function _v(e,t,r=t,n=K.empty){if(t==r&&!n.size)return null;let o=e.resolve(t),i=e.resolve(r);return ME(o,i,n)?new Dt(t,r,n):new oN(o,i,n).fit()}function ME(e,t,r){return!r.openStart&&!r.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),r.content)}class oN{constructor(t,r,n){this.$from=t,this.$to=r,this.unplaced=n,this.frontier=[],this.placed=R.empty;for(let o=0;o<=t.depth;o++){let i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=R.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,n=this.$from,o=this.close(t<0?this.$to:n.doc.resolve(t));if(!o)return null;let i=this.placed,s=n.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new K(i,s,a);return t>-1?new bt(n.pos,t,this.$to.pos,this.$to.end(),l,r):l.size||n.pos!=this.$to.pos?new Dt(n.pos,o.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let r=this.unplaced.content,n=0,o=this.unplaced.openEnd;n1&&(o=0),i.type.spec.isolating&&o<=n){t=n;break}r=i.content}for(let r=1;r<=2;r++)for(let n=r==1?t:this.unplaced.openStart;n>=0;n--){let o,i=null;n?(i=ug(this.unplaced.content,n-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(r==1&&(s?c.matchType(s.type)||(d=c.fillBefore(R.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:n,frontierDepth:a,parent:i,inject:d};if(r==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:n,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:t,openStart:r,openEnd:n}=this.unplaced,o=ug(t,r);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new K(t,r+1,Math.max(n,o.size+r>=t.size-n?r+1:0)),!0)}dropNode(){let{content:t,openStart:r,openEnd:n}=this.unplaced,o=ug(t,r);if(o.childCount<=1&&r>0){let i=t.size-r<=r+o.size;this.unplaced=new K(zc(t,r-1,1),r-1,i?r-1:n)}else this.unplaced=new K(zc(t,r,1),r,n)}placeNodes({sliceDepth:t,frontierDepth:r,parent:n,inject:o,wrap:i}){for(;this.depth>r;)this.closeFrontierNode();if(i)for(let m=0;m1||l==0||m.content.size)&&(d=b,u.push(TE(m.mark(f.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?p:-1)))}let h=c==a.childCount;h||(p=-1),this.placed=Lc(this.placed,r,R.from(u)),this.frontier[r].match=d,h&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,b=a;m1&&o==this.$to.end(--n);)++o;return o}findCloseLevel(t){e:for(let r=Math.min(this.depth,t.depth);r>=0;r--){let{match:n,type:o}=this.frontier[r],i=r=0;a--){let{match:l,type:c}=this.frontier[a],u=dg(t,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:r,fit:s,move:i?t.doc.resolve(t.after(r+1)):t}}}}close(t){let r=this.findCloseLevel(t);if(!r)return null;for(;this.depth>r.depth;)this.closeFrontierNode();r.fit.childCount&&(this.placed=Lc(this.placed,r.depth,r.fit)),t=r.move;for(let n=r.depth+1;n<=t.depth;n++){let o=t.node(n),i=o.type.contentMatch.fillBefore(o.content,!0,t.index(n));this.openFrontierNode(o.type,o.attrs,i)}return t}openFrontierNode(t,r=null,n){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=Lc(this.placed,this.depth,R.from(t.create(r,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let r=this.frontier.pop().match.fillBefore(R.empty,!0);r.childCount&&(this.placed=Lc(this.placed,this.frontier.length,r))}}function zc(e,t,r){return t==0?e.cutByIndex(r,e.childCount):e.replaceChild(0,e.firstChild.copy(zc(e.firstChild.content,t-1,r)))}function Lc(e,t,r){return t==0?e.append(r):e.replaceChild(e.childCount-1,e.lastChild.copy(Lc(e.lastChild.content,t-1,r)))}function ug(e,t){for(let r=0;r1&&(n=n.replaceChild(0,TE(n.firstChild,t-1,n.childCount==1?r-1:0))),t>0&&(n=e.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(e.type.contentMatch.matchFragment(n).fillBefore(R.empty,!0)))),e.copy(n)}function dg(e,t,r,n,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!r.compatibleContent(i.type))return null;let a=n.fillBefore(i.content,!0,s);return a&&!iN(r,i.content,s)?a:null}function iN(e,t,r){for(let n=r;n0;f--,p--){let h=o.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(f)>-1?a=f:o.before(f)==p&&s.splice(1,0,-f)}let l=s.indexOf(a),c=[],u=n.openStart;for(let f=n.content,p=0;;p++){let h=f.firstChild;if(c.push(h),p==n.openStart)break;f=h.content}for(let f=u-1;f>=0;f--){let p=c[f],h=sN(p.type);if(h&&!p.sameMarkup(o.node(Math.abs(a)-1)))u=f;else if(h||!p.type.isTextblock)break}for(let f=n.openStart;f>=0;f--){let p=(f+u+1)%(n.openStart+1),h=c[p];if(h)for(let m=0;m=0&&(e.replace(t,r,n),!(e.steps.length>d));f--){let p=s[f];p<0||(t=o.before(p),r=i.after(p))}}function OE(e,t,r,n,o){if(tn){let i=o.contentMatchAt(0),s=i.fillBefore(e).append(e);e=s.append(i.matchFragment(s).fillBefore(R.empty,!0))}return e}function lN(e,t,r,n){if(!n.isInline&&t==r&&e.doc.resolve(t).parent.content.size){let o=CE(e.doc,t,n.type);o!=null&&(t=r=o)}e.replaceRange(t,r,new K(R.from(n),0,0))}function cN(e,t,r){let n=e.doc.resolve(t),o=e.doc.resolve(r),i=_E(n,o);for(let s=0;s0&&(l||n.node(a-1).canReplace(n.index(a-1),o.indexAfter(a-1))))return e.delete(n.before(a),o.after(a))}for(let s=1;s<=n.depth&&s<=o.depth;s++)if(t-n.start(s)==n.depth-s&&r>n.end(s)&&o.end(s)-r!=o.depth-s)return e.delete(n.before(s),r);e.delete(t,r)}function _E(e,t){let r=[],n=Math.min(e.depth,t.depth);for(let o=n;o>=0;o--){let i=e.start(o);if(it.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(i==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==i-1)&&r.push(o)}return r}class fl extends Rt{constructor(t,r,n){super(),this.pos=t,this.attr=r,this.value=n}apply(t){let r=t.nodeAt(this.pos);if(!r)return yt.fail("No node at attribute step's position");let n=Object.create(null);for(let i in r.attrs)n[i]=r.attrs[i];n[this.attr]=this.value;let o=r.type.create(n,null,r.marks);return yt.fromReplace(t,this.pos,this.pos+1,new K(R.from(o),0,r.isLeaf?0:1))}getMap(){return nn.empty}invert(t){return new fl(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let r=t.mapResult(this.pos,1);return r.deletedAfter?null:new fl(r.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,r){if(typeof r.pos!="number"||typeof r.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new fl(r.pos,r.attr,r.value)}}Rt.jsonID("attr",fl);class Iu extends Rt{constructor(t,r){super(),this.attr=t,this.value=r}apply(t){let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let n=t.type.create(r,t.content,t.marks);return yt.ok(n)}getMap(){return nn.empty}invert(t){return new Iu(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,r){if(typeof r.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Iu(r.attr,r.value)}}Rt.jsonID("docAttr",Iu);let _l=class extends Error{};_l=function e(t){let r=Error.call(this,t);return r.__proto__=e.prototype,r};_l.prototype=Object.create(Error.prototype);_l.prototype.constructor=_l;_l.prototype.name="TransformError";class uN{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new ul}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let r=this.maybeStep(t);if(r.failed)throw new _l(r.failed);return this}maybeStep(t){let r=t.apply(this.doc);return r.failed||this.addStep(t,r.doc),r}get docChanged(){return this.steps.length>0}addStep(t,r){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=r}replace(t,r=t,n=K.empty){let o=_v(this.doc,t,r,n);return o&&this.step(o),this}replaceWith(t,r,n){return this.replace(t,r,new K(R.from(n),0,0))}delete(t,r){return this.replace(t,r,K.empty)}insert(t,r){return this.replaceWith(t,t,r)}replaceRange(t,r,n){return aN(this,t,r,n),this}replaceRangeWith(t,r,n){return lN(this,t,r,n),this}deleteRange(t,r){return cN(this,t,r),this}lift(t,r){return qA(this,t,r),this}join(t,r=1){return rN(this,t,r),this}wrap(t,r){return JA(this,t,r),this}setBlockType(t,r=t,n,o=null){return XA(this,t,r,n,o),this}setNodeMarkup(t,r,n=null,o){return ZA(this,t,r,n,o),this}setNodeAttribute(t,r,n){return this.step(new fl(t,r,n)),this}setDocAttribute(t,r){return this.step(new Iu(t,r)),this}addNodeMark(t,r){return this.step(new Ii(t,r)),this}removeNodeMark(t,r){if(!(r instanceof Te)){let n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(r=r.isInSet(n.marks),!r)return this}return this.step(new Ol(t,r)),this}split(t,r=1,n){return eN(this,t,r,n),this}addMark(t,r,n){return jA(this,t,r,n),this}removeMark(t,r,n){return UA(this,t,r,n),this}clearIncompatible(t,r,n){return WA(this,t,r,n),this}}const fg=Object.create(null);class be{constructor(t,r,n){this.$anchor=t,this.$head=r,this.ranges=n||[new dN(t.min(r),t.max(r))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let r=0;r=0;i--){let s=r<0?Fa(t.node(0),t.node(i),t.before(i+1),t.index(i),r,n):Fa(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,r,n);if(s)return s}return null}static near(t,r=1){return this.findFrom(t,r)||this.findFrom(t,-r)||new kr(t.node(0))}static atStart(t){return Fa(t,t,0,0,1)||new kr(t)}static atEnd(t){return Fa(t,t,t.content.size,t.childCount,-1)||new kr(t)}static fromJSON(t,r){if(!r||!r.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=fg[r.type];if(!n)throw new RangeError(`No selection type ${r.type} defined`);return n.fromJSON(t,r)}static jsonID(t,r){if(t in fg)throw new RangeError("Duplicate use of selection JSON ID "+t);return fg[t]=r,r.prototype.jsonID=t,r}getBookmark(){return le.between(this.$anchor,this.$head).getBookmark()}}be.prototype.visible=!0;class dN{constructor(t,r){this.$from=t,this.$to=r}}let uk=!1;function dk(e){!uk&&!e.parent.inlineContent&&(uk=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class le extends be{constructor(t,r=t){dk(t),dk(r),super(t,r)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,r){let n=t.resolve(r.map(this.head));if(!n.parent.inlineContent)return be.near(n);let o=t.resolve(r.map(this.anchor));return new le(o.parent.inlineContent?o:n,n)}replace(t,r=K.empty){if(super.replace(t,r),r==K.empty){let n=this.$from.marksAcross(this.$to);n&&t.ensureMarks(n)}}eq(t){return t instanceof le&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new zh(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,r){if(typeof r.anchor!="number"||typeof r.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new le(t.resolve(r.anchor),t.resolve(r.head))}static create(t,r,n=r){let o=t.resolve(r);return new this(o,n==r?o:t.resolve(n))}static between(t,r,n){let o=t.pos-r.pos;if((!n||o)&&(n=o>=0?1:-1),!r.parent.inlineContent){let i=be.findFrom(r,n,!0)||be.findFrom(r,-n,!0);if(i)r=i.$head;else return be.near(r,n)}return t.parent.inlineContent||(o==0?t=r:(t=(be.findFrom(t,-n,!0)||be.findFrom(t,n,!0)).$anchor,t.pos0?0:1);o>0?s=0;s+=o){let a=t.child(s);if(a.isAtom){if(!i&&ce.isSelectable(a))return ce.create(e,r-(o<0?a.nodeSize:0))}else{let l=Fa(e,a,r+o,o<0?a.childCount:0,o,i);if(l)return l}r+=a.nodeSize*o}return null}function fk(e,t,r){let n=e.steps.length-1;if(n{s==null&&(s=u)}),e.setSelection(be.near(e.doc.resolve(s),r))}const pk=1,of=2,hk=4;class pN extends uN{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=of,this}ensureMarks(t){return Te.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&of)>0}addStep(t,r){super.addStep(t,r),this.updated=this.updated&~of,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,r=!0){let n=this.selection;return r&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Te.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,r,n){let o=this.doc.type.schema;if(r==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(n==null&&(n=r),n=n??r,!t)return this.deleteRange(r,n);let i=this.storedMarks;if(!i){let s=this.doc.resolve(r);i=n==r?s.marks():s.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(r,n,o.text(t,i)),this.selection.empty||this.setSelection(be.near(this.selection.$to)),this}}setMeta(t,r){return this.meta[typeof t=="string"?t:t.key]=r,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=hk,this}get scrolledIntoView(){return(this.updated&hk)>0}}function mk(e,t){return!t||!e?e:e.bind(t)}class Ic{constructor(t,r,n){this.name=t,this.init=mk(r.init,n),this.apply=mk(r.apply,n)}}const hN=[new Ic("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Ic("selection",{init(e,t){return e.selection||be.atStart(t.doc)},apply(e){return e.selection}}),new Ic("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,r,n){return n.selection.$cursor?e.storedMarks:null}}),new Ic("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class pg{constructor(t,r){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=hN.slice(),r&&r.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new Ic(n.key,n.spec.state,n))})}}class Hs{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,r=-1){for(let n=0;nn.toJSON())),t&&typeof t=="object")for(let n in t){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[n],i=o.spec.state;i&&i.toJSON&&(r[n]=i.toJSON.call(o,this[o.key]))}return r}static fromJSON(t,r,n){if(!r)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new pg(t.schema,t.plugins),i=new Hs(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=Fi.fromJSON(t.schema,r.doc);else if(s.name=="selection")i.selection=be.fromJSON(i.doc,r.selection);else if(s.name=="storedMarks")r.storedMarks&&(i.storedMarks=r.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let a in n){let l=n[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(r,a)){i[s.name]=c.fromJSON.call(l,t,r[a],i);return}}i[s.name]=s.init(t,i)}}),i}}function AE(e,t,r){for(let n in e){let o=e[n];o instanceof Function?o=o.bind(t):n=="handleDOMEvents"&&(o=AE(o,t,{})),r[n]=o}return r}class Ro{constructor(t){this.spec=t,this.props={},t.props&&AE(t.props,this,this.props),this.key=t.key?t.key.key:NE("plugin")}getState(t){return t[this.key]}}const hg=Object.create(null);function NE(e){return e in hg?e+"$"+ ++hg[e]:(hg[e]=0,e+"$")}class ka{constructor(t="key"){this.key=NE(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}var mN=/[A-Z]/g,gN=/^ms-/,mg={};function vN(e){return"-"+e.toLowerCase()}function yN(e){if(mg.hasOwnProperty(e))return mg[e];var t=e.replace(mN,vN);return mg[e]=gN.test(t)?"-"+t:t}function bN(e){return yN(e)}function xN(e,t){return bN(e)+":"+t}function kN(e){var t="";for(var r in e){var n=e[r];typeof n!="string"&&typeof n!="number"||(t&&(t+=";"),t+=xN(r,n))}return t}function wN(){return typeof document<"u"?document:null}var RE=wN;function PE(e,t){if(typeof e!="string")return[e];var r=[e];typeof t=="string"||Array.isArray(t)?t={brackets:t}:t||(t={});var n=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],o=t.escape||"___",i=!!t.flat;n.forEach(function(l){var c=new RegExp(["\\",l[0],"[^\\",l[0],"\\",l[1],"]*\\",l[1]].join("")),u=[];function d(f,p,h){var m=r.push(f.slice(l[0].length,-l[1].length))-1;return u.push(m),o+m+o}r.forEach(function(f,p){for(var h,m=0;f!=h;)if(h=f,f=f.replace(c,d),m++>1e4)throw Error("References have circular dependency. Please, check them.");r[p]=f}),u=u.reverse(),r=r.map(function(f){return u.forEach(function(p){f=f.replace(new RegExp("(\\"+o+p+"\\"+o+")","g"),l[0]+"$1"+l[1])}),f})});var s=new RegExp("\\"+o+"([0-9]+)\\"+o);function a(l,c,u){for(var d=[],f,p=0;f=s.exec(l);){if(p++>1e4)throw Error("Circular references in parenthesis");d.push(l.slice(0,f.index)),d.push(a(c[f[1]],c)),l=l.slice(f.index+f[0].length)}return d.push(l),d}return i?r:a(r[0],r)}function zE(e,t){if(t&&t.flat){var r=t&&t.escape||"___",n=e[0],o;if(!n)return"";for(var i=new RegExp("\\"+r+"([0-9]+)\\"+r),s=0;n!=o;){if(s++>1e4)throw Error("Circular references in "+e);o=n,n=n.replace(i,a)}return n}return e.reduce(function l(c,u){return Array.isArray(u)&&(u=u.reduce(l,"")),c+u},"");function a(l,c){if(e[c]==null)throw Error("Reference "+c+"is undefined");return e[c]}}function Nv(e,t){return Array.isArray(e)?zE(e,t):PE(e,t)}Nv.parse=PE;Nv.stringify=zE;var SN=Nv;const EN=Dn(SN),CN={id:"extension.command.copy.label",message:"Copy",comment:"Label for copy command."},MN={id:"extension.command.copy.description",message:"Copy the selected text",comment:"Description for copy command."},TN={id:"extension.command.cut.label",message:"Cut",comment:"Label for cut command."},ON={id:"extension.command.cut.description",message:"Cut the selected text",comment:"Description for cut command."},_N={id:"extension.command.paste.label",message:"Paste",comment:"Label for paste command."},AN={id:"extension.command.paste.description",message:"Paste content into the editor",comment:"Description for paste command."},NN={id:"extension.command.select-all.label",message:"Select all",comment:"Label for select all command."},RN={id:"extension.command.select-all.description",message:"Select all content within the editor",comment:"Description for select all command."};var ts=Object.freeze({__proto__:null,COPY_DESCRIPTION:MN,COPY_LABEL:CN,CUT_DESCRIPTION:ON,CUT_LABEL:TN,PASTE_DESCRIPTION:AN,PASTE_LABEL:_N,SELECT_ALL_DESCRIPTION:RN,SELECT_ALL_LABEL:NN});const PN={id:"keyboard.shortcut.escape",message:"Enter",comment:"Label for escape key in shortcuts."},zN={id:"keyboard.shortcut.command",message:"Command",comment:"Label for command key in shortcuts."},LN={id:"keyboard.shortcut.control",message:"Control",comment:"Label for control key in shortcuts."},IN={id:"keyboard.shortcut.enter",message:"Enter",comment:"Label for enter key in shortcuts."},DN={id:"keyboard.shortcut.shift",message:"Shift",comment:"Label for shift key in shortcuts."},$N={id:"keyboard.shortcut.alt",message:"Alt",comment:"Label for alt key in shortcuts."},HN={id:"keyboard.shortcut.capsLock",message:"Caps Lock",comment:"Label for caps lock key in shortcuts."},BN={id:"keyboard.shortcut.backspace",message:"Backspace",comment:"Label for backspace key in shortcuts."},FN={id:"keyboard.shortcut.tab",message:"Tab",comment:"Label for tab key in shortcuts."},VN={id:"keyboard.shortcut.space",message:"Space",comment:"Label for space key in shortcuts."},jN={id:"keyboard.shortcut.delete",message:"Delete",comment:"Label for delete key in shortcuts."},UN={id:"keyboard.shortcut.pageUp",message:"Page Up",comment:"Label for page up key in shortcuts."},WN={id:"keyboard.shortcut.pageDown",message:"Page Down",comment:"Label for page down key in shortcuts."},KN={id:"keyboard.shortcut.home",message:"Home",comment:"Label for home key in shortcuts."},qN={id:"keyboard.shortcut.end",message:"End",comment:"Label for end key in shortcuts."},GN={id:"keyboard.shortcut.arrowLeft",message:"Arrow Left",comment:"Label for arrow left key in shortcuts."},YN={id:"keyboard.shortcut.arrowRight",message:"Arrow Right",comment:"Label for arrow right key in shortcuts."},JN={id:"keyboard.shortcut.arrowUp",message:"Arrow Up",comment:"Label for arrow up key in shortcuts."},XN={id:"keyboard.shortcut.arrowDown",message:"Arrow Down",comment:"Label for arrowDown key in shortcuts."};var Mt=Object.freeze({__proto__:null,ALT_KEY:$N,ARROW_DOWN_KEY:XN,ARROW_LEFT_KEY:GN,ARROW_RIGHT_KEY:YN,ARROW_UP_KEY:JN,BACKSPACE_KEY:BN,CAPS_LOCK_KEY:HN,COMMAND_KEY:zN,CONTROL_KEY:LN,DELETE_KEY:jN,END_KEY:qN,ENTER_KEY:IN,ESCAPE_KEY:PN,HOME_KEY:KN,PAGE_DOWN_KEY:WN,PAGE_UP_KEY:UN,SHIFT_KEY:DN,SPACE_KEY:VN,TAB_KEY:FN});const QN={id:"extension.command.toggle-blockquote.label",message:"Blockquote",comment:"Label for blockquote formatting command."},ZN={id:"extension.command.toggle-blockquote.description",message:"Add blockquote formatting to the selected text",comment:"Description for blockquote formatting command."};var gk=Object.freeze({__proto__:null,DESCRIPTION:ZN,LABEL:QN});const eR={id:"extension.command.toggle-bold.label",message:"Bold",comment:"Label for bold formatting command."},tR={id:"extension.command.toggle-bold.description",message:"Add bold formatting to the selected text",comment:"Description for bold formatting command."};var vk=Object.freeze({__proto__:null,DESCRIPTION:tR,LABEL:eR});const rR={id:"extension.command.toggle-code-block.label",message:"Codeblock",comment:"Label for the code block command."},nR={id:"extension.command.toggle-code-block.description",message:"Add a code block",comment:"Description for the code block command."};var oR=Object.freeze({__proto__:null,DESCRIPTION:nR,LABEL:rR});const iR={id:"extension.command.toggle-code.label",message:"Code",comment:"Label for the inline code formatting."},sR={id:"extension.command.toggle-code.description",message:"Add inline code formatting to the selected text",comment:"Description for the inline code formatting command."};var aR=Object.freeze({__proto__:null,DESCRIPTION:sR,LABEL:iR});const lR={id:"extension.command.set-font-size.label",message:"Font size",comment:"Label for adding a font size."},cR={id:"extension.command.set-font-size.description",message:"Set the font size for the selected text.",comment:"Description for adding a font size."},uR={id:"extension.command.increase-font-size.label",message:"Increase",comment:"Label for increasing the font size."},dR={id:"extension.command.increase-font-size.description",message:"Increase the font size",comment:"Description for increasing the font size."},fR={id:"extension.command.decrease-font-size.label",message:"Decrease",comment:"Label for decreasing the font size."},pR={id:"extension.command.decrease-font-size.description",message:"Decrease the font size.",comment:"Description for decreasing the font size."};var Al=Object.freeze({__proto__:null,DECREASE_DESCRIPTION:pR,DECREASE_LABEL:fR,INCREASE_DESCRIPTION:dR,INCREASE_LABEL:uR,SET_DESCRIPTION:cR,SET_LABEL:lR});const hR={id:"extension.command.toggle-heading.label",message:`{level, select, 1 {Heading 1} 2 {Heading 2} 3 {Heading 3} 4 {Heading 4} 5 {Heading 5} 6 {Heading 6} -other {Heading}}`,comment:"Label for heading command with support for levels."};var hR=Object.freeze({__proto__:null,LABEL:pR});const mR={id:"extension.command.undo.label",message:"Undo",comment:"Label for undo."},gR={id:"extension.command.undo.description",message:"Undo the most recent action",comment:"Description for undo."},vR={id:"extension.command.redo.label",message:"Redo",comment:"Label for redo."},yR={id:"extension.command.redo.description",message:"Redo the most recent action",comment:"Description for redo."};var Ep=Object.freeze({__proto__:null,REDO_DESCRIPTION:yR,REDO_LABEL:vR,UNDO_DESCRIPTION:gR,UNDO_LABEL:mR});const bR={id:"extension.command.insert-horizontal-rule.label",message:"Divider",comment:"Label for inserting a horizontal rule (divider) command."},xR={id:"extension.command.insert-horizontal-rule.description",message:"Separate content with a diving horizontal line",comment:"Description for inserting a horizontal rule (divider) command."};var vk=Object.freeze({__proto__:null,DESCRIPTION:xR,LABEL:bR});const kR={id:"extension.command.toggle-italic.label",message:"Italic",comment:"Label for italic formatting command."},wR={id:"extension.command.toggle-italic.description",message:"Italicize the selected text",comment:"Description for italic formatting command."};var yk=Object.freeze({__proto__:null,DESCRIPTION:wR,LABEL:kR});const SR={id:"extension.command.toggle-ordered-list.label",message:"Ordered list",comment:"Label for inserting an ordered list into the editor."},ER={id:"extension.command.toggle-bullet-list.description",message:"Bulleted list",comment:"Description for inserting a bullet list into the editor."},CR={id:"extension.command.toggle-task-list.description",message:"Tasked list",comment:"Description for inserting a task list into the editor."};var Nv=Object.freeze({__proto__:null,BULLET_LIST_LABEL:ER,ORDERED_LIST_LABEL:SR,TASK_LIST_LABEL:CR});const MR={id:"extension.command.increase-indent.label",message:"Increase indentation",comment:"Label for increasing the indentation level."},TR={id:"extension.command.decrease-indent.label",message:"Decrease indentation",comment:"Label for decreasing the indentation level of the current node block."},OR={id:"extension.command.center-align.label",message:"Center align",comment:"Center align the text in the current node."},_R={id:"extension.command.justify-align.label",message:"Justify",comment:"Justify the alignment of the selected nodes."},AR={id:"extension.command.right-align.label",message:"Right align",comment:"Right align the selected nodes."},NR={id:"extension.command.left-align.label",message:"Left align",comment:"Left align the selected nodes."};var nc=Object.freeze({__proto__:null,CENTER_ALIGN_LABEL:OR,DECREASE_INDENT_LABEL:TR,INCREASE_INDENT_LABEL:MR,JUSTIFY_ALIGN_LABEL:_R,LEFT_ALIGN_LABEL:NR,RIGHT_ALIGN_LABEL:AR});const RR={id:"extension.command.insert-paragraph.label",message:"Insert Paragraph",comment:"Label for inserting a paragraph."},PR={id:"extension.command.insert-paragraph.description",message:"Insert a new paragraph",comment:"Description for inserting a paragraph."},zR={id:"extension.command.convert-paragraph.label",message:"Convert Paragraph",comment:"Label for converting the current node into a paragraph."},LR={id:"extension.command.convert-paragraph.description",message:"Convert current block into a paragraph block.",comment:"Description for converting a paragraph."};var Cp=Object.freeze({__proto__:null,CONVERT_DESCRIPTION:LR,CONVERT_LABEL:zR,INSERT_DESCRIPTION:PR,INSERT_LABEL:RR});const IR={id:"extension.command.toggle-strike.label",message:"Strikethrough",comment:"Label for strike formatting command."},DR={id:"extension.command.toggle-strike.description",message:"Strikethrough the selected text",comment:"Description for strike formatting command."};var bk=Object.freeze({__proto__:null,DESCRIPTION:DR,LABEL:IR});const $R={id:"extension.command.toggle-underline.label",message:"Underline",comment:"Label for underline formatting command."},HR={id:"extension.command.toggle-underline.description",message:"Underline the selected text",comment:"Description for underline formatting command."};var xk=Object.freeze({__proto__:null,DESCRIPTION:HR,LABEL:$R});class wa{constructor(t,r){this.match=t,this.match=t,this.handler=typeof r=="string"?BR(r):r}}function BR(e){return function(t,r,n,o){let i=e;if(r[1]){let s=r[0].lastIndexOf(r[1]);i+=r[0].slice(s+r[1].length),n+=s;let a=n-o;a>0&&(i=r[0].slice(s-a,s)+i,n=o)}return t.tr.insertText(i,n,o)}}const FR=500;function VR({rules:e}){let t=new Ro({state:{init(){return null},apply(r,n){let o=r.getMeta(this);return o||(r.selectionSet||r.docChanged?null:n)}},props:{handleTextInput(r,n,o,i){return kk(r,n,o,i,e,t)},handleDOMEvents:{compositionend:r=>{setTimeout(()=>{let{$cursor:n}=r.state.selection;n&&kk(r,n.pos,n.pos,"",e,t)})}}},isInputRules:!0});return t}function kk(e,t,r,n,o,i){if(e.composing)return!1;let s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;let l=a.parent.textBetween(Math.max(0,a.parentOffset-FR),a.parentOffset,null,"")+n;for(let c=0;c{let r=e.plugins;for(let n=0;n=0;l--)s.step(a.steps[l].invert(a.docs[l]));if(i.text){let l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,e.schema.text(i.text,l))}else s.delete(i.from,i.to);t(s)}return!0}}return!1};function zh(e,t,r=null,n){return new wa(e,(o,i,s,a)=>{let l=r instanceof Function?r(i):r,c=o.tr.delete(s,a),u=c.doc.resolve(s),d=u.blockRange(),f=d&&Tv(d,t,l);if(!f)return null;c.wrap(d,f);let p=c.doc.resolve(s-1).nodeBefore;return p&&p.type==t&&Rd(c.doc,s-1)&&(!n||n(i,p))&&c.join(s-1),c})}function UR(e,t,r=null){return new wa(e,(n,o,i,s)=>{let a=n.doc.resolve(i),l=r instanceof Function?r(o):r;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t)?n.tr.delete(i,s).setBlockType(i,i,t,l):null})}const br=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Du=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let wk=null;const Fo=function(e,t,r){let n=wk||(wk=document.createRange());return n.setEnd(e,r??e.nodeValue.length),n.setStart(e,t||0),n},ia=function(e,t,r,n){return r&&(Sk(e,t,r,n,-1)||Sk(e,t,r,n,1))},WR=/^(img|br|input|textarea|hr)$/i;function Sk(e,t,r,n,o){for(;;){if(e==r&&t==n)return!0;if(t==(o<0?0:yo(e))){let i=e.parentNode;if(!i||i.nodeType!=1||Rv(e)||WR.test(e.nodeName)||e.contentEditable=="false")return!1;t=br(e)+(o<0?0:1),e=i}else if(e.nodeType==1){if(e=e.childNodes[t+(o<0?-1:0)],e.contentEditable=="false")return!1;t=o<0?yo(e):0}else return!1}}function yo(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function KR(e,t,r){for(let n=t==0,o=t==yo(e);n||o;){if(e==r)return!0;let i=br(e);if(e=e.parentNode,!e)return!1;n=n&&i==0,o=o&&i==yo(e)}}function Rv(e){let t;for(let r=e;r&&!(t=r.pmViewDesc);r=r.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const Lh=function(e){return e.focusNode&&ia(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function $s(e,t){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=e,r.key=r.code=t,r}function qR(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function GR(e,t,r){if(e.caretPositionFromPoint)try{let n=e.caretPositionFromPoint(t,r);if(n)return{node:n.offsetNode,offset:n.offset}}catch{}if(e.caretRangeFromPoint){let n=e.caretRangeFromPoint(t,r);if(n)return{node:n.startContainer,offset:n.startOffset}}}const To=typeof navigator<"u"?navigator:null,Ek=typeof document<"u"?document:null,ms=To&&To.userAgent||"",N1=/Edge\/(\d+)/.exec(ms),zE=/MSIE \d/.exec(ms),R1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ms),Ir=!!(zE||R1||N1),Fi=zE?document.documentMode:R1?+R1[1]:N1?+N1[1]:0,oo=!Ir&&/gecko\/(\d+)/i.test(ms);oo&&+(/Firefox\/(\d+)/.exec(ms)||[0,0])[1];const P1=!Ir&&/Chrome\/(\d+)/.exec(ms),dr=!!P1,YR=P1?+P1[1]:0,Sr=!Ir&&!!To&&/Apple Computer/.test(To.vendor),Nl=Sr&&(/Mobile\/\w+/.test(ms)||!!To&&To.maxTouchPoints>2),wn=Nl||(To?/Mac/.test(To.platform):!1),JR=To?/Win/.test(To.platform):!1,Jn=/Android \d/.test(ms),Pd=!!Ek&&"webkitFontSmoothing"in Ek.documentElement.style,XR=Pd?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function QR(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Lo(e,t){return typeof e=="number"?e:e[t]}function ZR(e){let t=e.getBoundingClientRect(),r=t.width/e.offsetWidth||1,n=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*r,top:t.top,bottom:t.top+e.clientHeight*n}}function Ck(e,t,r){let n=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=r||e.dom;s;s=Du(s)){if(s.nodeType!=1)continue;let a=s,l=a==i.body,c=l?QR(i):ZR(a),u=0,d=0;if(t.topc.bottom-Lo(n,"bottom")&&(d=t.bottom-t.top>c.bottom-c.top?t.top+Lo(o,"top")-c.top:t.bottom-c.bottom+Lo(o,"bottom")),t.leftc.right-Lo(n,"right")&&(u=t.right-c.right+Lo(o,"right")),u||d)if(l)i.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let h=a.scrollLeft-f,m=a.scrollTop-p;t={left:t.left-h,top:t.top-m,right:t.right-h,bottom:t.bottom-m}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function eP(e){let t=e.dom.getBoundingClientRect(),r=Math.max(0,t.top),n,o;for(let i=(t.left+t.right)/2,s=r+1;s=r-20){n=a,o=l.top;break}}return{refDOM:n,refTop:o,stack:LE(e.dom)}}function LE(e){let t=[],r=e.ownerDocument;for(let n=e;n&&(t.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),e!=r);n=Du(n));return t}function tP({refDOM:e,refTop:t,stack:r}){let n=e?e.getBoundingClientRect().top:0;IE(r,n==0?0:n-t)}function IE(e,t){for(let r=0;r=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);let m=h.left>t.left?h.left-t.left:h.right=(h.left+h.right)/2?1:0));continue}}else h.top>t.top&&!l&&h.left<=t.left&&h.right>=t.left&&(l=u,c={left:Math.max(h.left,Math.min(h.right,t.left)),top:h.top});!r&&(t.left>=h.right&&t.top>=h.top||t.left>=h.left&&t.top>=h.bottom)&&(i=d+1)}}return!r&&l&&(r=l,o=c,n=0),r&&r.nodeType==3?nP(r,o):!r||n&&r.nodeType==1?{node:e,offset:i}:DE(r,o)}function nP(e,t){let r=e.nodeValue.length,n=document.createRange();for(let o=0;o=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}function Pv(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function oP(e,t){let r=e.parentNode;return r&&/^li$/i.test(r.nodeName)&&t.left(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(n,o,i)}function sP(e,t,r,n){let o=-1;for(let i=t,s=!1;i!=e.dom;){let a=e.docView.nearestDesc(i,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent&&!s||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&!s&&(s=!0,l.left>n.left||l.top>n.top?o=a.posBefore:(l.right-1?o:e.docView.posFromDOM(t,r,-1)}function $E(e,t,r){let n=e.childNodes.length;if(n&&r.topt.top&&o++}let c;Pd&&o&&n.nodeType==1&&(c=n.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=t.top&&o--,n==e.dom&&o==n.childNodes.length-1&&n.lastChild.nodeType==1&&t.top>n.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(o==0||n.nodeType!=1||n.childNodes[o-1].nodeName!="BR")&&(a=sP(e,n,o,t))}a==null&&(a=iP(e,s,t));let l=e.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Mk(e){return e.top=0&&o==n.nodeValue.length?(l--,u=1):r<0?l--:c++,yc(ki(Fo(n,l,c),u),u<0)}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(i==null&&o&&(r<0||o==yo(n))){let l=n.childNodes[o-1];if(l.nodeType==1)return mg(l.getBoundingClientRect(),!1)}if(i==null&&o=0)}if(i==null&&o&&(r<0||o==yo(n))){let l=n.childNodes[o-1],c=l.nodeType==3?Fo(l,yo(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return yc(ki(c,1),!1)}if(i==null&&o=0)}function yc(e,t){if(e.width==0)return e;let r=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:r,right:r}}function mg(e,t){if(e.height==0)return e;let r=t?e.top:e.bottom;return{top:r,bottom:r,left:e.left,right:e.right}}function BE(e,t,r){let n=e.state,o=e.root.activeElement;n!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return r()}finally{n!=t&&e.updateState(n),o!=e.dom&&o&&o.focus()}}function cP(e,t,r){let n=t.selection,o=r=="up"?n.$from:n.$to;return BE(e,t,()=>{let{node:i}=e.docView.domFromPos(o.pos,r=="up"?-1:1);for(;;){let a=e.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=HE(e,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Fo(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(r=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const uP=/[\u0590-\u08ac]/;function dP(e,t,r){let{$head:n}=t.selection;if(!n.parent.isTextblock)return!1;let o=n.parentOffset,i=!o,s=o==n.parent.content.size,a=e.domSelection();return!uP.test(n.parent.textContent)||!a.modify?r=="left"||r=="backward"?i:s:BE(e,t,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=e.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",r,"character");let p=n.depth?e.docView.domAfterPos(n.before()):e.dom,{focusNode:h,focusOffset:m}=e.domSelectionRange(),b=h&&!p.contains(h.nodeType==1?h:h.parentNode)||l==h&&c==m;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),b})}let Tk=null,Ok=null,_k=!1;function fP(e,t,r){return Tk==t&&Ok==r?_k:(Tk=t,Ok=r,_k=r=="up"||r=="down"?cP(e,t,r):dP(e,t,r))}const _n=0,Ak=1,Fs=2,Oo=3;class zd{constructor(t,r,n,o){this.parent=t,this.children=r,this.dom=n,this.contentDOM=o,this.dirty=_n,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,r,n){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let r=0;rbr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(r==0)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&r==t.childNodes.length)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??n>0?this.posAtEnd:this.posAtStart}nearestDesc(t,r=!1){for(let n=!0,o=t;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!r||i.node))if(n&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(t.nodeType==1?t:t.parentNode):s==t))n=!1;else return i}}getDesc(t){let r=t.pmViewDesc;for(let n=r;n;n=n.parent)if(n==this)return r}posFromDOM(t,r,n){for(let o=t;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(t,r,n)}return-1}descAt(t){for(let r=0,n=0;rt||s instanceof VE){o=t-i;break}i=a}if(o)return this.children[n].domFromPos(o-this.children[n].border,r);for(let i;n&&!(i=this.children[n-1]).size&&i instanceof FE&&i.side>=0;n--);if(r<=0){let i,s=!0;for(;i=n?this.children[n-1]:null,!(!i||i.dom.parentNode==this.contentDOM);n--,s=!1);return i&&r&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,r):{node:this.contentDOM,offset:i?br(i.dom)+1:0}}else{let i,s=!0;for(;i=n=u&&r<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,r,u);t=s;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=br(f.dom)+1;break}t-=f.size}o==-1&&(o=0)}if(o>-1&&(c>r||a==this.children.length-1)){r=c;for(let u=a+1;up&&sr){let p=a;a=l,l=p}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,r){for(let n=0,o=0;o=n:tn){let a=n+i.border,l=s-i.border;if(t>=a&&r<=l){this.dirty=t==n||r==s?Fs:Ak,t==a&&r==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Oo:i.markDirty(t-a,r-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Fs:Oo}n=s}this.dirty=Fs}markParentsDirty(){let t=1;for(let r=this.parent;r;r=r.parent,t++){let n=t==1?Fs:Ak;r.dirty{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!r.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=r,this.widget=r,i=this}matchesWidget(t){return this.dirty==_n&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let r=this.widget.spec.stopEvent;return r?r(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class pP extends zd{constructor(t,r,n,o){super(t,[],r,null),this.textDOM=n,this.text=o}get size(){return this.text.length}localPosFromDOM(t,r){return t!=this.textDOM?this.posAtStart+(r?this.size:0):this.posAtStart+r}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class sa extends zd{constructor(t,r,n,o){super(t,[],n,o),this.mark=r}static create(t,r,n,o){let i=o.nodeViews[r.type.name],s=i&&i(r,o,n);return(!s||!s.dom)&&(s=an.renderSpec(document,r.type.spec.toDOM(r,n))),new sa(t,r,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&Oo||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Oo&&this.mark.eq(t)}markDirty(t,r){if(super.markDirty(t,r),this.dirty!=_n){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty0&&(i=I1(i,0,t,n));for(let a=0;a{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},n,o),u=c&&c.dom,d=c&&c.contentDOM;if(r.isText){if(!u)u=document.createTextNode(r.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=an.renderSpec(document,r.type.spec.toDOM(r)));!d&&!r.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),r.type.spec.draggable&&(u.draggable=!0));let f=u;return u=WE(u,n,r),c?l=new hP(t,r,n,o,u,d||null,f,c,i,s+1):r.isText?new Ih(t,r,n,o,u,f,i):new Vi(t,r,n,o,u,d||null,f,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let n=this.children[r];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}t.contentElement||(t.getContent=()=>R.empty)}return t}matchesNode(t,r,n){return this.dirty==_n&&t.eq(this.node)&&L1(r,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,r){let n=this.node.inlineContent,o=r,i=t.composing?this.localCompositionInfo(t,r):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new gP(this,s&&s.node,t);bP(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,n,t):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?Te.none:this.node.child(u).marks,n,t),l.placeWidget(c,t,o)},(c,u,d,f)=>{l.syncToMarks(c.marks,n,t);let p;l.findNodeMatch(c,u,d,f)||a&&t.state.selection.from>o&&t.state.selection.to-1&&l.updateNodeAt(c,u,d,p,t)||l.updateNextNode(c,u,d,t,f,o)||l.addNode(c,u,d,t,o),o+=c.nodeSize}),l.syncToMarks([],n,t),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Fs)&&(s&&this.protectLocalComposition(t,s),jE(this.contentDOM,this.children,t),Nl&&xP(this.dom))}localCompositionInfo(t,r){let{from:n,to:o}=t.state.selection;if(!(t.state.selection instanceof le)||nr+this.node.content.size)return null;let i=t.domSelectionRange(),s=kP(i.focusNode,i.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,l=wP(this.node.content,a,n-r,o-r);return l<0?null:{node:s,pos:l,text:a}}else return{node:s,pos:-1,text:""}}protectLocalComposition(t,{node:r,pos:n,text:o}){if(this.getDesc(r))return;let i=r;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new pP(this,i,r,o);t.input.compositionNodes.push(s),this.children=I1(this.children,n,n+o.length,t,s)}update(t,r,n,o){return this.dirty==Oo||!t.sameMarkup(this.node)?!1:(this.updateInner(t,r,n,o),!0)}updateInner(t,r,n,o){this.updateOuterDeco(r),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=_n}updateOuterDeco(t){if(L1(t,this.outerDeco))return;let r=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=UE(this.dom,this.nodeDOM,z1(this.outerDeco,this.node,r),z1(t,this.node,r)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Nk(e,t,r,n,o){WE(n,t,e);let i=new Vi(void 0,e,t,r,n,n,n,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Ih extends Vi{constructor(t,r,n,o,i,s,a){super(t,r,n,o,i,null,s,a,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,r,n,o){return this.dirty==Oo||this.dirty!=_n&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(r),(this.dirty!=_n||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=t,this.dirty=_n,!0)}inParent(){let t=this.parent.contentDOM;for(let r=this.nodeDOM;r;r=r.parentNode)if(r==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,r,n){return t==this.nodeDOM?this.posAtStart+Math.min(r,this.node.text.length):super.localPosFromDOM(t,r,n)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,r,n){let o=this.node.cut(t,r),i=document.createTextNode(o.text);return new Ih(this.parent,o,this.outerDeco,this.innerDeco,i,i,n)}markDirty(t,r){super.markDirty(t,r),this.dom!=this.nodeDOM&&(t==0||r==this.nodeDOM.nodeValue.length)&&(this.dirty=Oo)}get domAtom(){return!1}}class VE extends zd{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==_n&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class hP extends Vi{constructor(t,r,n,o,i,s,a,l,c,u){super(t,r,n,o,i,s,a,c,u),this.spec=l}update(t,r,n,o){if(this.dirty==Oo)return!1;if(this.spec.update){let i=this.spec.update(t,r,n);return i&&this.updateInner(t,r,n,o),i}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,r,n,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,r,n,o){this.spec.setSelection?this.spec.setSelection(t,r,n):super.setSelection(t,r,n,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function jE(e,t,r){let n=e.firstChild,o=!1;for(let i=0;i>1,s=Math.min(i,t.length);for(;o-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=sa.create(this.top,t[i],r,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(t,r,n,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(t,r,n))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(n){let c=r.children[n-1];if(c instanceof sa)r=c,n=c.children.length;else{a=c,n--;break}}else{if(r==t)break e;n=r.parent.children.indexOf(r),r=r.parent}let l=a.node;if(l){if(l!=e.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function yP(e,t){return e.type.side-t.type.side}function bP(e,t,r,n){let o=t.locals(e),i=0;if(o.length==0){for(let c=0;ci;)a.push(o[s++]);let h=i+f.nodeSize;if(f.isText){let b=h;s!b.inline):a.slice();n(f,m,t.forChild(i,f),p),i=h}}function xP(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function kP(e,t){for(;;){if(e.nodeType==3)return e;if(e.nodeType==1&&t>0){if(e.childNodes.length>t&&e.childNodes[t].nodeType==3)return e.childNodes[t];e=e.childNodes[t-1],t=yo(e)}else if(e.nodeType==1&&t=r){if(i>=n&&l.slice(n-t.length-a,n-a)==t)return n-t.length;let c=a=0&&c+t.length+a>=r)return a+c;if(r==n&&l.length>=n+t.length-a&&l.slice(n-a,n-a+t.length)==t)return n}}return-1}function I1(e,t,r,n,o){let i=[];for(let s=0,a=0;s=r||u<=t?i.push(l):(cr&&i.push(l.slice(r-c,l.size,n)))}return i}function zv(e,t=null){let r=e.domSelectionRange(),n=e.state.doc;if(!r.focusNode)return null;let o=e.docView.nearestDesc(r.focusNode),i=o&&o.size==0,s=e.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(s<0)return null;let a=n.resolve(s),l,c;if(Lh(r)){for(l=a;o&&!o.node;)o=o.parent;let u=o.node;if(o&&u.isAtom&&ce.isSelectable(u)&&o.parent&&!(u.isInline&&KR(r.focusNode,r.focusOffset,o.dom))){let d=o.posBefore;c=new ce(s==d?a:n.resolve(d))}}else{let u=e.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(u<0)return null;l=n.resolve(u)}if(!c){let u=t=="pointer"||e.state.selection.head{(r.anchorNode!=n||r.anchorOffset!=o)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!KE(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function EP(e){let t=e.domSelection(),r=document.createRange(),n=e.cursorWrapper.dom,o=n.nodeName=="IMG";o?r.setEnd(n.parentNode,br(n)+1):r.setEnd(n,0),r.collapse(!1),t.removeAllRanges(),t.addRange(r),!o&&!e.state.selection.visible&&Ir&&Fi<=11&&(n.disabled=!0,n.disabled=!1)}function qE(e,t){if(t instanceof ce){let r=e.docView.descAt(t.from);r!=e.lastSelectedViewDesc&&(Ik(e),r&&r.selectNode(),e.lastSelectedViewDesc=r)}else Ik(e)}function Ik(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Lv(e,t,r,n){return e.someProp("createSelectionBetween",o=>o(e,t,r))||le.between(t,r,n)}function Dk(e){return e.editable&&!e.hasFocus()?!1:GE(e)}function GE(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function CP(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),r=e.domSelectionRange();return ia(t.node,t.offset,r.anchorNode,r.anchorOffset)}function D1(e,t){let{$anchor:r,$head:n}=e.selection,o=t>0?r.max(n):r.min(n),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&be.findFrom(i,t)}function Ti(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function $k(e,t,r){let n=e.state.selection;if(n instanceof le)if(r.indexOf("s")>-1){let{$head:o}=n,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=e.state.doc.resolve(o.pos+i.nodeSize*(t<0?-1:1));return Ti(e,new le(n.$anchor,s))}else if(n.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let o=D1(e.state,t);return o&&o instanceof ce?Ti(e,o):!1}else if(!(wn&&r.indexOf("m")>-1)){let o=n.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let a=t<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=e.docView.descAt(a))&&!s.contentDOM?ce.isSelectable(i)?Ti(e,new ce(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):Pd?Ti(e,new le(e.state.doc.resolve(t<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(n instanceof ce&&n.node.isInline)return Ti(e,new le(t>0?n.$to:n.$from));{let o=D1(e.state,t);return o?Ti(e,o):!1}}}function Mp(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function yu(e,t){let r=e.pmViewDesc;return r&&r.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function Aa(e,t){return t<0?MP(e):TP(e)}function MP(e){let t=e.domSelectionRange(),r=t.focusNode,n=t.focusOffset;if(!r)return;let o,i,s=!1;for(oo&&r.nodeType==1&&n0){if(r.nodeType!=1)break;{let a=r.childNodes[n-1];if(yu(a,-1))o=r,i=--n;else if(a.nodeType==3)r=a,n=r.nodeValue.length;else break}}else{if(YE(r))break;{let a=r.previousSibling;for(;a&&yu(a,-1);)o=r.parentNode,i=br(a),a=a.previousSibling;if(a)r=a,n=Mp(r);else{if(r=r.parentNode,r==e.dom)break;n=0}}}s?$1(e,r,n):o&&$1(e,o,i)}function TP(e){let t=e.domSelectionRange(),r=t.focusNode,n=t.focusOffset;if(!r)return;let o=Mp(r),i,s;for(;;)if(n{e.state==o&&Qo(e)},50)}function Hk(e,t){let r=e.state.doc.resolve(t);if(!(dr||JR)&&r.parent.inlineContent){let o=e.coordsAtPos(t);if(t>r.start()){let i=e.coordsAtPos(t-1),s=(i.top+i.bottom)/2;if(s>o.top&&s1)return i.lefto.top&&s1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function Bk(e,t,r){let n=e.state.selection;if(n instanceof le&&!n.empty||r.indexOf("s")>-1||wn&&r.indexOf("m")>-1)return!1;let{$from:o,$to:i}=n;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=D1(e.state,t);if(s&&s instanceof ce)return Ti(e,s)}if(!o.parent.inlineContent){let s=t<0?o:i,a=n instanceof kr?be.near(s,t):be.findFrom(s,t);return a?Ti(e,a):!1}return!1}function Fk(e,t){if(!(e.state.selection instanceof le))return!0;let{$head:r,$anchor:n,empty:o}=e.state.selection;if(!r.sameParent(n))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(i&&!i.isText){let s=e.state.tr;return t<0?s.delete(r.pos-i.nodeSize,r.pos):s.delete(r.pos,r.pos+i.nodeSize),e.dispatch(s),!0}return!1}function Vk(e,t,r){e.domObserver.stop(),t.contentEditable=r,e.domObserver.start()}function AP(e){if(!Sr||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:r}=e.domSelectionRange();if(t&&t.nodeType==1&&r==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let n=t.firstChild;Vk(e,n,"true"),setTimeout(()=>Vk(e,n,"false"),20)}return!1}function NP(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function RP(e,t){let r=t.keyCode,n=NP(t);if(r==8||wn&&r==72&&n=="c")return Fk(e,-1)||Aa(e,-1);if(r==46&&!t.shiftKey||wn&&r==68&&n=="c")return Fk(e,1)||Aa(e,1);if(r==13||r==27)return!0;if(r==37||wn&&r==66&&n=="c"){let o=r==37?Hk(e,e.state.selection.from)=="ltr"?-1:1:-1;return $k(e,o,n)||Aa(e,o)}else if(r==39||wn&&r==70&&n=="c"){let o=r==39?Hk(e,e.state.selection.from)=="ltr"?1:-1:1;return $k(e,o,n)||Aa(e,o)}else{if(r==38||wn&&r==80&&n=="c")return Bk(e,-1,n)||Aa(e,-1);if(r==40||wn&&r==78&&n=="c")return AP(e)||Bk(e,1,n)||Aa(e,1);if(n==(wn?"m":"c")&&(r==66||r==73||r==89||r==90))return!0}return!1}function JE(e,t){e.someProp("transformCopied",p=>{t=p(t,e)});let r=[],{content:n,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&n.childCount==1&&n.firstChild.childCount==1;){o--,i--;let p=n.firstChild;r.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),n=p.content}let s=e.someProp("clipboardSerializer")||an.fromSchema(e.state.schema),a=rC(),l=a.createElement("div");l.appendChild(s.serializeFragment(n,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=tC[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let h=a.createElement(u[p]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(r)}`);let f=e.someProp("clipboardTextSerializer",p=>p(t,e))||t.content.textBetween(0,t.content.size,` +other {Heading}}`,comment:"Label for heading command with support for levels."};var mR=Object.freeze({__proto__:null,LABEL:hR});const gR={id:"extension.command.undo.label",message:"Undo",comment:"Label for undo."},vR={id:"extension.command.undo.description",message:"Undo the most recent action",comment:"Description for undo."},yR={id:"extension.command.redo.label",message:"Redo",comment:"Label for redo."},bR={id:"extension.command.redo.description",message:"Redo the most recent action",comment:"Description for redo."};var Cp=Object.freeze({__proto__:null,REDO_DESCRIPTION:bR,REDO_LABEL:yR,UNDO_DESCRIPTION:vR,UNDO_LABEL:gR});const xR={id:"extension.command.insert-horizontal-rule.label",message:"Divider",comment:"Label for inserting a horizontal rule (divider) command."},kR={id:"extension.command.insert-horizontal-rule.description",message:"Separate content with a diving horizontal line",comment:"Description for inserting a horizontal rule (divider) command."};var yk=Object.freeze({__proto__:null,DESCRIPTION:kR,LABEL:xR});const wR={id:"extension.command.toggle-italic.label",message:"Italic",comment:"Label for italic formatting command."},SR={id:"extension.command.toggle-italic.description",message:"Italicize the selected text",comment:"Description for italic formatting command."};var bk=Object.freeze({__proto__:null,DESCRIPTION:SR,LABEL:wR});const ER={id:"extension.command.toggle-ordered-list.label",message:"Ordered list",comment:"Label for inserting an ordered list into the editor."},CR={id:"extension.command.toggle-bullet-list.description",message:"Bulleted list",comment:"Description for inserting a bullet list into the editor."},MR={id:"extension.command.toggle-task-list.description",message:"Tasked list",comment:"Description for inserting a task list into the editor."};var Rv=Object.freeze({__proto__:null,BULLET_LIST_LABEL:CR,ORDERED_LIST_LABEL:ER,TASK_LIST_LABEL:MR});const TR={id:"extension.command.increase-indent.label",message:"Increase indentation",comment:"Label for increasing the indentation level."},OR={id:"extension.command.decrease-indent.label",message:"Decrease indentation",comment:"Label for decreasing the indentation level of the current node block."},_R={id:"extension.command.center-align.label",message:"Center align",comment:"Center align the text in the current node."},AR={id:"extension.command.justify-align.label",message:"Justify",comment:"Justify the alignment of the selected nodes."},NR={id:"extension.command.right-align.label",message:"Right align",comment:"Right align the selected nodes."},RR={id:"extension.command.left-align.label",message:"Left align",comment:"Left align the selected nodes."};var nc=Object.freeze({__proto__:null,CENTER_ALIGN_LABEL:_R,DECREASE_INDENT_LABEL:OR,INCREASE_INDENT_LABEL:TR,JUSTIFY_ALIGN_LABEL:AR,LEFT_ALIGN_LABEL:RR,RIGHT_ALIGN_LABEL:NR});const PR={id:"extension.command.insert-paragraph.label",message:"Insert Paragraph",comment:"Label for inserting a paragraph."},zR={id:"extension.command.insert-paragraph.description",message:"Insert a new paragraph",comment:"Description for inserting a paragraph."},LR={id:"extension.command.convert-paragraph.label",message:"Convert Paragraph",comment:"Label for converting the current node into a paragraph."},IR={id:"extension.command.convert-paragraph.description",message:"Convert current block into a paragraph block.",comment:"Description for converting a paragraph."};var Mp=Object.freeze({__proto__:null,CONVERT_DESCRIPTION:IR,CONVERT_LABEL:LR,INSERT_DESCRIPTION:zR,INSERT_LABEL:PR});const DR={id:"extension.command.toggle-strike.label",message:"Strikethrough",comment:"Label for strike formatting command."},$R={id:"extension.command.toggle-strike.description",message:"Strikethrough the selected text",comment:"Description for strike formatting command."};var xk=Object.freeze({__proto__:null,DESCRIPTION:$R,LABEL:DR});const HR={id:"extension.command.toggle-underline.label",message:"Underline",comment:"Label for underline formatting command."},BR={id:"extension.command.toggle-underline.description",message:"Underline the selected text",comment:"Description for underline formatting command."};var kk=Object.freeze({__proto__:null,DESCRIPTION:BR,LABEL:HR});class wa{constructor(t,r){this.match=t,this.match=t,this.handler=typeof r=="string"?FR(r):r}}function FR(e){return function(t,r,n,o){let i=e;if(r[1]){let s=r[0].lastIndexOf(r[1]);i+=r[0].slice(s+r[1].length),n+=s;let a=n-o;a>0&&(i=r[0].slice(s-a,s)+i,n=o)}return t.tr.insertText(i,n,o)}}const VR=500;function jR({rules:e}){let t=new Ro({state:{init(){return null},apply(r,n){let o=r.getMeta(this);return o||(r.selectionSet||r.docChanged?null:n)}},props:{handleTextInput(r,n,o,i){return wk(r,n,o,i,e,t)},handleDOMEvents:{compositionend:r=>{setTimeout(()=>{let{$cursor:n}=r.state.selection;n&&wk(r,n.pos,n.pos,"",e,t)})}}},isInputRules:!0});return t}function wk(e,t,r,n,o,i){if(e.composing)return!1;let s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;let l=a.parent.textBetween(Math.max(0,a.parentOffset-VR),a.parentOffset,null,"")+n;for(let c=0;c{let r=e.plugins;for(let n=0;n=0;l--)s.step(a.steps[l].invert(a.docs[l]));if(i.text){let l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,e.schema.text(i.text,l))}else s.delete(i.from,i.to);t(s)}return!0}}return!1};function Lh(e,t,r=null,n){return new wa(e,(o,i,s,a)=>{let l=r instanceof Function?r(i):r,c=o.tr.delete(s,a),u=c.doc.resolve(s),d=u.blockRange(),f=d&&Ov(d,t,l);if(!f)return null;c.wrap(d,f);let p=c.doc.resolve(s-1).nodeBefore;return p&&p.type==t&&Rd(c.doc,s-1)&&(!n||n(i,p))&&c.join(s-1),c})}function WR(e,t,r=null){return new wa(e,(n,o,i,s)=>{let a=n.doc.resolve(i),l=r instanceof Function?r(o):r;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t)?n.tr.delete(i,s).setBlockType(i,i,t,l):null})}const br=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Du=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let Sk=null;const Fo=function(e,t,r){let n=Sk||(Sk=document.createRange());return n.setEnd(e,r??e.nodeValue.length),n.setStart(e,t||0),n},oa=function(e,t,r,n){return r&&(Ek(e,t,r,n,-1)||Ek(e,t,r,n,1))},KR=/^(img|br|input|textarea|hr)$/i;function Ek(e,t,r,n,o){for(;;){if(e==r&&t==n)return!0;if(t==(o<0?0:yo(e))){let i=e.parentNode;if(!i||i.nodeType!=1||Pv(e)||KR.test(e.nodeName)||e.contentEditable=="false")return!1;t=br(e)+(o<0?0:1),e=i}else if(e.nodeType==1){if(e=e.childNodes[t+(o<0?-1:0)],e.contentEditable=="false")return!1;t=o<0?yo(e):0}else return!1}}function yo(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function qR(e,t,r){for(let n=t==0,o=t==yo(e);n||o;){if(e==r)return!0;let i=br(e);if(e=e.parentNode,!e)return!1;n=n&&i==0,o=o&&i==yo(e)}}function Pv(e){let t;for(let r=e;r&&!(t=r.pmViewDesc);r=r.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const Ih=function(e){return e.focusNode&&oa(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Ds(e,t){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=e,r.key=r.code=t,r}function GR(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function YR(e,t,r){if(e.caretPositionFromPoint)try{let n=e.caretPositionFromPoint(t,r);if(n)return{node:n.offsetNode,offset:n.offset}}catch{}if(e.caretRangeFromPoint){let n=e.caretRangeFromPoint(t,r);if(n)return{node:n.startContainer,offset:n.startOffset}}}const To=typeof navigator<"u"?navigator:null,Ck=typeof document<"u"?document:null,hs=To&&To.userAgent||"",R1=/Edge\/(\d+)/.exec(hs),LE=/MSIE \d/.exec(hs),P1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(hs),Ir=!!(LE||P1||R1),Vi=LE?document.documentMode:P1?+P1[1]:R1?+R1[1]:0,oo=!Ir&&/gecko\/(\d+)/i.test(hs);oo&&+(/Firefox\/(\d+)/.exec(hs)||[0,0])[1];const z1=!Ir&&/Chrome\/(\d+)/.exec(hs),dr=!!z1,JR=z1?+z1[1]:0,Sr=!Ir&&!!To&&/Apple Computer/.test(To.vendor),Nl=Sr&&(/Mobile\/\w+/.test(hs)||!!To&&To.maxTouchPoints>2),wn=Nl||(To?/Mac/.test(To.platform):!1),XR=To?/Win/.test(To.platform):!1,Jn=/Android \d/.test(hs),Pd=!!Ck&&"webkitFontSmoothing"in Ck.documentElement.style,QR=Pd?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function ZR(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Lo(e,t){return typeof e=="number"?e:e[t]}function eP(e){let t=e.getBoundingClientRect(),r=t.width/e.offsetWidth||1,n=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*r,top:t.top,bottom:t.top+e.clientHeight*n}}function Mk(e,t,r){let n=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=r||e.dom;s;s=Du(s)){if(s.nodeType!=1)continue;let a=s,l=a==i.body,c=l?ZR(i):eP(a),u=0,d=0;if(t.topc.bottom-Lo(n,"bottom")&&(d=t.bottom-t.top>c.bottom-c.top?t.top+Lo(o,"top")-c.top:t.bottom-c.bottom+Lo(o,"bottom")),t.leftc.right-Lo(n,"right")&&(u=t.right-c.right+Lo(o,"right")),u||d)if(l)i.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let h=a.scrollLeft-f,m=a.scrollTop-p;t={left:t.left-h,top:t.top-m,right:t.right-h,bottom:t.bottom-m}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function tP(e){let t=e.dom.getBoundingClientRect(),r=Math.max(0,t.top),n,o;for(let i=(t.left+t.right)/2,s=r+1;s=r-20){n=a,o=l.top;break}}return{refDOM:n,refTop:o,stack:IE(e.dom)}}function IE(e){let t=[],r=e.ownerDocument;for(let n=e;n&&(t.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),e!=r);n=Du(n));return t}function rP({refDOM:e,refTop:t,stack:r}){let n=e?e.getBoundingClientRect().top:0;DE(r,n==0?0:n-t)}function DE(e,t){for(let r=0;r=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);let m=h.left>t.left?h.left-t.left:h.right=(h.left+h.right)/2?1:0));continue}}else h.top>t.top&&!l&&h.left<=t.left&&h.right>=t.left&&(l=u,c={left:Math.max(h.left,Math.min(h.right,t.left)),top:h.top});!r&&(t.left>=h.right&&t.top>=h.top||t.left>=h.left&&t.top>=h.bottom)&&(i=d+1)}}return!r&&l&&(r=l,o=c,n=0),r&&r.nodeType==3?oP(r,o):!r||n&&r.nodeType==1?{node:e,offset:i}:$E(r,o)}function oP(e,t){let r=e.nodeValue.length,n=document.createRange();for(let o=0;o=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}function zv(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function iP(e,t){let r=e.parentNode;return r&&/^li$/i.test(r.nodeName)&&t.left(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(n,o,i)}function aP(e,t,r,n){let o=-1;for(let i=t,s=!1;i!=e.dom;){let a=e.docView.nearestDesc(i,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent&&!s||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&!s&&(s=!0,l.left>n.left||l.top>n.top?o=a.posBefore:(l.right-1?o:e.docView.posFromDOM(t,r,-1)}function HE(e,t,r){let n=e.childNodes.length;if(n&&r.topt.top&&o++}let c;Pd&&o&&n.nodeType==1&&(c=n.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=t.top&&o--,n==e.dom&&o==n.childNodes.length-1&&n.lastChild.nodeType==1&&t.top>n.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(o==0||n.nodeType!=1||n.childNodes[o-1].nodeName!="BR")&&(a=aP(e,n,o,t))}a==null&&(a=sP(e,s,t));let l=e.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Tk(e){return e.top=0&&o==n.nodeValue.length?(l--,u=1):r<0?l--:c++,yc(wi(Fo(n,l,c),u),u<0)}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(i==null&&o&&(r<0||o==yo(n))){let l=n.childNodes[o-1];if(l.nodeType==1)return gg(l.getBoundingClientRect(),!1)}if(i==null&&o=0)}if(i==null&&o&&(r<0||o==yo(n))){let l=n.childNodes[o-1],c=l.nodeType==3?Fo(l,yo(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return yc(wi(c,1),!1)}if(i==null&&o=0)}function yc(e,t){if(e.width==0)return e;let r=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:r,right:r}}function gg(e,t){if(e.height==0)return e;let r=t?e.top:e.bottom;return{top:r,bottom:r,left:e.left,right:e.right}}function FE(e,t,r){let n=e.state,o=e.root.activeElement;n!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return r()}finally{n!=t&&e.updateState(n),o!=e.dom&&o&&o.focus()}}function uP(e,t,r){let n=t.selection,o=r=="up"?n.$from:n.$to;return FE(e,t,()=>{let{node:i}=e.docView.domFromPos(o.pos,r=="up"?-1:1);for(;;){let a=e.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=BE(e,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Fo(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(r=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const dP=/[\u0590-\u08ac]/;function fP(e,t,r){let{$head:n}=t.selection;if(!n.parent.isTextblock)return!1;let o=n.parentOffset,i=!o,s=o==n.parent.content.size,a=e.domSelection();return!dP.test(n.parent.textContent)||!a.modify?r=="left"||r=="backward"?i:s:FE(e,t,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=e.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",r,"character");let p=n.depth?e.docView.domAfterPos(n.before()):e.dom,{focusNode:h,focusOffset:m}=e.domSelectionRange(),b=h&&!p.contains(h.nodeType==1?h:h.parentNode)||l==h&&c==m;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),b})}let Ok=null,_k=null,Ak=!1;function pP(e,t,r){return Ok==t&&_k==r?Ak:(Ok=t,_k=r,Ak=r=="up"||r=="down"?uP(e,t,r):fP(e,t,r))}const _n=0,Nk=1,Bs=2,Oo=3;class zd{constructor(t,r,n,o){this.parent=t,this.children=r,this.dom=n,this.contentDOM=o,this.dirty=_n,n.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,r,n){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let r=0;rbr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(r==0)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&r==t.childNodes.length)for(let i=t;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??n>0?this.posAtEnd:this.posAtStart}nearestDesc(t,r=!1){for(let n=!0,o=t;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!r||i.node))if(n&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(t.nodeType==1?t:t.parentNode):s==t))n=!1;else return i}}getDesc(t){let r=t.pmViewDesc;for(let n=r;n;n=n.parent)if(n==this)return r}posFromDOM(t,r,n){for(let o=t;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(t,r,n)}return-1}descAt(t){for(let r=0,n=0;rt||s instanceof jE){o=t-i;break}i=a}if(o)return this.children[n].domFromPos(o-this.children[n].border,r);for(let i;n&&!(i=this.children[n-1]).size&&i instanceof VE&&i.side>=0;n--);if(r<=0){let i,s=!0;for(;i=n?this.children[n-1]:null,!(!i||i.dom.parentNode==this.contentDOM);n--,s=!1);return i&&r&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,r):{node:this.contentDOM,offset:i?br(i.dom)+1:0}}else{let i,s=!0;for(;i=n=u&&r<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,r,u);t=s;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=br(f.dom)+1;break}t-=f.size}o==-1&&(o=0)}if(o>-1&&(c>r||a==this.children.length-1)){r=c;for(let u=a+1;up&&sr){let p=a;a=l,l=p}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,r){for(let n=0,o=0;o=n:tn){let a=n+i.border,l=s-i.border;if(t>=a&&r<=l){this.dirty=t==n||r==s?Bs:Nk,t==a&&r==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Oo:i.markDirty(t-a,r-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Bs:Oo}n=s}this.dirty=Bs}markParentsDirty(){let t=1;for(let r=this.parent;r;r=r.parent,t++){let n=t==1?Bs:Nk;r.dirty{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!r.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=r,this.widget=r,i=this}matchesWidget(t){return this.dirty==_n&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let r=this.widget.spec.stopEvent;return r?r(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class hP extends zd{constructor(t,r,n,o){super(t,[],r,null),this.textDOM=n,this.text=o}get size(){return this.text.length}localPosFromDOM(t,r){return t!=this.textDOM?this.posAtStart+(r?this.size:0):this.posAtStart+r}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class ia extends zd{constructor(t,r,n,o){super(t,[],n,o),this.mark=r}static create(t,r,n,o){let i=o.nodeViews[r.type.name],s=i&&i(r,o,n);return(!s||!s.dom)&&(s=an.renderSpec(document,r.type.spec.toDOM(r,n))),new ia(t,r,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&Oo||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Oo&&this.mark.eq(t)}markDirty(t,r){if(super.markDirty(t,r),this.dirty!=_n){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty0&&(i=D1(i,0,t,n));for(let a=0;a{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},n,o),u=c&&c.dom,d=c&&c.contentDOM;if(r.isText){if(!u)u=document.createTextNode(r.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=an.renderSpec(document,r.type.spec.toDOM(r)));!d&&!r.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),r.type.spec.draggable&&(u.draggable=!0));let f=u;return u=KE(u,n,r),c?l=new mP(t,r,n,o,u,d||null,f,c,i,s+1):r.isText?new Dh(t,r,n,o,u,f,i):new ji(t,r,n,o,u,d||null,f,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let n=this.children[r];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}t.contentElement||(t.getContent=()=>R.empty)}return t}matchesNode(t,r,n){return this.dirty==_n&&t.eq(this.node)&&I1(r,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,r){let n=this.node.inlineContent,o=r,i=t.composing?this.localCompositionInfo(t,r):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new vP(this,s&&s.node,t);xP(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,n,t):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?Te.none:this.node.child(u).marks,n,t),l.placeWidget(c,t,o)},(c,u,d,f)=>{l.syncToMarks(c.marks,n,t);let p;l.findNodeMatch(c,u,d,f)||a&&t.state.selection.from>o&&t.state.selection.to-1&&l.updateNodeAt(c,u,d,p,t)||l.updateNextNode(c,u,d,t,f,o)||l.addNode(c,u,d,t,o),o+=c.nodeSize}),l.syncToMarks([],n,t),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Bs)&&(s&&this.protectLocalComposition(t,s),UE(this.contentDOM,this.children,t),Nl&&kP(this.dom))}localCompositionInfo(t,r){let{from:n,to:o}=t.state.selection;if(!(t.state.selection instanceof le)||nr+this.node.content.size)return null;let i=t.domSelectionRange(),s=wP(i.focusNode,i.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,l=SP(this.node.content,a,n-r,o-r);return l<0?null:{node:s,pos:l,text:a}}else return{node:s,pos:-1,text:""}}protectLocalComposition(t,{node:r,pos:n,text:o}){if(this.getDesc(r))return;let i=r;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new hP(this,i,r,o);t.input.compositionNodes.push(s),this.children=D1(this.children,n,n+o.length,t,s)}update(t,r,n,o){return this.dirty==Oo||!t.sameMarkup(this.node)?!1:(this.updateInner(t,r,n,o),!0)}updateInner(t,r,n,o){this.updateOuterDeco(r),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=_n}updateOuterDeco(t){if(I1(t,this.outerDeco))return;let r=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=WE(this.dom,this.nodeDOM,L1(this.outerDeco,this.node,r),L1(t,this.node,r)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Rk(e,t,r,n,o){KE(n,t,e);let i=new ji(void 0,e,t,r,n,n,n,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Dh extends ji{constructor(t,r,n,o,i,s,a){super(t,r,n,o,i,null,s,a,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,r,n,o){return this.dirty==Oo||this.dirty!=_n&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(r),(this.dirty!=_n||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=t,this.dirty=_n,!0)}inParent(){let t=this.parent.contentDOM;for(let r=this.nodeDOM;r;r=r.parentNode)if(r==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,r,n){return t==this.nodeDOM?this.posAtStart+Math.min(r,this.node.text.length):super.localPosFromDOM(t,r,n)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,r,n){let o=this.node.cut(t,r),i=document.createTextNode(o.text);return new Dh(this.parent,o,this.outerDeco,this.innerDeco,i,i,n)}markDirty(t,r){super.markDirty(t,r),this.dom!=this.nodeDOM&&(t==0||r==this.nodeDOM.nodeValue.length)&&(this.dirty=Oo)}get domAtom(){return!1}}class jE extends zd{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==_n&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class mP extends ji{constructor(t,r,n,o,i,s,a,l,c,u){super(t,r,n,o,i,s,a,c,u),this.spec=l}update(t,r,n,o){if(this.dirty==Oo)return!1;if(this.spec.update){let i=this.spec.update(t,r,n);return i&&this.updateInner(t,r,n,o),i}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,r,n,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,r,n,o){this.spec.setSelection?this.spec.setSelection(t,r,n):super.setSelection(t,r,n,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function UE(e,t,r){let n=e.firstChild,o=!1;for(let i=0;i>1,s=Math.min(i,t.length);for(;o-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=ia.create(this.top,t[i],r,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(t,r,n,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(t,r,n))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(n){let c=r.children[n-1];if(c instanceof ia)r=c,n=c.children.length;else{a=c,n--;break}}else{if(r==t)break e;n=r.parent.children.indexOf(r),r=r.parent}let l=a.node;if(l){if(l!=e.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function bP(e,t){return e.type.side-t.type.side}function xP(e,t,r,n){let o=t.locals(e),i=0;if(o.length==0){for(let c=0;ci;)a.push(o[s++]);let h=i+f.nodeSize;if(f.isText){let b=h;s!b.inline):a.slice();n(f,m,t.forChild(i,f),p),i=h}}function kP(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function wP(e,t){for(;;){if(e.nodeType==3)return e;if(e.nodeType==1&&t>0){if(e.childNodes.length>t&&e.childNodes[t].nodeType==3)return e.childNodes[t];e=e.childNodes[t-1],t=yo(e)}else if(e.nodeType==1&&t=r){if(i>=n&&l.slice(n-t.length-a,n-a)==t)return n-t.length;let c=a=0&&c+t.length+a>=r)return a+c;if(r==n&&l.length>=n+t.length-a&&l.slice(n-a,n-a+t.length)==t)return n}}return-1}function D1(e,t,r,n,o){let i=[];for(let s=0,a=0;s=r||u<=t?i.push(l):(cr&&i.push(l.slice(r-c,l.size,n)))}return i}function Lv(e,t=null){let r=e.domSelectionRange(),n=e.state.doc;if(!r.focusNode)return null;let o=e.docView.nearestDesc(r.focusNode),i=o&&o.size==0,s=e.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(s<0)return null;let a=n.resolve(s),l,c;if(Ih(r)){for(l=a;o&&!o.node;)o=o.parent;let u=o.node;if(o&&u.isAtom&&ce.isSelectable(u)&&o.parent&&!(u.isInline&&qR(r.focusNode,r.focusOffset,o.dom))){let d=o.posBefore;c=new ce(s==d?a:n.resolve(d))}}else{let u=e.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(u<0)return null;l=n.resolve(u)}if(!c){let u=t=="pointer"||e.state.selection.head{(r.anchorNode!=n||r.anchorOffset!=o)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!qE(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function CP(e){let t=e.domSelection(),r=document.createRange(),n=e.cursorWrapper.dom,o=n.nodeName=="IMG";o?r.setEnd(n.parentNode,br(n)+1):r.setEnd(n,0),r.collapse(!1),t.removeAllRanges(),t.addRange(r),!o&&!e.state.selection.visible&&Ir&&Vi<=11&&(n.disabled=!0,n.disabled=!1)}function GE(e,t){if(t instanceof ce){let r=e.docView.descAt(t.from);r!=e.lastSelectedViewDesc&&(Dk(e),r&&r.selectNode(),e.lastSelectedViewDesc=r)}else Dk(e)}function Dk(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Iv(e,t,r,n){return e.someProp("createSelectionBetween",o=>o(e,t,r))||le.between(t,r,n)}function $k(e){return e.editable&&!e.hasFocus()?!1:YE(e)}function YE(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function MP(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),r=e.domSelectionRange();return oa(t.node,t.offset,r.anchorNode,r.anchorOffset)}function $1(e,t){let{$anchor:r,$head:n}=e.selection,o=t>0?r.max(n):r.min(n),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&be.findFrom(i,t)}function Oi(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Hk(e,t,r){let n=e.state.selection;if(n instanceof le)if(r.indexOf("s")>-1){let{$head:o}=n,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=e.state.doc.resolve(o.pos+i.nodeSize*(t<0?-1:1));return Oi(e,new le(n.$anchor,s))}else if(n.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let o=$1(e.state,t);return o&&o instanceof ce?Oi(e,o):!1}else if(!(wn&&r.indexOf("m")>-1)){let o=n.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let a=t<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=e.docView.descAt(a))&&!s.contentDOM?ce.isSelectable(i)?Oi(e,new ce(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):Pd?Oi(e,new le(e.state.doc.resolve(t<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(n instanceof ce&&n.node.isInline)return Oi(e,new le(t>0?n.$to:n.$from));{let o=$1(e.state,t);return o?Oi(e,o):!1}}}function Tp(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function yu(e,t){let r=e.pmViewDesc;return r&&r.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function Aa(e,t){return t<0?TP(e):OP(e)}function TP(e){let t=e.domSelectionRange(),r=t.focusNode,n=t.focusOffset;if(!r)return;let o,i,s=!1;for(oo&&r.nodeType==1&&n0){if(r.nodeType!=1)break;{let a=r.childNodes[n-1];if(yu(a,-1))o=r,i=--n;else if(a.nodeType==3)r=a,n=r.nodeValue.length;else break}}else{if(JE(r))break;{let a=r.previousSibling;for(;a&&yu(a,-1);)o=r.parentNode,i=br(a),a=a.previousSibling;if(a)r=a,n=Tp(r);else{if(r=r.parentNode,r==e.dom)break;n=0}}}s?H1(e,r,n):o&&H1(e,o,i)}function OP(e){let t=e.domSelectionRange(),r=t.focusNode,n=t.focusOffset;if(!r)return;let o=Tp(r),i,s;for(;;)if(n{e.state==o&&Qo(e)},50)}function Bk(e,t){let r=e.state.doc.resolve(t);if(!(dr||XR)&&r.parent.inlineContent){let o=e.coordsAtPos(t);if(t>r.start()){let i=e.coordsAtPos(t-1),s=(i.top+i.bottom)/2;if(s>o.top&&s1)return i.lefto.top&&s1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function Fk(e,t,r){let n=e.state.selection;if(n instanceof le&&!n.empty||r.indexOf("s")>-1||wn&&r.indexOf("m")>-1)return!1;let{$from:o,$to:i}=n;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=$1(e.state,t);if(s&&s instanceof ce)return Oi(e,s)}if(!o.parent.inlineContent){let s=t<0?o:i,a=n instanceof kr?be.near(s,t):be.findFrom(s,t);return a?Oi(e,a):!1}return!1}function Vk(e,t){if(!(e.state.selection instanceof le))return!0;let{$head:r,$anchor:n,empty:o}=e.state.selection;if(!r.sameParent(n))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(i&&!i.isText){let s=e.state.tr;return t<0?s.delete(r.pos-i.nodeSize,r.pos):s.delete(r.pos,r.pos+i.nodeSize),e.dispatch(s),!0}return!1}function jk(e,t,r){e.domObserver.stop(),t.contentEditable=r,e.domObserver.start()}function NP(e){if(!Sr||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:r}=e.domSelectionRange();if(t&&t.nodeType==1&&r==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let n=t.firstChild;jk(e,n,"true"),setTimeout(()=>jk(e,n,"false"),20)}return!1}function RP(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function PP(e,t){let r=t.keyCode,n=RP(t);if(r==8||wn&&r==72&&n=="c")return Vk(e,-1)||Aa(e,-1);if(r==46&&!t.shiftKey||wn&&r==68&&n=="c")return Vk(e,1)||Aa(e,1);if(r==13||r==27)return!0;if(r==37||wn&&r==66&&n=="c"){let o=r==37?Bk(e,e.state.selection.from)=="ltr"?-1:1:-1;return Hk(e,o,n)||Aa(e,o)}else if(r==39||wn&&r==70&&n=="c"){let o=r==39?Bk(e,e.state.selection.from)=="ltr"?1:-1:1;return Hk(e,o,n)||Aa(e,o)}else{if(r==38||wn&&r==80&&n=="c")return Fk(e,-1,n)||Aa(e,-1);if(r==40||wn&&r==78&&n=="c")return NP(e)||Fk(e,1,n)||Aa(e,1);if(n==(wn?"m":"c")&&(r==66||r==73||r==89||r==90))return!0}return!1}function XE(e,t){e.someProp("transformCopied",p=>{t=p(t,e)});let r=[],{content:n,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&n.childCount==1&&n.firstChild.childCount==1;){o--,i--;let p=n.firstChild;r.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),n=p.content}let s=e.someProp("clipboardSerializer")||an.fromSchema(e.state.schema),a=nC(),l=a.createElement("div");l.appendChild(s.serializeFragment(n,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=rC[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let h=a.createElement(u[p]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(r)}`);let f=e.someProp("clipboardTextSerializer",p=>p(t,e))||t.content.textBetween(0,t.content.size,` -`);return{dom:l,text:f}}function XE(e,t,r,n,o){let i=o.parent.type.spec.code,s,a;if(!r&&!t)return null;let l=t&&(n||i||!r);if(l){if(e.someProp("transformPastedText",f=>{t=f(t,i||n,e)}),i)return t?new K(R.from(e.state.schema.text(t.replace(/\r\n?/g,` -`))),0,0):K.empty;let d=e.someProp("clipboardTextParser",f=>f(t,o,n,e));if(d)a=d;else{let f=o.marks(),{schema:p}=e.state,h=an.fromSchema(p);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(m=>{let b=s.appendChild(document.createElement("p"));m&&b.appendChild(h.serializeNode(p.text(m,f)))})}}else e.someProp("transformPastedHTML",d=>{r=d(r,e)}),s=LP(r),Pd&&IP(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||Cv.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!PP.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)a=DP(jk(a,+u[1],+u[2]),u[4]);else if(a=K.maxOpen(zP(a.content,o),!0),a.openStart||a.openEnd){let d=0,f=0;for(let p=a.content.firstChild;d{a=d(a,e)}),a}const PP=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function zP(e,t){if(e.childCount<2)return e;for(let r=t.depth;r>=0;r--){let o=t.node(r).contentMatchAt(t.index(r)),i,s=[];if(e.forEach(a=>{if(!s)return;let l=o.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&i.length&&ZE(l,i,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=eC(s[s.length-1],i.length));let u=QE(a,l);s.push(u),o=o.matchType(u.type),i=l}}),s)return R.from(s)}return e}function QE(e,t,r=0){for(let n=t.length-1;n>=r;n--)e=t[n].create(null,R.from(e));return e}function ZE(e,t,r,n,o){if(o1&&(i=0),o=r&&(a=t<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(R.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function jk(e,t,r){return t]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let r=rC().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(e),o;if((o=n&&tC[n[1].toLowerCase()])&&(e=o.map(i=>"<"+i+">").join("")+e+o.map(i=>"").reverse().join("")),r.innerHTML=e,o)for(let i=0;i=0;a-=2){let l=r.nodes[n[a]];if(!l||l.hasRequiredAttrs())break;o=R.from(l.create(n[a+1],o)),i++,s++}return new K(o,i,s)}const Er={},Cr={},$P={touchstart:!0,touchmove:!0};class HP{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function BP(e){for(let t in Er){let r=Er[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=n=>{VP(e,n)&&!Iv(e,n)&&(e.editable||!(n.type in Cr))&&r(e,n)},$P[t]?{passive:!0}:void 0)}Sr&&e.dom.addEventListener("input",()=>null),B1(e)}function Ii(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function FP(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function B1(e){e.someProp("handleDOMEvents",t=>{for(let r in t)e.input.eventHandlers[r]||e.dom.addEventListener(r,e.input.eventHandlers[r]=n=>Iv(e,n))})}function Iv(e,t){return e.someProp("handleDOMEvents",r=>{let n=r[t.type];return n?n(e,t)||t.defaultPrevented:!1})}function VP(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let r=t.target;r!=e.dom;r=r.parentNode)if(!r||r.nodeType==11||r.pmViewDesc&&r.pmViewDesc.stopEvent(t))return!1;return!0}function jP(e,t){!Iv(e,t)&&Er[t.type]&&(e.editable||!(t.type in Cr))&&Er[t.type](e,t)}Cr.keydown=(e,t)=>{let r=t;if(e.input.shiftKey=r.keyCode==16||r.shiftKey,!oC(e,r)&&(e.input.lastKeyCode=r.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Jn&&dr&&r.keyCode==13)))if(r.keyCode!=229&&e.domObserver.forceFlush(),Nl&&r.keyCode==13&&!r.ctrlKey&&!r.altKey&&!r.metaKey){let n=Date.now();e.input.lastIOSEnter=n,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==n&&(e.someProp("handleKeyDown",o=>o(e,$s(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",n=>n(e,r))||RP(e,r)?r.preventDefault():Ii(e,"key")};Cr.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Cr.keypress=(e,t)=>{let r=t;if(oC(e,r)||!r.charCode||r.ctrlKey&&!r.altKey||wn&&r.metaKey)return;if(e.someProp("handleKeyPress",o=>o(e,r))){r.preventDefault();return}let n=e.state.selection;if(!(n instanceof le)||!n.$from.sameParent(n.$to)){let o=String.fromCharCode(r.charCode);!/[\r\n]/.test(o)&&!e.someProp("handleTextInput",i=>i(e,n.$from.pos,n.$to.pos,o))&&e.dispatch(e.state.tr.insertText(o).scrollIntoView()),r.preventDefault()}};function Dh(e){return{left:e.clientX,top:e.clientY}}function UP(e,t){let r=t.x-e.clientX,n=t.y-e.clientY;return r*r+n*n<100}function Dv(e,t,r,n,o){if(n==-1)return!1;let i=e.state.doc.resolve(n);for(let s=i.depth+1;s>0;s--)if(e.someProp(t,a=>s>i.depth?a(e,r,i.nodeAfter,i.before(s),o,!0):a(e,r,i.node(s),i.before(s),o,!1)))return!0;return!1}function pl(e,t,r){e.focused||e.focus();let n=e.state.tr.setSelection(t);r=="pointer"&&n.setMeta("pointer",!0),e.dispatch(n)}function WP(e,t){if(t==-1)return!1;let r=e.state.doc.resolve(t),n=r.nodeAfter;return n&&n.isAtom&&ce.isSelectable(n)?(pl(e,new ce(r),"pointer"),!0):!1}function KP(e,t){if(t==-1)return!1;let r=e.state.selection,n,o;r instanceof ce&&(n=r.node);let i=e.state.doc.resolve(t);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(ce.isSelectable(a)){n&&r.$from.depth>0&&s>=r.$from.depth&&i.before(r.$from.depth+1)==r.$from.pos?o=i.before(r.$from.depth):o=i.before(s);break}}return o!=null?(pl(e,ce.create(e.state.doc,o),"pointer"),!0):!1}function qP(e,t,r,n,o){return Dv(e,"handleClickOn",t,r,n)||e.someProp("handleClick",i=>i(e,t,n))||(o?KP(e,r):WP(e,r))}function GP(e,t,r,n){return Dv(e,"handleDoubleClickOn",t,r,n)||e.someProp("handleDoubleClick",o=>o(e,t,n))}function YP(e,t,r,n){return Dv(e,"handleTripleClickOn",t,r,n)||e.someProp("handleTripleClick",o=>o(e,t,n))||JP(e,r,n)}function JP(e,t,r){if(r.button!=0)return!1;let n=e.state.doc;if(t==-1)return n.inlineContent?(pl(e,le.create(n,0,n.content.size),"pointer"),!0):!1;let o=n.resolve(t);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)pl(e,le.create(n,a+1,a+1+s.content.size),"pointer");else if(ce.isSelectable(s))pl(e,ce.create(n,a),"pointer");else continue;return!0}}function $v(e){return Tp(e)}const nC=wn?"metaKey":"ctrlKey";Er.mousedown=(e,t)=>{let r=t;e.input.shiftKey=r.shiftKey;let n=$v(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&UP(r,e.input.lastClick)&&!r[nC]&&(e.input.lastClick.type=="singleClick"?i="doubleClick":e.input.lastClick.type=="doubleClick"&&(i="tripleClick")),e.input.lastClick={time:o,x:r.clientX,y:r.clientY,type:i};let s=e.posAtCoords(Dh(r));s&&(i=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new XP(e,s,r,!!n)):(i=="doubleClick"?GP:YP)(e,s.pos,s.inside,r)?r.preventDefault():Ii(e,"pointer"))};class XP{constructor(t,r,n,o){this.view=t,this.pos=r,this.event=n,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[nC],this.allowDefault=n.shiftKey;let i,s;if(r.inside>-1)i=t.state.doc.nodeAt(r.inside),s=r.inside;else{let u=t.state.doc.resolve(r.pos);i=u.parent,s=u.depth?u.before():0}const a=o?null:n.target,l=a?t.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:c}=t.state;(n.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof ce&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&oo&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ii(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Qo(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords(Dh(t))),this.updateAllowDefault(t),this.allowDefault||!r?Ii(this.view,"pointer"):qP(this.view,r.pos,r.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Sr&&this.mightDrag&&!this.mightDrag.node.isAtom||dr&&!this.view.state.selection.visible&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(pl(this.view,be.near(this.view.state.doc.resolve(r.pos)),"pointer"),t.preventDefault()):Ii(this.view,"pointer")}move(t){this.updateAllowDefault(t),Ii(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}Er.touchstart=e=>{e.input.lastTouch=Date.now(),$v(e),Ii(e,"pointer")};Er.touchmove=e=>{e.input.lastTouch=Date.now(),Ii(e,"pointer")};Er.contextmenu=e=>$v(e);function oC(e,t){return e.composing?!0:Sr&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const QP=Jn?5e3:-1;Cr.compositionstart=Cr.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,r=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||r.marks(),Tp(e,!0),e.markCursor=null;else if(Tp(e),oo&&t.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let n=e.domSelectionRange();for(let o=n.focusNode,i=n.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){e.domSelection().collapse(s,s.nodeValue.length);break}else o=s,i=-1}}e.input.composing=!0}iC(e,QP)};Cr.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,iC(e,20))};function iC(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Tp(e),t))}function sC(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=ZP());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function ZP(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Tp(e,t=!1){if(!(Jn&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),sC(e),t||e.docView&&e.docView.dirty){let r=zv(e);return r&&!r.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(r)):e.updateState(e.state),!0}return!1}}function e6(e,t){if(!e.dom.parentNode)return;let r=e.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(t),r.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),n.removeAllRanges(),n.addRange(o),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),e.focus()},50)}const Rl=Ir&&Fi<15||Nl&&XR<604;Er.copy=Cr.cut=(e,t)=>{let r=t,n=e.state.selection,o=r.type=="cut";if(n.empty)return;let i=Rl?null:r.clipboardData,s=n.content(),{dom:a,text:l}=JE(e,s);i?(r.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):e6(e,a),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function t6(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function r6(e,t){if(!e.dom.parentNode)return;let r=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,n=e.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let o=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),n.parentNode&&n.parentNode.removeChild(n),r?$u(e,n.value,null,o,t):$u(e,n.textContent,n.innerHTML,o,t)},50)}function $u(e,t,r,n,o){let i=XE(e,t,r,n,e.state.selection.$from);if(e.someProp("handlePaste",l=>l(e,o,i||K.empty)))return!0;if(!i)return!1;let s=t6(i),a=s?e.state.tr.replaceSelectionWith(s,n):e.state.tr.replaceSelection(i);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Cr.paste=(e,t)=>{let r=t;if(e.composing&&!Jn)return;let n=Rl?null:r.clipboardData,o=e.input.shiftKey&&e.input.lastKeyCode!=45;n&&$u(e,n.getData("text/plain"),n.getData("text/html"),o,r)?r.preventDefault():r6(e,r)};class n6{constructor(t,r){this.slice=t,this.move=r}}const aC=wn?"altKey":"ctrlKey";Er.dragstart=(e,t)=>{let r=t,n=e.input.mouseDown;if(n&&n.done(),!r.dataTransfer)return;let o=e.state.selection,i=o.empty?null:e.posAtCoords(Dh(r));if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof ce?o.to-1:o.to))){if(n&&n.mightDrag)e.dispatch(e.state.tr.setSelection(ce.create(e.state.doc,n.mightDrag.pos)));else if(r.target&&r.target.nodeType==1){let c=e.docView.nearestDesc(r.target,!0);c&&c.node.type.spec.draggable&&c!=e.docView&&e.dispatch(e.state.tr.setSelection(ce.create(e.state.doc,c.posBefore)))}}let s=e.state.selection.content(),{dom:a,text:l}=JE(e,s);r.dataTransfer.clearData(),r.dataTransfer.setData(Rl?"Text":"text/html",a.innerHTML),r.dataTransfer.effectAllowed="copyMove",Rl||r.dataTransfer.setData("text/plain",l),e.dragging=new n6(s,!r[aC])};Er.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Cr.dragover=Cr.dragenter=(e,t)=>t.preventDefault();Cr.drop=(e,t)=>{let r=t,n=e.dragging;if(e.dragging=null,!r.dataTransfer)return;let o=e.posAtCoords(Dh(r));if(!o)return;let i=e.state.doc.resolve(o.pos),s=n&&n.slice;s?e.someProp("transformPasted",h=>{s=h(s,e)}):s=XE(e,r.dataTransfer.getData(Rl?"Text":"text/plain"),Rl?null:r.dataTransfer.getData("text/html"),!1,i);let a=!!(n&&!r[aC]);if(e.someProp("handleDrop",h=>h(e,r,s||K.empty,a))){r.preventDefault();return}if(!s)return;r.preventDefault();let l=s?rN(e.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=e.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&ce.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new ce(p));else{let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((m,b,v,g)=>h=g),c.setSelection(Lv(e,p,c.doc.resolve(h)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))};Er.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Qo(e)},20))};Er.blur=(e,t)=>{let r=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),r.relatedTarget&&e.dom.contains(r.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};Er.beforeinput=(e,t)=>{if(dr&&Jn&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:n}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=n||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",i=>i(e,$s(8,"Backspace")))))return;let{$cursor:o}=e.state.selection;o&&o.pos>0&&e.dispatch(e.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let e in Cr)Er[e]=Cr[e];function Hu(e,t){if(e==t)return!0;for(let r in e)if(e[r]!==t[r])return!1;for(let r in t)if(!(r in e))return!1;return!0}class Op{constructor(t,r){this.toDOM=t,this.spec=r||Js,this.side=this.spec.side||0}map(t,r,n,o){let{pos:i,deleted:s}=t.mapResult(r.from+o,this.side<0?-1:1);return s?null:new Ge(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof Op&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Hu(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class ji{constructor(t,r){this.attrs=t,this.spec=r||Js}map(t,r,n,o){let i=t.map(r.from+o,this.spec.inclusiveStart?-1:1)-n,s=t.map(r.to+o,this.spec.inclusiveEnd?1:-1)-n;return i>=s?null:new Ge(i,s,this)}valid(t,r){return r.from=t&&(!i||i(a.spec))&&n.push(a.copy(a.from+o,a.to+o))}for(let s=0;st){let a=this.children[s]+1;this.children[s+2].findInner(t-a,r-a,n,o+a,i)}}map(t,r,n){return this==lr||t.maps.length==0?this:this.mapInner(t,r,0,0,n||Js)}mapInner(t,r,n,o,i){let s;for(let a=0;a{let c=l+n,u;if(u=cC(r,a,c)){for(o||(o=this.children.slice());ia&&d.to=t){this.children[a]==t&&(n=this.children[a+2]);break}let i=t+1,s=i+r.content.size;for(let a=0;ai&&l.type instanceof ji){let c=Math.max(i,l.from)-i,u=Math.min(s,l.to)-i;co.map(t,r,Js));return Ni.from(n)}forChild(t,r){if(r.isLeaf)return Ee.empty;let n=[];for(let o=0;or instanceof Ee)?t:t.reduce((r,n)=>r.concat(n instanceof Ee?n:n.members),[]))}}}function o6(e,t,r,n,o,i,s){let a=e.slice();for(let c=0,u=i;c{let b=m-h-(p-f);for(let v=0;vg+u-d)continue;let y=a[v]+u-d;p>=y?a[v+1]=f<=y?-2:-1:h>=o&&b&&(a[v]+=b,a[v+1]+=b)}d+=b}),u=r.maps[c].map(u,-1)}let l=!1;for(let c=0;c=n.content.size){l=!0;continue}let f=r.map(e[c+1]+i,-1),p=f-o,{index:h,offset:m}=n.content.findIndex(d),b=n.maybeChild(h);if(b&&m==d&&m+b.nodeSize==p){let v=a[c+2].mapInner(r,b,u+1,e[c]+i+1,s);v!=lr?(a[c]=d,a[c+1]=p,a[c+2]=v):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=i6(a,e,t,r,o,i,s),u=_p(c,n,0,s);t=u.local;for(let d=0;dr&&s.to{let c=cC(e,a,l+r);if(c){i=!0;let u=_p(c,a,r+l+1,n);u!=lr&&o.push(l,l+a.nodeSize,u)}});let s=lC(i?uC(e):e,-r).sort(Xs);for(let a=0;a0;)t++;e.splice(t,0,r)}function vg(e){let t=[];return e.someProp("decorations",r=>{let n=r(e.state);n&&n!=lr&&t.push(n)}),e.cursorWrapper&&t.push(Ee.create(e.state.doc,[e.cursorWrapper.deco])),Ni.from(t)}const s6={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},a6=Ir&&Fi<=11;class l6{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class c6{constructor(t,r){this.view=t,this.handleDOMChange=r,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new l6,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let o=0;oo.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),a6&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,s6)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let r=0;rthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Dk(this.view)){if(this.suppressingSelectionUpdates)return Qo(this.view);if(Ir&&Fi<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&ia(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let r=new Set,n;for(let i=t.focusNode;i;i=Du(i))r.add(i);for(let i=t.anchorNode;i;i=Du(i))if(r.has(i)){n=i;break}let o=n&&this.view.docView.nearestDesc(n);if(o&&o.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let r=this.pendingRecords();r.length&&(this.queue=[]);let n=t.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Dk(t)&&!this.ignoreSelectionChange(n),i=-1,s=-1,a=!1,l=[];if(t.editable)for(let u=0;u1){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let d=u[0],f=u[1];d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}}let c=null;i<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||o)&&(i>-1&&(t.docView.markDirty(i,s),u6(t)),this.handleDOMChange(i,s,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||Qo(t),this.currentSelection.set(n))}registerMutation(t,r){if(r.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(n==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!n||n.ignoreMutation(t))return null;if(t.type=="childList"){for(let u=0;uo;b--){let v=n.childNodes[b-1],g=v.pmViewDesc;if(v.nodeName=="BR"&&!g){i=b;break}if(!g||g.size)break}let d=e.state.doc,f=e.someProp("domParser")||Cv.fromSchema(e.state.schema),p=d.resolve(s),h=null,m=f.parse(n,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:i,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:p6,context:p});if(c&&c[0].pos!=null){let b=c[0].pos,v=c[1]&&c[1].pos;v==null&&(v=b),h={anchor:b+s,head:v+s}}return{doc:m,sel:h,from:s,to:a}}function p6(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(Sr&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(e.parentNode.lastChild==e||Sr&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const h6=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function m6(e,t,r,n,o){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let C=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,M=zv(e,C);if(M&&!e.state.selection.eq(M)){if(dr&&Jn&&e.input.lastKeyCode===13&&Date.now()-100F(e,$s(13,"Enter"))))return;let N=e.state.tr.setSelection(M);C=="pointer"?N.setMeta("pointer",!0):C=="key"&&N.scrollIntoView(),i&&N.setMeta("composition",i),e.dispatch(N)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(r);t=s.before(a+1),r=e.state.doc.resolve(r).after(a+1);let l=e.state.selection,c=f6(e,t,r),u=e.state.doc,d=u.slice(c.from,c.to),f,p;e.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Jn)&&o.some(C=>C.nodeType==1&&!h6.test(C.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",C=>C(e,$s(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!h)if(n&&l instanceof le&&!l.empty&&l.$head.sameParent(l.$anchor)&&!e.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let C=Gk(e,e.state.doc,c.sel);if(C&&!C.eq(e.state.selection)){let M=e.state.tr.setSelection(C);i&&M.setMeta("composition",i),e.dispatch(M)}}return}if(dr&&e.cursorWrapper&&c.sel&&c.sel.anchor==e.cursorWrapper.deco.from&&c.sel.head==c.sel.anchor){let C=h.endB-h.start;c.sel={anchor:c.sel.anchor+C,head:c.sel.anchor+C}}e.input.domChangeCount++,e.state.selection.frome.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=c.from?h.start=e.state.selection.from:h.endA=e.state.selection.to-2&&e.state.selection.to<=c.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),Ir&&Fi<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let m=c.doc.resolveNoCache(h.start-c.from),b=c.doc.resolveNoCache(h.endB-c.from),v=u.resolve(h.start),g=m.sameParent(b)&&m.parent.inlineContent&&v.end()>=h.endA,y;if((Nl&&e.input.lastIOSEnter>Date.now()-225&&(!g||o.some(C=>C.nodeName=="DIV"||C.nodeName=="P"))||!g&&m.posC(e,$s(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>h.start&&v6(u,h.start,h.endA,m,b)&&e.someProp("handleKeyDown",C=>C(e,$s(8,"Backspace")))){Jn&&dr&&e.domObserver.suppressSelectionUpdates();return}dr&&Jn&&h.endB==h.start&&(e.input.lastAndroidDelete=Date.now()),Jn&&!g&&m.start()!=b.start()&&b.parentOffset==0&&m.depth==b.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,b=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{e.someProp("handleKeyDown",function(C){return C(e,$s(13,"Enter"))})},20));let x=h.start,k=h.endA,w,E,T;if(g){if(m.pos==b.pos)Ir&&Fi<=11&&m.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Qo(e),20)),w=e.state.tr.delete(x,k),E=u.resolve(h.start).marksAcross(u.resolve(h.endA));else if(h.endA==h.endB&&(T=g6(m.parent.content.cut(m.parentOffset,b.parentOffset),v.parent.content.cut(v.parentOffset,h.endA-v.start()))))w=e.state.tr,T.type=="add"?w.addMark(x,k,T.mark):w.removeMark(x,k,T.mark);else if(m.parent.child(m.index()).isText&&m.index()==b.index()-(b.textOffset?0:1)){let C=m.parent.textBetween(m.parentOffset,b.parentOffset);if(e.someProp("handleTextInput",M=>M(e,x,k,C)))return;w=e.state.tr.insertText(C,x,k)}}if(w||(w=e.state.tr.replace(x,k,c.doc.slice(h.start-c.from,h.endB-c.from))),c.sel){let C=Gk(e,w.doc,c.sel);C&&!(dr&&Jn&&e.composing&&C.empty&&(h.start!=h.endB||e.input.lastAndroidDeletet.content.size?null:Lv(e,t.resolve(r.anchor),t.resolve(r.head))}function g6(e,t){let r=e.firstChild.marks,n=t.firstChild.marks,o=r,i=n,s,a,l;for(let u=0;uu.mark(a.addToSet(u.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;ur||yg(s,!0,!1)0&&(t||e.indexAfter(n)==e.node(n).childCount);)n--,o++,t=!1;if(r){let i=e.node(n).maybeChild(e.indexAfter(n));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function y6(e,t,r,n,o){let i=e.findDiffStart(t,r);if(i==null)return null;let{a:s,b:a}=e.findDiffEnd(t,r+e.size,r+t.size);if(o=="end"){let l=Math.max(0,i-Math.min(s,a));n-=s+l-i}if(s=s?i-n:0;i-=l,a=i+(a-s),s=i}else if(a=a?i-n:0;i-=l,s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}class b6{constructor(t,r){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new HP,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=r,this.state=r.state,this.directPlugins=r.plugins||[],this.directPlugins.forEach(Zk),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Xk(this),Jk(this),this.nodeViews=Qk(this),this.docView=Nk(this.state.doc,Yk(this),vg(this),this.dom,this),this.domObserver=new c6(this,(n,o,i,s)=>m6(this,n,o,i,s)),this.domObserver.start(),BP(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let r in t)this._props[r]=t[r];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&B1(this);let r=this._props;this._props=t,t.plugins&&(t.plugins.forEach(Zk),this.directPlugins=t.plugins),this.updateStateInner(t.state,r)}setProps(t){let r={};for(let n in this._props)r[n]=this._props[n];r.state=this.state;for(let n in t)r[n]=t[n];this.update(r)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,r){let n=this.state,o=!1,i=!1;t.storedMarks&&this.composing&&(sC(this),i=!0),this.state=t;let s=n.plugins!=t.plugins||this._props.plugins!=r.plugins;if(s||this._props.plugins!=r.plugins||this._props.nodeViews!=r.nodeViews){let f=Qk(this);k6(f,this.nodeViews)&&(this.nodeViews=f,o=!0)}(s||r.handleDOMEvents!=this._props.handleDOMEvents)&&B1(this),this.editable=Xk(this),Jk(this);let a=vg(this),l=Yk(this),c=n.plugins!=t.plugins&&!n.doc.eq(t.doc)?"reset":t.scrollToSelection>n.scrollToSelection?"to selection":"preserve",u=o||!this.docView.matchesNode(t.doc,l,a);(u||!t.selection.eq(n.selection))&&(i=!0);let d=c=="preserve"&&i&&this.dom.style.overflowAnchor==null&&eP(this);if(i){this.domObserver.stop();let f=u&&(Ir||dr)&&!this.composing&&!n.selection.empty&&!t.selection.empty&&x6(n.selection,t.selection);if(u){let p=dr?this.trackWrites=this.domSelectionRange().focusNode:null;(o||!this.docView.update(t.doc,l,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Nk(t.doc,l,a,this.dom,this)),p&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&CP(this))?Qo(this,f):(qE(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():d&&tP(d)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",r=>r(this)))if(this.state.selection instanceof ce){let r=this.docView.domAfterPos(this.state.selection.from);r.nodeType==1&&Ck(this,r.getBoundingClientRect(),t)}else Ck(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let r=0;rr.ownerDocument.getSelection()),this._root=r}return t||document}updateRoot(){this._root=null}posAtCoords(t){return aP(this,t)}coordsAtPos(t,r=1){return HE(this,t,r)}domAtPos(t,r=0){return this.docView.domFromPos(t,r)}nodeDOM(t){let r=this.docView.descAt(t);return r?r.nodeDOM:null}posAtDOM(t,r,n=-1){let o=this.docView.posFromDOM(t,r,n);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(t,r){return fP(this,r||this.state,t)}pasteHTML(t,r){return $u(this,"",t,!1,r||new ClipboardEvent("paste"))}pasteText(t,r){return $u(this,t,null,!0,r||new ClipboardEvent("paste"))}destroy(){this.docView&&(FP(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],vg(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(t){return jP(this,t)}dispatch(t){let r=this._props.dispatchTransaction;r?r.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return Sr&&this.root.nodeType===11&&qR(this.dom.ownerDocument)==this.dom?d6(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function Yk(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",r=>{if(typeof r=="function"&&(r=r(e.state)),r)for(let n in r)n=="class"?t.class+=" "+r[n]:n=="style"?t.style=(t.style?t.style+";":"")+r[n]:!t[n]&&n!="contenteditable"&&n!="nodeName"&&(t[n]=String(r[n]))}),t.translate||(t.translate="no"),[Ge.node(0,e.state.doc.content.size,t)]}function Jk(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Ge.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Xk(e){return!e.someProp("editable",t=>t(e.state)===!1)}function x6(e,t){let r=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(r)!=t.$anchor.start(r)}function Qk(e){let t=Object.create(null);function r(n){for(let o in n)Object.prototype.hasOwnProperty.call(t,o)||(t[o]=n[o])}return e.someProp("nodeViews",r),e.someProp("markViews",r),t}function k6(e,t){let r=0,n=0;for(let o in e){if(e[o]!=t[o])return!0;r++}for(let o in t)n++;return r!=n}function Zk(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var w6=e=>{if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")};const S6=Dn(w6);var dC=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},ge=(e,t,r)=>(dC(e,t,"read from private field"),r?r.call(e):t.get(e)),Io=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},qe=(e,t,r,n)=>(dC(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);function E6(e){return!!(e.prev&&e.next&&e.prev.text.full!==e.next.text.full)}function C6(e){return!!(e.prev&&e.next&&e.prev.range.cursor!==e.next.range.cursor)}function M6(e){return!!(!e.prev&&e.next)}function T6(e){return!!(e.prev&&!e.next)}function O6(e){return!!(e.prev&&e.next&&e.prev.range.from!==e.next.range.from)}function _6(e){return e==="invalid-exit-split"}var A6=["jump-backward-exit","jump-forward-exit"],N6=["jump-backward-change","jump-forward-change"];function R6(e){var t,r;return fr(A6,(t=e.exit)==null?void 0:t.exitReason)||fr(N6,(r=e.change)==null?void 0:r.changeReason)}function e2(e){return!!(e&&e.query.full.length>=e.suggester.matchOffset)}function t2(e){return Zt(e)&&e instanceof le}function Pr(e){const{match:t,changeReason:r,exitReason:n}=e;return{...t,changeReason:r,exitReason:n}}function P6(e,t){const{invalidPrefixCharacters:r,validPrefixCharacters:n}=t;return r?!new RegExp(V1(r)).test(e):new RegExp(V1(n)).test(e)}function z6(e){const{text:t,regexp:r,$pos:n,suggester:o}=e,i=n.start();let s;return xa(t,r).forEach(a=>{const l=a.input.slice(Math.max(0,a.index-1),a.index);if(P6(l,o)){const c=a.index+i,u=a[0],d=a[1];if(!ne(u)||!ne(d))return;const f=c+u.length,p=Math.min(f,n.pos),h=p-c;c=n.pos&&(s={range:{from:c,to:f,cursor:p},match:a,query:{partial:u.slice(d.length,h),full:u.slice(d.length)},text:{partial:u.slice(0,h),full:u},textAfter:n.doc.textBetween(f,n.end(),zi,zi),textBefore:n.doc.textBetween(i,c,zi,zi),suggester:o})}}),s}function fC(e){const{$pos:t,suggester:r}=e,{char:n,name:o,startOfLine:i,supportedCharacters:s,matchOffset:a,multiline:l,caseInsensitive:c,unicode:u}=r,d=j6({char:n,matchOffset:a,startOfLine:i,supportedCharacters:s,multiline:l,caseInsensitive:c,unicode:u}),f=t.doc.textBetween(t.before(),t.end(),zi,zi);return z6({suggester:r,text:f,regexp:d,$pos:t,char:n,name:o})}function pC(e){const{state:t,match:r}=e;try{return fC({$pos:t.doc.resolve(r.range.cursor),suggester:r.suggester})}catch{return}}function hC(e){const{prev:t,next:r,state:n}=e;return!r&&t.range.from>=n.doc.nodeSize?{exit:Pr({match:t,exitReason:"delete"})}:!r||!t.query.partial?{exit:Pr({match:t,exitReason:"invalid-exit-split"})}:t.range.to===r.range.cursor?{exit:Pr({match:r,exitReason:"exit-end"})}:t.query.partial?{exit:Pr({match:r,exitReason:"exit-split"})}:{}}function L6(e){const{prev:t,next:r,state:n}=e,o=ee(),i=pC({state:n,match:t}),{exit:s}=i&&i.query.full!==t.query.full?hC({prev:t,next:i,state:n}):o;return t.range.from=t.range.to)?{exit:Pr({match:t,exitReason:"selection-outside"})}:n.pos>t.range.to?{exit:Pr({match:t,exitReason:"move-end"})}:n.pos<=t.range.from?{exit:Pr({match:t,exitReason:"move-start"})}:{}}function D6(e){const{prev:t,next:r,state:n,$pos:o}=e,i=ee();if(!t&&!r)return i;const s={prev:t,next:r};return O6(s)?L6({prev:s.prev,next:s.next,state:n}):M6(s)?{change:Pr({match:s.next,changeReason:"start"})}:T6(s)?I6({$pos:o,match:s.prev,state:n}):E6(s)?{change:Pr({match:s.next,changeReason:"change-character"})}:C6(s)?{change:Pr({match:s.next,changeReason:n.selection.empty?"move":"selection-inside"})}:i}function r2(e,t){for(let r=e.depth;r>0;r--){const n=e.node(r);if(t.includes(n.type.name))return!0}return!1}function F1(e,t){const{$from:r,$to:n}=e;return mC(e,t)?!0:Ev(r.pos,n.pos).some(o=>$6(r.doc.resolve(o),t))}function mC(e,t){const{$from:r,$to:n}=e,o=new Set((r.marksAcross(n)??[]).map(i=>i.type.name));return t.some(i=>o.has(i))}function $6(e,t){const r=new Set(e.marks().map(n=>n.type.name));return t.some(n=>r.has(n))}function H6(e,t){const{$cursor:r}=t,{validMarks:n,validNodes:o,invalidMarks:i,invalidNodes:s}=e;return!n&&!o&&Mo(i)&&Mo(s)?!0:!(n&&!mC(t,n)||o&&!r2(r,o)||!n&&F1(t,i)||!o&&r2(r,s))}function n2(e){const{suggesters:t,$pos:r,selectionEmpty:n}=e;for(const o of t)if(!(o.emptySelectionsOnly&&!n))try{const i=fC({suggester:o,$pos:r});if(!i)continue;const s={$from:r.doc.resolve(i.range.from),$to:r.doc.resolve(i.range.to),$cursor:r};if(H6(o,s)&&o.isValidPosition(s,i))return i}catch{}}function V1(e){return lA(e)?e.source:e}function B6(e){return e?"^":""}function F6(e,t){return`(?:${V1(e)}){${t},}`}function V6(e){return ne(e)?new RegExp(S6(e)):e}function j6(e){const{char:t,matchOffset:r,startOfLine:n,supportedCharacters:o,captureChar:i=!0,caseInsensitive:s=!1,multiline:a=!1,unicode:l=!1}=e,c=`g${a?"m":""}${s?"i":""}${l?"u":""}`;let u=V6(t).source;return i&&(u=`(${u})`),new RegExp(`${B6(n)}${u}${F6(o,r)}`,c)}var U6={appendTransaction:!1,priority:50,ignoredTag:"span",matchOffset:0,disableDecorations:!1,startOfLine:!1,suggestClassName:"suggest",suggestTag:"span",supportedCharacters:/\w+/,validPrefixCharacters:/^[\s\0]?$/,invalidPrefixCharacters:null,ignoredClassName:null,invalidMarks:[],invalidNodes:[],validMarks:null,validNodes:null,isValidPosition:()=>!0,checkNextValidSelection:null,emptySelectionsOnly:!1,caseInsensitive:!1,multiline:!1,unicode:!1,captureChar:!0},gC="__ignore_prosemirror_suggest_update__",Df,Dc,zt,wi,ja,po,Ot,Si,Ua,vC=class{constructor(e){Io(this,Df,!1),Io(this,Dc,!1),Io(this,zt,void 0),Io(this,wi,void 0),Io(this,ja,void 0),Io(this,po,ee()),Io(this,Ot,Ee.empty),Io(this,Si,!1),Io(this,Ua,!1),this.setMarkRemoved=()=>{qe(this,Si,!0)},this.findNextTextSelection=r=>{const n=r.$from.doc,o=Math.min(n.nodeSize-2,r.to+1),i=n.resolve(o),s=be.findFrom(i,1,!0);if(t2(s))return s},this.ignoreNextExit=()=>{qe(this,Dc,!0)},this.addIgnored=({from:r,name:n,specific:o=!1})=>{const i=ge(this,zt).find(u=>u.name===n);if(!i)throw new Error(`No suggester exists for the name provided: ${n}`);const s=ne(i.char)?i.char.length:1,a=r+s,l=i.ignoredClassName?{class:i.ignoredClassName}:{},c=Ge.inline(r,a,{nodeName:i.ignoredTag,...l},{name:n,specific:o,char:i.char});qe(this,Ot,ge(this,Ot).add(this.view.state.doc,[c]))},this.removeIgnored=({from:r,name:n})=>{const o=ge(this,zt).find(a=>a.name===n);if(!o)throw new Error(`No suggester exists for the name provided: ${n}`);const i=ne(o.char)?o.char.length:1,s=ge(this,Ot).find(r,r+i)[0];!s||s.spec.name!==n||qe(this,Ot,ge(this,Ot).remove([s]))},this.clearIgnored=r=>{if(!r){qe(this,Ot,Ee.empty);return}const o=ge(this,Ot).find().filter(({spec:i})=>i.name===r);qe(this,Ot,ge(this,Ot).remove(o))},this.findMatchAtPosition=(r,n)=>{const o=n?ge(this,zt).filter(i=>i.name===n):ge(this,zt);return n2({suggesters:o,$pos:r,docChanged:!1,selectionEmpty:!0})},this.setLastChangeFromAppend=()=>{qe(this,Ua,!0)};const t=o2();qe(this,zt,e.map(t)),qe(this,zt,ra(ge(this,zt),(r,n)=>n.priority-r.priority))}static create(e){return new vC(e)}get decorationSet(){return ge(this,Ot)}get removed(){return ge(this,Si)}get match(){return ge(this,wi)?ge(this,wi):ge(this,ja)&&ge(this,po).exit?ge(this,ja):void 0}init(e){return this.view=e,this}createProps(e){const{name:t,char:r}=e.suggester;return{view:this.view,addIgnored:this.addIgnored,clearIgnored:this.clearIgnored,ignoreNextExit:this.ignoreNextExit,setMarkRemoved:this.setMarkRemoved,name:t,char:r,...e}}shouldRunExit(){return ge(this,Dc)?(qe(this,Dc,!1),!1):!0}updateWithNextSelection(e){var t,r,n;const o=this.findNextTextSelection(e.selection);if(o)for(const i of ge(this,zt)){const s=(t=ge(this,po).change)==null?void 0:t.suggester.name,a=(r=ge(this,po).exit)==null?void 0:r.suggester.name;(n=i.checkNextValidSelection)==null||n.call(i,o.$from,e,{change:s,exit:a})}}changeHandler(e,t){const{change:r,exit:n}=ge(this,po),o=this.match;if(!r&&!n||!e2(o))return;const i=t===(n==null?void 0:n.suggester.appendTransaction)&&this.shouldRunExit(),s=t===(r==null?void 0:r.suggester.appendTransaction);if(!(!i&&!s)){if(r&&n&&R6({change:r,exit:n})){const a=this.createProps(n),l=this.createProps(r),c=n.range.from{const a=ne(s.char)?s.char.length:1;return i-o!==a});qe(this,Ot,t.remove(n))}shouldIgnoreMatch({range:e,suggester:{name:t}}){return ge(this,Ot).find().some(({spec:o,from:i})=>i!==e.from?!1:o.specific?o.name===t:!0)}resetState(){qe(this,po,ee()),qe(this,wi,void 0),qe(this,Si,!1),qe(this,Ua,!1)}updateReasons(e){const{$pos:t,state:r}=e,n=ge(this,Df),o=ge(this,zt),i=r.selection.empty,s=t2(r.selection)?n2({suggesters:o,$pos:t,docChanged:n,selectionEmpty:i}):void 0;qe(this,wi,s&&this.shouldIgnoreMatch(s)?void 0:s),qe(this,po,D6({next:ge(this,wi),prev:ge(this,ja),state:r,$pos:t}))}addSuggester(e){const t=ge(this,zt).find(n=>n.name===e.name),r=o2();if(t)qe(this,zt,ge(this,zt).map(n=>n===t?r(e):n));else{const n=[...ge(this,zt),r(e)];qe(this,zt,ra(n,(o,i)=>i.priority-o.priority))}return()=>this.removeSuggester(e.name)}removeSuggester(e){const t=ne(e)?e:e.name;qe(this,zt,ge(this,zt).filter(r=>r.name!==t)),this.clearIgnored(t)}toJSON(){return this.match}apply(e){const{exit:t,change:r}=ge(this,po);if(ge(this,Ua)&&(qe(this,Ua,!1),!(t!=null&&t.suggester.appendTransaction)&&!(r!=null&&r.suggester.appendTransaction)))return this;const{tr:n,state:o}=e,i=n.docChanged||n.selectionSet;return n.getMeta(gC)||!i&&!ge(this,Si)?this:(qe(this,Df,n.docChanged),this.mapIgnoredDecorations(n),t&&this.resetState(),qe(this,ja,ge(this,wi)),this.updateReasons({$pos:n.selection.$from,state:o}),this)}createDecorations(e){const t=this.match;if(!e2(t))return ge(this,Ot);const{disableDecorations:r}=t.suggester;if(_e(r)?r(e,t):r)return ge(this,Ot);const{range:o,suggester:i}=t,{name:s,suggestTag:a,suggestClassName:l}=i,{from:c,to:u}=o;return this.shouldIgnoreMatch(t)?ge(this,Ot):ge(this,Ot).add(e.doc,[Ge.inline(c,u,{nodeName:a,class:s?`${l} suggest-${s}`:l},{name:s})])}},W6=vC;Df=new WeakMap;Dc=new WeakMap;zt=new WeakMap;wi=new WeakMap;ja=new WeakMap;po=new WeakMap;Ot=new WeakMap;Si=new WeakMap;Ua=new WeakMap;function o2(){const e=new Set;return t=>{if(e.has(t.name))throw new Error(`A suggester already exists with the name '${t.name}'. The name provided must be unique.`);const r={...U6,...t};return e.add(t.name),r}}var yC=new ka("suggest");function Fv(e){return yC.getState(e)}function i2(e,t){return Fv(e).addSuggester(t)}function s2(e){e.setMeta(gC,!0)}function K6(e,t){return Fv(e).removeSuggester(t)}function q6(...e){const t=W6.create(e);return new Ro({key:yC,view:r=>(t.init(r),{update:n=>t.changeHandler(n.state.tr,!1)}),state:{init:()=>t,apply:(r,n,o,i)=>t.apply({tr:r,state:i})},appendTransaction:(r,n,o)=>{const i=o.tr;return t.updateWithNextSelection(i),t.changeHandler(i,!0),i.docChanged||i.steps.length>0||i.selectionSet||i.storedMarksSet?(t.setLastChangeFromAppend(),i):null},props:{decorations:r=>t.createDecorations(r)}})}function Vv(e,t){const r=Object.getPrototypeOf(t);let n=e.selection,o=e.doc,i=e.storedMarks;const s=ee();for(const[a,l]of Object.entries(t))s[a]={value:l};return Object.create(r,{...s,storedMarks:{get(){return i}},selection:{get(){return n}},doc:{get(){return o}},tr:{get(){return n=e.selection,o=e.doc,i=e.storedMarks,e}}})}function bu(e){return({state:t,dispatch:r,view:n,tr:o})=>e(Vv(o,t),r,n)}function a2(e){return t=>{var r;return te(t.dispatch===void 0||t.dispatch===((r=t.view)==null?void 0:r.dispatch),{code:H.NON_CHAINABLE_COMMAND}),e(t)}}function G6(...e){return({state:t,dispatch:r,view:n,tr:o,...i})=>{for(const s of e)if(s({state:t,dispatch:r,view:n,tr:o,...i}))return!0;return!1}}var on={get isBrowser(){return!!(typeof window<"u"&&typeof window.document<"u"&&window.navigator&&window.navigator.userAgent)},get isJSDOM(){return on.isBrowser&&window.navigator.userAgent.includes("jsdom")},get isNode(){return typeof process<"u"&&process.versions!=null&&process.versions.node!=null},get isIos(){return on.isBrowser&&/iPod|iPhone|iPad/.test(navigator.platform)},get isMac(){return on.isBrowser&&/Mac|iPod|iPhone|iPad/.test(navigator.platform)},get isApple(){return on.isNode?process.platform==="darwin":on.isBrowser?/Mac|iPod|iPhone|iPad/.test(window.navigator.platform):!1},get isDevelopment(){return!1},get isTest(){return!1},get isProduction(){return!0}};function kn(e,t){var r;const n=RC(e);return((r=n==null?void 0:n.getComputedStyle(e))==null?void 0:r.getPropertyValue(t))??""}function ar(e,t){return Object.assign(e.style,t)}var Y6=["px","rem","em","in","q","mm","cm","pt","pc","vh","vw","vmin","vmax"],J6=/[\d-.]+(\w+)$/;function $f(e="0"){const t=e||"0",r=Number.parseFloat(t),n=t.match(J6),o=((n==null?void 0:n[1])??"px").toLowerCase();return[r,fr(Y6,o)?o:"px"]}var Cn=96,hl=25.4,bC=72,xC=6;function Pl(e){if(Je(e))return kn(e,"font-size")||Pl(e.parentElement);const t=RC(e);return t?kn(t.document.documentElement,"font-size"):""}function X6(e){const t=zC(e),r=t.document.documentElement||t.document.body;return(n,o)=>{switch(o){case"rem":return n*Qs(Pl(r));case"em":return n*Qs(Pl(e),e==null?void 0:e.parentElement);case"in":return n*Cn;case"q":return n*Cn/hl/4;case"mm":return n*Cn/hl;case"cm":return n*Cn*10/hl;case"pt":return n*Cn/bC;case"pc":return n*Cn/xC;case"vh":return(n*t.innerHeight||r.clientWidth)/100;case"vw":return(n*t.innerWidth||r.clientHeight)/100;case"vmin":return n*Math.min(t.innerWidth||r.clientWidth,t.innerHeight||r.clientHeight)/100;case"vmax":return n*Math.max(t.innerWidth||r.clientWidth,t.innerHeight||r.clientHeight)/100;default:return n}}}var Hf=/^([a-z]+)\((.+)\)$/i;function kC(e,t){if(!Hf.test(e))return Number.NaN;const r=SN(e,{brackets:["()"],escape:"_",flat:!0});if(!r||r.length===0)return Number.NaN;function n(i){return i.replace(/_(\d+)_/g,(s,a)=>{const l=Number.parseFloat(a);return r[l]??""})}const o=Zo(r,0);for(const i of xa(o,Hf)){const s=Zo(i,1),c=n(Zo(i,2)).split(/\s*,\s*/).map(u=>{if(Hf.test(u)){const d=n(u);return kC(d,t)}return wC(u,t)});switch(s){case"min":return Math.min(...c);case"max":return Math.max(...c);case"clamp":{const[u,d,f]=c;if(Jt(u)&&Jt(d)&&Jt(f))return Ad({min:u,max:f,value:d});break}case"calc":return Number.NaN;default:return Number.NaN}}return Number.NaN}function wC(e,t){const[r,n]=$f(e);return t(r,n)}function Qs(e,t){const r=X6(t);return Hf.test(e)?kC(e.toLowerCase(),r):wC(e,r)}function bg(e,t,r){const n=zC(r),o=n.document.documentElement||n.document.body,i=Qs(e,r);switch(t){case"px":return i;case"rem":return i/Qs(Pl(o));case"em":return i*Qs(Pl(r),r==null?void 0:r.parentElement);case"in":return i/Cn;case"q":return i/Cn*hl*4;case"mm":return i/Cn*hl;case"cm":return i/Cn/10*hl;case"pt":return i/Cn*bC;case"pc":return i/Cn*xC;case"vh":return i/(n.innerHeight||o.clientWidth)*100;case"vw":return i/(n.innerWidth||o.clientHeight)*100;case"vmin":return i/Math.min(n.innerWidth||o.clientWidth,n.innerHeight||o.clientHeight)*100;case"vmax":return i/Math.max(n.innerWidth||o.clientWidth,n.innerHeight||o.clientHeight)*100;default:return i}}function Ap(e){return Zt(e)&&Jt(e.nodeType)&&ne(e.nodeName)}function Je(e){return Ap(e)&&e.nodeType===1}function Q6(e){return Ap(e)&&e.nodeType===3}function $h(e){const{types:t,node:r}=e;if(!r)return!1;const n=o=>o===r.type||o===r.type.name;return ct(t)?t.some(n):n(t)}function Z6(e,t){const{tr:r}=t;return e.forEach(n=>{n.steps.forEach(o=>{r.step(o)})}),r}function ez({pos:e,tr:t}){const r=t.doc.nodeAt(e);return r&&t.delete(e,e+r.nodeSize),t}function tz({pos:e,tr:t,content:r}){const n=t.doc.nodeAt(e);return n&&t.replaceWith(e,e+n.nodeSize,r),t}function Ld(e){const{predicate:t,selection:r}=e,n=CC(r)?r.selection.$from:Wv(r)?r.$from:r;for(let o=n.depth;o>0;o--){const i=n.node(o),s=o>0?n.before(o):0,a=n.start(o),l=s+i.nodeSize;if(t(i,s))return{pos:s,depth:o,node:i,start:a,end:l}}}function rz(e){const{depth:t}=e,r=t>0?e.before(t):0,n=e.node(t),o=e.start(t),i=r+n.nodeSize;return{pos:r,start:o,node:n,end:i,depth:t}}function nz(e){const t=Ld({predicate:()=>!0,selection:e});return te(t,{message:"No parent node found for the selection provided."}),t}function ts(e){const{types:t,selection:r}=e;return Ld({predicate:n=>$h({types:t,node:n}),selection:r})}function oz(e){const{types:t,selection:r}=e;if(!(!Dd(r)||!$h({types:t,node:r.node})))return{pos:r.$from.pos,depth:r.$from.depth,start:r.$from.start(),end:r.$from.pos+r.node.nodeSize,node:r.node}}function jv(e){return Wv(e)?e.empty:e.selection.empty}function iz(e){return e.docChanged||e.selectionSet}function SC(e){return!!Bu(e)}function Bu(e){const{state:t,type:r,attrs:n}=e,{selection:o,doc:i}=t,s=ne(r)?i.type.schema.nodes[r]:r;te(s,{code:H.SCHEMA,message:`No node exists for ${r}`});const a=oz({selection:o,types:r})??Ld({predicate:l=>l.type===s,selection:o});return!n||gp(n)||!a||a.node.hasMarkup(s,{...a.node.attrs,...n})?a:void 0}function Np(...e){return t=>{if(!Qx(e))return!1;const[r,...n]=e;let o=!1;const i=(...l)=>()=>{if(!Qx(l))return!1;o=!0;const[,...c]=l;return Np(...l)({...t,next:i(...c)})},s=i(...n),a=r({...t,next:s});return o||a?a:s()}}function sz(e,t){const r=new Map,n=ee();for(const o of e)for(const[i,s]of At(o)){const l=[...r.get(i)??[],s],c=Np(...l);r.set(i,l),n[i]=t(c)}return n}function az(e){return sz(e,t=>(r,n,o)=>t({state:r,dispatch:n,view:o,tr:r.tr,next:()=>!1}))}function Uv(e,t){const r=e.attrs??{};return Object.entries(t).every(([n,o])=>r[n]===o)}function lz(e){return TC(e,[Ko,bt,Dt,eo])}function oc(e){return Zt(e)}function ic(e,t){return ct(t)?fr(t,e[ti]):t===e[ti]}function cz(e){return Zt(e)&&e instanceof T1}function uz(e,t){return ne(e)?it(t.nodes,e):e}function EC(e){return Zt(e)&&e instanceof Nd}function dz(e,t){return ne(e)?it(t.marks,e):e}function Id(e){return Zt(e)&&e instanceof Bi}function fz(e){return Zt(e)&&e instanceof R}function pz(e){return Zt(e)&&e instanceof Te}function CC(e){return Zt(e)&&e instanceof Bs}function gs(e){return Zt(e)&&e instanceof le}function hz(e){return Zt(e)&&e instanceof kr}function Wv(e){return Zt(e)&&e instanceof be}function mz(e){return Zt(e)&&e instanceof Tl}function l2(e){const{trState:t,from:r,to:n,type:o,attrs:i={}}=e,{doc:s}=t,a=dz(o,s.type.schema);if(Object.keys(i).length===0)return s.rangeHasMark(r,n,a);let l=!1;return n>r&&s.nodesBetween(r,n,c=>l?!1:(l=(c.marks??[]).some(d=>d.type!==a?!1:Uv(d,i)),!l)),l}function Dd(e){return Zt(e)&&e instanceof ce}function Rp(e){const{trState:t,type:r,attrs:n={},from:o,to:i}=e,{selection:s,doc:a,storedMarks:l}=t,c=ne(r)?a.type.schema.marks[r]:r;if(te(c,{code:H.SCHEMA,message:`Mark type: ${r} does not exist on the current schema.`}),o&&i)try{return Math.max(o,i)d.type!==r?!1:Uv(d,n??{})):l2({...e,from:s.from,to:s.to})}function Kv(e,t={}){const r=gz(e.type.schema);if(!r)return!1;const{ignoreAttributes:n,ignoreDocAttributes:o}=t;return n?MC(r,e):o?r.content.eq(e.content):r.eq(e)}function MC(e,t){if(e===t)return!0;const r=e.type===t.type&&Te.sameSet(e.marks,t.marks);function n(){if(e.content===t.content)return!0;if(e.content.size!==t.content.size)return!1;const o=[],i=[];e.content.forEach(s=>o.push(s)),t.content.forEach(s=>i.push(s));for(const[s,a]of o.entries()){const l=i[s];if(!l||!MC(a,l))return!1}return!0}return r&&n()}function gz(e){var t;return((t=e.nodes.doc)==null?void 0:t.createAndFill())??void 0}function Hh(e){for(const t of Object.values(e.nodes))if(t.name!=="doc"&&(t.isBlock||t.isTextblock))return t;te(!1,{code:H.SCHEMA,message:"No default block node found for the provided schema."})}function vz(e){return e.type===Hh(e.type.schema)}function Bh(e){return!!e&&e.type.isBlock&&!e.textContent&&!e.childCount}function _o(e,t,r){const n=e.parent.childAfter(e.parentOffset);if(!n.node)return;const o=ne(t)?t:t.name,i=n.node.marks.find(({type:d})=>d.name===o);let s=e.index(),a=e.start()+n.offset,l=s+1,c=a+n.node.nodeSize;if(!i)return r&&c0&&i.isInSet(e.parent.child(s-1).marks);)s-=1,a-=e.parent.child(s).nodeSize;for(;l{t=f(t,i||n,e)}),i)return t?new K(R.from(e.state.schema.text(t.replace(/\r\n?/g,` +`))),0,0):K.empty;let d=e.someProp("clipboardTextParser",f=>f(t,o,n,e));if(d)a=d;else{let f=o.marks(),{schema:p}=e.state,h=an.fromSchema(p);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(m=>{let b=s.appendChild(document.createElement("p"));m&&b.appendChild(h.serializeNode(p.text(m,f)))})}}else e.someProp("transformPastedHTML",d=>{r=d(r,e)}),s=IP(r),Pd&&DP(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||Mv.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!zP.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)a=$P(Uk(a,+u[1],+u[2]),u[4]);else if(a=K.maxOpen(LP(a.content,o),!0),a.openStart||a.openEnd){let d=0,f=0;for(let p=a.content.firstChild;d{a=d(a,e)}),a}const zP=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function LP(e,t){if(e.childCount<2)return e;for(let r=t.depth;r>=0;r--){let o=t.node(r).contentMatchAt(t.index(r)),i,s=[];if(e.forEach(a=>{if(!s)return;let l=o.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&i.length&&eC(l,i,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=tC(s[s.length-1],i.length));let u=ZE(a,l);s.push(u),o=o.matchType(u.type),i=l}}),s)return R.from(s)}return e}function ZE(e,t,r=0){for(let n=t.length-1;n>=r;n--)e=t[n].create(null,R.from(e));return e}function eC(e,t,r,n,o){if(o1&&(i=0),o=r&&(a=t<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(R.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Uk(e,t,r){return t]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let r=nC().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(e),o;if((o=n&&rC[n[1].toLowerCase()])&&(e=o.map(i=>"<"+i+">").join("")+e+o.map(i=>"").reverse().join("")),r.innerHTML=e,o)for(let i=0;i=0;a-=2){let l=r.nodes[n[a]];if(!l||l.hasRequiredAttrs())break;o=R.from(l.create(n[a+1],o)),i++,s++}return new K(o,i,s)}const Er={},Cr={},HP={touchstart:!0,touchmove:!0};class BP{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function FP(e){for(let t in Er){let r=Er[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=n=>{jP(e,n)&&!Dv(e,n)&&(e.editable||!(n.type in Cr))&&r(e,n)},HP[t]?{passive:!0}:void 0)}Sr&&e.dom.addEventListener("input",()=>null),F1(e)}function Di(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function VP(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function F1(e){e.someProp("handleDOMEvents",t=>{for(let r in t)e.input.eventHandlers[r]||e.dom.addEventListener(r,e.input.eventHandlers[r]=n=>Dv(e,n))})}function Dv(e,t){return e.someProp("handleDOMEvents",r=>{let n=r[t.type];return n?n(e,t)||t.defaultPrevented:!1})}function jP(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let r=t.target;r!=e.dom;r=r.parentNode)if(!r||r.nodeType==11||r.pmViewDesc&&r.pmViewDesc.stopEvent(t))return!1;return!0}function UP(e,t){!Dv(e,t)&&Er[t.type]&&(e.editable||!(t.type in Cr))&&Er[t.type](e,t)}Cr.keydown=(e,t)=>{let r=t;if(e.input.shiftKey=r.keyCode==16||r.shiftKey,!iC(e,r)&&(e.input.lastKeyCode=r.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Jn&&dr&&r.keyCode==13)))if(r.keyCode!=229&&e.domObserver.forceFlush(),Nl&&r.keyCode==13&&!r.ctrlKey&&!r.altKey&&!r.metaKey){let n=Date.now();e.input.lastIOSEnter=n,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==n&&(e.someProp("handleKeyDown",o=>o(e,Ds(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",n=>n(e,r))||PP(e,r)?r.preventDefault():Di(e,"key")};Cr.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Cr.keypress=(e,t)=>{let r=t;if(iC(e,r)||!r.charCode||r.ctrlKey&&!r.altKey||wn&&r.metaKey)return;if(e.someProp("handleKeyPress",o=>o(e,r))){r.preventDefault();return}let n=e.state.selection;if(!(n instanceof le)||!n.$from.sameParent(n.$to)){let o=String.fromCharCode(r.charCode);!/[\r\n]/.test(o)&&!e.someProp("handleTextInput",i=>i(e,n.$from.pos,n.$to.pos,o))&&e.dispatch(e.state.tr.insertText(o).scrollIntoView()),r.preventDefault()}};function $h(e){return{left:e.clientX,top:e.clientY}}function WP(e,t){let r=t.x-e.clientX,n=t.y-e.clientY;return r*r+n*n<100}function $v(e,t,r,n,o){if(n==-1)return!1;let i=e.state.doc.resolve(n);for(let s=i.depth+1;s>0;s--)if(e.someProp(t,a=>s>i.depth?a(e,r,i.nodeAfter,i.before(s),o,!0):a(e,r,i.node(s),i.before(s),o,!1)))return!0;return!1}function pl(e,t,r){e.focused||e.focus();let n=e.state.tr.setSelection(t);r=="pointer"&&n.setMeta("pointer",!0),e.dispatch(n)}function KP(e,t){if(t==-1)return!1;let r=e.state.doc.resolve(t),n=r.nodeAfter;return n&&n.isAtom&&ce.isSelectable(n)?(pl(e,new ce(r),"pointer"),!0):!1}function qP(e,t){if(t==-1)return!1;let r=e.state.selection,n,o;r instanceof ce&&(n=r.node);let i=e.state.doc.resolve(t);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(ce.isSelectable(a)){n&&r.$from.depth>0&&s>=r.$from.depth&&i.before(r.$from.depth+1)==r.$from.pos?o=i.before(r.$from.depth):o=i.before(s);break}}return o!=null?(pl(e,ce.create(e.state.doc,o),"pointer"),!0):!1}function GP(e,t,r,n,o){return $v(e,"handleClickOn",t,r,n)||e.someProp("handleClick",i=>i(e,t,n))||(o?qP(e,r):KP(e,r))}function YP(e,t,r,n){return $v(e,"handleDoubleClickOn",t,r,n)||e.someProp("handleDoubleClick",o=>o(e,t,n))}function JP(e,t,r,n){return $v(e,"handleTripleClickOn",t,r,n)||e.someProp("handleTripleClick",o=>o(e,t,n))||XP(e,r,n)}function XP(e,t,r){if(r.button!=0)return!1;let n=e.state.doc;if(t==-1)return n.inlineContent?(pl(e,le.create(n,0,n.content.size),"pointer"),!0):!1;let o=n.resolve(t);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)pl(e,le.create(n,a+1,a+1+s.content.size),"pointer");else if(ce.isSelectable(s))pl(e,ce.create(n,a),"pointer");else continue;return!0}}function Hv(e){return Op(e)}const oC=wn?"metaKey":"ctrlKey";Er.mousedown=(e,t)=>{let r=t;e.input.shiftKey=r.shiftKey;let n=Hv(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&WP(r,e.input.lastClick)&&!r[oC]&&(e.input.lastClick.type=="singleClick"?i="doubleClick":e.input.lastClick.type=="doubleClick"&&(i="tripleClick")),e.input.lastClick={time:o,x:r.clientX,y:r.clientY,type:i};let s=e.posAtCoords($h(r));s&&(i=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new QP(e,s,r,!!n)):(i=="doubleClick"?YP:JP)(e,s.pos,s.inside,r)?r.preventDefault():Di(e,"pointer"))};class QP{constructor(t,r,n,o){this.view=t,this.pos=r,this.event=n,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!n[oC],this.allowDefault=n.shiftKey;let i,s;if(r.inside>-1)i=t.state.doc.nodeAt(r.inside),s=r.inside;else{let u=t.state.doc.resolve(r.pos);i=u.parent,s=u.depth?u.before():0}const a=o?null:n.target,l=a?t.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:c}=t.state;(n.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof ce&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&oo&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Di(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Qo(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords($h(t))),this.updateAllowDefault(t),this.allowDefault||!r?Di(this.view,"pointer"):GP(this.view,r.pos,r.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Sr&&this.mightDrag&&!this.mightDrag.node.isAtom||dr&&!this.view.state.selection.visible&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(pl(this.view,be.near(this.view.state.doc.resolve(r.pos)),"pointer"),t.preventDefault()):Di(this.view,"pointer")}move(t){this.updateAllowDefault(t),Di(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}Er.touchstart=e=>{e.input.lastTouch=Date.now(),Hv(e),Di(e,"pointer")};Er.touchmove=e=>{e.input.lastTouch=Date.now(),Di(e,"pointer")};Er.contextmenu=e=>Hv(e);function iC(e,t){return e.composing?!0:Sr&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const ZP=Jn?5e3:-1;Cr.compositionstart=Cr.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,r=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||r.marks(),Op(e,!0),e.markCursor=null;else if(Op(e),oo&&t.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let n=e.domSelectionRange();for(let o=n.focusNode,i=n.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){e.domSelection().collapse(s,s.nodeValue.length);break}else o=s,i=-1}}e.input.composing=!0}sC(e,ZP)};Cr.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,sC(e,20))};function sC(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Op(e),t))}function aC(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=e6());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function e6(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Op(e,t=!1){if(!(Jn&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),aC(e),t||e.docView&&e.docView.dirty){let r=Lv(e);return r&&!r.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(r)):e.updateState(e.state),!0}return!1}}function t6(e,t){if(!e.dom.parentNode)return;let r=e.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(t),r.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),n.removeAllRanges(),n.addRange(o),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),e.focus()},50)}const Rl=Ir&&Vi<15||Nl&&QR<604;Er.copy=Cr.cut=(e,t)=>{let r=t,n=e.state.selection,o=r.type=="cut";if(n.empty)return;let i=Rl?null:r.clipboardData,s=n.content(),{dom:a,text:l}=XE(e,s);i?(r.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):t6(e,a),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function r6(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function n6(e,t){if(!e.dom.parentNode)return;let r=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,n=e.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let o=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),n.parentNode&&n.parentNode.removeChild(n),r?$u(e,n.value,null,o,t):$u(e,n.textContent,n.innerHTML,o,t)},50)}function $u(e,t,r,n,o){let i=QE(e,t,r,n,e.state.selection.$from);if(e.someProp("handlePaste",l=>l(e,o,i||K.empty)))return!0;if(!i)return!1;let s=r6(i),a=s?e.state.tr.replaceSelectionWith(s,n):e.state.tr.replaceSelection(i);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Cr.paste=(e,t)=>{let r=t;if(e.composing&&!Jn)return;let n=Rl?null:r.clipboardData,o=e.input.shiftKey&&e.input.lastKeyCode!=45;n&&$u(e,n.getData("text/plain"),n.getData("text/html"),o,r)?r.preventDefault():n6(e,r)};class o6{constructor(t,r){this.slice=t,this.move=r}}const lC=wn?"altKey":"ctrlKey";Er.dragstart=(e,t)=>{let r=t,n=e.input.mouseDown;if(n&&n.done(),!r.dataTransfer)return;let o=e.state.selection,i=o.empty?null:e.posAtCoords($h(r));if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof ce?o.to-1:o.to))){if(n&&n.mightDrag)e.dispatch(e.state.tr.setSelection(ce.create(e.state.doc,n.mightDrag.pos)));else if(r.target&&r.target.nodeType==1){let c=e.docView.nearestDesc(r.target,!0);c&&c.node.type.spec.draggable&&c!=e.docView&&e.dispatch(e.state.tr.setSelection(ce.create(e.state.doc,c.posBefore)))}}let s=e.state.selection.content(),{dom:a,text:l}=XE(e,s);r.dataTransfer.clearData(),r.dataTransfer.setData(Rl?"Text":"text/html",a.innerHTML),r.dataTransfer.effectAllowed="copyMove",Rl||r.dataTransfer.setData("text/plain",l),e.dragging=new o6(s,!r[lC])};Er.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Cr.dragover=Cr.dragenter=(e,t)=>t.preventDefault();Cr.drop=(e,t)=>{let r=t,n=e.dragging;if(e.dragging=null,!r.dataTransfer)return;let o=e.posAtCoords($h(r));if(!o)return;let i=e.state.doc.resolve(o.pos),s=n&&n.slice;s?e.someProp("transformPasted",h=>{s=h(s,e)}):s=QE(e,r.dataTransfer.getData(Rl?"Text":"text/plain"),Rl?null:r.dataTransfer.getData("text/html"),!1,i);let a=!!(n&&!r[lC]);if(e.someProp("handleDrop",h=>h(e,r,s||K.empty,a))){r.preventDefault();return}if(!s)return;r.preventDefault();let l=s?nN(e.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=e.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&ce.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new ce(p));else{let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((m,b,v,g)=>h=g),c.setSelection(Iv(e,p,c.doc.resolve(h)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))};Er.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Qo(e)},20))};Er.blur=(e,t)=>{let r=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),r.relatedTarget&&e.dom.contains(r.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};Er.beforeinput=(e,t)=>{if(dr&&Jn&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:n}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=n||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",i=>i(e,Ds(8,"Backspace")))))return;let{$cursor:o}=e.state.selection;o&&o.pos>0&&e.dispatch(e.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let e in Cr)Er[e]=Cr[e];function Hu(e,t){if(e==t)return!0;for(let r in e)if(e[r]!==t[r])return!1;for(let r in t)if(!(r in e))return!1;return!0}class _p{constructor(t,r){this.toDOM=t,this.spec=r||Ys,this.side=this.spec.side||0}map(t,r,n,o){let{pos:i,deleted:s}=t.mapResult(r.from+o,this.side<0?-1:1);return s?null:new Ge(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof _p&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Hu(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Ui{constructor(t,r){this.attrs=t,this.spec=r||Ys}map(t,r,n,o){let i=t.map(r.from+o,this.spec.inclusiveStart?-1:1)-n,s=t.map(r.to+o,this.spec.inclusiveEnd?1:-1)-n;return i>=s?null:new Ge(i,s,this)}valid(t,r){return r.from=t&&(!i||i(a.spec))&&n.push(a.copy(a.from+o,a.to+o))}for(let s=0;st){let a=this.children[s]+1;this.children[s+2].findInner(t-a,r-a,n,o+a,i)}}map(t,r,n){return this==lr||t.maps.length==0?this:this.mapInner(t,r,0,0,n||Ys)}mapInner(t,r,n,o,i){let s;for(let a=0;a{let c=l+n,u;if(u=uC(r,a,c)){for(o||(o=this.children.slice());ia&&d.to=t){this.children[a]==t&&(n=this.children[a+2]);break}let i=t+1,s=i+r.content.size;for(let a=0;ai&&l.type instanceof Ui){let c=Math.max(i,l.from)-i,u=Math.min(s,l.to)-i;co.map(t,r,Ys));return Ri.from(n)}forChild(t,r){if(r.isLeaf)return Ee.empty;let n=[];for(let o=0;or instanceof Ee)?t:t.reduce((r,n)=>r.concat(n instanceof Ee?n:n.members),[]))}}}function i6(e,t,r,n,o,i,s){let a=e.slice();for(let c=0,u=i;c{let b=m-h-(p-f);for(let v=0;vg+u-d)continue;let y=a[v]+u-d;p>=y?a[v+1]=f<=y?-2:-1:h>=o&&b&&(a[v]+=b,a[v+1]+=b)}d+=b}),u=r.maps[c].map(u,-1)}let l=!1;for(let c=0;c=n.content.size){l=!0;continue}let f=r.map(e[c+1]+i,-1),p=f-o,{index:h,offset:m}=n.content.findIndex(d),b=n.maybeChild(h);if(b&&m==d&&m+b.nodeSize==p){let v=a[c+2].mapInner(r,b,u+1,e[c]+i+1,s);v!=lr?(a[c]=d,a[c+1]=p,a[c+2]=v):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=s6(a,e,t,r,o,i,s),u=Ap(c,n,0,s);t=u.local;for(let d=0;dr&&s.to{let c=uC(e,a,l+r);if(c){i=!0;let u=Ap(c,a,r+l+1,n);u!=lr&&o.push(l,l+a.nodeSize,u)}});let s=cC(i?dC(e):e,-r).sort(Js);for(let a=0;a0;)t++;e.splice(t,0,r)}function yg(e){let t=[];return e.someProp("decorations",r=>{let n=r(e.state);n&&n!=lr&&t.push(n)}),e.cursorWrapper&&t.push(Ee.create(e.state.doc,[e.cursorWrapper.deco])),Ri.from(t)}const a6={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},l6=Ir&&Vi<=11;class c6{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class u6{constructor(t,r){this.view=t,this.handleDOMChange=r,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new c6,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let o=0;oo.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),l6&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,a6)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let r=0;rthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if($k(this.view)){if(this.suppressingSelectionUpdates)return Qo(this.view);if(Ir&&Vi<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&oa(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let r=new Set,n;for(let i=t.focusNode;i;i=Du(i))r.add(i);for(let i=t.anchorNode;i;i=Du(i))if(r.has(i)){n=i;break}let o=n&&this.view.docView.nearestDesc(n);if(o&&o.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let r=this.pendingRecords();r.length&&(this.queue=[]);let n=t.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&$k(t)&&!this.ignoreSelectionChange(n),i=-1,s=-1,a=!1,l=[];if(t.editable)for(let u=0;u1){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let d=u[0],f=u[1];d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}}let c=null;i<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||o)&&(i>-1&&(t.docView.markDirty(i,s),d6(t)),this.handleDOMChange(i,s,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||Qo(t),this.currentSelection.set(n))}registerMutation(t,r){if(r.indexOf(t.target)>-1)return null;let n=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(n==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!n||n.ignoreMutation(t))return null;if(t.type=="childList"){for(let u=0;uo;b--){let v=n.childNodes[b-1],g=v.pmViewDesc;if(v.nodeName=="BR"&&!g){i=b;break}if(!g||g.size)break}let d=e.state.doc,f=e.someProp("domParser")||Mv.fromSchema(e.state.schema),p=d.resolve(s),h=null,m=f.parse(n,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:i,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:h6,context:p});if(c&&c[0].pos!=null){let b=c[0].pos,v=c[1]&&c[1].pos;v==null&&(v=b),h={anchor:b+s,head:v+s}}return{doc:m,sel:h,from:s,to:a}}function h6(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(Sr&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(e.parentNode.lastChild==e||Sr&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const m6=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function g6(e,t,r,n,o){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let C=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,T=Lv(e,C);if(T&&!e.state.selection.eq(T)){if(dr&&Jn&&e.input.lastKeyCode===13&&Date.now()-100z(e,Ds(13,"Enter"))))return;let N=e.state.tr.setSelection(T);C=="pointer"?N.setMeta("pointer",!0):C=="key"&&N.scrollIntoView(),i&&N.setMeta("composition",i),e.dispatch(N)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(r);t=s.before(a+1),r=e.state.doc.resolve(r).after(a+1);let l=e.state.selection,c=p6(e,t,r),u=e.state.doc,d=u.slice(c.from,c.to),f,p;e.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Jn)&&o.some(C=>C.nodeType==1&&!m6.test(C.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",C=>C(e,Ds(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!h)if(n&&l instanceof le&&!l.empty&&l.$head.sameParent(l.$anchor)&&!e.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let C=Yk(e,e.state.doc,c.sel);if(C&&!C.eq(e.state.selection)){let T=e.state.tr.setSelection(C);i&&T.setMeta("composition",i),e.dispatch(T)}}return}if(dr&&e.cursorWrapper&&c.sel&&c.sel.anchor==e.cursorWrapper.deco.from&&c.sel.head==c.sel.anchor){let C=h.endB-h.start;c.sel={anchor:c.sel.anchor+C,head:c.sel.anchor+C}}e.input.domChangeCount++,e.state.selection.frome.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=c.from?h.start=e.state.selection.from:h.endA=e.state.selection.to-2&&e.state.selection.to<=c.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),Ir&&Vi<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let m=c.doc.resolveNoCache(h.start-c.from),b=c.doc.resolveNoCache(h.endB-c.from),v=u.resolve(h.start),g=m.sameParent(b)&&m.parent.inlineContent&&v.end()>=h.endA,y;if((Nl&&e.input.lastIOSEnter>Date.now()-225&&(!g||o.some(C=>C.nodeName=="DIV"||C.nodeName=="P"))||!g&&m.posC(e,Ds(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>h.start&&y6(u,h.start,h.endA,m,b)&&e.someProp("handleKeyDown",C=>C(e,Ds(8,"Backspace")))){Jn&&dr&&e.domObserver.suppressSelectionUpdates();return}dr&&Jn&&h.endB==h.start&&(e.input.lastAndroidDelete=Date.now()),Jn&&!g&&m.start()!=b.start()&&b.parentOffset==0&&m.depth==b.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,b=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{e.someProp("handleKeyDown",function(C){return C(e,Ds(13,"Enter"))})},20));let x=h.start,k=h.endA,w,E,M;if(g){if(m.pos==b.pos)Ir&&Vi<=11&&m.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Qo(e),20)),w=e.state.tr.delete(x,k),E=u.resolve(h.start).marksAcross(u.resolve(h.endA));else if(h.endA==h.endB&&(M=v6(m.parent.content.cut(m.parentOffset,b.parentOffset),v.parent.content.cut(v.parentOffset,h.endA-v.start()))))w=e.state.tr,M.type=="add"?w.addMark(x,k,M.mark):w.removeMark(x,k,M.mark);else if(m.parent.child(m.index()).isText&&m.index()==b.index()-(b.textOffset?0:1)){let C=m.parent.textBetween(m.parentOffset,b.parentOffset);if(e.someProp("handleTextInput",T=>T(e,x,k,C)))return;w=e.state.tr.insertText(C,x,k)}}if(w||(w=e.state.tr.replace(x,k,c.doc.slice(h.start-c.from,h.endB-c.from))),c.sel){let C=Yk(e,w.doc,c.sel);C&&!(dr&&Jn&&e.composing&&C.empty&&(h.start!=h.endB||e.input.lastAndroidDeletet.content.size?null:Iv(e,t.resolve(r.anchor),t.resolve(r.head))}function v6(e,t){let r=e.firstChild.marks,n=t.firstChild.marks,o=r,i=n,s,a,l;for(let u=0;uu.mark(a.addToSet(u.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;ur||bg(s,!0,!1)0&&(t||e.indexAfter(n)==e.node(n).childCount);)n--,o++,t=!1;if(r){let i=e.node(n).maybeChild(e.indexAfter(n));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function b6(e,t,r,n,o){let i=e.findDiffStart(t,r);if(i==null)return null;let{a:s,b:a}=e.findDiffEnd(t,r+e.size,r+t.size);if(o=="end"){let l=Math.max(0,i-Math.min(s,a));n-=s+l-i}if(s=s?i-n:0;i-=l,a=i+(a-s),s=i}else if(a=a?i-n:0;i-=l,s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}class x6{constructor(t,r){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new BP,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=r,this.state=r.state,this.directPlugins=r.plugins||[],this.directPlugins.forEach(e2),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Qk(this),Xk(this),this.nodeViews=Zk(this),this.docView=Rk(this.state.doc,Jk(this),yg(this),this.dom,this),this.domObserver=new u6(this,(n,o,i,s)=>g6(this,n,o,i,s)),this.domObserver.start(),FP(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let r in t)this._props[r]=t[r];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&F1(this);let r=this._props;this._props=t,t.plugins&&(t.plugins.forEach(e2),this.directPlugins=t.plugins),this.updateStateInner(t.state,r)}setProps(t){let r={};for(let n in this._props)r[n]=this._props[n];r.state=this.state;for(let n in t)r[n]=t[n];this.update(r)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,r){let n=this.state,o=!1,i=!1;t.storedMarks&&this.composing&&(aC(this),i=!0),this.state=t;let s=n.plugins!=t.plugins||this._props.plugins!=r.plugins;if(s||this._props.plugins!=r.plugins||this._props.nodeViews!=r.nodeViews){let f=Zk(this);w6(f,this.nodeViews)&&(this.nodeViews=f,o=!0)}(s||r.handleDOMEvents!=this._props.handleDOMEvents)&&F1(this),this.editable=Qk(this),Xk(this);let a=yg(this),l=Jk(this),c=n.plugins!=t.plugins&&!n.doc.eq(t.doc)?"reset":t.scrollToSelection>n.scrollToSelection?"to selection":"preserve",u=o||!this.docView.matchesNode(t.doc,l,a);(u||!t.selection.eq(n.selection))&&(i=!0);let d=c=="preserve"&&i&&this.dom.style.overflowAnchor==null&&tP(this);if(i){this.domObserver.stop();let f=u&&(Ir||dr)&&!this.composing&&!n.selection.empty&&!t.selection.empty&&k6(n.selection,t.selection);if(u){let p=dr?this.trackWrites=this.domSelectionRange().focusNode:null;(o||!this.docView.update(t.doc,l,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Rk(t.doc,l,a,this.dom,this)),p&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&MP(this))?Qo(this,f):(GE(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():d&&rP(d)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",r=>r(this)))if(this.state.selection instanceof ce){let r=this.docView.domAfterPos(this.state.selection.from);r.nodeType==1&&Mk(this,r.getBoundingClientRect(),t)}else Mk(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let r=0;rr.ownerDocument.getSelection()),this._root=r}return t||document}updateRoot(){this._root=null}posAtCoords(t){return lP(this,t)}coordsAtPos(t,r=1){return BE(this,t,r)}domAtPos(t,r=0){return this.docView.domFromPos(t,r)}nodeDOM(t){let r=this.docView.descAt(t);return r?r.nodeDOM:null}posAtDOM(t,r,n=-1){let o=this.docView.posFromDOM(t,r,n);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(t,r){return pP(this,r||this.state,t)}pasteHTML(t,r){return $u(this,"",t,!1,r||new ClipboardEvent("paste"))}pasteText(t,r){return $u(this,t,null,!0,r||new ClipboardEvent("paste"))}destroy(){this.docView&&(VP(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],yg(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(t){return UP(this,t)}dispatch(t){let r=this._props.dispatchTransaction;r?r.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return Sr&&this.root.nodeType===11&&GR(this.dom.ownerDocument)==this.dom?f6(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function Jk(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",r=>{if(typeof r=="function"&&(r=r(e.state)),r)for(let n in r)n=="class"?t.class+=" "+r[n]:n=="style"?t.style=(t.style?t.style+";":"")+r[n]:!t[n]&&n!="contenteditable"&&n!="nodeName"&&(t[n]=String(r[n]))}),t.translate||(t.translate="no"),[Ge.node(0,e.state.doc.content.size,t)]}function Xk(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Ge.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Qk(e){return!e.someProp("editable",t=>t(e.state)===!1)}function k6(e,t){let r=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(r)!=t.$anchor.start(r)}function Zk(e){let t=Object.create(null);function r(n){for(let o in n)Object.prototype.hasOwnProperty.call(t,o)||(t[o]=n[o])}return e.someProp("nodeViews",r),e.someProp("markViews",r),t}function w6(e,t){let r=0,n=0;for(let o in e){if(e[o]!=t[o])return!0;r++}for(let o in t)n++;return r!=n}function e2(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var S6=e=>{if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")};const E6=Dn(S6);var fC=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},ge=(e,t,r)=>(fC(e,t,"read from private field"),r?r.call(e):t.get(e)),Io=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},qe=(e,t,r,n)=>(fC(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);function C6(e){return!!(e.prev&&e.next&&e.prev.text.full!==e.next.text.full)}function M6(e){return!!(e.prev&&e.next&&e.prev.range.cursor!==e.next.range.cursor)}function T6(e){return!!(!e.prev&&e.next)}function O6(e){return!!(e.prev&&!e.next)}function _6(e){return!!(e.prev&&e.next&&e.prev.range.from!==e.next.range.from)}function A6(e){return e==="invalid-exit-split"}var N6=["jump-backward-exit","jump-forward-exit"],R6=["jump-backward-change","jump-forward-change"];function P6(e){var t,r;return fr(N6,(t=e.exit)==null?void 0:t.exitReason)||fr(R6,(r=e.change)==null?void 0:r.changeReason)}function t2(e){return!!(e&&e.query.full.length>=e.suggester.matchOffset)}function r2(e){return Zt(e)&&e instanceof le}function Pr(e){const{match:t,changeReason:r,exitReason:n}=e;return{...t,changeReason:r,exitReason:n}}function z6(e,t){const{invalidPrefixCharacters:r,validPrefixCharacters:n}=t;return r?!new RegExp(j1(r)).test(e):new RegExp(j1(n)).test(e)}function L6(e){const{text:t,regexp:r,$pos:n,suggester:o}=e,i=n.start();let s;return xa(t,r).forEach(a=>{const l=a.input.slice(Math.max(0,a.index-1),a.index);if(z6(l,o)){const c=a.index+i,u=a[0],d=a[1];if(!oe(u)||!oe(d))return;const f=c+u.length,p=Math.min(f,n.pos),h=p-c;c=n.pos&&(s={range:{from:c,to:f,cursor:p},match:a,query:{partial:u.slice(d.length,h),full:u.slice(d.length)},text:{partial:u.slice(0,h),full:u},textAfter:n.doc.textBetween(f,n.end(),Li,Li),textBefore:n.doc.textBetween(i,c,Li,Li),suggester:o})}}),s}function pC(e){const{$pos:t,suggester:r}=e,{char:n,name:o,startOfLine:i,supportedCharacters:s,matchOffset:a,multiline:l,caseInsensitive:c,unicode:u}=r,d=U6({char:n,matchOffset:a,startOfLine:i,supportedCharacters:s,multiline:l,caseInsensitive:c,unicode:u}),f=t.doc.textBetween(t.before(),t.end(),Li,Li);return L6({suggester:r,text:f,regexp:d,$pos:t,char:n,name:o})}function hC(e){const{state:t,match:r}=e;try{return pC({$pos:t.doc.resolve(r.range.cursor),suggester:r.suggester})}catch{return}}function mC(e){const{prev:t,next:r,state:n}=e;return!r&&t.range.from>=n.doc.nodeSize?{exit:Pr({match:t,exitReason:"delete"})}:!r||!t.query.partial?{exit:Pr({match:t,exitReason:"invalid-exit-split"})}:t.range.to===r.range.cursor?{exit:Pr({match:r,exitReason:"exit-end"})}:t.query.partial?{exit:Pr({match:r,exitReason:"exit-split"})}:{}}function I6(e){const{prev:t,next:r,state:n}=e,o=ee(),i=hC({state:n,match:t}),{exit:s}=i&&i.query.full!==t.query.full?mC({prev:t,next:i,state:n}):o;return t.range.from=t.range.to)?{exit:Pr({match:t,exitReason:"selection-outside"})}:n.pos>t.range.to?{exit:Pr({match:t,exitReason:"move-end"})}:n.pos<=t.range.from?{exit:Pr({match:t,exitReason:"move-start"})}:{}}function $6(e){const{prev:t,next:r,state:n,$pos:o}=e,i=ee();if(!t&&!r)return i;const s={prev:t,next:r};return _6(s)?I6({prev:s.prev,next:s.next,state:n}):T6(s)?{change:Pr({match:s.next,changeReason:"start"})}:O6(s)?D6({$pos:o,match:s.prev,state:n}):C6(s)?{change:Pr({match:s.next,changeReason:"change-character"})}:M6(s)?{change:Pr({match:s.next,changeReason:n.selection.empty?"move":"selection-inside"})}:i}function n2(e,t){for(let r=e.depth;r>0;r--){const n=e.node(r);if(t.includes(n.type.name))return!0}return!1}function V1(e,t){const{$from:r,$to:n}=e;return gC(e,t)?!0:Cv(r.pos,n.pos).some(o=>H6(r.doc.resolve(o),t))}function gC(e,t){const{$from:r,$to:n}=e,o=new Set((r.marksAcross(n)??[]).map(i=>i.type.name));return t.some(i=>o.has(i))}function H6(e,t){const r=new Set(e.marks().map(n=>n.type.name));return t.some(n=>r.has(n))}function B6(e,t){const{$cursor:r}=t,{validMarks:n,validNodes:o,invalidMarks:i,invalidNodes:s}=e;return!n&&!o&&Mo(i)&&Mo(s)?!0:!(n&&!gC(t,n)||o&&!n2(r,o)||!n&&V1(t,i)||!o&&n2(r,s))}function o2(e){const{suggesters:t,$pos:r,selectionEmpty:n}=e;for(const o of t)if(!(o.emptySelectionsOnly&&!n))try{const i=pC({suggester:o,$pos:r});if(!i)continue;const s={$from:r.doc.resolve(i.range.from),$to:r.doc.resolve(i.range.to),$cursor:r};if(B6(o,s)&&o.isValidPosition(s,i))return i}catch{}}function j1(e){return cA(e)?e.source:e}function F6(e){return e?"^":""}function V6(e,t){return`(?:${j1(e)}){${t},}`}function j6(e){return oe(e)?new RegExp(E6(e)):e}function U6(e){const{char:t,matchOffset:r,startOfLine:n,supportedCharacters:o,captureChar:i=!0,caseInsensitive:s=!1,multiline:a=!1,unicode:l=!1}=e,c=`g${a?"m":""}${s?"i":""}${l?"u":""}`;let u=j6(t).source;return i&&(u=`(${u})`),new RegExp(`${F6(n)}${u}${V6(o,r)}`,c)}var W6={appendTransaction:!1,priority:50,ignoredTag:"span",matchOffset:0,disableDecorations:!1,startOfLine:!1,suggestClassName:"suggest",suggestTag:"span",supportedCharacters:/\w+/,validPrefixCharacters:/^[\s\0]?$/,invalidPrefixCharacters:null,ignoredClassName:null,invalidMarks:[],invalidNodes:[],validMarks:null,validNodes:null,isValidPosition:()=>!0,checkNextValidSelection:null,emptySelectionsOnly:!1,caseInsensitive:!1,multiline:!1,unicode:!1,captureChar:!0},vC="__ignore_prosemirror_suggest_update__",Df,Dc,zt,Si,ja,po,Ot,Ei,Ua,yC=class{constructor(e){Io(this,Df,!1),Io(this,Dc,!1),Io(this,zt,void 0),Io(this,Si,void 0),Io(this,ja,void 0),Io(this,po,ee()),Io(this,Ot,Ee.empty),Io(this,Ei,!1),Io(this,Ua,!1),this.setMarkRemoved=()=>{qe(this,Ei,!0)},this.findNextTextSelection=r=>{const n=r.$from.doc,o=Math.min(n.nodeSize-2,r.to+1),i=n.resolve(o),s=be.findFrom(i,1,!0);if(r2(s))return s},this.ignoreNextExit=()=>{qe(this,Dc,!0)},this.addIgnored=({from:r,name:n,specific:o=!1})=>{const i=ge(this,zt).find(u=>u.name===n);if(!i)throw new Error(`No suggester exists for the name provided: ${n}`);const s=oe(i.char)?i.char.length:1,a=r+s,l=i.ignoredClassName?{class:i.ignoredClassName}:{},c=Ge.inline(r,a,{nodeName:i.ignoredTag,...l},{name:n,specific:o,char:i.char});qe(this,Ot,ge(this,Ot).add(this.view.state.doc,[c]))},this.removeIgnored=({from:r,name:n})=>{const o=ge(this,zt).find(a=>a.name===n);if(!o)throw new Error(`No suggester exists for the name provided: ${n}`);const i=oe(o.char)?o.char.length:1,s=ge(this,Ot).find(r,r+i)[0];!s||s.spec.name!==n||qe(this,Ot,ge(this,Ot).remove([s]))},this.clearIgnored=r=>{if(!r){qe(this,Ot,Ee.empty);return}const o=ge(this,Ot).find().filter(({spec:i})=>i.name===r);qe(this,Ot,ge(this,Ot).remove(o))},this.findMatchAtPosition=(r,n)=>{const o=n?ge(this,zt).filter(i=>i.name===n):ge(this,zt);return o2({suggesters:o,$pos:r,docChanged:!1,selectionEmpty:!0})},this.setLastChangeFromAppend=()=>{qe(this,Ua,!0)};const t=i2();qe(this,zt,e.map(t)),qe(this,zt,ta(ge(this,zt),(r,n)=>n.priority-r.priority))}static create(e){return new yC(e)}get decorationSet(){return ge(this,Ot)}get removed(){return ge(this,Ei)}get match(){return ge(this,Si)?ge(this,Si):ge(this,ja)&&ge(this,po).exit?ge(this,ja):void 0}init(e){return this.view=e,this}createProps(e){const{name:t,char:r}=e.suggester;return{view:this.view,addIgnored:this.addIgnored,clearIgnored:this.clearIgnored,ignoreNextExit:this.ignoreNextExit,setMarkRemoved:this.setMarkRemoved,name:t,char:r,...e}}shouldRunExit(){return ge(this,Dc)?(qe(this,Dc,!1),!1):!0}updateWithNextSelection(e){var t,r,n;const o=this.findNextTextSelection(e.selection);if(o)for(const i of ge(this,zt)){const s=(t=ge(this,po).change)==null?void 0:t.suggester.name,a=(r=ge(this,po).exit)==null?void 0:r.suggester.name;(n=i.checkNextValidSelection)==null||n.call(i,o.$from,e,{change:s,exit:a})}}changeHandler(e,t){const{change:r,exit:n}=ge(this,po),o=this.match;if(!r&&!n||!t2(o))return;const i=t===(n==null?void 0:n.suggester.appendTransaction)&&this.shouldRunExit(),s=t===(r==null?void 0:r.suggester.appendTransaction);if(!(!i&&!s)){if(r&&n&&P6({change:r,exit:n})){const a=this.createProps(n),l=this.createProps(r),c=n.range.from{const a=oe(s.char)?s.char.length:1;return i-o!==a});qe(this,Ot,t.remove(n))}shouldIgnoreMatch({range:e,suggester:{name:t}}){return ge(this,Ot).find().some(({spec:o,from:i})=>i!==e.from?!1:o.specific?o.name===t:!0)}resetState(){qe(this,po,ee()),qe(this,Si,void 0),qe(this,Ei,!1),qe(this,Ua,!1)}updateReasons(e){const{$pos:t,state:r}=e,n=ge(this,Df),o=ge(this,zt),i=r.selection.empty,s=r2(r.selection)?o2({suggesters:o,$pos:t,docChanged:n,selectionEmpty:i}):void 0;qe(this,Si,s&&this.shouldIgnoreMatch(s)?void 0:s),qe(this,po,$6({next:ge(this,Si),prev:ge(this,ja),state:r,$pos:t}))}addSuggester(e){const t=ge(this,zt).find(n=>n.name===e.name),r=i2();if(t)qe(this,zt,ge(this,zt).map(n=>n===t?r(e):n));else{const n=[...ge(this,zt),r(e)];qe(this,zt,ta(n,(o,i)=>i.priority-o.priority))}return()=>this.removeSuggester(e.name)}removeSuggester(e){const t=oe(e)?e:e.name;qe(this,zt,ge(this,zt).filter(r=>r.name!==t)),this.clearIgnored(t)}toJSON(){return this.match}apply(e){const{exit:t,change:r}=ge(this,po);if(ge(this,Ua)&&(qe(this,Ua,!1),!(t!=null&&t.suggester.appendTransaction)&&!(r!=null&&r.suggester.appendTransaction)))return this;const{tr:n,state:o}=e,i=n.docChanged||n.selectionSet;return n.getMeta(vC)||!i&&!ge(this,Ei)?this:(qe(this,Df,n.docChanged),this.mapIgnoredDecorations(n),t&&this.resetState(),qe(this,ja,ge(this,Si)),this.updateReasons({$pos:n.selection.$from,state:o}),this)}createDecorations(e){const t=this.match;if(!t2(t))return ge(this,Ot);const{disableDecorations:r}=t.suggester;if(_e(r)?r(e,t):r)return ge(this,Ot);const{range:o,suggester:i}=t,{name:s,suggestTag:a,suggestClassName:l}=i,{from:c,to:u}=o;return this.shouldIgnoreMatch(t)?ge(this,Ot):ge(this,Ot).add(e.doc,[Ge.inline(c,u,{nodeName:a,class:s?`${l} suggest-${s}`:l},{name:s})])}},K6=yC;Df=new WeakMap;Dc=new WeakMap;zt=new WeakMap;Si=new WeakMap;ja=new WeakMap;po=new WeakMap;Ot=new WeakMap;Ei=new WeakMap;Ua=new WeakMap;function i2(){const e=new Set;return t=>{if(e.has(t.name))throw new Error(`A suggester already exists with the name '${t.name}'. The name provided must be unique.`);const r={...W6,...t};return e.add(t.name),r}}var bC=new ka("suggest");function Vv(e){return bC.getState(e)}function s2(e,t){return Vv(e).addSuggester(t)}function a2(e){e.setMeta(vC,!0)}function q6(e,t){return Vv(e).removeSuggester(t)}function G6(...e){const t=K6.create(e);return new Ro({key:bC,view:r=>(t.init(r),{update:n=>t.changeHandler(n.state.tr,!1)}),state:{init:()=>t,apply:(r,n,o,i)=>t.apply({tr:r,state:i})},appendTransaction:(r,n,o)=>{const i=o.tr;return t.updateWithNextSelection(i),t.changeHandler(i,!0),i.docChanged||i.steps.length>0||i.selectionSet||i.storedMarksSet?(t.setLastChangeFromAppend(),i):null},props:{decorations:r=>t.createDecorations(r)}})}function jv(e,t){const r=Object.getPrototypeOf(t);let n=e.selection,o=e.doc,i=e.storedMarks;const s=ee();for(const[a,l]of Object.entries(t))s[a]={value:l};return Object.create(r,{...s,storedMarks:{get(){return i}},selection:{get(){return n}},doc:{get(){return o}},tr:{get(){return n=e.selection,o=e.doc,i=e.storedMarks,e}}})}function bu(e){return({state:t,dispatch:r,view:n,tr:o})=>e(jv(o,t),r,n)}function l2(e){return t=>{var r;return re(t.dispatch===void 0||t.dispatch===((r=t.view)==null?void 0:r.dispatch),{code:B.NON_CHAINABLE_COMMAND}),e(t)}}function Y6(...e){return({state:t,dispatch:r,view:n,tr:o,...i})=>{for(const s of e)if(s({state:t,dispatch:r,view:n,tr:o,...i}))return!0;return!1}}var on={get isBrowser(){return!!(typeof window<"u"&&typeof window.document<"u"&&window.navigator&&window.navigator.userAgent)},get isJSDOM(){return on.isBrowser&&window.navigator.userAgent.includes("jsdom")},get isNode(){return typeof process<"u"&&process.versions!=null&&process.versions.node!=null},get isIos(){return on.isBrowser&&/iPod|iPhone|iPad/.test(navigator.platform)},get isMac(){return on.isBrowser&&/Mac|iPod|iPhone|iPad/.test(navigator.platform)},get isApple(){return on.isNode?process.platform==="darwin":on.isBrowser?/Mac|iPod|iPhone|iPad/.test(window.navigator.platform):!1},get isDevelopment(){return!1},get isTest(){return!1},get isProduction(){return!0}};function kn(e,t){var r;const n=PC(e);return((r=n==null?void 0:n.getComputedStyle(e))==null?void 0:r.getPropertyValue(t))??""}function ar(e,t){return Object.assign(e.style,t)}var J6=["px","rem","em","in","q","mm","cm","pt","pc","vh","vw","vmin","vmax"],X6=/[\d-.]+(\w+)$/;function $f(e="0"){const t=e||"0",r=Number.parseFloat(t),n=t.match(X6),o=((n==null?void 0:n[1])??"px").toLowerCase();return[r,fr(J6,o)?o:"px"]}var Cn=96,hl=25.4,xC=72,kC=6;function Pl(e){if(et(e))return kn(e,"font-size")||Pl(e.parentElement);const t=PC(e);return t?kn(t.document.documentElement,"font-size"):""}function Q6(e){const t=LC(e),r=t.document.documentElement||t.document.body;return(n,o)=>{switch(o){case"rem":return n*Xs(Pl(r));case"em":return n*Xs(Pl(e),e==null?void 0:e.parentElement);case"in":return n*Cn;case"q":return n*Cn/hl/4;case"mm":return n*Cn/hl;case"cm":return n*Cn*10/hl;case"pt":return n*Cn/xC;case"pc":return n*Cn/kC;case"vh":return(n*t.innerHeight||r.clientWidth)/100;case"vw":return(n*t.innerWidth||r.clientHeight)/100;case"vmin":return n*Math.min(t.innerWidth||r.clientWidth,t.innerHeight||r.clientHeight)/100;case"vmax":return n*Math.max(t.innerWidth||r.clientWidth,t.innerHeight||r.clientHeight)/100;default:return n}}}var Hf=/^([a-z]+)\((.+)\)$/i;function wC(e,t){if(!Hf.test(e))return Number.NaN;const r=EN(e,{brackets:["()"],escape:"_",flat:!0});if(!r||r.length===0)return Number.NaN;function n(i){return i.replace(/_(\d+)_/g,(s,a)=>{const l=Number.parseFloat(a);return r[l]??""})}const o=Zo(r,0);for(const i of xa(o,Hf)){const s=Zo(i,1),c=n(Zo(i,2)).split(/\s*,\s*/).map(u=>{if(Hf.test(u)){const d=n(u);return wC(d,t)}return SC(u,t)});switch(s){case"min":return Math.min(...c);case"max":return Math.max(...c);case"clamp":{const[u,d,f]=c;if(Jt(u)&&Jt(d)&&Jt(f))return Ad({min:u,max:f,value:d});break}case"calc":return Number.NaN;default:return Number.NaN}}return Number.NaN}function SC(e,t){const[r,n]=$f(e);return t(r,n)}function Xs(e,t){const r=Q6(t);return Hf.test(e)?wC(e.toLowerCase(),r):SC(e,r)}function xg(e,t,r){const n=LC(r),o=n.document.documentElement||n.document.body,i=Xs(e,r);switch(t){case"px":return i;case"rem":return i/Xs(Pl(o));case"em":return i*Xs(Pl(r),r==null?void 0:r.parentElement);case"in":return i/Cn;case"q":return i/Cn*hl*4;case"mm":return i/Cn*hl;case"cm":return i/Cn/10*hl;case"pt":return i/Cn*xC;case"pc":return i/Cn*kC;case"vh":return i/(n.innerHeight||o.clientWidth)*100;case"vw":return i/(n.innerWidth||o.clientHeight)*100;case"vmin":return i/Math.min(n.innerWidth||o.clientWidth,n.innerHeight||o.clientHeight)*100;case"vmax":return i/Math.max(n.innerWidth||o.clientWidth,n.innerHeight||o.clientHeight)*100;default:return i}}function Np(e){return Zt(e)&&Jt(e.nodeType)&&oe(e.nodeName)}function et(e){return Np(e)&&e.nodeType===1}function Z6(e){return Np(e)&&e.nodeType===3}function Hh(e){const{types:t,node:r}=e;if(!r)return!1;const n=o=>o===r.type||o===r.type.name;return ct(t)?t.some(n):n(t)}function ez(e,t){const{tr:r}=t;return e.forEach(n=>{n.steps.forEach(o=>{r.step(o)})}),r}function tz({pos:e,tr:t}){const r=t.doc.nodeAt(e);return r&&t.delete(e,e+r.nodeSize),t}function rz({pos:e,tr:t,content:r}){const n=t.doc.nodeAt(e);return n&&t.replaceWith(e,e+n.nodeSize,r),t}function Ld(e){const{predicate:t,selection:r}=e,n=MC(r)?r.selection.$from:Kv(r)?r.$from:r;for(let o=n.depth;o>0;o--){const i=n.node(o),s=o>0?n.before(o):0,a=n.start(o),l=s+i.nodeSize;if(t(i,s))return{pos:s,depth:o,node:i,start:a,end:l}}}function nz(e){const{depth:t}=e,r=t>0?e.before(t):0,n=e.node(t),o=e.start(t),i=r+n.nodeSize;return{pos:r,start:o,node:n,end:i,depth:t}}function oz(e){const t=Ld({predicate:()=>!0,selection:e});return re(t,{message:"No parent node found for the selection provided."}),t}function rs(e){const{types:t,selection:r}=e;return Ld({predicate:n=>Hh({types:t,node:n}),selection:r})}function iz(e){const{types:t,selection:r}=e;if(!(!Dd(r)||!Hh({types:t,node:r.node})))return{pos:r.$from.pos,depth:r.$from.depth,start:r.$from.start(),end:r.$from.pos+r.node.nodeSize,node:r.node}}function Uv(e){return Kv(e)?e.empty:e.selection.empty}function sz(e){return e.docChanged||e.selectionSet}function EC(e){return!!Bu(e)}function Bu(e){const{state:t,type:r,attrs:n}=e,{selection:o,doc:i}=t,s=oe(r)?i.type.schema.nodes[r]:r;re(s,{code:B.SCHEMA,message:`No node exists for ${r}`});const a=iz({selection:o,types:r})??Ld({predicate:l=>l.type===s,selection:o});return!n||vp(n)||!a||a.node.hasMarkup(s,{...a.node.attrs,...n})?a:void 0}function Rp(...e){return t=>{if(!Zx(e))return!1;const[r,...n]=e;let o=!1;const i=(...l)=>()=>{if(!Zx(l))return!1;o=!0;const[,...c]=l;return Rp(...l)({...t,next:i(...c)})},s=i(...n),a=r({...t,next:s});return o||a?a:s()}}function az(e,t){const r=new Map,n=ee();for(const o of e)for(const[i,s]of At(o)){const l=[...r.get(i)??[],s],c=Rp(...l);r.set(i,l),n[i]=t(c)}return n}function lz(e){return az(e,t=>(r,n,o)=>t({state:r,dispatch:n,view:o,tr:r.tr,next:()=>!1}))}function Wv(e,t){const r=e.attrs??{};return Object.entries(t).every(([n,o])=>r[n]===o)}function cz(e){return OC(e,[Ko,bt,Dt,eo])}function oc(e){return Zt(e)}function ic(e,t){return ct(t)?fr(t,e[ti]):t===e[ti]}function uz(e){return Zt(e)&&e instanceof O1}function dz(e,t){return oe(e)?it(t.nodes,e):e}function CC(e){return Zt(e)&&e instanceof Nd}function fz(e,t){return oe(e)?it(t.marks,e):e}function Id(e){return Zt(e)&&e instanceof Fi}function pz(e){return Zt(e)&&e instanceof R}function hz(e){return Zt(e)&&e instanceof Te}function MC(e){return Zt(e)&&e instanceof Hs}function ms(e){return Zt(e)&&e instanceof le}function mz(e){return Zt(e)&&e instanceof kr}function Kv(e){return Zt(e)&&e instanceof be}function gz(e){return Zt(e)&&e instanceof Tl}function c2(e){const{trState:t,from:r,to:n,type:o,attrs:i={}}=e,{doc:s}=t,a=fz(o,s.type.schema);if(Object.keys(i).length===0)return s.rangeHasMark(r,n,a);let l=!1;return n>r&&s.nodesBetween(r,n,c=>l?!1:(l=(c.marks??[]).some(d=>d.type!==a?!1:Wv(d,i)),!l)),l}function Dd(e){return Zt(e)&&e instanceof ce}function Pp(e){const{trState:t,type:r,attrs:n={},from:o,to:i}=e,{selection:s,doc:a,storedMarks:l}=t,c=oe(r)?a.type.schema.marks[r]:r;if(re(c,{code:B.SCHEMA,message:`Mark type: ${r} does not exist on the current schema.`}),o&&i)try{return Math.max(o,i)d.type!==r?!1:Wv(d,n??{})):c2({...e,from:s.from,to:s.to})}function qv(e,t={}){const r=vz(e.type.schema);if(!r)return!1;const{ignoreAttributes:n,ignoreDocAttributes:o}=t;return n?TC(r,e):o?r.content.eq(e.content):r.eq(e)}function TC(e,t){if(e===t)return!0;const r=e.type===t.type&&Te.sameSet(e.marks,t.marks);function n(){if(e.content===t.content)return!0;if(e.content.size!==t.content.size)return!1;const o=[],i=[];e.content.forEach(s=>o.push(s)),t.content.forEach(s=>i.push(s));for(const[s,a]of o.entries()){const l=i[s];if(!l||!TC(a,l))return!1}return!0}return r&&n()}function vz(e){var t;return((t=e.nodes.doc)==null?void 0:t.createAndFill())??void 0}function Bh(e){for(const t of Object.values(e.nodes))if(t.name!=="doc"&&(t.isBlock||t.isTextblock))return t;re(!1,{code:B.SCHEMA,message:"No default block node found for the provided schema."})}function yz(e){return e.type===Bh(e.type.schema)}function Fh(e){return!!e&&e.type.isBlock&&!e.textContent&&!e.childCount}function _o(e,t,r){const n=e.parent.childAfter(e.parentOffset);if(!n.node)return;const o=oe(t)?t:t.name,i=n.node.marks.find(({type:d})=>d.name===o);let s=e.index(),a=e.start()+n.offset,l=s+1,c=a+n.node.nodeSize;if(!i)return r&&c0&&i.isInSet(e.parent.child(s-1).marks);)s-=1,a-=e.parent.child(s).nodeSize;for(;le instanceof r)}function bz(e){return Z4(e,({from:r,to:n,prevFrom:o,prevTo:i})=>`${r}_${n}_${o}_${i}`).filter((r,n,o)=>!o.some((i,s)=>n===s?!1:r.prevFrom>=i.prevFrom&&r.prevTo<=i.prevTo&&r.from>=i.from&&r.to<=i.to))}function OC(e,t=[]){const r=[],{steps:n,mapping:o}=e,i=o.invert();n.forEach((a,l)=>{if(!TC(a,t))return;const c=[],u=a.getMap(),d=o.slice(l);if(u.ranges.length===0&&lz(a)){const{from:f,to:p}=a;c.push({from:f,to:p})}else u.forEach((f,p)=>{c.push({from:f,to:p})});c.forEach(f=>{const p=d.map(f.from,-1),h=d.map(f.to);r.push({from:p,to:h,prevFrom:i.map(p,-1),prevTo:i.map(h)})})});const s=ra(r,(a,l)=>a.from-l.from);return bz(s)}function xz(e,t){const r=[],n=OC(e,t);for(const o of n)try{const i=e.doc.resolve(o.from),s=e.doc.resolve(o.to),a=i.blockRange(s);a&&r.push(a)}catch{}return r}function kz(e){var t;return((t=e.content.firstChild)==null?void 0:t.textContent)??""}function wz(e,t){if(!gs(e.selection))return;let{from:r,to:n}=e.selection;const o=(s,a)=>kz(le.between(e.doc.resolve(s),e.doc.resolve(a)).content());for(let s=o(r-1,r);s&&!t.test(s);r--,s=o(r-1,r));for(let s=o(n,n+1);s&&!t.test(s);n++,s=o(n,n+1));if(r===n)return;const i=e.doc.textBetween(r,n,kv,` +`);return{from:a,to:c,text:u,mark:i}}function bz(e,t){const r=[],{$from:n,$to:o}=e;let i=n;for(;;){const s=_o(i,t,o);if(!s)return r;if(r.push(s),s.toe instanceof r)}function xz(e){return eE(e,({from:r,to:n,prevFrom:o,prevTo:i})=>`${r}_${n}_${o}_${i}`).filter((r,n,o)=>!o.some((i,s)=>n===s?!1:r.prevFrom>=i.prevFrom&&r.prevTo<=i.prevTo&&r.from>=i.from&&r.to<=i.to))}function _C(e,t=[]){const r=[],{steps:n,mapping:o}=e,i=o.invert();n.forEach((a,l)=>{if(!OC(a,t))return;const c=[],u=a.getMap(),d=o.slice(l);if(u.ranges.length===0&&cz(a)){const{from:f,to:p}=a;c.push({from:f,to:p})}else u.forEach((f,p)=>{c.push({from:f,to:p})});c.forEach(f=>{const p=d.map(f.from,-1),h=d.map(f.to);r.push({from:p,to:h,prevFrom:i.map(p,-1),prevTo:i.map(h)})})});const s=ta(r,(a,l)=>a.from-l.from);return xz(s)}function kz(e,t){const r=[],n=_C(e,t);for(const o of n)try{const i=e.doc.resolve(o.from),s=e.doc.resolve(o.to),a=i.blockRange(s);a&&r.push(a)}catch{}return r}function wz(e){var t;return((t=e.content.firstChild)==null?void 0:t.textContent)??""}function Sz(e,t){if(!ms(e.selection))return;let{from:r,to:n}=e.selection;const o=(s,a)=>wz(le.between(e.doc.resolve(s),e.doc.resolve(a)).content());for(let s=o(r-1,r);s&&!t.test(s);r--,s=o(r-1,r));for(let s=o(n,n+1);s&&!t.test(s);n++,s=o(n,n+1));if(r===n)return;const i=e.doc.textBetween(r,n,wv,` -`);return{from:r,to:n,text:i}}function _C(e){return wz(e,/\W/)}function Zo(e,t=0){const r=ct(e)?e[t]:e;return U4(ne(r),`No match string found for match ${e}`),r??""}function Sz(e){return gs(e)?e.$cursor:void 0}function Ez(e,t){return Id(e)?t?e.type===t.nodes.doc:e.type.name==="doc":!1}function Cz(e){return Zt(e)&&Jt(e.anchor)&&Jt(e.head)}function jr(e,t){const r=t.nodeSize-2,n=0;let o;const i=l=>Ad({min:n,max:r,value:l});if(Wv(e))return e;if(e==="all")return new kr(t);if(e==="start"?o=n:e==="end"?o=r:mz(e)?o=e.pos:o=e,Jt(o))return o=i(o),le.near(t.resolve(o));if(Cz(o)){const l=i(o.anchor),c=i(o.head);return le.between(t.resolve(l),t.resolve(c))}const s=i(o.from),a=i(o.to);return le.between(t.resolve(s),t.resolve(a))}var Mz=3;function AC(e){const{content:t,schema:r,document:n,stringHandler:o,onError:i,attempts:s=0}=e,a=i&&s<=Mz||s===0;if(te(a,{code:H.INVALID_CONTENT,message:"The invalid content has been called recursively more than ${MAX_ATTEMPTS} times. The content is invalid and the error handler has not been able to recover properly."}),ne(t))return te(o,{code:H.INVALID_CONTENT,message:`The string '${t}' was added to the editor, but no \`stringHandler\` was added. Please provide a valid string handler which transforms your content to a \`ProsemirrorNode\` to prevent this error.`}),o({document:n,content:t,schema:r});if(CC(t))return t.doc;if(Id(t))return t;try{return r.nodeFromJSON(t)}catch(l){const c=Nz({schema:r,error:l,json:t}),u=i==null?void 0:i(c);return te(u,{code:H.INVALID_CONTENT,message:`An error occurred when processing the content. Please provide an \`onError\` handler to process the invalid content: ${JSON.stringify(c.invalidContent,null,2)}`}),AC({...e,content:u,attempts:s+1})}}function Fh(){const e=NE();if(e)return e;throw new Error(`Unable to retrieve the document from the global scope. +`);return{from:r,to:n,text:i}}function AC(e){return Sz(e,/\W/)}function Zo(e,t=0){const r=ct(e)?e[t]:e;return W4(oe(r),`No match string found for match ${e}`),r??""}function Ez(e){return ms(e)?e.$cursor:void 0}function Cz(e,t){return Id(e)?t?e.type===t.nodes.doc:e.type.name==="doc":!1}function Mz(e){return Zt(e)&&Jt(e.anchor)&&Jt(e.head)}function jr(e,t){const r=t.nodeSize-2,n=0;let o;const i=l=>Ad({min:n,max:r,value:l});if(Kv(e))return e;if(e==="all")return new kr(t);if(e==="start"?o=n:e==="end"?o=r:gz(e)?o=e.pos:o=e,Jt(o))return o=i(o),le.near(t.resolve(o));if(Mz(o)){const l=i(o.anchor),c=i(o.head);return le.between(t.resolve(l),t.resolve(c))}const s=i(o.from),a=i(o.to);return le.between(t.resolve(s),t.resolve(a))}var Tz=3;function NC(e){const{content:t,schema:r,document:n,stringHandler:o,onError:i,attempts:s=0}=e,a=i&&s<=Tz||s===0;if(re(a,{code:B.INVALID_CONTENT,message:"The invalid content has been called recursively more than ${MAX_ATTEMPTS} times. The content is invalid and the error handler has not been able to recover properly."}),oe(t))return re(o,{code:B.INVALID_CONTENT,message:`The string '${t}' was added to the editor, but no \`stringHandler\` was added. Please provide a valid string handler which transforms your content to a \`ProsemirrorNode\` to prevent this error.`}),o({document:n,content:t,schema:r});if(MC(t))return t.doc;if(Id(t))return t;try{return r.nodeFromJSON(t)}catch(l){const c=Rz({schema:r,error:l,json:t}),u=i==null?void 0:i(c);return re(u,{code:B.INVALID_CONTENT,message:`An error occurred when processing the content. Please provide an \`onError\` handler to process the invalid content: ${JSON.stringify(c.invalidContent,null,2)}`}),NC({...e,content:u,attempts:s+1})}}function Vh(){const e=RE();if(e)return e;throw new Error(`Unable to retrieve the document from the global scope. It seems that you are running Remirror in a non-browser environment. Remirror need browser APIs to work. If you are using Jest (or other testing frameworks), make sure that you are using the JSDOM environment (https://jestjs.io/docs/29.0/configuration#testenvironment-string). If you are using Next.js (or other server-side rendering frameworks), please use dynamic import with \`ssr: false\` to load the editor component without rendering it on the server (https://nextjs.org/docs/advanced-features/dynamic-import#with-no-ssr). -If you are using Node.js, you can install JSDOM and Remirror will try to use it automatically, or you can create a fake document and pass it to Remirror`)}function NC(e){var t;return(e==null?void 0:e.defaultView)??(typeof window<"u"?window:void 0)??((t=NE())==null?void 0:t.defaultView)}function RC(e){return NC(e==null?void 0:e.ownerDocument)}function PC(e){const t=NC(e)??Fh().defaultView;if(t)return t;throw new Error("Unable to retrieve the window from the global scope")}function zC(e){return PC(e==null?void 0:e.ownerDocument)}function Tz(e,t=Fh()){const r=Ez(e,e.type.schema)?e.content:R.from(e);return an.fromSchema(e.type.schema).serializeFragment(r,{document:t})}function Oz(e,t){return new(PC(t)).DOMParser().parseFromString(`${e}`,"text/html").body}function _z(e,t=Fh()){const r=t.createElement("div");return r.append(Tz(e,t)),r.innerHTML}function j1(e){const{content:t,schema:r,document:n,fragment:o=!1,...i}=e,s=Oz(t,n),a=Cv.fromSchema(r);return o?a.parseSlice(s,{...c2,...i}).content:a.parse(s,{...c2,...i})}var c2={preserveWhitespace:!1};function $d(e,t){const r=Lu(t.defaults());return wv({...e},r)}function qv(e,t){let r="";t&&(r=`${t.trim()}`);const n=xN(e);if(!n)return r;const o=(r.endsWith(";")," ");return`${r}${o}${n}`}var Az={remove(e,t){let r=e;for(const n of t)n.invalidParentNode||(r=hA(n.path,r));return r}};function Nz({json:e,schema:t,...r}){const n=new Set(Lu(t.marks)),o=new Set(Lu(t.nodes)),i=LC({json:e,path:[],validNodes:o,validMarks:n});return{json:e,invalidContent:i,transformers:Az,...r}}function LC(e){const{json:t,validMarks:r,validNodes:n,path:o=[]}=e,i={validMarks:r,validNodes:n},s=[],{type:a,marks:l,content:c}=t;let{invalidParentMark:u=!1,invalidParentNode:d=!1}=e;if(l){const f=[];for(const[p,h]of l.entries()){const m=ne(h)?h:h.type;r.has(m)||(f.unshift({name:m,path:[...o,"marks",`${p}`],type:"mark",invalidParentMark:u,invalidParentNode:d}),u=!0)}s.push(...f)}if(n.has(a)||(s.push({name:a,type:"node",path:o,invalidParentMark:u,invalidParentNode:d}),d=!0),c){const f=[];for(const[p,h]of c.entries())f.unshift(...LC({...i,json:h,path:[...o,"content",`${p}`],invalidParentMark:u,invalidParentNode:d}));s.unshift(...f)}return s}function Rz(e){return!!(gs(e)&&e.$cursor&&e.$cursor.parentOffset>=e.$cursor.parent.content.size)}function U1(e){return!!(gs(e)&&e.$cursor&&e.$cursor.parentOffset<=0)}function u2(e){const t=be.atStart(e.$anchor.doc);return!!(U1(e)&&t.anchor===e.anchor)}function Pz(e){return({dispatch:t,tr:r})=>{const{type:n,attrs:o=ee(),appendText:i,range:s}=e,a=s?le.between(r.doc.resolve(s.from),r.doc.resolve(s.to)):r.selection,{$from:l,from:c,to:u}=a;let d=l.depth===0?r.doc.type.allowsMarkType(n):!1;return r.doc.nodesBetween(c,u,f=>{if(d)return!1;if(f.inlineContent&&f.type.allowsMarkType(n)){d=!0;return}}),d?(t==null||t(r.addMark(c,u,n.create(o))&&i?r.insertText(i):r),!0):!1}}function zz({tr:e,dispatch:t}){const{$from:r,$to:n}=e.selection,o=r.blockRange(n),i=o&&rc(o);return!Jt(i)||!o?!1:(t==null||t(e.lift(o,i).scrollIntoView()),!0)}function IC(e,t={},r){return function(n){const{tr:o,dispatch:i,state:s}=n,a=ne(e)?it(s.schema.nodes,e):e,{from:l,to:c}=jr(r??o.selection,o.doc),u=o.doc.resolve(l),d=o.doc.resolve(c),f=u.blockRange(d),p=f&&Tv(f,a,t);return!p||!f?!1:(i==null||i(o.wrap(f,p).scrollIntoView()),!0)}}function DC(e,t={},r){return n=>{const{tr:o,state:i}=n,s=ne(e)?it(i.schema.nodes,e):e;return Bu({state:o,type:s,attrs:t})?zz(n):IC(e,t,r)(n)}}function Fu(e,t,r,n=!0){return function(o){const{tr:i,dispatch:s,state:a}=o,l=ne(e)?it(a.schema.nodes,e):e,{from:c,to:u}=jr(r??i.selection,i.doc);let d=!1,f;return i.doc.nodesBetween(c,u,(p,h)=>{if(d)return!1;if(!p.isTextblock||p.hasMarkup(l,t))return;if(p.type===l){d=!0,f=p.attrs;return}const m=i.doc.resolve(h),b=m.index();d=m.parent.canReplaceWith(b,b+1,l),d&&(f=m.parent.attrs)}),d?(s==null||s(i.setBlockType(c,u,l,{...n?f:{},...t}).scrollIntoView()),!0):!1}}function Gv(e){return t=>{const{tr:r,state:n}=t,{type:o,attrs:i,preserveAttrs:s=!0}=e,a=Bu({state:r,type:o,attrs:i}),l=e.toggleType??Hh(n.schema);if(a)return Fu(l,{...s?a.node.attrs:{},...i})(t);const c=Bu({state:r,type:l,attrs:i});return Fu(o,{...s?c==null?void 0:c.node.attrs:{},...i})(t)}}function Lz(e=0){const t=navigator.userAgent.match(/Chrom(e|ium)\/(\d+)\./);return t?Number.parseInt(it(t,2),10)>=e:!1}function Iz(e,t){let{head:r,empty:n,anchor:o}=e;for(const i of t.steps)r=i.getMap().map(r);n?t.setSelection(le.near(t.doc.resolve(r))):t.setSelection(le.between(t.doc.resolve(o),t.doc.resolve(r)))}function Dz(e){const{attrs:t={},appendText:r="",content:n="",keepSelection:o=!1,range:i}=e;return({state:s,tr:a,dispatch:l})=>{var c;const u=s.schema,d=jr(e.selection??i??a.selection,a.doc),f=d.$from.index(),{from:p,to:h,$from:m}=d,b=ne(e.type)?u.nodes[e.type]??u.marks[e.type]:e.type;if(te(ne(e.type)?b:!0,{code:H.SCHEMA,message:`Schema contains no marks or nodes with name ${b}`}),cz(b)){if(!m.parent.canReplaceWith(f,f,b))return!1;a.replaceWith(p,h,b.create(t,n?u.text(n):void 0))}else te(n,{message:"`replaceText` cannot be called without content when using a mark type"}),a.replaceWith(p,h,u.text(n,EC(b)?[b.create(t)]:void 0));return r&&a.insertText(r),o&&Iz(s.selection,a),l&&(Lz(60)&&((c=document.getSelection())==null||c.empty()),l(a)),!0}}function $C(e,t){const r=e.parent.childAfter(e.parentOffset);if(!r.node)return;const{marks:n,nodeSize:o}=r.node;if(n[0])return n[0].type;const s=e.start()+r.offset+o;return $C(e.doc.resolve(s+1))}function HC(e){return({dispatch:t,tr:r,state:n})=>{const{type:o,expand:i=!0,range:s}=e,a=jr(e.selection??s??r.selection,r.doc);let{from:l,to:c,$from:u,$to:d}=a;const f=ne(o)?n.schema.marks[o]:o;f!==null&&te(f,{code:H.SCHEMA,message:`Mark type: ${o} does not exist on the current schema.`});const p=f??$C(u);if(!p)return!1;const h=_o(u,p,d);return i&&h&&(l=Math.max(0,Math.min(l,h.from)),c=Math.min(Math.max(c,h.to),r.doc.nodeSize-2)),t==null||t(r.removeMark(l,Jt(c)?c:l,EC(f)?f:void 0)),!0}}function $z(e){const t=["command","cmd","meta"];return on.isMac&&t.push("mod"),t.includes(e)}function Hz(e){const t=["control","ctrl"];return on.isMac||t.push("mod"),t.includes(e)}function Bz(e){const t=[];for(let r of e.split("-")){if(r=r.toLowerCase(),$z(r)){t.push({type:"modifier",symbol:"⌘",key:"command",i18n:Mt.COMMAND_KEY});continue}if(Hz(r)){t.push({type:"modifier",symbol:"⌃",key:"control",i18n:Mt.CONTROL_KEY});continue}switch(r){case"shift":t.push({type:"modifier",symbol:"⇧",key:r,i18n:Mt.SHIFT_KEY});continue;case"alt":t.push({type:"modifier",symbol:"⌥",key:r,i18n:Mt.ALT_KEY});continue;case` -`:case"\r":case"enter":t.push({type:"named",symbol:"↵",key:r,i18n:Mt.ENTER_KEY});continue;case"backspace":t.push({type:"named",symbol:"⌫",key:r,i18n:Mt.BACKSPACE_KEY});continue;case"delete":t.push({type:"named",symbol:"⌦",key:r,i18n:Mt.DELETE_KEY});continue;case"escape":t.push({type:"named",symbol:"␛",key:r,i18n:Mt.ESCAPE_KEY});continue;case"tab":t.push({type:"named",symbol:"⇥",key:r,i18n:Mt.TAB_KEY});continue;case"capslock":t.push({type:"named",symbol:"⇪",key:r,i18n:Mt.CAPS_LOCK_KEY});continue;case"space":t.push({type:"named",symbol:"␣",key:r,i18n:Mt.SPACE_KEY});continue;case"pageup":t.push({type:"named",symbol:"⤒",key:r,i18n:Mt.PAGE_UP_KEY});continue;case"pagedown":t.push({type:"named",symbol:"⤓",key:r,i18n:Mt.PAGE_DOWN_KEY});continue;case"home":t.push({type:"named",key:r,i18n:Mt.HOME_KEY});continue;case"end":t.push({type:"named",key:r,i18n:Mt.END_KEY});continue;case"arrowleft":t.push({type:"named",symbol:"←",key:r,i18n:Mt.ARROW_LEFT_KEY});continue;case"arrowright":t.push({type:"named",symbol:"→",key:r,i18n:Mt.ARROW_RIGHT_KEY});continue;case"arrowup":t.push({type:"named",symbol:"→",key:r,i18n:Mt.ARROW_UP_KEY});continue;case"arrowdown":t.push({type:"named",symbol:"↓",key:r,i18n:Mt.ARROW_DOWN_KEY});continue;default:t.push({type:"char",key:r});continue}}return t}function Fz(e){const{node:t,predicate:r,descend:n=!0,action:o}=e;te(Id(t),{code:H.INTERNAL,message:'Invalid "node" parameter passed to "findChildren".'}),te(_e(r),{code:H.INTERNAL,message:'Invalid "predicate" parameter passed to "findChildren".'});const i=[];return t.descendants((s,a)=>{const l={node:s,pos:a};return r(l)&&(i.push(l),o==null||o(l)),n}),i}function Vz(e){const{type:t,...r}=e;return Fz({...r,predicate:n=>n.node.type===t})}function jz(e,t={}){const{descend:r=!1,predicate:n,StepTypes:o}=t,i=xz(e,o),s=[];for(const a of i){const{start:l,end:c}=a;e.doc.nodesBetween(l,c,(u,d)=>(((n==null?void 0:n(u,d,a))??!0)&&s.push({node:u,pos:d}),r))}return s}function Vu(e){const{regexp:t,type:r,getAttributes:n,ignoreWhitespace:o=!1,beforeDispatch:i,updateCaptured:s,shouldSkip:a,invalidMarks:l}=e;let c;const u=new wa(t,(d,f,p,h)=>{const{tr:m,schema:b}=d;c||(c=ne(r)?b.marks[r]:r,te(c,{code:H.SCHEMA,message:`Mark type: ${r} does not exist on the current schema.`}));let v=f[1],g=f[0];const y=FC({captureGroup:v,fullMatch:g,end:h,start:p,rule:u,state:d,ignoreWhitespace:o,invalidMarks:l,shouldSkip:a,updateCaptured:s});if(!y)return null;({start:p,end:h,captureGroup:v,fullMatch:g}=y);const x=_e(n)?n(f):n;let k=h,w=[];if(v){const E=g.search(/\S/),T=p+g.indexOf(v),C=T+v.length;w=m.storedMarks??[],Cp&&m.delete(p+E,T),k=p+E+v.length}return m.addMark(p,k,c.create(x)),m.setStoredMarks(w),i==null||i({tr:m,match:f,start:p,end:h}),m});return u}function BC(e){const{regexp:t,type:r,getAttributes:n,beforeDispatch:o,shouldSkip:i,ignoreWhitespace:s=!1,updateCaptured:a,invalidMarks:l}=e,c=new wa(t,(u,d,f,p)=>{const h=_e(n)?n(d):n,{tr:m,schema:b}=u,v=ne(r)?b.nodes[r]:r;let g=d[1],y=d[0];const x=FC({captureGroup:g,fullMatch:y,end:p,start:f,rule:c,state:u,ignoreWhitespace:s,invalidMarks:l,shouldSkip:i,updateCaptured:a});if(!x)return null;({start:f,end:p,captureGroup:g,fullMatch:y}=x),te(v,{code:H.SCHEMA,message:`No node exists for ${r} in the schema.`});const k=v.createAndFill(h);return k&&(m.replaceRangeWith(v.isBlock?m.doc.resolve(f).before():f,p,k),o==null||o({tr:m,match:[y,g??""],start:f,end:p})),m});return c}function FC({captureGroup:e,fullMatch:t,end:r,start:n,rule:o,ignoreWhitespace:i,shouldSkip:s,updateCaptured:a,state:l,invalidMarks:c}){var u;if(t==null)return null;const d=(a==null?void 0:a({captureGroup:e,fullMatch:t,start:n,end:r}))??{};e=d.captureGroup??e,t=d.fullMatch??t,n=d.start??n,r=d.end??r;const f=l.doc.resolve(n),p=l.doc.resolve(r);return c&&F1({$from:f,$to:p},c)||o.invalidMarks&&F1({$from:f,$to:p},o.invalidMarks)||i&&(e==null?void 0:e.trim())===""||s!=null&&s({state:l,captureGroup:e,fullMatch:t,start:n,end:r,ruleType:"mark"})||(u=o.shouldSkip)!=null&&u.call(o,{state:l,captureGroup:e,fullMatch:t,start:n,end:r,ruleType:"mark"})?null:{captureGroup:e,end:r,fullMatch:t,start:n}}var Uz=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),r={},n=[];t.forEach(i=>{(i?i.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,l]=a.split("_");r[l]=a}else n.push(a)})});const o=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&o.push(r[i]);return o.push(...n),o.join(" ")},Wz=Uz;const VC=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Kz(e,t){let{$cursor:r}=e.selection;return!r||(t?!t.endOfTextblock("backward",e):r.parentOffset>0)?null:r}const jC=(e,t,r)=>{let n=Kz(e,r);if(!n)return!1;let o=UC(n);if(!o){let s=n.blockRange(),a=s&&rc(s);return a==null?!1:(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&qC(e,o,t))return!0;if(n.parent.content.size==0&&(zl(i,"end")||ce.isSelectable(i))){let s=Ov(e.doc,n.before(),n.after(),K.empty);if(s&&s.slice.size{let{$head:n,empty:o}=e.selection,i=n;if(!o)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("backward",e):n.parentOffset>0)return!1;i=UC(n)}let s=i&&i.nodeBefore;return!s||!ce.isSelectable(s)?!1:(t&&t(e.tr.setSelection(ce.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function UC(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Gz(e,t){let{$cursor:r}=e.selection;return!r||(t?!t.endOfTextblock("forward",e):r.parentOffset{let n=Gz(e,r);if(!n)return!1;let o=WC(n);if(!o)return!1;let i=o.nodeAfter;if(qC(e,o,t))return!0;if(n.parent.content.size==0&&(zl(i,"start")||ce.isSelectable(i))){let s=Ov(e.doc,n.before(),n.after(),K.empty);if(s&&s.slice.size{let{$head:n,empty:o}=e.selection,i=n;if(!o)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("forward",e):n.parentOffset=0;t--){let r=e.node(t);if(e.index(t)+1{let{$head:r,$anchor:n}=e.selection;return!r.parent.type.spec.code||!r.sameParent(n)?!1:(t&&t(e.tr.insertText(` -`).scrollIntoView()),!0)};function Yv(e){for(let t=0;t{let{$head:r,$anchor:n}=e.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;let o=r.node(-1),i=r.indexAfter(-1),s=Yv(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let a=r.after(),l=e.tr.replaceWith(a,a,s.createAndFill());l.setSelection(be.near(l.doc.resolve(a),1)),t(l.scrollIntoView())}return!0},Qz=(e,t)=>{let r=e.selection,{$from:n,$to:o}=r;if(r instanceof kr||n.parent.inlineContent||o.parent.inlineContent)return!1;let i=Yv(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let s=(!n.parentOffset&&o.index(){let{$cursor:r}=e.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let i=r.before();if(dl(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let n=r.blockRange(),o=n&&rc(n);return o==null?!1:(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)};function eL(e){return(t,r)=>{let{$from:n,$to:o}=t.selection;if(t.selection instanceof ce&&t.selection.node.isBlock)return!n.parentOffset||!dl(t.doc,n.pos)?!1:(r&&r(t.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(r){let i=o.parentOffset==o.parent.content.size,s=t.tr;(t.selection instanceof le||t.selection instanceof kr)&&s.deleteSelection();let a=n.depth==0?null:Yv(n.node(-1).contentMatchAt(n.indexAfter(-1))),l=e&&e(o.parent,i),c=l?[l]:i&&a?[{type:a}]:void 0,u=dl(s.doc,s.mapping.map(n.pos),1,c);if(!c&&!u&&dl(s.doc,s.mapping.map(n.pos),1,a?[{type:a}]:void 0)&&(a&&(c=[{type:a}]),u=!0),u&&(s.split(s.mapping.map(n.pos),1,c),!i&&!n.parentOffset&&n.parent.type!=a)){let d=s.mapping.map(n.before()),f=s.doc.resolve(d);a&&n.node(-1).canReplaceWith(f.index(),f.index()+1,a)&&s.setNodeMarkup(s.mapping.map(n.before()),a)}r(s.scrollIntoView())}return!0}}const tL=eL(),rL=(e,t)=>{let{$from:r,to:n}=e.selection,o,i=r.sharedDepth(n);return i==0?!1:(o=r.before(i),t&&t(e.tr.setSelection(ce.create(e.doc,o))),!0)},nL=(e,t)=>(t&&t(e.tr.setSelection(new kr(e.doc))),!0);function oL(e,t,r){let n=t.nodeBefore,o=t.nodeAfter,i=t.index();return!n||!o||!n.type.compatibleContent(o.type)?!1:!n.content.size&&t.parent.canReplace(i-1,i)?(r&&r(e.tr.delete(t.pos-n.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(i,i+1)||!(o.isTextblock||Rd(e.doc,t.pos))?!1:(r&&r(e.tr.clearIncompatible(t.pos,n.type,n.contentMatchAt(n.childCount)).join(t.pos).scrollIntoView()),!0)}function qC(e,t,r){let n=t.nodeBefore,o=t.nodeAfter,i,s;if(n.type.spec.isolating||o.type.spec.isolating)return!1;if(oL(e,t,r))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(i=(s=n.contentMatchAt(n.childCount)).findWrapping(o.type))&&s.matchType(i[0]||o.type).validEnd){if(r){let d=t.pos+o.nodeSize,f=R.empty;for(let m=i.length-1;m>=0;m--)f=R.from(i[m].create(null,f));f=R.from(n.copy(f));let p=e.tr.step(new bt(t.pos-1,d,t.pos,d,new K(f,1,0),i.length,!0)),h=d+2*i.length;Rd(p.doc,h)&&p.join(h),r(p.scrollIntoView())}return!0}let l=be.findFrom(t,1),c=l&&l.$from.blockRange(l.$to),u=c&&rc(c);if(u!=null&&u>=t.depth)return r&&r(e.tr.lift(c,u).scrollIntoView()),!0;if(a&&zl(o,"start",!0)&&zl(n,"end")){let d=n,f=[];for(;f.push(d),!d.isTextblock;)d=d.lastChild;let p=o,h=1;for(;!p.isTextblock;p=p.firstChild)h++;if(d.canReplace(d.childCount,d.childCount,p.content)){if(r){let m=R.empty;for(let v=f.length-1;v>=0;v--)m=R.from(f[v].copy(m));let b=e.tr.step(new bt(t.pos-f.length,t.pos+o.nodeSize,t.pos+h,t.pos+o.nodeSize-h,new K(m,f.length,0),0,!0));r(b.scrollIntoView())}return!0}}return!1}function GC(e){return function(t,r){let n=t.selection,o=e<0?n.$from:n.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(r&&r(t.tr.setSelection(le.create(t.doc,e<0?o.start(i):o.end(i)))),!0):!1}}const iL=GC(-1),sL=GC(1);function aL(e,t,r){for(let n=0;n{if(s)return!1;s=a.inlineContent&&a.type.allowsMarkType(r)}),s)return!0}return!1}function lL(e,t=null){return function(r,n){let{empty:o,$cursor:i,ranges:s}=r.selection;if(o&&!i||!aL(r.doc,s,e))return!1;if(n)if(i)e.isInSet(r.storedMarks||i.marks())?n(r.tr.removeStoredMark(e)):n(r.tr.addStoredMark(e.create(t)));else{let a=!1,l=r.tr;for(let c=0;!a&&c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},uL=typeof navigator<"u"&&/Mac/.test(navigator.platform),dL=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Yt=0;Yt<10;Yt++)rs[48+Yt]=rs[96+Yt]=String(Yt);for(var Yt=1;Yt<=24;Yt++)rs[Yt+111]="F"+Yt;for(var Yt=65;Yt<=90;Yt++)rs[Yt]=String.fromCharCode(Yt+32),Pp[Yt]=String.fromCharCode(Yt);for(var wg in rs)Pp.hasOwnProperty(wg)||(Pp[wg]=rs[wg]);function fL(e){var t=uL&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||dL&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",r=!t&&e.key||(e.shiftKey?Pp:rs)[e.keyCode]||e.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}const pL=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function hL(e){let t=e.split(/-(?!$)/),r=t[t.length-1];r=="Space"&&(r=" ");let n,o,i,s;for(let a=0;a127)&&(i=rs[n.keyCode])&&i!=o){let a=t[Sg(i,n)];if(a&&a(r.state,r.dispatch,r))return!0}}return!1}}function gL(e){const t=ra(e,(i,s)=>(s.priority??Ae.Low)-(i.priority??Ae.Low)),r=[],n=[];for(const i of t)SL(i)?r.push(i):n.push(i);let o;return new Ro({key:vL,view:i=>(o=i,{}),props:{transformPasted:i=>{var s,a,l;const c=o.state.selection.$from,u=c.node().type.name,d=new Set(c.marks().map(f=>f.type.name));for(const f of r){if((s=f.ignoredNodes)!=null&&s.includes(u)||(a=f.ignoredMarks)!=null&&a.some(g=>d.has(g)))continue;const p=((l=i.content.firstChild)==null?void 0:l.textContent)??"",h=!o.state.selection.empty&&i.content.childCount===1&&p,m=xa(p,f.regexp)[0];if(h&&m&&f.type==="mark"&&f.replaceSelection){const{from:g,to:y}=o.state.selection,x=o.state.doc.slice(g,y),k=x.content.textBetween(0,x.content.size);if(typeof f.replaceSelection!="boolean"?f.replaceSelection(k):f.replaceSelection){const w=[],{getAttributes:E,markType:T}=f,C=_e(E)?E(m,!0):E,M=T.create(C);return x.content.forEach(N=>{if(N.isText){const F=M.addToSet(N.marks);w.push(N.mark(F))}}),K.maxOpen(R.fromArray(w))}}const{nodes:b,transformed:v}=kL(i.content,f,o.state.schema);v&&(i=f.type==="node"&&f.nodeType.isBlock?new K(R.fromArray(b),0,0):new K(R.fromArray(b),i.openStart,i.openEnd))}return TL(i)},handleDOMEvents:{paste:(i,s)=>{var a,l;const c=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{clipboardData:u}=c;if(!u)return!1;const d=[...u.items].map(p=>p.getAsFile()).filter(p=>!!p);if(d.length===0)return!1;const{selection:f}=i.state;for(const{fileHandler:p,regexp:h}of n){const m=h?d.filter(b=>h.test(b.type)):d;if(m.length!==0&&p({event:c,files:m,selection:f,view:i,type:"paste"}))return c.preventDefault(),!0}return!1},drop:(i,s)=>{var a,l,c;const u=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{dataTransfer:d,clientX:f,clientY:p}=u;if(!d)return!1;const h=ML(u);if(h.length===0)return!1;const m=((c=i.posAtCoords({left:f,top:p}))==null?void 0:c.pos)??i.state.selection.anchor;for(const{fileHandler:b,regexp:v}of n){const g=v?h.filter(y=>v.test(y.type)):h;if(g.length!==0&&b({event:u,files:g,pos:m,view:i,type:"drop"}))return u.preventDefault(),!0}return!1}}}})}var vL=new ka("pasteRule");function Eg(e,t){return function r(n){const{fragment:o,rule:i,nodes:s}=n,{regexp:a,ignoreWhitespace:l,ignoredMarks:c,ignoredNodes:u}=i;let d=!1;return o.forEach(f=>{if(u!=null&&u.includes(f.type.name)||EL(f)){s.push(f);return}if(!f.isText){const m=r({fragment:f.content,rule:i,nodes:[]});d||(d=m.transformed);const b=R.fromArray(m.nodes);f.type.validContent(b)?s.push(f.copy(b)):s.push(...m.nodes);return}if(f.marks.some(m=>CL(m)||(c==null?void 0:c.includes(m.type.name)))){s.push(f);return}const p=f.text??"";let h=0;for(const m of xa(p,a)){const b=m[1],v=m[0];if(l&&(b==null?void 0:b.trim())===""||!v)return;const g=m.index,y=g+v.length;g>h&&s.push(f.cut(h,g));let x=f.cut(g,y);if(v&&b){const k=v.search(/\S/),w=g+v.indexOf(b),E=w+b.length;k&&s.push(f.cut(g,g+k)),x=f.cut(w,E)}e({nodes:s,rule:i,textNode:x,match:m,schema:t}),d=!0,h=y}p&&h0?[...n.files]:(r=n.items)!=null&&r.length?[...n.items].map(o=>o.getAsFile()).filter(o=>!!o):[]:[]}function TL(e){const t=K.maxOpen(e.content);return t.openStart({events:{},emit(e,...t){(this.events[e]||[]).forEach(r=>r(...t))},on(e,t){return(this.events[e]=this.events[e]||[]).push(t),()=>this.events[e]=(this.events[e]||[]).filter(r=>r!==t)}});var OL=Object.defineProperty,_L=Object.getOwnPropertyDescriptor,Z=(e,t,r,n)=>{for(var o=n>1?void 0:n?_L(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&OL(t,r,o),o},JC=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},G=(e,t,r)=>(JC(e,t,"read from private field"),r?r.call(e):t.get(e)),kt=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Lt=(e,t,r,n)=>(JC(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);function AL(e,t){return e===t}function f2(e){const{previousOptions:t,update:r,equals:n=AL}=e,o=Hs({...t,...r}),i=ee(),s=Lu(t);for(const l of s){const c=t[l],u=o[l];if(n(c,u)){i[l]={changed:!1};continue}i[l]={changed:!0,previousValue:c,value:u}}const a=l=>{const c=ee();for(const u of l){const d=i[u];d!=null&&d.changed&&(c[u]=d.value)}return c};return{changes:Hs(i),options:o,pickChanged:a}}var NL={[H.DUPLICATE_HELPER_NAMES]:"helper method",[H.DUPLICATE_COMMAND_NAMES]:"command method"};function XC(e){const{name:t,set:r,code:n}=e,o=NL[n];te(!r.has(t),{code:n,message:`There is a naming conflict for the name: ${t} used in this '${o}'. Please rename or remove from the editor to avoid runtime errors.`}),r.add(t)}function ju(...e){return Ml(Wz(...e).split(" ")).join(" ")}var p2="__IGNORE__",RL="__ALL__",sc=class{constructor(e,...[t]){this["~O"]={},this._mappedHandlers=ee(),this.populateMappedHandlers(),this._options=this._initialOptions=X4(e,this.constructor.defaultOptions,t??ee(),this.createDefaultHandlerOptions()),this._dynamicKeys=this.getDynamicKeys(),this.init()}get options(){return this._options}get dynamicKeys(){return this._dynamicKeys}get initialOptions(){return this._initialOptions}init(){}getDynamicKeys(){const e=[],{customHandlerKeys:t,handlerKeys:r,staticKeys:n}=this.constructor;for(const o of Lu(this._options))n.includes(o)||r.includes(o)||t.includes(o)||e.push(o);return e}ensureAllKeysAreDynamic(e){}setOptions(e){var t;const r=this.getDynamicOptions();this.ensureAllKeysAreDynamic(e);const{changes:n,options:o,pickChanged:i}=f2({previousOptions:r,update:e});this.updateDynamicOptions(o),(t=this.onSetOptions)==null||t.call(this,{reason:"set",changes:n,options:o,pickChanged:i,initialOptions:this._initialOptions})}resetOptions(){var e;const t=this.getDynamicOptions(),{changes:r,options:n,pickChanged:o}=f2({previousOptions:t,update:this._initialOptions});this.updateDynamicOptions(n),(e=this.onSetOptions)==null||e.call(this,{reason:"reset",options:n,changes:r,pickChanged:o,initialOptions:this._initialOptions})}getDynamicOptions(){return wv(this._options,[...this.constructor.customHandlerKeys,...this.constructor.handlerKeys])}updateDynamicOptions(e){this._options={...this._options,...e}}populateMappedHandlers(){for(const e of this.constructor.handlerKeys)this._mappedHandlers[e]=[]}createDefaultHandlerOptions(){const e=ee();for(const t of this.constructor.handlerKeys)e[t]=(...r)=>{var n;const{handlerKeyOptions:o}=this.constructor,i=(n=o[t])==null?void 0:n.reducer;let s=i==null?void 0:i.getDefault(...r);for(const[,a]of this._mappedHandlers[t]){const l=a(...r);if(s=i?i.accumulator(s,l,...r):l,PL(o,s,t))return s}return s};return e}addHandler(e,t,r=Ae.Default){return this._mappedHandlers[e].push([r,t]),this.sortHandlers(e),()=>this._mappedHandlers[e]=this._mappedHandlers[e].filter(([,n])=>n!==t)}hasHandlers(e){return(this._mappedHandlers[e]??[]).length>0}sortHandlers(e){this._mappedHandlers[e]=ra(this._mappedHandlers[e],([t],[r])=>r-t)}addCustomHandler(e,t){var r;return((r=this.onAddCustomHandler)==null?void 0:r.call(this,{[e]:t}))??J4}};sc.defaultOptions={};sc.staticKeys=[];sc.handlerKeys=[];sc.handlerKeyOptions={};sc.customHandlerKeys=[];function PL(e,t,r){const{[RL]:n}=e,o=e[r];return!n&&!o?!1:!!(o&&o.earlyReturnValue!==p2&&(_e(o.earlyReturnValue)?o.earlyReturnValue(t)===!0:t===o.earlyReturnValue)||n&&n.earlyReturnValue!==p2&&(_e(n.earlyReturnValue)?n.earlyReturnValue(t)===!0:t===n.earlyReturnValue))}var Uh=class extends sc{constructor(...e){super(zL,...e),this["~E"]={},this._extensions=Z4(this.createExtensions(),t=>t.constructor),this.extensionMap=new Map;for(const t of this._extensions)this.extensionMap.set(t.constructor,t)}get priority(){return this.priorityOverride??this.options.priority??this.constructor.defaultPriority}get constructorName(){return`${V4(this.name)}Extension`}get store(){return te(this._store,{code:H.MANAGER_PHASE_ERROR,message:"An error occurred while attempting to access the 'extension.store' when the Manager has not yet set created the lifecycle methods."}),Hs(this._store,{requireKeys:!0})}get extensions(){return this._extensions}replaceChildExtension(e,t){this.extensionMap.has(e)&&(this.extensionMap.set(e,t),this._extensions=this.extensions.map(r=>t.constructor===e?t:r))}createExtensions(){return[]}getExtension(e){const t=this.extensionMap.get(e);return te(t,{code:H.INVALID_GET_EXTENSION,message:`'${e.name}' does not exist within the preset: '${this.name}'`}),t}isOfType(e){return this.constructor===e}setStore(e){this._store||(this._store=e)}clone(...e){return new this.constructor(...e)}setPriority(e){this.priorityOverride=e}};Uh.defaultPriority=Ae.Default;var Ve=class extends Uh{static get[ti](){return $t.PlainExtensionConstructor}get[ti](){return $t.PlainExtension}},li=class extends Uh{static get[ti](){return $t.MarkExtensionConstructor}get[ti](){return $t.MarkExtension}get type(){return it(this.store.schema.marks,this.name)}constructor(...e){super(...e)}};li.disableExtraAttributes=!1;var er=class extends Uh{static get[ti](){return $t.NodeExtensionConstructor}get[ti](){return $t.NodeExtension}get type(){return it(this.store.schema.nodes,this.name)}constructor(...e){super(...e)}};er.disableExtraAttributes=!1;var zL={priority:void 0,extraAttributes:{},disableExtraAttributes:!1,exclude:{}};function QC(e){return oc(e)&&ic(e,[$t.PlainExtension,$t.MarkExtension,$t.NodeExtension])}function LL(e){return oc(e)&&ic(e,[$t.PlainExtensionConstructor,$t.MarkExtensionConstructor,$t.NodeExtensionConstructor])}function ZC(e){return oc(e)&&ic(e,$t.PlainExtension)}function Hd(e){return oc(e)&&ic(e,$t.NodeExtension)}function Wh(e){return oc(e)&&ic(e,$t.MarkExtension)}function pe(e){return t=>{const{defaultOptions:r,customHandlerKeys:n,handlerKeys:o,staticKeys:i,defaultPriority:s,handlerKeyOptions:a,...l}=e,c=t;r&&(c.defaultOptions=r),s&&(c.defaultPriority=s),a&&(c.handlerKeyOptions=a),c.staticKeys=i??[],c.handlerKeys=o??[],c.customHandlerKeys=n??[];for(const[u,d]of Object.entries(l))c[u]||(c[u]=d);return c}}var IL=class extends Ve{constructor(){super(...arguments),this.attributeList=[],this.attributeObject=ee(),this.updateAttributes=(e=!0)=>{this.transformAttributes(),e&&this.store.commands.forceUpdate("attributes")}}get name(){return"attributes"}onCreate(){this.transformAttributes(),this.store.setExtensionStore("updateAttributes",this.updateAttributes)}transformAttributes(){var e,t,r;if(this.attributeObject=ee(),(e=this.store.managerSettings.exclude)!=null&&e.attributes){this.store.setStoreKey("attributes",this.attributeObject);return}this.attributeList=[];for(const n of this.store.extensions){if((t=n.options.exclude)!=null&&t.attributes)continue;const o=(r=n.createAttributes)==null?void 0:r.call(n),i={...o,class:ju(...n.classNames??[],o==null?void 0:o.class)};this.attributeList.unshift(i)}for(const n of this.attributeList)this.attributeObject={...this.attributeObject,...n,class:ju(this.attributeObject.class,n.class)};this.store.setStoreKey("attributes",this.attributeObject)}};function He(e={}){return(t,r,n)=>{(t.decoratedHelpers??(t.decoratedHelpers={}))[r]=e}}function U(e={}){return(t,r,n)=>{(t.decoratedCommands??(t.decoratedCommands={}))[r]=e}}function je(e){return(t,r,n)=>{(t.decoratedKeybindings??(t.decoratedKeybindings={}))[r]=e}}var DL=class{constructor(e){this.promiseCreator=e,this.failureHandlers=[],this.successHandlers=[],this.validateHandlers=[],this.generateCommand=()=>t=>{let r=!0;const{view:n,tr:o,dispatch:i}=t;if(!n)return!1;for(const a of this.validateHandlers)if(!a({...t,dispatch:()=>{}})){r=!1;break}return!i||!r?r:(this.promiseCreator(t).then(a=>{this.runHandlers(this.successHandlers,{value:a,state:n.state,tr:n.state.tr,dispatch:n.dispatch,view:n})}).catch(a=>{this.runHandlers(this.failureHandlers,{error:a,state:n.state,tr:n.state.tr,dispatch:n.dispatch,view:n})}),i(o),!0)}}validate(e,t="push"){return this.validateHandlers[t](e),this}success(e,t="push"){return this.successHandlers[t](e),this}failure(e,t="push"){return this.failureHandlers[t](e),this}runHandlers(e,t){var r;for(const n of e)if(!n({...t,dispatch:()=>{}}))break;(r=t.dispatch)==null||r.call(t,t.tr)}};function ns(e){const{type:t,attrs:r,range:n,selection:o}=e;return i=>{const{dispatch:s,tr:a,state:l}=i,c=ne(t)?l.schema.marks[t]:t;if(te(c,{code:H.SCHEMA,message:`Mark type: ${t} does not exist on the current schema.`}),n||o){const{from:u,to:d}=jr(o??n??a.selection,a.doc);return Rp({trState:a,type:t,...n})?s==null||s(a.removeMark(u,d,c)):s==null||s(a.addMark(u,d,c.create(r))),!0}return bu(lL(c,r))(i)}}function $L(e,t,r){for(const{$from:n,$to:o}of r){let i=n.depth===0?t.type.allowsMarkType(e):!1;if(t.nodesBetween(n.pos,o.pos,s=>{if(i)return!1;i=s.inlineContent&&s.type.allowsMarkType(e)}),i)return!0}return!1}function HL(e,t,r){return({tr:n,dispatch:o,state:i})=>{const s=jr(r??n.selection,n.doc),a=Sz(s),l=ne(e)?i.schema.marks[e]:e;if(te(l,{code:H.SCHEMA,message:`Mark type: ${e} does not exist on the current schema.`}),s.empty&&!a||!$L(l,n.doc,s.ranges))return!1;if(!o)return!0;if(a)return n.removeStoredMark(l),t&&n.addStoredMark(l.create(t)),o(n),!0;let c=!1;for(const{$from:u,$to:d}of s.ranges){if(c)break;c=n.doc.rangeHasMark(u.pos,d.pos,l)}for(const{$from:u,$to:d}of s.ranges)c&&n.removeMark(u.pos,d.pos,l),t&&n.addMark(u.pos,d.pos,l.create(t));return o(n),!0}}function BL(e,t={}){return({tr:r,dispatch:n,state:o})=>{const i=o.schema,s=r.selection,{from:a=s.from,to:l=a??s.to,marks:c={}}=t;if(!n)return!0;r.insertText(e,a,l);const u=it(r.steps,r.steps.length-1).getMap().map(l);for(const[d,f]of At(c))r.addMark(a,u,it(i.marks,d).create(f));return n(r),!0}}var xe=class extends Ve{constructor(){super(...arguments),this.decorated=new Map,this.forceUpdateTransaction=(e,...t)=>{const{forcedUpdates:r}=this.getCommandMeta(e);return this.setCommandMeta(e,{forcedUpdates:Ml([...r,...t])}),e}}get name(){return"commands"}get transaction(){const e=this.store.getState();this._transaction||(this._transaction=e.tr);const t=this._transaction.before.eq(e.doc),r=!Mo(this._transaction.steps);if(!t){const n=e.tr;if(r)for(const o of this._transaction.steps)n.step(o);this._transaction=n}return this._transaction}onCreate(){this.store.setStoreKey("getForcedUpdates",this.getForcedUpdates.bind(this))}onView(e){var t;const{extensions:r,helpers:n}=this.store,o=ee(),i=new Set;let s=ee();const a=c=>{var u;const d=ee(),f=()=>c??this.transaction;let p=[];const h=()=>p;for(const[b,v]of Object.entries(o))(u=s[b])!=null&&u.disableChaining||(d[b]=this.chainedFactory({chain:d,command:v.original,getTr:f,getChain:h}));const m=b=>{te(b===f(),{message:"Chaining currently only supports `CommandFunction` methods which do not use the `state.tr` property. Instead you should use the provided `tr` property."})};return d.run=(b={})=>{const v=p;p=[];for(const g of v)if(!g(m)&&b.exitEarly)return;e.dispatch(f())},d.tr=()=>{const b=p;p=[];for(const v of b)v(m);return f()},d.enabled=()=>{for(const b of p)if(!b())return!1;return!0},d.new=b=>a(b),d};for(const c of r){const u=((t=c.createCommands)==null?void 0:t.call(c))??{},d=c.decoratedCommands??{},f={};s={...s,decoratedCommands:d};for(const[p,h]of Object.entries(d)){const m=ne(h.shortcut)&&h.shortcut.startsWith("_|")?{shortcut:n.getNamedShortcut(h.shortcut,c.options)}:void 0;this.updateDecorated(p,{...h,name:c.name,...m}),u[p]=c[p].bind(c),h.active&&(f[p]=()=>{var b;return((b=h.active)==null?void 0:b.call(h,c.options,this.store))??!1})}gp(u)||this.addCommands({active:f,names:i,commands:o,extensionCommands:u})}const l=a();for(const[c,u]of Object.entries(l))a[c]=u;this.store.setStoreKey("commands",o),this.store.setStoreKey("chain",a),this.store.setExtensionStore("commands",o),this.store.setExtensionStore("chain",a)}onStateUpdate({state:e}){this._transaction=e.tr}createPlugin(){return{}}customDispatch(e){return e}insertText(e,t={}){return ne(e)?BL(e,t):this.store.createPlaceholderCommand({promise:e,placeholder:{type:"inline"},onSuccess:(r,n,o)=>this.insertText(r,{...t,...n})(o)}).generateCommand()}selectText(e,t={}){return({tr:r,dispatch:n})=>{const o=jr(e,r.doc);return r.selection.anchor===o.anchor&&r.selection.head===o.head&&!t.forceUpdate?!1:(n==null||n(r.setSelection(o)),!0)}}selectMark(e){return t=>{const{tr:r}=t,n=_o(r.selection.$from,e);return n?this.store.commands.selectText.original({from:n.from,to:n.to})(t):!1}}delete(e){return({tr:t,dispatch:r})=>{const{from:n,to:o}=e??t.selection;return r==null||r(t.delete(n,o)),!0}}emptyUpdate(e){return({tr:t,dispatch:r})=>(r&&(e==null||e(),r(t)),!0)}forceUpdate(...e){return({tr:t,dispatch:r})=>(r==null||r(this.forceUpdateTransaction(t,...e)),!0)}updateNodeAttributes(e,t){return({tr:r,dispatch:n})=>(n==null||n(r.setNodeMarkup(e,void 0,t)),!0)}setContent(e,t){return r=>{const{tr:n,dispatch:o}=r,i=this.store.manager.createState({content:e,selection:t});return i?(o==null||o(n.replaceRangeWith(0,n.doc.nodeSize-2,i.doc)),!0):!1}}resetContent(){return e=>{const{tr:t,dispatch:r}=e,n=this.store.manager.createEmptyDoc();return n?this.setContent(n)(e):(r==null||r(t.delete(0,t.doc.nodeSize)),!0)}}emptySelection(){return({tr:e,dispatch:t})=>e.selection.empty?!1:(t==null||t(e.setSelection(le.near(e.selection.$anchor))),!0)}insertNewLine(){return({dispatch:e,tr:t})=>gs(t.selection)?(e==null||e(t.insertText(` -`)),!0):!1}insertNode(e,t={}){return({dispatch:r,tr:n,state:o})=>{var i;const{attrs:s,range:a,selection:l,replaceEmptyParentBlock:c=!1}=t,{from:u,to:d,$from:f}=jr(l??a??n.selection,n.doc);if(Id(e)||fz(e)){const v=f.before(f.depth);return r==null||r(c&&u===d&&Bh(f.parent)?n.replaceWith(v,v+f.parent.nodeSize,e):n.replaceWith(u,d,e)),!0}const p=ne(e)?o.schema.nodes[e]:e;te(p,{code:H.SCHEMA,message:`The requested node type ${e} does not exist in the schema.`});const h=(i=t.marks)==null?void 0:i.map(v=>{if(v instanceof Te)return v;const g=ne(v)?o.schema.marks[v]:v;return te(g,{code:H.SCHEMA,message:`The requested mark type ${v} does not exist in the schema.`}),g.create()}),m=p.createAndFill(s,ne(t.content)?o.schema.text(t.content):t.content,h);if(!m)return!1;const b=u!==d;return r==null||r(b?n.replaceRangeWith(u,d,m):n.insert(u,m)),!0}}focus(e){return t=>{const{dispatch:r,tr:n}=t,{view:o}=this.store;if(e===!1||o.hasFocus()&&(e===void 0||e===!0))return!1;if(e===void 0||e===!0){const{from:i=0,to:s=i}=n.selection;e={from:i,to:s}}return r&&this.delayedFocus(),this.selectText(e)(t)}}blur(e){return t=>{const{view:r}=this.store;return r.hasFocus()?(requestAnimationFrame(()=>{r.dom.blur()}),e?this.selectText(e)(t):!0):!1}}setBlockNodeType(e,t,r,n=!0){return Fu(e,t,r,n)}toggleWrappingNode(e,t,r){return DC(e,t,r)}toggleBlockNodeItem(e){return Gv(e)}wrapInNode(e,t,r){return IC(e,t,r)}applyMark(e,t,r){return HL(e,t,r)}toggleMark(e){return ns(e)}removeMark(e){return HC(e)}setMeta(e,t){return({tr:r})=>(r.setMeta(e,t),!0)}selectAll(){return this.selectText("all")}copy(){return e=>e.tr.selection.empty?!1:(e.dispatch&&document.execCommand("copy"),!0)}paste(){return this.store.createPlaceholderCommand({promise:async()=>{var e;return(e=navigator.clipboard)!=null&&e.readText?await navigator.clipboard.readText():""},placeholder:{type:"inline"},onSuccess:(e,t,r)=>this.insertNode(j1({content:e,schema:r.state.schema}),{selection:t})(r)}).generateCommand()}cut(){return e=>e.tr.selection.empty?!1:(e.dispatch&&document.execCommand("cut"),!0)}replaceText(e){return Dz(e)}getAllCommandOptions(){const e={};for(const[t,r]of this.decorated)gp(r)||(e[t]=r);return e}getCommandOptions(e){return this.decorated.get(e)}getCommandProp(){return{tr:this.transaction,dispatch:this.store.view.dispatch,state:this.store.view.state,view:this.store.view}}updateDecorated(e,t){if(!t){this.decorated.delete(e);return}const r=this.decorated.get(e)??{name:""};this.decorated.set(e,{...r,...t})}handleIosFocus(){on.isIos&&this.store.view.dom.focus()}delayedFocus(){this.handleIosFocus(),requestAnimationFrame(()=>{this.store.view.focus(),this.store.view.dispatch(this.transaction.scrollIntoView())})}getForcedUpdates(e){return this.getCommandMeta(e).forcedUpdates}getCommandMeta(e){const t=e.getMeta(this.pluginKey)??{};return{...FL,...t}}setCommandMeta(e,t){const r=this.getCommandMeta(e);e.setMeta(this.pluginKey,{...r,...t})}addCommands(e){const{extensionCommands:t,commands:r,names:n,active:o}=e;for(const[i,s]of At(t))XC({name:i,set:n,code:H.DUPLICATE_COMMAND_NAMES}),te(!VL.has(i),{code:H.DUPLICATE_COMMAND_NAMES,message:"The command name you chose is forbidden."}),r[i]=this.createUnchainedCommand(s,o[i])}unchainedFactory(e){return(...t)=>{const{shouldDispatch:r=!0,command:n}=e,{view:o}=this.store,{state:i}=o;let s;return r&&(s=o.dispatch),n(...t)({state:i,dispatch:s,view:o,tr:i.tr})}}createUnchainedCommand(e,t){const r=this.unchainedFactory({command:e});return r.enabled=this.unchainedFactory({command:e,shouldDispatch:!1}),r.isEnabled=r.enabled,r.original=e,r.active=t,r}chainedFactory(e){return(...t)=>{const{chain:r,command:n,getTr:o,getChain:i}=e,s=i(),{view:a}=this.store,{state:l}=a;return s.push(c=>n(...t)({state:l,dispatch:c,view:a,tr:o()})),r}}};Z([U()],xe.prototype,"customDispatch",1);Z([U()],xe.prototype,"insertText",1);Z([U()],xe.prototype,"selectText",1);Z([U()],xe.prototype,"selectMark",1);Z([U()],xe.prototype,"delete",1);Z([U()],xe.prototype,"emptyUpdate",1);Z([U()],xe.prototype,"forceUpdate",1);Z([U()],xe.prototype,"updateNodeAttributes",1);Z([U()],xe.prototype,"setContent",1);Z([U()],xe.prototype,"resetContent",1);Z([U()],xe.prototype,"emptySelection",1);Z([U()],xe.prototype,"insertNewLine",1);Z([U()],xe.prototype,"insertNode",1);Z([U()],xe.prototype,"focus",1);Z([U()],xe.prototype,"blur",1);Z([U()],xe.prototype,"setBlockNodeType",1);Z([U()],xe.prototype,"toggleWrappingNode",1);Z([U()],xe.prototype,"toggleBlockNodeItem",1);Z([U()],xe.prototype,"wrapInNode",1);Z([U()],xe.prototype,"applyMark",1);Z([U()],xe.prototype,"toggleMark",1);Z([U()],xe.prototype,"removeMark",1);Z([U()],xe.prototype,"setMeta",1);Z([U({description:({t:e})=>e(es.SELECT_ALL_DESCRIPTION),label:({t:e})=>e(es.SELECT_ALL_LABEL),shortcut:D.SelectAll})],xe.prototype,"selectAll",1);Z([U({description:({t:e})=>e(es.COPY_DESCRIPTION),label:({t:e})=>e(es.COPY_LABEL),shortcut:D.Copy,icon:"fileCopyLine"})],xe.prototype,"copy",1);Z([U({description:({t:e})=>e(es.PASTE_DESCRIPTION),label:({t:e})=>e(es.PASTE_LABEL),shortcut:D.Paste,icon:"clipboardLine"})],xe.prototype,"paste",1);Z([U({description:({t:e})=>e(es.CUT_DESCRIPTION),label:({t:e})=>e(es.CUT_LABEL),shortcut:D.Cut,icon:"scissorsFill"})],xe.prototype,"cut",1);Z([U()],xe.prototype,"replaceText",1);Z([He()],xe.prototype,"getAllCommandOptions",1);Z([He()],xe.prototype,"getCommandOptions",1);Z([He()],xe.prototype,"getCommandProp",1);xe=Z([pe({defaultPriority:Ae.Highest,defaultOptions:{trackerClassName:"remirror-tracker-position",trackerNodeName:"span"},staticKeys:["trackerClassName","trackerNodeName"]})],xe);var FL={forcedUpdates:[]},VL=new Set(["run","chain","original","raw","enabled","tr","new"]),io=class extends Ve{constructor(){super(...arguments),this.placeholders=Ee.empty,this.placeholderWidgets=new Map,this.createPlaceholderCommand=e=>{const t=Cl(),{promise:r,placeholder:n,onFailure:o,onSuccess:i}=e;return new DL(r).validate(s=>this.addPlaceholder(t,n)(s)).success(s=>{const{state:a,tr:l,dispatch:c,view:u,value:d}=s,f=this.store.helpers.findPlaceholder(t);if(!f){const p=new Error("The placeholder has been removed");return(o==null?void 0:o({error:p,state:a,tr:l,dispatch:c,view:u}))??!1}return this.removePlaceholder(t)({state:a,tr:l,view:u,dispatch:()=>{}}),i(d,f,{state:a,tr:l,dispatch:c,view:u})}).failure(s=>(this.removePlaceholder(t)({...s,dispatch:()=>{}}),(o==null?void 0:o(s))??!1))}}get name(){return"decorations"}onCreate(){this.store.setExtensionStore("createPlaceholderCommand",this.createPlaceholderCommand)}createPlugin(){return{state:{init:()=>{},apply:e=>{var t,r,n,o,i,s;const{added:a,clearTrackers:l,removed:c,updated:u}=this.getMeta(e);if(l){this.placeholders=Ee.empty;for(const[,d]of this.placeholderWidgets)(r=(t=d.spec).onDestroy)==null||r.call(t,this.store.view,d.spec.element);this.placeholderWidgets.clear();return}this.placeholders=this.placeholders.map(e.mapping,e.doc,{onRemove:d=>{var f,p;const h=this.placeholderWidgets.get(d.id);h&&((p=(f=h.spec).onDestroy)==null||p.call(f,this.store.view,h.spec.element))}});for(const[,d]of this.placeholderWidgets)(o=(n=d.spec).onUpdate)==null||o.call(n,this.store.view,d.from,d.spec.element,d.spec.data);for(const d of a){if(d.type==="inline"){this.addInlinePlaceholder(d,e);continue}if(d.type==="node"){this.addNodePlaceholder(d,e);continue}if(d.type==="widget"){this.addWidgetPlaceholder(d,e);continue}}for(const{id:d,data:f}of u){const p=this.placeholderWidgets.get(d);if(!p)continue;const h=Ge.widget(p.from,p.spec.element,{...p.spec,data:f});this.placeholders=this.placeholders.remove([p]).add(e.doc,[h]),this.placeholderWidgets.set(d,h)}for(const d of c){const f=this.placeholders.find(void 0,void 0,h=>h.id===d&&h.__type===Na),p=this.placeholderWidgets.get(d);p&&((s=(i=p.spec).onDestroy)==null||s.call(i,this.store.view,p.spec.element)),this.placeholders=this.placeholders.remove(f),this.placeholderWidgets.delete(d)}}},props:{decorations:e=>{let t=this.options.decorations(e);t=t.add(e.doc,this.placeholders.find());for(const r of this.store.extensions){if(!r.createDecorations)continue;const n=r.createDecorations(e).find();t=t.add(e.doc,n)}return t},handleDOMEvents:{blur:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(h2,!1)),!1),focus:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(h2,!0)),!1)}}}}updateDecorations(){return({tr:e,dispatch:t})=>(t==null||t(e),!0)}addPlaceholder(e,t,r){return({dispatch:n,tr:o})=>this.addPlaceholderTransaction(e,t,o,!n)?(n==null||n(r?o.deleteSelection():o),!0):!1}updatePlaceholder(e,t){return({dispatch:r,tr:n})=>this.updatePlaceholderTransaction({id:e,data:t,tr:n,checkOnly:!r})?(r==null||r(n),!0):!1}removePlaceholder(e){return({dispatch:t,tr:r})=>this.removePlaceholderTransaction({id:e,tr:r,checkOnly:!t})?(t==null||t(r),!0):!1}clearPlaceholders(){return({tr:e,dispatch:t})=>this.clearPlaceholdersTransaction({tr:e,checkOnly:!t})?(t==null||t(e),!0):!1}findPlaceholder(e){return this.findAllPlaceholders().get(e)}findAllPlaceholders(){const e=new Map,t=this.placeholders.find(void 0,void 0,r=>r.__type===Na);for(const r of t)e.set(r.spec.id,{from:r.from,to:r.to});return e}createDecorations(e){var t,r,n;const{persistentSelectionClass:o}=this.options;return!o||(t=this.store.view)!=null&&t.hasFocus()||(n=(r=this.store.helpers).isInteracting)!=null&&n.call(r)?Ee.empty:UL(e,Ee.empty,{class:ne(o)?o:"selection"})}onApplyState(){}addWidgetPlaceholder(e,t){const{pos:r,createElement:n,onDestroy:o,onUpdate:i,className:s,nodeName:a,id:l,type:c}=e,u=(n==null?void 0:n(this.store.view,r))??document.createElement(a);u.classList.add(s);const d=Ge.widget(r,u,{id:l,__type:Na,type:c,element:u,onDestroy:o,onUpdate:i});this.placeholderWidgets.set(l,d),this.placeholders=this.placeholders.add(t.doc,[d])}addInlinePlaceholder(e,t){const{from:r=t.selection.from,to:n=t.selection.to,className:o,nodeName:i,id:s,type:a}=e;let l;if(r===n){const c=document.createElement(i);c.classList.add(o),l=Ge.widget(r,c,{id:s,type:a,__type:Na,widget:c})}else l=Ge.inline(r,n,{nodeName:i,class:o},{id:s,__type:Na});this.placeholders=this.placeholders.add(t.doc,[l])}addNodePlaceholder(e,t){const{pos:r,className:n,nodeName:o,id:i}=e,s=Jt(r)?t.doc.resolve(r):t.selection.$from,a=Jt(r)?s.nodeAfter?{pos:r,end:s.nodeAfter.nodeSize}:void 0:rz(s);if(!a)return;const l=Ge.node(a.pos,a.end,{nodeName:o,class:n},{id:i,__type:Na});this.placeholders=this.placeholders.add(t.doc,[l])}withRequiredBase(e,t){const{placeholderNodeName:r,placeholderClassName:n}=this.options,{nodeName:o=r,className:i,...s}=t,a=(i?[n,i]:[n]).join(" ");return{nodeName:o,className:a,...s,id:e}}getMeta(e){const t=e.getMeta(this.pluginKey)??{};return{...jL,...t}}setMeta(e,t){const r=this.getMeta(e);e.setMeta(this.pluginKey,{...r,...t})}addPlaceholderTransaction(e,t,r,n=!1){if(this.findPlaceholder(e))return!1;if(n)return!0;const{added:i}=this.getMeta(r);return this.setMeta(r,{added:[...i,this.withRequiredBase(e,t)]}),!0}updatePlaceholderTransaction(e){const{id:t,tr:r,checkOnly:n=!1,data:o}=e;if(!this.findPlaceholder(t))return!1;if(n)return!0;const{updated:s}=this.getMeta(r);return this.setMeta(r,{updated:Ml([...s,{id:t,data:o}])}),!0}removePlaceholderTransaction(e){const{id:t,tr:r,checkOnly:n=!1}=e;if(!this.findPlaceholder(t))return!1;if(n)return!0;const{removed:i}=this.getMeta(r);return this.setMeta(r,{removed:Ml([...i,t])}),!0}clearPlaceholdersTransaction(e){const{tr:t,checkOnly:r=!1}=e;return this.getPluginState()===Ee.empty?!1:(r||this.setMeta(t,{clearTrackers:!0}),!0)}};Z([U()],io.prototype,"updateDecorations",1);Z([U()],io.prototype,"addPlaceholder",1);Z([U()],io.prototype,"updatePlaceholder",1);Z([U()],io.prototype,"removePlaceholder",1);Z([U()],io.prototype,"clearPlaceholders",1);Z([He()],io.prototype,"findPlaceholder",1);Z([He()],io.prototype,"findAllPlaceholders",1);io=Z([pe({defaultOptions:{persistentSelectionClass:void 0,placeholderClassName:"placeholder",placeholderNodeName:"span"},staticKeys:["placeholderClassName","placeholderNodeName"],handlerKeys:["decorations"],handlerKeyOptions:{decorations:{reducer:{accumulator:(e,t,r)=>e.add(r.doc,t.find()),getDefault:()=>Ee.empty}}},defaultPriority:Ae.Low})],io);var jL={added:[],updated:[],clearTrackers:!1,removed:[]},Na="placeholderDecoration",h2="persistentSelectionFocus";function UL(e,t,r){const{selection:n,doc:o}=e;if(n.empty)return t;const{from:i,to:s}=n,a=Dd(n)?Ge.node(i,s,r):Ge.inline(i,s,r);return t.add(o,[a])}var W1=class extends Ve{get name(){return"docChanged"}onStateUpdate(e){const{firstUpdate:t,transactions:r,tr:n}=e;t||(r??[n]).some(o=>o==null?void 0:o.docChanged)&&this.options.docChanged(e)}};W1=Z([pe({handlerKeys:["docChanged"],handlerKeyOptions:{docChanged:{earlyReturnValue:!1}},defaultPriority:Ae.Lowest})],W1);var Rn=class extends Ve{get name(){return"helpers"}onCreate(){var e;this.store.setStringHandler("text",this.textToProsemirrorNode.bind(this)),this.store.setStringHandler("html",j1);const t=ee(),r=ee(),n=ee(),o=new Set;for(const i of this.store.extensions){Hd(i)&&(r[i.name]=a=>SC({state:this.store.getState(),type:i.type,attrs:a}),n[i.name]=a=>{var l;return(l=Bu({state:this.store.getState(),type:i.type,attrs:a}))==null?void 0:l.node.attrs}),Wh(i)&&(r[i.name]=a=>Rp({trState:this.store.getState(),type:i.type,attrs:a}),n[i.name]=a=>{const l=_o(this.store.getState().selection.$from,i.type);if(!l||!a)return l==null?void 0:l.mark.attrs;if(Uv(l.mark,a))return l.mark.attrs});const s=((e=i.createHelpers)==null?void 0:e.call(i))??{};for(const a of Object.keys(i.decoratedHelpers??{}))s[a]=i[a].bind(i);if(!gp(s))for(const[a,l]of At(s))XC({name:a,set:o,code:H.DUPLICATE_HELPER_NAMES}),t[a]=l}this.store.setStoreKey("attrs",n),this.store.setStoreKey("active",r),this.store.setStoreKey("helpers",t),this.store.setExtensionStore("attrs",n),this.store.setExtensionStore("active",r),this.store.setExtensionStore("helpers",t)}isSelectionEmpty(e=this.store.getState()){return jv(e)}isViewEditable(e=this.store.getState()){var t,r;return((r=(t=this.store.view.props).editable)==null?void 0:r.call(t,e))??!1}getStateJSON(e=this.store.getState()){return e.toJSON()}getJSON(e=this.store.getState()){return e.doc.toJSON()}getRemirrorJSON(e=this.store.getState()){return this.getJSON(e)}insertHtml(e,t){return r=>{const{state:n}=r,o=j1({content:e,schema:n.schema,fragment:!0});return this.store.commands.insertNode.original(o,t)(r)}}getText({lineBreakDivider:e=` +If you are using Node.js, you can install JSDOM and Remirror will try to use it automatically, or you can create a fake document and pass it to Remirror`)}function RC(e){var t;return(e==null?void 0:e.defaultView)??(typeof window<"u"?window:void 0)??((t=RE())==null?void 0:t.defaultView)}function PC(e){return RC(e==null?void 0:e.ownerDocument)}function zC(e){const t=RC(e)??Vh().defaultView;if(t)return t;throw new Error("Unable to retrieve the window from the global scope")}function LC(e){return zC(e==null?void 0:e.ownerDocument)}function Oz(e,t=Vh()){const r=Cz(e,e.type.schema)?e.content:R.from(e);return an.fromSchema(e.type.schema).serializeFragment(r,{document:t})}function _z(e,t){return new(zC(t)).DOMParser().parseFromString(`${e}`,"text/html").body}function Az(e,t=Vh()){const r=t.createElement("div");return r.append(Oz(e,t)),r.innerHTML}function U1(e){const{content:t,schema:r,document:n,fragment:o=!1,...i}=e,s=_z(t,n),a=Mv.fromSchema(r);return o?a.parseSlice(s,{...u2,...i}).content:a.parse(s,{...u2,...i})}var u2={preserveWhitespace:!1};function $d(e,t){const r=Lu(t.defaults());return Sv({...e},r)}function Gv(e,t){let r="";t&&(r=`${t.trim()}`);const n=kN(e);if(!n)return r;const o=(r.endsWith(";")," ");return`${r}${o}${n}`}var Nz={remove(e,t){let r=e;for(const n of t)n.invalidParentNode||(r=mA(n.path,r));return r}};function Rz({json:e,schema:t,...r}){const n=new Set(Lu(t.marks)),o=new Set(Lu(t.nodes)),i=IC({json:e,path:[],validNodes:o,validMarks:n});return{json:e,invalidContent:i,transformers:Nz,...r}}function IC(e){const{json:t,validMarks:r,validNodes:n,path:o=[]}=e,i={validMarks:r,validNodes:n},s=[],{type:a,marks:l,content:c}=t;let{invalidParentMark:u=!1,invalidParentNode:d=!1}=e;if(l){const f=[];for(const[p,h]of l.entries()){const m=oe(h)?h:h.type;r.has(m)||(f.unshift({name:m,path:[...o,"marks",`${p}`],type:"mark",invalidParentMark:u,invalidParentNode:d}),u=!0)}s.push(...f)}if(n.has(a)||(s.push({name:a,type:"node",path:o,invalidParentMark:u,invalidParentNode:d}),d=!0),c){const f=[];for(const[p,h]of c.entries())f.unshift(...IC({...i,json:h,path:[...o,"content",`${p}`],invalidParentMark:u,invalidParentNode:d}));s.unshift(...f)}return s}function Pz(e){return!!(ms(e)&&e.$cursor&&e.$cursor.parentOffset>=e.$cursor.parent.content.size)}function W1(e){return!!(ms(e)&&e.$cursor&&e.$cursor.parentOffset<=0)}function d2(e){const t=be.atStart(e.$anchor.doc);return!!(W1(e)&&t.anchor===e.anchor)}function zz(e){return({dispatch:t,tr:r})=>{const{type:n,attrs:o=ee(),appendText:i,range:s}=e,a=s?le.between(r.doc.resolve(s.from),r.doc.resolve(s.to)):r.selection,{$from:l,from:c,to:u}=a;let d=l.depth===0?r.doc.type.allowsMarkType(n):!1;return r.doc.nodesBetween(c,u,f=>{if(d)return!1;if(f.inlineContent&&f.type.allowsMarkType(n)){d=!0;return}}),d?(t==null||t(r.addMark(c,u,n.create(o))&&i?r.insertText(i):r),!0):!1}}function Lz({tr:e,dispatch:t}){const{$from:r,$to:n}=e.selection,o=r.blockRange(n),i=o&&rc(o);return!Jt(i)||!o?!1:(t==null||t(e.lift(o,i).scrollIntoView()),!0)}function DC(e,t={},r){return function(n){const{tr:o,dispatch:i,state:s}=n,a=oe(e)?it(s.schema.nodes,e):e,{from:l,to:c}=jr(r??o.selection,o.doc),u=o.doc.resolve(l),d=o.doc.resolve(c),f=u.blockRange(d),p=f&&Ov(f,a,t);return!p||!f?!1:(i==null||i(o.wrap(f,p).scrollIntoView()),!0)}}function $C(e,t={},r){return n=>{const{tr:o,state:i}=n,s=oe(e)?it(i.schema.nodes,e):e;return Bu({state:o,type:s,attrs:t})?Lz(n):DC(e,t,r)(n)}}function Fu(e,t,r,n=!0){return function(o){const{tr:i,dispatch:s,state:a}=o,l=oe(e)?it(a.schema.nodes,e):e,{from:c,to:u}=jr(r??i.selection,i.doc);let d=!1,f;return i.doc.nodesBetween(c,u,(p,h)=>{if(d)return!1;if(!p.isTextblock||p.hasMarkup(l,t))return;if(p.type===l){d=!0,f=p.attrs;return}const m=i.doc.resolve(h),b=m.index();d=m.parent.canReplaceWith(b,b+1,l),d&&(f=m.parent.attrs)}),d?(s==null||s(i.setBlockType(c,u,l,{...n?f:{},...t}).scrollIntoView()),!0):!1}}function Yv(e){return t=>{const{tr:r,state:n}=t,{type:o,attrs:i,preserveAttrs:s=!0}=e,a=Bu({state:r,type:o,attrs:i}),l=e.toggleType??Bh(n.schema);if(a)return Fu(l,{...s?a.node.attrs:{},...i})(t);const c=Bu({state:r,type:l,attrs:i});return Fu(o,{...s?c==null?void 0:c.node.attrs:{},...i})(t)}}function Iz(e=0){const t=navigator.userAgent.match(/Chrom(e|ium)\/(\d+)\./);return t?Number.parseInt(it(t,2),10)>=e:!1}function Dz(e,t){let{head:r,empty:n,anchor:o}=e;for(const i of t.steps)r=i.getMap().map(r);n?t.setSelection(le.near(t.doc.resolve(r))):t.setSelection(le.between(t.doc.resolve(o),t.doc.resolve(r)))}function $z(e){const{attrs:t={},appendText:r="",content:n="",keepSelection:o=!1,range:i}=e;return({state:s,tr:a,dispatch:l})=>{var c;const u=s.schema,d=jr(e.selection??i??a.selection,a.doc),f=d.$from.index(),{from:p,to:h,$from:m}=d,b=oe(e.type)?u.nodes[e.type]??u.marks[e.type]:e.type;if(re(oe(e.type)?b:!0,{code:B.SCHEMA,message:`Schema contains no marks or nodes with name ${b}`}),uz(b)){if(!m.parent.canReplaceWith(f,f,b))return!1;a.replaceWith(p,h,b.create(t,n?u.text(n):void 0))}else re(n,{message:"`replaceText` cannot be called without content when using a mark type"}),a.replaceWith(p,h,u.text(n,CC(b)?[b.create(t)]:void 0));return r&&a.insertText(r),o&&Dz(s.selection,a),l&&(Iz(60)&&((c=document.getSelection())==null||c.empty()),l(a)),!0}}function HC(e,t){const r=e.parent.childAfter(e.parentOffset);if(!r.node)return;const{marks:n,nodeSize:o}=r.node;if(n[0])return n[0].type;const s=e.start()+r.offset+o;return HC(e.doc.resolve(s+1))}function BC(e){return({dispatch:t,tr:r,state:n})=>{const{type:o,expand:i=!0,range:s}=e,a=jr(e.selection??s??r.selection,r.doc);let{from:l,to:c,$from:u,$to:d}=a;const f=oe(o)?n.schema.marks[o]:o;f!==null&&re(f,{code:B.SCHEMA,message:`Mark type: ${o} does not exist on the current schema.`});const p=f??HC(u);if(!p)return!1;const h=_o(u,p,d);return i&&h&&(l=Math.max(0,Math.min(l,h.from)),c=Math.min(Math.max(c,h.to),r.doc.nodeSize-2)),t==null||t(r.removeMark(l,Jt(c)?c:l,CC(f)?f:void 0)),!0}}function Hz(e){const t=["command","cmd","meta"];return on.isMac&&t.push("mod"),t.includes(e)}function Bz(e){const t=["control","ctrl"];return on.isMac||t.push("mod"),t.includes(e)}function Fz(e){const t=[];for(let r of e.split("-")){if(r=r.toLowerCase(),Hz(r)){t.push({type:"modifier",symbol:"⌘",key:"command",i18n:Mt.COMMAND_KEY});continue}if(Bz(r)){t.push({type:"modifier",symbol:"⌃",key:"control",i18n:Mt.CONTROL_KEY});continue}switch(r){case"shift":t.push({type:"modifier",symbol:"⇧",key:r,i18n:Mt.SHIFT_KEY});continue;case"alt":t.push({type:"modifier",symbol:"⌥",key:r,i18n:Mt.ALT_KEY});continue;case` +`:case"\r":case"enter":t.push({type:"named",symbol:"↵",key:r,i18n:Mt.ENTER_KEY});continue;case"backspace":t.push({type:"named",symbol:"⌫",key:r,i18n:Mt.BACKSPACE_KEY});continue;case"delete":t.push({type:"named",symbol:"⌦",key:r,i18n:Mt.DELETE_KEY});continue;case"escape":t.push({type:"named",symbol:"␛",key:r,i18n:Mt.ESCAPE_KEY});continue;case"tab":t.push({type:"named",symbol:"⇥",key:r,i18n:Mt.TAB_KEY});continue;case"capslock":t.push({type:"named",symbol:"⇪",key:r,i18n:Mt.CAPS_LOCK_KEY});continue;case"space":t.push({type:"named",symbol:"␣",key:r,i18n:Mt.SPACE_KEY});continue;case"pageup":t.push({type:"named",symbol:"⤒",key:r,i18n:Mt.PAGE_UP_KEY});continue;case"pagedown":t.push({type:"named",symbol:"⤓",key:r,i18n:Mt.PAGE_DOWN_KEY});continue;case"home":t.push({type:"named",key:r,i18n:Mt.HOME_KEY});continue;case"end":t.push({type:"named",key:r,i18n:Mt.END_KEY});continue;case"arrowleft":t.push({type:"named",symbol:"←",key:r,i18n:Mt.ARROW_LEFT_KEY});continue;case"arrowright":t.push({type:"named",symbol:"→",key:r,i18n:Mt.ARROW_RIGHT_KEY});continue;case"arrowup":t.push({type:"named",symbol:"→",key:r,i18n:Mt.ARROW_UP_KEY});continue;case"arrowdown":t.push({type:"named",symbol:"↓",key:r,i18n:Mt.ARROW_DOWN_KEY});continue;default:t.push({type:"char",key:r});continue}}return t}function Vz(e){const{node:t,predicate:r,descend:n=!0,action:o}=e;re(Id(t),{code:B.INTERNAL,message:'Invalid "node" parameter passed to "findChildren".'}),re(_e(r),{code:B.INTERNAL,message:'Invalid "predicate" parameter passed to "findChildren".'});const i=[];return t.descendants((s,a)=>{const l={node:s,pos:a};return r(l)&&(i.push(l),o==null||o(l)),n}),i}function jz(e){const{type:t,...r}=e;return Vz({...r,predicate:n=>n.node.type===t})}function Uz(e,t={}){const{descend:r=!1,predicate:n,StepTypes:o}=t,i=kz(e,o),s=[];for(const a of i){const{start:l,end:c}=a;e.doc.nodesBetween(l,c,(u,d)=>(((n==null?void 0:n(u,d,a))??!0)&&s.push({node:u,pos:d}),r))}return s}function Vu(e){const{regexp:t,type:r,getAttributes:n,ignoreWhitespace:o=!1,beforeDispatch:i,updateCaptured:s,shouldSkip:a,invalidMarks:l}=e;let c;const u=new wa(t,(d,f,p,h)=>{const{tr:m,schema:b}=d;c||(c=oe(r)?b.marks[r]:r,re(c,{code:B.SCHEMA,message:`Mark type: ${r} does not exist on the current schema.`}));let v=f[1],g=f[0];const y=VC({captureGroup:v,fullMatch:g,end:h,start:p,rule:u,state:d,ignoreWhitespace:o,invalidMarks:l,shouldSkip:a,updateCaptured:s});if(!y)return null;({start:p,end:h,captureGroup:v,fullMatch:g}=y);const x=_e(n)?n(f):n;let k=h,w=[];if(v){const E=g.search(/\S/),M=p+g.indexOf(v),C=M+v.length;w=m.storedMarks??[],Cp&&m.delete(p+E,M),k=p+E+v.length}return m.addMark(p,k,c.create(x)),m.setStoredMarks(w),i==null||i({tr:m,match:f,start:p,end:h}),m});return u}function FC(e){const{regexp:t,type:r,getAttributes:n,beforeDispatch:o,shouldSkip:i,ignoreWhitespace:s=!1,updateCaptured:a,invalidMarks:l}=e,c=new wa(t,(u,d,f,p)=>{const h=_e(n)?n(d):n,{tr:m,schema:b}=u,v=oe(r)?b.nodes[r]:r;let g=d[1],y=d[0];const x=VC({captureGroup:g,fullMatch:y,end:p,start:f,rule:c,state:u,ignoreWhitespace:s,invalidMarks:l,shouldSkip:i,updateCaptured:a});if(!x)return null;({start:f,end:p,captureGroup:g,fullMatch:y}=x),re(v,{code:B.SCHEMA,message:`No node exists for ${r} in the schema.`});const k=v.createAndFill(h);return k&&(m.replaceRangeWith(v.isBlock?m.doc.resolve(f).before():f,p,k),o==null||o({tr:m,match:[y,g??""],start:f,end:p})),m});return c}function VC({captureGroup:e,fullMatch:t,end:r,start:n,rule:o,ignoreWhitespace:i,shouldSkip:s,updateCaptured:a,state:l,invalidMarks:c}){var u;if(t==null)return null;const d=(a==null?void 0:a({captureGroup:e,fullMatch:t,start:n,end:r}))??{};e=d.captureGroup??e,t=d.fullMatch??t,n=d.start??n,r=d.end??r;const f=l.doc.resolve(n),p=l.doc.resolve(r);return c&&V1({$from:f,$to:p},c)||o.invalidMarks&&V1({$from:f,$to:p},o.invalidMarks)||i&&(e==null?void 0:e.trim())===""||s!=null&&s({state:l,captureGroup:e,fullMatch:t,start:n,end:r,ruleType:"mark"})||(u=o.shouldSkip)!=null&&u.call(o,{state:l,captureGroup:e,fullMatch:t,start:n,end:r,ruleType:"mark"})?null:{captureGroup:e,end:r,fullMatch:t,start:n}}var Wz=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),r={},n=[];t.forEach(i=>{(i?i.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,l]=a.split("_");r[l]=a}else n.push(a)})});const o=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&o.push(r[i]);return o.push(...n),o.join(" ")},Kz=Wz;const jC=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function qz(e,t){let{$cursor:r}=e.selection;return!r||(t?!t.endOfTextblock("backward",e):r.parentOffset>0)?null:r}const UC=(e,t,r)=>{let n=qz(e,r);if(!n)return!1;let o=WC(n);if(!o){let s=n.blockRange(),a=s&&rc(s);return a==null?!1:(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&GC(e,o,t))return!0;if(n.parent.content.size==0&&(zl(i,"end")||ce.isSelectable(i))){let s=_v(e.doc,n.before(),n.after(),K.empty);if(s&&s.slice.size{let{$head:n,empty:o}=e.selection,i=n;if(!o)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("backward",e):n.parentOffset>0)return!1;i=WC(n)}let s=i&&i.nodeBefore;return!s||!ce.isSelectable(s)?!1:(t&&t(e.tr.setSelection(ce.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function WC(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Yz(e,t){let{$cursor:r}=e.selection;return!r||(t?!t.endOfTextblock("forward",e):r.parentOffset{let n=Yz(e,r);if(!n)return!1;let o=KC(n);if(!o)return!1;let i=o.nodeAfter;if(GC(e,o,t))return!0;if(n.parent.content.size==0&&(zl(i,"start")||ce.isSelectable(i))){let s=_v(e.doc,n.before(),n.after(),K.empty);if(s&&s.slice.size{let{$head:n,empty:o}=e.selection,i=n;if(!o)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("forward",e):n.parentOffset=0;t--){let r=e.node(t);if(e.index(t)+1{let{$head:r,$anchor:n}=e.selection;return!r.parent.type.spec.code||!r.sameParent(n)?!1:(t&&t(e.tr.insertText(` +`).scrollIntoView()),!0)};function Jv(e){for(let t=0;t{let{$head:r,$anchor:n}=e.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;let o=r.node(-1),i=r.indexAfter(-1),s=Jv(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let a=r.after(),l=e.tr.replaceWith(a,a,s.createAndFill());l.setSelection(be.near(l.doc.resolve(a),1)),t(l.scrollIntoView())}return!0},Zz=(e,t)=>{let r=e.selection,{$from:n,$to:o}=r;if(r instanceof kr||n.parent.inlineContent||o.parent.inlineContent)return!1;let i=Jv(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let s=(!n.parentOffset&&o.index(){let{$cursor:r}=e.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let i=r.before();if(dl(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let n=r.blockRange(),o=n&&rc(n);return o==null?!1:(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)};function tL(e){return(t,r)=>{let{$from:n,$to:o}=t.selection;if(t.selection instanceof ce&&t.selection.node.isBlock)return!n.parentOffset||!dl(t.doc,n.pos)?!1:(r&&r(t.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(r){let i=o.parentOffset==o.parent.content.size,s=t.tr;(t.selection instanceof le||t.selection instanceof kr)&&s.deleteSelection();let a=n.depth==0?null:Jv(n.node(-1).contentMatchAt(n.indexAfter(-1))),l=e&&e(o.parent,i),c=l?[l]:i&&a?[{type:a}]:void 0,u=dl(s.doc,s.mapping.map(n.pos),1,c);if(!c&&!u&&dl(s.doc,s.mapping.map(n.pos),1,a?[{type:a}]:void 0)&&(a&&(c=[{type:a}]),u=!0),u&&(s.split(s.mapping.map(n.pos),1,c),!i&&!n.parentOffset&&n.parent.type!=a)){let d=s.mapping.map(n.before()),f=s.doc.resolve(d);a&&n.node(-1).canReplaceWith(f.index(),f.index()+1,a)&&s.setNodeMarkup(s.mapping.map(n.before()),a)}r(s.scrollIntoView())}return!0}}const rL=tL(),nL=(e,t)=>{let{$from:r,to:n}=e.selection,o,i=r.sharedDepth(n);return i==0?!1:(o=r.before(i),t&&t(e.tr.setSelection(ce.create(e.doc,o))),!0)},oL=(e,t)=>(t&&t(e.tr.setSelection(new kr(e.doc))),!0);function iL(e,t,r){let n=t.nodeBefore,o=t.nodeAfter,i=t.index();return!n||!o||!n.type.compatibleContent(o.type)?!1:!n.content.size&&t.parent.canReplace(i-1,i)?(r&&r(e.tr.delete(t.pos-n.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(i,i+1)||!(o.isTextblock||Rd(e.doc,t.pos))?!1:(r&&r(e.tr.clearIncompatible(t.pos,n.type,n.contentMatchAt(n.childCount)).join(t.pos).scrollIntoView()),!0)}function GC(e,t,r){let n=t.nodeBefore,o=t.nodeAfter,i,s;if(n.type.spec.isolating||o.type.spec.isolating)return!1;if(iL(e,t,r))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(i=(s=n.contentMatchAt(n.childCount)).findWrapping(o.type))&&s.matchType(i[0]||o.type).validEnd){if(r){let d=t.pos+o.nodeSize,f=R.empty;for(let m=i.length-1;m>=0;m--)f=R.from(i[m].create(null,f));f=R.from(n.copy(f));let p=e.tr.step(new bt(t.pos-1,d,t.pos,d,new K(f,1,0),i.length,!0)),h=d+2*i.length;Rd(p.doc,h)&&p.join(h),r(p.scrollIntoView())}return!0}let l=be.findFrom(t,1),c=l&&l.$from.blockRange(l.$to),u=c&&rc(c);if(u!=null&&u>=t.depth)return r&&r(e.tr.lift(c,u).scrollIntoView()),!0;if(a&&zl(o,"start",!0)&&zl(n,"end")){let d=n,f=[];for(;f.push(d),!d.isTextblock;)d=d.lastChild;let p=o,h=1;for(;!p.isTextblock;p=p.firstChild)h++;if(d.canReplace(d.childCount,d.childCount,p.content)){if(r){let m=R.empty;for(let v=f.length-1;v>=0;v--)m=R.from(f[v].copy(m));let b=e.tr.step(new bt(t.pos-f.length,t.pos+o.nodeSize,t.pos+h,t.pos+o.nodeSize-h,new K(m,f.length,0),0,!0));r(b.scrollIntoView())}return!0}}return!1}function YC(e){return function(t,r){let n=t.selection,o=e<0?n.$from:n.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(r&&r(t.tr.setSelection(le.create(t.doc,e<0?o.start(i):o.end(i)))),!0):!1}}const sL=YC(-1),aL=YC(1);function lL(e,t,r){for(let n=0;n{if(s)return!1;s=a.inlineContent&&a.type.allowsMarkType(r)}),s)return!0}return!1}function cL(e,t=null){return function(r,n){let{empty:o,$cursor:i,ranges:s}=r.selection;if(o&&!i||!lL(r.doc,s,e))return!1;if(n)if(i)e.isInSet(r.storedMarks||i.marks())?n(r.tr.removeStoredMark(e)):n(r.tr.addStoredMark(e.create(t)));else{let a=!1,l=r.tr;for(let c=0;!a&&c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},dL=typeof navigator<"u"&&/Mac/.test(navigator.platform),fL=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Yt=0;Yt<10;Yt++)ns[48+Yt]=ns[96+Yt]=String(Yt);for(var Yt=1;Yt<=24;Yt++)ns[Yt+111]="F"+Yt;for(var Yt=65;Yt<=90;Yt++)ns[Yt]=String.fromCharCode(Yt+32),zp[Yt]=String.fromCharCode(Yt);for(var Sg in ns)zp.hasOwnProperty(Sg)||(zp[Sg]=ns[Sg]);function pL(e){var t=dL&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||fL&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",r=!t&&e.key||(e.shiftKey?zp:ns)[e.keyCode]||e.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}const hL=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function mL(e){let t=e.split(/-(?!$)/),r=t[t.length-1];r=="Space"&&(r=" ");let n,o,i,s;for(let a=0;a127)&&(i=ns[n.keyCode])&&i!=o){let a=t[Eg(i,n)];if(a&&a(r.state,r.dispatch,r))return!0}}return!1}}function vL(e){const t=ta(e,(i,s)=>(s.priority??Ae.Low)-(i.priority??Ae.Low)),r=[],n=[];for(const i of t)EL(i)?r.push(i):n.push(i);let o;return new Ro({key:yL,view:i=>(o=i,{}),props:{transformPasted:i=>{var s,a,l;const c=o.state.selection.$from,u=c.node().type.name,d=new Set(c.marks().map(f=>f.type.name));for(const f of r){if((s=f.ignoredNodes)!=null&&s.includes(u)||(a=f.ignoredMarks)!=null&&a.some(g=>d.has(g)))continue;const p=((l=i.content.firstChild)==null?void 0:l.textContent)??"",h=!o.state.selection.empty&&i.content.childCount===1&&p,m=xa(p,f.regexp)[0];if(h&&m&&f.type==="mark"&&f.replaceSelection){const{from:g,to:y}=o.state.selection,x=o.state.doc.slice(g,y),k=x.content.textBetween(0,x.content.size);if(typeof f.replaceSelection!="boolean"?f.replaceSelection(k):f.replaceSelection){const w=[],{getAttributes:E,markType:M}=f,C=_e(E)?E(m,!0):E,T=M.create(C);return x.content.forEach(N=>{if(N.isText){const z=T.addToSet(N.marks);w.push(N.mark(z))}}),K.maxOpen(R.fromArray(w))}}const{nodes:b,transformed:v}=wL(i.content,f,o.state.schema);v&&(i=f.type==="node"&&f.nodeType.isBlock?new K(R.fromArray(b),0,0):new K(R.fromArray(b),i.openStart,i.openEnd))}return OL(i)},handleDOMEvents:{paste:(i,s)=>{var a,l;const c=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{clipboardData:u}=c;if(!u)return!1;const d=[...u.items].map(p=>p.getAsFile()).filter(p=>!!p);if(d.length===0)return!1;const{selection:f}=i.state;for(const{fileHandler:p,regexp:h}of n){const m=h?d.filter(b=>h.test(b.type)):d;if(m.length!==0&&p({event:c,files:m,selection:f,view:i,type:"paste"}))return c.preventDefault(),!0}return!1},drop:(i,s)=>{var a,l,c;const u=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{dataTransfer:d,clientX:f,clientY:p}=u;if(!d)return!1;const h=TL(u);if(h.length===0)return!1;const m=((c=i.posAtCoords({left:f,top:p}))==null?void 0:c.pos)??i.state.selection.anchor;for(const{fileHandler:b,regexp:v}of n){const g=v?h.filter(y=>v.test(y.type)):h;if(g.length!==0&&b({event:u,files:g,pos:m,view:i,type:"drop"}))return u.preventDefault(),!0}return!1}}}})}var yL=new ka("pasteRule");function Cg(e,t){return function r(n){const{fragment:o,rule:i,nodes:s}=n,{regexp:a,ignoreWhitespace:l,ignoredMarks:c,ignoredNodes:u}=i;let d=!1;return o.forEach(f=>{if(u!=null&&u.includes(f.type.name)||CL(f)){s.push(f);return}if(!f.isText){const m=r({fragment:f.content,rule:i,nodes:[]});d||(d=m.transformed);const b=R.fromArray(m.nodes);f.type.validContent(b)?s.push(f.copy(b)):s.push(...m.nodes);return}if(f.marks.some(m=>ML(m)||(c==null?void 0:c.includes(m.type.name)))){s.push(f);return}const p=f.text??"";let h=0;for(const m of xa(p,a)){const b=m[1],v=m[0];if(l&&(b==null?void 0:b.trim())===""||!v)return;const g=m.index,y=g+v.length;g>h&&s.push(f.cut(h,g));let x=f.cut(g,y);if(v&&b){const k=v.search(/\S/),w=g+v.indexOf(b),E=w+b.length;k&&s.push(f.cut(g,g+k)),x=f.cut(w,E)}e({nodes:s,rule:i,textNode:x,match:m,schema:t}),d=!0,h=y}p&&h0?[...n.files]:(r=n.items)!=null&&r.length?[...n.items].map(o=>o.getAsFile()).filter(o=>!!o):[]:[]}function OL(e){const t=K.maxOpen(e.content);return t.openStart({events:{},emit(e,...t){(this.events[e]||[]).forEach(r=>r(...t))},on(e,t){return(this.events[e]=this.events[e]||[]).push(t),()=>this.events[e]=(this.events[e]||[]).filter(r=>r!==t)}});var _L=Object.defineProperty,AL=Object.getOwnPropertyDescriptor,Z=(e,t,r,n)=>{for(var o=n>1?void 0:n?AL(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&_L(t,r,o),o},XC=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},G=(e,t,r)=>(XC(e,t,"read from private field"),r?r.call(e):t.get(e)),kt=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Lt=(e,t,r,n)=>(XC(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);function NL(e,t){return e===t}function p2(e){const{previousOptions:t,update:r,equals:n=NL}=e,o=$s({...t,...r}),i=ee(),s=Lu(t);for(const l of s){const c=t[l],u=o[l];if(n(c,u)){i[l]={changed:!1};continue}i[l]={changed:!0,previousValue:c,value:u}}const a=l=>{const c=ee();for(const u of l){const d=i[u];d!=null&&d.changed&&(c[u]=d.value)}return c};return{changes:$s(i),options:o,pickChanged:a}}var RL={[B.DUPLICATE_HELPER_NAMES]:"helper method",[B.DUPLICATE_COMMAND_NAMES]:"command method"};function QC(e){const{name:t,set:r,code:n}=e,o=RL[n];re(!r.has(t),{code:n,message:`There is a naming conflict for the name: ${t} used in this '${o}'. Please rename or remove from the editor to avoid runtime errors.`}),r.add(t)}function ju(...e){return Ml(Kz(...e).split(" ")).join(" ")}var h2="__IGNORE__",PL="__ALL__",sc=class{constructor(e,...[t]){this["~O"]={},this._mappedHandlers=ee(),this.populateMappedHandlers(),this._options=this._initialOptions=Q4(e,this.constructor.defaultOptions,t??ee(),this.createDefaultHandlerOptions()),this._dynamicKeys=this.getDynamicKeys(),this.init()}get options(){return this._options}get dynamicKeys(){return this._dynamicKeys}get initialOptions(){return this._initialOptions}init(){}getDynamicKeys(){const e=[],{customHandlerKeys:t,handlerKeys:r,staticKeys:n}=this.constructor;for(const o of Lu(this._options))n.includes(o)||r.includes(o)||t.includes(o)||e.push(o);return e}ensureAllKeysAreDynamic(e){}setOptions(e){var t;const r=this.getDynamicOptions();this.ensureAllKeysAreDynamic(e);const{changes:n,options:o,pickChanged:i}=p2({previousOptions:r,update:e});this.updateDynamicOptions(o),(t=this.onSetOptions)==null||t.call(this,{reason:"set",changes:n,options:o,pickChanged:i,initialOptions:this._initialOptions})}resetOptions(){var e;const t=this.getDynamicOptions(),{changes:r,options:n,pickChanged:o}=p2({previousOptions:t,update:this._initialOptions});this.updateDynamicOptions(n),(e=this.onSetOptions)==null||e.call(this,{reason:"reset",options:n,changes:r,pickChanged:o,initialOptions:this._initialOptions})}getDynamicOptions(){return Sv(this._options,[...this.constructor.customHandlerKeys,...this.constructor.handlerKeys])}updateDynamicOptions(e){this._options={...this._options,...e}}populateMappedHandlers(){for(const e of this.constructor.handlerKeys)this._mappedHandlers[e]=[]}createDefaultHandlerOptions(){const e=ee();for(const t of this.constructor.handlerKeys)e[t]=(...r)=>{var n;const{handlerKeyOptions:o}=this.constructor,i=(n=o[t])==null?void 0:n.reducer;let s=i==null?void 0:i.getDefault(...r);for(const[,a]of this._mappedHandlers[t]){const l=a(...r);if(s=i?i.accumulator(s,l,...r):l,zL(o,s,t))return s}return s};return e}addHandler(e,t,r=Ae.Default){return this._mappedHandlers[e].push([r,t]),this.sortHandlers(e),()=>this._mappedHandlers[e]=this._mappedHandlers[e].filter(([,n])=>n!==t)}hasHandlers(e){return(this._mappedHandlers[e]??[]).length>0}sortHandlers(e){this._mappedHandlers[e]=ta(this._mappedHandlers[e],([t],[r])=>r-t)}addCustomHandler(e,t){var r;return((r=this.onAddCustomHandler)==null?void 0:r.call(this,{[e]:t}))??X4}};sc.defaultOptions={};sc.staticKeys=[];sc.handlerKeys=[];sc.handlerKeyOptions={};sc.customHandlerKeys=[];function zL(e,t,r){const{[PL]:n}=e,o=e[r];return!n&&!o?!1:!!(o&&o.earlyReturnValue!==h2&&(_e(o.earlyReturnValue)?o.earlyReturnValue(t)===!0:t===o.earlyReturnValue)||n&&n.earlyReturnValue!==h2&&(_e(n.earlyReturnValue)?n.earlyReturnValue(t)===!0:t===n.earlyReturnValue))}var Wh=class extends sc{constructor(...e){super(LL,...e),this["~E"]={},this._extensions=eE(this.createExtensions(),t=>t.constructor),this.extensionMap=new Map;for(const t of this._extensions)this.extensionMap.set(t.constructor,t)}get priority(){return this.priorityOverride??this.options.priority??this.constructor.defaultPriority}get constructorName(){return`${j4(this.name)}Extension`}get store(){return re(this._store,{code:B.MANAGER_PHASE_ERROR,message:"An error occurred while attempting to access the 'extension.store' when the Manager has not yet set created the lifecycle methods."}),$s(this._store,{requireKeys:!0})}get extensions(){return this._extensions}replaceChildExtension(e,t){this.extensionMap.has(e)&&(this.extensionMap.set(e,t),this._extensions=this.extensions.map(r=>t.constructor===e?t:r))}createExtensions(){return[]}getExtension(e){const t=this.extensionMap.get(e);return re(t,{code:B.INVALID_GET_EXTENSION,message:`'${e.name}' does not exist within the preset: '${this.name}'`}),t}isOfType(e){return this.constructor===e}setStore(e){this._store||(this._store=e)}clone(...e){return new this.constructor(...e)}setPriority(e){this.priorityOverride=e}};Wh.defaultPriority=Ae.Default;var Ve=class extends Wh{static get[ti](){return $t.PlainExtensionConstructor}get[ti](){return $t.PlainExtension}},ci=class extends Wh{static get[ti](){return $t.MarkExtensionConstructor}get[ti](){return $t.MarkExtension}get type(){return it(this.store.schema.marks,this.name)}constructor(...e){super(...e)}};ci.disableExtraAttributes=!1;var er=class extends Wh{static get[ti](){return $t.NodeExtensionConstructor}get[ti](){return $t.NodeExtension}get type(){return it(this.store.schema.nodes,this.name)}constructor(...e){super(...e)}};er.disableExtraAttributes=!1;var LL={priority:void 0,extraAttributes:{},disableExtraAttributes:!1,exclude:{}};function ZC(e){return oc(e)&&ic(e,[$t.PlainExtension,$t.MarkExtension,$t.NodeExtension])}function IL(e){return oc(e)&&ic(e,[$t.PlainExtensionConstructor,$t.MarkExtensionConstructor,$t.NodeExtensionConstructor])}function e5(e){return oc(e)&&ic(e,$t.PlainExtension)}function Hd(e){return oc(e)&&ic(e,$t.NodeExtension)}function Kh(e){return oc(e)&&ic(e,$t.MarkExtension)}function pe(e){return t=>{const{defaultOptions:r,customHandlerKeys:n,handlerKeys:o,staticKeys:i,defaultPriority:s,handlerKeyOptions:a,...l}=e,c=t;r&&(c.defaultOptions=r),s&&(c.defaultPriority=s),a&&(c.handlerKeyOptions=a),c.staticKeys=i??[],c.handlerKeys=o??[],c.customHandlerKeys=n??[];for(const[u,d]of Object.entries(l))c[u]||(c[u]=d);return c}}var DL=class extends Ve{constructor(){super(...arguments),this.attributeList=[],this.attributeObject=ee(),this.updateAttributes=(e=!0)=>{this.transformAttributes(),e&&this.store.commands.forceUpdate("attributes")}}get name(){return"attributes"}onCreate(){this.transformAttributes(),this.store.setExtensionStore("updateAttributes",this.updateAttributes)}transformAttributes(){var e,t,r;if(this.attributeObject=ee(),(e=this.store.managerSettings.exclude)!=null&&e.attributes){this.store.setStoreKey("attributes",this.attributeObject);return}this.attributeList=[];for(const n of this.store.extensions){if((t=n.options.exclude)!=null&&t.attributes)continue;const o=(r=n.createAttributes)==null?void 0:r.call(n),i={...o,class:ju(...n.classNames??[],o==null?void 0:o.class)};this.attributeList.unshift(i)}for(const n of this.attributeList)this.attributeObject={...this.attributeObject,...n,class:ju(this.attributeObject.class,n.class)};this.store.setStoreKey("attributes",this.attributeObject)}};function He(e={}){return(t,r,n)=>{(t.decoratedHelpers??(t.decoratedHelpers={}))[r]=e}}function U(e={}){return(t,r,n)=>{(t.decoratedCommands??(t.decoratedCommands={}))[r]=e}}function je(e){return(t,r,n)=>{(t.decoratedKeybindings??(t.decoratedKeybindings={}))[r]=e}}var $L=class{constructor(e){this.promiseCreator=e,this.failureHandlers=[],this.successHandlers=[],this.validateHandlers=[],this.generateCommand=()=>t=>{let r=!0;const{view:n,tr:o,dispatch:i}=t;if(!n)return!1;for(const a of this.validateHandlers)if(!a({...t,dispatch:()=>{}})){r=!1;break}return!i||!r?r:(this.promiseCreator(t).then(a=>{this.runHandlers(this.successHandlers,{value:a,state:n.state,tr:n.state.tr,dispatch:n.dispatch,view:n})}).catch(a=>{this.runHandlers(this.failureHandlers,{error:a,state:n.state,tr:n.state.tr,dispatch:n.dispatch,view:n})}),i(o),!0)}}validate(e,t="push"){return this.validateHandlers[t](e),this}success(e,t="push"){return this.successHandlers[t](e),this}failure(e,t="push"){return this.failureHandlers[t](e),this}runHandlers(e,t){var r;for(const n of e)if(!n({...t,dispatch:()=>{}}))break;(r=t.dispatch)==null||r.call(t,t.tr)}};function is(e){const{type:t,attrs:r,range:n,selection:o}=e;return i=>{const{dispatch:s,tr:a,state:l}=i,c=oe(t)?l.schema.marks[t]:t;if(re(c,{code:B.SCHEMA,message:`Mark type: ${t} does not exist on the current schema.`}),n||o){const{from:u,to:d}=jr(o??n??a.selection,a.doc);return Pp({trState:a,type:t,...n})?s==null||s(a.removeMark(u,d,c)):s==null||s(a.addMark(u,d,c.create(r))),!0}return bu(cL(c,r))(i)}}function HL(e,t,r){for(const{$from:n,$to:o}of r){let i=n.depth===0?t.type.allowsMarkType(e):!1;if(t.nodesBetween(n.pos,o.pos,s=>{if(i)return!1;i=s.inlineContent&&s.type.allowsMarkType(e)}),i)return!0}return!1}function BL(e,t,r){return({tr:n,dispatch:o,state:i})=>{const s=jr(r??n.selection,n.doc),a=Ez(s),l=oe(e)?i.schema.marks[e]:e;if(re(l,{code:B.SCHEMA,message:`Mark type: ${e} does not exist on the current schema.`}),s.empty&&!a||!HL(l,n.doc,s.ranges))return!1;if(!o)return!0;if(a)return n.removeStoredMark(l),t&&n.addStoredMark(l.create(t)),o(n),!0;let c=!1;for(const{$from:u,$to:d}of s.ranges){if(c)break;c=n.doc.rangeHasMark(u.pos,d.pos,l)}for(const{$from:u,$to:d}of s.ranges)c&&n.removeMark(u.pos,d.pos,l),t&&n.addMark(u.pos,d.pos,l.create(t));return o(n),!0}}function FL(e,t={}){return({tr:r,dispatch:n,state:o})=>{const i=o.schema,s=r.selection,{from:a=s.from,to:l=a??s.to,marks:c={}}=t;if(!n)return!0;r.insertText(e,a,l);const u=it(r.steps,r.steps.length-1).getMap().map(l);for(const[d,f]of At(c))r.addMark(a,u,it(i.marks,d).create(f));return n(r),!0}}var xe=class extends Ve{constructor(){super(...arguments),this.decorated=new Map,this.forceUpdateTransaction=(e,...t)=>{const{forcedUpdates:r}=this.getCommandMeta(e);return this.setCommandMeta(e,{forcedUpdates:Ml([...r,...t])}),e}}get name(){return"commands"}get transaction(){const e=this.store.getState();this._transaction||(this._transaction=e.tr);const t=this._transaction.before.eq(e.doc),r=!Mo(this._transaction.steps);if(!t){const n=e.tr;if(r)for(const o of this._transaction.steps)n.step(o);this._transaction=n}return this._transaction}onCreate(){this.store.setStoreKey("getForcedUpdates",this.getForcedUpdates.bind(this))}onView(e){var t;const{extensions:r,helpers:n}=this.store,o=ee(),i=new Set;let s=ee();const a=c=>{var u;const d=ee(),f=()=>c??this.transaction;let p=[];const h=()=>p;for(const[b,v]of Object.entries(o))(u=s[b])!=null&&u.disableChaining||(d[b]=this.chainedFactory({chain:d,command:v.original,getTr:f,getChain:h}));const m=b=>{re(b===f(),{message:"Chaining currently only supports `CommandFunction` methods which do not use the `state.tr` property. Instead you should use the provided `tr` property."})};return d.run=(b={})=>{const v=p;p=[];for(const g of v)if(!g(m)&&b.exitEarly)return;e.dispatch(f())},d.tr=()=>{const b=p;p=[];for(const v of b)v(m);return f()},d.enabled=()=>{for(const b of p)if(!b())return!1;return!0},d.new=b=>a(b),d};for(const c of r){const u=((t=c.createCommands)==null?void 0:t.call(c))??{},d=c.decoratedCommands??{},f={};s={...s,decoratedCommands:d};for(const[p,h]of Object.entries(d)){const m=oe(h.shortcut)&&h.shortcut.startsWith("_|")?{shortcut:n.getNamedShortcut(h.shortcut,c.options)}:void 0;this.updateDecorated(p,{...h,name:c.name,...m}),u[p]=c[p].bind(c),h.active&&(f[p]=()=>{var b;return((b=h.active)==null?void 0:b.call(h,c.options,this.store))??!1})}vp(u)||this.addCommands({active:f,names:i,commands:o,extensionCommands:u})}const l=a();for(const[c,u]of Object.entries(l))a[c]=u;this.store.setStoreKey("commands",o),this.store.setStoreKey("chain",a),this.store.setExtensionStore("commands",o),this.store.setExtensionStore("chain",a)}onStateUpdate({state:e}){this._transaction=e.tr}createPlugin(){return{}}customDispatch(e){return e}insertText(e,t={}){return oe(e)?FL(e,t):this.store.createPlaceholderCommand({promise:e,placeholder:{type:"inline"},onSuccess:(r,n,o)=>this.insertText(r,{...t,...n})(o)}).generateCommand()}selectText(e,t={}){return({tr:r,dispatch:n})=>{const o=jr(e,r.doc);return r.selection.anchor===o.anchor&&r.selection.head===o.head&&!t.forceUpdate?!1:(n==null||n(r.setSelection(o)),!0)}}selectMark(e){return t=>{const{tr:r}=t,n=_o(r.selection.$from,e);return n?this.store.commands.selectText.original({from:n.from,to:n.to})(t):!1}}delete(e){return({tr:t,dispatch:r})=>{const{from:n,to:o}=e??t.selection;return r==null||r(t.delete(n,o)),!0}}emptyUpdate(e){return({tr:t,dispatch:r})=>(r&&(e==null||e(),r(t)),!0)}forceUpdate(...e){return({tr:t,dispatch:r})=>(r==null||r(this.forceUpdateTransaction(t,...e)),!0)}updateNodeAttributes(e,t){return({tr:r,dispatch:n})=>(n==null||n(r.setNodeMarkup(e,void 0,t)),!0)}setContent(e,t){return r=>{const{tr:n,dispatch:o}=r,i=this.store.manager.createState({content:e,selection:t});return i?(o==null||o(n.replaceRangeWith(0,n.doc.nodeSize-2,i.doc)),!0):!1}}resetContent(){return e=>{const{tr:t,dispatch:r}=e,n=this.store.manager.createEmptyDoc();return n?this.setContent(n)(e):(r==null||r(t.delete(0,t.doc.nodeSize)),!0)}}emptySelection(){return({tr:e,dispatch:t})=>e.selection.empty?!1:(t==null||t(e.setSelection(le.near(e.selection.$anchor))),!0)}insertNewLine(){return({dispatch:e,tr:t})=>ms(t.selection)?(e==null||e(t.insertText(` +`)),!0):!1}insertNode(e,t={}){return({dispatch:r,tr:n,state:o})=>{var i;const{attrs:s,range:a,selection:l,replaceEmptyParentBlock:c=!1}=t,{from:u,to:d,$from:f}=jr(l??a??n.selection,n.doc);if(Id(e)||pz(e)){const v=f.before(f.depth);return r==null||r(c&&u===d&&Fh(f.parent)?n.replaceWith(v,v+f.parent.nodeSize,e):n.replaceWith(u,d,e)),!0}const p=oe(e)?o.schema.nodes[e]:e;re(p,{code:B.SCHEMA,message:`The requested node type ${e} does not exist in the schema.`});const h=(i=t.marks)==null?void 0:i.map(v=>{if(v instanceof Te)return v;const g=oe(v)?o.schema.marks[v]:v;return re(g,{code:B.SCHEMA,message:`The requested mark type ${v} does not exist in the schema.`}),g.create()}),m=p.createAndFill(s,oe(t.content)?o.schema.text(t.content):t.content,h);if(!m)return!1;const b=u!==d;return r==null||r(b?n.replaceRangeWith(u,d,m):n.insert(u,m)),!0}}focus(e){return t=>{const{dispatch:r,tr:n}=t,{view:o}=this.store;if(e===!1||o.hasFocus()&&(e===void 0||e===!0))return!1;if(e===void 0||e===!0){const{from:i=0,to:s=i}=n.selection;e={from:i,to:s}}return r&&this.delayedFocus(),this.selectText(e)(t)}}blur(e){return t=>{const{view:r}=this.store;return r.hasFocus()?(requestAnimationFrame(()=>{r.dom.blur()}),e?this.selectText(e)(t):!0):!1}}setBlockNodeType(e,t,r,n=!0){return Fu(e,t,r,n)}toggleWrappingNode(e,t,r){return $C(e,t,r)}toggleBlockNodeItem(e){return Yv(e)}wrapInNode(e,t,r){return DC(e,t,r)}applyMark(e,t,r){return BL(e,t,r)}toggleMark(e){return is(e)}removeMark(e){return BC(e)}setMeta(e,t){return({tr:r})=>(r.setMeta(e,t),!0)}selectAll(){return this.selectText("all")}copy(){return e=>e.tr.selection.empty?!1:(e.dispatch&&document.execCommand("copy"),!0)}paste(){return this.store.createPlaceholderCommand({promise:async()=>{var e;return(e=navigator.clipboard)!=null&&e.readText?await navigator.clipboard.readText():""},placeholder:{type:"inline"},onSuccess:(e,t,r)=>this.insertNode(U1({content:e,schema:r.state.schema}),{selection:t})(r)}).generateCommand()}cut(){return e=>e.tr.selection.empty?!1:(e.dispatch&&document.execCommand("cut"),!0)}replaceText(e){return $z(e)}getAllCommandOptions(){const e={};for(const[t,r]of this.decorated)vp(r)||(e[t]=r);return e}getCommandOptions(e){return this.decorated.get(e)}getCommandProp(){return{tr:this.transaction,dispatch:this.store.view.dispatch,state:this.store.view.state,view:this.store.view}}updateDecorated(e,t){if(!t){this.decorated.delete(e);return}const r=this.decorated.get(e)??{name:""};this.decorated.set(e,{...r,...t})}handleIosFocus(){on.isIos&&this.store.view.dom.focus()}delayedFocus(){this.handleIosFocus(),requestAnimationFrame(()=>{this.store.view.focus(),this.store.view.dispatch(this.transaction.scrollIntoView())})}getForcedUpdates(e){return this.getCommandMeta(e).forcedUpdates}getCommandMeta(e){const t=e.getMeta(this.pluginKey)??{};return{...VL,...t}}setCommandMeta(e,t){const r=this.getCommandMeta(e);e.setMeta(this.pluginKey,{...r,...t})}addCommands(e){const{extensionCommands:t,commands:r,names:n,active:o}=e;for(const[i,s]of At(t))QC({name:i,set:n,code:B.DUPLICATE_COMMAND_NAMES}),re(!jL.has(i),{code:B.DUPLICATE_COMMAND_NAMES,message:"The command name you chose is forbidden."}),r[i]=this.createUnchainedCommand(s,o[i])}unchainedFactory(e){return(...t)=>{const{shouldDispatch:r=!0,command:n}=e,{view:o}=this.store,{state:i}=o;let s;return r&&(s=o.dispatch),n(...t)({state:i,dispatch:s,view:o,tr:i.tr})}}createUnchainedCommand(e,t){const r=this.unchainedFactory({command:e});return r.enabled=this.unchainedFactory({command:e,shouldDispatch:!1}),r.isEnabled=r.enabled,r.original=e,r.active=t,r}chainedFactory(e){return(...t)=>{const{chain:r,command:n,getTr:o,getChain:i}=e,s=i(),{view:a}=this.store,{state:l}=a;return s.push(c=>n(...t)({state:l,dispatch:c,view:a,tr:o()})),r}}};Z([U()],xe.prototype,"customDispatch",1);Z([U()],xe.prototype,"insertText",1);Z([U()],xe.prototype,"selectText",1);Z([U()],xe.prototype,"selectMark",1);Z([U()],xe.prototype,"delete",1);Z([U()],xe.prototype,"emptyUpdate",1);Z([U()],xe.prototype,"forceUpdate",1);Z([U()],xe.prototype,"updateNodeAttributes",1);Z([U()],xe.prototype,"setContent",1);Z([U()],xe.prototype,"resetContent",1);Z([U()],xe.prototype,"emptySelection",1);Z([U()],xe.prototype,"insertNewLine",1);Z([U()],xe.prototype,"insertNode",1);Z([U()],xe.prototype,"focus",1);Z([U()],xe.prototype,"blur",1);Z([U()],xe.prototype,"setBlockNodeType",1);Z([U()],xe.prototype,"toggleWrappingNode",1);Z([U()],xe.prototype,"toggleBlockNodeItem",1);Z([U()],xe.prototype,"wrapInNode",1);Z([U()],xe.prototype,"applyMark",1);Z([U()],xe.prototype,"toggleMark",1);Z([U()],xe.prototype,"removeMark",1);Z([U()],xe.prototype,"setMeta",1);Z([U({description:({t:e})=>e(ts.SELECT_ALL_DESCRIPTION),label:({t:e})=>e(ts.SELECT_ALL_LABEL),shortcut:$.SelectAll})],xe.prototype,"selectAll",1);Z([U({description:({t:e})=>e(ts.COPY_DESCRIPTION),label:({t:e})=>e(ts.COPY_LABEL),shortcut:$.Copy,icon:"fileCopyLine"})],xe.prototype,"copy",1);Z([U({description:({t:e})=>e(ts.PASTE_DESCRIPTION),label:({t:e})=>e(ts.PASTE_LABEL),shortcut:$.Paste,icon:"clipboardLine"})],xe.prototype,"paste",1);Z([U({description:({t:e})=>e(ts.CUT_DESCRIPTION),label:({t:e})=>e(ts.CUT_LABEL),shortcut:$.Cut,icon:"scissorsFill"})],xe.prototype,"cut",1);Z([U()],xe.prototype,"replaceText",1);Z([He()],xe.prototype,"getAllCommandOptions",1);Z([He()],xe.prototype,"getCommandOptions",1);Z([He()],xe.prototype,"getCommandProp",1);xe=Z([pe({defaultPriority:Ae.Highest,defaultOptions:{trackerClassName:"remirror-tracker-position",trackerNodeName:"span"},staticKeys:["trackerClassName","trackerNodeName"]})],xe);var VL={forcedUpdates:[]},jL=new Set(["run","chain","original","raw","enabled","tr","new"]),io=class extends Ve{constructor(){super(...arguments),this.placeholders=Ee.empty,this.placeholderWidgets=new Map,this.createPlaceholderCommand=e=>{const t=Cl(),{promise:r,placeholder:n,onFailure:o,onSuccess:i}=e;return new $L(r).validate(s=>this.addPlaceholder(t,n)(s)).success(s=>{const{state:a,tr:l,dispatch:c,view:u,value:d}=s,f=this.store.helpers.findPlaceholder(t);if(!f){const p=new Error("The placeholder has been removed");return(o==null?void 0:o({error:p,state:a,tr:l,dispatch:c,view:u}))??!1}return this.removePlaceholder(t)({state:a,tr:l,view:u,dispatch:()=>{}}),i(d,f,{state:a,tr:l,dispatch:c,view:u})}).failure(s=>(this.removePlaceholder(t)({...s,dispatch:()=>{}}),(o==null?void 0:o(s))??!1))}}get name(){return"decorations"}onCreate(){this.store.setExtensionStore("createPlaceholderCommand",this.createPlaceholderCommand)}createPlugin(){return{state:{init:()=>{},apply:e=>{var t,r,n,o,i,s;const{added:a,clearTrackers:l,removed:c,updated:u}=this.getMeta(e);if(l){this.placeholders=Ee.empty;for(const[,d]of this.placeholderWidgets)(r=(t=d.spec).onDestroy)==null||r.call(t,this.store.view,d.spec.element);this.placeholderWidgets.clear();return}this.placeholders=this.placeholders.map(e.mapping,e.doc,{onRemove:d=>{var f,p;const h=this.placeholderWidgets.get(d.id);h&&((p=(f=h.spec).onDestroy)==null||p.call(f,this.store.view,h.spec.element))}});for(const[,d]of this.placeholderWidgets)(o=(n=d.spec).onUpdate)==null||o.call(n,this.store.view,d.from,d.spec.element,d.spec.data);for(const d of a){if(d.type==="inline"){this.addInlinePlaceholder(d,e);continue}if(d.type==="node"){this.addNodePlaceholder(d,e);continue}if(d.type==="widget"){this.addWidgetPlaceholder(d,e);continue}}for(const{id:d,data:f}of u){const p=this.placeholderWidgets.get(d);if(!p)continue;const h=Ge.widget(p.from,p.spec.element,{...p.spec,data:f});this.placeholders=this.placeholders.remove([p]).add(e.doc,[h]),this.placeholderWidgets.set(d,h)}for(const d of c){const f=this.placeholders.find(void 0,void 0,h=>h.id===d&&h.__type===Na),p=this.placeholderWidgets.get(d);p&&((s=(i=p.spec).onDestroy)==null||s.call(i,this.store.view,p.spec.element)),this.placeholders=this.placeholders.remove(f),this.placeholderWidgets.delete(d)}}},props:{decorations:e=>{let t=this.options.decorations(e);t=t.add(e.doc,this.placeholders.find());for(const r of this.store.extensions){if(!r.createDecorations)continue;const n=r.createDecorations(e).find();t=t.add(e.doc,n)}return t},handleDOMEvents:{blur:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(m2,!1)),!1),focus:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(m2,!0)),!1)}}}}updateDecorations(){return({tr:e,dispatch:t})=>(t==null||t(e),!0)}addPlaceholder(e,t,r){return({dispatch:n,tr:o})=>this.addPlaceholderTransaction(e,t,o,!n)?(n==null||n(r?o.deleteSelection():o),!0):!1}updatePlaceholder(e,t){return({dispatch:r,tr:n})=>this.updatePlaceholderTransaction({id:e,data:t,tr:n,checkOnly:!r})?(r==null||r(n),!0):!1}removePlaceholder(e){return({dispatch:t,tr:r})=>this.removePlaceholderTransaction({id:e,tr:r,checkOnly:!t})?(t==null||t(r),!0):!1}clearPlaceholders(){return({tr:e,dispatch:t})=>this.clearPlaceholdersTransaction({tr:e,checkOnly:!t})?(t==null||t(e),!0):!1}findPlaceholder(e){return this.findAllPlaceholders().get(e)}findAllPlaceholders(){const e=new Map,t=this.placeholders.find(void 0,void 0,r=>r.__type===Na);for(const r of t)e.set(r.spec.id,{from:r.from,to:r.to});return e}createDecorations(e){var t,r,n;const{persistentSelectionClass:o}=this.options;return!o||(t=this.store.view)!=null&&t.hasFocus()||(n=(r=this.store.helpers).isInteracting)!=null&&n.call(r)?Ee.empty:WL(e,Ee.empty,{class:oe(o)?o:"selection"})}onApplyState(){}addWidgetPlaceholder(e,t){const{pos:r,createElement:n,onDestroy:o,onUpdate:i,className:s,nodeName:a,id:l,type:c}=e,u=(n==null?void 0:n(this.store.view,r))??document.createElement(a);u.classList.add(s);const d=Ge.widget(r,u,{id:l,__type:Na,type:c,element:u,onDestroy:o,onUpdate:i});this.placeholderWidgets.set(l,d),this.placeholders=this.placeholders.add(t.doc,[d])}addInlinePlaceholder(e,t){const{from:r=t.selection.from,to:n=t.selection.to,className:o,nodeName:i,id:s,type:a}=e;let l;if(r===n){const c=document.createElement(i);c.classList.add(o),l=Ge.widget(r,c,{id:s,type:a,__type:Na,widget:c})}else l=Ge.inline(r,n,{nodeName:i,class:o},{id:s,__type:Na});this.placeholders=this.placeholders.add(t.doc,[l])}addNodePlaceholder(e,t){const{pos:r,className:n,nodeName:o,id:i}=e,s=Jt(r)?t.doc.resolve(r):t.selection.$from,a=Jt(r)?s.nodeAfter?{pos:r,end:s.nodeAfter.nodeSize}:void 0:nz(s);if(!a)return;const l=Ge.node(a.pos,a.end,{nodeName:o,class:n},{id:i,__type:Na});this.placeholders=this.placeholders.add(t.doc,[l])}withRequiredBase(e,t){const{placeholderNodeName:r,placeholderClassName:n}=this.options,{nodeName:o=r,className:i,...s}=t,a=(i?[n,i]:[n]).join(" ");return{nodeName:o,className:a,...s,id:e}}getMeta(e){const t=e.getMeta(this.pluginKey)??{};return{...UL,...t}}setMeta(e,t){const r=this.getMeta(e);e.setMeta(this.pluginKey,{...r,...t})}addPlaceholderTransaction(e,t,r,n=!1){if(this.findPlaceholder(e))return!1;if(n)return!0;const{added:i}=this.getMeta(r);return this.setMeta(r,{added:[...i,this.withRequiredBase(e,t)]}),!0}updatePlaceholderTransaction(e){const{id:t,tr:r,checkOnly:n=!1,data:o}=e;if(!this.findPlaceholder(t))return!1;if(n)return!0;const{updated:s}=this.getMeta(r);return this.setMeta(r,{updated:Ml([...s,{id:t,data:o}])}),!0}removePlaceholderTransaction(e){const{id:t,tr:r,checkOnly:n=!1}=e;if(!this.findPlaceholder(t))return!1;if(n)return!0;const{removed:i}=this.getMeta(r);return this.setMeta(r,{removed:Ml([...i,t])}),!0}clearPlaceholdersTransaction(e){const{tr:t,checkOnly:r=!1}=e;return this.getPluginState()===Ee.empty?!1:(r||this.setMeta(t,{clearTrackers:!0}),!0)}};Z([U()],io.prototype,"updateDecorations",1);Z([U()],io.prototype,"addPlaceholder",1);Z([U()],io.prototype,"updatePlaceholder",1);Z([U()],io.prototype,"removePlaceholder",1);Z([U()],io.prototype,"clearPlaceholders",1);Z([He()],io.prototype,"findPlaceholder",1);Z([He()],io.prototype,"findAllPlaceholders",1);io=Z([pe({defaultOptions:{persistentSelectionClass:void 0,placeholderClassName:"placeholder",placeholderNodeName:"span"},staticKeys:["placeholderClassName","placeholderNodeName"],handlerKeys:["decorations"],handlerKeyOptions:{decorations:{reducer:{accumulator:(e,t,r)=>e.add(r.doc,t.find()),getDefault:()=>Ee.empty}}},defaultPriority:Ae.Low})],io);var UL={added:[],updated:[],clearTrackers:!1,removed:[]},Na="placeholderDecoration",m2="persistentSelectionFocus";function WL(e,t,r){const{selection:n,doc:o}=e;if(n.empty)return t;const{from:i,to:s}=n,a=Dd(n)?Ge.node(i,s,r):Ge.inline(i,s,r);return t.add(o,[a])}var K1=class extends Ve{get name(){return"docChanged"}onStateUpdate(e){const{firstUpdate:t,transactions:r,tr:n}=e;t||(r??[n]).some(o=>o==null?void 0:o.docChanged)&&this.options.docChanged(e)}};K1=Z([pe({handlerKeys:["docChanged"],handlerKeyOptions:{docChanged:{earlyReturnValue:!1}},defaultPriority:Ae.Lowest})],K1);var Rn=class extends Ve{get name(){return"helpers"}onCreate(){var e;this.store.setStringHandler("text",this.textToProsemirrorNode.bind(this)),this.store.setStringHandler("html",U1);const t=ee(),r=ee(),n=ee(),o=new Set;for(const i of this.store.extensions){Hd(i)&&(r[i.name]=a=>EC({state:this.store.getState(),type:i.type,attrs:a}),n[i.name]=a=>{var l;return(l=Bu({state:this.store.getState(),type:i.type,attrs:a}))==null?void 0:l.node.attrs}),Kh(i)&&(r[i.name]=a=>Pp({trState:this.store.getState(),type:i.type,attrs:a}),n[i.name]=a=>{const l=_o(this.store.getState().selection.$from,i.type);if(!l||!a)return l==null?void 0:l.mark.attrs;if(Wv(l.mark,a))return l.mark.attrs});const s=((e=i.createHelpers)==null?void 0:e.call(i))??{};for(const a of Object.keys(i.decoratedHelpers??{}))s[a]=i[a].bind(i);if(!vp(s))for(const[a,l]of At(s))QC({name:a,set:o,code:B.DUPLICATE_HELPER_NAMES}),t[a]=l}this.store.setStoreKey("attrs",n),this.store.setStoreKey("active",r),this.store.setStoreKey("helpers",t),this.store.setExtensionStore("attrs",n),this.store.setExtensionStore("active",r),this.store.setExtensionStore("helpers",t)}isSelectionEmpty(e=this.store.getState()){return Uv(e)}isViewEditable(e=this.store.getState()){var t,r;return((r=(t=this.store.view.props).editable)==null?void 0:r.call(t,e))??!1}getStateJSON(e=this.store.getState()){return e.toJSON()}getJSON(e=this.store.getState()){return e.doc.toJSON()}getRemirrorJSON(e=this.store.getState()){return this.getJSON(e)}insertHtml(e,t){return r=>{const{state:n}=r,o=U1({content:e,schema:n.schema,fragment:!0});return this.store.commands.insertNode.original(o,t)(r)}}getText({lineBreakDivider:e=` -`,state:t=this.store.getState()}={}){return t.doc.textBetween(0,t.doc.content.size,e,zi)}getTextBetween(e,t,r=this.store.getState().doc){return r.textBetween(e,t,` +`,state:t=this.store.getState()}={}){return t.doc.textBetween(0,t.doc.content.size,e,Li)}getTextBetween(e,t,r=this.store.getState().doc){return r.textBetween(e,t,` -`,zi)}getHTML(e=this.store.getState()){return _z(e.doc,this.store.document)}textToProsemirrorNode(e){const t=`
    ${e.content}
    `;return this.store.stringHandlers.html({...e,content:t})}};Z([He()],Rn.prototype,"isSelectionEmpty",1);Z([He()],Rn.prototype,"isViewEditable",1);Z([He()],Rn.prototype,"getStateJSON",1);Z([He()],Rn.prototype,"getJSON",1);Z([He()],Rn.prototype,"getRemirrorJSON",1);Z([U()],Rn.prototype,"insertHtml",1);Z([He()],Rn.prototype,"getText",1);Z([He()],Rn.prototype,"getTextBetween",1);Z([He()],Rn.prototype,"getHTML",1);Rn=Z([pe({})],Rn);var K1=class extends Ve{get name(){return"inputRules"}onCreate(){this.store.setExtensionStore("rebuildInputRules",this.rebuildInputRules.bind(this))}createExternalPlugins(){return[this.generateInputRulesPlugin()]}generateInputRulesPlugin(){var e,t;const r=[],n=this.store.markTags[oe.ExcludeInputRules];for(const o of this.store.extensions)if(!((e=this.store.managerSettings.exclude)!=null&&e.inputRules||!o.createInputRules||(t=o.options.exclude)!=null&&t.inputRules))for(const i of o.createInputRules())i.shouldSkip=this.options.shouldSkipInputRule,i.invalidMarks=n,r.push(i);return VR({rules:r})}rebuildInputRules(){this.store.updateExtensionPlugins(this)}};K1=Z([pe({defaultPriority:Ae.Default,handlerKeys:["shouldSkipInputRule"],handlerKeyOptions:{shouldSkipInputRule:{earlyReturnValue:!0}}})],K1);var Qn=class extends Ve{constructor(){super(...arguments),this.extraKeyBindings=[],this.backwardMarkExitTracker=new Map,this.keydownHandler=null,this.onAddCustomHandler=({keymap:e})=>{var t,r;if(e)return this.extraKeyBindings=[...this.extraKeyBindings,e],(r=(t=this.store).rebuildKeymap)==null||r.call(t),()=>{var n,o;this.extraKeyBindings=this.extraKeyBindings.filter(i=>i!==e),(o=(n=this.store).rebuildKeymap)==null||o.call(n)}},this.rebuildKeymap=()=>{this.setupKeydownHandler()}}get name(){return"keymap"}get shortcutMap(){const{shortcuts:e}=this.options;return ne(e)?GL[e]:e}onCreate(){this.store.setExtensionStore("rebuildKeymap",this.rebuildKeymap)}createExternalPlugins(){var e;return(e=this.store.managerSettings.exclude)!=null&&e.keymap?[]:(this.setupKeydownHandler(),[new Ro({props:{handleKeyDown:(t,r)=>{var n;return(n=this.keydownHandler)==null?void 0:n.call(this,t,r)}}})])}setupKeydownHandler(){const e=this.generateKeymapBindings();this.keydownHandler=Jv(e)}generateKeymapBindings(){var e;const t=[],r=this.shortcutMap,n=this.store.getExtension(xe),o=a=>l=>Bf({shortcut:l,map:r,store:this.store,options:a.options});for(const a of this.store.extensions){const l=a.decoratedKeybindings??{};if(!((e=a.options.exclude)!=null&&e.keymap)){a.createKeymap&&t.push(KL(a.createKeymap(o(a)),r));for(const[c,u]of At(l)){if(u.isActive&&!u.isActive(a.options,this.store))continue;const d=a[c].bind(a),f=Bf({shortcut:u.shortcut,map:r,options:a.options,store:this.store}),p=_e(u.priority)?u.priority(a.options,this.store):u.priority??Ae.Low,h=ee();for(const m of f)h[m]=d;t.push([p,h]),u.command&&n.updateDecorated(u.command,{shortcut:f})}}}const i=this.sortKeymaps([...this.extraKeyBindings,...t]);return az(i)}arrowRightShortcut(e){const t=this.store.markTags[oe.PreventExits],r=this.store.nodeTags[oe.PreventExits];return this.exitMarkForwards(t,r)(e)}arrowLeftShortcut(e){const t=this.store.markTags[oe.PreventExits],r=this.store.nodeTags[oe.PreventExits];return Np(this.exitNodeBackwards(r),this.exitMarkBackwards(t,r))(e)}backspace(e){const t=this.store.markTags[oe.PreventExits],r=this.store.nodeTags[oe.PreventExits];return Np(this.exitNodeBackwards(r,!0),this.exitMarkBackwards(t,r,!0))(e)}createKeymap(){const{selectParentNodeOnEscape:e,undoInputRuleOnBackspace:t,excludeBaseKeymap:r}=this.options,n=ee();if(!r)for(const[o,i]of At(kg))n[o]=bu(i);return t&&kg.Backspace&&(n.Backspace=bu(Vh(jR,kg.Backspace))),e&&(n.Escape=bu(rL)),[Ae.Low,n]}getNamedShortcut(e,t={}){return e.startsWith("_|")?Bf({shortcut:e,map:this.shortcutMap,store:this.store,options:t}):[e]}onSetOptions(e){var t,r;const{changes:n}=e;(n.excludeBaseKeymap.changed||n.selectParentNodeOnEscape.changed||n.undoInputRuleOnBackspace.changed)&&((r=(t=this.store).rebuildKeymap)==null||r.call(t))}sortKeymaps(e){return ra(e.map(t=>ct(t)?t:[Ae.Default,t]),(t,r)=>r[0]-t[0]).map(t=>t[1])}exitMarkForwards(e,t){return r=>{const{tr:n,dispatch:o}=r;if(!Rz(n.selection)||ts({selection:n.selection,types:t}))return!1;const a=n.selection.$from.marks().filter(l=>!e.includes(l.type.name));if(Mo(a))return!1;if(!o)return!0;for(const l of a)n.removeStoredMark(l);return o(n.insertText(" ",n.selection.from)),!0}}exitNodeBackwards(e,t=!1){return r=>{const{tr:n}=r;if(!(t?u2:U1)(n.selection))return!1;const i=n.selection.$anchor.node();return!Bh(i)||vz(i)||e.includes(i.type.name)?!1:this.store.commands.toggleBlockNodeItem.original({type:i.type})(r)}}exitMarkBackwards(e,t,r=!1){return n=>{const{tr:o,dispatch:i}=n;if(!(r?u2:U1)(o.selection)||this.backwardMarkExitTracker.has(o.selection.anchor))return this.backwardMarkExitTracker.clear(),!1;if(ts({selection:o.selection,types:t}))return!1;const l=[...o.storedMarks??[],...o.selection.$from.marks()].filter(c=>!e.includes(c.type.name));if(Mo(l))return!1;if(!i)return!0;for(const c of l)o.removeStoredMark(c);return this.backwardMarkExitTracker.set(o.selection.anchor,!0),i(o),!0}}};Z([je({shortcut:"ArrowRight",isActive:e=>e.exitMarksOnArrowPress})],Qn.prototype,"arrowRightShortcut",1);Z([je({shortcut:"ArrowLeft",isActive:e=>e.exitMarksOnArrowPress})],Qn.prototype,"arrowLeftShortcut",1);Z([je({shortcut:"Backspace",isActive:e=>e.exitMarksOnArrowPress})],Qn.prototype,"backspace",1);Z([He()],Qn.prototype,"getNamedShortcut",1);Qn=Z([pe({defaultPriority:Ae.Low,defaultOptions:{shortcuts:"default",undoInputRuleOnBackspace:!0,selectParentNodeOnEscape:!1,excludeBaseKeymap:!1,exitMarksOnArrowPress:!0},customHandlerKeys:["keymap"]})],Qn);function WL(e){return fr(Ah(D),e)}function Bf({shortcut:e,map:t,options:r,store:n}){return ne(e)?[q1(e,t)]:ct(e)?e.map(o=>q1(o,t)):(e=e(r,n),Bf({shortcut:e,map:t,options:r,store:n}))}function q1(e,t){return WL(e)?t[e]:e}function KL(e,t){const r={};let n,o;ct(e)?[o,n]=e:n=e;for(const[i,s]of At(n))r[q1(i,t)]=s;return Nh(o)?r:[o,r]}var e5={[D.Copy]:"Mod-c",[D.Cut]:"Mod-x",[D.Paste]:"Mod-v",[D.PastePlain]:"Mod-Shift-v",[D.SelectAll]:"Mod-a",[D.Undo]:"Mod-z",[D.Redo]:on.isMac?"Shift-Mod-z":"Mod-y",[D.Bold]:"Mod-b",[D.Italic]:"Mod-i",[D.Underline]:"Mod-u",[D.Strike]:"Mod-d",[D.Code]:"Mod-`",[D.Paragraph]:"Mod-Shift-0",[D.H1]:"Mod-Shift-1",[D.H2]:"Mod-Shift-2",[D.H3]:"Mod-Shift-3",[D.H4]:"Mod-Shift-4",[D.H5]:"Mod-Shift-5",[D.H6]:"Mod-Shift-6",[D.TaskList]:"Mod-Shift-7",[D.BulletList]:"Mod-Shift-8",[D.OrderedList]:"Mod-Shift-9",[D.Quote]:"Mod->",[D.Divider]:"Mod-Shift-|",[D.Codeblock]:"Mod-Shift-~",[D.ClearFormatting]:"Mod-Shift-C",[D.Superscript]:"Mod-.",[D.Subscript]:"Mod-,",[D.LeftAlignment]:"Mod-Shift-L",[D.CenterAlignment]:"Mod-Shift-E",[D.RightAlignment]:"Mod-Shift-R",[D.JustifyAlignment]:"Mod-Shift-J",[D.InsertLink]:"Mod-k",[D.Find]:"Mod-f",[D.FindBackwards]:"Mod-Shift-f",[D.FindReplace]:"Mod-Shift-H",[D.AddFootnote]:"Mod-Alt-f",[D.AddComment]:"Mod-Alt-m",[D.ContextMenu]:"Mod-Shift-\\",[D.IncreaseFontSize]:"Mod-Shift-.",[D.DecreaseFontSize]:"Mod-Shift-,",[D.IncreaseIndent]:"Tab",[D.DecreaseIndent]:"Shift-Tab",[D.Shortcuts]:"Mod-/",[D.Format]:on.isMac?"Alt-Shift-f":"Shift-Ctrl-f"},qL={...e5,[D.Strike]:"Mod-Shift-S",[D.Code]:"Mod-Shift-M",[D.Paragraph]:"Mod-Alt-0",[D.H1]:"Mod-Alt-1",[D.H2]:"Mod-Alt-2",[D.H3]:"Mod-Alt-3",[D.H4]:"Mod-Alt-4",[D.H5]:"Mod-Alt-5",[D.H6]:"Mod-Alt-6",[D.OrderedList]:"Mod-Alt-7",[D.BulletList]:"Mod-Alt-8",[D.Quote]:"Mod-Alt-9",[D.ClearFormatting]:"Mod-\\",[D.IncreaseIndent]:"Mod-[",[D.DecreaseIndent]:"Mod-]"},GL={default:e5,googleDoc:qL},YL=class extends Ve{get name(){return"nodeViews"}createPlugin(){const e=[],t=ee();for(const r of this.store.extensions){if(!r.createNodeViews)continue;const n=r.createNodeViews();e.unshift(_e(n)?{[r.name]:n}:n)}e.unshift(this.store.managerSettings.nodeViews??{});for(const r of e)Object.assign(t,r);return{props:{nodeViews:t}}}},JL=class extends Ve{get name(){return"pasteRules"}createExternalPlugins(){return[this.generatePasteRulesPlugin()]}generatePasteRulesPlugin(){var e,t;const r=[];for(const n of this.store.extensions){if((e=this.store.managerSettings.exclude)!=null&&e.pasteRules||!n.createPasteRules||(t=n.options.exclude)!=null&&t.pasteRules)continue;const o=n.createPasteRules(),i=ct(o)?o:[o];r.push(...i)}return gL(r)}},zp=class extends Ve{constructor(){super(...arguments),this.plugins=[],this.managerPlugins=[],this.applyStateHandlers=[],this.initStateHandlers=[],this.appendTransactionHandlers=[],this.pluginKeys=ee(),this.stateGetters=new Map,this.getPluginStateCreator=e=>t=>e.getState(t??this.store.getState()),this.getStateByName=e=>{const t=this.stateGetters.get(e);return te(t,{message:"No plugin exists for the requested extension name."}),t()}}get name(){return"plugins"}onCreate(){const{setStoreKey:e,setExtensionStore:t,managerSettings:r,extensions:n}=this.store;this.updateExtensionStore();const{plugins:o=[]}=r;this.updatePlugins(o,this.managerPlugins);for(const i of n)i.onApplyState&&this.applyStateHandlers.push(i.onApplyState.bind(i)),i.onInitState&&this.initStateHandlers.push(i.onInitState.bind(i)),i.onAppendTransaction&&this.appendTransactionHandlers.push(i.onAppendTransaction.bind(i)),this.extractExtensionPlugins(i);this.managerPlugins=o,this.store.setStoreKey("plugins",this.plugins),e("pluginKeys",this.pluginKeys),e("getPluginState",this.getStateByName),t("getPluginState",this.getStateByName)}createPlugin(){return{appendTransaction:(e,t,r)=>{const n=r.tr,o={previousState:t,tr:n,transactions:e,state:r};for(const i of this.appendTransactionHandlers)i(o);return this.options.appendTransaction(o),n.docChanged||n.steps.length>0||n.selectionSet||n.storedMarksSet?n:void 0},state:{init:(e,t)=>{for(const r of this.initStateHandlers)r(t)},apply:(e,t,r,n)=>{const o={previousState:r,state:n,tr:e};for(const i of this.applyStateHandlers)i(o);this.options.applyState(o)}}}}extractExtensionPlugins(e){var t,r;if(!(!e.createPlugin&&!e.createExternalPlugins||(t=this.store.managerSettings.exclude)!=null&&t.plugins||(r=e.options.exclude)!=null&&r.plugins)){if(e.createPlugin){const o=new ka(e.name);this.pluginKeys[e.name]=o;const i=this.getPluginStateCreator(o);e.pluginKey=o,e.getPluginState=i,this.stateGetters.set(e.name,i),this.stateGetters.set(e.constructor,i);const s={...e.createPlugin(),key:o},a=new Ro(s);this.updatePlugins([a],e.plugin?[e.plugin]:void 0),e.plugin=a}if(e.createExternalPlugins){const o=e.createExternalPlugins();this.updatePlugins(o,e.externalPlugins),e.externalPlugins=o}}}updatePlugins(e,t){if(!t||Mo(t)){this.plugins=[...this.plugins,...e];return}if(e.length!==t.length){this.plugins=[...this.plugins.filter(n=>!t.includes(n)),...e];return}const r=new Map;for(const[n,o]of e.entries())r.set(it(t,n),o);this.plugins=this.plugins.map(n=>t.includes(n)?r.get(n):n)}updateExtensionStore(){const{setExtensionStore:e}=this.store;e("updatePlugins",this.updatePlugins.bind(this)),e("dispatchPluginUpdate",this.dispatchPluginUpdate.bind(this)),e("updateExtensionPlugins",this.updateExtensionPlugins.bind(this))}updateExtensionPlugins(e){const t=QC(e)?e:LL(e)?this.store.manager.getExtension(e):this.store.extensions.find(r=>r.name===e);te(t,{code:H.INVALID_MANAGER_EXTENSION,message:`The extension ${e} does not exist within the editor.`}),this.extractExtensionPlugins(t),this.store.setStoreKey("plugins",this.plugins),this.dispatchPluginUpdate()}dispatchPluginUpdate(){te(this.store.phase>=Nr.EditorView,{code:H.MANAGER_PHASE_ERROR,message:"`dispatchPluginUpdate` should only be called after the view has been added to the manager."});const{view:e,updateState:t}=this.store,r=e.state.reconfigure({plugins:this.plugins});t(r)}};zp=Z([pe({defaultPriority:Ae.Highest,handlerKeys:["applyState","appendTransaction"]})],zp);var G1=class extends Ve{constructor(){super(...arguments),this.dynamicAttributes={marks:ee(),nodes:ee()}}get name(){return"schema"}onCreate(){const{managerSettings:e,tags:t,markNames:r,nodeNames:n,extensions:o}=this.store,{defaultBlockNode:i,disableExtraAttributes:s,nodeOverride:a,markOverride:l}=e,c=h=>!!(h&&t[oe.Block].includes(h));if(e.schema){const{nodes:h,marks:m}=oI(e.schema);this.addSchema(e.schema,h,m);return}const u=c(i)?{doc:ee(),[i]:ee()}:ee(),d=ee(),f=XL({settings:e,gatheredSchemaAttributes:this.gatherExtraAttributes(o),nodeNames:n,markNames:r,tags:t});for(const h of o){f[h.name]={...f[h.name],...h.options.extraAttributes};const m=s===!0||h.options.disableExtraAttributes===!0||h.constructor.disableExtraAttributes===!0;if(Hd(h)){const{spec:b,dynamic:v}=m2({createExtensionSpec:(g,y)=>h.createNodeSpec(g,y),extraAttributes:it(f,h.name),override:{...a,...h.options.nodeOverride},ignoreExtraAttributes:m,name:h.constructorName,tags:h.tags});h.spec=b,u[h.name]=b,Object.keys(v).length>0&&(this.dynamicAttributes.nodes[h.name]=v)}if(Wh(h)){const{spec:b,dynamic:v}=m2({createExtensionSpec:(g,y)=>h.createMarkSpec(g,y),extraAttributes:it(f,h.name),override:{...l,...h.options.markOverride},ignoreExtraAttributes:m,name:h.constructorName,tags:h.tags??[]});h.spec=b,d[h.name]=b,Object.keys(v).length>0&&(this.dynamicAttributes.marks[h.name]=v)}}const p=new PA({nodes:u,marks:d,topNode:"doc"});this.addSchema(p,u,d)}createPlugin(){return{appendTransaction:(e,t,r)=>{const{tr:n}=r;return!e.some(i=>i.docChanged)||Object.keys(this.dynamicAttributes.nodes).length===0&&Object.keys(this.dynamicAttributes.marks).length===0?null:(n.doc.descendants((i,s)=>(this.checkAndUpdateDynamicNodes(i,s,n),this.checkAndUpdateDynamicMarks(i,s,n),!0)),n.steps.length>0?n:null)}}}addSchema(e,t,r){this.store.setStoreKey("nodes",t),this.store.setStoreKey("marks",r),this.store.setStoreKey("schema",e),this.store.setExtensionStore("schema",e),this.store.setStoreKey("defaultBlockNode",Hh(e).name);for(const n of Object.values(e.nodes))if(n.name!=="doc"&&(n.isBlock||n.isTextblock))break}checkAndUpdateDynamicNodes(e,t,r){for(const[n,o]of At(this.dynamicAttributes.nodes))if(e.type.name===n)for(const[i,s]of At(o)){if(!Zi(e.attrs[i]))continue;const a={...e.attrs,[i]:s(e)};r.setNodeMarkup(t,void 0,a),s2(r)}}checkAndUpdateDynamicMarks(e,t,r){for(const[n,o]of At(this.dynamicAttributes.marks)){const i=it(this.store.schema.marks,n),s=e.marks.find(a=>a.type.name===n);if(s)for(const[a,l]of At(o)){if(!Zi(s.attrs[a]))continue;const c=_o(r.doc.resolve(t),i);if(!c)continue;const{from:u,to:d}=c,f=i.create({...s.attrs,[a]:l(s)});r.removeMark(u,d,i).addMark(u,d,f),s2(r)}}}gatherExtraAttributes(e){const t=[];for(const r of e)r.createSchemaAttributes&&t.push(...r.createSchemaAttributes());return t}};G1=Z([pe({defaultPriority:Ae.Highest})],G1);function XL(e){const{settings:t,gatheredSchemaAttributes:r,nodeNames:n,markNames:o,tags:i}=e,s=ee();if(t.disableExtraAttributes)return s;const a=[...r,...t.extraAttributes??[]];for(const l of a??[]){const c=ZL({identifiers:l.identifiers,nodeNames:n,markNames:o,tags:i});for(const u of c){const d=s[u]??{};s[u]={...d,...l.attributes}}}return s}function QL(e){return hs(e)&&ct(e.tags)}function ZL(e){const{identifiers:t,nodeNames:r,markNames:n,tags:o}=e;if(t==="nodes")return r;if(t==="marks")return n;if(t==="all")return[...r,...n];if(ct(t))return t;te(QL(t),{code:H.EXTENSION_EXTRA_ATTRIBUTES,message:"Invalid value passed as an identifier when creating `extraAttributes`."});const{tags:i=[],names:s=[],behavior:a="any",excludeNames:l,excludeTags:c,type:u}=t,d=new Set,f=u==="mark"?n:u==="node"?r:[...n,...r],p=m=>f.includes(m)&&!(l!=null&&l.includes(m));for(const m of s)p(m)&&d.add(m);const h=new Map;for(const m of i)if(!(c!=null&&c.includes(m)))for(const b of o[m]){if(!p(b))continue;if(a==="any"){d.add(b);continue}const v=h.get(b)??new Set;v.add(m),h.set(b,v)}for(const[m,b]of h)b.size===i.length&&d.add(m);return[...d]}function m2(e){var t;const{createExtensionSpec:r,extraAttributes:n,ignoreExtraAttributes:o,name:i,tags:s,override:a}=e,l=ee();function c(b,v){l[b]=v}let u=!1;function d(){u=!0}const f=eI(n,o,d,c),p=tI(n,o),h=rI(n,o),m=r({defaults:f,parse:p,dom:h},a);return te(o||u,{code:H.EXTENSION_SPEC,message:`When creating a node specification you must call the 'defaults', and parse, and 'dom' methods. To avoid this error you can set the static property 'disableExtraAttributes' of '${i}' to 'true'.`}),m.group=[...((t=m.group)==null?void 0:t.split(" "))??[],...s].join(" ")||void 0,{spec:m,dynamic:l}}function Xv(e){return ne(e)||_e(e)?{default:e}:(te(e,{message:`${W4(e)} is not supported`,code:H.EXTENSION_EXTRA_ATTRIBUTES}),e)}function eI(e,t,r,n){return()=>{r();const o=ee();if(t)return o;for(const[i,s]of At(e)){let l=Xv(s).default;_e(l)&&(n(i,l),l=null),o[i]=l===void 0?{}:{default:l}}return o}}function tI(e,t){return r=>{const n=ee();if(t)return n;for(const[o,i]of At(e)){const{parseDOM:s,...a}=Xv(i);if(Je(r)){if(Zi(s)){n[o]=r.getAttribute(o)??a.default;continue}if(_e(s)){n[o]=s(r)??a.default;continue}n[o]=r.getAttribute(s)??a.default}}return n}}function rI(e,t){return r=>{const n=ee();if(t)return n;function o(i,s){if(i){if(ne(i)){n[s]=i;return}if(ct(i)){const[a,l]=i;n[a]=l??r.attrs[s];return}for(const[a,l]of At(i))n[a]=l}}for(const[i,s]of At(e)){const{toDOM:a,parseDOM:l}=Xv(s);if(Zi(a)){const c=ne(l)?l:i;n[c]=r.attrs[i];continue}if(_e(a)){o(a(r.attrs,nI(r)),i);continue}o(a,i)}return n}}function nI(e){return Id(e)?{node:e}:pz(e)?{mark:e}:{}}function oI(e){const t=ee(),r=ee();for(const[n,o]of Object.entries(e.nodes))t[n]=o.spec;for(const[n,o]of Object.entries(e.marks))r[n]=o.spec;return{nodes:t,marks:r}}var Ll=class extends Ve{constructor(){super(...arguments),this.onAddCustomHandler=({suggester:e})=>{var t;if(!(!e||(t=this.store.managerSettings.exclude)!=null&&t.suggesters))return i2(this.store.getState(),e)}}get name(){return"suggest"}onCreate(){this.store.setExtensionStore("addSuggester",e=>i2(this.store.getState(),e)),this.store.setExtensionStore("removeSuggester",e=>K6(this.store.getState(),e))}createExternalPlugins(){var e,t;const r=[];for(const n of this.store.extensions){if((e=this.store.managerSettings.exclude)!=null&&e.suggesters)break;if(!n.createSuggesters||(t=n.options.exclude)!=null&&t.suggesters)continue;const o=n.createSuggesters(),i=ct(o)?o:[o];r.push(...i)}return[q6(...r)]}getSuggestState(e){return Fv(e??this.store.getState())}getSuggestMethods(){const{addIgnored:e,clearIgnored:t,removeIgnored:r,ignoreNextExit:n,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}=this.getSuggestState();return{addIgnored:e,clearIgnored:t,removeIgnored:r,ignoreNextExit:n,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}}isSuggesterActive(e){var t;return fr(ct(e)?e:[e],(t=this.getSuggestState().match)==null?void 0:t.suggester.name)}};Z([He()],Ll.prototype,"getSuggestState",1);Z([He()],Ll.prototype,"getSuggestMethods",1);Z([He()],Ll.prototype,"isSuggesterActive",1);Ll=Z([pe({customHandlerKeys:["suggester"]})],Ll);var Y1=class extends Ve{constructor(){super(...arguments),this.allTags=ee(),this.plainTags=ee(),this.markTags=ee(),this.nodeTags=ee()}get name(){return"tags"}onCreate(){this.resetTags();for(const e of this.store.extensions)this.updateTagForExtension(e);this.store.setStoreKey("tags",this.allTags),this.store.setExtensionStore("tags",this.allTags),this.store.setStoreKey("plainTags",this.plainTags),this.store.setExtensionStore("plainTags",this.plainTags),this.store.setStoreKey("markTags",this.markTags),this.store.setExtensionStore("markTags",this.markTags),this.store.setStoreKey("nodeTags",this.nodeTags),this.store.setExtensionStore("nodeTags",this.nodeTags)}resetTags(){const e=ee(),t=ee(),r=ee(),n=ee();for(const o of Ah(oe))e[o]=[],t[o]=[],r[o]=[],n[o]=[];this.allTags=e,this.plainTags=t,this.markTags=r,this.nodeTags=n}updateTagForExtension(e){var t,r;const n=new Set([...e.tags??[],...((t=e.createTags)==null?void 0:t.call(e))??[],...e.options.extraTags??[],...((r=this.store.managerSettings.extraTags)==null?void 0:r[e.name])??[]]);for(const o of n)te(iI(o),{code:H.EXTENSION,message:`The tag provided by the extension: ${e.constructorName} is not supported by the editor. To add custom tags you can use the 'mutateTag' method.`}),this.allTags[o].push(e.name),ZC(e)&&this.plainTags[o].push(e.name),Wh(e)&&this.markTags[o].push(e.name),Hd(e)&&this.nodeTags[o].push(e.name);e.tags=[...n]}};Y1=Z([pe({defaultPriority:Ae.Highest})],Y1);function iI(e){return fr(Ah(oe),e)}var sI=new ka("remirrorFilePlaceholderPlugin");function aI(){const e=new Ro({key:sI,state:{init(){return{set:Ee.empty,payloads:new Map}},apply(t,{set:r,payloads:n}){r=r.map(t.mapping,t.doc);const o=t.getMeta(e);if(o)if(o.type===0){const i=document.createElement("placeholder"),s=Ge.widget(o.pos,i,{id:o.id});r=r.add(t.doc,[s]),n.set(o.id,o.payload)}else o.type===1&&(r=r.remove(r.find(void 0,void 0,i=>i.id===o.id)),n.delete(o.id));return{set:r,payloads:n}}},props:{decorations(t){var r;return((r=e.getState(t))==null?void 0:r.set)??null}}});return e}var lI=class extends Ve{get name(){return"upload"}createExternalPlugins(){return[aI()]}};function cI(e={}){e={...{exitMarksOnArrowPress:Qn.defaultOptions.exitMarksOnArrowPress,excludeBaseKeymap:Qn.defaultOptions.excludeBaseKeymap,selectParentNodeOnEscape:Qn.defaultOptions.selectParentNodeOnEscape,undoInputRuleOnBackspace:Qn.defaultOptions.undoInputRuleOnBackspace,persistentSelectionClass:io.defaultOptions.persistentSelectionClass},...e};const r=w1(e,["excludeBaseKeymap","selectParentNodeOnEscape","undoInputRuleOnBackspace"]),n=w1(e,["persistentSelectionClass"]);return[new Y1,new G1,new IL,new zp,new K1,new JL,new YL,new Ll,new xe,new Rn,new Qn(r),new W1,new lI,new io(n)]}var g2=class extends Ve{get name(){return"meta"}onCreate(){if(this.store.setStoreKey("getCommandMeta",this.getCommandMeta.bind(this)),!!this.options.capture)for(const e of this.store.extensions)this.captureCommands(e),this.captureKeybindings(e)}createPlugin(){return{}}captureCommands(e){const t=e.decoratedCommands??{},r=e.createCommands;for(const n of Object.keys(t)){const o=e[n];e[n]=(...i)=>s=>{var a;const l=o(...i)(s);return s.dispatch&&l&&this.setCommandMeta(s.tr,{type:"command",chain:s.dispatch!==((a=s.view)==null?void 0:a.dispatch),name:n,extension:e.name,decorated:!0}),l}}r&&(e.createCommands=()=>{const n=r();for(const[o,i]of Object.entries(n))n[o]=(...s)=>a=>{var l;const c=i(...s)(a);return a.dispatch&&c&&this.setCommandMeta(a.tr,{type:"command",chain:a.dispatch!==((l=a.view)==null?void 0:l.dispatch),name:o,extension:e.name,decorated:!1}),c};return n})}captureKeybindings(e){}getCommandMeta(e){return e.getMeta(this.pluginKey)??[]}setCommandMeta(e,t){const r=this.getCommandMeta(e);e.setMeta(this.pluginKey,[...r,t])}};g2=Z([pe({defaultOptions:{capture:on.isDevelopment},staticKeys:["capture"],defaultPriority:Ae.Highest})],g2);var Ff,$c,Vf,Wa,Ei,jf,Uf,uI=class{constructor(e){kt(this,Ff,Cl()),kt(this,$c,void 0),kt(this,Vf,void 0),kt(this,Wa,!0),kt(this,Ei,jh()),kt(this,jf,void 0),kt(this,Uf,void 0),this.getState=()=>this.view.state??this.initialEditorState,this.getPreviousState=()=>this.previousState,this.dispatchTransaction=i=>{var s,a;te(!this.manager.destroyed,{code:H.MANAGER_PHASE_ERROR,message:"A transaction was dispatched to a manager that has already been destroyed. Please check your set up, or open an issue."}),i=((a=(s=this.props).onDispatchTransaction)==null?void 0:a.call(s,i,this.getState()))??i;const l=this.getState(),{state:c,transactions:u}=l.applyTransaction(i);Lt(this,Vf,l),this.updateState({state:c,tr:i,transactions:u});const d=this.manager.store.getForcedUpdates(i);Mo(d)||this.updateViewProps(...d)},this.onChange=(i=ee())=>{var s,a;const l=this.eventListenerProps(i);G(this,Wa)&&Lt(this,Wa,!1),(a=(s=this.props).onChange)==null||a.call(s,l)},this.onBlur=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onBlur)==null||a.call(s,l,i),G(this,Ei).emit("blur",l,i)},this.onFocus=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onFocus)==null||a.call(s,l,i),G(this,Ei).emit("focus",l,i)},this.setContent=(i,{triggerChange:s=!1}={})=>{const{doc:a}=this.manager.createState({content:i}),l=this.getState(),{state:c}=this.getState().applyTransaction(l.tr.replaceRangeWith(0,l.doc.nodeSize-2,a));if(s)return this.updateState({state:c,triggerChange:s});this.view.updateState(c)},this.clearContent=({triggerChange:i=!1}={})=>{this.setContent(this.manager.createEmptyDoc(),{triggerChange:i})},this.createStateFromContent=(i,s)=>this.manager.createState({content:i,selection:s}),this.focus=i=>{this.manager.store.commands.focus(i)},this.blur=i=>{this.manager.store.commands.blur(i)};const{getProps:t,initialEditorState:r,element:n}=e;if(Lt(this,$c,t),Lt(this,Uf,r),this.manager.attachFramework(this,this.updateListener.bind(this)),this.manager.view)return;const o=this.createView(r,n);this.manager.addView(o)}get addHandler(){return G(this,jf)??Lt(this,jf,G(this,Ei).on.bind(G(this,Ei)))}get updatableViewProps(){return{attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0}}get firstRender(){return G(this,Wa)}get props(){return G(this,$c).call(this)}get previousState(){return this.previousStateOverride??G(this,Vf)??this.initialEditorState}get manager(){return this.props.manager}get view(){return this.manager.view}get uid(){return G(this,Ff)}get initialEditorState(){return G(this,Uf)}updateListener(e){const{state:t,tr:r}=e;return G(this,Ei).emit("updated",this.eventListenerProps({state:t,tr:r}))}update(e){const{getProps:t}=e;return Lt(this,$c,t),this}updateViewProps(...e){const t=w1(this.updatableViewProps,e);this.view.setProps({...this.view.props,...t})}getAttributes(e){var t;const{attributes:r,autoFocus:n,classNames:o=[],label:i,editable:s}=this.props,a=(t=this.manager.store)==null?void 0:t.attributes,l=_e(r)?r(this.eventListenerProps()):r;let c={};(n||Jt(n))&&(c=e?{autoFocus:!0}:{autofocus:"true"});const u=Ml(ju(e&&"Prosemirror","remirror-editor",a==null?void 0:a.class,...o).split(" ")).join(" "),d={role:"textbox",...c,"aria-multiline":"true",...s??!0?{}:{"aria-readonly":"true"},"aria-label":i??"",...a,class:u};return q4({...d,...l})}addFocusListeners(){this.view.dom.addEventListener("blur",this.onBlur),this.view.dom.addEventListener("focus",this.onFocus)}removeFocusListeners(){this.view.dom.removeEventListener("blur",this.onBlur),this.view.dom.removeEventListener("focus",this.onFocus)}destroy(){G(this,Ei).emit("destroy"),this.view&&this.removeFocusListeners()}eventListenerProps(e=ee()){const{state:t,tr:r,transactions:n}=e;return{tr:r,transactions:n,internalUpdate:!r,view:this.view,firstRender:G(this,Wa),state:t??this.getState(),createStateFromContent:this.createStateFromContent,previousState:this.previousState,helpers:this.manager.store.helpers}}get baseOutput(){return{manager:this.manager,...this.manager.store,addHandler:this.addHandler,focus:this.focus,blur:this.blur,uid:G(this,Ff),view:this.view,getState:this.getState,getPreviousState:this.getPreviousState,getExtension:this.manager.getExtension.bind(this.manager),hasExtension:this.manager.hasExtension.bind(this.manager),clearContent:this.clearContent,setContent:this.setContent}}};Ff=new WeakMap;$c=new WeakMap;Vf=new WeakMap;Wa=new WeakMap;Ei=new WeakMap;jf=new WeakMap;Uf=new WeakMap;function dI(e,t){const r=[],n=new WeakMap,o=[],i=new WeakMap;let s=[];const a={duplicateMap:i,parentExtensions:o,gatheredExtensions:s,settings:t};for(const d of e)t5(a,{extension:d});s=ra(s,(d,f)=>f.priority-d.priority);const l=new WeakSet,c=new Set;for(const d of s){const f=d.constructor,p=d.name,h=i.get(f);te(h,{message:`No entries were found for the ExtensionConstructor ${d.name}`,code:H.INTERNAL}),!(l.has(f)||c.has(p))&&(l.add(f),c.add(p),r.push(d),n.set(f,d),h.forEach(m=>m==null?void 0:m.replaceChildExtension(f,d)))}const u=[];for(const d of r)fI({extension:d,found:l,missing:u});return te(Mo(u),{code:H.MISSING_REQUIRED_EXTENSION,message:u.map(({Constructor:d,extension:f})=>`The extension '${f.name}' requires '${d.name} in order to run correctly.`).join(` -`)}),{extensions:r,extensionMap:n}}function t5(e,t){var r;const{gatheredExtensions:n,duplicateMap:o,parentExtensions:i,settings:s}=e,{extension:a,parentExtension:l}=t;let{names:c=[]}=t;te(QC(a),{code:H.INVALID_MANAGER_EXTENSION,message:`An invalid extension: ${a} was provided to the [[\`RemirrorManager\`]].`});const u=a.extensions;if(a.setPriority((r=s.priority)==null?void 0:r[a.name]),n.push(a),pI({duplicateMap:o,extension:a,parentExtension:l}),u.length!==0){if(c.includes(a.name)){`${c.join(" > ")}${a.name}`;return}c=[...c,a.name],i.push(a);for(const d of u)t5(e,{names:c,extension:d,parentExtension:a})}}function fI(e){const{extension:t,found:r,missing:n}=e;if(t.requiredExtensions)for(const o of t.requiredExtensions??[])r.has(o)||n.push({Constructor:o,extension:t})}function pI(e){const{duplicateMap:t,extension:r,parentExtension:n}=e,o=r.constructor,i=t.get(o),s=n?[n]:[];t.set(o,i?[...i,...s]:s)}function hI(e){var t,r,n,o;const{extension:i,nodeNames:s,markNames:a,plainNames:l,store:c,handlers:u}=e;i.setStore(c);const d=(t=i.onCreate)==null?void 0:t.bind(i),f=(r=i.onView)==null?void 0:r.bind(i),p=(n=i.onStateUpdate)==null?void 0:n.bind(i),h=(o=i.onDestroy)==null?void 0:o.bind(i);d&&u.create.push(d),f&&u.view.push(f),p&&u.update.push(p),h&&u.destroy.push(h),Wh(i)&&a.push(i.name),Hd(i)&&i.name!=="doc"&&s.push(i.name),ZC(i)&&l.push(i.name)}var Ci,Hc,Wn,$o,Bc,Zr,Cs,Fc,Ms,Vc,Ts,Kn,jc,Wf=class{constructor(e,t={}){kt(this,Ci,void 0),kt(this,Hc,ee()),kt(this,Wn,ee()),kt(this,$o,void 0),kt(this,Bc,void 0),kt(this,Zr,Nr.None),kt(this,Cs,void 0),kt(this,Fc,!0),kt(this,Ms,{create:[],view:[],update:[],destroy:[]}),kt(this,Vc,[]),kt(this,Ts,jh()),kt(this,Kn,void 0),kt(this,jc,void 0),this.getState=()=>{var o;return G(this,Zr)>=Nr.EditorView?this.view.state:(te(G(this,Kn),{code:H.MANAGER_PHASE_ERROR,message:"`getState` can only be called after the `Framework` or the `EditorView` has been added to the manager`. Check your plugins to make sure that the decorations callback uses the state argument."}),(o=G(this,Kn))==null?void 0:o.initialEditorState)},this.updateState=o=>{const i=this.getState();this.view.updateState(o),this.onStateUpdate({previousState:i,state:o})};const{extensions:r,extensionMap:n}=dI(e,t);Lt(this,Cs,t),Lt(this,$o,Hs(r)),Lt(this,Bc,n),Lt(this,Ci,this.createExtensionStore()),Lt(this,Zr,Nr.Create),this.setupLifecycleHandlers();for(const o of G(this,Ms).create){const i=o();i&&G(this,Vc).push(i)}}static create(e,t={}){return new Wf([...eE(e),...cI(t.builtin)],t)}get[ti](){return $t.Manager}get destroyed(){return G(this,Zr)===Nr.Destroy}get mounted(){return G(this,Zr)>=Nr.EditorView&&G(this,Zr)G(this,$o),enumerable:t},phase:{get:()=>G(this,Zr),enumerable:t},view:{get:()=>this.view,enumerable:t},managerSettings:{get:()=>Hs(G(this,Cs)),enumerable:t},getState:{value:this.getState,enumerable:t},updateState:{value:this.updateState,enumerable:t},isMounted:{value:()=>this.mounted,enumerable:t},getExtension:{value:this.getExtension.bind(this),enumerable:t},manager:{get:()=>this,enumerable:t},document:{get:()=>this.document,enumerable:t},stringHandlers:{get:()=>G(this,Hc),enumerable:t},currentState:{get:()=>r??(r=this.getState()),set:o=>{r=o},enumerable:t},previousState:{get:()=>n,set:o=>{n=o},enumerable:t}}),e.getStoreKey=this.getStoreKey.bind(this),e.setStoreKey=this.setStoreKey.bind(this),e.setExtensionStore=this.setExtensionStore.bind(this),e.setStringHandler=this.setStringHandler.bind(this),e}addView(e){if(G(this,Zr)>=Nr.EditorView)return this;Lt(this,Fc,!0),Lt(this,Zr,Nr.EditorView),G(this,Wn).view=e;for(const t of G(this,Ms).view){const r=t(e);r&&G(this,Vc).push(r)}return this}attachFramework(e,t){var r;G(this,Kn)!==e&&(G(this,Kn)&&(G(this,Kn).destroy(),(r=G(this,jc))==null||r.call(this)),Lt(this,Kn,e),Lt(this,jc,this.addHandler("stateUpdate",t)))}createEmptyDoc(){var e;const t=(e=this.schema.nodes.doc)==null?void 0:e.createAndFill();return te(t,{code:H.INVALID_CONTENT,message:"An empty node could not be created due to an invalid schema."}),t}createState(e={}){const{onError:t,defaultSelection:r="end"}=this.settings,{content:n=this.createEmptyDoc(),selection:o=r,stringHandler:i=this.settings.stringHandler}=e,{schema:s,plugins:a}=this.store,l=AC({stringHandler:ne(i)?this.stringHandlers[i]:i,document:this.document,content:n,onError:t,schema:s,selection:o});return Bs.create({schema:s,doc:l,plugins:a,selection:jr(o,l)})}addHandler(e,t){return G(this,Ts).on(e,t)}onStateUpdate(e){const t=G(this,Fc);G(this,Ci).currentState=e.state,G(this,Ci).previousState=e.previousState,t&&(Lt(this,Zr,Nr.Runtime),Lt(this,Fc,!1));const r={...e,firstUpdate:t};for(const n of G(this,Ms).update)n(r);G(this,Ts).emit("stateUpdate",r)}getExtension(e){const t=G(this,Bc).get(e);return te(t,{code:H.INVALID_MANAGER_EXTENSION,message:`'${e.name}' doesn't exist within this manager. Make sure it is properly added before attempting to use it.`}),t}hasExtension(e){return!!G(this,Bc).get(e)}clone(){const e=G(this,$o).map(r=>r.clone(r.options)),t=Wf.create(()=>e,G(this,Cs));return G(this,Ts).emit("clone",t),t}recreate(e=[],t={}){const r=G(this,$o).map(o=>o.clone(o.initialOptions)),n=Wf.create(()=>[...r,...e],t);return G(this,Ts).emit("recreate",n),n}destroy(){var e,t,r,n,o,i;Lt(this,Zr,Nr.Destroy);for(const s of((e=this.view)==null?void 0:e.state.plugins)??[])(r=(t=s.getState(this.view.state))==null?void 0:t.destroy)==null||r.call(t);(n=G(this,Kn))==null||n.destroy(),(o=G(this,jc))==null||o.call(this);for(const s of G(this,Vc))s();for(const s of G(this,Ms).destroy)s();(i=this.view)==null||i.destroy(),G(this,Ts).emit("destroy")}includes(e){const t=[],r=[];for(const n of G(this,$o))t.push(n.name,n.constructorName),r.push(n.constructor);return e.every(n=>ne(n)?fr(t,n):fr(r,n))}},mI=Wf;Ci=new WeakMap;Hc=new WeakMap;Wn=new WeakMap;$o=new WeakMap;Bc=new WeakMap;Zr=new WeakMap;Cs=new WeakMap;Fc=new WeakMap;Ms=new WeakMap;Vc=new WeakMap;Ts=new WeakMap;Kn=new WeakMap;jc=new WeakMap;function gI(e,t){return!oc(e)||!ic(e,$t.Manager)?!1:t?e.includes(t):!0}var vI=Object.defineProperty,yI=Object.getOwnPropertyDescriptor,Bd=(e,t,r,n)=>{for(var o=n>1?void 0:n?yI(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&vI(t,r,o),o},r5=/\S+/g;function n5(e){return e.type.isTextblock?1:e.type.isText?e.textBetween(0,e.nodeSize).length:0}function bI({doc:e},t){let r=0,n=0;return e.nodesBetween(0,e.nodeSize-2,(o,i)=>{if(n>0)return!1;const s=n5(o);return r+s>t?(n=i+1+(t-r),!1):(r+=s,!0)}),n}function xI({doc:e},t){let r=0,n=0;return e.nodesBetween(0,e.nodeSize-2,(o,i)=>{if(n>0)return!1;if(!o.type.isText)return!0;const s=o.textBetween(0,o.nodeSize),a=xa(s,r5);if(r+a.length>t){const l=t-r,c=a[l];return n=i+((c==null?void 0:c.index)??0),!1}return r+=a.length,!0}),n}var is=class extends Ve{get name(){return"count"}getCountMaximum(){return this.options.maximum}getCharacterCount(e=this.store.getState()){let t=0;return e.doc.nodesBetween(0,e.doc.nodeSize-2,r=>(t+=n5(r),!0)),Math.max(t-1,0)}getWordCount(e=this.store.getState()){const t=this.store.helpers.getText({lineBreakDivider:" ",state:e});return xa(t,r5).length}isCountValid(e=this.store.getState()){const{maximumStrategy:t,maximum:r}=this.options;return r<1?!0:t==="CHARACTERS"?this.store.helpers.getCharacterCount(e)<=r:this.store.helpers.getWordCount(e)<=r}createDecorationSet(e){const{maximum:t=-1,maximumStrategy:r,maximumExceededClassName:n}=this.options,s=(r==="CHARACTERS"?bI:xI)(e,t);return Ee.create(e.doc,[Ge.inline(s,e.doc.nodeSize-2,{class:n})])}createExternalPlugins(){const{maximum:e}=this.options,t=new Ro({state:{init:(r,n)=>this.isCountValid(n)?{decorationSet:Ee.empty}:{decorationSet:this.createDecorationSet(n)},apply:(r,n,o,i)=>!r.docChanged||e<1?n:this.isCountValid(i)?{decorationSet:Ee.empty}:{decorationSet:this.createDecorationSet(i)}},props:{decorations(r){var n;return((n=t.getState(r))==null?void 0:n.decorationSet)??null}}});return[t]}};Bd([He()],is.prototype,"getCountMaximum",1);Bd([He()],is.prototype,"getCharacterCount",1);Bd([He()],is.prototype,"getWordCount",1);Bd([He()],is.prototype,"isCountValid",1);is=Bd([pe({defaultOptions:{maximum:-1,maximumExceededClassName:"remirror-max-count-exceeded",maximumStrategy:"CHARACTERS"},staticKeys:["maximum","maximumStrategy","maximumExceededClassName"]})],is);var o5={exports:{}},hn={},i5={exports:{}},s5={};/** +`,Li)}getHTML(e=this.store.getState()){return Az(e.doc,this.store.document)}textToProsemirrorNode(e){const t=`
    ${e.content}
    `;return this.store.stringHandlers.html({...e,content:t})}};Z([He()],Rn.prototype,"isSelectionEmpty",1);Z([He()],Rn.prototype,"isViewEditable",1);Z([He()],Rn.prototype,"getStateJSON",1);Z([He()],Rn.prototype,"getJSON",1);Z([He()],Rn.prototype,"getRemirrorJSON",1);Z([U()],Rn.prototype,"insertHtml",1);Z([He()],Rn.prototype,"getText",1);Z([He()],Rn.prototype,"getTextBetween",1);Z([He()],Rn.prototype,"getHTML",1);Rn=Z([pe({})],Rn);var q1=class extends Ve{get name(){return"inputRules"}onCreate(){this.store.setExtensionStore("rebuildInputRules",this.rebuildInputRules.bind(this))}createExternalPlugins(){return[this.generateInputRulesPlugin()]}generateInputRulesPlugin(){var e,t;const r=[],n=this.store.markTags[te.ExcludeInputRules];for(const o of this.store.extensions)if(!((e=this.store.managerSettings.exclude)!=null&&e.inputRules||!o.createInputRules||(t=o.options.exclude)!=null&&t.inputRules))for(const i of o.createInputRules())i.shouldSkip=this.options.shouldSkipInputRule,i.invalidMarks=n,r.push(i);return jR({rules:r})}rebuildInputRules(){this.store.updateExtensionPlugins(this)}};q1=Z([pe({defaultPriority:Ae.Default,handlerKeys:["shouldSkipInputRule"],handlerKeyOptions:{shouldSkipInputRule:{earlyReturnValue:!0}}})],q1);var Qn=class extends Ve{constructor(){super(...arguments),this.extraKeyBindings=[],this.backwardMarkExitTracker=new Map,this.keydownHandler=null,this.onAddCustomHandler=({keymap:e})=>{var t,r;if(e)return this.extraKeyBindings=[...this.extraKeyBindings,e],(r=(t=this.store).rebuildKeymap)==null||r.call(t),()=>{var n,o;this.extraKeyBindings=this.extraKeyBindings.filter(i=>i!==e),(o=(n=this.store).rebuildKeymap)==null||o.call(n)}},this.rebuildKeymap=()=>{this.setupKeydownHandler()}}get name(){return"keymap"}get shortcutMap(){const{shortcuts:e}=this.options;return oe(e)?YL[e]:e}onCreate(){this.store.setExtensionStore("rebuildKeymap",this.rebuildKeymap)}createExternalPlugins(){var e;return(e=this.store.managerSettings.exclude)!=null&&e.keymap?[]:(this.setupKeydownHandler(),[new Ro({props:{handleKeyDown:(t,r)=>{var n;return(n=this.keydownHandler)==null?void 0:n.call(this,t,r)}}})])}setupKeydownHandler(){const e=this.generateKeymapBindings();this.keydownHandler=Xv(e)}generateKeymapBindings(){var e;const t=[],r=this.shortcutMap,n=this.store.getExtension(xe),o=a=>l=>Bf({shortcut:l,map:r,store:this.store,options:a.options});for(const a of this.store.extensions){const l=a.decoratedKeybindings??{};if(!((e=a.options.exclude)!=null&&e.keymap)){a.createKeymap&&t.push(qL(a.createKeymap(o(a)),r));for(const[c,u]of At(l)){if(u.isActive&&!u.isActive(a.options,this.store))continue;const d=a[c].bind(a),f=Bf({shortcut:u.shortcut,map:r,options:a.options,store:this.store}),p=_e(u.priority)?u.priority(a.options,this.store):u.priority??Ae.Low,h=ee();for(const m of f)h[m]=d;t.push([p,h]),u.command&&n.updateDecorated(u.command,{shortcut:f})}}}const i=this.sortKeymaps([...this.extraKeyBindings,...t]);return lz(i)}arrowRightShortcut(e){const t=this.store.markTags[te.PreventExits],r=this.store.nodeTags[te.PreventExits];return this.exitMarkForwards(t,r)(e)}arrowLeftShortcut(e){const t=this.store.markTags[te.PreventExits],r=this.store.nodeTags[te.PreventExits];return Rp(this.exitNodeBackwards(r),this.exitMarkBackwards(t,r))(e)}backspace(e){const t=this.store.markTags[te.PreventExits],r=this.store.nodeTags[te.PreventExits];return Rp(this.exitNodeBackwards(r,!0),this.exitMarkBackwards(t,r,!0))(e)}createKeymap(){const{selectParentNodeOnEscape:e,undoInputRuleOnBackspace:t,excludeBaseKeymap:r}=this.options,n=ee();if(!r)for(const[o,i]of At(wg))n[o]=bu(i);return t&&wg.Backspace&&(n.Backspace=bu(jh(UR,wg.Backspace))),e&&(n.Escape=bu(nL)),[Ae.Low,n]}getNamedShortcut(e,t={}){return e.startsWith("_|")?Bf({shortcut:e,map:this.shortcutMap,store:this.store,options:t}):[e]}onSetOptions(e){var t,r;const{changes:n}=e;(n.excludeBaseKeymap.changed||n.selectParentNodeOnEscape.changed||n.undoInputRuleOnBackspace.changed)&&((r=(t=this.store).rebuildKeymap)==null||r.call(t))}sortKeymaps(e){return ta(e.map(t=>ct(t)?t:[Ae.Default,t]),(t,r)=>r[0]-t[0]).map(t=>t[1])}exitMarkForwards(e,t){return r=>{const{tr:n,dispatch:o}=r;if(!Pz(n.selection)||rs({selection:n.selection,types:t}))return!1;const a=n.selection.$from.marks().filter(l=>!e.includes(l.type.name));if(Mo(a))return!1;if(!o)return!0;for(const l of a)n.removeStoredMark(l);return o(n.insertText(" ",n.selection.from)),!0}}exitNodeBackwards(e,t=!1){return r=>{const{tr:n}=r;if(!(t?d2:W1)(n.selection))return!1;const i=n.selection.$anchor.node();return!Fh(i)||yz(i)||e.includes(i.type.name)?!1:this.store.commands.toggleBlockNodeItem.original({type:i.type})(r)}}exitMarkBackwards(e,t,r=!1){return n=>{const{tr:o,dispatch:i}=n;if(!(r?d2:W1)(o.selection)||this.backwardMarkExitTracker.has(o.selection.anchor))return this.backwardMarkExitTracker.clear(),!1;if(rs({selection:o.selection,types:t}))return!1;const l=[...o.storedMarks??[],...o.selection.$from.marks()].filter(c=>!e.includes(c.type.name));if(Mo(l))return!1;if(!i)return!0;for(const c of l)o.removeStoredMark(c);return this.backwardMarkExitTracker.set(o.selection.anchor,!0),i(o),!0}}};Z([je({shortcut:"ArrowRight",isActive:e=>e.exitMarksOnArrowPress})],Qn.prototype,"arrowRightShortcut",1);Z([je({shortcut:"ArrowLeft",isActive:e=>e.exitMarksOnArrowPress})],Qn.prototype,"arrowLeftShortcut",1);Z([je({shortcut:"Backspace",isActive:e=>e.exitMarksOnArrowPress})],Qn.prototype,"backspace",1);Z([He()],Qn.prototype,"getNamedShortcut",1);Qn=Z([pe({defaultPriority:Ae.Low,defaultOptions:{shortcuts:"default",undoInputRuleOnBackspace:!0,selectParentNodeOnEscape:!1,excludeBaseKeymap:!1,exitMarksOnArrowPress:!0},customHandlerKeys:["keymap"]})],Qn);function KL(e){return fr(Nh($),e)}function Bf({shortcut:e,map:t,options:r,store:n}){return oe(e)?[G1(e,t)]:ct(e)?e.map(o=>G1(o,t)):(e=e(r,n),Bf({shortcut:e,map:t,options:r,store:n}))}function G1(e,t){return KL(e)?t[e]:e}function qL(e,t){const r={};let n,o;ct(e)?[o,n]=e:n=e;for(const[i,s]of At(n))r[G1(i,t)]=s;return Rh(o)?r:[o,r]}var t5={[$.Copy]:"Mod-c",[$.Cut]:"Mod-x",[$.Paste]:"Mod-v",[$.PastePlain]:"Mod-Shift-v",[$.SelectAll]:"Mod-a",[$.Undo]:"Mod-z",[$.Redo]:on.isMac?"Shift-Mod-z":"Mod-y",[$.Bold]:"Mod-b",[$.Italic]:"Mod-i",[$.Underline]:"Mod-u",[$.Strike]:"Mod-d",[$.Code]:"Mod-`",[$.Paragraph]:"Mod-Shift-0",[$.H1]:"Mod-Shift-1",[$.H2]:"Mod-Shift-2",[$.H3]:"Mod-Shift-3",[$.H4]:"Mod-Shift-4",[$.H5]:"Mod-Shift-5",[$.H6]:"Mod-Shift-6",[$.TaskList]:"Mod-Shift-7",[$.BulletList]:"Mod-Shift-8",[$.OrderedList]:"Mod-Shift-9",[$.Quote]:"Mod->",[$.Divider]:"Mod-Shift-|",[$.Codeblock]:"Mod-Shift-~",[$.ClearFormatting]:"Mod-Shift-C",[$.Superscript]:"Mod-.",[$.Subscript]:"Mod-,",[$.LeftAlignment]:"Mod-Shift-L",[$.CenterAlignment]:"Mod-Shift-E",[$.RightAlignment]:"Mod-Shift-R",[$.JustifyAlignment]:"Mod-Shift-J",[$.InsertLink]:"Mod-k",[$.Find]:"Mod-f",[$.FindBackwards]:"Mod-Shift-f",[$.FindReplace]:"Mod-Shift-H",[$.AddFootnote]:"Mod-Alt-f",[$.AddComment]:"Mod-Alt-m",[$.ContextMenu]:"Mod-Shift-\\",[$.IncreaseFontSize]:"Mod-Shift-.",[$.DecreaseFontSize]:"Mod-Shift-,",[$.IncreaseIndent]:"Tab",[$.DecreaseIndent]:"Shift-Tab",[$.Shortcuts]:"Mod-/",[$.Format]:on.isMac?"Alt-Shift-f":"Shift-Ctrl-f"},GL={...t5,[$.Strike]:"Mod-Shift-S",[$.Code]:"Mod-Shift-M",[$.Paragraph]:"Mod-Alt-0",[$.H1]:"Mod-Alt-1",[$.H2]:"Mod-Alt-2",[$.H3]:"Mod-Alt-3",[$.H4]:"Mod-Alt-4",[$.H5]:"Mod-Alt-5",[$.H6]:"Mod-Alt-6",[$.OrderedList]:"Mod-Alt-7",[$.BulletList]:"Mod-Alt-8",[$.Quote]:"Mod-Alt-9",[$.ClearFormatting]:"Mod-\\",[$.IncreaseIndent]:"Mod-[",[$.DecreaseIndent]:"Mod-]"},YL={default:t5,googleDoc:GL},JL=class extends Ve{get name(){return"nodeViews"}createPlugin(){const e=[],t=ee();for(const r of this.store.extensions){if(!r.createNodeViews)continue;const n=r.createNodeViews();e.unshift(_e(n)?{[r.name]:n}:n)}e.unshift(this.store.managerSettings.nodeViews??{});for(const r of e)Object.assign(t,r);return{props:{nodeViews:t}}}},XL=class extends Ve{get name(){return"pasteRules"}createExternalPlugins(){return[this.generatePasteRulesPlugin()]}generatePasteRulesPlugin(){var e,t;const r=[];for(const n of this.store.extensions){if((e=this.store.managerSettings.exclude)!=null&&e.pasteRules||!n.createPasteRules||(t=n.options.exclude)!=null&&t.pasteRules)continue;const o=n.createPasteRules(),i=ct(o)?o:[o];r.push(...i)}return vL(r)}},Lp=class extends Ve{constructor(){super(...arguments),this.plugins=[],this.managerPlugins=[],this.applyStateHandlers=[],this.initStateHandlers=[],this.appendTransactionHandlers=[],this.pluginKeys=ee(),this.stateGetters=new Map,this.getPluginStateCreator=e=>t=>e.getState(t??this.store.getState()),this.getStateByName=e=>{const t=this.stateGetters.get(e);return re(t,{message:"No plugin exists for the requested extension name."}),t()}}get name(){return"plugins"}onCreate(){const{setStoreKey:e,setExtensionStore:t,managerSettings:r,extensions:n}=this.store;this.updateExtensionStore();const{plugins:o=[]}=r;this.updatePlugins(o,this.managerPlugins);for(const i of n)i.onApplyState&&this.applyStateHandlers.push(i.onApplyState.bind(i)),i.onInitState&&this.initStateHandlers.push(i.onInitState.bind(i)),i.onAppendTransaction&&this.appendTransactionHandlers.push(i.onAppendTransaction.bind(i)),this.extractExtensionPlugins(i);this.managerPlugins=o,this.store.setStoreKey("plugins",this.plugins),e("pluginKeys",this.pluginKeys),e("getPluginState",this.getStateByName),t("getPluginState",this.getStateByName)}createPlugin(){return{appendTransaction:(e,t,r)=>{const n=r.tr,o={previousState:t,tr:n,transactions:e,state:r};for(const i of this.appendTransactionHandlers)i(o);return this.options.appendTransaction(o),n.docChanged||n.steps.length>0||n.selectionSet||n.storedMarksSet?n:void 0},state:{init:(e,t)=>{for(const r of this.initStateHandlers)r(t)},apply:(e,t,r,n)=>{const o={previousState:r,state:n,tr:e};for(const i of this.applyStateHandlers)i(o);this.options.applyState(o)}}}}extractExtensionPlugins(e){var t,r;if(!(!e.createPlugin&&!e.createExternalPlugins||(t=this.store.managerSettings.exclude)!=null&&t.plugins||(r=e.options.exclude)!=null&&r.plugins)){if(e.createPlugin){const o=new ka(e.name);this.pluginKeys[e.name]=o;const i=this.getPluginStateCreator(o);e.pluginKey=o,e.getPluginState=i,this.stateGetters.set(e.name,i),this.stateGetters.set(e.constructor,i);const s={...e.createPlugin(),key:o},a=new Ro(s);this.updatePlugins([a],e.plugin?[e.plugin]:void 0),e.plugin=a}if(e.createExternalPlugins){const o=e.createExternalPlugins();this.updatePlugins(o,e.externalPlugins),e.externalPlugins=o}}}updatePlugins(e,t){if(!t||Mo(t)){this.plugins=[...this.plugins,...e];return}if(e.length!==t.length){this.plugins=[...this.plugins.filter(n=>!t.includes(n)),...e];return}const r=new Map;for(const[n,o]of e.entries())r.set(it(t,n),o);this.plugins=this.plugins.map(n=>t.includes(n)?r.get(n):n)}updateExtensionStore(){const{setExtensionStore:e}=this.store;e("updatePlugins",this.updatePlugins.bind(this)),e("dispatchPluginUpdate",this.dispatchPluginUpdate.bind(this)),e("updateExtensionPlugins",this.updateExtensionPlugins.bind(this))}updateExtensionPlugins(e){const t=ZC(e)?e:IL(e)?this.store.manager.getExtension(e):this.store.extensions.find(r=>r.name===e);re(t,{code:B.INVALID_MANAGER_EXTENSION,message:`The extension ${e} does not exist within the editor.`}),this.extractExtensionPlugins(t),this.store.setStoreKey("plugins",this.plugins),this.dispatchPluginUpdate()}dispatchPluginUpdate(){re(this.store.phase>=Nr.EditorView,{code:B.MANAGER_PHASE_ERROR,message:"`dispatchPluginUpdate` should only be called after the view has been added to the manager."});const{view:e,updateState:t}=this.store,r=e.state.reconfigure({plugins:this.plugins});t(r)}};Lp=Z([pe({defaultPriority:Ae.Highest,handlerKeys:["applyState","appendTransaction"]})],Lp);var Y1=class extends Ve{constructor(){super(...arguments),this.dynamicAttributes={marks:ee(),nodes:ee()}}get name(){return"schema"}onCreate(){const{managerSettings:e,tags:t,markNames:r,nodeNames:n,extensions:o}=this.store,{defaultBlockNode:i,disableExtraAttributes:s,nodeOverride:a,markOverride:l}=e,c=h=>!!(h&&t[te.Block].includes(h));if(e.schema){const{nodes:h,marks:m}=iI(e.schema);this.addSchema(e.schema,h,m);return}const u=c(i)?{doc:ee(),[i]:ee()}:ee(),d=ee(),f=QL({settings:e,gatheredSchemaAttributes:this.gatherExtraAttributes(o),nodeNames:n,markNames:r,tags:t});for(const h of o){f[h.name]={...f[h.name],...h.options.extraAttributes};const m=s===!0||h.options.disableExtraAttributes===!0||h.constructor.disableExtraAttributes===!0;if(Hd(h)){const{spec:b,dynamic:v}=g2({createExtensionSpec:(g,y)=>h.createNodeSpec(g,y),extraAttributes:it(f,h.name),override:{...a,...h.options.nodeOverride},ignoreExtraAttributes:m,name:h.constructorName,tags:h.tags});h.spec=b,u[h.name]=b,Object.keys(v).length>0&&(this.dynamicAttributes.nodes[h.name]=v)}if(Kh(h)){const{spec:b,dynamic:v}=g2({createExtensionSpec:(g,y)=>h.createMarkSpec(g,y),extraAttributes:it(f,h.name),override:{...l,...h.options.markOverride},ignoreExtraAttributes:m,name:h.constructorName,tags:h.tags??[]});h.spec=b,d[h.name]=b,Object.keys(v).length>0&&(this.dynamicAttributes.marks[h.name]=v)}}const p=new zA({nodes:u,marks:d,topNode:"doc"});this.addSchema(p,u,d)}createPlugin(){return{appendTransaction:(e,t,r)=>{const{tr:n}=r;return!e.some(i=>i.docChanged)||Object.keys(this.dynamicAttributes.nodes).length===0&&Object.keys(this.dynamicAttributes.marks).length===0?null:(n.doc.descendants((i,s)=>(this.checkAndUpdateDynamicNodes(i,s,n),this.checkAndUpdateDynamicMarks(i,s,n),!0)),n.steps.length>0?n:null)}}}addSchema(e,t,r){this.store.setStoreKey("nodes",t),this.store.setStoreKey("marks",r),this.store.setStoreKey("schema",e),this.store.setExtensionStore("schema",e),this.store.setStoreKey("defaultBlockNode",Bh(e).name);for(const n of Object.values(e.nodes))if(n.name!=="doc"&&(n.isBlock||n.isTextblock))break}checkAndUpdateDynamicNodes(e,t,r){for(const[n,o]of At(this.dynamicAttributes.nodes))if(e.type.name===n)for(const[i,s]of At(o)){if(!es(e.attrs[i]))continue;const a={...e.attrs,[i]:s(e)};r.setNodeMarkup(t,void 0,a),a2(r)}}checkAndUpdateDynamicMarks(e,t,r){for(const[n,o]of At(this.dynamicAttributes.marks)){const i=it(this.store.schema.marks,n),s=e.marks.find(a=>a.type.name===n);if(s)for(const[a,l]of At(o)){if(!es(s.attrs[a]))continue;const c=_o(r.doc.resolve(t),i);if(!c)continue;const{from:u,to:d}=c,f=i.create({...s.attrs,[a]:l(s)});r.removeMark(u,d,i).addMark(u,d,f),a2(r)}}}gatherExtraAttributes(e){const t=[];for(const r of e)r.createSchemaAttributes&&t.push(...r.createSchemaAttributes());return t}};Y1=Z([pe({defaultPriority:Ae.Highest})],Y1);function QL(e){const{settings:t,gatheredSchemaAttributes:r,nodeNames:n,markNames:o,tags:i}=e,s=ee();if(t.disableExtraAttributes)return s;const a=[...r,...t.extraAttributes??[]];for(const l of a??[]){const c=eI({identifiers:l.identifiers,nodeNames:n,markNames:o,tags:i});for(const u of c){const d=s[u]??{};s[u]={...d,...l.attributes}}}return s}function ZL(e){return ps(e)&&ct(e.tags)}function eI(e){const{identifiers:t,nodeNames:r,markNames:n,tags:o}=e;if(t==="nodes")return r;if(t==="marks")return n;if(t==="all")return[...r,...n];if(ct(t))return t;re(ZL(t),{code:B.EXTENSION_EXTRA_ATTRIBUTES,message:"Invalid value passed as an identifier when creating `extraAttributes`."});const{tags:i=[],names:s=[],behavior:a="any",excludeNames:l,excludeTags:c,type:u}=t,d=new Set,f=u==="mark"?n:u==="node"?r:[...n,...r],p=m=>f.includes(m)&&!(l!=null&&l.includes(m));for(const m of s)p(m)&&d.add(m);const h=new Map;for(const m of i)if(!(c!=null&&c.includes(m)))for(const b of o[m]){if(!p(b))continue;if(a==="any"){d.add(b);continue}const v=h.get(b)??new Set;v.add(m),h.set(b,v)}for(const[m,b]of h)b.size===i.length&&d.add(m);return[...d]}function g2(e){var t;const{createExtensionSpec:r,extraAttributes:n,ignoreExtraAttributes:o,name:i,tags:s,override:a}=e,l=ee();function c(b,v){l[b]=v}let u=!1;function d(){u=!0}const f=tI(n,o,d,c),p=rI(n,o),h=nI(n,o),m=r({defaults:f,parse:p,dom:h},a);return re(o||u,{code:B.EXTENSION_SPEC,message:`When creating a node specification you must call the 'defaults', and parse, and 'dom' methods. To avoid this error you can set the static property 'disableExtraAttributes' of '${i}' to 'true'.`}),m.group=[...((t=m.group)==null?void 0:t.split(" "))??[],...s].join(" ")||void 0,{spec:m,dynamic:l}}function Qv(e){return oe(e)||_e(e)?{default:e}:(re(e,{message:`${K4(e)} is not supported`,code:B.EXTENSION_EXTRA_ATTRIBUTES}),e)}function tI(e,t,r,n){return()=>{r();const o=ee();if(t)return o;for(const[i,s]of At(e)){let l=Qv(s).default;_e(l)&&(n(i,l),l=null),o[i]=l===void 0?{}:{default:l}}return o}}function rI(e,t){return r=>{const n=ee();if(t)return n;for(const[o,i]of At(e)){const{parseDOM:s,...a}=Qv(i);if(et(r)){if(es(s)){n[o]=r.getAttribute(o)??a.default;continue}if(_e(s)){n[o]=s(r)??a.default;continue}n[o]=r.getAttribute(s)??a.default}}return n}}function nI(e,t){return r=>{const n=ee();if(t)return n;function o(i,s){if(i){if(oe(i)){n[s]=i;return}if(ct(i)){const[a,l]=i;n[a]=l??r.attrs[s];return}for(const[a,l]of At(i))n[a]=l}}for(const[i,s]of At(e)){const{toDOM:a,parseDOM:l}=Qv(s);if(es(a)){const c=oe(l)?l:i;n[c]=r.attrs[i];continue}if(_e(a)){o(a(r.attrs,oI(r)),i);continue}o(a,i)}return n}}function oI(e){return Id(e)?{node:e}:hz(e)?{mark:e}:{}}function iI(e){const t=ee(),r=ee();for(const[n,o]of Object.entries(e.nodes))t[n]=o.spec;for(const[n,o]of Object.entries(e.marks))r[n]=o.spec;return{nodes:t,marks:r}}var Ll=class extends Ve{constructor(){super(...arguments),this.onAddCustomHandler=({suggester:e})=>{var t;if(!(!e||(t=this.store.managerSettings.exclude)!=null&&t.suggesters))return s2(this.store.getState(),e)}}get name(){return"suggest"}onCreate(){this.store.setExtensionStore("addSuggester",e=>s2(this.store.getState(),e)),this.store.setExtensionStore("removeSuggester",e=>q6(this.store.getState(),e))}createExternalPlugins(){var e,t;const r=[];for(const n of this.store.extensions){if((e=this.store.managerSettings.exclude)!=null&&e.suggesters)break;if(!n.createSuggesters||(t=n.options.exclude)!=null&&t.suggesters)continue;const o=n.createSuggesters(),i=ct(o)?o:[o];r.push(...i)}return[G6(...r)]}getSuggestState(e){return Vv(e??this.store.getState())}getSuggestMethods(){const{addIgnored:e,clearIgnored:t,removeIgnored:r,ignoreNextExit:n,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}=this.getSuggestState();return{addIgnored:e,clearIgnored:t,removeIgnored:r,ignoreNextExit:n,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}}isSuggesterActive(e){var t;return fr(ct(e)?e:[e],(t=this.getSuggestState().match)==null?void 0:t.suggester.name)}};Z([He()],Ll.prototype,"getSuggestState",1);Z([He()],Ll.prototype,"getSuggestMethods",1);Z([He()],Ll.prototype,"isSuggesterActive",1);Ll=Z([pe({customHandlerKeys:["suggester"]})],Ll);var J1=class extends Ve{constructor(){super(...arguments),this.allTags=ee(),this.plainTags=ee(),this.markTags=ee(),this.nodeTags=ee()}get name(){return"tags"}onCreate(){this.resetTags();for(const e of this.store.extensions)this.updateTagForExtension(e);this.store.setStoreKey("tags",this.allTags),this.store.setExtensionStore("tags",this.allTags),this.store.setStoreKey("plainTags",this.plainTags),this.store.setExtensionStore("plainTags",this.plainTags),this.store.setStoreKey("markTags",this.markTags),this.store.setExtensionStore("markTags",this.markTags),this.store.setStoreKey("nodeTags",this.nodeTags),this.store.setExtensionStore("nodeTags",this.nodeTags)}resetTags(){const e=ee(),t=ee(),r=ee(),n=ee();for(const o of Nh(te))e[o]=[],t[o]=[],r[o]=[],n[o]=[];this.allTags=e,this.plainTags=t,this.markTags=r,this.nodeTags=n}updateTagForExtension(e){var t,r;const n=new Set([...e.tags??[],...((t=e.createTags)==null?void 0:t.call(e))??[],...e.options.extraTags??[],...((r=this.store.managerSettings.extraTags)==null?void 0:r[e.name])??[]]);for(const o of n)re(sI(o),{code:B.EXTENSION,message:`The tag provided by the extension: ${e.constructorName} is not supported by the editor. To add custom tags you can use the 'mutateTag' method.`}),this.allTags[o].push(e.name),e5(e)&&this.plainTags[o].push(e.name),Kh(e)&&this.markTags[o].push(e.name),Hd(e)&&this.nodeTags[o].push(e.name);e.tags=[...n]}};J1=Z([pe({defaultPriority:Ae.Highest})],J1);function sI(e){return fr(Nh(te),e)}var aI=new ka("remirrorFilePlaceholderPlugin");function lI(){const e=new Ro({key:aI,state:{init(){return{set:Ee.empty,payloads:new Map}},apply(t,{set:r,payloads:n}){r=r.map(t.mapping,t.doc);const o=t.getMeta(e);if(o)if(o.type===0){const i=document.createElement("placeholder"),s=Ge.widget(o.pos,i,{id:o.id});r=r.add(t.doc,[s]),n.set(o.id,o.payload)}else o.type===1&&(r=r.remove(r.find(void 0,void 0,i=>i.id===o.id)),n.delete(o.id));return{set:r,payloads:n}}},props:{decorations(t){var r;return((r=e.getState(t))==null?void 0:r.set)??null}}});return e}var cI=class extends Ve{get name(){return"upload"}createExternalPlugins(){return[lI()]}};function uI(e={}){e={...{exitMarksOnArrowPress:Qn.defaultOptions.exitMarksOnArrowPress,excludeBaseKeymap:Qn.defaultOptions.excludeBaseKeymap,selectParentNodeOnEscape:Qn.defaultOptions.selectParentNodeOnEscape,undoInputRuleOnBackspace:Qn.defaultOptions.undoInputRuleOnBackspace,persistentSelectionClass:io.defaultOptions.persistentSelectionClass},...e};const r=S1(e,["excludeBaseKeymap","selectParentNodeOnEscape","undoInputRuleOnBackspace"]),n=S1(e,["persistentSelectionClass"]);return[new J1,new Y1,new DL,new Lp,new q1,new XL,new JL,new Ll,new xe,new Rn,new Qn(r),new K1,new cI,new io(n)]}var v2=class extends Ve{get name(){return"meta"}onCreate(){if(this.store.setStoreKey("getCommandMeta",this.getCommandMeta.bind(this)),!!this.options.capture)for(const e of this.store.extensions)this.captureCommands(e),this.captureKeybindings(e)}createPlugin(){return{}}captureCommands(e){const t=e.decoratedCommands??{},r=e.createCommands;for(const n of Object.keys(t)){const o=e[n];e[n]=(...i)=>s=>{var a;const l=o(...i)(s);return s.dispatch&&l&&this.setCommandMeta(s.tr,{type:"command",chain:s.dispatch!==((a=s.view)==null?void 0:a.dispatch),name:n,extension:e.name,decorated:!0}),l}}r&&(e.createCommands=()=>{const n=r();for(const[o,i]of Object.entries(n))n[o]=(...s)=>a=>{var l;const c=i(...s)(a);return a.dispatch&&c&&this.setCommandMeta(a.tr,{type:"command",chain:a.dispatch!==((l=a.view)==null?void 0:l.dispatch),name:o,extension:e.name,decorated:!1}),c};return n})}captureKeybindings(e){}getCommandMeta(e){return e.getMeta(this.pluginKey)??[]}setCommandMeta(e,t){const r=this.getCommandMeta(e);e.setMeta(this.pluginKey,[...r,t])}};v2=Z([pe({defaultOptions:{capture:on.isDevelopment},staticKeys:["capture"],defaultPriority:Ae.Highest})],v2);var Ff,$c,Vf,Wa,Ci,jf,Uf,dI=class{constructor(e){kt(this,Ff,Cl()),kt(this,$c,void 0),kt(this,Vf,void 0),kt(this,Wa,!0),kt(this,Ci,Uh()),kt(this,jf,void 0),kt(this,Uf,void 0),this.getState=()=>this.view.state??this.initialEditorState,this.getPreviousState=()=>this.previousState,this.dispatchTransaction=i=>{var s,a;re(!this.manager.destroyed,{code:B.MANAGER_PHASE_ERROR,message:"A transaction was dispatched to a manager that has already been destroyed. Please check your set up, or open an issue."}),i=((a=(s=this.props).onDispatchTransaction)==null?void 0:a.call(s,i,this.getState()))??i;const l=this.getState(),{state:c,transactions:u}=l.applyTransaction(i);Lt(this,Vf,l),this.updateState({state:c,tr:i,transactions:u});const d=this.manager.store.getForcedUpdates(i);Mo(d)||this.updateViewProps(...d)},this.onChange=(i=ee())=>{var s,a;const l=this.eventListenerProps(i);G(this,Wa)&&Lt(this,Wa,!1),(a=(s=this.props).onChange)==null||a.call(s,l)},this.onBlur=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onBlur)==null||a.call(s,l,i),G(this,Ci).emit("blur",l,i)},this.onFocus=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onFocus)==null||a.call(s,l,i),G(this,Ci).emit("focus",l,i)},this.setContent=(i,{triggerChange:s=!1}={})=>{const{doc:a}=this.manager.createState({content:i}),l=this.getState(),{state:c}=this.getState().applyTransaction(l.tr.replaceRangeWith(0,l.doc.nodeSize-2,a));if(s)return this.updateState({state:c,triggerChange:s});this.view.updateState(c)},this.clearContent=({triggerChange:i=!1}={})=>{this.setContent(this.manager.createEmptyDoc(),{triggerChange:i})},this.createStateFromContent=(i,s)=>this.manager.createState({content:i,selection:s}),this.focus=i=>{this.manager.store.commands.focus(i)},this.blur=i=>{this.manager.store.commands.blur(i)};const{getProps:t,initialEditorState:r,element:n}=e;if(Lt(this,$c,t),Lt(this,Uf,r),this.manager.attachFramework(this,this.updateListener.bind(this)),this.manager.view)return;const o=this.createView(r,n);this.manager.addView(o)}get addHandler(){return G(this,jf)??Lt(this,jf,G(this,Ci).on.bind(G(this,Ci)))}get updatableViewProps(){return{attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0}}get firstRender(){return G(this,Wa)}get props(){return G(this,$c).call(this)}get previousState(){return this.previousStateOverride??G(this,Vf)??this.initialEditorState}get manager(){return this.props.manager}get view(){return this.manager.view}get uid(){return G(this,Ff)}get initialEditorState(){return G(this,Uf)}updateListener(e){const{state:t,tr:r}=e;return G(this,Ci).emit("updated",this.eventListenerProps({state:t,tr:r}))}update(e){const{getProps:t}=e;return Lt(this,$c,t),this}updateViewProps(...e){const t=S1(this.updatableViewProps,e);this.view.setProps({...this.view.props,...t})}getAttributes(e){var t;const{attributes:r,autoFocus:n,classNames:o=[],label:i,editable:s}=this.props,a=(t=this.manager.store)==null?void 0:t.attributes,l=_e(r)?r(this.eventListenerProps()):r;let c={};(n||Jt(n))&&(c=e?{autoFocus:!0}:{autofocus:"true"});const u=Ml(ju(e&&"Prosemirror","remirror-editor",a==null?void 0:a.class,...o).split(" ")).join(" "),d={role:"textbox",...c,"aria-multiline":"true",...s??!0?{}:{"aria-readonly":"true"},"aria-label":i??"",...a,class:u};return G4({...d,...l})}addFocusListeners(){this.view.dom.addEventListener("blur",this.onBlur),this.view.dom.addEventListener("focus",this.onFocus)}removeFocusListeners(){this.view.dom.removeEventListener("blur",this.onBlur),this.view.dom.removeEventListener("focus",this.onFocus)}destroy(){G(this,Ci).emit("destroy"),this.view&&this.removeFocusListeners()}eventListenerProps(e=ee()){const{state:t,tr:r,transactions:n}=e;return{tr:r,transactions:n,internalUpdate:!r,view:this.view,firstRender:G(this,Wa),state:t??this.getState(),createStateFromContent:this.createStateFromContent,previousState:this.previousState,helpers:this.manager.store.helpers}}get baseOutput(){return{manager:this.manager,...this.manager.store,addHandler:this.addHandler,focus:this.focus,blur:this.blur,uid:G(this,Ff),view:this.view,getState:this.getState,getPreviousState:this.getPreviousState,getExtension:this.manager.getExtension.bind(this.manager),hasExtension:this.manager.hasExtension.bind(this.manager),clearContent:this.clearContent,setContent:this.setContent}}};Ff=new WeakMap;$c=new WeakMap;Vf=new WeakMap;Wa=new WeakMap;Ci=new WeakMap;jf=new WeakMap;Uf=new WeakMap;function fI(e,t){const r=[],n=new WeakMap,o=[],i=new WeakMap;let s=[];const a={duplicateMap:i,parentExtensions:o,gatheredExtensions:s,settings:t};for(const d of e)r5(a,{extension:d});s=ta(s,(d,f)=>f.priority-d.priority);const l=new WeakSet,c=new Set;for(const d of s){const f=d.constructor,p=d.name,h=i.get(f);re(h,{message:`No entries were found for the ExtensionConstructor ${d.name}`,code:B.INTERNAL}),!(l.has(f)||c.has(p))&&(l.add(f),c.add(p),r.push(d),n.set(f,d),h.forEach(m=>m==null?void 0:m.replaceChildExtension(f,d)))}const u=[];for(const d of r)pI({extension:d,found:l,missing:u});return re(Mo(u),{code:B.MISSING_REQUIRED_EXTENSION,message:u.map(({Constructor:d,extension:f})=>`The extension '${f.name}' requires '${d.name} in order to run correctly.`).join(` +`)}),{extensions:r,extensionMap:n}}function r5(e,t){var r;const{gatheredExtensions:n,duplicateMap:o,parentExtensions:i,settings:s}=e,{extension:a,parentExtension:l}=t;let{names:c=[]}=t;re(ZC(a),{code:B.INVALID_MANAGER_EXTENSION,message:`An invalid extension: ${a} was provided to the [[\`RemirrorManager\`]].`});const u=a.extensions;if(a.setPriority((r=s.priority)==null?void 0:r[a.name]),n.push(a),hI({duplicateMap:o,extension:a,parentExtension:l}),u.length!==0){if(c.includes(a.name)){`${c.join(" > ")}${a.name}`;return}c=[...c,a.name],i.push(a);for(const d of u)r5(e,{names:c,extension:d,parentExtension:a})}}function pI(e){const{extension:t,found:r,missing:n}=e;if(t.requiredExtensions)for(const o of t.requiredExtensions??[])r.has(o)||n.push({Constructor:o,extension:t})}function hI(e){const{duplicateMap:t,extension:r,parentExtension:n}=e,o=r.constructor,i=t.get(o),s=n?[n]:[];t.set(o,i?[...i,...s]:s)}function mI(e){var t,r,n,o;const{extension:i,nodeNames:s,markNames:a,plainNames:l,store:c,handlers:u}=e;i.setStore(c);const d=(t=i.onCreate)==null?void 0:t.bind(i),f=(r=i.onView)==null?void 0:r.bind(i),p=(n=i.onStateUpdate)==null?void 0:n.bind(i),h=(o=i.onDestroy)==null?void 0:o.bind(i);d&&u.create.push(d),f&&u.view.push(f),p&&u.update.push(p),h&&u.destroy.push(h),Kh(i)&&a.push(i.name),Hd(i)&&i.name!=="doc"&&s.push(i.name),e5(i)&&l.push(i.name)}var Mi,Hc,Wn,$o,Bc,Zr,Es,Fc,Cs,Vc,Ms,Kn,jc,Wf=class{constructor(e,t={}){kt(this,Mi,void 0),kt(this,Hc,ee()),kt(this,Wn,ee()),kt(this,$o,void 0),kt(this,Bc,void 0),kt(this,Zr,Nr.None),kt(this,Es,void 0),kt(this,Fc,!0),kt(this,Cs,{create:[],view:[],update:[],destroy:[]}),kt(this,Vc,[]),kt(this,Ms,Uh()),kt(this,Kn,void 0),kt(this,jc,void 0),this.getState=()=>{var o;return G(this,Zr)>=Nr.EditorView?this.view.state:(re(G(this,Kn),{code:B.MANAGER_PHASE_ERROR,message:"`getState` can only be called after the `Framework` or the `EditorView` has been added to the manager`. Check your plugins to make sure that the decorations callback uses the state argument."}),(o=G(this,Kn))==null?void 0:o.initialEditorState)},this.updateState=o=>{const i=this.getState();this.view.updateState(o),this.onStateUpdate({previousState:i,state:o})};const{extensions:r,extensionMap:n}=fI(e,t);Lt(this,Es,t),Lt(this,$o,$s(r)),Lt(this,Bc,n),Lt(this,Mi,this.createExtensionStore()),Lt(this,Zr,Nr.Create),this.setupLifecycleHandlers();for(const o of G(this,Cs).create){const i=o();i&&G(this,Vc).push(i)}}static create(e,t={}){return new Wf([...tE(e),...uI(t.builtin)],t)}get[ti](){return $t.Manager}get destroyed(){return G(this,Zr)===Nr.Destroy}get mounted(){return G(this,Zr)>=Nr.EditorView&&G(this,Zr)G(this,$o),enumerable:t},phase:{get:()=>G(this,Zr),enumerable:t},view:{get:()=>this.view,enumerable:t},managerSettings:{get:()=>$s(G(this,Es)),enumerable:t},getState:{value:this.getState,enumerable:t},updateState:{value:this.updateState,enumerable:t},isMounted:{value:()=>this.mounted,enumerable:t},getExtension:{value:this.getExtension.bind(this),enumerable:t},manager:{get:()=>this,enumerable:t},document:{get:()=>this.document,enumerable:t},stringHandlers:{get:()=>G(this,Hc),enumerable:t},currentState:{get:()=>r??(r=this.getState()),set:o=>{r=o},enumerable:t},previousState:{get:()=>n,set:o=>{n=o},enumerable:t}}),e.getStoreKey=this.getStoreKey.bind(this),e.setStoreKey=this.setStoreKey.bind(this),e.setExtensionStore=this.setExtensionStore.bind(this),e.setStringHandler=this.setStringHandler.bind(this),e}addView(e){if(G(this,Zr)>=Nr.EditorView)return this;Lt(this,Fc,!0),Lt(this,Zr,Nr.EditorView),G(this,Wn).view=e;for(const t of G(this,Cs).view){const r=t(e);r&&G(this,Vc).push(r)}return this}attachFramework(e,t){var r;G(this,Kn)!==e&&(G(this,Kn)&&(G(this,Kn).destroy(),(r=G(this,jc))==null||r.call(this)),Lt(this,Kn,e),Lt(this,jc,this.addHandler("stateUpdate",t)))}createEmptyDoc(){var e;const t=(e=this.schema.nodes.doc)==null?void 0:e.createAndFill();return re(t,{code:B.INVALID_CONTENT,message:"An empty node could not be created due to an invalid schema."}),t}createState(e={}){const{onError:t,defaultSelection:r="end"}=this.settings,{content:n=this.createEmptyDoc(),selection:o=r,stringHandler:i=this.settings.stringHandler}=e,{schema:s,plugins:a}=this.store,l=NC({stringHandler:oe(i)?this.stringHandlers[i]:i,document:this.document,content:n,onError:t,schema:s,selection:o});return Hs.create({schema:s,doc:l,plugins:a,selection:jr(o,l)})}addHandler(e,t){return G(this,Ms).on(e,t)}onStateUpdate(e){const t=G(this,Fc);G(this,Mi).currentState=e.state,G(this,Mi).previousState=e.previousState,t&&(Lt(this,Zr,Nr.Runtime),Lt(this,Fc,!1));const r={...e,firstUpdate:t};for(const n of G(this,Cs).update)n(r);G(this,Ms).emit("stateUpdate",r)}getExtension(e){const t=G(this,Bc).get(e);return re(t,{code:B.INVALID_MANAGER_EXTENSION,message:`'${e.name}' doesn't exist within this manager. Make sure it is properly added before attempting to use it.`}),t}hasExtension(e){return!!G(this,Bc).get(e)}clone(){const e=G(this,$o).map(r=>r.clone(r.options)),t=Wf.create(()=>e,G(this,Es));return G(this,Ms).emit("clone",t),t}recreate(e=[],t={}){const r=G(this,$o).map(o=>o.clone(o.initialOptions)),n=Wf.create(()=>[...r,...e],t);return G(this,Ms).emit("recreate",n),n}destroy(){var e,t,r,n,o,i;Lt(this,Zr,Nr.Destroy);for(const s of((e=this.view)==null?void 0:e.state.plugins)??[])(r=(t=s.getState(this.view.state))==null?void 0:t.destroy)==null||r.call(t);(n=G(this,Kn))==null||n.destroy(),(o=G(this,jc))==null||o.call(this);for(const s of G(this,Vc))s();for(const s of G(this,Cs).destroy)s();(i=this.view)==null||i.destroy(),G(this,Ms).emit("destroy")}includes(e){const t=[],r=[];for(const n of G(this,$o))t.push(n.name,n.constructorName),r.push(n.constructor);return e.every(n=>oe(n)?fr(t,n):fr(r,n))}},gI=Wf;Mi=new WeakMap;Hc=new WeakMap;Wn=new WeakMap;$o=new WeakMap;Bc=new WeakMap;Zr=new WeakMap;Es=new WeakMap;Fc=new WeakMap;Cs=new WeakMap;Vc=new WeakMap;Ms=new WeakMap;Kn=new WeakMap;jc=new WeakMap;function vI(e,t){return!oc(e)||!ic(e,$t.Manager)?!1:t?e.includes(t):!0}var yI=Object.defineProperty,bI=Object.getOwnPropertyDescriptor,Bd=(e,t,r,n)=>{for(var o=n>1?void 0:n?bI(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&yI(t,r,o),o},n5=/\S+/g;function o5(e){return e.type.isTextblock?1:e.type.isText?e.textBetween(0,e.nodeSize).length:0}function xI({doc:e},t){let r=0,n=0;return e.nodesBetween(0,e.nodeSize-2,(o,i)=>{if(n>0)return!1;const s=o5(o);return r+s>t?(n=i+1+(t-r),!1):(r+=s,!0)}),n}function kI({doc:e},t){let r=0,n=0;return e.nodesBetween(0,e.nodeSize-2,(o,i)=>{if(n>0)return!1;if(!o.type.isText)return!0;const s=o.textBetween(0,o.nodeSize),a=xa(s,n5);if(r+a.length>t){const l=t-r,c=a[l];return n=i+((c==null?void 0:c.index)??0),!1}return r+=a.length,!0}),n}var ss=class extends Ve{get name(){return"count"}getCountMaximum(){return this.options.maximum}getCharacterCount(e=this.store.getState()){let t=0;return e.doc.nodesBetween(0,e.doc.nodeSize-2,r=>(t+=o5(r),!0)),Math.max(t-1,0)}getWordCount(e=this.store.getState()){const t=this.store.helpers.getText({lineBreakDivider:" ",state:e});return xa(t,n5).length}isCountValid(e=this.store.getState()){const{maximumStrategy:t,maximum:r}=this.options;return r<1?!0:t==="CHARACTERS"?this.store.helpers.getCharacterCount(e)<=r:this.store.helpers.getWordCount(e)<=r}createDecorationSet(e){const{maximum:t=-1,maximumStrategy:r,maximumExceededClassName:n}=this.options,s=(r==="CHARACTERS"?xI:kI)(e,t);return Ee.create(e.doc,[Ge.inline(s,e.doc.nodeSize-2,{class:n})])}createExternalPlugins(){const{maximum:e}=this.options,t=new Ro({state:{init:(r,n)=>this.isCountValid(n)?{decorationSet:Ee.empty}:{decorationSet:this.createDecorationSet(n)},apply:(r,n,o,i)=>!r.docChanged||e<1?n:this.isCountValid(i)?{decorationSet:Ee.empty}:{decorationSet:this.createDecorationSet(i)}},props:{decorations(r){var n;return((n=t.getState(r))==null?void 0:n.decorationSet)??null}}});return[t]}};Bd([He()],ss.prototype,"getCountMaximum",1);Bd([He()],ss.prototype,"getCharacterCount",1);Bd([He()],ss.prototype,"getWordCount",1);Bd([He()],ss.prototype,"isCountValid",1);ss=Bd([pe({defaultOptions:{maximum:-1,maximumExceededClassName:"remirror-max-count-exceeded",maximumStrategy:"CHARACTERS"},staticKeys:["maximum","maximumStrategy","maximumExceededClassName"]})],ss);var i5={exports:{}},hn={},s5={exports:{}},a5={};/** * @license React * scheduler.production.min.js * @@ -80,7 +80,7 @@ If you are using Node.js, you can install JSDOM and Remirror will try to use it * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(A,P){var B=A.length;A.push(P);e:for(;0>>1,J=A[Y];if(0>>1;Yo(ue,B))deo(me,ue)?(A[Y]=me,A[de]=B,Y=de):(A[Y]=ue,A[ie]=B,Y=ie);else if(deo(me,B))A[Y]=me,A[de]=B,Y=de;else break e}}return P}function o(A,P){var B=A.sortIndex-P.sortIndex;return B!==0?B:A.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,d=null,f=3,p=!1,h=!1,m=!1,b=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(A){for(var P=r(c);P!==null;){if(P.callback===null)n(c);else if(P.startTime<=A)n(c),P.sortIndex=P.expirationTime,t(l,P);else break;P=r(c)}}function x(A){if(m=!1,y(A),!h)if(r(l)!==null)h=!0,z(k);else{var P=r(c);P!==null&&q(x,P.startTime-A)}}function k(A,P){h=!1,m&&(m=!1,v(T),T=-1),p=!0;var B=f;try{for(y(P),d=r(l);d!==null&&(!(d.expirationTime>P)||A&&!N());){var Y=d.callback;if(typeof Y=="function"){d.callback=null,f=d.priorityLevel;var J=Y(d.expirationTime<=P);P=e.unstable_now(),typeof J=="function"?d.callback=J:d===r(l)&&n(l),y(P)}else n(l);d=r(l)}if(d!==null)var Ne=!0;else{var ie=r(c);ie!==null&&q(x,ie.startTime-P),Ne=!1}return Ne}finally{d=null,f=B,p=!1}}var w=!1,E=null,T=-1,C=5,M=-1;function N(){return!(e.unstable_now()-MA||125Y?(A.sortIndex=B,t(c,A),r(l)===null&&A===r(c)&&(m?(v(T),T=-1):m=!0,q(x,B-Y))):(A.sortIndex=J,t(l,A),h||p||(h=!0,z(k))),A},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(A){var P=f;return function(){var B=f;f=P;try{return A.apply(this,arguments)}finally{f=B}}}})(s5);i5.exports=s5;var kI=i5.exports;/** + */(function(e){function t(A,P){var F=A.length;A.push(P);e:for(;0>>1,J=A[Y];if(0>>1;Yo(ue,F))deo(me,ue)?(A[Y]=me,A[de]=F,Y=de):(A[Y]=ue,A[ie]=F,Y=ie);else if(deo(me,F))A[Y]=me,A[de]=F,Y=de;else break e}}return P}function o(A,P){var F=A.sortIndex-P.sortIndex;return F!==0?F:A.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,d=null,f=3,p=!1,h=!1,m=!1,b=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(A){for(var P=r(c);P!==null;){if(P.callback===null)n(c);else if(P.startTime<=A)n(c),P.sortIndex=P.expirationTime,t(l,P);else break;P=r(c)}}function x(A){if(m=!1,y(A),!h)if(r(l)!==null)h=!0,L(k);else{var P=r(c);P!==null&&q(x,P.startTime-A)}}function k(A,P){h=!1,m&&(m=!1,v(M),M=-1),p=!0;var F=f;try{for(y(P),d=r(l);d!==null&&(!(d.expirationTime>P)||A&&!N());){var Y=d.callback;if(typeof Y=="function"){d.callback=null,f=d.priorityLevel;var J=Y(d.expirationTime<=P);P=e.unstable_now(),typeof J=="function"?d.callback=J:d===r(l)&&n(l),y(P)}else n(l);d=r(l)}if(d!==null)var Ne=!0;else{var ie=r(c);ie!==null&&q(x,ie.startTime-P),Ne=!1}return Ne}finally{d=null,f=F,p=!1}}var w=!1,E=null,M=-1,C=5,T=-1;function N(){return!(e.unstable_now()-TA||125Y?(A.sortIndex=F,t(c,A),r(l)===null&&A===r(c)&&(m?(v(M),M=-1):m=!0,q(x,F-Y))):(A.sortIndex=J,t(l,A),h||p||(h=!0,L(k))),A},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(A){var P=f;return function(){var F=f;f=P;try{return A.apply(this,arguments)}finally{f=F}}}})(a5);s5.exports=a5;var wI=s5.exports;/** * @license React * react-dom.production.min.js * @@ -88,16 +88,16 @@ If you are using Node.js, you can install JSDOM and Remirror will try to use it * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var a5=S,fn=kI;function $(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),J1=Object.prototype.hasOwnProperty,wI=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,v2={},y2={};function SI(e){return J1.call(y2,e)?!0:J1.call(v2,e)?!1:wI.test(e)?y2[e]=!0:(v2[e]=!0,!1)}function EI(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function CI(e,t,r,n){if(t===null||typeof t>"u"||EI(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Tr(e,t,r,n,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Qt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Qt[e]=new Tr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Qt[t]=new Tr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Qt[e]=new Tr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Qt[e]=new Tr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Qt[e]=new Tr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Qt[e]=new Tr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Qt[e]=new Tr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Qt[e]=new Tr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Qt[e]=new Tr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Qv=/[\-:]([a-z])/g;function Zv(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Qv,Zv);Qt[t]=new Tr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Qv,Zv);Qt[t]=new Tr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Qv,Zv);Qt[t]=new Tr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Qt[e]=new Tr(e,1,!1,e.toLowerCase(),null,!1,!1)});Qt.xlinkHref=new Tr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Qt[e]=new Tr(e,1,!1,e.toLowerCase(),null,!0,!0)});function ey(e,t,r,n){var o=Qt.hasOwnProperty(t)?Qt[t]:null;(o!==null?o.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),X1=Object.prototype.hasOwnProperty,SI=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,y2={},b2={};function EI(e){return X1.call(b2,e)?!0:X1.call(y2,e)?!1:SI.test(e)?b2[e]=!0:(y2[e]=!0,!1)}function CI(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function MI(e,t,r,n){if(t===null||typeof t>"u"||CI(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Tr(e,t,r,n,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Qt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Qt[e]=new Tr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Qt[t]=new Tr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Qt[e]=new Tr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Qt[e]=new Tr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Qt[e]=new Tr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Qt[e]=new Tr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Qt[e]=new Tr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Qt[e]=new Tr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Qt[e]=new Tr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Zv=/[\-:]([a-z])/g;function ey(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Zv,ey);Qt[t]=new Tr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Zv,ey);Qt[t]=new Tr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Zv,ey);Qt[t]=new Tr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Qt[e]=new Tr(e,1,!1,e.toLowerCase(),null,!1,!1)});Qt.xlinkHref=new Tr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Qt[e]=new Tr(e,1,!1,e.toLowerCase(),null,!0,!0)});function ty(e,t,r,n){var o=Qt.hasOwnProperty(t)?Qt[t]:null;(o!==null?o.type!==0:n||!(2a||o[s]!==i[a]){var l=` -`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Mg=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Uc(e):""}function MI(e){switch(e.tag){case 5:return Uc(e.type);case 16:return Uc("Lazy");case 13:return Uc("Suspense");case 19:return Uc("SuspenseList");case 0:case 2:case 15:return e=Tg(e.type,!1),e;case 11:return e=Tg(e.type.render,!1),e;case 1:return e=Tg(e.type,!0),e;default:return""}}function e0(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Za:return"Fragment";case Qa:return"Portal";case X1:return"Profiler";case ty:return"StrictMode";case Q1:return"Suspense";case Z1:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case u5:return(e.displayName||"Context")+".Consumer";case c5:return(e._context.displayName||"Context")+".Provider";case ry:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ny:return t=e.displayName||null,t!==null?t:e0(e.type)||"Memo";case Oi:t=e._payload,e=e._init;try{return e0(e(t))}catch{}}return null}function TI(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return e0(t);case 8:return t===ty?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ss(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function f5(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function OI(e){var t=f5(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){n=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function af(e){e._valueTracker||(e._valueTracker=OI(e))}function p5(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=f5(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Lp(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function t0(e,t){var r=t.checked;return ut({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function x2(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=ss(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function h5(e,t){t=t.checked,t!=null&&ey(e,"checked",t,!1)}function r0(e,t){h5(e,t);var r=ss(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?n0(e,t.type,r):t.hasOwnProperty("defaultValue")&&n0(e,t.type,ss(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function k2(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function n0(e,t,r){(t!=="number"||Lp(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Wc=Array.isArray;function ml(e,t,r,n){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=lf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Wu(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var xu={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},_I=["Webkit","ms","Moz","O"];Object.keys(xu).forEach(function(e){_I.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xu[t]=xu[e]})});function y5(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||xu.hasOwnProperty(e)&&xu[e]?(""+t).trim():t+"px"}function b5(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,o=y5(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}var AI=ut({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function s0(e,t){if(t){if(AI[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error($(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error($(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error($(61))}if(t.style!=null&&typeof t.style!="object")throw Error($(62))}}function a0(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var l0=null;function oy(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var c0=null,gl=null,vl=null;function E2(e){if(e=jd(e)){if(typeof c0!="function")throw Error($(280));var t=e.stateNode;t&&(t=Jh(t),c0(e.stateNode,e.type,t))}}function x5(e){gl?vl?vl.push(e):vl=[e]:gl=e}function k5(){if(gl){var e=gl,t=vl;if(vl=gl=null,E2(e),t)for(e=0;e>>=0,e===0?32:31-(FI(e)/VI|0)|0}var cf=64,uf=4194304;function Kc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Hp(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,o=e.suspendedLanes,i=e.pingedLanes,s=r&268435455;if(s!==0){var a=s&~o;a!==0?n=Kc(a):(i&=s,i!==0&&(n=Kc(i)))}else s=r&~o,s!==0?n=Kc(s):i!==0&&(n=Kc(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&o)&&(o=n&-n,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Fd(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-to(t),e[t]=r}function KI(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=wu),P2=String.fromCharCode(32),z2=!1;function F5(e,t){switch(e){case"keyup":return x8.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function V5(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var el=!1;function w8(e,t){switch(e){case"compositionend":return V5(t);case"keypress":return t.which!==32?null:(z2=!0,P2);case"textInput":return e=t.data,e===P2&&z2?null:e;default:return null}}function S8(e,t){if(el)return e==="compositionend"||!fy&&F5(e,t)?(e=H5(),qf=cy=Di=null,el=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=$2(r)}}function K5(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?K5(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function q5(){for(var e=window,t=Lp();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Lp(e.document)}return t}function py(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function R8(e){var t=q5(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&K5(r.ownerDocument.documentElement,r)){if(n!==null&&py(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=r.textContent.length,i=Math.min(n.start,o);n=n.end===void 0?i:Math.min(n.end,o),!e.extend&&i>n&&(o=n,n=i,i=o),o=H2(r,i);var s=H2(r,n);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,tl=null,m0=null,Eu=null,g0=!1;function B2(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;g0||tl==null||tl!==Lp(n)||(n=tl,"selectionStart"in n&&py(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Eu&&Xu(Eu,n)||(Eu=n,n=Vp(m0,"onSelect"),0ol||(e.current=w0[ol],w0[ol]=null,ol--)}function Ye(e,t){ol++,w0[ol]=e.current,e.current=t}var as={},pr=ys(as),Dr=ys(!1),aa=as;function Dl(e,t){var r=e.type.contextTypes;if(!r)return as;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in r)o[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function $r(e){return e=e.childContextTypes,e!=null}function Up(){tt(Dr),tt(pr)}function q2(e,t,r){if(pr.current!==as)throw Error($(168));Ye(pr,t),Ye(Dr,r)}function rM(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var o in n)if(!(o in t))throw Error($(108,TI(e)||"Unknown",o));return ut({},r,n)}function Wp(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||as,aa=pr.current,Ye(pr,e),Ye(Dr,Dr.current),!0}function G2(e,t,r){var n=e.stateNode;if(!n)throw Error($(169));r?(e=rM(e,t,aa),n.__reactInternalMemoizedMergedChildContext=e,tt(Dr),tt(pr),Ye(pr,e)):tt(Dr),Ye(Dr,r)}var Uo=null,Xh=!1,Fg=!1;function nM(e){Uo===null?Uo=[e]:Uo.push(e)}function U8(e){Xh=!0,nM(e)}function bs(){if(!Fg&&Uo!==null){Fg=!0;var e=0,t=$e;try{var r=Uo;for($e=1;e>=s,o-=s,qo=1<<32-to(t)+o|r<T?(C=E,E=null):C=E.sibling;var M=f(v,E,y[T],x);if(M===null){E===null&&(E=C);break}e&&E&&M.alternate===null&&t(v,E),g=i(M,g,T),w===null?k=M:w.sibling=M,w=M,E=C}if(T===y.length)return r(v,E),ot&&Os(v,T),k;if(E===null){for(;TT?(C=E,E=null):C=E.sibling;var N=f(v,E,M.value,x);if(N===null){E===null&&(E=C);break}e&&E&&N.alternate===null&&t(v,E),g=i(N,g,T),w===null?k=N:w.sibling=N,w=N,E=C}if(M.done)return r(v,E),ot&&Os(v,T),k;if(E===null){for(;!M.done;T++,M=y.next())M=d(v,M.value,x),M!==null&&(g=i(M,g,T),w===null?k=M:w.sibling=M,w=M);return ot&&Os(v,T),k}for(E=n(v,E);!M.done;T++,M=y.next())M=p(E,v,T,M.value,x),M!==null&&(e&&M.alternate!==null&&E.delete(M.key===null?T:M.key),g=i(M,g,T),w===null?k=M:w.sibling=M,w=M);return e&&E.forEach(function(F){return t(v,F)}),ot&&Os(v,T),k}function b(v,g,y,x){if(typeof y=="object"&&y!==null&&y.type===Za&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case sf:e:{for(var k=y.key,w=g;w!==null;){if(w.key===k){if(k=y.type,k===Za){if(w.tag===7){r(v,w.sibling),g=o(w,y.props.children),g.return=v,v=g;break e}}else if(w.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Oi&&tw(k)===w.type){r(v,w.sibling),g=o(w,y.props),g.ref=Ec(v,w,y),g.return=v,v=g;break e}r(v,w);break}else t(v,w);w=w.sibling}y.type===Za?(g=ea(y.props.children,v.mode,x,y.key),g.return=v,v=g):(x=tp(y.type,y.key,y.props,null,v.mode,x),x.ref=Ec(v,g,y),x.return=v,v=x)}return s(v);case Qa:e:{for(w=y.key;g!==null;){if(g.key===w)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){r(v,g.sibling),g=o(g,y.children||[]),g.return=v,v=g;break e}else{r(v,g);break}else t(v,g);g=g.sibling}g=Yg(y,v.mode,x),g.return=v,v=g}return s(v);case Oi:return w=y._init,b(v,g,w(y._payload),x)}if(Wc(y))return h(v,g,y,x);if(bc(y))return m(v,g,y,x);vf(v,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,g!==null&&g.tag===6?(r(v,g.sibling),g=o(g,y),g.return=v,v=g):(r(v,g),g=Gg(y,v.mode,x),g.return=v,v=g),s(v)):r(v,g)}return b}var Hl=dM(!0),fM=dM(!1),Ud={},wo=ys(Ud),td=ys(Ud),rd=ys(Ud);function Ws(e){if(e===Ud)throw Error($(174));return e}function wy(e,t){switch(Ye(rd,t),Ye(td,e),Ye(wo,Ud),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:i0(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=i0(t,e)}tt(wo),Ye(wo,t)}function Bl(){tt(wo),tt(td),tt(rd)}function pM(e){Ws(rd.current);var t=Ws(wo.current),r=i0(t,e.type);t!==r&&(Ye(td,e),Ye(wo,r))}function Sy(e){td.current===e&&(tt(wo),tt(td))}var at=ys(0);function Xp(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Vg=[];function Ey(){for(var e=0;er?r:4,e(!0);var n=jg.transition;jg.transition={};try{e(!1),t()}finally{$e=r,jg.transition=n}}function _M(){return zn().memoizedState}function G8(e,t,r){var n=Ji(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},AM(e))NM(t,r);else if(r=aM(e,t,r,n),r!==null){var o=wr();ro(r,e,n,o),RM(r,t,n)}}function Y8(e,t,r){var n=Ji(e),o={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(AM(e))NM(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,r);if(o.hasEagerState=!0,o.eagerState=a,so(a,s)){var l=t.interleaved;l===null?(o.next=o,xy(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}r=aM(e,t,o,n),r!==null&&(o=wr(),ro(r,e,n,o),RM(r,t,n))}}function AM(e){var t=e.alternate;return e===lt||t!==null&&t===lt}function NM(e,t){Cu=Qp=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function RM(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,sy(e,r)}}var Zp={readContext:Pn,useCallback:or,useContext:or,useEffect:or,useImperativeHandle:or,useInsertionEffect:or,useLayoutEffect:or,useMemo:or,useReducer:or,useRef:or,useState:or,useDebugValue:or,useDeferredValue:or,useTransition:or,useMutableSource:or,useSyncExternalStore:or,useId:or,unstable_isNewReconciler:!1},J8={readContext:Pn,useCallback:function(e,t){return ho().memoizedState=[e,t===void 0?null:t],e},useContext:Pn,useEffect:nw,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Xf(4194308,4,EM.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Xf(4194308,4,e,t)},useInsertionEffect:function(e,t){return Xf(4,2,e,t)},useMemo:function(e,t){var r=ho();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ho();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=G8.bind(null,lt,e),[n.memoizedState,e]},useRef:function(e){var t=ho();return e={current:e},t.memoizedState=e},useState:rw,useDebugValue:_y,useDeferredValue:function(e){return ho().memoizedState=e},useTransition:function(){var e=rw(!1),t=e[0];return e=q8.bind(null,e[1]),ho().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=lt,o=ho();if(ot){if(r===void 0)throw Error($(407));r=r()}else{if(r=t(),Ht===null)throw Error($(349));ca&30||gM(n,t,r)}o.memoizedState=r;var i={value:r,getSnapshot:t};return o.queue=i,nw(yM.bind(null,n,i,e),[e]),n.flags|=2048,id(9,vM.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=ho(),t=Ht.identifierPrefix;if(ot){var r=Go,n=qo;r=(n&~(1<<32-to(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=nd++,0")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Tg=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Uc(e):""}function TI(e){switch(e.tag){case 5:return Uc(e.type);case 16:return Uc("Lazy");case 13:return Uc("Suspense");case 19:return Uc("SuspenseList");case 0:case 2:case 15:return e=Og(e.type,!1),e;case 11:return e=Og(e.type.render,!1),e;case 1:return e=Og(e.type,!0),e;default:return""}}function t0(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Za:return"Fragment";case Qa:return"Portal";case Q1:return"Profiler";case ry:return"StrictMode";case Z1:return"Suspense";case e0:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case d5:return(e.displayName||"Context")+".Consumer";case u5:return(e._context.displayName||"Context")+".Provider";case ny:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case oy:return t=e.displayName||null,t!==null?t:t0(e.type)||"Memo";case _i:t=e._payload,e=e._init;try{return t0(e(t))}catch{}}return null}function OI(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return t0(t);case 8:return t===ry?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function as(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function p5(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _I(e){var t=p5(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){n=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function af(e){e._valueTracker||(e._valueTracker=_I(e))}function h5(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=p5(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Ip(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function r0(e,t){var r=t.checked;return ut({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function k2(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=as(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function m5(e,t){t=t.checked,t!=null&&ty(e,"checked",t,!1)}function n0(e,t){m5(e,t);var r=as(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?o0(e,t.type,r):t.hasOwnProperty("defaultValue")&&o0(e,t.type,as(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function w2(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function o0(e,t,r){(t!=="number"||Ip(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Wc=Array.isArray;function ml(e,t,r,n){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=lf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Wu(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var xu={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},AI=["Webkit","ms","Moz","O"];Object.keys(xu).forEach(function(e){AI.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xu[t]=xu[e]})});function b5(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||xu.hasOwnProperty(e)&&xu[e]?(""+t).trim():t+"px"}function x5(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,o=b5(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}var NI=ut({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function a0(e,t){if(t){if(NI[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function l0(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var c0=null;function iy(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var u0=null,gl=null,vl=null;function C2(e){if(e=jd(e)){if(typeof u0!="function")throw Error(H(280));var t=e.stateNode;t&&(t=Xh(t),u0(e.stateNode,e.type,t))}}function k5(e){gl?vl?vl.push(e):vl=[e]:gl=e}function w5(){if(gl){var e=gl,t=vl;if(vl=gl=null,C2(e),t)for(e=0;e>>=0,e===0?32:31-(VI(e)/jI|0)|0}var cf=64,uf=4194304;function Kc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Bp(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,o=e.suspendedLanes,i=e.pingedLanes,s=r&268435455;if(s!==0){var a=s&~o;a!==0?n=Kc(a):(i&=s,i!==0&&(n=Kc(i)))}else s=r&~o,s!==0?n=Kc(s):i!==0&&(n=Kc(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&o)&&(o=n&-n,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Fd(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-to(t),e[t]=r}function qI(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=wu),z2=String.fromCharCode(32),L2=!1;function V5(e,t){switch(e){case"keyup":return k8.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function j5(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var el=!1;function S8(e,t){switch(e){case"compositionend":return j5(t);case"keypress":return t.which!==32?null:(L2=!0,z2);case"textInput":return e=t.data,e===z2&&L2?null:e;default:return null}}function E8(e,t){if(el)return e==="compositionend"||!py&&V5(e,t)?(e=B5(),qf=uy=$i=null,el=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=H2(r)}}function q5(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?q5(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function G5(){for(var e=window,t=Ip();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Ip(e.document)}return t}function hy(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function P8(e){var t=G5(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&q5(r.ownerDocument.documentElement,r)){if(n!==null&&hy(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=r.textContent.length,i=Math.min(n.start,o);n=n.end===void 0?i:Math.min(n.end,o),!e.extend&&i>n&&(o=n,n=i,i=o),o=B2(r,i);var s=B2(r,n);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,tl=null,g0=null,Eu=null,v0=!1;function F2(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;v0||tl==null||tl!==Ip(n)||(n=tl,"selectionStart"in n&&hy(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Eu&&Xu(Eu,n)||(Eu=n,n=jp(g0,"onSelect"),0ol||(e.current=S0[ol],S0[ol]=null,ol--)}function Ye(e,t){ol++,S0[ol]=e.current,e.current=t}var ls={},pr=vs(ls),Dr=vs(!1),sa=ls;function Dl(e,t){var r=e.type.contextTypes;if(!r)return ls;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in r)o[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function $r(e){return e=e.childContextTypes,e!=null}function Wp(){tt(Dr),tt(pr)}function G2(e,t,r){if(pr.current!==ls)throw Error(H(168));Ye(pr,t),Ye(Dr,r)}function nM(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var o in n)if(!(o in t))throw Error(H(108,OI(e)||"Unknown",o));return ut({},r,n)}function Kp(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ls,sa=pr.current,Ye(pr,e),Ye(Dr,Dr.current),!0}function Y2(e,t,r){var n=e.stateNode;if(!n)throw Error(H(169));r?(e=nM(e,t,sa),n.__reactInternalMemoizedMergedChildContext=e,tt(Dr),tt(pr),Ye(pr,e)):tt(Dr),Ye(Dr,r)}var Uo=null,Qh=!1,Vg=!1;function oM(e){Uo===null?Uo=[e]:Uo.push(e)}function W8(e){Qh=!0,oM(e)}function ys(){if(!Vg&&Uo!==null){Vg=!0;var e=0,t=$e;try{var r=Uo;for($e=1;e>=s,o-=s,qo=1<<32-to(t)+o|r<M?(C=E,E=null):C=E.sibling;var T=f(v,E,y[M],x);if(T===null){E===null&&(E=C);break}e&&E&&T.alternate===null&&t(v,E),g=i(T,g,M),w===null?k=T:w.sibling=T,w=T,E=C}if(M===y.length)return r(v,E),ot&&Ts(v,M),k;if(E===null){for(;MM?(C=E,E=null):C=E.sibling;var N=f(v,E,T.value,x);if(N===null){E===null&&(E=C);break}e&&E&&N.alternate===null&&t(v,E),g=i(N,g,M),w===null?k=N:w.sibling=N,w=N,E=C}if(T.done)return r(v,E),ot&&Ts(v,M),k;if(E===null){for(;!T.done;M++,T=y.next())T=d(v,T.value,x),T!==null&&(g=i(T,g,M),w===null?k=T:w.sibling=T,w=T);return ot&&Ts(v,M),k}for(E=n(v,E);!T.done;M++,T=y.next())T=p(E,v,M,T.value,x),T!==null&&(e&&T.alternate!==null&&E.delete(T.key===null?M:T.key),g=i(T,g,M),w===null?k=T:w.sibling=T,w=T);return e&&E.forEach(function(z){return t(v,z)}),ot&&Ts(v,M),k}function b(v,g,y,x){if(typeof y=="object"&&y!==null&&y.type===Za&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case sf:e:{for(var k=y.key,w=g;w!==null;){if(w.key===k){if(k=y.type,k===Za){if(w.tag===7){r(v,w.sibling),g=o(w,y.props.children),g.return=v,v=g;break e}}else if(w.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===_i&&rw(k)===w.type){r(v,w.sibling),g=o(w,y.props),g.ref=Ec(v,w,y),g.return=v,v=g;break e}r(v,w);break}else t(v,w);w=w.sibling}y.type===Za?(g=Zs(y.props.children,v.mode,x,y.key),g.return=v,v=g):(x=tp(y.type,y.key,y.props,null,v.mode,x),x.ref=Ec(v,g,y),x.return=v,v=x)}return s(v);case Qa:e:{for(w=y.key;g!==null;){if(g.key===w)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){r(v,g.sibling),g=o(g,y.children||[]),g.return=v,v=g;break e}else{r(v,g);break}else t(v,g);g=g.sibling}g=Jg(y,v.mode,x),g.return=v,v=g}return s(v);case _i:return w=y._init,b(v,g,w(y._payload),x)}if(Wc(y))return h(v,g,y,x);if(bc(y))return m(v,g,y,x);vf(v,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,g!==null&&g.tag===6?(r(v,g.sibling),g=o(g,y),g.return=v,v=g):(r(v,g),g=Yg(y,v.mode,x),g.return=v,v=g),s(v)):r(v,g)}return b}var Hl=fM(!0),pM=fM(!1),Ud={},wo=vs(Ud),td=vs(Ud),rd=vs(Ud);function Us(e){if(e===Ud)throw Error(H(174));return e}function Sy(e,t){switch(Ye(rd,t),Ye(td,e),Ye(wo,Ud),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:s0(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=s0(t,e)}tt(wo),Ye(wo,t)}function Bl(){tt(wo),tt(td),tt(rd)}function hM(e){Us(rd.current);var t=Us(wo.current),r=s0(t,e.type);t!==r&&(Ye(td,e),Ye(wo,r))}function Ey(e){td.current===e&&(tt(wo),tt(td))}var at=vs(0);function Qp(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var jg=[];function Cy(){for(var e=0;er?r:4,e(!0);var n=Ug.transition;Ug.transition={};try{e(!1),t()}finally{$e=r,Ug.transition=n}}function AM(){return zn().memoizedState}function Y8(e,t,r){var n=Xi(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},NM(e))RM(t,r);else if(r=lM(e,t,r,n),r!==null){var o=wr();ro(r,e,n,o),PM(r,t,n)}}function J8(e,t,r){var n=Xi(e),o={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(NM(e))RM(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,r);if(o.hasEagerState=!0,o.eagerState=a,so(a,s)){var l=t.interleaved;l===null?(o.next=o,ky(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}r=lM(e,t,o,n),r!==null&&(o=wr(),ro(r,e,n,o),PM(r,t,n))}}function NM(e){var t=e.alternate;return e===lt||t!==null&&t===lt}function RM(e,t){Cu=Zp=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function PM(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,ay(e,r)}}var eh={readContext:Pn,useCallback:or,useContext:or,useEffect:or,useImperativeHandle:or,useInsertionEffect:or,useLayoutEffect:or,useMemo:or,useReducer:or,useRef:or,useState:or,useDebugValue:or,useDeferredValue:or,useTransition:or,useMutableSource:or,useSyncExternalStore:or,useId:or,unstable_isNewReconciler:!1},X8={readContext:Pn,useCallback:function(e,t){return ho().memoizedState=[e,t===void 0?null:t],e},useContext:Pn,useEffect:ow,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Xf(4194308,4,CM.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Xf(4194308,4,e,t)},useInsertionEffect:function(e,t){return Xf(4,2,e,t)},useMemo:function(e,t){var r=ho();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ho();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=Y8.bind(null,lt,e),[n.memoizedState,e]},useRef:function(e){var t=ho();return e={current:e},t.memoizedState=e},useState:nw,useDebugValue:Ay,useDeferredValue:function(e){return ho().memoizedState=e},useTransition:function(){var e=nw(!1),t=e[0];return e=G8.bind(null,e[1]),ho().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=lt,o=ho();if(ot){if(r===void 0)throw Error(H(407));r=r()}else{if(r=t(),Ht===null)throw Error(H(349));la&30||vM(n,t,r)}o.memoizedState=r;var i={value:r,getSnapshot:t};return o.queue=i,ow(bM.bind(null,n,i,e),[e]),n.flags|=2048,id(9,yM.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=ho(),t=Ht.identifierPrefix;if(ot){var r=Go,n=qo;r=(n&~(1<<32-to(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=nd++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=s.createElement(r,{is:n.is}):(e=s.createElement(r),r==="select"&&(s=e,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):e=s.createElementNS(e,r),e[bo]=t,e[ed]=n,FM(e,t,!1,!1),t.stateNode=e;e:{switch(s=a0(r,n),r){case"dialog":et("cancel",e),et("close",e),o=n;break;case"iframe":case"object":case"embed":et("load",e),o=n;break;case"video":case"audio":for(o=0;oVl&&(t.flags|=128,n=!0,Cc(i,!1),t.lanes=4194304)}else{if(!n)if(e=Xp(s),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Cc(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!ot)return ir(t),null}else 2*vt()-i.renderingStartTime>Vl&&r!==1073741824&&(t.flags|=128,n=!0,Cc(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(r=i.last,r!==null?r.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=vt(),t.sibling=null,r=at.current,Ye(at,n?r&1|2:r&1),t):(ir(t),null);case 22:case 23:return Ly(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?tn&1073741824&&(ir(t),t.subtreeFlags&6&&(t.flags|=8192)):ir(t),null;case 24:return null;case 25:return null}throw Error($(156,t.tag))}function o9(e,t){switch(my(t),t.tag){case 1:return $r(t.type)&&Up(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bl(),tt(Dr),tt(pr),Ey(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Sy(t),null;case 13:if(tt(at),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error($(340));$l()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return tt(at),null;case 4:return Bl(),null;case 10:return by(t.type._context),null;case 22:case 23:return Ly(),null;case 24:return null;default:return null}}var bf=!1,ur=!1,i9=typeof WeakSet=="function"?WeakSet:Set,X=null;function ll(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){mt(e,t,n)}else r.current=null}function z0(e,t,r){try{r()}catch(n){mt(e,t,n)}}var fw=!1;function s9(e,t){if(v0=Bp,e=q5(),py(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var o=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var p;d!==r||o!==0&&d.nodeType!==3||(a=s+o),d!==i||n!==0&&d.nodeType!==3||(l=s+n),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===r&&++c===o&&(a=s),f===i&&++u===n&&(l=s),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(y0={focusedElem:e,selectionRange:r},Bp=!1,X=t;X!==null;)if(t=X,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,X=e;else for(;X!==null;){t=X;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var m=h.memoizedProps,b=h.memoizedState,v=t.stateNode,g=v.getSnapshotBeforeUpdate(t.elementType===t.type?m:Gn(t.type,m),b);v.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error($(163))}}catch(x){mt(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,X=e;break}X=t.return}return h=fw,fw=!1,h}function Mu(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&z0(t,r,i)}o=o.next}while(o!==n)}}function em(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function L0(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function UM(e){var t=e.alternate;t!==null&&(e.alternate=null,UM(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[bo],delete t[ed],delete t[k0],delete t[V8],delete t[j8])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function WM(e){return e.tag===5||e.tag===3||e.tag===4}function pw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||WM(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function I0(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=jp));else if(n!==4&&(e=e.child,e!==null))for(I0(e,t,r),e=e.sibling;e!==null;)I0(e,t,r),e=e.sibling}function D0(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(D0(e,t,r),e=e.sibling;e!==null;)D0(e,t,r),e=e.sibling}var qt=null,Yn=!1;function vi(e,t,r){for(r=r.child;r!==null;)KM(e,t,r),r=r.sibling}function KM(e,t,r){if(ko&&typeof ko.onCommitFiberUnmount=="function")try{ko.onCommitFiberUnmount(Kh,r)}catch{}switch(r.tag){case 5:ur||ll(r,t);case 6:var n=qt,o=Yn;qt=null,vi(e,t,r),qt=n,Yn=o,qt!==null&&(Yn?(e=qt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):qt.removeChild(r.stateNode));break;case 18:qt!==null&&(Yn?(e=qt,r=r.stateNode,e.nodeType===8?Bg(e.parentNode,r):e.nodeType===1&&Bg(e,r),Yu(e)):Bg(qt,r.stateNode));break;case 4:n=qt,o=Yn,qt=r.stateNode.containerInfo,Yn=!0,vi(e,t,r),qt=n,Yn=o;break;case 0:case 11:case 14:case 15:if(!ur&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){o=n=n.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&z0(r,t,s),o=o.next}while(o!==n)}vi(e,t,r);break;case 1:if(!ur&&(ll(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){mt(r,t,a)}vi(e,t,r);break;case 21:vi(e,t,r);break;case 22:r.mode&1?(ur=(n=ur)||r.memoizedState!==null,vi(e,t,r),ur=n):vi(e,t,r);break;default:vi(e,t,r)}}function hw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new i9),t.forEach(function(n){var o=m9.bind(null,e,n);r.has(n)||(r.add(n),n.then(o,o))})}}function Un(e,t){var r=t.deletions;if(r!==null)for(var n=0;no&&(o=s),n&=~i}if(n=o,n=vt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*l9(n/1960))-n,10e?16:e,$i===null)var n=!1;else{if(e=$i,$i=null,rh=0,Oe&6)throw Error($(331));var o=Oe;for(Oe|=4,X=e.current;X!==null;){var i=X,s=i.child;if(X.flags&16){var a=i.deletions;if(a!==null){for(var l=0;lvt()-Py?Zs(e,0):Ry|=r),Hr(e,t)}function eT(e,t){t===0&&(e.mode&1?(t=uf,uf<<=1,!(uf&130023424)&&(uf=4194304)):t=1);var r=wr();e=oi(e,t),e!==null&&(Fd(e,t,r),Hr(e,r))}function h9(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),eT(e,r)}function m9(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:n=e.stateNode;break;default:throw Error($(314))}n!==null&&n.delete(t),eT(e,r)}var tT;tT=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Dr.current)zr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return zr=!1,r9(e,t,r);zr=!!(e.flags&131072)}else zr=!1,ot&&t.flags&1048576&&oM(t,qp,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Qf(e,t),e=t.pendingProps;var o=Dl(t,pr.current);bl(t,r),o=My(null,t,n,e,o,r);var i=Ty();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,$r(n)?(i=!0,Wp(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,ky(t),o.updater=Qh,t.stateNode=o,o._reactInternals=t,T0(t,n,e,r),t=A0(null,t,n,!0,i,r)):(t.tag=0,ot&&i&&hy(t),yr(null,t,o,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Qf(e,t),e=t.pendingProps,o=n._init,n=o(n._payload),t.type=n,o=t.tag=v9(n),e=Gn(n,e),o){case 0:t=_0(null,t,n,e,r);break e;case 1:t=cw(null,t,n,e,r);break e;case 11:t=aw(null,t,n,e,r);break e;case 14:t=lw(null,t,n,Gn(n.type,e),r);break e}throw Error($(306,n,""))}return t;case 0:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Gn(n,o),_0(e,t,n,o,r);case 1:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Gn(n,o),cw(e,t,n,o,r);case 3:e:{if($M(t),e===null)throw Error($(387));n=t.pendingProps,i=t.memoizedState,o=i.element,lM(e,t),Jp(t,n,null,r);var s=t.memoizedState;if(n=s.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Fl(Error($(423)),t),t=uw(e,t,n,r,o);break e}else if(n!==o){o=Fl(Error($(424)),t),t=uw(e,t,n,r,o);break e}else for(ln=qi(t.stateNode.containerInfo.firstChild),cn=t,ot=!0,Xn=null,r=fM(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if($l(),n===o){t=ii(e,t,r);break e}yr(e,t,n,r)}t=t.child}return t;case 5:return pM(t),e===null&&E0(t),n=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,b0(n,o)?s=null:i!==null&&b0(n,i)&&(t.flags|=32),DM(e,t),yr(e,t,s,r),t.child;case 6:return e===null&&E0(t),null;case 13:return HM(e,t,r);case 4:return wy(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Hl(t,null,n,r):yr(e,t,n,r),t.child;case 11:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Gn(n,o),aw(e,t,n,o,r);case 7:return yr(e,t,t.pendingProps,r),t.child;case 8:return yr(e,t,t.pendingProps.children,r),t.child;case 12:return yr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,Ye(Gp,n._currentValue),n._currentValue=s,i!==null)if(so(i.value,s)){if(i.children===o.children&&!Dr.current){t=ii(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=ei(-1,r&-r),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),C0(i.return,r,t),a.lanes|=r;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error($(341));s.lanes|=r,a=s.alternate,a!==null&&(a.lanes|=r),C0(s,r,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}yr(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,n=t.pendingProps.children,bl(t,r),o=Pn(o),n=n(o),t.flags|=1,yr(e,t,n,r),t.child;case 14:return n=t.type,o=Gn(n,t.pendingProps),o=Gn(n.type,o),lw(e,t,n,o,r);case 15:return LM(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Gn(n,o),Qf(e,t),t.tag=1,$r(n)?(e=!0,Wp(t)):e=!1,bl(t,r),uM(t,n,o),T0(t,n,o,r),A0(null,t,n,!0,e,r);case 19:return BM(e,t,r);case 22:return IM(e,t,r)}throw Error($(156,t.tag))};function rT(e,t){return O5(e,t)}function g9(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function On(e,t,r,n){return new g9(e,t,r,n)}function Dy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function v9(e){if(typeof e=="function")return Dy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ry)return 11;if(e===ny)return 14}return 2}function Xi(e,t){var r=e.alternate;return r===null?(r=On(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function tp(e,t,r,n,o,i){var s=2;if(n=e,typeof e=="function")Dy(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Za:return ea(r.children,o,i,t);case ty:s=8,o|=8;break;case X1:return e=On(12,r,t,o|2),e.elementType=X1,e.lanes=i,e;case Q1:return e=On(13,r,t,o),e.elementType=Q1,e.lanes=i,e;case Z1:return e=On(19,r,t,o),e.elementType=Z1,e.lanes=i,e;case d5:return rm(r,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case c5:s=10;break e;case u5:s=9;break e;case ry:s=11;break e;case ny:s=14;break e;case Oi:s=16,n=null;break e}throw Error($(130,e==null?e:typeof e,""))}return t=On(s,r,t,o),t.elementType=e,t.type=n,t.lanes=i,t}function ea(e,t,r,n){return e=On(7,e,n,t),e.lanes=r,e}function rm(e,t,r,n){return e=On(22,e,n,t),e.elementType=d5,e.lanes=r,e.stateNode={isHidden:!1},e}function Gg(e,t,r){return e=On(6,e,null,t),e.lanes=r,e}function Yg(e,t,r){return t=On(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function y9(e,t,r,n,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=_g(0),this.expirationTimes=_g(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_g(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function $y(e,t,r,n,o,i,s,a,l){return e=new y9(e,t,r,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=On(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},ky(i),e}function b9(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(sT)}catch(e){console.error(e)}}sT(),o5.exports=hn;var am=o5.exports;const wf=Dn(am);var E9=Object.defineProperty,C9=Object.getOwnPropertyDescriptor,M9=(e,t,r,n)=>{for(var o=n>1?void 0:n?C9(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&E9(t,r,o),o},aT=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},re=(e,t,r)=>(aT(e,t,"read from private field"),r?r.call(e):t.get(e)),en=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Qr=(e,t,r,n)=>(aT(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Gc,T9=class{constructor(){this.portals=new Map,en(this,Gc,jh()),this.on=e=>re(this,Gc).on("update",e),this.once=e=>{const t=re(this,Gc).on("update",r=>{t(),e(r)});return t}}update(){re(this,Gc).emit("update",this.portals)}render({Component:e,container:t}){const r=this.portals.get(t);this.portals.set(t,{Component:e,key:(r==null?void 0:r.key)??Cl()}),this.update()}forceUpdate(){for(const[e,{Component:t}]of this.portals)this.portals.set(e,{Component:t,key:Cl()})}remove(e){this.portals.delete(e),this.update()}};Gc=new WeakMap;var O9=e=>{const{portals:t}=e;return L.createElement(L.Fragment,null,t.map(([r,{Component:n,key:o}])=>am.createPortal(L.createElement(n,null),r,o)))};function _9(e){const[t,r]=S.useState(()=>Array.from(e.portals.entries()));return S.useEffect(()=>e.on(n=>{r(Array.from(n.entries()))}),[e]),S.useMemo(()=>t,[t])}var st,Yc,As,Jc,rp,Xc,Ka,Qc,np,Ho,vr,V0,lT=class{constructor({getPosition:e,node:t,portalContainer:r,view:n,ReactComponent:o,options:i}){en(this,st,void 0),en(this,Yc,[]),en(this,As,void 0),en(this,Jc,void 0),en(this,rp,void 0),en(this,Xc,void 0),en(this,Ka,void 0),en(this,Qc,!1),en(this,np,void 0),en(this,Ho,void 0),en(this,vr,void 0),en(this,V0,l=>{l&&(te(re(this,Ho),{code:H.REACT_NODE_VIEW,message:`You have applied a ref to a node view provided for '${re(this,st).type.name}' which doesn't support content.`}),l.append(re(this,Ho)))}),this.Component=()=>{const l=re(this,rp);return te(l,{code:H.REACT_NODE_VIEW,message:`The custom react node view provided for ${re(this,st).type.name} doesn't have a valid ReactComponent`}),L.createElement(l,{updateAttributes:this.updateAttributes,selected:this.selected,view:re(this,As),getPosition:re(this,Xc),node:re(this,st),forwardRef:re(this,V0),decorations:re(this,Yc)})},this.updateAttributes=l=>{if(!re(this,As).editable)return;const c=re(this,Xc).call(this);if(c==null)return;const u=re(this,As).state.tr.setNodeMarkup(c,void 0,{...re(this,st).attrs,...l});re(this,As).dispatch(u)},te(_e(e),{message:"You are attempting to use a node view for a mark type. This is not supported yet. Please check your configuration."}),Qr(this,st,t),Qr(this,As,n),Qr(this,Jc,r),Qr(this,rp,o),Qr(this,Xc,e),Qr(this,Ka,i),Qr(this,vr,this.createDom());const{contentDOM:s,wrapper:a}=this.createContentDom()??{};Qr(this,np,s??void 0),Qr(this,Ho,a),re(this,Ho)&&re(this,vr).append(re(this,Ho)),this.setDomAttributes(re(this,st),re(this,vr)),this.Component.displayName=V4(`${re(this,st).type.name}NodeView`),this.renderComponent()}static create(e){const{portalContainer:t,ReactComponent:r,options:n}=e;return(o,i,s)=>new lT({options:n,node:o,view:i,getPosition:s,portalContainer:t,ReactComponent:r})}get selected(){return re(this,Qc)}get contentDOM(){return re(this,np)}get dom(){return re(this,vr)}renderComponent(){re(this,Jc).render({Component:this.Component,container:re(this,vr)})}createDom(){const{defaultBlockNode:e,defaultInlineNode:t}=re(this,Ka),r=re(this,st).isInline?document.createElement(t):document.createElement(e);return r.classList.add(`${Xx(re(this,st).type.name)}-node-view-wrapper`),r}createContentDom(){var e,t;if(re(this,st).isLeaf)return;const r=(t=(e=re(this,st).type.spec).toDOM)==null?void 0:t.call(e,re(this,st));if(!r)return;const{contentDOM:n,dom:o}=an.renderSpec(document,r);let i;if(Je(o))return i=o,o===n&&(i=document.createElement("span"),i.classList.add(`${Xx(re(this,st).type.name)}-node-view-content-wrapper`),i.append(n)),Je(n),{wrapper:i,contentDOM:n}}update(e,t){return $h({types:re(this,st).type,node:e})?(re(this,st)===e&&re(this,Yc)===t||(re(this,st).sameMarkup(e)||this.setDomAttributes(e,re(this,vr)),Qr(this,st,e),Qr(this,Yc,t),this.renderComponent()),!0):!1}setDomAttributes(e,t){const{toDOM:r}=re(this,st).type.spec;let n=e.attrs;if(r){const o=r(e);if(ne(o)||A9(o))return;hs(o[1])&&(n=o[1])}for(const[o,i]of At(n))t.setAttribute(o,i)}selectNode(){Qr(this,Qc,!0),re(this,vr)&&re(this,vr).classList.add(qx),this.renderComponent()}deselectNode(){Qr(this,Qc,!1),re(this,vr)&&re(this,vr).classList.remove(qx),this.renderComponent()}destroy(){re(this,Jc).remove(re(this,vr))}ignoreMutation(e){return e.type==="selection"?!re(this,st).type.spec.selectable:re(this,Ho)?!re(this,Ho).contains(e.target):!0}stopEvent(e){var t;if(!re(this,vr))return!1;if(_e(re(this,Ka).stopEvent))return re(this,Ka).stopEvent({event:e});const r=e.target;if(!(re(this,vr).contains(r)&&!((t=this.contentDOM)!=null&&t.contains(r))))return!1;const o=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!o)return!0;const s=!!re(this,st).type.spec.draggable,a=ce.isSelectable(re(this,st)),l=e.type==="copy",c=e.type==="paste",u=e.type==="cut",d=e.type==="mousedown",f=e.type.startsWith("drag");return!s&&a&&f&&e.preventDefault(),!(f||o||l||c||u||d&&a)}},ww=lT;st=new WeakMap;Yc=new WeakMap;As=new WeakMap;Jc=new WeakMap;rp=new WeakMap;Xc=new WeakMap;Ka=new WeakMap;Qc=new WeakMap;np=new WeakMap;Ho=new WeakMap;vr=new WeakMap;V0=new WeakMap;function A9(e){return Ap(e)||hs(e)&&Ap(e.dom)}var ad=class extends Ve{constructor(){super(...arguments),this.portalContainer=new T9}get name(){return"reactComponent"}onCreate(){this.store.setStoreKey("portalContainer",this.portalContainer)}createNodeViews(){const e=ee(),t=this.store.managerSettings.nodeViewComponents??{};for(const n of this.store.extensions)!n.ReactComponent||!Hd(n)||n.reactComponentEnvironment==="ssr"||(e[n.name]=ww.create({options:this.options,ReactComponent:n.ReactComponent,portalContainer:this.portalContainer}));const r=At({...this.options.nodeViewComponents,...t});for(const[n,o]of r)e[n]=ww.create({options:this.options,ReactComponent:o,portalContainer:this.portalContainer});return e}};ad=M9([pe({defaultOptions:{defaultBlockNode:"div",defaultInlineNode:"span",defaultContentNode:"span",defaultEnvironment:"both",nodeViewComponents:{},stopEvent:null},staticKeys:["defaultBlockNode","defaultInlineNode","defaultContentNode","defaultEnvironment"]})],ad);function N9(e){const t=S.createContext(null),r=R9(t);return[o=>{const i=e(o);return L.createElement(t.Provider,{value:i},o.children)},r,t]}function R9(e){return(t,r)=>{const n=S.useContext(e),o=P9(n);if(!n)throw new Error("`useContextHook` must be placed inside the `Provider` returned by the `createContextState` method");if(!t)return n;if(typeof t!="function")throw new TypeError("invalid arguments passed to `useContextHook`. This hook must be called with zero arguments, a getter function or a path string.");const i=t(n);if(!o||!r)return i;const s=t(o);return r(s,i)?s:i}}function P9(e){const t=S.useRef();return z9(()=>{t.current=e}),t.current}var z9=typeof document<"u"?S.useLayoutEffect:S.useEffect;function L9(e,t){return N9(r=>{const n=S.useRef(null),o=S.useRef(),i=t==null?void 0:t(r),[s,a]=S.useState(()=>e({get:Sw(n),set:Ew(o),previousContext:void 0,props:r,state:i})),l=[...Object.values(r),i];return S.useEffect(()=>{l.length!==0&&a(c=>e({get:Sw(n),set:Ew(o),previousContext:c,props:r,state:i}))},l),n.current=s,o.current=a,s})}function Sw(e){return t=>{if(!e.current)throw new Error("`get` called outside of function scope. `get` can only be called within a function.");if(!t)return e.current;if(typeof t!="function")throw new TypeError("Invalid arguments passed to `useContextHook`. The hook must be called with zero arguments, a getter function or a path string.");return t(e.current)}}function Ew(e){return t=>{if(!e.current)throw new Error("`set` called outside of function scope. `set` can only be called within a function.");e.current(r=>({...r,...typeof t=="function"?t(r):t}))}}var cT={},uT={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.errorMessages=e.ErrorType=void 0;var t;(function(r){r.MalformedUnicode="MALFORMED_UNICODE",r.MalformedHexadecimal="MALFORMED_HEXADECIMAL",r.CodePointLimit="CODE_POINT_LIMIT",r.OctalDeprecation="OCTAL_DEPRECATION",r.EndOfString="END_OF_STRING"})(t=e.ErrorType||(e.ErrorType={})),e.errorMessages=new Map([[t.MalformedUnicode,"malformed Unicode character escape sequence"],[t.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[t.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[t.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[t.EndOfString,"malformed escape sequence at end of string"]])})(uT);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.unraw=e.errorMessages=e.ErrorType=void 0;const t=uT;Object.defineProperty(e,"ErrorType",{enumerable:!0,get:function(){return t.ErrorType}}),Object.defineProperty(e,"errorMessages",{enumerable:!0,get:function(){return t.errorMessages}});function r(p){return!p.match(/[^a-f0-9]/i)?parseInt(p,16):NaN}function n(p,h,m){const b=r(p);if(Number.isNaN(b)||m!==void 0&&m!==p.length)throw new SyntaxError(t.errorMessages.get(h));return b}function o(p){const h=n(p,t.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(h)}function i(p,h){const m=n(p,t.ErrorType.MalformedUnicode,4);if(h!==void 0){const b=n(h,t.ErrorType.MalformedUnicode,4);return String.fromCharCode(m,b)}return String.fromCharCode(m)}function s(p){return p.charAt(0)==="{"&&p.charAt(p.length-1)==="}"}function a(p){if(!s(p))throw new SyntaxError(t.errorMessages.get(t.ErrorType.MalformedUnicode));const h=p.slice(1,-1),m=n(h,t.ErrorType.MalformedUnicode);try{return String.fromCodePoint(m)}catch(b){throw b instanceof RangeError?new SyntaxError(t.errorMessages.get(t.ErrorType.CodePointLimit)):b}}function l(p,h=!1){if(h)throw new SyntaxError(t.errorMessages.get(t.ErrorType.OctalDeprecation));const m=parseInt(p,8);return String.fromCharCode(m)}const c=new Map([["b","\b"],["f","\f"],["n",` -`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function u(p){return c.get(p)||p}const d=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function f(p,h=!1){return p.replace(d,function(m,b,v,g,y,x,k,w,E){if(b!==void 0)return"\\";if(v!==void 0)return o(v);if(g!==void 0)return a(g);if(y!==void 0)return i(y,x);if(k!==void 0)return i(k);if(w==="0")return"\0";if(w!==void 0)return l(w,!h);if(E!==void 0)return u(E);throw new SyntaxError(t.errorMessages.get(t.ErrorType.EndOfString))})}e.unraw=f,e.default=f})(cT);const I9=Dn(cT),Yo=e=>typeof e=="string",D9=e=>typeof e=="function",Cw=new Map;function Vy(e){return[...Array.isArray(e)?e:[e],"en"]}function dT(e,t,r){const n=Vy(e);return ih(()=>sh("date",n,r),()=>new Intl.DateTimeFormat(n,r)).format(Yo(t)?new Date(t):t)}function j0(e,t,r){const n=Vy(e);return ih(()=>sh("number",n,r),()=>new Intl.NumberFormat(n,r)).format(t)}function Mw(e,t,r,{offset:n=0,...o}){const i=Vy(e),s=t?ih(()=>sh("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):ih(()=>sh("plural-cardinal",i),()=>new Intl.PluralRules(i,{type:"cardinal"}));return o[r]??o[s.select(r-n)]??o.other}function ih(e,t){const r=e();let n=Cw.get(r);return n||(n=t(),Cw.set(r,n)),n}function sh(e,t,r){const n=t.join("-");return`${e}-${n}-${JSON.stringify(r)}`}const fT=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g,$9=(e,t,r={})=>{t=t||e;const n=i=>Yo(i)?r[i]||{style:i}:i,o=(i,s)=>{const a=Object.keys(r).length?n("number"):{},l=j0(t,i,a);return s.replace("#",l)};return{plural:(i,s)=>{const{offset:a=0}=s,l=Mw(t,!1,i,s);return o(i-a,l)},selectordinal:(i,s)=>{const{offset:a=0}=s,l=Mw(t,!0,i,s);return o(i-a,l)},select:(i,s)=>s[i]??s.other,number:(i,s)=>j0(t,i,n(s)),date:(i,s)=>dT(t,i,n(s)),undefined:i=>i}};function H9(e,t,r){return(n,o={})=>{const i=$9(t,r,o),s=l=>Array.isArray(l)?l.reduce((c,u)=>{if(Yo(u))return c+u;const[d,f,p]=u;let h={};p!=null&&!Yo(p)?Object.keys(p).forEach(b=>{h[b]=s(p[b])}):h=p;const m=i[f](n[d],h);return m==null?c:c+m},""):l,a=s(e);return Yo(a)&&fT.test(a)?I9(a.trim()):Yo(a)?a.trim():a}}var B9=Object.defineProperty,F9=(e,t,r)=>t in e?B9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,V9=(e,t,r)=>(F9(e,typeof t!="symbol"?t+"":t,r),r);class j9{constructor(){V9(this,"_events",{})}on(t,r){return this._hasEvent(t)||(this._events[t]=[]),this._events[t].push(r),()=>this.removeListener(t,r)}removeListener(t,r){if(!this._hasEvent(t))return;const n=this._events[t].indexOf(r);~n&&this._events[t].splice(n,1)}emit(t,...r){this._hasEvent(t)&&this._events[t].map(n=>n.apply(this,r))}_hasEvent(t){return Array.isArray(this._events[t])}}var U9=Object.defineProperty,W9=(e,t,r)=>t in e?U9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pa=(e,t,r)=>(W9(e,typeof t!="symbol"?t+"":t,r),r);class K9 extends j9{constructor(t){super(),Pa(this,"_locale"),Pa(this,"_locales"),Pa(this,"_localeData"),Pa(this,"_messages"),Pa(this,"_missing"),Pa(this,"t",this._.bind(this)),this._messages={},this._localeData={},t.missing!=null&&(this._missing=t.missing),t.messages!=null&&this.load(t.messages),t.localeData!=null&&this.loadLocaleData(t.localeData),(t.locale!=null||t.locales!=null)&&this.activate(t.locale,t.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(t,r){this._localeData[t]==null?this._localeData[t]=r:Object.assign(this._localeData[t],r)}loadLocaleData(t,r){r!=null?this._loadLocaleData(t,r):Object.keys(t).forEach(n=>this._loadLocaleData(n,t[n])),this.emit("change")}_load(t,r){this._messages[t]==null?this._messages[t]=r:Object.assign(this._messages[t],r)}load(t,r){r!=null?this._load(t,r):Object.keys(t).forEach(n=>this._load(n,t[n])),this.emit("change")}loadAndActivate({locale:t,locales:r,messages:n}){this._locale=t,this._locales=r||void 0,this._messages[this._locale]=n,this.emit("change")}activate(t,r){this._locale=t,this._locales=r,this.emit("change")}_(t,r={},{message:n,formats:o}={}){Yo(t)||(r=t.values||r,n=t.message,t=t.id);const i=!this.messages[t],s=this._missing;if(s&&i)return D9(s)?s(this._locale,t):s;i&&this.emit("missing",{id:t,locale:this._locale});let a=this.messages[t]||n||t;return Yo(a)&&fT.test(a)?JSON.parse(`"${a}"`):Yo(a)?a:H9(a,this._locale,this._locales)(r,o)}date(t,r){return dT(this._locales||this._locale,t,r)}number(t,r){return j0(this._locales||this._locale,t,r)}}function q9(e={}){return new K9(e)}const lm=q9();function W(e,t){return t?"other":e==1?"one":"other"}function ui(e,t){return t?"other":e==0||e==1?"one":"other"}function Kr(e,t){var r=String(e).split("."),n=!r[1];return t?"other":e==1&&n?"one":"other"}function Le(e,t){return"other"}function xs(e,t){return t?"other":e==1?"one":e==2?"two":"other"}const G9=Le,Y9=W,J9=ui;function X9(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const Q9=W;function Z9(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2);return t?"other":e==0?"zero":e==1?"one":e==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function eD(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2);return t?"other":e==0?"zero":e==1?"one":e==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function tD(e,t){return t?e==1||e==5||e==7||e==8||e==9||e==10?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const rD=W,nD=Kr;function oD(e,t){var r=String(e).split("."),n=r[0],o=n.slice(-1),i=n.slice(-2),s=n.slice(-3);return t?o==1||o==2||o==5||o==7||o==8||i==20||i==50||i==70||i==80?"one":o==3||o==4||s==100||s==200||s==300||s==400||s==500||s==600||s==700||s==800||s==900?"few":n==0||o==6||i==40||i==60||i==90?"many":"other":e==1?"one":"other"}function iD(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2);return t?(o==2||o==3)&&i!=12&&i!=13?"few":"other":o==1&&i!=11?"one":o>=2&&o<=4&&(i<12||i>14)?"few":n&&o==0||o>=5&&o<=9||i>=11&&i<=14?"many":"other"}const sD=W,aD=W,lD=W,cD=ui,uD=Le;function dD(e,t){return t?e==1||e==5||e==7||e==8||e==9||e==10?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const fD=Le;function pD(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2),s=n&&r[0].slice(-6);return t?"other":o==1&&i!=11&&i!=71&&i!=91?"one":o==2&&i!=12&&i!=72&&i!=92?"two":(o==3||o==4||o==9)&&(i<10||i>19)&&(i<70||i>79)&&(i<90||i>99)?"few":e!=0&&n&&s==0?"many":"other"}const hD=W;function mD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function gD(e,t){var r=String(e).split("."),n=!r[1];return t?e==1||e==3?"one":e==2?"two":e==4?"few":"other":e==1&&n?"one":"other"}const vD=W;function yD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?"other":i&&(n==1||n==2||n==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const bD=W,xD=W,kD=W;function wD(e,t){var r=String(e).split("."),n=r[0],o=!r[1];return t?"other":e==1&&o?"one":n>=2&&n<=4&&o?"few":o?"other":"many"}function SD(e,t){return t?e==0||e==7||e==8||e==9?"zero":e==1?"one":e==2?"two":e==3||e==4?"few":e==5||e==6?"many":"other":e==0?"zero":e==1?"one":e==2?"two":e==3?"few":e==6?"many":"other"}function ED(e,t){var r=String(e).split("."),n=r[0],o=Number(r[0])==e;return t?"other":e==1||!o&&(n==0||n==1)?"one":"other"}const CD=Kr;function MD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-2),a=o.slice(-2);return t?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}const TD=W,OD=Le,_D=W,AD=W;function ND(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?i==1&&s!=11?"one":i==2&&s!=12?"two":i==3&&s!=13?"few":"other":e==1&&n?"one":"other"}const RD=W,PD=W,zD=Kr,LD=W;function ID(e,t){return t?"other":e>=0&&e<=1?"one":"other"}function DD(e,t){return t?"other":e>=0&&e<2?"one":"other"}const $D=Kr;function HD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?e==1?"one":"other":i&&(n==1||n==2||n==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const BD=W;function FD(e,t){return t?e==1?"one":"other":e>=0&&e<2?"one":"other"}const VD=W,jD=Kr;function UD(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?e==1?"one":"other":e==1?"one":e==2?"two":n&&e>=3&&e<=6?"few":n&&e>=7&&e<=10?"many":"other"}function WD(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?e==1||e==11?"one":e==2||e==12?"two":e==3||e==13?"few":"other":e==1||e==11?"one":e==2||e==12?"two":n&&e>=3&&e<=10||n&&e>=13&&e<=19?"few":"other"}const KD=Kr,qD=W;function GD(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const YD=ui;function JD(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":o&&i==1?"one":o&&i==2?"two":o&&(s==0||s==20||s==40||s==60||s==80)?"few":o?"other":"many"}const XD=W,QD=W;function ZD(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1);return t?"other":e==1&&o?"one":n==2&&o?"two":o&&(e<0||e>10)&&i&&s==0?"many":"other"}function e7(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}function t7(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function r7(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-2),a=o.slice(-2);return t?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}function n7(e,t){return t?e==1||e==5?"one":"other":e==1?"one":"other"}function o7(e,t){return t?e==1?"one":"other":e>=0&&e<2?"one":"other"}const i7=Kr,s7=Le,a7=Le,l7=Le,c7=Kr;function u7(e,t){var r=String(e).split("."),n=r[0],o=Number(r[0])==e,i=n.slice(-1),s=n.slice(-2);return t?"other":o&&i==1&&s!=11||!o?"one":"other"}function d7(e,t){var r=String(e).split("."),n=!r[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&n?"one":"other"}const f7=xs;function p7(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1);return t?"other":e==1&&o?"one":n==2&&o?"two":o&&(e<0||e>10)&&i&&s==0?"many":"other"}const h7=Le,m7=Le,g7=W,v7=Kr,y7=W,b7=Le,x7=Le;function k7(e,t){var r=String(e).split("."),n=r[0],o=n.slice(-2);return t?n==1?"one":n==0||o>=2&&o<=20||o==40||o==60||o==80?"many":"other":e==1?"one":"other"}function w7(e,t){return t?"other":e>=0&&e<2?"one":"other"}const S7=W,E7=W,C7=Le,M7=Le;function T7(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1);return t?o==6||o==9||n&&o==0&&e!=0?"many":"other":e==1?"one":"other"}const O7=W,_7=W,A7=Le;function N7(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const R7=Le,P7=W,z7=W;function L7(e,t){return t?"other":e==0?"zero":e==1?"one":"other"}const I7=W;function D7(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2),i=n&&r[0].slice(-3),s=n&&r[0].slice(-5),a=n&&r[0].slice(-6);return t?n&&e>=1&&e<=4||o>=1&&o<=4||o>=21&&o<=24||o>=41&&o<=44||o>=61&&o<=64||o>=81&&o<=84?"one":e==5||o==5?"many":"other":e==0?"zero":e==1?"one":o==2||o==22||o==42||o==62||o==82||n&&i==0&&(s>=1e3&&s<=2e4||s==4e4||s==6e4||s==8e4)||e!=0&&a==1e5?"two":o==3||o==23||o==43||o==63||o==83?"few":e!=1&&(o==1||o==21||o==41||o==61||o==81)?"many":"other"}const $7=W;function H7(e,t){var r=String(e).split("."),n=r[0];return t?"other":e==0?"zero":(n==0||n==1)&&e!=0?"one":"other"}const B7=W,F7=W,V7=Le,j7=ui;function U7(e,t){return t&&e==1?"one":"other"}function W7(e,t){var r=String(e).split("."),n=r[1]||"",o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?"other":i==1&&(s<11||s>19)?"one":i>=2&&i<=9&&(s<11||s>19)?"few":n!=0?"many":"other"}function K7(e,t){var r=String(e).split("."),n=r[1]||"",o=n.length,i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-2),c=n.slice(-1);return t?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const q7=W,G7=ui,Y7=W;function J7(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?s==1&&a!=11?"one":s==2&&a!=12?"two":(s==7||s==8)&&a!=17&&a!=18?"many":"other":i&&s==1&&a!=11||l==1&&c!=11?"one":"other"}const X7=W,Q7=W;function Z7(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-2);return t?e==1?"one":"other":e==1&&n?"one":!n||e==0||i>=2&&i<=19?"few":"other"}function e$(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":"other":e==1?"one":"other"}function t$(e,t){return t&&e==1?"one":"other"}function r$(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2);return t?"other":e==1?"one":e==0||o>=2&&o<=10?"few":o>=11&&o<=19?"many":"other"}const n$=Le,o$=W,i$=xs,s$=W,a$=W;function l$(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?n&&e>=1&&e<=4?"one":"other":e==1?"one":"other"}const c$=Kr,u$=W,d$=W,f$=W,p$=Le,h$=W,m$=ui,g$=W,v$=W,y$=W;function b$(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?e==1||e==5||n&&e>=7&&e<=9?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e==1?"one":"other"}const x$=W,k$=Le,w$=ui,S$=W;function E$(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":e==1&&o?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&n!=1&&(i==0||i==1)||o&&i>=5&&i<=9||o&&s>=12&&s<=14?"many":"other"}function C$(e,t){var r=String(e).split("."),n=r[1]||"",o=n.length,i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-2),c=n.slice(-1);return t?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const M$=W;function T$(e,t){var r=String(e).split("."),n=r[0];return t?"other":n==0||n==1?"one":"other"}const O$=Kr,_$=W;function A$(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-2);return t?e==1?"one":"other":e==1&&n?"one":!n||e==0||i>=2&&i<=19?"few":"other"}const N$=W,R$=Le;function P$(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":o&&i==1&&s!=11?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&i==0||o&&i>=5&&i<=9||o&&s>=11&&s<=14?"many":"other"}const z$=W,L$=Le,I$=W;function D$(e,t){var r=String(e).split("."),n=!r[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&n?"one":"other"}function $$(e,t){var r=String(e).split("."),n=!r[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&n?"one":"other"}const H$=W,B$=W,F$=xs,V$=W,j$=Le,U$=Le;function W$(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function K$(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?"other":e>=0&&e<=1?"one":n&&e>=2&&e<=10?"few":"other"}function q$(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"";return t?"other":e==0||e==1||n==0&&o==1?"one":"other"}function G$(e,t){var r=String(e).split("."),n=r[0],o=!r[1];return t?"other":e==1&&o?"one":n>=2&&n<=4&&o?"few":o?"other":"many"}function Y$(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-2);return t?"other":o&&i==1?"one":o&&i==2?"two":o&&(i==3||i==4)||!o?"few":"other"}const J$=xs,X$=xs,Q$=xs,Z$=xs,eH=xs,tH=W,rH=W;function nH(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2);return t?e==1?"one":o==4&&i!=14?"many":"other":e==1?"one":"other"}function oH(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}const iH=W,sH=W,aH=W,lH=Le;function cH(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?(i==1||i==2)&&s!=11&&s!=12?"one":"other":e==1&&n?"one":"other"}const uH=Kr,dH=W,fH=W,pH=W,hH=W,mH=Le,gH=ui,vH=W;function yH(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1);return t?o==6||o==9||e==10?"few":"other":e==1?"one":"other"}function bH(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?e==1?"one":"other":i&&(n==1||n==2||n==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const xH=W,kH=Le,wH=W,SH=W;function EH(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?"other":e==0||e==1||n&&e>=11&&e<=99?"one":"other"}const CH=W;function MH(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-1),c=n.slice(-2);return t?s==3&&a!=13?"few":"other":o&&l==1&&c!=11?"one":o&&l>=2&&l<=4&&(c<12||c>14)?"few":o&&l==0||o&&l>=5&&l<=9||o&&c>=11&&c<=14?"many":"other"}const TH=Kr,OH=W,_H=W;function AH(e,t){return t&&e==1?"one":"other"}const NH=W,RH=W,PH=ui,zH=W,LH=Le,IH=W,DH=W,$H=Kr,HH=Le,BH=Le,FH=Le;function VH(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const jH=Object.freeze(Object.defineProperty({__proto__:null,_in:G9,af:Y9,ak:J9,am:X9,an:Q9,ar:Z9,ars:eD,as:tD,asa:rD,ast:nD,az:oD,be:iD,bem:sD,bez:aD,bg:lD,bho:cD,bm:uD,bn:dD,bo:fD,br:pD,brx:hD,bs:mD,ca:gD,ce:vD,ceb:yD,cgg:bD,chr:xD,ckb:kD,cs:wD,cy:SD,da:ED,de:CD,dsb:MD,dv:TD,dz:OD,ee:_D,el:AD,en:ND,eo:RD,es:PD,et:zD,eu:LD,fa:ID,ff:DD,fi:$D,fil:HD,fo:BD,fr:FD,fur:VD,fy:jD,ga:UD,gd:WD,gl:KD,gsw:qD,gu:GD,guw:YD,gv:JD,ha:XD,haw:QD,he:ZD,hi:e7,hr:t7,hsb:r7,hu:n7,hy:o7,ia:i7,id:s7,ig:a7,ii:l7,io:c7,is:u7,it:d7,iu:f7,iw:p7,ja:h7,jbo:m7,jgo:g7,ji:v7,jmc:y7,jv:b7,jw:x7,ka:k7,kab:w7,kaj:S7,kcg:E7,kde:C7,kea:M7,kk:T7,kkj:O7,kl:_7,km:A7,kn:N7,ko:R7,ks:P7,ksb:z7,ksh:L7,ku:I7,kw:D7,ky:$7,lag:H7,lb:B7,lg:F7,lkt:V7,ln:j7,lo:U7,lt:W7,lv:K7,mas:q7,mg:G7,mgo:Y7,mk:J7,ml:X7,mn:Q7,mo:Z7,mr:e$,ms:t$,mt:r$,my:n$,nah:o$,naq:i$,nb:s$,nd:a$,ne:l$,nl:c$,nn:u$,nnh:d$,no:f$,nqo:p$,nr:h$,nso:m$,ny:g$,nyn:v$,om:y$,or:b$,os:x$,osa:k$,pa:w$,pap:S$,pl:E$,prg:C$,ps:M$,pt:T$,pt_PT:O$,rm:_$,ro:A$,rof:N$,root:R$,ru:P$,rwk:z$,sah:L$,saq:I$,sc:D$,scn:$$,sd:H$,sdh:B$,se:F$,seh:V$,ses:j$,sg:U$,sh:W$,shi:K$,si:q$,sk:G$,sl:Y$,sma:J$,smi:X$,smj:Q$,smn:Z$,sms:eH,sn:tH,so:rH,sq:nH,sr:oH,ss:iH,ssy:sH,st:aH,su:lH,sv:cH,sw:uH,syr:dH,ta:fH,te:pH,teo:hH,th:mH,ti:gH,tig:vH,tk:yH,tl:bH,tn:xH,to:kH,tr:wH,ts:SH,tzm:EH,ug:CH,uk:MH,ur:TH,uz:OH,ve:_H,vi:AH,vo:NH,vun:RH,wa:PH,wae:zH,wo:LH,xh:IH,xog:DH,yi:$H,yo:HH,yue:BH,zh:FH,zu:VH},Symbol.toStringTag,{value:"Module"}));var UH=Object.defineProperty,WH=Object.getOwnPropertyDescriptor,KH=Object.getOwnPropertyNames,qH=Object.prototype.hasOwnProperty,Tw=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of KH(t))!qH.call(e,o)&&o!==r&&UH(e,o,{get:()=>t[o],enumerable:!(n=WH(t,o))||n.enumerable});return e},GH=(e,t,r)=>(Tw(e,t,"default"),r&&Tw(r,t,"default")),YH=JSON.parse('{"extension.command.toggle-upper-case.label":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"extension.table.column_count":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"extension.table.row_count":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.toggle-columns.description":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"extension.command.toggle-columns.label":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"extension.command.set-text-direction.label":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"extension.command.set-text-direction.description":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"extension.command.toggle-heading.label":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"extension.command.toggle-callout.description":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"extension.command.toggle-callout.label":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"extension.command.toggle-code-block.description":"Add a code block","extension.command.add-annotation.label":"Add annotation","extension.command.toggle-blockquote.description":"Add blockquote formatting to the selected text","extension.command.toggle-bold.description":"Add bold formatting to the selected text","extension.command.toggle-code.description":"Add inline code formatting to the selected text","keyboard.shortcut.alt":"Alt","keyboard.shortcut.arrowDown":"Arrow Down","keyboard.shortcut.arrowLeft":"Arrow Left","keyboard.shortcut.arrowRight":"Arrow Right","keyboard.shortcut.arrowUp":"Arrow Up","keyboard.shortcut.backspace":"Backspace","ui.text-color.black":"Black","extension.command.toggle-blockquote.label":"Blockquote","ui.text-color.blue":"Blue","ui.text-color.blue.hue":["Blue ",["hue"]],"extension.command.toggle-bold.label":"Bold","extension.command.toggle-bullet-list.description":"Bulleted list","keyboard.shortcut.capsLock":"Caps Lock","extension.command.center-align.label":"Center align","extension.command.toggle-code.label":"Code","extension.command.toggle-code-block.label":"Codeblock","keyboard.shortcut.command":"Command","QcPNd6":"Image description","ogrUzJ":"Add a short description here.","yqdyzr":"Image","6/02F4":"Image source","X8H91v":"Image","zhQ7Zt":"Italic","ZL7E7l":"Underline","keyboard.shortcut.control":"Control","extension.command.convert-paragraph.description":"Convert current block into a paragraph block.","extension.command.convert-paragraph.label":"Convert Paragraph","extension.command.copy.label":"Copy","extension.command.copy.description":"Copy the selected text","extension.command.create-table.description":"Create a table with set number of rows and columns.","extension.command.create-table.label":"Create table","extension.command.cut.label":"Cut","extension.command.cut.description":"Cut the selected text","ui.text-color.cyan":"Cyan","ui.text-color.cyan.hue":["Cyan ",["hue"]],"extension.command.decrease-font-size.label":"Decrease","extension.command.decrease-indent.label":"Decrease indentation","extension.command.decrease-font-size.description":"Decrease the font size.","keyboard.shortcut.delete":"Delete","extension.command.insert-horizontal-rule.label":"Divider","keyboard.shortcut.end":"End","keyboard.shortcut.escape":"Enter","keyboard.shortcut.enter":"Enter","6PjrOF":"Add annotation","OTq5WC":"Center align","oeZ3ox":"Convert current block into a paragraph block.","m1khs+":"Convert Paragraph","w/1U+3":"Copy the selected text","kdodi0":"Copy","k0KR/u":"Create a table with set number of rows and columns.","zrwMyD":"Create table","D/nWxh":"Cut the selected text","jHPv5m":"Cut","5cNgRx":"Decrease the font size.","vyRNWx":"Decrease","Jgiol4":"Decrease indentation","1gJSHH":"Increase the font size","OQXJXz":"Increase","72TLhr":"Increase indentation","HFlfzJ":"Insert Emoji","RPq9fY":"Separate content with a diving horizontal line","OKQF+e":"Divider","zjYb9C":"Insert a new paragraph","4M4sXC":"Insert Paragraph","1Q+eVc":"Justify","ejWWtP":"Left align","wVqrpS":"Paste content into the editor","07v9aw":"Paste","zUYfou":"Redo the most recent action","9Nq9zr":"Redo","0uxaZe":"Remove annotation","iJWZAz":"Right align","g5WpPn":"Select all content within the editor","2+pZDT":"Select all","yChCR1":"Set text case","GMzAC/":"Set the font size for the selected text.","vzEyrv":"Font size","7VCkJ8":"Set the text color for the selected text.","qjWFaR":"Text color","LVWgFu":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"WXwRy1":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"G/o315":"Set the text highlight color for the selected text.","xtHg6d":"Text highlight","1p1W/p":"Add blockquote formatting to the selected text","6+rh6I":"Blockquote","0yB3LV":"Add bold formatting to the selected text","sFMo4Z":"Bold","SMKG/s":"Bulleted list","/BYCMi":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"V+3IBe":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"hbIo4L":"Add a code block","7GkMcx":"Codeblock","2r4JYl":"Add inline code formatting to the selected text","Up8Tpe":"Code","ATHSPS":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"7DC1VE":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"hnrBeo":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"NkZAcw":"Italicize the selected text","2fTW9e":"Italic","c759Ra":"Ordered list","uQwrZu":"Strikethrough the selected text","pT3qly":"Strikethrough","BHk+zu":"Subscript","18BVwM":"Superscript","tOIVCV":"Tasked list","4Janx3":"Underline the selected text","dCHt+D":"Underline","YYAprs":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"tczyZL":"Show hidden whitespace characters in your editor.","0qAX23":"Toggle Whitespace","ezMADU":"Undo the most recent action","N3P7EC":"Undo","2nj/+s":"Update annotation","dWD7u4":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"qXqgVT":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.set-font-size.label":"Font size","ui.text-color.grape":"Grape","ui.text-color.grape.hue":["Grape ",["hue"]],"ui.text-color.gray":"Gray","ui.text-color.gray.hue":["Gray ",["hue"]],"ui.text-color.green":"Green","ui.text-color.green.hue":["Green ",["hue"]],"keyboard.shortcut.home":"Home","extension.command.increase-font-size.label":"Increase","extension.command.increase-indent.label":"Increase indentation","extension.command.increase-font-size.description":"Increase the font size","ui.text-color.indigo":"Indigo","ui.text-color.indigo.hue":["Indigo ",["hue"]],"extension.command.insert-paragraph.description":"Insert a new paragraph","extension.command.insert-emoji.label":"Insert Emoji","extension.command.insert-paragraph.label":"Insert Paragraph","extension.command.toggle-italic.label":"Italic","extension.command.toggle-italic.description":"Italicize the selected text","extension.command.justify-align.label":"Justify","R7NlCw":"Alt","RbDiK5":"Arrow Down","Dgyd+E":"Arrow Left","8pdCk4":"Arrow Right","Gp/343":"Arrow Up","PFPV0A":"Backspace","0IRYvp":"Caps Lock","X7HX0D":"Command","zq0AdD":"Control","8SfToN":"Delete","Ys/uah":"End","3K5hww":"Enter","veQt1j":"Enter","ySv7i+":"Home","e6RUI1":"Page Down","EEJk31":"Page Up","7sbhAU":"Shift","Q4eplT":"Space","SUhVVC":"Tab","extension.command.left-align.label":"Left align","ui.text-color.lime":"Lime","ui.text-color.lime.hue":["Lime ",["hue"]],"react-components.mention-atom-component.zero-items":"No items available","ui.text-color.orange":"Orange","ui.text-color.orange.hue":["Orange ",["hue"]],"extension.command.toggle-ordered-list.label":"Ordered list","keyboard.shortcut.pageDown":"Page Down","keyboard.shortcut.pageUp":"Page Up","extension.command.paste.label":"Paste","extension.command.paste.description":"Paste content into the editor","ui.text-color.pink":"Pink","ui.text-color.pink.hue":["Pink ",["hue"]],"zvMfIA":"No items available","pEjhti":"Static Menu","ui.text-color.red":"Red","ui.text-color.red.hue":["Red ",["hue"]],"extension.command.redo.label":"Redo","extension.command.redo.description":"Redo the most recent action","extension.command.remove-annotation.label":"Remove annotation","extension.command.right-align.label":"Right align","extension.command.select-all.label":"Select all","extension.command.select-all.description":"Select all content within the editor","extension.command.insert-horizontal-rule.description":"Separate content with a diving horizontal line","extension.command.set-casing.label":"Set text case","extension.command.set-font-size.description":"Set the font size for the selected text.","extension.command.set-text-color.description":"Set the text color for the selected text.","extension.command.set-text-highlight.description":"Set the text highlight color for the selected text.","keyboard.shortcut.shift":"Shift","extension.command.toggle-whitespace.description":"Show hidden whitespace characters in your editor.","keyboard.shortcut.space":"Space","extension.command.toggle-strike.label":"Strikethrough","extension.command.toggle-strike.description":"Strikethrough the selected text","extension.command.toggle-subscript.label":"Subscript","extension.command.toggle-superscript.label":"Superscript","keyboard.shortcut.tab":"Tab","extension.command.toggle-task-list.description":"Tasked list","ui.text-color.teal":"Teal","ui.text-color.teal.hue":["Teal ",["hue"]],"extension.command.set-text-color.label":"Text color","extension.command.set-text-highlight.label":"Text highlight","extension.command.toggle-whitespace.label":"Toggle Whitespace","ui.text-color.transparent":"Transparent","slrB1c":"Black","6QML30":"Blue","xw+keN":["Blue ",["hue"]],"38RHqP":"Cyan","D89yPf":["Cyan ",["hue"]],"VjBLnd":"Grape","Rp40yv":["Grape ",["hue"]],"5Dm9D1":"Gray","HGjXjC":["Gray ",["hue"]],"b9fz+n":"Green","18jo3M":["Green ",["hue"]],"CFzqCV":"Indigo","aVlDku":["Indigo ",["hue"]],"04PfLc":"Lime","KRTK6Y":["Lime ",["hue"]],"pSnXFd":"Orange","ve/MJZ":["Orange ",["hue"]],"OvCgDa":"Pink","l7NqyT":["Pink ",["hue"]],"IT9k0j":"Red","AdyJ7/":["Red ",["hue"]],"3D2UWc":"Teal","Dcq0Y1":["Teal ",["hue"]],"bsi2ik":"Transparent","Tj3PRR":"Violet","xxMH5N":["Violet ",["hue"]],"Rum0ah":"White","4gaw/Q":"Yellow","hhauc3":["Yellow ",["hue"]],"extension.command.toggle-underline.label":"Underline","extension.command.toggle-underline.description":"Underline the selected text","extension.command.undo.label":"Undo","extension.command.undo.description":"Undo the most recent action","extension.command.update-annotation.label":"Update annotation","ui.text-color.violet":"Violet","ui.text-color.violet.hue":["Violet ",["hue"]],"ui.text-color.white":"White","ui.text-color.yellow":"Yellow","ui.text-color.yellow.hue":["Yellow ",["hue"]]}'),pT={};GH(pT,jH);lm.loadLocaleData("en",{plurals:pT.en});lm.load("en",YH);lm.activate("en");var JH=Object.defineProperty,XH=Object.getOwnPropertyDescriptor,jy=(e,t,r,n)=>{for(var o=n>1?void 0:n?XH(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&JH(t,r,o),o},jl=class extends er{get name(){return"doc"}createNodeSpec(e,t){const{docAttributes:r,content:n}=this.options,o=ee();if(hs(r))for(const[i,s]of At(r))o[i]={default:s};else for(const i of r)o[i]={default:null};return{attrs:o,content:n,...t}}setDocAttributes(e){return({tr:t,dispatch:r})=>{if(r){for(const[n,o]of Object.entries(e))t.step(new ld(n,o));r(t)}return!0}}isDefaultDocNode({state:e=this.store.getState(),options:t}={}){return Kv(e.doc,t)}};jy([U()],jl.prototype,"setDocAttributes",1);jy([He()],jl.prototype,"isDefaultDocNode",1);jl=jy([pe({defaultOptions:{content:"block+",docAttributes:[]},defaultPriority:Ae.Medium,staticKeys:["content","docAttributes"],disableExtraAttributes:!0})],jl);var hT="SetDocAttribute",mT="RevertSetDocAttribute",ld=class extends Rt{constructor(e,t,r=hT){super(),this.stepType=r,this.key=e,this.value=t}static fromJSON(e,t){return new ld(t.key,t.value,t.stepType)}apply(e){this.previous=e.attrs[this.key];const t={...e.attrs,[this.key]:this.value};return yt.ok(e.type.create(t,e.content,e.marks))}invert(){return new ld(this.key,this.previous,mT)}map(){return this}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}};try{Rt.jsonID(hT,ld),Rt.jsonID(mT,ld)}catch(e){if(!e.message.startsWith("Duplicate use of step JSON ID"))throw e}var QH=Object.defineProperty,ZH=Object.getOwnPropertyDescriptor,gT=(e,t,r,n)=>{for(var o=n>1?void 0:n?ZH(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&QH(t,r,o),o};function eB(e,t,r,n){const o=e.docView.posFromDOM(t,r,n);return o===null||o<0?null:o}function tB(e,t){const r=t.target;if(r){const n=eB(e,r,0);if(n!==null){const o=e.state.doc.resolve(n),i=o.node().isLeaf?0:1,s=o.start()-i;return{pos:n,inside:s}}}return e.posAtCoords({left:t.clientX,top:t.clientY})??void 0}var ah=class extends Ve{constructor(){super(...arguments),this.mousedown=!1,this.mouseover=!1,this.createMouseEventHandler=e=>(t,r)=>{const n=r,o=tB(t,n);if(!o)return!1;const i=[],s=[],{inside:a,pos:l}=o;if(a===-1)return!1;const c=t.state.doc.resolve(l),u=c.depth+1;for(const d of Ev(u,1))i.push({node:d>c.depth&&c.nodeAfter?c.nodeAfter:c.node(d),pos:c.before(d)});for(const{type:d}of c.marksAcross(c)??[]){const f=_o(c,d);f&&s.push(f)}return e(n,{view:t,nodes:i,marks:s,getMark:d=>{const f=ne(d)?t.state.schema.marks[d]:d;return te(f,{code:H.EXTENSION,message:`The mark ${d} being checked does not exist within the editor schema.`}),s.find(p=>p.mark.type===f)},getNode:d=>{var f;const p=ne(d)?t.state.schema.nodes[d]:d;te(p,{code:H.EXTENSION,message:"The node being checked does not exist"});const h=i.find(({node:m})=>m.type===p);if(h)return{...h,isRoot:!!((f=i[0])!=null&&f.node.eq(h.node))}}})}}get name(){return"events"}onView(){var e,t;if(!((e=this.store.managerSettings.exclude)!=null&&e.clickHandler))for(const r of this.store.extensions){if(!r.createEventHandlers||(t=r.options.exclude)!=null&&t.clickHandler)continue;const n=r.createEventHandlers();for(const[o,i]of At(n))this.addHandler(o,i)}}createPlugin(){const e=new WeakMap,t=(r,n,o,i,s,a,l,c)=>{const u=this.store.currentState,{schema:d,doc:f}=u,p=f.resolve(i),h=e.has(l),m=rB({$pos:p,handled:h,view:o,state:u});let b=!1;h||(b=r(l,m)||b);const v={...m,pos:i,direct:c,nodeWithPosition:{node:s,pos:a},getNode:g=>{const y=ne(g)?d.nodes[g]:g;return te(y,{code:H.EXTENSION,message:"The node being checked does not exist"}),y===s.type?{node:s,pos:a}:void 0}};return e.set(l,!0),n(l,v)||b};return{props:{handleKeyPress:(r,n)=>this.options.keypress(n)||!1,handleKeyDown:(r,n)=>this.options.keydown(n)||!1,handleTextInput:(r,n,o,i)=>this.options.textInput({from:n,to:o,text:i})||!1,handleClickOn:(r,n,o,i,s,a)=>t(this.options.clickMark,this.options.click,r,n,o,i,s,a),handleDoubleClickOn:(r,n,o,i,s,a)=>t(this.options.doubleClickMark,this.options.doubleClick,r,n,o,i,s,a),handleTripleClickOn:(r,n,o,i,s,a)=>t(this.options.tripleClickMark,this.options.tripleClick,r,n,o,i,s,a),handleDOMEvents:{focus:(r,n)=>this.options.focus(n)||!1,blur:(r,n)=>this.options.blur(n)||!1,mousedown:(r,n)=>(this.startMouseover(),this.options.mousedown(n)||!1),mouseup:(r,n)=>(this.endMouseover(),this.options.mouseup(n)||!1),mouseleave:(r,n)=>(this.mouseover=!1,this.options.mouseleave(n)||!1),mouseenter:(r,n)=>(this.mouseover=!0,this.options.mouseenter(n)||!1),keyup:(r,n)=>this.options.keyup(n)||!1,mouseout:this.createMouseEventHandler((r,n)=>{const o={...n,hovering:!1};return this.options.hover(r,o)||!1}),mouseover:this.createMouseEventHandler((r,n)=>{const o={...n,hovering:!0};return this.options.hover(r,o)||!1}),contextmenu:this.createMouseEventHandler((r,n)=>this.options.contextmenu(r,n)||!1),scroll:(r,n)=>this.options.scroll(n)||!1,copy:(r,n)=>this.options.copy(n)||!1,cut:(r,n)=>this.options.cut(n)||!1,paste:(r,n)=>this.options.paste(n)||!1}},view:r=>{let n=r.editable;const o=this.options;return{update(i){const s=i.editable;s!==n&&(o.editable(s),n=s)}}}}}isInteracting(){return this.mousedown&&this.mouseover}startMouseover(){this.mouseover=!0,!this.mousedown&&(this.mousedown=!0,this.store.document.documentElement.addEventListener("mouseup",()=>{this.endMouseover()},{once:!0}))}endMouseover(){this.mousedown&&(this.mousedown=!1,this.store.commands.emptyUpdate())}};gT([He()],ah.prototype,"isInteracting",1);ah=gT([pe({handlerKeys:["blur","focus","mousedown","mouseup","mouseenter","mouseleave","textInput","keypress","keyup","keydown","click","clickMark","doubleClick","doubleClickMark","tripleClick","tripleClickMark","contextmenu","hover","scroll","copy","cut","paste","editable"],handlerKeyOptions:{blur:{earlyReturnValue:!0},focus:{earlyReturnValue:!0},mousedown:{earlyReturnValue:!0},mouseleave:{earlyReturnValue:!0},mouseup:{earlyReturnValue:!0},click:{earlyReturnValue:!0},doubleClick:{earlyReturnValue:!0},tripleClick:{earlyReturnValue:!0},hover:{earlyReturnValue:!0},contextmenu:{earlyReturnValue:!0},scroll:{earlyReturnValue:!0},copy:{earlyReturnValue:!0},cut:{earlyReturnValue:!0},paste:{earlyReturnValue:!0}},defaultPriority:Ae.High})],ah);function rB(e){const{handled:t,view:r,$pos:n,state:o}=e,i={getMark:J4,markRanges:[],view:r,state:o};if(t)return i;for(const{type:s}of n.marksAcross(n)??[]){const a=_o(n,s);a&&i.markRanges.push(a)}return i.getMark=s=>{const a=ne(s)?o.schema.marks[s]:s;return te(a,{code:H.EXTENSION,message:`The mark ${s} being checked does not exist within the editor schema.`}),i.markRanges.find(l=>l.mark.type===a)},i}class gt extends be{constructor(t){super(t,t)}map(t,r){let n=t.resolve(r.map(this.head));return gt.valid(n)?new gt(n):be.near(n)}content(){return K.empty}eq(t){return t instanceof gt&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new gt(t.resolve(r.pos))}getBookmark(){return new Uy(this.anchor)}static valid(t){let r=t.parent;if(r.isTextblock||!nB(t)||!oB(t))return!1;let n=r.type.spec.allowGapCursor;if(n!=null)return n;let o=r.contentMatchAt(t.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(t,r,n=!1){e:for(;;){if(!n&>.valid(t))return t;let o=t.pos,i=null;for(let s=t.depth;;s--){let a=t.node(s);if(r>0?t.indexAfter(s)0){i=a.child(r>0?t.indexAfter(s):t.index(s)-1);break}else if(s==0)return null;o+=r;let l=t.doc.resolve(o);if(gt.valid(l))return l}for(;;){let s=r>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!ce.isSelectable(i)){t=t.doc.resolve(o+i.nodeSize*r),n=!1;continue e}break}i=s,o+=r;let a=t.doc.resolve(o);if(gt.valid(a))return a}return null}}}gt.prototype.visible=!1;gt.findFrom=gt.findGapCursorFrom;be.jsonID("gapcursor",gt);class Uy{constructor(t){this.pos=t}map(t){return new Uy(t.map(this.pos))}resolve(t){let r=t.resolve(this.pos);return gt.valid(r)?new gt(r):be.near(r)}}function nB(e){for(let t=e.depth;t>=0;t--){let r=e.index(t),n=e.node(t);if(r==0){if(n.type.spec.isolating)return!0;continue}for(let o=n.child(r-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function oB(e){for(let t=e.depth;t>=0;t--){let r=e.indexAfter(t),n=e.node(t);if(r==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let o=n.child(r);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function iB(){return new Ro({props:{decorations:cB,createSelectionBetween(e,t,r){return t.pos==r.pos&>.valid(r)?new gt(r):null},handleClick:aB,handleKeyDown:sB,handleDOMEvents:{beforeinput:lB}}})}const sB=Jv({ArrowLeft:Sf("horiz",-1),ArrowRight:Sf("horiz",1),ArrowUp:Sf("vert",-1),ArrowDown:Sf("vert",1)});function Sf(e,t){const r=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(n,o,i){let s=n.selection,a=t>0?s.$to:s.$from,l=s.empty;if(s instanceof le){if(!i.endOfTextblock(r)||a.depth==0)return!1;l=!1,a=n.doc.resolve(t>0?a.after():a.before())}let c=gt.findGapCursorFrom(a,t,l);return c?(o&&o(n.tr.setSelection(new gt(c))),!0):!1}}function aB(e,t,r){if(!e||!e.editable)return!1;let n=e.state.doc.resolve(t);if(!gt.valid(n))return!1;let o=e.posAtCoords({left:r.clientX,top:r.clientY});return o&&o.inside>-1&&ce.isSelectable(e.state.doc.nodeAt(o.inside))?!1:(e.dispatch(e.state.tr.setSelection(new gt(n))),!0)}function lB(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof gt))return!1;let{$from:r}=e.state.selection,n=r.parent.contentMatchAt(r.index()).findWrapping(e.state.schema.nodes.text);if(!n)return!1;let o=R.empty;for(let s=n.length-1;s>=0;s--)o=R.from(n[s].createAndFill(null,o));let i=e.state.tr.replace(r.pos,r.pos,new K(o,0,0));return i.setSelection(le.near(i.doc.resolve(r.pos+1))),e.dispatch(i),!1}function cB(e){if(!(e.selection instanceof gt))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Ee.create(e.doc,[Ge.widget(e.selection.head,t,{key:"gapcursor"})])}var uB=Object.defineProperty,dB=Object.getOwnPropertyDescriptor,fB=(e,t,r,n)=>{for(var o=n>1?void 0:n?dB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&uB(t,r,o),o},U0=class extends Ve{get name(){return"gapCursor"}createExternalPlugins(){return[iB()]}};U0=fB([pe({})],U0);var lh=200,Bt=function(){};Bt.prototype.append=function(t){return t.length?(t=Bt.from(t),!this.length&&t||t.length=r?Bt.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,r))};Bt.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Bt.prototype.forEach=function(t,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length),r<=n?this.forEachInner(t,r,n,0):this.forEachInvertedInner(t,r,n,0)};Bt.prototype.map=function(t,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length);var o=[];return this.forEach(function(i,s){return o.push(t(i,s))},r,n),o};Bt.from=function(t){return t instanceof Bt?t:t&&t.length?new vT(t):Bt.empty};var vT=function(e){function t(n){e.call(this),this.values=n}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new t(this.values.slice(o,i))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,i,s,a){for(var l=i;l=s;l--)if(o(this.values[l],a+l)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=lh)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=lh)return new t(o.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(t.prototype,r),t}(Bt);Bt.empty=new vT([]);var pB=function(e){function t(r,n){e.call(this),this.left=r,this.right=n,this.length=r.length+n.length,this.depth=Math.max(r.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(n){return na&&this.right.forEachInner(n,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(n,o,i,s){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(n,o-a,Math.max(i,a)-a,s+a)===!1||i=i?this.right.slice(n-i,o-i):this.left.slice(n,i).append(this.right.slice(0,o-i))},t.prototype.leafAppend=function(n){var o=this.right.leafAppend(n);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(n){var o=this.left.leafPrepend(n);if(o)return new t(o,this.right)},t.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new t(this.left,new t(this.right,n)):new t(this,n)},t}(Bt);const hB=500;class Zn{constructor(t,r){this.items=t,this.eventCount=r}popEvent(t,r){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let o,i;r&&(o=this.remapping(n,this.items.length),i=o.maps.length);let s=t.tr,a,l,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(n,f+1),i=o.maps.length),i--,u.push(d);return}if(o){u.push(new mo(d.map));let p=d.step.map(o.slice(i)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new mo(h,void 0,void 0,c.length+u.length))),i--,h&&o.appendMap(h,i)}else s.maybeStep(d.step);if(d.selection)return a=o?d.selection.map(o.slice(i)):d.selection,l=new Zn(this.items.slice(0,n).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(t,r,n,o){let i=[],s=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let u=0;ugB&&(a=mB(a,c),s-=c),new Zn(a.append(i),s)}remapping(t,r){let n=new ul;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=t?n.maps.length-o.mirrorOffset:void 0;n.appendMap(o.map,s)},t,r),n}addMaps(t){return this.eventCount==0?this:new Zn(this.items.append(t.map(r=>new mo(r))),this.eventCount)}rebased(t,r){if(!this.eventCount)return this;let n=[],o=Math.max(0,this.items.length-r),i=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},o);let l=r;this.items.forEach(f=>{let p=i.getMirror(--l);if(p==null)return;s=Math.min(s,p);let h=i.maps[p];if(f.step){let m=t.steps[p].invert(t.docs[p]),b=f.selection&&f.selection.map(i.slice(l+1,p));b&&a++,n.push(new mo(h,m,b))}else n.push(new mo(h))},o);let c=[];for(let f=r;fhB&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let t=0;return this.items.forEach(r=>{r.step||t++}),t}compress(t=this.items.length){let r=this.remapping(0,t),n=r.maps.length,o=[],i=0;return this.items.forEach((s,a)=>{if(a>=t)o.push(s),s.selection&&i++;else if(s.step){let l=s.step.map(r.slice(n)),c=l&&l.getMap();if(n--,c&&r.appendMap(c,n),l){let u=s.selection&&s.selection.map(r.slice(n));u&&i++;let d=new mo(c.invert(),l,u),f,p=o.length-1;(f=o.length&&o[p].merge(d))?o[p]=f:o.push(d)}}else s.map&&n--},this.items.length,0),new Zn(Bt.from(o.reverse()),i)}}Zn.empty=new Zn(Bt.empty,0);function mB(e,t){let r;return e.forEach((n,o)=>{if(n.selection&&t--==0)return r=o,!1}),e.slice(r)}class mo{constructor(t,r,n,o){this.map=t,this.step=r,this.selection=n,this.mirrorOffset=o}merge(t){if(this.step&&t.step&&!t.selection){let r=t.step.merge(this.step);if(r)return new mo(r.getMap().invert(),r,this.selection)}}}class Ai{constructor(t,r,n,o,i){this.done=t,this.undone=r,this.prevRanges=n,this.prevTime=o,this.prevComposition=i}}const gB=20;function vB(e,t,r,n){let o=r.getMeta(So),i;if(o)return o.historyState;r.getMeta(bB)&&(e=new Ai(e.done,e.undone,null,0,-1));let s=r.getMeta("appendedTransaction");if(r.steps.length==0)return e;if(s&&s.getMeta(So))return s.getMeta(So).redo?new Ai(e.done.addTransform(r,void 0,n,op(t)),e.undone,Ow(r.mapping.maps[r.steps.length-1]),e.prevTime,e.prevComposition):new Ai(e.done,e.undone.addTransform(r,void 0,n,op(t)),null,e.prevTime,e.prevComposition);if(r.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=r.getMeta("composition"),l=e.prevTime==0||!s&&e.prevComposition!=a&&(e.prevTime<(r.time||0)-n.newGroupDelay||!yB(r,e.prevRanges)),c=s?Jg(e.prevRanges,r.mapping):Ow(r.mapping.maps[r.steps.length-1]);return new Ai(e.done.addTransform(r,l?t.selection.getBookmark():void 0,n,op(t)),Zn.empty,c,r.time,a??e.prevComposition)}else return(i=r.getMeta("rebased"))?new Ai(e.done.rebased(r,i),e.undone.rebased(r,i),Jg(e.prevRanges,r.mapping),e.prevTime,e.prevComposition):new Ai(e.done.addMaps(r.mapping.maps),e.undone.addMaps(r.mapping.maps),Jg(e.prevRanges,r.mapping),e.prevTime,e.prevComposition)}function yB(e,t){if(!t)return!1;if(!e.docChanged)return!0;let r=!1;return e.mapping.maps[0].forEach((n,o)=>{for(let i=0;i=t[i]&&(r=!0)}),r}function Ow(e){let t=[];return e.forEach((r,n,o,i)=>t.push(o,i)),t}function Jg(e,t){if(!e)return null;let r=[];for(let n=0;n{let r=So.getState(e);return!r||r.done.eventCount==0?!1:(t&&yT(r,e,t,!1),!0)},Zc=(e,t)=>{let r=So.getState(e);return!r||r.undone.eventCount==0?!1:(t&&yT(r,e,t,!0),!0)};function W0(e){let t=So.getState(e);return t?t.done.eventCount:0}function kB(e){let t=So.getState(e);return t?t.undone.eventCount:0}var wB=Object.defineProperty,SB=Object.getOwnPropertyDescriptor,Ca=(e,t,r,n)=>{for(var o=n>1?void 0:n?SB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&wB(t,r,o),o},Ao=class extends Ve{constructor(){super(...arguments),this.wrapMethod=(e,t)=>({state:r,dispatch:n,view:o})=>{const{getState:i,getDispatch:s}=this.options,a=_e(i)?i():r,l=_e(s)&&n?s():n,c=e(a,l,o);return t==null||t(c),c}}get name(){return"history"}createKeymap(){return{"Mod-y":on.isMac?()=>!1:this.wrapMethod(Zc,this.options.onRedo),"Mod-z":this.wrapMethod(ip,this.options.onUndo),"Shift-Mod-z":this.wrapMethod(Zc,this.options.onRedo)}}undoShortcut(e){return this.wrapMethod(ip,this.options.onUndo)(e)}redoShortcut(e){return this.wrapMethod(Zc,this.options.onRedo)(e)}createExternalPlugins(){const{depth:e,newGroupDelay:t}=this.options;return[xB({depth:e,newGroupDelay:t})]}undo(){return a2(this.wrapMethod(ip,this.options.onUndo))}redo(){return a2(this.wrapMethod(Zc,this.options.onRedo))}undoDepth(e=this.store.getState()){return W0(e)}redoDepth(e=this.store.getState()){return kB(e)}};Ca([je({shortcut:D.Undo,command:"undo"})],Ao.prototype,"undoShortcut",1);Ca([je({shortcut:D.Redo,command:"redo"})],Ao.prototype,"redoShortcut",1);Ca([U({disableChaining:!0,description:({t:e})=>e(Ep.UNDO_DESCRIPTION),label:({t:e})=>e(Ep.UNDO_LABEL),icon:"arrowGoBackFill"})],Ao.prototype,"undo",1);Ca([U({disableChaining:!0,description:({t:e})=>e(Ep.REDO_DESCRIPTION),label:({t:e})=>e(Ep.REDO_LABEL),icon:"arrowGoForwardFill"})],Ao.prototype,"redo",1);Ca([He()],Ao.prototype,"undoDepth",1);Ca([He()],Ao.prototype,"redoDepth",1);Ao=Ca([pe({defaultOptions:{depth:100,newGroupDelay:500,getDispatch:void 0,getState:void 0},staticKeys:["depth","newGroupDelay"],handlerKeys:["onUndo","onRedo"]})],Ao);var EB=Object.defineProperty,CB=Object.getOwnPropertyDescriptor,cm=(e,t,r,n)=>{for(var o=n>1?void 0:n?CB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&EB(t,r,o),o},MB={icon:"paragraph",label:({t:e})=>e(Cp.INSERT_LABEL),description:({t:e})=>e(Cp.INSERT_DESCRIPTION)},TB={icon:"paragraph",label:({t:e})=>e(Cp.CONVERT_LABEL),description:({t:e})=>e(Cp.CONVERT_DESCRIPTION)},fa=class extends er{get name(){return"paragraph"}createTags(){return[oe.LastNodeCompatible,oe.TextBlock,oe.Block,oe.FormattingNode]}createNodeSpec(e,t){return{content:"inline*",draggable:!1,...t,attrs:{...e.defaults()},parseDOM:[{tag:"p",getAttrs:r=>({...e.parse(r)})},...t.parseDOM??[]],toDOM:r=>["p",e.dom(r),0]}}convertParagraph(e={}){const{attrs:t,selection:r,preserveAttrs:n}=e;return this.store.commands.setBlockNodeType.original(this.type,t,r,n)}insertParagraph(e,t={}){const{selection:r,attrs:n}=t;return this.store.commands.insertNode.original(this.type,{content:e,selection:r,attrs:n})}shortcut(e){return this.convertParagraph()(e)}};cm([U(TB)],fa.prototype,"convertParagraph",1);cm([U(MB)],fa.prototype,"insertParagraph",1);cm([je({shortcut:D.Paragraph,command:"convertParagraph"})],fa.prototype,"shortcut",1);fa=cm([pe({defaultPriority:Ae.Medium})],fa);function Jo(e,t,r){return Math.min(Math.max(e,r),t)}class OB extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var eu=OB;function Wy(e){if(typeof e!="string")throw new eu(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=IB.test(e)?NB(e):e;const r=RB.exec(t);if(r){const s=Array.from(r).slice(1);return[...s.slice(0,3).map(a=>parseInt(cd(a,2),16)),parseInt(cd(s[3]||"f",2),16)/255]}const n=PB.exec(t);if(n){const s=Array.from(n).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,16)),parseInt(s[3]||"ff",16)/255]}const o=zB.exec(t);if(o){const s=Array.from(o).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,10)),parseFloat(s[3]||"1")]}const i=LB.exec(t);if(i){const[s,a,l,c]=Array.from(i).slice(1).map(parseFloat);if(Jo(0,100,a)!==a)throw new eu(e);if(Jo(0,100,l)!==l)throw new eu(e);return[...DB(s,a,l),Number.isNaN(c)?1:c]}throw new eu(e)}function _B(e){let t=5381,r=e.length;for(;r;)t=t*33^e.charCodeAt(--r);return(t>>>0)%2341}const Aw=e=>parseInt(e.replace(/_/g,""),36),AB="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const r=Aw(t.substring(0,3)),n=Aw(t.substring(3)).toString(16);let o="";for(let i=0;i<6-n.length;i++)o+="0";return e[r]=`${o}${n}`,e},{});function NB(e){const t=e.toLowerCase().trim(),r=AB[_B(t)];if(!r)throw new eu(e);return`#${r}`}const cd=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),RB=new RegExp(`^#${cd("([a-f0-9])",3)}([a-f0-9])?$`,"i"),PB=new RegExp(`^#${cd("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),zB=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${cd(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),LB=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,IB=/^[a-z]+$/i,Nw=e=>Math.round(e*255),DB=(e,t,r)=>{let n=r/100;if(t===0)return[n,n,n].map(Nw);const o=(e%360+360)%360/60,i=(1-Math.abs(2*n-1))*(t/100),s=i*(1-Math.abs(o%2-1));let a=0,l=0,c=0;o>=0&&o<1?(a=i,l=s):o>=1&&o<2?(a=s,l=i):o>=2&&o<3?(l=i,c=s):o>=3&&o<4?(l=s,c=i):o>=4&&o<5?(a=s,c=i):o>=5&&o<6&&(a=i,c=s);const u=n-i/2,d=a+u,f=l+u,p=c+u;return[d,f,p].map(Nw)};function $B(e){const[t,r,n,o]=Wy(e).map((d,f)=>f===3?d:d/255),i=Math.max(t,r,n),s=Math.min(t,r,n),a=(i+s)/2;if(i===s)return[0,0,a,o];const l=i-s,c=a>.5?l/(2-i-s):l/(i+s);return[60*(t===i?(r-n)/l+(r.179}function kl(e){return VB(e)?"#000":"#fff"}const jB="remirror-editor-wrapper",UB="remirror-button-active",WB="remirror-button",KB="remirror-composite",qB="remirror-dialog",GB="remirror-dialog-backdrop",YB="remirror-form",JB="remirror-form-message",XB="remirror-form-label",QB="remirror-form-group",ZB="remirror-group",eF="remirror-input",tF="remirror-menu",rF="remirror-menu-pane",nF="remirror-menu-pane-active",oF="remirror-menu-dropdown-label",iF="remirror-menu-pane-icon",sF="remirror-menu-pane-label",aF="remirror-menu-pane-shortcut",lF="remirror-menu-button-left",cF="remirror-menu-button-right",uF="remirror-menu-button-nested-left",dF="remirror-menu-button-nested-right",fF="remirror-menu-button",pF="remirror-menu-bar",hF="remirror-flex-column",mF="remirror-flex-row",gF="remirror-menu-item",vF="remirror-menu-item-row",yF="remirror-menu-item-column",bF="remirror-menu-item-checkbox",xF="remirror-menu-item-radio",kF="remirror-menu-group",wF="remirror-floating-popover",SF="remirror-popover",EF="remirror-animated-popover",CF="remirror-role",MF="remirror-separator",TF="remirror-tab",OF="remirror-tab-list",_F="remirror-tabbable",AF="remirror-toolbar",NF="remirror-tooltip",RF="remirror-table-size-editor",PF="remirror-table-size-editor-body",zF="remirror-table-size-editor-cell",LF="remirror-table-size-editor-cell-selected",IF="remirror-table-size-editor-footer",DF="remirror-color-picker",$F="remirror-color-picker-cell",HF="remirror-color-picker-cell-selected";var BF=Object.freeze({__proto__:null,ANIMATED_POPOVER:EF,BUTTON:WB,BUTTON_ACTIVE:UB,COLOR_PICKER:DF,COLOR_PICKER_CELL:$F,COLOR_PICKER_CELL_SELECTED:HF,COMPOSITE:KB,DIALOG:qB,DIALOG_BACKDROP:GB,EDITOR_WRAPPER:jB,FLEX_COLUMN:hF,FLEX_ROW:mF,FLOATING_POPOVER:wF,FORM:YB,FORM_GROUP:QB,FORM_LABEL:XB,FORM_MESSAGE:JB,GROUP:ZB,INPUT:eF,MENU:tF,MENU_BAR:pF,MENU_BUTTON:fF,MENU_BUTTON_LEFT:lF,MENU_BUTTON_NESTED_LEFT:uF,MENU_BUTTON_NESTED_RIGHT:dF,MENU_BUTTON_RIGHT:cF,MENU_DROPDOWN_LABEL:oF,MENU_GROUP:kF,MENU_ITEM:gF,MENU_ITEM_CHECKBOX:bF,MENU_ITEM_COLUMN:yF,MENU_ITEM_RADIO:xF,MENU_ITEM_ROW:vF,MENU_PANE:rF,MENU_PANE_ACTIVE:nF,MENU_PANE_ICON:iF,MENU_PANE_LABEL:sF,MENU_PANE_SHORTCUT:aF,POPOVER:SF,ROLE:CF,SEPARATOR:MF,TAB:TF,TABBABLE:_F,TABLE_SIZE_EDITOR:RF,TABLE_SIZE_EDITOR_BODY:PF,TABLE_SIZE_EDITOR_CELL:zF,TABLE_SIZE_EDITOR_CELL_SELECTED:LF,TABLE_SIZE_EDITOR_FOOTER:IF,TAB_LIST:OF,TOOLBAR:AF,TOOLTIP:NF});const FF="remirror-wrap",VF="remirror-language-select-positioner",jF="remirror-language-select-width",UF="remirror-a11y-dark",WF="remirror-atom-dark",KF="remirror-base16-ateliersulphurpool-light",qF="remirror-cb",GF="remirror-darcula",YF="remirror-dracula",JF="remirror-duotone-dark",XF="remirror-duotone-earth",QF="remirror-duotone-forest",ZF="remirror-duotone-light",eV="remirror-duotone-sea",tV="remirror-duotone-space",rV="remirror-gh-colors",nV="remirror-hopscotch",oV="remirror-pojoaque",iV="remirror-vs",sV="remirror-xonokai";var aV=Object.freeze({__proto__:null,A11Y_DARK:UF,ATOM_DARK:WF,BASE16_ATELIERSULPHURPOOL_LIGHT:KF,CB:qF,DARCULA:GF,DRACULA:YF,DUOTONE_DARK:JF,DUOTONE_EARTH:XF,DUOTONE_FOREST:QF,DUOTONE_LIGHT:ZF,DUOTONE_SEA:eV,DUOTONE_SPACE:tV,GH_COLORS:rV,HOPSCOTCH:nV,LANGUAGE_SELECT_POSITIONER:VF,LANGUAGE_SELECT_WIDTH:jF,POJOAQUE:oV,VS:iV,WRAP:FF,XONOKAI:sV});const lV="remirror-image-loader";var cV=Object.freeze({__proto__:null,IMAGE_LOADER:lV});const uV="remirror-list-item-with-custom-mark",dV="remirror-ul-list-content",fV="remirror-editor",pV="remirror-list-item-marker-container",hV="remirror-list-item-checkbox",mV="remirror-collapsible-list-item-closed",gV="remirror-collapsible-list-item-button",vV="remirror-list-spine";var ls=Object.freeze({__proto__:null,COLLAPSIBLE_LIST_ITEM_BUTTON:gV,COLLAPSIBLE_LIST_ITEM_CLOSED:mV,EDITOR:fV,LIST_ITEM_CHECKBOX:hV,LIST_ITEM_MARKER_CONTAINER:pV,LIST_ITEM_WITH_CUSTOM_MARKER:uV,LIST_SPINE:vV,UL_LIST_CONTENT:dV});const yV="remirror-is-empty";var bV=Object.freeze({__proto__:null,IS_EMPTY:yV});const xV="remirror-editor",kV="remirror-positioner",wV="remirror-positioner-widget";var SV=Object.freeze({__proto__:null,EDITOR:xV,POSITIONER:kV,POSITIONER_WIDGET:wV});const EV="remirror-theme";function CV(e={}){const t=[],r={};function n(o,i){if(typeof i=="string"||typeof i=="number"){t.push(`${Rw(o)}: ${i};`),r[Rw(o)]=i;return}if(!(typeof i!="object"||!i))for(const[s,a]of Object.entries(i))n([...o,s],a)}for(const[o,i]of Object.entries(e))n([o],i);return{css:t.join(` -`),styles:r}}function MV(e){return e.replace(/([a-z])([\dA-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function Rw(e){return`--rmr-${e.map(MV).join("-")}`}const qn={gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},Xo="#000000",Ky="#ffffff",TV="#252103",qy=ch(Xo,.75),um="#7963d2",Gy="#bcd263",OV="#fff",_V="#fff",Yy=qn.gray[1],Pw="rgba(10,31,68,0.08)",zw="rgba(10,31,68,0.10)",Lw="rgba(10,31,68,0.12)",AV=sp(ch(Xo,.1),.13),Jy={background:Ky,border:qy,foreground:Xo,muted:Yy,primary:um,secondary:Gy,primaryText:OV,secondaryText:_V,text:TV,faded:AV},NV={...Jy,background:rn(Ky,.15),border:rn(qy,.15),foreground:rn(Xo,.15),muted:rn(Yy,.15),primary:rn(um,.15),secondary:rn(Gy,.15),get text(){return kl(this.background)},get primaryText(){return kl(this.primary)},get secondaryText(){return kl(this.secondary)}},RV={...Jy,background:rn(Ky,.075),border:rn(qy,.075),foreground:rn(Xo,.075),muted:rn(Yy,.075),primary:rn(um,.075),secondary:rn(Gy,.075),get text(){return kl(this.background)},get primaryText(){return kl(this.primary)},get secondaryText(){return kl(this.secondary)}},Ss={color:{...Jy,active:NV,hover:RV,shadow1:Pw,shadow2:zw,shadow3:Lw,backdrop:ch(Xo,.1),outline:ch(um,.6),table:{default:{border:sp(Xo,.8),cell:sp(Xo,.4),controller:qn.gray[3]},selected:{border:qn.blue[7],cell:qn.blue[1],controller:qn.blue[5]},preselect:{border:qn.blue[7],cell:sp(Xo,.4),controller:qn.blue[5]},predelete:{border:qn.red[7],cell:qn.red[1],controller:qn.red[5]},mark:"#91919196"}},hue:qn,radius:{border:"0.25rem",extra:"0.5rem",circle:"50%"},fontFamily:{default:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif',heading:"inherit",mono:"Menlo, monospace"},fontSize:{0:"12px",1:"14px",2:"16px",3:"20px",4:"24px",5:"32px",6:"48px",7:"64px",8:"96px",default:"16px"},space:{1:"4px",2:"8px",3:"16px",4:"32px",5:"64px",6:"128px",7:"256px",8:"512px"},fontWeight:{bold:"700",default:"400",heading:"700"},letterSpacing:{tight:"-1px",default:"normal",loose:"1px",wide:"3px"},lineHeight:{heading:"1.25em",default:"1.5em"},boxShadow:{1:`0 1px 1px ${Pw}`,2:`0 1px 1px ${zw}`,3:`0 1px 1px ${Lw}`}};var PV=Object.defineProperty,zV=Object.getOwnPropertyDescriptor,Xy=(e,t,r,n)=>{for(var o=n>1?void 0:n?zV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&PV(t,r,o),o},bT=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},Tt=(e,t,r)=>(bT(e,t,"read from private field"),r?r.call(e):t.get(e)),Do=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},yi=(e,t,r,n)=>(bT(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),tu,ru,qa,nu,ap,ou,iu,su,au,lp=class{constructor(e){Do(this,tu,jh()),Do(this,ru,[]),Do(this,qa,new Map),Do(this,nu,[]),Do(this,ap,!1),Do(this,ou,void 0),Do(this,iu,void 0),Do(this,su,void 0),Do(this,au,void 0),this.addListener=(t,r)=>Tt(this,tu).on(t,r),yi(this,ou,e),yi(this,iu,e.getActive),yi(this,au,e.getPosition),yi(this,su,e.getID),this.hasChanged=e.hasChanged,this.events=e.events??["state","scroll"]}static create(e){return new lp(e)}static fromPositioner(e,t){return lp.create({...e.basePositioner,...t})}get basePositioner(){return{getActive:Tt(this,iu),getPosition:Tt(this,au),hasChanged:this.hasChanged,events:this.events,getID:Tt(this,su)}}onActiveChanged(e){this.recentUpdate=e;const t=Tt(this,iu).call(this,e);yi(this,ru,t),yi(this,qa,new Map),yi(this,ap,!1),yi(this,nu,[]);const r=[];for(const[n,o]of t.entries()){const i=this.getID(o,n);Tt(this,nu).push(i),r.push({setElement:s=>this.addProps({...e,data:o,element:s},n),id:i,data:o})}Tt(this,tu).emit("update",r)}getID(e,t){var r;return((r=Tt(this,su))==null?void 0:r.call(this,e,t))??t.toString()}addProps(e,t){if(Tt(this,ap)||(Tt(this,qa).set(t,e),Tt(this,qa).sizee;return this.clone(r=>({getActive:n=>r.getActive(n).filter(t)}))}},no=lp;tu=new WeakMap;ru=new WeakMap;qa=new WeakMap;nu=new WeakMap;ap=new WeakMap;ou=new WeakMap;iu=new WeakMap;su=new WeakMap;au=new WeakMap;no.EMPTY=[];function LV(e,t=ST){const{key:r}=(e==null?void 0:e.getMeta(wT))??{};return r===t}function xT(e){const{tr:t,state:r,previousState:n}=e;return!n||t&&LV(t)?!0:t?iz(t):!r.doc.eq(n.doc)||!r.selection.eq(n.selection)}function kT(e,t,r={}){const n=t.getBoundingClientRect(),{accountForPadding:o=!1}=r;let i=0,s=0,a=0,l=0;if(Je(t)&&o){const u=Number.parseFloat(kn(t,"padding-left").replace("px","")),d=Number.parseFloat(kn(t,"padding-right").replace("px","")),f=Number.parseFloat(kn(t,"padding-top").replace("px","")),p=Number.parseFloat(kn(t,"padding-bottom").replace("px","")),h=Number.parseFloat(kn(t,"border-left").replace("px","")),m=Number.parseFloat(kn(t,"border-right").replace("px","")),b=Number.parseFloat(kn(t,"border-top").replace("px","")),v=Number.parseFloat(kn(t,"border-bottom").replace("px","")),g=t.offsetWidth-t.clientWidth,y=t.offsetHeight-t.clientHeight;i+=u+h+(t.dir==="rtl"?g:0),s+=d+m+(t.dir==="rtl"?0:g),a+=f+b,l+=p+v+y}const c=new DOMRect(n.left+i,n.top+a,n.width-s,n.height-l);for(const[u,d]of[[e.top,e.left],[e.top,e.right],[e.bottom,e.left],[e.bottom,e.right]])if(Zx(u,c.top,c.bottom)&&Zx(d,c.left,c.right))return!0;return!1}var IV="remirror-positioner-widget",wT="positionerUpdate",ST="__all_positioners__",ET={y:-999999,x:-999999,width:0,height:0},Iw={...ET,left:-999999,top:-999999,bottom:-999999,right:-999999},Qy={...ET,rect:{...Iw,toJSON:()=>Iw},visible:!1},CT=no.create({hasChanged:xT,getActive(e){const{state:t}=e;if(!jv(t)||t.selection.$anchor.depth>2)return no.EMPTY;const r=Ld({predicate:n=>n.type.isBlock,selection:t});return r?[r]:no.EMPTY},getPosition(e){const{view:t,data:r}=e,n=t.nodeDOM(r.pos);if(!Je(n))return Qy;const o=n.getBoundingClientRect(),i=t.dom.getBoundingClientRect(),s=o.height,a=o.width,l=t.dom.scrollLeft+o.left-i.left,c=t.dom.scrollTop+o.top-i.top,u=kT(o,t.dom);return{y:c,x:l,height:s,width:a,rect:o,visible:u}}}),Zy=CT.clone(({getActive:e})=>({getActive:t=>{const[r]=e(t);return r&&Bh(r.node)&&r.node.type===Hh(t.state.schema)?[r]:no.EMPTY}})),DV=Zy.clone(({getPosition:e})=>({getPosition:t=>({...e(t),width:1})})),$V=Zy.clone(({getPosition:e})=>({getPosition:t=>{const{width:r,x:n,y:o,height:i}=e(t);return{...e(t),width:1,x:r+n,rect:new DOMRect(r+n,o,1,i)}}}));function eb(e){return no.create({hasChanged:xT,getActive:t=>{const{state:r,view:n}=t;if(!e(r)||!gs(r.selection))return no.EMPTY;try{const{head:o,anchor:i}=r.selection;return[{from:n.coordsAtPos(i),to:n.coordsAtPos(o)}]}catch{return no.EMPTY}},getPosition(t){const{element:r,data:n,view:o}=t,{from:i,to:s}=n,a=r.offsetParent??o.dom,l=a.getBoundingClientRect(),c=Math.abs(s.bottom-i.top),u=c>i.bottom-i.top,d=Math.min(i.left,s.left),f=Math.min(i.top,s.top),p=a.scrollLeft+(u?s.left-l.left:d-l.left),h=a.scrollTop+f-l.top,m=u?1:Math.abs(i.left-s.right),b=new DOMRect(u?s.left:d,f,m,c),v=kT(b,o.dom);return{rect:b,y:h,x:p,height:c,width:m,visible:v}}})}var MT=eb(e=>!e.selection.empty),HV=eb(e=>e.selection.empty),BV=eb(()=>!0),FV=MT.clone(()=>({getActive:e=>{const{state:t,view:r}=e;if(!t.selection.empty)return no.EMPTY;const n=_C(t);if(!n)return no.EMPTY;try{return[{from:r.coordsAtPos(n.from),to:r.coordsAtPos(n.to)}]}catch{return no.EMPTY}}})),VV={selection:MT,cursor:HV,always:BV,block:CT,emptyBlock:Zy,emptyBlockStart:DV,emptyBlockEnd:$V,nearestWord:FV},Ul=class extends Ve{constructor(){super(...arguments),this.positioners=[],this.onAddCustomHandler=({positioner:e})=>{if(e)return this.positioners=[...this.positioners,e],this.store.commands.forceUpdate(),()=>{this.positioners=this.positioners.filter(t=>t!==e)}}}get name(){return"positioner"}createAttributes(){return{class:SV.EDITOR}}init(){this.onScroll=j4(this.options.scrollDebounce,this.onScroll.bind(this))}createEventHandlers(){return{scroll:()=>(this.onScroll(),!1),hover:(e,t)=>(this.positioner(this.getBaseProps("hover",{hover:t})),!1),contextmenu:(e,t)=>(this.positioner(this.getBaseProps("contextmenu",{contextmenu:t})),!1)}}onStateUpdate(e){this.positioner({...e,previousState:e.firstUpdate?void 0:e.previousState,event:"state",helpers:this.store.helpers})}createDecorations(e){if(this.element??(this.element=this.createElement()),!this.element.hasChildNodes())return Ee.empty;const t=Ge.widget(0,this.element,{key:"positioner-widget",side:-1,stopEvent:()=>!0});return Ee.create(e.doc,[t])}forceUpdatePositioners(e=ST){return({tr:t,dispatch:r})=>(r==null||r(t.setMeta(wT,{key:e})),!0)}getPositionerWidget(){return this.element??(this.element=this.createElement())}createElement(){const e=document.createElement("span");return e.dataset.id=IV,e.setAttribute("role","presentation"),e}triggerPositioner(e,t){e.hasChanged(t)&&e.onActiveChanged({...t,view:this.store.view})}positioner(e){for(const t of this.positioners)t.events.includes(e.event)&&this.triggerPositioner(t,e)}getBaseProps(e,t){const r=this.store.getState(),n=this.store.previousState;return{helpers:this.store.helpers,event:e,firstUpdate:!1,previousState:n,state:r,...t}}onScroll(){this.positioner(this.getBaseProps("scroll",{scroll:{scrollTop:this.store.view.dom.scrollTop}}))}};Xy([U()],Ul.prototype,"forceUpdatePositioners",1);Xy([He()],Ul.prototype,"getPositionerWidget",1);Ul=Xy([pe({defaultOptions:{scrollDebounce:100},customHandlerKeys:["positioner"],staticKeys:["scrollDebounce"]})],Ul);function K0(e){return ne(e)?VV[e].clone():_e(e)?e().clone():e.clone()}var jV=Object.defineProperty,UV=Object.getOwnPropertyDescriptor,WV=(e,t,r,n)=>{for(var o=n>1?void 0:n?UV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&jV(t,r,o),o},q0=class extends er{get name(){return"text"}createTags(){return[oe.InlineNode]}createNodeSpec(){return{}}};q0=WV([pe({disableExtraAttributes:!0,defaultPriority:Ae.Medium})],q0);var KV={...jl.defaultOptions,...fa.defaultOptions,...Ao.defaultOptions,excludeExtensions:[]};function qV(e={}){e={...KV,...e};const{content:t,depth:r,getDispatch:n,getState:o,newGroupDelay:i,excludeExtensions:s}=e,a={};for(const c of s??[])a[c]=!0;const l=[];if(!a.history){const c=new Ao({depth:r,getDispatch:n,getState:o,newGroupDelay:i});l.push(c)}return a.doc||l.push(new jl({content:t})),a.text||l.push(new q0),a.paragraph||l.push(new fa),a.positioner||l.push(new Ul),a.gapCursor||l.push(new U0),a.events||l.push(new ah),l}var GV=Object.defineProperty,YV=Object.getOwnPropertyDescriptor,JV=(e,t,r,n)=>{for(var o=n>1?void 0:n?YV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&GV(t,r,o),o},pa=class extends Ve{get name(){return"placeholder"}createAttributes(){return{"aria-placeholder":this.options.placeholder}}createPlugin(){return{state:{init:(e,t)=>({...this.options,empty:Kv(t.doc,{ignoreAttributes:!0})}),apply:(e,t,r,n)=>XV({pluginState:t,tr:e,extension:this,state:n})},props:{decorations:e=>QV({state:e,extension:this})}}}onSetOptions(e){const{changes:t}=e;t.placeholder.changed&&this.store.phase>=Nr.EditorView&&this.store.updateAttributes()}};pa=JV([pe({defaultOptions:{emptyNodeClass:bV.IS_EMPTY,placeholder:""}})],pa);function XV(e){const{pluginState:t,extension:r,tr:n,state:o}=e;return n.docChanged?{...r.options,empty:Kv(o.doc)}:t}function QV(e){const{extension:t,state:r}=e,{empty:n}=t.pluginKey.getState(r),{emptyNodeClass:o,placeholder:i}=t.options;if(!n)return null;const s=[];return r.doc.descendants((a,l)=>{const c=Ge.node(l,l+a.nodeSize,{class:o,"data-placeholder":i});s.push(c)}),Ee.create(r.doc,s)}var ZV=Object.defineProperty,ej=Object.getOwnPropertyDescriptor,tj=(e,t,r,n)=>{for(var o=n>1?void 0:n?ej(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&ZV(t,r,o),o},rj={...pa.defaultOptions,...ad.defaultOptions},nj=[...pa.staticKeys,...ad.staticKeys],ud=class extends Ve{get name(){return"react"}onSetOptions(e){const{pickChanged:t}=e;this.getExtension(pa).setOptions(t(["placeholder"]))}createExtensions(){const{emptyNodeClass:e,placeholder:t,defaultBlockNode:r,defaultContentNode:n,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s}=this.options;return[new pa({emptyNodeClass:e,placeholder:t,priority:Ae.Low}),new ad({defaultBlockNode:r,defaultContentNode:n,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s})]}};ud=tj([pe({defaultOptions:rj,staticKeys:nj})],ud);var TT={};Object.defineProperty(TT,"__esModule",{value:!0});function oj(){for(var e=[],t=0;t{if(!t.has(e))throw TypeError("Cannot "+r)},Qg=(e,t,r)=>(OT(e,t,"read from private field"),r?r.call(e):t.get(e)),ij=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},sj=(e,t,r,n)=>(OT(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);function aj(){const[,e]=S.useState(ee());return S.useCallback(()=>{e(ee())},[])}var _T=S.createContext(null);function di(e){const t=S.useContext(_T),r=S.useRef(aj());te(t,{code:H.REACT_PROVIDER_CONTEXT});const{addHandler:n}=t;return S.useEffect(()=>{let o=e;if(o){if(hs(o)){const{autoUpdate:i}=o;o=i?()=>r.current():void 0}if(_e(o))return n("updated",o)}},[n,e]),t}function qr(e=!0){return di({autoUpdate:e}).active}function lj(e=!1){return di(e?{autoUpdate:!0}:void 0).attrs}function cc(){return di().chain.new()}function tr(){return di().commands}function tb(){return di({autoUpdate:!0}).getState().selection}function Wd(e,t=void 0,r){const{getExtension:n}=di(),o=S.useMemo(()=>n(e),[e,n]);let i;if(_e(t)?i=r?[o,...r]:[o,t]:i=t?[o,...Object.values(t)]:[],S.useEffect(()=>{_e(t)||!t||o.setOptions(t)},i),S.useEffect(()=>{if(_e(t))return t({addHandler:o.addHandler.bind(o),addCustomHandler:o.addCustomHandler.bind(o),extension:o})},i),!t)return o}function cj(e,t,r){const n=S.useCallback(({addHandler:o})=>o(t,r),[r,t]);return Wd(e,n)}function dm(e=!1){return di(e?{autoUpdate:!0}:void 0).helpers}var[uj,dj]=L9(({props:e})=>{const t=e.locale??"en",r=e.i18n??lm,n=e.supportedLocales??[t],o=r._.bind(r);return{locale:t,i18n:r,supportedLocales:n,t:o}});function Bw(e,t={}){const{core:r,react:n,...o}=t;return gI(e)?e:mI.create(()=>[...eE(e),new ud(n),...qV(r)],o)}function fj(e,t={}){const r=S.useRef(e),n=S.useRef(t),[o,i]=S.useState(()=>Bw(e,t));return r.current=e,n.current=t,S.useEffect(()=>o.addHandler("destroy",()=>{i(()=>Bw(r.current,n.current))}),[o]),o}var pj=typeof xr=="object"&&xr.__esModule&&xr.default?xr.default:xr,Ga,hj=class extends uI{constructor(e){if(super(e),ij(this,Ga,void 0),this.rootPropsConfig={called:!1,count:0},this.getRootProps=t=>this.internalGetRootProps(t,null),this.internalGetRootProps=(t,r)=>{this.rootPropsConfig.called=!0;const{refKey:n="ref",ref:o,...i}=t??ee();return{[n]:pj(o,this.onRef),key:this.uid,...i,children:r}},this.onRef=t=>{t&&(this.rootPropsConfig.count+=1,te(this.rootPropsConfig.count<=1,{code:H.REACT_GET_ROOT_PROPS,message:`Called ${this.rootPropsConfig.count} times`}),sj(this,Ga,t),this.onRefLoad())},this.manager.view){this.manager.view.setProps({state:this.manager.view.state,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0});return}this.manager.getExtension(pa).setOptions({placeholder:this.props.placeholder??""})}get name(){return"react"}update(e){return super.update(e),this}createView(e){return new b6(null,{state:e,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0,plugins:[]})}updateState({state:e,...t}){const{triggerChange:r=!0,tr:n,transactions:o}=t;if(this.props.state){const{onChange:i}=this.props;te(i,{code:H.REACT_CONTROLLED,message:"You are required to provide the `onChange` handler when creating a controlled editor."}),te(r,{code:H.REACT_CONTROLLED,message:"Controlled editors do not support `clearContent` or `setContent` where `triggerChange` is `true`. Update the `state` prop instead."}),this.previousStateOverride||(this.previousStateOverride=this.getState()),this.onChange({state:e,tr:n,transactions:o});return}!n&&!o&&(e=e.apply(e.tr.setMeta(Gx,{}))),this.view.updateState(e),r&&(o==null?void 0:o.length)!==0&&this.onChange({state:e,tr:n,transactions:o}),this.manager.onStateUpdate({previousState:this.previousState,state:e,tr:n,transactions:o})}updateControlledState(e,t){this.previousStateOverride=t,e=e.apply(e.tr.setMeta(Gx,{})),this.view.updateState(e),this.manager.onStateUpdate({previousState:this.previousState,state:e}),this.previousStateOverride=void 0}addProsemirrorViewToDom(e,t){this.props.insertPosition==="start"?e.insertBefore(t,e.firstChild):e.append(t)}onRefLoad(){te(Qg(this,Ga),{code:H.REACT_EDITOR_VIEW,message:"Something went wrong when initializing the text editor. Please check your setup."});const{autoFocus:e}=this.props;this.addProsemirrorViewToDom(Qg(this,Ga),this.view.dom),e&&this.focus(e),this.onChange(),this.addFocusListeners()}onUpdate(){this.view&&Qg(this,Ga)&&this.view.setProps({...this.view.props,editable:()=>this.props.editable??!0})}get frameworkOutput(){return{...this.baseOutput,getRootProps:this.getRootProps,portalContainer:this.manager.store.portalContainer}}resetRender(){this.rootPropsConfig.called=!1,this.rootPropsConfig.count=0}};Ga=new WeakMap;var AT=typeof document<"u"?S.useLayoutEffect:S.useEffect;function mj(e){const t=S.useRef();return AT(()=>{t.current=e}),t.current}function gj(e){const{manager:t,state:r}=e,{placeholder:n,editable:o}=e;S.useRef(!0).current&&!Zi(n)&&t.getExtension(ud).setOptions({placeholder:n}),S.useEffect(()=>{n!=null&&t.getExtension(ud).setOptions({placeholder:n})},[n,t]);const[s]=S.useState(()=>{if(r)return r;const l=t.createEmptyDoc(),[c,u]=ct(e.initialContent)?e.initialContent:[e.initialContent??l];return t.createState({content:c,selection:u})}),a=vj({initialEditorState:s,getProps:()=>e});return S.useEffect(()=>()=>{a.destroy()},[a]),S.useEffect(()=>{a.onUpdate()},[o,a]),yj(a),a.frameworkOutput}function vj(e){const t=S.useRef(e);t.current=e;const r=S.useMemo(()=>new hj(t.current),[]);return r.update(e),r}function yj(e){const{state:t}=e.props,r=S.useRef(!!t),n=mj(t);AT(()=>{const o=t?r.current===!0:r.current===!1;te(o,{code:H.REACT_CONTROLLED,message:r.current?"You have attempted to switch from a controlled to an uncontrolled editor. Once you set up an editor as a controlled editor it must always provide a `state` prop.":"You have provided a `state` prop to an uncontrolled editor. In order to set up your editor as controlled you must provide the `state` prop from the very first render."}),!(!t||t===n)&&e.updateControlledState(t,n??void 0)},[t,n,e])}function bj(e={}){const{content:t,document:r,selection:n,extensions:o,...i}=e,s=fj(o??(()=>[]),i),[a,l]=S.useState(()=>s.createState({selection:n,content:t??s.createEmptyDoc()})),c=S.useCallback(({state:d})=>{l(d)},[]),u=S.useCallback(()=>s.output,[s]);return S.useMemo(()=>({state:a,setState:l,manager:s,onChange:c,getContext:u}),[u,s,c,a])}var Fw={doc:!1,selection:!1,storedMark:!1};function xj(){const[e,t]=S.useState(Fw);return cj(zp,"applyState",S.useCallback(({tr:r})=>{const n={...Fw};r.docChanged&&(n.doc=!0),r.selectionSet&&(n.selection=!0),r.storedMarksSet&&(n.storedMark=!0),t(n)},[])),e}var G0=()=>L.createElement("div",{className:BF.EDITOR_WRAPPER,...di().getRootProps()}),kj=e=>(e.hook(),null);function wj(e){const{children:t,autoRender:r,i18n:n,locale:o,supportedLocales:i,hooks:s=[],...a}=e,l=gj(a),c=_9(l.portalContainer),u=r==="start"||r===!0||!t&&Zi(r),d=r==="end";return L.createElement(uj,{i18n:n,locale:o,supportedLocales:i},L.createElement(_T.Provider,{value:l},L.createElement(O9,{portals:c}),s.map((f,p)=>L.createElement(kj,{hook:f,key:p})),u&&L.createElement(G0,null),t,d&&L.createElement(G0,null)))}const Sj={black:"#000",white:"#fff"},dd=Sj,Ej={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},za=Ej,Cj={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},La=Cj,Mj={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Ia=Mj,Tj={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},Da=Tj,Oj={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},$a=Oj,_j={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},Tc=_j,Aj={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Nj=Aj;function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t{t[r]=NT(e[r])}),t}function un(e,t,r={clone:!0}){const n=r.clone?_({},e):e;return Wo(e)&&Wo(t)&&Object.keys(t).forEach(o=>{o!=="__proto__"&&(Wo(t[o])&&o in e&&Wo(e[o])?n[o]=un(e[o],t[o],r):r.clone?n[o]=Wo(t[o])?NT(t[o]):t[o]:n[o]=t[o])}),n}function Wl(e){let t="https://mui.com/production-error/?code="+e;for(let r=1;r<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=s.createElement(r,{is:n.is}):(e=s.createElement(r),r==="select"&&(s=e,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):e=s.createElementNS(e,r),e[bo]=t,e[ed]=n,VM(e,t,!1,!1),t.stateNode=e;e:{switch(s=l0(r,n),r){case"dialog":Ze("cancel",e),Ze("close",e),o=n;break;case"iframe":case"object":case"embed":Ze("load",e),o=n;break;case"video":case"audio":for(o=0;oVl&&(t.flags|=128,n=!0,Cc(i,!1),t.lanes=4194304)}else{if(!n)if(e=Qp(s),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Cc(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!ot)return ir(t),null}else 2*vt()-i.renderingStartTime>Vl&&r!==1073741824&&(t.flags|=128,n=!0,Cc(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(r=i.last,r!==null?r.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=vt(),t.sibling=null,r=at.current,Ye(at,n?r&1|2:r&1),t):(ir(t),null);case 22:case 23:return Iy(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?tn&1073741824&&(ir(t),t.subtreeFlags&6&&(t.flags|=8192)):ir(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function i9(e,t){switch(gy(t),t.tag){case 1:return $r(t.type)&&Wp(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bl(),tt(Dr),tt(pr),Cy(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ey(t),null;case 13:if(tt(at),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));$l()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return tt(at),null;case 4:return Bl(),null;case 10:return xy(t.type._context),null;case 22:case 23:return Iy(),null;case 24:return null;default:return null}}var bf=!1,ur=!1,s9=typeof WeakSet=="function"?WeakSet:Set,X=null;function ll(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){mt(e,t,n)}else r.current=null}function L0(e,t,r){try{r()}catch(n){mt(e,t,n)}}var pw=!1;function a9(e,t){if(y0=Fp,e=G5(),hy(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var o=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var p;d!==r||o!==0&&d.nodeType!==3||(a=s+o),d!==i||n!==0&&d.nodeType!==3||(l=s+n),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===r&&++c===o&&(a=s),f===i&&++u===n&&(l=s),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(b0={focusedElem:e,selectionRange:r},Fp=!1,X=t;X!==null;)if(t=X,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,X=e;else for(;X!==null;){t=X;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var m=h.memoizedProps,b=h.memoizedState,v=t.stateNode,g=v.getSnapshotBeforeUpdate(t.elementType===t.type?m:Gn(t.type,m),b);v.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(x){mt(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,X=e;break}X=t.return}return h=pw,pw=!1,h}function Mu(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&L0(t,r,i)}o=o.next}while(o!==n)}}function tm(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function I0(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function WM(e){var t=e.alternate;t!==null&&(e.alternate=null,WM(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[bo],delete t[ed],delete t[w0],delete t[j8],delete t[U8])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function KM(e){return e.tag===5||e.tag===3||e.tag===4}function hw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||KM(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function D0(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Up));else if(n!==4&&(e=e.child,e!==null))for(D0(e,t,r),e=e.sibling;e!==null;)D0(e,t,r),e=e.sibling}function $0(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for($0(e,t,r),e=e.sibling;e!==null;)$0(e,t,r),e=e.sibling}var qt=null,Yn=!1;function yi(e,t,r){for(r=r.child;r!==null;)qM(e,t,r),r=r.sibling}function qM(e,t,r){if(ko&&typeof ko.onCommitFiberUnmount=="function")try{ko.onCommitFiberUnmount(qh,r)}catch{}switch(r.tag){case 5:ur||ll(r,t);case 6:var n=qt,o=Yn;qt=null,yi(e,t,r),qt=n,Yn=o,qt!==null&&(Yn?(e=qt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):qt.removeChild(r.stateNode));break;case 18:qt!==null&&(Yn?(e=qt,r=r.stateNode,e.nodeType===8?Fg(e.parentNode,r):e.nodeType===1&&Fg(e,r),Yu(e)):Fg(qt,r.stateNode));break;case 4:n=qt,o=Yn,qt=r.stateNode.containerInfo,Yn=!0,yi(e,t,r),qt=n,Yn=o;break;case 0:case 11:case 14:case 15:if(!ur&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){o=n=n.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&L0(r,t,s),o=o.next}while(o!==n)}yi(e,t,r);break;case 1:if(!ur&&(ll(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){mt(r,t,a)}yi(e,t,r);break;case 21:yi(e,t,r);break;case 22:r.mode&1?(ur=(n=ur)||r.memoizedState!==null,yi(e,t,r),ur=n):yi(e,t,r);break;default:yi(e,t,r)}}function mw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new s9),t.forEach(function(n){var o=g9.bind(null,e,n);r.has(n)||(r.add(n),n.then(o,o))})}}function Un(e,t){var r=t.deletions;if(r!==null)for(var n=0;no&&(o=s),n&=~i}if(n=o,n=vt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*c9(n/1960))-n,10e?16:e,Hi===null)var n=!1;else{if(e=Hi,Hi=null,nh=0,Oe&6)throw Error(H(331));var o=Oe;for(Oe|=4,X=e.current;X!==null;){var i=X,s=i.child;if(X.flags&16){var a=i.deletions;if(a!==null){for(var l=0;lvt()-zy?Qs(e,0):Py|=r),Hr(e,t)}function tT(e,t){t===0&&(e.mode&1?(t=uf,uf<<=1,!(uf&130023424)&&(uf=4194304)):t=1);var r=wr();e=oi(e,t),e!==null&&(Fd(e,t,r),Hr(e,r))}function m9(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),tT(e,r)}function g9(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(H(314))}n!==null&&n.delete(t),tT(e,r)}var rT;rT=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Dr.current)zr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return zr=!1,n9(e,t,r);zr=!!(e.flags&131072)}else zr=!1,ot&&t.flags&1048576&&iM(t,Gp,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Qf(e,t),e=t.pendingProps;var o=Dl(t,pr.current);bl(t,r),o=Ty(null,t,n,e,o,r);var i=Oy();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,$r(n)?(i=!0,Kp(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,wy(t),o.updater=Zh,t.stateNode=o,o._reactInternals=t,O0(t,n,e,r),t=N0(null,t,n,!0,i,r)):(t.tag=0,ot&&i&&my(t),yr(null,t,o,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Qf(e,t),e=t.pendingProps,o=n._init,n=o(n._payload),t.type=n,o=t.tag=y9(n),e=Gn(n,e),o){case 0:t=A0(null,t,n,e,r);break e;case 1:t=uw(null,t,n,e,r);break e;case 11:t=lw(null,t,n,e,r);break e;case 14:t=cw(null,t,n,Gn(n.type,e),r);break e}throw Error(H(306,n,""))}return t;case 0:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Gn(n,o),A0(e,t,n,o,r);case 1:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Gn(n,o),uw(e,t,n,o,r);case 3:e:{if(HM(t),e===null)throw Error(H(387));n=t.pendingProps,i=t.memoizedState,o=i.element,cM(e,t),Xp(t,n,null,r);var s=t.memoizedState;if(n=s.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Fl(Error(H(423)),t),t=dw(e,t,n,r,o);break e}else if(n!==o){o=Fl(Error(H(424)),t),t=dw(e,t,n,r,o);break e}else for(ln=Gi(t.stateNode.containerInfo.firstChild),cn=t,ot=!0,Xn=null,r=pM(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if($l(),n===o){t=ii(e,t,r);break e}yr(e,t,n,r)}t=t.child}return t;case 5:return hM(t),e===null&&C0(t),n=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,x0(n,o)?s=null:i!==null&&x0(n,i)&&(t.flags|=32),$M(e,t),yr(e,t,s,r),t.child;case 6:return e===null&&C0(t),null;case 13:return BM(e,t,r);case 4:return Sy(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Hl(t,null,n,r):yr(e,t,n,r),t.child;case 11:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Gn(n,o),lw(e,t,n,o,r);case 7:return yr(e,t,t.pendingProps,r),t.child;case 8:return yr(e,t,t.pendingProps.children,r),t.child;case 12:return yr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,Ye(Yp,n._currentValue),n._currentValue=s,i!==null)if(so(i.value,s)){if(i.children===o.children&&!Dr.current){t=ii(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=ei(-1,r&-r),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),M0(i.return,r,t),a.lanes|=r;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(H(341));s.lanes|=r,a=s.alternate,a!==null&&(a.lanes|=r),M0(s,r,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}yr(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,n=t.pendingProps.children,bl(t,r),o=Pn(o),n=n(o),t.flags|=1,yr(e,t,n,r),t.child;case 14:return n=t.type,o=Gn(n,t.pendingProps),o=Gn(n.type,o),cw(e,t,n,o,r);case 15:return IM(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:Gn(n,o),Qf(e,t),t.tag=1,$r(n)?(e=!0,Kp(t)):e=!1,bl(t,r),dM(t,n,o),O0(t,n,o,r),N0(null,t,n,!0,e,r);case 19:return FM(e,t,r);case 22:return DM(e,t,r)}throw Error(H(156,t.tag))};function nT(e,t){return _5(e,t)}function v9(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function On(e,t,r,n){return new v9(e,t,r,n)}function $y(e){return e=e.prototype,!(!e||!e.isReactComponent)}function y9(e){if(typeof e=="function")return $y(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ny)return 11;if(e===oy)return 14}return 2}function Qi(e,t){var r=e.alternate;return r===null?(r=On(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function tp(e,t,r,n,o,i){var s=2;if(n=e,typeof e=="function")$y(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Za:return Zs(r.children,o,i,t);case ry:s=8,o|=8;break;case Q1:return e=On(12,r,t,o|2),e.elementType=Q1,e.lanes=i,e;case Z1:return e=On(13,r,t,o),e.elementType=Z1,e.lanes=i,e;case e0:return e=On(19,r,t,o),e.elementType=e0,e.lanes=i,e;case f5:return nm(r,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case u5:s=10;break e;case d5:s=9;break e;case ny:s=11;break e;case oy:s=14;break e;case _i:s=16,n=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=On(s,r,t,o),t.elementType=e,t.type=n,t.lanes=i,t}function Zs(e,t,r,n){return e=On(7,e,n,t),e.lanes=r,e}function nm(e,t,r,n){return e=On(22,e,n,t),e.elementType=f5,e.lanes=r,e.stateNode={isHidden:!1},e}function Yg(e,t,r){return e=On(6,e,null,t),e.lanes=r,e}function Jg(e,t,r){return t=On(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function b9(e,t,r,n,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ag(0),this.expirationTimes=Ag(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ag(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Hy(e,t,r,n,o,i,s,a,l){return e=new b9(e,t,r,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=On(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},wy(i),e}function x9(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(aT)}catch(e){console.error(e)}}aT(),i5.exports=hn;var lm=i5.exports;const wf=Dn(lm);var C9=Object.defineProperty,M9=Object.getOwnPropertyDescriptor,T9=(e,t,r,n)=>{for(var o=n>1?void 0:n?M9(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&C9(t,r,o),o},lT=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},ne=(e,t,r)=>(lT(e,t,"read from private field"),r?r.call(e):t.get(e)),en=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Qr=(e,t,r,n)=>(lT(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Gc,O9=class{constructor(){this.portals=new Map,en(this,Gc,Uh()),this.on=e=>ne(this,Gc).on("update",e),this.once=e=>{const t=ne(this,Gc).on("update",r=>{t(),e(r)});return t}}update(){ne(this,Gc).emit("update",this.portals)}render({Component:e,container:t}){const r=this.portals.get(t);this.portals.set(t,{Component:e,key:(r==null?void 0:r.key)??Cl()}),this.update()}forceUpdate(){for(const[e,{Component:t}]of this.portals)this.portals.set(e,{Component:t,key:Cl()})}remove(e){this.portals.delete(e),this.update()}};Gc=new WeakMap;var _9=e=>{const{portals:t}=e;return I.createElement(I.Fragment,null,t.map(([r,{Component:n,key:o}])=>lm.createPortal(I.createElement(n,null),r,o)))};function A9(e){const[t,r]=S.useState(()=>Array.from(e.portals.entries()));return S.useEffect(()=>e.on(n=>{r(Array.from(n.entries()))}),[e]),S.useMemo(()=>t,[t])}var st,Yc,_s,Jc,rp,Xc,Ka,Qc,np,Ho,vr,j0,cT=class{constructor({getPosition:e,node:t,portalContainer:r,view:n,ReactComponent:o,options:i}){en(this,st,void 0),en(this,Yc,[]),en(this,_s,void 0),en(this,Jc,void 0),en(this,rp,void 0),en(this,Xc,void 0),en(this,Ka,void 0),en(this,Qc,!1),en(this,np,void 0),en(this,Ho,void 0),en(this,vr,void 0),en(this,j0,l=>{l&&(re(ne(this,Ho),{code:B.REACT_NODE_VIEW,message:`You have applied a ref to a node view provided for '${ne(this,st).type.name}' which doesn't support content.`}),l.append(ne(this,Ho)))}),this.Component=()=>{const l=ne(this,rp);return re(l,{code:B.REACT_NODE_VIEW,message:`The custom react node view provided for ${ne(this,st).type.name} doesn't have a valid ReactComponent`}),I.createElement(l,{updateAttributes:this.updateAttributes,selected:this.selected,view:ne(this,_s),getPosition:ne(this,Xc),node:ne(this,st),forwardRef:ne(this,j0),decorations:ne(this,Yc)})},this.updateAttributes=l=>{if(!ne(this,_s).editable)return;const c=ne(this,Xc).call(this);if(c==null)return;const u=ne(this,_s).state.tr.setNodeMarkup(c,void 0,{...ne(this,st).attrs,...l});ne(this,_s).dispatch(u)},re(_e(e),{message:"You are attempting to use a node view for a mark type. This is not supported yet. Please check your configuration."}),Qr(this,st,t),Qr(this,_s,n),Qr(this,Jc,r),Qr(this,rp,o),Qr(this,Xc,e),Qr(this,Ka,i),Qr(this,vr,this.createDom());const{contentDOM:s,wrapper:a}=this.createContentDom()??{};Qr(this,np,s??void 0),Qr(this,Ho,a),ne(this,Ho)&&ne(this,vr).append(ne(this,Ho)),this.setDomAttributes(ne(this,st),ne(this,vr)),this.Component.displayName=j4(`${ne(this,st).type.name}NodeView`),this.renderComponent()}static create(e){const{portalContainer:t,ReactComponent:r,options:n}=e;return(o,i,s)=>new cT({options:n,node:o,view:i,getPosition:s,portalContainer:t,ReactComponent:r})}get selected(){return ne(this,Qc)}get contentDOM(){return ne(this,np)}get dom(){return ne(this,vr)}renderComponent(){ne(this,Jc).render({Component:this.Component,container:ne(this,vr)})}createDom(){const{defaultBlockNode:e,defaultInlineNode:t}=ne(this,Ka),r=ne(this,st).isInline?document.createElement(t):document.createElement(e);return r.classList.add(`${Qx(ne(this,st).type.name)}-node-view-wrapper`),r}createContentDom(){var e,t;if(ne(this,st).isLeaf)return;const r=(t=(e=ne(this,st).type.spec).toDOM)==null?void 0:t.call(e,ne(this,st));if(!r)return;const{contentDOM:n,dom:o}=an.renderSpec(document,r);let i;if(et(o))return i=o,o===n&&(i=document.createElement("span"),i.classList.add(`${Qx(ne(this,st).type.name)}-node-view-content-wrapper`),i.append(n)),et(n),{wrapper:i,contentDOM:n}}update(e,t){return Hh({types:ne(this,st).type,node:e})?(ne(this,st)===e&&ne(this,Yc)===t||(ne(this,st).sameMarkup(e)||this.setDomAttributes(e,ne(this,vr)),Qr(this,st,e),Qr(this,Yc,t),this.renderComponent()),!0):!1}setDomAttributes(e,t){const{toDOM:r}=ne(this,st).type.spec;let n=e.attrs;if(r){const o=r(e);if(oe(o)||N9(o))return;ps(o[1])&&(n=o[1])}for(const[o,i]of At(n))t.setAttribute(o,i)}selectNode(){Qr(this,Qc,!0),ne(this,vr)&&ne(this,vr).classList.add(Gx),this.renderComponent()}deselectNode(){Qr(this,Qc,!1),ne(this,vr)&&ne(this,vr).classList.remove(Gx),this.renderComponent()}destroy(){ne(this,Jc).remove(ne(this,vr))}ignoreMutation(e){return e.type==="selection"?!ne(this,st).type.spec.selectable:ne(this,Ho)?!ne(this,Ho).contains(e.target):!0}stopEvent(e){var t;if(!ne(this,vr))return!1;if(_e(ne(this,Ka).stopEvent))return ne(this,Ka).stopEvent({event:e});const r=e.target;if(!(ne(this,vr).contains(r)&&!((t=this.contentDOM)!=null&&t.contains(r))))return!1;const o=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!o)return!0;const s=!!ne(this,st).type.spec.draggable,a=ce.isSelectable(ne(this,st)),l=e.type==="copy",c=e.type==="paste",u=e.type==="cut",d=e.type==="mousedown",f=e.type.startsWith("drag");return!s&&a&&f&&e.preventDefault(),!(f||o||l||c||u||d&&a)}},Sw=cT;st=new WeakMap;Yc=new WeakMap;_s=new WeakMap;Jc=new WeakMap;rp=new WeakMap;Xc=new WeakMap;Ka=new WeakMap;Qc=new WeakMap;np=new WeakMap;Ho=new WeakMap;vr=new WeakMap;j0=new WeakMap;function N9(e){return Np(e)||ps(e)&&Np(e.dom)}var ad=class extends Ve{constructor(){super(...arguments),this.portalContainer=new O9}get name(){return"reactComponent"}onCreate(){this.store.setStoreKey("portalContainer",this.portalContainer)}createNodeViews(){const e=ee(),t=this.store.managerSettings.nodeViewComponents??{};for(const n of this.store.extensions)!n.ReactComponent||!Hd(n)||n.reactComponentEnvironment==="ssr"||(e[n.name]=Sw.create({options:this.options,ReactComponent:n.ReactComponent,portalContainer:this.portalContainer}));const r=At({...this.options.nodeViewComponents,...t});for(const[n,o]of r)e[n]=Sw.create({options:this.options,ReactComponent:o,portalContainer:this.portalContainer});return e}};ad=T9([pe({defaultOptions:{defaultBlockNode:"div",defaultInlineNode:"span",defaultContentNode:"span",defaultEnvironment:"both",nodeViewComponents:{},stopEvent:null},staticKeys:["defaultBlockNode","defaultInlineNode","defaultContentNode","defaultEnvironment"]})],ad);function R9(e){const t=S.createContext(null),r=P9(t);return[o=>{const i=e(o);return I.createElement(t.Provider,{value:i},o.children)},r,t]}function P9(e){return(t,r)=>{const n=S.useContext(e),o=z9(n);if(!n)throw new Error("`useContextHook` must be placed inside the `Provider` returned by the `createContextState` method");if(!t)return n;if(typeof t!="function")throw new TypeError("invalid arguments passed to `useContextHook`. This hook must be called with zero arguments, a getter function or a path string.");const i=t(n);if(!o||!r)return i;const s=t(o);return r(s,i)?s:i}}function z9(e){const t=S.useRef();return L9(()=>{t.current=e}),t.current}var L9=typeof document<"u"?S.useLayoutEffect:S.useEffect;function I9(e,t){return R9(r=>{const n=S.useRef(null),o=S.useRef(),i=t==null?void 0:t(r),[s,a]=S.useState(()=>e({get:Ew(n),set:Cw(o),previousContext:void 0,props:r,state:i})),l=[...Object.values(r),i];return S.useEffect(()=>{l.length!==0&&a(c=>e({get:Ew(n),set:Cw(o),previousContext:c,props:r,state:i}))},l),n.current=s,o.current=a,s})}function Ew(e){return t=>{if(!e.current)throw new Error("`get` called outside of function scope. `get` can only be called within a function.");if(!t)return e.current;if(typeof t!="function")throw new TypeError("Invalid arguments passed to `useContextHook`. The hook must be called with zero arguments, a getter function or a path string.");return t(e.current)}}function Cw(e){return t=>{if(!e.current)throw new Error("`set` called outside of function scope. `set` can only be called within a function.");e.current(r=>({...r,...typeof t=="function"?t(r):t}))}}var uT={},dT={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.errorMessages=e.ErrorType=void 0;var t;(function(r){r.MalformedUnicode="MALFORMED_UNICODE",r.MalformedHexadecimal="MALFORMED_HEXADECIMAL",r.CodePointLimit="CODE_POINT_LIMIT",r.OctalDeprecation="OCTAL_DEPRECATION",r.EndOfString="END_OF_STRING"})(t=e.ErrorType||(e.ErrorType={})),e.errorMessages=new Map([[t.MalformedUnicode,"malformed Unicode character escape sequence"],[t.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[t.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[t.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[t.EndOfString,"malformed escape sequence at end of string"]])})(dT);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.unraw=e.errorMessages=e.ErrorType=void 0;const t=dT;Object.defineProperty(e,"ErrorType",{enumerable:!0,get:function(){return t.ErrorType}}),Object.defineProperty(e,"errorMessages",{enumerable:!0,get:function(){return t.errorMessages}});function r(p){return!p.match(/[^a-f0-9]/i)?parseInt(p,16):NaN}function n(p,h,m){const b=r(p);if(Number.isNaN(b)||m!==void 0&&m!==p.length)throw new SyntaxError(t.errorMessages.get(h));return b}function o(p){const h=n(p,t.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(h)}function i(p,h){const m=n(p,t.ErrorType.MalformedUnicode,4);if(h!==void 0){const b=n(h,t.ErrorType.MalformedUnicode,4);return String.fromCharCode(m,b)}return String.fromCharCode(m)}function s(p){return p.charAt(0)==="{"&&p.charAt(p.length-1)==="}"}function a(p){if(!s(p))throw new SyntaxError(t.errorMessages.get(t.ErrorType.MalformedUnicode));const h=p.slice(1,-1),m=n(h,t.ErrorType.MalformedUnicode);try{return String.fromCodePoint(m)}catch(b){throw b instanceof RangeError?new SyntaxError(t.errorMessages.get(t.ErrorType.CodePointLimit)):b}}function l(p,h=!1){if(h)throw new SyntaxError(t.errorMessages.get(t.ErrorType.OctalDeprecation));const m=parseInt(p,8);return String.fromCharCode(m)}const c=new Map([["b","\b"],["f","\f"],["n",` +`],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function u(p){return c.get(p)||p}const d=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function f(p,h=!1){return p.replace(d,function(m,b,v,g,y,x,k,w,E){if(b!==void 0)return"\\";if(v!==void 0)return o(v);if(g!==void 0)return a(g);if(y!==void 0)return i(y,x);if(k!==void 0)return i(k);if(w==="0")return"\0";if(w!==void 0)return l(w,!h);if(E!==void 0)return u(E);throw new SyntaxError(t.errorMessages.get(t.ErrorType.EndOfString))})}e.unraw=f,e.default=f})(uT);const D9=Dn(uT),Yo=e=>typeof e=="string",$9=e=>typeof e=="function",Mw=new Map;function jy(e){return[...Array.isArray(e)?e:[e],"en"]}function fT(e,t,r){const n=jy(e);return sh(()=>ah("date",n,r),()=>new Intl.DateTimeFormat(n,r)).format(Yo(t)?new Date(t):t)}function U0(e,t,r){const n=jy(e);return sh(()=>ah("number",n,r),()=>new Intl.NumberFormat(n,r)).format(t)}function Tw(e,t,r,{offset:n=0,...o}){const i=jy(e),s=t?sh(()=>ah("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):sh(()=>ah("plural-cardinal",i),()=>new Intl.PluralRules(i,{type:"cardinal"}));return o[r]??o[s.select(r-n)]??o.other}function sh(e,t){const r=e();let n=Mw.get(r);return n||(n=t(),Mw.set(r,n)),n}function ah(e,t,r){const n=t.join("-");return`${e}-${n}-${JSON.stringify(r)}`}const pT=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g,H9=(e,t,r={})=>{t=t||e;const n=i=>Yo(i)?r[i]||{style:i}:i,o=(i,s)=>{const a=Object.keys(r).length?n("number"):{},l=U0(t,i,a);return s.replace("#",l)};return{plural:(i,s)=>{const{offset:a=0}=s,l=Tw(t,!1,i,s);return o(i-a,l)},selectordinal:(i,s)=>{const{offset:a=0}=s,l=Tw(t,!0,i,s);return o(i-a,l)},select:(i,s)=>s[i]??s.other,number:(i,s)=>U0(t,i,n(s)),date:(i,s)=>fT(t,i,n(s)),undefined:i=>i}};function B9(e,t,r){return(n,o={})=>{const i=H9(t,r,o),s=l=>Array.isArray(l)?l.reduce((c,u)=>{if(Yo(u))return c+u;const[d,f,p]=u;let h={};p!=null&&!Yo(p)?Object.keys(p).forEach(b=>{h[b]=s(p[b])}):h=p;const m=i[f](n[d],h);return m==null?c:c+m},""):l,a=s(e);return Yo(a)&&pT.test(a)?D9(a.trim()):Yo(a)?a.trim():a}}var F9=Object.defineProperty,V9=(e,t,r)=>t in e?F9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,j9=(e,t,r)=>(V9(e,typeof t!="symbol"?t+"":t,r),r);class U9{constructor(){j9(this,"_events",{})}on(t,r){return this._hasEvent(t)||(this._events[t]=[]),this._events[t].push(r),()=>this.removeListener(t,r)}removeListener(t,r){if(!this._hasEvent(t))return;const n=this._events[t].indexOf(r);~n&&this._events[t].splice(n,1)}emit(t,...r){this._hasEvent(t)&&this._events[t].map(n=>n.apply(this,r))}_hasEvent(t){return Array.isArray(this._events[t])}}var W9=Object.defineProperty,K9=(e,t,r)=>t in e?W9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pa=(e,t,r)=>(K9(e,typeof t!="symbol"?t+"":t,r),r);class q9 extends U9{constructor(t){super(),Pa(this,"_locale"),Pa(this,"_locales"),Pa(this,"_localeData"),Pa(this,"_messages"),Pa(this,"_missing"),Pa(this,"t",this._.bind(this)),this._messages={},this._localeData={},t.missing!=null&&(this._missing=t.missing),t.messages!=null&&this.load(t.messages),t.localeData!=null&&this.loadLocaleData(t.localeData),(t.locale!=null||t.locales!=null)&&this.activate(t.locale,t.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(t,r){this._localeData[t]==null?this._localeData[t]=r:Object.assign(this._localeData[t],r)}loadLocaleData(t,r){r!=null?this._loadLocaleData(t,r):Object.keys(t).forEach(n=>this._loadLocaleData(n,t[n])),this.emit("change")}_load(t,r){this._messages[t]==null?this._messages[t]=r:Object.assign(this._messages[t],r)}load(t,r){r!=null?this._load(t,r):Object.keys(t).forEach(n=>this._load(n,t[n])),this.emit("change")}loadAndActivate({locale:t,locales:r,messages:n}){this._locale=t,this._locales=r||void 0,this._messages[this._locale]=n,this.emit("change")}activate(t,r){this._locale=t,this._locales=r,this.emit("change")}_(t,r={},{message:n,formats:o}={}){Yo(t)||(r=t.values||r,n=t.message,t=t.id);const i=!this.messages[t],s=this._missing;if(s&&i)return $9(s)?s(this._locale,t):s;i&&this.emit("missing",{id:t,locale:this._locale});let a=this.messages[t]||n||t;return Yo(a)&&pT.test(a)?JSON.parse(`"${a}"`):Yo(a)?a:B9(a,this._locale,this._locales)(r,o)}date(t,r){return fT(this._locales||this._locale,t,r)}number(t,r){return U0(this._locales||this._locale,t,r)}}function G9(e={}){return new q9(e)}const cm=G9();function W(e,t){return t?"other":e==1?"one":"other"}function di(e,t){return t?"other":e==0||e==1?"one":"other"}function Kr(e,t){var r=String(e).split("."),n=!r[1];return t?"other":e==1&&n?"one":"other"}function Le(e,t){return"other"}function bs(e,t){return t?"other":e==1?"one":e==2?"two":"other"}const Y9=Le,J9=W,X9=di;function Q9(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const Z9=W;function eD(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2);return t?"other":e==0?"zero":e==1?"one":e==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function tD(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2);return t?"other":e==0?"zero":e==1?"one":e==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function rD(e,t){return t?e==1||e==5||e==7||e==8||e==9||e==10?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const nD=W,oD=Kr;function iD(e,t){var r=String(e).split("."),n=r[0],o=n.slice(-1),i=n.slice(-2),s=n.slice(-3);return t?o==1||o==2||o==5||o==7||o==8||i==20||i==50||i==70||i==80?"one":o==3||o==4||s==100||s==200||s==300||s==400||s==500||s==600||s==700||s==800||s==900?"few":n==0||o==6||i==40||i==60||i==90?"many":"other":e==1?"one":"other"}function sD(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2);return t?(o==2||o==3)&&i!=12&&i!=13?"few":"other":o==1&&i!=11?"one":o>=2&&o<=4&&(i<12||i>14)?"few":n&&o==0||o>=5&&o<=9||i>=11&&i<=14?"many":"other"}const aD=W,lD=W,cD=W,uD=di,dD=Le;function fD(e,t){return t?e==1||e==5||e==7||e==8||e==9||e==10?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const pD=Le;function hD(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2),s=n&&r[0].slice(-6);return t?"other":o==1&&i!=11&&i!=71&&i!=91?"one":o==2&&i!=12&&i!=72&&i!=92?"two":(o==3||o==4||o==9)&&(i<10||i>19)&&(i<70||i>79)&&(i<90||i>99)?"few":e!=0&&n&&s==0?"many":"other"}const mD=W;function gD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function vD(e,t){var r=String(e).split("."),n=!r[1];return t?e==1||e==3?"one":e==2?"two":e==4?"few":"other":e==1&&n?"one":"other"}const yD=W;function bD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?"other":i&&(n==1||n==2||n==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const xD=W,kD=W,wD=W;function SD(e,t){var r=String(e).split("."),n=r[0],o=!r[1];return t?"other":e==1&&o?"one":n>=2&&n<=4&&o?"few":o?"other":"many"}function ED(e,t){return t?e==0||e==7||e==8||e==9?"zero":e==1?"one":e==2?"two":e==3||e==4?"few":e==5||e==6?"many":"other":e==0?"zero":e==1?"one":e==2?"two":e==3?"few":e==6?"many":"other"}function CD(e,t){var r=String(e).split("."),n=r[0],o=Number(r[0])==e;return t?"other":e==1||!o&&(n==0||n==1)?"one":"other"}const MD=Kr;function TD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-2),a=o.slice(-2);return t?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}const OD=W,_D=Le,AD=W,ND=W;function RD(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?i==1&&s!=11?"one":i==2&&s!=12?"two":i==3&&s!=13?"few":"other":e==1&&n?"one":"other"}const PD=W,zD=W,LD=Kr,ID=W;function DD(e,t){return t?"other":e>=0&&e<=1?"one":"other"}function $D(e,t){return t?"other":e>=0&&e<2?"one":"other"}const HD=Kr;function BD(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?e==1?"one":"other":i&&(n==1||n==2||n==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const FD=W;function VD(e,t){return t?e==1?"one":"other":e>=0&&e<2?"one":"other"}const jD=W,UD=Kr;function WD(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?e==1?"one":"other":e==1?"one":e==2?"two":n&&e>=3&&e<=6?"few":n&&e>=7&&e<=10?"many":"other"}function KD(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?e==1||e==11?"one":e==2||e==12?"two":e==3||e==13?"few":"other":e==1||e==11?"one":e==2||e==12?"two":n&&e>=3&&e<=10||n&&e>=13&&e<=19?"few":"other"}const qD=Kr,GD=W;function YD(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}const JD=di;function XD(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":o&&i==1?"one":o&&i==2?"two":o&&(s==0||s==20||s==40||s==60||s==80)?"few":o?"other":"many"}const QD=W,ZD=W;function e7(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1);return t?"other":e==1&&o?"one":n==2&&o?"two":o&&(e<0||e>10)&&i&&s==0?"many":"other"}function t7(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e>=0&&e<=1?"one":"other"}function r7(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function n7(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-2),a=o.slice(-2);return t?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}function o7(e,t){return t?e==1||e==5?"one":"other":e==1?"one":"other"}function i7(e,t){return t?e==1?"one":"other":e>=0&&e<2?"one":"other"}const s7=Kr,a7=Le,l7=Le,c7=Le,u7=Kr;function d7(e,t){var r=String(e).split("."),n=r[0],o=Number(r[0])==e,i=n.slice(-1),s=n.slice(-2);return t?"other":o&&i==1&&s!=11||!o?"one":"other"}function f7(e,t){var r=String(e).split("."),n=!r[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&n?"one":"other"}const p7=bs;function h7(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1);return t?"other":e==1&&o?"one":n==2&&o?"two":o&&(e<0||e>10)&&i&&s==0?"many":"other"}const m7=Le,g7=Le,v7=W,y7=Kr,b7=W,x7=Le,k7=Le;function w7(e,t){var r=String(e).split("."),n=r[0],o=n.slice(-2);return t?n==1?"one":n==0||o>=2&&o<=20||o==40||o==60||o==80?"many":"other":e==1?"one":"other"}function S7(e,t){return t?"other":e>=0&&e<2?"one":"other"}const E7=W,C7=W,M7=Le,T7=Le;function O7(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1);return t?o==6||o==9||n&&o==0&&e!=0?"many":"other":e==1?"one":"other"}const _7=W,A7=W,N7=Le;function R7(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const P7=Le,z7=W,L7=W;function I7(e,t){return t?"other":e==0?"zero":e==1?"one":"other"}const D7=W;function $7(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2),i=n&&r[0].slice(-3),s=n&&r[0].slice(-5),a=n&&r[0].slice(-6);return t?n&&e>=1&&e<=4||o>=1&&o<=4||o>=21&&o<=24||o>=41&&o<=44||o>=61&&o<=64||o>=81&&o<=84?"one":e==5||o==5?"many":"other":e==0?"zero":e==1?"one":o==2||o==22||o==42||o==62||o==82||n&&i==0&&(s>=1e3&&s<=2e4||s==4e4||s==6e4||s==8e4)||e!=0&&a==1e5?"two":o==3||o==23||o==43||o==63||o==83?"few":e!=1&&(o==1||o==21||o==41||o==61||o==81)?"many":"other"}const H7=W;function B7(e,t){var r=String(e).split("."),n=r[0];return t?"other":e==0?"zero":(n==0||n==1)&&e!=0?"one":"other"}const F7=W,V7=W,j7=Le,U7=di;function W7(e,t){return t&&e==1?"one":"other"}function K7(e,t){var r=String(e).split("."),n=r[1]||"",o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?"other":i==1&&(s<11||s>19)?"one":i>=2&&i<=9&&(s<11||s>19)?"few":n!=0?"many":"other"}function q7(e,t){var r=String(e).split("."),n=r[1]||"",o=n.length,i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-2),c=n.slice(-1);return t?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const G7=W,Y7=di,J7=W;function X7(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?s==1&&a!=11?"one":s==2&&a!=12?"two":(s==7||s==8)&&a!=17&&a!=18?"many":"other":i&&s==1&&a!=11||l==1&&c!=11?"one":"other"}const Q7=W,Z7=W;function e$(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-2);return t?e==1?"one":"other":e==1&&n?"one":!n||e==0||i>=2&&i<=19?"few":"other"}function t$(e,t){return t?e==1?"one":e==2||e==3?"two":e==4?"few":"other":e==1?"one":"other"}function r$(e,t){return t&&e==1?"one":"other"}function n$(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2);return t?"other":e==1?"one":e==0||o>=2&&o<=10?"few":o>=11&&o<=19?"many":"other"}const o$=Le,i$=W,s$=bs,a$=W,l$=W;function c$(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?n&&e>=1&&e<=4?"one":"other":e==1?"one":"other"}const u$=Kr,d$=W,f$=W,p$=W,h$=Le,m$=W,g$=di,v$=W,y$=W,b$=W;function x$(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?e==1||e==5||n&&e>=7&&e<=9?"one":e==2||e==3?"two":e==4?"few":e==6?"many":"other":e==1?"one":"other"}const k$=W,w$=Le,S$=di,E$=W;function C$(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":e==1&&o?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&n!=1&&(i==0||i==1)||o&&i>=5&&i<=9||o&&s>=12&&s<=14?"many":"other"}function M$(e,t){var r=String(e).split("."),n=r[1]||"",o=n.length,i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-2),c=n.slice(-1);return t?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const T$=W;function O$(e,t){var r=String(e).split("."),n=r[0];return t?"other":n==0||n==1?"one":"other"}const _$=Kr,A$=W;function N$(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-2);return t?e==1?"one":"other":e==1&&n?"one":!n||e==0||i>=2&&i<=19?"few":"other"}const R$=W,P$=Le;function z$(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":o&&i==1&&s!=11?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&i==0||o&&i>=5&&i<=9||o&&s>=11&&s<=14?"many":"other"}const L$=W,I$=Le,D$=W;function $$(e,t){var r=String(e).split("."),n=!r[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&n?"one":"other"}function H$(e,t){var r=String(e).split("."),n=!r[1];return t?e==11||e==8||e==80||e==800?"many":"other":e==1&&n?"one":"other"}const B$=W,F$=W,V$=bs,j$=W,U$=Le,W$=Le;function K$(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function q$(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?"other":e>=0&&e<=1?"one":n&&e>=2&&e<=10?"few":"other"}function G$(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"";return t?"other":e==0||e==1||n==0&&o==1?"one":"other"}function Y$(e,t){var r=String(e).split("."),n=r[0],o=!r[1];return t?"other":e==1&&o?"one":n>=2&&n<=4&&o?"few":o?"other":"many"}function J$(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-2);return t?"other":o&&i==1?"one":o&&i==2?"two":o&&(i==3||i==4)||!o?"few":"other"}const X$=bs,Q$=bs,Z$=bs,eH=bs,tH=bs,rH=W,nH=W;function oH(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2);return t?e==1?"one":o==4&&i!=14?"many":"other":e==1?"one":"other"}function iH(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}const sH=W,aH=W,lH=W,cH=Le;function uH(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?(i==1||i==2)&&s!=11&&s!=12?"one":"other":e==1&&n?"one":"other"}const dH=Kr,fH=W,pH=W,hH=W,mH=W,gH=Le,vH=di,yH=W;function bH(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1);return t?o==6||o==9||e==10?"few":"other":e==1?"one":"other"}function xH(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?e==1?"one":"other":i&&(n==1||n==2||n==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const kH=W,wH=Le,SH=W,EH=W;function CH(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?"other":e==0||e==1||n&&e>=11&&e<=99?"one":"other"}const MH=W;function TH(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-1),c=n.slice(-2);return t?s==3&&a!=13?"few":"other":o&&l==1&&c!=11?"one":o&&l>=2&&l<=4&&(c<12||c>14)?"few":o&&l==0||o&&l>=5&&l<=9||o&&c>=11&&c<=14?"many":"other"}const OH=Kr,_H=W,AH=W;function NH(e,t){return t&&e==1?"one":"other"}const RH=W,PH=W,zH=di,LH=W,IH=Le,DH=W,$H=W,HH=Kr,BH=Le,FH=Le,VH=Le;function jH(e,t){return t?"other":e>=0&&e<=1?"one":"other"}const UH=Object.freeze(Object.defineProperty({__proto__:null,_in:Y9,af:J9,ak:X9,am:Q9,an:Z9,ar:eD,ars:tD,as:rD,asa:nD,ast:oD,az:iD,be:sD,bem:aD,bez:lD,bg:cD,bho:uD,bm:dD,bn:fD,bo:pD,br:hD,brx:mD,bs:gD,ca:vD,ce:yD,ceb:bD,cgg:xD,chr:kD,ckb:wD,cs:SD,cy:ED,da:CD,de:MD,dsb:TD,dv:OD,dz:_D,ee:AD,el:ND,en:RD,eo:PD,es:zD,et:LD,eu:ID,fa:DD,ff:$D,fi:HD,fil:BD,fo:FD,fr:VD,fur:jD,fy:UD,ga:WD,gd:KD,gl:qD,gsw:GD,gu:YD,guw:JD,gv:XD,ha:QD,haw:ZD,he:e7,hi:t7,hr:r7,hsb:n7,hu:o7,hy:i7,ia:s7,id:a7,ig:l7,ii:c7,io:u7,is:d7,it:f7,iu:p7,iw:h7,ja:m7,jbo:g7,jgo:v7,ji:y7,jmc:b7,jv:x7,jw:k7,ka:w7,kab:S7,kaj:E7,kcg:C7,kde:M7,kea:T7,kk:O7,kkj:_7,kl:A7,km:N7,kn:R7,ko:P7,ks:z7,ksb:L7,ksh:I7,ku:D7,kw:$7,ky:H7,lag:B7,lb:F7,lg:V7,lkt:j7,ln:U7,lo:W7,lt:K7,lv:q7,mas:G7,mg:Y7,mgo:J7,mk:X7,ml:Q7,mn:Z7,mo:e$,mr:t$,ms:r$,mt:n$,my:o$,nah:i$,naq:s$,nb:a$,nd:l$,ne:c$,nl:u$,nn:d$,nnh:f$,no:p$,nqo:h$,nr:m$,nso:g$,ny:v$,nyn:y$,om:b$,or:x$,os:k$,osa:w$,pa:S$,pap:E$,pl:C$,prg:M$,ps:T$,pt:O$,pt_PT:_$,rm:A$,ro:N$,rof:R$,root:P$,ru:z$,rwk:L$,sah:I$,saq:D$,sc:$$,scn:H$,sd:B$,sdh:F$,se:V$,seh:j$,ses:U$,sg:W$,sh:K$,shi:q$,si:G$,sk:Y$,sl:J$,sma:X$,smi:Q$,smj:Z$,smn:eH,sms:tH,sn:rH,so:nH,sq:oH,sr:iH,ss:sH,ssy:aH,st:lH,su:cH,sv:uH,sw:dH,syr:fH,ta:pH,te:hH,teo:mH,th:gH,ti:vH,tig:yH,tk:bH,tl:xH,tn:kH,to:wH,tr:SH,ts:EH,tzm:CH,ug:MH,uk:TH,ur:OH,uz:_H,ve:AH,vi:NH,vo:RH,vun:PH,wa:zH,wae:LH,wo:IH,xh:DH,xog:$H,yi:HH,yo:BH,yue:FH,zh:VH,zu:jH},Symbol.toStringTag,{value:"Module"}));var WH=Object.defineProperty,KH=Object.getOwnPropertyDescriptor,qH=Object.getOwnPropertyNames,GH=Object.prototype.hasOwnProperty,Ow=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of qH(t))!GH.call(e,o)&&o!==r&&WH(e,o,{get:()=>t[o],enumerable:!(n=KH(t,o))||n.enumerable});return e},YH=(e,t,r)=>(Ow(e,t,"default"),r&&Ow(r,t,"default")),JH=JSON.parse('{"extension.command.toggle-upper-case.label":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"extension.table.column_count":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"extension.table.row_count":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.toggle-columns.description":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"extension.command.toggle-columns.label":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"extension.command.set-text-direction.label":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"extension.command.set-text-direction.description":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"extension.command.toggle-heading.label":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"extension.command.toggle-callout.description":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"extension.command.toggle-callout.label":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"extension.command.toggle-code-block.description":"Add a code block","extension.command.add-annotation.label":"Add annotation","extension.command.toggle-blockquote.description":"Add blockquote formatting to the selected text","extension.command.toggle-bold.description":"Add bold formatting to the selected text","extension.command.toggle-code.description":"Add inline code formatting to the selected text","keyboard.shortcut.alt":"Alt","keyboard.shortcut.arrowDown":"Arrow Down","keyboard.shortcut.arrowLeft":"Arrow Left","keyboard.shortcut.arrowRight":"Arrow Right","keyboard.shortcut.arrowUp":"Arrow Up","keyboard.shortcut.backspace":"Backspace","ui.text-color.black":"Black","extension.command.toggle-blockquote.label":"Blockquote","ui.text-color.blue":"Blue","ui.text-color.blue.hue":["Blue ",["hue"]],"extension.command.toggle-bold.label":"Bold","extension.command.toggle-bullet-list.description":"Bulleted list","keyboard.shortcut.capsLock":"Caps Lock","extension.command.center-align.label":"Center align","extension.command.toggle-code.label":"Code","extension.command.toggle-code-block.label":"Codeblock","keyboard.shortcut.command":"Command","QcPNd6":"Image description","ogrUzJ":"Add a short description here.","yqdyzr":"Image","6/02F4":"Image source","X8H91v":"Image","zhQ7Zt":"Italic","ZL7E7l":"Underline","keyboard.shortcut.control":"Control","extension.command.convert-paragraph.description":"Convert current block into a paragraph block.","extension.command.convert-paragraph.label":"Convert Paragraph","extension.command.copy.label":"Copy","extension.command.copy.description":"Copy the selected text","extension.command.create-table.description":"Create a table with set number of rows and columns.","extension.command.create-table.label":"Create table","extension.command.cut.label":"Cut","extension.command.cut.description":"Cut the selected text","ui.text-color.cyan":"Cyan","ui.text-color.cyan.hue":["Cyan ",["hue"]],"extension.command.decrease-font-size.label":"Decrease","extension.command.decrease-indent.label":"Decrease indentation","extension.command.decrease-font-size.description":"Decrease the font size.","keyboard.shortcut.delete":"Delete","extension.command.insert-horizontal-rule.label":"Divider","keyboard.shortcut.end":"End","keyboard.shortcut.escape":"Enter","keyboard.shortcut.enter":"Enter","6PjrOF":"Add annotation","OTq5WC":"Center align","oeZ3ox":"Convert current block into a paragraph block.","m1khs+":"Convert Paragraph","w/1U+3":"Copy the selected text","kdodi0":"Copy","k0KR/u":"Create a table with set number of rows and columns.","zrwMyD":"Create table","D/nWxh":"Cut the selected text","jHPv5m":"Cut","5cNgRx":"Decrease the font size.","vyRNWx":"Decrease","Jgiol4":"Decrease indentation","1gJSHH":"Increase the font size","OQXJXz":"Increase","72TLhr":"Increase indentation","HFlfzJ":"Insert Emoji","RPq9fY":"Separate content with a diving horizontal line","OKQF+e":"Divider","zjYb9C":"Insert a new paragraph","4M4sXC":"Insert Paragraph","1Q+eVc":"Justify","ejWWtP":"Left align","wVqrpS":"Paste content into the editor","07v9aw":"Paste","zUYfou":"Redo the most recent action","9Nq9zr":"Redo","0uxaZe":"Remove annotation","iJWZAz":"Right align","g5WpPn":"Select all content within the editor","2+pZDT":"Select all","yChCR1":"Set text case","GMzAC/":"Set the font size for the selected text.","vzEyrv":"Font size","7VCkJ8":"Set the text color for the selected text.","qjWFaR":"Text color","LVWgFu":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"WXwRy1":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"G/o315":"Set the text highlight color for the selected text.","xtHg6d":"Text highlight","1p1W/p":"Add blockquote formatting to the selected text","6+rh6I":"Blockquote","0yB3LV":"Add bold formatting to the selected text","sFMo4Z":"Bold","SMKG/s":"Bulleted list","/BYCMi":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"V+3IBe":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"hbIo4L":"Add a code block","7GkMcx":"Codeblock","2r4JYl":"Add inline code formatting to the selected text","Up8Tpe":"Code","ATHSPS":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"7DC1VE":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"hnrBeo":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"NkZAcw":"Italicize the selected text","2fTW9e":"Italic","c759Ra":"Ordered list","uQwrZu":"Strikethrough the selected text","pT3qly":"Strikethrough","BHk+zu":"Subscript","18BVwM":"Superscript","tOIVCV":"Tasked list","4Janx3":"Underline the selected text","dCHt+D":"Underline","YYAprs":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"tczyZL":"Show hidden whitespace characters in your editor.","0qAX23":"Toggle Whitespace","ezMADU":"Undo the most recent action","N3P7EC":"Undo","2nj/+s":"Update annotation","dWD7u4":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"qXqgVT":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.set-font-size.label":"Font size","ui.text-color.grape":"Grape","ui.text-color.grape.hue":["Grape ",["hue"]],"ui.text-color.gray":"Gray","ui.text-color.gray.hue":["Gray ",["hue"]],"ui.text-color.green":"Green","ui.text-color.green.hue":["Green ",["hue"]],"keyboard.shortcut.home":"Home","extension.command.increase-font-size.label":"Increase","extension.command.increase-indent.label":"Increase indentation","extension.command.increase-font-size.description":"Increase the font size","ui.text-color.indigo":"Indigo","ui.text-color.indigo.hue":["Indigo ",["hue"]],"extension.command.insert-paragraph.description":"Insert a new paragraph","extension.command.insert-emoji.label":"Insert Emoji","extension.command.insert-paragraph.label":"Insert Paragraph","extension.command.toggle-italic.label":"Italic","extension.command.toggle-italic.description":"Italicize the selected text","extension.command.justify-align.label":"Justify","R7NlCw":"Alt","RbDiK5":"Arrow Down","Dgyd+E":"Arrow Left","8pdCk4":"Arrow Right","Gp/343":"Arrow Up","PFPV0A":"Backspace","0IRYvp":"Caps Lock","X7HX0D":"Command","zq0AdD":"Control","8SfToN":"Delete","Ys/uah":"End","3K5hww":"Enter","veQt1j":"Enter","ySv7i+":"Home","e6RUI1":"Page Down","EEJk31":"Page Up","7sbhAU":"Shift","Q4eplT":"Space","SUhVVC":"Tab","extension.command.left-align.label":"Left align","ui.text-color.lime":"Lime","ui.text-color.lime.hue":["Lime ",["hue"]],"react-components.mention-atom-component.zero-items":"No items available","ui.text-color.orange":"Orange","ui.text-color.orange.hue":["Orange ",["hue"]],"extension.command.toggle-ordered-list.label":"Ordered list","keyboard.shortcut.pageDown":"Page Down","keyboard.shortcut.pageUp":"Page Up","extension.command.paste.label":"Paste","extension.command.paste.description":"Paste content into the editor","ui.text-color.pink":"Pink","ui.text-color.pink.hue":["Pink ",["hue"]],"zvMfIA":"No items available","pEjhti":"Static Menu","ui.text-color.red":"Red","ui.text-color.red.hue":["Red ",["hue"]],"extension.command.redo.label":"Redo","extension.command.redo.description":"Redo the most recent action","extension.command.remove-annotation.label":"Remove annotation","extension.command.right-align.label":"Right align","extension.command.select-all.label":"Select all","extension.command.select-all.description":"Select all content within the editor","extension.command.insert-horizontal-rule.description":"Separate content with a diving horizontal line","extension.command.set-casing.label":"Set text case","extension.command.set-font-size.description":"Set the font size for the selected text.","extension.command.set-text-color.description":"Set the text color for the selected text.","extension.command.set-text-highlight.description":"Set the text highlight color for the selected text.","keyboard.shortcut.shift":"Shift","extension.command.toggle-whitespace.description":"Show hidden whitespace characters in your editor.","keyboard.shortcut.space":"Space","extension.command.toggle-strike.label":"Strikethrough","extension.command.toggle-strike.description":"Strikethrough the selected text","extension.command.toggle-subscript.label":"Subscript","extension.command.toggle-superscript.label":"Superscript","keyboard.shortcut.tab":"Tab","extension.command.toggle-task-list.description":"Tasked list","ui.text-color.teal":"Teal","ui.text-color.teal.hue":["Teal ",["hue"]],"extension.command.set-text-color.label":"Text color","extension.command.set-text-highlight.label":"Text highlight","extension.command.toggle-whitespace.label":"Toggle Whitespace","ui.text-color.transparent":"Transparent","slrB1c":"Black","6QML30":"Blue","xw+keN":["Blue ",["hue"]],"38RHqP":"Cyan","D89yPf":["Cyan ",["hue"]],"VjBLnd":"Grape","Rp40yv":["Grape ",["hue"]],"5Dm9D1":"Gray","HGjXjC":["Gray ",["hue"]],"b9fz+n":"Green","18jo3M":["Green ",["hue"]],"CFzqCV":"Indigo","aVlDku":["Indigo ",["hue"]],"04PfLc":"Lime","KRTK6Y":["Lime ",["hue"]],"pSnXFd":"Orange","ve/MJZ":["Orange ",["hue"]],"OvCgDa":"Pink","l7NqyT":["Pink ",["hue"]],"IT9k0j":"Red","AdyJ7/":["Red ",["hue"]],"3D2UWc":"Teal","Dcq0Y1":["Teal ",["hue"]],"bsi2ik":"Transparent","Tj3PRR":"Violet","xxMH5N":["Violet ",["hue"]],"Rum0ah":"White","4gaw/Q":"Yellow","hhauc3":["Yellow ",["hue"]],"extension.command.toggle-underline.label":"Underline","extension.command.toggle-underline.description":"Underline the selected text","extension.command.undo.label":"Undo","extension.command.undo.description":"Undo the most recent action","extension.command.update-annotation.label":"Update annotation","ui.text-color.violet":"Violet","ui.text-color.violet.hue":["Violet ",["hue"]],"ui.text-color.white":"White","ui.text-color.yellow":"Yellow","ui.text-color.yellow.hue":["Yellow ",["hue"]]}'),hT={};YH(hT,UH);cm.loadLocaleData("en",{plurals:hT.en});cm.load("en",JH);cm.activate("en");var XH=Object.defineProperty,QH=Object.getOwnPropertyDescriptor,Uy=(e,t,r,n)=>{for(var o=n>1?void 0:n?QH(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&XH(t,r,o),o},jl=class extends er{get name(){return"doc"}createNodeSpec(e,t){const{docAttributes:r,content:n}=this.options,o=ee();if(ps(r))for(const[i,s]of At(r))o[i]={default:s};else for(const i of r)o[i]={default:null};return{attrs:o,content:n,...t}}setDocAttributes(e){return({tr:t,dispatch:r})=>{if(r){for(const[n,o]of Object.entries(e))t.step(new ld(n,o));r(t)}return!0}}isDefaultDocNode({state:e=this.store.getState(),options:t}={}){return qv(e.doc,t)}};Uy([U()],jl.prototype,"setDocAttributes",1);Uy([He()],jl.prototype,"isDefaultDocNode",1);jl=Uy([pe({defaultOptions:{content:"block+",docAttributes:[]},defaultPriority:Ae.Medium,staticKeys:["content","docAttributes"],disableExtraAttributes:!0})],jl);var mT="SetDocAttribute",gT="RevertSetDocAttribute",ld=class extends Rt{constructor(e,t,r=mT){super(),this.stepType=r,this.key=e,this.value=t}static fromJSON(e,t){return new ld(t.key,t.value,t.stepType)}apply(e){this.previous=e.attrs[this.key];const t={...e.attrs,[this.key]:this.value};return yt.ok(e.type.create(t,e.content,e.marks))}invert(){return new ld(this.key,this.previous,gT)}map(){return this}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}};try{Rt.jsonID(mT,ld),Rt.jsonID(gT,ld)}catch(e){if(!e.message.startsWith("Duplicate use of step JSON ID"))throw e}var ZH=Object.defineProperty,eB=Object.getOwnPropertyDescriptor,vT=(e,t,r,n)=>{for(var o=n>1?void 0:n?eB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&ZH(t,r,o),o};function tB(e,t,r,n){const o=e.docView.posFromDOM(t,r,n);return o===null||o<0?null:o}function rB(e,t){const r=t.target;if(r){const n=tB(e,r,0);if(n!==null){const o=e.state.doc.resolve(n),i=o.node().isLeaf?0:1,s=o.start()-i;return{pos:n,inside:s}}}return e.posAtCoords({left:t.clientX,top:t.clientY})??void 0}var lh=class extends Ve{constructor(){super(...arguments),this.mousedown=!1,this.mouseover=!1,this.createMouseEventHandler=e=>(t,r)=>{const n=r,o=rB(t,n);if(!o)return!1;const i=[],s=[],{inside:a,pos:l}=o;if(a===-1)return!1;const c=t.state.doc.resolve(l),u=c.depth+1;for(const d of Cv(u,1))i.push({node:d>c.depth&&c.nodeAfter?c.nodeAfter:c.node(d),pos:c.before(d)});for(const{type:d}of c.marksAcross(c)??[]){const f=_o(c,d);f&&s.push(f)}return e(n,{view:t,nodes:i,marks:s,getMark:d=>{const f=oe(d)?t.state.schema.marks[d]:d;return re(f,{code:B.EXTENSION,message:`The mark ${d} being checked does not exist within the editor schema.`}),s.find(p=>p.mark.type===f)},getNode:d=>{var f;const p=oe(d)?t.state.schema.nodes[d]:d;re(p,{code:B.EXTENSION,message:"The node being checked does not exist"});const h=i.find(({node:m})=>m.type===p);if(h)return{...h,isRoot:!!((f=i[0])!=null&&f.node.eq(h.node))}}})}}get name(){return"events"}onView(){var e,t;if(!((e=this.store.managerSettings.exclude)!=null&&e.clickHandler))for(const r of this.store.extensions){if(!r.createEventHandlers||(t=r.options.exclude)!=null&&t.clickHandler)continue;const n=r.createEventHandlers();for(const[o,i]of At(n))this.addHandler(o,i)}}createPlugin(){const e=new WeakMap,t=(r,n,o,i,s,a,l,c)=>{const u=this.store.currentState,{schema:d,doc:f}=u,p=f.resolve(i),h=e.has(l),m=nB({$pos:p,handled:h,view:o,state:u});let b=!1;h||(b=r(l,m)||b);const v={...m,pos:i,direct:c,nodeWithPosition:{node:s,pos:a},getNode:g=>{const y=oe(g)?d.nodes[g]:g;return re(y,{code:B.EXTENSION,message:"The node being checked does not exist"}),y===s.type?{node:s,pos:a}:void 0}};return e.set(l,!0),n(l,v)||b};return{props:{handleKeyPress:(r,n)=>this.options.keypress(n)||!1,handleKeyDown:(r,n)=>this.options.keydown(n)||!1,handleTextInput:(r,n,o,i)=>this.options.textInput({from:n,to:o,text:i})||!1,handleClickOn:(r,n,o,i,s,a)=>t(this.options.clickMark,this.options.click,r,n,o,i,s,a),handleDoubleClickOn:(r,n,o,i,s,a)=>t(this.options.doubleClickMark,this.options.doubleClick,r,n,o,i,s,a),handleTripleClickOn:(r,n,o,i,s,a)=>t(this.options.tripleClickMark,this.options.tripleClick,r,n,o,i,s,a),handleDOMEvents:{focus:(r,n)=>this.options.focus(n)||!1,blur:(r,n)=>this.options.blur(n)||!1,mousedown:(r,n)=>(this.startMouseover(),this.options.mousedown(n)||!1),mouseup:(r,n)=>(this.endMouseover(),this.options.mouseup(n)||!1),mouseleave:(r,n)=>(this.mouseover=!1,this.options.mouseleave(n)||!1),mouseenter:(r,n)=>(this.mouseover=!0,this.options.mouseenter(n)||!1),keyup:(r,n)=>this.options.keyup(n)||!1,mouseout:this.createMouseEventHandler((r,n)=>{const o={...n,hovering:!1};return this.options.hover(r,o)||!1}),mouseover:this.createMouseEventHandler((r,n)=>{const o={...n,hovering:!0};return this.options.hover(r,o)||!1}),contextmenu:this.createMouseEventHandler((r,n)=>this.options.contextmenu(r,n)||!1),scroll:(r,n)=>this.options.scroll(n)||!1,copy:(r,n)=>this.options.copy(n)||!1,cut:(r,n)=>this.options.cut(n)||!1,paste:(r,n)=>this.options.paste(n)||!1}},view:r=>{let n=r.editable;const o=this.options;return{update(i){const s=i.editable;s!==n&&(o.editable(s),n=s)}}}}}isInteracting(){return this.mousedown&&this.mouseover}startMouseover(){this.mouseover=!0,!this.mousedown&&(this.mousedown=!0,this.store.document.documentElement.addEventListener("mouseup",()=>{this.endMouseover()},{once:!0}))}endMouseover(){this.mousedown&&(this.mousedown=!1,this.store.commands.emptyUpdate())}};vT([He()],lh.prototype,"isInteracting",1);lh=vT([pe({handlerKeys:["blur","focus","mousedown","mouseup","mouseenter","mouseleave","textInput","keypress","keyup","keydown","click","clickMark","doubleClick","doubleClickMark","tripleClick","tripleClickMark","contextmenu","hover","scroll","copy","cut","paste","editable"],handlerKeyOptions:{blur:{earlyReturnValue:!0},focus:{earlyReturnValue:!0},mousedown:{earlyReturnValue:!0},mouseleave:{earlyReturnValue:!0},mouseup:{earlyReturnValue:!0},click:{earlyReturnValue:!0},doubleClick:{earlyReturnValue:!0},tripleClick:{earlyReturnValue:!0},hover:{earlyReturnValue:!0},contextmenu:{earlyReturnValue:!0},scroll:{earlyReturnValue:!0},copy:{earlyReturnValue:!0},cut:{earlyReturnValue:!0},paste:{earlyReturnValue:!0}},defaultPriority:Ae.High})],lh);function nB(e){const{handled:t,view:r,$pos:n,state:o}=e,i={getMark:X4,markRanges:[],view:r,state:o};if(t)return i;for(const{type:s}of n.marksAcross(n)??[]){const a=_o(n,s);a&&i.markRanges.push(a)}return i.getMark=s=>{const a=oe(s)?o.schema.marks[s]:s;return re(a,{code:B.EXTENSION,message:`The mark ${s} being checked does not exist within the editor schema.`}),i.markRanges.find(l=>l.mark.type===a)},i}class gt extends be{constructor(t){super(t,t)}map(t,r){let n=t.resolve(r.map(this.head));return gt.valid(n)?new gt(n):be.near(n)}content(){return K.empty}eq(t){return t instanceof gt&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new gt(t.resolve(r.pos))}getBookmark(){return new Wy(this.anchor)}static valid(t){let r=t.parent;if(r.isTextblock||!oB(t)||!iB(t))return!1;let n=r.type.spec.allowGapCursor;if(n!=null)return n;let o=r.contentMatchAt(t.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(t,r,n=!1){e:for(;;){if(!n&>.valid(t))return t;let o=t.pos,i=null;for(let s=t.depth;;s--){let a=t.node(s);if(r>0?t.indexAfter(s)0){i=a.child(r>0?t.indexAfter(s):t.index(s)-1);break}else if(s==0)return null;o+=r;let l=t.doc.resolve(o);if(gt.valid(l))return l}for(;;){let s=r>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!ce.isSelectable(i)){t=t.doc.resolve(o+i.nodeSize*r),n=!1;continue e}break}i=s,o+=r;let a=t.doc.resolve(o);if(gt.valid(a))return a}return null}}}gt.prototype.visible=!1;gt.findFrom=gt.findGapCursorFrom;be.jsonID("gapcursor",gt);class Wy{constructor(t){this.pos=t}map(t){return new Wy(t.map(this.pos))}resolve(t){let r=t.resolve(this.pos);return gt.valid(r)?new gt(r):be.near(r)}}function oB(e){for(let t=e.depth;t>=0;t--){let r=e.index(t),n=e.node(t);if(r==0){if(n.type.spec.isolating)return!0;continue}for(let o=n.child(r-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function iB(e){for(let t=e.depth;t>=0;t--){let r=e.indexAfter(t),n=e.node(t);if(r==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let o=n.child(r);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function sB(){return new Ro({props:{decorations:uB,createSelectionBetween(e,t,r){return t.pos==r.pos&>.valid(r)?new gt(r):null},handleClick:lB,handleKeyDown:aB,handleDOMEvents:{beforeinput:cB}}})}const aB=Xv({ArrowLeft:Sf("horiz",-1),ArrowRight:Sf("horiz",1),ArrowUp:Sf("vert",-1),ArrowDown:Sf("vert",1)});function Sf(e,t){const r=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(n,o,i){let s=n.selection,a=t>0?s.$to:s.$from,l=s.empty;if(s instanceof le){if(!i.endOfTextblock(r)||a.depth==0)return!1;l=!1,a=n.doc.resolve(t>0?a.after():a.before())}let c=gt.findGapCursorFrom(a,t,l);return c?(o&&o(n.tr.setSelection(new gt(c))),!0):!1}}function lB(e,t,r){if(!e||!e.editable)return!1;let n=e.state.doc.resolve(t);if(!gt.valid(n))return!1;let o=e.posAtCoords({left:r.clientX,top:r.clientY});return o&&o.inside>-1&&ce.isSelectable(e.state.doc.nodeAt(o.inside))?!1:(e.dispatch(e.state.tr.setSelection(new gt(n))),!0)}function cB(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof gt))return!1;let{$from:r}=e.state.selection,n=r.parent.contentMatchAt(r.index()).findWrapping(e.state.schema.nodes.text);if(!n)return!1;let o=R.empty;for(let s=n.length-1;s>=0;s--)o=R.from(n[s].createAndFill(null,o));let i=e.state.tr.replace(r.pos,r.pos,new K(o,0,0));return i.setSelection(le.near(i.doc.resolve(r.pos+1))),e.dispatch(i),!1}function uB(e){if(!(e.selection instanceof gt))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Ee.create(e.doc,[Ge.widget(e.selection.head,t,{key:"gapcursor"})])}var dB=Object.defineProperty,fB=Object.getOwnPropertyDescriptor,pB=(e,t,r,n)=>{for(var o=n>1?void 0:n?fB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&dB(t,r,o),o},W0=class extends Ve{get name(){return"gapCursor"}createExternalPlugins(){return[sB()]}};W0=pB([pe({})],W0);var ch=200,Bt=function(){};Bt.prototype.append=function(t){return t.length?(t=Bt.from(t),!this.length&&t||t.length=r?Bt.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,r))};Bt.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Bt.prototype.forEach=function(t,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length),r<=n?this.forEachInner(t,r,n,0):this.forEachInvertedInner(t,r,n,0)};Bt.prototype.map=function(t,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length);var o=[];return this.forEach(function(i,s){return o.push(t(i,s))},r,n),o};Bt.from=function(t){return t instanceof Bt?t:t&&t.length?new yT(t):Bt.empty};var yT=function(e){function t(n){e.call(this),this.values=n}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new t(this.values.slice(o,i))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,i,s,a){for(var l=i;l=s;l--)if(o(this.values[l],a+l)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=ch)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=ch)return new t(o.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(t.prototype,r),t}(Bt);Bt.empty=new yT([]);var hB=function(e){function t(r,n){e.call(this),this.left=r,this.right=n,this.length=r.length+n.length,this.depth=Math.max(r.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(n){return na&&this.right.forEachInner(n,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(n,o,i,s){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(n,o-a,Math.max(i,a)-a,s+a)===!1||i=i?this.right.slice(n-i,o-i):this.left.slice(n,i).append(this.right.slice(0,o-i))},t.prototype.leafAppend=function(n){var o=this.right.leafAppend(n);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(n){var o=this.left.leafPrepend(n);if(o)return new t(o,this.right)},t.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new t(this.left,new t(this.right,n)):new t(this,n)},t}(Bt);const mB=500;class Zn{constructor(t,r){this.items=t,this.eventCount=r}popEvent(t,r){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let o,i;r&&(o=this.remapping(n,this.items.length),i=o.maps.length);let s=t.tr,a,l,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(n,f+1),i=o.maps.length),i--,u.push(d);return}if(o){u.push(new mo(d.map));let p=d.step.map(o.slice(i)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new mo(h,void 0,void 0,c.length+u.length))),i--,h&&o.appendMap(h,i)}else s.maybeStep(d.step);if(d.selection)return a=o?d.selection.map(o.slice(i)):d.selection,l=new Zn(this.items.slice(0,n).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(t,r,n,o){let i=[],s=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let u=0;uvB&&(a=gB(a,c),s-=c),new Zn(a.append(i),s)}remapping(t,r){let n=new ul;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=t?n.maps.length-o.mirrorOffset:void 0;n.appendMap(o.map,s)},t,r),n}addMaps(t){return this.eventCount==0?this:new Zn(this.items.append(t.map(r=>new mo(r))),this.eventCount)}rebased(t,r){if(!this.eventCount)return this;let n=[],o=Math.max(0,this.items.length-r),i=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},o);let l=r;this.items.forEach(f=>{let p=i.getMirror(--l);if(p==null)return;s=Math.min(s,p);let h=i.maps[p];if(f.step){let m=t.steps[p].invert(t.docs[p]),b=f.selection&&f.selection.map(i.slice(l+1,p));b&&a++,n.push(new mo(h,m,b))}else n.push(new mo(h))},o);let c=[];for(let f=r;fmB&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let t=0;return this.items.forEach(r=>{r.step||t++}),t}compress(t=this.items.length){let r=this.remapping(0,t),n=r.maps.length,o=[],i=0;return this.items.forEach((s,a)=>{if(a>=t)o.push(s),s.selection&&i++;else if(s.step){let l=s.step.map(r.slice(n)),c=l&&l.getMap();if(n--,c&&r.appendMap(c,n),l){let u=s.selection&&s.selection.map(r.slice(n));u&&i++;let d=new mo(c.invert(),l,u),f,p=o.length-1;(f=o.length&&o[p].merge(d))?o[p]=f:o.push(d)}}else s.map&&n--},this.items.length,0),new Zn(Bt.from(o.reverse()),i)}}Zn.empty=new Zn(Bt.empty,0);function gB(e,t){let r;return e.forEach((n,o)=>{if(n.selection&&t--==0)return r=o,!1}),e.slice(r)}class mo{constructor(t,r,n,o){this.map=t,this.step=r,this.selection=n,this.mirrorOffset=o}merge(t){if(this.step&&t.step&&!t.selection){let r=t.step.merge(this.step);if(r)return new mo(r.getMap().invert(),r,this.selection)}}}class Ni{constructor(t,r,n,o,i){this.done=t,this.undone=r,this.prevRanges=n,this.prevTime=o,this.prevComposition=i}}const vB=20;function yB(e,t,r,n){let o=r.getMeta(So),i;if(o)return o.historyState;r.getMeta(xB)&&(e=new Ni(e.done,e.undone,null,0,-1));let s=r.getMeta("appendedTransaction");if(r.steps.length==0)return e;if(s&&s.getMeta(So))return s.getMeta(So).redo?new Ni(e.done.addTransform(r,void 0,n,op(t)),e.undone,_w(r.mapping.maps[r.steps.length-1]),e.prevTime,e.prevComposition):new Ni(e.done,e.undone.addTransform(r,void 0,n,op(t)),null,e.prevTime,e.prevComposition);if(r.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=r.getMeta("composition"),l=e.prevTime==0||!s&&e.prevComposition!=a&&(e.prevTime<(r.time||0)-n.newGroupDelay||!bB(r,e.prevRanges)),c=s?Xg(e.prevRanges,r.mapping):_w(r.mapping.maps[r.steps.length-1]);return new Ni(e.done.addTransform(r,l?t.selection.getBookmark():void 0,n,op(t)),Zn.empty,c,r.time,a??e.prevComposition)}else return(i=r.getMeta("rebased"))?new Ni(e.done.rebased(r,i),e.undone.rebased(r,i),Xg(e.prevRanges,r.mapping),e.prevTime,e.prevComposition):new Ni(e.done.addMaps(r.mapping.maps),e.undone.addMaps(r.mapping.maps),Xg(e.prevRanges,r.mapping),e.prevTime,e.prevComposition)}function bB(e,t){if(!t)return!1;if(!e.docChanged)return!0;let r=!1;return e.mapping.maps[0].forEach((n,o)=>{for(let i=0;i=t[i]&&(r=!0)}),r}function _w(e){let t=[];return e.forEach((r,n,o,i)=>t.push(o,i)),t}function Xg(e,t){if(!e)return null;let r=[];for(let n=0;n{let r=So.getState(e);return!r||r.done.eventCount==0?!1:(t&&bT(r,e,t,!1),!0)},Zc=(e,t)=>{let r=So.getState(e);return!r||r.undone.eventCount==0?!1:(t&&bT(r,e,t,!0),!0)};function K0(e){let t=So.getState(e);return t?t.done.eventCount:0}function wB(e){let t=So.getState(e);return t?t.undone.eventCount:0}var SB=Object.defineProperty,EB=Object.getOwnPropertyDescriptor,Ca=(e,t,r,n)=>{for(var o=n>1?void 0:n?EB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&SB(t,r,o),o},Ao=class extends Ve{constructor(){super(...arguments),this.wrapMethod=(e,t)=>({state:r,dispatch:n,view:o})=>{const{getState:i,getDispatch:s}=this.options,a=_e(i)?i():r,l=_e(s)&&n?s():n,c=e(a,l,o);return t==null||t(c),c}}get name(){return"history"}createKeymap(){return{"Mod-y":on.isMac?()=>!1:this.wrapMethod(Zc,this.options.onRedo),"Mod-z":this.wrapMethod(ip,this.options.onUndo),"Shift-Mod-z":this.wrapMethod(Zc,this.options.onRedo)}}undoShortcut(e){return this.wrapMethod(ip,this.options.onUndo)(e)}redoShortcut(e){return this.wrapMethod(Zc,this.options.onRedo)(e)}createExternalPlugins(){const{depth:e,newGroupDelay:t}=this.options;return[kB({depth:e,newGroupDelay:t})]}undo(){return l2(this.wrapMethod(ip,this.options.onUndo))}redo(){return l2(this.wrapMethod(Zc,this.options.onRedo))}undoDepth(e=this.store.getState()){return K0(e)}redoDepth(e=this.store.getState()){return wB(e)}};Ca([je({shortcut:$.Undo,command:"undo"})],Ao.prototype,"undoShortcut",1);Ca([je({shortcut:$.Redo,command:"redo"})],Ao.prototype,"redoShortcut",1);Ca([U({disableChaining:!0,description:({t:e})=>e(Cp.UNDO_DESCRIPTION),label:({t:e})=>e(Cp.UNDO_LABEL),icon:"arrowGoBackFill"})],Ao.prototype,"undo",1);Ca([U({disableChaining:!0,description:({t:e})=>e(Cp.REDO_DESCRIPTION),label:({t:e})=>e(Cp.REDO_LABEL),icon:"arrowGoForwardFill"})],Ao.prototype,"redo",1);Ca([He()],Ao.prototype,"undoDepth",1);Ca([He()],Ao.prototype,"redoDepth",1);Ao=Ca([pe({defaultOptions:{depth:100,newGroupDelay:500,getDispatch:void 0,getState:void 0},staticKeys:["depth","newGroupDelay"],handlerKeys:["onUndo","onRedo"]})],Ao);var CB=Object.defineProperty,MB=Object.getOwnPropertyDescriptor,um=(e,t,r,n)=>{for(var o=n>1?void 0:n?MB(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&CB(t,r,o),o},TB={icon:"paragraph",label:({t:e})=>e(Mp.INSERT_LABEL),description:({t:e})=>e(Mp.INSERT_DESCRIPTION)},OB={icon:"paragraph",label:({t:e})=>e(Mp.CONVERT_LABEL),description:({t:e})=>e(Mp.CONVERT_DESCRIPTION)},da=class extends er{get name(){return"paragraph"}createTags(){return[te.LastNodeCompatible,te.TextBlock,te.Block,te.FormattingNode]}createNodeSpec(e,t){return{content:"inline*",draggable:!1,...t,attrs:{...e.defaults()},parseDOM:[{tag:"p",getAttrs:r=>({...e.parse(r)})},...t.parseDOM??[]],toDOM:r=>["p",e.dom(r),0]}}convertParagraph(e={}){const{attrs:t,selection:r,preserveAttrs:n}=e;return this.store.commands.setBlockNodeType.original(this.type,t,r,n)}insertParagraph(e,t={}){const{selection:r,attrs:n}=t;return this.store.commands.insertNode.original(this.type,{content:e,selection:r,attrs:n})}shortcut(e){return this.convertParagraph()(e)}};um([U(OB)],da.prototype,"convertParagraph",1);um([U(TB)],da.prototype,"insertParagraph",1);um([je({shortcut:$.Paragraph,command:"convertParagraph"})],da.prototype,"shortcut",1);da=um([pe({defaultPriority:Ae.Medium})],da);function Jo(e,t,r){return Math.min(Math.max(e,r),t)}class _B extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var eu=_B;function Ky(e){if(typeof e!="string")throw new eu(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=DB.test(e)?RB(e):e;const r=PB.exec(t);if(r){const s=Array.from(r).slice(1);return[...s.slice(0,3).map(a=>parseInt(cd(a,2),16)),parseInt(cd(s[3]||"f",2),16)/255]}const n=zB.exec(t);if(n){const s=Array.from(n).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,16)),parseInt(s[3]||"ff",16)/255]}const o=LB.exec(t);if(o){const s=Array.from(o).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,10)),parseFloat(s[3]||"1")]}const i=IB.exec(t);if(i){const[s,a,l,c]=Array.from(i).slice(1).map(parseFloat);if(Jo(0,100,a)!==a)throw new eu(e);if(Jo(0,100,l)!==l)throw new eu(e);return[...$B(s,a,l),Number.isNaN(c)?1:c]}throw new eu(e)}function AB(e){let t=5381,r=e.length;for(;r;)t=t*33^e.charCodeAt(--r);return(t>>>0)%2341}const Nw=e=>parseInt(e.replace(/_/g,""),36),NB="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const r=Nw(t.substring(0,3)),n=Nw(t.substring(3)).toString(16);let o="";for(let i=0;i<6-n.length;i++)o+="0";return e[r]=`${o}${n}`,e},{});function RB(e){const t=e.toLowerCase().trim(),r=NB[AB(t)];if(!r)throw new eu(e);return`#${r}`}const cd=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),PB=new RegExp(`^#${cd("([a-f0-9])",3)}([a-f0-9])?$`,"i"),zB=new RegExp(`^#${cd("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),LB=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${cd(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),IB=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,DB=/^[a-z]+$/i,Rw=e=>Math.round(e*255),$B=(e,t,r)=>{let n=r/100;if(t===0)return[n,n,n].map(Rw);const o=(e%360+360)%360/60,i=(1-Math.abs(2*n-1))*(t/100),s=i*(1-Math.abs(o%2-1));let a=0,l=0,c=0;o>=0&&o<1?(a=i,l=s):o>=1&&o<2?(a=s,l=i):o>=2&&o<3?(l=i,c=s):o>=3&&o<4?(l=s,c=i):o>=4&&o<5?(a=s,c=i):o>=5&&o<6&&(a=i,c=s);const u=n-i/2,d=a+u,f=l+u,p=c+u;return[d,f,p].map(Rw)};function HB(e){const[t,r,n,o]=Ky(e).map((d,f)=>f===3?d:d/255),i=Math.max(t,r,n),s=Math.min(t,r,n),a=(i+s)/2;if(i===s)return[0,0,a,o];const l=i-s,c=a>.5?l/(2-i-s):l/(i+s);return[60*(t===i?(r-n)/l+(r.179}function kl(e){return jB(e)?"#000":"#fff"}const UB="remirror-editor-wrapper",WB="remirror-button-active",KB="remirror-button",qB="remirror-composite",GB="remirror-dialog",YB="remirror-dialog-backdrop",JB="remirror-form",XB="remirror-form-message",QB="remirror-form-label",ZB="remirror-form-group",eF="remirror-group",tF="remirror-input",rF="remirror-menu",nF="remirror-menu-pane",oF="remirror-menu-pane-active",iF="remirror-menu-dropdown-label",sF="remirror-menu-pane-icon",aF="remirror-menu-pane-label",lF="remirror-menu-pane-shortcut",cF="remirror-menu-button-left",uF="remirror-menu-button-right",dF="remirror-menu-button-nested-left",fF="remirror-menu-button-nested-right",pF="remirror-menu-button",hF="remirror-menu-bar",mF="remirror-flex-column",gF="remirror-flex-row",vF="remirror-menu-item",yF="remirror-menu-item-row",bF="remirror-menu-item-column",xF="remirror-menu-item-checkbox",kF="remirror-menu-item-radio",wF="remirror-menu-group",SF="remirror-floating-popover",EF="remirror-popover",CF="remirror-animated-popover",MF="remirror-role",TF="remirror-separator",OF="remirror-tab",_F="remirror-tab-list",AF="remirror-tabbable",NF="remirror-toolbar",RF="remirror-tooltip",PF="remirror-table-size-editor",zF="remirror-table-size-editor-body",LF="remirror-table-size-editor-cell",IF="remirror-table-size-editor-cell-selected",DF="remirror-table-size-editor-footer",$F="remirror-color-picker",HF="remirror-color-picker-cell",BF="remirror-color-picker-cell-selected";var FF=Object.freeze({__proto__:null,ANIMATED_POPOVER:CF,BUTTON:KB,BUTTON_ACTIVE:WB,COLOR_PICKER:$F,COLOR_PICKER_CELL:HF,COLOR_PICKER_CELL_SELECTED:BF,COMPOSITE:qB,DIALOG:GB,DIALOG_BACKDROP:YB,EDITOR_WRAPPER:UB,FLEX_COLUMN:mF,FLEX_ROW:gF,FLOATING_POPOVER:SF,FORM:JB,FORM_GROUP:ZB,FORM_LABEL:QB,FORM_MESSAGE:XB,GROUP:eF,INPUT:tF,MENU:rF,MENU_BAR:hF,MENU_BUTTON:pF,MENU_BUTTON_LEFT:cF,MENU_BUTTON_NESTED_LEFT:dF,MENU_BUTTON_NESTED_RIGHT:fF,MENU_BUTTON_RIGHT:uF,MENU_DROPDOWN_LABEL:iF,MENU_GROUP:wF,MENU_ITEM:vF,MENU_ITEM_CHECKBOX:xF,MENU_ITEM_COLUMN:bF,MENU_ITEM_RADIO:kF,MENU_ITEM_ROW:yF,MENU_PANE:nF,MENU_PANE_ACTIVE:oF,MENU_PANE_ICON:sF,MENU_PANE_LABEL:aF,MENU_PANE_SHORTCUT:lF,POPOVER:EF,ROLE:MF,SEPARATOR:TF,TAB:OF,TABBABLE:AF,TABLE_SIZE_EDITOR:PF,TABLE_SIZE_EDITOR_BODY:zF,TABLE_SIZE_EDITOR_CELL:LF,TABLE_SIZE_EDITOR_CELL_SELECTED:IF,TABLE_SIZE_EDITOR_FOOTER:DF,TAB_LIST:_F,TOOLBAR:NF,TOOLTIP:RF});const VF="remirror-wrap",jF="remirror-language-select-positioner",UF="remirror-language-select-width",WF="remirror-a11y-dark",KF="remirror-atom-dark",qF="remirror-base16-ateliersulphurpool-light",GF="remirror-cb",YF="remirror-darcula",JF="remirror-dracula",XF="remirror-duotone-dark",QF="remirror-duotone-earth",ZF="remirror-duotone-forest",eV="remirror-duotone-light",tV="remirror-duotone-sea",rV="remirror-duotone-space",nV="remirror-gh-colors",oV="remirror-hopscotch",iV="remirror-pojoaque",sV="remirror-vs",aV="remirror-xonokai";var lV=Object.freeze({__proto__:null,A11Y_DARK:WF,ATOM_DARK:KF,BASE16_ATELIERSULPHURPOOL_LIGHT:qF,CB:GF,DARCULA:YF,DRACULA:JF,DUOTONE_DARK:XF,DUOTONE_EARTH:QF,DUOTONE_FOREST:ZF,DUOTONE_LIGHT:eV,DUOTONE_SEA:tV,DUOTONE_SPACE:rV,GH_COLORS:nV,HOPSCOTCH:oV,LANGUAGE_SELECT_POSITIONER:jF,LANGUAGE_SELECT_WIDTH:UF,POJOAQUE:iV,VS:sV,WRAP:VF,XONOKAI:aV});const cV="remirror-image-loader";var uV=Object.freeze({__proto__:null,IMAGE_LOADER:cV});const dV="remirror-list-item-with-custom-mark",fV="remirror-ul-list-content",pV="remirror-editor",hV="remirror-list-item-marker-container",mV="remirror-list-item-checkbox",gV="remirror-collapsible-list-item-closed",vV="remirror-collapsible-list-item-button",yV="remirror-list-spine";var cs=Object.freeze({__proto__:null,COLLAPSIBLE_LIST_ITEM_BUTTON:vV,COLLAPSIBLE_LIST_ITEM_CLOSED:gV,EDITOR:pV,LIST_ITEM_CHECKBOX:mV,LIST_ITEM_MARKER_CONTAINER:hV,LIST_ITEM_WITH_CUSTOM_MARKER:dV,LIST_SPINE:yV,UL_LIST_CONTENT:fV});const bV="remirror-is-empty";var xV=Object.freeze({__proto__:null,IS_EMPTY:bV});const kV="remirror-editor",wV="remirror-positioner",SV="remirror-positioner-widget";var EV=Object.freeze({__proto__:null,EDITOR:kV,POSITIONER:wV,POSITIONER_WIDGET:SV});const CV="remirror-theme";function MV(e={}){const t=[],r={};function n(o,i){if(typeof i=="string"||typeof i=="number"){t.push(`${Pw(o)}: ${i};`),r[Pw(o)]=i;return}if(!(typeof i!="object"||!i))for(const[s,a]of Object.entries(i))n([...o,s],a)}for(const[o,i]of Object.entries(e))n([o],i);return{css:t.join(` +`),styles:r}}function TV(e){return e.replace(/([a-z])([\dA-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function Pw(e){return`--rmr-${e.map(TV).join("-")}`}const qn={gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},Xo="#000000",qy="#ffffff",OV="#252103",Gy=uh(Xo,.75),dm="#7963d2",Yy="#bcd263",_V="#fff",AV="#fff",Jy=qn.gray[1],zw="rgba(10,31,68,0.08)",Lw="rgba(10,31,68,0.10)",Iw="rgba(10,31,68,0.12)",NV=sp(uh(Xo,.1),.13),Xy={background:qy,border:Gy,foreground:Xo,muted:Jy,primary:dm,secondary:Yy,primaryText:_V,secondaryText:AV,text:OV,faded:NV},RV={...Xy,background:rn(qy,.15),border:rn(Gy,.15),foreground:rn(Xo,.15),muted:rn(Jy,.15),primary:rn(dm,.15),secondary:rn(Yy,.15),get text(){return kl(this.background)},get primaryText(){return kl(this.primary)},get secondaryText(){return kl(this.secondary)}},PV={...Xy,background:rn(qy,.075),border:rn(Gy,.075),foreground:rn(Xo,.075),muted:rn(Jy,.075),primary:rn(dm,.075),secondary:rn(Yy,.075),get text(){return kl(this.background)},get primaryText(){return kl(this.primary)},get secondaryText(){return kl(this.secondary)}},ws={color:{...Xy,active:RV,hover:PV,shadow1:zw,shadow2:Lw,shadow3:Iw,backdrop:uh(Xo,.1),outline:uh(dm,.6),table:{default:{border:sp(Xo,.8),cell:sp(Xo,.4),controller:qn.gray[3]},selected:{border:qn.blue[7],cell:qn.blue[1],controller:qn.blue[5]},preselect:{border:qn.blue[7],cell:sp(Xo,.4),controller:qn.blue[5]},predelete:{border:qn.red[7],cell:qn.red[1],controller:qn.red[5]},mark:"#91919196"}},hue:qn,radius:{border:"0.25rem",extra:"0.5rem",circle:"50%"},fontFamily:{default:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif',heading:"inherit",mono:"Menlo, monospace"},fontSize:{0:"12px",1:"14px",2:"16px",3:"20px",4:"24px",5:"32px",6:"48px",7:"64px",8:"96px",default:"16px"},space:{1:"4px",2:"8px",3:"16px",4:"32px",5:"64px",6:"128px",7:"256px",8:"512px"},fontWeight:{bold:"700",default:"400",heading:"700"},letterSpacing:{tight:"-1px",default:"normal",loose:"1px",wide:"3px"},lineHeight:{heading:"1.25em",default:"1.5em"},boxShadow:{1:`0 1px 1px ${zw}`,2:`0 1px 1px ${Lw}`,3:`0 1px 1px ${Iw}`}};var zV=Object.defineProperty,LV=Object.getOwnPropertyDescriptor,Qy=(e,t,r,n)=>{for(var o=n>1?void 0:n?LV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&zV(t,r,o),o},xT=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},Tt=(e,t,r)=>(xT(e,t,"read from private field"),r?r.call(e):t.get(e)),Do=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},bi=(e,t,r,n)=>(xT(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),tu,ru,qa,nu,ap,ou,iu,su,au,lp=class{constructor(e){Do(this,tu,Uh()),Do(this,ru,[]),Do(this,qa,new Map),Do(this,nu,[]),Do(this,ap,!1),Do(this,ou,void 0),Do(this,iu,void 0),Do(this,su,void 0),Do(this,au,void 0),this.addListener=(t,r)=>Tt(this,tu).on(t,r),bi(this,ou,e),bi(this,iu,e.getActive),bi(this,au,e.getPosition),bi(this,su,e.getID),this.hasChanged=e.hasChanged,this.events=e.events??["state","scroll"]}static create(e){return new lp(e)}static fromPositioner(e,t){return lp.create({...e.basePositioner,...t})}get basePositioner(){return{getActive:Tt(this,iu),getPosition:Tt(this,au),hasChanged:this.hasChanged,events:this.events,getID:Tt(this,su)}}onActiveChanged(e){this.recentUpdate=e;const t=Tt(this,iu).call(this,e);bi(this,ru,t),bi(this,qa,new Map),bi(this,ap,!1),bi(this,nu,[]);const r=[];for(const[n,o]of t.entries()){const i=this.getID(o,n);Tt(this,nu).push(i),r.push({setElement:s=>this.addProps({...e,data:o,element:s},n),id:i,data:o})}Tt(this,tu).emit("update",r)}getID(e,t){var r;return((r=Tt(this,su))==null?void 0:r.call(this,e,t))??t.toString()}addProps(e,t){if(Tt(this,ap)||(Tt(this,qa).set(t,e),Tt(this,qa).sizee;return this.clone(r=>({getActive:n=>r.getActive(n).filter(t)}))}},no=lp;tu=new WeakMap;ru=new WeakMap;qa=new WeakMap;nu=new WeakMap;ap=new WeakMap;ou=new WeakMap;iu=new WeakMap;su=new WeakMap;au=new WeakMap;no.EMPTY=[];function IV(e,t=ET){const{key:r}=(e==null?void 0:e.getMeta(ST))??{};return r===t}function kT(e){const{tr:t,state:r,previousState:n}=e;return!n||t&&IV(t)?!0:t?sz(t):!r.doc.eq(n.doc)||!r.selection.eq(n.selection)}function wT(e,t,r={}){const n=t.getBoundingClientRect(),{accountForPadding:o=!1}=r;let i=0,s=0,a=0,l=0;if(et(t)&&o){const u=Number.parseFloat(kn(t,"padding-left").replace("px","")),d=Number.parseFloat(kn(t,"padding-right").replace("px","")),f=Number.parseFloat(kn(t,"padding-top").replace("px","")),p=Number.parseFloat(kn(t,"padding-bottom").replace("px","")),h=Number.parseFloat(kn(t,"border-left").replace("px","")),m=Number.parseFloat(kn(t,"border-right").replace("px","")),b=Number.parseFloat(kn(t,"border-top").replace("px","")),v=Number.parseFloat(kn(t,"border-bottom").replace("px","")),g=t.offsetWidth-t.clientWidth,y=t.offsetHeight-t.clientHeight;i+=u+h+(t.dir==="rtl"?g:0),s+=d+m+(t.dir==="rtl"?0:g),a+=f+b,l+=p+v+y}const c=new DOMRect(n.left+i,n.top+a,n.width-s,n.height-l);for(const[u,d]of[[e.top,e.left],[e.top,e.right],[e.bottom,e.left],[e.bottom,e.right]])if(ek(u,c.top,c.bottom)&&ek(d,c.left,c.right))return!0;return!1}var DV="remirror-positioner-widget",ST="positionerUpdate",ET="__all_positioners__",CT={y:-999999,x:-999999,width:0,height:0},Dw={...CT,left:-999999,top:-999999,bottom:-999999,right:-999999},Zy={...CT,rect:{...Dw,toJSON:()=>Dw},visible:!1},MT=no.create({hasChanged:kT,getActive(e){const{state:t}=e;if(!Uv(t)||t.selection.$anchor.depth>2)return no.EMPTY;const r=Ld({predicate:n=>n.type.isBlock,selection:t});return r?[r]:no.EMPTY},getPosition(e){const{view:t,data:r}=e,n=t.nodeDOM(r.pos);if(!et(n))return Zy;const o=n.getBoundingClientRect(),i=t.dom.getBoundingClientRect(),s=o.height,a=o.width,l=t.dom.scrollLeft+o.left-i.left,c=t.dom.scrollTop+o.top-i.top,u=wT(o,t.dom);return{y:c,x:l,height:s,width:a,rect:o,visible:u}}}),eb=MT.clone(({getActive:e})=>({getActive:t=>{const[r]=e(t);return r&&Fh(r.node)&&r.node.type===Bh(t.state.schema)?[r]:no.EMPTY}})),$V=eb.clone(({getPosition:e})=>({getPosition:t=>({...e(t),width:1})})),HV=eb.clone(({getPosition:e})=>({getPosition:t=>{const{width:r,x:n,y:o,height:i}=e(t);return{...e(t),width:1,x:r+n,rect:new DOMRect(r+n,o,1,i)}}}));function tb(e){return no.create({hasChanged:kT,getActive:t=>{const{state:r,view:n}=t;if(!e(r)||!ms(r.selection))return no.EMPTY;try{const{head:o,anchor:i}=r.selection;return[{from:n.coordsAtPos(i),to:n.coordsAtPos(o)}]}catch{return no.EMPTY}},getPosition(t){const{element:r,data:n,view:o}=t,{from:i,to:s}=n,a=r.offsetParent??o.dom,l=a.getBoundingClientRect(),c=Math.abs(s.bottom-i.top),u=c>i.bottom-i.top,d=Math.min(i.left,s.left),f=Math.min(i.top,s.top),p=a.scrollLeft+(u?s.left-l.left:d-l.left),h=a.scrollTop+f-l.top,m=u?1:Math.abs(i.left-s.right),b=new DOMRect(u?s.left:d,f,m,c),v=wT(b,o.dom);return{rect:b,y:h,x:p,height:c,width:m,visible:v}}})}var TT=tb(e=>!e.selection.empty),BV=tb(e=>e.selection.empty),FV=tb(()=>!0),VV=TT.clone(()=>({getActive:e=>{const{state:t,view:r}=e;if(!t.selection.empty)return no.EMPTY;const n=AC(t);if(!n)return no.EMPTY;try{return[{from:r.coordsAtPos(n.from),to:r.coordsAtPos(n.to)}]}catch{return no.EMPTY}}})),jV={selection:TT,cursor:BV,always:FV,block:MT,emptyBlock:eb,emptyBlockStart:$V,emptyBlockEnd:HV,nearestWord:VV},Ul=class extends Ve{constructor(){super(...arguments),this.positioners=[],this.onAddCustomHandler=({positioner:e})=>{if(e)return this.positioners=[...this.positioners,e],this.store.commands.forceUpdate(),()=>{this.positioners=this.positioners.filter(t=>t!==e)}}}get name(){return"positioner"}createAttributes(){return{class:EV.EDITOR}}init(){this.onScroll=U4(this.options.scrollDebounce,this.onScroll.bind(this))}createEventHandlers(){return{scroll:()=>(this.onScroll(),!1),hover:(e,t)=>(this.positioner(this.getBaseProps("hover",{hover:t})),!1),contextmenu:(e,t)=>(this.positioner(this.getBaseProps("contextmenu",{contextmenu:t})),!1)}}onStateUpdate(e){this.positioner({...e,previousState:e.firstUpdate?void 0:e.previousState,event:"state",helpers:this.store.helpers})}createDecorations(e){if(this.element??(this.element=this.createElement()),!this.element.hasChildNodes())return Ee.empty;const t=Ge.widget(0,this.element,{key:"positioner-widget",side:-1,stopEvent:()=>!0});return Ee.create(e.doc,[t])}forceUpdatePositioners(e=ET){return({tr:t,dispatch:r})=>(r==null||r(t.setMeta(ST,{key:e})),!0)}getPositionerWidget(){return this.element??(this.element=this.createElement())}createElement(){const e=document.createElement("span");return e.dataset.id=DV,e.setAttribute("role","presentation"),e}triggerPositioner(e,t){e.hasChanged(t)&&e.onActiveChanged({...t,view:this.store.view})}positioner(e){for(const t of this.positioners)t.events.includes(e.event)&&this.triggerPositioner(t,e)}getBaseProps(e,t){const r=this.store.getState(),n=this.store.previousState;return{helpers:this.store.helpers,event:e,firstUpdate:!1,previousState:n,state:r,...t}}onScroll(){this.positioner(this.getBaseProps("scroll",{scroll:{scrollTop:this.store.view.dom.scrollTop}}))}};Qy([U()],Ul.prototype,"forceUpdatePositioners",1);Qy([He()],Ul.prototype,"getPositionerWidget",1);Ul=Qy([pe({defaultOptions:{scrollDebounce:100},customHandlerKeys:["positioner"],staticKeys:["scrollDebounce"]})],Ul);function q0(e){return oe(e)?jV[e].clone():_e(e)?e().clone():e.clone()}var UV=Object.defineProperty,WV=Object.getOwnPropertyDescriptor,KV=(e,t,r,n)=>{for(var o=n>1?void 0:n?WV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&UV(t,r,o),o},G0=class extends er{get name(){return"text"}createTags(){return[te.InlineNode]}createNodeSpec(){return{}}};G0=KV([pe({disableExtraAttributes:!0,defaultPriority:Ae.Medium})],G0);var qV={...jl.defaultOptions,...da.defaultOptions,...Ao.defaultOptions,excludeExtensions:[]};function GV(e={}){e={...qV,...e};const{content:t,depth:r,getDispatch:n,getState:o,newGroupDelay:i,excludeExtensions:s}=e,a={};for(const c of s??[])a[c]=!0;const l=[];if(!a.history){const c=new Ao({depth:r,getDispatch:n,getState:o,newGroupDelay:i});l.push(c)}return a.doc||l.push(new jl({content:t})),a.text||l.push(new G0),a.paragraph||l.push(new da),a.positioner||l.push(new Ul),a.gapCursor||l.push(new W0),a.events||l.push(new lh),l}var YV=Object.defineProperty,JV=Object.getOwnPropertyDescriptor,XV=(e,t,r,n)=>{for(var o=n>1?void 0:n?JV(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&YV(t,r,o),o},fa=class extends Ve{get name(){return"placeholder"}createAttributes(){return{"aria-placeholder":this.options.placeholder}}createPlugin(){return{state:{init:(e,t)=>({...this.options,empty:qv(t.doc,{ignoreAttributes:!0})}),apply:(e,t,r,n)=>QV({pluginState:t,tr:e,extension:this,state:n})},props:{decorations:e=>ZV({state:e,extension:this})}}}onSetOptions(e){const{changes:t}=e;t.placeholder.changed&&this.store.phase>=Nr.EditorView&&this.store.updateAttributes()}};fa=XV([pe({defaultOptions:{emptyNodeClass:xV.IS_EMPTY,placeholder:""}})],fa);function QV(e){const{pluginState:t,extension:r,tr:n,state:o}=e;return n.docChanged?{...r.options,empty:qv(o.doc)}:t}function ZV(e){const{extension:t,state:r}=e,{empty:n}=t.pluginKey.getState(r),{emptyNodeClass:o,placeholder:i}=t.options;if(!n)return null;const s=[];return r.doc.descendants((a,l)=>{const c=Ge.node(l,l+a.nodeSize,{class:o,"data-placeholder":i});s.push(c)}),Ee.create(r.doc,s)}var ej=Object.defineProperty,tj=Object.getOwnPropertyDescriptor,rj=(e,t,r,n)=>{for(var o=n>1?void 0:n?tj(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&ej(t,r,o),o},nj={...fa.defaultOptions,...ad.defaultOptions},oj=[...fa.staticKeys,...ad.staticKeys],ud=class extends Ve{get name(){return"react"}onSetOptions(e){const{pickChanged:t}=e;this.getExtension(fa).setOptions(t(["placeholder"]))}createExtensions(){const{emptyNodeClass:e,placeholder:t,defaultBlockNode:r,defaultContentNode:n,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s}=this.options;return[new fa({emptyNodeClass:e,placeholder:t,priority:Ae.Low}),new ad({defaultBlockNode:r,defaultContentNode:n,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s})]}};ud=rj([pe({defaultOptions:nj,staticKeys:oj})],ud);var OT={};Object.defineProperty(OT,"__esModule",{value:!0});function ij(){for(var e=[],t=0;t{if(!t.has(e))throw TypeError("Cannot "+r)},Zg=(e,t,r)=>(_T(e,t,"read from private field"),r?r.call(e):t.get(e)),sj=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},aj=(e,t,r,n)=>(_T(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);function lj(){const[,e]=S.useState(ee());return S.useCallback(()=>{e(ee())},[])}var AT=S.createContext(null);function fi(e){const t=S.useContext(AT),r=S.useRef(lj());re(t,{code:B.REACT_PROVIDER_CONTEXT});const{addHandler:n}=t;return S.useEffect(()=>{let o=e;if(o){if(ps(o)){const{autoUpdate:i}=o;o=i?()=>r.current():void 0}if(_e(o))return n("updated",o)}},[n,e]),t}function qr(e=!0){return fi({autoUpdate:e}).active}function cj(e=!1){return fi(e?{autoUpdate:!0}:void 0).attrs}function cc(){return fi().chain.new()}function tr(){return fi().commands}function rb(){return fi({autoUpdate:!0}).getState().selection}function Wd(e,t=void 0,r){const{getExtension:n}=fi(),o=S.useMemo(()=>n(e),[e,n]);let i;if(_e(t)?i=r?[o,...r]:[o,t]:i=t?[o,...Object.values(t)]:[],S.useEffect(()=>{_e(t)||!t||o.setOptions(t)},i),S.useEffect(()=>{if(_e(t))return t({addHandler:o.addHandler.bind(o),addCustomHandler:o.addCustomHandler.bind(o),extension:o})},i),!t)return o}function uj(e,t,r){const n=S.useCallback(({addHandler:o})=>o(t,r),[r,t]);return Wd(e,n)}function fm(e=!1){return fi(e?{autoUpdate:!0}:void 0).helpers}var[dj,fj]=I9(({props:e})=>{const t=e.locale??"en",r=e.i18n??cm,n=e.supportedLocales??[t],o=r._.bind(r);return{locale:t,i18n:r,supportedLocales:n,t:o}});function Fw(e,t={}){const{core:r,react:n,...o}=t;return vI(e)?e:gI.create(()=>[...tE(e),new ud(n),...GV(r)],o)}function pj(e,t={}){const r=S.useRef(e),n=S.useRef(t),[o,i]=S.useState(()=>Fw(e,t));return r.current=e,n.current=t,S.useEffect(()=>o.addHandler("destroy",()=>{i(()=>Fw(r.current,n.current))}),[o]),o}var hj=typeof xr=="object"&&xr.__esModule&&xr.default?xr.default:xr,Ga,mj=class extends dI{constructor(e){if(super(e),sj(this,Ga,void 0),this.rootPropsConfig={called:!1,count:0},this.getRootProps=t=>this.internalGetRootProps(t,null),this.internalGetRootProps=(t,r)=>{this.rootPropsConfig.called=!0;const{refKey:n="ref",ref:o,...i}=t??ee();return{[n]:hj(o,this.onRef),key:this.uid,...i,children:r}},this.onRef=t=>{t&&(this.rootPropsConfig.count+=1,re(this.rootPropsConfig.count<=1,{code:B.REACT_GET_ROOT_PROPS,message:`Called ${this.rootPropsConfig.count} times`}),aj(this,Ga,t),this.onRefLoad())},this.manager.view){this.manager.view.setProps({state:this.manager.view.state,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0});return}this.manager.getExtension(fa).setOptions({placeholder:this.props.placeholder??""})}get name(){return"react"}update(e){return super.update(e),this}createView(e){return new x6(null,{state:e,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0,plugins:[]})}updateState({state:e,...t}){const{triggerChange:r=!0,tr:n,transactions:o}=t;if(this.props.state){const{onChange:i}=this.props;re(i,{code:B.REACT_CONTROLLED,message:"You are required to provide the `onChange` handler when creating a controlled editor."}),re(r,{code:B.REACT_CONTROLLED,message:"Controlled editors do not support `clearContent` or `setContent` where `triggerChange` is `true`. Update the `state` prop instead."}),this.previousStateOverride||(this.previousStateOverride=this.getState()),this.onChange({state:e,tr:n,transactions:o});return}!n&&!o&&(e=e.apply(e.tr.setMeta(Yx,{}))),this.view.updateState(e),r&&(o==null?void 0:o.length)!==0&&this.onChange({state:e,tr:n,transactions:o}),this.manager.onStateUpdate({previousState:this.previousState,state:e,tr:n,transactions:o})}updateControlledState(e,t){this.previousStateOverride=t,e=e.apply(e.tr.setMeta(Yx,{})),this.view.updateState(e),this.manager.onStateUpdate({previousState:this.previousState,state:e}),this.previousStateOverride=void 0}addProsemirrorViewToDom(e,t){this.props.insertPosition==="start"?e.insertBefore(t,e.firstChild):e.append(t)}onRefLoad(){re(Zg(this,Ga),{code:B.REACT_EDITOR_VIEW,message:"Something went wrong when initializing the text editor. Please check your setup."});const{autoFocus:e}=this.props;this.addProsemirrorViewToDom(Zg(this,Ga),this.view.dom),e&&this.focus(e),this.onChange(),this.addFocusListeners()}onUpdate(){this.view&&Zg(this,Ga)&&this.view.setProps({...this.view.props,editable:()=>this.props.editable??!0})}get frameworkOutput(){return{...this.baseOutput,getRootProps:this.getRootProps,portalContainer:this.manager.store.portalContainer}}resetRender(){this.rootPropsConfig.called=!1,this.rootPropsConfig.count=0}};Ga=new WeakMap;var NT=typeof document<"u"?S.useLayoutEffect:S.useEffect;function gj(e){const t=S.useRef();return NT(()=>{t.current=e}),t.current}function vj(e){const{manager:t,state:r}=e,{placeholder:n,editable:o}=e;S.useRef(!0).current&&!es(n)&&t.getExtension(ud).setOptions({placeholder:n}),S.useEffect(()=>{n!=null&&t.getExtension(ud).setOptions({placeholder:n})},[n,t]);const[s]=S.useState(()=>{if(r)return r;const l=t.createEmptyDoc(),[c,u]=ct(e.initialContent)?e.initialContent:[e.initialContent??l];return t.createState({content:c,selection:u})}),a=yj({initialEditorState:s,getProps:()=>e});return S.useEffect(()=>()=>{a.destroy()},[a]),S.useEffect(()=>{a.onUpdate()},[o,a]),bj(a),a.frameworkOutput}function yj(e){const t=S.useRef(e);t.current=e;const r=S.useMemo(()=>new mj(t.current),[]);return r.update(e),r}function bj(e){const{state:t}=e.props,r=S.useRef(!!t),n=gj(t);NT(()=>{const o=t?r.current===!0:r.current===!1;re(o,{code:B.REACT_CONTROLLED,message:r.current?"You have attempted to switch from a controlled to an uncontrolled editor. Once you set up an editor as a controlled editor it must always provide a `state` prop.":"You have provided a `state` prop to an uncontrolled editor. In order to set up your editor as controlled you must provide the `state` prop from the very first render."}),!(!t||t===n)&&e.updateControlledState(t,n??void 0)},[t,n,e])}function xj(e={}){const{content:t,document:r,selection:n,extensions:o,...i}=e,s=pj(o??(()=>[]),i),[a,l]=S.useState(()=>s.createState({selection:n,content:t??s.createEmptyDoc()})),c=S.useCallback(({state:d})=>{l(d)},[]),u=S.useCallback(()=>s.output,[s]);return S.useMemo(()=>({state:a,setState:l,manager:s,onChange:c,getContext:u}),[u,s,c,a])}var Vw={doc:!1,selection:!1,storedMark:!1};function kj(){const[e,t]=S.useState(Vw);return uj(Lp,"applyState",S.useCallback(({tr:r})=>{const n={...Vw};r.docChanged&&(n.doc=!0),r.selectionSet&&(n.selection=!0),r.storedMarksSet&&(n.storedMark=!0),t(n)},[])),e}var Y0=()=>I.createElement("div",{className:FF.EDITOR_WRAPPER,...fi().getRootProps()}),wj=e=>(e.hook(),null);function Sj(e){const{children:t,autoRender:r,i18n:n,locale:o,supportedLocales:i,hooks:s=[],...a}=e,l=vj(a),c=A9(l.portalContainer),u=r==="start"||r===!0||!t&&es(r),d=r==="end";return I.createElement(dj,{i18n:n,locale:o,supportedLocales:i},I.createElement(AT.Provider,{value:l},I.createElement(_9,{portals:c}),s.map((f,p)=>I.createElement(wj,{hook:f,key:p})),u&&I.createElement(Y0,null),t,d&&I.createElement(Y0,null)))}const Ej={black:"#000",white:"#fff"},dd=Ej,Cj={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},za=Cj,Mj={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},La=Mj,Tj={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Ia=Tj,Oj={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},Da=Oj,_j={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},$a=_j,Aj={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},Tc=Aj,Nj={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Rj=Nj;function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t{t[r]=RT(e[r])}),t}function un(e,t,r={clone:!0}){const n=r.clone?_({},e):e;return Wo(e)&&Wo(t)&&Object.keys(t).forEach(o=>{o!=="__proto__"&&(Wo(t[o])&&o in e&&Wo(e[o])?n[o]=un(e[o],t[o],r):r.clone?n[o]=Wo(t[o])?RT(t[o]):t[o]:n[o]=t[o])}),n}function Wl(e){let t="https://mui.com/production-error/?code="+e;for(let r=1;rr==null?t:function(...o){t.apply(this,o),r.apply(this,o)},()=>{})}function zj(e,t=166){let r;function n(...o){const i=()=>{e.apply(this,o)};clearTimeout(r),r=setTimeout(i,t)}return n.clear=()=>{clearTimeout(r)},n}function Br(e){return e&&e.ownerDocument||document}function fd(e){return Br(e).defaultView||window}function Y0(e,t){typeof e=="function"?e(t):e&&(e.current=t)}const Lj=typeof window<"u"?S.useLayoutEffect:S.useEffect,ha=Lj;let jw=0;function Ij(e){const[t,r]=S.useState(e),n=e||t;return S.useEffect(()=>{t==null&&(jw+=1,r(`mui-${jw}`))},[t]),n}const Uw=x1["useId".toString()];function Dj(e){if(Uw!==void 0){const t=Uw();return e??t}return Ij(e)}function $j({controlled:e,default:t,name:r,state:n="value"}){const{current:o}=S.useRef(e!==void 0),[i,s]=S.useState(t),a=o?e:i,l=S.useCallback(c=>{o||s(c)},[]);return[a,l]}function Ks(e){const t=S.useRef(e);return ha(()=>{t.current=e}),S.useCallback((...r)=>(0,t.current)(...r),[])}function Ur(...e){return S.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(r=>{Y0(r,t)})},e)}let wm=!0,J0=!1,Ww;const Hj={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function Bj(e){const{type:t,tagName:r}=e;return!!(r==="INPUT"&&Hj[t]&&!e.readOnly||r==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function Fj(e){e.metaKey||e.altKey||e.ctrlKey||(wm=!0)}function Zg(){wm=!1}function Vj(){this.visibilityState==="hidden"&&J0&&(wm=!0)}function jj(e){e.addEventListener("keydown",Fj,!0),e.addEventListener("mousedown",Zg,!0),e.addEventListener("pointerdown",Zg,!0),e.addEventListener("touchstart",Zg,!0),e.addEventListener("visibilitychange",Vj,!0)}function Uj(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return wm||Bj(t)}function PT(){const e=S.useCallback(o=>{o!=null&&jj(o.ownerDocument)},[]),t=S.useRef(!1);function r(){return t.current?(J0=!0,window.clearTimeout(Ww),Ww=window.setTimeout(()=>{J0=!1},100),t.current=!1,!0):!1}function n(o){return Uj(o)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:n,onBlur:r,ref:e}}function zT(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}const Wj=e=>{const t=S.useRef({});return S.useEffect(()=>{t.current=e}),t.current},LT=Wj;function IT(e,t){const r=_({},t);return Object.keys(e).forEach(n=>{if(n.toString().match(/^(components|slots)$/))r[n]=_({},e[n],r[n]);else if(n.toString().match(/^(componentsProps|slotProps)$/)){const o=e[n]||{},i=t[n];r[n]={},!i||!Object.keys(i)?r[n]=o:!o||!Object.keys(o)?r[n]=i:(r[n]=_({},i),Object.keys(o).forEach(s=>{r[n][s]=IT(o[s],i[s])}))}else r[n]===void 0&&(r[n]=e[n])}),r}function rr(e,t,r=void 0){const n={};return Object.keys(e).forEach(o=>{n[o]=e[o].reduce((i,s)=>{if(s){const a=t(s);a!==""&&i.push(a),r&&r[s]&&i.push(r[s])}return i},[]).join(" ")}),n}const Kw=e=>e,Kj=()=>{let e=Kw;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Kw}}},qj=Kj(),DT=qj,Gj={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Vt(e,t,r="Mui"){const n=Gj[t];return n?`${r}-${n}`:`${DT.generate(e)}-${t}`}function jt(e,t,r="Mui"){const n={};return t.forEach(o=>{n[o]=Vt(e,o,r)}),n}const Kl="$$material";function ve(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i=0)&&(r[o]=e[o]);return r}function $T(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Yj=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Jj=$T(function(e){return Yj.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91});function Xj(e){if(e.sheet)return e.sheet;for(var t=0;t0?Gt(uc,--Wr):0,ql--,wt===10&&(ql=1,Em--),wt}function dn(){return wt=Wr2||hd(wt)>3?"":" "}function uU(e,t){for(;--t&&dn()&&!(wt<48||wt>102||wt>57&&wt<65||wt>70&&wt<97););return Kd(e,cp()+(t<6&&Eo()==32&&dn()==32))}function Q0(e){for(;dn();)switch(wt){case e:return Wr;case 34:case 39:e!==34&&e!==39&&Q0(wt);break;case 40:e===41&&Q0(e);break;case 92:dn();break}return Wr}function dU(e,t){for(;dn()&&e+wt!==47+10;)if(e+wt===42+42&&Eo()===47)break;return"/*"+Kd(t,Wr-1)+"*"+Sm(e===47?e:dn())}function fU(e){for(;!hd(Eo());)dn();return Kd(e,Wr)}function pU(e){return UT(dp("",null,null,null,[""],e=jT(e),0,[0],e))}function dp(e,t,r,n,o,i,s,a,l){for(var c=0,u=0,d=s,f=0,p=0,h=0,m=1,b=1,v=1,g=0,y="",x=o,k=i,w=n,E=y;b;)switch(h=g,g=dn()){case 40:if(h!=108&&Gt(E,d-1)==58){X0(E+=Pe(up(g),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:E+=up(g);break;case 9:case 10:case 13:case 32:E+=cU(h);break;case 92:E+=uU(cp()-1,7);continue;case 47:switch(Eo()){case 42:case 47:Ef(hU(dU(dn(),cp()),t,r),l);break;default:E+="/"}break;case 123*m:a[c++]=go(E)*v;case 125*m:case 59:case 0:switch(g){case 0:case 125:b=0;case 59+u:v==-1&&(E=Pe(E,/\f/g,"")),p>0&&go(E)-d&&Ef(p>32?Gw(E+";",n,r,d-1):Gw(Pe(E," ","")+";",n,r,d-2),l);break;case 59:E+=";";default:if(Ef(w=qw(E,t,r,c,u,o,a,y,x=[],k=[],d),i),g===123)if(u===0)dp(E,t,w,w,x,i,d,a,k);else switch(f===99&&Gt(E,3)===110?100:f){case 100:case 108:case 109:case 115:dp(e,w,w,n&&Ef(qw(e,w,w,0,0,o,a,y,o,x=[],d),k),o,k,d,a,n?x:k);break;default:dp(E,w,w,w,[""],k,0,a,k)}}c=u=p=0,m=v=1,y=E="",d=s;break;case 58:d=1+go(E),p=h;default:if(m<1){if(g==123)--m;else if(g==125&&m++==0&&lU()==125)continue}switch(E+=Sm(g),g*m){case 38:v=u>0?1:(E+="\f",-1);break;case 44:a[c++]=(go(E)-1)*v,v=1;break;case 64:Eo()===45&&(E+=up(dn())),f=Eo(),u=d=go(y=E+=fU(cp())),g++;break;case 45:h===45&&go(E)==2&&(m=0)}}return i}function qw(e,t,r,n,o,i,s,a,l,c,u){for(var d=o-1,f=o===0?i:[""],p=sb(f),h=0,m=0,b=0;h0?f[v]+" "+g:Pe(g,/&\f/g,f[v])))&&(l[b++]=y);return Cm(e,t,r,o===0?ob:a,l,c,u)}function hU(e,t,r){return Cm(e,t,r,HT,Sm(aU()),pd(e,2,-2),0)}function Gw(e,t,r,n){return Cm(e,t,r,ib,pd(e,0,n),pd(e,n+1,-1),n)}function wl(e,t){for(var r="",n=sb(e),o=0;o6)switch(Gt(e,t+1)){case 109:if(Gt(e,t+4)!==45)break;case 102:return Pe(e,/(.+:)(.+)-([^]+)/,"$1"+Re+"$2-$3$1"+uh+(Gt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~X0(e,"stretch")?WT(Pe(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Gt(e,t+1)!==115)break;case 6444:switch(Gt(e,go(e)-3-(~X0(e,"!important")&&10))){case 107:return Pe(e,":",":"+Re)+e;case 101:return Pe(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Re+(Gt(e,14)===45?"inline-":"")+"box$3$1"+Re+"$2$3$1"+sr+"$2box$3")+e}break;case 5936:switch(Gt(e,t+11)){case 114:return Re+e+sr+Pe(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Re+e+sr+Pe(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Re+e+sr+Pe(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Re+e+sr+e+e}return e}var SU=function(t,r,n,o){if(t.length>-1&&!t.return)switch(t.type){case ib:t.return=WT(t.value,t.length);break;case BT:return wl([Oc(t,{value:Pe(t.value,"@","@"+Re)})],o);case ob:if(t.length)return sU(t.props,function(i){switch(iU(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return wl([Oc(t,{props:[Pe(i,/:(read-\w+)/,":"+uh+"$1")]})],o);case"::placeholder":return wl([Oc(t,{props:[Pe(i,/:(plac\w+)/,":"+Re+"input-$1")]}),Oc(t,{props:[Pe(i,/:(plac\w+)/,":"+uh+"$1")]}),Oc(t,{props:[Pe(i,/:(plac\w+)/,sr+"input-$1")]})],o)}return""})}},EU=[SU],CU=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(m){var b=m.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var o=t.stylisPlugins||EU,i={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(m){for(var b=m.getAttribute("data-emotion").split(" "),v=1;vr==null?t:function(...o){t.apply(this,o),r.apply(this,o)},()=>{})}function Lj(e,t=166){let r;function n(...o){const i=()=>{e.apply(this,o)};clearTimeout(r),r=setTimeout(i,t)}return n.clear=()=>{clearTimeout(r)},n}function Br(e){return e&&e.ownerDocument||document}function fd(e){return Br(e).defaultView||window}function J0(e,t){typeof e=="function"?e(t):e&&(e.current=t)}const Ij=typeof window<"u"?S.useLayoutEffect:S.useEffect,pa=Ij;let Uw=0;function Dj(e){const[t,r]=S.useState(e),n=e||t;return S.useEffect(()=>{t==null&&(Uw+=1,r(`mui-${Uw}`))},[t]),n}const Ww=k1["useId".toString()];function $j(e){if(Ww!==void 0){const t=Ww();return e??t}return Dj(e)}function Hj({controlled:e,default:t,name:r,state:n="value"}){const{current:o}=S.useRef(e!==void 0),[i,s]=S.useState(t),a=o?e:i,l=S.useCallback(c=>{o||s(c)},[]);return[a,l]}function Ws(e){const t=S.useRef(e);return pa(()=>{t.current=e}),S.useCallback((...r)=>(0,t.current)(...r),[])}function Ur(...e){return S.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(r=>{J0(r,t)})},e)}let Sm=!0,X0=!1,Kw;const Bj={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function Fj(e){const{type:t,tagName:r}=e;return!!(r==="INPUT"&&Bj[t]&&!e.readOnly||r==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function Vj(e){e.metaKey||e.altKey||e.ctrlKey||(Sm=!0)}function e1(){Sm=!1}function jj(){this.visibilityState==="hidden"&&X0&&(Sm=!0)}function Uj(e){e.addEventListener("keydown",Vj,!0),e.addEventListener("mousedown",e1,!0),e.addEventListener("pointerdown",e1,!0),e.addEventListener("touchstart",e1,!0),e.addEventListener("visibilitychange",jj,!0)}function Wj(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return Sm||Fj(t)}function zT(){const e=S.useCallback(o=>{o!=null&&Uj(o.ownerDocument)},[]),t=S.useRef(!1);function r(){return t.current?(X0=!0,window.clearTimeout(Kw),Kw=window.setTimeout(()=>{X0=!1},100),t.current=!1,!0):!1}function n(o){return Wj(o)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:n,onBlur:r,ref:e}}function LT(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}const Kj=e=>{const t=S.useRef({});return S.useEffect(()=>{t.current=e}),t.current},IT=Kj;function DT(e,t){const r=_({},t);return Object.keys(e).forEach(n=>{if(n.toString().match(/^(components|slots)$/))r[n]=_({},e[n],r[n]);else if(n.toString().match(/^(componentsProps|slotProps)$/)){const o=e[n]||{},i=t[n];r[n]={},!i||!Object.keys(i)?r[n]=o:!o||!Object.keys(o)?r[n]=i:(r[n]=_({},i),Object.keys(o).forEach(s=>{r[n][s]=DT(o[s],i[s])}))}else r[n]===void 0&&(r[n]=e[n])}),r}function rr(e,t,r=void 0){const n={};return Object.keys(e).forEach(o=>{n[o]=e[o].reduce((i,s)=>{if(s){const a=t(s);a!==""&&i.push(a),r&&r[s]&&i.push(r[s])}return i},[]).join(" ")}),n}const qw=e=>e,qj=()=>{let e=qw;return{configure(t){e=t},generate(t){return e(t)},reset(){e=qw}}},Gj=qj(),$T=Gj,Yj={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Vt(e,t,r="Mui"){const n=Yj[t];return n?`${r}-${n}`:`${$T.generate(e)}-${t}`}function jt(e,t,r="Mui"){const n={};return t.forEach(o=>{n[o]=Vt(e,o,r)}),n}const Kl="$$material";function ve(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i=0)&&(r[o]=e[o]);return r}function HT(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Jj=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Xj=HT(function(e){return Jj.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91});function Qj(e){if(e.sheet)return e.sheet;for(var t=0;t0?Gt(uc,--Wr):0,ql--,wt===10&&(ql=1,Cm--),wt}function dn(){return wt=Wr2||hd(wt)>3?"":" "}function dU(e,t){for(;--t&&dn()&&!(wt<48||wt>102||wt>57&&wt<65||wt>70&&wt<97););return Kd(e,cp()+(t<6&&Eo()==32&&dn()==32))}function Z0(e){for(;dn();)switch(wt){case e:return Wr;case 34:case 39:e!==34&&e!==39&&Z0(wt);break;case 40:e===41&&Z0(e);break;case 92:dn();break}return Wr}function fU(e,t){for(;dn()&&e+wt!==47+10;)if(e+wt===42+42&&Eo()===47)break;return"/*"+Kd(t,Wr-1)+"*"+Em(e===47?e:dn())}function pU(e){for(;!hd(Eo());)dn();return Kd(e,Wr)}function hU(e){return WT(dp("",null,null,null,[""],e=UT(e),0,[0],e))}function dp(e,t,r,n,o,i,s,a,l){for(var c=0,u=0,d=s,f=0,p=0,h=0,m=1,b=1,v=1,g=0,y="",x=o,k=i,w=n,E=y;b;)switch(h=g,g=dn()){case 40:if(h!=108&&Gt(E,d-1)==58){Q0(E+=Pe(up(g),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:E+=up(g);break;case 9:case 10:case 13:case 32:E+=uU(h);break;case 92:E+=dU(cp()-1,7);continue;case 47:switch(Eo()){case 42:case 47:Ef(mU(fU(dn(),cp()),t,r),l);break;default:E+="/"}break;case 123*m:a[c++]=go(E)*v;case 125*m:case 59:case 0:switch(g){case 0:case 125:b=0;case 59+u:v==-1&&(E=Pe(E,/\f/g,"")),p>0&&go(E)-d&&Ef(p>32?Yw(E+";",n,r,d-1):Yw(Pe(E," ","")+";",n,r,d-2),l);break;case 59:E+=";";default:if(Ef(w=Gw(E,t,r,c,u,o,a,y,x=[],k=[],d),i),g===123)if(u===0)dp(E,t,w,w,x,i,d,a,k);else switch(f===99&&Gt(E,3)===110?100:f){case 100:case 108:case 109:case 115:dp(e,w,w,n&&Ef(Gw(e,w,w,0,0,o,a,y,o,x=[],d),k),o,k,d,a,n?x:k);break;default:dp(E,w,w,w,[""],k,0,a,k)}}c=u=p=0,m=v=1,y=E="",d=s;break;case 58:d=1+go(E),p=h;default:if(m<1){if(g==123)--m;else if(g==125&&m++==0&&cU()==125)continue}switch(E+=Em(g),g*m){case 38:v=u>0?1:(E+="\f",-1);break;case 44:a[c++]=(go(E)-1)*v,v=1;break;case 64:Eo()===45&&(E+=up(dn())),f=Eo(),u=d=go(y=E+=pU(cp())),g++;break;case 45:h===45&&go(E)==2&&(m=0)}}return i}function Gw(e,t,r,n,o,i,s,a,l,c,u){for(var d=o-1,f=o===0?i:[""],p=ab(f),h=0,m=0,b=0;h0?f[v]+" "+g:Pe(g,/&\f/g,f[v])))&&(l[b++]=y);return Mm(e,t,r,o===0?ib:a,l,c,u)}function mU(e,t,r){return Mm(e,t,r,BT,Em(lU()),pd(e,2,-2),0)}function Yw(e,t,r,n){return Mm(e,t,r,sb,pd(e,0,n),pd(e,n+1,-1),n)}function wl(e,t){for(var r="",n=ab(e),o=0;o6)switch(Gt(e,t+1)){case 109:if(Gt(e,t+4)!==45)break;case 102:return Pe(e,/(.+:)(.+)-([^]+)/,"$1"+Re+"$2-$3$1"+dh+(Gt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Q0(e,"stretch")?KT(Pe(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Gt(e,t+1)!==115)break;case 6444:switch(Gt(e,go(e)-3-(~Q0(e,"!important")&&10))){case 107:return Pe(e,":",":"+Re)+e;case 101:return Pe(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Re+(Gt(e,14)===45?"inline-":"")+"box$3$1"+Re+"$2$3$1"+sr+"$2box$3")+e}break;case 5936:switch(Gt(e,t+11)){case 114:return Re+e+sr+Pe(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Re+e+sr+Pe(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Re+e+sr+Pe(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Re+e+sr+e+e}return e}var EU=function(t,r,n,o){if(t.length>-1&&!t.return)switch(t.type){case sb:t.return=KT(t.value,t.length);break;case FT:return wl([Oc(t,{value:Pe(t.value,"@","@"+Re)})],o);case ib:if(t.length)return aU(t.props,function(i){switch(sU(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return wl([Oc(t,{props:[Pe(i,/:(read-\w+)/,":"+dh+"$1")]})],o);case"::placeholder":return wl([Oc(t,{props:[Pe(i,/:(plac\w+)/,":"+Re+"input-$1")]}),Oc(t,{props:[Pe(i,/:(plac\w+)/,":"+dh+"$1")]}),Oc(t,{props:[Pe(i,/:(plac\w+)/,sr+"input-$1")]})],o)}return""})}},CU=[EU],MU=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(m){var b=m.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var o=t.stylisPlugins||CU,i={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(m){for(var b=m.getAttribute("data-emotion").split(" "),v=1;v=4;++n,o-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var $U={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},HU=/[A-Z]|^ms/g,BU=/_EMO_([^_]+?)_([^]*?)_EMO_/g,XT=function(t){return t.charCodeAt(1)===45},Jw=function(t){return t!=null&&typeof t!="boolean"},e1=$T(function(e){return XT(e)?e:e.replace(HU,"-$&").toLowerCase()}),Xw=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(BU,function(n,o,i){return vo={name:o,styles:i,next:vo},o})}return $U[t]!==1&&!XT(t)&&typeof r=="number"&&r!==0?r+"px":r};function md(e,t,r){if(r==null)return"";if(r.__emotion_styles!==void 0)return r;switch(typeof r){case"boolean":return"";case"object":{if(r.anim===1)return vo={name:r.name,styles:r.styles,next:vo},r.name;if(r.styles!==void 0){var n=r.next;if(n!==void 0)for(;n!==void 0;)vo={name:n.name,styles:n.styles,next:vo},n=n.next;var o=r.styles+";";return o}return FU(e,t,r)}case"function":{if(e!==void 0){var i=vo,s=r(e);return vo=i,md(e,t,s)}break}}if(t==null)return r;var a=t[r];return a!==void 0?a:r}function FU(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o96?KU:qU},eS=function(t,r,n){var o;if(r){var i=r.shouldForwardProp;o=t.__emotion_forwardProp&&i?function(s){return t.__emotion_forwardProp(s)&&i(s)}:i}return typeof o!="function"&&n&&(o=t.__emotion_forwardProp),o},GU=function(t){var r=t.cache,n=t.serialized,o=t.isStringTag;return JT(r,n,o),UU(function(){return IU(r,n,o)}),null},YU=function e(t,r){var n=t.__emotion_real===t,o=n&&t.__emotion_base||t,i,s;r!==void 0&&(i=r.label,s=r.target);var a=eS(t,r,n),l=a||Zw(o),c=!l("as");return function(){var u=arguments,d=n&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&d.push("label:"+i+";"),u[0]==null||u[0].raw===void 0)d.push.apply(d,u);else{d.push(u[0][0]);for(var f=u.length,p=1;p=4;++n,o-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var HU={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},BU=/[A-Z]|^ms/g,FU=/_EMO_([^_]+?)_([^]*?)_EMO_/g,QT=function(t){return t.charCodeAt(1)===45},Xw=function(t){return t!=null&&typeof t!="boolean"},t1=HT(function(e){return QT(e)?e:e.replace(BU,"-$&").toLowerCase()}),Qw=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(FU,function(n,o,i){return vo={name:o,styles:i,next:vo},o})}return HU[t]!==1&&!QT(t)&&typeof r=="number"&&r!==0?r+"px":r};function md(e,t,r){if(r==null)return"";if(r.__emotion_styles!==void 0)return r;switch(typeof r){case"boolean":return"";case"object":{if(r.anim===1)return vo={name:r.name,styles:r.styles,next:vo},r.name;if(r.styles!==void 0){var n=r.next;if(n!==void 0)for(;n!==void 0;)vo={name:n.name,styles:n.styles,next:vo},n=n.next;var o=r.styles+";";return o}return VU(e,t,r)}case"function":{if(e!==void 0){var i=vo,s=r(e);return vo=i,md(e,t,s)}break}}if(t==null)return r;var a=t[r];return a!==void 0?a:r}function VU(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o96?qU:GU},tS=function(t,r,n){var o;if(r){var i=r.shouldForwardProp;o=t.__emotion_forwardProp&&i?function(s){return t.__emotion_forwardProp(s)&&i(s)}:i}return typeof o!="function"&&n&&(o=t.__emotion_forwardProp),o},YU=function(t){var r=t.cache,n=t.serialized,o=t.isStringTag;return XT(r,n,o),WU(function(){return DU(r,n,o)}),null},JU=function e(t,r){var n=t.__emotion_real===t,o=n&&t.__emotion_base||t,i,s;r!==void 0&&(i=r.label,s=r.target);var a=tS(t,r,n),l=a||eS(o),c=!l("as");return function(){var u=arguments,d=n&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&d.push("label:"+i+";"),u[0]==null||u[0].raw===void 0)d.push.apply(d,u);else{d.push(u[0][0]);for(var f=u.length,p=1;p{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))},QU=["values","unit","step"],ZU=e=>{const t=Object.keys(e).map(r=>({key:r,val:e[r]}))||[];return t.sort((r,n)=>r.val-n.val),t.reduce((r,n)=>_({},r,{[n.key]:n.val}),{})};function eW(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5}=e,o=ve(e,QU),i=ZU(t),s=Object.keys(i);function a(f){return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r})`}function l(f){return`@media (max-width:${(typeof t[f]=="number"?t[f]:f)-n/100}${r})`}function c(f,p){const h=s.indexOf(p);return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r}) and (max-width:${(h!==-1&&typeof t[s[h]]=="number"?t[s[h]]:p)-n/100}${r})`}function u(f){return s.indexOf(f)+1`@media (min-width:${fb[e]}px)`};function ao(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const i=n.breakpoints||tS;return t.reduce((s,a,l)=>(s[i.up(i.keys[l])]=r(t[l]),s),{})}if(typeof t=="object"){const i=n.breakpoints||tS;return Object.keys(t).reduce((s,a)=>{if(Object.keys(i.values||fb).indexOf(a)!==-1){const l=i.up(a);s[l]=r(t[a],a)}else{const l=a;s[l]=t[l]}return s},{})}return r(t)}function t3(e={}){var t;return((t=e.keys)==null?void 0:t.reduce((n,o)=>{const i=e.up(o);return n[i]={},n},{}))||{}}function r3(e,t){return e.reduce((r,n)=>{const o=r[n];return(!o||Object.keys(o).length===0)&&delete r[n],r},t)}function nW(e,...t){const r=t3(e),n=[r,...t].reduce((o,i)=>un(o,i),{});return r3(Object.keys(r),n)}function oW(e,t){if(typeof e!="object")return{};const r={},n=Object.keys(t);return Array.isArray(e)?n.forEach((o,i)=>{i{e[o]!=null&&(r[o]=!0)}),r}function t1({values:e,breakpoints:t,base:r}){const n=r||oW(e,t),o=Object.keys(n);if(o.length===0)return e;let i;return o.reduce((s,a,l)=>(Array.isArray(e)?(s[a]=e[l]!=null?e[l]:e[i],i=l):typeof e=="object"?(s[a]=e[a]!=null?e[a]:e[i],i=a):s[a]=e,s),{})}function Im(e,t,r=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&r){const n=`vars.${t}`.split(".").reduce((o,i)=>o&&o[i]?o[i]:null,e);if(n!=null)return n}return t.split(".").reduce((n,o)=>n&&n[o]!=null?n[o]:null,e)}function fh(e,t,r,n=r){let o;return typeof e=="function"?o=e(r):Array.isArray(e)?o=e[r]||n:o=Im(e,r)||n,t&&(o=t(o,n,e)),o}function Ie(e){const{prop:t,cssProperty:r=e.prop,themeKey:n,transform:o}=e,i=s=>{if(s[t]==null)return null;const a=s[t],l=s.theme,c=Im(l,n)||{};return ao(s,a,d=>{let f=fh(c,o,d);return d===f&&typeof d=="string"&&(f=fh(c,o,`${t}${d==="default"?"":Fe(d)}`,d)),r===!1?f:{[r]:f}})};return i.propTypes={},i.filterProps=[t],i}function iW(e){const t={};return r=>(t[r]===void 0&&(t[r]=e(r)),t[r])}const sW={m:"margin",p:"padding"},aW={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},rS={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},lW=iW(e=>{if(e.length>2)if(rS[e])e=rS[e];else return[e];const[t,r]=e.split(""),n=sW[t],o=aW[r]||"";return Array.isArray(o)?o.map(i=>n+i):[n+o]}),pb=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],hb=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...pb,...hb];function qd(e,t,r,n){var o;const i=(o=Im(e,t,!1))!=null?o:r;return typeof i=="number"?s=>typeof s=="string"?s:i*s:Array.isArray(i)?s=>typeof s=="string"?s:i[s]:typeof i=="function"?i:()=>{}}function mb(e){return qd(e,"spacing",8)}function ma(e,t){if(typeof t=="string"||t==null)return t;const r=Math.abs(t),n=e(r);return t>=0?n:typeof n=="number"?-n:`-${n}`}function cW(e,t){return r=>e.reduce((n,o)=>(n[o]=ma(t,r),n),{})}function uW(e,t,r,n){if(t.indexOf(r)===-1)return null;const o=lW(r),i=cW(o,n),s=e[r];return ao(e,s,i)}function n3(e,t){const r=mb(e.theme);return Object.keys(e).map(n=>uW(e,t,n,r)).reduce(_u,{})}function pt(e){return n3(e,pb)}pt.propTypes={};pt.filterProps=pb;function ht(e){return n3(e,hb)}ht.propTypes={};ht.filterProps=hb;function dW(e=8){if(e.mui)return e;const t=mb({spacing:e}),r=(...n)=>(n.length===0?[1]:n).map(i=>{const s=t(i);return typeof s=="number"?`${s}px`:s}).join(" ");return r.mui=!0,r}function Dm(...e){const t=e.reduce((n,o)=>(o.filterProps.forEach(i=>{n[i]=o}),n),{}),r=n=>Object.keys(n).reduce((o,i)=>t[i]?_u(o,t[i](n)):o,{});return r.propTypes={},r.filterProps=e.reduce((n,o)=>n.concat(o.filterProps),[]),r}function xo(e){return typeof e!="number"?e:`${e}px solid`}const fW=Ie({prop:"border",themeKey:"borders",transform:xo}),pW=Ie({prop:"borderTop",themeKey:"borders",transform:xo}),hW=Ie({prop:"borderRight",themeKey:"borders",transform:xo}),mW=Ie({prop:"borderBottom",themeKey:"borders",transform:xo}),gW=Ie({prop:"borderLeft",themeKey:"borders",transform:xo}),vW=Ie({prop:"borderColor",themeKey:"palette"}),yW=Ie({prop:"borderTopColor",themeKey:"palette"}),bW=Ie({prop:"borderRightColor",themeKey:"palette"}),xW=Ie({prop:"borderBottomColor",themeKey:"palette"}),kW=Ie({prop:"borderLeftColor",themeKey:"palette"}),$m=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=qd(e.theme,"shape.borderRadius",4),r=n=>({borderRadius:ma(t,n)});return ao(e,e.borderRadius,r)}return null};$m.propTypes={};$m.filterProps=["borderRadius"];Dm(fW,pW,hW,mW,gW,vW,yW,bW,xW,kW,$m);const Hm=e=>{if(e.gap!==void 0&&e.gap!==null){const t=qd(e.theme,"spacing",8),r=n=>({gap:ma(t,n)});return ao(e,e.gap,r)}return null};Hm.propTypes={};Hm.filterProps=["gap"];const Bm=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=qd(e.theme,"spacing",8),r=n=>({columnGap:ma(t,n)});return ao(e,e.columnGap,r)}return null};Bm.propTypes={};Bm.filterProps=["columnGap"];const Fm=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=qd(e.theme,"spacing",8),r=n=>({rowGap:ma(t,n)});return ao(e,e.rowGap,r)}return null};Fm.propTypes={};Fm.filterProps=["rowGap"];const wW=Ie({prop:"gridColumn"}),SW=Ie({prop:"gridRow"}),EW=Ie({prop:"gridAutoFlow"}),CW=Ie({prop:"gridAutoColumns"}),MW=Ie({prop:"gridAutoRows"}),TW=Ie({prop:"gridTemplateColumns"}),OW=Ie({prop:"gridTemplateRows"}),_W=Ie({prop:"gridTemplateAreas"}),AW=Ie({prop:"gridArea"});Dm(Hm,Bm,Fm,wW,SW,EW,CW,MW,TW,OW,_W,AW);function Sl(e,t){return t==="grey"?t:e}const NW=Ie({prop:"color",themeKey:"palette",transform:Sl}),RW=Ie({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Sl}),PW=Ie({prop:"backgroundColor",themeKey:"palette",transform:Sl});Dm(NW,RW,PW);function sn(e){return e<=1&&e!==0?`${e*100}%`:e}const zW=Ie({prop:"width",transform:sn}),gb=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=r=>{var n,o;const i=((n=e.theme)==null||(n=n.breakpoints)==null||(n=n.values)==null?void 0:n[r])||fb[r];return i?((o=e.theme)==null||(o=o.breakpoints)==null?void 0:o.unit)!=="px"?{maxWidth:`${i}${e.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:sn(r)}};return ao(e,e.maxWidth,t)}return null};gb.filterProps=["maxWidth"];const LW=Ie({prop:"minWidth",transform:sn}),IW=Ie({prop:"height",transform:sn}),DW=Ie({prop:"maxHeight",transform:sn}),$W=Ie({prop:"minHeight",transform:sn});Ie({prop:"size",cssProperty:"width",transform:sn});Ie({prop:"size",cssProperty:"height",transform:sn});const HW=Ie({prop:"boxSizing"});Dm(zW,gb,LW,IW,DW,$W,HW);const BW={border:{themeKey:"borders",transform:xo},borderTop:{themeKey:"borders",transform:xo},borderRight:{themeKey:"borders",transform:xo},borderBottom:{themeKey:"borders",transform:xo},borderLeft:{themeKey:"borders",transform:xo},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:$m},color:{themeKey:"palette",transform:Sl},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Sl},backgroundColor:{themeKey:"palette",transform:Sl},p:{style:ht},pt:{style:ht},pr:{style:ht},pb:{style:ht},pl:{style:ht},px:{style:ht},py:{style:ht},padding:{style:ht},paddingTop:{style:ht},paddingRight:{style:ht},paddingBottom:{style:ht},paddingLeft:{style:ht},paddingX:{style:ht},paddingY:{style:ht},paddingInline:{style:ht},paddingInlineStart:{style:ht},paddingInlineEnd:{style:ht},paddingBlock:{style:ht},paddingBlockStart:{style:ht},paddingBlockEnd:{style:ht},m:{style:pt},mt:{style:pt},mr:{style:pt},mb:{style:pt},ml:{style:pt},mx:{style:pt},my:{style:pt},margin:{style:pt},marginTop:{style:pt},marginRight:{style:pt},marginBottom:{style:pt},marginLeft:{style:pt},marginX:{style:pt},marginY:{style:pt},marginInline:{style:pt},marginInlineStart:{style:pt},marginInlineEnd:{style:pt},marginBlock:{style:pt},marginBlockStart:{style:pt},marginBlockEnd:{style:pt},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Hm},rowGap:{style:Fm},columnGap:{style:Bm},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:sn},maxWidth:{style:gb},minWidth:{transform:sn},height:{transform:sn},maxHeight:{transform:sn},minHeight:{transform:sn},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},Vm=BW;function FW(...e){const t=e.reduce((n,o)=>n.concat(Object.keys(o)),[]),r=new Set(t);return e.every(n=>r.size===Object.keys(n).length)}function VW(e,t){return typeof e=="function"?e(t):e}function jW(){function e(r,n,o,i){const s={[r]:n,theme:o},a=i[r];if(!a)return{[r]:n};const{cssProperty:l=r,themeKey:c,transform:u,style:d}=a;if(n==null)return null;if(c==="typography"&&n==="inherit")return{[r]:n};const f=Im(o,c)||{};return d?d(s):ao(s,n,h=>{let m=fh(f,u,h);return h===m&&typeof h=="string"&&(m=fh(f,u,`${r}${h==="default"?"":Fe(h)}`,h)),l===!1?m:{[l]:m}})}function t(r){var n;const{sx:o,theme:i={}}=r||{};if(!o)return null;const s=(n=i.unstable_sxConfig)!=null?n:Vm;function a(l){let c=l;if(typeof l=="function")c=l(i);else if(typeof l!="object")return l;if(!c)return null;const u=t3(i.breakpoints),d=Object.keys(u);let f=u;return Object.keys(c).forEach(p=>{const h=VW(c[p],i);if(h!=null)if(typeof h=="object")if(s[p])f=_u(f,e(p,h,i,s));else{const m=ao({theme:i},h,b=>({[p]:b}));FW(m,h)?f[p]=t({sx:h,theme:i}):f=_u(f,m)}else f=_u(f,e(p,h,i,s))}),r3(d,f)}return Array.isArray(o)?o.map(a):a(o)}return t}const o3=jW();o3.filterProps=["sx"];const jm=o3,UW=["breakpoints","palette","spacing","shape"];function Um(e={},...t){const{breakpoints:r={},palette:n={},spacing:o,shape:i={}}=e,s=ve(e,UW),a=eW(r),l=dW(o);let c=un({breakpoints:a,direction:"ltr",components:{},palette:_({mode:"light"},n),spacing:l,shape:_({},rW,i)},s);return c=t.reduce((u,d)=>un(u,d),c),c.unstable_sxConfig=_({},Vm,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(d){return jm({sx:d,theme:this})},c}function WW(e){return Object.keys(e).length===0}function vb(e=null){const t=S.useContext(ub);return!t||WW(t)?e:t}const KW=Um();function yb(e=KW){return vb(e)}const qW=["sx"],GW=e=>{var t,r;const n={systemProps:{},otherProps:{}},o=(t=e==null||(r=e.theme)==null?void 0:r.unstable_sxConfig)!=null?t:Vm;return Object.keys(e).forEach(i=>{o[i]?n.systemProps[i]=e[i]:n.otherProps[i]=e[i]}),n};function bb(e){const{sx:t}=e,r=ve(e,qW),{systemProps:n,otherProps:o}=GW(r);let i;return Array.isArray(t)?i=[n,...t]:typeof t=="function"?i=(...s)=>{const a=t(...s);return Wo(a)?_({},n,a):n}:i=_({},n,t),_({},o,{sx:i})}function i3(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ta!=="theme"&&a!=="sx"&&a!=="as"})(jm);return S.forwardRef(function(l,c){const u=yb(r),d=bb(l),{className:f,component:p="div"}=d,h=ve(d,YW);return O.jsx(i,_({as:p,ref:c,className:Ce(f,o?o(n):n),theme:t&&u[t]||u},h))})}const XW=["variant"];function nS(e){return e.length===0}function s3(e){const{variant:t}=e,r=ve(e,XW);let n=t||"";return Object.keys(r).sort().forEach(o=>{o==="color"?n+=nS(n)?e[o]:Fe(e[o]):n+=`${nS(n)?o:Fe(o)}${Fe(e[o].toString())}`}),n}const QW=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function ZW(e){return Object.keys(e).length===0}function eK(e){return typeof e=="string"&&e.charCodeAt(0)>96}const tK=(e,t)=>t.components&&t.components[e]&&t.components[e].styleOverrides?t.components[e].styleOverrides:null,ph=e=>{const t={};return e&&e.forEach(r=>{const n=s3(r.props);t[n]=r.style}),t},rK=(e,t)=>{let r=[];return t&&t.components&&t.components[e]&&t.components[e].variants&&(r=t.components[e].variants),ph(r)},hh=(e,t,r)=>{const{ownerState:n={}}=e,o=[];return r&&r.forEach(i=>{let s=!0;Object.keys(i.props).forEach(a=>{n[a]!==i.props[a]&&e[a]!==i.props[a]&&(s=!1)}),s&&o.push(t[s3(i.props)])}),o},nK=(e,t,r,n)=>{var o;const i=r==null||(o=r.components)==null||(o=o[n])==null?void 0:o.variants;return hh(e,t,i)};function fp(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const oK=Um(),iK=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function pp({defaultTheme:e,theme:t,themeId:r}){return ZW(t)?e:t[r]||t}function sK(e){return e?(t,r)=>r[e]:null}const oS=({styledArg:e,props:t,defaultTheme:r,themeId:n})=>{const o=e(_({},t,{theme:pp(_({},t,{defaultTheme:r,themeId:n}))}));let i;if(o&&o.variants&&(i=o.variants,delete o.variants),i){const s=hh(t,ph(i),i);return[o,...s]}return o};function a3(e={}){const{themeId:t,defaultTheme:r=oK,rootShouldForwardProp:n=fp,slotShouldForwardProp:o=fp}=e,i=s=>jm(_({},s,{theme:pp(_({},s,{defaultTheme:r,themeId:t}))}));return i.__mui_systemSx=!0,(s,a={})=>{XU(s,x=>x.filter(k=>!(k!=null&&k.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:d,overridesResolver:f=sK(iK(c))}=a,p=ve(a,QW),h=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,m=d||!1;let b,v=fp;c==="Root"||c==="root"?v=n:c?v=o:eK(s)&&(v=void 0);const g=e3(s,_({shouldForwardProp:v,label:b},p)),y=(x,...k)=>{const w=k?k.map(M=>{if(typeof M=="function"&&M.__emotion_real!==M)return N=>oS({styledArg:M,props:N,defaultTheme:r,themeId:t});if(Wo(M)){let N=M,F;return M&&M.variants&&(F=M.variants,delete N.variants,N=I=>{let V=M;return hh(I,ph(F),F).forEach(z=>{V=un(V,z)}),V}),N}return M}):[];let E=x;if(Wo(x)){let M;x&&x.variants&&(M=x.variants,delete E.variants,E=N=>{let F=x;return hh(N,ph(M),M).forEach(V=>{F=un(F,V)}),F})}else typeof x=="function"&&x.__emotion_real!==x&&(E=M=>oS({styledArg:x,props:M,defaultTheme:r,themeId:t}));l&&f&&w.push(M=>{const N=pp(_({},M,{defaultTheme:r,themeId:t})),F=tK(l,N);if(F){const I={};return Object.entries(F).forEach(([V,j])=>{I[V]=typeof j=="function"?j(_({},M,{theme:N})):j}),f(M,I)}return null}),l&&!h&&w.push(M=>{const N=pp(_({},M,{defaultTheme:r,themeId:t}));return nK(M,rK(l,N),N,l)}),m||w.push(i);const T=w.length-k.length;if(Array.isArray(x)&&T>0){const M=new Array(T).fill("");E=[...x,...M],E.raw=[...x.raw,...M]}const C=g(E,...w);return s.muiName&&(C.muiName=s.muiName),C};return g.withConfig&&(y.withConfig=g.withConfig),y}}const aK=a3(),lK=aK;function cK(e){const{theme:t,name:r,props:n}=e;return!t||!t.components||!t.components[r]||!t.components[r].defaultProps?n:IT(t.components[r].defaultProps,n)}function l3({props:e,name:t,defaultTheme:r,themeId:n}){let o=yb(r);return n&&(o=o[n]||o),cK({theme:o,name:t,props:e})}function xb(e,t=0,r=1){return Math.min(Math.max(t,e),r)}function uK(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let r=e.match(t);return r&&r[0].length===1&&(r=r.map(n=>n+n)),r?`rgb${r.length===4?"a":""}(${r.map((n,o)=>o<3?parseInt(n,16):Math.round(parseInt(n,16)/255*1e3)/1e3).join(", ")})`:""}function ga(e){if(e.type)return e;if(e.charAt(0)==="#")return ga(uK(e));const t=e.indexOf("("),r=e.substring(0,t);if(["rgb","rgba","hsl","hsla","color"].indexOf(r)===-1)throw new Error(Wl(9,e));let n=e.substring(t+1,e.length-1),o;if(r==="color"){if(n=n.split(" "),o=n.shift(),n.length===4&&n[3].charAt(0)==="/"&&(n[3]=n[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(o)===-1)throw new Error(Wl(10,o))}else n=n.split(",");return n=n.map(i=>parseFloat(i)),{type:r,values:n,colorSpace:o}}function Wm(e){const{type:t,colorSpace:r}=e;let{values:n}=e;return t.indexOf("rgb")!==-1?n=n.map((o,i)=>i<3?parseInt(o,10):o):t.indexOf("hsl")!==-1&&(n[1]=`${n[1]}%`,n[2]=`${n[2]}%`),t.indexOf("color")!==-1?n=`${r} ${n.join(" ")}`:n=`${n.join(", ")}`,`${t}(${n})`}function dK(e){e=ga(e);const{values:t}=e,r=t[0],n=t[1]/100,o=t[2]/100,i=n*Math.min(o,1-o),s=(c,u=(c+r/30)%12)=>o-i*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return e.type==="hsla"&&(a+="a",l.push(t[3])),Wm({type:a,values:l})}function iS(e){e=ga(e);let t=e.type==="hsl"||e.type==="hsla"?ga(dK(e)).values:e.values;return t=t.map(r=>(e.type!=="color"&&(r/=255),r<=.03928?r/12.92:((r+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function fK(e,t){const r=iS(e),n=iS(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}function Lr(e,t){return e=ga(e),t=xb(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Wm(e)}function pK(e,t){if(e=ga(e),t=xb(t),e.type.indexOf("hsl")!==-1)e.values[2]*=1-t;else if(e.type.indexOf("rgb")!==-1||e.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)e.values[r]*=1-t;return Wm(e)}function hK(e,t){if(e=ga(e),t=xb(t),e.type.indexOf("hsl")!==-1)e.values[2]+=(100-e.values[2])*t;else if(e.type.indexOf("rgb")!==-1)for(let r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(e.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return Wm(e)}const mK=S.createContext(null),c3=mK;function u3(){return S.useContext(c3)}const gK=typeof Symbol=="function"&&Symbol.for,vK=gK?Symbol.for("mui.nested"):"__THEME_NESTED__";function yK(e,t){return typeof t=="function"?t(e):_({},e,t)}function bK(e){const{children:t,theme:r}=e,n=u3(),o=S.useMemo(()=>{const i=n===null?r:yK(n,r);return i!=null&&(i[vK]=n!==null),i},[r,n]);return O.jsx(c3.Provider,{value:o,children:t})}const sS={};function aS(e,t,r,n=!1){return S.useMemo(()=>{const o=e&&t[e]||t;if(typeof r=="function"){const i=r(o),s=e?_({},t,{[e]:i}):i;return n?()=>s:s}return e?_({},t,{[e]:r}):_({},t,r)},[e,t,r,n])}function xK(e){const{children:t,theme:r,themeId:n}=e,o=vb(sS),i=u3()||sS,s=aS(n,o,r),a=aS(n,i,r,!0);return O.jsx(bK,{theme:a,children:O.jsx(ub.Provider,{value:s,children:t})})}const kK=["component","direction","spacing","divider","children","className","useFlexGap"],wK=Um(),SK=lK("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root});function EK(e){return l3({props:e,name:"MuiStack",defaultTheme:wK})}function CK(e,t){const r=S.Children.toArray(e).filter(Boolean);return r.reduce((n,o,i)=>(n.push(o),i({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],TK=({ownerState:e,theme:t})=>{let r=_({display:"flex",flexDirection:"column"},ao({theme:t},t1({values:e.direction,breakpoints:t.breakpoints.values}),n=>({flexDirection:n})));if(e.spacing){const n=mb(t),o=Object.keys(t.breakpoints.values).reduce((l,c)=>((typeof e.spacing=="object"&&e.spacing[c]!=null||typeof e.direction=="object"&&e.direction[c]!=null)&&(l[c]=!0),l),{}),i=t1({values:e.direction,base:o}),s=t1({values:e.spacing,base:o});typeof i=="object"&&Object.keys(i).forEach((l,c,u)=>{if(!i[l]){const f=c>0?i[u[c-1]]:"column";i[l]=f}}),r=un(r,ao({theme:t},s,(l,c)=>e.useFlexGap?{gap:ma(n,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${MK(c?i[c]:e.direction)}`]:ma(n,l)}}))}return r=nW(t.breakpoints,r),r};function OK(e={}){const{createStyledComponent:t=SK,useThemeProps:r=EK,componentName:n="MuiStack"}=e,o=()=>rr({root:["root"]},l=>Vt(n,l),{}),i=t(TK);return S.forwardRef(function(l,c){const u=r(l),d=bb(u),{component:f="div",direction:p="column",spacing:h=0,divider:m,children:b,className:v,useFlexGap:g=!1}=d,y=ve(d,kK),x={direction:p,spacing:h,useFlexGap:g},k=o();return O.jsx(i,_({as:f,ownerState:x,ref:c,className:Ce(k.root,v)},y,{children:m?CK(b,m):b}))})}function _K(e,t){return _({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},t)}const AK=["mode","contrastThreshold","tonalOffset"],lS={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:dd.white,default:dd.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},r1={text:{primary:dd.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:dd.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function cS(e,t,r,n){const o=n.light||n,i=n.dark||n*1.5;e[t]||(e.hasOwnProperty(r)?e[t]=e[r]:t==="light"?e.light=hK(e.main,o):t==="dark"&&(e.dark=pK(e.main,i)))}function NK(e="light"){return e==="dark"?{main:Ia[200],light:Ia[50],dark:Ia[400]}:{main:Ia[700],light:Ia[400],dark:Ia[800]}}function RK(e="light"){return e==="dark"?{main:La[200],light:La[50],dark:La[400]}:{main:La[500],light:La[300],dark:La[700]}}function PK(e="light"){return e==="dark"?{main:za[500],light:za[300],dark:za[700]}:{main:za[700],light:za[400],dark:za[800]}}function zK(e="light"){return e==="dark"?{main:Da[400],light:Da[300],dark:Da[700]}:{main:Da[700],light:Da[500],dark:Da[900]}}function LK(e="light"){return e==="dark"?{main:$a[400],light:$a[300],dark:$a[700]}:{main:$a[800],light:$a[500],dark:$a[900]}}function IK(e="light"){return e==="dark"?{main:Tc[400],light:Tc[300],dark:Tc[700]}:{main:"#ed6c02",light:Tc[500],dark:Tc[900]}}function DK(e){const{mode:t="light",contrastThreshold:r=3,tonalOffset:n=.2}=e,o=ve(e,AK),i=e.primary||NK(t),s=e.secondary||RK(t),a=e.error||PK(t),l=e.info||zK(t),c=e.success||LK(t),u=e.warning||IK(t);function d(m){return fK(m,r1.text.primary)>=r?r1.text.primary:lS.text.primary}const f=({color:m,name:b,mainShade:v=500,lightShade:g=300,darkShade:y=700})=>{if(m=_({},m),!m.main&&m[v]&&(m.main=m[v]),!m.hasOwnProperty("main"))throw new Error(Wl(11,b?` (${b})`:"",v));if(typeof m.main!="string")throw new Error(Wl(12,b?` (${b})`:"",JSON.stringify(m.main)));return cS(m,"light",g,n),cS(m,"dark",y,n),m.contrastText||(m.contrastText=d(m.main)),m},p={dark:r1,light:lS};return un(_({common:_({},dd),mode:t,primary:f({color:i,name:"primary"}),secondary:f({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:f({color:a,name:"error"}),warning:f({color:u,name:"warning"}),info:f({color:l,name:"info"}),success:f({color:c,name:"success"}),grey:Nj,contrastThreshold:r,getContrastText:d,augmentColor:f,tonalOffset:n},p[t]),o)}const $K=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function HK(e){return Math.round(e*1e5)/1e5}const uS={textTransform:"uppercase"},dS='"Roboto", "Helvetica", "Arial", sans-serif';function BK(e,t){const r=typeof t=="function"?t(e):t,{fontFamily:n=dS,fontSize:o=14,fontWeightLight:i=300,fontWeightRegular:s=400,fontWeightMedium:a=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:d}=r,f=ve(r,$K),p=o/14,h=d||(v=>`${v/c*p}rem`),m=(v,g,y,x,k)=>_({fontFamily:n,fontWeight:v,fontSize:h(g),lineHeight:y},n===dS?{letterSpacing:`${HK(x/g)}em`}:{},k,u),b={h1:m(i,96,1.167,-1.5),h2:m(i,60,1.2,-.5),h3:m(s,48,1.167,0),h4:m(s,34,1.235,.25),h5:m(s,24,1.334,0),h6:m(a,20,1.6,.15),subtitle1:m(s,16,1.75,.15),subtitle2:m(a,14,1.57,.1),body1:m(s,16,1.5,.15),body2:m(s,14,1.43,.15),button:m(a,14,1.75,.4,uS),caption:m(s,12,1.66,.4),overline:m(s,12,2.66,1,uS),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return un(_({htmlFontSize:c,pxToRem:h,fontFamily:n,fontSize:o,fontWeightLight:i,fontWeightRegular:s,fontWeightMedium:a,fontWeightBold:l},b),f,{clone:!1})}const FK=.2,VK=.14,jK=.12;function nt(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${FK})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${VK})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${jK})`].join(",")}const UK=["none",nt(0,2,1,-1,0,1,1,0,0,1,3,0),nt(0,3,1,-2,0,2,2,0,0,1,5,0),nt(0,3,3,-2,0,3,4,0,0,1,8,0),nt(0,2,4,-1,0,4,5,0,0,1,10,0),nt(0,3,5,-1,0,5,8,0,0,1,14,0),nt(0,3,5,-1,0,6,10,0,0,1,18,0),nt(0,4,5,-2,0,7,10,1,0,2,16,1),nt(0,5,5,-3,0,8,10,1,0,3,14,2),nt(0,5,6,-3,0,9,12,1,0,3,16,2),nt(0,6,6,-3,0,10,14,1,0,4,18,3),nt(0,6,7,-4,0,11,15,1,0,4,20,3),nt(0,7,8,-4,0,12,17,2,0,5,22,4),nt(0,7,8,-4,0,13,19,2,0,5,24,4),nt(0,7,9,-4,0,14,21,2,0,5,26,4),nt(0,8,9,-5,0,15,22,2,0,6,28,5),nt(0,8,10,-5,0,16,24,2,0,6,30,5),nt(0,8,11,-5,0,17,26,2,0,6,32,5),nt(0,9,11,-5,0,18,28,2,0,7,34,6),nt(0,9,12,-6,0,19,29,2,0,7,36,6),nt(0,10,13,-6,0,20,31,3,0,8,38,7),nt(0,10,13,-6,0,21,33,3,0,8,40,7),nt(0,10,14,-6,0,22,35,3,0,8,42,7),nt(0,11,14,-7,0,23,36,3,0,9,44,8),nt(0,11,15,-7,0,24,38,3,0,9,46,8)],WK=UK,KK=["duration","easing","delay"],qK={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},GK={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function fS(e){return`${Math.round(e)}ms`}function YK(e){if(!e)return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function JK(e){const t=_({},qK,e.easing),r=_({},GK,e.duration);return _({getAutoHeightDuration:YK,create:(o=["all"],i={})=>{const{duration:s=r.standard,easing:a=t.easeInOut,delay:l=0}=i;return ve(i,KK),(Array.isArray(o)?o:[o]).map(c=>`${c} ${typeof s=="string"?s:fS(s)} ${a} ${typeof l=="string"?l:fS(l)}`).join(",")}},e,{easing:t,duration:r})}const XK={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},QK=XK,ZK=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function kb(e={},...t){const{mixins:r={},palette:n={},transitions:o={},typography:i={}}=e,s=ve(e,ZK);if(e.vars)throw new Error(Wl(18));const a=DK(n),l=Um(e);let c=un(l,{mixins:_K(l.breakpoints,r),palette:a,shadows:WK.slice(),typography:BK(a,i),transitions:JK(o),zIndex:_({},QK)});return c=un(c,s),c=t.reduce((u,d)=>un(u,d),c),c.unstable_sxConfig=_({},Vm,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(d){return jm({sx:d,theme:this})},c}const eq=kb(),wb=eq;function Km(){const e=yb(wb);return e[Kl]||e}function Wt({props:e,name:t}){return l3({props:e,name:t,defaultTheme:wb,themeId:Kl})}const Sb=e=>fp(e)&&e!=="classes",tq=a3({themeId:Kl,defaultTheme:wb,rootShouldForwardProp:Sb}),Xe=tq,rq=["theme"];function nq(e){let{theme:t}=e,r=ve(e,rq);const n=t[Kl];return O.jsx(xK,_({},r,{themeId:n?Kl:void 0,theme:n||t}))}const oq=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)},pS=oq;function Z0(e,t){return Z0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Z0(e,t)}function d3(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Z0(e,t)}const hS={disabled:!1},mh=L.createContext(null);var iq=function(t){return t.scrollTop},lu="unmounted",Ns="exited",Rs="entering",Ya="entered",ev="exiting",fi=function(e){d3(t,e);function t(n,o){var i;i=e.call(this,n,o)||this;var s=o,a=s&&!s.isMounting?n.enter:n.appear,l;return i.appearStatus=null,n.in?a?(l=Ns,i.appearStatus=Rs):l=Ya:n.unmountOnExit||n.mountOnEnter?l=lu:l=Ns,i.state={status:l},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var s=o.in;return s&&i.status===lu?{status:Ns}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(o){var i=null;if(o!==this.props){var s=this.state.status;this.props.in?s!==Rs&&s!==Ya&&(i=Rs):(s===Rs||s===Ya)&&(i=ev)}this.updateStatus(!1,i)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var o=this.props.timeout,i,s,a;return i=s=a=o,o!=null&&typeof o!="number"&&(i=o.exit,s=o.enter,a=o.appear!==void 0?o.appear:s),{exit:i,enter:s,appear:a}},r.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===Rs){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:wf.findDOMNode(this);s&&iq(s)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ns&&this.setState({status:lu})},r.performEnter=function(o){var i=this,s=this.props.enter,a=this.context?this.context.isMounting:o,l=this.props.nodeRef?[a]:[wf.findDOMNode(this),a],c=l[0],u=l[1],d=this.getTimeouts(),f=a?d.appear:d.enter;if(!o&&!s||hS.disabled){this.safeSetState({status:Ya},function(){i.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:Rs},function(){i.props.onEntering(c,u),i.onTransitionEnd(f,function(){i.safeSetState({status:Ya},function(){i.props.onEntered(c,u)})})})},r.performExit=function(){var o=this,i=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:wf.findDOMNode(this);if(!i||hS.disabled){this.safeSetState({status:Ns},function(){o.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:ev},function(){o.props.onExiting(a),o.onTransitionEnd(s.exit,function(){o.safeSetState({status:Ns},function(){o.props.onExited(a)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},r.setNextCallback=function(o){var i=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,i.nextCallback=null,o(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},r.onTransitionEnd=function(o,i){this.setNextCallback(i);var s=this.props.nodeRef?this.props.nodeRef.current:wf.findDOMNode(this),a=o==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}o!=null&&setTimeout(this.nextCallback,o)},r.render=function(){var o=this.state.status;if(o===lu)return null;var i=this.props,s=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var a=ve(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return L.createElement(mh.Provider,{value:null},typeof s=="function"?s(o,a):L.cloneElement(L.Children.only(s),a))},t}(L.Component);fi.contextType=mh;fi.propTypes={};function Ha(){}fi.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ha,onEntering:Ha,onEntered:Ha,onExit:Ha,onExiting:Ha,onExited:Ha};fi.UNMOUNTED=lu;fi.EXITED=Ns;fi.ENTERING=Rs;fi.ENTERED=Ya;fi.EXITING=ev;const f3=fi;function sq(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Eb(e,t){var r=function(i){return t&&S.isValidElement(i)?t(i):i},n=Object.create(null);return e&&S.Children.map(e,function(o){return o}).forEach(function(o){n[o.key]=r(o)}),n}function aq(e,t){e=e||{},t=t||{};function r(u){return u in t?t[u]:e[u]}var n=Object.create(null),o=[];for(var i in e)i in t?o.length&&(n[i]=o,o=[]):o.push(i);var s,a={};for(var l in t){if(n[l])for(s=0;se.scrollTop;function gh(e,t){var r,n;const{timeout:o,easing:i,style:s={}}=e;return{duration:(r=s.transitionDuration)!=null?r:typeof o=="number"?o:o[t.mode]||0,easing:(n=s.transitionTimingFunction)!=null?n:typeof i=="object"?i[t.mode]:i,delay:s.transitionDelay}}function pq(e){return Vt("MuiPaper",e)}jt("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const hq=["className","component","elevation","square","variant"],mq=e=>{const{square:t,elevation:r,variant:n,classes:o}=e,i={root:["root",n,!t&&"rounded",n==="elevation"&&`elevation${r}`]};return rr(i,pq,o)},gq=Xe("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],!r.square&&t.rounded,r.variant==="elevation"&&t[`elevation${r.elevation}`]]}})(({theme:e,ownerState:t})=>{var r;return _({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!t.square&&{borderRadius:e.shape.borderRadius},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.divider}`},t.variant==="elevation"&&_({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&e.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${Lr("#fff",pS(t.elevation))}, ${Lr("#fff",pS(t.elevation))})`},e.vars&&{backgroundImage:(r=e.vars.overlays)==null?void 0:r[t.elevation]}))}),vq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiPaper"}),{className:o,component:i="div",elevation:s=1,square:a=!1,variant:l="elevation"}=n,c=ve(n,hq),u=_({},n,{component:i,elevation:s,square:a,variant:l}),d=mq(u);return O.jsx(gq,_({as:i,ownerState:u,className:Ce(d.root,o),ref:r},c))}),yq=vq;function bq(e){const{className:t,classes:r,pulsate:n=!1,rippleX:o,rippleY:i,rippleSize:s,in:a,onExited:l,timeout:c}=e,[u,d]=S.useState(!1),f=Ce(t,r.ripple,r.rippleVisible,n&&r.ripplePulsate),p={width:s,height:s,top:-(s/2)+i,left:-(s/2)+o},h=Ce(r.child,u&&r.childLeaving,n&&r.childPulsate);return!a&&!u&&d(!0),S.useEffect(()=>{if(!a&&l!=null){const m=setTimeout(l,c);return()=>{clearTimeout(m)}}},[l,a,c]),O.jsx("span",{className:f,style:p,children:O.jsx("span",{className:h})})}const xq=jt("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Sn=xq,kq=["center","classes","className"];let qm=e=>e,mS,gS,vS,yS;const tv=550,wq=80,Sq=db(mS||(mS=qm` + */function t3(e,t){return fh(e,t)}const QU=(e,t)=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))},ZU=["values","unit","step"],eW=e=>{const t=Object.keys(e).map(r=>({key:r,val:e[r]}))||[];return t.sort((r,n)=>r.val-n.val),t.reduce((r,n)=>_({},r,{[n.key]:n.val}),{})};function tW(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5}=e,o=ve(e,ZU),i=eW(t),s=Object.keys(i);function a(f){return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r})`}function l(f){return`@media (max-width:${(typeof t[f]=="number"?t[f]:f)-n/100}${r})`}function c(f,p){const h=s.indexOf(p);return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r}) and (max-width:${(h!==-1&&typeof t[s[h]]=="number"?t[s[h]]:p)-n/100}${r})`}function u(f){return s.indexOf(f)+1`@media (min-width:${pb[e]}px)`};function ao(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const i=n.breakpoints||rS;return t.reduce((s,a,l)=>(s[i.up(i.keys[l])]=r(t[l]),s),{})}if(typeof t=="object"){const i=n.breakpoints||rS;return Object.keys(t).reduce((s,a)=>{if(Object.keys(i.values||pb).indexOf(a)!==-1){const l=i.up(a);s[l]=r(t[a],a)}else{const l=a;s[l]=t[l]}return s},{})}return r(t)}function r3(e={}){var t;return((t=e.keys)==null?void 0:t.reduce((n,o)=>{const i=e.up(o);return n[i]={},n},{}))||{}}function n3(e,t){return e.reduce((r,n)=>{const o=r[n];return(!o||Object.keys(o).length===0)&&delete r[n],r},t)}function oW(e,...t){const r=r3(e),n=[r,...t].reduce((o,i)=>un(o,i),{});return n3(Object.keys(r),n)}function iW(e,t){if(typeof e!="object")return{};const r={},n=Object.keys(t);return Array.isArray(e)?n.forEach((o,i)=>{i{e[o]!=null&&(r[o]=!0)}),r}function r1({values:e,breakpoints:t,base:r}){const n=r||iW(e,t),o=Object.keys(n);if(o.length===0)return e;let i;return o.reduce((s,a,l)=>(Array.isArray(e)?(s[a]=e[l]!=null?e[l]:e[i],i=l):typeof e=="object"?(s[a]=e[a]!=null?e[a]:e[i],i=a):s[a]=e,s),{})}function Dm(e,t,r=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&r){const n=`vars.${t}`.split(".").reduce((o,i)=>o&&o[i]?o[i]:null,e);if(n!=null)return n}return t.split(".").reduce((n,o)=>n&&n[o]!=null?n[o]:null,e)}function ph(e,t,r,n=r){let o;return typeof e=="function"?o=e(r):Array.isArray(e)?o=e[r]||n:o=Dm(e,r)||n,t&&(o=t(o,n,e)),o}function Ie(e){const{prop:t,cssProperty:r=e.prop,themeKey:n,transform:o}=e,i=s=>{if(s[t]==null)return null;const a=s[t],l=s.theme,c=Dm(l,n)||{};return ao(s,a,d=>{let f=ph(c,o,d);return d===f&&typeof d=="string"&&(f=ph(c,o,`${t}${d==="default"?"":Fe(d)}`,d)),r===!1?f:{[r]:f}})};return i.propTypes={},i.filterProps=[t],i}function sW(e){const t={};return r=>(t[r]===void 0&&(t[r]=e(r)),t[r])}const aW={m:"margin",p:"padding"},lW={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},nS={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},cW=sW(e=>{if(e.length>2)if(nS[e])e=nS[e];else return[e];const[t,r]=e.split(""),n=aW[t],o=lW[r]||"";return Array.isArray(o)?o.map(i=>n+i):[n+o]}),hb=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],mb=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...hb,...mb];function qd(e,t,r,n){var o;const i=(o=Dm(e,t,!1))!=null?o:r;return typeof i=="number"?s=>typeof s=="string"?s:i*s:Array.isArray(i)?s=>typeof s=="string"?s:i[s]:typeof i=="function"?i:()=>{}}function gb(e){return qd(e,"spacing",8)}function ha(e,t){if(typeof t=="string"||t==null)return t;const r=Math.abs(t),n=e(r);return t>=0?n:typeof n=="number"?-n:`-${n}`}function uW(e,t){return r=>e.reduce((n,o)=>(n[o]=ha(t,r),n),{})}function dW(e,t,r,n){if(t.indexOf(r)===-1)return null;const o=cW(r),i=uW(o,n),s=e[r];return ao(e,s,i)}function o3(e,t){const r=gb(e.theme);return Object.keys(e).map(n=>dW(e,t,n,r)).reduce(_u,{})}function pt(e){return o3(e,hb)}pt.propTypes={};pt.filterProps=hb;function ht(e){return o3(e,mb)}ht.propTypes={};ht.filterProps=mb;function fW(e=8){if(e.mui)return e;const t=gb({spacing:e}),r=(...n)=>(n.length===0?[1]:n).map(i=>{const s=t(i);return typeof s=="number"?`${s}px`:s}).join(" ");return r.mui=!0,r}function $m(...e){const t=e.reduce((n,o)=>(o.filterProps.forEach(i=>{n[i]=o}),n),{}),r=n=>Object.keys(n).reduce((o,i)=>t[i]?_u(o,t[i](n)):o,{});return r.propTypes={},r.filterProps=e.reduce((n,o)=>n.concat(o.filterProps),[]),r}function xo(e){return typeof e!="number"?e:`${e}px solid`}const pW=Ie({prop:"border",themeKey:"borders",transform:xo}),hW=Ie({prop:"borderTop",themeKey:"borders",transform:xo}),mW=Ie({prop:"borderRight",themeKey:"borders",transform:xo}),gW=Ie({prop:"borderBottom",themeKey:"borders",transform:xo}),vW=Ie({prop:"borderLeft",themeKey:"borders",transform:xo}),yW=Ie({prop:"borderColor",themeKey:"palette"}),bW=Ie({prop:"borderTopColor",themeKey:"palette"}),xW=Ie({prop:"borderRightColor",themeKey:"palette"}),kW=Ie({prop:"borderBottomColor",themeKey:"palette"}),wW=Ie({prop:"borderLeftColor",themeKey:"palette"}),Hm=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=qd(e.theme,"shape.borderRadius",4),r=n=>({borderRadius:ha(t,n)});return ao(e,e.borderRadius,r)}return null};Hm.propTypes={};Hm.filterProps=["borderRadius"];$m(pW,hW,mW,gW,vW,yW,bW,xW,kW,wW,Hm);const Bm=e=>{if(e.gap!==void 0&&e.gap!==null){const t=qd(e.theme,"spacing",8),r=n=>({gap:ha(t,n)});return ao(e,e.gap,r)}return null};Bm.propTypes={};Bm.filterProps=["gap"];const Fm=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=qd(e.theme,"spacing",8),r=n=>({columnGap:ha(t,n)});return ao(e,e.columnGap,r)}return null};Fm.propTypes={};Fm.filterProps=["columnGap"];const Vm=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=qd(e.theme,"spacing",8),r=n=>({rowGap:ha(t,n)});return ao(e,e.rowGap,r)}return null};Vm.propTypes={};Vm.filterProps=["rowGap"];const SW=Ie({prop:"gridColumn"}),EW=Ie({prop:"gridRow"}),CW=Ie({prop:"gridAutoFlow"}),MW=Ie({prop:"gridAutoColumns"}),TW=Ie({prop:"gridAutoRows"}),OW=Ie({prop:"gridTemplateColumns"}),_W=Ie({prop:"gridTemplateRows"}),AW=Ie({prop:"gridTemplateAreas"}),NW=Ie({prop:"gridArea"});$m(Bm,Fm,Vm,SW,EW,CW,MW,TW,OW,_W,AW,NW);function Sl(e,t){return t==="grey"?t:e}const RW=Ie({prop:"color",themeKey:"palette",transform:Sl}),PW=Ie({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Sl}),zW=Ie({prop:"backgroundColor",themeKey:"palette",transform:Sl});$m(RW,PW,zW);function sn(e){return e<=1&&e!==0?`${e*100}%`:e}const LW=Ie({prop:"width",transform:sn}),vb=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=r=>{var n,o;const i=((n=e.theme)==null||(n=n.breakpoints)==null||(n=n.values)==null?void 0:n[r])||pb[r];return i?((o=e.theme)==null||(o=o.breakpoints)==null?void 0:o.unit)!=="px"?{maxWidth:`${i}${e.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:sn(r)}};return ao(e,e.maxWidth,t)}return null};vb.filterProps=["maxWidth"];const IW=Ie({prop:"minWidth",transform:sn}),DW=Ie({prop:"height",transform:sn}),$W=Ie({prop:"maxHeight",transform:sn}),HW=Ie({prop:"minHeight",transform:sn});Ie({prop:"size",cssProperty:"width",transform:sn});Ie({prop:"size",cssProperty:"height",transform:sn});const BW=Ie({prop:"boxSizing"});$m(LW,vb,IW,DW,$W,HW,BW);const FW={border:{themeKey:"borders",transform:xo},borderTop:{themeKey:"borders",transform:xo},borderRight:{themeKey:"borders",transform:xo},borderBottom:{themeKey:"borders",transform:xo},borderLeft:{themeKey:"borders",transform:xo},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Hm},color:{themeKey:"palette",transform:Sl},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Sl},backgroundColor:{themeKey:"palette",transform:Sl},p:{style:ht},pt:{style:ht},pr:{style:ht},pb:{style:ht},pl:{style:ht},px:{style:ht},py:{style:ht},padding:{style:ht},paddingTop:{style:ht},paddingRight:{style:ht},paddingBottom:{style:ht},paddingLeft:{style:ht},paddingX:{style:ht},paddingY:{style:ht},paddingInline:{style:ht},paddingInlineStart:{style:ht},paddingInlineEnd:{style:ht},paddingBlock:{style:ht},paddingBlockStart:{style:ht},paddingBlockEnd:{style:ht},m:{style:pt},mt:{style:pt},mr:{style:pt},mb:{style:pt},ml:{style:pt},mx:{style:pt},my:{style:pt},margin:{style:pt},marginTop:{style:pt},marginRight:{style:pt},marginBottom:{style:pt},marginLeft:{style:pt},marginX:{style:pt},marginY:{style:pt},marginInline:{style:pt},marginInlineStart:{style:pt},marginInlineEnd:{style:pt},marginBlock:{style:pt},marginBlockStart:{style:pt},marginBlockEnd:{style:pt},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Bm},rowGap:{style:Vm},columnGap:{style:Fm},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:sn},maxWidth:{style:vb},minWidth:{transform:sn},height:{transform:sn},maxHeight:{transform:sn},minHeight:{transform:sn},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},jm=FW;function VW(...e){const t=e.reduce((n,o)=>n.concat(Object.keys(o)),[]),r=new Set(t);return e.every(n=>r.size===Object.keys(n).length)}function jW(e,t){return typeof e=="function"?e(t):e}function UW(){function e(r,n,o,i){const s={[r]:n,theme:o},a=i[r];if(!a)return{[r]:n};const{cssProperty:l=r,themeKey:c,transform:u,style:d}=a;if(n==null)return null;if(c==="typography"&&n==="inherit")return{[r]:n};const f=Dm(o,c)||{};return d?d(s):ao(s,n,h=>{let m=ph(f,u,h);return h===m&&typeof h=="string"&&(m=ph(f,u,`${r}${h==="default"?"":Fe(h)}`,h)),l===!1?m:{[l]:m}})}function t(r){var n;const{sx:o,theme:i={}}=r||{};if(!o)return null;const s=(n=i.unstable_sxConfig)!=null?n:jm;function a(l){let c=l;if(typeof l=="function")c=l(i);else if(typeof l!="object")return l;if(!c)return null;const u=r3(i.breakpoints),d=Object.keys(u);let f=u;return Object.keys(c).forEach(p=>{const h=jW(c[p],i);if(h!=null)if(typeof h=="object")if(s[p])f=_u(f,e(p,h,i,s));else{const m=ao({theme:i},h,b=>({[p]:b}));VW(m,h)?f[p]=t({sx:h,theme:i}):f=_u(f,m)}else f=_u(f,e(p,h,i,s))}),n3(d,f)}return Array.isArray(o)?o.map(a):a(o)}return t}const i3=UW();i3.filterProps=["sx"];const Um=i3,WW=["breakpoints","palette","spacing","shape"];function Wm(e={},...t){const{breakpoints:r={},palette:n={},spacing:o,shape:i={}}=e,s=ve(e,WW),a=tW(r),l=fW(o);let c=un({breakpoints:a,direction:"ltr",components:{},palette:_({mode:"light"},n),spacing:l,shape:_({},nW,i)},s);return c=t.reduce((u,d)=>un(u,d),c),c.unstable_sxConfig=_({},jm,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(d){return Um({sx:d,theme:this})},c}function KW(e){return Object.keys(e).length===0}function yb(e=null){const t=S.useContext(db);return!t||KW(t)?e:t}const qW=Wm();function bb(e=qW){return yb(e)}const GW=["sx"],YW=e=>{var t,r;const n={systemProps:{},otherProps:{}},o=(t=e==null||(r=e.theme)==null?void 0:r.unstable_sxConfig)!=null?t:jm;return Object.keys(e).forEach(i=>{o[i]?n.systemProps[i]=e[i]:n.otherProps[i]=e[i]}),n};function xb(e){const{sx:t}=e,r=ve(e,GW),{systemProps:n,otherProps:o}=YW(r);let i;return Array.isArray(t)?i=[n,...t]:typeof t=="function"?i=(...s)=>{const a=t(...s);return Wo(a)?_({},n,a):n}:i=_({},n,t),_({},o,{sx:i})}function s3(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ta!=="theme"&&a!=="sx"&&a!=="as"})(Um);return S.forwardRef(function(l,c){const u=bb(r),d=xb(l),{className:f,component:p="div"}=d,h=ve(d,JW);return O.jsx(i,_({as:p,ref:c,className:Ce(f,o?o(n):n),theme:t&&u[t]||u},h))})}const QW=["variant"];function oS(e){return e.length===0}function a3(e){const{variant:t}=e,r=ve(e,QW);let n=t||"";return Object.keys(r).sort().forEach(o=>{o==="color"?n+=oS(n)?e[o]:Fe(e[o]):n+=`${oS(n)?o:Fe(o)}${Fe(e[o].toString())}`}),n}const ZW=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function eK(e){return Object.keys(e).length===0}function tK(e){return typeof e=="string"&&e.charCodeAt(0)>96}const rK=(e,t)=>t.components&&t.components[e]&&t.components[e].styleOverrides?t.components[e].styleOverrides:null,hh=e=>{const t={};return e&&e.forEach(r=>{const n=a3(r.props);t[n]=r.style}),t},nK=(e,t)=>{let r=[];return t&&t.components&&t.components[e]&&t.components[e].variants&&(r=t.components[e].variants),hh(r)},mh=(e,t,r)=>{const{ownerState:n={}}=e,o=[];return r&&r.forEach(i=>{let s=!0;Object.keys(i.props).forEach(a=>{n[a]!==i.props[a]&&e[a]!==i.props[a]&&(s=!1)}),s&&o.push(t[a3(i.props)])}),o},oK=(e,t,r,n)=>{var o;const i=r==null||(o=r.components)==null||(o=o[n])==null?void 0:o.variants;return mh(e,t,i)};function fp(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const iK=Wm(),sK=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function pp({defaultTheme:e,theme:t,themeId:r}){return eK(t)?e:t[r]||t}function aK(e){return e?(t,r)=>r[e]:null}const iS=({styledArg:e,props:t,defaultTheme:r,themeId:n})=>{const o=e(_({},t,{theme:pp(_({},t,{defaultTheme:r,themeId:n}))}));let i;if(o&&o.variants&&(i=o.variants,delete o.variants),i){const s=mh(t,hh(i),i);return[o,...s]}return o};function l3(e={}){const{themeId:t,defaultTheme:r=iK,rootShouldForwardProp:n=fp,slotShouldForwardProp:o=fp}=e,i=s=>Um(_({},s,{theme:pp(_({},s,{defaultTheme:r,themeId:t}))}));return i.__mui_systemSx=!0,(s,a={})=>{QU(s,x=>x.filter(k=>!(k!=null&&k.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:d,overridesResolver:f=aK(sK(c))}=a,p=ve(a,ZW),h=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,m=d||!1;let b,v=fp;c==="Root"||c==="root"?v=n:c?v=o:tK(s)&&(v=void 0);const g=t3(s,_({shouldForwardProp:v,label:b},p)),y=(x,...k)=>{const w=k?k.map(T=>{if(typeof T=="function"&&T.__emotion_real!==T)return N=>iS({styledArg:T,props:N,defaultTheme:r,themeId:t});if(Wo(T)){let N=T,z;return T&&T.variants&&(z=T.variants,delete N.variants,N=D=>{let V=T;return mh(D,hh(z),z).forEach(L=>{V=un(V,L)}),V}),N}return T}):[];let E=x;if(Wo(x)){let T;x&&x.variants&&(T=x.variants,delete E.variants,E=N=>{let z=x;return mh(N,hh(T),T).forEach(V=>{z=un(z,V)}),z})}else typeof x=="function"&&x.__emotion_real!==x&&(E=T=>iS({styledArg:x,props:T,defaultTheme:r,themeId:t}));l&&f&&w.push(T=>{const N=pp(_({},T,{defaultTheme:r,themeId:t})),z=rK(l,N);if(z){const D={};return Object.entries(z).forEach(([V,j])=>{D[V]=typeof j=="function"?j(_({},T,{theme:N})):j}),f(T,D)}return null}),l&&!h&&w.push(T=>{const N=pp(_({},T,{defaultTheme:r,themeId:t}));return oK(T,nK(l,N),N,l)}),m||w.push(i);const M=w.length-k.length;if(Array.isArray(x)&&M>0){const T=new Array(M).fill("");E=[...x,...T],E.raw=[...x.raw,...T]}const C=g(E,...w);return s.muiName&&(C.muiName=s.muiName),C};return g.withConfig&&(y.withConfig=g.withConfig),y}}const lK=l3(),cK=lK;function uK(e){const{theme:t,name:r,props:n}=e;return!t||!t.components||!t.components[r]||!t.components[r].defaultProps?n:DT(t.components[r].defaultProps,n)}function c3({props:e,name:t,defaultTheme:r,themeId:n}){let o=bb(r);return n&&(o=o[n]||o),uK({theme:o,name:t,props:e})}function kb(e,t=0,r=1){return Math.min(Math.max(t,e),r)}function dK(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let r=e.match(t);return r&&r[0].length===1&&(r=r.map(n=>n+n)),r?`rgb${r.length===4?"a":""}(${r.map((n,o)=>o<3?parseInt(n,16):Math.round(parseInt(n,16)/255*1e3)/1e3).join(", ")})`:""}function ma(e){if(e.type)return e;if(e.charAt(0)==="#")return ma(dK(e));const t=e.indexOf("("),r=e.substring(0,t);if(["rgb","rgba","hsl","hsla","color"].indexOf(r)===-1)throw new Error(Wl(9,e));let n=e.substring(t+1,e.length-1),o;if(r==="color"){if(n=n.split(" "),o=n.shift(),n.length===4&&n[3].charAt(0)==="/"&&(n[3]=n[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(o)===-1)throw new Error(Wl(10,o))}else n=n.split(",");return n=n.map(i=>parseFloat(i)),{type:r,values:n,colorSpace:o}}function Km(e){const{type:t,colorSpace:r}=e;let{values:n}=e;return t.indexOf("rgb")!==-1?n=n.map((o,i)=>i<3?parseInt(o,10):o):t.indexOf("hsl")!==-1&&(n[1]=`${n[1]}%`,n[2]=`${n[2]}%`),t.indexOf("color")!==-1?n=`${r} ${n.join(" ")}`:n=`${n.join(", ")}`,`${t}(${n})`}function fK(e){e=ma(e);const{values:t}=e,r=t[0],n=t[1]/100,o=t[2]/100,i=n*Math.min(o,1-o),s=(c,u=(c+r/30)%12)=>o-i*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return e.type==="hsla"&&(a+="a",l.push(t[3])),Km({type:a,values:l})}function sS(e){e=ma(e);let t=e.type==="hsl"||e.type==="hsla"?ma(fK(e)).values:e.values;return t=t.map(r=>(e.type!=="color"&&(r/=255),r<=.03928?r/12.92:((r+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function pK(e,t){const r=sS(e),n=sS(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}function Lr(e,t){return e=ma(e),t=kb(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Km(e)}function hK(e,t){if(e=ma(e),t=kb(t),e.type.indexOf("hsl")!==-1)e.values[2]*=1-t;else if(e.type.indexOf("rgb")!==-1||e.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)e.values[r]*=1-t;return Km(e)}function mK(e,t){if(e=ma(e),t=kb(t),e.type.indexOf("hsl")!==-1)e.values[2]+=(100-e.values[2])*t;else if(e.type.indexOf("rgb")!==-1)for(let r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(e.type.indexOf("color")!==-1)for(let r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return Km(e)}const gK=S.createContext(null),u3=gK;function d3(){return S.useContext(u3)}const vK=typeof Symbol=="function"&&Symbol.for,yK=vK?Symbol.for("mui.nested"):"__THEME_NESTED__";function bK(e,t){return typeof t=="function"?t(e):_({},e,t)}function xK(e){const{children:t,theme:r}=e,n=d3(),o=S.useMemo(()=>{const i=n===null?r:bK(n,r);return i!=null&&(i[yK]=n!==null),i},[r,n]);return O.jsx(u3.Provider,{value:o,children:t})}const aS={};function lS(e,t,r,n=!1){return S.useMemo(()=>{const o=e&&t[e]||t;if(typeof r=="function"){const i=r(o),s=e?_({},t,{[e]:i}):i;return n?()=>s:s}return e?_({},t,{[e]:r}):_({},t,r)},[e,t,r,n])}function kK(e){const{children:t,theme:r,themeId:n}=e,o=yb(aS),i=d3()||aS,s=lS(n,o,r),a=lS(n,i,r,!0);return O.jsx(xK,{theme:a,children:O.jsx(db.Provider,{value:s,children:t})})}const wK=["component","direction","spacing","divider","children","className","useFlexGap"],SK=Wm(),EK=cK("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root});function CK(e){return c3({props:e,name:"MuiStack",defaultTheme:SK})}function MK(e,t){const r=S.Children.toArray(e).filter(Boolean);return r.reduce((n,o,i)=>(n.push(o),i({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],OK=({ownerState:e,theme:t})=>{let r=_({display:"flex",flexDirection:"column"},ao({theme:t},r1({values:e.direction,breakpoints:t.breakpoints.values}),n=>({flexDirection:n})));if(e.spacing){const n=gb(t),o=Object.keys(t.breakpoints.values).reduce((l,c)=>((typeof e.spacing=="object"&&e.spacing[c]!=null||typeof e.direction=="object"&&e.direction[c]!=null)&&(l[c]=!0),l),{}),i=r1({values:e.direction,base:o}),s=r1({values:e.spacing,base:o});typeof i=="object"&&Object.keys(i).forEach((l,c,u)=>{if(!i[l]){const f=c>0?i[u[c-1]]:"column";i[l]=f}}),r=un(r,ao({theme:t},s,(l,c)=>e.useFlexGap?{gap:ha(n,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${TK(c?i[c]:e.direction)}`]:ha(n,l)}}))}return r=oW(t.breakpoints,r),r};function _K(e={}){const{createStyledComponent:t=EK,useThemeProps:r=CK,componentName:n="MuiStack"}=e,o=()=>rr({root:["root"]},l=>Vt(n,l),{}),i=t(OK);return S.forwardRef(function(l,c){const u=r(l),d=xb(u),{component:f="div",direction:p="column",spacing:h=0,divider:m,children:b,className:v,useFlexGap:g=!1}=d,y=ve(d,wK),x={direction:p,spacing:h,useFlexGap:g},k=o();return O.jsx(i,_({as:f,ownerState:x,ref:c,className:Ce(k.root,v)},y,{children:m?MK(b,m):b}))})}function AK(e,t){return _({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},t)}const NK=["mode","contrastThreshold","tonalOffset"],cS={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:dd.white,default:dd.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},n1={text:{primary:dd.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:dd.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function uS(e,t,r,n){const o=n.light||n,i=n.dark||n*1.5;e[t]||(e.hasOwnProperty(r)?e[t]=e[r]:t==="light"?e.light=mK(e.main,o):t==="dark"&&(e.dark=hK(e.main,i)))}function RK(e="light"){return e==="dark"?{main:Ia[200],light:Ia[50],dark:Ia[400]}:{main:Ia[700],light:Ia[400],dark:Ia[800]}}function PK(e="light"){return e==="dark"?{main:La[200],light:La[50],dark:La[400]}:{main:La[500],light:La[300],dark:La[700]}}function zK(e="light"){return e==="dark"?{main:za[500],light:za[300],dark:za[700]}:{main:za[700],light:za[400],dark:za[800]}}function LK(e="light"){return e==="dark"?{main:Da[400],light:Da[300],dark:Da[700]}:{main:Da[700],light:Da[500],dark:Da[900]}}function IK(e="light"){return e==="dark"?{main:$a[400],light:$a[300],dark:$a[700]}:{main:$a[800],light:$a[500],dark:$a[900]}}function DK(e="light"){return e==="dark"?{main:Tc[400],light:Tc[300],dark:Tc[700]}:{main:"#ed6c02",light:Tc[500],dark:Tc[900]}}function $K(e){const{mode:t="light",contrastThreshold:r=3,tonalOffset:n=.2}=e,o=ve(e,NK),i=e.primary||RK(t),s=e.secondary||PK(t),a=e.error||zK(t),l=e.info||LK(t),c=e.success||IK(t),u=e.warning||DK(t);function d(m){return pK(m,n1.text.primary)>=r?n1.text.primary:cS.text.primary}const f=({color:m,name:b,mainShade:v=500,lightShade:g=300,darkShade:y=700})=>{if(m=_({},m),!m.main&&m[v]&&(m.main=m[v]),!m.hasOwnProperty("main"))throw new Error(Wl(11,b?` (${b})`:"",v));if(typeof m.main!="string")throw new Error(Wl(12,b?` (${b})`:"",JSON.stringify(m.main)));return uS(m,"light",g,n),uS(m,"dark",y,n),m.contrastText||(m.contrastText=d(m.main)),m},p={dark:n1,light:cS};return un(_({common:_({},dd),mode:t,primary:f({color:i,name:"primary"}),secondary:f({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:f({color:a,name:"error"}),warning:f({color:u,name:"warning"}),info:f({color:l,name:"info"}),success:f({color:c,name:"success"}),grey:Rj,contrastThreshold:r,getContrastText:d,augmentColor:f,tonalOffset:n},p[t]),o)}const HK=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function BK(e){return Math.round(e*1e5)/1e5}const dS={textTransform:"uppercase"},fS='"Roboto", "Helvetica", "Arial", sans-serif';function FK(e,t){const r=typeof t=="function"?t(e):t,{fontFamily:n=fS,fontSize:o=14,fontWeightLight:i=300,fontWeightRegular:s=400,fontWeightMedium:a=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:d}=r,f=ve(r,HK),p=o/14,h=d||(v=>`${v/c*p}rem`),m=(v,g,y,x,k)=>_({fontFamily:n,fontWeight:v,fontSize:h(g),lineHeight:y},n===fS?{letterSpacing:`${BK(x/g)}em`}:{},k,u),b={h1:m(i,96,1.167,-1.5),h2:m(i,60,1.2,-.5),h3:m(s,48,1.167,0),h4:m(s,34,1.235,.25),h5:m(s,24,1.334,0),h6:m(a,20,1.6,.15),subtitle1:m(s,16,1.75,.15),subtitle2:m(a,14,1.57,.1),body1:m(s,16,1.5,.15),body2:m(s,14,1.43,.15),button:m(a,14,1.75,.4,dS),caption:m(s,12,1.66,.4),overline:m(s,12,2.66,1,dS),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return un(_({htmlFontSize:c,pxToRem:h,fontFamily:n,fontSize:o,fontWeightLight:i,fontWeightRegular:s,fontWeightMedium:a,fontWeightBold:l},b),f,{clone:!1})}const VK=.2,jK=.14,UK=.12;function nt(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${VK})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${jK})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${UK})`].join(",")}const WK=["none",nt(0,2,1,-1,0,1,1,0,0,1,3,0),nt(0,3,1,-2,0,2,2,0,0,1,5,0),nt(0,3,3,-2,0,3,4,0,0,1,8,0),nt(0,2,4,-1,0,4,5,0,0,1,10,0),nt(0,3,5,-1,0,5,8,0,0,1,14,0),nt(0,3,5,-1,0,6,10,0,0,1,18,0),nt(0,4,5,-2,0,7,10,1,0,2,16,1),nt(0,5,5,-3,0,8,10,1,0,3,14,2),nt(0,5,6,-3,0,9,12,1,0,3,16,2),nt(0,6,6,-3,0,10,14,1,0,4,18,3),nt(0,6,7,-4,0,11,15,1,0,4,20,3),nt(0,7,8,-4,0,12,17,2,0,5,22,4),nt(0,7,8,-4,0,13,19,2,0,5,24,4),nt(0,7,9,-4,0,14,21,2,0,5,26,4),nt(0,8,9,-5,0,15,22,2,0,6,28,5),nt(0,8,10,-5,0,16,24,2,0,6,30,5),nt(0,8,11,-5,0,17,26,2,0,6,32,5),nt(0,9,11,-5,0,18,28,2,0,7,34,6),nt(0,9,12,-6,0,19,29,2,0,7,36,6),nt(0,10,13,-6,0,20,31,3,0,8,38,7),nt(0,10,13,-6,0,21,33,3,0,8,40,7),nt(0,10,14,-6,0,22,35,3,0,8,42,7),nt(0,11,14,-7,0,23,36,3,0,9,44,8),nt(0,11,15,-7,0,24,38,3,0,9,46,8)],KK=WK,qK=["duration","easing","delay"],GK={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},YK={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function pS(e){return`${Math.round(e)}ms`}function JK(e){if(!e)return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function XK(e){const t=_({},GK,e.easing),r=_({},YK,e.duration);return _({getAutoHeightDuration:JK,create:(o=["all"],i={})=>{const{duration:s=r.standard,easing:a=t.easeInOut,delay:l=0}=i;return ve(i,qK),(Array.isArray(o)?o:[o]).map(c=>`${c} ${typeof s=="string"?s:pS(s)} ${a} ${typeof l=="string"?l:pS(l)}`).join(",")}},e,{easing:t,duration:r})}const QK={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},ZK=QK,eq=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function wb(e={},...t){const{mixins:r={},palette:n={},transitions:o={},typography:i={}}=e,s=ve(e,eq);if(e.vars)throw new Error(Wl(18));const a=$K(n),l=Wm(e);let c=un(l,{mixins:AK(l.breakpoints,r),palette:a,shadows:KK.slice(),typography:FK(a,i),transitions:XK(o),zIndex:_({},ZK)});return c=un(c,s),c=t.reduce((u,d)=>un(u,d),c),c.unstable_sxConfig=_({},jm,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(d){return Um({sx:d,theme:this})},c}const tq=wb(),Sb=tq;function qm(){const e=bb(Sb);return e[Kl]||e}function Wt({props:e,name:t}){return c3({props:e,name:t,defaultTheme:Sb,themeId:Kl})}const Eb=e=>fp(e)&&e!=="classes",rq=l3({themeId:Kl,defaultTheme:Sb,rootShouldForwardProp:Eb}),Je=rq,nq=["theme"];function oq(e){let{theme:t}=e,r=ve(e,nq);const n=t[Kl];return O.jsx(kK,_({},r,{themeId:n?Kl:void 0,theme:n||t}))}const iq=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)},hS=iq;function ev(e,t){return ev=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},ev(e,t)}function f3(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ev(e,t)}const mS={disabled:!1},gh=I.createContext(null);var sq=function(t){return t.scrollTop},lu="unmounted",As="exited",Ns="entering",Ya="entered",tv="exiting",pi=function(e){f3(t,e);function t(n,o){var i;i=e.call(this,n,o)||this;var s=o,a=s&&!s.isMounting?n.enter:n.appear,l;return i.appearStatus=null,n.in?a?(l=As,i.appearStatus=Ns):l=Ya:n.unmountOnExit||n.mountOnEnter?l=lu:l=As,i.state={status:l},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var s=o.in;return s&&i.status===lu?{status:As}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(o){var i=null;if(o!==this.props){var s=this.state.status;this.props.in?s!==Ns&&s!==Ya&&(i=Ns):(s===Ns||s===Ya)&&(i=tv)}this.updateStatus(!1,i)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var o=this.props.timeout,i,s,a;return i=s=a=o,o!=null&&typeof o!="number"&&(i=o.exit,s=o.enter,a=o.appear!==void 0?o.appear:s),{exit:i,enter:s,appear:a}},r.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===Ns){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:wf.findDOMNode(this);s&&sq(s)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===As&&this.setState({status:lu})},r.performEnter=function(o){var i=this,s=this.props.enter,a=this.context?this.context.isMounting:o,l=this.props.nodeRef?[a]:[wf.findDOMNode(this),a],c=l[0],u=l[1],d=this.getTimeouts(),f=a?d.appear:d.enter;if(!o&&!s||mS.disabled){this.safeSetState({status:Ya},function(){i.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:Ns},function(){i.props.onEntering(c,u),i.onTransitionEnd(f,function(){i.safeSetState({status:Ya},function(){i.props.onEntered(c,u)})})})},r.performExit=function(){var o=this,i=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:wf.findDOMNode(this);if(!i||mS.disabled){this.safeSetState({status:As},function(){o.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:tv},function(){o.props.onExiting(a),o.onTransitionEnd(s.exit,function(){o.safeSetState({status:As},function(){o.props.onExited(a)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},r.setNextCallback=function(o){var i=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,i.nextCallback=null,o(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},r.onTransitionEnd=function(o,i){this.setNextCallback(i);var s=this.props.nodeRef?this.props.nodeRef.current:wf.findDOMNode(this),a=o==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}o!=null&&setTimeout(this.nextCallback,o)},r.render=function(){var o=this.state.status;if(o===lu)return null;var i=this.props,s=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var a=ve(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return I.createElement(gh.Provider,{value:null},typeof s=="function"?s(o,a):I.cloneElement(I.Children.only(s),a))},t}(I.Component);pi.contextType=gh;pi.propTypes={};function Ha(){}pi.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ha,onEntering:Ha,onEntered:Ha,onExit:Ha,onExiting:Ha,onExited:Ha};pi.UNMOUNTED=lu;pi.EXITED=As;pi.ENTERING=Ns;pi.ENTERED=Ya;pi.EXITING=tv;const p3=pi;function aq(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Cb(e,t){var r=function(i){return t&&S.isValidElement(i)?t(i):i},n=Object.create(null);return e&&S.Children.map(e,function(o){return o}).forEach(function(o){n[o.key]=r(o)}),n}function lq(e,t){e=e||{},t=t||{};function r(u){return u in t?t[u]:e[u]}var n=Object.create(null),o=[];for(var i in e)i in t?o.length&&(n[i]=o,o=[]):o.push(i);var s,a={};for(var l in t){if(n[l])for(s=0;se.scrollTop;function vh(e,t){var r,n;const{timeout:o,easing:i,style:s={}}=e;return{duration:(r=s.transitionDuration)!=null?r:typeof o=="number"?o:o[t.mode]||0,easing:(n=s.transitionTimingFunction)!=null?n:typeof i=="object"?i[t.mode]:i,delay:s.transitionDelay}}function hq(e){return Vt("MuiPaper",e)}jt("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const mq=["className","component","elevation","square","variant"],gq=e=>{const{square:t,elevation:r,variant:n,classes:o}=e,i={root:["root",n,!t&&"rounded",n==="elevation"&&`elevation${r}`]};return rr(i,hq,o)},vq=Je("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],!r.square&&t.rounded,r.variant==="elevation"&&t[`elevation${r.elevation}`]]}})(({theme:e,ownerState:t})=>{var r;return _({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!t.square&&{borderRadius:e.shape.borderRadius},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.divider}`},t.variant==="elevation"&&_({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&e.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${Lr("#fff",hS(t.elevation))}, ${Lr("#fff",hS(t.elevation))})`},e.vars&&{backgroundImage:(r=e.vars.overlays)==null?void 0:r[t.elevation]}))}),yq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiPaper"}),{className:o,component:i="div",elevation:s=1,square:a=!1,variant:l="elevation"}=n,c=ve(n,mq),u=_({},n,{component:i,elevation:s,square:a,variant:l}),d=gq(u);return O.jsx(vq,_({as:i,ownerState:u,className:Ce(d.root,o),ref:r},c))}),bq=yq;function xq(e){const{className:t,classes:r,pulsate:n=!1,rippleX:o,rippleY:i,rippleSize:s,in:a,onExited:l,timeout:c}=e,[u,d]=S.useState(!1),f=Ce(t,r.ripple,r.rippleVisible,n&&r.ripplePulsate),p={width:s,height:s,top:-(s/2)+i,left:-(s/2)+o},h=Ce(r.child,u&&r.childLeaving,n&&r.childPulsate);return!a&&!u&&d(!0),S.useEffect(()=>{if(!a&&l!=null){const m=setTimeout(l,c);return()=>{clearTimeout(m)}}},[l,a,c]),O.jsx("span",{className:f,style:p,children:O.jsx("span",{className:h})})}const kq=jt("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Sn=kq,wq=["center","classes","className"];let Gm=e=>e,gS,vS,yS,bS;const rv=550,Sq=80,Eq=fb(gS||(gS=Gm` 0% { transform: scale(0); opacity: 0.1; @@ -128,7 +128,7 @@ Error generating stack: `+i.message+` transform: scale(1); opacity: 0.3; } -`)),Eq=db(gS||(gS=qm` +`)),Cq=fb(vS||(vS=Gm` 0% { opacity: 1; } @@ -136,7 +136,7 @@ Error generating stack: `+i.message+` 100% { opacity: 0; } -`)),Cq=db(vS||(vS=qm` +`)),Mq=fb(yS||(yS=Gm` 0% { transform: scale(1); } @@ -148,7 +148,7 @@ Error generating stack: `+i.message+` 100% { transform: scale(1); } -`)),Mq=Xe("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),Tq=Xe(bq,{name:"MuiTouchRipple",slot:"Ripple"})(yS||(yS=qm` +`)),Tq=Je("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),Oq=Je(xq,{name:"MuiTouchRipple",slot:"Ripple"})(bS||(bS=Gm` opacity: 0; position: absolute; @@ -191,7 +191,7 @@ Error generating stack: `+i.message+` animation-iteration-count: infinite; animation-delay: 200ms; } -`),Sn.rippleVisible,Sq,tv,({theme:e})=>e.transitions.easing.easeInOut,Sn.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,Sn.child,Sn.childLeaving,Eq,tv,({theme:e})=>e.transitions.easing.easeInOut,Sn.childPulsate,Cq,({theme:e})=>e.transitions.easing.easeInOut),Oq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiTouchRipple"}),{center:o=!1,classes:i={},className:s}=n,a=ve(n,kq),[l,c]=S.useState([]),u=S.useRef(0),d=S.useRef(null);S.useEffect(()=>{d.current&&(d.current(),d.current=null)},[l]);const f=S.useRef(!1),p=S.useRef(0),h=S.useRef(null),m=S.useRef(null);S.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const b=S.useCallback(x=>{const{pulsate:k,rippleX:w,rippleY:E,rippleSize:T,cb:C}=x;c(M=>[...M,O.jsx(Tq,{classes:{ripple:Ce(i.ripple,Sn.ripple),rippleVisible:Ce(i.rippleVisible,Sn.rippleVisible),ripplePulsate:Ce(i.ripplePulsate,Sn.ripplePulsate),child:Ce(i.child,Sn.child),childLeaving:Ce(i.childLeaving,Sn.childLeaving),childPulsate:Ce(i.childPulsate,Sn.childPulsate)},timeout:tv,pulsate:k,rippleX:w,rippleY:E,rippleSize:T},u.current)]),u.current+=1,d.current=C},[i]),v=S.useCallback((x={},k={},w=()=>{})=>{const{pulsate:E=!1,center:T=o||k.pulsate,fakeElement:C=!1}=k;if((x==null?void 0:x.type)==="mousedown"&&f.current){f.current=!1;return}(x==null?void 0:x.type)==="touchstart"&&(f.current=!0);const M=C?null:m.current,N=M?M.getBoundingClientRect():{width:0,height:0,left:0,top:0};let F,I,V;if(T||x===void 0||x.clientX===0&&x.clientY===0||!x.clientX&&!x.touches)F=Math.round(N.width/2),I=Math.round(N.height/2);else{const{clientX:j,clientY:z}=x.touches&&x.touches.length>0?x.touches[0]:x;F=Math.round(j-N.left),I=Math.round(z-N.top)}if(T)V=Math.sqrt((2*N.width**2+N.height**2)/3),V%2===0&&(V+=1);else{const j=Math.max(Math.abs((M?M.clientWidth:0)-F),F)*2+2,z=Math.max(Math.abs((M?M.clientHeight:0)-I),I)*2+2;V=Math.sqrt(j**2+z**2)}x!=null&&x.touches?h.current===null&&(h.current=()=>{b({pulsate:E,rippleX:F,rippleY:I,rippleSize:V,cb:w})},p.current=setTimeout(()=>{h.current&&(h.current(),h.current=null)},wq)):b({pulsate:E,rippleX:F,rippleY:I,rippleSize:V,cb:w})},[o,b]),g=S.useCallback(()=>{v({},{pulsate:!0})},[v]),y=S.useCallback((x,k)=>{if(clearTimeout(p.current),(x==null?void 0:x.type)==="touchend"&&h.current){h.current(),h.current=null,p.current=setTimeout(()=>{y(x,k)});return}h.current=null,c(w=>w.length>0?w.slice(1):w),d.current=k},[]);return S.useImperativeHandle(r,()=>({pulsate:g,start:v,stop:y}),[g,v,y]),O.jsx(Mq,_({className:Ce(Sn.root,i.root,s),ref:m},a,{children:O.jsx(fq,{component:null,exit:!0,children:l})}))}),_q=Oq;function Aq(e){return Vt("MuiButtonBase",e)}const Nq=jt("MuiButtonBase",["root","disabled","focusVisible"]),Rq=Nq,Pq=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],zq=e=>{const{disabled:t,focusVisible:r,focusVisibleClassName:n,classes:o}=e,s=rr({root:["root",t&&"disabled",r&&"focusVisible"]},Aq,o);return r&&n&&(s.root+=` ${n}`),s},Lq=Xe("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Rq.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),Iq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiButtonBase"}),{action:o,centerRipple:i=!1,children:s,className:a,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:d=!1,focusRipple:f=!1,LinkComponent:p="a",onBlur:h,onClick:m,onContextMenu:b,onDragLeave:v,onFocus:g,onFocusVisible:y,onKeyDown:x,onKeyUp:k,onMouseDown:w,onMouseLeave:E,onMouseUp:T,onTouchEnd:C,onTouchMove:M,onTouchStart:N,tabIndex:F=0,TouchRippleProps:I,touchRippleRef:V,type:j}=n,z=ve(n,Pq),q=S.useRef(null),A=S.useRef(null),P=Ur(A,V),{isFocusVisibleRef:B,onFocus:Y,onBlur:J,ref:Ne}=PT(),[ie,ue]=S.useState(!1);c&&ie&&ue(!1),S.useImperativeHandle(o,()=>({focusVisible:()=>{ue(!0),q.current.focus()}}),[]);const[de,me]=S.useState(!1);S.useEffect(()=>{me(!0)},[]);const Me=de&&!u&&!c;S.useEffect(()=>{ie&&f&&!u&&de&&A.current.pulsate()},[u,f,ie,de]);function Se(fe,bn,fc=d){return Ks(gi=>(bn&&bn(gi),!fc&&A.current&&A.current[fe](gi),!0))}const ft=Se("start",w),rt=Se("stop",b),Or=Se("stop",v),he=Se("stop",T),De=Se("stop",fe=>{ie&&fe.preventDefault(),E&&E(fe)}),Ke=Se("start",N),Fn=Se("stop",C),Gr=Se("stop",M),nr=Se("stop",fe=>{J(fe),B.current===!1&&ue(!1),h&&h(fe)},!1),zo=Ks(fe=>{q.current||(q.current=fe.currentTarget),Y(fe),B.current===!0&&(ue(!0),y&&y(fe)),g&&g(fe)}),Pt=()=>{const fe=q.current;return l&&l!=="button"&&!(fe.tagName==="A"&&fe.href)},Yr=S.useRef(!1),vn=Ks(fe=>{f&&!Yr.current&&ie&&A.current&&fe.key===" "&&(Yr.current=!0,A.current.stop(fe,()=>{A.current.start(fe)})),fe.target===fe.currentTarget&&Pt()&&fe.key===" "&&fe.preventDefault(),x&&x(fe),fe.target===fe.currentTarget&&Pt()&&fe.key==="Enter"&&!c&&(fe.preventDefault(),m&&m(fe))}),Vn=Ks(fe=>{f&&fe.key===" "&&A.current&&ie&&!fe.defaultPrevented&&(Yr.current=!1,A.current.stop(fe,()=>{A.current.pulsate(fe)})),k&&k(fe),m&&fe.target===fe.currentTarget&&Pt()&&fe.key===" "&&!fe.defaultPrevented&&m(fe)});let Qe=l;Qe==="button"&&(z.href||z.to)&&(Qe=p);const Jr={};Qe==="button"?(Jr.type=j===void 0?"button":j,Jr.disabled=c):(!z.href&&!z.to&&(Jr.role="button"),c&&(Jr["aria-disabled"]=c));const yn=Ur(r,Ne,q),mi=_({},n,{centerRipple:i,component:l,disabled:c,disableRipple:u,disableTouchRipple:d,focusRipple:f,tabIndex:F,focusVisible:ie}),Oa=zq(mi);return O.jsxs(Lq,_({as:Qe,className:Ce(Oa.root,a),ownerState:mi,onBlur:nr,onClick:m,onContextMenu:rt,onFocus:zo,onKeyDown:vn,onKeyUp:Vn,onMouseDown:ft,onMouseLeave:De,onMouseUp:he,onDragLeave:Or,onTouchEnd:Fn,onTouchMove:Gr,onTouchStart:Ke,ref:yn,tabIndex:c?-1:F,type:j},Jr,z,{children:[s,Me?O.jsx(_q,_({ref:P,center:i},I)):null]}))}),Mb=Iq;function Dq(e){return Vt("MuiIconButton",e)}const $q=jt("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),Hq=$q,Bq=["edge","children","className","color","disabled","disableFocusRipple","size"],Fq=e=>{const{classes:t,disabled:r,color:n,edge:o,size:i}=e,s={root:["root",r&&"disabled",n!=="default"&&`color${Fe(n)}`,o&&`edge${Fe(o)}`,`size${Fe(i)}`]};return rr(s,Dq,t)},Vq=Xe(Mb,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.color!=="default"&&t[`color${Fe(r.color)}`],r.edge&&t[`edge${Fe(r.edge)}`],t[`size${Fe(r.size)}`]]}})(({theme:e,ownerState:t})=>_({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Lr(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12}),({theme:e,ownerState:t})=>{var r;const n=(r=(e.vars||e).palette)==null?void 0:r[t.color];return _({},t.color==="inherit"&&{color:"inherit"},t.color!=="inherit"&&t.color!=="default"&&_({color:n==null?void 0:n.main},!t.disableRipple&&{"&:hover":_({},n&&{backgroundColor:e.vars?`rgba(${n.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Lr(n.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),t.size==="small"&&{padding:5,fontSize:e.typography.pxToRem(18)},t.size==="large"&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${Hq.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})}),jq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiIconButton"}),{edge:o=!1,children:i,className:s,color:a="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium"}=n,d=ve(n,Bq),f=_({},n,{edge:o,color:a,disabled:l,disableFocusRipple:c,size:u}),p=Fq(f);return O.jsx(Vq,_({className:Ce(p.root,s),centerRipple:!0,focusRipple:!c,disabled:l,ref:r,ownerState:f},d,{children:i}))}),Uq=jq;function Wq(e){return Vt("MuiTypography",e)}jt("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const Kq=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],qq=e=>{const{align:t,gutterBottom:r,noWrap:n,paragraph:o,variant:i,classes:s}=e,a={root:["root",i,e.align!=="inherit"&&`align${Fe(t)}`,r&&"gutterBottom",n&&"noWrap",o&&"paragraph"]};return rr(a,Wq,s)},Gq=Xe("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.variant&&t[r.variant],r.align!=="inherit"&&t[`align${Fe(r.align)}`],r.noWrap&&t.noWrap,r.gutterBottom&&t.gutterBottom,r.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>_({margin:0},t.variant==="inherit"&&{font:"inherit"},t.variant!=="inherit"&&e.typography[t.variant],t.align!=="inherit"&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),bS={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Yq={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Jq=e=>Yq[e]||e,Xq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiTypography"}),o=Jq(n.color),i=bb(_({},n,{color:o})),{align:s="inherit",className:a,component:l,gutterBottom:c=!1,noWrap:u=!1,paragraph:d=!1,variant:f="body1",variantMapping:p=bS}=i,h=ve(i,Kq),m=_({},i,{align:s,color:o,className:a,component:l,gutterBottom:c,noWrap:u,paragraph:d,variant:f,variantMapping:p}),b=l||(d?"p":p[f]||bS[f])||"span",v=qq(m);return O.jsx(Gq,_({as:b,ref:r,ownerState:m,className:Ce(v.root,a)},h))}),cu=Xq;function h3(e){return typeof e=="string"}function uu(e,t,r){return e===void 0||h3(e)?t:_({},t,{ownerState:_({},t.ownerState,r)})}const Qq={disableDefaultClasses:!1},Zq=S.createContext(Qq);function eG(e){const{disableDefaultClasses:t}=S.useContext(Zq);return r=>t?"":e(r)}function m3(e,t=[]){if(e===void 0)return{};const r={};return Object.keys(e).filter(n=>n.match(/^on[A-Z]/)&&typeof e[n]=="function"&&!t.includes(n)).forEach(n=>{r[n]=e[n]}),r}function tG(e,t,r){return typeof e=="function"?e(t,r):e}function xS(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(r=>!(r.match(/^on[A-Z]/)&&typeof e[r]=="function")).forEach(r=>{t[r]=e[r]}),t}function rG(e){const{getSlotProps:t,additionalProps:r,externalSlotProps:n,externalForwardedProps:o,className:i}=e;if(!t){const p=Ce(o==null?void 0:o.className,n==null?void 0:n.className,i,r==null?void 0:r.className),h=_({},r==null?void 0:r.style,o==null?void 0:o.style,n==null?void 0:n.style),m=_({},r,o,n);return p.length>0&&(m.className=p),Object.keys(h).length>0&&(m.style=h),{props:m,internalRef:void 0}}const s=m3(_({},o,n)),a=xS(n),l=xS(o),c=t(s),u=Ce(c==null?void 0:c.className,r==null?void 0:r.className,i,o==null?void 0:o.className,n==null?void 0:n.className),d=_({},c==null?void 0:c.style,r==null?void 0:r.style,o==null?void 0:o.style,n==null?void 0:n.style),f=_({},c,r,l,a);return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:c.ref}}const nG=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function si(e){var t;const{elementType:r,externalSlotProps:n,ownerState:o,skipResolvingSlotProps:i=!1}=e,s=ve(e,nG),a=i?{}:tG(n,o),{props:l,internalRef:c}=rG(_({},s,{externalSlotProps:a})),u=Ur(c,a==null?void 0:a.ref,(t=e.additionalProps)==null?void 0:t.ref);return uu(r,_({},l,{ref:u}),o)}function oG(e){const{badgeContent:t,invisible:r=!1,max:n=99,showZero:o=!1}=e,i=LT({badgeContent:t,max:n});let s=r;r===!1&&t===0&&!o&&(s=!0);const{badgeContent:a,max:l=n}=s?i:e,c=a&&Number(a)>l?`${l}+`:a;return{badgeContent:a,invisible:s,max:l,displayValue:c}}const iG=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function sG(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function aG(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=n=>e.ownerDocument.querySelector(`input[type="radio"]${n}`);let r=t(`[name="${e.name}"]:checked`);return r||(r=t(`[name="${e.name}"]`)),r!==e}function lG(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||aG(e))}function cG(e){const t=[],r=[];return Array.from(e.querySelectorAll(iG)).forEach((n,o)=>{const i=sG(n);i===-1||!lG(n)||(i===0?t.push(n):r.push({documentOrder:o,tabIndex:i,node:n}))}),r.sort((n,o)=>n.tabIndex===o.tabIndex?n.documentOrder-o.documentOrder:n.tabIndex-o.tabIndex).map(n=>n.node).concat(t)}function uG(){return!0}function dG(e){const{children:t,disableAutoFocus:r=!1,disableEnforceFocus:n=!1,disableRestoreFocus:o=!1,getTabbable:i=cG,isEnabled:s=uG,open:a}=e,l=S.useRef(!1),c=S.useRef(null),u=S.useRef(null),d=S.useRef(null),f=S.useRef(null),p=S.useRef(!1),h=S.useRef(null),m=Ur(t.ref,h),b=S.useRef(null);S.useEffect(()=>{!a||!h.current||(p.current=!r)},[r,a]),S.useEffect(()=>{if(!a||!h.current)return;const y=Br(h.current);return h.current.contains(y.activeElement)||(h.current.hasAttribute("tabIndex")||h.current.setAttribute("tabIndex","-1"),p.current&&h.current.focus()),()=>{o||(d.current&&d.current.focus&&(l.current=!0,d.current.focus()),d.current=null)}},[a]),S.useEffect(()=>{if(!a||!h.current)return;const y=Br(h.current),x=E=>{b.current=E,!(n||!s()||E.key!=="Tab")&&y.activeElement===h.current&&E.shiftKey&&(l.current=!0,u.current&&u.current.focus())},k=()=>{const E=h.current;if(E===null)return;if(!y.hasFocus()||!s()||l.current){l.current=!1;return}if(E.contains(y.activeElement)||n&&y.activeElement!==c.current&&y.activeElement!==u.current)return;if(y.activeElement!==f.current)f.current=null;else if(f.current!==null)return;if(!p.current)return;let T=[];if((y.activeElement===c.current||y.activeElement===u.current)&&(T=i(h.current)),T.length>0){var C,M;const N=!!((C=b.current)!=null&&C.shiftKey&&((M=b.current)==null?void 0:M.key)==="Tab"),F=T[0],I=T[T.length-1];typeof F!="string"&&typeof I!="string"&&(N?I.focus():F.focus())}else E.focus()};y.addEventListener("focusin",k),y.addEventListener("keydown",x,!0);const w=setInterval(()=>{y.activeElement&&y.activeElement.tagName==="BODY"&&k()},50);return()=>{clearInterval(w),y.removeEventListener("focusin",k),y.removeEventListener("keydown",x,!0)}},[r,n,o,s,a,i]);const v=y=>{d.current===null&&(d.current=y.relatedTarget),p.current=!0,f.current=y.target;const x=t.props.onFocus;x&&x(y)},g=y=>{d.current===null&&(d.current=y.relatedTarget),p.current=!0};return O.jsxs(S.Fragment,{children:[O.jsx("div",{tabIndex:a?0:-1,onFocus:g,ref:c,"data-testid":"sentinelStart"}),S.cloneElement(t,{ref:m,onFocus:v}),O.jsx("div",{tabIndex:a?0:-1,onFocus:g,ref:u,"data-testid":"sentinelEnd"})]})}var Fr="top",Ln="bottom",In="right",Vr="left",Tb="auto",Gd=[Fr,Ln,In,Vr],Gl="start",gd="end",fG="clippingParents",g3="viewport",_c="popper",pG="reference",kS=Gd.reduce(function(e,t){return e.concat([t+"-"+Gl,t+"-"+gd])},[]),v3=[].concat(Gd,[Tb]).reduce(function(e,t){return e.concat([t,t+"-"+Gl,t+"-"+gd])},[]),hG="beforeRead",mG="read",gG="afterRead",vG="beforeMain",yG="main",bG="afterMain",xG="beforeWrite",kG="write",wG="afterWrite",SG=[hG,mG,gG,vG,yG,bG,xG,kG,wG];function No(e){return e?(e.nodeName||"").toLowerCase():null}function pn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function va(e){var t=pn(e).Element;return e instanceof t||e instanceof Element}function Nn(e){var t=pn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Ob(e){if(typeof ShadowRoot>"u")return!1;var t=pn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function EG(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},o=t.attributes[r]||{},i=t.elements[r];!Nn(i)||!No(i)||(Object.assign(i.style,n),Object.keys(o).forEach(function(s){var a=o[s];a===!1?i.removeAttribute(s):i.setAttribute(s,a===!0?"":a)}))})}function CG(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var o=t.elements[n],i=t.attributes[n]||{},s=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),a=s.reduce(function(l,c){return l[c]="",l},{});!Nn(o)||!No(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const MG={name:"applyStyles",enabled:!0,phase:"write",fn:EG,effect:CG,requires:["computeStyles"]};function Co(e){return e.split("-")[0]}var ta=Math.max,vh=Math.min,Yl=Math.round;function rv(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function y3(){return!/^((?!chrome|android).)*safari/i.test(rv())}function Jl(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),o=1,i=1;t&&Nn(e)&&(o=e.offsetWidth>0&&Yl(n.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Yl(n.height)/e.offsetHeight||1);var s=va(e)?pn(e):window,a=s.visualViewport,l=!y3()&&r,c=(n.left+(l&&a?a.offsetLeft:0))/o,u=(n.top+(l&&a?a.offsetTop:0))/i,d=n.width/o,f=n.height/i;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function _b(e){var t=Jl(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function b3(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&Ob(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function ai(e){return pn(e).getComputedStyle(e)}function TG(e){return["table","td","th"].indexOf(No(e))>=0}function ks(e){return((va(e)?e.ownerDocument:e.document)||window.document).documentElement}function Gm(e){return No(e)==="html"?e:e.assignedSlot||e.parentNode||(Ob(e)?e.host:null)||ks(e)}function wS(e){return!Nn(e)||ai(e).position==="fixed"?null:e.offsetParent}function OG(e){var t=/firefox/i.test(rv()),r=/Trident/i.test(rv());if(r&&Nn(e)){var n=ai(e);if(n.position==="fixed")return null}var o=Gm(e);for(Ob(o)&&(o=o.host);Nn(o)&&["html","body"].indexOf(No(o))<0;){var i=ai(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function Yd(e){for(var t=pn(e),r=wS(e);r&&TG(r)&&ai(r).position==="static";)r=wS(r);return r&&(No(r)==="html"||No(r)==="body"&&ai(r).position==="static")?t:r||OG(e)||t}function Ab(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Au(e,t,r){return ta(e,vh(t,r))}function _G(e,t,r){var n=Au(e,t,r);return n>r?r:n}function x3(){return{top:0,right:0,bottom:0,left:0}}function k3(e){return Object.assign({},x3(),e)}function w3(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var AG=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,k3(typeof t!="number"?t:w3(t,Gd))};function NG(e){var t,r=e.state,n=e.name,o=e.options,i=r.elements.arrow,s=r.modifiersData.popperOffsets,a=Co(r.placement),l=Ab(a),c=[Vr,In].indexOf(a)>=0,u=c?"height":"width";if(!(!i||!s)){var d=AG(o.padding,r),f=_b(i),p=l==="y"?Fr:Vr,h=l==="y"?Ln:In,m=r.rects.reference[u]+r.rects.reference[l]-s[l]-r.rects.popper[u],b=s[l]-r.rects.reference[l],v=Yd(i),g=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,y=m/2-b/2,x=d[p],k=g-f[u]-d[h],w=g/2-f[u]/2+y,E=Au(x,w,k),T=l;r.modifiersData[n]=(t={},t[T]=E,t.centerOffset=E-w,t)}}function RG(e){var t=e.state,r=e.options,n=r.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||b3(t.elements.popper,o)&&(t.elements.arrow=o))}const PG={name:"arrow",enabled:!0,phase:"main",fn:NG,effect:RG,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Xl(e){return e.split("-")[1]}var zG={top:"auto",right:"auto",bottom:"auto",left:"auto"};function LG(e,t){var r=e.x,n=e.y,o=t.devicePixelRatio||1;return{x:Yl(r*o)/o||0,y:Yl(n*o)/o||0}}function SS(e){var t,r=e.popper,n=e.popperRect,o=e.placement,i=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=s.x,p=f===void 0?0:f,h=s.y,m=h===void 0?0:h,b=typeof u=="function"?u({x:p,y:m}):{x:p,y:m};p=b.x,m=b.y;var v=s.hasOwnProperty("x"),g=s.hasOwnProperty("y"),y=Vr,x=Fr,k=window;if(c){var w=Yd(r),E="clientHeight",T="clientWidth";if(w===pn(r)&&(w=ks(r),ai(w).position!=="static"&&a==="absolute"&&(E="scrollHeight",T="scrollWidth")),w=w,o===Fr||(o===Vr||o===In)&&i===gd){x=Ln;var C=d&&w===k&&k.visualViewport?k.visualViewport.height:w[E];m-=C-n.height,m*=l?1:-1}if(o===Vr||(o===Fr||o===Ln)&&i===gd){y=In;var M=d&&w===k&&k.visualViewport?k.visualViewport.width:w[T];p-=M-n.width,p*=l?1:-1}}var N=Object.assign({position:a},c&&zG),F=u===!0?LG({x:p,y:m},pn(r)):{x:p,y:m};if(p=F.x,m=F.y,l){var I;return Object.assign({},N,(I={},I[x]=g?"0":"",I[y]=v?"0":"",I.transform=(k.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",I))}return Object.assign({},N,(t={},t[x]=g?m+"px":"",t[y]=v?p+"px":"",t.transform="",t))}function IG(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=n===void 0?!0:n,i=r.adaptive,s=i===void 0?!0:i,a=r.roundOffsets,l=a===void 0?!0:a,c={placement:Co(t.placement),variation:Xl(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,SS(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,SS(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const DG={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:IG,data:{}};var Cf={passive:!0};function $G(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,i=o===void 0?!0:o,s=n.resize,a=s===void 0?!0:s,l=pn(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",r.update,Cf)}),a&&l.addEventListener("resize",r.update,Cf),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",r.update,Cf)}),a&&l.removeEventListener("resize",r.update,Cf)}}const HG={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:$G,data:{}};var BG={left:"right",right:"left",bottom:"top",top:"bottom"};function hp(e){return e.replace(/left|right|bottom|top/g,function(t){return BG[t]})}var FG={start:"end",end:"start"};function ES(e){return e.replace(/start|end/g,function(t){return FG[t]})}function Nb(e){var t=pn(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function Rb(e){return Jl(ks(e)).left+Nb(e).scrollLeft}function VG(e,t){var r=pn(e),n=ks(e),o=r.visualViewport,i=n.clientWidth,s=n.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;var c=y3();(c||!c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a+Rb(e),y:l}}function jG(e){var t,r=ks(e),n=Nb(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=ta(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=ta(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-n.scrollLeft+Rb(e),l=-n.scrollTop;return ai(o||r).direction==="rtl"&&(a+=ta(r.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function Pb(e){var t=ai(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function S3(e){return["html","body","#document"].indexOf(No(e))>=0?e.ownerDocument.body:Nn(e)&&Pb(e)?e:S3(Gm(e))}function Nu(e,t){var r;t===void 0&&(t=[]);var n=S3(e),o=n===((r=e.ownerDocument)==null?void 0:r.body),i=pn(n),s=o?[i].concat(i.visualViewport||[],Pb(n)?n:[]):n,a=t.concat(s);return o?a:a.concat(Nu(Gm(s)))}function nv(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function UG(e,t){var r=Jl(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function CS(e,t,r){return t===g3?nv(VG(e,r)):va(t)?UG(t,r):nv(jG(ks(e)))}function WG(e){var t=Nu(Gm(e)),r=["absolute","fixed"].indexOf(ai(e).position)>=0,n=r&&Nn(e)?Yd(e):e;return va(n)?t.filter(function(o){return va(o)&&b3(o,n)&&No(o)!=="body"}):[]}function KG(e,t,r,n){var o=t==="clippingParents"?WG(e):[].concat(t),i=[].concat(o,[r]),s=i[0],a=i.reduce(function(l,c){var u=CS(e,c,n);return l.top=ta(u.top,l.top),l.right=vh(u.right,l.right),l.bottom=vh(u.bottom,l.bottom),l.left=ta(u.left,l.left),l},CS(e,s,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function E3(e){var t=e.reference,r=e.element,n=e.placement,o=n?Co(n):null,i=n?Xl(n):null,s=t.x+t.width/2-r.width/2,a=t.y+t.height/2-r.height/2,l;switch(o){case Fr:l={x:s,y:t.y-r.height};break;case Ln:l={x:s,y:t.y+t.height};break;case In:l={x:t.x+t.width,y:a};break;case Vr:l={x:t.x-r.width,y:a};break;default:l={x:t.x,y:t.y}}var c=o?Ab(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case Gl:l[c]=l[c]-(t[u]/2-r[u]/2);break;case gd:l[c]=l[c]+(t[u]/2-r[u]/2);break}}return l}function vd(e,t){t===void 0&&(t={});var r=t,n=r.placement,o=n===void 0?e.placement:n,i=r.strategy,s=i===void 0?e.strategy:i,a=r.boundary,l=a===void 0?fG:a,c=r.rootBoundary,u=c===void 0?g3:c,d=r.elementContext,f=d===void 0?_c:d,p=r.altBoundary,h=p===void 0?!1:p,m=r.padding,b=m===void 0?0:m,v=k3(typeof b!="number"?b:w3(b,Gd)),g=f===_c?pG:_c,y=e.rects.popper,x=e.elements[h?g:f],k=KG(va(x)?x:x.contextElement||ks(e.elements.popper),l,u,s),w=Jl(e.elements.reference),E=E3({reference:w,element:y,strategy:"absolute",placement:o}),T=nv(Object.assign({},y,E)),C=f===_c?T:w,M={top:k.top-C.top+v.top,bottom:C.bottom-k.bottom+v.bottom,left:k.left-C.left+v.left,right:C.right-k.right+v.right},N=e.modifiersData.offset;if(f===_c&&N){var F=N[o];Object.keys(M).forEach(function(I){var V=[In,Ln].indexOf(I)>=0?1:-1,j=[Fr,Ln].indexOf(I)>=0?"y":"x";M[I]+=F[j]*V})}return M}function qG(e,t){t===void 0&&(t={});var r=t,n=r.placement,o=r.boundary,i=r.rootBoundary,s=r.padding,a=r.flipVariations,l=r.allowedAutoPlacements,c=l===void 0?v3:l,u=Xl(n),d=u?a?kS:kS.filter(function(h){return Xl(h)===u}):Gd,f=d.filter(function(h){return c.indexOf(h)>=0});f.length===0&&(f=d);var p=f.reduce(function(h,m){return h[m]=vd(e,{placement:m,boundary:o,rootBoundary:i,padding:s})[Co(m)],h},{});return Object.keys(p).sort(function(h,m){return p[h]-p[m]})}function GG(e){if(Co(e)===Tb)return[];var t=hp(e);return[ES(e),t,ES(t)]}function YG(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=r.mainAxis,i=o===void 0?!0:o,s=r.altAxis,a=s===void 0?!0:s,l=r.fallbackPlacements,c=r.padding,u=r.boundary,d=r.rootBoundary,f=r.altBoundary,p=r.flipVariations,h=p===void 0?!0:p,m=r.allowedAutoPlacements,b=t.options.placement,v=Co(b),g=v===b,y=l||(g||!h?[hp(b)]:GG(b)),x=[b].concat(y).reduce(function(ie,ue){return ie.concat(Co(ue)===Tb?qG(t,{placement:ue,boundary:u,rootBoundary:d,padding:c,flipVariations:h,allowedAutoPlacements:m}):ue)},[]),k=t.rects.reference,w=t.rects.popper,E=new Map,T=!0,C=x[0],M=0;M=0,j=V?"width":"height",z=vd(t,{placement:N,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),q=V?I?In:Vr:I?Ln:Fr;k[j]>w[j]&&(q=hp(q));var A=hp(q),P=[];if(i&&P.push(z[F]<=0),a&&P.push(z[q]<=0,z[A]<=0),P.every(function(ie){return ie})){C=N,T=!1;break}E.set(N,P)}if(T)for(var B=h?3:1,Y=function(ue){var de=x.find(function(me){var Me=E.get(me);if(Me)return Me.slice(0,ue).every(function(Se){return Se})});if(de)return C=de,"break"},J=B;J>0;J--){var Ne=Y(J);if(Ne==="break")break}t.placement!==C&&(t.modifiersData[n]._skip=!0,t.placement=C,t.reset=!0)}}const JG={name:"flip",enabled:!0,phase:"main",fn:YG,requiresIfExists:["offset"],data:{_skip:!1}};function MS(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function TS(e){return[Fr,In,Ln,Vr].some(function(t){return e[t]>=0})}function XG(e){var t=e.state,r=e.name,n=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=vd(t,{elementContext:"reference"}),a=vd(t,{altBoundary:!0}),l=MS(s,n),c=MS(a,o,i),u=TS(l),d=TS(c);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const QG={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:XG};function ZG(e,t,r){var n=Co(e),o=[Vr,Fr].indexOf(n)>=0?-1:1,i=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Vr,In].indexOf(n)>=0?{x:a,y:s}:{x:s,y:a}}function eY(e){var t=e.state,r=e.options,n=e.name,o=r.offset,i=o===void 0?[0,0]:o,s=v3.reduce(function(u,d){return u[d]=ZG(d,t.rects,i),u},{}),a=s[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=s}const tY={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:eY};function rY(e){var t=e.state,r=e.name;t.modifiersData[r]=E3({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const nY={name:"popperOffsets",enabled:!0,phase:"read",fn:rY,data:{}};function oY(e){return e==="x"?"y":"x"}function iY(e){var t=e.state,r=e.options,n=e.name,o=r.mainAxis,i=o===void 0?!0:o,s=r.altAxis,a=s===void 0?!1:s,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,d=r.padding,f=r.tether,p=f===void 0?!0:f,h=r.tetherOffset,m=h===void 0?0:h,b=vd(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),v=Co(t.placement),g=Xl(t.placement),y=!g,x=Ab(v),k=oY(x),w=t.modifiersData.popperOffsets,E=t.rects.reference,T=t.rects.popper,C=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,M=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,F={x:0,y:0};if(w){if(i){var I,V=x==="y"?Fr:Vr,j=x==="y"?Ln:In,z=x==="y"?"height":"width",q=w[x],A=q+b[V],P=q-b[j],B=p?-T[z]/2:0,Y=g===Gl?E[z]:T[z],J=g===Gl?-T[z]:-E[z],Ne=t.elements.arrow,ie=p&&Ne?_b(Ne):{width:0,height:0},ue=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:x3(),de=ue[V],me=ue[j],Me=Au(0,E[z],ie[z]),Se=y?E[z]/2-B-Me-de-M.mainAxis:Y-Me-de-M.mainAxis,ft=y?-E[z]/2+B+Me+me+M.mainAxis:J+Me+me+M.mainAxis,rt=t.elements.arrow&&Yd(t.elements.arrow),Or=rt?x==="y"?rt.clientTop||0:rt.clientLeft||0:0,he=(I=N==null?void 0:N[x])!=null?I:0,De=q+Se-he-Or,Ke=q+ft-he,Fn=Au(p?vh(A,De):A,q,p?ta(P,Ke):P);w[x]=Fn,F[x]=Fn-q}if(a){var Gr,nr=x==="x"?Fr:Vr,zo=x==="x"?Ln:In,Pt=w[k],Yr=k==="y"?"height":"width",vn=Pt+b[nr],Vn=Pt-b[zo],Qe=[Fr,Vr].indexOf(v)!==-1,Jr=(Gr=N==null?void 0:N[k])!=null?Gr:0,yn=Qe?vn:Pt-E[Yr]-T[Yr]-Jr+M.altAxis,mi=Qe?Pt+E[Yr]+T[Yr]-Jr-M.altAxis:Vn,Oa=p&&Qe?_G(yn,Pt,mi):Au(p?yn:vn,Pt,p?mi:Vn);w[k]=Oa,F[k]=Oa-Pt}t.modifiersData[n]=F}}const sY={name:"preventOverflow",enabled:!0,phase:"main",fn:iY,requiresIfExists:["offset"]};function aY(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function lY(e){return e===pn(e)||!Nn(e)?Nb(e):aY(e)}function cY(e){var t=e.getBoundingClientRect(),r=Yl(t.width)/e.offsetWidth||1,n=Yl(t.height)/e.offsetHeight||1;return r!==1||n!==1}function uY(e,t,r){r===void 0&&(r=!1);var n=Nn(t),o=Nn(t)&&cY(t),i=ks(t),s=Jl(e,o,r),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!r)&&((No(t)!=="body"||Pb(i))&&(a=lY(t)),Nn(t)?(l=Jl(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=Rb(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function dY(e){var t=new Map,r=new Set,n=[];e.forEach(function(i){t.set(i.name,i)});function o(i){r.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!r.has(a)){var l=t.get(a);l&&o(l)}}),n.push(i)}return e.forEach(function(i){r.has(i.name)||o(i)}),n}function fY(e){var t=dY(e);return SG.reduce(function(r,n){return r.concat(t.filter(function(o){return o.phase===n}))},[])}function pY(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function hY(e){var t=e.reduce(function(r,n){var o=r[n.name];return r[n.name]=o?Object.assign({},o,n,{options:Object.assign({},o.options,n.options),data:Object.assign({},o.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var OS={placement:"bottom",modifiers:[],strategy:"absolute"};function _S(){for(var e=arguments.length,t=new Array(e),r=0;r{i||a(yY(o)||document.body)},[o,i]),ha(()=>{if(s&&!i)return Y0(r,s),()=>{Y0(r,null)}},[r,s,i]),i){if(S.isValidElement(n)){const c={ref:l};return S.cloneElement(n,c)}return O.jsx(S.Fragment,{children:n})}return O.jsx(S.Fragment,{children:s&&am.createPortal(n,s)})});function bY(e){return Vt("MuiPopper",e)}jt("MuiPopper",["root"]);const xY=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],kY=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function wY(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function ov(e){return typeof e=="function"?e():e}function SY(e){return e.nodeType!==void 0}const EY=()=>rr({root:["root"]},eG(bY)),CY={},MY=S.forwardRef(function(t,r){var n;const{anchorEl:o,children:i,direction:s,disablePortal:a,modifiers:l,open:c,placement:u,popperOptions:d,popperRef:f,slotProps:p={},slots:h={},TransitionProps:m}=t,b=ve(t,xY),v=S.useRef(null),g=Ur(v,r),y=S.useRef(null),x=Ur(y,f),k=S.useRef(x);ha(()=>{k.current=x},[x]),S.useImperativeHandle(f,()=>y.current,[]);const w=wY(u,s),[E,T]=S.useState(w),[C,M]=S.useState(ov(o));S.useEffect(()=>{y.current&&y.current.forceUpdate()}),S.useEffect(()=>{o&&M(ov(o))},[o]),ha(()=>{if(!C||!c)return;const j=A=>{T(A.placement)};let z=[{name:"preventOverflow",options:{altBoundary:a}},{name:"flip",options:{altBoundary:a}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:A})=>{j(A)}}];l!=null&&(z=z.concat(l)),d&&d.modifiers!=null&&(z=z.concat(d.modifiers));const q=vY(C,v.current,_({placement:w},d,{modifiers:z}));return k.current(q),()=>{q.destroy(),k.current(null)}},[C,a,l,c,d,w]);const N={placement:E};m!==null&&(N.TransitionProps=m);const F=EY(),I=(n=h.root)!=null?n:"div",V=si({elementType:I,externalSlotProps:p.root,externalForwardedProps:b,additionalProps:{role:"tooltip",ref:g},ownerState:t,className:F.root});return O.jsx(I,_({},V,{children:typeof i=="function"?i(N):i}))}),TY=S.forwardRef(function(t,r){const{anchorEl:n,children:o,container:i,direction:s="ltr",disablePortal:a=!1,keepMounted:l=!1,modifiers:c,open:u,placement:d="bottom",popperOptions:f=CY,popperRef:p,style:h,transition:m=!1,slotProps:b={},slots:v={}}=t,g=ve(t,kY),[y,x]=S.useState(!0),k=()=>{x(!1)},w=()=>{x(!0)};if(!l&&!u&&(!m||y))return null;let E;if(i)E=i;else if(n){const M=ov(n);E=M&&SY(M)?Br(M).body:Br(null).body}const T=!u&&l&&(!m||y)?"none":void 0,C=m?{in:u,onEnter:k,onExited:w}:void 0;return O.jsx(C3,{disablePortal:a,container:E,children:O.jsx(MY,_({anchorEl:n,direction:s,disablePortal:a,modifiers:c,ref:r,open:m?!y:u,placement:d,popperOptions:f,popperRef:p,slotProps:b,slots:v},g,{style:_({position:"fixed",top:0,left:0,display:T},h),TransitionProps:C,children:o}))})});function OY(e){const t=Br(e);return t.body===e?fd(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function Ru(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function AS(e){return parseInt(fd(e).getComputedStyle(e).paddingRight,10)||0}function _Y(e){const r=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName)!==-1,n=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return r||n}function NS(e,t,r,n,o){const i=[t,r,...n];[].forEach.call(e.children,s=>{const a=i.indexOf(s)===-1,l=!_Y(s);a&&l&&Ru(s,o)})}function n1(e,t){let r=-1;return e.some((n,o)=>t(n)?(r=o,!0):!1),r}function AY(e,t){const r=[],n=e.container;if(!t.disableScrollLock){if(OY(n)){const s=zT(Br(n));r.push({value:n.style.paddingRight,property:"padding-right",el:n}),n.style.paddingRight=`${AS(n)+s}px`;const a=Br(n).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{r.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${AS(l)+s}px`})}let i;if(n.parentNode instanceof DocumentFragment)i=Br(n).body;else{const s=n.parentElement,a=fd(n);i=(s==null?void 0:s.nodeName)==="HTML"&&a.getComputedStyle(s).overflowY==="scroll"?s:n}r.push({value:i.style.overflow,property:"overflow",el:i},{value:i.style.overflowX,property:"overflow-x",el:i},{value:i.style.overflowY,property:"overflow-y",el:i}),i.style.overflow="hidden"}return()=>{r.forEach(({value:i,el:s,property:a})=>{i?s.style.setProperty(a,i):s.style.removeProperty(a)})}}function NY(e){const t=[];return[].forEach.call(e.children,r=>{r.getAttribute("aria-hidden")==="true"&&t.push(r)}),t}class RY{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(t,r){let n=this.modals.indexOf(t);if(n!==-1)return n;n=this.modals.length,this.modals.push(t),t.modalRef&&Ru(t.modalRef,!1);const o=NY(r);NS(r,t.mount,t.modalRef,o,!0);const i=n1(this.containers,s=>s.container===r);return i!==-1?(this.containers[i].modals.push(t),n):(this.containers.push({modals:[t],container:r,restore:null,hiddenSiblings:o}),n)}mount(t,r){const n=n1(this.containers,i=>i.modals.indexOf(t)!==-1),o=this.containers[n];o.restore||(o.restore=AY(o,r))}remove(t,r=!0){const n=this.modals.indexOf(t);if(n===-1)return n;const o=n1(this.containers,s=>s.modals.indexOf(t)!==-1),i=this.containers[o];if(i.modals.splice(i.modals.indexOf(t),1),this.modals.splice(n,1),i.modals.length===0)i.restore&&i.restore(),t.modalRef&&Ru(t.modalRef,r),NS(i.container,t.mount,t.modalRef,i.hiddenSiblings,!1),this.containers.splice(o,1);else{const s=i.modals[i.modals.length-1];s.modalRef&&Ru(s.modalRef,!1)}return n}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function PY(e){return typeof e=="function"?e():e}function zY(e){return e?e.props.hasOwnProperty("in"):!1}const LY=new RY;function IY(e){const{container:t,disableEscapeKeyDown:r=!1,disableScrollLock:n=!1,manager:o=LY,closeAfterTransition:i=!1,onTransitionEnter:s,onTransitionExited:a,children:l,onClose:c,open:u,rootRef:d}=e,f=S.useRef({}),p=S.useRef(null),h=S.useRef(null),m=Ur(h,d),[b,v]=S.useState(!u),g=zY(l);let y=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(y=!1);const x=()=>Br(p.current),k=()=>(f.current.modalRef=h.current,f.current.mount=p.current,f.current),w=()=>{o.mount(k(),{disableScrollLock:n}),h.current&&(h.current.scrollTop=0)},E=Ks(()=>{const z=PY(t)||x().body;o.add(k(),z),h.current&&w()}),T=S.useCallback(()=>o.isTopModal(k()),[o]),C=Ks(z=>{p.current=z,z&&(u&&T()?w():h.current&&Ru(h.current,y))}),M=S.useCallback(()=>{o.remove(k(),y)},[y,o]);S.useEffect(()=>()=>{M()},[M]),S.useEffect(()=>{u?E():(!g||!i)&&M()},[u,M,g,i,E]);const N=z=>q=>{var A;(A=z.onKeyDown)==null||A.call(z,q),!(q.key!=="Escape"||!T())&&(r||(q.stopPropagation(),c&&c(q,"escapeKeyDown")))},F=z=>q=>{var A;(A=z.onClick)==null||A.call(z,q),q.target===q.currentTarget&&c&&c(q,"backdropClick")};return{getRootProps:(z={})=>{const q=m3(e);delete q.onTransitionEnter,delete q.onTransitionExited;const A=_({},q,z);return _({role:"presentation"},A,{onKeyDown:N(A),ref:m})},getBackdropProps:(z={})=>{const q=z;return _({"aria-hidden":!0},q,{onClick:F(q),open:u})},getTransitionProps:()=>{const z=()=>{v(!1),s&&s()},q=()=>{v(!0),a&&a(),i&&M()};return{onEnter:Vw(z,l==null?void 0:l.props.onEnter),onExited:Vw(q,l==null?void 0:l.props.onExited)}},rootRef:m,portalRef:C,isTopModal:T,exited:b,hasTransition:g}}const DY=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],$Y=Xe(TY,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),HY=S.forwardRef(function(t,r){var n;const o=vb(),i=Wt({props:t,name:"MuiPopper"}),{anchorEl:s,component:a,components:l,componentsProps:c,container:u,disablePortal:d,keepMounted:f,modifiers:p,open:h,placement:m,popperOptions:b,popperRef:v,transition:g,slots:y,slotProps:x}=i,k=ve(i,DY),w=(n=y==null?void 0:y.root)!=null?n:l==null?void 0:l.Root,E=_({anchorEl:s,container:u,disablePortal:d,keepMounted:f,modifiers:p,open:h,placement:m,popperOptions:b,popperRef:v,transition:g},k);return O.jsx($Y,_({as:a,direction:o==null?void 0:o.direction,slots:{root:w},slotProps:x??c},E,{ref:r}))}),zb=HY,BY=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],FY={entering:{opacity:1},entered:{opacity:1}},VY=S.forwardRef(function(t,r){const n=Km(),o={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:s=!0,children:a,easing:l,in:c,onEnter:u,onEntered:d,onEntering:f,onExit:p,onExited:h,onExiting:m,style:b,timeout:v=o,TransitionComponent:g=f3}=t,y=ve(t,BY),x=S.useRef(null),k=Ur(x,a.ref,r),w=V=>j=>{if(V){const z=x.current;j===void 0?V(z):V(z,j)}},E=w(f),T=w((V,j)=>{p3(V);const z=gh({style:b,timeout:v,easing:l},{mode:"enter"});V.style.webkitTransition=n.transitions.create("opacity",z),V.style.transition=n.transitions.create("opacity",z),u&&u(V,j)}),C=w(d),M=w(m),N=w(V=>{const j=gh({style:b,timeout:v,easing:l},{mode:"exit"});V.style.webkitTransition=n.transitions.create("opacity",j),V.style.transition=n.transitions.create("opacity",j),p&&p(V)}),F=w(h),I=V=>{i&&i(x.current,V)};return O.jsx(g,_({appear:s,in:c,nodeRef:x,onEnter:T,onEntered:C,onEntering:E,onExit:N,onExited:F,onExiting:M,addEndListener:I,timeout:v},y,{children:(V,j)=>S.cloneElement(a,_({style:_({opacity:0,visibility:V==="exited"&&!c?"hidden":void 0},FY[V],b,a.props.style),ref:k},j))}))}),jY=VY;function UY(e){return Vt("MuiBackdrop",e)}jt("MuiBackdrop",["root","invisible"]);const WY=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],KY=e=>{const{classes:t,invisible:r}=e;return rr({root:["root",r&&"invisible"]},UY,t)},qY=Xe("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.invisible&&t.invisible]}})(({ownerState:e})=>_({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},e.invisible&&{backgroundColor:"transparent"})),GY=S.forwardRef(function(t,r){var n,o,i;const s=Wt({props:t,name:"MuiBackdrop"}),{children:a,className:l,component:c="div",components:u={},componentsProps:d={},invisible:f=!1,open:p,slotProps:h={},slots:m={},TransitionComponent:b=jY,transitionDuration:v}=s,g=ve(s,WY),y=_({},s,{component:c,invisible:f}),x=KY(y),k=(n=h.root)!=null?n:d.root;return O.jsx(b,_({in:p,timeout:v},g,{children:O.jsx(qY,_({"aria-hidden":!0},k,{as:(o=(i=m.root)!=null?i:u.Root)!=null?o:c,className:Ce(x.root,l,k==null?void 0:k.className),ownerState:_({},y,k==null?void 0:k.ownerState),classes:x,ref:r,children:a}))}))}),YY=GY;function JY(e){return Vt("MuiBadge",e)}const XY=jt("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),bi=XY,QY=["anchorOrigin","className","classes","component","components","componentsProps","children","overlap","color","invisible","max","badgeContent","slots","slotProps","showZero","variant"],o1=10,i1=4,ZY=e=>{const{color:t,anchorOrigin:r,invisible:n,overlap:o,variant:i,classes:s={}}=e,a={root:["root"],badge:["badge",i,n&&"invisible",`anchorOrigin${Fe(r.vertical)}${Fe(r.horizontal)}`,`anchorOrigin${Fe(r.vertical)}${Fe(r.horizontal)}${Fe(o)}`,`overlap${Fe(o)}`,t!=="default"&&`color${Fe(t)}`]};return rr(a,JY,s)},eJ=Xe("span",{name:"MuiBadge",slot:"Root",overridesResolver:(e,t)=>t.root})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),tJ=Xe("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.badge,t[r.variant],t[`anchorOrigin${Fe(r.anchorOrigin.vertical)}${Fe(r.anchorOrigin.horizontal)}${Fe(r.overlap)}`],r.color!=="default"&&t[`color${Fe(r.color)}`],r.invisible&&t.invisible]}})(({theme:e,ownerState:t})=>_({display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(12),minWidth:o1*2,lineHeight:1,padding:"0 6px",height:o1*2,borderRadius:o1,zIndex:1,transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.enteringScreen})},t.color!=="default"&&{backgroundColor:(e.vars||e).palette[t.color].main,color:(e.vars||e).palette[t.color].contrastText},t.variant==="dot"&&{borderRadius:i1,height:i1*2,minWidth:i1*2,padding:0},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular"&&{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular"&&{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular"&&{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular"&&{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular"&&{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular"&&{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular"&&{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular"&&{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${bi.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}},t.invisible&&{transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.leavingScreen})})),rJ=S.forwardRef(function(t,r){var n,o,i,s,a,l;const c=Wt({props:t,name:"MuiBadge"}),{anchorOrigin:u={vertical:"top",horizontal:"right"},className:d,component:f,components:p={},componentsProps:h={},children:m,overlap:b="rectangular",color:v="default",invisible:g=!1,max:y=99,badgeContent:x,slots:k,slotProps:w,showZero:E=!1,variant:T="standard"}=c,C=ve(c,QY),{badgeContent:M,invisible:N,max:F,displayValue:I}=oG({max:y,invisible:g,badgeContent:x,showZero:E}),V=LT({anchorOrigin:u,color:v,overlap:b,variant:T,badgeContent:x}),j=N||M==null&&T!=="dot",{color:z=v,overlap:q=b,anchorOrigin:A=u,variant:P=T}=j?V:c,B=P!=="dot"?I:void 0,Y=_({},c,{badgeContent:M,invisible:j,max:F,displayValue:B,showZero:E,anchorOrigin:A,color:z,overlap:q,variant:P}),J=ZY(Y),Ne=(n=(o=k==null?void 0:k.root)!=null?o:p.Root)!=null?n:eJ,ie=(i=(s=k==null?void 0:k.badge)!=null?s:p.Badge)!=null?i:tJ,ue=(a=w==null?void 0:w.root)!=null?a:h.root,de=(l=w==null?void 0:w.badge)!=null?l:h.badge,me=si({elementType:Ne,externalSlotProps:ue,externalForwardedProps:C,additionalProps:{ref:r,as:f},ownerState:Y,className:Ce(ue==null?void 0:ue.className,J.root,d)}),Me=si({elementType:ie,externalSlotProps:de,ownerState:Y,className:Ce(J.badge,de==null?void 0:de.className)});return O.jsxs(Ne,_({},me,{children:[m,O.jsx(ie,_({},Me,{children:B}))]}))}),nJ=rJ,oJ=kb(),iJ=JW({themeId:Kl,defaultTheme:oJ,defaultClassName:"MuiBox-root",generateClassName:DT.generate}),M3=iJ;function sJ(e){return Vt("MuiModal",e)}jt("MuiModal",["root","hidden","backdrop"]);const aJ=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],lJ=e=>{const{open:t,exited:r,classes:n}=e;return rr({root:["root",!t&&r&&"hidden"],backdrop:["backdrop"]},sJ,n)},cJ=Xe("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.open&&r.exited&&t.hidden]}})(({theme:e,ownerState:t})=>_({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),uJ=Xe(YY,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),dJ=S.forwardRef(function(t,r){var n,o,i,s,a,l;const c=Wt({name:"MuiModal",props:t}),{BackdropComponent:u=uJ,BackdropProps:d,className:f,closeAfterTransition:p=!1,children:h,container:m,component:b,components:v={},componentsProps:g={},disableAutoFocus:y=!1,disableEnforceFocus:x=!1,disableEscapeKeyDown:k=!1,disablePortal:w=!1,disableRestoreFocus:E=!1,disableScrollLock:T=!1,hideBackdrop:C=!1,keepMounted:M=!1,onBackdropClick:N,open:F,slotProps:I,slots:V}=c,j=ve(c,aJ),z=_({},c,{closeAfterTransition:p,disableAutoFocus:y,disableEnforceFocus:x,disableEscapeKeyDown:k,disablePortal:w,disableRestoreFocus:E,disableScrollLock:T,hideBackdrop:C,keepMounted:M}),{getRootProps:q,getBackdropProps:A,getTransitionProps:P,portalRef:B,isTopModal:Y,exited:J,hasTransition:Ne}=IY(_({},z,{rootRef:r})),ie=_({},z,{exited:J}),ue=lJ(ie),de={};if(h.props.tabIndex===void 0&&(de.tabIndex="-1"),Ne){const{onEnter:he,onExited:De}=P();de.onEnter=he,de.onExited=De}const me=(n=(o=V==null?void 0:V.root)!=null?o:v.Root)!=null?n:cJ,Me=(i=(s=V==null?void 0:V.backdrop)!=null?s:v.Backdrop)!=null?i:u,Se=(a=I==null?void 0:I.root)!=null?a:g.root,ft=(l=I==null?void 0:I.backdrop)!=null?l:g.backdrop,rt=si({elementType:me,externalSlotProps:Se,externalForwardedProps:j,getSlotProps:q,additionalProps:{ref:r,as:b},ownerState:ie,className:Ce(f,Se==null?void 0:Se.className,ue==null?void 0:ue.root,!ie.open&&ie.exited&&(ue==null?void 0:ue.hidden))}),Or=si({elementType:Me,externalSlotProps:ft,additionalProps:d,getSlotProps:he=>A(_({},he,{onClick:De=>{N&&N(De),he!=null&&he.onClick&&he.onClick(De)}})),className:Ce(ft==null?void 0:ft.className,d==null?void 0:d.className,ue==null?void 0:ue.backdrop),ownerState:ie});return!M&&!F&&(!Ne||J)?null:O.jsx(C3,{ref:B,container:m,disablePortal:w,children:O.jsxs(me,_({},rt,{children:[!C&&u?O.jsx(Me,_({},Or)):null,O.jsx(dG,{disableEnforceFocus:x,disableAutoFocus:y,disableRestoreFocus:E,isEnabled:Y,open:F,children:S.cloneElement(h,de)})]}))})}),fJ=dJ,pJ=jt("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),RS=pJ,hJ=OK({createStyledComponent:Xe("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>Wt({props:e,name:"MuiStack"})}),mJ=hJ,gJ=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function iv(e){return`scale(${e}, ${e**2})`}const vJ={entering:{opacity:1,transform:iv(1)},entered:{opacity:1,transform:"none"}},s1=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),T3=S.forwardRef(function(t,r){const{addEndListener:n,appear:o=!0,children:i,easing:s,in:a,onEnter:l,onEntered:c,onEntering:u,onExit:d,onExited:f,onExiting:p,style:h,timeout:m="auto",TransitionComponent:b=f3}=t,v=ve(t,gJ),g=S.useRef(),y=S.useRef(),x=Km(),k=S.useRef(null),w=Ur(k,i.ref,r),E=j=>z=>{if(j){const q=k.current;z===void 0?j(q):j(q,z)}},T=E(u),C=E((j,z)=>{p3(j);const{duration:q,delay:A,easing:P}=gh({style:h,timeout:m,easing:s},{mode:"enter"});let B;m==="auto"?(B=x.transitions.getAutoHeightDuration(j.clientHeight),y.current=B):B=q,j.style.transition=[x.transitions.create("opacity",{duration:B,delay:A}),x.transitions.create("transform",{duration:s1?B:B*.666,delay:A,easing:P})].join(","),l&&l(j,z)}),M=E(c),N=E(p),F=E(j=>{const{duration:z,delay:q,easing:A}=gh({style:h,timeout:m,easing:s},{mode:"exit"});let P;m==="auto"?(P=x.transitions.getAutoHeightDuration(j.clientHeight),y.current=P):P=z,j.style.transition=[x.transitions.create("opacity",{duration:P,delay:q}),x.transitions.create("transform",{duration:s1?P:P*.666,delay:s1?q:q||P*.333,easing:A})].join(","),j.style.opacity=0,j.style.transform=iv(.75),d&&d(j)}),I=E(f),V=j=>{m==="auto"&&(g.current=setTimeout(j,y.current||0)),n&&n(k.current,j)};return S.useEffect(()=>()=>{clearTimeout(g.current)},[]),O.jsx(b,_({appear:o,in:a,nodeRef:k,onEnter:C,onEntered:M,onEntering:T,onExit:F,onExited:I,onExiting:N,addEndListener:V,timeout:m==="auto"?null:m},v,{children:(j,z)=>S.cloneElement(i,_({style:_({opacity:0,transform:iv(.75),visibility:j==="exited"&&!a?"hidden":void 0},vJ[j],h,i.props.style),ref:w},z))}))});T3.muiSupportAuto=!0;const sv=T3,yJ=S.createContext({}),yd=yJ;function bJ(e){return Vt("MuiList",e)}jt("MuiList",["root","padding","dense","subheader"]);const xJ=["children","className","component","dense","disablePadding","subheader"],kJ=e=>{const{classes:t,disablePadding:r,dense:n,subheader:o}=e;return rr({root:["root",!r&&"padding",n&&"dense",o&&"subheader"]},bJ,t)},wJ=Xe("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disablePadding&&t.padding,r.dense&&t.dense,r.subheader&&t.subheader]}})(({ownerState:e})=>_({listStyle:"none",margin:0,padding:0,position:"relative"},!e.disablePadding&&{paddingTop:8,paddingBottom:8},e.subheader&&{paddingTop:0})),SJ=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiList"}),{children:o,className:i,component:s="ul",dense:a=!1,disablePadding:l=!1,subheader:c}=n,u=ve(n,xJ),d=S.useMemo(()=>({dense:a}),[a]),f=_({},n,{component:s,dense:a,disablePadding:l}),p=kJ(f);return O.jsx(yd.Provider,{value:d,children:O.jsxs(wJ,_({as:s,className:Ce(p.root,i),ref:r,ownerState:f},u,{children:[c,o]}))})}),EJ=SJ;function CJ(e){return Vt("MuiListItemIcon",e)}const MJ=jt("MuiListItemIcon",["root","alignItemsFlexStart"]),PS=MJ,TJ=["className"],OJ=e=>{const{alignItems:t,classes:r}=e;return rr({root:["root",t==="flex-start"&&"alignItemsFlexStart"]},CJ,r)},_J=Xe("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.alignItems==="flex-start"&&t.alignItemsFlexStart]}})(({theme:e,ownerState:t})=>_({minWidth:56,color:(e.vars||e).palette.action.active,flexShrink:0,display:"inline-flex"},t.alignItems==="flex-start"&&{marginTop:8})),AJ=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiListItemIcon"}),{className:o}=n,i=ve(n,TJ),s=S.useContext(yd),a=_({},n,{alignItems:s.alignItems}),l=OJ(a);return O.jsx(_J,_({className:Ce(l.root,o),ownerState:a,ref:r},i))}),NJ=AJ;function RJ(e){return Vt("MuiListItemText",e)}const PJ=jt("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),yh=PJ,zJ=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],LJ=e=>{const{classes:t,inset:r,primary:n,secondary:o,dense:i}=e;return rr({root:["root",r&&"inset",i&&"dense",n&&o&&"multiline"],primary:["primary"],secondary:["secondary"]},RJ,t)},IJ=Xe("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${yh.primary}`]:t.primary},{[`& .${yh.secondary}`]:t.secondary},t.root,r.inset&&t.inset,r.primary&&r.secondary&&t.multiline,r.dense&&t.dense]}})(({ownerState:e})=>_({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},e.primary&&e.secondary&&{marginTop:6,marginBottom:6},e.inset&&{paddingLeft:56})),DJ=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiListItemText"}),{children:o,className:i,disableTypography:s=!1,inset:a=!1,primary:l,primaryTypographyProps:c,secondary:u,secondaryTypographyProps:d}=n,f=ve(n,zJ),{dense:p}=S.useContext(yd);let h=l??o,m=u;const b=_({},n,{disableTypography:s,inset:a,primary:!!h,secondary:!!m,dense:p}),v=LJ(b);return h!=null&&h.type!==cu&&!s&&(h=O.jsx(cu,_({variant:p?"body2":"body1",className:v.primary,component:c!=null&&c.variant?void 0:"span",display:"block"},c,{children:h}))),m!=null&&m.type!==cu&&!s&&(m=O.jsx(cu,_({variant:"body2",className:v.secondary,color:"text.secondary",display:"block"},d,{children:m}))),O.jsxs(IJ,_({className:Ce(v.root,i),ownerState:b,ref:r},f,{children:[h,m]}))}),$J=DJ,HJ=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function a1(e,t,r){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:r?null:e.firstChild}function zS(e,t,r){return e===t?r?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:r?null:e.lastChild}function O3(e,t){if(t===void 0)return!0;let r=e.innerText;return r===void 0&&(r=e.textContent),r=r.trim().toLowerCase(),r.length===0?!1:t.repeating?r[0]===t.keys[0]:r.indexOf(t.keys.join(""))===0}function Ac(e,t,r,n,o,i){let s=!1,a=o(e,t,t?r:!1);for(;a;){if(a===e.firstChild){if(s)return!1;s=!0}const l=n?!1:a.disabled||a.getAttribute("aria-disabled")==="true";if(!a.hasAttribute("tabindex")||!O3(a,i)||l)a=o(e,a,r);else return a.focus(),!0}return!1}const BJ=S.forwardRef(function(t,r){const{actions:n,autoFocus:o=!1,autoFocusItem:i=!1,children:s,className:a,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:d="selectedMenu"}=t,f=ve(t,HJ),p=S.useRef(null),h=S.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});ha(()=>{o&&p.current.focus()},[o]),S.useImperativeHandle(n,()=>({adjustStyleForScrollbar:(y,x)=>{const k=!p.current.style.width;if(y.clientHeight{const x=p.current,k=y.key,w=Br(x).activeElement;if(k==="ArrowDown")y.preventDefault(),Ac(x,w,c,l,a1);else if(k==="ArrowUp")y.preventDefault(),Ac(x,w,c,l,zS);else if(k==="Home")y.preventDefault(),Ac(x,null,c,l,a1);else if(k==="End")y.preventDefault(),Ac(x,null,c,l,zS);else if(k.length===1){const E=h.current,T=k.toLowerCase(),C=performance.now();E.keys.length>0&&(C-E.lastTime>500?(E.keys=[],E.repeating=!0,E.previousKeyMatched=!0):E.repeating&&T!==E.keys[0]&&(E.repeating=!1)),E.lastTime=C,E.keys.push(T);const M=w&&!E.repeating&&O3(w,E);E.previousKeyMatched&&(M||Ac(x,w,!1,l,a1,E))?y.preventDefault():E.previousKeyMatched=!1}u&&u(y)},b=Ur(p,r);let v=-1;S.Children.forEach(s,(y,x)=>{if(!S.isValidElement(y)){v===x&&(v+=1,v>=s.length&&(v=-1));return}y.props.disabled||(d==="selectedMenu"&&y.props.selected||v===-1)&&(v=x),v===x&&(y.props.disabled||y.props.muiSkipListHighlight||y.type.muiSkipListHighlight)&&(v+=1,v>=s.length&&(v=-1))});const g=S.Children.map(s,(y,x)=>{if(x===v){const k={};return i&&(k.autoFocus=!0),y.props.tabIndex===void 0&&d==="selectedMenu"&&(k.tabIndex=0),S.cloneElement(y,k)}return y});return O.jsx(EJ,_({role:"menu",ref:b,className:a,onKeyDown:m,tabIndex:o?0:-1},f,{children:g}))}),FJ=BJ;function VJ(e){return Vt("MuiPopover",e)}jt("MuiPopover",["root","paper"]);const jJ=["onEntering"],UJ=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],WJ=["slotProps"];function LS(e,t){let r=0;return typeof t=="number"?r=t:t==="center"?r=e.height/2:t==="bottom"&&(r=e.height),r}function IS(e,t){let r=0;return typeof t=="number"?r=t:t==="center"?r=e.width/2:t==="right"&&(r=e.width),r}function DS(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function l1(e){return typeof e=="function"?e():e}const KJ=e=>{const{classes:t}=e;return rr({root:["root"],paper:["paper"]},VJ,t)},qJ=Xe(fJ,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),_3=Xe(yq,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),GJ=S.forwardRef(function(t,r){var n,o,i;const s=Wt({props:t,name:"MuiPopover"}),{action:a,anchorEl:l,anchorOrigin:c={vertical:"top",horizontal:"left"},anchorPosition:u,anchorReference:d="anchorEl",children:f,className:p,container:h,elevation:m=8,marginThreshold:b=16,open:v,PaperProps:g={},slots:y,slotProps:x,transformOrigin:k={vertical:"top",horizontal:"left"},TransitionComponent:w=sv,transitionDuration:E="auto",TransitionProps:{onEntering:T}={},disableScrollLock:C=!1}=s,M=ve(s.TransitionProps,jJ),N=ve(s,UJ),F=(n=x==null?void 0:x.paper)!=null?n:g,I=S.useRef(),V=Ur(I,F.ref),j=_({},s,{anchorOrigin:c,anchorReference:d,elevation:m,marginThreshold:b,externalPaperSlotProps:F,transformOrigin:k,TransitionComponent:w,transitionDuration:E,TransitionProps:M}),z=KJ(j),q=S.useCallback(()=>{if(d==="anchorPosition")return u;const he=l1(l),Ke=(he&&he.nodeType===1?he:Br(I.current).body).getBoundingClientRect();return{top:Ke.top+LS(Ke,c.vertical),left:Ke.left+IS(Ke,c.horizontal)}},[l,c.horizontal,c.vertical,u,d]),A=S.useCallback(he=>({vertical:LS(he,k.vertical),horizontal:IS(he,k.horizontal)}),[k.horizontal,k.vertical]),P=S.useCallback(he=>{const De={width:he.offsetWidth,height:he.offsetHeight},Ke=A(De);if(d==="none")return{top:null,left:null,transformOrigin:DS(Ke)};const Fn=q();let Gr=Fn.top-Ke.vertical,nr=Fn.left-Ke.horizontal;const zo=Gr+De.height,Pt=nr+De.width,Yr=fd(l1(l)),vn=Yr.innerHeight-b,Vn=Yr.innerWidth-b;if(b!==null&&Grvn){const Qe=zo-vn;Gr-=Qe,Ke.vertical+=Qe}if(b!==null&&nrVn){const Qe=Pt-Vn;nr-=Qe,Ke.horizontal+=Qe}return{top:`${Math.round(Gr)}px`,left:`${Math.round(nr)}px`,transformOrigin:DS(Ke)}},[l,d,q,A,b]),[B,Y]=S.useState(v),J=S.useCallback(()=>{const he=I.current;if(!he)return;const De=P(he);De.top!==null&&(he.style.top=De.top),De.left!==null&&(he.style.left=De.left),he.style.transformOrigin=De.transformOrigin,Y(!0)},[P]);S.useEffect(()=>(C&&window.addEventListener("scroll",J),()=>window.removeEventListener("scroll",J)),[l,C,J]);const Ne=(he,De)=>{T&&T(he,De),J()},ie=()=>{Y(!1)};S.useEffect(()=>{v&&J()}),S.useImperativeHandle(a,()=>v?{updatePosition:()=>{J()}}:null,[v,J]),S.useEffect(()=>{if(!v)return;const he=zj(()=>{J()}),De=fd(l);return De.addEventListener("resize",he),()=>{he.clear(),De.removeEventListener("resize",he)}},[l,v,J]);let ue=E;E==="auto"&&!w.muiSupportAuto&&(ue=void 0);const de=h||(l?Br(l1(l)).body:void 0),me=(o=y==null?void 0:y.root)!=null?o:qJ,Me=(i=y==null?void 0:y.paper)!=null?i:_3,Se=si({elementType:Me,externalSlotProps:_({},F,{style:B?F.style:_({},F.style,{opacity:0})}),additionalProps:{elevation:m,ref:V},ownerState:j,className:Ce(z.paper,F==null?void 0:F.className)}),ft=si({elementType:me,externalSlotProps:(x==null?void 0:x.root)||{},externalForwardedProps:N,additionalProps:{ref:r,slotProps:{backdrop:{invisible:!0}},container:de,open:v},ownerState:j,className:Ce(z.root,p)}),{slotProps:rt}=ft,Or=ve(ft,WJ);return O.jsx(me,_({},Or,!h3(me)&&{slotProps:rt,disableScrollLock:C},{children:O.jsx(w,_({appear:!0,in:v,onEntering:Ne,onExited:ie,timeout:ue},M,{children:O.jsx(Me,_({},Se,{children:f}))}))}))}),YJ=GJ;function JJ(e){return Vt("MuiMenu",e)}jt("MuiMenu",["root","paper","list"]);const XJ=["onEntering"],QJ=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],ZJ={vertical:"top",horizontal:"right"},eX={vertical:"top",horizontal:"left"},tX=e=>{const{classes:t}=e;return rr({root:["root"],paper:["paper"],list:["list"]},JJ,t)},rX=Xe(YJ,{shouldForwardProp:e=>Sb(e)||e==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),nX=Xe(_3,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),oX=Xe(FJ,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),iX=S.forwardRef(function(t,r){var n,o;const i=Wt({props:t,name:"MuiMenu"}),{autoFocus:s=!0,children:a,className:l,disableAutoFocusItem:c=!1,MenuListProps:u={},onClose:d,open:f,PaperProps:p={},PopoverClasses:h,transitionDuration:m="auto",TransitionProps:{onEntering:b}={},variant:v="selectedMenu",slots:g={},slotProps:y={}}=i,x=ve(i.TransitionProps,XJ),k=ve(i,QJ),w=Km(),E=w.direction==="rtl",T=_({},i,{autoFocus:s,disableAutoFocusItem:c,MenuListProps:u,onEntering:b,PaperProps:p,transitionDuration:m,TransitionProps:x,variant:v}),C=tX(T),M=s&&!c&&f,N=S.useRef(null),F=(P,B)=>{N.current&&N.current.adjustStyleForScrollbar(P,w),b&&b(P,B)},I=P=>{P.key==="Tab"&&(P.preventDefault(),d&&d(P,"tabKeyDown"))};let V=-1;S.Children.map(a,(P,B)=>{S.isValidElement(P)&&(P.props.disabled||(v==="selectedMenu"&&P.props.selected||V===-1)&&(V=B))});const j=(n=g.paper)!=null?n:nX,z=(o=y.paper)!=null?o:p,q=si({elementType:g.root,externalSlotProps:y.root,ownerState:T,className:[C.root,l]}),A=si({elementType:j,externalSlotProps:z,ownerState:T,className:C.paper});return O.jsx(rX,_({onClose:d,anchorOrigin:{vertical:"bottom",horizontal:E?"right":"left"},transformOrigin:E?ZJ:eX,slots:{paper:j,root:g.root},slotProps:{root:q,paper:A},open:f,ref:r,transitionDuration:m,TransitionProps:_({onEntering:F},x),ownerState:T},k,{classes:h,children:O.jsx(oX,_({onKeyDown:I,actions:N,autoFocus:s&&(V===-1||c),autoFocusItem:M,variant:v},u,{className:Ce(C.list,u.className),children:a}))}))}),sX=iX;function aX(e){return Vt("MuiMenuItem",e)}const lX=jt("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),Nc=lX,cX=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],uX=(e,t)=>{const{ownerState:r}=e;return[t.root,r.dense&&t.dense,r.divider&&t.divider,!r.disableGutters&&t.gutters]},dX=e=>{const{disabled:t,dense:r,divider:n,disableGutters:o,selected:i,classes:s}=e,l=rr({root:["root",r&&"dense",t&&"disabled",!o&&"gutters",n&&"divider",i&&"selected"]},aX,s);return _({},s,l)},fX=Xe(Mb,{shouldForwardProp:e=>Sb(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:uX})(({theme:e,ownerState:t})=>_({},e.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Nc.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${Nc.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${Nc.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${Nc.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Nc.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${RS.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${RS.inset}`]:{marginLeft:52},[`& .${yh.root}`]:{marginTop:0,marginBottom:0},[`& .${yh.inset}`]:{paddingLeft:36},[`& .${PS.root}`]:{minWidth:36}},!t.dense&&{[e.breakpoints.up("sm")]:{minHeight:"auto"}},t.dense&&_({minHeight:32,paddingTop:4,paddingBottom:4},e.typography.body2,{[`& .${PS.root} svg`]:{fontSize:"1.25rem"}}))),pX=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiMenuItem"}),{autoFocus:o=!1,component:i="li",dense:s=!1,divider:a=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:d,className:f}=n,p=ve(n,cX),h=S.useContext(yd),m=S.useMemo(()=>({dense:s||h.dense||!1,disableGutters:l}),[h.dense,s,l]),b=S.useRef(null);ha(()=>{o&&b.current&&b.current.focus()},[o]);const v=_({},n,{dense:m.dense,divider:a,disableGutters:l}),g=dX(n),y=Ur(b,r);let x;return n.disabled||(x=d!==void 0?d:-1),O.jsx(yd.Provider,{value:m,children:O.jsx(fX,_({ref:y,role:u,tabIndex:x,component:i,focusVisibleClassName:Ce(g.focusVisible,c),className:Ce(g.root,f)},p,{ownerState:v,classes:g}))})}),hX=pX;function mX(e){return Vt("MuiTooltip",e)}const gX=jt("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),Hi=gX,vX=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","slotProps","slots","title","TransitionComponent","TransitionProps"];function yX(e){return Math.round(e*1e5)/1e5}const bX=e=>{const{classes:t,disableInteractive:r,arrow:n,touch:o,placement:i}=e,s={popper:["popper",!r&&"popperInteractive",n&&"popperArrow"],tooltip:["tooltip",n&&"tooltipArrow",o&&"touch",`tooltipPlacement${Fe(i.split("-")[0])}`],arrow:["arrow"]};return rr(s,mX,t)},xX=Xe(zb,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.popper,!r.disableInteractive&&t.popperInteractive,r.arrow&&t.popperArrow,!r.open&&t.popperClose]}})(({theme:e,ownerState:t,open:r})=>_({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none"},!t.disableInteractive&&{pointerEvents:"auto"},!r&&{pointerEvents:"none"},t.arrow&&{[`&[data-popper-placement*="bottom"] .${Hi.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Hi.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Hi.arrow}`]:_({},t.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}}),[`&[data-popper-placement*="left"] .${Hi.arrow}`]:_({},t.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})),kX=Xe("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.tooltip,r.touch&&t.touch,r.arrow&&t.tooltipArrow,t[`tooltipPlacement${Fe(r.placement.split("-")[0])}`]]}})(({theme:e,ownerState:t})=>_({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:Lr(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},t.arrow&&{position:"relative",margin:0},t.touch&&{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${yX(16/14)}em`,fontWeight:e.typography.fontWeightRegular},{[`.${Hi.popper}[data-popper-placement*="left"] &`]:_({transformOrigin:"right center"},t.isRtl?_({marginLeft:"14px"},t.touch&&{marginLeft:"24px"}):_({marginRight:"14px"},t.touch&&{marginRight:"24px"})),[`.${Hi.popper}[data-popper-placement*="right"] &`]:_({transformOrigin:"left center"},t.isRtl?_({marginRight:"14px"},t.touch&&{marginRight:"24px"}):_({marginLeft:"14px"},t.touch&&{marginLeft:"24px"})),[`.${Hi.popper}[data-popper-placement*="top"] &`]:_({transformOrigin:"center bottom",marginBottom:"14px"},t.touch&&{marginBottom:"24px"}),[`.${Hi.popper}[data-popper-placement*="bottom"] &`]:_({transformOrigin:"center top",marginTop:"14px"},t.touch&&{marginTop:"24px"})})),wX=Xe("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:Lr(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}));let Mf=!1,c1=null,Rc={x:0,y:0};function Tf(e,t){return r=>{t&&t(r),e(r)}}const SX=S.forwardRef(function(t,r){var n,o,i,s,a,l,c,u,d,f,p,h,m,b,v,g,y,x,k;const w=Wt({props:t,name:"MuiTooltip"}),{arrow:E=!1,children:T,components:C={},componentsProps:M={},describeChild:N=!1,disableFocusListener:F=!1,disableHoverListener:I=!1,disableInteractive:V=!1,disableTouchListener:j=!1,enterDelay:z=100,enterNextDelay:q=0,enterTouchDelay:A=700,followCursor:P=!1,id:B,leaveDelay:Y=0,leaveTouchDelay:J=1500,onClose:Ne,onOpen:ie,open:ue,placement:de="bottom",PopperComponent:me,PopperProps:Me={},slotProps:Se={},slots:ft={},title:rt,TransitionComponent:Or=sv,TransitionProps:he}=w,De=ve(w,vX),Ke=S.isValidElement(T)?T:O.jsx("span",{children:T}),Fn=Km(),Gr=Fn.direction==="rtl",[nr,zo]=S.useState(),[Pt,Yr]=S.useState(null),vn=S.useRef(!1),Vn=V||P,Qe=S.useRef(),Jr=S.useRef(),yn=S.useRef(),mi=S.useRef(),[Oa,fe]=$j({controlled:ue,default:!1,name:"Tooltip",state:"open"});let bn=Oa;const fc=Dj(B),gi=S.useRef(),pc=S.useCallback(()=>{gi.current!==void 0&&(document.body.style.WebkitUserSelect=gi.current,gi.current=void 0),clearTimeout(mi.current)},[]);S.useEffect(()=>()=>{clearTimeout(Qe.current),clearTimeout(Jr.current),clearTimeout(yn.current),pc()},[pc]);const Nx=ke=>{clearTimeout(c1),Mf=!0,fe(!0),ie&&!bn&&ie(ke)},ef=Ks(ke=>{clearTimeout(c1),c1=setTimeout(()=>{Mf=!1},800+Y),fe(!1),Ne&&bn&&Ne(ke),clearTimeout(Qe.current),Qe.current=setTimeout(()=>{vn.current=!1},Fn.transitions.duration.shortest)}),Zm=ke=>{vn.current&&ke.type!=="touchstart"||(nr&&nr.removeAttribute("title"),clearTimeout(Jr.current),clearTimeout(yn.current),z||Mf&&q?Jr.current=setTimeout(()=>{Nx(ke)},Mf?q:z):Nx(ke))},Rx=ke=>{clearTimeout(Jr.current),clearTimeout(yn.current),yn.current=setTimeout(()=>{ef(ke)},Y)},{isFocusVisibleRef:Px,onBlur:GO,onFocus:YO,ref:JO}=PT(),[,zx]=S.useState(!1),Lx=ke=>{GO(ke),Px.current===!1&&(zx(!1),Rx(ke))},Ix=ke=>{nr||zo(ke.currentTarget),YO(ke),Px.current===!0&&(zx(!0),Zm(ke))},Dx=ke=>{vn.current=!0;const Xr=Ke.props;Xr.onTouchStart&&Xr.onTouchStart(ke)},$x=Zm,Hx=Rx,XO=ke=>{Dx(ke),clearTimeout(yn.current),clearTimeout(Qe.current),pc(),gi.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",mi.current=setTimeout(()=>{document.body.style.WebkitUserSelect=gi.current,Zm(ke)},A)},QO=ke=>{Ke.props.onTouchEnd&&Ke.props.onTouchEnd(ke),pc(),clearTimeout(yn.current),yn.current=setTimeout(()=>{ef(ke)},J)};S.useEffect(()=>{if(!bn)return;function ke(Xr){(Xr.key==="Escape"||Xr.key==="Esc")&&ef(Xr)}return document.addEventListener("keydown",ke),()=>{document.removeEventListener("keydown",ke)}},[ef,bn]);const ZO=Ur(Ke.ref,JO,zo,r);!rt&&rt!==0&&(bn=!1);const eg=S.useRef(),e_=ke=>{const Xr=Ke.props;Xr.onMouseMove&&Xr.onMouseMove(ke),Rc={x:ke.clientX,y:ke.clientY},eg.current&&eg.current.update()},hc={},tg=typeof rt=="string";N?(hc.title=!bn&&tg&&!I?rt:null,hc["aria-describedby"]=bn?fc:null):(hc["aria-label"]=tg?rt:null,hc["aria-labelledby"]=bn&&!tg?fc:null);const jn=_({},hc,De,Ke.props,{className:Ce(De.className,Ke.props.className),onTouchStart:Dx,ref:ZO},P?{onMouseMove:e_}:{}),mc={};j||(jn.onTouchStart=XO,jn.onTouchEnd=QO),I||(jn.onMouseOver=Tf($x,jn.onMouseOver),jn.onMouseLeave=Tf(Hx,jn.onMouseLeave),Vn||(mc.onMouseOver=$x,mc.onMouseLeave=Hx)),F||(jn.onFocus=Tf(Ix,jn.onFocus),jn.onBlur=Tf(Lx,jn.onBlur),Vn||(mc.onFocus=Ix,mc.onBlur=Lx));const t_=S.useMemo(()=>{var ke;let Xr=[{name:"arrow",enabled:!!Pt,options:{element:Pt,padding:4}}];return(ke=Me.popperOptions)!=null&&ke.modifiers&&(Xr=Xr.concat(Me.popperOptions.modifiers)),_({},Me.popperOptions,{modifiers:Xr})},[Pt,Me]),gc=_({},w,{isRtl:Gr,arrow:E,disableInteractive:Vn,placement:de,PopperComponentProp:me,touch:vn.current}),rg=bX(gc),Bx=(n=(o=ft.popper)!=null?o:C.Popper)!=null?n:xX,Fx=(i=(s=(a=ft.transition)!=null?a:C.Transition)!=null?s:Or)!=null?i:sv,Vx=(l=(c=ft.tooltip)!=null?c:C.Tooltip)!=null?l:kX,jx=(u=(d=ft.arrow)!=null?d:C.Arrow)!=null?u:wX,r_=uu(Bx,_({},Me,(f=Se.popper)!=null?f:M.popper,{className:Ce(rg.popper,Me==null?void 0:Me.className,(p=(h=Se.popper)!=null?h:M.popper)==null?void 0:p.className)}),gc),n_=uu(Fx,_({},he,(m=Se.transition)!=null?m:M.transition),gc),o_=uu(Vx,_({},(b=Se.tooltip)!=null?b:M.tooltip,{className:Ce(rg.tooltip,(v=(g=Se.tooltip)!=null?g:M.tooltip)==null?void 0:v.className)}),gc),i_=uu(jx,_({},(y=Se.arrow)!=null?y:M.arrow,{className:Ce(rg.arrow,(x=(k=Se.arrow)!=null?k:M.arrow)==null?void 0:x.className)}),gc);return O.jsxs(S.Fragment,{children:[S.cloneElement(Ke,jn),O.jsx(Bx,_({as:me??zb,placement:de,anchorEl:P?{getBoundingClientRect:()=>({top:Rc.y,left:Rc.x,right:Rc.x,bottom:Rc.y,width:0,height:0})}:nr,popperRef:eg,open:nr?bn:!1,id:fc,transition:!0},mc,r_,{popperOptions:t_,children:({TransitionProps:ke})=>O.jsx(Fx,_({timeout:Fn.transitions.duration.shorter},ke,n_,{children:O.jsxs(Vx,_({},o_,{children:[rt,E?O.jsx(jx,_({},i_,{ref:Yr})):null]}))}))}))]})}),A3=SX;function EX(e){return Vt("MuiToggleButton",e)}const CX=jt("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge"]),$S=CX,MX=["children","className","color","disabled","disableFocusRipple","fullWidth","onChange","onClick","selected","size","value"],TX=e=>{const{classes:t,fullWidth:r,selected:n,disabled:o,size:i,color:s}=e,a={root:["root",n&&"selected",o&&"disabled",r&&"fullWidth",`size${Fe(i)}`,s]};return rr(a,EX,t)},OX=Xe(Mb,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`size${Fe(r.size)}`]]}})(({theme:e,ownerState:t})=>{let r=t.color==="standard"?e.palette.text.primary:e.palette[t.color].main,n;return e.vars&&(r=t.color==="standard"?e.vars.palette.text.primary:e.vars.palette[t.color].main,n=t.color==="standard"?e.vars.palette.text.primaryChannel:e.vars.palette[t.color].mainChannel),_({},e.typography.button,{borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active},t.fullWidth&&{width:"100%"},{[`&.${$S.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Lr(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${$S.selected}`]:{color:r,backgroundColor:e.vars?`rgba(${n} / ${e.vars.palette.action.selectedOpacity})`:Lr(r,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${n} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Lr(r,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${n} / ${e.vars.palette.action.selectedOpacity})`:Lr(r,e.palette.action.selectedOpacity)}}}},t.size==="small"&&{padding:7,fontSize:e.typography.pxToRem(13)},t.size==="large"&&{padding:15,fontSize:e.typography.pxToRem(15)})}),_X=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiToggleButton"}),{children:o,className:i,color:s="standard",disabled:a=!1,disableFocusRipple:l=!1,fullWidth:c=!1,onChange:u,onClick:d,selected:f,size:p="medium",value:h}=n,m=ve(n,MX),b=_({},n,{color:s,disabled:a,disableFocusRipple:l,fullWidth:c,size:p}),v=TX(b),g=y=>{d&&(d(y,h),y.defaultPrevented)||u&&u(y,h)};return O.jsx(OX,_({className:Ce(v.root,i),disabled:a,focusRipple:!l,ref:r,onClick:g,onChange:u,value:h,ownerState:b,"aria-pressed":f},m,{children:o}))}),AX=_X;var NX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 15v2c0 1.054.95 2 2 2h3v2H7a4 4 0 0 1-4-4v-2h2zm13-5l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16 10h2zm-1 2.885L15.753 16h2.492L17 12.885zM3 3h6a3 3 0 0 1 2.235 5A3 3 0 0 1 9 13H3V3zm6 6H5v2h4a1 1 0 0 0 0-2zm8-6a4 4 0 0 1 4 4v2h-2V7a2 2 0 0 0-2-2h-3V3h3zM9 5H5v2h4a1 1 0 1 0 0-2z"}}],RX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"}}],PX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"}}],zX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0zm-8.66 16h15.588L12 5.5 4.206 19zM11 16h2v2h-2v-2zm0-7h2v5h-2V9z"}}],LX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 19h18v2H3v-2zm5-6h3l-4 4-4-4h3V3h2v10zm10 0h3l-4 4-4-4h3V3h2v10z"}}],IX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm2 15h14v2H5v-2zm-2-5h18v2H3v-2zm2-5h14v2H5V9z"}}],DX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h18v2H3v-2zm0-5h18v2H3v-2zm0-5h18v2H3V9z"}}],$X=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h14v2H3v-2zm0-5h18v2H3v-2zm0-5h14v2H3V9z"}}],HX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm4 15h14v2H7v-2zm-4-5h18v2H3v-2zm4-5h14v2H7V9z"}}],BX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 3h18v2H3V3zm5 8v10H6V11H3l4-4 4 4H8zm10 0v10h-2V11h-3l4-4 4 4h-3z"}}],FX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 11h18v2H3v-2zm15 7v3h-2v-3h-3l4-4 4 4h-3zM8 18v3H6v-3H3l4-4 4 4H8zM18 6h3l-4 4-4-4h3V3h2v3zM8 6h3l-4 4-4-4h3V3h2v3z"}}],VX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M6.75 2.5A4.25 4.25 0 0 1 11 6.75V11H6.75a4.25 4.25 0 1 1 0-8.5zM9 9V6.75A2.25 2.25 0 1 0 6.75 9H9zm-2.25 4H11v4.25A4.25 4.25 0 1 1 6.75 13zm0 2A2.25 2.25 0 1 0 9 17.25V15H6.75zm10.5-12.5a4.25 4.25 0 1 1 0 8.5H13V6.75a4.25 4.25 0 0 1 4.25-4.25zm0 6.5A2.25 2.25 0 1 0 15 6.75V9h2.25zM13 13h4.25A4.25 4.25 0 1 1 13 17.25V13zm2 2v2.25A2.25 2.25 0 1 0 17.25 15H15z"}}],jX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 16l-6-6h12z"}}],UX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 7v4L2 6l6-5v4h5a8 8 0 1 1 0 16H4v-2h9a6 6 0 1 0 0-12H8z"}}],WX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 7h-5a6 6 0 1 0 0 12h9v2h-9a8 8 0 1 1 0-16h5V1l6 5-6 5V7z"}}],KX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 12l6-6v12z"}}],qX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 12l-6 6V6z"}}],GX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 8l6 6H6z"}}],YX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 3v7.267l6.294-3.633 1 1.732-6.293 3.633 6.293 3.635-1 1.732L13 13.732V21h-2v-7.268l-6.294 3.634-1-1.732L9.999 12 3.706 8.366l1-1.732L11 10.267V3z"}}],JX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14.828 7.757l-5.656 5.657a1 1 0 1 0 1.414 1.414l5.657-5.656A3 3 0 1 0 12 4.929l-5.657 5.657a5 5 0 1 0 7.071 7.07L19.071 12l1.414 1.414-5.657 5.657a7 7 0 1 1-9.9-9.9l5.658-5.656a5 5 0 0 1 7.07 7.07L12 16.244A3 3 0 1 1 7.757 12l5.657-5.657 1.414 1.414z"}}],XX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 11h4.5a2.5 2.5 0 1 0 0-5H8v5zm10 4.5a4.5 4.5 0 0 1-4.5 4.5H6V4h6.5a4.5 4.5 0 0 1 3.256 7.606A4.498 4.498 0 0 1 18 15.5zM8 13v5h5.5a2.5 2.5 0 1 0 0-5H8z"}}],QX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12 2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3zm16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5z"}}],ZX=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M14 3c.552 0 1 .448 1 1v5h5c.552 0 1 .448 1 1v10c0 .552-.448 1-1 1H10c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h10zm-1 2H5v8h8V5z"}}],eQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M11 3c.552 0 1 .448 1 1v2h5c.552 0 1 .448 1 1v5h2c.552 0 1 .448 1 1v7c0 .552-.448 1-1 1h-7c-.552 0-1-.448-1-1v-2H7c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h7zm5 5H8v8h8V8z"}}],tQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 3v2H4v13.385L5.763 17H20v-7h2v8a1 1 0 0 1-1 1H6.455L2 22.5V4a1 1 0 0 1 1-1h11zm5 0V0h2v3h3v2h-3v3h-2V5h-3V3h3z"}}],rQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-.997-4L6.76 11.757l1.414-1.414 2.829 2.829 5.656-5.657 1.415 1.414L11.003 16z"}}],nQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M7 7V3a1 1 0 0 1 1-1h13a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-4v3.993c0 .556-.449 1.007-1.007 1.007H3.007A1.006 1.006 0 0 1 2 20.993l.003-12.986C2.003 7.451 2.452 7 3.01 7H7zm2 0h6.993C16.549 7 17 7.449 17 8.007V15h3V4H9v3zm6 2H4.003L4 20h11V9zm-6.497 9l-3.536-3.536 1.414-1.414 2.122 2.122 4.242-4.243 1.414 1.414L8.503 18z"}}],oQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M6 4v4h12V4h2.007c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.994.994 0 0 1 3 21.007V4.993C3 4.445 3.445 4 3.993 4H6zm2-2h8v4H8V2z"}}],iQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 4V2h10v2h3.007c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.994.994 0 0 1 3 21.007V4.993C3 4.445 3.445 4 3.993 4H7zm0 2H5v14h14V6h-2v2H7V6zm2-2v2h6V4H9z"}}],sQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm0-9.414l2.828-2.829 1.415 1.415L13.414 12l2.829 2.828-1.415 1.415L12 13.414l-2.828 2.829-1.415-1.415L10.586 12 7.757 9.172l1.415-1.415L12 10.586z"}}],aQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"}}],lQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"}}],cQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M23 12l-7.071 7.071-1.414-1.414L20.172 12l-5.657-5.657 1.414-1.414L23 12zM3.828 12l5.657 5.657-1.414 1.414L1 12l7.071-7.071 1.414 1.414L3.828 12z"}}],uQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16.95 8.464l1.414-1.414 4.95 4.95-4.95 4.95-1.414-1.414L20.485 12 16.95 8.464zm-9.9 0L3.515 12l3.535 3.536-1.414 1.414L.686 12l4.95-4.95L7.05 8.464z"}}],dQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 6h5v2h-2v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V8H2V6h5V3a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v3zm-8 5v6h2v-6H9zm4 0v6h2v-6h-2zM9 4v2h6V4H9z"}}],fQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 6h5v2h-2v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V8H2V6h5V3a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v3zm1 2H6v12h12V8zm-9 3h2v6H9v-6zm4 0h2v6h-2v-6zM9 4v2h6V4H9z"}}],pQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M12 3c.552 0 1 .448 1 1v8c.835-.628 1.874-1 3-1 2.761 0 5 2.239 5 5s-2.239 5-5 5c-1.032 0-1.99-.313-2.787-.848L13 20c0 .552-.448 1-1 1H6c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zm-1 2H7v14h4V5zm8 10h-6v2h6v-2z"}}],hQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 5c.552 0 1 .448 1 1v6c0 .552-.448 1-1 1 .628.835 1 1.874 1 3 0 2.761-2.239 5-5 5s-5-2.239-5-5c0-1.126.372-2.165 1-3H4c-.552 0-1-.448-1-1V6c0-.552.448-1 1-1h16zm-7 10v2h6v-2h-6zm6-8H5v4h14V7z"}}],mQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4.583 17.321C3.553 16.227 3 15 3 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 0 1-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179zm10 0C13.553 16.227 13 15 13 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 0 1-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179z"}}],gQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19.417 6.679C20.447 7.773 21 9 21 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311-1.804-.167-3.226-1.648-3.226-3.489a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179zm-10 0C10.447 7.773 11 9 11 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311C4.591 12.322 3.17 10.841 3.17 9a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179z"}}],vQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 19h16v-7h2v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-8h2v7zM14 9h5l-7 7-7-7h5V3h4v6z"}}],yQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M16 13l6.964 4.062-2.973.85 2.125 3.681-1.732 1-2.125-3.68-2.223 2.15L16 13zm-2-7h2v2h5a1 1 0 0 1 1 1v4h-2v-3H10v10h4v2H9a1 1 0 0 1-1-1v-5H6v-2h2V9a1 1 0 0 1 1-1h5V6zM4 14v2H2v-2h2zm0-4v2H2v-2h2zm0-4v2H2V6h2zm0-4v2H2V2h2zm4 0v2H6V2h2zm4 0v2h-2V2h2zm4 0v2h-2V2h2z"}}],bQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 19a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm-5.5 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm11 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zM13 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.621 6.302 14.685 14.685 0 0 0 5.327 3.042l-.536 1.93A16.685 16.685 0 0 1 12 13.726a16.696 16.696 0 0 1-6.202 3.547l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042 18.077 18.077 0 0 1-2.822-4.3h2.24A16.031 16.031 0 0 0 12 10.876a16.168 16.168 0 0 0 2.91-4.876L5 6V4h6V2h2z"}}],xQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 19a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm-5.5 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm11 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zM18 3v2H8v4h9v2H8v4h10v2H6V3h12z"}}],kQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 10h2v.757a4.5 4.5 0 0 1 7 3.743V20h-2v-5.5c0-1.43-1.175-2.5-2.5-2.5S16 13.07 16 14.5V20h-2V10zm-2-6v2H4v5h8v2H4v5h8v2H2V4h10z"}}],wQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-1-5h2v2h-2v-2zm0-8h2v6h-2V7z"}}],SQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6zm11-3v9l-3.794-3.793-5.999 6-1.414-1.414 5.999-6L12 3h9z"}}],EQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1.001 1.001 0 0 1 3 21l.003-14c0-.552.45-1 1.007-1H7zM5.003 8L5 20h10V8H5.003zM9 6h8v10h2V4H9v2z"}}],CQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M6 21.5c-1.933 0-3.5-1.567-3.5-3.5s1.567-3.5 3.5-3.5c1.585 0 2.924 1.054 3.355 2.5H15v-2h2V9.242L14.757 7H9V9H3V3h6v2h5.757L18 1.756 22.243 6 19 9.241V15L21 15v6h-6v-2H9.355c-.43 1.446-1.77 2.5-3.355 2.5zm0-5c-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5-.672-1.5-1.5-1.5zm13 .5h-2v2h2v-2zM18 4.586L16.586 6 18 7.414 19.414 6 18 4.586zM7 5H5v2h2V5z"}}],MQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15.246 14H8.754l-1.6 4H5l6-15h2l6 15h-2.154l-1.6-4zm-.8-2L12 5.885 9.554 12h4.892zM3 20h18v2H3v-2z"}}],TQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M10 6v15H8V6H2V4h14v2h-6zm8 8v7h-2v-7h-3v-2h8v2h-3z"}}],OQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11.246 15H4.754l-2 5H.6L7 4h2l6.4 16h-2.154l-2-5zm-.8-2L8 6.885 5.554 13h4.892zM21 12.535V12h2v8h-2v-.535a4 4 0 1 1 0-6.93zM19 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"}}],_Q=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12.651 14.065L11.605 20H9.574l1.35-7.661-7.41-7.41L4.93 3.515 20.485 19.07l-1.414 1.414-6.42-6.42zm-.878-6.535l.27-1.53h-1.8l-2-2H20v2h-5.927L13.5 9.257 11.773 7.53z"}}],AQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z"}}],NQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 3h2v6h-2V5h-4V3h4zM4 3h4v2H4v4H2V3h2zm16 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z"}}],RQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 18l7.68-6L5 6V4h14v2H8.263L16 12l-7.737 6H19v2H5v-2z"}}],PQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 1v4H4v14h16V3h1.008c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3H6V1h2zm4 7l4 4h-3v4h-2v-4H8l4-4zm6-7v4h-8V3h6V1h2z"}}],zQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M13 20h-2v-7H4v7H2V4h2v7h7V4h2v16zm8-12v12h-2v-9.796l-2 .536V8.67L19.5 8H21z"}}],LQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M4 4v7h7V4h2v16h-2v-7H4v7H2V4h2zm14.5 4c2.071 0 3.75 1.679 3.75 3.75 0 .857-.288 1.648-.772 2.28l-.148.18L18.034 18H22v2h-7v-1.556l4.82-5.546c.268-.307.43-.709.43-1.148 0-.966-.784-1.75-1.75-1.75-.918 0-1.671.707-1.744 1.606l-.006.144h-2C14.75 9.679 16.429 8 18.5 8z"}}],IQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M22 8l-.002 2-2.505 2.883c1.59.435 2.757 1.89 2.757 3.617 0 2.071-1.679 3.75-3.75 3.75-1.826 0-3.347-1.305-3.682-3.033l1.964-.382c.156.806.866 1.415 1.718 1.415.966 0 1.75-.784 1.75-1.75s-.784-1.75-1.75-1.75c-.286 0-.556.069-.794.19l-1.307-1.547L19.35 10H15V8h7zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2z"}}],DQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M13 20h-2v-7H4v7H2V4h2v7h7V4h2v16zm9-12v8h1.5v2H22v2h-2v-2h-5.5v-1.34l5-8.66H22zm-2 3.133L17.19 16H20v-4.867z"}}],$Q=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M22 8v2h-4.323l-.464 2.636c.33-.089.678-.136 1.037-.136 2.21 0 4 1.79 4 4s-1.79 4-4 4c-1.827 0-3.367-1.224-3.846-2.897l1.923-.551c.24.836 1.01 1.448 1.923 1.448 1.105 0 2-.895 2-2s-.895-2-2-2c-.63 0-1.193.292-1.56.748l-1.81-.904L16 8h6zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2z"}}],HQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M21.097 8l-2.598 4.5c2.21 0 4.001 1.79 4.001 4s-1.79 4-4 4-4-1.79-4-4c0-.736.199-1.426.546-2.019L18.788 8h2.309zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2zm14.5 10.5c-1.105 0-2 .895-2 2s.895 2 2 2 2-.895 2-2-.895-2-2-2z"}}],BQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7.784 14l.42-4H4V8h4.415l.525-5h2.011l-.525 5h3.989l.525-5h2.011l-.525 5H20v2h-3.784l-.42 4H20v2h-4.415l-.525 5h-2.011l.525-5H9.585l-.525 5H7.049l.525-5H4v-2h3.784zm2.011 0h3.99l.42-4h-3.99l-.42 4z"}}],FQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 11V4h2v17h-2v-8H7v8H5V4h2v7z"}}],VQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 15v3h3v2h-3v3h-2v-3h-3v-2h3v-3h2zm.008-12c.548 0 .992.445.992.993V13h-2V5H4v13.999L14 9l3 3v2.829l-3-3L6.827 19H14v2H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016zM8 7a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"}}],jQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v1.757l-2 2V5H5v8.1l4-4 4.328 4.329-1.415 1.413L9 11.93l-4 3.999V19h10.533l.708.001 1.329-1.33L18.9 19h.1v-2.758l2-2V20c0 .552-.448 1-1 1H4c-.55 0-1-.45-1-1V4c0-.552.448-1 1-1h16zm1.778 4.808l1.414 1.414L15.414 17l-1.416-.002.002-1.412 7.778-7.778zM15.5 7c.828 0 1.5.672 1.5 1.5s-.672 1.5-1.5 1.5S14 9.328 14 8.5 14.672 7 15.5 7z"}}],UQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4.828 21l-.02.02-.021-.02H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H4.828zM20 15V5H4v14L14 9l6 6zm0 2.828l-6-6L6.828 19H20v-1.172zM8 11a2 2 0 1 1 0-4 2 2 0 0 1 0 4z"}}],WQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h18v2H3v-2zm8-5h10v2H11v-2zm0-5h10v2H11V9zm-8 3.5L7 9v7l-4-3.5z"}}],KQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h18v2H3v-2zm8-5h10v2H11v-2zm0-5h10v2H11V9zm-4 3.5L3 16V9l4 3.5z"}}],qQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM11 7h2v2h-2V7zm0 4h2v6h-2v-6z"}}],GQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 21v-2h3V5H8V3h8v2h-3v14h3v2H8zM18.05 7.05L23 12l-4.95 4.95-1.414-1.414L20.172 12l-3.536-3.536L18.05 7.05zm-12.1 0l1.414 1.414L3.828 12l3.536 3.536L5.95 16.95 1 12l4.95-4.95z"}}],YQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zm-1 2h-4v14h4V5zM6 7c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2H5v1.999L3 11v2l2-.001V15h2v-2.001L9 13v-2l-2-.001V9z"}}],JQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M10 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zM9 5H5v14h4V5zm9 2c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2h-2v1.999L15 11v2l2-.001V15h2v-2.001L21 13v-2l-2-.001V9z"}}],XQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M12 13c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2h-2v1.999L9 17v2l2-.001V21h2v-2.001L15 19v-2l-2-.001V15zm7-12c.552 0 1 .448 1 1v6c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zM5 5v4h14V5H5z"}}],QQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 13c.552 0 1 .448 1 1v6c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1v-6c0-.552.448-1 1-1h16zm-1 2H5v4h14v-4zM12 1c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2h-2v1.999L9 5v2l2-.001V9h2V6.999L15 7V5l-2-.001V3z"}}],ZQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 20H7v-2h2.927l2.116-12H9V4h8v2h-2.927l-2.116 12H15z"}}],eZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M11 5H5v14h6V5zm2 0v14h6V5h-6zM4 3h16a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"}}],tZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 4h10v2H11V4zM6 7v4H4V7H1l4-4 4 4H6zm0 10h3l-4 4-4-4h3v-4h2v4zm5 1h10v2H11v-2zm-2-7h12v2H9v-2z"}}],rZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.657 14.828l-1.414-1.414L17.657 12A4 4 0 1 0 12 6.343l-1.414 1.414-1.414-1.414 1.414-1.414a6 6 0 0 1 8.485 8.485l-1.414 1.414zm-2.829 2.829l-1.414 1.414a6 6 0 1 1-8.485-8.485l1.414-1.414 1.414 1.414L6.343 12A4 4 0 1 0 12 17.657l1.414-1.414 1.414 1.414zm0-9.9l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"}}],nZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.657 14.828l-1.414-1.414L17.657 12A4 4 0 1 0 12 6.343l-1.414 1.414-1.414-1.414 1.414-1.414a6 6 0 0 1 8.485 8.485l-1.414 1.414zm-2.829 2.829l-1.414 1.414a6 6 0 1 1-8.485-8.485l1.414-1.414 1.414 1.414L6.343 12A4 4 0 1 0 12 17.657l1.414-1.414 1.414 1.414zm0-9.9l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07zM5.775 2.293l1.932-.518L8.742 5.64l-1.931.518-1.036-3.864zm9.483 16.068l1.931-.518 1.036 3.864-1.932.518-1.035-3.864zM2.293 5.775l3.864 1.036-.518 1.931-3.864-1.035.518-1.932zm16.068 9.483l3.864 1.035-.518 1.932-3.864-1.036.518-1.931z"}}],oZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 17h5v2h-3v3h-2v-5zM7 7H2V5h3V2h2v5zm11.364 8.536L16.95 14.12l1.414-1.414a5 5 0 1 0-7.071-7.071L9.879 7.05 8.464 5.636 9.88 4.222a7 7 0 0 1 9.9 9.9l-1.415 1.414zm-2.828 2.828l-1.415 1.414a7 7 0 0 1-9.9-9.9l1.415-1.414L7.05 9.88l-1.414 1.414a5 5 0 1 0 7.071 7.071l1.414-1.414 1.415 1.414zm-.708-10.607l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"}}],iZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18.364 15.536L16.95 14.12l1.414-1.414a5 5 0 1 0-7.071-7.071L9.879 7.05 8.464 5.636 9.88 4.222a7 7 0 0 1 9.9 9.9l-1.415 1.414zm-2.828 2.828l-1.415 1.414a7 7 0 0 1-9.9-9.9l1.415-1.414L7.05 9.88l-1.414 1.414a5 5 0 1 0 7.071 7.071l1.414-1.414 1.415 1.414zm-.708-10.607l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"}}],sZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 4h10v2H11V4zm0 4h6v2h-6V8zm0 6h10v2H11v-2zm0 4h6v2h-6v-2zM3 4h6v6H3V4zm2 2v2h2V6H5zm-2 8h6v6H3v-6zm2 2v2h2v-2H5z"}}],aZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 4h13v2H8V4zm-5-.5h3v3H3v-3zm0 7h3v3H3v-3zm0 7h3v3H3v-3zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"}}],lZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 4h13v2H8V4zM5 3v3h1v1H3V6h1V4H3V3h2zM3 14v-2.5h2V11H3v-1h3v2.5H4v.5h2v1H3zm2 5.5H3v-1h2V18H3v-1h3v4H3v-1h2v-.5zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"}}],cZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 4h13v2H8V4zM4.5 6.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 6.9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"}}],uZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15.243 4.515l-6.738 6.737-.707 2.121-1.04 1.041 2.828 2.829 1.04-1.041 2.122-.707 6.737-6.738-4.242-4.242zm6.364 3.535a1 1 0 0 1 0 1.414l-7.779 7.779-2.12.707-1.415 1.414a1 1 0 0 1-1.414 0l-4.243-4.243a1 1 0 0 1 0-1.414l1.414-1.414.707-2.121 7.779-7.779a1 1 0 0 1 1.414 0l5.657 5.657zm-6.364-.707l1.414 1.414-4.95 4.95-1.414-1.414 4.95-4.95zM4.283 16.89l2.828 2.829-1.414 1.414-4.243-1.414 2.828-2.829z"}}],dZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm4 12.5v-4l2 2 2-2v4h2v-7h-2l-2 2-2-2H5v7h2zm11-3v-4h-2v4h-2l3 3 3-3h-2z"}}],fZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm1 2v14h16V5H4zm3 10.5H5v-7h2l2 2 2-2h2v7h-2v-4l-2 2-2-2v4zm11-3h2l-3 3-3-3h2v-4h2v4z"}}],pZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zm-9 2H5v5.999h2V9l3 3-3 3v-2H5v6h6v-2h2v2h6v-6h-2v2l-3-3 3-3v1.999h2V5h-6v2h-2V5zm2 8v2h-2v-2h2zm0-4v2h-2V9h2z"}}],hZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M21 20c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16c.552 0 1 .448 1 1v16zm-2-9V5h-5.999v2H15l-3 3-3-3h2V5H5v6h2v2H5v6h6v-2H9l3-3 3 3h-1.999v2H19v-6h-2v-2h2zm-8 2H9v-2h2v2zm4 0h-2v-2h2v2z"}}],mZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M18 3c1.657 0 3 1.343 3 3s-1.343 3-3 3h-3c-1.306 0-2.417-.834-2.829-2H11c-1.1 0-2 .9-2 2v.171c1.166.412 2 1.523 2 2.829 0 1.306-.834 2.417-2 2.829V15c0 1.1.9 2 2 2h1.17c.412-1.165 1.524-2 2.83-2h3c1.657 0 3 1.343 3 3s-1.343 3-3 3h-3c-1.306 0-2.417-.834-2.829-2H11c-2.21 0-4-1.79-4-4H5c-1.657 0-3-1.343-3-3s1.343-3 3-3h2c0-2.21 1.79-4 4-4h1.17c.412-1.165 1.524-2 2.83-2h3zm0 14h-3c-.552 0-1 .448-1 1s.448 1 1 1h3c.552 0 1-.448 1-1s-.448-1-1-1zM8 11H5c-.552 0-1 .448-1 1s.448 1 1 1h3c.552 0 1-.448 1-1s-.448-1-1-1zm10-6h-3c-.552 0-1 .448-1 1s.448 1 1 1h3c.552 0 1-.448 1-1s-.448-1-1-1z"}}],gZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm14 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-7 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}}],vZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M10 2c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1H8v2h5V9c0-.552.448-1 1-1h6c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1v-1H8v6h5v-1c0-.552.448-1 1-1h6c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1v-1H7c-.552 0-1-.448-1-1V8H4c-.552 0-1-.448-1-1V3c0-.552.448-1 1-1h6zm9 16h-4v2h4v-2zm0-8h-4v2h4v-2zM9 4H5v2h4V4z"}}],yZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 1.5c1.321 0 2.484.348 3.447.994.963.645 1.726 1.588 2.249 2.778.522 1.19.804 2.625.804 4.257v4.942c0 1.632-.282 3.068-.804 4.257-.523 1.19-1.286 2.133-2.25 2.778-.962.646-2.125.994-3.446.994-1.321 0-2.484-.348-3.447-.994-.963-.645-1.726-1.588-2.249-2.778-.522-1.19-.804-2.625-.804-4.257V9.529c0-1.632.282-3.068.804-4.257.523-1.19 1.286-2.133 2.25-2.778C9.515 1.848 10.678 1.5 12 1.5zm0 2c-.916 0-1.694.226-2.333.655-.637.427-1.158 1.07-1.532 1.92-.412.94-.635 2.108-.635 3.454v4.942c0 1.346.223 2.514.635 3.453.374.851.895 1.494 1.532 1.921.639.429 1.417.655 2.333.655.916 0 1.694-.226 2.333-.655.637-.427 1.158-1.07 1.532-1.92.412-.94.635-2.108.635-3.454V9.529c0-1.346-.223-2.514-.635-3.453-.374-.851-.895-1.494-1.532-1.921C13.694 3.726 12.916 3.5 12 3.5z"}}],bZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 1.5V22h-2V3.704L7.5 4.91V2.839l5-1.339z"}}],xZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 7.5a4 4 0 1 0-8 0H6a6 6 0 1 1 10.663 3.776l-7.32 8.723L18 20v2H6v-1.127l9.064-10.802A3.982 3.982 0 0 0 16 7.5z"}}],kZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18 2v1.362L12.809 9.55a6.501 6.501 0 1 1-7.116 8.028l1.94-.486A4.502 4.502 0 0 0 16.5 16a4.5 4.5 0 0 0-6.505-4.03l-.228.122-.69-1.207L14.855 4 6.5 4V2H18z"}}],wZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 1.5V16h3v2h-3v4h-2v-4H4v-1.102L14 1.5h2zM14 16V5.171L6.968 16H14z"}}],SZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18 2v2H9.3l-.677 6.445a6.5 6.5 0 1 1-2.93 7.133l1.94-.486A4.502 4.502 0 0 0 16.5 16a4.5 4.5 0 0 0-4.5-4.5c-2.022 0-3.278.639-3.96 1.53l-1.575-1.182L7.5 2H18z"}}],EZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14.886 2l-4.438 7.686A6.5 6.5 0 1 1 6.4 12.7L12.576 2h2.31zM12 11.5a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9z"}}],CZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 2v1.5L10.763 22H8.574l8.013-18H6V2z"}}],MZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 1.5a5.5 5.5 0 0 1 3.352 9.86C17.24 12.41 18.5 14.32 18.5 16.5c0 3.314-2.91 6-6.5 6s-6.5-2.686-6.5-6c0-2.181 1.261-4.09 3.147-5.141A5.5 5.5 0 0 1 12 1.5zm0 11c-2.52 0-4.5 1.828-4.5 4 0 2.172 1.98 4 4.5 4s4.5-1.828 4.5-4c0-2.172-1.98-4-4.5-4zm0-9a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7z"}}],TZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 1.5a6.5 6.5 0 0 1 5.619 9.77l-6.196 10.729H9.114l4.439-7.686A6.5 6.5 0 1 1 12 1.5zm0 2a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9z"}}],OZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M14 20v-2.157c1.863-1.192 3.5-3.875 3.5-6.959 0-3.073-2-6.029-5.5-6.029s-5.5 2.956-5.5 6.03c0 3.083 1.637 5.766 3.5 6.958V20H3v-2h4.76C5.666 16.505 4 13.989 4 10.884 4 6.247 7.5 3 12 3s8 3.247 8 7.884c0 3.105-1.666 5.621-3.76 7.116H21v2h-7z"}}],_Z=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M15 3c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-2v2h4c.552 0 1 .448 1 1v3h2c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1v-4c0-.552.448-1 1-1h2v-2H8v2h2c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1v-4c0-.552.448-1 1-1h2v-3c0-.552.448-1 1-1h4V9H9c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zM9 17H5v2h4v-2zm10 0h-4v2h4v-2zM14 5h-4v2h4V5z"}}],AZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 21v-4H7v4H5v-5a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v5h-2zM7 3v4h10V3h2v5a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V3h2zM2 9l4 3-4 3V9zm20 0v6l-4-3 4-3z"}}],NZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 6v15h-2v-5a6 6 0 1 1 0-12h10v2h-3v15h-2V6h-3zm-2 0a4 4 0 1 0 0 8V6z"}}],RZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12.9 6.858l4.242 4.243L7.242 21H3v-4.243l9.9-9.9zm1.414-1.414l2.121-2.122a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414l-2.122 2.121-4.242-4.242z"}}],PZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15.728 9.686l-1.414-1.414L5 17.586V19h1.414l9.314-9.314zm1.414-1.414l1.414-1.414-1.414-1.414-1.414 1.414 1.414 1.414zM7.242 21H3v-4.243L16.435 3.322a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414L7.243 21z"}}],zZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.934 3.036l1.732 1L18.531 6H21v2h-2v4h2v2h-2v7h-2v-7h-3.084c-.325 2.862-1.564 5.394-3.37 7.193l-1.562-1.27c1.52-1.438 2.596-3.522 2.917-5.922L10 14v-2l2-.001V8h-2V6h2.467l-1.133-1.964 1.732-1L14.777 6h1.444l1.713-2.964zM5 13.803l-2 .536v-2.071l2-.536V8H3V6h2V3h2v3h2v2H7v3.197l2-.536v2.07l-2 .536V18.5A2.5 2.5 0 0 1 4.5 21H3v-2h1.5a.5.5 0 0 0 .492-.41L5 18.5v-4.697zM17 8h-3v4h3V8z"}}],LZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M12 19c.828 0 1.5.672 1.5 1.5S12.828 22 12 22s-1.5-.672-1.5-1.5.672-1.5 1.5-1.5zm0-17c3.314 0 6 2.686 6 6 0 2.165-.753 3.29-2.674 4.923C13.399 14.56 13 15.297 13 17h-2c0-2.474.787-3.695 3.031-5.601C15.548 10.11 16 9.434 16 8c0-2.21-1.79-4-4-4S8 5.79 8 8v1H6V8c0-3.314 2.686-6 6-6z"}}],IZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M21 19v2h-2v-2h2zm-4 0v2h-2v-2h2zm-4 0v2h-2v-2h2zm-4 0v2H7v-2h2zm-4 0v2H3v-2h2zm16-4v2h-2v-2h2zM5 15v2H3v-2h2zm0-4v2H3v-2h2zm11-8c2.687 0 4.882 2.124 4.995 4.783L21 8v5h-2V8c0-1.591-1.255-2.903-2.824-2.995L16 5h-5V3h5zM5 7v2H3V7h2zm0-4v2H3V3h2zm4 0v2H7V3h2z"}}],DZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M9.683 7.562L12 9.88l6.374-6.375a2 2 0 0 1 2.829 0l.707.707L9.683 16.438a4 4 0 1 1-2.121-2.121L9.88 12 7.562 9.683a4 4 0 1 1 2.121-2.121zM6 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 12a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm9.535-6.587l6.375 6.376-.707.707a2 2 0 0 1-2.829 0l-4.96-4.961 2.12-2.122z"}}],$Z=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M14 3c.552 0 1 .448 1 1v5h5c.552 0 1 .448 1 1v10c0 .552-.448 1-1 1H10c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h10zm-1 2H5v8h4v-3c0-.552.448-1 1-1h3V5z"}}],HZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M11 3c.552 0 1 .448 1 1v2h5c.552 0 1 .448 1 1v5h2c.552 0 1 .448 1 1v7c0 .552-.448 1-1 1h-7c-.552 0-1-.448-1-1v-2H7c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h7zm5 5h-4v3c0 .552-.448 1-1 1H8v4h4v-3c0-.552.448-1 1-1h3V8z"}}],BZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M2 11h2v2H2v-2zm4 0h12v2H6v-2zm14 0h2v2h-2v-2z"}}],FZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M9.583 17.321C8.553 16.227 8 15 8 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 0 1-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179z"}}],VZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14.417 6.679C15.447 7.773 16 9 16 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311C9.591 12.322 8.17 10.841 8.17 9a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179z"}}],jZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M19 3l4 5h-3v12h-2V8h-3l4-5zm-5 15v2H3v-2h11zm0-7v2H3v-2h11zm-2-7v2H3V4h9z"}}],UZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 4v12h3l-4 5-4-5h3V4h2zm-8 14v2H3v-2h9zm2-7v2H3v-2h11zm0-7v2H3V4h11z"}}],WZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 9v4h16V9h2v5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V9h2z"}}],KZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M17.5 2.5L23 12l-5.5 9.5h-11L1 12l5.5-9.5h11zm-1.153 2H7.653L3.311 12l4.342 7.5h8.694l4.342-7.5-4.342-7.5zM11 15h2v2h-2v-2zm0-8h2v6h-2V7z"}}],qZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zm-9 2H5v14h6v-4h2v4h6V5h-6v4h-2V5zm4 4l3 3-3 3v-2H9v2l-3-3 3-3v2h6V9z"}}],GZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zm-1 2H5v5.999L9 11v2H5v6h14v-6h-4v-2l4-.001V5zm-7 1l3 3h-2v6h2l-3 3-3-3h2V9H9l3-3z"}}],YZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 9h-2V6H5V4h14v2h-6v3zm0 6v5h-2v-5h2zM3 11h18v2H3v-2z"}}],JZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.154 14c.23.516.346 1.09.346 1.72 0 1.342-.524 2.392-1.571 3.147C14.88 19.622 13.433 20 11.586 20c-1.64 0-3.263-.381-4.87-1.144V16.6c1.52.877 3.075 1.316 4.666 1.316 2.551 0 3.83-.732 3.839-2.197a2.21 2.21 0 0 0-.648-1.603l-.12-.117H3v-2h18v2h-3.846zm-4.078-3H7.629a4.086 4.086 0 0 1-.481-.522C6.716 9.92 6.5 9.246 6.5 8.452c0-1.236.466-2.287 1.397-3.153C8.83 4.433 10.271 4 12.222 4c1.471 0 2.879.328 4.222.984v2.152c-1.2-.687-2.515-1.03-3.946-1.03-2.48 0-3.719.782-3.719 2.346 0 .42.218.786.654 1.099.436.313.974.562 1.613.75.62.18 1.297.414 2.03.699z"}}],XZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 6v13H9V6H3V4h14v2h-6zm8.55 10.58a.8.8 0 1 0-1.32-.36l-1.154.33A2.001 2.001 0 0 1 19 14a2 2 0 0 1 1.373 3.454L18.744 19H21v1h-4v-1l2.55-2.42z"}}],QZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5.596 4L10.5 9.928 15.404 4H18l-6.202 7.497L18 18.994V19h-2.59l-4.91-5.934L5.59 19H3v-.006l6.202-7.497L3 4h2.596zM21.55 16.58a.8.8 0 1 0-1.32-.36l-1.155.33A2.001 2.001 0 0 1 21 14a2 2 0 0 1 1.373 3.454L20.744 19H23v1h-4v-1l2.55-2.42z"}}],ZZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 11h14v2H5z"}}],eee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 7v13H9V7H3V5h12v2h-4zm8.55-.42a.8.8 0 1 0-1.32-.36l-1.154.33A2.001 2.001 0 0 1 19 4a2 2 0 0 1 1.373 3.454L18.744 9H21v1h-4V9l2.55-2.42z"}}],tee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5.596 5l4.904 5.928L15.404 5H18l-6.202 7.497L18 19.994V20h-2.59l-4.91-5.934L5.59 20H3v-.006l6.202-7.497L3 5h2.596zM21.55 6.58a.8.8 0 1 0-1.32-.36l-1.155.33A2.001 2.001 0 0 1 21 4a2 2 0 0 1 1.373 3.454L20.744 9H23v1h-4V9l2.55-2.42z"}}],ree=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M13 10v4h6v-4h-6zm-2 0H5v4h6v-4zm2 9h6v-3h-6v3zm-2 0v-3H5v3h6zm2-14v3h6V5h-6zm-2 0H5v3h6V5zM4 3h16a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"}}],nee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 8h16V5H4v3zm10 11v-9h-4v9h4zm2 0h4v-9h-4v9zm-8 0v-9H4v9h4zM3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"}}],oee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 5v10H9v-4a4 4 0 1 1 0-8h8v2h-2v10h-2V5h-2zM9 5a2 2 0 1 0 0 4V5zm8 12v-2.5l4 3.5-4 3.5V19H5v-2h12z"}}],iee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 5v10H9v-4a4 4 0 1 1 0-8h8v2h-2v10h-2V5h-2zM9 5a2 2 0 1 0 0 4V5zM7 17h12v2H7v2.5L3 18l4-3.5V17z"}}],see=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 17h10v-2.5l3.5 3.5-3.5 3.5V19H7v2.5L3.5 18 7 14.5V17zm6-11v9h-2V6H5V4h14v2h-6z"}}],aee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 18h1.5a2.5 2.5 0 1 0 0-5H3v-2h13.5a4.5 4.5 0 1 1 0 9H15v2l-4-3 4-3v2zM3 4h18v2H3V4zm6 14v2H3v-2h6z"}}],lee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 6v15h-2V6H5V4h14v2z"}}],cee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301 14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"}}],uee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 15v2a2 2 0 0 0 1.85 1.995L7 19h3v2H7a4 4 0 0 1-4-4v-2h2zm13-5l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16 10h2zm-1 2.885L15.753 16h2.492L17 12.885zM8 2v2h4v7H8v3H6v-3H2V4h4V2h2zm9 1a4 4 0 0 1 4 4v2h-2V7a2 2 0 0 0-2-2h-3V3h3zM6 6H4v3h2V6zm4 0H8v3h2V6z"}}],dee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 3v9a4 4 0 1 0 8 0V3h2v9a6 6 0 1 1-12 0V3h2zM4 20h16v2H4v-2z"}}],fee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 19h16v-7h2v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-8h2v7zM14 9v6h-4V9H5l7-7 7 7h-5z"}}],pee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 3.993C3 3.445 3.445 3 3.993 3h16.014c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.994.994 0 0 1 3 20.007V3.993zM5 5v14h14V5H5zm5.622 3.415l4.879 3.252a.4.4 0 0 1 0 .666l-4.88 3.252a.4.4 0 0 1-.621-.332V8.747a.4.4 0 0 1 .622-.332z"}}],hee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 21v-2h3.662l1.234-7H5v-2h3.249l.881-5H4V3h16v2h-8.839l-.882 5H18v9h3v2H3zm13-9H9.927l-1.235 7H16v-7z"}}];const mee=Object.freeze(Object.defineProperty({__proto__:null,ab:NX,addFill:RX,addLine:PX,alertLine:zX,alignBottom:LX,alignCenter:IX,alignJustify:DX,alignLeft:$X,alignRight:HX,alignTop:BX,alignVertically:FX,appsLine:VX,arrowDownSFill:jX,arrowGoBackFill:UX,arrowGoForwardFill:WX,arrowLeftSFill:KX,arrowRightSFill:qX,arrowUpSFill:GX,asterisk:YX,attachment2:JX,bold:XX,bracesLine:QX,bringForward:ZX,bringToFront:eQ,chatNewLine:tQ,checkboxCircleLine:rQ,checkboxMultipleLine:nQ,clipboardFill:oQ,clipboardLine:iQ,closeCircleLine:sQ,closeFill:aQ,closeLine:lQ,codeLine:cQ,codeView:uQ,deleteBinFill:dQ,deleteBinLine:fQ,deleteColumn:pQ,deleteRow:hQ,doubleQuotesL:mQ,doubleQuotesR:gQ,download2Fill:vQ,dragDropLine:yQ,emphasis:xQ,emphasisCn:bQ,englishInput:kQ,errorWarningLine:wQ,externalLinkFill:SQ,fileCopyLine:EQ,flowChart:CQ,fontColor:MQ,fontSize:OQ,fontSize2:TQ,formatClear:_Q,fullscreenExitLine:AQ,fullscreenLine:NQ,functions:RQ,galleryUploadLine:PQ,h1:zQ,h2:LQ,h3:IQ,h4:DQ,h5:$Q,h6:HQ,hashtag:BQ,heading:FQ,imageAddLine:VQ,imageEditLine:jQ,imageLine:UQ,indentDecrease:WQ,indentIncrease:KQ,informationLine:qQ,inputCursorMove:GQ,insertColumnLeft:YQ,insertColumnRight:JQ,insertRowBottom:XQ,insertRowTop:QQ,italic:ZQ,layoutColumnLine:eZ,lineHeight:tZ,link:iZ,linkM:rZ,linkUnlink:oZ,linkUnlinkM:nZ,listCheck:aZ,listCheck2:sZ,listOrdered:lZ,listUnordered:cZ,markPenLine:uZ,markdownFill:dZ,markdownLine:fZ,mergeCellsHorizontal:pZ,mergeCellsVertical:hZ,mindMap:mZ,moreFill:gZ,nodeTree:vZ,number0:yZ,number1:bZ,number2:xZ,number3:kZ,number4:wZ,number5:SZ,number6:EZ,number7:CZ,number8:MZ,number9:TZ,omega:OZ,organizationChart:_Z,pageSeparator:AZ,paragraph:NZ,pencilFill:RZ,pencilLine:PZ,pinyinInput:zZ,questionMark:LZ,roundedCorner:IZ,scissorsFill:DZ,sendBackward:$Z,sendToBack:HZ,separator:BZ,singleQuotesL:FZ,singleQuotesR:VZ,sortAsc:jZ,sortDesc:UZ,space:WZ,spamLine:KZ,splitCellsHorizontal:qZ,splitCellsVertical:GZ,strikethrough:JZ,strikethrough2:YZ,subscript:QZ,subscript2:XZ,subtractLine:ZZ,superscript:tee,superscript2:eee,table2:ree,tableLine:nee,text:lee,textDirectionL:oee,textDirectionR:iee,textSpacing:see,textWrap:aee,translate:uee,translate2:cee,underline:dee,upload2Fill:fee,videoLine:pee,wubiInput:hee},Symbol.toStringTag,{value:"Module"}));function gee(e,t=null){return function(r,n){let{$from:o,$to:i}=r.selection,s=o.blockRange(i),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(e)&&s.startIndex==0){if(o.index(s.depth-1)==0)return!1;let u=r.doc.resolve(s.start-2);l=new na(u,u,s.depth),s.endIndex=0;u--)i=R.from(r[u].type.create(r[u].attrs,i));e.step(new bt(t.start-(n?2:0),t.end,t.start,t.end,new K(i,0,0),r.length,!0));let s=0;for(let u=0;us.childCount>0&&s.firstChild.type==e);return i?r?n.node(i.depth-1).type==e?bee(t,r,e,i):xee(t,r,i):!0:!1}}function bee(e,t,r,n){let o=e.tr,i=n.end,s=n.$to.end(n.depth);im;h--)p-=o.child(h).nodeSize,n.delete(p-1,p+1);let i=n.doc.resolve(r.start),s=i.nodeAfter;if(n.mapping.map(r.end)!=r.start+i.nodeAfter.nodeSize)return!1;let a=r.startIndex==0,l=r.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?R.empty:R.from(o))))return!1;let d=i.pos,f=d+s.nodeSize;return n.step(new bt(d-(a?1:0),f+(l?1:0),d+1,f-1,new K((a?R.empty:R.from(o.copy(R.empty))).append(l?R.empty:R.from(o.copy(R.empty))),a?0:1,l?0:1),a?0:1)),t(n.scrollIntoView()),!0}var kee=Object.defineProperty,wee=Object.getOwnPropertyDescriptor,Hn=(e,t,r,n)=>{for(var o=n>1?void 0:n?wee(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&kee(t,r,o),o};function av(e){var t;return!!((t=e.spec.group)!=null&&t.includes(oe.ListContainerNode))}function See(e){var t;return!!((t=e.spec.group)!=null&&t.includes(oe.ListItemNode))}function cs(e){return av(e.type)}function Qi(e){return See(e.type)}function Lb(e,t){return r=>{const{dispatch:n,tr:o}=r,i=Vv(o,r.state),{$from:s,$to:a}=o.selection,l=s.blockRange(a);if(!l)return!1;const c=Ld({predicate:u=>av(u.type),selection:o.selection});if(c&&l.depth-c.depth<=1&&l.startIndex===0){if(c.node.type===e)return P3(t)(r);if(av(c.node.type))return e.validContent(c.node.content)?(n==null||n(o.setNodeMarkup(c.pos,e)),!0):Eee(o,c,e,t)?(n==null||n(o.scrollIntoView()),!0):!1}return gee(e)(i,n)}}function N3(e,t=["checked"]){return function({tr:r,dispatch:n,state:o}){var i,s;const a=uz(e,o.schema),{$from:l,$to:c}=r.selection;if(Dd(r.selection)&&r.selection.node.isBlock||l.depth<2||!l.sameParent(c))return!1;const u=l.node(-1);if(u.type!==a)return!1;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(n){const m=l.index(-1)>0;let b=R.empty;for(let y=l.depth-(m?1:2);y>=l.depth-3;y--)b=R.from(l.node(y).copy(b));const v=((i=a.contentMatch.defaultType)==null?void 0:i.createAndFill())||void 0;b=b.append(R.from(a.createAndFill(null,v)||void 0));const g=l.indexAfter(-1)!t.includes(m))),f=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,p={...l.node().attrs};r.delete(l.pos,c.pos);const h=f?[{type:a,attrs:d},{type:f,attrs:p}]:[{type:a,attrs:d}];return dl(r.doc,l.pos,2)?(n&&n(r.split(l.pos,2,h).scrollIntoView()),!0):!1}}function Eee(e,t,r,n){const o=t.node,i=e.doc.resolve(t.start),s=i.node(-1),a=i.index(-1);if(!s||!s.canReplace(a,a+1,R.from(r.create())))return!1;const l=[];for(let p=0;pb;m--)h-=o.child(m).nodeSize,n.delete(h-1,h+1);const s=n.doc.resolve(r.start),a=s.nodeAfter;if(!a||n.mapping.slice(i).map(r.end)!==r.start+a.nodeSize)return!1;const l=r.startIndex===0,c=r.endIndex===o.childCount,u=s.node(-1),d=s.index(-1);if(!u.canReplace(d+(l?0:1),d+1,a.content.append(c?R.empty:R.from(o))))return!1;const f=s.pos,p=f+a.nodeSize;return n.step(new bt(f-(l?1:0),p+(c?1:0),f+1,p-1,new K((l?R.empty:R.from(o.copy(R.empty))).append(c?R.empty:R.from(o.copy(R.empty))),l?0:1,c?0:1),l?0:1)),t(n.scrollIntoView()),!0}function R3(e,t){const r=t||e.selection.$from;let n=[],o,i,s,a;for(let c=r.depth;c>=0;c--){if(i=r.node(c),o=r.index(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&cs(s)){const u=r.before(c+1);n.push(u)}if(o=r.indexAfter(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&cs(s)){const u=r.after(c+1);n.push(u)}}n=[...new Set(n)].sort((c,u)=>u-c);let l=!1;for(const c of n)Rd(e.doc,c)&&(e.join(c),l=!0);return l}function P3(e){return t=>{const{dispatch:r,tr:n}=t,o=Vv(n,t.state),i=Tee(e,n.selection);return i?(r&&Mee(o,r,i),!0):!1}}function Tee(e,t){const{$from:r,$to:n}=t;return r.blockRange(n,i=>{var s;return((s=i.firstChild)==null?void 0:s.type)===e})}function bh(e){const{$from:t,$to:r}=e;return t.blockRange(r,cs)}function Oee(e){const t=e.selection.$from,r=t.blockRange();if(!r||!Qi(r.parent)||r.startIndex!==0)return!1;const n=t.node(r.depth-2),o=t.index(r.depth),i=t.index(r.depth-1),s=t.index(r.depth-2),a=n.maybeChild(s-1),l=a==null?void 0:a.lastChild;if(o!==0||i!==0)return!1;if(a&&cs(a)&&l&&Qi(l))return Ql({listType:a.type,itemType:l.type,tr:e});if(Qi(n)){const c=n,u=t.node(r.depth-3);if(cs(u))return Ql({listType:u.type,itemType:c.type,tr:e})}return!1}function HS({view:e}){if(!e)return!1;{const t=e.state.selection.$cursor;if(!t||t.parentOffset>0)return!1;const r=t.blockRange();if(!r||!Qi(r.parent)||r.startIndex!==0)return!1}{const t=e.state.tr;Oee(t)&&e.dispatch(t)}{const t=e.state.selection.$cursor;if(!t||t.parentOffset>0)return!1;const r=t.blockRange();if(!r||!Qi(r.parent)||r.startIndex!==0)return!1;const n=t.index(r.depth),o=t.index(r.depth-1),i=t.index(r.depth-2),s=r.depth-2>=1&&Qi(t.node(r.depth-2));n===0&&o===0&&i<=1&&s&&yee(r.parent.type)(e.state,e.dispatch)}return jC(e.state,e.dispatch,e),!0}function z3({node:e,mark:t,updateDOM:r,updateMark:n}){const o=document.createElement("label");o.contentEditable="false",o.classList.add(ls.LIST_ITEM_MARKER_CONTAINER),o.append(t);const i=document.createElement("div"),s=document.createElement("li");s.classList.add(ls.LIST_ITEM_WITH_CUSTOM_MARKER),s.append(o),s.append(i);const a=l=>l.type!==e.type?!1:(e=l,r(e,s),n(e,t),!0);return a(e),{dom:s,contentDOM:i,update:a}}function _ee(e,t){const r=e.node(t.depth-1),n=e.node(t.depth-2);return!Qi(r)||!cs(n)?!1:{parentItem:r,parentList:n}}function Aee(e,t){const r=t.parent,n=t.parent.child(t.endIndex-1),o=t.end,i=t.$to.end(t.depth);return oPee(e)?(t==null||t(e.scrollIntoView()),!0):!1;function Lee(e,t,r){let n,o,i,s;const a=t.doc;if(r.startIndex>=1){n=e.child(r.startIndex-1),o=e,s=a.resolve(r.start).start(r.depth),i=s+1;for(let l=0;l=1){const c=t.node(r.depth-1),u=t.start(r.depth-1);if(o=c.child(l-1),!cs(o))return!1;s=u+1;for(let d=0;d=r.depth+2?t.end(r.depth+2):r.end-1,a=r.end;return s+1>=a?(n=e.slice(i,a),o=null):(n=e.slice(i,s),o=e.slice(s+1,a-1)),{selectedSlice:n,unselectedSlice:o}}function Dee(e){const{$from:t,$to:r}=e.selection,n=bh(e.selection);if(!n)return!1;const o=e.doc.resolve(n.start).node();if(!cs(o))return!1;const i=Lee(o,t,n);if(!i)return!1;const{previousItem:s,previousList:a,previousItemStart:l}=i,{selectedSlice:c,unselectedSlice:u}=Iee(e.doc,r,n),d=s.content.append(R.fromArray([o.copy(c.content)])).append(u?u.content:R.empty);e.deleteRange(n.start,n.end);const f=l+s.nodeSize-2,p=s.copy(d);return p.check(),e.replaceRangeWith(l-1,f+1,p),e.setSelection(a===o?le.between(e.doc.resolve(t.pos),e.doc.resolve(r.pos)):le.between(e.doc.resolve(t.pos-2),e.doc.resolve(r.pos-2))),!0}var $ee=({tr:e,dispatch:t})=>Dee(e)?(t==null||t(e.scrollIntoView()),!0):!1,L3=class extends Ve{get name(){return"listItemShared"}createKeymap(){const e={Tab:$ee,"Shift-Tab":zee,Backspace:HS,"Mod-Backspace":HS};if(on.isMac){const t={"Ctrl-h":e.Backspace,"Alt-Backspace":e["Mod-Backspace"]};return{...e,...t}}return e}createPlugin(){return{appendTransaction:(e,t,r)=>{const n=r.tr;return R3(n)?n:null}}}},ya=class extends er{get name(){return"listItem"}createTags(){return[oe.ListItemNode]}createNodeSpec(e,t){return{content:"paragraph block*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),closed:{default:!1},nested:{default:!1}},parseDOM:[{tag:"li",getAttrs:e.parse,priority:Ae.Lowest},...t.parseDOM??[]],toDOM:r=>["li",e.dom(r),0]}}createNodeViews(){return this.options.enableCollapsible?(e,t,r)=>{const n=document.createElement("div");return n.classList.add(ls.COLLAPSIBLE_LIST_ITEM_BUTTON),n.contentEditable="false",n.addEventListener("click",()=>{if(n.classList.contains("disabled"))return;const o=r(),i=ce.create(t.state.doc,o);return t.dispatch(t.state.tr.setSelection(i)),this.store.commands.toggleListItemClosed(),!0}),z3({mark:n,node:e,updateDOM:Hee,updateMark:Bee})}:{}}createKeymap(){return{Enter:N3(this.type)}}createExtensions(){return[new L3]}toggleListItemClosed(e){return({state:{tr:t,selection:r},dispatch:n})=>{if(!Dd(r)||r.node.type.name!==this.name)return!1;const{node:o,from:i}=r;return e=E1(e)?e:!o.attrs.closed,n==null||n(t.setNodeMarkup(i,void 0,{...o.attrs,closed:e})),!0}}liftListItemOutOfList(e){return P3(e??this.type)}};Hn([U()],ya.prototype,"toggleListItemClosed",1);Hn([U()],ya.prototype,"liftListItemOutOfList",1);ya=Hn([pe({defaultOptions:{enableCollapsible:!1},staticKeys:["enableCollapsible"]})],ya);function Hee(e,t){e.attrs.closed?t.classList.add(ls.COLLAPSIBLE_LIST_ITEM_CLOSED):t.classList.remove(ls.COLLAPSIBLE_LIST_ITEM_CLOSED)}function Bee(e,t){e.childCount<=1?t.classList.add("disabled"):t.classList.remove("disabled")}var bd=class extends er{get name(){return"bulletList"}createTags(){return[oe.Block,oe.ListContainerNode]}createNodeSpec(e,t){return{content:"listItem+",...t,attrs:e.defaults(),parseDOM:[{tag:"ul",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["ul",e.dom(r),0]}}createNodeViews(){return this.options.enableSpine?(e,t,r)=>{var n;const o=document.createElement("div");o.style.position="relative";const i=r(),s=t.state.doc.resolve(i+1),a=s.node(s.depth-1);if(!(((n=a==null?void 0:a.type)==null?void 0:n.name)!=="listItem")){const u=document.createElement("div");u.contentEditable="false",u.classList.add(ls.LIST_SPINE),u.addEventListener("click",d=>{const f=r(),p=t.state.doc.resolve(f+1),h=p.start(p.depth-1),m=ce.create(t.state.doc,h-1);t.dispatch(t.state.tr.setSelection(m)),this.store.commands.toggleListItemClosed(),d.preventDefault(),d.stopPropagation()}),o.append(u)}const c=document.createElement("ul");return c.classList.add(ls.UL_LIST_CONTENT),o.append(c),{dom:o,contentDOM:c}}:{}}createExtensions(){return[new ya({priority:Ae.Low,enableCollapsible:this.options.enableSpine})]}toggleBulletList(){return Lb(this.type,it(this.store.schema.nodes,"listItem"))}listShortcut(e){return this.toggleBulletList()(e)}createInputRules(){const e=/^\s*([*+-])\s$/;return[zh(e,this.type),new wa(e,(t,r,n,o)=>{const i=t.tr;return i.deleteRange(n,o),Ql({listType:this.type,itemType:it(this.store.schema.nodes,"listItem"),tr:i})?i:null})]}};Hn([U({icon:"listUnordered",label:({t:e})=>e(Nv.BULLET_LIST_LABEL)})],bd.prototype,"toggleBulletList",1);Hn([je({shortcut:D.BulletList,command:"toggleBulletList"})],bd.prototype,"listShortcut",1);bd=Hn([pe({defaultOptions:{enableSpine:!1},staticKeys:["enableSpine"]})],bd);var xd=class extends er{get name(){return"orderedList"}createTags(){return[oe.Block,oe.ListContainerNode]}createNodeSpec(e,t){return{content:"listItem+",...t,attrs:{...e.defaults(),order:{default:1}},parseDOM:[{tag:"ol",getAttrs:r=>Je(r)?{...e.parse(r),order:+(r.getAttribute("start")??1)}:{}},...t.parseDOM??[]],toDOM:r=>{const n=e.dom(r);return r.attrs.order===1?["ol",n,0]:["ol",{...n,start:r.attrs.order},0]}}}createExtensions(){return[new ya({priority:Ae.Low})]}toggleOrderedList(){return Lb(this.type,it(this.store.schema.nodes,"listItem"))}listShortcut(e){return this.toggleOrderedList()(e)}createInputRules(){const e=/^(\d+)\.\s$/;return[zh(e,this.type,t=>({order:+it(t,1)}),(t,r)=>r.childCount+r.attrs.order===+it(t,1)),new wa(e,(t,r,n,o)=>{const i=t.tr;if(i.deleteRange(n,o),!Ql({listType:this.type,itemType:it(this.store.schema.nodes,"listItem"),tr:i}))return null;const a=+it(r,1);if(a!==1){const l=ts({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{order:a})}return i})]}};Hn([U({icon:"listOrdered",label:({t:e})=>e(Nv.ORDERED_LIST_LABEL)})],xd.prototype,"toggleOrderedList",1);Hn([je({shortcut:D.OrderedList,command:"toggleOrderedList"})],xd.prototype,"listShortcut",1);xd=Hn([pe({})],xd);var I3=class extends er{get name(){return"taskListItem"}createTags(){return[oe.ListItemNode]}createNodeSpec(e,t){return{content:"paragraph block*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),checked:{default:!1}},parseDOM:[{tag:"li[data-task-list-item]",getAttrs:r=>{let n=!1;return Je(r)&&r.getAttribute("data-checked")!==null&&(n=!0),{checked:n,...e.parse(r)}},priority:Ae.Medium},...t.parseDOM??[]],toDOM:r=>["li",{...e.dom(r),"data-task-list-item":"","data-checked":r.attrs.checked?"":void 0},0]}}createNodeViews(){return(e,t,r)=>{const n=document.createElement("input");return n.type="checkbox",n.classList.add(ls.LIST_ITEM_CHECKBOX),n.contentEditable="false",n.addEventListener("click",o=>{t.editable||o.preventDefault()}),n.addEventListener("change",()=>{const o=r(),i=t.state.doc.resolve(o+1);this.store.commands.toggleCheckboxChecked({$pos:i})}),n.checked=e.attrs.checked,z3({node:e,mark:n,updateDOM:Fee,updateMark:Vee})}}createKeymap(){return{Enter:N3(this.type)}}createExtensions(){return[new L3]}toggleCheckboxChecked(e){let t,r;return typeof e=="boolean"?t=e:e&&(t=e.checked,r=e.$pos),({tr:n,dispatch:o})=>{const i=ts({selection:r??n.selection.$from,types:this.type});if(!i)return!1;const{node:s,pos:a}=i,l={...s.attrs,checked:t??!s.attrs.checked};return o==null||o(n.setNodeMarkup(a,void 0,l)),!0}}createInputRules(){const e=/^\s*(\[( ?|x|X)]\s)$/;return[zh(e,this.type,t=>({checked:["x","X"].includes(Zo(t,2))})),new wa(e,(t,r,n,o)=>{const i=t.tr;if(i.deleteRange(n,o),!Ql({listType:it(this.store.schema.nodes,"taskList"),itemType:this.type,tr:i}))return null;const a=["x","X"].includes(Zo(r,2));if(a){const l=ts({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{checked:a})}return i})]}};Hn([U()],I3.prototype,"toggleCheckboxChecked",1);function Fee(e,t){e.attrs.checked?t.setAttribute("data-checked",""):t.removeAttribute("data-checked"),t.setAttribute("data-task-list-item","")}function Vee(e,t){t.checked=!!e.attrs.checked}var D3=class extends er{get name(){return"taskList"}createTags(){return[oe.Block,oe.ListContainerNode]}createNodeSpec(e,t){return{content:"taskListItem+",...t,attrs:e.defaults(),parseDOM:[{tag:"ul[data-task-list]",getAttrs:e.parse,priority:Ae.Medium},...t.parseDOM??[]],toDOM:r=>["ul",{...e.dom(r),"data-task-list":""},0]}}createExtensions(){return[new I3({})]}toggleTaskList(){return Lb(this.type,it(this.store.schema.nodes,"taskListItem"))}listShortcut(e){return this.toggleTaskList()(e)}};Hn([U({icon:"checkboxMultipleLine",label:({t:e})=>e(Nv.TASK_LIST_LABEL)})],D3.prototype,"toggleTaskList",1);Hn([je({shortcut:D.TaskList,command:"toggleTaskList"})],D3.prototype,"listShortcut",1);var fo,jee=(e=document)=>fo||(fo=e.createElement("div"),fo.setAttribute("id","a11y-status-message"),fo.setAttribute("role","status"),fo.setAttribute("aria-live","polite"),fo.setAttribute("aria-relevant","additions text"),Object.assign(fo.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.append(fo),fo);j4(500,()=>{jee().textContent=""});function BS(e){return typeof e=="object"&&e!=null&&e.nodeType===1}function FS(e,t){return(!t||e!=="hidden")&&e!=="visible"&&e!=="clip"}function u1(e,t){if(e.clientHeightt||i>e&&s=t&&a>=r?i-e-n:s>t&&ar?s-t+o:0}var Uee=function(e,t){var r=window,n=t.scrollMode,o=t.block,i=t.inline,s=t.boundary,a=t.skipOverflowHiddenElements,l=typeof s=="function"?s:function(De){return De!==s};if(!BS(e))throw new TypeError("Invalid target");for(var c,u,d=document.scrollingElement||document.documentElement,f=[],p=e;BS(p)&&l(p);){if((p=(u=(c=p).parentElement)==null?c.getRootNode().host||null:u)===d){f.push(p);break}p!=null&&p===document.body&&u1(p)&&!u1(document.documentElement)||p!=null&&u1(p,a)&&f.push(p)}for(var h=r.visualViewport?r.visualViewport.width:innerWidth,m=r.visualViewport?r.visualViewport.height:innerHeight,b=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,g=e.getBoundingClientRect(),y=g.height,x=g.width,k=g.top,w=g.right,E=g.bottom,T=g.left,C=o==="start"||o==="nearest"?k:o==="end"?E:k+y/2,M=i==="center"?T+x/2:i==="end"?w:T,N=[],F=0;F=0&&T>=0&&E<=m&&w<=h&&k>=q&&E<=P&&T>=B&&w<=A)return N;var Y=getComputedStyle(I),J=parseInt(Y.borderLeftWidth,10),Ne=parseInt(Y.borderTopWidth,10),ie=parseInt(Y.borderRightWidth,10),ue=parseInt(Y.borderBottomWidth,10),de=0,me=0,Me="offsetWidth"in I?I.offsetWidth-I.clientWidth-J-ie:0,Se="offsetHeight"in I?I.offsetHeight-I.clientHeight-Ne-ue:0,ft="offsetWidth"in I?I.offsetWidth===0?0:z/I.offsetWidth:0,rt="offsetHeight"in I?I.offsetHeight===0?0:j/I.offsetHeight:0;if(d===I)de=o==="start"?C:o==="end"?C-m:o==="nearest"?Of(v,v+m,m,Ne,ue,v+C,v+C+y,y):C-m/2,me=i==="start"?M:i==="center"?M-h/2:i==="end"?M-h:Of(b,b+h,h,J,ie,b+M,b+M+x,x),de=Math.max(0,de+v),me=Math.max(0,me+b);else{de=o==="start"?C-q-Ne:o==="end"?C-P+ue+Se:o==="nearest"?Of(q,P,j,Ne,ue+Se,C,C+y,y):C-(q+j/2)+Se/2,me=i==="start"?M-B-J:i==="center"?M-(B+z/2)+Me/2:i==="end"?M-A+ie+Me:Of(B,A,z,J,ie+Me,M,M+x,x);var Or=I.scrollLeft,he=I.scrollTop;C+=he-(de=Math.max(0,Math.min(he+de/rt,I.scrollHeight-j/rt+Se))),M+=Or-(me=Math.max(0,Math.min(Or+me/ft,I.scrollWidth-z/ft+Me)))}N.push({el:I,top:de,left:me})}return N};typeof xr=="object"&&xr.__esModule&&xr.default&&xr.default;Rh(Uee);var Wee=typeof document<"u"?S.useLayoutEffect:S.useEffect;function Kee(e){const t=S.useRef();return Wee(()=>{t.current=e}),t.current}function qee(e,t){const[r,n]=S.useState([]),[o,i]=S.useState(()=>K0(e)),[s,a]=S.useState([]),l=S.useRef(e),c=Kee(o);return l.current=e,Wd(Ul,({addCustomHandler:u})=>{const d=K0(l.current),f=u("positioner",d);return i(d),f},t),S.useLayoutEffect(()=>{const u=o.addListener("update",f=>{const p=[];for(const{id:h,data:m,setElement:b}of f){const v=g=>{g&&b(g)};p.push({id:h,data:m,ref:v})}a(p)}),d=o.addListener("done",f=>{n(f)});return c!=null&&c.recentUpdate&&o.onActiveChanged(c==null?void 0:c.recentUpdate),()=>{u(),d()}},[o,c]),S.useMemo(()=>{const u=[];for(const[d,{ref:f,data:p,id:h}]of s.entries()){const m=r[d],{element:b,position:v={}}=m??{},g={...Qy,...q4(v)};u.push({ref:f,element:b,data:p,key:h,...g})}return u},[s,r])}function Gee(e,t){const r=t==null||E1(t)?[e]:t,n=E1(t)?t:!0,o=S.useRef(Cl()),s=qee(e,r)[0];return S.useMemo(()=>s&&n?{...s,active:!0}:{...Qy,ref:void 0,data:{},active:!1,key:o.current},[n,s])}function d1(e,t){return _e(e)?e(t):e}function Yee(e){return ne(e[0])}function Jee(e,t){var r;return ne(e)?e:ct(e)?Yee(e)?e[0]??"":((r=e.find(n=>G4(n.attrs,t))??e[0])==null?void 0:r.shortcut)??"":e.shortcut}var Xee={title:e=>dA(e),upper:e=>e.toLocaleUpperCase(),lower:e=>e.toLocaleLowerCase()};function Qee(e,t){const{casing:r="title",namedAsSymbol:n=!1,modifierAsSymbol:o=!0,separator:i=" ",t:s}=t,a=Bz(e),l=[],c=Xee[r];for(const u of a){if(u.type==="char"){l.push(c(u.key));continue}if(u.type==="named"){const f=n===!0||ct(n)&&fr(n,u.key)?u.symbol??s(u.i18n):s(u.i18n);l.push(c(f));continue}const d=o===!0||ct(o)&&fr(o,u.key)?u.symbol:s(u.i18n);l.push(c(d))}return l.join(i)}var $3=({commandName:e,active:t,enabled:r,attrs:n})=>{const{t:o}=dj(),{getCommandOptions:i}=dm(),s=i(e),{description:a,label:l,icon:c,shortcut:u}=s||{},d=S.useMemo(()=>({active:t,attrs:n,enabled:r,t:o}),[t,n,r,o]),f=S.useMemo(()=>{if(u)return Qee(Jee(u,n??{}),{t:o,separator:""})},[u,n,o]);return S.useMemo(()=>({description:d1(a,d),label:d1(l,d),icon:d1(c,d),shortcut:f}),[d,a,l,c,f])},Zee={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},H3=S.createContext(Zee);H3.Provider;function B3(e){return e.map((t,r)=>S.createElement(t.tag,{key:r,...t.attr},B3(t.child??[])))}var Ym=e=>{const{name:t}=e;return L.createElement(ete,{...e},B3(mee[t]))},ete=e=>{const t=r=>{const n=e.size??r.size??"1em";let o;r.className&&(o=r.className),e.className&&(o=(o?`${o} `:"")+e.className);const{title:i,...s}=e;return L.createElement("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",...r.attr,...s,className:o,style:{color:e.color??r.color,...r.style,...e.style},height:n,width:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},i&&L.createElement("title",null,i),e.children)};return L.createElement(H3.Consumer,null,t)},tte=e=>hs(e)?!!e.name:!1,rte=({icon:e})=>ne(e)?L.createElement(Ym,{name:e,size:"1rem"}):e,nte=({icon:e,children:t})=>{if(!tte(e))return L.createElement(L.Fragment,null,t);const{sub:r,sup:n}=e,o=r??n,i=r!==void 0;return o===void 0?L.createElement(L.Fragment,null,t):L.createElement(nJ,{anchorOrigin:{vertical:i?"bottom":"top",horizontal:"right"},badgeContent:o,sx:{"& > .MuiBadge-badge":{bgcolor:"background.paper",color:"text.secondary",minWidth:12,height:12,margin:"2px 0",padding:"1px"}}},t)},dt=({commandName:e,active:t=!1,enabled:r,attrs:n,onSelect:o,onChange:i,icon:s,displayShortcut:a=!0,"aria-label":l,label:c,...u})=>{const d=S.useCallback((g,y)=>{o(),i==null||i(g,y)},[o,i]),f=S.useCallback(g=>{g.preventDefault()},[]),p=$3({commandName:e,active:t,enabled:r,attrs:n});let h=null;p.icon&&(h=ne(p.icon)?p.icon:p.icon.name);const m=l??p.label??"",b=c??m,v=a&&p.shortcut?` (${p.shortcut})`:"";return L.createElement(A3,{title:`${b}${v}`},L.createElement(M3,{component:"span",sx:{"&:not(:first-of-type)":{marginLeft:"-1px"}}},L.createElement(AX,{"aria-label":m,selected:t,disabled:!r,onMouseDown:f,color:"primary",size:"small",sx:{padding:"6px 12px","&.Mui-selected":{backgroundColor:"primary.main",color:"primary.contrastText"},"&.Mui-selected:hover":{backgroundColor:"primary.dark",color:"primary.contrastText"},"&:not(:first-of-type)":{borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:last-of-type)":{borderTopRightRadius:0,borderBottomRightRadius:0}},...u,value:e,onChange:d},L.createElement(nte,{icon:p.icon},L.createElement(rte,{icon:s??h})))))},ote=({icon:e})=>ne(e)?L.createElement(Ym,{name:e,size:"1rem"}):e,F3=({label:e,"aria-label":t,icon:r,children:n,onClose:o,...i})=>{const s=S.useRef(Cl()),[a,l]=S.useState(null),c=!!a,u=S.useCallback(p=>{p.preventDefault()},[]),d=S.useCallback(p=>{l(p.currentTarget)},[]),f=S.useCallback((p,h)=>{l(null),o==null||o(p,h)},[o]);return L.createElement(L.Fragment,null,L.createElement(A3,{title:e??t},L.createElement(Uq,{"aria-label":t,"aria-controls":c?s.current:void 0,"aria-haspopup":!0,"aria-expanded":c?"true":void 0,onMouseDown:u,onClick:d,size:"small",sx:p=>({border:`1px solid ${p.palette.divider}`,borderRadius:`${p.shape.borderRadius}px`,padding:"6px 12px","&:not(:first-of-type)":{marginLeft:"-1px",borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:last-of-type)":{borderTopRightRadius:0,borderBottomRightRadius:0}})},r&&L.createElement(ote,{icon:r}),L.createElement(Ym,{name:"arrowDownSFill",size:"1rem"}))),L.createElement(sX,{...i,id:s.current,anchorEl:a,open:c,onClose:f},n))},ite=e=>{const{insertHorizontalRule:t}=tr();tb();const r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=t.enabled();return L.createElement(dt,{...e,commandName:"insertHorizontalRule",enabled:n,onSelect:r})},ste=e=>{const{redo:t}=tr(),{redoDepth:r}=dm(!0),n=S.useCallback(()=>{t.enabled()&&t()},[t]),o=r()>0;return L.createElement(dt,{...e,commandName:"redo",active:!1,enabled:o,onSelect:n})},ate=e=>{const{toggleBlockquote:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().blockquote(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleBlockquote",active:n,enabled:o,onSelect:r})},lv=e=>{const{toggleBold:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().bold(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleBold",active:n,enabled:o,onSelect:r})},lte=e=>{const{toggleBulletList:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().bulletList(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleBulletList",active:n,enabled:o,onSelect:r})},cte=({attrs:e={},...t})=>{const{toggleCodeBlock:r}=tr(),n=S.useCallback(()=>{r.enabled(e)&&r(e)},[r,e]),o=qr().codeBlock(),i=r.enabled(e);return L.createElement(dt,{...t,commandName:"toggleCodeBlock",active:o,enabled:i,attrs:e,onSelect:n})},cv=e=>{const{toggleCode:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().code(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleCode",active:n,enabled:o,onSelect:r})},f1=({attrs:e,...t})=>{const{toggleHeading:r}=tr(),n=S.useCallback(()=>{r.enabled(e)&&r(e)},[r,e]),o=qr().heading(e),i=r.enabled(e);return L.createElement(dt,{...t,commandName:"toggleHeading",active:o,enabled:i,attrs:e,onSelect:n})},uv=e=>{const{toggleItalic:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().italic(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleItalic",active:n,enabled:o,onSelect:r})},ute=e=>{const{toggleOrderedList:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().orderedList(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleOrderedList",active:n,enabled:o,onSelect:r})},dte=e=>{const{toggleStrike:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().strike(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleStrike",active:n,enabled:o,onSelect:r})},dv=e=>{const{toggleUnderline:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().underline(),o=t.enabled();return L.createElement(dt,{...e,commandName:"toggleUnderline",active:n,enabled:o,onSelect:r})},fte=e=>{const{undo:t}=tr(),{undoDepth:r}=dm(!0),n=S.useCallback(()=>{t.enabled()&&t()},[t]),o=r()>0;return L.createElement(dt,{...e,commandName:"undo",active:!1,enabled:o,onSelect:n})},En=e=>L.createElement(M3,{sx:{display:"flex",alignItems:"center",width:"fit-content",bgcolor:"background.paper",color:"text.secondary"},...e}),pte=({children:e})=>L.createElement(En,null,L.createElement(lv,null),L.createElement(uv,null),L.createElement(dv,null),L.createElement(dte,null),L.createElement(cv,null),e),hte=({icon:e})=>e?L.createElement(NJ,null,ne(e)?L.createElement(Ym,{name:e,size:"1rem"}):L.createElement(L.Fragment,null,e)):null,Ib=({commandName:e,active:t=!1,enabled:r,attrs:n,onSelect:o,onClick:i,icon:s,displayShortcut:a=!0,label:l,description:c,displayDescription:u=!0,...d})=>{const f=S.useCallback(g=>{o(),i==null||i(g)},[o,i]),p=S.useCallback(g=>{g.preventDefault()},[]),h=$3({commandName:e,active:t,enabled:r,attrs:n});let m=null;h.icon&&(m=ne(h.icon)?h.icon:h.icon.name);const b=l??h.label??"",v=u&&(c??h.description);return L.createElement(hX,{selected:t,disabled:!r,onMouseDown:p,...d,onClick:f},s!==null&&L.createElement(hte,{icon:s??m}),L.createElement($J,{primary:b,secondary:v}),a&&h.shortcut&&L.createElement(cu,{variant:"body2",color:"text.secondary",sx:{ml:2}},h.shortcut))},_f=({attrs:e,...t})=>{const{toggleHeading:r}=tr(),n=S.useCallback(()=>{r.enabled(e)&&r(e)},[r,e]),o=qr().heading(e),i=r.enabled(e);return L.createElement(Ib,{...t,commandName:"toggleHeading",active:o,enabled:i,attrs:e,onSelect:n})},mte={level:1},gte={level:2},VS={level:3},vte={level:4},yte={level:5},bte={level:6},xte=({showAll:e=!1,children:t})=>L.createElement(En,null,L.createElement(f1,{attrs:mte}),L.createElement(f1,{attrs:gte}),e?L.createElement(F3,{"aria-label":"More heading options"},L.createElement(_f,{attrs:VS}),L.createElement(_f,{attrs:vte}),L.createElement(_f,{attrs:yte}),L.createElement(_f,{attrs:bte})):L.createElement(f1,{attrs:VS}),t),kte=({children:e})=>L.createElement(En,null,L.createElement(fte,null),L.createElement(ste,null),e);typeof xr=="object"&&xr.__esModule&&xr.default&&xr.default;var V3=S.createContext({});function wte(e={}){const t=S.useContext(V3),r=S.useMemo(()=>X4(t,e.theme??{}),[t,e.theme]),n=S.useMemo(()=>CV(r).styles,[r]),o=ju(EV,e.className);return S.useMemo(()=>({style:n,className:o,theme:r}),[n,o,r])}var Ste=e=>{var t,r,n,o,i,s,a,l;const{children:c,as:u="div"}=e,{theme:d,style:f,className:p}=wte({theme:e.theme??Ss}),h=kb({palette:{primary:{main:((t=d.color)==null?void 0:t.primary)??Ss.color.primary,dark:((n=(r=d.color)==null?void 0:r.hover)==null?void 0:n.primary)??Ss.color.hover.primary,contrastText:((o=d.color)==null?void 0:o.primaryText)??Ss.color.primaryText},secondary:{main:((i=d.color)==null?void 0:i.secondary)??Ss.color.secondary,dark:((a=(s=d.color)==null?void 0:s.hover)==null?void 0:a.secondary)??Ss.color.hover.secondary,contrastText:((l=d.color)==null?void 0:l.secondaryText)??Ss.color.secondaryText}}});return L.createElement(nq,{theme:h},L.createElement(V3.Provider,{value:d},L.createElement(u,{style:f,className:p},c)))},j3=e=>L.createElement(mJ,{direction:"row",spacing:1,sx:{backgroundColor:"background.paper",overflowX:"auto"},...e}),Ete=[{name:"offset",options:{offset:[0,8]}}],Cte=({positioner:e="selection",children:t,...r})=>{const{ref:n,x:o,y:i,width:s,height:a,active:l}=Gee(()=>K0(e),[e]),[c,u]=S.useState(null),d=S.useMemo(()=>({position:"absolute",pointerEvents:"none",left:o,top:i,width:s,height:a}),[o,i,s,a]),f=S.useCallback(p=>{u(p),n==null||n(p)},[n]);return L.createElement(L.Fragment,null,L.createElement("div",{ref:f,style:d}),L.createElement(zb,{placement:"top",modifiers:Ete,...r,open:l,anchorEl:c},L.createElement(j3,null,t?L.createElement(L.Fragment,null,t):L.createElement(pte,null))))},Ct=Rh(dh),Db=xt` +`),Sn.rippleVisible,Eq,rv,({theme:e})=>e.transitions.easing.easeInOut,Sn.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,Sn.child,Sn.childLeaving,Cq,rv,({theme:e})=>e.transitions.easing.easeInOut,Sn.childPulsate,Mq,({theme:e})=>e.transitions.easing.easeInOut),_q=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiTouchRipple"}),{center:o=!1,classes:i={},className:s}=n,a=ve(n,wq),[l,c]=S.useState([]),u=S.useRef(0),d=S.useRef(null);S.useEffect(()=>{d.current&&(d.current(),d.current=null)},[l]);const f=S.useRef(!1),p=S.useRef(0),h=S.useRef(null),m=S.useRef(null);S.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const b=S.useCallback(x=>{const{pulsate:k,rippleX:w,rippleY:E,rippleSize:M,cb:C}=x;c(T=>[...T,O.jsx(Oq,{classes:{ripple:Ce(i.ripple,Sn.ripple),rippleVisible:Ce(i.rippleVisible,Sn.rippleVisible),ripplePulsate:Ce(i.ripplePulsate,Sn.ripplePulsate),child:Ce(i.child,Sn.child),childLeaving:Ce(i.childLeaving,Sn.childLeaving),childPulsate:Ce(i.childPulsate,Sn.childPulsate)},timeout:rv,pulsate:k,rippleX:w,rippleY:E,rippleSize:M},u.current)]),u.current+=1,d.current=C},[i]),v=S.useCallback((x={},k={},w=()=>{})=>{const{pulsate:E=!1,center:M=o||k.pulsate,fakeElement:C=!1}=k;if((x==null?void 0:x.type)==="mousedown"&&f.current){f.current=!1;return}(x==null?void 0:x.type)==="touchstart"&&(f.current=!0);const T=C?null:m.current,N=T?T.getBoundingClientRect():{width:0,height:0,left:0,top:0};let z,D,V;if(M||x===void 0||x.clientX===0&&x.clientY===0||!x.clientX&&!x.touches)z=Math.round(N.width/2),D=Math.round(N.height/2);else{const{clientX:j,clientY:L}=x.touches&&x.touches.length>0?x.touches[0]:x;z=Math.round(j-N.left),D=Math.round(L-N.top)}if(M)V=Math.sqrt((2*N.width**2+N.height**2)/3),V%2===0&&(V+=1);else{const j=Math.max(Math.abs((T?T.clientWidth:0)-z),z)*2+2,L=Math.max(Math.abs((T?T.clientHeight:0)-D),D)*2+2;V=Math.sqrt(j**2+L**2)}x!=null&&x.touches?h.current===null&&(h.current=()=>{b({pulsate:E,rippleX:z,rippleY:D,rippleSize:V,cb:w})},p.current=setTimeout(()=>{h.current&&(h.current(),h.current=null)},Sq)):b({pulsate:E,rippleX:z,rippleY:D,rippleSize:V,cb:w})},[o,b]),g=S.useCallback(()=>{v({},{pulsate:!0})},[v]),y=S.useCallback((x,k)=>{if(clearTimeout(p.current),(x==null?void 0:x.type)==="touchend"&&h.current){h.current(),h.current=null,p.current=setTimeout(()=>{y(x,k)});return}h.current=null,c(w=>w.length>0?w.slice(1):w),d.current=k},[]);return S.useImperativeHandle(r,()=>({pulsate:g,start:v,stop:y}),[g,v,y]),O.jsx(Tq,_({className:Ce(Sn.root,i.root,s),ref:m},a,{children:O.jsx(pq,{component:null,exit:!0,children:l})}))}),Aq=_q;function Nq(e){return Vt("MuiButtonBase",e)}const Rq=jt("MuiButtonBase",["root","disabled","focusVisible"]),Pq=Rq,zq=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],Lq=e=>{const{disabled:t,focusVisible:r,focusVisibleClassName:n,classes:o}=e,s=rr({root:["root",t&&"disabled",r&&"focusVisible"]},Nq,o);return r&&n&&(s.root+=` ${n}`),s},Iq=Je("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Pq.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),Dq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiButtonBase"}),{action:o,centerRipple:i=!1,children:s,className:a,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:d=!1,focusRipple:f=!1,LinkComponent:p="a",onBlur:h,onClick:m,onContextMenu:b,onDragLeave:v,onFocus:g,onFocusVisible:y,onKeyDown:x,onKeyUp:k,onMouseDown:w,onMouseLeave:E,onMouseUp:M,onTouchEnd:C,onTouchMove:T,onTouchStart:N,tabIndex:z=0,TouchRippleProps:D,touchRippleRef:V,type:j}=n,L=ve(n,zq),q=S.useRef(null),A=S.useRef(null),P=Ur(A,V),{isFocusVisibleRef:F,onFocus:Y,onBlur:J,ref:Ne}=zT(),[ie,ue]=S.useState(!1);c&&ie&&ue(!1),S.useImperativeHandle(o,()=>({focusVisible:()=>{ue(!0),q.current.focus()}}),[]);const[de,me]=S.useState(!1);S.useEffect(()=>{me(!0)},[]);const Me=de&&!u&&!c;S.useEffect(()=>{ie&&f&&!u&&de&&A.current.pulsate()},[u,f,ie,de]);function Se(fe,bn,fc=d){return Ws(vi=>(bn&&bn(vi),!fc&&A.current&&A.current[fe](vi),!0))}const ft=Se("start",w),rt=Se("stop",b),Or=Se("stop",v),he=Se("stop",M),De=Se("stop",fe=>{ie&&fe.preventDefault(),E&&E(fe)}),Ke=Se("start",N),Fn=Se("stop",C),Gr=Se("stop",T),nr=Se("stop",fe=>{J(fe),F.current===!1&&ue(!1),h&&h(fe)},!1),zo=Ws(fe=>{q.current||(q.current=fe.currentTarget),Y(fe),F.current===!0&&(ue(!0),y&&y(fe)),g&&g(fe)}),Pt=()=>{const fe=q.current;return l&&l!=="button"&&!(fe.tagName==="A"&&fe.href)},Yr=S.useRef(!1),vn=Ws(fe=>{f&&!Yr.current&&ie&&A.current&&fe.key===" "&&(Yr.current=!0,A.current.stop(fe,()=>{A.current.start(fe)})),fe.target===fe.currentTarget&&Pt()&&fe.key===" "&&fe.preventDefault(),x&&x(fe),fe.target===fe.currentTarget&&Pt()&&fe.key==="Enter"&&!c&&(fe.preventDefault(),m&&m(fe))}),Vn=Ws(fe=>{f&&fe.key===" "&&A.current&&ie&&!fe.defaultPrevented&&(Yr.current=!1,A.current.stop(fe,()=>{A.current.pulsate(fe)})),k&&k(fe),m&&fe.target===fe.currentTarget&&Pt()&&fe.key===" "&&!fe.defaultPrevented&&m(fe)});let Xe=l;Xe==="button"&&(L.href||L.to)&&(Xe=p);const Jr={};Xe==="button"?(Jr.type=j===void 0?"button":j,Jr.disabled=c):(!L.href&&!L.to&&(Jr.role="button"),c&&(Jr["aria-disabled"]=c));const yn=Ur(r,Ne,q),gi=_({},n,{centerRipple:i,component:l,disabled:c,disableRipple:u,disableTouchRipple:d,focusRipple:f,tabIndex:z,focusVisible:ie}),Oa=Lq(gi);return O.jsxs(Iq,_({as:Xe,className:Ce(Oa.root,a),ownerState:gi,onBlur:nr,onClick:m,onContextMenu:rt,onFocus:zo,onKeyDown:vn,onKeyUp:Vn,onMouseDown:ft,onMouseLeave:De,onMouseUp:he,onDragLeave:Or,onTouchEnd:Fn,onTouchMove:Gr,onTouchStart:Ke,ref:yn,tabIndex:c?-1:z,type:j},Jr,L,{children:[s,Me?O.jsx(Aq,_({ref:P,center:i},D)):null]}))}),Tb=Dq;function $q(e){return Vt("MuiIconButton",e)}const Hq=jt("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),Bq=Hq,Fq=["edge","children","className","color","disabled","disableFocusRipple","size"],Vq=e=>{const{classes:t,disabled:r,color:n,edge:o,size:i}=e,s={root:["root",r&&"disabled",n!=="default"&&`color${Fe(n)}`,o&&`edge${Fe(o)}`,`size${Fe(i)}`]};return rr(s,$q,t)},jq=Je(Tb,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.color!=="default"&&t[`color${Fe(r.color)}`],r.edge&&t[`edge${Fe(r.edge)}`],t[`size${Fe(r.size)}`]]}})(({theme:e,ownerState:t})=>_({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Lr(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12}),({theme:e,ownerState:t})=>{var r;const n=(r=(e.vars||e).palette)==null?void 0:r[t.color];return _({},t.color==="inherit"&&{color:"inherit"},t.color!=="inherit"&&t.color!=="default"&&_({color:n==null?void 0:n.main},!t.disableRipple&&{"&:hover":_({},n&&{backgroundColor:e.vars?`rgba(${n.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Lr(n.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),t.size==="small"&&{padding:5,fontSize:e.typography.pxToRem(18)},t.size==="large"&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${Bq.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})}),Uq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiIconButton"}),{edge:o=!1,children:i,className:s,color:a="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium"}=n,d=ve(n,Fq),f=_({},n,{edge:o,color:a,disabled:l,disableFocusRipple:c,size:u}),p=Vq(f);return O.jsx(jq,_({className:Ce(p.root,s),centerRipple:!0,focusRipple:!c,disabled:l,ref:r,ownerState:f},d,{children:i}))}),Wq=Uq;function Kq(e){return Vt("MuiTypography",e)}jt("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const qq=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],Gq=e=>{const{align:t,gutterBottom:r,noWrap:n,paragraph:o,variant:i,classes:s}=e,a={root:["root",i,e.align!=="inherit"&&`align${Fe(t)}`,r&&"gutterBottom",n&&"noWrap",o&&"paragraph"]};return rr(a,Kq,s)},Yq=Je("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.variant&&t[r.variant],r.align!=="inherit"&&t[`align${Fe(r.align)}`],r.noWrap&&t.noWrap,r.gutterBottom&&t.gutterBottom,r.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>_({margin:0},t.variant==="inherit"&&{font:"inherit"},t.variant!=="inherit"&&e.typography[t.variant],t.align!=="inherit"&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),xS={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Jq={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Xq=e=>Jq[e]||e,Qq=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiTypography"}),o=Xq(n.color),i=xb(_({},n,{color:o})),{align:s="inherit",className:a,component:l,gutterBottom:c=!1,noWrap:u=!1,paragraph:d=!1,variant:f="body1",variantMapping:p=xS}=i,h=ve(i,qq),m=_({},i,{align:s,color:o,className:a,component:l,gutterBottom:c,noWrap:u,paragraph:d,variant:f,variantMapping:p}),b=l||(d?"p":p[f]||xS[f])||"span",v=Gq(m);return O.jsx(Yq,_({as:b,ref:r,ownerState:m,className:Ce(v.root,a)},h))}),cu=Qq;function m3(e){return typeof e=="string"}function uu(e,t,r){return e===void 0||m3(e)?t:_({},t,{ownerState:_({},t.ownerState,r)})}const Zq={disableDefaultClasses:!1},eG=S.createContext(Zq);function tG(e){const{disableDefaultClasses:t}=S.useContext(eG);return r=>t?"":e(r)}function g3(e,t=[]){if(e===void 0)return{};const r={};return Object.keys(e).filter(n=>n.match(/^on[A-Z]/)&&typeof e[n]=="function"&&!t.includes(n)).forEach(n=>{r[n]=e[n]}),r}function rG(e,t,r){return typeof e=="function"?e(t,r):e}function kS(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(r=>!(r.match(/^on[A-Z]/)&&typeof e[r]=="function")).forEach(r=>{t[r]=e[r]}),t}function nG(e){const{getSlotProps:t,additionalProps:r,externalSlotProps:n,externalForwardedProps:o,className:i}=e;if(!t){const p=Ce(o==null?void 0:o.className,n==null?void 0:n.className,i,r==null?void 0:r.className),h=_({},r==null?void 0:r.style,o==null?void 0:o.style,n==null?void 0:n.style),m=_({},r,o,n);return p.length>0&&(m.className=p),Object.keys(h).length>0&&(m.style=h),{props:m,internalRef:void 0}}const s=g3(_({},o,n)),a=kS(n),l=kS(o),c=t(s),u=Ce(c==null?void 0:c.className,r==null?void 0:r.className,i,o==null?void 0:o.className,n==null?void 0:n.className),d=_({},c==null?void 0:c.style,r==null?void 0:r.style,o==null?void 0:o.style,n==null?void 0:n.style),f=_({},c,r,l,a);return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:c.ref}}const oG=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function si(e){var t;const{elementType:r,externalSlotProps:n,ownerState:o,skipResolvingSlotProps:i=!1}=e,s=ve(e,oG),a=i?{}:rG(n,o),{props:l,internalRef:c}=nG(_({},s,{externalSlotProps:a})),u=Ur(c,a==null?void 0:a.ref,(t=e.additionalProps)==null?void 0:t.ref);return uu(r,_({},l,{ref:u}),o)}function iG(e){const{badgeContent:t,invisible:r=!1,max:n=99,showZero:o=!1}=e,i=IT({badgeContent:t,max:n});let s=r;r===!1&&t===0&&!o&&(s=!0);const{badgeContent:a,max:l=n}=s?i:e,c=a&&Number(a)>l?`${l}+`:a;return{badgeContent:a,invisible:s,max:l,displayValue:c}}const sG=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function aG(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function lG(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=n=>e.ownerDocument.querySelector(`input[type="radio"]${n}`);let r=t(`[name="${e.name}"]:checked`);return r||(r=t(`[name="${e.name}"]`)),r!==e}function cG(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||lG(e))}function uG(e){const t=[],r=[];return Array.from(e.querySelectorAll(sG)).forEach((n,o)=>{const i=aG(n);i===-1||!cG(n)||(i===0?t.push(n):r.push({documentOrder:o,tabIndex:i,node:n}))}),r.sort((n,o)=>n.tabIndex===o.tabIndex?n.documentOrder-o.documentOrder:n.tabIndex-o.tabIndex).map(n=>n.node).concat(t)}function dG(){return!0}function fG(e){const{children:t,disableAutoFocus:r=!1,disableEnforceFocus:n=!1,disableRestoreFocus:o=!1,getTabbable:i=uG,isEnabled:s=dG,open:a}=e,l=S.useRef(!1),c=S.useRef(null),u=S.useRef(null),d=S.useRef(null),f=S.useRef(null),p=S.useRef(!1),h=S.useRef(null),m=Ur(t.ref,h),b=S.useRef(null);S.useEffect(()=>{!a||!h.current||(p.current=!r)},[r,a]),S.useEffect(()=>{if(!a||!h.current)return;const y=Br(h.current);return h.current.contains(y.activeElement)||(h.current.hasAttribute("tabIndex")||h.current.setAttribute("tabIndex","-1"),p.current&&h.current.focus()),()=>{o||(d.current&&d.current.focus&&(l.current=!0,d.current.focus()),d.current=null)}},[a]),S.useEffect(()=>{if(!a||!h.current)return;const y=Br(h.current),x=E=>{b.current=E,!(n||!s()||E.key!=="Tab")&&y.activeElement===h.current&&E.shiftKey&&(l.current=!0,u.current&&u.current.focus())},k=()=>{const E=h.current;if(E===null)return;if(!y.hasFocus()||!s()||l.current){l.current=!1;return}if(E.contains(y.activeElement)||n&&y.activeElement!==c.current&&y.activeElement!==u.current)return;if(y.activeElement!==f.current)f.current=null;else if(f.current!==null)return;if(!p.current)return;let M=[];if((y.activeElement===c.current||y.activeElement===u.current)&&(M=i(h.current)),M.length>0){var C,T;const N=!!((C=b.current)!=null&&C.shiftKey&&((T=b.current)==null?void 0:T.key)==="Tab"),z=M[0],D=M[M.length-1];typeof z!="string"&&typeof D!="string"&&(N?D.focus():z.focus())}else E.focus()};y.addEventListener("focusin",k),y.addEventListener("keydown",x,!0);const w=setInterval(()=>{y.activeElement&&y.activeElement.tagName==="BODY"&&k()},50);return()=>{clearInterval(w),y.removeEventListener("focusin",k),y.removeEventListener("keydown",x,!0)}},[r,n,o,s,a,i]);const v=y=>{d.current===null&&(d.current=y.relatedTarget),p.current=!0,f.current=y.target;const x=t.props.onFocus;x&&x(y)},g=y=>{d.current===null&&(d.current=y.relatedTarget),p.current=!0};return O.jsxs(S.Fragment,{children:[O.jsx("div",{tabIndex:a?0:-1,onFocus:g,ref:c,"data-testid":"sentinelStart"}),S.cloneElement(t,{ref:m,onFocus:v}),O.jsx("div",{tabIndex:a?0:-1,onFocus:g,ref:u,"data-testid":"sentinelEnd"})]})}var Fr="top",Ln="bottom",In="right",Vr="left",Ob="auto",Gd=[Fr,Ln,In,Vr],Gl="start",gd="end",pG="clippingParents",v3="viewport",_c="popper",hG="reference",wS=Gd.reduce(function(e,t){return e.concat([t+"-"+Gl,t+"-"+gd])},[]),y3=[].concat(Gd,[Ob]).reduce(function(e,t){return e.concat([t,t+"-"+Gl,t+"-"+gd])},[]),mG="beforeRead",gG="read",vG="afterRead",yG="beforeMain",bG="main",xG="afterMain",kG="beforeWrite",wG="write",SG="afterWrite",EG=[mG,gG,vG,yG,bG,xG,kG,wG,SG];function No(e){return e?(e.nodeName||"").toLowerCase():null}function pn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function ga(e){var t=pn(e).Element;return e instanceof t||e instanceof Element}function Nn(e){var t=pn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function _b(e){if(typeof ShadowRoot>"u")return!1;var t=pn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function CG(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},o=t.attributes[r]||{},i=t.elements[r];!Nn(i)||!No(i)||(Object.assign(i.style,n),Object.keys(o).forEach(function(s){var a=o[s];a===!1?i.removeAttribute(s):i.setAttribute(s,a===!0?"":a)}))})}function MG(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var o=t.elements[n],i=t.attributes[n]||{},s=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),a=s.reduce(function(l,c){return l[c]="",l},{});!Nn(o)||!No(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const TG={name:"applyStyles",enabled:!0,phase:"write",fn:CG,effect:MG,requires:["computeStyles"]};function Co(e){return e.split("-")[0]}var ea=Math.max,yh=Math.min,Yl=Math.round;function nv(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function b3(){return!/^((?!chrome|android).)*safari/i.test(nv())}function Jl(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),o=1,i=1;t&&Nn(e)&&(o=e.offsetWidth>0&&Yl(n.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Yl(n.height)/e.offsetHeight||1);var s=ga(e)?pn(e):window,a=s.visualViewport,l=!b3()&&r,c=(n.left+(l&&a?a.offsetLeft:0))/o,u=(n.top+(l&&a?a.offsetTop:0))/i,d=n.width/o,f=n.height/i;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function Ab(e){var t=Jl(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function x3(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&_b(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function ai(e){return pn(e).getComputedStyle(e)}function OG(e){return["table","td","th"].indexOf(No(e))>=0}function xs(e){return((ga(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ym(e){return No(e)==="html"?e:e.assignedSlot||e.parentNode||(_b(e)?e.host:null)||xs(e)}function SS(e){return!Nn(e)||ai(e).position==="fixed"?null:e.offsetParent}function _G(e){var t=/firefox/i.test(nv()),r=/Trident/i.test(nv());if(r&&Nn(e)){var n=ai(e);if(n.position==="fixed")return null}var o=Ym(e);for(_b(o)&&(o=o.host);Nn(o)&&["html","body"].indexOf(No(o))<0;){var i=ai(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function Yd(e){for(var t=pn(e),r=SS(e);r&&OG(r)&&ai(r).position==="static";)r=SS(r);return r&&(No(r)==="html"||No(r)==="body"&&ai(r).position==="static")?t:r||_G(e)||t}function Nb(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Au(e,t,r){return ea(e,yh(t,r))}function AG(e,t,r){var n=Au(e,t,r);return n>r?r:n}function k3(){return{top:0,right:0,bottom:0,left:0}}function w3(e){return Object.assign({},k3(),e)}function S3(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var NG=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,w3(typeof t!="number"?t:S3(t,Gd))};function RG(e){var t,r=e.state,n=e.name,o=e.options,i=r.elements.arrow,s=r.modifiersData.popperOffsets,a=Co(r.placement),l=Nb(a),c=[Vr,In].indexOf(a)>=0,u=c?"height":"width";if(!(!i||!s)){var d=NG(o.padding,r),f=Ab(i),p=l==="y"?Fr:Vr,h=l==="y"?Ln:In,m=r.rects.reference[u]+r.rects.reference[l]-s[l]-r.rects.popper[u],b=s[l]-r.rects.reference[l],v=Yd(i),g=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,y=m/2-b/2,x=d[p],k=g-f[u]-d[h],w=g/2-f[u]/2+y,E=Au(x,w,k),M=l;r.modifiersData[n]=(t={},t[M]=E,t.centerOffset=E-w,t)}}function PG(e){var t=e.state,r=e.options,n=r.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||x3(t.elements.popper,o)&&(t.elements.arrow=o))}const zG={name:"arrow",enabled:!0,phase:"main",fn:RG,effect:PG,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Xl(e){return e.split("-")[1]}var LG={top:"auto",right:"auto",bottom:"auto",left:"auto"};function IG(e,t){var r=e.x,n=e.y,o=t.devicePixelRatio||1;return{x:Yl(r*o)/o||0,y:Yl(n*o)/o||0}}function ES(e){var t,r=e.popper,n=e.popperRect,o=e.placement,i=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=s.x,p=f===void 0?0:f,h=s.y,m=h===void 0?0:h,b=typeof u=="function"?u({x:p,y:m}):{x:p,y:m};p=b.x,m=b.y;var v=s.hasOwnProperty("x"),g=s.hasOwnProperty("y"),y=Vr,x=Fr,k=window;if(c){var w=Yd(r),E="clientHeight",M="clientWidth";if(w===pn(r)&&(w=xs(r),ai(w).position!=="static"&&a==="absolute"&&(E="scrollHeight",M="scrollWidth")),w=w,o===Fr||(o===Vr||o===In)&&i===gd){x=Ln;var C=d&&w===k&&k.visualViewport?k.visualViewport.height:w[E];m-=C-n.height,m*=l?1:-1}if(o===Vr||(o===Fr||o===Ln)&&i===gd){y=In;var T=d&&w===k&&k.visualViewport?k.visualViewport.width:w[M];p-=T-n.width,p*=l?1:-1}}var N=Object.assign({position:a},c&&LG),z=u===!0?IG({x:p,y:m},pn(r)):{x:p,y:m};if(p=z.x,m=z.y,l){var D;return Object.assign({},N,(D={},D[x]=g?"0":"",D[y]=v?"0":"",D.transform=(k.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",D))}return Object.assign({},N,(t={},t[x]=g?m+"px":"",t[y]=v?p+"px":"",t.transform="",t))}function DG(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=n===void 0?!0:n,i=r.adaptive,s=i===void 0?!0:i,a=r.roundOffsets,l=a===void 0?!0:a,c={placement:Co(t.placement),variation:Xl(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,ES(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,ES(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const $G={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:DG,data:{}};var Cf={passive:!0};function HG(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,i=o===void 0?!0:o,s=n.resize,a=s===void 0?!0:s,l=pn(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",r.update,Cf)}),a&&l.addEventListener("resize",r.update,Cf),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",r.update,Cf)}),a&&l.removeEventListener("resize",r.update,Cf)}}const BG={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:HG,data:{}};var FG={left:"right",right:"left",bottom:"top",top:"bottom"};function hp(e){return e.replace(/left|right|bottom|top/g,function(t){return FG[t]})}var VG={start:"end",end:"start"};function CS(e){return e.replace(/start|end/g,function(t){return VG[t]})}function Rb(e){var t=pn(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function Pb(e){return Jl(xs(e)).left+Rb(e).scrollLeft}function jG(e,t){var r=pn(e),n=xs(e),o=r.visualViewport,i=n.clientWidth,s=n.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;var c=b3();(c||!c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a+Pb(e),y:l}}function UG(e){var t,r=xs(e),n=Rb(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=ea(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=ea(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-n.scrollLeft+Pb(e),l=-n.scrollTop;return ai(o||r).direction==="rtl"&&(a+=ea(r.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function zb(e){var t=ai(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function E3(e){return["html","body","#document"].indexOf(No(e))>=0?e.ownerDocument.body:Nn(e)&&zb(e)?e:E3(Ym(e))}function Nu(e,t){var r;t===void 0&&(t=[]);var n=E3(e),o=n===((r=e.ownerDocument)==null?void 0:r.body),i=pn(n),s=o?[i].concat(i.visualViewport||[],zb(n)?n:[]):n,a=t.concat(s);return o?a:a.concat(Nu(Ym(s)))}function ov(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function WG(e,t){var r=Jl(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function MS(e,t,r){return t===v3?ov(jG(e,r)):ga(t)?WG(t,r):ov(UG(xs(e)))}function KG(e){var t=Nu(Ym(e)),r=["absolute","fixed"].indexOf(ai(e).position)>=0,n=r&&Nn(e)?Yd(e):e;return ga(n)?t.filter(function(o){return ga(o)&&x3(o,n)&&No(o)!=="body"}):[]}function qG(e,t,r,n){var o=t==="clippingParents"?KG(e):[].concat(t),i=[].concat(o,[r]),s=i[0],a=i.reduce(function(l,c){var u=MS(e,c,n);return l.top=ea(u.top,l.top),l.right=yh(u.right,l.right),l.bottom=yh(u.bottom,l.bottom),l.left=ea(u.left,l.left),l},MS(e,s,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function C3(e){var t=e.reference,r=e.element,n=e.placement,o=n?Co(n):null,i=n?Xl(n):null,s=t.x+t.width/2-r.width/2,a=t.y+t.height/2-r.height/2,l;switch(o){case Fr:l={x:s,y:t.y-r.height};break;case Ln:l={x:s,y:t.y+t.height};break;case In:l={x:t.x+t.width,y:a};break;case Vr:l={x:t.x-r.width,y:a};break;default:l={x:t.x,y:t.y}}var c=o?Nb(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case Gl:l[c]=l[c]-(t[u]/2-r[u]/2);break;case gd:l[c]=l[c]+(t[u]/2-r[u]/2);break}}return l}function vd(e,t){t===void 0&&(t={});var r=t,n=r.placement,o=n===void 0?e.placement:n,i=r.strategy,s=i===void 0?e.strategy:i,a=r.boundary,l=a===void 0?pG:a,c=r.rootBoundary,u=c===void 0?v3:c,d=r.elementContext,f=d===void 0?_c:d,p=r.altBoundary,h=p===void 0?!1:p,m=r.padding,b=m===void 0?0:m,v=w3(typeof b!="number"?b:S3(b,Gd)),g=f===_c?hG:_c,y=e.rects.popper,x=e.elements[h?g:f],k=qG(ga(x)?x:x.contextElement||xs(e.elements.popper),l,u,s),w=Jl(e.elements.reference),E=C3({reference:w,element:y,strategy:"absolute",placement:o}),M=ov(Object.assign({},y,E)),C=f===_c?M:w,T={top:k.top-C.top+v.top,bottom:C.bottom-k.bottom+v.bottom,left:k.left-C.left+v.left,right:C.right-k.right+v.right},N=e.modifiersData.offset;if(f===_c&&N){var z=N[o];Object.keys(T).forEach(function(D){var V=[In,Ln].indexOf(D)>=0?1:-1,j=[Fr,Ln].indexOf(D)>=0?"y":"x";T[D]+=z[j]*V})}return T}function GG(e,t){t===void 0&&(t={});var r=t,n=r.placement,o=r.boundary,i=r.rootBoundary,s=r.padding,a=r.flipVariations,l=r.allowedAutoPlacements,c=l===void 0?y3:l,u=Xl(n),d=u?a?wS:wS.filter(function(h){return Xl(h)===u}):Gd,f=d.filter(function(h){return c.indexOf(h)>=0});f.length===0&&(f=d);var p=f.reduce(function(h,m){return h[m]=vd(e,{placement:m,boundary:o,rootBoundary:i,padding:s})[Co(m)],h},{});return Object.keys(p).sort(function(h,m){return p[h]-p[m]})}function YG(e){if(Co(e)===Ob)return[];var t=hp(e);return[CS(e),t,CS(t)]}function JG(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=r.mainAxis,i=o===void 0?!0:o,s=r.altAxis,a=s===void 0?!0:s,l=r.fallbackPlacements,c=r.padding,u=r.boundary,d=r.rootBoundary,f=r.altBoundary,p=r.flipVariations,h=p===void 0?!0:p,m=r.allowedAutoPlacements,b=t.options.placement,v=Co(b),g=v===b,y=l||(g||!h?[hp(b)]:YG(b)),x=[b].concat(y).reduce(function(ie,ue){return ie.concat(Co(ue)===Ob?GG(t,{placement:ue,boundary:u,rootBoundary:d,padding:c,flipVariations:h,allowedAutoPlacements:m}):ue)},[]),k=t.rects.reference,w=t.rects.popper,E=new Map,M=!0,C=x[0],T=0;T=0,j=V?"width":"height",L=vd(t,{placement:N,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),q=V?D?In:Vr:D?Ln:Fr;k[j]>w[j]&&(q=hp(q));var A=hp(q),P=[];if(i&&P.push(L[z]<=0),a&&P.push(L[q]<=0,L[A]<=0),P.every(function(ie){return ie})){C=N,M=!1;break}E.set(N,P)}if(M)for(var F=h?3:1,Y=function(ue){var de=x.find(function(me){var Me=E.get(me);if(Me)return Me.slice(0,ue).every(function(Se){return Se})});if(de)return C=de,"break"},J=F;J>0;J--){var Ne=Y(J);if(Ne==="break")break}t.placement!==C&&(t.modifiersData[n]._skip=!0,t.placement=C,t.reset=!0)}}const XG={name:"flip",enabled:!0,phase:"main",fn:JG,requiresIfExists:["offset"],data:{_skip:!1}};function TS(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function OS(e){return[Fr,In,Ln,Vr].some(function(t){return e[t]>=0})}function QG(e){var t=e.state,r=e.name,n=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=vd(t,{elementContext:"reference"}),a=vd(t,{altBoundary:!0}),l=TS(s,n),c=TS(a,o,i),u=OS(l),d=OS(c);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const ZG={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:QG};function eY(e,t,r){var n=Co(e),o=[Vr,Fr].indexOf(n)>=0?-1:1,i=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Vr,In].indexOf(n)>=0?{x:a,y:s}:{x:s,y:a}}function tY(e){var t=e.state,r=e.options,n=e.name,o=r.offset,i=o===void 0?[0,0]:o,s=y3.reduce(function(u,d){return u[d]=eY(d,t.rects,i),u},{}),a=s[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=s}const rY={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:tY};function nY(e){var t=e.state,r=e.name;t.modifiersData[r]=C3({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const oY={name:"popperOffsets",enabled:!0,phase:"read",fn:nY,data:{}};function iY(e){return e==="x"?"y":"x"}function sY(e){var t=e.state,r=e.options,n=e.name,o=r.mainAxis,i=o===void 0?!0:o,s=r.altAxis,a=s===void 0?!1:s,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,d=r.padding,f=r.tether,p=f===void 0?!0:f,h=r.tetherOffset,m=h===void 0?0:h,b=vd(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),v=Co(t.placement),g=Xl(t.placement),y=!g,x=Nb(v),k=iY(x),w=t.modifiersData.popperOffsets,E=t.rects.reference,M=t.rects.popper,C=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,T=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,z={x:0,y:0};if(w){if(i){var D,V=x==="y"?Fr:Vr,j=x==="y"?Ln:In,L=x==="y"?"height":"width",q=w[x],A=q+b[V],P=q-b[j],F=p?-M[L]/2:0,Y=g===Gl?E[L]:M[L],J=g===Gl?-M[L]:-E[L],Ne=t.elements.arrow,ie=p&&Ne?Ab(Ne):{width:0,height:0},ue=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:k3(),de=ue[V],me=ue[j],Me=Au(0,E[L],ie[L]),Se=y?E[L]/2-F-Me-de-T.mainAxis:Y-Me-de-T.mainAxis,ft=y?-E[L]/2+F+Me+me+T.mainAxis:J+Me+me+T.mainAxis,rt=t.elements.arrow&&Yd(t.elements.arrow),Or=rt?x==="y"?rt.clientTop||0:rt.clientLeft||0:0,he=(D=N==null?void 0:N[x])!=null?D:0,De=q+Se-he-Or,Ke=q+ft-he,Fn=Au(p?yh(A,De):A,q,p?ea(P,Ke):P);w[x]=Fn,z[x]=Fn-q}if(a){var Gr,nr=x==="x"?Fr:Vr,zo=x==="x"?Ln:In,Pt=w[k],Yr=k==="y"?"height":"width",vn=Pt+b[nr],Vn=Pt-b[zo],Xe=[Fr,Vr].indexOf(v)!==-1,Jr=(Gr=N==null?void 0:N[k])!=null?Gr:0,yn=Xe?vn:Pt-E[Yr]-M[Yr]-Jr+T.altAxis,gi=Xe?Pt+E[Yr]+M[Yr]-Jr-T.altAxis:Vn,Oa=p&&Xe?AG(yn,Pt,gi):Au(p?yn:vn,Pt,p?gi:Vn);w[k]=Oa,z[k]=Oa-Pt}t.modifiersData[n]=z}}const aY={name:"preventOverflow",enabled:!0,phase:"main",fn:sY,requiresIfExists:["offset"]};function lY(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function cY(e){return e===pn(e)||!Nn(e)?Rb(e):lY(e)}function uY(e){var t=e.getBoundingClientRect(),r=Yl(t.width)/e.offsetWidth||1,n=Yl(t.height)/e.offsetHeight||1;return r!==1||n!==1}function dY(e,t,r){r===void 0&&(r=!1);var n=Nn(t),o=Nn(t)&&uY(t),i=xs(t),s=Jl(e,o,r),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!r)&&((No(t)!=="body"||zb(i))&&(a=cY(t)),Nn(t)?(l=Jl(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=Pb(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function fY(e){var t=new Map,r=new Set,n=[];e.forEach(function(i){t.set(i.name,i)});function o(i){r.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!r.has(a)){var l=t.get(a);l&&o(l)}}),n.push(i)}return e.forEach(function(i){r.has(i.name)||o(i)}),n}function pY(e){var t=fY(e);return EG.reduce(function(r,n){return r.concat(t.filter(function(o){return o.phase===n}))},[])}function hY(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function mY(e){var t=e.reduce(function(r,n){var o=r[n.name];return r[n.name]=o?Object.assign({},o,n,{options:Object.assign({},o.options,n.options),data:Object.assign({},o.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var _S={placement:"bottom",modifiers:[],strategy:"absolute"};function AS(){for(var e=arguments.length,t=new Array(e),r=0;r{i||a(bY(o)||document.body)},[o,i]),pa(()=>{if(s&&!i)return J0(r,s),()=>{J0(r,null)}},[r,s,i]),i){if(S.isValidElement(n)){const c={ref:l};return S.cloneElement(n,c)}return O.jsx(S.Fragment,{children:n})}return O.jsx(S.Fragment,{children:s&&lm.createPortal(n,s)})});function xY(e){return Vt("MuiPopper",e)}jt("MuiPopper",["root"]);const kY=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],wY=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function SY(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function iv(e){return typeof e=="function"?e():e}function EY(e){return e.nodeType!==void 0}const CY=()=>rr({root:["root"]},tG(xY)),MY={},TY=S.forwardRef(function(t,r){var n;const{anchorEl:o,children:i,direction:s,disablePortal:a,modifiers:l,open:c,placement:u,popperOptions:d,popperRef:f,slotProps:p={},slots:h={},TransitionProps:m}=t,b=ve(t,kY),v=S.useRef(null),g=Ur(v,r),y=S.useRef(null),x=Ur(y,f),k=S.useRef(x);pa(()=>{k.current=x},[x]),S.useImperativeHandle(f,()=>y.current,[]);const w=SY(u,s),[E,M]=S.useState(w),[C,T]=S.useState(iv(o));S.useEffect(()=>{y.current&&y.current.forceUpdate()}),S.useEffect(()=>{o&&T(iv(o))},[o]),pa(()=>{if(!C||!c)return;const j=A=>{M(A.placement)};let L=[{name:"preventOverflow",options:{altBoundary:a}},{name:"flip",options:{altBoundary:a}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:A})=>{j(A)}}];l!=null&&(L=L.concat(l)),d&&d.modifiers!=null&&(L=L.concat(d.modifiers));const q=yY(C,v.current,_({placement:w},d,{modifiers:L}));return k.current(q),()=>{q.destroy(),k.current(null)}},[C,a,l,c,d,w]);const N={placement:E};m!==null&&(N.TransitionProps=m);const z=CY(),D=(n=h.root)!=null?n:"div",V=si({elementType:D,externalSlotProps:p.root,externalForwardedProps:b,additionalProps:{role:"tooltip",ref:g},ownerState:t,className:z.root});return O.jsx(D,_({},V,{children:typeof i=="function"?i(N):i}))}),OY=S.forwardRef(function(t,r){const{anchorEl:n,children:o,container:i,direction:s="ltr",disablePortal:a=!1,keepMounted:l=!1,modifiers:c,open:u,placement:d="bottom",popperOptions:f=MY,popperRef:p,style:h,transition:m=!1,slotProps:b={},slots:v={}}=t,g=ve(t,wY),[y,x]=S.useState(!0),k=()=>{x(!1)},w=()=>{x(!0)};if(!l&&!u&&(!m||y))return null;let E;if(i)E=i;else if(n){const T=iv(n);E=T&&EY(T)?Br(T).body:Br(null).body}const M=!u&&l&&(!m||y)?"none":void 0,C=m?{in:u,onEnter:k,onExited:w}:void 0;return O.jsx(M3,{disablePortal:a,container:E,children:O.jsx(TY,_({anchorEl:n,direction:s,disablePortal:a,modifiers:c,ref:r,open:m?!y:u,placement:d,popperOptions:f,popperRef:p,slotProps:b,slots:v},g,{style:_({position:"fixed",top:0,left:0,display:M},h),TransitionProps:C,children:o}))})});function _Y(e){const t=Br(e);return t.body===e?fd(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function Ru(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function NS(e){return parseInt(fd(e).getComputedStyle(e).paddingRight,10)||0}function AY(e){const r=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName)!==-1,n=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return r||n}function RS(e,t,r,n,o){const i=[t,r,...n];[].forEach.call(e.children,s=>{const a=i.indexOf(s)===-1,l=!AY(s);a&&l&&Ru(s,o)})}function o1(e,t){let r=-1;return e.some((n,o)=>t(n)?(r=o,!0):!1),r}function NY(e,t){const r=[],n=e.container;if(!t.disableScrollLock){if(_Y(n)){const s=LT(Br(n));r.push({value:n.style.paddingRight,property:"padding-right",el:n}),n.style.paddingRight=`${NS(n)+s}px`;const a=Br(n).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{r.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${NS(l)+s}px`})}let i;if(n.parentNode instanceof DocumentFragment)i=Br(n).body;else{const s=n.parentElement,a=fd(n);i=(s==null?void 0:s.nodeName)==="HTML"&&a.getComputedStyle(s).overflowY==="scroll"?s:n}r.push({value:i.style.overflow,property:"overflow",el:i},{value:i.style.overflowX,property:"overflow-x",el:i},{value:i.style.overflowY,property:"overflow-y",el:i}),i.style.overflow="hidden"}return()=>{r.forEach(({value:i,el:s,property:a})=>{i?s.style.setProperty(a,i):s.style.removeProperty(a)})}}function RY(e){const t=[];return[].forEach.call(e.children,r=>{r.getAttribute("aria-hidden")==="true"&&t.push(r)}),t}class PY{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(t,r){let n=this.modals.indexOf(t);if(n!==-1)return n;n=this.modals.length,this.modals.push(t),t.modalRef&&Ru(t.modalRef,!1);const o=RY(r);RS(r,t.mount,t.modalRef,o,!0);const i=o1(this.containers,s=>s.container===r);return i!==-1?(this.containers[i].modals.push(t),n):(this.containers.push({modals:[t],container:r,restore:null,hiddenSiblings:o}),n)}mount(t,r){const n=o1(this.containers,i=>i.modals.indexOf(t)!==-1),o=this.containers[n];o.restore||(o.restore=NY(o,r))}remove(t,r=!0){const n=this.modals.indexOf(t);if(n===-1)return n;const o=o1(this.containers,s=>s.modals.indexOf(t)!==-1),i=this.containers[o];if(i.modals.splice(i.modals.indexOf(t),1),this.modals.splice(n,1),i.modals.length===0)i.restore&&i.restore(),t.modalRef&&Ru(t.modalRef,r),RS(i.container,t.mount,t.modalRef,i.hiddenSiblings,!1),this.containers.splice(o,1);else{const s=i.modals[i.modals.length-1];s.modalRef&&Ru(s.modalRef,!1)}return n}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function zY(e){return typeof e=="function"?e():e}function LY(e){return e?e.props.hasOwnProperty("in"):!1}const IY=new PY;function DY(e){const{container:t,disableEscapeKeyDown:r=!1,disableScrollLock:n=!1,manager:o=IY,closeAfterTransition:i=!1,onTransitionEnter:s,onTransitionExited:a,children:l,onClose:c,open:u,rootRef:d}=e,f=S.useRef({}),p=S.useRef(null),h=S.useRef(null),m=Ur(h,d),[b,v]=S.useState(!u),g=LY(l);let y=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(y=!1);const x=()=>Br(p.current),k=()=>(f.current.modalRef=h.current,f.current.mount=p.current,f.current),w=()=>{o.mount(k(),{disableScrollLock:n}),h.current&&(h.current.scrollTop=0)},E=Ws(()=>{const L=zY(t)||x().body;o.add(k(),L),h.current&&w()}),M=S.useCallback(()=>o.isTopModal(k()),[o]),C=Ws(L=>{p.current=L,L&&(u&&M()?w():h.current&&Ru(h.current,y))}),T=S.useCallback(()=>{o.remove(k(),y)},[y,o]);S.useEffect(()=>()=>{T()},[T]),S.useEffect(()=>{u?E():(!g||!i)&&T()},[u,T,g,i,E]);const N=L=>q=>{var A;(A=L.onKeyDown)==null||A.call(L,q),!(q.key!=="Escape"||!M())&&(r||(q.stopPropagation(),c&&c(q,"escapeKeyDown")))},z=L=>q=>{var A;(A=L.onClick)==null||A.call(L,q),q.target===q.currentTarget&&c&&c(q,"backdropClick")};return{getRootProps:(L={})=>{const q=g3(e);delete q.onTransitionEnter,delete q.onTransitionExited;const A=_({},q,L);return _({role:"presentation"},A,{onKeyDown:N(A),ref:m})},getBackdropProps:(L={})=>{const q=L;return _({"aria-hidden":!0},q,{onClick:z(q),open:u})},getTransitionProps:()=>{const L=()=>{v(!1),s&&s()},q=()=>{v(!0),a&&a(),i&&T()};return{onEnter:jw(L,l==null?void 0:l.props.onEnter),onExited:jw(q,l==null?void 0:l.props.onExited)}},rootRef:m,portalRef:C,isTopModal:M,exited:b,hasTransition:g}}const $Y=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],HY=Je(OY,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),BY=S.forwardRef(function(t,r){var n;const o=yb(),i=Wt({props:t,name:"MuiPopper"}),{anchorEl:s,component:a,components:l,componentsProps:c,container:u,disablePortal:d,keepMounted:f,modifiers:p,open:h,placement:m,popperOptions:b,popperRef:v,transition:g,slots:y,slotProps:x}=i,k=ve(i,$Y),w=(n=y==null?void 0:y.root)!=null?n:l==null?void 0:l.Root,E=_({anchorEl:s,container:u,disablePortal:d,keepMounted:f,modifiers:p,open:h,placement:m,popperOptions:b,popperRef:v,transition:g},k);return O.jsx(HY,_({as:a,direction:o==null?void 0:o.direction,slots:{root:w},slotProps:x??c},E,{ref:r}))}),Lb=BY,FY=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],VY={entering:{opacity:1},entered:{opacity:1}},jY=S.forwardRef(function(t,r){const n=qm(),o={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:s=!0,children:a,easing:l,in:c,onEnter:u,onEntered:d,onEntering:f,onExit:p,onExited:h,onExiting:m,style:b,timeout:v=o,TransitionComponent:g=p3}=t,y=ve(t,FY),x=S.useRef(null),k=Ur(x,a.ref,r),w=V=>j=>{if(V){const L=x.current;j===void 0?V(L):V(L,j)}},E=w(f),M=w((V,j)=>{h3(V);const L=vh({style:b,timeout:v,easing:l},{mode:"enter"});V.style.webkitTransition=n.transitions.create("opacity",L),V.style.transition=n.transitions.create("opacity",L),u&&u(V,j)}),C=w(d),T=w(m),N=w(V=>{const j=vh({style:b,timeout:v,easing:l},{mode:"exit"});V.style.webkitTransition=n.transitions.create("opacity",j),V.style.transition=n.transitions.create("opacity",j),p&&p(V)}),z=w(h),D=V=>{i&&i(x.current,V)};return O.jsx(g,_({appear:s,in:c,nodeRef:x,onEnter:M,onEntered:C,onEntering:E,onExit:N,onExited:z,onExiting:T,addEndListener:D,timeout:v},y,{children:(V,j)=>S.cloneElement(a,_({style:_({opacity:0,visibility:V==="exited"&&!c?"hidden":void 0},VY[V],b,a.props.style),ref:k},j))}))}),UY=jY;function WY(e){return Vt("MuiBackdrop",e)}jt("MuiBackdrop",["root","invisible"]);const KY=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],qY=e=>{const{classes:t,invisible:r}=e;return rr({root:["root",r&&"invisible"]},WY,t)},GY=Je("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.invisible&&t.invisible]}})(({ownerState:e})=>_({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},e.invisible&&{backgroundColor:"transparent"})),YY=S.forwardRef(function(t,r){var n,o,i;const s=Wt({props:t,name:"MuiBackdrop"}),{children:a,className:l,component:c="div",components:u={},componentsProps:d={},invisible:f=!1,open:p,slotProps:h={},slots:m={},TransitionComponent:b=UY,transitionDuration:v}=s,g=ve(s,KY),y=_({},s,{component:c,invisible:f}),x=qY(y),k=(n=h.root)!=null?n:d.root;return O.jsx(b,_({in:p,timeout:v},g,{children:O.jsx(GY,_({"aria-hidden":!0},k,{as:(o=(i=m.root)!=null?i:u.Root)!=null?o:c,className:Ce(x.root,l,k==null?void 0:k.className),ownerState:_({},y,k==null?void 0:k.ownerState),classes:x,ref:r,children:a}))}))}),JY=YY;function XY(e){return Vt("MuiBadge",e)}const QY=jt("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),xi=QY,ZY=["anchorOrigin","className","classes","component","components","componentsProps","children","overlap","color","invisible","max","badgeContent","slots","slotProps","showZero","variant"],i1=10,s1=4,eJ=e=>{const{color:t,anchorOrigin:r,invisible:n,overlap:o,variant:i,classes:s={}}=e,a={root:["root"],badge:["badge",i,n&&"invisible",`anchorOrigin${Fe(r.vertical)}${Fe(r.horizontal)}`,`anchorOrigin${Fe(r.vertical)}${Fe(r.horizontal)}${Fe(o)}`,`overlap${Fe(o)}`,t!=="default"&&`color${Fe(t)}`]};return rr(a,XY,s)},tJ=Je("span",{name:"MuiBadge",slot:"Root",overridesResolver:(e,t)=>t.root})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),rJ=Je("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.badge,t[r.variant],t[`anchorOrigin${Fe(r.anchorOrigin.vertical)}${Fe(r.anchorOrigin.horizontal)}${Fe(r.overlap)}`],r.color!=="default"&&t[`color${Fe(r.color)}`],r.invisible&&t.invisible]}})(({theme:e,ownerState:t})=>_({display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(12),minWidth:i1*2,lineHeight:1,padding:"0 6px",height:i1*2,borderRadius:i1,zIndex:1,transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.enteringScreen})},t.color!=="default"&&{backgroundColor:(e.vars||e).palette[t.color].main,color:(e.vars||e).palette[t.color].contrastText},t.variant==="dot"&&{borderRadius:s1,height:s1*2,minWidth:s1*2,padding:0},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular"&&{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${xi.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular"&&{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${xi.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular"&&{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${xi.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular"&&{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${xi.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular"&&{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${xi.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular"&&{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${xi.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}},t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular"&&{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${xi.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}},t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular"&&{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${xi.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}},t.invisible&&{transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.leavingScreen})})),nJ=S.forwardRef(function(t,r){var n,o,i,s,a,l;const c=Wt({props:t,name:"MuiBadge"}),{anchorOrigin:u={vertical:"top",horizontal:"right"},className:d,component:f,components:p={},componentsProps:h={},children:m,overlap:b="rectangular",color:v="default",invisible:g=!1,max:y=99,badgeContent:x,slots:k,slotProps:w,showZero:E=!1,variant:M="standard"}=c,C=ve(c,ZY),{badgeContent:T,invisible:N,max:z,displayValue:D}=iG({max:y,invisible:g,badgeContent:x,showZero:E}),V=IT({anchorOrigin:u,color:v,overlap:b,variant:M,badgeContent:x}),j=N||T==null&&M!=="dot",{color:L=v,overlap:q=b,anchorOrigin:A=u,variant:P=M}=j?V:c,F=P!=="dot"?D:void 0,Y=_({},c,{badgeContent:T,invisible:j,max:z,displayValue:F,showZero:E,anchorOrigin:A,color:L,overlap:q,variant:P}),J=eJ(Y),Ne=(n=(o=k==null?void 0:k.root)!=null?o:p.Root)!=null?n:tJ,ie=(i=(s=k==null?void 0:k.badge)!=null?s:p.Badge)!=null?i:rJ,ue=(a=w==null?void 0:w.root)!=null?a:h.root,de=(l=w==null?void 0:w.badge)!=null?l:h.badge,me=si({elementType:Ne,externalSlotProps:ue,externalForwardedProps:C,additionalProps:{ref:r,as:f},ownerState:Y,className:Ce(ue==null?void 0:ue.className,J.root,d)}),Me=si({elementType:ie,externalSlotProps:de,ownerState:Y,className:Ce(J.badge,de==null?void 0:de.className)});return O.jsxs(Ne,_({},me,{children:[m,O.jsx(ie,_({},Me,{children:F}))]}))}),oJ=nJ,iJ=wb(),sJ=XW({themeId:Kl,defaultTheme:iJ,defaultClassName:"MuiBox-root",generateClassName:$T.generate}),T3=sJ;function aJ(e){return Vt("MuiModal",e)}jt("MuiModal",["root","hidden","backdrop"]);const lJ=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],cJ=e=>{const{open:t,exited:r,classes:n}=e;return rr({root:["root",!t&&r&&"hidden"],backdrop:["backdrop"]},aJ,n)},uJ=Je("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.open&&r.exited&&t.hidden]}})(({theme:e,ownerState:t})=>_({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),dJ=Je(JY,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),fJ=S.forwardRef(function(t,r){var n,o,i,s,a,l;const c=Wt({name:"MuiModal",props:t}),{BackdropComponent:u=dJ,BackdropProps:d,className:f,closeAfterTransition:p=!1,children:h,container:m,component:b,components:v={},componentsProps:g={},disableAutoFocus:y=!1,disableEnforceFocus:x=!1,disableEscapeKeyDown:k=!1,disablePortal:w=!1,disableRestoreFocus:E=!1,disableScrollLock:M=!1,hideBackdrop:C=!1,keepMounted:T=!1,onBackdropClick:N,open:z,slotProps:D,slots:V}=c,j=ve(c,lJ),L=_({},c,{closeAfterTransition:p,disableAutoFocus:y,disableEnforceFocus:x,disableEscapeKeyDown:k,disablePortal:w,disableRestoreFocus:E,disableScrollLock:M,hideBackdrop:C,keepMounted:T}),{getRootProps:q,getBackdropProps:A,getTransitionProps:P,portalRef:F,isTopModal:Y,exited:J,hasTransition:Ne}=DY(_({},L,{rootRef:r})),ie=_({},L,{exited:J}),ue=cJ(ie),de={};if(h.props.tabIndex===void 0&&(de.tabIndex="-1"),Ne){const{onEnter:he,onExited:De}=P();de.onEnter=he,de.onExited=De}const me=(n=(o=V==null?void 0:V.root)!=null?o:v.Root)!=null?n:uJ,Me=(i=(s=V==null?void 0:V.backdrop)!=null?s:v.Backdrop)!=null?i:u,Se=(a=D==null?void 0:D.root)!=null?a:g.root,ft=(l=D==null?void 0:D.backdrop)!=null?l:g.backdrop,rt=si({elementType:me,externalSlotProps:Se,externalForwardedProps:j,getSlotProps:q,additionalProps:{ref:r,as:b},ownerState:ie,className:Ce(f,Se==null?void 0:Se.className,ue==null?void 0:ue.root,!ie.open&&ie.exited&&(ue==null?void 0:ue.hidden))}),Or=si({elementType:Me,externalSlotProps:ft,additionalProps:d,getSlotProps:he=>A(_({},he,{onClick:De=>{N&&N(De),he!=null&&he.onClick&&he.onClick(De)}})),className:Ce(ft==null?void 0:ft.className,d==null?void 0:d.className,ue==null?void 0:ue.backdrop),ownerState:ie});return!T&&!z&&(!Ne||J)?null:O.jsx(M3,{ref:F,container:m,disablePortal:w,children:O.jsxs(me,_({},rt,{children:[!C&&u?O.jsx(Me,_({},Or)):null,O.jsx(fG,{disableEnforceFocus:x,disableAutoFocus:y,disableRestoreFocus:E,isEnabled:Y,open:z,children:S.cloneElement(h,de)})]}))})}),pJ=fJ,hJ=jt("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),PS=hJ,mJ=_K({createStyledComponent:Je("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>Wt({props:e,name:"MuiStack"})}),gJ=mJ,vJ=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function sv(e){return`scale(${e}, ${e**2})`}const yJ={entering:{opacity:1,transform:sv(1)},entered:{opacity:1,transform:"none"}},a1=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),O3=S.forwardRef(function(t,r){const{addEndListener:n,appear:o=!0,children:i,easing:s,in:a,onEnter:l,onEntered:c,onEntering:u,onExit:d,onExited:f,onExiting:p,style:h,timeout:m="auto",TransitionComponent:b=p3}=t,v=ve(t,vJ),g=S.useRef(),y=S.useRef(),x=qm(),k=S.useRef(null),w=Ur(k,i.ref,r),E=j=>L=>{if(j){const q=k.current;L===void 0?j(q):j(q,L)}},M=E(u),C=E((j,L)=>{h3(j);const{duration:q,delay:A,easing:P}=vh({style:h,timeout:m,easing:s},{mode:"enter"});let F;m==="auto"?(F=x.transitions.getAutoHeightDuration(j.clientHeight),y.current=F):F=q,j.style.transition=[x.transitions.create("opacity",{duration:F,delay:A}),x.transitions.create("transform",{duration:a1?F:F*.666,delay:A,easing:P})].join(","),l&&l(j,L)}),T=E(c),N=E(p),z=E(j=>{const{duration:L,delay:q,easing:A}=vh({style:h,timeout:m,easing:s},{mode:"exit"});let P;m==="auto"?(P=x.transitions.getAutoHeightDuration(j.clientHeight),y.current=P):P=L,j.style.transition=[x.transitions.create("opacity",{duration:P,delay:q}),x.transitions.create("transform",{duration:a1?P:P*.666,delay:a1?q:q||P*.333,easing:A})].join(","),j.style.opacity=0,j.style.transform=sv(.75),d&&d(j)}),D=E(f),V=j=>{m==="auto"&&(g.current=setTimeout(j,y.current||0)),n&&n(k.current,j)};return S.useEffect(()=>()=>{clearTimeout(g.current)},[]),O.jsx(b,_({appear:o,in:a,nodeRef:k,onEnter:C,onEntered:T,onEntering:M,onExit:z,onExited:D,onExiting:N,addEndListener:V,timeout:m==="auto"?null:m},v,{children:(j,L)=>S.cloneElement(i,_({style:_({opacity:0,transform:sv(.75),visibility:j==="exited"&&!a?"hidden":void 0},yJ[j],h,i.props.style),ref:w},L))}))});O3.muiSupportAuto=!0;const av=O3,bJ=S.createContext({}),yd=bJ;function xJ(e){return Vt("MuiList",e)}jt("MuiList",["root","padding","dense","subheader"]);const kJ=["children","className","component","dense","disablePadding","subheader"],wJ=e=>{const{classes:t,disablePadding:r,dense:n,subheader:o}=e;return rr({root:["root",!r&&"padding",n&&"dense",o&&"subheader"]},xJ,t)},SJ=Je("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disablePadding&&t.padding,r.dense&&t.dense,r.subheader&&t.subheader]}})(({ownerState:e})=>_({listStyle:"none",margin:0,padding:0,position:"relative"},!e.disablePadding&&{paddingTop:8,paddingBottom:8},e.subheader&&{paddingTop:0})),EJ=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiList"}),{children:o,className:i,component:s="ul",dense:a=!1,disablePadding:l=!1,subheader:c}=n,u=ve(n,kJ),d=S.useMemo(()=>({dense:a}),[a]),f=_({},n,{component:s,dense:a,disablePadding:l}),p=wJ(f);return O.jsx(yd.Provider,{value:d,children:O.jsxs(SJ,_({as:s,className:Ce(p.root,i),ref:r,ownerState:f},u,{children:[c,o]}))})}),CJ=EJ;function MJ(e){return Vt("MuiListItemIcon",e)}const TJ=jt("MuiListItemIcon",["root","alignItemsFlexStart"]),zS=TJ,OJ=["className"],_J=e=>{const{alignItems:t,classes:r}=e;return rr({root:["root",t==="flex-start"&&"alignItemsFlexStart"]},MJ,r)},AJ=Je("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.alignItems==="flex-start"&&t.alignItemsFlexStart]}})(({theme:e,ownerState:t})=>_({minWidth:56,color:(e.vars||e).palette.action.active,flexShrink:0,display:"inline-flex"},t.alignItems==="flex-start"&&{marginTop:8})),NJ=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiListItemIcon"}),{className:o}=n,i=ve(n,OJ),s=S.useContext(yd),a=_({},n,{alignItems:s.alignItems}),l=_J(a);return O.jsx(AJ,_({className:Ce(l.root,o),ownerState:a,ref:r},i))}),RJ=NJ;function PJ(e){return Vt("MuiListItemText",e)}const zJ=jt("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),bh=zJ,LJ=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],IJ=e=>{const{classes:t,inset:r,primary:n,secondary:o,dense:i}=e;return rr({root:["root",r&&"inset",i&&"dense",n&&o&&"multiline"],primary:["primary"],secondary:["secondary"]},PJ,t)},DJ=Je("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${bh.primary}`]:t.primary},{[`& .${bh.secondary}`]:t.secondary},t.root,r.inset&&t.inset,r.primary&&r.secondary&&t.multiline,r.dense&&t.dense]}})(({ownerState:e})=>_({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},e.primary&&e.secondary&&{marginTop:6,marginBottom:6},e.inset&&{paddingLeft:56})),$J=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiListItemText"}),{children:o,className:i,disableTypography:s=!1,inset:a=!1,primary:l,primaryTypographyProps:c,secondary:u,secondaryTypographyProps:d}=n,f=ve(n,LJ),{dense:p}=S.useContext(yd);let h=l??o,m=u;const b=_({},n,{disableTypography:s,inset:a,primary:!!h,secondary:!!m,dense:p}),v=IJ(b);return h!=null&&h.type!==cu&&!s&&(h=O.jsx(cu,_({variant:p?"body2":"body1",className:v.primary,component:c!=null&&c.variant?void 0:"span",display:"block"},c,{children:h}))),m!=null&&m.type!==cu&&!s&&(m=O.jsx(cu,_({variant:"body2",className:v.secondary,color:"text.secondary",display:"block"},d,{children:m}))),O.jsxs(DJ,_({className:Ce(v.root,i),ownerState:b,ref:r},f,{children:[h,m]}))}),HJ=$J,BJ=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function l1(e,t,r){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:r?null:e.firstChild}function LS(e,t,r){return e===t?r?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:r?null:e.lastChild}function _3(e,t){if(t===void 0)return!0;let r=e.innerText;return r===void 0&&(r=e.textContent),r=r.trim().toLowerCase(),r.length===0?!1:t.repeating?r[0]===t.keys[0]:r.indexOf(t.keys.join(""))===0}function Ac(e,t,r,n,o,i){let s=!1,a=o(e,t,t?r:!1);for(;a;){if(a===e.firstChild){if(s)return!1;s=!0}const l=n?!1:a.disabled||a.getAttribute("aria-disabled")==="true";if(!a.hasAttribute("tabindex")||!_3(a,i)||l)a=o(e,a,r);else return a.focus(),!0}return!1}const FJ=S.forwardRef(function(t,r){const{actions:n,autoFocus:o=!1,autoFocusItem:i=!1,children:s,className:a,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:d="selectedMenu"}=t,f=ve(t,BJ),p=S.useRef(null),h=S.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});pa(()=>{o&&p.current.focus()},[o]),S.useImperativeHandle(n,()=>({adjustStyleForScrollbar:(y,x)=>{const k=!p.current.style.width;if(y.clientHeight{const x=p.current,k=y.key,w=Br(x).activeElement;if(k==="ArrowDown")y.preventDefault(),Ac(x,w,c,l,l1);else if(k==="ArrowUp")y.preventDefault(),Ac(x,w,c,l,LS);else if(k==="Home")y.preventDefault(),Ac(x,null,c,l,l1);else if(k==="End")y.preventDefault(),Ac(x,null,c,l,LS);else if(k.length===1){const E=h.current,M=k.toLowerCase(),C=performance.now();E.keys.length>0&&(C-E.lastTime>500?(E.keys=[],E.repeating=!0,E.previousKeyMatched=!0):E.repeating&&M!==E.keys[0]&&(E.repeating=!1)),E.lastTime=C,E.keys.push(M);const T=w&&!E.repeating&&_3(w,E);E.previousKeyMatched&&(T||Ac(x,w,!1,l,l1,E))?y.preventDefault():E.previousKeyMatched=!1}u&&u(y)},b=Ur(p,r);let v=-1;S.Children.forEach(s,(y,x)=>{if(!S.isValidElement(y)){v===x&&(v+=1,v>=s.length&&(v=-1));return}y.props.disabled||(d==="selectedMenu"&&y.props.selected||v===-1)&&(v=x),v===x&&(y.props.disabled||y.props.muiSkipListHighlight||y.type.muiSkipListHighlight)&&(v+=1,v>=s.length&&(v=-1))});const g=S.Children.map(s,(y,x)=>{if(x===v){const k={};return i&&(k.autoFocus=!0),y.props.tabIndex===void 0&&d==="selectedMenu"&&(k.tabIndex=0),S.cloneElement(y,k)}return y});return O.jsx(CJ,_({role:"menu",ref:b,className:a,onKeyDown:m,tabIndex:o?0:-1},f,{children:g}))}),VJ=FJ;function jJ(e){return Vt("MuiPopover",e)}jt("MuiPopover",["root","paper"]);const UJ=["onEntering"],WJ=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],KJ=["slotProps"];function IS(e,t){let r=0;return typeof t=="number"?r=t:t==="center"?r=e.height/2:t==="bottom"&&(r=e.height),r}function DS(e,t){let r=0;return typeof t=="number"?r=t:t==="center"?r=e.width/2:t==="right"&&(r=e.width),r}function $S(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function c1(e){return typeof e=="function"?e():e}const qJ=e=>{const{classes:t}=e;return rr({root:["root"],paper:["paper"]},jJ,t)},GJ=Je(pJ,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),A3=Je(bq,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),YJ=S.forwardRef(function(t,r){var n,o,i;const s=Wt({props:t,name:"MuiPopover"}),{action:a,anchorEl:l,anchorOrigin:c={vertical:"top",horizontal:"left"},anchorPosition:u,anchorReference:d="anchorEl",children:f,className:p,container:h,elevation:m=8,marginThreshold:b=16,open:v,PaperProps:g={},slots:y,slotProps:x,transformOrigin:k={vertical:"top",horizontal:"left"},TransitionComponent:w=av,transitionDuration:E="auto",TransitionProps:{onEntering:M}={},disableScrollLock:C=!1}=s,T=ve(s.TransitionProps,UJ),N=ve(s,WJ),z=(n=x==null?void 0:x.paper)!=null?n:g,D=S.useRef(),V=Ur(D,z.ref),j=_({},s,{anchorOrigin:c,anchorReference:d,elevation:m,marginThreshold:b,externalPaperSlotProps:z,transformOrigin:k,TransitionComponent:w,transitionDuration:E,TransitionProps:T}),L=qJ(j),q=S.useCallback(()=>{if(d==="anchorPosition")return u;const he=c1(l),Ke=(he&&he.nodeType===1?he:Br(D.current).body).getBoundingClientRect();return{top:Ke.top+IS(Ke,c.vertical),left:Ke.left+DS(Ke,c.horizontal)}},[l,c.horizontal,c.vertical,u,d]),A=S.useCallback(he=>({vertical:IS(he,k.vertical),horizontal:DS(he,k.horizontal)}),[k.horizontal,k.vertical]),P=S.useCallback(he=>{const De={width:he.offsetWidth,height:he.offsetHeight},Ke=A(De);if(d==="none")return{top:null,left:null,transformOrigin:$S(Ke)};const Fn=q();let Gr=Fn.top-Ke.vertical,nr=Fn.left-Ke.horizontal;const zo=Gr+De.height,Pt=nr+De.width,Yr=fd(c1(l)),vn=Yr.innerHeight-b,Vn=Yr.innerWidth-b;if(b!==null&&Grvn){const Xe=zo-vn;Gr-=Xe,Ke.vertical+=Xe}if(b!==null&&nrVn){const Xe=Pt-Vn;nr-=Xe,Ke.horizontal+=Xe}return{top:`${Math.round(Gr)}px`,left:`${Math.round(nr)}px`,transformOrigin:$S(Ke)}},[l,d,q,A,b]),[F,Y]=S.useState(v),J=S.useCallback(()=>{const he=D.current;if(!he)return;const De=P(he);De.top!==null&&(he.style.top=De.top),De.left!==null&&(he.style.left=De.left),he.style.transformOrigin=De.transformOrigin,Y(!0)},[P]);S.useEffect(()=>(C&&window.addEventListener("scroll",J),()=>window.removeEventListener("scroll",J)),[l,C,J]);const Ne=(he,De)=>{M&&M(he,De),J()},ie=()=>{Y(!1)};S.useEffect(()=>{v&&J()}),S.useImperativeHandle(a,()=>v?{updatePosition:()=>{J()}}:null,[v,J]),S.useEffect(()=>{if(!v)return;const he=Lj(()=>{J()}),De=fd(l);return De.addEventListener("resize",he),()=>{he.clear(),De.removeEventListener("resize",he)}},[l,v,J]);let ue=E;E==="auto"&&!w.muiSupportAuto&&(ue=void 0);const de=h||(l?Br(c1(l)).body:void 0),me=(o=y==null?void 0:y.root)!=null?o:GJ,Me=(i=y==null?void 0:y.paper)!=null?i:A3,Se=si({elementType:Me,externalSlotProps:_({},z,{style:F?z.style:_({},z.style,{opacity:0})}),additionalProps:{elevation:m,ref:V},ownerState:j,className:Ce(L.paper,z==null?void 0:z.className)}),ft=si({elementType:me,externalSlotProps:(x==null?void 0:x.root)||{},externalForwardedProps:N,additionalProps:{ref:r,slotProps:{backdrop:{invisible:!0}},container:de,open:v},ownerState:j,className:Ce(L.root,p)}),{slotProps:rt}=ft,Or=ve(ft,KJ);return O.jsx(me,_({},Or,!m3(me)&&{slotProps:rt,disableScrollLock:C},{children:O.jsx(w,_({appear:!0,in:v,onEntering:Ne,onExited:ie,timeout:ue},T,{children:O.jsx(Me,_({},Se,{children:f}))}))}))}),JJ=YJ;function XJ(e){return Vt("MuiMenu",e)}jt("MuiMenu",["root","paper","list"]);const QJ=["onEntering"],ZJ=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],eX={vertical:"top",horizontal:"right"},tX={vertical:"top",horizontal:"left"},rX=e=>{const{classes:t}=e;return rr({root:["root"],paper:["paper"],list:["list"]},XJ,t)},nX=Je(JJ,{shouldForwardProp:e=>Eb(e)||e==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),oX=Je(A3,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),iX=Je(VJ,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),sX=S.forwardRef(function(t,r){var n,o;const i=Wt({props:t,name:"MuiMenu"}),{autoFocus:s=!0,children:a,className:l,disableAutoFocusItem:c=!1,MenuListProps:u={},onClose:d,open:f,PaperProps:p={},PopoverClasses:h,transitionDuration:m="auto",TransitionProps:{onEntering:b}={},variant:v="selectedMenu",slots:g={},slotProps:y={}}=i,x=ve(i.TransitionProps,QJ),k=ve(i,ZJ),w=qm(),E=w.direction==="rtl",M=_({},i,{autoFocus:s,disableAutoFocusItem:c,MenuListProps:u,onEntering:b,PaperProps:p,transitionDuration:m,TransitionProps:x,variant:v}),C=rX(M),T=s&&!c&&f,N=S.useRef(null),z=(P,F)=>{N.current&&N.current.adjustStyleForScrollbar(P,w),b&&b(P,F)},D=P=>{P.key==="Tab"&&(P.preventDefault(),d&&d(P,"tabKeyDown"))};let V=-1;S.Children.map(a,(P,F)=>{S.isValidElement(P)&&(P.props.disabled||(v==="selectedMenu"&&P.props.selected||V===-1)&&(V=F))});const j=(n=g.paper)!=null?n:oX,L=(o=y.paper)!=null?o:p,q=si({elementType:g.root,externalSlotProps:y.root,ownerState:M,className:[C.root,l]}),A=si({elementType:j,externalSlotProps:L,ownerState:M,className:C.paper});return O.jsx(nX,_({onClose:d,anchorOrigin:{vertical:"bottom",horizontal:E?"right":"left"},transformOrigin:E?eX:tX,slots:{paper:j,root:g.root},slotProps:{root:q,paper:A},open:f,ref:r,transitionDuration:m,TransitionProps:_({onEntering:z},x),ownerState:M},k,{classes:h,children:O.jsx(iX,_({onKeyDown:D,actions:N,autoFocus:s&&(V===-1||c),autoFocusItem:T,variant:v},u,{className:Ce(C.list,u.className),children:a}))}))}),aX=sX;function lX(e){return Vt("MuiMenuItem",e)}const cX=jt("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),Nc=cX,uX=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],dX=(e,t)=>{const{ownerState:r}=e;return[t.root,r.dense&&t.dense,r.divider&&t.divider,!r.disableGutters&&t.gutters]},fX=e=>{const{disabled:t,dense:r,divider:n,disableGutters:o,selected:i,classes:s}=e,l=rr({root:["root",r&&"dense",t&&"disabled",!o&&"gutters",n&&"divider",i&&"selected"]},lX,s);return _({},s,l)},pX=Je(Tb,{shouldForwardProp:e=>Eb(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:dX})(({theme:e,ownerState:t})=>_({},e.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Nc.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${Nc.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${Nc.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Lr(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${Nc.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Nc.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${PS.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${PS.inset}`]:{marginLeft:52},[`& .${bh.root}`]:{marginTop:0,marginBottom:0},[`& .${bh.inset}`]:{paddingLeft:36},[`& .${zS.root}`]:{minWidth:36}},!t.dense&&{[e.breakpoints.up("sm")]:{minHeight:"auto"}},t.dense&&_({minHeight:32,paddingTop:4,paddingBottom:4},e.typography.body2,{[`& .${zS.root} svg`]:{fontSize:"1.25rem"}}))),hX=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiMenuItem"}),{autoFocus:o=!1,component:i="li",dense:s=!1,divider:a=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:d,className:f}=n,p=ve(n,uX),h=S.useContext(yd),m=S.useMemo(()=>({dense:s||h.dense||!1,disableGutters:l}),[h.dense,s,l]),b=S.useRef(null);pa(()=>{o&&b.current&&b.current.focus()},[o]);const v=_({},n,{dense:m.dense,divider:a,disableGutters:l}),g=fX(n),y=Ur(b,r);let x;return n.disabled||(x=d!==void 0?d:-1),O.jsx(yd.Provider,{value:m,children:O.jsx(pX,_({ref:y,role:u,tabIndex:x,component:i,focusVisibleClassName:Ce(g.focusVisible,c),className:Ce(g.root,f)},p,{ownerState:v,classes:g}))})}),mX=hX;function gX(e){return Vt("MuiTooltip",e)}const vX=jt("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),Bi=vX,yX=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","slotProps","slots","title","TransitionComponent","TransitionProps"];function bX(e){return Math.round(e*1e5)/1e5}const xX=e=>{const{classes:t,disableInteractive:r,arrow:n,touch:o,placement:i}=e,s={popper:["popper",!r&&"popperInteractive",n&&"popperArrow"],tooltip:["tooltip",n&&"tooltipArrow",o&&"touch",`tooltipPlacement${Fe(i.split("-")[0])}`],arrow:["arrow"]};return rr(s,gX,t)},kX=Je(Lb,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.popper,!r.disableInteractive&&t.popperInteractive,r.arrow&&t.popperArrow,!r.open&&t.popperClose]}})(({theme:e,ownerState:t,open:r})=>_({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none"},!t.disableInteractive&&{pointerEvents:"auto"},!r&&{pointerEvents:"none"},t.arrow&&{[`&[data-popper-placement*="bottom"] .${Bi.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Bi.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Bi.arrow}`]:_({},t.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}}),[`&[data-popper-placement*="left"] .${Bi.arrow}`]:_({},t.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})),wX=Je("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.tooltip,r.touch&&t.touch,r.arrow&&t.tooltipArrow,t[`tooltipPlacement${Fe(r.placement.split("-")[0])}`]]}})(({theme:e,ownerState:t})=>_({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:Lr(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},t.arrow&&{position:"relative",margin:0},t.touch&&{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${bX(16/14)}em`,fontWeight:e.typography.fontWeightRegular},{[`.${Bi.popper}[data-popper-placement*="left"] &`]:_({transformOrigin:"right center"},t.isRtl?_({marginLeft:"14px"},t.touch&&{marginLeft:"24px"}):_({marginRight:"14px"},t.touch&&{marginRight:"24px"})),[`.${Bi.popper}[data-popper-placement*="right"] &`]:_({transformOrigin:"left center"},t.isRtl?_({marginRight:"14px"},t.touch&&{marginRight:"24px"}):_({marginLeft:"14px"},t.touch&&{marginLeft:"24px"})),[`.${Bi.popper}[data-popper-placement*="top"] &`]:_({transformOrigin:"center bottom",marginBottom:"14px"},t.touch&&{marginBottom:"24px"}),[`.${Bi.popper}[data-popper-placement*="bottom"] &`]:_({transformOrigin:"center top",marginTop:"14px"},t.touch&&{marginTop:"24px"})})),SX=Je("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:Lr(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}));let Mf=!1,u1=null,Rc={x:0,y:0};function Tf(e,t){return r=>{t&&t(r),e(r)}}const EX=S.forwardRef(function(t,r){var n,o,i,s,a,l,c,u,d,f,p,h,m,b,v,g,y,x,k;const w=Wt({props:t,name:"MuiTooltip"}),{arrow:E=!1,children:M,components:C={},componentsProps:T={},describeChild:N=!1,disableFocusListener:z=!1,disableHoverListener:D=!1,disableInteractive:V=!1,disableTouchListener:j=!1,enterDelay:L=100,enterNextDelay:q=0,enterTouchDelay:A=700,followCursor:P=!1,id:F,leaveDelay:Y=0,leaveTouchDelay:J=1500,onClose:Ne,onOpen:ie,open:ue,placement:de="bottom",PopperComponent:me,PopperProps:Me={},slotProps:Se={},slots:ft={},title:rt,TransitionComponent:Or=av,TransitionProps:he}=w,De=ve(w,yX),Ke=S.isValidElement(M)?M:O.jsx("span",{children:M}),Fn=qm(),Gr=Fn.direction==="rtl",[nr,zo]=S.useState(),[Pt,Yr]=S.useState(null),vn=S.useRef(!1),Vn=V||P,Xe=S.useRef(),Jr=S.useRef(),yn=S.useRef(),gi=S.useRef(),[Oa,fe]=Hj({controlled:ue,default:!1,name:"Tooltip",state:"open"});let bn=Oa;const fc=$j(F),vi=S.useRef(),pc=S.useCallback(()=>{vi.current!==void 0&&(document.body.style.WebkitUserSelect=vi.current,vi.current=void 0),clearTimeout(gi.current)},[]);S.useEffect(()=>()=>{clearTimeout(Xe.current),clearTimeout(Jr.current),clearTimeout(yn.current),pc()},[pc]);const Rx=ke=>{clearTimeout(u1),Mf=!0,fe(!0),ie&&!bn&&ie(ke)},ef=Ws(ke=>{clearTimeout(u1),u1=setTimeout(()=>{Mf=!1},800+Y),fe(!1),Ne&&bn&&Ne(ke),clearTimeout(Xe.current),Xe.current=setTimeout(()=>{vn.current=!1},Fn.transitions.duration.shortest)}),eg=ke=>{vn.current&&ke.type!=="touchstart"||(nr&&nr.removeAttribute("title"),clearTimeout(Jr.current),clearTimeout(yn.current),L||Mf&&q?Jr.current=setTimeout(()=>{Rx(ke)},Mf?q:L):Rx(ke))},Px=ke=>{clearTimeout(Jr.current),clearTimeout(yn.current),yn.current=setTimeout(()=>{ef(ke)},Y)},{isFocusVisibleRef:zx,onBlur:YO,onFocus:JO,ref:XO}=zT(),[,Lx]=S.useState(!1),Ix=ke=>{YO(ke),zx.current===!1&&(Lx(!1),Px(ke))},Dx=ke=>{nr||zo(ke.currentTarget),JO(ke),zx.current===!0&&(Lx(!0),eg(ke))},$x=ke=>{vn.current=!0;const Xr=Ke.props;Xr.onTouchStart&&Xr.onTouchStart(ke)},Hx=eg,Bx=Px,QO=ke=>{$x(ke),clearTimeout(yn.current),clearTimeout(Xe.current),pc(),vi.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",gi.current=setTimeout(()=>{document.body.style.WebkitUserSelect=vi.current,eg(ke)},A)},ZO=ke=>{Ke.props.onTouchEnd&&Ke.props.onTouchEnd(ke),pc(),clearTimeout(yn.current),yn.current=setTimeout(()=>{ef(ke)},J)};S.useEffect(()=>{if(!bn)return;function ke(Xr){(Xr.key==="Escape"||Xr.key==="Esc")&&ef(Xr)}return document.addEventListener("keydown",ke),()=>{document.removeEventListener("keydown",ke)}},[ef,bn]);const e_=Ur(Ke.ref,XO,zo,r);!rt&&rt!==0&&(bn=!1);const tg=S.useRef(),t_=ke=>{const Xr=Ke.props;Xr.onMouseMove&&Xr.onMouseMove(ke),Rc={x:ke.clientX,y:ke.clientY},tg.current&&tg.current.update()},hc={},rg=typeof rt=="string";N?(hc.title=!bn&&rg&&!D?rt:null,hc["aria-describedby"]=bn?fc:null):(hc["aria-label"]=rg?rt:null,hc["aria-labelledby"]=bn&&!rg?fc:null);const jn=_({},hc,De,Ke.props,{className:Ce(De.className,Ke.props.className),onTouchStart:$x,ref:e_},P?{onMouseMove:t_}:{}),mc={};j||(jn.onTouchStart=QO,jn.onTouchEnd=ZO),D||(jn.onMouseOver=Tf(Hx,jn.onMouseOver),jn.onMouseLeave=Tf(Bx,jn.onMouseLeave),Vn||(mc.onMouseOver=Hx,mc.onMouseLeave=Bx)),z||(jn.onFocus=Tf(Dx,jn.onFocus),jn.onBlur=Tf(Ix,jn.onBlur),Vn||(mc.onFocus=Dx,mc.onBlur=Ix));const r_=S.useMemo(()=>{var ke;let Xr=[{name:"arrow",enabled:!!Pt,options:{element:Pt,padding:4}}];return(ke=Me.popperOptions)!=null&&ke.modifiers&&(Xr=Xr.concat(Me.popperOptions.modifiers)),_({},Me.popperOptions,{modifiers:Xr})},[Pt,Me]),gc=_({},w,{isRtl:Gr,arrow:E,disableInteractive:Vn,placement:de,PopperComponentProp:me,touch:vn.current}),ng=xX(gc),Fx=(n=(o=ft.popper)!=null?o:C.Popper)!=null?n:kX,Vx=(i=(s=(a=ft.transition)!=null?a:C.Transition)!=null?s:Or)!=null?i:av,jx=(l=(c=ft.tooltip)!=null?c:C.Tooltip)!=null?l:wX,Ux=(u=(d=ft.arrow)!=null?d:C.Arrow)!=null?u:SX,n_=uu(Fx,_({},Me,(f=Se.popper)!=null?f:T.popper,{className:Ce(ng.popper,Me==null?void 0:Me.className,(p=(h=Se.popper)!=null?h:T.popper)==null?void 0:p.className)}),gc),o_=uu(Vx,_({},he,(m=Se.transition)!=null?m:T.transition),gc),i_=uu(jx,_({},(b=Se.tooltip)!=null?b:T.tooltip,{className:Ce(ng.tooltip,(v=(g=Se.tooltip)!=null?g:T.tooltip)==null?void 0:v.className)}),gc),s_=uu(Ux,_({},(y=Se.arrow)!=null?y:T.arrow,{className:Ce(ng.arrow,(x=(k=Se.arrow)!=null?k:T.arrow)==null?void 0:x.className)}),gc);return O.jsxs(S.Fragment,{children:[S.cloneElement(Ke,jn),O.jsx(Fx,_({as:me??Lb,placement:de,anchorEl:P?{getBoundingClientRect:()=>({top:Rc.y,left:Rc.x,right:Rc.x,bottom:Rc.y,width:0,height:0})}:nr,popperRef:tg,open:nr?bn:!1,id:fc,transition:!0},mc,n_,{popperOptions:r_,children:({TransitionProps:ke})=>O.jsx(Vx,_({timeout:Fn.transitions.duration.shorter},ke,o_,{children:O.jsxs(jx,_({},i_,{children:[rt,E?O.jsx(Ux,_({},s_,{ref:Yr})):null]}))}))}))]})}),N3=EX;function CX(e){return Vt("MuiToggleButton",e)}const MX=jt("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge"]),HS=MX,TX=["children","className","color","disabled","disableFocusRipple","fullWidth","onChange","onClick","selected","size","value"],OX=e=>{const{classes:t,fullWidth:r,selected:n,disabled:o,size:i,color:s}=e,a={root:["root",n&&"selected",o&&"disabled",r&&"fullWidth",`size${Fe(i)}`,s]};return rr(a,CX,t)},_X=Je(Tb,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`size${Fe(r.size)}`]]}})(({theme:e,ownerState:t})=>{let r=t.color==="standard"?e.palette.text.primary:e.palette[t.color].main,n;return e.vars&&(r=t.color==="standard"?e.vars.palette.text.primary:e.vars.palette[t.color].main,n=t.color==="standard"?e.vars.palette.text.primaryChannel:e.vars.palette[t.color].mainChannel),_({},e.typography.button,{borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active},t.fullWidth&&{width:"100%"},{[`&.${HS.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Lr(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${HS.selected}`]:{color:r,backgroundColor:e.vars?`rgba(${n} / ${e.vars.palette.action.selectedOpacity})`:Lr(r,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${n} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Lr(r,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${n} / ${e.vars.palette.action.selectedOpacity})`:Lr(r,e.palette.action.selectedOpacity)}}}},t.size==="small"&&{padding:7,fontSize:e.typography.pxToRem(13)},t.size==="large"&&{padding:15,fontSize:e.typography.pxToRem(15)})}),AX=S.forwardRef(function(t,r){const n=Wt({props:t,name:"MuiToggleButton"}),{children:o,className:i,color:s="standard",disabled:a=!1,disableFocusRipple:l=!1,fullWidth:c=!1,onChange:u,onClick:d,selected:f,size:p="medium",value:h}=n,m=ve(n,TX),b=_({},n,{color:s,disabled:a,disableFocusRipple:l,fullWidth:c,size:p}),v=OX(b),g=y=>{d&&(d(y,h),y.defaultPrevented)||u&&u(y,h)};return O.jsx(_X,_({className:Ce(v.root,i),disabled:a,focusRipple:!l,ref:r,onClick:g,onChange:u,value:h,ownerState:b,"aria-pressed":f},m,{children:o}))}),NX=AX;var RX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 15v2c0 1.054.95 2 2 2h3v2H7a4 4 0 0 1-4-4v-2h2zm13-5l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16 10h2zm-1 2.885L15.753 16h2.492L17 12.885zM3 3h6a3 3 0 0 1 2.235 5A3 3 0 0 1 9 13H3V3zm6 6H5v2h4a1 1 0 0 0 0-2zm8-6a4 4 0 0 1 4 4v2h-2V7a2 2 0 0 0-2-2h-3V3h3zM9 5H5v2h4a1 1 0 1 0 0-2z"}}],PX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"}}],zX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"}}],LX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0zm-8.66 16h15.588L12 5.5 4.206 19zM11 16h2v2h-2v-2zm0-7h2v5h-2V9z"}}],IX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 19h18v2H3v-2zm5-6h3l-4 4-4-4h3V3h2v10zm10 0h3l-4 4-4-4h3V3h2v10z"}}],DX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm2 15h14v2H5v-2zm-2-5h18v2H3v-2zm2-5h14v2H5V9z"}}],$X=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h18v2H3v-2zm0-5h18v2H3v-2zm0-5h18v2H3V9z"}}],HX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h14v2H3v-2zm0-5h18v2H3v-2zm0-5h14v2H3V9z"}}],BX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm4 15h14v2H7v-2zm-4-5h18v2H3v-2zm4-5h14v2H7V9z"}}],FX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 3h18v2H3V3zm5 8v10H6V11H3l4-4 4 4H8zm10 0v10h-2V11h-3l4-4 4 4h-3z"}}],VX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 11h18v2H3v-2zm15 7v3h-2v-3h-3l4-4 4 4h-3zM8 18v3H6v-3H3l4-4 4 4H8zM18 6h3l-4 4-4-4h3V3h2v3zM8 6h3l-4 4-4-4h3V3h2v3z"}}],jX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M6.75 2.5A4.25 4.25 0 0 1 11 6.75V11H6.75a4.25 4.25 0 1 1 0-8.5zM9 9V6.75A2.25 2.25 0 1 0 6.75 9H9zm-2.25 4H11v4.25A4.25 4.25 0 1 1 6.75 13zm0 2A2.25 2.25 0 1 0 9 17.25V15H6.75zm10.5-12.5a4.25 4.25 0 1 1 0 8.5H13V6.75a4.25 4.25 0 0 1 4.25-4.25zm0 6.5A2.25 2.25 0 1 0 15 6.75V9h2.25zM13 13h4.25A4.25 4.25 0 1 1 13 17.25V13zm2 2v2.25A2.25 2.25 0 1 0 17.25 15H15z"}}],UX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 16l-6-6h12z"}}],WX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 7v4L2 6l6-5v4h5a8 8 0 1 1 0 16H4v-2h9a6 6 0 1 0 0-12H8z"}}],KX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 7h-5a6 6 0 1 0 0 12h9v2h-9a8 8 0 1 1 0-16h5V1l6 5-6 5V7z"}}],qX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 12l6-6v12z"}}],GX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 12l-6 6V6z"}}],YX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 8l6 6H6z"}}],JX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 3v7.267l6.294-3.633 1 1.732-6.293 3.633 6.293 3.635-1 1.732L13 13.732V21h-2v-7.268l-6.294 3.634-1-1.732L9.999 12 3.706 8.366l1-1.732L11 10.267V3z"}}],XX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14.828 7.757l-5.656 5.657a1 1 0 1 0 1.414 1.414l5.657-5.656A3 3 0 1 0 12 4.929l-5.657 5.657a5 5 0 1 0 7.071 7.07L19.071 12l1.414 1.414-5.657 5.657a7 7 0 1 1-9.9-9.9l5.658-5.656a5 5 0 0 1 7.07 7.07L12 16.244A3 3 0 1 1 7.757 12l5.657-5.657 1.414 1.414z"}}],QX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 11h4.5a2.5 2.5 0 1 0 0-5H8v5zm10 4.5a4.5 4.5 0 0 1-4.5 4.5H6V4h6.5a4.5 4.5 0 0 1 3.256 7.606A4.498 4.498 0 0 1 18 15.5zM8 13v5h5.5a2.5 2.5 0 1 0 0-5H8z"}}],ZX=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 18v-3.7a1.5 1.5 0 0 0-1.5-1.5H2v-1.6h.5A1.5 1.5 0 0 0 4 9.7V6a3 3 0 0 1 3-3h1v2H7a1 1 0 0 0-1 1v4.1A2 2 0 0 1 4.626 12 2 2 0 0 1 6 13.9V18a1 1 0 0 0 1 1h1v2H7a3 3 0 0 1-3-3zm16-3.7V18a3 3 0 0 1-3 3h-1v-2h1a1 1 0 0 0 1-1v-4.1a2 2 0 0 1 1.374-1.9A2 2 0 0 1 18 10.1V6a1 1 0 0 0-1-1h-1V3h1a3 3 0 0 1 3 3v3.7a1.5 1.5 0 0 0 1.5 1.5h.5v1.6h-.5a1.5 1.5 0 0 0-1.5 1.5z"}}],eQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M14 3c.552 0 1 .448 1 1v5h5c.552 0 1 .448 1 1v10c0 .552-.448 1-1 1H10c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h10zm-1 2H5v8h8V5z"}}],tQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M11 3c.552 0 1 .448 1 1v2h5c.552 0 1 .448 1 1v5h2c.552 0 1 .448 1 1v7c0 .552-.448 1-1 1h-7c-.552 0-1-.448-1-1v-2H7c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h7zm5 5H8v8h8V8z"}}],rQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 3v2H4v13.385L5.763 17H20v-7h2v8a1 1 0 0 1-1 1H6.455L2 22.5V4a1 1 0 0 1 1-1h11zm5 0V0h2v3h3v2h-3v3h-2V5h-3V3h3z"}}],nQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-.997-4L6.76 11.757l1.414-1.414 2.829 2.829 5.656-5.657 1.415 1.414L11.003 16z"}}],oQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M7 7V3a1 1 0 0 1 1-1h13a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-4v3.993c0 .556-.449 1.007-1.007 1.007H3.007A1.006 1.006 0 0 1 2 20.993l.003-12.986C2.003 7.451 2.452 7 3.01 7H7zm2 0h6.993C16.549 7 17 7.449 17 8.007V15h3V4H9v3zm6 2H4.003L4 20h11V9zm-6.497 9l-3.536-3.536 1.414-1.414 2.122 2.122 4.242-4.243 1.414 1.414L8.503 18z"}}],iQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M6 4v4h12V4h2.007c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.994.994 0 0 1 3 21.007V4.993C3 4.445 3.445 4 3.993 4H6zm2-2h8v4H8V2z"}}],sQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 4V2h10v2h3.007c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.994.994 0 0 1 3 21.007V4.993C3 4.445 3.445 4 3.993 4H7zm0 2H5v14h14V6h-2v2H7V6zm2-2v2h6V4H9z"}}],aQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm0-9.414l2.828-2.829 1.415 1.415L13.414 12l2.829 2.828-1.415 1.415L12 13.414l-2.828 2.829-1.415-1.415L10.586 12 7.757 9.172l1.415-1.415L12 10.586z"}}],lQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"}}],cQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"}}],uQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M23 12l-7.071 7.071-1.414-1.414L20.172 12l-5.657-5.657 1.414-1.414L23 12zM3.828 12l5.657 5.657-1.414 1.414L1 12l7.071-7.071 1.414 1.414L3.828 12z"}}],dQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16.95 8.464l1.414-1.414 4.95 4.95-4.95 4.95-1.414-1.414L20.485 12 16.95 8.464zm-9.9 0L3.515 12l3.535 3.536-1.414 1.414L.686 12l4.95-4.95L7.05 8.464z"}}],fQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 6h5v2h-2v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V8H2V6h5V3a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v3zm-8 5v6h2v-6H9zm4 0v6h2v-6h-2zM9 4v2h6V4H9z"}}],pQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 6h5v2h-2v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V8H2V6h5V3a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v3zm1 2H6v12h12V8zm-9 3h2v6H9v-6zm4 0h2v6h-2v-6zM9 4v2h6V4H9z"}}],hQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M12 3c.552 0 1 .448 1 1v8c.835-.628 1.874-1 3-1 2.761 0 5 2.239 5 5s-2.239 5-5 5c-1.032 0-1.99-.313-2.787-.848L13 20c0 .552-.448 1-1 1H6c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zm-1 2H7v14h4V5zm8 10h-6v2h6v-2z"}}],mQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 5c.552 0 1 .448 1 1v6c0 .552-.448 1-1 1 .628.835 1 1.874 1 3 0 2.761-2.239 5-5 5s-5-2.239-5-5c0-1.126.372-2.165 1-3H4c-.552 0-1-.448-1-1V6c0-.552.448-1 1-1h16zm-7 10v2h6v-2h-6zm6-8H5v4h14V7z"}}],gQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4.583 17.321C3.553 16.227 3 15 3 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 0 1-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179zm10 0C13.553 16.227 13 15 13 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 0 1-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179z"}}],vQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19.417 6.679C20.447 7.773 21 9 21 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311-1.804-.167-3.226-1.648-3.226-3.489a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179zm-10 0C10.447 7.773 11 9 11 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311C4.591 12.322 3.17 10.841 3.17 9a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179z"}}],yQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 19h16v-7h2v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-8h2v7zM14 9h5l-7 7-7-7h5V3h4v6z"}}],bQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M16 13l6.964 4.062-2.973.85 2.125 3.681-1.732 1-2.125-3.68-2.223 2.15L16 13zm-2-7h2v2h5a1 1 0 0 1 1 1v4h-2v-3H10v10h4v2H9a1 1 0 0 1-1-1v-5H6v-2h2V9a1 1 0 0 1 1-1h5V6zM4 14v2H2v-2h2zm0-4v2H2v-2h2zm0-4v2H2V6h2zm0-4v2H2V2h2zm4 0v2H6V2h2zm4 0v2h-2V2h2zm4 0v2h-2V2h2z"}}],xQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 19a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm-5.5 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm11 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zM13 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.621 6.302 14.685 14.685 0 0 0 5.327 3.042l-.536 1.93A16.685 16.685 0 0 1 12 13.726a16.696 16.696 0 0 1-6.202 3.547l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042 18.077 18.077 0 0 1-2.822-4.3h2.24A16.031 16.031 0 0 0 12 10.876a16.168 16.168 0 0 0 2.91-4.876L5 6V4h6V2h2z"}}],kQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 19a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm-5.5 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm11 0a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zM18 3v2H8v4h9v2H8v4h10v2H6V3h12z"}}],wQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 10h2v.757a4.5 4.5 0 0 1 7 3.743V20h-2v-5.5c0-1.43-1.175-2.5-2.5-2.5S16 13.07 16 14.5V20h-2V10zm-2-6v2H4v5h8v2H4v5h8v2H2V4h10z"}}],SQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-1-5h2v2h-2v-2zm0-8h2v6h-2V7z"}}],EQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6zm11-3v9l-3.794-3.793-5.999 6-1.414-1.414 5.999-6L12 3h9z"}}],CQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 6V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3v3c0 .552-.45 1-1.007 1H4.007A1.001 1.001 0 0 1 3 21l.003-14c0-.552.45-1 1.007-1H7zM5.003 8L5 20h10V8H5.003zM9 6h8v10h2V4H9v2z"}}],MQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M6 21.5c-1.933 0-3.5-1.567-3.5-3.5s1.567-3.5 3.5-3.5c1.585 0 2.924 1.054 3.355 2.5H15v-2h2V9.242L14.757 7H9V9H3V3h6v2h5.757L18 1.756 22.243 6 19 9.241V15L21 15v6h-6v-2H9.355c-.43 1.446-1.77 2.5-3.355 2.5zm0-5c-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5-.672-1.5-1.5-1.5zm13 .5h-2v2h2v-2zM18 4.586L16.586 6 18 7.414 19.414 6 18 4.586zM7 5H5v2h2V5z"}}],TQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15.246 14H8.754l-1.6 4H5l6-15h2l6 15h-2.154l-1.6-4zm-.8-2L12 5.885 9.554 12h4.892zM3 20h18v2H3v-2z"}}],OQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M10 6v15H8V6H2V4h14v2h-6zm8 8v7h-2v-7h-3v-2h8v2h-3z"}}],_Q=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11.246 15H4.754l-2 5H.6L7 4h2l6.4 16h-2.154l-2-5zm-.8-2L8 6.885 5.554 13h4.892zM21 12.535V12h2v8h-2v-.535a4 4 0 1 1 0-6.93zM19 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"}}],AQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12.651 14.065L11.605 20H9.574l1.35-7.661-7.41-7.41L4.93 3.515 20.485 19.07l-1.414 1.414-6.42-6.42zm-.878-6.535l.27-1.53h-1.8l-2-2H20v2h-5.927L13.5 9.257 11.773 7.53z"}}],NQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z"}}],RQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 3h2v6h-2V5h-4V3h4zM4 3h4v2H4v4H2V3h2zm16 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z"}}],PQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 18l7.68-6L5 6V4h14v2H8.263L16 12l-7.737 6H19v2H5v-2z"}}],zQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 1v4H4v14h16V3h1.008c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3H6V1h2zm4 7l4 4h-3v4h-2v-4H8l4-4zm6-7v4h-8V3h6V1h2z"}}],LQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M13 20h-2v-7H4v7H2V4h2v7h7V4h2v16zm8-12v12h-2v-9.796l-2 .536V8.67L19.5 8H21z"}}],IQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M4 4v7h7V4h2v16h-2v-7H4v7H2V4h2zm14.5 4c2.071 0 3.75 1.679 3.75 3.75 0 .857-.288 1.648-.772 2.28l-.148.18L18.034 18H22v2h-7v-1.556l4.82-5.546c.268-.307.43-.709.43-1.148 0-.966-.784-1.75-1.75-1.75-.918 0-1.671.707-1.744 1.606l-.006.144h-2C14.75 9.679 16.429 8 18.5 8z"}}],DQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M22 8l-.002 2-2.505 2.883c1.59.435 2.757 1.89 2.757 3.617 0 2.071-1.679 3.75-3.75 3.75-1.826 0-3.347-1.305-3.682-3.033l1.964-.382c.156.806.866 1.415 1.718 1.415.966 0 1.75-.784 1.75-1.75s-.784-1.75-1.75-1.75c-.286 0-.556.069-.794.19l-1.307-1.547L19.35 10H15V8h7zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2z"}}],$Q=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M13 20h-2v-7H4v7H2V4h2v7h7V4h2v16zm9-12v8h1.5v2H22v2h-2v-2h-5.5v-1.34l5-8.66H22zm-2 3.133L17.19 16H20v-4.867z"}}],HQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M22 8v2h-4.323l-.464 2.636c.33-.089.678-.136 1.037-.136 2.21 0 4 1.79 4 4s-1.79 4-4 4c-1.827 0-3.367-1.224-3.846-2.897l1.923-.551c.24.836 1.01 1.448 1.923 1.448 1.105 0 2-.895 2-2s-.895-2-2-2c-.63 0-1.193.292-1.56.748l-1.81-.904L16 8h6zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2z"}}],BQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M21.097 8l-2.598 4.5c2.21 0 4.001 1.79 4.001 4s-1.79 4-4 4-4-1.79-4-4c0-.736.199-1.426.546-2.019L18.788 8h2.309zM4 4v7h7V4h2v16h-2v-7H4v7H2V4h2zm14.5 10.5c-1.105 0-2 .895-2 2s.895 2 2 2 2-.895 2-2-.895-2-2-2z"}}],FQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7.784 14l.42-4H4V8h4.415l.525-5h2.011l-.525 5h3.989l.525-5h2.011l-.525 5H20v2h-3.784l-.42 4H20v2h-4.415l-.525 5h-2.011l.525-5H9.585l-.525 5H7.049l.525-5H4v-2h3.784zm2.011 0h3.99l.42-4h-3.99l-.42 4z"}}],VQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 11V4h2v17h-2v-8H7v8H5V4h2v7z"}}],jQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 15v3h3v2h-3v3h-2v-3h-3v-2h3v-3h2zm.008-12c.548 0 .992.445.992.993V13h-2V5H4v13.999L14 9l3 3v2.829l-3-3L6.827 19H14v2H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016zM8 7a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"}}],UQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v1.757l-2 2V5H5v8.1l4-4 4.328 4.329-1.415 1.413L9 11.93l-4 3.999V19h10.533l.708.001 1.329-1.33L18.9 19h.1v-2.758l2-2V20c0 .552-.448 1-1 1H4c-.55 0-1-.45-1-1V4c0-.552.448-1 1-1h16zm1.778 4.808l1.414 1.414L15.414 17l-1.416-.002.002-1.412 7.778-7.778zM15.5 7c.828 0 1.5.672 1.5 1.5s-.672 1.5-1.5 1.5S14 9.328 14 8.5 14.672 7 15.5 7z"}}],WQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4.828 21l-.02.02-.021-.02H2.992A.993.993 0 0 1 2 20.007V3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H4.828zM20 15V5H4v14L14 9l6 6zm0 2.828l-6-6L6.828 19H20v-1.172zM8 11a2 2 0 1 1 0-4 2 2 0 0 1 0 4z"}}],KQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h18v2H3v-2zm8-5h10v2H11v-2zm0-5h10v2H11V9zm-8 3.5L7 9v7l-4-3.5z"}}],qQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 4h18v2H3V4zm0 15h18v2H3v-2zm8-5h10v2H11v-2zm0-5h10v2H11V9zm-4 3.5L3 16V9l4 3.5z"}}],GQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM11 7h2v2h-2V7zm0 4h2v6h-2v-6z"}}],YQ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 21v-2h3V5H8V3h8v2h-3v14h3v2H8zM18.05 7.05L23 12l-4.95 4.95-1.414-1.414L20.172 12l-3.536-3.536L18.05 7.05zm-12.1 0l1.414 1.414L3.828 12l3.536 3.536L5.95 16.95 1 12l4.95-4.95z"}}],JQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zm-1 2h-4v14h4V5zM6 7c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2H5v1.999L3 11v2l2-.001V15h2v-2.001L9 13v-2l-2-.001V9z"}}],XQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M10 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zM9 5H5v14h4V5zm9 2c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2h-2v1.999L15 11v2l2-.001V15h2v-2.001L21 13v-2l-2-.001V9z"}}],QQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M12 13c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2h-2v1.999L9 17v2l2-.001V21h2v-2.001L15 19v-2l-2-.001V15zm7-12c.552 0 1 .448 1 1v6c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zM5 5v4h14V5H5z"}}],ZQ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 13c.552 0 1 .448 1 1v6c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1v-6c0-.552.448-1 1-1h16zm-1 2H5v4h14v-4zM12 1c2.761 0 5 2.239 5 5s-2.239 5-5 5-5-2.239-5-5 2.239-5 5-5zm1 2h-2v1.999L9 5v2l2-.001V9h2V6.999L15 7V5l-2-.001V3z"}}],eZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 20H7v-2h2.927l2.116-12H9V4h8v2h-2.927l-2.116 12H15z"}}],tZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M11 5H5v14h6V5zm2 0v14h6V5h-6zM4 3h16a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"}}],rZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 4h10v2H11V4zM6 7v4H4V7H1l4-4 4 4H6zm0 10h3l-4 4-4-4h3v-4h2v4zm5 1h10v2H11v-2zm-2-7h12v2H9v-2z"}}],nZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.657 14.828l-1.414-1.414L17.657 12A4 4 0 1 0 12 6.343l-1.414 1.414-1.414-1.414 1.414-1.414a6 6 0 0 1 8.485 8.485l-1.414 1.414zm-2.829 2.829l-1.414 1.414a6 6 0 1 1-8.485-8.485l1.414-1.414 1.414 1.414L6.343 12A4 4 0 1 0 12 17.657l1.414-1.414 1.414 1.414zm0-9.9l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"}}],oZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.657 14.828l-1.414-1.414L17.657 12A4 4 0 1 0 12 6.343l-1.414 1.414-1.414-1.414 1.414-1.414a6 6 0 0 1 8.485 8.485l-1.414 1.414zm-2.829 2.829l-1.414 1.414a6 6 0 1 1-8.485-8.485l1.414-1.414 1.414 1.414L6.343 12A4 4 0 1 0 12 17.657l1.414-1.414 1.414 1.414zm0-9.9l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07zM5.775 2.293l1.932-.518L8.742 5.64l-1.931.518-1.036-3.864zm9.483 16.068l1.931-.518 1.036 3.864-1.932.518-1.035-3.864zM2.293 5.775l3.864 1.036-.518 1.931-3.864-1.035.518-1.932zm16.068 9.483l3.864 1.035-.518 1.932-3.864-1.036.518-1.931z"}}],iZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 17h5v2h-3v3h-2v-5zM7 7H2V5h3V2h2v5zm11.364 8.536L16.95 14.12l1.414-1.414a5 5 0 1 0-7.071-7.071L9.879 7.05 8.464 5.636 9.88 4.222a7 7 0 0 1 9.9 9.9l-1.415 1.414zm-2.828 2.828l-1.415 1.414a7 7 0 0 1-9.9-9.9l1.415-1.414L7.05 9.88l-1.414 1.414a5 5 0 1 0 7.071 7.071l1.414-1.414 1.415 1.414zm-.708-10.607l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"}}],sZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18.364 15.536L16.95 14.12l1.414-1.414a5 5 0 1 0-7.071-7.071L9.879 7.05 8.464 5.636 9.88 4.222a7 7 0 0 1 9.9 9.9l-1.415 1.414zm-2.828 2.828l-1.415 1.414a7 7 0 0 1-9.9-9.9l1.415-1.414L7.05 9.88l-1.414 1.414a5 5 0 1 0 7.071 7.071l1.414-1.414 1.415 1.414zm-.708-10.607l1.415 1.415-7.071 7.07-1.415-1.414 7.071-7.07z"}}],aZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 4h10v2H11V4zm0 4h6v2h-6V8zm0 6h10v2H11v-2zm0 4h6v2h-6v-2zM3 4h6v6H3V4zm2 2v2h2V6H5zm-2 8h6v6H3v-6zm2 2v2h2v-2H5z"}}],lZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 4h13v2H8V4zm-5-.5h3v3H3v-3zm0 7h3v3H3v-3zm0 7h3v3H3v-3zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"}}],cZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 4h13v2H8V4zM5 3v3h1v1H3V6h1V4H3V3h2zM3 14v-2.5h2V11H3v-1h3v2.5H4v.5h2v1H3zm2 5.5H3v-1h2V18H3v-1h3v4H3v-1h2v-.5zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"}}],uZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 4h13v2H8V4zM4.5 6.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm0 6.9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"}}],dZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15.243 4.515l-6.738 6.737-.707 2.121-1.04 1.041 2.828 2.829 1.04-1.041 2.122-.707 6.737-6.738-4.242-4.242zm6.364 3.535a1 1 0 0 1 0 1.414l-7.779 7.779-2.12.707-1.415 1.414a1 1 0 0 1-1.414 0l-4.243-4.243a1 1 0 0 1 0-1.414l1.414-1.414.707-2.121 7.779-7.779a1 1 0 0 1 1.414 0l5.657 5.657zm-6.364-.707l1.414 1.414-4.95 4.95-1.414-1.414 4.95-4.95zM4.283 16.89l2.828 2.829-1.414 1.414-4.243-1.414 2.828-2.829z"}}],fZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm4 12.5v-4l2 2 2-2v4h2v-7h-2l-2 2-2-2H5v7h2zm11-3v-4h-2v4h-2l3 3 3-3h-2z"}}],pZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm1 2v14h16V5H4zm3 10.5H5v-7h2l2 2 2-2h2v7h-2v-4l-2 2-2-2v4zm11-3h2l-3 3-3-3h2v-4h2v4z"}}],hZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zm-9 2H5v5.999h2V9l3 3-3 3v-2H5v6h6v-2h2v2h6v-6h-2v2l-3-3 3-3v1.999h2V5h-6v2h-2V5zm2 8v2h-2v-2h2zm0-4v2h-2V9h2z"}}],mZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M21 20c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16c.552 0 1 .448 1 1v16zm-2-9V5h-5.999v2H15l-3 3-3-3h2V5H5v6h2v2H5v6h6v-2H9l3-3 3 3h-1.999v2H19v-6h-2v-2h2zm-8 2H9v-2h2v2zm4 0h-2v-2h2v2z"}}],gZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M18 3c1.657 0 3 1.343 3 3s-1.343 3-3 3h-3c-1.306 0-2.417-.834-2.829-2H11c-1.1 0-2 .9-2 2v.171c1.166.412 2 1.523 2 2.829 0 1.306-.834 2.417-2 2.829V15c0 1.1.9 2 2 2h1.17c.412-1.165 1.524-2 2.83-2h3c1.657 0 3 1.343 3 3s-1.343 3-3 3h-3c-1.306 0-2.417-.834-2.829-2H11c-2.21 0-4-1.79-4-4H5c-1.657 0-3-1.343-3-3s1.343-3 3-3h2c0-2.21 1.79-4 4-4h1.17c.412-1.165 1.524-2 2.83-2h3zm0 14h-3c-.552 0-1 .448-1 1s.448 1 1 1h3c.552 0 1-.448 1-1s-.448-1-1-1zM8 11H5c-.552 0-1 .448-1 1s.448 1 1 1h3c.552 0 1-.448 1-1s-.448-1-1-1zm10-6h-3c-.552 0-1 .448-1 1s.448 1 1 1h3c.552 0 1-.448 1-1s-.448-1-1-1z"}}],vZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm14 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-7 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}}],yZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M10 2c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1H8v2h5V9c0-.552.448-1 1-1h6c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1v-1H8v6h5v-1c0-.552.448-1 1-1h6c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1v-1H7c-.552 0-1-.448-1-1V8H4c-.552 0-1-.448-1-1V3c0-.552.448-1 1-1h6zm9 16h-4v2h4v-2zm0-8h-4v2h4v-2zM9 4H5v2h4V4z"}}],bZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 1.5c1.321 0 2.484.348 3.447.994.963.645 1.726 1.588 2.249 2.778.522 1.19.804 2.625.804 4.257v4.942c0 1.632-.282 3.068-.804 4.257-.523 1.19-1.286 2.133-2.25 2.778-.962.646-2.125.994-3.446.994-1.321 0-2.484-.348-3.447-.994-.963-.645-1.726-1.588-2.249-2.778-.522-1.19-.804-2.625-.804-4.257V9.529c0-1.632.282-3.068.804-4.257.523-1.19 1.286-2.133 2.25-2.778C9.515 1.848 10.678 1.5 12 1.5zm0 2c-.916 0-1.694.226-2.333.655-.637.427-1.158 1.07-1.532 1.92-.412.94-.635 2.108-.635 3.454v4.942c0 1.346.223 2.514.635 3.453.374.851.895 1.494 1.532 1.921.639.429 1.417.655 2.333.655.916 0 1.694-.226 2.333-.655.637-.427 1.158-1.07 1.532-1.92.412-.94.635-2.108.635-3.454V9.529c0-1.346-.223-2.514-.635-3.453-.374-.851-.895-1.494-1.532-1.921C13.694 3.726 12.916 3.5 12 3.5z"}}],xZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 1.5V22h-2V3.704L7.5 4.91V2.839l5-1.339z"}}],kZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 7.5a4 4 0 1 0-8 0H6a6 6 0 1 1 10.663 3.776l-7.32 8.723L18 20v2H6v-1.127l9.064-10.802A3.982 3.982 0 0 0 16 7.5z"}}],wZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18 2v1.362L12.809 9.55a6.501 6.501 0 1 1-7.116 8.028l1.94-.486A4.502 4.502 0 0 0 16.5 16a4.5 4.5 0 0 0-6.505-4.03l-.228.122-.69-1.207L14.855 4 6.5 4V2H18z"}}],SZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 1.5V16h3v2h-3v4h-2v-4H4v-1.102L14 1.5h2zM14 16V5.171L6.968 16H14z"}}],EZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18 2v2H9.3l-.677 6.445a6.5 6.5 0 1 1-2.93 7.133l1.94-.486A4.502 4.502 0 0 0 16.5 16a4.5 4.5 0 0 0-4.5-4.5c-2.022 0-3.278.639-3.96 1.53l-1.575-1.182L7.5 2H18z"}}],CZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14.886 2l-4.438 7.686A6.5 6.5 0 1 1 6.4 12.7L12.576 2h2.31zM12 11.5a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9z"}}],MZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 2v1.5L10.763 22H8.574l8.013-18H6V2z"}}],TZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 1.5a5.5 5.5 0 0 1 3.352 9.86C17.24 12.41 18.5 14.32 18.5 16.5c0 3.314-2.91 6-6.5 6s-6.5-2.686-6.5-6c0-2.181 1.261-4.09 3.147-5.141A5.5 5.5 0 0 1 12 1.5zm0 11c-2.52 0-4.5 1.828-4.5 4 0 2.172 1.98 4 4.5 4s4.5-1.828 4.5-4c0-2.172-1.98-4-4.5-4zm0-9a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7z"}}],OZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 1.5a6.5 6.5 0 0 1 5.619 9.77l-6.196 10.729H9.114l4.439-7.686A6.5 6.5 0 1 1 12 1.5zm0 2a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9z"}}],_Z=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M14 20v-2.157c1.863-1.192 3.5-3.875 3.5-6.959 0-3.073-2-6.029-5.5-6.029s-5.5 2.956-5.5 6.03c0 3.083 1.637 5.766 3.5 6.958V20H3v-2h4.76C5.666 16.505 4 13.989 4 10.884 4 6.247 7.5 3 12 3s8 3.247 8 7.884c0 3.105-1.666 5.621-3.76 7.116H21v2h-7z"}}],AZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M15 3c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-2v2h4c.552 0 1 .448 1 1v3h2c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1h-6c-.552 0-1-.448-1-1v-4c0-.552.448-1 1-1h2v-2H8v2h2c.552 0 1 .448 1 1v4c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1v-4c0-.552.448-1 1-1h2v-3c0-.552.448-1 1-1h4V9H9c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h6zM9 17H5v2h4v-2zm10 0h-4v2h4v-2zM14 5h-4v2h4V5z"}}],NZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 21v-4H7v4H5v-5a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v5h-2zM7 3v4h10V3h2v5a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V3h2zM2 9l4 3-4 3V9zm20 0v6l-4-3 4-3z"}}],RZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 6v15h-2v-5a6 6 0 1 1 0-12h10v2h-3v15h-2V6h-3zm-2 0a4 4 0 1 0 0 8V6z"}}],PZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12.9 6.858l4.242 4.243L7.242 21H3v-4.243l9.9-9.9zm1.414-1.414l2.121-2.122a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414l-2.122 2.121-4.242-4.242z"}}],zZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15.728 9.686l-1.414-1.414L5 17.586V19h1.414l9.314-9.314zm1.414-1.414l1.414-1.414-1.414-1.414-1.414 1.414 1.414 1.414zM7.242 21H3v-4.243L16.435 3.322a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414L7.243 21z"}}],LZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.934 3.036l1.732 1L18.531 6H21v2h-2v4h2v2h-2v7h-2v-7h-3.084c-.325 2.862-1.564 5.394-3.37 7.193l-1.562-1.27c1.52-1.438 2.596-3.522 2.917-5.922L10 14v-2l2-.001V8h-2V6h2.467l-1.133-1.964 1.732-1L14.777 6h1.444l1.713-2.964zM5 13.803l-2 .536v-2.071l2-.536V8H3V6h2V3h2v3h2v2H7v3.197l2-.536v2.07l-2 .536V18.5A2.5 2.5 0 0 1 4.5 21H3v-2h1.5a.5.5 0 0 0 .492-.41L5 18.5v-4.697zM17 8h-3v4h3V8z"}}],IZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M12 19c.828 0 1.5.672 1.5 1.5S12.828 22 12 22s-1.5-.672-1.5-1.5.672-1.5 1.5-1.5zm0-17c3.314 0 6 2.686 6 6 0 2.165-.753 3.29-2.674 4.923C13.399 14.56 13 15.297 13 17h-2c0-2.474.787-3.695 3.031-5.601C15.548 10.11 16 9.434 16 8c0-2.21-1.79-4-4-4S8 5.79 8 8v1H6V8c0-3.314 2.686-6 6-6z"}}],DZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M21 19v2h-2v-2h2zm-4 0v2h-2v-2h2zm-4 0v2h-2v-2h2zm-4 0v2H7v-2h2zm-4 0v2H3v-2h2zm16-4v2h-2v-2h2zM5 15v2H3v-2h2zm0-4v2H3v-2h2zm11-8c2.687 0 4.882 2.124 4.995 4.783L21 8v5h-2V8c0-1.591-1.255-2.903-2.824-2.995L16 5h-5V3h5zM5 7v2H3V7h2zm0-4v2H3V3h2zm4 0v2H7V3h2z"}}],$Z=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M9.683 7.562L12 9.88l6.374-6.375a2 2 0 0 1 2.829 0l.707.707L9.683 16.438a4 4 0 1 1-2.121-2.121L9.88 12 7.562 9.683a4 4 0 1 1 2.121-2.121zM6 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 12a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm9.535-6.587l6.375 6.376-.707.707a2 2 0 0 1-2.829 0l-4.96-4.961 2.12-2.122z"}}],HZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M14 3c.552 0 1 .448 1 1v5h5c.552 0 1 .448 1 1v10c0 .552-.448 1-1 1H10c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h10zm-1 2H5v8h4v-3c0-.552.448-1 1-1h3V5z"}}],BZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M11 3c.552 0 1 .448 1 1v2h5c.552 0 1 .448 1 1v5h2c.552 0 1 .448 1 1v7c0 .552-.448 1-1 1h-7c-.552 0-1-.448-1-1v-2H7c-.552 0-1-.448-1-1v-5H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h7zm5 5h-4v3c0 .552-.448 1-1 1H8v4h4v-3c0-.552.448-1 1-1h3V8z"}}],FZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M2 11h2v2H2v-2zm4 0h12v2H6v-2zm14 0h2v2h-2v-2z"}}],VZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M9.583 17.321C8.553 16.227 8 15 8 13.011c0-3.5 2.457-6.637 6.03-8.188l.893 1.378c-3.335 1.804-3.987 4.145-4.247 5.621.537-.278 1.24-.375 1.929-.311 1.804.167 3.226 1.648 3.226 3.489a3.5 3.5 0 0 1-3.5 3.5c-1.073 0-2.099-.49-2.748-1.179z"}}],jZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14.417 6.679C15.447 7.773 16 9 16 10.989c0 3.5-2.457 6.637-6.03 8.188l-.893-1.378c3.335-1.804 3.987-4.145 4.247-5.621-.537.278-1.24.375-1.929.311C9.591 12.322 8.17 10.841 8.17 9a3.5 3.5 0 0 1 3.5-3.5c1.073 0 2.099.49 2.748 1.179z"}}],UZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M19 3l4 5h-3v12h-2V8h-3l4-5zm-5 15v2H3v-2h11zm0-7v2H3v-2h11zm-2-7v2H3V4h9z"}}],WZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 4v12h3l-4 5-4-5h3V4h2zm-8 14v2H3v-2h9zm2-7v2H3v-2h11zm0-7v2H3V4h11z"}}],KZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 9v4h16V9h2v5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V9h2z"}}],qZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M17.5 2.5L23 12l-5.5 9.5h-11L1 12l5.5-9.5h11zm-1.153 2H7.653L3.311 12l4.342 7.5h8.694l4.342-7.5-4.342-7.5zM11 15h2v2h-2v-2zm0-8h2v6h-2V7z"}}],GZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zm-9 2H5v14h6v-4h2v4h6V5h-6v4h-2V5zm4 4l3 3-3 3v-2H9v2l-3-3 3-3v2h6V9z"}}],YZ=[{tag:"path",attr:{fill:"none",d:"M0 0H24V24H0z"}},{tag:"path",attr:{d:"M20 3c.552 0 1 .448 1 1v16c0 .552-.448 1-1 1H4c-.552 0-1-.448-1-1V4c0-.552.448-1 1-1h16zm-1 2H5v5.999L9 11v2H5v6h14v-6h-4v-2l4-.001V5zm-7 1l3 3h-2v6h2l-3 3-3-3h2V9H9l3-3z"}}],JZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 9h-2V6H5V4h14v2h-6v3zm0 6v5h-2v-5h2zM3 11h18v2H3v-2z"}}],XZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.154 14c.23.516.346 1.09.346 1.72 0 1.342-.524 2.392-1.571 3.147C14.88 19.622 13.433 20 11.586 20c-1.64 0-3.263-.381-4.87-1.144V16.6c1.52.877 3.075 1.316 4.666 1.316 2.551 0 3.83-.732 3.839-2.197a2.21 2.21 0 0 0-.648-1.603l-.12-.117H3v-2h18v2h-3.846zm-4.078-3H7.629a4.086 4.086 0 0 1-.481-.522C6.716 9.92 6.5 9.246 6.5 8.452c0-1.236.466-2.287 1.397-3.153C8.83 4.433 10.271 4 12.222 4c1.471 0 2.879.328 4.222.984v2.152c-1.2-.687-2.515-1.03-3.946-1.03-2.48 0-3.719.782-3.719 2.346 0 .42.218.786.654 1.099.436.313.974.562 1.613.75.62.18 1.297.414 2.03.699z"}}],QZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 6v13H9V6H3V4h14v2h-6zm8.55 10.58a.8.8 0 1 0-1.32-.36l-1.154.33A2.001 2.001 0 0 1 19 14a2 2 0 0 1 1.373 3.454L18.744 19H21v1h-4v-1l2.55-2.42z"}}],ZZ=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5.596 4L10.5 9.928 15.404 4H18l-6.202 7.497L18 18.994V19h-2.59l-4.91-5.934L5.59 19H3v-.006l6.202-7.497L3 4h2.596zM21.55 16.58a.8.8 0 1 0-1.32-.36l-1.155.33A2.001 2.001 0 0 1 21 14a2 2 0 0 1 1.373 3.454L20.744 19H23v1h-4v-1l2.55-2.42z"}}],eee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 11h14v2H5z"}}],tee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 7v13H9V7H3V5h12v2h-4zm8.55-.42a.8.8 0 1 0-1.32-.36l-1.154.33A2.001 2.001 0 0 1 19 4a2 2 0 0 1 1.373 3.454L18.744 9H21v1h-4V9l2.55-2.42z"}}],ree=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5.596 5l4.904 5.928L15.404 5H18l-6.202 7.497L18 19.994V20h-2.59l-4.91-5.934L5.59 20H3v-.006l6.202-7.497L3 5h2.596zM21.55 6.58a.8.8 0 1 0-1.32-.36l-1.155.33A2.001 2.001 0 0 1 21 4a2 2 0 0 1 1.373 3.454L20.744 9H23v1h-4V9l2.55-2.42z"}}],nee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fillRule:"nonzero",d:"M13 10v4h6v-4h-6zm-2 0H5v4h6v-4zm2 9h6v-3h-6v3zm-2 0v-3H5v3h6zm2-14v3h6V5h-6zm-2 0H5v3h6V5zM4 3h16a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"}}],oee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 8h16V5H4v3zm10 11v-9h-4v9h4zm2 0h4v-9h-4v9zm-8 0v-9H4v9h4zM3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"}}],iee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 5v10H9v-4a4 4 0 1 1 0-8h8v2h-2v10h-2V5h-2zM9 5a2 2 0 1 0 0 4V5zm8 12v-2.5l4 3.5-4 3.5V19H5v-2h12z"}}],see=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11 5v10H9v-4a4 4 0 1 1 0-8h8v2h-2v10h-2V5h-2zM9 5a2 2 0 1 0 0 4V5zM7 17h12v2H7v2.5L3 18l4-3.5V17z"}}],aee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 17h10v-2.5l3.5 3.5-3.5 3.5V19H7v2.5L3.5 18 7 14.5V17zm6-11v9h-2V6H5V4h14v2h-6z"}}],lee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 18h1.5a2.5 2.5 0 1 0 0-5H3v-2h13.5a4.5 4.5 0 1 1 0 9H15v2l-4-3 4-3v2zM3 4h18v2H3V4zm6 14v2H3v-2h6z"}}],cee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 6v15h-2V6H5V4h14v2z"}}],uee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301 14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"}}],dee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 15v2a2 2 0 0 0 1.85 1.995L7 19h3v2H7a4 4 0 0 1-4-4v-2h2zm13-5l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16 10h2zm-1 2.885L15.753 16h2.492L17 12.885zM8 2v2h4v7H8v3H6v-3H2V4h4V2h2zm9 1a4 4 0 0 1 4 4v2h-2V7a2 2 0 0 0-2-2h-3V3h3zM6 6H4v3h2V6zm4 0H8v3h2V6z"}}],fee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 3v9a4 4 0 1 0 8 0V3h2v9a6 6 0 1 1-12 0V3h2zM4 20h16v2H4v-2z"}}],pee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M4 19h16v-7h2v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-8h2v7zM14 9v6h-4V9H5l7-7 7 7h-5z"}}],hee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 3.993C3 3.445 3.445 3 3.993 3h16.014c.548 0 .993.445.993.993v16.014a.994.994 0 0 1-.993.993H3.993A.994.994 0 0 1 3 20.007V3.993zM5 5v14h14V5H5zm5.622 3.415l4.879 3.252a.4.4 0 0 1 0 .666l-4.88 3.252a.4.4 0 0 1-.621-.332V8.747a.4.4 0 0 1 .622-.332z"}}],mee=[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 21v-2h3.662l1.234-7H5v-2h3.249l.881-5H4V3h16v2h-8.839l-.882 5H18v9h3v2H3zm13-9H9.927l-1.235 7H16v-7z"}}];const gee=Object.freeze(Object.defineProperty({__proto__:null,ab:RX,addFill:PX,addLine:zX,alertLine:LX,alignBottom:IX,alignCenter:DX,alignJustify:$X,alignLeft:HX,alignRight:BX,alignTop:FX,alignVertically:VX,appsLine:jX,arrowDownSFill:UX,arrowGoBackFill:WX,arrowGoForwardFill:KX,arrowLeftSFill:qX,arrowRightSFill:GX,arrowUpSFill:YX,asterisk:JX,attachment2:XX,bold:QX,bracesLine:ZX,bringForward:eQ,bringToFront:tQ,chatNewLine:rQ,checkboxCircleLine:nQ,checkboxMultipleLine:oQ,clipboardFill:iQ,clipboardLine:sQ,closeCircleLine:aQ,closeFill:lQ,closeLine:cQ,codeLine:uQ,codeView:dQ,deleteBinFill:fQ,deleteBinLine:pQ,deleteColumn:hQ,deleteRow:mQ,doubleQuotesL:gQ,doubleQuotesR:vQ,download2Fill:yQ,dragDropLine:bQ,emphasis:kQ,emphasisCn:xQ,englishInput:wQ,errorWarningLine:SQ,externalLinkFill:EQ,fileCopyLine:CQ,flowChart:MQ,fontColor:TQ,fontSize:_Q,fontSize2:OQ,formatClear:AQ,fullscreenExitLine:NQ,fullscreenLine:RQ,functions:PQ,galleryUploadLine:zQ,h1:LQ,h2:IQ,h3:DQ,h4:$Q,h5:HQ,h6:BQ,hashtag:FQ,heading:VQ,imageAddLine:jQ,imageEditLine:UQ,imageLine:WQ,indentDecrease:KQ,indentIncrease:qQ,informationLine:GQ,inputCursorMove:YQ,insertColumnLeft:JQ,insertColumnRight:XQ,insertRowBottom:QQ,insertRowTop:ZQ,italic:eZ,layoutColumnLine:tZ,lineHeight:rZ,link:sZ,linkM:nZ,linkUnlink:iZ,linkUnlinkM:oZ,listCheck:lZ,listCheck2:aZ,listOrdered:cZ,listUnordered:uZ,markPenLine:dZ,markdownFill:fZ,markdownLine:pZ,mergeCellsHorizontal:hZ,mergeCellsVertical:mZ,mindMap:gZ,moreFill:vZ,nodeTree:yZ,number0:bZ,number1:xZ,number2:kZ,number3:wZ,number4:SZ,number5:EZ,number6:CZ,number7:MZ,number8:TZ,number9:OZ,omega:_Z,organizationChart:AZ,pageSeparator:NZ,paragraph:RZ,pencilFill:PZ,pencilLine:zZ,pinyinInput:LZ,questionMark:IZ,roundedCorner:DZ,scissorsFill:$Z,sendBackward:HZ,sendToBack:BZ,separator:FZ,singleQuotesL:VZ,singleQuotesR:jZ,sortAsc:UZ,sortDesc:WZ,space:KZ,spamLine:qZ,splitCellsHorizontal:GZ,splitCellsVertical:YZ,strikethrough:XZ,strikethrough2:JZ,subscript:ZZ,subscript2:QZ,subtractLine:eee,superscript:ree,superscript2:tee,table2:nee,tableLine:oee,text:cee,textDirectionL:iee,textDirectionR:see,textSpacing:aee,textWrap:lee,translate:dee,translate2:uee,underline:fee,upload2Fill:pee,videoLine:hee,wubiInput:mee},Symbol.toStringTag,{value:"Module"}));function vee(e,t=null){return function(r,n){let{$from:o,$to:i}=r.selection,s=o.blockRange(i),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(e)&&s.startIndex==0){if(o.index(s.depth-1)==0)return!1;let u=r.doc.resolve(s.start-2);l=new ra(u,u,s.depth),s.endIndex=0;u--)i=R.from(r[u].type.create(r[u].attrs,i));e.step(new bt(t.start-(n?2:0),t.end,t.start,t.end,new K(i,0,0),r.length,!0));let s=0;for(let u=0;us.childCount>0&&s.firstChild.type==e);return i?r?n.node(i.depth-1).type==e?xee(t,r,e,i):kee(t,r,i):!0:!1}}function xee(e,t,r,n){let o=e.tr,i=n.end,s=n.$to.end(n.depth);im;h--)p-=o.child(h).nodeSize,n.delete(p-1,p+1);let i=n.doc.resolve(r.start),s=i.nodeAfter;if(n.mapping.map(r.end)!=r.start+i.nodeAfter.nodeSize)return!1;let a=r.startIndex==0,l=r.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?R.empty:R.from(o))))return!1;let d=i.pos,f=d+s.nodeSize;return n.step(new bt(d-(a?1:0),f+(l?1:0),d+1,f-1,new K((a?R.empty:R.from(o.copy(R.empty))).append(l?R.empty:R.from(o.copy(R.empty))),a?0:1,l?0:1),a?0:1)),t(n.scrollIntoView()),!0}var wee=Object.defineProperty,See=Object.getOwnPropertyDescriptor,Hn=(e,t,r,n)=>{for(var o=n>1?void 0:n?See(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&wee(t,r,o),o};function lv(e){var t;return!!((t=e.spec.group)!=null&&t.includes(te.ListContainerNode))}function Eee(e){var t;return!!((t=e.spec.group)!=null&&t.includes(te.ListItemNode))}function us(e){return lv(e.type)}function Zi(e){return Eee(e.type)}function Ib(e,t){return r=>{const{dispatch:n,tr:o}=r,i=jv(o,r.state),{$from:s,$to:a}=o.selection,l=s.blockRange(a);if(!l)return!1;const c=Ld({predicate:u=>lv(u.type),selection:o.selection});if(c&&l.depth-c.depth<=1&&l.startIndex===0){if(c.node.type===e)return z3(t)(r);if(lv(c.node.type))return e.validContent(c.node.content)?(n==null||n(o.setNodeMarkup(c.pos,e)),!0):Cee(o,c,e,t)?(n==null||n(o.scrollIntoView()),!0):!1}return vee(e)(i,n)}}function R3(e,t=["checked"]){return function({tr:r,dispatch:n,state:o}){var i,s;const a=dz(e,o.schema),{$from:l,$to:c}=r.selection;if(Dd(r.selection)&&r.selection.node.isBlock||l.depth<2||!l.sameParent(c))return!1;const u=l.node(-1);if(u.type!==a)return!1;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(n){const m=l.index(-1)>0;let b=R.empty;for(let y=l.depth-(m?1:2);y>=l.depth-3;y--)b=R.from(l.node(y).copy(b));const v=((i=a.contentMatch.defaultType)==null?void 0:i.createAndFill())||void 0;b=b.append(R.from(a.createAndFill(null,v)||void 0));const g=l.indexAfter(-1)!t.includes(m))),f=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,p={...l.node().attrs};r.delete(l.pos,c.pos);const h=f?[{type:a,attrs:d},{type:f,attrs:p}]:[{type:a,attrs:d}];return dl(r.doc,l.pos,2)?(n&&n(r.split(l.pos,2,h).scrollIntoView()),!0):!1}}function Cee(e,t,r,n){const o=t.node,i=e.doc.resolve(t.start),s=i.node(-1),a=i.index(-1);if(!s||!s.canReplace(a,a+1,R.from(r.create())))return!1;const l=[];for(let p=0;pb;m--)h-=o.child(m).nodeSize,n.delete(h-1,h+1);const s=n.doc.resolve(r.start),a=s.nodeAfter;if(!a||n.mapping.slice(i).map(r.end)!==r.start+a.nodeSize)return!1;const l=r.startIndex===0,c=r.endIndex===o.childCount,u=s.node(-1),d=s.index(-1);if(!u.canReplace(d+(l?0:1),d+1,a.content.append(c?R.empty:R.from(o))))return!1;const f=s.pos,p=f+a.nodeSize;return n.step(new bt(f-(l?1:0),p+(c?1:0),f+1,p-1,new K((l?R.empty:R.from(o.copy(R.empty))).append(c?R.empty:R.from(o.copy(R.empty))),l?0:1,c?0:1),l?0:1)),t(n.scrollIntoView()),!0}function P3(e,t){const r=t||e.selection.$from;let n=[],o,i,s,a;for(let c=r.depth;c>=0;c--){if(i=r.node(c),o=r.index(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&us(s)){const u=r.before(c+1);n.push(u)}if(o=r.indexAfter(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&us(s)){const u=r.after(c+1);n.push(u)}}n=[...new Set(n)].sort((c,u)=>u-c);let l=!1;for(const c of n)Rd(e.doc,c)&&(e.join(c),l=!0);return l}function z3(e){return t=>{const{dispatch:r,tr:n}=t,o=jv(n,t.state),i=Oee(e,n.selection);return i?(r&&Tee(o,r,i),!0):!1}}function Oee(e,t){const{$from:r,$to:n}=t;return r.blockRange(n,i=>{var s;return((s=i.firstChild)==null?void 0:s.type)===e})}function xh(e){const{$from:t,$to:r}=e;return t.blockRange(r,us)}function _ee(e){const t=e.selection.$from,r=t.blockRange();if(!r||!Zi(r.parent)||r.startIndex!==0)return!1;const n=t.node(r.depth-2),o=t.index(r.depth),i=t.index(r.depth-1),s=t.index(r.depth-2),a=n.maybeChild(s-1),l=a==null?void 0:a.lastChild;if(o!==0||i!==0)return!1;if(a&&us(a)&&l&&Zi(l))return Ql({listType:a.type,itemType:l.type,tr:e});if(Zi(n)){const c=n,u=t.node(r.depth-3);if(us(u))return Ql({listType:u.type,itemType:c.type,tr:e})}return!1}function BS({view:e}){if(!e)return!1;{const t=e.state.selection.$cursor;if(!t||t.parentOffset>0)return!1;const r=t.blockRange();if(!r||!Zi(r.parent)||r.startIndex!==0)return!1}{const t=e.state.tr;_ee(t)&&e.dispatch(t)}{const t=e.state.selection.$cursor;if(!t||t.parentOffset>0)return!1;const r=t.blockRange();if(!r||!Zi(r.parent)||r.startIndex!==0)return!1;const n=t.index(r.depth),o=t.index(r.depth-1),i=t.index(r.depth-2),s=r.depth-2>=1&&Zi(t.node(r.depth-2));n===0&&o===0&&i<=1&&s&&bee(r.parent.type)(e.state,e.dispatch)}return UC(e.state,e.dispatch,e),!0}function L3({node:e,mark:t,updateDOM:r,updateMark:n}){const o=document.createElement("label");o.contentEditable="false",o.classList.add(cs.LIST_ITEM_MARKER_CONTAINER),o.append(t);const i=document.createElement("div"),s=document.createElement("li");s.classList.add(cs.LIST_ITEM_WITH_CUSTOM_MARKER),s.append(o),s.append(i);const a=l=>l.type!==e.type?!1:(e=l,r(e,s),n(e,t),!0);return a(e),{dom:s,contentDOM:i,update:a}}function Aee(e,t){const r=e.node(t.depth-1),n=e.node(t.depth-2);return!Zi(r)||!us(n)?!1:{parentItem:r,parentList:n}}function Nee(e,t){const r=t.parent,n=t.parent.child(t.endIndex-1),o=t.end,i=t.$to.end(t.depth);return ozee(e)?(t==null||t(e.scrollIntoView()),!0):!1;function Iee(e,t,r){let n,o,i,s;const a=t.doc;if(r.startIndex>=1){n=e.child(r.startIndex-1),o=e,s=a.resolve(r.start).start(r.depth),i=s+1;for(let l=0;l=1){const c=t.node(r.depth-1),u=t.start(r.depth-1);if(o=c.child(l-1),!us(o))return!1;s=u+1;for(let d=0;d=r.depth+2?t.end(r.depth+2):r.end-1,a=r.end;return s+1>=a?(n=e.slice(i,a),o=null):(n=e.slice(i,s),o=e.slice(s+1,a-1)),{selectedSlice:n,unselectedSlice:o}}function $ee(e){const{$from:t,$to:r}=e.selection,n=xh(e.selection);if(!n)return!1;const o=e.doc.resolve(n.start).node();if(!us(o))return!1;const i=Iee(o,t,n);if(!i)return!1;const{previousItem:s,previousList:a,previousItemStart:l}=i,{selectedSlice:c,unselectedSlice:u}=Dee(e.doc,r,n),d=s.content.append(R.fromArray([o.copy(c.content)])).append(u?u.content:R.empty);e.deleteRange(n.start,n.end);const f=l+s.nodeSize-2,p=s.copy(d);return p.check(),e.replaceRangeWith(l-1,f+1,p),e.setSelection(a===o?le.between(e.doc.resolve(t.pos),e.doc.resolve(r.pos)):le.between(e.doc.resolve(t.pos-2),e.doc.resolve(r.pos-2))),!0}var Hee=({tr:e,dispatch:t})=>$ee(e)?(t==null||t(e.scrollIntoView()),!0):!1,I3=class extends Ve{get name(){return"listItemShared"}createKeymap(){const e={Tab:Hee,"Shift-Tab":Lee,Backspace:BS,"Mod-Backspace":BS};if(on.isMac){const t={"Ctrl-h":e.Backspace,"Alt-Backspace":e["Mod-Backspace"]};return{...e,...t}}return e}createPlugin(){return{appendTransaction:(e,t,r)=>{const n=r.tr;return P3(n)?n:null}}}},va=class extends er{get name(){return"listItem"}createTags(){return[te.ListItemNode]}createNodeSpec(e,t){return{content:"paragraph block*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),closed:{default:!1},nested:{default:!1}},parseDOM:[{tag:"li",getAttrs:e.parse,priority:Ae.Lowest},...t.parseDOM??[]],toDOM:r=>["li",e.dom(r),0]}}createNodeViews(){return this.options.enableCollapsible?(e,t,r)=>{const n=document.createElement("div");return n.classList.add(cs.COLLAPSIBLE_LIST_ITEM_BUTTON),n.contentEditable="false",n.addEventListener("click",()=>{if(n.classList.contains("disabled"))return;const o=r(),i=ce.create(t.state.doc,o);return t.dispatch(t.state.tr.setSelection(i)),this.store.commands.toggleListItemClosed(),!0}),L3({mark:n,node:e,updateDOM:Bee,updateMark:Fee})}:{}}createKeymap(){return{Enter:R3(this.type)}}createExtensions(){return[new I3]}toggleListItemClosed(e){return({state:{tr:t,selection:r},dispatch:n})=>{if(!Dd(r)||r.node.type.name!==this.name)return!1;const{node:o,from:i}=r;return e=C1(e)?e:!o.attrs.closed,n==null||n(t.setNodeMarkup(i,void 0,{...o.attrs,closed:e})),!0}}liftListItemOutOfList(e){return z3(e??this.type)}};Hn([U()],va.prototype,"toggleListItemClosed",1);Hn([U()],va.prototype,"liftListItemOutOfList",1);va=Hn([pe({defaultOptions:{enableCollapsible:!1},staticKeys:["enableCollapsible"]})],va);function Bee(e,t){e.attrs.closed?t.classList.add(cs.COLLAPSIBLE_LIST_ITEM_CLOSED):t.classList.remove(cs.COLLAPSIBLE_LIST_ITEM_CLOSED)}function Fee(e,t){e.childCount<=1?t.classList.add("disabled"):t.classList.remove("disabled")}var bd=class extends er{get name(){return"bulletList"}createTags(){return[te.Block,te.ListContainerNode]}createNodeSpec(e,t){return{content:"listItem+",...t,attrs:e.defaults(),parseDOM:[{tag:"ul",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["ul",e.dom(r),0]}}createNodeViews(){return this.options.enableSpine?(e,t,r)=>{var n;const o=document.createElement("div");o.style.position="relative";const i=r(),s=t.state.doc.resolve(i+1),a=s.node(s.depth-1);if(!(((n=a==null?void 0:a.type)==null?void 0:n.name)!=="listItem")){const u=document.createElement("div");u.contentEditable="false",u.classList.add(cs.LIST_SPINE),u.addEventListener("click",d=>{const f=r(),p=t.state.doc.resolve(f+1),h=p.start(p.depth-1),m=ce.create(t.state.doc,h-1);t.dispatch(t.state.tr.setSelection(m)),this.store.commands.toggleListItemClosed(),d.preventDefault(),d.stopPropagation()}),o.append(u)}const c=document.createElement("ul");return c.classList.add(cs.UL_LIST_CONTENT),o.append(c),{dom:o,contentDOM:c}}:{}}createExtensions(){return[new va({priority:Ae.Low,enableCollapsible:this.options.enableSpine})]}toggleBulletList(){return Ib(this.type,it(this.store.schema.nodes,"listItem"))}listShortcut(e){return this.toggleBulletList()(e)}createInputRules(){const e=/^\s*([*+-])\s$/;return[Lh(e,this.type),new wa(e,(t,r,n,o)=>{const i=t.tr;return i.deleteRange(n,o),Ql({listType:this.type,itemType:it(this.store.schema.nodes,"listItem"),tr:i})?i:null})]}};Hn([U({icon:"listUnordered",label:({t:e})=>e(Rv.BULLET_LIST_LABEL)})],bd.prototype,"toggleBulletList",1);Hn([je({shortcut:$.BulletList,command:"toggleBulletList"})],bd.prototype,"listShortcut",1);bd=Hn([pe({defaultOptions:{enableSpine:!1},staticKeys:["enableSpine"]})],bd);var xd=class extends er{get name(){return"orderedList"}createTags(){return[te.Block,te.ListContainerNode]}createNodeSpec(e,t){return{content:"listItem+",...t,attrs:{...e.defaults(),order:{default:1}},parseDOM:[{tag:"ol",getAttrs:r=>et(r)?{...e.parse(r),order:+(r.getAttribute("start")??1)}:{}},...t.parseDOM??[]],toDOM:r=>{const n=e.dom(r);return r.attrs.order===1?["ol",n,0]:["ol",{...n,start:r.attrs.order},0]}}}createExtensions(){return[new va({priority:Ae.Low})]}toggleOrderedList(){return Ib(this.type,it(this.store.schema.nodes,"listItem"))}listShortcut(e){return this.toggleOrderedList()(e)}createInputRules(){const e=/^(\d+)\.\s$/;return[Lh(e,this.type,t=>({order:+it(t,1)}),(t,r)=>r.childCount+r.attrs.order===+it(t,1)),new wa(e,(t,r,n,o)=>{const i=t.tr;if(i.deleteRange(n,o),!Ql({listType:this.type,itemType:it(this.store.schema.nodes,"listItem"),tr:i}))return null;const a=+it(r,1);if(a!==1){const l=rs({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{order:a})}return i})]}};Hn([U({icon:"listOrdered",label:({t:e})=>e(Rv.ORDERED_LIST_LABEL)})],xd.prototype,"toggleOrderedList",1);Hn([je({shortcut:$.OrderedList,command:"toggleOrderedList"})],xd.prototype,"listShortcut",1);xd=Hn([pe({})],xd);var D3=class extends er{get name(){return"taskListItem"}createTags(){return[te.ListItemNode]}createNodeSpec(e,t){return{content:"paragraph block*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),checked:{default:!1}},parseDOM:[{tag:"li[data-task-list-item]",getAttrs:r=>{let n=!1;return et(r)&&r.getAttribute("data-checked")!==null&&(n=!0),{checked:n,...e.parse(r)}},priority:Ae.Medium},...t.parseDOM??[]],toDOM:r=>["li",{...e.dom(r),"data-task-list-item":"","data-checked":r.attrs.checked?"":void 0},0]}}createNodeViews(){return(e,t,r)=>{const n=document.createElement("input");return n.type="checkbox",n.classList.add(cs.LIST_ITEM_CHECKBOX),n.contentEditable="false",n.addEventListener("click",o=>{t.editable||o.preventDefault()}),n.addEventListener("change",()=>{const o=r(),i=t.state.doc.resolve(o+1);this.store.commands.toggleCheckboxChecked({$pos:i})}),n.checked=e.attrs.checked,L3({node:e,mark:n,updateDOM:Vee,updateMark:jee})}}createKeymap(){return{Enter:R3(this.type)}}createExtensions(){return[new I3]}toggleCheckboxChecked(e){let t,r;return typeof e=="boolean"?t=e:e&&(t=e.checked,r=e.$pos),({tr:n,dispatch:o})=>{const i=rs({selection:r??n.selection.$from,types:this.type});if(!i)return!1;const{node:s,pos:a}=i,l={...s.attrs,checked:t??!s.attrs.checked};return o==null||o(n.setNodeMarkup(a,void 0,l)),!0}}createInputRules(){const e=/^\s*(\[( ?|x|X)]\s)$/;return[Lh(e,this.type,t=>({checked:["x","X"].includes(Zo(t,2))})),new wa(e,(t,r,n,o)=>{const i=t.tr;if(i.deleteRange(n,o),!Ql({listType:it(this.store.schema.nodes,"taskList"),itemType:this.type,tr:i}))return null;const a=["x","X"].includes(Zo(r,2));if(a){const l=rs({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{checked:a})}return i})]}};Hn([U()],D3.prototype,"toggleCheckboxChecked",1);function Vee(e,t){e.attrs.checked?t.setAttribute("data-checked",""):t.removeAttribute("data-checked"),t.setAttribute("data-task-list-item","")}function jee(e,t){t.checked=!!e.attrs.checked}var $3=class extends er{get name(){return"taskList"}createTags(){return[te.Block,te.ListContainerNode]}createNodeSpec(e,t){return{content:"taskListItem+",...t,attrs:e.defaults(),parseDOM:[{tag:"ul[data-task-list]",getAttrs:e.parse,priority:Ae.Medium},...t.parseDOM??[]],toDOM:r=>["ul",{...e.dom(r),"data-task-list":""},0]}}createExtensions(){return[new D3({})]}toggleTaskList(){return Ib(this.type,it(this.store.schema.nodes,"taskListItem"))}listShortcut(e){return this.toggleTaskList()(e)}};Hn([U({icon:"checkboxMultipleLine",label:({t:e})=>e(Rv.TASK_LIST_LABEL)})],$3.prototype,"toggleTaskList",1);Hn([je({shortcut:$.TaskList,command:"toggleTaskList"})],$3.prototype,"listShortcut",1);var fo,Uee=(e=document)=>fo||(fo=e.createElement("div"),fo.setAttribute("id","a11y-status-message"),fo.setAttribute("role","status"),fo.setAttribute("aria-live","polite"),fo.setAttribute("aria-relevant","additions text"),Object.assign(fo.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.append(fo),fo);U4(500,()=>{Uee().textContent=""});function FS(e){return typeof e=="object"&&e!=null&&e.nodeType===1}function VS(e,t){return(!t||e!=="hidden")&&e!=="visible"&&e!=="clip"}function d1(e,t){if(e.clientHeightt||i>e&&s=t&&a>=r?i-e-n:s>t&&ar?s-t+o:0}var Wee=function(e,t){var r=window,n=t.scrollMode,o=t.block,i=t.inline,s=t.boundary,a=t.skipOverflowHiddenElements,l=typeof s=="function"?s:function(De){return De!==s};if(!FS(e))throw new TypeError("Invalid target");for(var c,u,d=document.scrollingElement||document.documentElement,f=[],p=e;FS(p)&&l(p);){if((p=(u=(c=p).parentElement)==null?c.getRootNode().host||null:u)===d){f.push(p);break}p!=null&&p===document.body&&d1(p)&&!d1(document.documentElement)||p!=null&&d1(p,a)&&f.push(p)}for(var h=r.visualViewport?r.visualViewport.width:innerWidth,m=r.visualViewport?r.visualViewport.height:innerHeight,b=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,g=e.getBoundingClientRect(),y=g.height,x=g.width,k=g.top,w=g.right,E=g.bottom,M=g.left,C=o==="start"||o==="nearest"?k:o==="end"?E:k+y/2,T=i==="center"?M+x/2:i==="end"?w:M,N=[],z=0;z=0&&M>=0&&E<=m&&w<=h&&k>=q&&E<=P&&M>=F&&w<=A)return N;var Y=getComputedStyle(D),J=parseInt(Y.borderLeftWidth,10),Ne=parseInt(Y.borderTopWidth,10),ie=parseInt(Y.borderRightWidth,10),ue=parseInt(Y.borderBottomWidth,10),de=0,me=0,Me="offsetWidth"in D?D.offsetWidth-D.clientWidth-J-ie:0,Se="offsetHeight"in D?D.offsetHeight-D.clientHeight-Ne-ue:0,ft="offsetWidth"in D?D.offsetWidth===0?0:L/D.offsetWidth:0,rt="offsetHeight"in D?D.offsetHeight===0?0:j/D.offsetHeight:0;if(d===D)de=o==="start"?C:o==="end"?C-m:o==="nearest"?Of(v,v+m,m,Ne,ue,v+C,v+C+y,y):C-m/2,me=i==="start"?T:i==="center"?T-h/2:i==="end"?T-h:Of(b,b+h,h,J,ie,b+T,b+T+x,x),de=Math.max(0,de+v),me=Math.max(0,me+b);else{de=o==="start"?C-q-Ne:o==="end"?C-P+ue+Se:o==="nearest"?Of(q,P,j,Ne,ue+Se,C,C+y,y):C-(q+j/2)+Se/2,me=i==="start"?T-F-J:i==="center"?T-(F+L/2)+Me/2:i==="end"?T-A+ie+Me:Of(F,A,L,J,ie+Me,T,T+x,x);var Or=D.scrollLeft,he=D.scrollTop;C+=he-(de=Math.max(0,Math.min(he+de/rt,D.scrollHeight-j/rt+Se))),T+=Or-(me=Math.max(0,Math.min(Or+me/ft,D.scrollWidth-L/ft+Me)))}N.push({el:D,top:de,left:me})}return N};typeof xr=="object"&&xr.__esModule&&xr.default&&xr.default;Ph(Wee);var Kee=typeof document<"u"?S.useLayoutEffect:S.useEffect;function qee(e){const t=S.useRef();return Kee(()=>{t.current=e}),t.current}function Gee(e,t){const[r,n]=S.useState([]),[o,i]=S.useState(()=>q0(e)),[s,a]=S.useState([]),l=S.useRef(e),c=qee(o);return l.current=e,Wd(Ul,({addCustomHandler:u})=>{const d=q0(l.current),f=u("positioner",d);return i(d),f},t),S.useLayoutEffect(()=>{const u=o.addListener("update",f=>{const p=[];for(const{id:h,data:m,setElement:b}of f){const v=g=>{g&&b(g)};p.push({id:h,data:m,ref:v})}a(p)}),d=o.addListener("done",f=>{n(f)});return c!=null&&c.recentUpdate&&o.onActiveChanged(c==null?void 0:c.recentUpdate),()=>{u(),d()}},[o,c]),S.useMemo(()=>{const u=[];for(const[d,{ref:f,data:p,id:h}]of s.entries()){const m=r[d],{element:b,position:v={}}=m??{},g={...Zy,...G4(v)};u.push({ref:f,element:b,data:p,key:h,...g})}return u},[s,r])}function Yee(e,t){const r=t==null||C1(t)?[e]:t,n=C1(t)?t:!0,o=S.useRef(Cl()),s=Gee(e,r)[0];return S.useMemo(()=>s&&n?{...s,active:!0}:{...Zy,ref:void 0,data:{},active:!1,key:o.current},[n,s])}function f1(e,t){return _e(e)?e(t):e}function Jee(e){return oe(e[0])}function Xee(e,t){var r;return oe(e)?e:ct(e)?Jee(e)?e[0]??"":((r=e.find(n=>Y4(n.attrs,t))??e[0])==null?void 0:r.shortcut)??"":e.shortcut}var Qee={title:e=>fA(e),upper:e=>e.toLocaleUpperCase(),lower:e=>e.toLocaleLowerCase()};function Zee(e,t){const{casing:r="title",namedAsSymbol:n=!1,modifierAsSymbol:o=!0,separator:i=" ",t:s}=t,a=Fz(e),l=[],c=Qee[r];for(const u of a){if(u.type==="char"){l.push(c(u.key));continue}if(u.type==="named"){const f=n===!0||ct(n)&&fr(n,u.key)?u.symbol??s(u.i18n):s(u.i18n);l.push(c(f));continue}const d=o===!0||ct(o)&&fr(o,u.key)?u.symbol:s(u.i18n);l.push(c(d))}return l.join(i)}var H3=({commandName:e,active:t,enabled:r,attrs:n})=>{const{t:o}=fj(),{getCommandOptions:i}=fm(),s=i(e),{description:a,label:l,icon:c,shortcut:u}=s||{},d=S.useMemo(()=>({active:t,attrs:n,enabled:r,t:o}),[t,n,r,o]),f=S.useMemo(()=>{if(u)return Zee(Xee(u,n??{}),{t:o,separator:""})},[u,n,o]);return S.useMemo(()=>({description:f1(a,d),label:f1(l,d),icon:f1(c,d),shortcut:f}),[d,a,l,c,f])},ete={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},B3=S.createContext(ete);B3.Provider;function F3(e){return e.map((t,r)=>S.createElement(t.tag,{key:r,...t.attr},F3(t.child??[])))}var Jm=e=>{const{name:t}=e;return I.createElement(tte,{...e},F3(gee[t]))},tte=e=>{const t=r=>{const n=e.size??r.size??"1em";let o;r.className&&(o=r.className),e.className&&(o=(o?`${o} `:"")+e.className);const{title:i,...s}=e;return I.createElement("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",...r.attr,...s,className:o,style:{color:e.color??r.color,...r.style,...e.style},height:n,width:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},i&&I.createElement("title",null,i),e.children)};return I.createElement(B3.Consumer,null,t)},rte=e=>ps(e)?!!e.name:!1,nte=({icon:e})=>oe(e)?I.createElement(Jm,{name:e,size:"1rem"}):e,ote=({icon:e,children:t})=>{if(!rte(e))return I.createElement(I.Fragment,null,t);const{sub:r,sup:n}=e,o=r??n,i=r!==void 0;return o===void 0?I.createElement(I.Fragment,null,t):I.createElement(oJ,{anchorOrigin:{vertical:i?"bottom":"top",horizontal:"right"},badgeContent:o,sx:{"& > .MuiBadge-badge":{bgcolor:"background.paper",color:"text.secondary",minWidth:12,height:12,margin:"2px 0",padding:"1px"}}},t)},dt=({commandName:e,active:t=!1,enabled:r,attrs:n,onSelect:o,onChange:i,icon:s,displayShortcut:a=!0,"aria-label":l,label:c,...u})=>{const d=S.useCallback((g,y)=>{o(),i==null||i(g,y)},[o,i]),f=S.useCallback(g=>{g.preventDefault()},[]),p=H3({commandName:e,active:t,enabled:r,attrs:n});let h=null;p.icon&&(h=oe(p.icon)?p.icon:p.icon.name);const m=l??p.label??"",b=c??m,v=a&&p.shortcut?` (${p.shortcut})`:"";return I.createElement(N3,{title:`${b}${v}`},I.createElement(T3,{component:"span",sx:{"&:not(:first-of-type)":{marginLeft:"-1px"}}},I.createElement(NX,{"aria-label":m,selected:t,disabled:!r,onMouseDown:f,color:"primary",size:"small",sx:{padding:"6px 12px","&.Mui-selected":{backgroundColor:"primary.main",color:"primary.contrastText"},"&.Mui-selected:hover":{backgroundColor:"primary.dark",color:"primary.contrastText"},"&:not(:first-of-type)":{borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:last-of-type)":{borderTopRightRadius:0,borderBottomRightRadius:0}},...u,value:e,onChange:d},I.createElement(ote,{icon:p.icon},I.createElement(nte,{icon:s??h})))))},ite=({icon:e})=>oe(e)?I.createElement(Jm,{name:e,size:"1rem"}):e,V3=({label:e,"aria-label":t,icon:r,children:n,onClose:o,...i})=>{const s=S.useRef(Cl()),[a,l]=S.useState(null),c=!!a,u=S.useCallback(p=>{p.preventDefault()},[]),d=S.useCallback(p=>{l(p.currentTarget)},[]),f=S.useCallback((p,h)=>{l(null),o==null||o(p,h)},[o]);return I.createElement(I.Fragment,null,I.createElement(N3,{title:e??t},I.createElement(Wq,{"aria-label":t,"aria-controls":c?s.current:void 0,"aria-haspopup":!0,"aria-expanded":c?"true":void 0,onMouseDown:u,onClick:d,size:"small",sx:p=>({border:`1px solid ${p.palette.divider}`,borderRadius:`${p.shape.borderRadius}px`,padding:"6px 12px","&:not(:first-of-type)":{marginLeft:"-1px",borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:last-of-type)":{borderTopRightRadius:0,borderBottomRightRadius:0}})},r&&I.createElement(ite,{icon:r}),I.createElement(Jm,{name:"arrowDownSFill",size:"1rem"}))),I.createElement(aX,{...i,id:s.current,anchorEl:a,open:c,onClose:f},n))},ste=e=>{const{insertHorizontalRule:t}=tr();rb();const r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=t.enabled();return I.createElement(dt,{...e,commandName:"insertHorizontalRule",enabled:n,onSelect:r})},ate=e=>{const{redo:t}=tr(),{redoDepth:r}=fm(!0),n=S.useCallback(()=>{t.enabled()&&t()},[t]),o=r()>0;return I.createElement(dt,{...e,commandName:"redo",active:!1,enabled:o,onSelect:n})},lte=e=>{const{toggleBlockquote:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().blockquote(),o=t.enabled();return I.createElement(dt,{...e,commandName:"toggleBlockquote",active:n,enabled:o,onSelect:r})},cv=e=>{const{toggleBold:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().bold(),o=t.enabled();return I.createElement(dt,{...e,commandName:"toggleBold",active:n,enabled:o,onSelect:r})},cte=e=>{const{toggleBulletList:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().bulletList(),o=t.enabled();return I.createElement(dt,{...e,commandName:"toggleBulletList",active:n,enabled:o,onSelect:r})},ute=({attrs:e={},...t})=>{const{toggleCodeBlock:r}=tr(),n=S.useCallback(()=>{r.enabled(e)&&r(e)},[r,e]),o=qr().codeBlock(),i=r.enabled(e);return I.createElement(dt,{...t,commandName:"toggleCodeBlock",active:o,enabled:i,attrs:e,onSelect:n})},uv=e=>{const{toggleCode:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().code(),o=t.enabled();return I.createElement(dt,{...e,commandName:"toggleCode",active:n,enabled:o,onSelect:r})},p1=({attrs:e,...t})=>{const{toggleHeading:r}=tr(),n=S.useCallback(()=>{r.enabled(e)&&r(e)},[r,e]),o=qr().heading(e),i=r.enabled(e);return I.createElement(dt,{...t,commandName:"toggleHeading",active:o,enabled:i,attrs:e,onSelect:n})},dv=e=>{const{toggleItalic:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().italic(),o=t.enabled();return I.createElement(dt,{...e,commandName:"toggleItalic",active:n,enabled:o,onSelect:r})},dte=e=>{const{toggleOrderedList:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().orderedList(),o=t.enabled();return I.createElement(dt,{...e,commandName:"toggleOrderedList",active:n,enabled:o,onSelect:r})},fte=e=>{const{toggleStrike:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().strike(),o=t.enabled();return I.createElement(dt,{...e,commandName:"toggleStrike",active:n,enabled:o,onSelect:r})},fv=e=>{const{toggleUnderline:t}=tr(),r=S.useCallback(()=>{t.enabled()&&t()},[t]),n=qr().underline(),o=t.enabled();return I.createElement(dt,{...e,commandName:"toggleUnderline",active:n,enabled:o,onSelect:r})},pte=e=>{const{undo:t}=tr(),{undoDepth:r}=fm(!0),n=S.useCallback(()=>{t.enabled()&&t()},[t]),o=r()>0;return I.createElement(dt,{...e,commandName:"undo",active:!1,enabled:o,onSelect:n})},En=e=>I.createElement(T3,{sx:{display:"flex",alignItems:"center",width:"fit-content",bgcolor:"background.paper",color:"text.secondary"},...e}),hte=({children:e})=>I.createElement(En,null,I.createElement(cv,null),I.createElement(dv,null),I.createElement(fv,null),I.createElement(fte,null),I.createElement(uv,null),e),mte=({icon:e})=>e?I.createElement(RJ,null,oe(e)?I.createElement(Jm,{name:e,size:"1rem"}):I.createElement(I.Fragment,null,e)):null,Db=({commandName:e,active:t=!1,enabled:r,attrs:n,onSelect:o,onClick:i,icon:s,displayShortcut:a=!0,label:l,description:c,displayDescription:u=!0,...d})=>{const f=S.useCallback(g=>{o(),i==null||i(g)},[o,i]),p=S.useCallback(g=>{g.preventDefault()},[]),h=H3({commandName:e,active:t,enabled:r,attrs:n});let m=null;h.icon&&(m=oe(h.icon)?h.icon:h.icon.name);const b=l??h.label??"",v=u&&(c??h.description);return I.createElement(mX,{selected:t,disabled:!r,onMouseDown:p,...d,onClick:f},s!==null&&I.createElement(mte,{icon:s??m}),I.createElement(HJ,{primary:b,secondary:v}),a&&h.shortcut&&I.createElement(cu,{variant:"body2",color:"text.secondary",sx:{ml:2}},h.shortcut))},_f=({attrs:e,...t})=>{const{toggleHeading:r}=tr(),n=S.useCallback(()=>{r.enabled(e)&&r(e)},[r,e]),o=qr().heading(e),i=r.enabled(e);return I.createElement(Db,{...t,commandName:"toggleHeading",active:o,enabled:i,attrs:e,onSelect:n})},gte={level:1},vte={level:2},jS={level:3},yte={level:4},bte={level:5},xte={level:6},kte=({showAll:e=!1,children:t})=>I.createElement(En,null,I.createElement(p1,{attrs:gte}),I.createElement(p1,{attrs:vte}),e?I.createElement(V3,{"aria-label":"More heading options"},I.createElement(_f,{attrs:jS}),I.createElement(_f,{attrs:yte}),I.createElement(_f,{attrs:bte}),I.createElement(_f,{attrs:xte})):I.createElement(p1,{attrs:jS}),t),wte=({children:e})=>I.createElement(En,null,I.createElement(pte,null),I.createElement(ate,null),e);typeof xr=="object"&&xr.__esModule&&xr.default&&xr.default;var j3=S.createContext({});function Ste(e={}){const t=S.useContext(j3),r=S.useMemo(()=>Q4(t,e.theme??{}),[t,e.theme]),n=S.useMemo(()=>MV(r).styles,[r]),o=ju(CV,e.className);return S.useMemo(()=>({style:n,className:o,theme:r}),[n,o,r])}var Ete=e=>{var t,r,n,o,i,s,a,l;const{children:c,as:u="div"}=e,{theme:d,style:f,className:p}=Ste({theme:e.theme??ws}),h=wb({palette:{primary:{main:((t=d.color)==null?void 0:t.primary)??ws.color.primary,dark:((n=(r=d.color)==null?void 0:r.hover)==null?void 0:n.primary)??ws.color.hover.primary,contrastText:((o=d.color)==null?void 0:o.primaryText)??ws.color.primaryText},secondary:{main:((i=d.color)==null?void 0:i.secondary)??ws.color.secondary,dark:((a=(s=d.color)==null?void 0:s.hover)==null?void 0:a.secondary)??ws.color.hover.secondary,contrastText:((l=d.color)==null?void 0:l.secondaryText)??ws.color.secondaryText}}});return I.createElement(oq,{theme:h},I.createElement(j3.Provider,{value:d},I.createElement(u,{style:f,className:p},c)))},U3=e=>I.createElement(gJ,{direction:"row",spacing:1,sx:{backgroundColor:"background.paper",overflowX:"auto"},...e}),Cte=[{name:"offset",options:{offset:[0,8]}}],Mte=({positioner:e="selection",children:t,...r})=>{const{ref:n,x:o,y:i,width:s,height:a,active:l}=Yee(()=>q0(e),[e]),[c,u]=S.useState(null),d=S.useMemo(()=>({position:"absolute",pointerEvents:"none",left:o,top:i,width:s,height:a}),[o,i,s,a]),f=S.useCallback(p=>{u(p),n==null||n(p)},[n]);return I.createElement(I.Fragment,null,I.createElement("div",{ref:f,style:d}),I.createElement(Lb,{placement:"top",modifiers:Cte,...r,open:l,anchorEl:c},I.createElement(U3,null,t?I.createElement(I.Fragment,null,t):I.createElement(hte,null))))},Ct=Ph(fh),$b=xt` /** * Styles extracted from: packages/remirror__theme/src/components-theme.ts */ @@ -771,8 +771,8 @@ Error generating stack: `+i.message+` .remirror-color-picker-cell-selected { } `;Ct.div` - ${Db} -`;var $b=xt` + ${$b} +`;var Hb=xt` /** * Styles extracted from: packages/remirror__theme/src/core-theme.ts */ @@ -838,8 +838,8 @@ Error generating stack: `+i.message+` pointer-events: none; } `;Ct.div` - ${$b} -`;var Hb=xt` + ${Hb} +`;var Bb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-blockquote-theme.ts */ @@ -854,8 +854,8 @@ Error generating stack: `+i.message+` color: #888; } `;Ct.div` - ${Hb} -`;var Bb=xt` + ${Bb} +`;var Fb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-callout-theme.ts */ @@ -891,8 +891,8 @@ Error generating stack: `+i.message+` background: #f8f8f8; } `;Ct.div` - ${Bb} -`;var Fb=xt` + ${Fb} +`;var Vb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-code-block-theme.ts */ @@ -3689,8 +3689,8 @@ Error generating stack: `+i.message+` bottom: 0.4em; } `;Ct.div` - ${Fb} -`;var Vb=xt` + ${Vb} +`;var jb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-count-theme.ts */ @@ -3698,8 +3698,8 @@ Error generating stack: `+i.message+` background-color: var(--rmr-hue-red-4); } `;Ct.div` - ${Vb} -`;var jb=xt` + ${jb} +`;var Ub=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-emoji-theme.ts */ @@ -3757,8 +3757,8 @@ Error generating stack: `+i.message+` padding-right: 5px; } `;Ct.div` - ${jb} -`;var Ub=xt` + ${Ub} +`;var Wb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-file-theme.ts */ @@ -3810,8 +3810,8 @@ Error generating stack: `+i.message+` color: #000; } `;Ct.div` - ${Ub} -`;var Wb=xt` + ${Wb} +`;var Kb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-gap-cursor-theme.ts */ @@ -3839,8 +3839,8 @@ Error generating stack: `+i.message+` display: block; } `;Ct.div` - ${Wb} -`;var Kb=xt` + ${Kb} +`;var qb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-image-theme.ts */ @@ -3862,8 +3862,8 @@ Error generating stack: `+i.message+` } } `;Ct.div` - ${Kb} -`;var qb=xt` + ${qb} +`;var Gb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-list-theme.ts */ @@ -3958,8 +3958,8 @@ Error generating stack: `+i.message+` border-left-color: var(--rmr-color-primary); } `;Ct.div` - ${qb} -`;var Gb=xt` + ${Gb} +`;var Yb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-mention-atom-theme.ts */ @@ -4024,16 +4024,16 @@ Error generating stack: `+i.message+` padding-right: 5px; } `;Ct.div` - ${Gb} -`;var Yb=xt` + ${Yb} +`;var Jb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-node-formatting-theme.ts */ .remirror-editor.ProseMirror { } `;Ct.div` - ${Yb} -`;var Jb=xt` + ${Jb} +`;var Xb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-placeholder-theme.ts */ @@ -4046,8 +4046,8 @@ Error generating stack: `+i.message+` content: attr(data-placeholder); } `;Ct.div` - ${Jb} -`;var Xb=xt` + ${Xb} +`;var Qb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-positioner-theme.ts */ @@ -4074,8 +4074,8 @@ Error generating stack: `+i.message+` position: absolute; } `;Ct.div` - ${Xb} -`;var Qb=xt` + ${Qb} +`;var Zb=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-tables-theme.ts */ @@ -4442,8 +4442,8 @@ Error generating stack: `+i.message+` background-color: var(--rmr-color-table-predelete-controller) !important; } `;Ct.div` - ${Qb} -`;var Zb=xt` + ${Zb} +`;var ex=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-whitespace-theme.ts */ @@ -4473,8 +4473,8 @@ Error generating stack: `+i.message+` content: '¶'; } `;Ct.div` - ${Zb} -`;var ex=xt` + ${ex} +`;var tx=xt` /** * Styles extracted from: packages/remirror__theme/src/extension-yjs-theme.ts */ @@ -4518,8 +4518,8 @@ Error generating stack: `+i.message+` display: inline-block; } `;Ct.div` - ${ex} -`;var tx=xt` + ${tx} +`;var rx=xt` /** * Styles extracted from: packages/remirror__theme/src/theme.ts */ @@ -4821,9 +4821,8 @@ Error generating stack: `+i.message+` /* margin-bottom: var(--rmr-space-2); */ } `;Ct.div` - ${tx} + ${rx} `;xt` - ${Db} ${$b} ${Hb} ${Bb} @@ -4842,8 +4841,8 @@ Error generating stack: `+i.message+` ${Zb} ${ex} ${tx} -`;var Mte=Ct.div` - ${Db} + ${rx} +`;var Tte=Ct.div` ${$b} ${Hb} ${Bb} @@ -4862,28 +4861,29 @@ Error generating stack: `+i.message+` ${Zb} ${ex} ${tx} -`,Tte=Object.defineProperty,Ote=Object.getOwnPropertyDescriptor,U3=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ote(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Tte(t,r,o),o},rx=class extends er{get name(){return"blockquote"}createTags(){return[oe.Block,oe.FormattingNode]}createNodeSpec(e,t){return{content:"block+",defining:!0,draggable:!1,...t,attrs:e.defaults(),parseDOM:[{tag:"blockquote",getAttrs:e.parse,priority:100},...t.parseDOM??[]],toDOM:r=>["blockquote",e.dom(r),0]}}toggleBlockquote(){return DC(this.type)}shortcut(e){return this.toggleBlockquote()(e)}createInputRules(){return[zh(/^\s*>\s$/,this.type)]}createPasteRules(){return{type:"node",nodeType:this.type,regexp:/^\s*>\s$/,startOfTextBlock:!0}}};U3([U({icon:"doubleQuotesL",description:({t:e})=>e(mk.DESCRIPTION),label:({t:e})=>e(mk.LABEL)})],rx.prototype,"toggleBlockquote",1);U3([je({shortcut:"Ctrl->",command:"toggleBlockquote"})],rx.prototype,"shortcut",1);var _te=Object.defineProperty,Ate=Object.getOwnPropertyDescriptor,Jd=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ate(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&_te(t,r,o),o},Nte={icon:"bold",label:({t:e})=>e(gk.LABEL),description:({t:e})=>e(gk.DESCRIPTION)},ba=class extends li{get name(){return"bold"}createTags(){return[oe.FormattingMark,oe.FontStyle]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"strong",getAttrs:e.parse},{tag:"b",getAttrs:r=>Je(r)&&r.style.fontWeight!=="normal"?e.parse(r):!1},{style:"font-weight",getAttrs:r=>ne(r)&&/^(bold(er)?|[5-9]\d{2,})$/.test(r)?null:!1},...t.parseDOM??[]],toDOM:r=>{const{weight:n}=this.options;return n?["strong",{"font-weight":n.toString()},0]:["strong",e.dom(r),0]}}}createInputRules(){return[Vu({regexp:/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,type:this.type,ignoreWhitespace:!0})]}toggleBold(e){return ns({type:this.type,selection:e})}setBold(e){return({tr:t,dispatch:r})=>{const{from:n,to:o}=jr(e??t.selection,t.doc);return r==null||r(t.addMark(n,o,this.type.create())),!0}}removeBold(e){return({tr:t,dispatch:r})=>{const{from:n,to:o}=jr(e??t.selection,t.doc);return t.doc.rangeHasMark(n,o,this.type)?(r==null||r(t.removeMark(n,o,this.type)),!0):!1}}shortcut(e){return this.toggleBold()(e)}};Jd([U(Nte)],ba.prototype,"toggleBold",1);Jd([U()],ba.prototype,"setBold",1);Jd([U()],ba.prototype,"removeBold",1);Jd([je({shortcut:D.Bold,command:"toggleBold"})],ba.prototype,"shortcut",1);ba=Jd([pe({defaultOptions:{weight:void 0},staticKeys:["weight"]})],ba);var Rte=Object.defineProperty,Pte=Object.getOwnPropertyDescriptor,nx=(e,t,r,n)=>{for(var o=n>1?void 0:n?Pte(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Rte(t,r,o),o},{DESCRIPTION:zte,LABEL:Lte}=sR,Ite={icon:"codeLine",description:({t:e})=>e(zte),label:({t:e})=>e(Lte)},kd=class extends li{get name(){return"code"}createTags(){return[oe.Code,oe.ExcludeInputRules]}createMarkSpec(e,t){return{excludes:"_",...t,attrs:e.defaults(),parseDOM:[{tag:"code",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["code",{spellcheck:"false",...e.dom(r)},0]}}createKeymap(){return{"Mod-`":ns({type:this.type})}}keyboardShortcut(e){return this.toggleCode()(e)}toggleCode(){return ns({type:this.type})}createInputRules(){return[Vu({regexp:new RegExp(`(?:\`)([^\`${kv}]+)(?:\`)$`),type:this.type,ignoreWhitespace:!0})]}createPasteRules(){return[{type:"mark",regexp:/`([^`]+)`/g,markType:this.type}]}};nx([je({shortcut:D.Code,command:"toggleCode"})],kd.prototype,"keyboardShortcut",1);nx([U(Ite)],kd.prototype,"toggleCode",1);kd=nx([pe({})],kd);var Dte=Hte,$te=Object.prototype.hasOwnProperty;function Hte(){for(var e={},t=0;t4&&r.slice(0,4)===lx&&Mre.test(t)&&(t.charAt(4)==="-"?n=_re(t):t=Are(t),o=Sre),new o(n,t))}function _re(e){var t=e.slice(5).replace(Z3,Rre);return lx+t.charAt(0).toUpperCase()+t.slice(1)}function Are(e){var t=e.slice(4);return Z3.test(t)?e:(t=t.replace(Tre,Nre),t.charAt(0)!=="-"&&(t="-"+t),lx+t)}function Nre(e){return"-"+e.toLowerCase()}function Rre(e){return e.charAt(1).toUpperCase()}var Pre=zre,qS=/[#.]/g;function zre(e,t){for(var r=e||"",n=t||"div",o={},i=0,s,a,l;i=48&&t<=57}var rie=nie;function nie(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}var oie=iie;function iie(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}var sie=oie,aie=rO,lie=cie;function cie(e){return sie(e)||aie(e)}var Nf,uie=59,die=fie;function fie(e){var t="&"+e+";",r;return Nf=Nf||document.createElement("i"),Nf.innerHTML=t,r=Nf.textContent,r.charCodeAt(r.length-1)===uie&&e!=="semi"||r===t?!1:r}var e4=Zoe,t4=eie,pie=rO,hie=rie,nO=lie,mie=die,gie=_ie,vie={}.hasOwnProperty,Ba=String.fromCharCode,yie=Function.prototype,r4={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:!1,nonTerminated:!0},bie=9,n4=10,xie=12,kie=32,o4=38,wie=59,Sie=60,Eie=61,Cie=35,Mie=88,Tie=120,Oie=65533,Ja="named",dx="hexadecimal",fx="decimal",px={};px[dx]=16;px[fx]=10;var Jm={};Jm[Ja]=nO;Jm[fx]=pie;Jm[dx]=hie;var oO=1,iO=2,sO=3,aO=4,lO=5,pv=6,cO=7,ws={};ws[oO]="Named character references must be terminated by a semicolon";ws[iO]="Numeric character references must be terminated by a semicolon";ws[sO]="Named character references cannot be empty";ws[aO]="Numeric character references cannot be empty";ws[lO]="Named character references must be known";ws[pv]="Numeric character references cannot be disallowed";ws[cO]="Numeric character references cannot be outside the permissible Unicode range";function _ie(e,t){var r={},n,o;t||(t={});for(o in r4)n=t[o],r[o]=n??r4[o];return(r.position.indent||r.position.start)&&(r.indent=r.position.indent||[],r.position=r.position.start),Aie(e,r)}function Aie(e,t){var r=t.additional,n=t.nonTerminated,o=t.text,i=t.reference,s=t.warning,a=t.textContext,l=t.referenceContext,c=t.warningContext,u=t.position,d=t.indent||[],f=e.length,p=0,h=-1,m=u.column||1,b=u.line||1,v="",g=[],y,x,k,w,E,T,C,M,N,F,I,V,j,z,q,A,P,B,Y;for(typeof r=="string"&&(r=r.charCodeAt(0)),A=J(),M=s?Ne:yie,p--,f++;++p65535&&(T-=65536,F+=Ba(T>>>10|55296),T=56320|T&1023),T=F+Ba(T))):z!==Ja&&M(aO,B)),T?(ie(),A=J(),p=Y-1,m+=Y-j+1,g.push(T),P=J(),P.offset++,i&&i.call(l,T,{start:A,end:P},e.slice(j-1,Y)),A=P):(w=e.slice(j-1,Y),v+=w,m+=w.length,p=Y-1)}else E===10&&(b++,h++,m=0),E===E?(v+=Ba(E),m++):ie();return g.join("");function J(){return{line:b,column:m,offset:p+(u.offset||0)}}function Ne(ue,de){var me=J();me.column+=de,me.offset+=de,s.call(c,ws[ue],me,ue)}function ie(){v&&(g.push(v),o&&o.call(a,v,{start:A,end:J()}),v="")}}function Nie(e){return e>=55296&&e<=57343||e>1114111}function Rie(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var uO={exports:{}};(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/** + ${rx} +`,Ote=Object.defineProperty,_te=Object.getOwnPropertyDescriptor,W3=(e,t,r,n)=>{for(var o=n>1?void 0:n?_te(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ote(t,r,o),o},nx=class extends er{get name(){return"blockquote"}createTags(){return[te.Block,te.FormattingNode]}createNodeSpec(e,t){return{content:"block+",defining:!0,draggable:!1,...t,attrs:e.defaults(),parseDOM:[{tag:"blockquote",getAttrs:e.parse,priority:100},...t.parseDOM??[]],toDOM:r=>["blockquote",e.dom(r),0]}}toggleBlockquote(){return $C(this.type)}shortcut(e){return this.toggleBlockquote()(e)}createInputRules(){return[Lh(/^\s*>\s$/,this.type)]}createPasteRules(){return{type:"node",nodeType:this.type,regexp:/^\s*>\s$/,startOfTextBlock:!0}}};W3([U({icon:"doubleQuotesL",description:({t:e})=>e(gk.DESCRIPTION),label:({t:e})=>e(gk.LABEL)})],nx.prototype,"toggleBlockquote",1);W3([je({shortcut:"Ctrl->",command:"toggleBlockquote"})],nx.prototype,"shortcut",1);var Ate=Object.defineProperty,Nte=Object.getOwnPropertyDescriptor,Jd=(e,t,r,n)=>{for(var o=n>1?void 0:n?Nte(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ate(t,r,o),o},Rte={icon:"bold",label:({t:e})=>e(vk.LABEL),description:({t:e})=>e(vk.DESCRIPTION)},ya=class extends ci{get name(){return"bold"}createTags(){return[te.FormattingMark,te.FontStyle]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"strong",getAttrs:e.parse},{tag:"b",getAttrs:r=>et(r)&&r.style.fontWeight!=="normal"?e.parse(r):!1},{style:"font-weight",getAttrs:r=>oe(r)&&/^(bold(er)?|[5-9]\d{2,})$/.test(r)?null:!1},...t.parseDOM??[]],toDOM:r=>{const{weight:n}=this.options;return n?["strong",{"font-weight":n.toString()},0]:["strong",e.dom(r),0]}}}createInputRules(){return[Vu({regexp:/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,type:this.type,ignoreWhitespace:!0})]}toggleBold(e){return is({type:this.type,selection:e})}setBold(e){return({tr:t,dispatch:r})=>{const{from:n,to:o}=jr(e??t.selection,t.doc);return r==null||r(t.addMark(n,o,this.type.create())),!0}}removeBold(e){return({tr:t,dispatch:r})=>{const{from:n,to:o}=jr(e??t.selection,t.doc);return t.doc.rangeHasMark(n,o,this.type)?(r==null||r(t.removeMark(n,o,this.type)),!0):!1}}shortcut(e){return this.toggleBold()(e)}};Jd([U(Rte)],ya.prototype,"toggleBold",1);Jd([U()],ya.prototype,"setBold",1);Jd([U()],ya.prototype,"removeBold",1);Jd([je({shortcut:$.Bold,command:"toggleBold"})],ya.prototype,"shortcut",1);ya=Jd([pe({defaultOptions:{weight:void 0},staticKeys:["weight"]})],ya);var Pte=Object.defineProperty,zte=Object.getOwnPropertyDescriptor,ox=(e,t,r,n)=>{for(var o=n>1?void 0:n?zte(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Pte(t,r,o),o},{DESCRIPTION:Lte,LABEL:Ite}=aR,Dte={icon:"codeLine",description:({t:e})=>e(Lte),label:({t:e})=>e(Ite)},kd=class extends ci{get name(){return"code"}createTags(){return[te.Code,te.ExcludeInputRules]}createMarkSpec(e,t){return{excludes:"_",...t,attrs:e.defaults(),parseDOM:[{tag:"code",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["code",{spellcheck:"false",...e.dom(r)},0]}}createKeymap(){return{"Mod-`":is({type:this.type})}}keyboardShortcut(e){return this.toggleCode()(e)}toggleCode(){return is({type:this.type})}createInputRules(){return[Vu({regexp:new RegExp(`(?:\`)([^\`${wv}]+)(?:\`)$`),type:this.type,ignoreWhitespace:!0})]}createPasteRules(){return[{type:"mark",regexp:/`([^`]+)`/g,markType:this.type}]}};ox([je({shortcut:$.Code,command:"toggleCode"})],kd.prototype,"keyboardShortcut",1);ox([U(Dte)],kd.prototype,"toggleCode",1);kd=ox([pe({})],kd);var $te=Bte,Hte=Object.prototype.hasOwnProperty;function Bte(){for(var e={},t=0;t4&&r.slice(0,4)===cx&&Tre.test(t)&&(t.charAt(4)==="-"?n=Are(t):t=Nre(t),o=Ere),new o(n,t))}function Are(e){var t=e.slice(5).replace(eO,Pre);return cx+t.charAt(0).toUpperCase()+t.slice(1)}function Nre(e){var t=e.slice(4);return eO.test(t)?e:(t=t.replace(Ore,Rre),t.charAt(0)!=="-"&&(t="-"+t),cx+t)}function Rre(e){return"-"+e.toLowerCase()}function Pre(e){return e.charAt(1).toUpperCase()}var zre=Lre,GS=/[#.]/g;function Lre(e,t){for(var r=e||"",n=t||"div",o={},i=0,s,a,l;i=48&&t<=57}var nie=oie;function oie(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}var iie=sie;function sie(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}var aie=iie,lie=nO,cie=uie;function uie(e){return aie(e)||lie(e)}var Nf,die=59,fie=pie;function pie(e){var t="&"+e+";",r;return Nf=Nf||document.createElement("i"),Nf.innerHTML=t,r=Nf.textContent,r.charCodeAt(r.length-1)===die&&e!=="semi"||r===t?!1:r}var t4=eie,r4=tie,hie=nO,mie=nie,oO=cie,gie=fie,vie=Aie,yie={}.hasOwnProperty,Ba=String.fromCharCode,bie=Function.prototype,n4={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:!1,nonTerminated:!0},xie=9,o4=10,kie=12,wie=32,i4=38,Sie=59,Eie=60,Cie=61,Mie=35,Tie=88,Oie=120,_ie=65533,Ja="named",fx="hexadecimal",px="decimal",hx={};hx[fx]=16;hx[px]=10;var Xm={};Xm[Ja]=oO;Xm[px]=hie;Xm[fx]=mie;var iO=1,sO=2,aO=3,lO=4,cO=5,hv=6,uO=7,ks={};ks[iO]="Named character references must be terminated by a semicolon";ks[sO]="Numeric character references must be terminated by a semicolon";ks[aO]="Named character references cannot be empty";ks[lO]="Numeric character references cannot be empty";ks[cO]="Named character references must be known";ks[hv]="Numeric character references cannot be disallowed";ks[uO]="Numeric character references cannot be outside the permissible Unicode range";function Aie(e,t){var r={},n,o;t||(t={});for(o in n4)n=t[o],r[o]=n??n4[o];return(r.position.indent||r.position.start)&&(r.indent=r.position.indent||[],r.position=r.position.start),Nie(e,r)}function Nie(e,t){var r=t.additional,n=t.nonTerminated,o=t.text,i=t.reference,s=t.warning,a=t.textContext,l=t.referenceContext,c=t.warningContext,u=t.position,d=t.indent||[],f=e.length,p=0,h=-1,m=u.column||1,b=u.line||1,v="",g=[],y,x,k,w,E,M,C,T,N,z,D,V,j,L,q,A,P,F,Y;for(typeof r=="string"&&(r=r.charCodeAt(0)),A=J(),T=s?Ne:bie,p--,f++;++p65535&&(M-=65536,z+=Ba(M>>>10|55296),M=56320|M&1023),M=z+Ba(M))):L!==Ja&&T(lO,F)),M?(ie(),A=J(),p=Y-1,m+=Y-j+1,g.push(M),P=J(),P.offset++,i&&i.call(l,M,{start:A,end:P},e.slice(j-1,Y)),A=P):(w=e.slice(j-1,Y),v+=w,m+=w.length,p=Y-1)}else E===10&&(b++,h++,m=0),E===E?(v+=Ba(E),m++):ie();return g.join("");function J(){return{line:b,column:m,offset:p+(u.offset||0)}}function Ne(ue,de){var me=J();me.column+=de,me.offset+=de,s.call(c,ks[ue],me,ue)}function ie(){v&&(g.push(v),o&&o.call(a,v,{start:A,end:J()}),v="")}}function Rie(e){return e>=55296&&e<=57343||e>1114111}function Pie(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var dO={exports:{}};(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/** * Prism: Lightweight, robust, elegant syntax highlighting * * @license MIT * @author Lea Verou * @namespace * @public - */var r=function(n){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,s={},a={manual:n.Prism&&n.Prism.manual,disableWorkerMessageHandler:n.Prism&&n.Prism.disableWorkerMessageHandler,util:{encode:function g(y){return y instanceof l?new l(y.type,g(y.content),y.alias):Array.isArray(y)?y.map(g):y.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(k){var g=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(k.stack)||[])[1];if(g){var y=document.getElementsByTagName("script");for(var x in y)if(y[x].src==g)return y[x]}return null}},isActive:function(g,y,x){for(var k="no-"+y;g;){var w=g.classList;if(w.contains(y))return!0;if(w.contains(k))return!1;g=g.parentElement}return!!x}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(g,y){var x=a.util.clone(a.languages[g]);for(var k in y)x[k]=y[k];return x},insertBefore:function(g,y,x,k){k=k||a.languages;var w=k[g],E={};for(var T in w)if(w.hasOwnProperty(T)){if(T==y)for(var C in x)x.hasOwnProperty(C)&&(E[C]=x[C]);x.hasOwnProperty(T)||(E[T]=w[T])}var M=k[g];return k[g]=E,a.languages.DFS(a.languages,function(N,F){F===M&&N!=g&&(this[N]=E)}),E},DFS:function g(y,x,k,w){w=w||{};var E=a.util.objId;for(var T in y)if(y.hasOwnProperty(T)){x.call(y,T,y[T],k||T);var C=y[T],M=a.util.type(C);M==="Object"&&!w[E(C)]?(w[E(C)]=!0,g(C,x,null,w)):M==="Array"&&!w[E(C)]&&(w[E(C)]=!0,g(C,x,T,w))}}},plugins:{},highlightAll:function(g,y){a.highlightAllUnder(document,g,y)},highlightAllUnder:function(g,y,x){var k={callback:x,container:g,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",k),k.elements=Array.prototype.slice.apply(k.container.querySelectorAll(k.selector)),a.hooks.run("before-all-elements-highlight",k);for(var w=0,E;E=k.elements[w++];)a.highlightElement(E,y===!0,k.callback)},highlightElement:function(g,y,x){var k=a.util.getLanguage(g),w=a.languages[k];a.util.setLanguage(g,k);var E=g.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(E,k);var T=g.textContent,C={element:g,language:k,grammar:w,code:T};function M(F){C.highlightedCode=F,a.hooks.run("before-insert",C),C.element.innerHTML=C.highlightedCode,a.hooks.run("after-highlight",C),a.hooks.run("complete",C),x&&x.call(C.element)}if(a.hooks.run("before-sanity-check",C),E=C.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!C.code){a.hooks.run("complete",C),x&&x.call(C.element);return}if(a.hooks.run("before-highlight",C),!C.grammar){M(a.util.encode(C.code));return}if(y&&n.Worker){var N=new Worker(a.filename);N.onmessage=function(F){M(F.data)},N.postMessage(JSON.stringify({language:C.language,code:C.code,immediateClose:!0}))}else M(a.highlight(C.code,C.grammar,C.language))},highlight:function(g,y,x){var k={code:g,grammar:y,language:x};if(a.hooks.run("before-tokenize",k),!k.grammar)throw new Error('The language "'+k.language+'" has no grammar.');return k.tokens=a.tokenize(k.code,k.grammar),a.hooks.run("after-tokenize",k),l.stringify(a.util.encode(k.tokens),k.language)},tokenize:function(g,y){var x=y.rest;if(x){for(var k in x)y[k]=x[k];delete y.rest}var w=new d;return f(w,w.head,g),u(g,w,y,w.head,0),h(w)},hooks:{all:{},add:function(g,y){var x=a.hooks.all;x[g]=x[g]||[],x[g].push(y)},run:function(g,y){var x=a.hooks.all[g];if(!(!x||!x.length))for(var k=0,w;w=x[k++];)w(y)}},Token:l};n.Prism=a;function l(g,y,x,k){this.type=g,this.content=y,this.alias=x,this.length=(k||"").length|0}l.stringify=function g(y,x){if(typeof y=="string")return y;if(Array.isArray(y)){var k="";return y.forEach(function(M){k+=g(M,x)}),k}var w={type:y.type,content:g(y.content,x),tag:"span",classes:["token",y.type],attributes:{},language:x},E=y.alias;E&&(Array.isArray(E)?Array.prototype.push.apply(w.classes,E):w.classes.push(E)),a.hooks.run("wrap",w);var T="";for(var C in w.attributes)T+=" "+C+'="'+(w.attributes[C]||"").replace(/"/g,""")+'"';return"<"+w.tag+' class="'+w.classes.join(" ")+'"'+T+">"+w.content+""};function c(g,y,x,k){g.lastIndex=y;var w=g.exec(x);if(w&&k&&w[1]){var E=w[1].length;w.index+=E,w[0]=w[0].slice(E)}return w}function u(g,y,x,k,w,E){for(var T in x)if(!(!x.hasOwnProperty(T)||!x[T])){var C=x[T];C=Array.isArray(C)?C:[C];for(var M=0;M=E.reach);P+=A.value.length,A=A.next){var B=A.value;if(y.length>g.length)return;if(!(B instanceof l)){var Y=1,J;if(V){if(J=c(q,P,g,I),!J||J.index>=g.length)break;var de=J.index,Ne=J.index+J[0].length,ie=P;for(ie+=A.value.length;de>=ie;)A=A.next,ie+=A.value.length;if(ie-=A.value.length,P=ie,A.value instanceof l)continue;for(var ue=A;ue!==y.tail&&(ieE.reach&&(E.reach=ft);var rt=A.prev;Me&&(rt=f(y,rt,Me),P+=Me.length),p(y,rt,Y);var Or=new l(T,F?a.tokenize(me,F):me,j,me);if(A=f(y,rt,Or),Se&&f(y,A,Se),Y>1){var he={cause:T+","+M,reach:ft};u(g,y,x,A.prev,P,he),E&&he.reach>E.reach&&(E.reach=he.reach)}}}}}}function d(){var g={value:null,prev:null,next:null},y={value:null,prev:g,next:null};g.next=y,this.head=g,this.tail=y,this.length=0}function f(g,y,x){var k=y.next,w={value:x,prev:y,next:k};return y.next=w,k.prev=w,g.length++,w}function p(g,y,x){for(var k=y.next,w=0;w/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(r,n){var o={};o["language-"+n]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[n]},o.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:o}};i["language-"+n]={pattern:/[\s\S]+/,inside:e.languages[n]};var s={};s[r]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return r}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",s)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,r){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[r,"language-"+r],inside:e.languages[r]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}var Lie=mx;mx.displayName="css";mx.aliases=[];function mx(e){(function(t){var r=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+r.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+r.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+r.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:r,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var n=t.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))})(e)}var Iie=gx;gx.displayName="clike";gx.aliases=[];function gx(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}var Die=vx;vx.displayName="javascript";vx.aliases=["js"];function vx(e){e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}var fu=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof Pu=="object"?Pu:{},$ie=ese();fu.Prism={manual:!0,disableWorkerMessageHandler:!0};var Hie=ene,Bie=gie,dO=Pie,Fie=zie,Vie=Lie,jie=Iie,Uie=Die;$ie();var yx={}.hasOwnProperty;function fO(){}fO.prototype=dO;var Et=new fO,Wie=Et;Et.highlight=qie;Et.register=Qd;Et.alias=Kie;Et.registered=Gie;Et.listLanguages=Yie;Qd(Fie);Qd(Vie);Qd(jie);Qd(Uie);Et.util.encode=Qie;Et.Token.stringify=Jie;function Qd(e){if(typeof e!="function"||!e.displayName)throw new Error("Expected `function` for `grammar`, got `"+e+"`");Et.languages[e.displayName]===void 0&&e(Et)}function Kie(e,t){var r=Et.languages,n=e,o,i,s,a;t&&(n={},n[e]=t);for(o in n)for(i=n[o],i=typeof i=="string"?[i]:i,s=i.length,a=-1;++a{for(var o=n>1?void 0:n?rse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&tse(t,r,o),o},pO=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},xi=(e,t,r)=>(pO(e,t,"read from private field"),r?r.call(e):t.get(e)),p1=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},h1=(e,t,r,n)=>(pO(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),hO="data-code-block-language";function mO(e,t,r=[]){return e.map(n=>{const o=[...r];return n.type==="element"&&n.properties.className?o.push(...n.properties.className):n.type==="text"&&o.length===0&&t&&o.push(t),n.type==="element"?mO(n.children,t,o):{text:n.value,classes:o}})}function nse(e,t){var r;const{node:n,pos:o}=e,i=xh({language:(r=n.attrs.language)==null?void 0:r.replace("language-",""),fallback:"markup"}),s=bx.highlight(n.textContent??"",i),a=mO(s,t);let l=o+1;function c(u){const d=l,f=d+u.text.length;return l=f,{...u,from:d,to:f}}return Y4(a).map(c)}function i4(e){const{blocks:t,skipLast:r,plainTextClassName:n}=e,o=[];for(const i of t){const s=nse(i,n),a=r?s.length-1:s.length;for(const l of Ev(a)){const c=s[l],u=c==null?void 0:c.classes;if(!c||!(u!=null&&u.length))continue;const d=Ge.inline(c.from,c.to,{class:u.join(" ")});o.push(d)}}return o}function ose(e){return!!(e&&Zt(e)&&ne(e.language)&&e.language.length>0)}function ise(e){return t=>({state:{tr:r,selection:n},dispatch:o})=>{if(!ose(t))throw new Error("Invalid attrs passed to the updateAttributes method");const i=ts({types:e,selection:n});return!i||G4(t,i.node.attrs)?!1:(r.setNodeMarkup(i.pos,e,{...i.node.attrs,...t}),o&&o(r),!0)}}function xh(e){const{language:t,fallback:r}=e;if(!t)return r;const n=bx.listLanguages();for(const o of n)if(o.toLowerCase()===t.toLowerCase())return o;return r}function sse(e,t){const{language:r,wrap:n}=$d(e.attrs,t),{style:o,...i}=t.dom(e);let s=i.style;return n&&(s=qv({whiteSpace:"pre-wrap",wordBreak:"break-all"},s)),["pre",{spellcheck:"false",...i,class:ju(i.class,`language-${r}`)},["code",{[hO]:r,style:s},0]]}function ase(e){return({pos:t}=ee())=>({tr:r,dispatch:n})=>{const{type:o,formatter:i,defaultLanguage:s}=e,{from:a,to:l}=t?{from:t,to:t}:r.selection,c=ts({types:o,selection:r.selection});if(!c)return!1;const{node:{attrs:u,textContent:d},start:f}=c,p=a-f,h=l-f,m=xh({language:u.language,fallback:s}),b=i({source:d,language:m,cursorOffset:p});let v;if(p!==h&&(v=i({source:d,language:m,cursorOffset:h})),!b)return!1;const{cursorOffset:g,formatted:y}=b;if(y===d)return!1;const x=f+d.length;r.insertText(y,f,x);const k=f+g,w=v?f+v.cursorOffset:void 0;return r.setSelection(le.between(r.doc.resolve(k),r.doc.resolve(w??k))),n&&n(r),!0}}function lse(e){var t;return(t=e.getAttribute(hO)??e.classList[0])==null?void 0:t.replace("language-","")}var{DESCRIPTION:cse,LABEL:use}=nR,dse={icon:"bracesLine",description:({t:e})=>e(cse),label:({t:e})=>e(use)},Ps,pu,hu,fse=class{constructor(e,t){p1(this,Ps,void 0),p1(this,pu,void 0),p1(this,hu,!1),h1(this,pu,e),h1(this,Ps,t)}init(e){const t=Vz({node:e.doc,type:xi(this,pu)});return this.refreshDecorationSet(e.doc,t),this}refreshDecorationSet(e,t){const r=i4({blocks:t,skipLast:xi(this,hu),defaultLanguage:xi(this,Ps).options.defaultLanguage,plainTextClassName:xi(this,Ps).options.plainTextClassName??void 0});this.decorationSet=Ee.create(e,r)}apply(e,t){if(!e.docChanged)return this;this.decorationSet=this.decorationSet.map(e.mapping,e.doc);const r=jz(e,{descend:!0,predicate:n=>n.type===xi(this,pu),StepTypes:[]});return this.updateDecorationSet(e,r),this}updateDecorationSet(e,t){if(t.length===0)return;let r=this.decorationSet;for(const{node:n,pos:o}of t)r=this.decorationSet.remove(this.decorationSet.find(o,o+n.nodeSize));this.decorationSet=r.add(e.doc,i4({blocks:t,skipLast:xi(this,hu),defaultLanguage:xi(this,Ps).options.defaultLanguage,plainTextClassName:xi(this,Ps).options.plainTextClassName??void 0}))}setDeleted(e){h1(this,hu,e)}};Ps=new WeakMap;pu=new WeakMap;hu=new WeakMap;var lo=class extends er{get name(){return"codeBlock"}createTags(){return[oe.Block,oe.Code]}init(){this.registerLanguages()}createNodeSpec(e,t){const r=/highlight-(?:text|source)-([\da-z]+)/;return{content:"text*",marks:"",defining:!0,draggable:!1,...t,code:!0,attrs:{...e.defaults(),language:{default:this.options.defaultLanguage},wrap:{default:this.options.defaultWrap}},parseDOM:[{tag:"div.highlight",preserveWhitespace:"full",getAttrs:n=>{var o,i;if(!Je(n))return!1;const s=n.querySelector("pre.code");if(!Je(s))return!1;const a=kn(s,"white-space")==="pre-wrap",l=(i=(o=n.className.match(r))==null?void 0:o[1])==null?void 0:i.replace("language-","");return{...e.parse(n),language:l,wrap:a}}},{tag:"pre",preserveWhitespace:"full",getAttrs:n=>{if(!Je(n))return!1;const o=n.querySelector("code");if(!Je(o))return!1;const i=kn(o,"white-space")==="pre-wrap",s=this.options.getLanguageFromDom(o,n);return{...e.parse(n),language:s,wrap:i}}},...t.parseDOM??[]],toDOM:n=>sse(n,e)}}createAttributes(){return{class:aV[this.options.syntaxTheme.toUpperCase()]}}createInputRules(){const e=/^```([\dA-Za-z]*) $/,t=r=>({language:xh({language:Zo(r,1),fallback:this.options.defaultLanguage})});return[BC({regexp:e,type:this.type,beforeDispatch:({tr:r,start:n})=>{const o=r.doc.resolve(n);r.setSelection(le.near(o))},getAttributes:t})]}onSetOptions(e){const{changes:t}=e;t.supportedLanguages.changed&&this.registerLanguages(),t.syntaxTheme.changed&&this.store.updateAttributes()}createPlugin(){const e=new fse(this.type,this),t=()=>(e.setDeleted(!0),!1);return{state:{init(r,n){return e.init(n)},apply(r,n,o,i){return e.apply(r,i)}},props:{handleKeyDown:Jv({Backspace:t,"Mod-Backspace":t,Delete:t,"Mod-Delete":t,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t}),decorations(){return e.setDeleted(!1),e.decorationSet}}}}toggleCodeBlock(e={}){return Gv({type:this.type,toggleType:this.options.toggleName,attrs:{language:this.options.defaultLanguage,...e}})}createCodeBlock(e){return Fu(this.type,e)}updateCodeBlock(e){return ise(this.type)(e)}formatCodeBlock(e){return ase({type:this.type,formatter:this.options.formatter,defaultLanguage:this.options.defaultLanguage})(e)}tabKey({state:e,dispatch:t}){const{selection:r,tr:n,schema:o}=e,{node:i}=nz(r);if(!$h({node:i,types:this.type}))return!1;if(r.empty)n.insertText(" ");else{const{from:s,to:a}=r;n.replaceWith(s,a,o.text(" "))}return t&&t(n),!0}backspaceKey({dispatch:e,tr:t,state:r}){if(!t.selection.empty)return!1;const n=ts({types:this.type,selection:t.selection});if((n==null?void 0:n.start)!==t.selection.from)return!1;const{pos:o,node:i,start:s}=n,a=it(r.schema.nodes,this.options.toggleName);return i.textContent.trim()===""?t.doc.lastChild===i&&t.doc.firstChild===i?tz({pos:o,tr:t,content:a.create()}):ez({pos:o,tr:t}):s>2?t.setSelection(le.near(t.doc.resolve(s-2))):(t.insert(0,a.create()),t.setSelection(le.near(t.doc.resolve(1)))),e&&e(t),!0}enterKey({dispatch:e,tr:t}){if(!(gs(t.selection)&&t.selection.empty))return!1;const{nodeBefore:r,parent:n}=t.selection.$anchor;if(!(r!=null&&r.isText)||!n.type.isTextblock)return!1;const o=/^```([A-Za-z]*)?$/,{text:i,nodeSize:s}=r,{textContent:a}=n;if(!i)return!1;const l=i.match(o),c=a.match(o);if(!l||!c)return!1;const[,u]=l,d=xh({language:u,fallback:this.options.defaultLanguage}),f=t.selection.$from.before(),p=f+s+1;return t.replaceWith(f,p,this.type.create({language:d})),t.setSelection(le.near(t.doc.resolve(f+1))),e&&e(t),!0}formatShortcut({tr:e}){const t=this.store.commands;if(!SC({type:this.type,state:e}))return!1;const r=t.formatCodeBlock.isEnabled();return r&&t.formatCodeBlock(),r}registerLanguages(){for(const e of this.options.supportedLanguages)bx.register(e)}};pi([U(dse)],lo.prototype,"toggleCodeBlock",1);pi([U()],lo.prototype,"createCodeBlock",1);pi([U()],lo.prototype,"updateCodeBlock",1);pi([U()],lo.prototype,"formatCodeBlock",1);pi([je({shortcut:"Tab"})],lo.prototype,"tabKey",1);pi([je({shortcut:"Backspace"})],lo.prototype,"backspaceKey",1);pi([je({shortcut:"Enter"})],lo.prototype,"enterKey",1);pi([je({shortcut:D.Format})],lo.prototype,"formatShortcut",1);lo=pi([pe({defaultOptions:{supportedLanguages:[],toggleName:"paragraph",formatter:({source:e})=>({cursorOffset:0,formatted:e}),syntaxTheme:"a11y_dark",defaultLanguage:"markup",defaultWrap:!1,plainTextClassName:"",getLanguageFromDom:lse},staticKeys:["getLanguageFromDom"]})],lo);var gO=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},ze=(e,t,r)=>(gO(e,t,"read from private field"),r?r.call(e):t.get(e)),Xa=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Mi=(e,t,r,n)=>(gO(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),pse='',hse='',mse=encodeURIComponent(pse),gse=encodeURIComponent(hse),Ar,vse=class{constructor(e){Xa(this,Ar,void 0);const t=document.createElement("div"),r=document.createElement("div");this.dom=t,Mi(this,Ar,r),this.type=e,this.createHandle(e)}createHandle(e){switch(ar(this.dom,{position:"absolute",pointerEvents:"auto",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"100"}),ar(ze(this,Ar),{opacity:"0",transition:"opacity 300ms ease-in 0s"}),ze(this,Ar).dataset.dragging="",e){case 0:ar(this.dom,{right:"0px",top:"0px",height:"100%",width:"15px",cursor:"col-resize"}),ar(ze(this,Ar),{width:" 4px",height:"36px",maxHeight:"50%",boxSizing:"content-box",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 1:ar(this.dom,{left:"0px",top:"0px",height:"100%",width:"15px",cursor:"col-resize"}),ar(ze(this,Ar),{width:" 4px",height:"36px",maxHeight:"50%",boxSizing:"content-box",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 2:ar(this.dom,{bottom:"0px",width:"100%",height:"14px",cursor:"row-resize"}),ar(ze(this,Ar),{width:" 42px",height:"4px",boxSizing:"content-box",maxWidth:"50%",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 3:ar(this.dom,{right:"-1px",bottom:"-2px",width:"30px",height:"30px",cursor:"nwse-resize",zIndex:"101"}),ar(ze(this,Ar),{height:"22px",width:"22px",backgroundRepeat:"no-repeat",backgroundImage:`url("data:image/svg+xml,${gse}") `});break;case 4:ar(this.dom,{left:"-1px",bottom:"-2px",width:"30px",height:"30px",cursor:"nesw-resize",zIndex:"101"}),ar(ze(this,Ar),{height:"22px",width:"22px",backgroundRepeat:"no-repeat",backgroundImage:`url("data:image/svg+xml,${mse}") `});break}this.dom.append(ze(this,Ar))}setHandleVisibility(e){const t=e||!!ze(this,Ar).dataset.dragging;ze(this,Ar).style.opacity=t?"1":"0"}dataSetDragging(e){ze(this,Ar).dataset.dragging=e?"true":""}};Ar=new WeakMap;var Rf=50,vO=(e=>(e[e.Fixed=0]="Fixed",e[e.Flexible=1]="Flexible",e))(vO||{}),zs,Ls,Is,Bo,Ds,yse=class{constructor({node:e,view:t,getPos:r,aspectRatio:n=0,options:o,initialSize:i}){Xa(this,zs,void 0),Xa(this,Ls,void 0),Xa(this,Is,[]),Xa(this,Bo,void 0),Xa(this,Ds,void 0);const s=this.createWrapper(e,i),a=this.createElement({node:e,view:t,getPos:r,options:o}),c=(n===1?[0,1,2,3,4]:[0,1]).map(f=>new vse(f));for(const f of c){const p=h=>{this.startResizing(h,t,r,f)};f.dom.addEventListener("mousedown",p),ze(this,Is).push(()=>f.dom.removeEventListener("mousedown",p)),s.append(f.dom)}const u=()=>{c.forEach(f=>f.setHandleVisibility(!0))},d=()=>{c.forEach(f=>f.setHandleVisibility(!1))};s.addEventListener("mouseover",u),s.addEventListener("mouseout",d),ze(this,Is).push(()=>s.removeEventListener("mouseover",u),()=>s.removeEventListener("mouseout",d)),s.append(a),this.dom=s,Mi(this,Ls,e),Mi(this,zs,a),this.aspectRatio=n}createWrapper(e,t){const r=document.createElement("div");return r.classList.add("remirror-resizable-view"),r.style.position="relative",t?ar(r,{width:s4(t.width),aspectRatio:`${t.width} / ${t.height}`}):ar(r,{width:s4(e.attrs.width),aspectRatio:`${e.attrs.width} / ${e.attrs.height}`}),ar(r,{maxWidth:"100%",minWidth:`${Rf}px`,verticalAlign:"bottom",display:"inline-block",lineHeight:"0",transition:"width 0.15s ease-out, height 0.15s ease-out"}),r}startResizing(e,t,r,n){var o,i;e.preventDefault(),n.dataSetDragging(!0),ze(this,zs).style.pointerEvents="none";const s=e.pageX,a=e.pageY,l=((o=ze(this,zs))==null?void 0:o.getBoundingClientRect().width)||0,c=((i=ze(this,zs))==null?void 0:i.getBoundingClientRect().height)||0,u=S1(100,!1,f=>{const p=f.pageX,h=f.pageY,m=p-s,b=h-a;let v=null,g=null;if(this.aspectRatio===0&&l&&c)switch(n.type){case 0:case 3:v=l+m,g=c/l*v;break;case 1:case 4:v=l-m,g=c/l*v;break;case 2:g=c+b,v=l/c*g;break}else if(this.aspectRatio===1)switch(n.type){case 0:v=l+m;break;case 1:v=l-m;break;case 2:g=c+b;break;case 3:v=l+m,g=c+b;break;case 4:v=l-m,g=c+b;break}typeof v=="number"&&v{f.preventDefault(),n.dataSetDragging(!1),n.setHandleVisibility(!1),ze(this,zs).style.pointerEvents="auto",document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",d);const p=r(),h=t.state.tr.setNodeMarkup(p,void 0,{...ze(this,Ls).attrs,width:ze(this,Bo),height:ze(this,Ds)});t.dispatch(h)};document.addEventListener("mousemove",u),document.addEventListener("mouseup",d),ze(this,Is).push(()=>document.removeEventListener("mousemove",u)),ze(this,Is).push(()=>document.removeEventListener("mouseup",d))}update(e){return e.type!==ze(this,Ls).type||this.aspectRatio===0&&e.attrs.width&&e.attrs.width!==ze(this,Bo)||this.aspectRatio===1&&e.attrs.width&&e.attrs.height&&e.attrs.width!==ze(this,Bo)&&e.attrs.height!==ze(this,Ds)||!bse(ze(this,Ls),e,["width","height"])?!1:(Mi(this,Ls,e),Mi(this,Bo,e.attrs.width),Mi(this,Ds,e.attrs.height),!0)}destroy(){ze(this,Is).forEach(e=>e())}};zs=new WeakMap;Ls=new WeakMap;Is=new WeakMap;Bo=new WeakMap;Ds=new WeakMap;function bse(e,t,r){return e===t||xse(e,t,r)&&e.content.eq(t.content)}function xse(e,t,r){const n=e.attrs,o=t.attrs,i={};for(const a of r)i[a]=null;e.attrs={...n,...i},t.attrs={...o,...i};const s=e.sameMarkup(t);return e.attrs=n,t.attrs=o,s}function s4(e){return typeof e=="number"?`${e}px`:e||void 0}var yO={exports:{}},kse=Number.isNaN||function(e){return e!==e},wse=kse,xx=Number.isFinite||function(e){return!(typeof e!="number"||wse(e)||e===1/0||e===-1/0)},Sse=xx,Ese=Number.isInteger||function(e){return typeof e=="number"&&Sse(e)&&Math.floor(e)===e},Cse=xx,Mse=Ese,Tse=function(t,r){if(!Cse(t))throw new Error("Value must be a finite number");if(!Mse(r)||r<0)throw new Error("Precision must be a non-negative integer");return parseFloat(t.toFixed(r))},Ose=/^(-?\d?\.?\d+)e([\+\-]\d)+/,_se=function(t){var r=t.match(Ose);if(!r)throw new Error("Invalid exponential");return r.slice(1)},Ase=xx,Nse=_se,Rse=function(t){if(!Ase(t))throw new Error("Value must be a finite number");var r=Nse(t.toExponential()),n=r[0],o=parseInt(r[1],10),i=(n.split(".")[1]||"").length;return!i&&o>0?0:i+-1*o};(function(e,t){var r=Tse,n=Rse;e.exports=i;var o={down:"floor",up:"ceil"};function i(s,a,l){if(a=a||1,l){if(!o.hasOwnProperty(l))throw new Error("invalid direction");var c=o[l];return r(Math[c](s/a)*a,n(a))}var u=i(s,a,"down"),d=i(s,a,"up");return s-u{for(var o=n>1?void 0:n?Ise(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Lse(t,r,o),o},Dse={icon:"fontSize",description:({t:e})=>e(Al.SET_DESCRIPTION),label:({t:e})=>e(Al.SET_LABEL)},$se={icon:"addLine",description:({t:e})=>e(Al.INCREASE_DESCRIPTION),label:({t:e})=>e(Al.INCREASE_LABEL)},Hse={icon:"subtractLine",description:({t:e})=>e(Al.DECREASE_DESCRIPTION),label:({t:e})=>e(Al.DECREASE_LABEL)},m1="data-font-size-mark",co=class extends li{get name(){return"fontSize"}createTags(){return[oe.FormattingMark,oe.FontStyle]}createMarkSpec(e,t){return{...t,attrs:{...e.defaults(),size:{default:this.options.defaultSize}},parseDOM:[{tag:`span[${m1}]`,getAttrs:r=>{if(!Je(r))return null;let n=r.getAttribute(m1);return n?(n=`${bg(n,this.options.unit,r)}${this.options.unit}`,{...e.parse(r),size:n}):null}},{style:"font-size",priority:Ae.Low,getAttrs:r=>ne(r)?(r=this.getFontSize(r),{size:r}):null},...t.parseDOM??[]],toDOM:r=>{const{size:n,...o}=$d(r.attrs,e),i=e.dom(r);let s=i.style,a;return n&&(s=qv({fontSize:this.getFontSize(n)},s)),["span",{...o,...i,style:s,[m1]:a},0]}}}getFontSize(e){var t;const{unit:r,roundingMultiple:n,max:o,min:i,defaultSize:s}=this.options,a=bg(e,r,(t=this.store.view)==null?void 0:t.dom);return Number.isNaN(a)?s||"1rem":`${Ad({value:zse(a,n),max:o,min:i})}${r}`}setFontSize(e,t){return this.store.commands.applyMark.original(this.type,{size:String(e)},t==null?void 0:t.selection)}increaseFontSize(e){const{increment:t}=this.options;return r=>{const[n]=this.getFontSizeForSelection(e==null?void 0:e.selection);let[o]=n;return o+=_e(t)?t(n,1):t,this.setFontSize(o,e)(r)}}decreaseFontSize(e){const{increment:t}=this.options;return r=>{const[n]=this.getFontSizeForSelection(e==null?void 0:e.selection);let[o]=n;return o-=_e(t)?t(n,-1):t,this.setFontSize(o,e)(r)}}removeFontSize(e){return this.store.commands.removeMark.original({type:this.type,expand:!1,...e})}increaseFontSizeShortcut(e){return this.increaseFontSize()(e)}decreaseFontSizeShortcut(e){return this.decreaseFontSize()(e)}getFontSizeForSelection(e){const t=this.store.getState(),r=jr(e??t.selection,t.doc),[n,...o]=yz(r,this.type);if(n)return[$f(n.mark.attrs.size),...o.map(l=>$f(l.mark.attrs.size))];const{defaultSize:i,unit:s}=this.options;return[[bg(i,s),s]]}getFontSizeFromDom(e){const t=this.store.getState(),r=jr(e??t.selection,t.doc),n=this.store.view.domAtPos(r.from),o=Je(n.node)?n.node:this.store.view.dom;return $f(Pl(o))}};hi([U(Dse)],co.prototype,"setFontSize",1);hi([U($se)],co.prototype,"increaseFontSize",1);hi([U(Hse)],co.prototype,"decreaseFontSize",1);hi([U()],co.prototype,"removeFontSize",1);hi([je({shortcut:D.IncreaseFontSize,command:"increaseFontSize"})],co.prototype,"increaseFontSizeShortcut",1);hi([je({shortcut:D.IncreaseFontSize,command:"decreaseFontSize"})],co.prototype,"decreaseFontSizeShortcut",1);hi([He()],co.prototype,"getFontSizeForSelection",1);hi([He()],co.prototype,"getFontSizeFromDom",1);co=hi([pe({defaultOptions:{defaultSize:"",unit:"pt",increment:1,max:100,min:1,roundingMultiple:.5},staticKeys:["defaultSize"]})],co);var Bse=Object.defineProperty,Fse=Object.getOwnPropertyDescriptor,bO=(e,t,r,n)=>{for(var o=n>1?void 0:n?Fse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Bse(t,r,o),o},kh=class extends er{get name(){return"hardBreak"}createTags(){return[oe.InlineNode]}createNodeSpec(e,t){return{inline:!0,selectable:!1,atom:!0,leafText:()=>` -`,...t,attrs:e.defaults(),parseDOM:[{tag:"br",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["br",e.dom(r)]}}createKeymap(){const e=G6(bu(KC),()=>(this.store.commands.insertHardBreak(),!0));return{"Mod-Enter":e,"Shift-Enter":e}}insertHardBreak(){return e=>{const{tr:t,dispatch:r}=e;return r==null||r(t.replaceSelectionWith(this.type.create()).scrollIntoView()),!0}}};bO([U()],kh.prototype,"insertHardBreak",1);kh=bO([pe({defaultPriority:Ae.Low})],kh);var Vse=Object.defineProperty,jse=Object.getOwnPropertyDescriptor,xO=(e,t,r,n)=>{for(var o=n>1?void 0:n?jse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Vse(t,r,o),o},{LABEL:Use}=hR,Wse={icon:({attrs:e})=>`h${(e==null?void 0:e.level)??"1"}`,label:({t:e,attrs:t})=>e({...Use,values:{level:t==null?void 0:t.level}})},Kse=[D.H1,D.H2,D.H3,D.H4,D.H5,D.H6],wh=class extends er{get name(){return"heading"}createTags(){return[oe.Block,oe.TextBlock,oe.FormattingNode]}createNodeSpec(e,t){return{content:"inline*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),level:{default:this.options.defaultLevel}},parseDOM:[...this.options.levels.map(r=>({tag:`h${r}`,getAttrs:n=>({...e.parse(n),level:r})})),...t.parseDOM??[]],toDOM:r=>this.options.levels.includes(r.attrs.level)?[`h${r.attrs.level}`,e.dom(r),0]:[`h${this.options.defaultLevel}`,e.dom(r),0]}}toggleHeading(e={}){return Gv({type:this.type,toggleType:"paragraph",attrs:e})}createKeymap(e){const t=this.store.getExtension(xe),r=ee(),n=[];for(const o of this.options.levels){const i=Kse[o-1]??D.H1;r[i]=Fu(this.type,{level:o}),n.push({attrs:{level:o},shortcut:e(i)[0]})}return t.updateDecorated("toggleHeading",{shortcut:n}),r}createInputRules(){return this.options.levels.map(e=>UR(new RegExp(`^(#{1,${e}})\\s$`),this.type,()=>({level:e})))}createPasteRules(){return this.options.levels.map(e=>({type:"node",nodeType:this.type,regexp:new RegExp(`^#{${e}}\\s([\\s\\w]+)$`),getAttributes:()=>({level:e}),startOfTextBlock:!0}))}};xO([U(Wse)],wh.prototype,"toggleHeading",1);wh=xO([pe({defaultOptions:{levels:[1,2,3,4,5,6],defaultLevel:1},staticKeys:["defaultLevel","levels"]})],wh);var qse=Object.defineProperty,Gse=Object.getOwnPropertyDescriptor,kO=(e,t,r,n)=>{for(var o=n>1?void 0:n?Gse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&qse(t,r,o),o},Yse={icon:"separator",label:({t:e})=>e(vk.LABEL),description:({t:e})=>e(vk.DESCRIPTION)},Sh=class extends er{get name(){return"horizontalRule"}createTags(){return[oe.Block]}createNodeSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"hr",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["hr",e.dom(r)]}}insertHorizontalRule(){return e=>{const{tr:t,dispatch:r}=e,n=t.selection.$anchor,o=n.parent;return o.type.name==="doc"||o.isAtom||o.isLeaf?!1:(r&&(t.selection.empty&&Bh(o)&&t.insert(n.pos+1,o),t.replaceSelectionWith(this.type.create()),this.updateFromNodeSelection(t),r(t.scrollIntoView())),!0)}}createInputRules(){return[BC({regexp:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type,beforeDispatch:({tr:e})=>{this.updateFromNodeSelection(e)}})]}updateFromNodeSelection(e){if(!Dd(e.selection)||e.selection.node.type.name!==this.name)return;const t=e.selection.$from.pos+1,{insertionNode:r}=this.options;if(!r)return;const n=this.store.schema.nodes[r];te(n,{code:H.EXTENSION,message:`'${r}' node provided as the insertionNode to the '${this.constructorName}' does not exist.`});const o=n.create();e.insert(t,o),e.setSelection(le.near(e.doc.resolve(t+1)))}};kO([U(Yse)],Sh.prototype,"insertHorizontalRule",1);Sh=kO([pe({defaultOptions:{insertionNode:"paragraph"}})],Sh);var Jse=Object.defineProperty,Xse=Object.getOwnPropertyDescriptor,kx=(e,t,r,n)=>{for(var o=n>1?void 0:n?Xse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Jse(t,r,o),o},Qse=class extends yse{constructor(e,t,r){super({node:e,view:t,getPos:r,aspectRatio:vO.Fixed})}createElement({node:e}){const t=document.createElement("img");return t.setAttribute("src",e.attrs.src),ar(t,{width:"100%",minWidth:"50px",objectFit:"contain"}),t}},wd=class extends er{get name(){return"image"}createTags(){return[oe.InlineNode,oe.Media]}createNodeSpec(e,t){const{preferPastedTextContent:r}=this.options;return{inline:!0,draggable:!0,selectable:!1,...t,attrs:{...e.defaults(),alt:{default:""},crop:{default:null},height:{default:null},width:{default:null},rotate:{default:null},src:{default:null},title:{default:""},fileName:{default:null},resizable:{default:!1}},parseDOM:[{tag:"img[src]",getAttrs:n=>{var o;if(Je(n)){const i=eae({element:n,parse:e.parse});return r&&((o=i.src)!=null&&o.startsWith("file:///"))?!1:i}return{}}},...t.parseDOM??[]],toDOM:n=>{const o=$d(n.attrs,e);return["img",{...e.dom(n),...o}]}}}insertImage(e,t){return({tr:r,dispatch:n})=>{const{from:o,to:i}=jr(t??r.selection,r.doc),s=this.type.create(e);return n==null||n(r.replaceRangeWith(o,i,s)),!0}}uploadImage(e,t){const{updatePlaceholder:r,destroyPlaceholder:n,createPlaceholder:o}=this.options;return i=>{const{tr:s}=i;let a=s.selection.from;return this.store.createPlaceholderCommand({promise:e,placeholder:{type:"widget",get pos(){return a},createElement:(l,c)=>{const u=o(l,c);return t==null||t(u),u},onUpdate:(l,c,u,d)=>{r(l,c,u,d)},onDestroy:(l,c)=>{n(l,c)}},onSuccess:(l,c,u)=>this.insertImage(l,c)(u)}).validate(({tr:l,dispatch:c})=>{const u=EE(l.doc,a,this.type);return u==null?!1:(a=u,l.selection.empty||c==null||c(l.deleteSelection()),!0)},"unshift").generateCommand()(i)}}fileUploadFileHandler(e,t,r){var n;const{preferPastedTextContent:o,uploadHandler:i}=this.options;if(o&&nae(t)&&((n=t.clipboardData)!=null&&n.getData("text/plain")))return!1;const{commands:s,chain:a}=this.store,l=e.map((u,d)=>({file:u,progress:f=>{s.updatePlaceholder(c[d],f)}})),c=i(l);Jt(r)&&a.selectText(r);for(const u of c)a.uploadImage(u);return a.run(),!0}createPasteRules(){return[{type:"file",regexp:/image/i,fileHandler:e=>{const t=e.type==="drop"?e.pos:void 0;return this.fileUploadFileHandler(e.files,e.event,t)}}]}createNodeViews(){return this.options.enableResizing?(e,t,r)=>new Qse(e,t,r):{}}};kx([U()],wd.prototype,"insertImage",1);kx([U()],wd.prototype,"uploadImage",1);wd=kx([pe({defaultOptions:{createPlaceholder:tae,updatePlaceholder:()=>{},destroyPlaceholder:()=>{},uploadHandler:rae,enableResizing:!1,preferPastedTextContent:!0}})],wd);function Zse(e){let{width:t,height:r}=e.style;return t=t||e.getAttribute("width")||"",r=r||e.getAttribute("height")||"",{width:t,height:r}}function eae({element:e,parse:t}){const{width:r,height:n}=Zse(e);return{...t(e),alt:e.getAttribute("alt")??"",height:Number.parseInt(n||"0",10)||null,src:e.getAttribute("src")??null,title:e.getAttribute("title")??"",width:Number.parseInt(r||"0",10)||null,fileName:e.getAttribute("data-file-name")??null}}function tae(e,t){const r=document.createElement("div");return r.classList.add(cV.IMAGE_LOADER),r}function rae(e){te(e.length>0,{code:H.EXTENSION,message:"The upload handler was applied for the image extension without any valid files"});let t=0;const r=[];for(const{file:n,progress:o}of e)r.push(()=>new Promise(i=>{const s=new FileReader;s.addEventListener("load",a=>{var l;t+=1,o(t/e.length),i({src:(l=a.target)==null?void 0:l.result,fileName:n.name})},{once:!0}),s.readAsDataURL(n)}));return r}function nae(e){return e.clipboardData!==void 0}var oae=Object.defineProperty,iae=Object.getOwnPropertyDescriptor,wx=(e,t,r,n)=>{for(var o=n>1?void 0:n?iae(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&oae(t,r,o),o},sae={icon:"italic",label:({t:e})=>e(yk.LABEL),description:({t:e})=>e(yk.DESCRIPTION)},Sd=class extends li{get name(){return"italic"}createTags(){return[oe.FontStyle,oe.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"i",getAttrs:e.parse},{tag:"em",getAttrs:e.parse},{style:"font-style=italic"},...t.parseDOM??[]],toDOM:r=>["em",e.dom(r),0]}}createKeymap(){return{"Mod-i":ns({type:this.type})}}createInputRules(){return[Vu({regexp:/(?:^|[^*])\*([^*]+)\*$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:e,start:t})=>e.startsWith("*")?{}:{fullMatch:e.slice(1),start:t+1}}),Vu({regexp:/(?:^|\W)_([^_]+)_$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:e,start:t})=>e.startsWith("_")?{}:{fullMatch:e.slice(1),start:t+1}})]}createPasteRules(){return[{type:"mark",markType:this.type,regexp:/(?:^|\W)_([^_]+)_/g},{type:"mark",markType:this.type,regexp:/\*([^*]+)\*/g}]}toggleItalic(e){return ns({type:this.type,selection:e})}shortcut(e){return this.toggleItalic()(e)}};wx([U(sae)],Sd.prototype,"toggleItalic",1);wx([je({shortcut:D.Italic,command:"toggleItalic"})],Sd.prototype,"shortcut",1);Sd=wx([pe({})],Sd);var wO={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(typeof self<"u"?self:Pu,function(){return function(r){function n(i){if(o[i])return o[i].exports;var s=o[i]={i,l:!1,exports:{}};return r[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}var o={};return n.m=r,n.c=o,n.d=function(i,s,a){n.o(i,s)||Object.defineProperty(i,s,{configurable:!1,enumerable:!0,get:a})},n.n=function(i){var s=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(s,"a",s),s},n.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)},n.p="",n(n.s=0)}([function(r,n,o){function i(){throw new TypeError("The given URL is not a string. Please verify your string|array.")}function s(c){typeof c!="string"&&i();for(var u=0,d=0,f=0,p=c.length,h=0;p--&&++h&&!(u&&-1f?"":c.slice(f,u)}var a=["/",":","?","#"],l=[".","/","@"];r.exports=function(c){if(typeof c=="string")return s(c);if(Array.isArray(c)){var u=[],d,f=0;for(d=c.length;f{for(var o=n>1?void 0:n?uae(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&cae(t,r,o),o},dae=["com","de","net","org","uk","cn","ga","nl","cf","ml","tk","ru","br","gq","xyz","fr","eu","info","co","au","ca","it","in","ch","pl","es","online","us","top","be","jp","biz","se","at","dk","cz","za","me","ir","icu","shop","kr","site","mx","hu","io","cc","club","no","cyou"],a4="updateLink",fae=/(?:(?:(?:https?|ftp):)?\/\/)?(?:\S+(?::\S*)?@)?(?:(?:[\da-z\u00A1-\uFFFF][\w\u00A1-\uFFFF-]{0,62})?[\da-z\u00A1-\uFFFF]\.)*(?:(?:\d(?!\.)|[a-z\u00A1-\uFFFF])(?:[\da-z\u00A1-\uFFFF][\w\u00A1-\uFFFF-]{0,62})?[\da-z\u00A1-\uFFFF]\.)+[a-z\u00A1-\uFFFF]{2,}(?::\d{2,5})?(?:[#/?]\S*)?/gi,us=class extends li{constructor(){super(...arguments),this._autoLinkRegexNonGlobal=void 0}get name(){return"link"}createTags(){return[oe.Link,oe.ExcludeInputRules]}createMarkSpec(e,t){const r="data-link-auto",n=o=>{const{defaultTarget:i,supportedTargets:s}=this.options,a=i?[...s,i]:s;return o&&fr(a,o)?{target:o}:void 0};return{inclusive:!1,excludes:"_",...t,attrs:{...e.defaults(),href:{},target:{default:this.options.defaultTarget},auto:{default:!1}},parseDOM:[{tag:"a[href]",getAttrs:o=>{if(!Je(o))return!1;const i=o.getAttribute("href"),s=o.textContent,a=this.options.autoLink&&(o.hasAttribute(r)||i===s||(i==null?void 0:i.replace(`${this.options.defaultProtocol}//`,""))===s);return{...e.parse(o),href:i,auto:a,...n(o.getAttribute("target"))}}},...t.parseDOM??[]],toDOM:o=>{const{auto:i,target:s,...a}=$d(o.attrs,e),l=o.attrs.auto?{[r]:""}:{},c="noopener noreferrer nofollow";return["a",{...e.dom(o),...a,rel:c,...l,...n(o.attrs.target)},0]}}}onCreate(){const{autoLinkRegex:e}=this.options;this._autoLinkRegexNonGlobal=new RegExp(`^${e.source}$`,e.flags.replace("g",""))}shortcut({tr:e}){let t="",{from:r,to:n,empty:o,$from:i}=e.selection,s=!1;const a=_o(i,this.type);if(o){const l=a??_C(e);if(!l)return!1;({text:t,from:r,to:n}=l),s=!0}return r===n?!1:(s||(t=e.doc.textBetween(r,n)),this.options.onActivateLink(t),this.options.onShortcut({activeLink:a?{attrs:a.mark.attrs,from:a.from,to:a.to}:void 0,selectedText:t,from:r,to:n}),!0)}updateLink(e,t){return r=>{const{tr:n}=r;return!(gs(n.selection)&&!jv(n.selection)||hz(n.selection)||Rp({trState:n,type:this.type}))&&!t?!1:(n.setMeta(this.name,{command:a4,attrs:e,range:t}),Pz({type:this.type,attrs:e,range:t})(r))}}selectLink(){return this.store.commands.selectMark.original(this.type)}removeLink(e){return t=>{const{tr:r}=t;return Rp({trState:r,type:this.type,...e})?HC({type:this.type,expand:!0,range:e})(t):!1}}createPasteRules(){return[{type:"mark",regexp:this.options.autoLinkRegex,markType:this.type,getAttributes:(e,t)=>({href:this.buildHref(Zo(e)),auto:!t}),transformMatch:e=>{const t=Zo(e);return!t||!this.isValidUrl(t)?!1:t}}]}createEventHandlers(){return{clickMark:(e,t)=>{const r=t.getMark(this.type);if(!r)return;const n=r.mark.attrs,o={...n,...r};if(this.options.onClick(e,o))return!0;if(!this.store.view.editable)return;let i=!1;if(this.options.openLinkOnClick){i=!0;const s=n.href;window.open(s,"_blank")}return this.options.selectTextOnClick&&(i=!0,this.store.commands.selectText(r)),i}}}createPlugin(){return{appendTransaction:(e,t,r)=>{if(e.filter(p=>!!p.getMeta(this.name)).forEach(p=>{const h=p.getMeta(this.name);if(h.command===a4){const{range:m,attrs:b}=h,{selection:v,doc:g}=r,y={range:m,selection:v,doc:g,attrs:b},{from:x,to:k}=m??v;this.options.onUpdateLink(g.textBetween(x,k),y)}}),!this.options.autoLink||W0(t)-W0(r)===1||!e.some(p=>p.docChanged))return;const s=Z6(e,t),a=OC(s,[bt,Dt]),{mapping:l}=s,{tr:c,doc:u}=r,{updateLink:d,removeLink:f}=this.store.chain(c);if(a.forEach(({prevFrom:p,prevTo:h,from:m,to:b})=>{const v=[],g=b-m===2,y=this.getLinkMarksInRange(t.doc,p,h,!0).filter(x=>x.mark.type===this.type).map(({from:x,to:k,text:w})=>({mappedFrom:l.map(x),mappedTo:l.map(k),text:w,from:x,to:k}));y.forEach(({mappedFrom:x,mappedTo:k,from:w,to:E},T)=>this.getLinkMarksInRange(u,x,k,!0).filter(C=>C.mark.type===this.type).forEach(C=>{const M=t.doc.textBetween(w,E,void 0," "),N=u.textBetween(C.from,C.to+1,void 0," ").trim(),F=this.isValidUrl(M);this.isValidUrl(N)||(F&&(f({from:C.from,to:C.to}).tr(),y.splice(T,1)),!g&&m===b&&this.findAutoLinks(N).map(V=>this.addLinkProperties({...V,from:x+V.start,to:x+V.end})).forEach(({attrs:V,range:j,text:z})=>{d(V,j).tr(),v.push({attrs:V,range:j,text:z})}))})),this.findTextBlocksInRange(u,{from:m,to:b}).forEach(({text:x,positionStart:k})=>{this.findAutoLinks(x).map(w=>this.addLinkProperties({...w,from:k+w.start+1,to:k+w.end+1})).filter(({range:w})=>{const E=m>=w.from&&m<=w.to,T=b>=w.from&&b<=w.to;return E||T||g}).filter(({range:w})=>this.getLinkMarksInRange(c.doc,w.from,w.to,!1).length===0).filter(({range:{from:w},text:E})=>!y.some(({text:T,mappedFrom:C})=>C===w&&T===E)).forEach(({attrs:w,text:E,range:T})=>{d(w,T).tr(),v.push({attrs:w,range:T,text:E})})}),window.requestAnimationFrame(()=>{v.forEach(({attrs:x,range:k,text:w})=>{const{doc:E,selection:T}=c;this.options.onUpdateLink(w,{attrs:x,doc:E,range:k,selection:T})})})}),c.steps.length!==0)return c}}}buildHref(e){return this.options.extractHref({url:e,defaultProtocol:this.options.defaultProtocol})}getLinkMarksInRange(e,t,r,n){const o=[];if(t===r){const i=Math.max(t-1,0),s=e.resolve(i),a=_o(s,this.type);(a==null?void 0:a.mark.attrs.auto)===n&&o.push(a)}else e.nodesBetween(t,r,(i,s)=>{const l=(i.marks??[]).find(({type:c,attrs:u})=>c===this.type&&u.auto===n);l&&o.push({from:s,to:s+i.nodeSize,mark:l,text:i.textContent})});return o}findTextBlocksInRange(e,t){const r=[];return e.nodesBetween(t.from,t.to,(n,o)=>{!n.isTextblock||!n.type.allowsMarkType(this.type)||r.push({node:n,pos:o})}),r.map(n=>({text:e.textBetween(n.pos,n.pos+n.node.nodeSize,void 0," "),positionStart:n.pos}))}addLinkProperties({from:e,to:t,href:r,...n}){return{...n,range:{from:e,to:t},attrs:{href:r,auto:!0}}}findAutoLinks(e){if(this.options.findAutoLinks)return this.options.findAutoLinks(e,this.options.defaultProtocol);const t=[];for(const r of xa(e,this.options.autoLinkRegex)){const n=Zo(r);if(!n)continue;const o=this.buildHref(n);!this.isValidTLD(o)&&!o.startsWith("tel:")||t.push({text:n,href:o,start:r.index,end:r.index+n.length})}return t}isValidUrl(e){var t;return this.options.isValidUrl?this.options.isValidUrl(e,this.options.defaultProtocol):this.isValidTLD(this.buildHref(e))&&!!((t=this._autoLinkRegexNonGlobal)!=null&&t.test(e))}isValidTLD(e){const{autoLinkAllowedTLDs:t}=this.options;if(t.length===0)return!0;const r=lae(e);if(r==="")return!0;const n=Q4(r.split("."));return t.includes(n)}};Zd([je({shortcut:D.InsertLink})],us.prototype,"shortcut",1);Zd([U()],us.prototype,"updateLink",1);Zd([U()],us.prototype,"selectLink",1);Zd([U()],us.prototype,"removeLink",1);us=Zd([pe({defaultOptions:{autoLink:!1,defaultProtocol:"",selectTextOnClick:!1,openLinkOnClick:!1,autoLinkRegex:fae,autoLinkAllowedTLDs:dae,findAutoLinks:void 0,isValidUrl:void 0,defaultTarget:null,supportedTargets:[],extractHref:pae},staticKeys:["autoLinkRegex"],handlerKeyOptions:{onClick:{earlyReturnValue:!0}},handlerKeys:["onActivateLink","onShortcut","onUpdateLink","onClick"],defaultPriority:Ae.Medium})],us);function pae({url:e,defaultProtocol:t}){const r=/^((?:https?|ftp)?:)\/\//.test(e);return!r&&e.includes("@")?`mailto:${e}`:r?e:`${t}//${e}`}function hae(e){for(var t=1;t0&&e[t-1]===` -`;)t--;return e.substring(0,t)}var vae=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function Sx(e){return Ex(e,vae)}var SO=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function EO(e){return Ex(e,SO)}function yae(e){return MO(e,SO)}var CO=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function bae(e){return Ex(e,CO)}function xae(e){return MO(e,CO)}function Ex(e,t){return t.indexOf(e.nodeName)>=0}function MO(e,t){return e.getElementsByTagName&&t.some(function(r){return e.getElementsByTagName(r).length})}var hr={};hr.paragraph={filter:"p",replacement:function(e){return` + */var r=function(n){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,s={},a={manual:n.Prism&&n.Prism.manual,disableWorkerMessageHandler:n.Prism&&n.Prism.disableWorkerMessageHandler,util:{encode:function g(y){return y instanceof l?new l(y.type,g(y.content),y.alias):Array.isArray(y)?y.map(g):y.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(k){var g=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(k.stack)||[])[1];if(g){var y=document.getElementsByTagName("script");for(var x in y)if(y[x].src==g)return y[x]}return null}},isActive:function(g,y,x){for(var k="no-"+y;g;){var w=g.classList;if(w.contains(y))return!0;if(w.contains(k))return!1;g=g.parentElement}return!!x}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(g,y){var x=a.util.clone(a.languages[g]);for(var k in y)x[k]=y[k];return x},insertBefore:function(g,y,x,k){k=k||a.languages;var w=k[g],E={};for(var M in w)if(w.hasOwnProperty(M)){if(M==y)for(var C in x)x.hasOwnProperty(C)&&(E[C]=x[C]);x.hasOwnProperty(M)||(E[M]=w[M])}var T=k[g];return k[g]=E,a.languages.DFS(a.languages,function(N,z){z===T&&N!=g&&(this[N]=E)}),E},DFS:function g(y,x,k,w){w=w||{};var E=a.util.objId;for(var M in y)if(y.hasOwnProperty(M)){x.call(y,M,y[M],k||M);var C=y[M],T=a.util.type(C);T==="Object"&&!w[E(C)]?(w[E(C)]=!0,g(C,x,null,w)):T==="Array"&&!w[E(C)]&&(w[E(C)]=!0,g(C,x,M,w))}}},plugins:{},highlightAll:function(g,y){a.highlightAllUnder(document,g,y)},highlightAllUnder:function(g,y,x){var k={callback:x,container:g,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",k),k.elements=Array.prototype.slice.apply(k.container.querySelectorAll(k.selector)),a.hooks.run("before-all-elements-highlight",k);for(var w=0,E;E=k.elements[w++];)a.highlightElement(E,y===!0,k.callback)},highlightElement:function(g,y,x){var k=a.util.getLanguage(g),w=a.languages[k];a.util.setLanguage(g,k);var E=g.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(E,k);var M=g.textContent,C={element:g,language:k,grammar:w,code:M};function T(z){C.highlightedCode=z,a.hooks.run("before-insert",C),C.element.innerHTML=C.highlightedCode,a.hooks.run("after-highlight",C),a.hooks.run("complete",C),x&&x.call(C.element)}if(a.hooks.run("before-sanity-check",C),E=C.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!C.code){a.hooks.run("complete",C),x&&x.call(C.element);return}if(a.hooks.run("before-highlight",C),!C.grammar){T(a.util.encode(C.code));return}if(y&&n.Worker){var N=new Worker(a.filename);N.onmessage=function(z){T(z.data)},N.postMessage(JSON.stringify({language:C.language,code:C.code,immediateClose:!0}))}else T(a.highlight(C.code,C.grammar,C.language))},highlight:function(g,y,x){var k={code:g,grammar:y,language:x};if(a.hooks.run("before-tokenize",k),!k.grammar)throw new Error('The language "'+k.language+'" has no grammar.');return k.tokens=a.tokenize(k.code,k.grammar),a.hooks.run("after-tokenize",k),l.stringify(a.util.encode(k.tokens),k.language)},tokenize:function(g,y){var x=y.rest;if(x){for(var k in x)y[k]=x[k];delete y.rest}var w=new d;return f(w,w.head,g),u(g,w,y,w.head,0),h(w)},hooks:{all:{},add:function(g,y){var x=a.hooks.all;x[g]=x[g]||[],x[g].push(y)},run:function(g,y){var x=a.hooks.all[g];if(!(!x||!x.length))for(var k=0,w;w=x[k++];)w(y)}},Token:l};n.Prism=a;function l(g,y,x,k){this.type=g,this.content=y,this.alias=x,this.length=(k||"").length|0}l.stringify=function g(y,x){if(typeof y=="string")return y;if(Array.isArray(y)){var k="";return y.forEach(function(T){k+=g(T,x)}),k}var w={type:y.type,content:g(y.content,x),tag:"span",classes:["token",y.type],attributes:{},language:x},E=y.alias;E&&(Array.isArray(E)?Array.prototype.push.apply(w.classes,E):w.classes.push(E)),a.hooks.run("wrap",w);var M="";for(var C in w.attributes)M+=" "+C+'="'+(w.attributes[C]||"").replace(/"/g,""")+'"';return"<"+w.tag+' class="'+w.classes.join(" ")+'"'+M+">"+w.content+""};function c(g,y,x,k){g.lastIndex=y;var w=g.exec(x);if(w&&k&&w[1]){var E=w[1].length;w.index+=E,w[0]=w[0].slice(E)}return w}function u(g,y,x,k,w,E){for(var M in x)if(!(!x.hasOwnProperty(M)||!x[M])){var C=x[M];C=Array.isArray(C)?C:[C];for(var T=0;T=E.reach);P+=A.value.length,A=A.next){var F=A.value;if(y.length>g.length)return;if(!(F instanceof l)){var Y=1,J;if(V){if(J=c(q,P,g,D),!J||J.index>=g.length)break;var de=J.index,Ne=J.index+J[0].length,ie=P;for(ie+=A.value.length;de>=ie;)A=A.next,ie+=A.value.length;if(ie-=A.value.length,P=ie,A.value instanceof l)continue;for(var ue=A;ue!==y.tail&&(ieE.reach&&(E.reach=ft);var rt=A.prev;Me&&(rt=f(y,rt,Me),P+=Me.length),p(y,rt,Y);var Or=new l(M,z?a.tokenize(me,z):me,j,me);if(A=f(y,rt,Or),Se&&f(y,A,Se),Y>1){var he={cause:M+","+T,reach:ft};u(g,y,x,A.prev,P,he),E&&he.reach>E.reach&&(E.reach=he.reach)}}}}}}function d(){var g={value:null,prev:null,next:null},y={value:null,prev:g,next:null};g.next=y,this.head=g,this.tail=y,this.length=0}function f(g,y,x){var k=y.next,w={value:x,prev:y,next:k};return y.next=w,k.prev=w,g.length++,w}function p(g,y,x){for(var k=y.next,w=0;w/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(r,n){var o={};o["language-"+n]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[n]},o.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:o}};i["language-"+n]={pattern:/[\s\S]+/,inside:e.languages[n]};var s={};s[r]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return r}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",s)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,r){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[r,"language-"+r],inside:e.languages[r]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}var Iie=gx;gx.displayName="css";gx.aliases=[];function gx(e){(function(t){var r=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+r.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+r.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+r.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:r,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var n=t.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))})(e)}var Die=vx;vx.displayName="clike";vx.aliases=[];function vx(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}var $ie=yx;yx.displayName="javascript";yx.aliases=["js"];function yx(e){e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}var fu=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof Pu=="object"?Pu:{},Hie=tse();fu.Prism={manual:!0,disableWorkerMessageHandler:!0};var Bie=tne,Fie=vie,fO=zie,Vie=Lie,jie=Iie,Uie=Die,Wie=$ie;Hie();var bx={}.hasOwnProperty;function pO(){}pO.prototype=fO;var Et=new pO,Kie=Et;Et.highlight=Gie;Et.register=Qd;Et.alias=qie;Et.registered=Yie;Et.listLanguages=Jie;Qd(Vie);Qd(jie);Qd(Uie);Qd(Wie);Et.util.encode=Zie;Et.Token.stringify=Xie;function Qd(e){if(typeof e!="function"||!e.displayName)throw new Error("Expected `function` for `grammar`, got `"+e+"`");Et.languages[e.displayName]===void 0&&e(Et)}function qie(e,t){var r=Et.languages,n=e,o,i,s,a;t&&(n={},n[e]=t);for(o in n)for(i=n[o],i=typeof i=="string"?[i]:i,s=i.length,a=-1;++a{for(var o=n>1?void 0:n?nse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&rse(t,r,o),o},hO=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},ki=(e,t,r)=>(hO(e,t,"read from private field"),r?r.call(e):t.get(e)),h1=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},m1=(e,t,r,n)=>(hO(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),mO="data-code-block-language";function gO(e,t,r=[]){return e.map(n=>{const o=[...r];return n.type==="element"&&n.properties.className?o.push(...n.properties.className):n.type==="text"&&o.length===0&&t&&o.push(t),n.type==="element"?gO(n.children,t,o):{text:n.value,classes:o}})}function ose(e,t){var r;const{node:n,pos:o}=e,i=kh({language:(r=n.attrs.language)==null?void 0:r.replace("language-",""),fallback:"markup"}),s=xx.highlight(n.textContent??"",i),a=gO(s,t);let l=o+1;function c(u){const d=l,f=d+u.text.length;return l=f,{...u,from:d,to:f}}return J4(a).map(c)}function s4(e){const{blocks:t,skipLast:r,plainTextClassName:n}=e,o=[];for(const i of t){const s=ose(i,n),a=r?s.length-1:s.length;for(const l of Cv(a)){const c=s[l],u=c==null?void 0:c.classes;if(!c||!(u!=null&&u.length))continue;const d=Ge.inline(c.from,c.to,{class:u.join(" ")});o.push(d)}}return o}function ise(e){return!!(e&&Zt(e)&&oe(e.language)&&e.language.length>0)}function sse(e){return t=>({state:{tr:r,selection:n},dispatch:o})=>{if(!ise(t))throw new Error("Invalid attrs passed to the updateAttributes method");const i=rs({types:e,selection:n});return!i||Y4(t,i.node.attrs)?!1:(r.setNodeMarkup(i.pos,e,{...i.node.attrs,...t}),o&&o(r),!0)}}function kh(e){const{language:t,fallback:r}=e;if(!t)return r;const n=xx.listLanguages();for(const o of n)if(o.toLowerCase()===t.toLowerCase())return o;return r}function ase(e,t){const{language:r,wrap:n}=$d(e.attrs,t),{style:o,...i}=t.dom(e);let s=i.style;return n&&(s=Gv({whiteSpace:"pre-wrap",wordBreak:"break-all"},s)),["pre",{spellcheck:"false",...i,class:ju(i.class,`language-${r}`)},["code",{[mO]:r,style:s},0]]}function lse(e){return({pos:t}=ee())=>({tr:r,dispatch:n})=>{const{type:o,formatter:i,defaultLanguage:s}=e,{from:a,to:l}=t?{from:t,to:t}:r.selection,c=rs({types:o,selection:r.selection});if(!c)return!1;const{node:{attrs:u,textContent:d},start:f}=c,p=a-f,h=l-f,m=kh({language:u.language,fallback:s}),b=i({source:d,language:m,cursorOffset:p});let v;if(p!==h&&(v=i({source:d,language:m,cursorOffset:h})),!b)return!1;const{cursorOffset:g,formatted:y}=b;if(y===d)return!1;const x=f+d.length;r.insertText(y,f,x);const k=f+g,w=v?f+v.cursorOffset:void 0;return r.setSelection(le.between(r.doc.resolve(k),r.doc.resolve(w??k))),n&&n(r),!0}}function cse(e){var t;return(t=e.getAttribute(mO)??e.classList[0])==null?void 0:t.replace("language-","")}var{DESCRIPTION:use,LABEL:dse}=oR,fse={icon:"bracesLine",description:({t:e})=>e(use),label:({t:e})=>e(dse)},Rs,pu,hu,pse=class{constructor(e,t){h1(this,Rs,void 0),h1(this,pu,void 0),h1(this,hu,!1),m1(this,pu,e),m1(this,Rs,t)}init(e){const t=jz({node:e.doc,type:ki(this,pu)});return this.refreshDecorationSet(e.doc,t),this}refreshDecorationSet(e,t){const r=s4({blocks:t,skipLast:ki(this,hu),defaultLanguage:ki(this,Rs).options.defaultLanguage,plainTextClassName:ki(this,Rs).options.plainTextClassName??void 0});this.decorationSet=Ee.create(e,r)}apply(e,t){if(!e.docChanged)return this;this.decorationSet=this.decorationSet.map(e.mapping,e.doc);const r=Uz(e,{descend:!0,predicate:n=>n.type===ki(this,pu),StepTypes:[]});return this.updateDecorationSet(e,r),this}updateDecorationSet(e,t){if(t.length===0)return;let r=this.decorationSet;for(const{node:n,pos:o}of t)r=this.decorationSet.remove(this.decorationSet.find(o,o+n.nodeSize));this.decorationSet=r.add(e.doc,s4({blocks:t,skipLast:ki(this,hu),defaultLanguage:ki(this,Rs).options.defaultLanguage,plainTextClassName:ki(this,Rs).options.plainTextClassName??void 0}))}setDeleted(e){m1(this,hu,e)}};Rs=new WeakMap;pu=new WeakMap;hu=new WeakMap;var lo=class extends er{get name(){return"codeBlock"}createTags(){return[te.Block,te.Code]}init(){this.registerLanguages()}createNodeSpec(e,t){const r=/highlight-(?:text|source)-([\da-z]+)/;return{content:"text*",marks:"",defining:!0,draggable:!1,...t,code:!0,attrs:{...e.defaults(),language:{default:this.options.defaultLanguage},wrap:{default:this.options.defaultWrap}},parseDOM:[{tag:"div.highlight",preserveWhitespace:"full",getAttrs:n=>{var o,i;if(!et(n))return!1;const s=n.querySelector("pre.code");if(!et(s))return!1;const a=kn(s,"white-space")==="pre-wrap",l=(i=(o=n.className.match(r))==null?void 0:o[1])==null?void 0:i.replace("language-","");return{...e.parse(n),language:l,wrap:a}}},{tag:"pre",preserveWhitespace:"full",getAttrs:n=>{if(!et(n))return!1;const o=n.querySelector("code");if(!et(o))return!1;const i=kn(o,"white-space")==="pre-wrap",s=this.options.getLanguageFromDom(o,n);return{...e.parse(n),language:s,wrap:i}}},...t.parseDOM??[]],toDOM:n=>ase(n,e)}}createAttributes(){return{class:lV[this.options.syntaxTheme.toUpperCase()]}}createInputRules(){const e=/^```([\dA-Za-z]*) $/,t=r=>({language:kh({language:Zo(r,1),fallback:this.options.defaultLanguage})});return[FC({regexp:e,type:this.type,beforeDispatch:({tr:r,start:n})=>{const o=r.doc.resolve(n);r.setSelection(le.near(o))},getAttributes:t})]}onSetOptions(e){const{changes:t}=e;t.supportedLanguages.changed&&this.registerLanguages(),t.syntaxTheme.changed&&this.store.updateAttributes()}createPlugin(){const e=new pse(this.type,this),t=()=>(e.setDeleted(!0),!1);return{state:{init(r,n){return e.init(n)},apply(r,n,o,i){return e.apply(r,i)}},props:{handleKeyDown:Xv({Backspace:t,"Mod-Backspace":t,Delete:t,"Mod-Delete":t,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t}),decorations(){return e.setDeleted(!1),e.decorationSet}}}}toggleCodeBlock(e={}){return Yv({type:this.type,toggleType:this.options.toggleName,attrs:{language:this.options.defaultLanguage,...e}})}createCodeBlock(e){return Fu(this.type,e)}updateCodeBlock(e){return sse(this.type)(e)}formatCodeBlock(e){return lse({type:this.type,formatter:this.options.formatter,defaultLanguage:this.options.defaultLanguage})(e)}tabKey({state:e,dispatch:t}){const{selection:r,tr:n,schema:o}=e,{node:i}=oz(r);if(!Hh({node:i,types:this.type}))return!1;if(r.empty)n.insertText(" ");else{const{from:s,to:a}=r;n.replaceWith(s,a,o.text(" "))}return t&&t(n),!0}backspaceKey({dispatch:e,tr:t,state:r}){if(!t.selection.empty)return!1;const n=rs({types:this.type,selection:t.selection});if((n==null?void 0:n.start)!==t.selection.from)return!1;const{pos:o,node:i,start:s}=n,a=it(r.schema.nodes,this.options.toggleName);return i.textContent.trim()===""?t.doc.lastChild===i&&t.doc.firstChild===i?rz({pos:o,tr:t,content:a.create()}):tz({pos:o,tr:t}):s>2?t.setSelection(le.near(t.doc.resolve(s-2))):(t.insert(0,a.create()),t.setSelection(le.near(t.doc.resolve(1)))),e&&e(t),!0}enterKey({dispatch:e,tr:t}){if(!(ms(t.selection)&&t.selection.empty))return!1;const{nodeBefore:r,parent:n}=t.selection.$anchor;if(!(r!=null&&r.isText)||!n.type.isTextblock)return!1;const o=/^```([A-Za-z]*)?$/,{text:i,nodeSize:s}=r,{textContent:a}=n;if(!i)return!1;const l=i.match(o),c=a.match(o);if(!l||!c)return!1;const[,u]=l,d=kh({language:u,fallback:this.options.defaultLanguage}),f=t.selection.$from.before(),p=f+s+1;return t.replaceWith(f,p,this.type.create({language:d})),t.setSelection(le.near(t.doc.resolve(f+1))),e&&e(t),!0}formatShortcut({tr:e}){const t=this.store.commands;if(!EC({type:this.type,state:e}))return!1;const r=t.formatCodeBlock.isEnabled();return r&&t.formatCodeBlock(),r}registerLanguages(){for(const e of this.options.supportedLanguages)xx.register(e)}};hi([U(fse)],lo.prototype,"toggleCodeBlock",1);hi([U()],lo.prototype,"createCodeBlock",1);hi([U()],lo.prototype,"updateCodeBlock",1);hi([U()],lo.prototype,"formatCodeBlock",1);hi([je({shortcut:"Tab"})],lo.prototype,"tabKey",1);hi([je({shortcut:"Backspace"})],lo.prototype,"backspaceKey",1);hi([je({shortcut:"Enter"})],lo.prototype,"enterKey",1);hi([je({shortcut:$.Format})],lo.prototype,"formatShortcut",1);lo=hi([pe({defaultOptions:{supportedLanguages:[],toggleName:"paragraph",formatter:({source:e})=>({cursorOffset:0,formatted:e}),syntaxTheme:"a11y_dark",defaultLanguage:"markup",defaultWrap:!1,plainTextClassName:"",getLanguageFromDom:cse},staticKeys:["getLanguageFromDom"]})],lo);var vO=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},ze=(e,t,r)=>(vO(e,t,"read from private field"),r?r.call(e):t.get(e)),Xa=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Ti=(e,t,r,n)=>(vO(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),hse='',mse='',gse=encodeURIComponent(hse),vse=encodeURIComponent(mse),Ar,yse=class{constructor(e){Xa(this,Ar,void 0);const t=document.createElement("div"),r=document.createElement("div");this.dom=t,Ti(this,Ar,r),this.type=e,this.createHandle(e)}createHandle(e){switch(ar(this.dom,{position:"absolute",pointerEvents:"auto",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"100"}),ar(ze(this,Ar),{opacity:"0",transition:"opacity 300ms ease-in 0s"}),ze(this,Ar).dataset.dragging="",e){case 0:ar(this.dom,{right:"0px",top:"0px",height:"100%",width:"15px",cursor:"col-resize"}),ar(ze(this,Ar),{width:" 4px",height:"36px",maxHeight:"50%",boxSizing:"content-box",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 1:ar(this.dom,{left:"0px",top:"0px",height:"100%",width:"15px",cursor:"col-resize"}),ar(ze(this,Ar),{width:" 4px",height:"36px",maxHeight:"50%",boxSizing:"content-box",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 2:ar(this.dom,{bottom:"0px",width:"100%",height:"14px",cursor:"row-resize"}),ar(ze(this,Ar),{width:" 42px",height:"4px",boxSizing:"content-box",maxWidth:"50%",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 3:ar(this.dom,{right:"-1px",bottom:"-2px",width:"30px",height:"30px",cursor:"nwse-resize",zIndex:"101"}),ar(ze(this,Ar),{height:"22px",width:"22px",backgroundRepeat:"no-repeat",backgroundImage:`url("data:image/svg+xml,${vse}") `});break;case 4:ar(this.dom,{left:"-1px",bottom:"-2px",width:"30px",height:"30px",cursor:"nesw-resize",zIndex:"101"}),ar(ze(this,Ar),{height:"22px",width:"22px",backgroundRepeat:"no-repeat",backgroundImage:`url("data:image/svg+xml,${gse}") `});break}this.dom.append(ze(this,Ar))}setHandleVisibility(e){const t=e||!!ze(this,Ar).dataset.dragging;ze(this,Ar).style.opacity=t?"1":"0"}dataSetDragging(e){ze(this,Ar).dataset.dragging=e?"true":""}};Ar=new WeakMap;var Rf=50,yO=(e=>(e[e.Fixed=0]="Fixed",e[e.Flexible=1]="Flexible",e))(yO||{}),Ps,zs,Ls,Bo,Is,bse=class{constructor({node:e,view:t,getPos:r,aspectRatio:n=0,options:o,initialSize:i}){Xa(this,Ps,void 0),Xa(this,zs,void 0),Xa(this,Ls,[]),Xa(this,Bo,void 0),Xa(this,Is,void 0);const s=this.createWrapper(e,i),a=this.createElement({node:e,view:t,getPos:r,options:o}),c=(n===1?[0,1,2,3,4]:[0,1]).map(f=>new yse(f));for(const f of c){const p=h=>{this.startResizing(h,t,r,f)};f.dom.addEventListener("mousedown",p),ze(this,Ls).push(()=>f.dom.removeEventListener("mousedown",p)),s.append(f.dom)}const u=()=>{c.forEach(f=>f.setHandleVisibility(!0))},d=()=>{c.forEach(f=>f.setHandleVisibility(!1))};s.addEventListener("mouseover",u),s.addEventListener("mouseout",d),ze(this,Ls).push(()=>s.removeEventListener("mouseover",u),()=>s.removeEventListener("mouseout",d)),s.append(a),this.dom=s,Ti(this,zs,e),Ti(this,Ps,a),this.aspectRatio=n}createWrapper(e,t){const r=document.createElement("div");return r.classList.add("remirror-resizable-view"),r.style.position="relative",t?ar(r,{width:a4(t.width),aspectRatio:`${t.width} / ${t.height}`}):ar(r,{width:a4(e.attrs.width),aspectRatio:`${e.attrs.width} / ${e.attrs.height}`}),ar(r,{maxWidth:"100%",minWidth:`${Rf}px`,verticalAlign:"bottom",display:"inline-block",lineHeight:"0",transition:"width 0.15s ease-out, height 0.15s ease-out"}),r}startResizing(e,t,r,n){var o,i;e.preventDefault(),n.dataSetDragging(!0),ze(this,Ps).style.pointerEvents="none";const s=e.pageX,a=e.pageY,l=((o=ze(this,Ps))==null?void 0:o.getBoundingClientRect().width)||0,c=((i=ze(this,Ps))==null?void 0:i.getBoundingClientRect().height)||0,u=E1(100,!1,f=>{const p=f.pageX,h=f.pageY,m=p-s,b=h-a;let v=null,g=null;if(this.aspectRatio===0&&l&&c)switch(n.type){case 0:case 3:v=l+m,g=c/l*v;break;case 1:case 4:v=l-m,g=c/l*v;break;case 2:g=c+b,v=l/c*g;break}else if(this.aspectRatio===1)switch(n.type){case 0:v=l+m;break;case 1:v=l-m;break;case 2:g=c+b;break;case 3:v=l+m,g=c+b;break;case 4:v=l-m,g=c+b;break}typeof v=="number"&&v{f.preventDefault(),n.dataSetDragging(!1),n.setHandleVisibility(!1),ze(this,Ps).style.pointerEvents="auto",document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",d);const p=r(),h=t.state.tr.setNodeMarkup(p,void 0,{...ze(this,zs).attrs,width:ze(this,Bo),height:ze(this,Is)});t.dispatch(h)};document.addEventListener("mousemove",u),document.addEventListener("mouseup",d),ze(this,Ls).push(()=>document.removeEventListener("mousemove",u)),ze(this,Ls).push(()=>document.removeEventListener("mouseup",d))}update(e){return e.type!==ze(this,zs).type||this.aspectRatio===0&&e.attrs.width&&e.attrs.width!==ze(this,Bo)||this.aspectRatio===1&&e.attrs.width&&e.attrs.height&&e.attrs.width!==ze(this,Bo)&&e.attrs.height!==ze(this,Is)||!xse(ze(this,zs),e,["width","height"])?!1:(Ti(this,zs,e),Ti(this,Bo,e.attrs.width),Ti(this,Is,e.attrs.height),!0)}destroy(){ze(this,Ls).forEach(e=>e())}};Ps=new WeakMap;zs=new WeakMap;Ls=new WeakMap;Bo=new WeakMap;Is=new WeakMap;function xse(e,t,r){return e===t||kse(e,t,r)&&e.content.eq(t.content)}function kse(e,t,r){const n=e.attrs,o=t.attrs,i={};for(const a of r)i[a]=null;e.attrs={...n,...i},t.attrs={...o,...i};const s=e.sameMarkup(t);return e.attrs=n,t.attrs=o,s}function a4(e){return typeof e=="number"?`${e}px`:e||void 0}var bO={exports:{}},wse=Number.isNaN||function(e){return e!==e},Sse=wse,kx=Number.isFinite||function(e){return!(typeof e!="number"||Sse(e)||e===1/0||e===-1/0)},Ese=kx,Cse=Number.isInteger||function(e){return typeof e=="number"&&Ese(e)&&Math.floor(e)===e},Mse=kx,Tse=Cse,Ose=function(t,r){if(!Mse(t))throw new Error("Value must be a finite number");if(!Tse(r)||r<0)throw new Error("Precision must be a non-negative integer");return parseFloat(t.toFixed(r))},_se=/^(-?\d?\.?\d+)e([\+\-]\d)+/,Ase=function(t){var r=t.match(_se);if(!r)throw new Error("Invalid exponential");return r.slice(1)},Nse=kx,Rse=Ase,Pse=function(t){if(!Nse(t))throw new Error("Value must be a finite number");var r=Rse(t.toExponential()),n=r[0],o=parseInt(r[1],10),i=(n.split(".")[1]||"").length;return!i&&o>0?0:i+-1*o};(function(e,t){var r=Ose,n=Pse;e.exports=i;var o={down:"floor",up:"ceil"};function i(s,a,l){if(a=a||1,l){if(!o.hasOwnProperty(l))throw new Error("invalid direction");var c=o[l];return r(Math[c](s/a)*a,n(a))}var u=i(s,a,"down"),d=i(s,a,"up");return s-u{for(var o=n>1?void 0:n?Dse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ise(t,r,o),o},$se={icon:"fontSize",description:({t:e})=>e(Al.SET_DESCRIPTION),label:({t:e})=>e(Al.SET_LABEL)},Hse={icon:"addLine",description:({t:e})=>e(Al.INCREASE_DESCRIPTION),label:({t:e})=>e(Al.INCREASE_LABEL)},Bse={icon:"subtractLine",description:({t:e})=>e(Al.DECREASE_DESCRIPTION),label:({t:e})=>e(Al.DECREASE_LABEL)},g1="data-font-size-mark",co=class extends ci{get name(){return"fontSize"}createTags(){return[te.FormattingMark,te.FontStyle]}createMarkSpec(e,t){return{...t,attrs:{...e.defaults(),size:{default:this.options.defaultSize}},parseDOM:[{tag:`span[${g1}]`,getAttrs:r=>{if(!et(r))return null;let n=r.getAttribute(g1);return n?(n=`${xg(n,this.options.unit,r)}${this.options.unit}`,{...e.parse(r),size:n}):null}},{style:"font-size",priority:Ae.Low,getAttrs:r=>oe(r)?(r=this.getFontSize(r),{size:r}):null},...t.parseDOM??[]],toDOM:r=>{const{size:n,...o}=$d(r.attrs,e),i=e.dom(r);let s=i.style,a;return n&&(s=Gv({fontSize:this.getFontSize(n)},s)),["span",{...o,...i,style:s,[g1]:a},0]}}}getFontSize(e){var t;const{unit:r,roundingMultiple:n,max:o,min:i,defaultSize:s}=this.options,a=xg(e,r,(t=this.store.view)==null?void 0:t.dom);return Number.isNaN(a)?s||"1rem":`${Ad({value:Lse(a,n),max:o,min:i})}${r}`}setFontSize(e,t){return this.store.commands.applyMark.original(this.type,{size:String(e)},t==null?void 0:t.selection)}increaseFontSize(e){const{increment:t}=this.options;return r=>{const[n]=this.getFontSizeForSelection(e==null?void 0:e.selection);let[o]=n;return o+=_e(t)?t(n,1):t,this.setFontSize(o,e)(r)}}decreaseFontSize(e){const{increment:t}=this.options;return r=>{const[n]=this.getFontSizeForSelection(e==null?void 0:e.selection);let[o]=n;return o-=_e(t)?t(n,-1):t,this.setFontSize(o,e)(r)}}removeFontSize(e){return this.store.commands.removeMark.original({type:this.type,expand:!1,...e})}increaseFontSizeShortcut(e){return this.increaseFontSize()(e)}decreaseFontSizeShortcut(e){return this.decreaseFontSize()(e)}getFontSizeForSelection(e){const t=this.store.getState(),r=jr(e??t.selection,t.doc),[n,...o]=bz(r,this.type);if(n)return[$f(n.mark.attrs.size),...o.map(l=>$f(l.mark.attrs.size))];const{defaultSize:i,unit:s}=this.options;return[[xg(i,s),s]]}getFontSizeFromDom(e){const t=this.store.getState(),r=jr(e??t.selection,t.doc),n=this.store.view.domAtPos(r.from),o=et(n.node)?n.node:this.store.view.dom;return $f(Pl(o))}};mi([U($se)],co.prototype,"setFontSize",1);mi([U(Hse)],co.prototype,"increaseFontSize",1);mi([U(Bse)],co.prototype,"decreaseFontSize",1);mi([U()],co.prototype,"removeFontSize",1);mi([je({shortcut:$.IncreaseFontSize,command:"increaseFontSize"})],co.prototype,"increaseFontSizeShortcut",1);mi([je({shortcut:$.IncreaseFontSize,command:"decreaseFontSize"})],co.prototype,"decreaseFontSizeShortcut",1);mi([He()],co.prototype,"getFontSizeForSelection",1);mi([He()],co.prototype,"getFontSizeFromDom",1);co=mi([pe({defaultOptions:{defaultSize:"",unit:"pt",increment:1,max:100,min:1,roundingMultiple:.5},staticKeys:["defaultSize"]})],co);var Fse=Object.defineProperty,Vse=Object.getOwnPropertyDescriptor,xO=(e,t,r,n)=>{for(var o=n>1?void 0:n?Vse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Fse(t,r,o),o},wh=class extends er{get name(){return"hardBreak"}createTags(){return[te.InlineNode]}createNodeSpec(e,t){return{inline:!0,selectable:!1,atom:!0,leafText:()=>` +`,...t,attrs:e.defaults(),parseDOM:[{tag:"br",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["br",e.dom(r)]}}createKeymap(){const e=Y6(bu(qC),()=>(this.store.commands.insertHardBreak(),!0));return{"Mod-Enter":e,"Shift-Enter":e}}insertHardBreak(){return e=>{const{tr:t,dispatch:r}=e;return r==null||r(t.replaceSelectionWith(this.type.create()).scrollIntoView()),!0}}};xO([U()],wh.prototype,"insertHardBreak",1);wh=xO([pe({defaultPriority:Ae.Low})],wh);var jse=Object.defineProperty,Use=Object.getOwnPropertyDescriptor,kO=(e,t,r,n)=>{for(var o=n>1?void 0:n?Use(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&jse(t,r,o),o},{LABEL:Wse}=mR,Kse={icon:({attrs:e})=>`h${(e==null?void 0:e.level)??"1"}`,label:({t:e,attrs:t})=>e({...Wse,values:{level:t==null?void 0:t.level}})},qse=[$.H1,$.H2,$.H3,$.H4,$.H5,$.H6],Sh=class extends er{get name(){return"heading"}createTags(){return[te.Block,te.TextBlock,te.FormattingNode]}createNodeSpec(e,t){return{content:"inline*",defining:!0,draggable:!1,...t,attrs:{...e.defaults(),level:{default:this.options.defaultLevel}},parseDOM:[...this.options.levels.map(r=>({tag:`h${r}`,getAttrs:n=>({...e.parse(n),level:r})})),...t.parseDOM??[]],toDOM:r=>this.options.levels.includes(r.attrs.level)?[`h${r.attrs.level}`,e.dom(r),0]:[`h${this.options.defaultLevel}`,e.dom(r),0]}}toggleHeading(e={}){return Yv({type:this.type,toggleType:"paragraph",attrs:e})}createKeymap(e){const t=this.store.getExtension(xe),r=ee(),n=[];for(const o of this.options.levels){const i=qse[o-1]??$.H1;r[i]=Fu(this.type,{level:o}),n.push({attrs:{level:o},shortcut:e(i)[0]})}return t.updateDecorated("toggleHeading",{shortcut:n}),r}createInputRules(){return this.options.levels.map(e=>WR(new RegExp(`^(#{1,${e}})\\s$`),this.type,()=>({level:e})))}createPasteRules(){return this.options.levels.map(e=>({type:"node",nodeType:this.type,regexp:new RegExp(`^#{${e}}\\s([\\s\\w]+)$`),getAttributes:()=>({level:e}),startOfTextBlock:!0}))}};kO([U(Kse)],Sh.prototype,"toggleHeading",1);Sh=kO([pe({defaultOptions:{levels:[1,2,3,4,5,6],defaultLevel:1},staticKeys:["defaultLevel","levels"]})],Sh);var Gse=Object.defineProperty,Yse=Object.getOwnPropertyDescriptor,wO=(e,t,r,n)=>{for(var o=n>1?void 0:n?Yse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Gse(t,r,o),o},Jse={icon:"separator",label:({t:e})=>e(yk.LABEL),description:({t:e})=>e(yk.DESCRIPTION)},Eh=class extends er{get name(){return"horizontalRule"}createTags(){return[te.Block]}createNodeSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"hr",getAttrs:e.parse},...t.parseDOM??[]],toDOM:r=>["hr",e.dom(r)]}}insertHorizontalRule(){return e=>{const{tr:t,dispatch:r}=e,n=t.selection.$anchor,o=n.parent;return o.type.name==="doc"||o.isAtom||o.isLeaf?!1:(r&&(t.selection.empty&&Fh(o)&&t.insert(n.pos+1,o),t.replaceSelectionWith(this.type.create()),this.updateFromNodeSelection(t),r(t.scrollIntoView())),!0)}}createInputRules(){return[FC({regexp:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type,beforeDispatch:({tr:e})=>{this.updateFromNodeSelection(e)}})]}updateFromNodeSelection(e){if(!Dd(e.selection)||e.selection.node.type.name!==this.name)return;const t=e.selection.$from.pos+1,{insertionNode:r}=this.options;if(!r)return;const n=this.store.schema.nodes[r];re(n,{code:B.EXTENSION,message:`'${r}' node provided as the insertionNode to the '${this.constructorName}' does not exist.`});const o=n.create();e.insert(t,o),e.setSelection(le.near(e.doc.resolve(t+1)))}};wO([U(Jse)],Eh.prototype,"insertHorizontalRule",1);Eh=wO([pe({defaultOptions:{insertionNode:"paragraph"}})],Eh);var Xse=Object.defineProperty,Qse=Object.getOwnPropertyDescriptor,wx=(e,t,r,n)=>{for(var o=n>1?void 0:n?Qse(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Xse(t,r,o),o},Zse=class extends bse{constructor(e,t,r){super({node:e,view:t,getPos:r,aspectRatio:yO.Fixed})}createElement({node:e}){const t=document.createElement("img");return t.setAttribute("src",e.attrs.src),ar(t,{width:"100%",minWidth:"50px",objectFit:"contain"}),t}},wd=class extends er{get name(){return"image"}createTags(){return[te.InlineNode,te.Media]}createNodeSpec(e,t){const{preferPastedTextContent:r}=this.options;return{inline:!0,draggable:!0,selectable:!1,...t,attrs:{...e.defaults(),alt:{default:""},crop:{default:null},height:{default:null},width:{default:null},rotate:{default:null},src:{default:null},title:{default:""},fileName:{default:null},resizable:{default:!1}},parseDOM:[{tag:"img[src]",getAttrs:n=>{var o;if(et(n)){const i=tae({element:n,parse:e.parse});return r&&((o=i.src)!=null&&o.startsWith("file:///"))?!1:i}return{}}},...t.parseDOM??[]],toDOM:n=>{const o=$d(n.attrs,e);return["img",{...e.dom(n),...o}]}}}insertImage(e,t){return({tr:r,dispatch:n})=>{const{from:o,to:i}=jr(t??r.selection,r.doc),s=this.type.create(e);return n==null||n(r.replaceRangeWith(o,i,s)),!0}}uploadImage(e,t){const{updatePlaceholder:r,destroyPlaceholder:n,createPlaceholder:o}=this.options;return i=>{const{tr:s}=i;let a=s.selection.from;return this.store.createPlaceholderCommand({promise:e,placeholder:{type:"widget",get pos(){return a},createElement:(l,c)=>{const u=o(l,c);return t==null||t(u),u},onUpdate:(l,c,u,d)=>{r(l,c,u,d)},onDestroy:(l,c)=>{n(l,c)}},onSuccess:(l,c,u)=>this.insertImage(l,c)(u)}).validate(({tr:l,dispatch:c})=>{const u=CE(l.doc,a,this.type);return u==null?!1:(a=u,l.selection.empty||c==null||c(l.deleteSelection()),!0)},"unshift").generateCommand()(i)}}fileUploadFileHandler(e,t,r){var n;const{preferPastedTextContent:o,uploadHandler:i}=this.options;if(o&&oae(t)&&((n=t.clipboardData)!=null&&n.getData("text/plain")))return!1;const{commands:s,chain:a}=this.store,l=e.map((u,d)=>({file:u,progress:f=>{s.updatePlaceholder(c[d],f)}})),c=i(l);Jt(r)&&a.selectText(r);for(const u of c)a.uploadImage(u);return a.run(),!0}createPasteRules(){return[{type:"file",regexp:/image/i,fileHandler:e=>{const t=e.type==="drop"?e.pos:void 0;return this.fileUploadFileHandler(e.files,e.event,t)}}]}createNodeViews(){return this.options.enableResizing?(e,t,r)=>new Zse(e,t,r):{}}};wx([U()],wd.prototype,"insertImage",1);wx([U()],wd.prototype,"uploadImage",1);wd=wx([pe({defaultOptions:{createPlaceholder:rae,updatePlaceholder:()=>{},destroyPlaceholder:()=>{},uploadHandler:nae,enableResizing:!1,preferPastedTextContent:!0}})],wd);function eae(e){let{width:t,height:r}=e.style;return t=t||e.getAttribute("width")||"",r=r||e.getAttribute("height")||"",{width:t,height:r}}function tae({element:e,parse:t}){const{width:r,height:n}=eae(e);return{...t(e),alt:e.getAttribute("alt")??"",height:Number.parseInt(n||"0",10)||null,src:e.getAttribute("src")??null,title:e.getAttribute("title")??"",width:Number.parseInt(r||"0",10)||null,fileName:e.getAttribute("data-file-name")??null}}function rae(e,t){const r=document.createElement("div");return r.classList.add(uV.IMAGE_LOADER),r}function nae(e){re(e.length>0,{code:B.EXTENSION,message:"The upload handler was applied for the image extension without any valid files"});let t=0;const r=[];for(const{file:n,progress:o}of e)r.push(()=>new Promise(i=>{const s=new FileReader;s.addEventListener("load",a=>{var l;t+=1,o(t/e.length),i({src:(l=a.target)==null?void 0:l.result,fileName:n.name})},{once:!0}),s.readAsDataURL(n)}));return r}function oae(e){return e.clipboardData!==void 0}var iae=Object.defineProperty,sae=Object.getOwnPropertyDescriptor,Sx=(e,t,r,n)=>{for(var o=n>1?void 0:n?sae(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&iae(t,r,o),o},aae={icon:"italic",label:({t:e})=>e(bk.LABEL),description:({t:e})=>e(bk.DESCRIPTION)},Sd=class extends ci{get name(){return"italic"}createTags(){return[te.FontStyle,te.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"i",getAttrs:e.parse},{tag:"em",getAttrs:e.parse},{style:"font-style=italic"},...t.parseDOM??[]],toDOM:r=>["em",e.dom(r),0]}}createKeymap(){return{"Mod-i":is({type:this.type})}}createInputRules(){return[Vu({regexp:/(?:^|[^*])\*([^*]+)\*$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:e,start:t})=>e.startsWith("*")?{}:{fullMatch:e.slice(1),start:t+1}}),Vu({regexp:/(?:^|\W)_([^_]+)_$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:e,start:t})=>e.startsWith("_")?{}:{fullMatch:e.slice(1),start:t+1}})]}createPasteRules(){return[{type:"mark",markType:this.type,regexp:/(?:^|\W)_([^_]+)_/g},{type:"mark",markType:this.type,regexp:/\*([^*]+)\*/g}]}toggleItalic(e){return is({type:this.type,selection:e})}shortcut(e){return this.toggleItalic()(e)}};Sx([U(aae)],Sd.prototype,"toggleItalic",1);Sx([je({shortcut:$.Italic,command:"toggleItalic"})],Sd.prototype,"shortcut",1);Sd=Sx([pe({})],Sd);var SO={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(typeof self<"u"?self:Pu,function(){return function(r){function n(i){if(o[i])return o[i].exports;var s=o[i]={i,l:!1,exports:{}};return r[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}var o={};return n.m=r,n.c=o,n.d=function(i,s,a){n.o(i,s)||Object.defineProperty(i,s,{configurable:!1,enumerable:!0,get:a})},n.n=function(i){var s=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(s,"a",s),s},n.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)},n.p="",n(n.s=0)}([function(r,n,o){function i(){throw new TypeError("The given URL is not a string. Please verify your string|array.")}function s(c){typeof c!="string"&&i();for(var u=0,d=0,f=0,p=c.length,h=0;p--&&++h&&!(u&&-1f?"":c.slice(f,u)}var a=["/",":","?","#"],l=[".","/","@"];r.exports=function(c){if(typeof c=="string")return s(c);if(Array.isArray(c)){var u=[],d,f=0;for(d=c.length;f{for(var o=n>1?void 0:n?dae(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&uae(t,r,o),o},fae=["com","de","net","org","uk","cn","ga","nl","cf","ml","tk","ru","br","gq","xyz","fr","eu","info","co","au","ca","it","in","ch","pl","es","online","us","top","be","jp","biz","se","at","dk","cz","za","me","ir","icu","shop","kr","site","mx","hu","io","cc","club","no","cyou"],l4="updateLink",pae=/(?:(?:(?:https?|ftp):)?\/\/)?(?:\S+(?::\S*)?@)?(?:(?:[\da-z\u00A1-\uFFFF][\w\u00A1-\uFFFF-]{0,62})?[\da-z\u00A1-\uFFFF]\.)*(?:(?:\d(?!\.)|[a-z\u00A1-\uFFFF])(?:[\da-z\u00A1-\uFFFF][\w\u00A1-\uFFFF-]{0,62})?[\da-z\u00A1-\uFFFF]\.)+[a-z\u00A1-\uFFFF]{2,}(?::\d{2,5})?(?:[#/?]\S*)?/gi,ba=class extends ci{constructor(){super(...arguments),this._autoLinkRegexNonGlobal=void 0}get name(){return"link"}createTags(){return[te.Link,te.ExcludeInputRules]}createMarkSpec(e,t){const r="data-link-auto",n=o=>{const{defaultTarget:i,supportedTargets:s}=this.options,a=i?[...s,i]:s;return o&&fr(a,o)?{target:o}:void 0};return{inclusive:!1,excludes:"_",...t,attrs:{...e.defaults(),href:{},target:{default:this.options.defaultTarget},auto:{default:!1}},parseDOM:[{tag:"a[href]",getAttrs:o=>{if(!et(o))return!1;const i=o.getAttribute("href"),s=o.textContent,a=this.options.autoLink&&(o.hasAttribute(r)||i===s||(i==null?void 0:i.replace(`${this.options.defaultProtocol}//`,""))===s);return{...e.parse(o),href:i,auto:a,...n(o.getAttribute("target"))}}},...t.parseDOM??[]],toDOM:o=>{const{auto:i,target:s,...a}=$d(o.attrs,e),l=o.attrs.auto?{[r]:""}:{},c="noopener noreferrer nofollow";return["a",{...e.dom(o),...a,rel:c,...l,...n(o.attrs.target)},0]}}}onCreate(){const{autoLinkRegex:e}=this.options;this._autoLinkRegexNonGlobal=new RegExp(`^${e.source}$`,e.flags.replace("g",""))}shortcut({tr:e}){let t="",{from:r,to:n,empty:o,$from:i}=e.selection,s=!1;const a=_o(i,this.type);if(o){const l=a??AC(e);if(!l)return!1;({text:t,from:r,to:n}=l),s=!0}return r===n?!1:(s||(t=e.doc.textBetween(r,n)),this.options.onActivateLink(t),this.options.onShortcut({activeLink:a?{attrs:a.mark.attrs,from:a.from,to:a.to}:void 0,selectedText:t,from:r,to:n}),!0)}updateLink(e,t){return r=>{const{tr:n}=r;return!(ms(n.selection)&&!Uv(n.selection)||mz(n.selection)||Pp({trState:n,type:this.type}))&&!t?!1:(n.setMeta(this.name,{command:l4,attrs:e,range:t}),zz({type:this.type,attrs:e,range:t})(r))}}selectLink(){return this.store.commands.selectMark.original(this.type)}removeLink(e){return t=>{const{tr:r}=t;return Pp({trState:r,type:this.type,...e})?BC({type:this.type,expand:!0,range:e})(t):!1}}createPasteRules(){return[{type:"mark",regexp:this.options.autoLinkRegex,markType:this.type,getAttributes:(e,t)=>({href:this.buildHref(Zo(e)),auto:!t}),transformMatch:e=>{const t=Zo(e);return!t||!this.isValidUrl(t)?!1:t}}]}createEventHandlers(){return{clickMark:(e,t)=>{const r=t.getMark(this.type);if(!r)return;const n=r.mark.attrs,o={...n,...r};if(this.options.onClick(e,o))return!0;if(!this.store.view.editable)return;let i=!1;if(this.options.openLinkOnClick){i=!0;const s=n.href;window.open(s,"_blank")}return this.options.selectTextOnClick&&(i=!0,this.store.commands.selectText(r)),i}}}createPlugin(){return{appendTransaction:(e,t,r)=>{if(e.filter(p=>!!p.getMeta(this.name)).forEach(p=>{const h=p.getMeta(this.name);if(h.command===l4){const{range:m,attrs:b}=h,{selection:v,doc:g}=r,y={range:m,selection:v,doc:g,attrs:b},{from:x,to:k}=m??v;this.options.onUpdateLink(g.textBetween(x,k),y)}}),!this.options.autoLink||K0(t)-K0(r)===1||!e.some(p=>p.docChanged))return;const s=ez(e,t),a=_C(s,[bt,Dt]),{mapping:l}=s,{tr:c,doc:u}=r,{updateLink:d,removeLink:f}=this.store.chain(c);if(a.forEach(({prevFrom:p,prevTo:h,from:m,to:b})=>{const v=[],g=b-m===2,y=this.getLinkMarksInRange(t.doc,p,h,!0).filter(x=>x.mark.type===this.type).map(({from:x,to:k,text:w})=>({mappedFrom:l.map(x),mappedTo:l.map(k),text:w,from:x,to:k}));y.forEach(({mappedFrom:x,mappedTo:k,from:w,to:E},M)=>this.getLinkMarksInRange(u,x,k,!0).filter(C=>C.mark.type===this.type).forEach(C=>{const T=t.doc.textBetween(w,E,void 0," "),N=u.textBetween(C.from,C.to+1,void 0," ").trim(),z=this.isValidUrl(T);this.isValidUrl(N)||(z&&(f({from:C.from,to:C.to}).tr(),y.splice(M,1)),!g&&m===b&&this.findAutoLinks(N).map(V=>this.addLinkProperties({...V,from:x+V.start,to:x+V.end})).forEach(({attrs:V,range:j,text:L})=>{d(V,j).tr(),v.push({attrs:V,range:j,text:L})}))})),this.findTextBlocksInRange(u,{from:m,to:b}).forEach(({text:x,positionStart:k})=>{this.findAutoLinks(x).map(w=>this.addLinkProperties({...w,from:k+w.start+1,to:k+w.end+1})).filter(({range:w})=>{const E=m>=w.from&&m<=w.to,M=b>=w.from&&b<=w.to;return E||M||g}).filter(({range:w})=>this.getLinkMarksInRange(c.doc,w.from,w.to,!1).length===0).filter(({range:{from:w},text:E})=>!y.some(({text:M,mappedFrom:C})=>C===w&&M===E)).forEach(({attrs:w,text:E,range:M})=>{d(w,M).tr(),v.push({attrs:w,range:M,text:E})})}),window.requestAnimationFrame(()=>{v.forEach(({attrs:x,range:k,text:w})=>{const{doc:E,selection:M}=c;this.options.onUpdateLink(w,{attrs:x,doc:E,range:k,selection:M})})})}),c.steps.length!==0)return c}}}buildHref(e){return this.options.extractHref({url:e,defaultProtocol:this.options.defaultProtocol})}getLinkMarksInRange(e,t,r,n){const o=[];if(t===r){const i=Math.max(t-1,0),s=e.resolve(i),a=_o(s,this.type);(a==null?void 0:a.mark.attrs.auto)===n&&o.push(a)}else e.nodesBetween(t,r,(i,s)=>{const l=(i.marks??[]).find(({type:c,attrs:u})=>c===this.type&&u.auto===n);l&&o.push({from:s,to:s+i.nodeSize,mark:l,text:i.textContent})});return o}findTextBlocksInRange(e,t){const r=[];return e.nodesBetween(t.from,t.to,(n,o)=>{!n.isTextblock||!n.type.allowsMarkType(this.type)||r.push({node:n,pos:o})}),r.map(n=>({text:e.textBetween(n.pos,n.pos+n.node.nodeSize,void 0," "),positionStart:n.pos}))}addLinkProperties({from:e,to:t,href:r,...n}){return{...n,range:{from:e,to:t},attrs:{href:r,auto:!0}}}findAutoLinks(e){if(this.options.findAutoLinks)return this.options.findAutoLinks(e,this.options.defaultProtocol);const t=[];for(const r of xa(e,this.options.autoLinkRegex)){const n=Zo(r);if(!n)continue;const o=this.buildHref(n);!this.isValidTLD(o)&&!o.startsWith("tel:")||t.push({text:n,href:o,start:r.index,end:r.index+n.length})}return t}isValidUrl(e){var t;return this.options.isValidUrl?this.options.isValidUrl(e,this.options.defaultProtocol):this.isValidTLD(this.buildHref(e))&&!!((t=this._autoLinkRegexNonGlobal)!=null&&t.test(e))}isValidTLD(e){const{autoLinkAllowedTLDs:t}=this.options;if(t.length===0)return!0;const r=cae(e);if(r==="")return!0;const n=Z4(r.split("."));return t.includes(n)}};Zd([je({shortcut:$.InsertLink})],ba.prototype,"shortcut",1);Zd([U()],ba.prototype,"updateLink",1);Zd([U()],ba.prototype,"selectLink",1);Zd([U()],ba.prototype,"removeLink",1);ba=Zd([pe({defaultOptions:{autoLink:!1,defaultProtocol:"",selectTextOnClick:!1,openLinkOnClick:!1,autoLinkRegex:pae,autoLinkAllowedTLDs:fae,findAutoLinks:void 0,isValidUrl:void 0,defaultTarget:null,supportedTargets:[],extractHref:hae},staticKeys:["autoLinkRegex"],handlerKeyOptions:{onClick:{earlyReturnValue:!0}},handlerKeys:["onActivateLink","onShortcut","onUpdateLink","onClick"],defaultPriority:Ae.Medium})],ba);function hae({url:e,defaultProtocol:t}){const r=/^((?:https?|ftp)?:)\/\//.test(e);return!r&&e.includes("@")?`mailto:${e}`:r?e:`${t}//${e}`}function mae(e){for(var t=1;t0&&e[t-1]===` +`;)t--;return e.substring(0,t)}var yae=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function Ex(e){return Cx(e,yae)}var EO=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function CO(e){return Cx(e,EO)}function bae(e){return TO(e,EO)}var MO=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function xae(e){return Cx(e,MO)}function kae(e){return TO(e,MO)}function Cx(e,t){return t.indexOf(e.nodeName)>=0}function TO(e,t){return e.getElementsByTagName&&t.some(function(r){return e.getElementsByTagName(r).length})}var hr={};hr.paragraph={filter:"p",replacement:function(e){return` `+e+` `}};hr.lineBreak={filter:"br",replacement:function(e,t,r){return r.br+` -`}};hr.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,r){var n=Number(t.nodeName.charAt(1));if(r.headingStyle==="setext"&&n<3){var o=hv(n===1?"=":"-",e.length);return` +`}};hr.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,r){var n=Number(t.nodeName.charAt(1));if(r.headingStyle==="setext"&&n<3){var o=mv(n===1?"=":"-",e.length);return` `+e+` `+o+` `}else return` -`+hv("#",n)+" "+e+` +`+mv("#",n)+" "+e+` `}};hr.blockquote={filter:"blockquote",replacement:function(e){return e=e.replace(/^\n+|\n+$/g,""),e=e.replace(/^/gm,"> "),` @@ -4902,7 +4902,7 @@ Error generating stack: `+i.message+` `+t.firstChild.textContent.replace(/\n/g,` `)+` -`}};hr.fencedCodeBlock={filter:function(e,t){return t.codeBlockStyle==="fenced"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,t,r){for(var n=t.firstChild.getAttribute("class")||"",o=(n.match(/language-(\S+)/)||[null,""])[1],i=t.firstChild.textContent,s=r.fence.charAt(0),a=3,l=new RegExp("^"+s+"{3,}","gm"),c;c=l.exec(i);)c[0].length>=a&&(a=c[0].length+1);var u=hv(s,a);return` +`}};hr.fencedCodeBlock={filter:function(e,t){return t.codeBlockStyle==="fenced"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,t,r){for(var n=t.firstChild.getAttribute("class")||"",o=(n.match(/language-(\S+)/)||[null,""])[1],i=t.firstChild.textContent,s=r.fence.charAt(0),a=3,l=new RegExp("^"+s+"{3,}","gm"),c;c=l.exec(i);)c[0].length>=a&&(a=c[0].length+1);var u=mv(s,a);return` `+u+o+` `+i.replace(/\n$/,"")+` @@ -4912,13 +4912,13 @@ Error generating stack: `+i.message+` `+r.hr+` -`}};hr.inlineLink={filter:function(e,t){return t.linkStyle==="inlined"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t){var r=t.getAttribute("href"),n=Eh(t.getAttribute("title"));return n&&(n=' "'+n+'"'),"["+e+"]("+r+n+")"}};hr.referenceLink={filter:function(e,t){return t.linkStyle==="referenced"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t,r){var n=t.getAttribute("href"),o=Eh(t.getAttribute("title"));o&&(o=' "'+o+'"');var i,s;switch(r.linkReferenceStyle){case"collapsed":i="["+e+"][]",s="["+e+"]: "+n+o;break;case"shortcut":i="["+e+"]",s="["+e+"]: "+n+o;break;default:var a=this.references.length+1;i="["+e+"]["+a+"]",s="["+a+"]: "+n+o}return this.references.push(s),i},references:[],append:function(e){var t="";return this.references.length&&(t=` +`}};hr.inlineLink={filter:function(e,t){return t.linkStyle==="inlined"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t){var r=t.getAttribute("href"),n=Ch(t.getAttribute("title"));return n&&(n=' "'+n+'"'),"["+e+"]("+r+n+")"}};hr.referenceLink={filter:function(e,t){return t.linkStyle==="referenced"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,t,r){var n=t.getAttribute("href"),o=Ch(t.getAttribute("title"));o&&(o=' "'+o+'"');var i,s;switch(r.linkReferenceStyle){case"collapsed":i="["+e+"][]",s="["+e+"]: "+n+o;break;case"shortcut":i="["+e+"]",s="["+e+"]: "+n+o;break;default:var a=this.references.length+1;i="["+e+"]["+a+"]",s="["+a+"]: "+n+o}return this.references.push(s),i},references:[],append:function(e){var t="";return this.references.length&&(t=` `+this.references.join(` `)+` -`,this.references=[]),t}};hr.emphasis={filter:["em","i"],replacement:function(e,t,r){return e.trim()?r.emDelimiter+e+r.emDelimiter:""}};hr.strong={filter:["strong","b"],replacement:function(e,t,r){return e.trim()?r.strongDelimiter+e+r.strongDelimiter:""}};hr.code={filter:function(e){var t=e.previousSibling||e.nextSibling,r=e.parentNode.nodeName==="PRE"&&!t;return e.nodeName==="CODE"&&!r},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",r="`",n=e.match(/`+/gm)||[];n.indexOf(r)!==-1;)r=r+"`";return r+t+e+t+r}};hr.image={filter:"img",replacement:function(e,t){var r=Eh(t.getAttribute("alt")),n=t.getAttribute("src")||"",o=Eh(t.getAttribute("title")),i=o?' "'+o+'"':"";return n?"!["+r+"]("+n+i+")":""}};function Eh(e){return e?e.replace(/(\n+\s*)+/g,` -`):""}function TO(e){this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[];for(var t in e.rules)this.array.push(e.rules[t])}TO.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){if(e.isBlank)return this.blankRule;var t;return(t=g1(this.array,e,this.options))||(t=g1(this._keep,e,this.options))||(t=g1(this._remove,e,this.options))?t:this.defaultRule},forEach:function(e){for(var t=0;t-1)return!0}else if(typeof n=="function"){if(n.call(e,t,r))return!0}else throw new TypeError("`filter` needs to be a string, array, or function")}function wae(e){var t=e.element,r=e.isBlock,n=e.isVoid,o=e.isPre||function(d){return d.nodeName==="PRE"};if(!(!t.firstChild||o(t))){for(var i=null,s=!1,a=null,l=l4(a,t,o);l!==t;){if(l.nodeType===3||l.nodeType===4){var c=l.data.replace(/[ \r\n\t]+/g," ");if((!i||/ $/.test(i.data))&&!s&&c[0]===" "&&(c=c.substr(1)),!c){l=v1(l);continue}l.data=c,i=l}else if(l.nodeType===1)r(l)||l.nodeName==="BR"?(i&&(i.data=i.data.replace(/ $/,"")),i=null,s=!1):n(l)||o(l)?(i=null,s=!0):i&&(s=!1);else{l=v1(l);continue}var u=l4(a,l,o);a=l,l=u}i&&(i.data=i.data.replace(/ $/,""),i.data||v1(i))}}function v1(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function l4(e,t,r){return e&&e.parentNode===t||r(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}var OO=typeof window<"u"?window:{};function Sae(){var e=OO.DOMParser,t=!1;try{new e().parseFromString("","text/html")&&(t=!0)}catch{}return t}function Eae(){var e=function(){};return Cae()?e.prototype.parseFromString=function(t){var r=new window.ActiveXObject("htmlfile");return r.designMode="on",r.open(),r.write(t),r.close(),r}:e.prototype.parseFromString=function(t){var r=document.implementation.createHTMLDocument("");return r.open(),r.write(t),r.close(),r},e}function Cae(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch{window.ActiveXObject&&(e=!0)}return e}var Mae=Sae()?OO.DOMParser:Eae();function Tae(e,t){var r;if(typeof e=="string"){var n=Oae().parseFromString(''+e+"","text/html");r=n.getElementById("turndown-root")}else r=e.cloneNode(!0);return wae({element:r,isBlock:Sx,isVoid:EO,isPre:t.preformattedCode?_ae:null}),r}var y1;function Oae(){return y1=y1||new Mae,y1}function _ae(e){return e.nodeName==="PRE"||e.nodeName==="CODE"}function Aae(e,t){return e.isBlock=Sx(e),e.isCode=e.nodeName==="CODE"||e.parentNode.isCode,e.isBlank=Nae(e),e.flankingWhitespace=Rae(e,t),e}function Nae(e){return!EO(e)&&!bae(e)&&/^\s*$/i.test(e.textContent)&&!yae(e)&&!xae(e)}function Rae(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var r=Pae(e.textContent);return r.leadingAscii&&c4("left",e,t)&&(r.leading=r.leadingNonAscii),r.trailingAscii&&c4("right",e,t)&&(r.trailing=r.trailingNonAscii),{leading:r.leading,trailing:r.trailing}}function Pae(e){var t=e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:t[1],leadingAscii:t[2],leadingNonAscii:t[3],trailing:t[4],trailingNonAscii:t[5],trailingAscii:t[6]}}function c4(e,t,r){var n,o,i;return e==="left"?(n=t.previousSibling,o=/ $/):(n=t.nextSibling,o=/^ /),n&&(n.nodeType===3?i=o.test(n.nodeValue):r.preformattedCode&&n.nodeName==="CODE"?i=!1:n.nodeType===1&&!Sx(n)&&(i=o.test(n.textContent))),i}var zae=Array.prototype.reduce,Lae=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function Ed(e){if(!(this instanceof Ed))return new Ed(e);var t={rules:hr,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(r,n){return n.isBlock?` +`,this.references=[]),t}};hr.emphasis={filter:["em","i"],replacement:function(e,t,r){return e.trim()?r.emDelimiter+e+r.emDelimiter:""}};hr.strong={filter:["strong","b"],replacement:function(e,t,r){return e.trim()?r.strongDelimiter+e+r.strongDelimiter:""}};hr.code={filter:function(e){var t=e.previousSibling||e.nextSibling,r=e.parentNode.nodeName==="PRE"&&!t;return e.nodeName==="CODE"&&!r},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",r="`",n=e.match(/`+/gm)||[];n.indexOf(r)!==-1;)r=r+"`";return r+t+e+t+r}};hr.image={filter:"img",replacement:function(e,t){var r=Ch(t.getAttribute("alt")),n=t.getAttribute("src")||"",o=Ch(t.getAttribute("title")),i=o?' "'+o+'"':"";return n?"!["+r+"]("+n+i+")":""}};function Ch(e){return e?e.replace(/(\n+\s*)+/g,` +`):""}function OO(e){this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[];for(var t in e.rules)this.array.push(e.rules[t])}OO.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){if(e.isBlank)return this.blankRule;var t;return(t=v1(this.array,e,this.options))||(t=v1(this._keep,e,this.options))||(t=v1(this._remove,e,this.options))?t:this.defaultRule},forEach:function(e){for(var t=0;t-1)return!0}else if(typeof n=="function"){if(n.call(e,t,r))return!0}else throw new TypeError("`filter` needs to be a string, array, or function")}function Sae(e){var t=e.element,r=e.isBlock,n=e.isVoid,o=e.isPre||function(d){return d.nodeName==="PRE"};if(!(!t.firstChild||o(t))){for(var i=null,s=!1,a=null,l=c4(a,t,o);l!==t;){if(l.nodeType===3||l.nodeType===4){var c=l.data.replace(/[ \r\n\t]+/g," ");if((!i||/ $/.test(i.data))&&!s&&c[0]===" "&&(c=c.substr(1)),!c){l=y1(l);continue}l.data=c,i=l}else if(l.nodeType===1)r(l)||l.nodeName==="BR"?(i&&(i.data=i.data.replace(/ $/,"")),i=null,s=!1):n(l)||o(l)?(i=null,s=!0):i&&(s=!1);else{l=y1(l);continue}var u=c4(a,l,o);a=l,l=u}i&&(i.data=i.data.replace(/ $/,""),i.data||y1(i))}}function y1(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function c4(e,t,r){return e&&e.parentNode===t||r(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}var _O=typeof window<"u"?window:{};function Eae(){var e=_O.DOMParser,t=!1;try{new e().parseFromString("","text/html")&&(t=!0)}catch{}return t}function Cae(){var e=function(){};return Mae()?e.prototype.parseFromString=function(t){var r=new window.ActiveXObject("htmlfile");return r.designMode="on",r.open(),r.write(t),r.close(),r}:e.prototype.parseFromString=function(t){var r=document.implementation.createHTMLDocument("");return r.open(),r.write(t),r.close(),r},e}function Mae(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch{window.ActiveXObject&&(e=!0)}return e}var Tae=Eae()?_O.DOMParser:Cae();function Oae(e,t){var r;if(typeof e=="string"){var n=_ae().parseFromString(''+e+"","text/html");r=n.getElementById("turndown-root")}else r=e.cloneNode(!0);return Sae({element:r,isBlock:Ex,isVoid:CO,isPre:t.preformattedCode?Aae:null}),r}var b1;function _ae(){return b1=b1||new Tae,b1}function Aae(e){return e.nodeName==="PRE"||e.nodeName==="CODE"}function Nae(e,t){return e.isBlock=Ex(e),e.isCode=e.nodeName==="CODE"||e.parentNode.isCode,e.isBlank=Rae(e),e.flankingWhitespace=Pae(e,t),e}function Rae(e){return!CO(e)&&!xae(e)&&/^\s*$/i.test(e.textContent)&&!bae(e)&&!kae(e)}function Pae(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var r=zae(e.textContent);return r.leadingAscii&&u4("left",e,t)&&(r.leading=r.leadingNonAscii),r.trailingAscii&&u4("right",e,t)&&(r.trailing=r.trailingNonAscii),{leading:r.leading,trailing:r.trailing}}function zae(e){var t=e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:t[1],leadingAscii:t[2],leadingNonAscii:t[3],trailing:t[4],trailingNonAscii:t[5],trailingAscii:t[6]}}function u4(e,t,r){var n,o,i;return e==="left"?(n=t.previousSibling,o=/ $/):(n=t.nextSibling,o=/^ /),n&&(n.nodeType===3?i=o.test(n.nodeValue):r.preformattedCode&&n.nodeName==="CODE"?i=!1:n.nodeType===1&&!Ex(n)&&(i=o.test(n.textContent))),i}var Lae=Array.prototype.reduce,Iae=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function Ed(e){if(!(this instanceof Ed))return new Ed(e);var t={rules:hr,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(r,n){return n.isBlock?` `:""},keepReplacement:function(r,n){return n.isBlock?` @@ -4928,22 +4928,22 @@ Error generating stack: `+i.message+` `+r+` -`:r}};this.options=hae({},t,e),this.rules=new TO(this.options)}Ed.prototype={turndown:function(e){if(!$ae(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(e==="")return"";var t=_O.call(this,new Tae(e,this.options));return Iae.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t"']/,Bae=new RegExp(RO.source,"g"),PO=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Fae=new RegExp(PO.source,"g"),Vae={"&":"&","<":"<",">":">",'"':""","'":"'"},u4=e=>Vae[e];function cr(e,t){if(t){if(RO.test(e))return e.replace(Bae,u4)}else if(PO.test(e))return e.replace(Fae,u4);return e}const jae=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function zO(e){return e.replace(jae,(t,r)=>(r=r.toLowerCase(),r==="colon"?":":r.charAt(0)==="#"?r.charAt(1)==="x"?String.fromCharCode(parseInt(r.substring(2),16)):String.fromCharCode(+r.substring(1)):""))}const Uae=/(^|[^\[])\^/g;function We(e,t){e=typeof e=="string"?e:e.source,t=t||"";const r={replace:(n,o)=>(o=o.source||o,o=o.replace(Uae,"$1"),e=e.replace(n,o),r),getRegex:()=>new RegExp(e,t)};return r}const Wae=/[^\w:]/g,Kae=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function d4(e,t,r){if(e){let n;try{n=decodeURIComponent(zO(r)).replace(Wae,"").toLowerCase()}catch{return null}if(n.indexOf("javascript:")===0||n.indexOf("vbscript:")===0||n.indexOf("data:")===0)return null}t&&!Kae.test(r)&&(r=Jae(t,r));try{r=encodeURI(r).replace(/%25/g,"%")}catch{return null}return r}const Pf={},qae=/^[^:]+:\/*[^/]*$/,Gae=/^([^:]+:)[\s\S]*$/,Yae=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Jae(e,t){Pf[" "+e]||(qae.test(e)?Pf[" "+e]=e+"/":Pf[" "+e]=mp(e,"/",!0)),e=Pf[" "+e];const r=e.indexOf(":")===-1;return t.substring(0,2)==="//"?r?t:e.replace(Gae,"$1")+t:t.charAt(0)==="/"?r?t:e.replace(Yae,"$1")+t:e+t}const Ch={exec:function(){}};function f4(e,t){const r=e.replace(/\|/g,(i,s,a)=>{let l=!1,c=s;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),n=r.split(/ \|/);let o=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length1;)t&1&&(r+=e),t>>=1,e+=e;return r+e}function h4(e,t,r,n){const o=t.href,i=t.title?cr(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){n.state.inLink=!0;const a={type:"link",raw:r,href:o,title:i,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,a}return{type:"image",raw:r,href:o,title:i,text:cr(s)}}function Zae(e,t){const r=e.match(/^(\s+)(?:```)/);if(r===null)return t;const n=r[1];return t.split(` +`.substring(0,o);return r+i+n}function Hae(e){return e!=null&&(typeof e=="string"||e.nodeType&&(e.nodeType===1||e.nodeType===9||e.nodeType===11))}function RO(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Ta=RO();function Bae(e){Ta=e}const PO=/[&<>"']/,Fae=new RegExp(PO.source,"g"),zO=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Vae=new RegExp(zO.source,"g"),jae={"&":"&","<":"<",">":">",'"':""","'":"'"},d4=e=>jae[e];function cr(e,t){if(t){if(PO.test(e))return e.replace(Fae,d4)}else if(zO.test(e))return e.replace(Vae,d4);return e}const Uae=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function LO(e){return e.replace(Uae,(t,r)=>(r=r.toLowerCase(),r==="colon"?":":r.charAt(0)==="#"?r.charAt(1)==="x"?String.fromCharCode(parseInt(r.substring(2),16)):String.fromCharCode(+r.substring(1)):""))}const Wae=/(^|[^\[])\^/g;function We(e,t){e=typeof e=="string"?e:e.source,t=t||"";const r={replace:(n,o)=>(o=o.source||o,o=o.replace(Wae,"$1"),e=e.replace(n,o),r),getRegex:()=>new RegExp(e,t)};return r}const Kae=/[^\w:]/g,qae=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function f4(e,t,r){if(e){let n;try{n=decodeURIComponent(LO(r)).replace(Kae,"").toLowerCase()}catch{return null}if(n.indexOf("javascript:")===0||n.indexOf("vbscript:")===0||n.indexOf("data:")===0)return null}t&&!qae.test(r)&&(r=Xae(t,r));try{r=encodeURI(r).replace(/%25/g,"%")}catch{return null}return r}const Pf={},Gae=/^[^:]+:\/*[^/]*$/,Yae=/^([^:]+:)[\s\S]*$/,Jae=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Xae(e,t){Pf[" "+e]||(Gae.test(e)?Pf[" "+e]=e+"/":Pf[" "+e]=mp(e,"/",!0)),e=Pf[" "+e];const r=e.indexOf(":")===-1;return t.substring(0,2)==="//"?r?t:e.replace(Yae,"$1")+t:t.charAt(0)==="/"?r?t:e.replace(Jae,"$1")+t:e+t}const Mh={exec:function(){}};function p4(e,t){const r=e.replace(/\|/g,(i,s,a)=>{let l=!1,c=s;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),n=r.split(/ \|/);let o=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length1;)t&1&&(r+=e),t>>=1,e+=e;return r+e}function m4(e,t,r,n){const o=t.href,i=t.title?cr(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){n.state.inLink=!0;const a={type:"link",raw:r,href:o,title:i,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,a}return{type:"image",raw:r,href:o,title:i,text:cr(s)}}function ele(e,t){const r=e.match(/^(\s+)(?:```)/);if(r===null)return t;const n=r[1];return t.split(` `).map(o=>{const i=o.match(/^\s+/);if(i===null)return o;const[s]=i;return s.length>=n.length?o.slice(n.length):o}).join(` -`)}class Cx{constructor(t){this.options=t||Ta}space(t){const r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){const r=this.rules.block.code.exec(t);if(r){const n=r[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:mp(n,` -`)}}}fences(t){const r=this.rules.block.fences.exec(t);if(r){const n=r[0],o=Zae(n,r[3]||"");return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline._escapes,"$1"):r[2],text:o}}}heading(t){const r=this.rules.block.heading.exec(t);if(r){let n=r[2].trim();if(/#$/.test(n)){const o=mp(n,"#");(this.options.pedantic||!o||/ $/.test(o))&&(n=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){const r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:r[0]}}blockquote(t){const r=this.rules.block.blockquote.exec(t);if(r){const n=r[0].replace(/^ *>[ \t]?/gm,""),o=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(n);return this.lexer.state.top=o,{type:"blockquote",raw:r[0],tokens:i,text:n}}}list(t){let r=this.rules.block.list.exec(t);if(r){let n,o,i,s,a,l,c,u,d,f,p,h,m=r[1].trim();const b=m.length>1,v={type:"list",raw:"",ordered:b,start:b?+m.slice(0,-1):"",loose:!1,items:[]};m=b?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=b?m:"[*+-]");const g=new RegExp(`^( {0,3}${m})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(h=!1,!(!(r=g.exec(t))||this.rules.block.hr.test(t)));){if(n=r[0],t=t.substring(n.length),u=r[2].split(` +`)}class Mx{constructor(t){this.options=t||Ta}space(t){const r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){const r=this.rules.block.code.exec(t);if(r){const n=r[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:mp(n,` +`)}}}fences(t){const r=this.rules.block.fences.exec(t);if(r){const n=r[0],o=ele(n,r[3]||"");return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline._escapes,"$1"):r[2],text:o}}}heading(t){const r=this.rules.block.heading.exec(t);if(r){let n=r[2].trim();if(/#$/.test(n)){const o=mp(n,"#");(this.options.pedantic||!o||/ $/.test(o))&&(n=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){const r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:r[0]}}blockquote(t){const r=this.rules.block.blockquote.exec(t);if(r){const n=r[0].replace(/^ *>[ \t]?/gm,""),o=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(n);return this.lexer.state.top=o,{type:"blockquote",raw:r[0],tokens:i,text:n}}}list(t){let r=this.rules.block.list.exec(t);if(r){let n,o,i,s,a,l,c,u,d,f,p,h,m=r[1].trim();const b=m.length>1,v={type:"list",raw:"",ordered:b,start:b?+m.slice(0,-1):"",loose:!1,items:[]};m=b?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=b?m:"[*+-]");const g=new RegExp(`^( {0,3}${m})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(h=!1,!(!(r=g.exec(t))||this.rules.block.hr.test(t)));){if(n=r[0],t=t.substring(n.length),u=r[2].split(` `,1)[0].replace(/^\t+/,x=>" ".repeat(3*x.length)),d=t.split(` `,1)[0],this.options.pedantic?(s=2,p=u.trimLeft()):(s=r[2].search(/[^ ]/),s=s>4?1:s,p=u.slice(s),s+=r[1].length),l=!1,!u&&/^ *$/.test(d)&&(n+=d+` `,t=t.substring(d.length+1),h=!0),!h){const x=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),k=new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),w=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),E=new RegExp(`^ {0,${Math.min(3,s-1)}}#`);for(;t&&(f=t.split(` `,1)[0],d=f,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(w.test(d)||E.test(d)||x.test(d)||k.test(t)));){if(d.search(/[^ ]/)>=s||!d.trim())p+=` `+d.slice(s);else{if(l||u.search(/[^ ]/)>=4||w.test(u)||E.test(u)||k.test(u))break;p+=` `+d}!l&&!d.trim()&&(l=!0),n+=f+` -`,t=t.substring(f.length+1),u=d.slice(s)}}v.loose||(c?v.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(o=/^\[[ xX]\] /.exec(p),o&&(i=o[0]!=="[ ] ",p=p.replace(/^\[[ xX]\] +/,""))),v.items.push({type:"list_item",raw:n,task:!!o,checked:i,loose:!1,text:p}),v.raw+=n}v.items[v.items.length-1].raw=n.trimRight(),v.items[v.items.length-1].text=p.trimRight(),v.raw=v.raw.trimRight();const y=v.items.length;for(a=0;aw.type==="space"),k=x.length>0&&x.some(w=>/\n.*\n/.test(w.raw));v.loose=k}if(v.loose)for(a=0;a$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline._escapes,"$1"):r[3];return{type:"def",tag:n,raw:r[0],href:o,title:i}}}table(t){const r=this.rules.block.table.exec(t);if(r){const n={type:"table",header:f4(r[1]).map(o=>({text:o})),align:r[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:r[3]&&r[3].trim()?r[3].replace(/\n[ \t]*$/,"").split(` -`):[]};if(n.header.length===n.align.length){n.raw=r[0];let o=n.align.length,i,s,a,l;for(i=0;i({text:c}));for(o=n.header.length,s=0;s/i.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):cr(r[0]):r[0]}}link(t){const r=this.rules.inline.link.exec(t);if(r){const n=r[2].trim();if(!this.options.pedantic&&/^$/.test(n))return;const s=mp(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{const s=Xae(r[2],"()");if(s>-1){const l=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,l).trim(),r[3]=""}}let o=r[2],i="";if(this.options.pedantic){const s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);s&&(o=s[1],i=s[3])}else i=r[3]?r[3].slice(1,-1):"";return o=o.trim(),/^$/.test(n)?o=o.slice(1):o=o.slice(1,-1)),h4(r,{href:o&&o.replace(this.rules.inline._escapes,"$1"),title:i&&i.replace(this.rules.inline._escapes,"$1")},r[0],this.lexer)}}reflink(t,r){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let o=(n[2]||n[1]).replace(/\s+/g," ");if(o=r[o.toLowerCase()],!o){const i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return h4(n,o,n[0],this.lexer)}}emStrong(t,r,n=""){let o=this.rules.inline.emStrong.lDelim.exec(t);if(!o||o[3]&&n.match(/[\p{L}\p{N}]/u))return;const i=o[1]||o[2]||"";if(!i||i&&(n===""||this.rules.inline.punctuation.exec(n))){const s=o[0].length-1;let a,l,c=s,u=0;const d=o[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,r=r.slice(-1*t.length+s);(o=d.exec(r))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(l=a.length,o[3]||o[4]){c+=l;continue}else if((o[5]||o[6])&&s%3&&!((s+l)%3)){u+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+u);const f=t.slice(0,s+o.index+(o[0].length-a.length)+l);if(Math.min(s,l)%2){const h=f.slice(1,-1);return{type:"em",raw:f,text:h,tokens:this.lexer.inlineTokens(h)}}const p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(t){const r=this.rules.inline.code.exec(t);if(r){let n=r[2].replace(/\n/g," ");const o=/[^ ]/.test(n),i=/^ /.test(n)&&/ $/.test(n);return o&&i&&(n=n.substring(1,n.length-1)),n=cr(n,!0),{type:"codespan",raw:r[0],text:n}}}br(t){const r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){const r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t,r){const n=this.rules.inline.autolink.exec(t);if(n){let o,i;return n[2]==="@"?(o=cr(this.options.mangle?r(n[1]):n[1]),i="mailto:"+o):(o=cr(n[1]),i=o),{type:"link",raw:n[0],text:o,href:i,tokens:[{type:"text",raw:o,text:o}]}}}url(t,r){let n;if(n=this.rules.inline.url.exec(t)){let o,i;if(n[2]==="@")o=cr(this.options.mangle?r(n[0]):n[0]),i="mailto:"+o;else{let s;do s=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0];while(s!==n[0]);o=cr(n[0]),n[1]==="www."?i="http://"+n[0]:i=n[0]}return{type:"link",raw:n[0],text:o,href:i,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(t,r){const n=this.rules.inline.text.exec(t);if(n){let o;return this.lexer.state.inRawBlock?o=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):cr(n[0]):n[0]:o=cr(this.options.smartypants?r(n[0]):n[0]),{type:"text",raw:n[0],text:o}}}}const ae={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Ch,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};ae._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;ae._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;ae.def=We(ae.def).replace("label",ae._label).replace("title",ae._title).getRegex();ae.bullet=/(?:[*+-]|\d{1,9}[.)])/;ae.listItemStart=We(/^( *)(bull) */).replace("bull",ae.bullet).getRegex();ae.list=We(ae.list).replace(/bull/g,ae.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ae.def.source+")").getRegex();ae._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";ae._comment=/|$)/;ae.html=We(ae.html,"i").replace("comment",ae._comment).replace("tag",ae._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();ae.paragraph=We(ae._paragraph).replace("hr",ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ae._tag).getRegex();ae.blockquote=We(ae.blockquote).replace("paragraph",ae.paragraph).getRegex();ae.normal={...ae};ae.gfm={...ae.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};ae.gfm.table=We(ae.gfm.table).replace("hr",ae.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ae._tag).getRegex();ae.gfm.paragraph=We(ae._paragraph).replace("hr",ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",ae.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ae._tag).getRegex();ae.pedantic={...ae.normal,html:We(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ae._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ch,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:We(ae.normal._paragraph).replace("hr",ae.hr).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",ae.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ch,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ch,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";Q.punctuation=We(Q.punctuation).replace(/punctuation/g,Q._punctuation).getRegex();Q.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;Q.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;Q._comment=We(ae._comment).replace("(?:-->|$)","-->").getRegex();Q.emStrong.lDelim=We(Q.emStrong.lDelim).replace(/punct/g,Q._punctuation).getRegex();Q.emStrong.rDelimAst=We(Q.emStrong.rDelimAst,"g").replace(/punct/g,Q._punctuation).getRegex();Q.emStrong.rDelimUnd=We(Q.emStrong.rDelimUnd,"g").replace(/punct/g,Q._punctuation).getRegex();Q._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;Q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;Q._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;Q.autolink=We(Q.autolink).replace("scheme",Q._scheme).replace("email",Q._email).getRegex();Q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;Q.tag=We(Q.tag).replace("comment",Q._comment).replace("attribute",Q._attribute).getRegex();Q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;Q._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;Q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;Q.link=We(Q.link).replace("label",Q._label).replace("href",Q._href).replace("title",Q._title).getRegex();Q.reflink=We(Q.reflink).replace("label",Q._label).replace("ref",ae._label).getRegex();Q.nolink=We(Q.nolink).replace("ref",ae._label).getRegex();Q.reflinkSearch=We(Q.reflinkSearch,"g").replace("reflink",Q.reflink).replace("nolink",Q.nolink).getRegex();Q.normal={...Q};Q.pedantic={...Q.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:We(/^!?\[(label)\]\((.*?)\)/).replace("label",Q._label).getRegex(),reflink:We(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Q._label).getRegex()};Q.gfm={...Q.normal,escape:We(Q.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),t+="&#"+n+";";return t}class ds{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ta,this.options.tokenizer=this.options.tokenizer||new Cx,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={block:ae.normal,inline:Q.normal};this.options.pedantic?(r.block=ae.pedantic,r.inline=Q.pedantic):this.options.gfm&&(r.block=ae.gfm,this.options.breaks?r.inline=Q.breaks:r.inline=Q.gfm),this.tokenizer.rules=r}static get rules(){return{block:ae,inline:Q}}static lex(t,r){return new ds(r).lex(t)}static lexInline(t,r){return new ds(r).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,` +`,t=t.substring(f.length+1),u=d.slice(s)}}v.loose||(c?v.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(o=/^\[[ xX]\] /.exec(p),o&&(i=o[0]!=="[ ] ",p=p.replace(/^\[[ xX]\] +/,""))),v.items.push({type:"list_item",raw:n,task:!!o,checked:i,loose:!1,text:p}),v.raw+=n}v.items[v.items.length-1].raw=n.trimRight(),v.items[v.items.length-1].text=p.trimRight(),v.raw=v.raw.trimRight();const y=v.items.length;for(a=0;aw.type==="space"),k=x.length>0&&x.some(w=>/\n.*\n/.test(w.raw));v.loose=k}if(v.loose)for(a=0;a$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline._escapes,"$1"):r[3];return{type:"def",tag:n,raw:r[0],href:o,title:i}}}table(t){const r=this.rules.block.table.exec(t);if(r){const n={type:"table",header:p4(r[1]).map(o=>({text:o})),align:r[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:r[3]&&r[3].trim()?r[3].replace(/\n[ \t]*$/,"").split(` +`):[]};if(n.header.length===n.align.length){n.raw=r[0];let o=n.align.length,i,s,a,l;for(i=0;i({text:c}));for(o=n.header.length,s=0;s/i.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):cr(r[0]):r[0]}}link(t){const r=this.rules.inline.link.exec(t);if(r){const n=r[2].trim();if(!this.options.pedantic&&/^$/.test(n))return;const s=mp(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{const s=Qae(r[2],"()");if(s>-1){const l=(r[0].indexOf("!")===0?5:4)+r[1].length+s;r[2]=r[2].substring(0,s),r[0]=r[0].substring(0,l).trim(),r[3]=""}}let o=r[2],i="";if(this.options.pedantic){const s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);s&&(o=s[1],i=s[3])}else i=r[3]?r[3].slice(1,-1):"";return o=o.trim(),/^$/.test(n)?o=o.slice(1):o=o.slice(1,-1)),m4(r,{href:o&&o.replace(this.rules.inline._escapes,"$1"),title:i&&i.replace(this.rules.inline._escapes,"$1")},r[0],this.lexer)}}reflink(t,r){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let o=(n[2]||n[1]).replace(/\s+/g," ");if(o=r[o.toLowerCase()],!o){const i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return m4(n,o,n[0],this.lexer)}}emStrong(t,r,n=""){let o=this.rules.inline.emStrong.lDelim.exec(t);if(!o||o[3]&&n.match(/[\p{L}\p{N}]/u))return;const i=o[1]||o[2]||"";if(!i||i&&(n===""||this.rules.inline.punctuation.exec(n))){const s=o[0].length-1;let a,l,c=s,u=0;const d=o[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,r=r.slice(-1*t.length+s);(o=d.exec(r))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(l=a.length,o[3]||o[4]){c+=l;continue}else if((o[5]||o[6])&&s%3&&!((s+l)%3)){u+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+u);const f=t.slice(0,s+o.index+(o[0].length-a.length)+l);if(Math.min(s,l)%2){const h=f.slice(1,-1);return{type:"em",raw:f,text:h,tokens:this.lexer.inlineTokens(h)}}const p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(t){const r=this.rules.inline.code.exec(t);if(r){let n=r[2].replace(/\n/g," ");const o=/[^ ]/.test(n),i=/^ /.test(n)&&/ $/.test(n);return o&&i&&(n=n.substring(1,n.length-1)),n=cr(n,!0),{type:"codespan",raw:r[0],text:n}}}br(t){const r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){const r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t,r){const n=this.rules.inline.autolink.exec(t);if(n){let o,i;return n[2]==="@"?(o=cr(this.options.mangle?r(n[1]):n[1]),i="mailto:"+o):(o=cr(n[1]),i=o),{type:"link",raw:n[0],text:o,href:i,tokens:[{type:"text",raw:o,text:o}]}}}url(t,r){let n;if(n=this.rules.inline.url.exec(t)){let o,i;if(n[2]==="@")o=cr(this.options.mangle?r(n[0]):n[0]),i="mailto:"+o;else{let s;do s=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0];while(s!==n[0]);o=cr(n[0]),n[1]==="www."?i="http://"+n[0]:i=n[0]}return{type:"link",raw:n[0],text:o,href:i,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(t,r){const n=this.rules.inline.text.exec(t);if(n){let o;return this.lexer.state.inRawBlock?o=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):cr(n[0]):n[0]:o=cr(this.options.smartypants?r(n[0]):n[0]),{type:"text",raw:n[0],text:o}}}}const ae={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Mh,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};ae._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;ae._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;ae.def=We(ae.def).replace("label",ae._label).replace("title",ae._title).getRegex();ae.bullet=/(?:[*+-]|\d{1,9}[.)])/;ae.listItemStart=We(/^( *)(bull) */).replace("bull",ae.bullet).getRegex();ae.list=We(ae.list).replace(/bull/g,ae.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ae.def.source+")").getRegex();ae._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";ae._comment=/|$)/;ae.html=We(ae.html,"i").replace("comment",ae._comment).replace("tag",ae._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();ae.paragraph=We(ae._paragraph).replace("hr",ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ae._tag).getRegex();ae.blockquote=We(ae.blockquote).replace("paragraph",ae.paragraph).getRegex();ae.normal={...ae};ae.gfm={...ae.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};ae.gfm.table=We(ae.gfm.table).replace("hr",ae.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ae._tag).getRegex();ae.gfm.paragraph=We(ae._paragraph).replace("hr",ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",ae.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ae._tag).getRegex();ae.pedantic={...ae.normal,html:We(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ae._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Mh,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:We(ae.normal._paragraph).replace("hr",ae.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",ae.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Mh,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Mh,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";Q.punctuation=We(Q.punctuation).replace(/punctuation/g,Q._punctuation).getRegex();Q.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;Q.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;Q._comment=We(ae._comment).replace("(?:-->|$)","-->").getRegex();Q.emStrong.lDelim=We(Q.emStrong.lDelim).replace(/punct/g,Q._punctuation).getRegex();Q.emStrong.rDelimAst=We(Q.emStrong.rDelimAst,"g").replace(/punct/g,Q._punctuation).getRegex();Q.emStrong.rDelimUnd=We(Q.emStrong.rDelimUnd,"g").replace(/punct/g,Q._punctuation).getRegex();Q._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;Q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;Q._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;Q.autolink=We(Q.autolink).replace("scheme",Q._scheme).replace("email",Q._email).getRegex();Q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;Q.tag=We(Q.tag).replace("comment",Q._comment).replace("attribute",Q._attribute).getRegex();Q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;Q._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;Q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;Q.link=We(Q.link).replace("label",Q._label).replace("href",Q._href).replace("title",Q._title).getRegex();Q.reflink=We(Q.reflink).replace("label",Q._label).replace("ref",ae._label).getRegex();Q.nolink=We(Q.nolink).replace("ref",ae._label).getRegex();Q.reflinkSearch=We(Q.reflinkSearch,"g").replace("reflink",Q.reflink).replace("nolink",Q.nolink).getRegex();Q.normal={...Q};Q.pedantic={...Q.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:We(/^!?\[(label)\]\((.*?)\)/).replace("label",Q._label).getRegex(),reflink:We(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Q._label).getRegex()};Q.gfm={...Q.normal,escape:We(Q.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),t+="&#"+n+";";return t}class ds{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ta,this.options.tokenizer=this.options.tokenizer||new Mx,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={block:ae.normal,inline:Q.normal};this.options.pedantic?(r.block=ae.pedantic,r.inline=Q.pedantic):this.options.gfm&&(r.block=ae.gfm,this.options.breaks?r.inline=Q.breaks:r.inline=Q.gfm),this.tokenizer.rules=r}static get rules(){return{block:ae,inline:Q}}static lex(t,r){return new ds(r).lex(t)}static lexInline(t,r){return new ds(r).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,` `),this.blockTokens(t,this.tokens);let r;for(;r=this.inlineQueue.shift();)this.inlineTokens(r.src,r.tokens);return this.tokens}blockTokens(t,r=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(a,l,c)=>l+" ".repeat(c.length));let n,o,i,s;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(n=a.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length),n.raw.length===1&&r.length>0?r[r.length-1].raw+=` `:r.push(n);continue}if(n=this.tokenizer.code(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=` `+n.raw,o.text+=` @@ -4953,7 +4953,7 @@ Error generating stack: `+i.message+` `+n.raw,o.text+=` `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n),s=i.length!==t.length,t=t.substring(n.raw.length);continue}if(n=this.tokenizer.text(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&o.type==="text"?(o.raw+=` `+n.raw,o.text+=` -`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let n,o,i,s=t,a,l,c;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)u.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+p4("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,a.index)+"["+p4("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(s))!=null;)s=s.slice(0,a.index+a[0].length-2)+"++"+s.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;t;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(n=u.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.escape(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.tag(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(n=this.tokenizer.link(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(n.raw.length),o=r[r.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(n=this.tokenizer.emStrong(t,s,c)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.codespan(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.br(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.del(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.autolink(t,m4)){t=t.substring(n.raw.length),r.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(t,m4))){t=t.substring(n.raw.length),r.push(n);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let u=1/0;const d=t.slice(1);let f;this.options.extensions.startInline.forEach(function(p){f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(i=t.substring(0,u+1))}if(n=this.tokenizer.inlineText(i,ele)){t=t.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(c=n.raw.slice(-1)),l=!0,o=r[r.length-1],o&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(t){const u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return r}}class Mx{constructor(t){this.options=t||Ta}code(t,r,n){const o=(r||"").match(/\S*/)[0];if(this.options.highlight){const i=this.options.highlight(t,o);i!=null&&i!==t&&(n=!0,t=i)}return t=t.replace(/\n$/,"")+` +`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):r.push(n);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let n,o,i,s=t,a,l,c;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)u.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+h4("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,a.index)+"["+h4("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(s))!=null;)s=s.slice(0,a.index+a[0].length-2)+"++"+s.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;t;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(n=u.call({lexer:this},t,r))?(t=t.substring(n.raw.length),r.push(n),!0):!1))){if(n=this.tokenizer.escape(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.tag(t)){t=t.substring(n.raw.length),o=r[r.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(n=this.tokenizer.link(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(n.raw.length),o=r[r.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(n=this.tokenizer.emStrong(t,s,c)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.codespan(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.br(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.del(t)){t=t.substring(n.raw.length),r.push(n);continue}if(n=this.tokenizer.autolink(t,g4)){t=t.substring(n.raw.length),r.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(t,g4))){t=t.substring(n.raw.length),r.push(n);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let u=1/0;const d=t.slice(1);let f;this.options.extensions.startInline.forEach(function(p){f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(i=t.substring(0,u+1))}if(n=this.tokenizer.inlineText(i,tle)){t=t.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(c=n.raw.slice(-1)),l=!0,o=r[r.length-1],o&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):r.push(n);continue}if(t){const u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return r}}class Tx{constructor(t){this.options=t||Ta}code(t,r,n){const o=(r||"").match(/\S*/)[0];if(this.options.highlight){const i=this.options.highlight(t,o);i!=null&&i!==t&&(n=!0,t=i)}return t=t.replace(/\n$/,"")+` `,o?'
    '+(n?t:cr(t,!0))+`
    `:"
    "+(n?t:cr(t,!0))+`
    `}blockquote(t){return`
    @@ -4973,18 +4973,18 @@ ${t}
    `}tablerow(t){return` ${t} `}tablecell(t,r){const n=r.header?"th":"td";return(r.align?`<${n} align="${r.align}">`:`<${n}>`)+t+` -`}strong(t){return`${t}`}em(t){return`${t}`}codespan(t){return`${t}`}br(){return this.options.xhtml?"
    ":"
    "}del(t){return`${t}`}link(t,r,n){if(t=d4(this.options.sanitize,this.options.baseUrl,t),t===null)return n;let o='",o}image(t,r,n){if(t=d4(this.options.sanitize,this.options.baseUrl,t),t===null)return n;let o=`${n}":">",o}text(t){return t}}class LO{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,r,n){return""+n}image(t,r,n){return""+n}br(){return""}}class IO{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,r){let n=t,o=0;if(this.seen.hasOwnProperty(n)){o=this.seen[t];do o++,n=t+"-"+o;while(this.seen.hasOwnProperty(n))}return r||(this.seen[t]=o,this.seen[n]=0),n}slug(t,r={}){const n=this.serialize(t);return this.getNextSafeSlug(n,r.dryrun)}}class fs{constructor(t){this.options=t||Ta,this.options.renderer=this.options.renderer||new Mx,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new LO,this.slugger=new IO}static parse(t,r){return new fs(r).parse(t)}static parseInline(t,r){return new fs(r).parseInline(t)}parse(t,r=!0){let n="",o,i,s,a,l,c,u,d,f,p,h,m,b,v,g,y,x,k,w;const E=t.length;for(o=0;o0&&g.tokens[0].type==="paragraph"?(g.tokens[0].text=k+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&g.tokens[0].tokens[0].type==="text"&&(g.tokens[0].tokens[0].text=k+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:k}):v+=k),v+=this.parse(g.tokens,b),f+=this.renderer.listitem(v,x,y);n+=this.renderer.list(f,h,m);continue}case"html":{n+=this.renderer.html(p.text);continue}case"paragraph":{n+=this.renderer.paragraph(this.parseInline(p.tokens));continue}case"text":{for(f=p.tokens?this.parseInline(p.tokens):p.text;o+1{if(n.message+=` -Please report this to https://github.com/markedjs/marked.`,e){const o="

    An error occurred:

    "+cr(n.message+"",!0)+"
    ";if(t)return Promise.resolve(o);if(r){r(null,o);return}return o}if(t)return Promise.reject(n);if(r){r(n);return}throw n}}function DO(e,t){return(r,n,o)=>{typeof n=="function"&&(o=n,n=null);const i={...n};n={...se.defaults,...i};const s=tle(n.silent,n.async,o);if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(Qae(n),n.hooks&&(n.hooks.options=n),o){const a=n.highlight;let l;try{n.hooks&&(r=n.hooks.preprocess(r)),l=e(r,n)}catch(d){return s(d)}const c=function(d){let f;if(!d)try{n.walkTokens&&se.walkTokens(l,n.walkTokens),f=t(l,n),n.hooks&&(f=n.hooks.postprocess(f))}catch(p){d=p}return n.highlight=a,d?s(d):o(null,f)};if(!a||a.length<3||(delete n.highlight,!l.length))return c();let u=0;se.walkTokens(l,function(d){d.type==="code"&&(u++,setTimeout(()=>{a(d.text,d.lang,function(f,p){if(f)return c(f);p!=null&&p!==d.text&&(d.text=p,d.escaped=!0),u--,u===0&&c()})},0))}),u===0&&c();return}if(n.async)return Promise.resolve(n.hooks?n.hooks.preprocess(r):r).then(a=>e(a,n)).then(a=>n.walkTokens?Promise.all(se.walkTokens(a,n.walkTokens)).then(()=>a):a).then(a=>t(a,n)).then(a=>n.hooks?n.hooks.postprocess(a):a).catch(s);try{n.hooks&&(r=n.hooks.preprocess(r));const a=e(r,n);n.walkTokens&&se.walkTokens(a,n.walkTokens);let l=t(a,n);return n.hooks&&(l=n.hooks.postprocess(l)),l}catch(a){return s(a)}}}function se(e,t,r){return DO(ds.lex,fs.parse)(e,t,r)}se.options=se.setOptions=function(e){return se.defaults={...se.defaults,...e},Hae(se.defaults),se};se.getDefaults=NO;se.defaults=Ta;se.use=function(...e){const t=se.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(r=>{const n={...r};if(n.async=se.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if(o.renderer){const i=t.renderers[o.name];i?t.renderers[o.name]=function(...s){let a=o.renderer.apply(this,s);return a===!1&&(a=i.apply(this,s)),a}:t.renderers[o.name]=o.renderer}if(o.tokenizer){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[o.level]?t[o.level].unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),n.extensions=t),r.renderer){const o=se.defaults.renderer||new Mx;for(const i in r.renderer){const s=o[i];o[i]=(...a)=>{let l=r.renderer[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}n.renderer=o}if(r.tokenizer){const o=se.defaults.tokenizer||new Cx;for(const i in r.tokenizer){const s=o[i];o[i]=(...a)=>{let l=r.tokenizer[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}n.tokenizer=o}if(r.hooks){const o=se.defaults.hooks||new Mh;for(const i in r.hooks){const s=o[i];Mh.passThroughHooks.has(i)?o[i]=a=>{if(se.defaults.async)return Promise.resolve(r.hooks[i].call(o,a)).then(c=>s.call(o,c));const l=r.hooks[i].call(o,a);return s.call(o,l)}:o[i]=(...a)=>{let l=r.hooks[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}n.hooks=o}if(r.walkTokens){const o=se.defaults.walkTokens;n.walkTokens=function(i){let s=[];return s.push(r.walkTokens.call(this,i)),o&&(s=s.concat(o.call(this,i))),s}}se.setOptions(n)})};se.walkTokens=function(e,t){let r=[];for(const n of e)switch(r=r.concat(t.call(se,n)),n.type){case"table":{for(const o of n.header)r=r.concat(se.walkTokens(o.tokens,t));for(const o of n.rows)for(const i of o)r=r.concat(se.walkTokens(i.tokens,t));break}case"list":{r=r.concat(se.walkTokens(n.items,t));break}default:se.defaults.extensions&&se.defaults.extensions.childTokens&&se.defaults.extensions.childTokens[n.type]?se.defaults.extensions.childTokens[n.type].forEach(function(o){r=r.concat(se.walkTokens(n[o],t))}):n.tokens&&(r=r.concat(se.walkTokens(n.tokens,t)))}return r};se.parseInline=DO(ds.lexInline,fs.parseInline);se.Parser=fs;se.parser=fs.parse;se.Renderer=Mx;se.TextRenderer=LO;se.Lexer=ds;se.lexer=ds.lex;se.Tokenizer=Cx;se.Slugger=IO;se.Hooks=Mh;se.parse=se;se.options;se.setOptions;se.use;se.walkTokens;se.parseInline;fs.parse;ds.lex;var rle=Object.defineProperty,nle=Object.getOwnPropertyDescriptor,Xm=(e,t,r,n)=>{for(var o=n>1?void 0:n?nle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&rle(t,r,o),o},ole=Rh(Ed);function ile(e){return ale.turndown(e)}function b1(e){const t=e.parentNode;if(!Je(t))return!1;if(t.nodeName==="THEAD")return!0;if(t.nodeName!=="TABLE"&&!$O(t))return!1;const r=[...e.childNodes];return r.every(n=>n.nodeName==="TH")&&r.some(n=>!!n.textContent)}function Th(e){return Je(e)&&e.matches("th[data-controller-cell]")}function sle(e){const t=e.parentNode;return!Je(t)||t.nodeName!=="TABLE"&&!$O(t)?!1:[...e.childNodes].every(n=>Th(n))}function $O(e){var t;if(e.nodeName!=="TBODY")return!1;const r=e.previousSibling;return r?Je(r)&&r.nodeName==="THEAD"&&!((t=r.textContent)!=null&&t.trim()):!0}function g4(e){const t=e.closest("table");if(!t)return!1;const{parentNode:r}=t;return r?!!r.closest("table"):!0}function v4(e,t){var r;const n=[];for(const s of((r=t.parentNode)==null?void 0:r.childNodes)??[])Th(s)||n.push(s);return`${(n.indexOf(t)===0?"| ":" ")+e.trim()} |`}var ale=new ole({codeBlockStyle:"fenced",headingStyle:"atx"}).addRule("taskListItems",{filter:e=>e.nodeName==="LI"&&e.hasAttribute("data-task-list-item"),replacement:(e,t)=>`- ${t.hasAttribute("data-checked")?"[x]":"[ ]"} ${e.trimStart()}`}).addRule("tableCell",{filter:["th","td"],replacement:(e,t)=>Th(t)?"":v4(e,t)}).addRule("tableRow",{filter:"tr",replacement:(e,t)=>{let r="";const n={left:":--",right:"--:",center:":-:"},o=[...t.childNodes].filter(i=>!Th(i));if(b1(t))for(const i of o){if(!Je(i))continue;let s="---";const a=(i.getAttribute("align")??"").toLowerCase();a&&(s=n[a]||s),r+=v4(s,i)}return` +`}strong(t){return`${t}`}em(t){return`${t}`}codespan(t){return`${t}`}br(){return this.options.xhtml?"
    ":"
    "}del(t){return`${t}`}link(t,r,n){if(t=f4(this.options.sanitize,this.options.baseUrl,t),t===null)return n;let o='
    ",o}image(t,r,n){if(t=f4(this.options.sanitize,this.options.baseUrl,t),t===null)return n;let o=`${n}":">",o}text(t){return t}}class IO{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,r,n){return""+n}image(t,r,n){return""+n}br(){return""}}class DO{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,r){let n=t,o=0;if(this.seen.hasOwnProperty(n)){o=this.seen[t];do o++,n=t+"-"+o;while(this.seen.hasOwnProperty(n))}return r||(this.seen[t]=o,this.seen[n]=0),n}slug(t,r={}){const n=this.serialize(t);return this.getNextSafeSlug(n,r.dryrun)}}class fs{constructor(t){this.options=t||Ta,this.options.renderer=this.options.renderer||new Tx,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new IO,this.slugger=new DO}static parse(t,r){return new fs(r).parse(t)}static parseInline(t,r){return new fs(r).parseInline(t)}parse(t,r=!0){let n="",o,i,s,a,l,c,u,d,f,p,h,m,b,v,g,y,x,k,w;const E=t.length;for(o=0;o0&&g.tokens[0].type==="paragraph"?(g.tokens[0].text=k+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&g.tokens[0].tokens[0].type==="text"&&(g.tokens[0].tokens[0].text=k+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:k}):v+=k),v+=this.parse(g.tokens,b),f+=this.renderer.listitem(v,x,y);n+=this.renderer.list(f,h,m);continue}case"html":{n+=this.renderer.html(p.text);continue}case"paragraph":{n+=this.renderer.paragraph(this.parseInline(p.tokens));continue}case"text":{for(f=p.tokens?this.parseInline(p.tokens):p.text;o+1{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,e){const o="

    An error occurred:

    "+cr(n.message+"",!0)+"
    ";if(t)return Promise.resolve(o);if(r){r(null,o);return}return o}if(t)return Promise.reject(n);if(r){r(n);return}throw n}}function $O(e,t){return(r,n,o)=>{typeof n=="function"&&(o=n,n=null);const i={...n};n={...se.defaults,...i};const s=rle(n.silent,n.async,o);if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(Zae(n),n.hooks&&(n.hooks.options=n),o){const a=n.highlight;let l;try{n.hooks&&(r=n.hooks.preprocess(r)),l=e(r,n)}catch(d){return s(d)}const c=function(d){let f;if(!d)try{n.walkTokens&&se.walkTokens(l,n.walkTokens),f=t(l,n),n.hooks&&(f=n.hooks.postprocess(f))}catch(p){d=p}return n.highlight=a,d?s(d):o(null,f)};if(!a||a.length<3||(delete n.highlight,!l.length))return c();let u=0;se.walkTokens(l,function(d){d.type==="code"&&(u++,setTimeout(()=>{a(d.text,d.lang,function(f,p){if(f)return c(f);p!=null&&p!==d.text&&(d.text=p,d.escaped=!0),u--,u===0&&c()})},0))}),u===0&&c();return}if(n.async)return Promise.resolve(n.hooks?n.hooks.preprocess(r):r).then(a=>e(a,n)).then(a=>n.walkTokens?Promise.all(se.walkTokens(a,n.walkTokens)).then(()=>a):a).then(a=>t(a,n)).then(a=>n.hooks?n.hooks.postprocess(a):a).catch(s);try{n.hooks&&(r=n.hooks.preprocess(r));const a=e(r,n);n.walkTokens&&se.walkTokens(a,n.walkTokens);let l=t(a,n);return n.hooks&&(l=n.hooks.postprocess(l)),l}catch(a){return s(a)}}}function se(e,t,r){return $O(ds.lex,fs.parse)(e,t,r)}se.options=se.setOptions=function(e){return se.defaults={...se.defaults,...e},Bae(se.defaults),se};se.getDefaults=RO;se.defaults=Ta;se.use=function(...e){const t=se.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(r=>{const n={...r};if(n.async=se.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if(o.renderer){const i=t.renderers[o.name];i?t.renderers[o.name]=function(...s){let a=o.renderer.apply(this,s);return a===!1&&(a=i.apply(this,s)),a}:t.renderers[o.name]=o.renderer}if(o.tokenizer){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[o.level]?t[o.level].unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),n.extensions=t),r.renderer){const o=se.defaults.renderer||new Tx;for(const i in r.renderer){const s=o[i];o[i]=(...a)=>{let l=r.renderer[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}n.renderer=o}if(r.tokenizer){const o=se.defaults.tokenizer||new Mx;for(const i in r.tokenizer){const s=o[i];o[i]=(...a)=>{let l=r.tokenizer[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}n.tokenizer=o}if(r.hooks){const o=se.defaults.hooks||new Th;for(const i in r.hooks){const s=o[i];Th.passThroughHooks.has(i)?o[i]=a=>{if(se.defaults.async)return Promise.resolve(r.hooks[i].call(o,a)).then(c=>s.call(o,c));const l=r.hooks[i].call(o,a);return s.call(o,l)}:o[i]=(...a)=>{let l=r.hooks[i].apply(o,a);return l===!1&&(l=s.apply(o,a)),l}}n.hooks=o}if(r.walkTokens){const o=se.defaults.walkTokens;n.walkTokens=function(i){let s=[];return s.push(r.walkTokens.call(this,i)),o&&(s=s.concat(o.call(this,i))),s}}se.setOptions(n)})};se.walkTokens=function(e,t){let r=[];for(const n of e)switch(r=r.concat(t.call(se,n)),n.type){case"table":{for(const o of n.header)r=r.concat(se.walkTokens(o.tokens,t));for(const o of n.rows)for(const i of o)r=r.concat(se.walkTokens(i.tokens,t));break}case"list":{r=r.concat(se.walkTokens(n.items,t));break}default:se.defaults.extensions&&se.defaults.extensions.childTokens&&se.defaults.extensions.childTokens[n.type]?se.defaults.extensions.childTokens[n.type].forEach(function(o){r=r.concat(se.walkTokens(n[o],t))}):n.tokens&&(r=r.concat(se.walkTokens(n.tokens,t)))}return r};se.parseInline=$O(ds.lexInline,fs.parseInline);se.Parser=fs;se.parser=fs.parse;se.Renderer=Tx;se.TextRenderer=IO;se.Lexer=ds;se.lexer=ds.lex;se.Tokenizer=Mx;se.Slugger=DO;se.Hooks=Th;se.parse=se;se.options;se.setOptions;se.use;se.walkTokens;se.parseInline;fs.parse;ds.lex;var nle=Object.defineProperty,ole=Object.getOwnPropertyDescriptor,Qm=(e,t,r,n)=>{for(var o=n>1?void 0:n?ole(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&nle(t,r,o),o},ile=Ph(Ed);function sle(e){return lle.turndown(e)}function x1(e){const t=e.parentNode;if(!et(t))return!1;if(t.nodeName==="THEAD")return!0;if(t.nodeName!=="TABLE"&&!HO(t))return!1;const r=[...e.childNodes];return r.every(n=>n.nodeName==="TH")&&r.some(n=>!!n.textContent)}function Oh(e){return et(e)&&e.matches("th[data-controller-cell]")}function ale(e){const t=e.parentNode;return!et(t)||t.nodeName!=="TABLE"&&!HO(t)?!1:[...e.childNodes].every(n=>Oh(n))}function HO(e){var t;if(e.nodeName!=="TBODY")return!1;const r=e.previousSibling;return r?et(r)&&r.nodeName==="THEAD"&&!((t=r.textContent)!=null&&t.trim()):!0}function v4(e){const t=e.closest("table");if(!t)return!1;const{parentNode:r}=t;return r?!!r.closest("table"):!0}function y4(e,t){var r;const n=[];for(const s of((r=t.parentNode)==null?void 0:r.childNodes)??[])Oh(s)||n.push(s);return`${(n.indexOf(t)===0?"| ":" ")+e.trim()} |`}var lle=new ile({codeBlockStyle:"fenced",headingStyle:"atx"}).addRule("taskListItems",{filter:e=>e.nodeName==="LI"&&e.hasAttribute("data-task-list-item"),replacement:(e,t)=>`- ${t.hasAttribute("data-checked")?"[x]":"[ ]"} ${e.trimStart()}`}).addRule("tableCell",{filter:["th","td"],replacement:(e,t)=>Oh(t)?"":y4(e,t)}).addRule("tableRow",{filter:"tr",replacement:(e,t)=>{let r="";const n={left:":--",right:"--:",center:":-:"},o=[...t.childNodes].filter(i=>!Oh(i));if(x1(t))for(const i of o){if(!et(i))continue;let s="---";const a=(i.getAttribute("align")??"").toLowerCase();a&&(s=n[a]||s),r+=y4(s,i)}return` ${e}${r?` -${r}`:""}`}}).addRule("table",{filter:e=>{if(e.nodeName!=="TABLE"||g4(e))return!1;const t=[...e.rows].filter(r=>!sle(r));return b1(t[0])},replacement:e=>(e=e.replace(` +${r}`:""}`}}).addRule("table",{filter:e=>{if(e.nodeName!=="TABLE"||v4(e))return!1;const t=[...e.rows].filter(r=>!ale(r));return x1(t[0])},replacement:e=>(e=e.replace(` `,` `),` ${e} -`)}).addRule("tableSection",{filter:["thead","tbody","tfoot"],replacement:function(e){return e}}).keep(e=>e.nodeName==="TABLE"&&!b1(e.rows[0])).keep(e=>e.nodeName==="TABLE"&&g4(e)).addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return`~${e}~`}}).addRule("fencedCodeBlock",{filter:(e,t)=>!!(t.codeBlockStyle==="fenced"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"),replacement:(e,t,r)=>{var n,o;te(Je(t.firstChild),{code:H.EXTENSION,message:`Invalid node \`${(n=t.firstChild)==null?void 0:n.nodeName}\` encountered for codeblock when converting html to markdown.`});const s=((o=(t.firstChild.getAttribute("class")??"").match(/(?:lang|language)-(\S+)/))==null?void 0:o[1])??t.firstChild.getAttribute("data-code-block-language")??"";return` +`)}).addRule("tableSection",{filter:["thead","tbody","tfoot"],replacement:function(e){return e}}).keep(e=>e.nodeName==="TABLE"&&!x1(e.rows[0])).keep(e=>e.nodeName==="TABLE"&&v4(e)).addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return`~${e}~`}}).addRule("fencedCodeBlock",{filter:(e,t)=>!!(t.codeBlockStyle==="fenced"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"),replacement:(e,t,r)=>{var n,o;re(et(t.firstChild),{code:B.EXTENSION,message:`Invalid node \`${(n=t.firstChild)==null?void 0:n.nodeName}\` encountered for codeblock when converting html to markdown.`});const s=((o=(t.firstChild.getAttribute("class")??"").match(/(?:lang|language)-(\S+)/))==null?void 0:o[1])??t.firstChild.getAttribute("data-code-block-language")??"";return` ${r.fence}${s} ${t.firstChild.textContent} @@ -4996,20 +4996,20 @@ ${e} ${e} `},listitem(e,t,r){return t?`
  • ${e}
  • `:`
  • ${e}
  • -`}}});function lle(e,t){return se(e,{gfm:!0,smartLists:!0,xhtml:!0,sanitizer:t})}function cle(e){te(typeof document,{code:H.EXTENSION,message:"Attempting to sanitize html within a non-browser environment. Please provide your own `sanitizeHtml` method to the `MarkdownExtension`."});const t=new DOMParser().parseFromString(`${e}`,"text/html");return t.normalize(),HO(t.body),t.body.innerHTML}function HO(e){if(!Q6(e)){if(!Je(e)||/^(script|iframe|object|embed|svg)$/i.test(e.tagName))return e==null?void 0:e.remove();for(const{name:t}of e.attributes)/^(class|id|name|href|src|alt|align|valign)$/i.test(t)||e.attributes.removeNamedItem(t);for(const t of e.childNodes)HO(t)}}var Zl=class extends Ve{get name(){return"markdown"}onCreate(){this.store.setStringHandler("markdown",this.markdownToProsemirrorNode.bind(this))}createPlugin(){return{props:{clipboardTextSerializer:this.options.copyAsMarkdown?t=>{const r=document.createElement("div"),n=an.fromSchema(this.store.schema);return r.append(n.serializeFragment(t.content)),this.options.htmlToMarkdown(r.innerHTML)}:void 0}}}markdownToProsemirrorNode(e){return this.store.stringHandlers.html({...e,content:this.options.markdownToHtml(e.content,this.options.htmlSanitizer)})}insertMarkdown(e,t){return r=>{const{state:n}=r;let o=this.options.markdownToHtml(e,this.options.htmlSanitizer);o=!(t!=null&&t.alwaysWrapInBlock)&&o.startsWith("

    <")&&o.endsWith(`

    -`)?o.slice(3,-5):`
    ${o}
    `;const i=this.store.stringHandlers.html({content:o,schema:n.schema,fragment:!0});return this.store.commands.insertNode.original(i,{...t,replaceEmptyParentBlock:!0})(r)}}getMarkdown(e){return this.options.htmlToMarkdown(this.store.helpers.getHTML(e))}toggleBoldMarkdown(){return e=>!1}};Xm([U()],Zl.prototype,"insertMarkdown",1);Xm([He()],Zl.prototype,"getMarkdown",1);Xm([U()],Zl.prototype,"toggleBoldMarkdown",1);Zl=Xm([pe({defaultOptions:{htmlToMarkdown:ile,markdownToHtml:lle,htmlSanitizer:cle,activeNodes:[oe.Code],copyAsMarkdown:!1},staticKeys:["htmlToMarkdown","markdownToHtml","htmlSanitizer"]})],Zl);var ule=Object.defineProperty,dle=Object.getOwnPropertyDescriptor,mr=(e,t,r,n)=>{for(var o=n>1?void 0:n?dle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&ule(t,r,o),o},fle={label:({t:e})=>e(nc.INCREASE_INDENT_LABEL),icon:"indentIncrease"},ple={label:({t:e})=>e(nc.DECREASE_INDENT_LABEL),icon:"indentDecrease"},hle={label:({t:e})=>e(nc.CENTER_ALIGN_LABEL),icon:"alignCenter",active:Qm(({node:e})=>e.attrs.nodeTextAlignment==="center")},mle={label:({t:e})=>e(nc.JUSTIFY_ALIGN_LABEL),icon:"alignJustify",active:Qm(({node:e})=>e.attrs.nodeTextAlignment==="justify")},gle={label:({t:e})=>e(nc.RIGHT_ALIGN_LABEL),icon:"alignRight",active:Qm(({node:e})=>e.attrs.nodeTextAlignment==="right")},vle={label:({t:e})=>e(nc.LEFT_ALIGN_LABEL),icon:"alignLeft",active:Qm(({node:e})=>{const{nodeTextAlignment:t}=e.attrs;return t==="left"||t===""})};function Qm(e){return({excludeNodes:t},r)=>{const{getState:n,nodeTags:o}=r;return BO(n(),o.formattingNode,t).some(e)}}function y4(e,t,r){return r.includes(e.name)?!1:t.includes(e.name)}function BO(e,t,r){const n=[],{$from:o,$to:i}=e.selection,s=o.blockRange(i);if(!s)return[];const{parent:a,start:l,end:c}=s;return a.nodeSize-2===c-l&&y4(a.type,t,r)?[{node:a,pos:l-1}]:(e.doc.nodesBetween(l,c,(d,f)=>{if(!(fc)&&y4(d.type,t,r))return n.push({node:d,pos:f}),!1}),n)}var b4="data-node-indent",x4="data-node-text-align",k4="data-line-height-align";function yle(e,t){const r=Qs(Q4(e)),n=Qs(t??"0"),o=e.length??1,i=r/o;return Ad({max:o,min:0,value:Math.floor(n/i)})}var ble=/^\d+(?:\.\d+)?$/,xle=/^(\d+(?:\.\d+)?)%$/;function w4(e){if(Jt(e))return e;if(!e)return null;const t=e.trim(),r=t.match(xle);if(r)return Number.parseFloat(r[1])/100;const n=t.match(ble);return n?Number.parseFloat(n[0]):null}var Ft=class extends Ve{get name(){return"nodeFormatting"}createSchemaAttributes(){return[{identifiers:{type:"node",tags:[oe.FormattingNode],excludeNames:this.options.excludeNodes},attributes:{nodeIndent:this.nodeIndent(),nodeTextAlignment:this.nodeTextAlignment(),nodeLineHeight:this.nodeLineHeight(),style:{default:"",parseDOM:()=>"",toDOM:({nodeIndent:e,nodeTextAlignment:t,nodeLineHeight:r,style:n})=>{const o=e?this.options.indents[e]:void 0;return{style:qv({marginLeft:o,textAlign:t&&t!=="none"?t:void 0,lineHeight:r||void 0},n)}}}}}]}setLineHeight(e){return this.setNodeAttribute(({node:t})=>{if(e!==t.attrs.nodeLineHeight)return{nodeLineHeight:e}})}setTextAlignment(e){return this.setNodeAttribute(({node:t})=>{if(e!==t.attrs.nodeTextAlignment)return{nodeTextAlignment:e}})}setIndent(e){return this.setNodeAttribute(({node:t})=>{const r=t.attrs.nodeIndent??0,n=e==="-1"?r-1:e==="+1"?r+1:e,o=Ad({min:0,max:this.options.indents.length-1,value:n});if(o!==r)return{nodeIndent:o}})}centerAlign(){return this.setTextAlignment("center")}justifyAlign(){return this.setTextAlignment("justify")}leftAlign(){return this.setTextAlignment("left")}rightAlign(){return this.setTextAlignment("right")}increaseIndent(){return e=>this.setIndent("+1")(e)}decreaseIndent(){return e=>this.setIndent("-1")(e)}centerAlignShortcut(e){return this.centerAlign()(e)}justifyAlignShortcut(e){return this.justifyAlign()(e)}leftAlignShortcut(e){return this.leftAlign()(e)}rightAlignShortcut(e){return this.rightAlign()(e)}increaseIndentShortcut(e){return this.increaseIndent()(e)}decreaseIndentShortcut(e){return this.decreaseIndent()(e)}nodeIndent(){return{default:null,parseDOM:e=>e.getAttribute(b4)??yle(this.options.indents,e.style.marginLeft),toDOM:e=>{if(!e.nodeIndent)return;const t=`${e.nodeIndent}`;if(this.options.indents[e.nodeIndent])return{[b4]:t}}}}nodeTextAlignment(){return{default:null,parseDOM:e=>e.getAttribute(x4)??e.style.textAlign,toDOM:e=>{const t=e.nodeTextAlignment;if(!(!t||t==="none"))return{[x4]:t}}}}nodeLineHeight(){return{default:null,parseDOM:e=>{const t=e.getAttribute(k4);return w4(t)??w4(e.style.lineHeight)},toDOM:e=>{const t=e.nodeLineHeight;if(t)return{[k4]:t.toString()}}}}setNodeAttribute(e){return t=>{const{tr:r,dispatch:n}=t,o=BO(r,this.store.nodeTags.formattingNode,this.options.excludeNodes);if(Mo(o))return!1;if(!n)return!0;const i=[];for(const s of o){const{node:a,pos:l}=s,c=e(s);c&&i.push([l,{...a.attrs,...c}])}if(Mo(i))return!1;if(!n)return!0;for(const[s,a]of i)r.setNodeMarkup(s,void 0,a);return n(r),!0}}};mr([U()],Ft.prototype,"setLineHeight",1);mr([U()],Ft.prototype,"setTextAlignment",1);mr([U()],Ft.prototype,"setIndent",1);mr([U(hle)],Ft.prototype,"centerAlign",1);mr([U(mle)],Ft.prototype,"justifyAlign",1);mr([U(vle)],Ft.prototype,"leftAlign",1);mr([U(gle)],Ft.prototype,"rightAlign",1);mr([U(fle)],Ft.prototype,"increaseIndent",1);mr([U(ple)],Ft.prototype,"decreaseIndent",1);mr([je({shortcut:D.CenterAlignment,command:"centerAlign"})],Ft.prototype,"centerAlignShortcut",1);mr([je({shortcut:D.JustifyAlignment,command:"justifyAlign"})],Ft.prototype,"justifyAlignShortcut",1);mr([je({shortcut:D.LeftAlignment,command:"leftAlign"})],Ft.prototype,"leftAlignShortcut",1);mr([je({shortcut:D.RightAlignment,command:"rightAlign"})],Ft.prototype,"rightAlignShortcut",1);mr([je({shortcut:D.IncreaseIndent,command:"increaseIndent",priority:Ae.Low})],Ft.prototype,"increaseIndentShortcut",1);mr([je({shortcut:D.DecreaseIndent,command:"decreaseIndent",priority:Ae.Medium})],Ft.prototype,"decreaseIndentShortcut",1);Ft=mr([pe({defaultOptions:{indents:["0","20px","40px","60px","80px","100px","120px","140px","160px","180px","200px"],excludeNodes:[]},staticKeys:["indents"]})],Ft);var kle=Object.defineProperty,wle=Object.getOwnPropertyDescriptor,Tx=(e,t,r,n)=>{for(var o=n>1?void 0:n?wle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&kle(t,r,o),o},Sle={icon:"strikethrough",label:({t:e})=>e(bk.LABEL),description:({t:e})=>e(bk.DESCRIPTION)},Cd=class extends li{get name(){return"strike"}createTags(){return[oe.FontStyle,oe.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"s",getAttrs:e.parse},{tag:"del",getAttrs:e.parse},{tag:"strike",getAttrs:e.parse},{style:"text-decoration",getAttrs:r=>r==="line-through"?{}:!1},...t.parseDOM??[]],toDOM:r=>["s",e.dom(r),0]}}toggleStrike(){return ns({type:this.type})}shortcut(e){return this.toggleStrike()(e)}createInputRules(){return[Vu({regexp:/~([^~]+)~$/,type:this.type,ignoreWhitespace:!0})]}createPasteRules(){return[{regexp:/~([^~]+)~/g,type:"mark",markType:this.type}]}};Tx([U(Sle)],Cd.prototype,"toggleStrike",1);Tx([je({shortcut:D.Strike,command:"toggleStrike"})],Cd.prototype,"shortcut",1);Cd=Tx([pe({})],Cd);var S4=new ka("trailingNode");function Ele(e){const{ignoredNodes:t=[],nodeName:r="paragraph"}=e??{},n=Ml([...t,r]);let o,i;return new Ro({key:S4,appendTransaction(s,a,l){const{doc:c,tr:u}=l,d=S4.getState(l),f=c.content.size;if(d)return u.insert(f,o.create())},state:{init:(s,{doc:a,schema:l})=>{var c;const u=l.nodes[r];if(!u)throw new Error(`Invalid node being used for trailing node extension: '${r}'`);return o=u,i=Object.values(l.nodes).map(d=>d).filter(d=>!n.includes(d.name)),fr(i,(c=a.lastChild)==null?void 0:c.type)},apply:(s,a)=>{var l;return s.docChanged?fr(i,(l=s.doc.lastChild)==null?void 0:l.type):a}}})}var Cle=Object.defineProperty,Mle=Object.getOwnPropertyDescriptor,Tle=(e,t,r,n)=>{for(var o=n>1?void 0:n?Mle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Cle(t,r,o),o},mv=class extends Ve{get name(){return"trailingNode"}onSetOptions(e){const{changes:t}=e;(t.disableTags.changed||t.ignoredNodes.changed||t.nodeName.changed)&&this.store.updateExtensionPlugins(this)}createExternalPlugins(){const{tags:e}=this.store,{disableTags:t,nodeName:r}=this.options,n=t?[...this.options.ignoredNodes]:[...this.options.ignoredNodes,...e.lastNodeCompatible];return[Ele({ignoredNodes:n,nodeName:r})]}};mv=Tle([pe({defaultOptions:{ignoredNodes:[],disableTags:!1,nodeName:"paragraph"}})],mv);var Ole=Object.defineProperty,_le=Object.getOwnPropertyDescriptor,Ox=(e,t,r,n)=>{for(var o=n>1?void 0:n?_le(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ole(t,r,o),o},Ale={icon:"underline",label:({t:e})=>e(xk.LABEL),description:({t:e})=>e(xk.DESCRIPTION)},Md=class extends li{get name(){return"underline"}createTags(){return[oe.FontStyle,oe.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"u",getAttrs:e.parse},{style:"text-decoration",getAttrs:r=>r==="underline"?{}:!1},...t.parseDOM??[]],toDOM:r=>["u",e.dom(r),0]}}toggleUnderline(e){return ns({type:this.type,selection:e})}shortcut(e){return this.toggleUnderline()(e)}};Ox([U(Ale)],Md.prototype,"toggleUnderline",1);Ox([je({shortcut:D.Underline,command:"toggleUnderline"})],Md.prototype,"shortcut",1);Md=Ox([pe({})],Md);const E4={};function Nle(e){if(E4[e])return;const t=document.createElement("style"),r=Rle(e)/1e4,n=Ple({h:Math.abs(r),s:.6,v:.6}),o=zle(n);t.type="text/css",t.textContent=` - .remirror-editor-wrapper .__editor_${e}::before { +`}}});function cle(e,t){return se(e,{gfm:!0,smartLists:!0,xhtml:!0,sanitizer:t})}function ule(e){re(typeof document,{code:B.EXTENSION,message:"Attempting to sanitize html within a non-browser environment. Please provide your own `sanitizeHtml` method to the `MarkdownExtension`."});const t=new DOMParser().parseFromString(`${e}`,"text/html");return t.normalize(),BO(t.body),t.body.innerHTML}function BO(e){if(!Z6(e)){if(!et(e)||/^(script|iframe|object|embed|svg)$/i.test(e.tagName))return e==null?void 0:e.remove();for(const{name:t}of e.attributes)/^(class|id|name|href|src|alt|align|valign)$/i.test(t)||e.attributes.removeNamedItem(t);for(const t of e.childNodes)BO(t)}}var Zl=class extends Ve{get name(){return"markdown"}onCreate(){this.store.setStringHandler("markdown",this.markdownToProsemirrorNode.bind(this))}createPlugin(){return{props:{clipboardTextSerializer:this.options.copyAsMarkdown?t=>{const r=document.createElement("div"),n=an.fromSchema(this.store.schema);return r.append(n.serializeFragment(t.content)),this.options.htmlToMarkdown(r.innerHTML)}:void 0}}}markdownToProsemirrorNode(e){return this.store.stringHandlers.html({...e,content:this.options.markdownToHtml(e.content,this.options.htmlSanitizer)})}insertMarkdown(e,t){return r=>{const{state:n}=r;let o=this.options.markdownToHtml(e,this.options.htmlSanitizer);o=!(t!=null&&t.alwaysWrapInBlock)&&o.startsWith("

    <")&&o.endsWith(`

    +`)?o.slice(3,-5):`
    ${o}
    `;const i=this.store.stringHandlers.html({content:o,schema:n.schema,fragment:!0});return this.store.commands.insertNode.original(i,{...t,replaceEmptyParentBlock:!0})(r)}}getMarkdown(e){return this.options.htmlToMarkdown(this.store.helpers.getHTML(e))}toggleBoldMarkdown(){return e=>!1}};Qm([U()],Zl.prototype,"insertMarkdown",1);Qm([He()],Zl.prototype,"getMarkdown",1);Qm([U()],Zl.prototype,"toggleBoldMarkdown",1);Zl=Qm([pe({defaultOptions:{htmlToMarkdown:sle,markdownToHtml:cle,htmlSanitizer:ule,activeNodes:[te.Code],copyAsMarkdown:!1},staticKeys:["htmlToMarkdown","markdownToHtml","htmlSanitizer"]})],Zl);var dle=Object.defineProperty,fle=Object.getOwnPropertyDescriptor,mr=(e,t,r,n)=>{for(var o=n>1?void 0:n?fle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&dle(t,r,o),o},ple={label:({t:e})=>e(nc.INCREASE_INDENT_LABEL),icon:"indentIncrease"},hle={label:({t:e})=>e(nc.DECREASE_INDENT_LABEL),icon:"indentDecrease"},mle={label:({t:e})=>e(nc.CENTER_ALIGN_LABEL),icon:"alignCenter",active:Zm(({node:e})=>e.attrs.nodeTextAlignment==="center")},gle={label:({t:e})=>e(nc.JUSTIFY_ALIGN_LABEL),icon:"alignJustify",active:Zm(({node:e})=>e.attrs.nodeTextAlignment==="justify")},vle={label:({t:e})=>e(nc.RIGHT_ALIGN_LABEL),icon:"alignRight",active:Zm(({node:e})=>e.attrs.nodeTextAlignment==="right")},yle={label:({t:e})=>e(nc.LEFT_ALIGN_LABEL),icon:"alignLeft",active:Zm(({node:e})=>{const{nodeTextAlignment:t}=e.attrs;return t==="left"||t===""})};function Zm(e){return({excludeNodes:t},r)=>{const{getState:n,nodeTags:o}=r;return FO(n(),o.formattingNode,t).some(e)}}function b4(e,t,r){return r.includes(e.name)?!1:t.includes(e.name)}function FO(e,t,r){const n=[],{$from:o,$to:i}=e.selection,s=o.blockRange(i);if(!s)return[];const{parent:a,start:l,end:c}=s;return a.nodeSize-2===c-l&&b4(a.type,t,r)?[{node:a,pos:l-1}]:(e.doc.nodesBetween(l,c,(d,f)=>{if(!(fc)&&b4(d.type,t,r))return n.push({node:d,pos:f}),!1}),n)}var x4="data-node-indent",k4="data-node-text-align",w4="data-line-height-align";function ble(e,t){const r=Xs(Z4(e)),n=Xs(t??"0"),o=e.length??1,i=r/o;return Ad({max:o,min:0,value:Math.floor(n/i)})}var xle=/^\d+(?:\.\d+)?$/,kle=/^(\d+(?:\.\d+)?)%$/;function S4(e){if(Jt(e))return e;if(!e)return null;const t=e.trim(),r=t.match(kle);if(r)return Number.parseFloat(r[1])/100;const n=t.match(xle);return n?Number.parseFloat(n[0]):null}var Ft=class extends Ve{get name(){return"nodeFormatting"}createSchemaAttributes(){return[{identifiers:{type:"node",tags:[te.FormattingNode],excludeNames:this.options.excludeNodes},attributes:{nodeIndent:this.nodeIndent(),nodeTextAlignment:this.nodeTextAlignment(),nodeLineHeight:this.nodeLineHeight(),style:{default:"",parseDOM:()=>"",toDOM:({nodeIndent:e,nodeTextAlignment:t,nodeLineHeight:r,style:n})=>{const o=e?this.options.indents[e]:void 0;return{style:Gv({marginLeft:o,textAlign:t&&t!=="none"?t:void 0,lineHeight:r||void 0},n)}}}}}]}setLineHeight(e){return this.setNodeAttribute(({node:t})=>{if(e!==t.attrs.nodeLineHeight)return{nodeLineHeight:e}})}setTextAlignment(e){return this.setNodeAttribute(({node:t})=>{if(e!==t.attrs.nodeTextAlignment)return{nodeTextAlignment:e}})}setIndent(e){return this.setNodeAttribute(({node:t})=>{const r=t.attrs.nodeIndent??0,n=e==="-1"?r-1:e==="+1"?r+1:e,o=Ad({min:0,max:this.options.indents.length-1,value:n});if(o!==r)return{nodeIndent:o}})}centerAlign(){return this.setTextAlignment("center")}justifyAlign(){return this.setTextAlignment("justify")}leftAlign(){return this.setTextAlignment("left")}rightAlign(){return this.setTextAlignment("right")}increaseIndent(){return e=>this.setIndent("+1")(e)}decreaseIndent(){return e=>this.setIndent("-1")(e)}centerAlignShortcut(e){return this.centerAlign()(e)}justifyAlignShortcut(e){return this.justifyAlign()(e)}leftAlignShortcut(e){return this.leftAlign()(e)}rightAlignShortcut(e){return this.rightAlign()(e)}increaseIndentShortcut(e){return this.increaseIndent()(e)}decreaseIndentShortcut(e){return this.decreaseIndent()(e)}nodeIndent(){return{default:null,parseDOM:e=>e.getAttribute(x4)??ble(this.options.indents,e.style.marginLeft),toDOM:e=>{if(!e.nodeIndent)return;const t=`${e.nodeIndent}`;if(this.options.indents[e.nodeIndent])return{[x4]:t}}}}nodeTextAlignment(){return{default:null,parseDOM:e=>e.getAttribute(k4)??e.style.textAlign,toDOM:e=>{const t=e.nodeTextAlignment;if(!(!t||t==="none"))return{[k4]:t}}}}nodeLineHeight(){return{default:null,parseDOM:e=>{const t=e.getAttribute(w4);return S4(t)??S4(e.style.lineHeight)},toDOM:e=>{const t=e.nodeLineHeight;if(t)return{[w4]:t.toString()}}}}setNodeAttribute(e){return t=>{const{tr:r,dispatch:n}=t,o=FO(r,this.store.nodeTags.formattingNode,this.options.excludeNodes);if(Mo(o))return!1;if(!n)return!0;const i=[];for(const s of o){const{node:a,pos:l}=s,c=e(s);c&&i.push([l,{...a.attrs,...c}])}if(Mo(i))return!1;if(!n)return!0;for(const[s,a]of i)r.setNodeMarkup(s,void 0,a);return n(r),!0}}};mr([U()],Ft.prototype,"setLineHeight",1);mr([U()],Ft.prototype,"setTextAlignment",1);mr([U()],Ft.prototype,"setIndent",1);mr([U(mle)],Ft.prototype,"centerAlign",1);mr([U(gle)],Ft.prototype,"justifyAlign",1);mr([U(yle)],Ft.prototype,"leftAlign",1);mr([U(vle)],Ft.prototype,"rightAlign",1);mr([U(ple)],Ft.prototype,"increaseIndent",1);mr([U(hle)],Ft.prototype,"decreaseIndent",1);mr([je({shortcut:$.CenterAlignment,command:"centerAlign"})],Ft.prototype,"centerAlignShortcut",1);mr([je({shortcut:$.JustifyAlignment,command:"justifyAlign"})],Ft.prototype,"justifyAlignShortcut",1);mr([je({shortcut:$.LeftAlignment,command:"leftAlign"})],Ft.prototype,"leftAlignShortcut",1);mr([je({shortcut:$.RightAlignment,command:"rightAlign"})],Ft.prototype,"rightAlignShortcut",1);mr([je({shortcut:$.IncreaseIndent,command:"increaseIndent",priority:Ae.Low})],Ft.prototype,"increaseIndentShortcut",1);mr([je({shortcut:$.DecreaseIndent,command:"decreaseIndent",priority:Ae.Medium})],Ft.prototype,"decreaseIndentShortcut",1);Ft=mr([pe({defaultOptions:{indents:["0","20px","40px","60px","80px","100px","120px","140px","160px","180px","200px"],excludeNodes:[]},staticKeys:["indents"]})],Ft);var wle=Object.defineProperty,Sle=Object.getOwnPropertyDescriptor,Ox=(e,t,r,n)=>{for(var o=n>1?void 0:n?Sle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&wle(t,r,o),o},Ele={icon:"strikethrough",label:({t:e})=>e(xk.LABEL),description:({t:e})=>e(xk.DESCRIPTION)},Cd=class extends ci{get name(){return"strike"}createTags(){return[te.FontStyle,te.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"s",getAttrs:e.parse},{tag:"del",getAttrs:e.parse},{tag:"strike",getAttrs:e.parse},{style:"text-decoration",getAttrs:r=>r==="line-through"?{}:!1},...t.parseDOM??[]],toDOM:r=>["s",e.dom(r),0]}}toggleStrike(){return is({type:this.type})}shortcut(e){return this.toggleStrike()(e)}createInputRules(){return[Vu({regexp:/~([^~]+)~$/,type:this.type,ignoreWhitespace:!0})]}createPasteRules(){return[{regexp:/~([^~]+)~/g,type:"mark",markType:this.type}]}};Ox([U(Ele)],Cd.prototype,"toggleStrike",1);Ox([je({shortcut:$.Strike,command:"toggleStrike"})],Cd.prototype,"shortcut",1);Cd=Ox([pe({})],Cd);var E4=new ka("trailingNode");function Cle(e){const{ignoredNodes:t=[],nodeName:r="paragraph"}=e??{},n=Ml([...t,r]);let o,i;return new Ro({key:E4,appendTransaction(s,a,l){const{doc:c,tr:u}=l,d=E4.getState(l),f=c.content.size;if(d)return u.insert(f,o.create())},state:{init:(s,{doc:a,schema:l})=>{var c;const u=l.nodes[r];if(!u)throw new Error(`Invalid node being used for trailing node extension: '${r}'`);return o=u,i=Object.values(l.nodes).map(d=>d).filter(d=>!n.includes(d.name)),fr(i,(c=a.lastChild)==null?void 0:c.type)},apply:(s,a)=>{var l;return s.docChanged?fr(i,(l=s.doc.lastChild)==null?void 0:l.type):a}}})}var Mle=Object.defineProperty,Tle=Object.getOwnPropertyDescriptor,Ole=(e,t,r,n)=>{for(var o=n>1?void 0:n?Tle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Mle(t,r,o),o},gv=class extends Ve{get name(){return"trailingNode"}onSetOptions(e){const{changes:t}=e;(t.disableTags.changed||t.ignoredNodes.changed||t.nodeName.changed)&&this.store.updateExtensionPlugins(this)}createExternalPlugins(){const{tags:e}=this.store,{disableTags:t,nodeName:r}=this.options,n=t?[...this.options.ignoredNodes]:[...this.options.ignoredNodes,...e.lastNodeCompatible];return[Cle({ignoredNodes:n,nodeName:r})]}};gv=Ole([pe({defaultOptions:{ignoredNodes:[],disableTags:!1,nodeName:"paragraph"}})],gv);var _le=Object.defineProperty,Ale=Object.getOwnPropertyDescriptor,_x=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ale(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&_le(t,r,o),o},Nle={icon:"underline",label:({t:e})=>e(kk.LABEL),description:({t:e})=>e(kk.DESCRIPTION)},Md=class extends ci{get name(){return"underline"}createTags(){return[te.FontStyle,te.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:e.defaults(),parseDOM:[{tag:"u",getAttrs:e.parse},{style:"text-decoration",getAttrs:r=>r==="underline"?{}:!1},...t.parseDOM??[]],toDOM:r=>["u",e.dom(r),0]}}toggleUnderline(e){return is({type:this.type,selection:e})}shortcut(e){return this.toggleUnderline()(e)}};_x([U(Nle)],Md.prototype,"toggleUnderline",1);_x([je({shortcut:$.Underline,command:"toggleUnderline"})],Md.prototype,"shortcut",1);Md=_x([pe({})],Md);const C4={};function Rle(e,t){if(C4[e])return;const r=document.createElement("style"),n=Ple(e)/1e4,o=zle({h:Math.abs(n),s:.6,v:.6}),i=Lle(o);r.type="text/css",r.textContent=` + .remirror-editor-wrapper .${t}${e}::before { content: '[${e}]'; font-family: monospace; font-size: 90%; - color: ${o}; + color: ${i}; } - .remirror-editor-wrapper .__editor_${e}::after { + .remirror-editor-wrapper .${t}${e}::after { content: '[/${e}]'; font-family: monospace; font-size: 90%; - color: ${o}; + color: ${i}; } - `,document.head.appendChild(t),E4[e]=!0}function Rle(e){let t=0;if(!e||e.length===0)return t;for(let r=0;r{for(var o=n>1?void 0:n?Ile(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Lle(t,r,o),o};let ec=class extends li{get name(){return"className"}constructor(e){super(e);for(const t of e.classNames||[])Nle(t)}createTags(){return[oe.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:{...e.defaults(),className:{}},parseDOM:[{tag:"*",getAttrs:r=>{if(!Je(r))return!1;for(const n of r.classList)if(this.options.classNames.indexOf(n)>=0)return{...e.parse(r),className:n};return!1}},...t.parseDOM??[]],toDOM:r=>{const{className:n,...o}=$d(r.attrs,e),i=e.dom(r),s=i.className,a=Dle(n,s);return["span",{...o,...i,class:a},0]}}}setClassName(e,t){return this.store.commands.applyMark.original(this.type,{className:e},t)}removeClassName(e){return this.store.commands.removeMark.original({type:this.type,selection:e,expand:!0})}};_x([U({})],ec.prototype,"setClassName",1);_x([U({})],ec.prototype,"removeClassName",1);ec=_x([pe({defaultOptions:{classNames:[]}})],ec);function Dle(e,t){return e&&(e=`__editor_${e}`),e&&t?`${e} ${t}`:e||t}function FO(e){const[t,r]=S.useState(e),n=S.useRef(e);return n.current=t,[t,r,n]}function $le(e,t,r){if(!e)return;const n=`${t}/api/assets/${r}/`;if(e.startsWith(n)){const o=e.substring(n.length).split(/[/?]+/);return o.length<1?null:{id:o[0]}}return null}function Hle(e,t,r){if(!e)return;const n=`${t}/api/content/${r}/`;if(e.startsWith(n)){const o=e.substring(n.length).split(/[/?]+/);return o.length<2?null:{schemaName:o[0],id:o[1]}}return null}const Ble=Rh(Ed),Ax=new Ble({hr:"---"});Ax.addRule("link2",{filter:(e,t)=>t.linkStyle==="inlined"&&e.nodeName==="A"&&!!e.getAttribute("href"),replacement:function(e,t){const r=t,n=r.getAttribute("href");if(!n)return"";const o=gv(r.getAttribute("title"));return o?`[${e}](${n} '${o}')`:`[${e}](${n})`}});Ax.addRule("link2",{filter:"img",replacement:(e,t)=>{const r=t,n=r.getAttribute("src")||"";if(!n)return"";const o=gv(r.getAttribute("alt")),i=gv(r.getAttribute("title"));return i?`![${o}](${n} '${i}')`:`![${o}](${n})`}});function gv(e){return(e==null?void 0:e.replace(/(\n+\s*)+/g,` -`))||""}function Fle(e){return Ax.turndown(e)}const ps=e=>{const{type:t}=e;return t==="Assets"?O.jsxs("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 28 28",children:[O.jsx("path",{d:"M21.875 28h-15.75c-3.413 0-6.125-2.713-6.125-6.125v-15.75c0-3.413 2.712-6.125 6.125-6.125h15.75c3.412 0 6.125 2.712 6.125 6.125v15.75c0 3.412-2.713 6.125-6.125 6.125zM6.125 1.75c-2.45 0-4.375 1.925-4.375 4.375v15.75c0 2.45 1.925 4.375 4.375 4.375h15.75c2.45 0 4.375-1.925 4.375-4.375v-15.75c0-2.45-1.925-4.375-4.375-4.375h-15.75z"}),O.jsx("path",{d:"M21.088 23.537h-11.988c-0.35 0-0.612-0.175-0.787-0.525s-0.088-0.7 0.088-0.962l8.225-9.713c0.175-0.175 0.438-0.35 0.7-0.35s0.525 0.175 0.7 0.35l5.25 7.525c0.088 0.087 0.088 0.175 0.088 0.262 0.438 1.225 0.087 2.012-0.175 2.45-0.613 0.875-1.925 0.963-2.1 0.963zM11.025 21.787h10.15c0.175 0 0.612-0.088 0.7-0.262 0.088-0.088 0.088-0.35 0-0.7l-4.55-6.475-6.3 7.438z"}),O.jsx("path",{d:"M9.1 13.737c-2.1 0-3.85-1.75-3.85-3.85s1.75-3.85 3.85-3.85 3.85 1.75 3.85 3.85-1.663 3.85-3.85 3.85zM9.1 7.788c-1.138 0-2.1 0.875-2.1 2.1s0.962 2.1 2.1 2.1 2.1-0.962 2.1-2.1-0.875-2.1-2.1-2.1z"})]}):t==="Contents"?O.jsxs("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 28 28",children:[O.jsx("path",{d:"M21.875 28h-15.75c-3.413 0-6.125-2.713-6.125-6.125v-15.75c0-3.413 2.712-6.125 6.125-6.125h15.75c3.412 0 6.125 2.712 6.125 6.125v15.75c0 3.412-2.713 6.125-6.125 6.125zM6.125 1.75c-2.45 0-4.375 1.925-4.375 4.375v15.75c0 2.45 1.925 4.375 4.375 4.375h15.75c2.45 0 4.375-1.925 4.375-4.375v-15.75c0-2.45-1.925-4.375-4.375-4.375h-15.75z"}),O.jsx("path",{d:"M13.125 12.25h-5.775c-1.575 0-2.888-1.313-2.888-2.888v-2.013c0-1.575 1.313-2.888 2.888-2.888h5.775c1.575 0 2.887 1.313 2.887 2.888v2.013c0 1.575-1.312 2.888-2.887 2.888zM7.35 6.212c-0.613 0-1.138 0.525-1.138 1.138v2.012c0 0.612 0.525 1.138 1.138 1.138h5.775c0.612 0 1.138-0.525 1.138-1.138v-2.013c0-0.612-0.525-1.138-1.138-1.138h-5.775z"}),O.jsx("path",{d:"M22.662 16.713h-17.325c-0.525 0-0.875-0.35-0.875-0.875s0.35-0.875 0.875-0.875h17.237c0.525 0 0.875 0.35 0.875 0.875s-0.35 0.875-0.787 0.875z"}),O.jsx("path",{d:"M15.138 21.262h-9.8c-0.525 0-0.875-0.35-0.875-0.875s0.35-0.875 0.875-0.875h9.713c0.525 0 0.875 0.35 0.875 0.875s-0.35 0.875-0.787 0.875z"})]}):t==="Check"?O.jsx("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960",width:"1rem",height:"1rem",children:O.jsx("path",{d:"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"})}):t==="Cancel"?O.jsx("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960",width:"1rem",height:"1rem",children:O.jsx("path",{d:"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"})}):t==="Edit"?O.jsx("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1rem",height:"1rem",children:O.jsx("path",{d:"M15.728 9.686l-1.414-1.414L5 17.586V19h1.414l9.314-9.314zm1.414-1.414l1.414-1.414-1.414-1.414-1.414 1.414 1.414 1.414zM7.242 21H3v-4.243L16.435 3.322a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414L7.243 21z"})}):null},Vle=({node:e})=>{const t=Wd(Td),r=e.attrs.contentId,n=e.attrs.contentTitle,o=e.attrs.schemaName,i=S.useMemo(()=>`${t.options.baseUrl}/app/${t.options.appName}/content/${o}/${r}`,[r,t.options.appName,t.options.baseUrl,o]);return O.jsxs("div",{className:"squidex-editor-content-link",children:[O.jsx("a",{href:i,target:"_blank",className:"squidex-editor-button",children:O.jsx(ps,{type:"Contents"})}),O.jsx("div",{className:"squidex-editor-content-schema",children:o}),O.jsx("div",{className:"squidex-editor-content-name",children:n})]})};var jle=Object.defineProperty,Ule=Object.getOwnPropertyDescriptor,VO=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ule(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&jle(t,r,o),o};let Td=class extends er{constructor(t){super({...t,disableExtraAttributes:!0});vc(this,"ReactComponent",Vle)}get name(){return"contentLink"}createTags(){return[oe.Block]}createNodeSpec(){return{attrs:{contentId:{default:""},contentTitle:{default:""},schemaName:{default:""}},toDOM:t=>["a",{href:`${this.options.baseUrl}/api/content/${this.options.appName}/${t.attrs.schemaName}/${t.attrs.contentId}`},t.attrs.contentTitle],parseDOM:[{tag:"a[href]",getAttrs:t=>{if(!Je(t))return!1;const r=t.getAttribute("href");if(!r)return!1;const n=Hle(r,this.options.baseUrl,this.options.appName);return n?{contentId:n.id,contentTitle:t.innerText,schemaName:n.schemaName}:!1},priority:1e4}]}}addContent(t,r){return this.store.commands.insertNode.original(this.type,{attrs:{contentId:t,contentTitle:t.title,schemaName:t.schemaName},selection:r})}};VO([U({})],Td.prototype,"addContent",1);Td=VO([pe({defaultOptions:{baseUrl:"url",appName:"app"}})],Td);const Wle=({appName:e,baseUrl:t,node:r,onEdit:n,getPosition:o})=>{const i=$le(r.attrs.src,t,e);return O.jsxs("div",{style:{position:"relative"},className:"squidex-editor-image-view",children:[O.jsx("img",{className:"squidex-editor-image-element",src:r.attrs.src}),O.jsx("button",{style:{position:"absolute"},className:"squidex-editor-button",onClick:()=>n({node:r,getPos:o}),children:O.jsx(ps,{type:"Edit"})}),i&&O.jsx("div",{style:{position:"absolute"},className:"squidex-editor-image-info",children:"Asset"})]})};class Kle extends Ve{get name(){return"htmlCopy"}createPlugin(){return{props:{clipboardTextSerializer:this.options.copyAsHtml?r=>{const n=document.createElement("div");return n.append(an.fromSchema(this.store.schema).serializeFragment(r.content)),n.innerHTML}:void 0}}}}const qle=({mode:e,onChange:t,state:r,value:n})=>{const{setContent:o}=di(),{getMarkdown:i,getHTML:s}=dm(),a=S.useRef(null),l=S.useRef(!1),c=S.useRef(0),u=xj();return S.useEffect(()=>{c.current+=1},[u]),S.useEffect(()=>{l.current=!!n&&n.length>0,a.current!==n&&(a.current=n,o(n||""),c.current=-1)},[o,n]),S.useEffect(()=>{if(!t)return;function d(){switch(e){case"Markdown":return i(r);default:return s(r)}}if(c.current<=0)return;let f=d().trim();f==="

    "&&(f=""),a.current!==f&&(!l.current&&f.length===0?t(void 0):t(f),a.current=f,l.current=!!f&&f.length>0)},[s,i,e,t,r]),null},Gle=({node:e,getPosition:t,view:r})=>{const n=S.useCallback(o=>{const i=r.state.tr.setNodeAttribute(t(),"html",o.target.value);r.dispatch(i)},[t,r]);return O.jsxs("div",{className:"squidex-editor-html",children:[O.jsx("div",{className:"squidex-editor-html-label",children:"Plain HTML"}),O.jsx("textarea",{spellCheck:"false",value:e.attrs.content,onChange:n})]})};var Yle=Object.defineProperty,Jle=Object.getOwnPropertyDescriptor,jO=(e,t,r,n)=>{for(var o=n>1?void 0:n?Jle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Yle(t,r,o),o};let Oh=class extends er{constructor(){super({disableExtraAttributes:!0});vc(this,"ReactComponent",Gle)}get name(){return"plainHtml"}createTags(){return[oe.Block]}createNodeSpec(){return{attrs:{html:{default:""}},toDOM:t=>{const r=t.attrs.html;return["div",{class:"__editor_html"},...Xle(r)]},parseDOM:[{tag:"div[class~=__editor_html]",getAttrs:t=>({content:t.innerHTML}),priority:1e4}]}}insertPlainHtml(t){return this.store.commands.insertNode.original(this.type,{attrs:{content:""},selection:t})}};jO([U({})],Oh.prototype,"insertPlainHtml",1);Oh=jO([pe({defaultOptions:{}})],Oh);function Xle(e){if(!e)return[""];const t=document.createElement("div");return t.innerHTML=e,UO(t)}function Qle(e){const t={};for(let r=0;r{const t=cc(),r=S.useCallback(async()=>{const n=await e();ece(n)&&n.length>0&&t.insertText(n),t.run()},[t,e]);return O.jsx(dt,{commandName:"addImage",enabled:!0,onSelect:r,label:"Add AI generated Text",icon:O.jsx("span",{style:{height:"16px",lineHeight:"16px"},children:"AI"})})};function ece(e){return typeof e=="string"||e instanceof String}const WO=e=>{const t=S.useRef(null);return S.useEffect(()=>{const r=window.requestAnimationFrame(()=>{var n;(n=t.current)==null||n.focus()});return()=>{window.cancelAnimationFrame(r)}},[]),O.jsx("input",{className:"squidex-editor-input",ref:t,...e})},KO=({children:e,title:t})=>O.jsxs("div",{className:"squidex-editor-modal-wrapper",children:[O.jsx("div",{className:"squidex-editor-modal-backdrop"}),O.jsxs("div",{className:"squidex-editor-modal-window",children:[t&&O.jsx("div",{className:"squidex-editor-modal-title",children:t}),O.jsx("div",{className:"squidex-editor-modal-body",children:e})]})]}),tce=({onSelectAssets:e})=>{const t=cc(),r=S.useCallback(async()=>{const n=await e();for(const o of n){if(o.mimeType.startsWith("image/")){const i={src:o.src,alt:o.alt,title:o.fileName};t.insertImage(i)}else t.insertAsset(o);t.insertText(" ")}t.run()},[t,e]);return O.jsx(dt,{commandName:"addImage",enabled:!0,onSelect:r,label:"Add Asset",icon:O.jsx(ps,{type:"Assets"})})},rce=({onSelectContents:e})=>{const t=cc(),r=S.useCallback(async()=>{const n=await e();for(const o of n)t.insertNode("content-link",{attrs:{contentId:o.id,contentTitle:o.title,schemaName:o.schemaName}}),t.insertText(" ");t.run()},[t,e]);return O.jsx(dt,{commandName:"addContent",enabled:!0,onSelect:r,label:"Add Content",icon:O.jsx(ps,{type:"Contents"})})},nce=()=>{const e=cc(),t=S.useCallback(async()=>{e.insertPlainHtml().run()},[e]);return O.jsx(dt,{commandName:"addImage",enabled:!0,onSelect:t,label:"Add HTML",icon:O.jsx("span",{style:{height:"16px",lineHeight:"16px"},children:"HTML"})})},oce=({attrs:e,...t})=>{const{setClassName:r}=tr(),n=S.useCallback(()=>{r(e.className)},[e.className,r]),o=qr().className(e);return O.jsx(Ib,{...t,commandName:"toggleClass",active:o,attrs:e,enabled:!0,onSelect:n,label:(e==null?void 0:e.className)||"No Class"})},ice=({...e})=>{const{removeClassName:t}=tr(),r=S.useCallback(()=>{t()},[t]),n=!qr().className();return O.jsx(Ib,{...e,commandName:"removeClass",active:n,attrs:{},enabled:!0,onSelect:r,label:"No Class"})},sce=()=>{const e=Wd(ec);return!e.options.classNames||e.options.classNames.length===0?null:O.jsxs(F3,{"aria-label":"Class Name",icon:O.jsx("span",{style:{height:"14px",lineHeight:"14px",fontSize:"14px"},children:"Class"}),children:[O.jsx(ice,{}),e.options.classNames.map(t=>O.jsx(oce,{attrs:{className:t}},t))]})},ace=()=>{const e=Wd(is);return O.jsxs("div",{className:"squidex-editor-counter",children:["Words: ",O.jsx("strong",{children:e.getWordCount()}),", Characters: ",O.jsx("strong",{children:e.getCharacterCount()})]})},C4=({onEdit:e})=>{const t=cc(),n=qr().link(),o=tb(),i=S.useCallback(()=>{t.removeLink().focus().run()},[t]);return O.jsxs(O.Fragment,{children:[O.jsx(dt,{commandName:"updateLink",enabled:!o.empty,label:"Add or Edit Link",onSelect:e,icon:"link"}),O.jsx(dt,{commandName:"removeLink",enabled:n,label:"Remove Link",onSelect:i,icon:"linkUnlink"})]})},lce=({onClose:e})=>{const[t,r,n]=FO(""),o=cc(),i=lj(!0).link(),s=(i==null?void 0:i.href)??"",a=tb();S.useEffect(()=>{r(s)},[s,a,r]);const l=S.useCallback(()=>{const d=n.current;d?o.updateLink({href:d,auto:!1}):o.removeLink(),o.focus(a.to).run(),e()},[o,n,e,a.to]),c=S.useCallback(d=>{r(d.target.value)},[r]),u=S.useCallback(d=>{const{code:f}=d;f==="Enter"&&l(),f==="Escape"&&e()},[e,l]);return O.jsxs(KO,{title:"Change Link",children:[O.jsx(WO,{value:t,onChange:c,onKeyDown:u,placeholder:"Enter Link..."}),O.jsxs(En,{children:[O.jsx(dt,{commandName:"submitLink",enabled:!0,onSelect:l,icon:O.jsx(ps,{type:"Check"})}),O.jsx(dt,{commandName:"cancelLink",enabled:!0,onSelect:e,icon:O.jsx(ps,{type:"Cancel"})})]})]})},cce=({onClose:e,node:t})=>{const[r,n,o]=FO(""),i=tr();S.useEffect(()=>{n(t.node.attrs.title||"")},[t,n]);const s=S.useCallback(c=>{n(c.target.value)},[n]),a=S.useCallback(()=>{i.updateNodeAttributes(t.getPos()||0,{...t.node.attrs||{},title:o.current}),e()},[i,t,e,o]),l=S.useCallback(c=>{const{code:u}=c;u==="Enter"&&a(),u==="Escape"&&e()},[e,a]);return O.jsxs(KO,{title:"Change Image Title",children:[O.jsx(WO,{value:r,onChange:s,onKeyDown:l,placeholder:"Enter Title..."}),O.jsxs(En,{children:[O.jsx(dt,{commandName:"submitLink",enabled:!0,onSelect:a,icon:O.jsx(ps,{type:"Check"})}),O.jsx(dt,{commandName:"cancelLink",enabled:!0,onSelect:e,icon:O.jsx(ps,{type:"Cancel"})})]})]})};const uce=e=>{const{appName:t,classNames:r,canSelectAIText:n,canSelectAssets:o,canSelectContents:i,isDisabled:s,mode:a,onChange:l,onSelectAIText:c,onSelectAssets:u,onSelectContents:d,onUpload:f,value:p}=e,h=S.useMemo(()=>{let M=e.baseUrl;return M.endsWith("/")&&(M=M.substring(0,M.length-1)),M},[e.baseUrl]),[m,b]=S.useState(),[v,g]=S.useState(!1),y=S.useCallback(()=>{g(!0)},[]),x=S.useCallback(()=>{g(!1)},[]),k=S.useCallback(()=>{b(null)},[]),w=S.useCallback(()=>[new rx,new ba({}),new bd({enableSpine:!0}),new ec({classNames:r}),new lo({}),new kd,new Td({appName:t,baseUrl:h}),new is({}),new co,new kh,new wh({}),new Sh,new Kle({copyAsHtml:a==="Html"}),new wd({uploadHandler:f}),new Sd,new us({autoLink:!0}),new us({autoLink:!0}),new ya({enableCollapsible:!0}),new Zl({copyAsMarkdown:a==="Markdown",htmlToMarkdown:Fle}),new Ft,new xd,new Oh,new Cd,new mv,new Md],[t,h,r,a,f]),{manager:E,state:T,setState:C}=bj({stringHandler:a==="Markdown"?"markdown":"html",content:p,nodeViewComponents:{image:M=>O.jsx(Wle,{...M,appName:t,baseUrl:h,onEdit:b})},extensions:w});return O.jsx(Mte,{children:O.jsx(Ste,{theme:{color:{primary:"#3389ff",active:{primary:"#3389ff"}}},children:O.jsxs(wj,{classNames:s?["squidex-editor-disabled"]:[],manager:E,state:T,onChange:M=>C(M.state),children:[O.jsx("div",{className:"squidex-editor-menu",children:O.jsxs(j3,{children:[O.jsx(kte,{}),O.jsx(xte,{showAll:!0}),O.jsxs(En,{children:[O.jsx(lv,{}),O.jsx(uv,{}),O.jsx(dv,{}),O.jsx(cv,{})]}),O.jsxs(En,{children:[O.jsx(ate,{}),O.jsx(cte,{}),O.jsx(ite,{})]}),O.jsxs(En,{children:[O.jsx(lte,{}),O.jsx(ute,{})]}),a==="Html"&&r&&r.length>0&&O.jsx(En,{children:O.jsx(sce,{})}),O.jsx(En,{children:O.jsx(C4,{onEdit:y})}),O.jsxs(En,{children:[o&&u&&O.jsx(tce,{onSelectAssets:u}),i&&d&&O.jsx(rce,{onSelectContents:d}),n&&c&&O.jsx(Zle,{onSelectAIText:c})]}),a==="Html"&&O.jsx(En,{children:O.jsx(nce,{})})]})}),O.jsx(qle,{mode:a,onChange:l,state:T,value:p}),O.jsx(G0,{}),v?O.jsx(lce,{onClose:x}):m?O.jsx(cce,{node:m,onClose:k}):O.jsxs(Cte,{className:"squidex-editor-floating",children:[O.jsx(lv,{}),O.jsx(uv,{}),O.jsx(dv,{}),O.jsx(cv,{}),O.jsx(C4,{onEdit:y})]}),O.jsx(ace,{})]})})})};var qO,M4=am;qO=M4.createRoot,M4.hydrateRoot;class dce{constructor(t,r){vc(this,"root");this.element=t,this.props=r,this.root=qO(this.element),this.render()}update(t){this.props={...this.props,...t},this.render()}setValue(t){this.update({value:t})}setIsDisabled(t){this.update({isDisabled:t})}destroy(){this.root.unmount()}render(){this.root.render(O.jsx(uce,{...this.props}))}}window.SquidexEditorWrapper=dce; + `,document.head.appendChild(r),C4[e]=!0}function Ple(e){let t=0;if(!e||e.length===0)return t;for(let r=0;r{for(var o=n>1?void 0:n?Dle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ile(t,r,o),o};const gp="__editor_";let ec=class extends ci{get name(){return"className"}constructor(e){super(e);for(const t of e.classNames||[])Rle(t,gp)}createTags(){return[te.FormattingMark]}createMarkSpec(e,t){return{...t,attrs:{...e.defaults(),className:{}},parseDOM:[{tag:"*",getAttrs:r=>{if(!et(r))return!1;for(let n of r.classList)if(n.startsWith(gp)&&(n=n.substring(gp.length)),this.options.classNames.indexOf(n)>=0)return{...e.parse(r),className:n};return!1}},...t.parseDOM??[]],toDOM:r=>{const{className:n,...o}=$d(r.attrs,e),i=e.dom(r),s=i.className,a=$le(n,s);return["span",{...o,...i,class:a},0]}}}setClassName(e,t){return this.store.commands.applyMark.original(this.type,{className:e},t)}removeClassName(e){return this.store.commands.removeMark.original({type:this.type,selection:e,expand:!0})}};Ax([U({})],ec.prototype,"setClassName",1);Ax([U({})],ec.prototype,"removeClassName",1);ec=Ax([pe({defaultOptions:{}})],ec);function $le(e,t){return e&&(e=`${gp}${e}`),e&&t?`${e} ${t}`:e||t}function VO(e){const[t,r]=S.useState(e),n=S.useRef(e);return n.current=t,[t,r,n]}function Hle(e,t,r){if(!e)return;const n=`${t}/api/assets/${r}/`;if(e.startsWith(n)){const o=e.substring(n.length).split(/[/?]+/);return o.length<1?null:{id:o[0]}}return null}function Ble(e,t,r){if(!e)return;const n=`${t}/api/content/${r}/`;if(e.startsWith(n)){const o=e.substring(n.length).split(/[/?]+/);return o.length<2?null:{schemaName:o[0],id:o[1]}}return null}const Fle=Ph(Ed),Nx=new Fle({hr:"---"});Nx.addRule("link2",{filter:(e,t)=>t.linkStyle==="inlined"&&e.nodeName==="A"&&!!e.getAttribute("href"),replacement:function(e,t){const r=t,n=r.getAttribute("href");if(!n)return"";const o=vv(r.getAttribute("title"));return o?`[${e}](${n} '${o}')`:`[${e}](${n})`}});Nx.addRule("link2",{filter:"img",replacement:(e,t)=>{const r=t,n=r.getAttribute("src")||"";if(!n)return"";const o=vv(r.getAttribute("alt")),i=vv(r.getAttribute("title"));return i?`![${o}](${n} '${i}')`:`![${o}](${n})`}});function vv(e){return(e==null?void 0:e.replace(/(\n+\s*)+/g,` +`))||""}function Vle(e){return Nx.turndown(e)}const li=e=>{const{type:t}=e;return t==="Assets"?O.jsxs("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 28 28",children:[O.jsx("path",{d:"M21.875 28h-15.75c-3.413 0-6.125-2.713-6.125-6.125v-15.75c0-3.413 2.712-6.125 6.125-6.125h15.75c3.412 0 6.125 2.712 6.125 6.125v15.75c0 3.412-2.713 6.125-6.125 6.125zM6.125 1.75c-2.45 0-4.375 1.925-4.375 4.375v15.75c0 2.45 1.925 4.375 4.375 4.375h15.75c2.45 0 4.375-1.925 4.375-4.375v-15.75c0-2.45-1.925-4.375-4.375-4.375h-15.75z"}),O.jsx("path",{d:"M21.088 23.537h-11.988c-0.35 0-0.612-0.175-0.787-0.525s-0.088-0.7 0.088-0.962l8.225-9.713c0.175-0.175 0.438-0.35 0.7-0.35s0.525 0.175 0.7 0.35l5.25 7.525c0.088 0.087 0.088 0.175 0.088 0.262 0.438 1.225 0.087 2.012-0.175 2.45-0.613 0.875-1.925 0.963-2.1 0.963zM11.025 21.787h10.15c0.175 0 0.612-0.088 0.7-0.262 0.088-0.088 0.088-0.35 0-0.7l-4.55-6.475-6.3 7.438z"}),O.jsx("path",{d:"M9.1 13.737c-2.1 0-3.85-1.75-3.85-3.85s1.75-3.85 3.85-3.85 3.85 1.75 3.85 3.85-1.663 3.85-3.85 3.85zM9.1 7.788c-1.138 0-2.1 0.875-2.1 2.1s0.962 2.1 2.1 2.1 2.1-0.962 2.1-2.1-0.875-2.1-2.1-2.1z"})]}):t==="Contents"?O.jsxs("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 28 28",children:[O.jsx("path",{d:"M21.875 28h-15.75c-3.413 0-6.125-2.713-6.125-6.125v-15.75c0-3.413 2.712-6.125 6.125-6.125h15.75c3.412 0 6.125 2.712 6.125 6.125v15.75c0 3.412-2.713 6.125-6.125 6.125zM6.125 1.75c-2.45 0-4.375 1.925-4.375 4.375v15.75c0 2.45 1.925 4.375 4.375 4.375h15.75c2.45 0 4.375-1.925 4.375-4.375v-15.75c0-2.45-1.925-4.375-4.375-4.375h-15.75z"}),O.jsx("path",{d:"M13.125 12.25h-5.775c-1.575 0-2.888-1.313-2.888-2.888v-2.013c0-1.575 1.313-2.888 2.888-2.888h5.775c1.575 0 2.887 1.313 2.887 2.888v2.013c0 1.575-1.312 2.888-2.887 2.888zM7.35 6.212c-0.613 0-1.138 0.525-1.138 1.138v2.012c0 0.612 0.525 1.138 1.138 1.138h5.775c0.612 0 1.138-0.525 1.138-1.138v-2.013c0-0.612-0.525-1.138-1.138-1.138h-5.775z"}),O.jsx("path",{d:"M22.662 16.713h-17.325c-0.525 0-0.875-0.35-0.875-0.875s0.35-0.875 0.875-0.875h17.237c0.525 0 0.875 0.35 0.875 0.875s-0.35 0.875-0.787 0.875z"}),O.jsx("path",{d:"M15.138 21.262h-9.8c-0.525 0-0.875-0.35-0.875-0.875s0.35-0.875 0.875-0.875h9.713c0.525 0 0.875 0.35 0.875 0.875s-0.35 0.875-0.787 0.875z"})]}):t==="Check"?O.jsx("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960",width:"1rem",height:"1rem",children:O.jsx("path",{d:"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"})}):t==="Cancel"?O.jsx("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -960 960 960",width:"1rem",height:"1rem",children:O.jsx("path",{d:"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"})}):t==="Edit"?O.jsx("svg",{className:"custom-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1rem",height:"1rem",children:O.jsx("path",{d:"M15.728 9.686l-1.414-1.414L5 17.586V19h1.414l9.314-9.314zm1.414-1.414l1.414-1.414-1.414-1.414-1.414 1.414 1.414 1.414zM7.242 21H3v-4.243L16.435 3.322a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414L7.243 21z"})}):null},jle=({node:e})=>{const t=Wd(Td),r=e.attrs.contentId,n=e.attrs.contentTitle,o=e.attrs.schemaName,i=t.options.onEditContent;return O.jsxs("div",{className:"squidex-editor-content-link",children:[O.jsx("button",{type:"button",className:"squidex-editor-button",onClick:()=>i(o,r),children:O.jsx(li,{type:"Contents"})}),O.jsx("div",{className:"squidex-editor-content-schema",children:o}),O.jsx("div",{className:"squidex-editor-content-name",children:n})]})};var Ule=Object.defineProperty,Wle=Object.getOwnPropertyDescriptor,jO=(e,t,r,n)=>{for(var o=n>1?void 0:n?Wle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ule(t,r,o),o};let Td=class extends er{constructor(t){super({...t,disableExtraAttributes:!0});vc(this,"ReactComponent",jle)}get name(){return"contentLink"}createTags(){return[te.InlineNode,te.Media]}createNodeSpec(){return{inline:!0,attrs:{contentId:{default:""},contentTitle:{default:""},schemaName:{default:""}},toDOM:t=>["a",{href:`${this.options.baseUrl}/api/content/${this.options.appName}/${t.attrs.schemaName}/${t.attrs.contentId}`},t.attrs.contentTitle],parseDOM:[{tag:"a[href]",getAttrs:t=>{const r=t.getAttribute("href");if(!r)return!1;const n=Ble(r,this.options.baseUrl,this.options.appName);return n?{contentId:n.id,contentTitle:t.innerText,schemaName:n.schemaName}:!1},priority:1e5}]}}addContent(t,r){return this.store.commands.insertNode.original(this.type,{attrs:{contentId:t.id,contentTitle:t.title,schemaName:t.schemaName},selection:r})}};jO([U({})],Td.prototype,"addContent",1);Td=jO([pe({defaultOptions:{}})],Td);const Kle=e=>{const{appName:t,baseUrl:r,onEditNode:n,onEditAsset:o,node:i,getPosition:s}=e,a=Hle(i.attrs.src,r,t);return O.jsxs("div",{style:{position:"relative"},className:"squidex-editor-image-view",children:[O.jsx("img",{className:"squidex-editor-image-element",src:i.attrs.src}),O.jsxs("div",{className:"squidex-editor-image-buttons",children:[O.jsx("button",{type:"button",className:"squidex-editor-button",onClick:()=>n({node:i,getPos:s}),children:O.jsx(li,{type:"Edit"})}),a&&O.jsx("button",{type:"button",className:"squidex-editor-button",onClick:()=>o(a.id),children:O.jsx(li,{type:"Assets"})})]}),a&&O.jsx("div",{className:"squidex-editor-image-info",children:"Asset"})]})};class qle extends Ve{get name(){return"htmlCopy"}createPlugin(){return{props:{clipboardTextSerializer:this.options.copyAsHtml?r=>{const n=document.createElement("div");return n.append(an.fromSchema(this.store.schema).serializeFragment(r.content)),n.innerHTML}:void 0}}}}const Gle=({mode:e,onChange:t,state:r,value:n})=>{const{setContent:o}=fi(),{getMarkdown:i,getHTML:s}=fm(),a=S.useRef(null),l=S.useRef(!1),c=S.useRef(0),u=kj();return S.useEffect(()=>{c.current+=1},[u]),S.useEffect(()=>{l.current=!!n&&n.length>0,a.current!==n&&(a.current=n,o(n||""),c.current=-1)},[o,n]),S.useEffect(()=>{if(!t)return;function d(){switch(e){case"Markdown":return i(r);default:return s(r)}}if(c.current<=0)return;let f=d().trim();f==="

    "&&(f=""),a.current!==f&&(!l.current&&f.length===0?t(void 0):t(f),a.current=f,l.current=!!f&&f.length>0)},[s,i,e,t,r]),null},Yle=({node:e,getPosition:t,view:r})=>{const n=S.useCallback(o=>{const i=r.state.tr.setNodeAttribute(t(),"html",o.target.value);r.dispatch(i)},[t,r]);return O.jsxs("div",{className:"squidex-editor-html",children:[O.jsx("div",{className:"squidex-editor-html-label",children:"Plain HTML"}),O.jsx("textarea",{spellCheck:"false",value:e.attrs.content,onChange:n})]})};var Jle=Object.defineProperty,Xle=Object.getOwnPropertyDescriptor,UO=(e,t,r,n)=>{for(var o=n>1?void 0:n?Xle(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Jle(t,r,o),o};let _h=class extends er{constructor(){super({disableExtraAttributes:!0});vc(this,"ReactComponent",Yle)}get name(){return"plainHtml"}createTags(){return[te.Block,te.TextBlock,te.FormattingNode]}createNodeSpec(){return{attrs:{html:{default:""}},toDOM:t=>{const r=t.attrs.html;return["div",{class:"__editor_html"},...Qle(r)]},parseDOM:[{tag:"div[class~=__editor_html]",getAttrs:t=>({content:t.innerHTML}),priority:1e4}]}}insertPlainHtml(t){return this.store.commands.insertNode.original(this.type,{attrs:{content:""},selection:t})}};UO([U({})],_h.prototype,"insertPlainHtml",1);_h=UO([pe({defaultOptions:{}})],_h);function Qle(e){if(!e)return[""];const t=document.createElement("div");return t.innerHTML=e,WO(t)}function Zle(e){const t={};for(let r=0;r{const t=cc(),r=S.useCallback(async()=>{const n=await e();tce(n)&&n.length>0&&t.insertText(n),t.run()},[t,e]);return O.jsx(dt,{commandName:"addImage",enabled:!0,onSelect:r,label:"Add AI generated Text",icon:O.jsx("span",{style:{height:"16px",lineHeight:"16px"},children:"AI"})})};function tce(e){return typeof e=="string"||e instanceof String}const KO=e=>{const t=S.useRef(null);return S.useEffect(()=>{const r=window.requestAnimationFrame(()=>{var n;(n=t.current)==null||n.focus()});return()=>{window.cancelAnimationFrame(r)}},[]),O.jsx("input",{className:"squidex-editor-input",ref:t,...e})},qO=({children:e,title:t})=>O.jsxs("div",{className:"squidex-editor-modal-wrapper",children:[O.jsx("div",{className:"squidex-editor-modal-backdrop"}),O.jsxs("div",{className:"squidex-editor-modal-window",children:[t&&O.jsx("div",{className:"squidex-editor-modal-title",children:t}),O.jsx("div",{className:"squidex-editor-modal-body",children:e})]})]}),rce=({onSelectAssets:e})=>{const t=cc(),r=S.useCallback(async()=>{const n=await e();for(const o of n){if(o.mimeType.startsWith("image/")){const i={src:o.src,alt:o.alt,title:o.fileName};t.insertImage(i)}else t.insertAsset(o);t.insertText(" ")}t.run()},[t,e]);return O.jsx(dt,{commandName:"addImage",enabled:!0,onSelect:r,label:"Add Asset",icon:O.jsx(li,{type:"Assets"})})},nce=({onSelectContents:e})=>{const t=cc(),r=S.useCallback(async()=>{const n=await e();for(const o of n)t.addContent(o);t.run()},[t,e]);return O.jsx(dt,{commandName:"addContent",enabled:!0,onSelect:r,label:"Add Content",icon:O.jsx(li,{type:"Contents"})})},oce=()=>{const e=cc(),t=S.useCallback(async()=>{e.insertPlainHtml().run()},[e]);return O.jsx(dt,{commandName:"addImage",enabled:!0,onSelect:t,label:"Add HTML",icon:O.jsx("span",{style:{height:"16px",lineHeight:"16px"},children:"HTML"})})},ice=({attrs:e,...t})=>{const{setClassName:r}=tr(),n=S.useCallback(()=>{r(e.className)},[e.className,r]),o=qr().className(e);return O.jsx(Db,{...t,commandName:"toggleClass",active:o,attrs:e,enabled:!0,onSelect:n,label:(e==null?void 0:e.className)||"No Class"})},sce=({...e})=>{const{removeClassName:t}=tr(),r=S.useCallback(()=>{t()},[t]),n=!qr().className();return O.jsx(Db,{...e,commandName:"removeClass",active:n,attrs:{},enabled:!0,onSelect:r,label:"No Class"})},ace=()=>{const e=Wd(ec);return!e.options.classNames||e.options.classNames.length===0?null:O.jsxs(V3,{"aria-label":"Class Name",icon:O.jsx("span",{style:{height:"14px",lineHeight:"14px",fontSize:"14px"},children:"Class"}),children:[O.jsx(sce,{}),e.options.classNames.map(t=>O.jsx(ice,{attrs:{className:t}},t))]})},lce=()=>{const e=Wd(ss);return O.jsxs("div",{className:"squidex-editor-counter",children:["Words: ",O.jsx("strong",{children:e.getWordCount()}),", Characters: ",O.jsx("strong",{children:e.getCharacterCount()})]})},M4=({onEdit:e})=>{const t=cc(),n=qr().link(),o=rb(),i=S.useCallback(()=>{t.removeLink().focus().run()},[t]);return O.jsxs(O.Fragment,{children:[O.jsx(dt,{commandName:"updateLink",enabled:!o.empty,label:"Add or Edit Link",onSelect:e,icon:"link"}),O.jsx(dt,{commandName:"removeLink",enabled:n,label:"Remove Link",onSelect:i,icon:"linkUnlink"})]})},cce=({onClose:e})=>{const[t,r,n]=VO(""),o=cc(),i=cj(!0).link(),s=(i==null?void 0:i.href)??"",a=rb();S.useEffect(()=>{r(s)},[s,a,r]);const l=S.useCallback(()=>{const d=n.current;d?o.updateLink({href:d,auto:!1}):o.removeLink(),o.focus(a.to).run(),e()},[o,n,e,a.to]),c=S.useCallback(d=>{r(d.target.value)},[r]),u=S.useCallback(d=>{const{code:f}=d;f==="Enter"&&l(),f==="Escape"&&e()},[e,l]);return O.jsxs(qO,{title:"Change Link",children:[O.jsx(KO,{value:t,onChange:c,onKeyDown:u,placeholder:"Enter Link..."}),O.jsxs(En,{children:[O.jsx(dt,{commandName:"submitLink",enabled:!0,onSelect:l,icon:O.jsx(li,{type:"Check"})}),O.jsx(dt,{commandName:"cancelLink",enabled:!0,onSelect:e,icon:O.jsx(li,{type:"Cancel"})})]})]})},uce=({onClose:e,node:t})=>{const[r,n,o]=VO(""),i=tr();S.useEffect(()=>{n(t.node.attrs.title||"")},[t,n]);const s=S.useCallback(c=>{n(c.target.value)},[n]),a=S.useCallback(()=>{i.updateNodeAttributes(t.getPos()||0,{...t.node.attrs||{},title:o.current}),e()},[i,t,e,o]),l=S.useCallback(c=>{const{code:u}=c;u==="Enter"&&a(),u==="Escape"&&e()},[e,a]);return O.jsxs(qO,{title:"Change Image Title",children:[O.jsx(KO,{value:r,onChange:s,onKeyDown:l,placeholder:"Enter Title..."}),O.jsxs(En,{children:[O.jsx(dt,{commandName:"submitLink",enabled:!0,onSelect:a,icon:O.jsx(li,{type:"Check"})}),O.jsx(dt,{commandName:"cancelLink",enabled:!0,onSelect:e,icon:O.jsx(li,{type:"Cancel"})})]})]})};const dce=e=>{const{appName:t,classNames:r,canSelectAIText:n,canSelectAssets:o,canSelectContents:i,isDisabled:s,mode:a,onChange:l,onEditAsset:c,onEditContent:u,onSelectAIText:d,onSelectAssets:f,onSelectContents:p,onUpload:h,value:m}=e,b=S.useMemo(()=>{let z=e.baseUrl;return z.endsWith("/")&&(z=z.substring(0,z.length-1)),z},[e.baseUrl]),[v,g]=S.useState(),[y,x]=S.useState(!1),k=S.useCallback(()=>{x(!0)},[]),w=S.useCallback(()=>{x(!1)},[]),E=S.useCallback(()=>{g(null)},[]),M=S.useCallback(()=>[new nx,new ya({}),new bd({enableSpine:!0}),new ec({classNames:r}),new lo({}),new kd,new Td({appName:t,baseUrl:b,onEditContent:u}),new ss({}),new co,new wh,new Sh({}),new Eh,new qle({copyAsHtml:a==="Html"}),new wd({uploadHandler:h}),new Sd,new ba({autoLink:!0}),new va({enableCollapsible:!0}),new Zl({copyAsMarkdown:a==="Markdown",htmlToMarkdown:Vle}),new Ft,new xd,new _h,new Cd,new gv,new Md],[t,b,r,a,u,h]),{manager:C,state:T,setState:N}=xj({stringHandler:a==="Markdown"?"markdown":"html",content:m,nodeViewComponents:{image:z=>O.jsx(Kle,{...z,appName:t,baseUrl:b,onEditNode:g,onEditAsset:c})},extensions:M});return O.jsx(Tte,{children:O.jsx(Ete,{theme:{color:{primary:"#3389ff",active:{primary:"#3389ff"}}},children:O.jsxs(Sj,{classNames:s?["squidex-editor-disabled"]:[],manager:C,state:T,onChange:z=>N(z.state),children:[O.jsx("div",{className:"squidex-editor-menu",children:O.jsxs(U3,{children:[O.jsx(wte,{}),O.jsx(kte,{showAll:!0}),O.jsxs(En,{children:[O.jsx(cv,{}),O.jsx(dv,{}),O.jsx(fv,{}),O.jsx(uv,{})]}),O.jsxs(En,{children:[O.jsx(lte,{}),O.jsx(ute,{}),O.jsx(ste,{})]}),O.jsxs(En,{children:[O.jsx(cte,{}),O.jsx(dte,{})]}),a==="Html"&&r&&r.length>0&&O.jsx(En,{children:O.jsx(ace,{})}),O.jsx(En,{children:O.jsx(M4,{onEdit:k})}),O.jsxs(En,{children:[o&&f&&O.jsx(rce,{onSelectAssets:f}),i&&p&&O.jsx(nce,{onSelectContents:p}),n&&d&&O.jsx(ece,{onSelectAIText:d})]}),a==="Html"&&O.jsx(En,{children:O.jsx(oce,{})})]})}),O.jsx(Gle,{mode:a,onChange:l,state:T,value:m}),O.jsx(Y0,{}),y?O.jsx(cce,{onClose:w}):v?O.jsx(uce,{node:v,onClose:E}):O.jsxs(Mte,{className:"squidex-editor-floating",children:[O.jsx(cv,{}),O.jsx(dv,{}),O.jsx(fv,{}),O.jsx(uv,{}),O.jsx(M4,{onEdit:k})]}),O.jsx(lce,{})]})})})};var GO,T4=lm;GO=T4.createRoot,T4.hydrateRoot;class fce{constructor(t,r){vc(this,"root");this.element=t,this.props=r,this.root=GO(this.element),this.render()}update(t){this.props={...this.props,...t},this.render()}setValue(t){this.update({value:t})}setIsDisabled(t){this.update({isDisabled:t})}destroy(){this.root.unmount()}render(){this.root.render(O.jsx(dce,{...this.props}))}}window.SquidexEditorWrapper=fce; diff --git a/frontend/src/app/declarations.d.ts b/frontend/src/app/declarations.d.ts index a518b4802..d8f9fa8d8 100644 --- a/frontend/src/app/declarations.d.ts +++ b/frontend/src/app/declarations.d.ts @@ -89,6 +89,13 @@ interface EditorProps { // Called when content items should be selected. onSelectContents?: OnSelectContents; + // Called when an asset is to be edited. + onEditAsset: (assetId: string) => void; + + // Called when a content is to be edited. + onEditContent: (schemaName: string, contentId: string) => void; + + // Called when a file needs to be uploaded. onUpload?: (images: UploadRequest[]) => DelayedPromiseCreator[]; diff --git a/frontend/src/app/shared/components/forms/rich-editor.component.html b/frontend/src/app/shared/components/forms/rich-editor.component.html index e08076a29..391a7aa5b 100644 --- a/frontend/src/app/shared/components/forms/rich-editor.component.html +++ b/frontend/src/app/shared/components/forms/rich-editor.component.html @@ -4,8 +4,12 @@ (assetSelect)="insertAssets($event)"> + + + diff --git a/frontend/src/app/shared/components/forms/rich-editor.component.ts b/frontend/src/app/shared/components/forms/rich-editor.component.ts index 89fc8172a..4aee803c7 100644 --- a/frontend/src/app/shared/components/forms/rich-editor.component.ts +++ b/frontend/src/app/shared/components/forms/rich-editor.component.ts @@ -7,8 +7,9 @@ import { AfterViewInit, booleanAttribute, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, forwardRef, Input, OnDestroy, Output, ViewChild } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; +import { BehaviorSubject, catchError, of, switchMap } from 'rxjs'; import { ContentDto } from '@app/shared'; -import { ApiUrlConfig, AppsState, AssetDto, AssetUploaderState, DialogModel, getContentValue, LanguageDto, ResourceLoaderService, StatefulControlComponent, Types } from '@app/shared/internal'; +import { ApiUrlConfig, AppsState, AssetDto, AssetsService, AssetUploaderState, DialogModel, getContentValue, LanguageDto, ResourceLoaderService, StatefulControlComponent, Types } from '@app/shared/internal'; export const SQX_RICH_EDITOR_CONTROL_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => RichEditorComponent), multi: true, @@ -24,6 +25,7 @@ export const SQX_RICH_EDITOR_CONTROL_VALUE_ACCESSOR: any = { changeDetection: ChangeDetectionStrategy.OnPush, }) export class RichEditorComponent extends StatefulControlComponent<{}, string> implements AfterViewInit, OnDestroy { + private readonly assetId = new BehaviorSubject(null); private editorWrapper: any; private value?: string; private currentContents?: ResolvablePromise; @@ -62,16 +64,26 @@ export class RichEditorComponent extends StatefulControlComponent<{}, string> im @ViewChild('editor', { static: false }) public editor!: ElementRef; - public assetsDialog = new DialogModel(); - public chatDialog = new DialogModel(); + public assetsDialog = new DialogModel(); + public assetToEdit = this.assetId.pipe( + switchMap(id => { + if (id) { + return this.assetService.getAsset(this.appsState.appName, id); + } else { + return of(null); + } + }), + catchError(() => of(null))); + public contentsDialog = new DialogModel(); constructor( private readonly apiUrl: ApiUrlConfig, private readonly appsState: AppsState, private readonly assetUploader: AssetUploaderState, + private readonly assetService: AssetsService, private readonly resourceLoader: ResourceLoaderService, ) { super({}); @@ -126,6 +138,14 @@ export class RichEditorComponent extends StatefulControlComponent<{}, string> im onChange: (value: string | undefined) => { this.callChange(value); }, + onEditContent: (schemaName, id) => { + const url = this.apiUrl.buildUrl(`/app/${this.appsState.appName}/content/${schemaName}/${id}`); + + window.open(url, '_blank'); + }, + onEditAsset: id => { + this.assetId.next(id); + }, appName: this.appsState.appName, baseUrl: this.apiUrl.buildUrl(''), canSelectAIText: this.hasChatBot, @@ -222,6 +242,10 @@ export class RichEditorComponent extends StatefulControlComponent<{}, string> im private buildContent(content: ContentDto): Content { return { ...content, title: buildContentTitle(content, this.language) }; } + + public closeAssetDialog() { + this.assetId.next(null); + } } function buildContentTitle(content: ContentDto, language: LanguageDto) {