diff --git a/app/Concerns/HasSlug.php b/app/Concerns/HasSlug.php new file mode 100644 index 0000000..eebdfec --- /dev/null +++ b/app/Concerns/HasSlug.php @@ -0,0 +1,84 @@ +fillable[] = 'slug'; + } + + public function getSlugFieldSource(): string + { + return $this->slugFieldSource ?? 'title'; + } + + public static function bootHasSlug(): void + { + static::creating(fn (Model $model) => $model->fillSlugs()); + static::updating(fn (Model $model) => $model->fillSlugs()); + } + + protected function fillSlugs(): void + { + if ( + ! \array_key_exists('slug', $this->attributes) || + ! \array_key_exists($this->getSlugFieldSource(), $this->attributes) + ) { + return; + } + + $this->slug = Str::slug($this->slug); + + if (! $this->slug || ! $this->slugAlreadyUsed($this->slug)) { + $this->slug = $this->generateSlug(); + } + } + + public function generateSlug(): string + { + $base = $slug = Str::slug($this->{$this->getSlugFieldSource()}); + $suffix = 1; + + while ($this->slugAlreadyUsed($slug)) { + $slug = Str::slug($base . '_' . $suffix++); + } + + return $slug; + } + + protected function slugAlreadyUsed(string $slug): bool + { + $query = static::query() + ->where('slug', $slug) + ->withoutGlobalScopes(); + + if ($this->exists) { + $query->where($this->getKeyName(), '!=', $this->getKey()); + } + + return $query->exists(); + } + + public function getUrlAttribute(): ?string + { + $key = $this->getMorphClass(); + + if (! $this->slug) { + return null; + } + + return route('front.' . Str::plural($key) . '.show', [ + $key => $this->slug, + ]); + } +} diff --git a/app/Enums/VoteMonitorStatKey.php b/app/Enums/VoteMonitorStatKey.php new file mode 100644 index 0000000..876cb6d --- /dev/null +++ b/app/Enums/VoteMonitorStatKey.php @@ -0,0 +1,62 @@ + __('app.vote_monitor_stats.observers'), + self::COUNTIES => __('app.vote_monitor_stats.counties'), + self::POLLING_STATIONS => __('app.vote_monitor_stats.polling_stations'), + self::MESSAGES => __('app.vote_monitor_stats.messages'), + self::PROBLEMS => __('app.vote_monitor_stats.problems'), + }; + } + + public function getIcon(): ?string + { + return match ($this) { + self::OBSERVERS => 'gmdi-remove-red-eye-tt', + self::COUNTIES => 'gmdi-map-tt', + self::POLLING_STATIONS => 'gmdi-how-to-vote-tt', + self::MESSAGES => 'gmdi-send-to-mobile-tt', + self::PROBLEMS => 'gmdi-report-problem-tt', + }; + } + + public function getColor(): string|array|null + { + return match ($this) { + self::OBSERVERS => Color::Purple, + self::COUNTIES => Color::Purple, + self::POLLING_STATIONS => Color::Purple, + self::MESSAGES => Color::Purple, + self::PROBLEMS => Color::Amber, + }; + } +} diff --git a/app/Filament/Admin/Resources/PageResource.php b/app/Filament/Admin/Resources/PageResource.php new file mode 100644 index 0000000..3a0c262 --- /dev/null +++ b/app/Filament/Admin/Resources/PageResource.php @@ -0,0 +1,105 @@ +schema([ + Section::make() + ->columns(2) + ->schema([ + TextInput::make('title') + ->required() + ->maxLength(255) + ->lazy() + ->afterStateUpdated(function (Get $get, Set $set, ?string $old, ?string $state) { + if (($get('slug') ?? '') !== Str::slug($old)) { + return; + } + + $set('slug', Str::slug($state)); + }), + + TextInput::make('slug') + ->required() + ->unique(ignoreRecord: true) + ->maxLength(255), + + TiptapEditor::make('content') + ->required() + ->columnSpanFull(), + ]), + ]); + } + + public static function table(Table $table): Table + { + return $table + ->columns([ + TextColumn::make('title') + ->searchable() + ->sortable(), + ]) + ->filters([ + // + ]) + ->actions([ + Tables\Actions\ViewAction::make() + ->url(fn (Page $record) => $record->url) + ->openUrlInNewTab(), + + Tables\Actions\EditAction::make(), + ]); + } + + public static function getPages(): array + { + return [ + 'index' => Pages\ListPages::route('/'), + 'create' => Pages\CreatePage::route('/create'), + 'edit' => Pages\EditPage::route('/{record}/edit'), + ]; + } +} diff --git a/app/Filament/Admin/Resources/PageResource/Pages/CreatePage.php b/app/Filament/Admin/Resources/PageResource/Pages/CreatePage.php new file mode 100644 index 0000000..fe5f8eb --- /dev/null +++ b/app/Filament/Admin/Resources/PageResource/Pages/CreatePage.php @@ -0,0 +1,13 @@ +schema([ + Select::make('key') + ->options(VoteMonitorStatKey::options()) + ->enum(VoteMonitorStatKey::class) + ->unique(ignoreRecord:true) + ->required(), + + TextInput::make('value') + ->type('number') + ->minValue(0) + ->maxValue(4294967295) + ->required(), + + Checkbox::make('enabled') + ->label('Enabled') + ->columnSpanFull(), + ]); + } + + public static function table(Table $table): Table + { + return $table + ->columns([ + TextColumn::make('order') + ->alignRight() + ->shrink(), + + ToggleColumn::make('enabled') + ->label('Enabled') + ->shrink(), + + TextColumn::make('key') + ->label('Name') + ->sortable(), + + TextColumn::make('value') + ->label('Value') + ->formatStateUsing(fn ($state) => number_format($state)) + ->sortable(), + + TextColumn::make('updated_at') + ->label('Last Updated') + ->toggleable() + ->sortable(), + ]) + ->filters([ + // + ]) + ->actions([ + Tables\Actions\EditAction::make(), + ]) + ->defaultSort('order', 'asc') + ->reorderable('order'); + } + + public static function getPages(): array + { + return [ + 'index' => Pages\ManageVoteMonitorStats::route('/'), + ]; + } +} diff --git a/app/Filament/Admin/Resources/VoteMonitorStatResource/Pages/ManageVoteMonitorStats.php b/app/Filament/Admin/Resources/VoteMonitorStatResource/Pages/ManageVoteMonitorStats.php new file mode 100644 index 0000000..c664e8a --- /dev/null +++ b/app/Filament/Admin/Resources/VoteMonitorStatResource/Pages/ManageVoteMonitorStats.php @@ -0,0 +1,21 @@ +title($this->page->title); + + return view('livewire.pages.content-page'); + } +} diff --git a/app/Livewire/Pages/ElectionPage.php b/app/Livewire/Pages/ElectionPage.php index c8981ee..7e29335 100644 --- a/app/Livewire/Pages/ElectionPage.php +++ b/app/Livewire/Pages/ElectionPage.php @@ -116,6 +116,15 @@ public function mapKey(): string return hash('xxh128', "map-{$this->level->value}-{$this->county}"); } + /** + * Used to refresh the embed component when the url changes. + */ + #[Computed] + public function embedKey(): string + { + return hash('xxh128', "embed-{$this->getEmbedUrl()}"); + } + #[On('map:click')] public function refreshData(?string $country = null, ?int $county = null, ?int $locality = null): void { diff --git a/app/Livewire/Pages/ElectionResults.php b/app/Livewire/Pages/ElectionResults.php index cab3581..febf658 100644 --- a/app/Livewire/Pages/ElectionResults.php +++ b/app/Livewire/Pages/ElectionResults.php @@ -120,4 +120,12 @@ protected function getVotable(string $type, int $id): Party|Candidate (new Candidate)->getMorphClass() => $this->candidates->find($id), }; } + + public function getEmbedUrl(): ?string + { + return route('front.elections.results.embed', [ + 'election' => $this->election, + ...$this->getQueryParameters(), + ]); + } } diff --git a/app/Livewire/Pages/ElectionTurnouts.php b/app/Livewire/Pages/ElectionTurnouts.php index a98643b..a331804 100644 --- a/app/Livewire/Pages/ElectionTurnouts.php +++ b/app/Livewire/Pages/ElectionTurnouts.php @@ -146,4 +146,12 @@ public function getLegend(): ?array ], ]; } + + public function getEmbedUrl(): string + { + return route('front.elections.turnout.embed', [ + 'election' => $this->election, + ...$this->getQueryParameters(), + ]); + } } diff --git a/app/Livewire/VoteMonitorStats.php b/app/Livewire/VoteMonitorStats.php new file mode 100644 index 0000000..9e5e9b6 --- /dev/null +++ b/app/Livewire/VoteMonitorStats.php @@ -0,0 +1,47 @@ +whereBelongsTo($this->election) + ->where('enabled', true) + ->orderBy('order') + ->get() + ->toArray(); + } + + #[Computed] + protected function count(): int + { + return \count($this->stats()); + } + + public function gridColumns(): string + { + return match ($this->count()) { + 1 => 'sm:grid-cols-1', + 2, 4 => 'sm:grid-cols-2', + 3 => 'sm:grid-cols-3', + default => 'sm:grid-cols-6', + }; + } + + public function render() + { + return view('livewire.vote-monitor-stats'); + } +} diff --git a/app/Models/Election.php b/app/Models/Election.php index de89a6c..2b82fbd 100644 --- a/app/Models/Election.php +++ b/app/Models/Election.php @@ -54,6 +54,11 @@ public function scheduledJobs(): HasMany return $this->hasMany(ScheduledJob::class); } + public function voteMonitorStats(): HasMany + { + return $this->hasMany(VoteMonitorStat::class); + } + public function scopeWhereLive(Builder $query): Builder { return $query->where('is_live', true); diff --git a/app/Models/Page.php b/app/Models/Page.php new file mode 100644 index 0000000..e5b1a7c --- /dev/null +++ b/app/Models/Page.php @@ -0,0 +1,28 @@ + */ + use HasFactory; + use HasSlug; + use InteractsWithMedia; + + protected static string $factory = PageFactory::class; + + protected $fillable = [ + 'title', + 'slug', + 'content', + ]; +} diff --git a/app/Models/VoteMonitorStat.php b/app/Models/VoteMonitorStat.php new file mode 100644 index 0000000..a831bf0 --- /dev/null +++ b/app/Models/VoteMonitorStat.php @@ -0,0 +1,50 @@ + */ + use HasFactory; + + protected static string $factory = VoteMonitorStatFactory::class; + + protected $fillable = [ + 'election_id', + 'key', + 'value', + 'enabled', + 'order', + ]; + + protected function casts(): array + { + return [ + 'key' => VoteMonitorStatKey::class, + 'value' => 'integer', + 'enabled' => 'boolean', + 'order' => 'integer', + ]; + } + + public function toArray(): array + { + return [ + 'value' => Number::format($this->value), + 'key' => $this->key->value, + 'label' => $this->key->getLabel(), + 'icon' => $this->key->getIcon(), + 'color' => $this->key->getColor(), + ]; + } +} diff --git a/app/Policies/PagePolicy.php b/app/Policies/PagePolicy.php new file mode 100644 index 0000000..4a9e2fb --- /dev/null +++ b/app/Policies/PagePolicy.php @@ -0,0 +1,67 @@ +isAdmin(); + } + + /** + * Determine whether the user can update the model. + */ + public function update(User $user, Page $page): bool + { + return $user->isAdmin(); + } + + /** + * Determine whether the user can delete the model. + */ + public function delete(User $user, Page $page): bool + { + return $user->isAdmin(); + } + + /** + * Determine whether the user can restore the model. + */ + public function restore(User $user, Page $page): bool + { + return $this->delete($user, $page); + } + + /** + * Determine whether the user can permanently delete the model. + */ + public function forceDelete(User $user, Page $page): bool + { + return $this->delete($user, $page); + } +} diff --git a/app/Policies/VoteMonitorStatPolicy.php b/app/Policies/VoteMonitorStatPolicy.php new file mode 100644 index 0000000..a5440c6 --- /dev/null +++ b/app/Policies/VoteMonitorStatPolicy.php @@ -0,0 +1,67 @@ +isAdmin($user); + } + + /** + * Determine whether the user can update the model. + */ + public function update(User $user, VoteMonitorStat $voteMonitorStat): bool + { + return $user->isAdmin($user); + } + + /** + * Determine whether the user can delete the model. + */ + public function delete(User $user, VoteMonitorStat $voteMonitorStat): bool + { + return $user->isAdmin($user); + } + + /** + * Determine whether the user can restore the model. + */ + public function restore(User $user, VoteMonitorStat $voteMonitorStat): bool + { + return $this->delete($user, $voteMonitorStat); + } + + /** + * Determine whether the user can permanently delete the model. + */ + public function forceDelete(User $user, VoteMonitorStat $voteMonitorStat): bool + { + return $this->delete($user, $voteMonitorStat); + } +} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index a94788c..81b0f37 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -5,6 +5,8 @@ namespace App\Providers; use App\Models\ScheduledJob; +use Filament\Actions\CreateAction; +use Filament\Resources\Pages\CreateRecord; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\Relation; @@ -41,6 +43,9 @@ public function boot(): void Number::useLocale($this->app->getLocale()); + CreateRecord::disableCreateAnother(); + CreateAction::configureUsing(fn (CreateAction $action) => $action->createAnother(false)); + $this->enforceMorphMap(); $this->resolveSchedule(); @@ -63,6 +68,7 @@ protected function enforceMorphMap(): void 'county' => \App\Models\County::class, 'election' => \App\Models\Election::class, 'locality' => \App\Models\Locality::class, + 'page' => \App\Models\Page::class, 'party' => \App\Models\Party::class, 'record' => \App\Models\Record::class, 'turnout' => \App\Models\Turnout::class, diff --git a/app/View/Components/Election/Title.php b/app/View/Components/Election/Title.php new file mode 100644 index 0000000..51fd090 --- /dev/null +++ b/app/View/Components/Election/Title.php @@ -0,0 +1,37 @@ +title = $title; + + $this->level = $level; + + $this->embedUrl = $embedUrl; + } + + public function render(): View + { + return view('components.election.title'); + } + + public function embedKey(): string + { + return hash('xxh128', "embed-{$this->embedUrl}"); + } +} diff --git a/composer.json b/composer.json index 8be51b1..c20fbec 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,9 @@ "php": "^8.2", "andreiio/blade-remix-icon": "^3.5", "archtechx/laravel-seo": "^0.10.1", + "awcodes/filament-tiptap-editor": "^3.4", "blade-ui-kit/blade-icons": "^1.7", + "codeat3/blade-google-material-design-icons": "^1.19", "filament/filament": "^3.2", "filament/spatie-laravel-media-library-plugin": "^3.2", "haydenpierce/class-finder": "^0.5.3", diff --git a/composer.lock b/composer.lock index c3a26b0..e986348 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "80a22baf77937d91ba5e0af4a3f11652", + "content-hash": "ef40933dd50f21c5a6d36047682c0207", "packages": [ { "name": "andreiio/blade-remix-icon", @@ -188,6 +188,88 @@ }, "time": "2024-05-03T22:09:30+00:00" }, + { + "name": "awcodes/filament-tiptap-editor", + "version": "v3.4.18", + "source": { + "type": "git", + "url": "https://github.com/awcodes/filament-tiptap-editor.git", + "reference": "f168de14e9c2e78779a8b571e2469aca7ad6f9f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/awcodes/filament-tiptap-editor/zipball/f168de14e9c2e78779a8b571e2469aca7ad6f9f5", + "reference": "f168de14e9c2e78779a8b571e2469aca7ad6f9f5", + "shasum": "" + }, + "require": { + "php": "^8.1", + "spatie/laravel-package-tools": "^1.9.2", + "ueberdosis/tiptap-php": "^1.1" + }, + "require-dev": { + "filament/filament": "^3.0", + "laravel/pint": "^1.0", + "nunomaduro/collision": "^7.0", + "orchestra/testbench": "^8.0", + "pestphp/pest": "^2.19", + "pestphp/pest-plugin-laravel": "^2.2", + "pestphp/pest-plugin-livewire": "^2.1", + "spatie/laravel-ray": "^1.26" + }, + "type": "package", + "extra": { + "laravel": { + "providers": [ + "FilamentTiptapEditor\\FilamentTiptapEditorServiceProvider" + ] + }, + "aliases": { + "TiptapConverter": "FilamentTiptapEditor\\Facades\\TiptapConverter" + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "FilamentTiptapEditor\\": "src/", + "FilamentTiptapEditor\\Tests\\": "tests/src", + "FilamentTiptapEditor\\Tests\\Database\\Factories\\": "tests/database/factories" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Adam Weston", + "email": "awcodes1@gmail.com", + "role": "Developer" + } + ], + "description": "A Tiptap integration for Filament Admin/Forms.", + "keywords": [ + "editor", + "filament", + "framework", + "laravel", + "tiptap", + "wysiwyg" + ], + "support": { + "issues": "https://github.com/awcodes/filament-tiptap-editor/issues", + "source": "https://github.com/awcodes/filament-tiptap-editor/tree/v3.4.18" + }, + "funding": [ + { + "url": "https://github.com/awcodes", + "type": "github" + } + ], + "time": "2024-11-04T13:22:48+00:00" + }, { "name": "aws/aws-crt-php", "version": "v1.2.7", @@ -739,6 +821,79 @@ ], "time": "2023-12-20T15:40:13+00:00" }, + { + "name": "codeat3/blade-google-material-design-icons", + "version": "1.19.0", + "source": { + "type": "git", + "url": "https://github.com/codeat3/blade-google-material-design-icons.git", + "reference": "7a20f3a763edc54dba69725660eff2b2e99f8dad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/codeat3/blade-google-material-design-icons/zipball/7a20f3a763edc54dba69725660eff2b2e99f8dad", + "reference": "7a20f3a763edc54dba69725660eff2b2e99f8dad", + "shasum": "" + }, + "require": { + "blade-ui-kit/blade-icons": "^1.1", + "illuminate/support": "^8.0|^9.0|^10.0|^11.0", + "php": "^7.4|^8.0" + }, + "require-dev": { + "codeat3/blade-icon-generation-helpers": "^0.8", + "codeat3/phpcs-styles": "^1.0", + "orchestra/testbench": "^6.0|^7.0|^8.0|^9.0", + "phpunit/phpunit": "^9.0|^10.5|^11.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Codeat3\\BladeGoogleMaterialDesignIcons\\BladeGoogleMaterialDesignIconsServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Codeat3\\BladeGoogleMaterialDesignIcons\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Swapnil Sarwe", + "homepage": "https://swapnilsarwe.com" + }, + { + "name": "Dries Vints", + "homepage": "https://driesvints.com" + } + ], + "description": "A package to easily make use of \"Google Fonts Material Icons\" in your Laravel Blade views.", + "homepage": "https://github.com/codeat3/blade-google-material-design-icons", + "keywords": [ + "blade", + "google", + "icons", + "laravel", + "material" + ], + "support": { + "issues": "https://github.com/codeat3/blade-google-material-design-icons/issues", + "source": "https://github.com/codeat3/blade-google-material-design-icons/tree/1.19.0" + }, + "funding": [ + { + "url": "https://github.com/swapnilsarwe", + "type": "github" + } + ], + "time": "2024-02-28T15:02:13+00:00" + }, { "name": "composer/semver", "version": "3.4.3", @@ -6793,6 +6948,84 @@ ], "time": "2024-02-26T18:08:49+00:00" }, + { + "name": "scrivo/highlight.php", + "version": "v9.18.1.10", + "source": { + "type": "git", + "url": "https://github.com/scrivo/highlight.php.git", + "reference": "850f4b44697a2552e892ffe71490ba2733c2fc6e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/scrivo/highlight.php/zipball/850f4b44697a2552e892ffe71490ba2733c2fc6e", + "reference": "850f4b44697a2552e892ffe71490ba2733c2fc6e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.4" + }, + "require-dev": { + "phpunit/phpunit": "^4.8|^5.7", + "sabberworm/php-css-parser": "^8.3", + "symfony/finder": "^2.8|^3.4|^5.4", + "symfony/var-dumper": "^2.8|^3.4|^5.4" + }, + "suggest": { + "ext-mbstring": "Allows highlighting code with unicode characters and supports language with unicode keywords" + }, + "type": "library", + "autoload": { + "files": [ + "HighlightUtilities/functions.php" + ], + "psr-0": { + "Highlight\\": "", + "HighlightUtilities\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Geert Bergman", + "homepage": "http://www.scrivo.org/", + "role": "Project Author" + }, + { + "name": "Vladimir Jimenez", + "homepage": "https://allejo.io", + "role": "Maintainer" + }, + { + "name": "Martin Folkers", + "homepage": "https://twobrain.io", + "role": "Contributor" + } + ], + "description": "Server side syntax highlighter that supports 185 languages. It's a PHP port of highlight.js", + "keywords": [ + "code", + "highlight", + "highlight.js", + "highlight.php", + "syntax" + ], + "support": { + "issues": "https://github.com/scrivo/highlight.php/issues", + "source": "https://github.com/scrivo/highlight.php" + }, + "funding": [ + { + "url": "https://github.com/allejo", + "type": "github" + } + ], + "time": "2022-12-17T21:53:22+00:00" + }, { "name": "sentry/sentry", "version": "4.10.0", @@ -7386,6 +7619,71 @@ ], "time": "2024-08-27T18:56:10+00:00" }, + { + "name": "spatie/shiki-php", + "version": "2.2.2", + "source": { + "type": "git", + "url": "https://github.com/spatie/shiki-php.git", + "reference": "05cbdd79180fdc71488047c27cfaf73be2b6c5fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/shiki-php/zipball/05cbdd79180fdc71488047c27cfaf73be2b6c5fc", + "reference": "05cbdd79180fdc71488047c27cfaf73be2b6c5fc", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^7.4|^8.0", + "symfony/process": "^5.4|^6.4|^7.1" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^v3.0", + "pestphp/pest": "^1.8", + "phpunit/phpunit": "^9.5", + "spatie/pest-plugin-snapshots": "^1.1", + "spatie/ray": "^1.10" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\ShikiPhp\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Rias Van der Veken", + "email": "rias@spatie.be", + "role": "Developer" + }, + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "role": "Developer" + } + ], + "description": "Highlight code using Shiki in PHP", + "homepage": "https://github.com/spatie/shiki-php", + "keywords": [ + "shiki", + "spatie" + ], + "support": { + "source": "https://github.com/spatie/shiki-php/tree/2.2.2" + }, + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2024-11-06T09:52:06+00:00" + }, { "name": "spatie/temporary-directory", "version": "2.2.1", @@ -10144,6 +10442,75 @@ ], "time": "2024-04-29T15:34:34+00:00" }, + { + "name": "ueberdosis/tiptap-php", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/ueberdosis/tiptap-php.git", + "reference": "640667176da4cdfaa84c32093171e0674c3c807f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ueberdosis/tiptap-php/zipball/640667176da4cdfaa84c32093171e0674c3c807f", + "reference": "640667176da4cdfaa84c32093171e0674c3c807f", + "shasum": "" + }, + "require": { + "php": "^7.4|^8.0", + "scrivo/highlight.php": "^9.18", + "spatie/shiki-php": "^2.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.5", + "pestphp/pest": "^1.21", + "phpunit/phpunit": "^9.5", + "vimeo/psalm": "^4.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Tiptap\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Hans Pagel", + "email": "humans@tiptap.dev", + "role": "Developer" + } + ], + "description": "A PHP package to work with Tiptap output", + "homepage": "https://github.com/ueberdosis/tiptap-php", + "keywords": [ + "prosemirror", + "tiptap", + "ueberdosis" + ], + "support": { + "issues": "https://github.com/ueberdosis/tiptap-php/issues", + "source": "https://github.com/ueberdosis/tiptap-php/tree/1.4.0" + }, + "funding": [ + { + "url": "https://tiptap.dev/pricing", + "type": "custom" + }, + { + "url": "https://github.com/ueberdosis", + "type": "github" + }, + { + "url": "https://opencollective.com/tiptap", + "type": "open_collective" + } + ], + "time": "2024-08-12T08:25:45+00:00" + }, { "name": "vlucas/phpdotenv", "version": "v5.6.1", diff --git a/database/factories/ElectionFactory.php b/database/factories/ElectionFactory.php index 182e430..fb39e23 100644 --- a/database/factories/ElectionFactory.php +++ b/database/factories/ElectionFactory.php @@ -5,6 +5,7 @@ namespace Database\Factories; use App\Enums\ElectionType; +use App\Enums\VoteMonitorStatKey; use App\Models\Candidate; use App\Models\Country; use App\Models\Election; @@ -13,7 +14,9 @@ use App\Models\Record; use App\Models\ScheduledJob; use App\Models\Turnout; +use App\Models\VoteMonitorStat; use Illuminate\Database\Eloquent\Factories\Factory; +use Illuminate\Database\Eloquent\Factories\Sequence; use Illuminate\Support\Collection; use Illuminate\Support\Lottery; use Illuminate\Support\Str; @@ -55,6 +58,16 @@ public function configure(): static ->count(2) ->create(); + VoteMonitorStat::factory() + ->for($election) + ->sequence( + fn (Sequence $sequence) => [ + 'key' => VoteMonitorStatKey::values()[$sequence->index], + ] + ) + ->count(\count(VoteMonitorStatKey::values())) + ->create(); + return; $parties = Party::factory() ->for($election) diff --git a/database/factories/PageFactory.php b/database/factories/PageFactory.php new file mode 100644 index 0000000..436a8d4 --- /dev/null +++ b/database/factories/PageFactory.php @@ -0,0 +1,32 @@ + + */ +class PageFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + $title = fake()->sentence(3); + + return [ + 'title' => $title, + 'slug' => Str::slug($title), + 'content' => collect(fake()->paragraphs(3)) + ->map(fn (string $paragraph) => "

{$paragraph}

") + ->join(''), + ]; + } +} diff --git a/database/factories/VoteMonitorStatFactory.php b/database/factories/VoteMonitorStatFactory.php new file mode 100644 index 0000000..5acb880 --- /dev/null +++ b/database/factories/VoteMonitorStatFactory.php @@ -0,0 +1,29 @@ + + */ +class VoteMonitorStatFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'election_id' => Election::factory(), + 'key' => null, + 'value' => fake()->numberBetween(0, 100_000), + 'enabled' => fake()->boolean(75), + ]; + } +} diff --git a/database/migrations/0001_01_20_000001_create_vote_monitor_stats_table.php b/database/migrations/0001_01_20_000001_create_vote_monitor_stats_table.php new file mode 100644 index 0000000..a1f3484 --- /dev/null +++ b/database/migrations/0001_01_20_000001_create_vote_monitor_stats_table.php @@ -0,0 +1,35 @@ +id(); + + $table->foreignIdFor(Election::class) + ->constrained() + ->cascadeOnDelete(); + + $table->string('key'); + + $table->integer('value')->unsigned(); + $table->boolean('enabled')->default(false); + $table->tinyInteger('order')->unsigned()->default(0); + + $table->timestamps(); + + $table->unique(['key', 'election_id']); + }); + } +}; diff --git a/database/migrations/0001_01_30_000000_create_pages_table.php b/database/migrations/0001_01_30_000000_create_pages_table.php new file mode 100644 index 0000000..f35a557 --- /dev/null +++ b/database/migrations/0001_01_30_000000_create_pages_table.php @@ -0,0 +1,24 @@ +id(); + $table->string('title'); + $table->string('slug')->unique(); + $table->text('content'); + $table->timestamps(); + }); + } +}; diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 11677c2..cd2c586 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -5,6 +5,7 @@ namespace Database\Seeders; use App\Models\Election; +use App\Models\Page; use App\Models\User; // use Illuminate\Database\Console\Seeds\WithoutModelEvents; use Illuminate\Database\Seeder; @@ -37,6 +38,10 @@ public function run(): void // ->withDiasporaRecords() ->create(); + Page::factory() + ->count(10) + ->create(); + Artisan::call('scout:rebuild'); } } diff --git a/lang/ro/app.php b/lang/ro/app.php index 0ee6e48..66a3db4 100644 --- a/lang/ro/app.php +++ b/lang/ro/app.php @@ -143,6 +143,13 @@ ], ], + 'page' => [ + 'label' => [ + 'singular' => 'pagină', + 'plural' => 'pagini', + ], + ], + 'cron' => [ 'every_minute' => '1 minut', 'every_2_minutes' => '2 minute', @@ -173,4 +180,12 @@ ], 'others' => 'Alții', + + 'vote_monitor_stats' => [ + 'observers' => 'Observatori logați în aplicație', + 'counties' => 'Județe acoperite', + 'polling_stations' => 'Secții de votare acoperite', + 'messages' => 'Mesaje trimise de către observatori', + 'problems' => 'Probleme sesizate', + ], ]; diff --git a/package-lock.json b/package-lock.json index b097376..794ead6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,8 @@ "packages": { "": { "devDependencies": { + "@iframe-resizer/child": "^5.3.2", + "@ryangjchandler/alpine-clipboard": "^2.3.0", "@tailwindcss/forms": "^0.5.9", "@tailwindcss/typography": "^0.5.15", "autoprefixer": "^10.4.20", @@ -16,7 +18,7 @@ "postcss-nesting": "^13.0.1", "prettier": "^3.3.3", "prettier-plugin-tailwindcss": "^0.6.8", - "tailwindcss": "^3.4.14", + "tailwindcss": "^3.4.15", "vite": "^5.4.11" } }, @@ -424,6 +426,17 @@ "node": ">=12" } }, + "node_modules/@iframe-resizer/child": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/@iframe-resizer/child/-/child-5.3.2.tgz", + "integrity": "sha512-y4uX26NzdAU1XRURiFCQCNTuLI04WTGUFQNcG4hfNZGvWO/BnfQ3fiVokQwZjnaQH7mzbGE2SLJqYUb1JIqF1Q==", + "dev": true, + "license": "GPL-3.0", + "funding": { + "type": "individual", + "url": "https://iframe-resizer.com/pricing/" + } + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -859,6 +872,13 @@ "win32" ] }, + "node_modules/@ryangjchandler/alpine-clipboard": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ryangjchandler/alpine-clipboard/-/alpine-clipboard-2.3.0.tgz", + "integrity": "sha512-r1YL/LL851vSemjgcca+M6Yz9SNtA9ATul8nJ0n0sAS1W3V1GUWvH0Od2XdQF1r36YJF+/4sUc0eHF/Zexw7dA==", + "dev": true, + "license": "MIT" + }, "node_modules/@tailwindcss/forms": { "version": "0.5.9", "resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.5.9.tgz", @@ -3407,34 +3427,34 @@ } }, "node_modules/tailwindcss": { - "version": "3.4.14", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.14.tgz", - "integrity": "sha512-IcSvOcTRcUtQQ7ILQL5quRDg7Xs93PdJEk1ZLbhhvJc7uj/OAhYOnruEiwnGgBvUtaUAJ8/mhSw1o8L2jCiENA==", + "version": "3.4.15", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.15.tgz", + "integrity": "sha512-r4MeXnfBmSOuKUWmXe6h2CcyfzJCEk4F0pptO5jlnYSIViUkVmsawj80N5h2lO3gwcmSb4n3PuN+e+GC1Guylw==", "dev": true, "license": "MIT", "dependencies": { "@alloc/quick-lru": "^5.2.0", "arg": "^5.0.2", - "chokidar": "^3.5.3", + "chokidar": "^3.6.0", "didyoumean": "^1.2.2", "dlv": "^1.1.3", - "fast-glob": "^3.3.0", + "fast-glob": "^3.3.2", "glob-parent": "^6.0.2", "is-glob": "^4.0.3", - "jiti": "^1.21.0", + "jiti": "^1.21.6", "lilconfig": "^2.1.0", - "micromatch": "^4.0.5", + "micromatch": "^4.0.8", "normalize-path": "^3.0.0", "object-hash": "^3.0.0", - "picocolors": "^1.0.0", - "postcss": "^8.4.23", + "picocolors": "^1.1.1", + "postcss": "^8.4.47", "postcss-import": "^15.1.0", "postcss-js": "^4.0.1", - "postcss-load-config": "^4.0.1", - "postcss-nested": "^6.0.1", - "postcss-selector-parser": "^6.0.11", - "resolve": "^1.22.2", - "sucrase": "^3.32.0" + "postcss-load-config": "^4.0.2", + "postcss-nested": "^6.2.0", + "postcss-selector-parser": "^6.1.2", + "resolve": "^1.22.8", + "sucrase": "^3.35.0" }, "bin": { "tailwind": "lib/cli.js", diff --git a/package.json b/package.json index 466a494..27a5fc8 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,8 @@ "build": "vite build" }, "devDependencies": { + "@iframe-resizer/child": "^5.3.2", + "@ryangjchandler/alpine-clipboard": "^2.3.0", "@tailwindcss/forms": "^0.5.9", "@tailwindcss/typography": "^0.5.15", "autoprefixer": "^10.4.20", @@ -17,7 +19,7 @@ "postcss-nesting": "^13.0.1", "prettier": "^3.3.3", "prettier-plugin-tailwindcss": "^0.6.8", - "tailwindcss": "^3.4.14", + "tailwindcss": "^3.4.15", "vite": "^5.4.11" } } diff --git a/public/css/awcodes/tiptap-editor/tiptap.css b/public/css/awcodes/tiptap-editor/tiptap.css new file mode 100644 index 0000000..a0f5ece --- /dev/null +++ b/public/css/awcodes/tiptap-editor/tiptap.css @@ -0,0 +1 @@ +.tiptap-editor .ProseMirror .hljs{background:rgba(var(--gray-800),1);color:#d6deeb;padding:.5rem 1rem;border-radius:.5rem;font-size:.875rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace,monospace}.tiptap-editor .ProseMirror .hljs-keyword{color:#c792ea}.tiptap-editor .ProseMirror .hljs-built_in{color:#addb67}.tiptap-editor .ProseMirror .hljs-type{color:#82aaff}.tiptap-editor .ProseMirror .hljs-literal{color:#ff5874}.tiptap-editor .ProseMirror .hljs-number{color:#f78c6c}.tiptap-editor .ProseMirror .hljs-regexp{color:#5ca7e4}.tiptap-editor .ProseMirror .hljs-string{color:#ecc48d}.tiptap-editor .ProseMirror .hljs-subst{color:#d3423e}.tiptap-editor .ProseMirror .hljs-symbol{color:#82aaff}.tiptap-editor .ProseMirror .hljs-class{color:#ffcb8b}.tiptap-editor .ProseMirror .hljs-function{color:#82aaff}.tiptap-editor .ProseMirror .hljs-title{color:#dcdcaa}.tiptap-editor .ProseMirror .hljs-params{color:#7fdbca}.tiptap-editor .ProseMirror .hljs-comment{color:#637777}.tiptap-editor .ProseMirror .hljs-doctag{color:#7fdbca}.tiptap-editor .ProseMirror .hljs-meta,.tiptap-editor .ProseMirror .hljs-meta .hljs-keyword{color:#82aaff}.tiptap-editor .ProseMirror .hljs-meta .hljs-string{color:#ecc48d}.tiptap-editor .ProseMirror .hljs-section{color:#82b1ff}.tiptap-editor .ProseMirror .hljs-attr,.tiptap-editor .ProseMirror .hljs-name,.tiptap-editor .ProseMirror .hljs-tag{color:#7fdbca}.tiptap-editor .ProseMirror .hljs-attribute{color:#80cbc4}.tiptap-editor .ProseMirror .hljs-variable{color:#addb67}.tiptap-editor .ProseMirror .hljs-bullet{color:#d9f5dd}.tiptap-editor .ProseMirror .hljs-code{color:#80cbc4}.tiptap-editor .ProseMirror .hljs-emphasis{color:#c792ea;font-style:italic}.tiptap-editor .ProseMirror .hljs-strong{color:#addb67;font-weight:700}.tiptap-editor .ProseMirror .hljs-formula{color:#c792ea}.tiptap-editor .ProseMirror .hljs-link{color:#ff869a}.tiptap-editor .ProseMirror .hljs-quote{color:#697098}.tiptap-editor .ProseMirror .hljs-selector-tag{color:#ff6363}.tiptap-editor .ProseMirror .hljs-selector-id{color:#fad430}.tiptap-editor .ProseMirror .hljs-selector-class{color:#addb67}.tiptap-editor .ProseMirror .hljs-selector-attr,.tiptap-editor .ProseMirror .hljs-selector-pseudo,.tiptap-editor .ProseMirror .hljs-template-tag{color:#c792ea}.tiptap-editor .ProseMirror .hljs-template-variable{color:#addb67}.tiptap-editor .ProseMirror .hljs-addition{color:#addb67;font-style:italic}.tiptap-editor .ProseMirror .hljs-deletion{color:#ef535090;font-style:italic}[wire\:key*=filament_tiptap_source] .fi-fo-component-ctn,[wire\:key*=filament_tiptap_source] .fi-fo-component-ctn>div,[wire\:key*=filament_tiptap_source] .fi-fo-component-ctn>div .fi-fo-field-wrp{height:100%}[wire\:key*=filament_tiptap_source] .fi-fo-component-ctn>div .fi-fo-field-wrp>div{height:100%;grid-template-rows:auto 1fr}[wire\:key*=filament_tiptap_source] .fi-fo-component-ctn>div .fi-fo-field-wrp>div .source_code_editor *{height:100%!important}.sorting .tiptap-wrapper{pointer-events:none}.tiptap-wrapper.tiptap-fullscreen{position:fixed;top:0;left:0;bottom:0;right:0;z-index:40;display:flex;flex-direction:column;height:100%}.tiptap-wrapper.tiptap-fullscreen .tiptap-toolbar{border-radius:0}.tiptap-wrapper.tiptap-fullscreen .tiptap-prosemirror-wrapper{max-height:100%;padding-block-end:3rem}.tiptap-editor .tiptap-content{display:flex;flex-direction:column}.tiptap-prosemirror-wrapper.prosemirror-w-sm{padding:0 max(1rem,calc(50% - 12rem))}.tiptap-prosemirror-wrapper.prosemirror-w-md{padding:0 max(1rem,calc(50% - 14rem))}.tiptap-prosemirror-wrapper.prosemirror-w-lg{padding:0 max(1rem,calc(50% - 16rem))}.tiptap-prosemirror-wrapper.prosemirror-w-xl{padding:0 max(1rem,calc(50% - 18rem))}.tiptap-prosemirror-wrapper.prosemirror-w-2xl{padding:0 max(1rem,calc(50% - 21rem))}.tiptap-prosemirror-wrapper.prosemirror-w-3xl{padding:0 max(1rem,calc(50% - 24rem))}.tiptap-prosemirror-wrapper.prosemirror-w-4xl{padding:0 max(1rem,calc(50% - 28rem))}.tiptap-prosemirror-wrapper.prosemirror-w-5xl{padding:0 max(1rem,calc(50% - 32rem))}.tiptap-prosemirror-wrapper.prosemirror-w-6xl{padding:0 max(1rem,calc(50% - 36rem))}.tiptap-prosemirror-wrapper.prosemirror-w-7xl{padding:0 max(1rem,calc(50% - 40rem))}.tiptap-prosemirror-wrapper.prosemirror-w-none{padding:0 1rem}.tiptap-editor .ProseMirror{border-bottom-left-radius:.375rem;border-bottom-right-radius:.375rem;flex:1 1 0;padding-block:1rem;margin-inline:auto;position:relative;width:100%;color:#000}.tiptap-editor .ProseMirror.ProseMirror-focused .ProseMirror-selectednode{outline-style:dashed;outline-width:2px;outline-offset:2px;outline-color:rgba(var(--gray-700),1)}.tiptap-editor .ProseMirror.ProseMirror-focused .ProseMirror-selectednode:is(.dark *){outline-color:rgba(var(--gray-300),1)}.tiptap-editor .ProseMirror .tiptap-block-wrapper{overflow:hidden;border-radius:.375rem;--tw-bg-opacity:1;background-color:rgba(var(--gray-100),var(--tw-bg-opacity))}.tiptap-editor .ProseMirror .tiptap-block-wrapper:is(.dark *){--tw-bg-opacity:1;background-color:rgba(var(--gray-800),var(--tw-bg-opacity))}.tiptap-editor .ProseMirror .tiptap-block-wrapper .tiptap-block .tiptap-block-heading{display:flex;align-items:center;justify-content:space-between;--tw-bg-opacity:1;background-color:rgba(var(--gray-200),var(--tw-bg-opacity));padding:.25rem .75rem;line-height:1;--tw-text-opacity:1;color:rgba(var(--gray-900),var(--tw-text-opacity))}.tiptap-editor .ProseMirror .tiptap-block-wrapper .tiptap-block .tiptap-block-heading:is(.dark *){--tw-bg-opacity:1;background-color:rgba(var(--gray-950),var(--tw-bg-opacity));--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.tiptap-editor .ProseMirror .tiptap-block-wrapper .tiptap-block .tiptap-block-heading .tiptap-block-title{font-size:.875rem;line-height:1.25rem;font-weight:700;text-transform:uppercase;opacity:.8}.tiptap-editor .ProseMirror .tiptap-block-wrapper .tiptap-block .tiptap-block-actions{display:flex;align-items:center;gap:.5rem}.tiptap-editor .ProseMirror .tiptap-block-wrapper .tiptap-block .tiptap-block-actions button{opacity:.75}.tiptap-editor .ProseMirror .tiptap-block-wrapper .tiptap-block .tiptap-block-actions button:focus,.tiptap-editor .ProseMirror .tiptap-block-wrapper .tiptap-block .tiptap-block-actions button:hover{--tw-text-opacity:1;color:rgba(var(--primary-500),var(--tw-text-opacity));opacity:1}.tiptap-editor .ProseMirror .tiptap-block-wrapper .tiptap-block .preview{padding:1rem}.tiptap-editor .ProseMirror .filament-tiptap-hurdle{width:100%;max-width:100vw;padding-block:1rem;background-color:rgba(var(--gray-800),1);position:relative}.tiptap-editor .ProseMirror .filament-tiptap-hurdle:after,.tiptap-editor .ProseMirror .filament-tiptap-hurdle:before{content:"";position:absolute;display:block;width:100%;top:0;bottom:0;background-color:inherit}.tiptap-editor .ProseMirror .filament-tiptap-hurdle:before{left:-100%}.tiptap-editor .ProseMirror .filament-tiptap-hurdle:after{right:-100%}.tiptap-editor .ProseMirror .filament-tiptap-hurdle[data-color=gray_light]{color:rgba(var(--gray-900),1);background-color:rgba(var(--gray-300),1)}.tiptap-editor .ProseMirror .filament-tiptap-hurdle[data-color=gray]{color:#fff;background-color:rgba(var(--gray-500),1)}.tiptap-editor .ProseMirror .filament-tiptap-hurdle[data-color=gray_dark]{color:#fff;background-color:rgba(var(--gray-800),1)}.tiptap-editor .ProseMirror .filament-tiptap-hurdle[data-color=primary]{color:rgba(var(--gray-900),1);background-color:rgba(var(--primary-500),1)}.tiptap-editor .ProseMirror .filament-tiptap-hurdle[data-color=secondary]{color:rgba(var(--gray-900),1);background-color:rgba(var(--warning-500),1)}.tiptap-editor .ProseMirror .filament-tiptap-hurdle[data-color=tertiary]{color:#fff;background-color:rgba(var(--success-500),1)}.tiptap-editor .ProseMirror .filament-tiptap-hurdle[data-color=accent]{color:#fff;background-color:rgba(var(--danger-500),1)}.tiptap-editor .ProseMirror.ProseMirror-focused{outline:none}.tiptap-editor .ProseMirror>*+*{margin-block-start:1rem}.tiptap-editor .ProseMirror>*+h1,.tiptap-editor .ProseMirror>*+h2,.tiptap-editor .ProseMirror>*+h3,.tiptap-editor .ProseMirror>*+h4,.tiptap-editor .ProseMirror>*+h5,.tiptap-editor .ProseMirror>*+h6{margin-block-start:2rem}.tiptap-editor .ProseMirror img{display:inline-block}.tiptap-editor .ProseMirror h1,.tiptap-editor .ProseMirror h2,.tiptap-editor .ProseMirror h3,.tiptap-editor .ProseMirror h4,.tiptap-editor .ProseMirror h5,.tiptap-editor .ProseMirror h6{font-weight:700}.tiptap-editor .ProseMirror h1{font-size:1.75rem;line-height:1.1}.tiptap-editor .ProseMirror h2{font-size:1.5rem;line-height:1.1}.tiptap-editor .ProseMirror h3{font-size:1.25rem;line-height:1.25}.tiptap-editor .ProseMirror h4{font-size:1.125rem}.tiptap-editor .ProseMirror .lead{font-size:1.375rem;line-height:1.3}.tiptap-editor .ProseMirror small{font-size:.75rem}.tiptap-editor .ProseMirror ol>:not([hidden])~:not([hidden]),.tiptap-editor .ProseMirror ul>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem*var(--tw-space-y-reverse))}.tiptap-editor .ProseMirror ol,.tiptap-editor .ProseMirror ul{padding-inline-start:1rem;margin-inline-start:1rem}.tiptap-editor .ProseMirror ul{list-style:disc}.tiptap-editor .ProseMirror ol{list-style:decimal}.tiptap-editor .ProseMirror ul.checked-list{list-style-type:none;margin-inline-start:0}.tiptap-editor .ProseMirror ul.checked-list li{display:flex;align-items:baseline;gap:.375em}.tiptap-editor .ProseMirror ul.checked-list li:before{content:"✓";width:1.25rem;height:1.25rem;flex-shrink:0}.tiptap-editor .ProseMirror blockquote{border-left:.25rem solid rgba(var(--gray-400),1);padding-inline-start:.5rem;margin-inline-start:1rem;font-size:1.25rem}.tiptap-editor .ProseMirror hr{border-color:rgba(var(--gray-400),1)}.tiptap-editor .ProseMirror a{color:#2563eb;text-decoration:underline}.tiptap-editor .ProseMirror a[id]{color:#000;text-decoration:none}.tiptap-editor .ProseMirror a[id]:before{content:"# ";color:rgba(var(--gray-500),1);opacity:1}.tiptap-editor .ProseMirror a[data-as-button=true]{background-color:rgba(var(--gray-900),1);color:#fff!important;text-decoration:none;display:inline-block;border-radius:.375rem;padding:.5rem 1.25rem}.tiptap-editor .ProseMirror a[data-as-button=true][data-as-button-theme=primary]{background-color:rgba(var(--primary-600),1)}.tiptap-editor .ProseMirror a[data-as-button=true][data-as-button-theme=secondary]{background-color:rgba(var(--warning-600),1)}.tiptap-editor .ProseMirror a[data-as-button=true][data-as-button-theme=tertiary]{background-color:rgba(var(--success-600),1)}.tiptap-editor .ProseMirror a[data-as-button=true][data-as-button-theme=accent]{background-color:rgba(var(--danger-600),1)}.tiptap-editor .ProseMirror sup{font-size:65%}.tiptap-editor .ProseMirror img{border:2px dashed transparent}.tiptap-editor .ProseMirror img.ProseMirror-selectednode{border-radius:.25rem;outline-offset:2px;outline:rgba(var(--gray-900),1) dashed 2px}.tiptap-editor .ProseMirror table{border-collapse:collapse;margin:0;overflow:hidden;table-layout:fixed;width:100%;position:relative}.tiptap-editor .ProseMirror table td,.tiptap-editor .ProseMirror table th{border:1px solid rgba(var(--gray-400),1);min-width:1em;padding:3px 5px;vertical-align:top;background-clip:padding-box}.tiptap-editor .ProseMirror table td>*,.tiptap-editor .ProseMirror table th>*{margin-bottom:0}.tiptap-editor .ProseMirror table th{background-color:rgba(var(--gray-200),1);color:rgba(var(--gray-700),1);font-weight:700;text-align:left}.tiptap-editor .ProseMirror table .selectedCell{position:relative}.tiptap-editor .ProseMirror table .selectedCell:after{background:rgba(200,200,255,.4);content:"";left:0;right:0;top:0;bottom:0;pointer-events:none;position:absolute;z-index:2}.tiptap-editor .ProseMirror table .column-resize-handle{background-color:#adf;bottom:-2px;position:absolute;right:-2px;pointer-events:none;top:0;width:4px}.tiptap-editor .ProseMirror table p{margin:0}.tiptap-editor .ProseMirror .tableWrapper{padding:1rem 0;overflow-x:auto}.tiptap-editor .ProseMirror .resize-cursor{cursor:col-resize}.tiptap-editor .ProseMirror pre{padding:.75rem 1rem;border-radius:.25rem;font-size:.875rem}.tiptap-editor .ProseMirror pre code{border-radius:0;padding-inline:0}.tiptap-editor .ProseMirror code{background-color:rgba(var(--gray-300),1);border-radius:.25rem;padding-inline:.25rem}.tiptap-editor .ProseMirror pre.hljs{direction:ltr}.tiptap-editor .ProseMirror pre.hljs code{background-color:transparent}.tiptap-editor .ProseMirror .filament-tiptap-grid,.tiptap-editor .ProseMirror .filament-tiptap-grid-builder{display:grid;gap:1rem;box-sizing:border-box}.tiptap-editor .ProseMirror .filament-tiptap-grid .filament-tiptap-grid-builder__column,.tiptap-editor .ProseMirror .filament-tiptap-grid .filament-tiptap-grid__column,.tiptap-editor .ProseMirror .filament-tiptap-grid-builder .filament-tiptap-grid-builder__column,.tiptap-editor .ProseMirror .filament-tiptap-grid-builder .filament-tiptap-grid__column{box-sizing:border-box;border-style:dashed;border-width:1px;border-color:rgba(var(--gray-400),1);padding:.5rem;border-radius:.25rem}.tiptap-editor .ProseMirror .filament-tiptap-grid .filament-tiptap-grid-builder__column>*+*,.tiptap-editor .ProseMirror .filament-tiptap-grid .filament-tiptap-grid__column>*+*,.tiptap-editor .ProseMirror .filament-tiptap-grid-builder .filament-tiptap-grid-builder__column>*+*,.tiptap-editor .ProseMirror .filament-tiptap-grid-builder .filament-tiptap-grid__column>*+*{margin-block-start:1rem}.tiptap-editor .ProseMirror .filament-tiptap-grid-builder.ProseMirror-selectednode,.tiptap-editor .ProseMirror .filament-tiptap-grid.ProseMirror-selectednode{border-radius:.25rem;outline-offset:2px;outline:rgba(var(--gray-900),1) dashed 2px}.tiptap-editor .ProseMirror .filament-tiptap-grid[type^=asymetric]{grid-template-columns:1fr;grid-template-rows:auto}@media (max-width:640px){.tiptap-editor .ProseMirror .filament-tiptap-grid-builder[data-stack-at=sm]{grid-template-columns:1fr!important}.tiptap-editor .ProseMirror .filament-tiptap-grid-builder[data-stack-at=sm] .filament-tiptap-grid-builder__column{grid-column:span 1!important}}@media (max-width:768px){.tiptap-editor .ProseMirror .filament-tiptap-grid-builder[data-stack-at=md]{grid-template-columns:1fr!important}.tiptap-editor .ProseMirror .filament-tiptap-grid-builder[data-stack-at=md] .filament-tiptap-grid-builder__column{grid-column:span 1!important}}@media (max-width:1024px){.tiptap-editor .ProseMirror .filament-tiptap-grid-builder[data-stack-at=lg]{grid-template-columns:1fr!important}.tiptap-editor .ProseMirror .filament-tiptap-grid-builder[data-stack-at=lg] .filament-tiptap-grid-builder__column{grid-column:span 1!important}}@media (min-width:768px){.tiptap-editor .ProseMirror .filament-tiptap-grid[type=asymetric-right-thirds]{grid-template-columns:1fr 2fr}.tiptap-editor .ProseMirror .filament-tiptap-grid[type=asymetric-left-thirds]{grid-template-columns:2fr 1fr}.tiptap-editor .ProseMirror .filament-tiptap-grid[type=asymetric-right-fourths]{grid-template-columns:1fr 3fr}.tiptap-editor .ProseMirror .filament-tiptap-grid[type=asymetric-left-fourths]{grid-template-columns:3fr 1fr}}.tiptap-editor .ProseMirror .filament-tiptap-grid[type=responsive]{grid-template-columns:1fr;grid-template-rows:auto}@media (min-width:768px){.tiptap-editor .ProseMirror .filament-tiptap-grid[type=responsive][cols="2"]{grid-template-columns:repeat(2,1fr)}.tiptap-editor .ProseMirror .filament-tiptap-grid[type=responsive][cols="3"]{grid-template-columns:repeat(3,1fr)}.tiptap-editor .ProseMirror .filament-tiptap-grid[type=responsive][cols="4"]{grid-template-columns:repeat(2,1fr)}}@media (min-width:1024px){.tiptap-editor .ProseMirror .filament-tiptap-grid[type=responsive][cols="4"]{grid-template-columns:repeat(4,1fr)}}@media (min-width:768px){.tiptap-editor .ProseMirror .filament-tiptap-grid[type=responsive][cols="5"]{grid-template-columns:repeat(5,1fr)}}.tiptap-editor .ProseMirror .filament-tiptap-grid[type=fixed][cols="2"]{grid-template-columns:repeat(2,1fr)}.tiptap-editor .ProseMirror .filament-tiptap-grid[type=fixed][cols="3"]{grid-template-columns:repeat(3,1fr)}.tiptap-editor .ProseMirror .filament-tiptap-grid[type=fixed][cols="4"]{grid-template-columns:repeat(4,1fr)}.tiptap-editor .ProseMirror .filament-tiptap-grid[type=fixed][cols="5"]{grid-template-columns:repeat(5,1fr)}.tiptap-editor .ProseMirror [data-native-video],.tiptap-editor .ProseMirror [data-vimeo-video],.tiptap-editor .ProseMirror [data-youtube-video]{border:1px dashed transparent}.tiptap-editor .ProseMirror [data-native-video].ProseMirror-selectednode,.tiptap-editor .ProseMirror [data-vimeo-video].ProseMirror-selectednode,.tiptap-editor .ProseMirror [data-youtube-video].ProseMirror-selectednode{border-radius:.25rem;outline-offset:2px;outline:rgba(var(--gray-900),1) dashed 2px}.tiptap-editor .ProseMirror [data-native-video] iframe,.tiptap-editor .ProseMirror [data-native-video] video,.tiptap-editor .ProseMirror [data-vimeo-video] iframe,.tiptap-editor .ProseMirror [data-vimeo-video] video,.tiptap-editor .ProseMirror [data-youtube-video] iframe,.tiptap-editor .ProseMirror [data-youtube-video] video{pointer-events:none}.tiptap-editor .ProseMirror div[data-type=details]{box-sizing:border-box;border-style:dashed;border-width:1px;border-color:rgba(var(--gray-400),1);border-radius:.25rem;position:relative}.tiptap-editor .ProseMirror div[data-type=details] button{position:absolute;z-index:1;top:.125rem;right:.25rem;color:rgba(var(--gray-400),1)}.tiptap-editor .ProseMirror div[data-type=details] summary{padding:.375rem .5rem;font-weight:700;border-bottom:1px solid rgba(var(--gray-200),1)}.tiptap-editor .ProseMirror div[data-type=details] summary::marker{content:"";display:none}.tiptap-editor .ProseMirror div[data-type=details] div[data-type=details-content]{padding:.5rem;height:auto}.tiptap-editor .ProseMirror div[data-type=details] div[data-type=details-content]>*+*{margin-block-start:1rem}.dark .tiptap-editor .ProseMirror{color:rgba(var(--gray-200),1)}.dark .tiptap-editor .ProseMirror blockquote{border-left-color:rgba(var(--gray-500),1)}.dark .tiptap-editor .ProseMirror hr{border-color:rgba(var(--gray-500),1)}.dark .tiptap-editor .ProseMirror a{color:#60a5fa}.dark .tiptap-editor .ProseMirror a[id]{color:rgba(var(--gray-200),1)}.dark .tiptap-editor .ProseMirror code{background-color:rgba(var(--gray-800),1)}.dark .tiptap-editor .ProseMirror table td,.dark .tiptap-editor .ProseMirror table th{border-color:rgba(var(--gray-600),1)}.dark .tiptap-editor .ProseMirror table th{background-color:rgba(var(--gray-800),1);color:rgba(var(--gray-100),1)}.dark .tiptap-editor .ProseMirror .filament-tiptap-grid .filament-tiptap-grid__column{border-color:rgba(var(--gray-500),1)}.dark .tiptap-editor .ProseMirror .filament-tiptap-grid.ProseMirror-selectednode,.dark .tiptap-editor .ProseMirror [data-native-video].ProseMirror-selectednode,.dark .tiptap-editor .ProseMirror [data-vimeo-video].ProseMirror-selectednode,.dark .tiptap-editor .ProseMirror [data-youtube-video].ProseMirror-selectednode,.dark .tiptap-editor .ProseMirror img.ProseMirror-selectednode{outline-color:rgba(var(--gray-400),1)}.dark .tiptap-editor .ProseMirror div[data-type=details]{box-sizing:border-box;border-color:rgba(var(--gray-500),1);border-radius:.25rem;position:relative}.dark .tiptap-editor .ProseMirror div[data-type=details] summary{border-bottom-color:rgba(var(--gray-500),1)}.dark .tiptap-editor .ProseMirror-focused .ProseMirror-gapcursor:after{border-top:1px solid #fff}.filament-tiptap-editor-source-modal textarea{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace monospace}.tiptap-editor p.is-editor-empty:first-child:before{content:attr(data-placeholder);float:left;height:0;pointer-events:none;--tw-text-opacity:1;color:rgba(var(--gray-400),var(--tw-text-opacity))}.tiptap-editor p.is-editor-empty:first-child:is(.dark *):before{--tw-text-opacity:1;color:rgba(var(--gray-500),var(--tw-text-opacity))}.tippy-content-p-0{margin:-.25rem -.5rem}span[data-type=mergeTag]{margin-left:.25rem;margin-right:.25rem;border-radius:.25rem;--tw-bg-opacity:1;background-color:rgba(var(--gray-100),var(--tw-bg-opacity));padding:.25rem .5rem}span[data-type=mergeTag]:is(.dark *){--tw-bg-opacity:1;background-color:rgba(var(--gray-800),var(--tw-bg-opacity))} \ No newline at end of file diff --git a/public/js/awcodes/tiptap-editor/components/tiptap.js b/public/js/awcodes/tiptap-editor/components/tiptap.js new file mode 100644 index 0000000..965ef70 --- /dev/null +++ b/public/js/awcodes/tiptap-editor/components/tiptap.js @@ -0,0 +1,237 @@ +var Xk=Object.create;var cy=Object.defineProperty;var Zk=Object.getOwnPropertyDescriptor;var jk=Object.getOwnPropertyNames;var Qk=Object.getPrototypeOf,eO=Object.prototype.hasOwnProperty;var jd=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var tO=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of jk(e))!eO.call(t,i)&&i!==n&&cy(t,i,{get:()=>e[i],enumerable:!(r=Zk(e,i))||r.enumerable});return t};var Qd=(t,e,n)=>(n=t!=null?Xk(Qk(t)):{},tO(e||!t||!t.__esModule?cy(n,"default",{value:t,enumerable:!0}):n,t));var sS=jd((oq,oS)=>{function q_(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{let n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&q_(n)}),t}var Mu=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function Y_(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Ci(t,...e){let n=Object.create(null);for(let r in t)n[r]=t[r];return e.forEach(function(r){for(let i in r)n[i]=r[i]}),n}var $F="",z_=t=>!!t.scope,zF=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){let n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`},Sm=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=Y_(e)}openNode(e){if(!z_(e))return;let n=zF(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){z_(e)&&(this.buffer+=$F)}value(){return this.buffer}span(e){this.buffer+=``}},U_=(t={})=>{let e={children:[]};return Object.assign(e,t),e},Tm=class t{constructor(){this.rootNode=U_(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n=U_({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{t._collapse(n)}))}},Cm=class extends Tm{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){let r=e.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new Sm(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function xa(t){return t?typeof t=="string"?t:t.source:null}function J_(t){return Eo("(?=",t,")")}function UF(t){return Eo("(?:",t,")*")}function WF(t){return Eo("(?:",t,")?")}function Eo(...t){return t.map(n=>xa(n)).join("")}function KF(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Mm(...t){return"("+(KF(t).capture?"":"?:")+t.map(r=>xa(r)).join("|")+")"}function X_(t){return new RegExp(t.toString()+"|").exec("").length-1}function VF(t,e){let n=t&&t.exec(e);return n&&n.index===0}var GF=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Nm(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;let i=n,o=xa(r),s="";for(;o.length>0;){let l=GF.exec(o);if(!l){s+=o;break}s+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?s+="\\"+String(Number(l[1])+i):(s+=l[0],l[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(e)}var qF=/\b\B/,Z_="[a-zA-Z]\\w*",km="[a-zA-Z_]\\w*",j_="\\b\\d+(\\.\\d+)?",Q_="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",eS="\\b(0b[01]+)",YF="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",JF=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=Eo(e,/.*\b/,t.binary,/\b.*/)),Ci({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},_a={begin:"\\\\[\\s\\S]",relevance:0},XF={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[_a]},ZF={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[_a]},jF={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ku=function(t,e,n={}){let r=Ci({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=Mm("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:Eo(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},QF=ku("//","$"),eH=ku("/\\*","\\*/"),tH=ku("#","$"),nH={scope:"number",begin:j_,relevance:0},rH={scope:"number",begin:Q_,relevance:0},iH={scope:"number",begin:eS,relevance:0},oH={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[_a,{begin:/\[/,end:/\]/,relevance:0,contains:[_a]}]}]},sH={scope:"title",begin:Z_,relevance:0},aH={scope:"title",begin:km,relevance:0},lH={begin:"\\.\\s*"+km,relevance:0},cH=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},Au=Object.freeze({__proto__:null,MATCH_NOTHING_RE:qF,IDENT_RE:Z_,UNDERSCORE_IDENT_RE:km,NUMBER_RE:j_,C_NUMBER_RE:Q_,BINARY_NUMBER_RE:eS,RE_STARTERS_RE:YF,SHEBANG:JF,BACKSLASH_ESCAPE:_a,APOS_STRING_MODE:XF,QUOTE_STRING_MODE:ZF,PHRASAL_WORDS_MODE:jF,COMMENT:ku,C_LINE_COMMENT_MODE:QF,C_BLOCK_COMMENT_MODE:eH,HASH_COMMENT_MODE:tH,NUMBER_MODE:nH,C_NUMBER_MODE:rH,BINARY_NUMBER_MODE:iH,REGEXP_MODE:oH,TITLE_MODE:sH,UNDERSCORE_TITLE_MODE:aH,METHOD_GUARD:lH,END_SAME_AS_BEGIN:cH});function uH(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function dH(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function fH(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=uH,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function pH(t,e){Array.isArray(t.illegal)&&(t.illegal=Mm(...t.illegal))}function hH(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function mH(t,e){t.relevance===void 0&&(t.relevance=1)}var gH=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=Eo(n.beforeMatch,J_(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},bH=["of","and","for","in","not","or","if","then","parent","list","value"],yH="keyword";function tS(t,e,n=yH){let r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(o){Object.assign(r,tS(t[o],e,o))}),r;function i(o,s){e&&(s=s.map(l=>l.toLowerCase())),s.forEach(function(l){let c=l.split("|");r[c[0]]=[o,EH(c[0],c[1])]})}}function EH(t,e){return e?Number(e):vH(t)?0:1}function vH(t){return bH.includes(t.toLowerCase())}var W_={},yo=t=>{console.error(t)},K_=(t,...e)=>{console.log(`WARN: ${t}`,...e)},fs=(t,e)=>{W_[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),W_[`${t}/${e}`]=!0)},Nu=new Error;function nS(t,e,{key:n}){let r=0,i=t[n],o={},s={};for(let l=1;l<=e.length;l++)s[l+r]=i[l],o[l+r]=!0,r+=X_(e[l-1]);t[n]=s,t[n]._emit=o,t[n]._multi=!0}function wH(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw yo("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Nu;if(typeof t.beginScope!="object"||t.beginScope===null)throw yo("beginScope must be object"),Nu;nS(t,t.begin,{key:"beginScope"}),t.begin=Nm(t.begin,{joinWith:""})}}function xH(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw yo("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Nu;if(typeof t.endScope!="object"||t.endScope===null)throw yo("endScope must be object"),Nu;nS(t,t.end,{key:"endScope"}),t.end=Nm(t.end,{joinWith:""})}}function _H(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function SH(t){_H(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),wH(t),xH(t)}function TH(t){function e(s,l){return new RegExp(xa(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=X_(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let l=this.regexes.map(c=>c[1]);this.matcherRe=e(Nm(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;let c=this.matcherRe.exec(l);if(!c)return null;let d=c.findIndex((h,m)=>m>0&&h!==void 0),f=this.matchIndexes[d];return c.splice(0,d),Object.assign(c,f)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];let c=new n;return this.rules.slice(l).forEach(([d,f])=>c.addRule(d,f)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){let c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let d=c.exec(l);if(this.resumingScanAtSamePosition()&&!(d&&d.index===this.lastIndex)){let f=this.getMatcher(0);f.lastIndex=this.lastIndex+1,d=f.exec(l)}return d&&(this.regexIndex+=d.position+1,this.regexIndex===this.count&&this.considerAll()),d}}function i(s){let l=new r;return s.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),s.terminatorEnd&&l.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&l.addRule(s.illegal,{type:"illegal"}),l}function o(s,l){let c=s;if(s.isCompiled)return c;[dH,hH,SH,gH].forEach(f=>f(s,l)),t.compilerExtensions.forEach(f=>f(s,l)),s.__beforeBegin=null,[fH,pH,mH].forEach(f=>f(s,l)),s.isCompiled=!0;let d=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),d=s.keywords.$pattern,delete s.keywords.$pattern),d=d||/\w+/,s.keywords&&(s.keywords=tS(s.keywords,t.case_insensitive)),c.keywordPatternRe=e(d,!0),l&&(s.begin||(s.begin=/\B|\b/),c.beginRe=e(c.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(c.endRe=e(c.end)),c.terminatorEnd=xa(c.end)||"",s.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(s.end?"|":"")+l.terminatorEnd)),s.illegal&&(c.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(f){return CH(f==="self"?s:f)})),s.contains.forEach(function(f){o(f,c)}),s.starts&&o(s.starts,l),c.matcher=i(c),c}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Ci(t.classNameAliases||{}),o(t)}function rS(t){return t?t.endsWithParent||rS(t.starts):!1}function CH(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Ci(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:rS(t)?Ci(t,{starts:t.starts?Ci(t.starts):null}):Object.isFrozen(t)?Ci(t):t}var AH="11.8.0",Am=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},_m=Y_,V_=Ci,G_=Symbol("nomatch"),MH=7,iS=function(t){let e=Object.create(null),n=Object.create(null),r=[],i=!0,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Cm};function c(A){return l.noHighlightRe.test(A)}function d(A){let R=A.className+" ";R+=A.parentNode?A.parentNode.className:"";let K=l.languageDetectRe.exec(R);if(K){let J=z(K[1]);return J||(K_(o.replace("{}",K[1])),K_("Falling back to no-highlight mode for this block.",A)),J?K[1]:"no-highlight"}return R.split(/\s+/).find(J=>c(J)||z(J))}function f(A,R,K){let J="",se="";typeof R=="object"?(J=A,K=R.ignoreIllegals,se=R.language):(fs("10.7.0","highlight(lang, code, ...args) has been deprecated."),fs("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),se=A,J=R),K===void 0&&(K=!0);let be={code:J,language:se};ge("before:highlight",be);let De=be.result?be.result:h(be.language,be.code,K);return De.code=be.code,ge("after:highlight",De),De}function h(A,R,K,J){let se=Object.create(null);function be(I,F){return I.keywords[F]}function De(){if(!V.keywords){we.addText(fe);return}let I=0;V.keywordPatternRe.lastIndex=0;let F=V.keywordPatternRe.exec(fe),X="";for(;F;){X+=fe.substring(I,F.index);let oe=Je.case_insensitive?F[0].toLowerCase():F[0],Fe=be(V,oe);if(Fe){let[rt,xr]=Fe;if(we.addText(X),X="",se[oe]=(se[oe]||0)+1,se[oe]<=MH&&(ct+=xr),rt.startsWith("_"))X+=F[0];else{let B=Je.classNameAliases[rt]||rt;Be(F[0],B)}}else X+=F[0];I=V.keywordPatternRe.lastIndex,F=V.keywordPatternRe.exec(fe)}X+=fe.substring(I),we.addText(X)}function je(){if(fe==="")return;let I=null;if(typeof V.subLanguage=="string"){if(!e[V.subLanguage]){we.addText(fe);return}I=h(V.subLanguage,fe,!0,bt[V.subLanguage]),bt[V.subLanguage]=I._top}else I=y(fe,V.subLanguage.length?V.subLanguage:null);V.relevance>0&&(ct+=I.relevance),we.__addSublanguage(I._emitter,I.language)}function Me(){V.subLanguage!=null?je():De(),fe=""}function Be(I,F){I!==""&&(we.startScope(F),we.addText(I),we.endScope())}function wt(I,F){let X=1,oe=F.length-1;for(;X<=oe;){if(!I._emit[X]){X++;continue}let Fe=Je.classNameAliases[I[X]]||I[X],rt=F[X];Fe?Be(rt,Fe):(fe=rt,De(),fe=""),X++}}function Nt(I,F){return I.scope&&typeof I.scope=="string"&&we.openNode(Je.classNameAliases[I.scope]||I.scope),I.beginScope&&(I.beginScope._wrap?(Be(fe,Je.classNameAliases[I.beginScope._wrap]||I.beginScope._wrap),fe=""):I.beginScope._multi&&(wt(I.beginScope,F),fe="")),V=Object.create(I,{parent:{value:V}}),V}function Oe(I,F,X){let oe=VF(I.endRe,X);if(oe){if(I["on:end"]){let Fe=new Mu(I);I["on:end"](F,Fe),Fe.isMatchIgnored&&(oe=!1)}if(oe){for(;I.endsParent&&I.parent;)I=I.parent;return I}}if(I.endsWithParent)return Oe(I.parent,F,X)}function xt(I){return V.matcher.regexIndex===0?(fe+=I[0],1):(kt=!0,0)}function Jt(I){let F=I[0],X=I.rule,oe=new Mu(X),Fe=[X.__beforeBegin,X["on:begin"]];for(let rt of Fe)if(rt&&(rt(I,oe),oe.isMatchIgnored))return xt(F);return X.skip?fe+=F:(X.excludeBegin&&(fe+=F),Me(),!X.returnBegin&&!X.excludeBegin&&(fe=F)),Nt(X,I),X.returnBegin?0:F.length}function pt(I){let F=I[0],X=R.substring(I.index),oe=Oe(V,I,X);if(!oe)return G_;let Fe=V;V.endScope&&V.endScope._wrap?(Me(),Be(F,V.endScope._wrap)):V.endScope&&V.endScope._multi?(Me(),wt(V.endScope,I)):Fe.skip?fe+=F:(Fe.returnEnd||Fe.excludeEnd||(fe+=F),Me(),Fe.excludeEnd&&(fe=F));do V.scope&&we.closeNode(),!V.skip&&!V.subLanguage&&(ct+=V.relevance),V=V.parent;while(V!==oe.parent);return oe.starts&&Nt(oe.starts,I),Fe.returnEnd?0:F.length}function sn(){let I=[];for(let F=V;F!==Je;F=F.parent)F.scope&&I.unshift(F.scope);I.forEach(F=>we.openNode(F))}let Xt={};function _t(I,F){let X=F&&F[0];if(fe+=I,X==null)return Me(),0;if(Xt.type==="begin"&&F.type==="end"&&Xt.index===F.index&&X===""){if(fe+=R.slice(F.index,F.index+1),!i){let oe=new Error(`0 width match regex (${A})`);throw oe.languageName=A,oe.badRule=Xt.rule,oe}return 1}if(Xt=F,F.type==="begin")return Jt(F);if(F.type==="illegal"&&!K){let oe=new Error('Illegal lexeme "'+X+'" for mode "'+(V.scope||"")+'"');throw oe.mode=V,oe}else if(F.type==="end"){let oe=pt(F);if(oe!==G_)return oe}if(F.type==="illegal"&&X==="")return 1;if(Pt>1e5&&Pt>F.index*3)throw new Error("potential infinite loop, way more iterations than matches");return fe+=X,X.length}let Je=z(A);if(!Je)throw yo(o.replace("{}",A)),new Error('Unknown language: "'+A+'"');let Xn=TH(Je),Lt="",V=J||Xn,bt={},we=new l.__emitter(l);sn();let fe="",ct=0,ut=0,Pt=0,kt=!1;try{if(Je.__emitTokens)Je.__emitTokens(R,we);else{for(V.matcher.considerAll();;){Pt++,kt?kt=!1:V.matcher.considerAll(),V.matcher.lastIndex=ut;let I=V.matcher.exec(R);if(!I)break;let F=R.substring(ut,I.index),X=_t(F,I);ut=I.index+X}_t(R.substring(ut))}return we.finalize(),Lt=we.toHTML(),{language:A,value:Lt,relevance:ct,illegal:!1,_emitter:we,_top:V}}catch(I){if(I.message&&I.message.includes("Illegal"))return{language:A,value:_m(R),illegal:!0,relevance:0,_illegalBy:{message:I.message,index:ut,context:R.slice(ut-100,ut+100),mode:I.mode,resultSoFar:Lt},_emitter:we};if(i)return{language:A,value:_m(R),illegal:!1,relevance:0,errorRaised:I,_emitter:we,_top:V};throw I}}function m(A){let R={value:_m(A),illegal:!1,relevance:0,_top:s,_emitter:new l.__emitter(l)};return R._emitter.addText(A),R}function y(A,R){R=R||l.languages||Object.keys(e);let K=m(A),J=R.filter(z).filter(he).map(Me=>h(Me,A,!1));J.unshift(K);let se=J.sort((Me,Be)=>{if(Me.relevance!==Be.relevance)return Be.relevance-Me.relevance;if(Me.language&&Be.language){if(z(Me.language).supersetOf===Be.language)return 1;if(z(Be.language).supersetOf===Me.language)return-1}return 0}),[be,De]=se,je=be;return je.secondBest=De,je}function b(A,R,K){let J=R&&n[R]||K;A.classList.add("hljs"),A.classList.add(`language-${J}`)}function w(A){let R=null,K=d(A);if(c(K))return;if(ge("before:highlightElement",{el:A,language:K}),A.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(A)),l.throwUnescapedHTML))throw new Am("One of your code blocks includes unescaped HTML.",A.innerHTML);R=A;let J=R.textContent,se=K?f(J,{language:K,ignoreIllegals:!0}):y(J);A.innerHTML=se.value,b(A,K,se.language),A.result={language:se.language,re:se.relevance,relevance:se.relevance},se.secondBest&&(A.secondBest={language:se.secondBest.language,relevance:se.secondBest.relevance}),ge("after:highlightElement",{el:A,result:se,text:J})}function _(A){l=V_(l,A)}let S=()=>{T(),fs("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function L(){T(),fs("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let D=!1;function T(){if(document.readyState==="loading"){D=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function $(){D&&T()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",$,!1);function O(A,R){let K=null;try{K=R(t)}catch(J){if(yo("Language definition for '{}' could not be registered.".replace("{}",A)),i)yo(J);else throw J;K=s}K.name||(K.name=A),e[A]=K,K.rawDefinition=R.bind(null,t),K.aliases&&re(K.aliases,{languageName:A})}function Y(A){delete e[A];for(let R of Object.keys(n))n[R]===A&&delete n[R]}function ee(){return Object.keys(e)}function z(A){return A=(A||"").toLowerCase(),e[A]||e[n[A]]}function re(A,{languageName:R}){typeof A=="string"&&(A=[A]),A.forEach(K=>{n[K.toLowerCase()]=R})}function he(A){let R=z(A);return R&&!R.disableAutodetect}function Se(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=R=>{A["before:highlightBlock"](Object.assign({block:R.el},R))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=R=>{A["after:highlightBlock"](Object.assign({block:R.el},R))})}function me(A){Se(A),r.push(A)}function Ce(A){let R=r.indexOf(A);R!==-1&&r.splice(R,1)}function ge(A,R){let K=A;r.forEach(function(J){J[K]&&J[K](R)})}function _e(A){return fs("10.7.0","highlightBlock will be removed entirely in v12.0"),fs("10.7.0","Please use highlightElement now."),w(A)}Object.assign(t,{highlight:f,highlightAuto:y,highlightAll:T,highlightElement:w,highlightBlock:_e,configure:_,initHighlighting:S,initHighlightingOnLoad:L,registerLanguage:O,unregisterLanguage:Y,listLanguages:ee,getLanguage:z,registerAliases:re,autoDetection:he,inherit:V_,addPlugin:me,removePlugin:Ce}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=AH,t.regex={concat:Eo,lookahead:J_,either:Mm,optional:WF,anyNumberOfTimes:UF};for(let A in Au)typeof Au[A]=="object"&&q_(Au[A]);return Object.assign(t,Au),t},ps=iS({});ps.newInstance=()=>iS({});oS.exports=ps;ps.HighlightJS=ps;ps.default=ps});var lS=jd((aq,Om)=>{(function(){var t;typeof Om<"u"?t=Om.exports=r:t=function(){return this||(0,eval)("this")}(),t.format=r,t.vsprintf=n,typeof console<"u"&&typeof console.log=="function"&&(t.printf=e);function e(){console.log(r.apply(null,arguments))}function n(i,o){return r.apply(null,[i].concat(o))}function r(i){for(var o=1,s=[].slice.call(arguments),l=0,c=i.length,d="",f,h=!1,m,y,b=!1,w,_=function(){return s[o++]},S=function(){for(var L="";/\d/.test(i[l]);)L+=i[l++],f=i[l];return L.length>0?parseInt(L):null};l{(function(){var t,e="4.17.21",n=200,r="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",o="Invalid `variable` option passed into `_.template`",s="__lodash_hash_undefined__",l=500,c="__lodash_placeholder__",d=1,f=2,h=4,m=1,y=2,b=1,w=2,_=4,S=8,L=16,D=32,T=64,$=128,O=256,Y=512,ee=30,z="...",re=800,he=16,Se=1,me=2,Ce=3,ge=1/0,_e=9007199254740991,A=17976931348623157e292,R=NaN,K=4294967295,J=K-1,se=K>>>1,be=[["ary",$],["bind",b],["bindKey",w],["curry",S],["curryRight",L],["flip",Y],["partial",D],["partialRight",T],["rearg",O]],De="[object Arguments]",je="[object Array]",Me="[object AsyncFunction]",Be="[object Boolean]",wt="[object Date]",Nt="[object DOMException]",Oe="[object Error]",xt="[object Function]",Jt="[object GeneratorFunction]",pt="[object Map]",sn="[object Number]",Xt="[object Null]",_t="[object Object]",Je="[object Promise]",Xn="[object Proxy]",Lt="[object RegExp]",V="[object Set]",bt="[object String]",we="[object Symbol]",fe="[object Undefined]",ct="[object WeakMap]",ut="[object WeakSet]",Pt="[object ArrayBuffer]",kt="[object DataView]",I="[object Float32Array]",F="[object Float64Array]",X="[object Int8Array]",oe="[object Int16Array]",Fe="[object Int32Array]",rt="[object Uint8Array]",xr="[object Uint8ClampedArray]",B="[object Uint16Array]",ae="[object Uint32Array]",xe=/\b__p \+= '';/g,qe=/\b(__p \+=) '' \+/g,Ke=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Bt=/&(?:amp|lt|gt|quot|#39);/g,an=/[&<>"']/g,Jr=RegExp(Bt.source),Ma=RegExp(an.source),_r=/<%-([\s\S]+?)%>/g,bs=/<%([\s\S]+?)%>/g,Mi=/<%=([\s\S]+?)%>/g,Xr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$u=/^\w*$/,ys=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zr=/[\\^$.*+?()[\]{}|]/g,AS=RegExp(Zr.source),zu=/^\s+/,MS=/\s/,NS=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,kS=/\{\n\/\* \[wrapped with (.+)\] \*/,OS=/,? & /,RS=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,IS=/[()=,{}\[\]\/\s]/,DS=/\\(\\)?/g,LS=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Bm=/\w*$/,PS=/^[-+]0x[0-9a-f]+$/i,BS=/^0b[01]+$/i,FS=/^\[object .+?Constructor\]$/,HS=/^0o[0-7]+$/i,$S=/^(?:0|[1-9]\d*)$/,zS=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Na=/($^)/,US=/['\n\r\u2028\u2029\\]/g,ka="\\ud800-\\udfff",WS="\\u0300-\\u036f",KS="\\ufe20-\\ufe2f",VS="\\u20d0-\\u20ff",Fm=WS+KS+VS,Hm="\\u2700-\\u27bf",$m="a-z\\xdf-\\xf6\\xf8-\\xff",GS="\\xac\\xb1\\xd7\\xf7",qS="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",YS="\\u2000-\\u206f",JS=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",zm="A-Z\\xc0-\\xd6\\xd8-\\xde",Um="\\ufe0e\\ufe0f",Wm=GS+qS+YS+JS,Uu="['\u2019]",XS="["+ka+"]",Km="["+Wm+"]",Oa="["+Fm+"]",Vm="\\d+",ZS="["+Hm+"]",Gm="["+$m+"]",qm="[^"+ka+Wm+Vm+Hm+$m+zm+"]",Wu="\\ud83c[\\udffb-\\udfff]",jS="(?:"+Oa+"|"+Wu+")",Ym="[^"+ka+"]",Ku="(?:\\ud83c[\\udde6-\\uddff]){2}",Vu="[\\ud800-\\udbff][\\udc00-\\udfff]",wo="["+zm+"]",Jm="\\u200d",Xm="(?:"+Gm+"|"+qm+")",QS="(?:"+wo+"|"+qm+")",Zm="(?:"+Uu+"(?:d|ll|m|re|s|t|ve))?",jm="(?:"+Uu+"(?:D|LL|M|RE|S|T|VE))?",Qm=jS+"?",eg="["+Um+"]?",e1="(?:"+Jm+"(?:"+[Ym,Ku,Vu].join("|")+")"+eg+Qm+")*",t1="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",n1="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",tg=eg+Qm+e1,r1="(?:"+[ZS,Ku,Vu].join("|")+")"+tg,i1="(?:"+[Ym+Oa+"?",Oa,Ku,Vu,XS].join("|")+")",o1=RegExp(Uu,"g"),s1=RegExp(Oa,"g"),Gu=RegExp(Wu+"(?="+Wu+")|"+i1+tg,"g"),a1=RegExp([wo+"?"+Gm+"+"+Zm+"(?="+[Km,wo,"$"].join("|")+")",QS+"+"+jm+"(?="+[Km,wo+Xm,"$"].join("|")+")",wo+"?"+Xm+"+"+Zm,wo+"+"+jm,n1,t1,Vm,r1].join("|"),"g"),l1=RegExp("["+Jm+ka+Fm+Um+"]"),c1=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,u1=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],d1=-1,it={};it[I]=it[F]=it[X]=it[oe]=it[Fe]=it[rt]=it[xr]=it[B]=it[ae]=!0,it[De]=it[je]=it[Pt]=it[Be]=it[kt]=it[wt]=it[Oe]=it[xt]=it[pt]=it[sn]=it[_t]=it[Lt]=it[V]=it[bt]=it[ct]=!1;var tt={};tt[De]=tt[je]=tt[Pt]=tt[kt]=tt[Be]=tt[wt]=tt[I]=tt[F]=tt[X]=tt[oe]=tt[Fe]=tt[pt]=tt[sn]=tt[_t]=tt[Lt]=tt[V]=tt[bt]=tt[we]=tt[rt]=tt[xr]=tt[B]=tt[ae]=!0,tt[Oe]=tt[xt]=tt[ct]=!1;var f1={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},p1={"&":"&","<":"<",">":">",'"':""","'":"'"},h1={"&":"&","<":"<",">":">",""":'"',"'":"'"},m1={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},g1=parseFloat,b1=parseInt,ng=typeof global=="object"&&global&&global.Object===Object&&global,y1=typeof self=="object"&&self&&self.Object===Object&&self,Ft=ng||y1||Function("return this")(),qu=typeof gs=="object"&&gs&&!gs.nodeType&&gs,Ni=qu&&typeof Aa=="object"&&Aa&&!Aa.nodeType&&Aa,rg=Ni&&Ni.exports===qu,Yu=rg&&ng.process,kn=function(){try{var N=Ni&&Ni.require&&Ni.require("util").types;return N||Yu&&Yu.binding&&Yu.binding("util")}catch{}}(),ig=kn&&kn.isArrayBuffer,og=kn&&kn.isDate,sg=kn&&kn.isMap,ag=kn&&kn.isRegExp,lg=kn&&kn.isSet,cg=kn&&kn.isTypedArray;function _n(N,H,P){switch(P.length){case 0:return N.call(H);case 1:return N.call(H,P[0]);case 2:return N.call(H,P[0],P[1]);case 3:return N.call(H,P[0],P[1],P[2])}return N.apply(H,P)}function E1(N,H,P,ie){for(var Ae=-1,Ye=N==null?0:N.length;++Ae-1}function Ju(N,H,P){for(var ie=-1,Ae=N==null?0:N.length;++ie-1;);return P}function bg(N,H){for(var P=N.length;P--&&xo(H,N[P],0)>-1;);return P}function M1(N,H){for(var P=N.length,ie=0;P--;)N[P]===H&&++ie;return ie}var N1=Qu(f1),k1=Qu(p1);function O1(N){return"\\"+m1[N]}function R1(N,H){return N==null?t:N[H]}function _o(N){return l1.test(N)}function I1(N){return c1.test(N)}function D1(N){for(var H,P=[];!(H=N.next()).done;)P.push(H.value);return P}function rd(N){var H=-1,P=Array(N.size);return N.forEach(function(ie,Ae){P[++H]=[Ae,ie]}),P}function yg(N,H){return function(P){return N(H(P))}}function ei(N,H){for(var P=-1,ie=N.length,Ae=0,Ye=[];++P-1}function wT(a,u){var p=this.__data__,g=Ja(p,a);return g<0?(++this.size,p.push([a,u])):p[g][1]=u,this}Sr.prototype.clear=bT,Sr.prototype.delete=yT,Sr.prototype.get=ET,Sr.prototype.has=vT,Sr.prototype.set=wT;function Tr(a){var u=-1,p=a==null?0:a.length;for(this.clear();++u=u?a:u)),a}function Dn(a,u,p,g,E,x){var C,M=u&d,k=u&f,U=u&h;if(p&&(C=E?p(a,g,E,x):p(a)),C!==t)return C;if(!dt(a))return a;var W=Ne(a);if(W){if(C=TC(a),!M)return mn(a,C)}else{var q=jt(a),te=q==xt||q==Jt;if(ai(a))return eb(a,M);if(q==_t||q==De||te&&!E){if(C=k||te?{}:Eb(a),!M)return k?hC(a,BT(C,a)):pC(a,kg(C,a))}else{if(!tt[q])return E?a:{};C=CC(a,q,M)}}x||(x=new jn);var de=x.get(a);if(de)return de;x.set(a,C),Yb(a)?a.forEach(function(ve){C.add(Dn(ve,u,p,ve,a,x))}):Gb(a)&&a.forEach(function(ve,$e){C.set($e,Dn(ve,u,p,$e,a,x))});var Ee=U?k?Nd:Md:k?bn:Ht,Le=W?t:Ee(a);return On(Le||a,function(ve,$e){Le&&($e=ve,ve=a[$e]),Ts(C,$e,Dn(ve,u,p,$e,a,x))}),C}function FT(a){var u=Ht(a);return function(p){return Og(p,a,u)}}function Og(a,u,p){var g=p.length;if(a==null)return!g;for(a=Qe(a);g--;){var E=p[g],x=u[E],C=a[E];if(C===t&&!(E in a)||!x(C))return!1}return!0}function Rg(a,u,p){if(typeof a!="function")throw new Rn(i);return Rs(function(){a.apply(t,p)},u)}function Cs(a,u,p,g){var E=-1,x=Ra,C=!0,M=a.length,k=[],U=u.length;if(!M)return k;p&&(u=at(u,Sn(p))),g?(x=Ju,C=!1):u.length>=n&&(x=Es,C=!1,u=new Ri(u));e:for(;++EE?0:E+p),g=g===t||g>E?E:Re(g),g<0&&(g+=E),g=p>g?0:Xb(g);p0&&p(M)?u>1?Kt(M,u-1,p,g,E):Qr(E,M):g||(E[E.length]=M)}return E}var ud=sb(),Lg=sb(!0);function ur(a,u){return a&&ud(a,u,Ht)}function dd(a,u){return a&&Lg(a,u,Ht)}function Za(a,u){return jr(u,function(p){return kr(a[p])})}function Di(a,u){u=oi(u,a);for(var p=0,g=u.length;a!=null&&pu}function zT(a,u){return a!=null&&Ze.call(a,u)}function UT(a,u){return a!=null&&u in Qe(a)}function WT(a,u,p){return a>=Zt(u,p)&&a=120&&W.length>=120)?new Ri(C&&W):t}W=a[0];var q=-1,te=M[0];e:for(;++q-1;)M!==a&&Ua.call(M,k,1),Ua.call(a,k,1);return a}function Gg(a,u){for(var p=a?u.length:0,g=p-1;p--;){var E=u[p];if(p==g||E!==x){var x=E;Nr(E)?Ua.call(a,E,1):wd(a,E)}}return a}function yd(a,u){return a+Va(Cg()*(u-a+1))}function nC(a,u,p,g){for(var E=-1,x=Rt(Ka((u-a)/(p||1)),0),C=P(x);x--;)C[g?x:++E]=a,a+=p;return C}function Ed(a,u){var p="";if(!a||u<1||u>_e)return p;do u%2&&(p+=a),u=Va(u/2),u&&(a+=a);while(u);return p}function He(a,u){return Pd(xb(a,u,yn),a+"")}function rC(a){return Ng(Io(a))}function iC(a,u){var p=Io(a);return ll(p,Ii(u,0,p.length))}function Ns(a,u,p,g){if(!dt(a))return a;u=oi(u,a);for(var E=-1,x=u.length,C=x-1,M=a;M!=null&&++EE?0:E+u),p=p>E?E:p,p<0&&(p+=E),E=u>p?0:p-u>>>0,u>>>=0;for(var x=P(E);++g>>1,C=a[x];C!==null&&!Cn(C)&&(p?C<=u:C=n){var U=u?null:yC(a);if(U)return Da(U);C=!1,E=Es,k=new Ri}else k=u?[]:M;e:for(;++g=g?a:Ln(a,u,p)}var Qg=J1||function(a){return Ft.clearTimeout(a)};function eb(a,u){if(u)return a.slice();var p=a.length,g=wg?wg(p):new a.constructor(p);return a.copy(g),g}function Td(a){var u=new a.constructor(a.byteLength);return new $a(u).set(new $a(a)),u}function cC(a,u){var p=u?Td(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.byteLength)}function uC(a){var u=new a.constructor(a.source,Bm.exec(a));return u.lastIndex=a.lastIndex,u}function dC(a){return Ss?Qe(Ss.call(a)):{}}function tb(a,u){var p=u?Td(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.length)}function nb(a,u){if(a!==u){var p=a!==t,g=a===null,E=a===a,x=Cn(a),C=u!==t,M=u===null,k=u===u,U=Cn(u);if(!M&&!U&&!x&&a>u||x&&C&&k&&!M&&!U||g&&C&&k||!p&&k||!E)return 1;if(!g&&!x&&!U&&a=M)return k;var U=p[g];return k*(U=="desc"?-1:1)}}return a.index-u.index}function rb(a,u,p,g){for(var E=-1,x=a.length,C=p.length,M=-1,k=u.length,U=Rt(x-C,0),W=P(k+U),q=!g;++M1?p[E-1]:t,C=E>2?p[2]:t;for(x=a.length>3&&typeof x=="function"?(E--,x):t,C&&cn(p[0],p[1],C)&&(x=E<3?t:x,E=1),u=Qe(u);++g-1?E[x?u[C]:C]:t}}function cb(a){return Mr(function(u){var p=u.length,g=p,E=In.prototype.thru;for(a&&u.reverse();g--;){var x=u[g];if(typeof x!="function")throw new Rn(i);if(E&&!C&&sl(x)=="wrapper")var C=new In([],!0)}for(g=C?g:p;++g1&&Ve.reverse(),W&&k<$e&&(Ve.length=k),this&&this!==Ft&&this instanceof ve&&(Rr=Le||ks(Rr)),Rr.apply(er,Ve)}return ve}function ub(a,u){return function(p,g){return KT(p,a,u(g),{})}}function rl(a,u){return function(p,g){var E;if(p===t&&g===t)return u;if(p!==t&&(E=p),g!==t){if(E===t)return g;typeof p=="string"||typeof g=="string"?(p=Tn(p),g=Tn(g)):(p=Jg(p),g=Jg(g)),E=a(p,g)}return E}}function Cd(a){return Mr(function(u){return u=at(u,Sn(ye())),He(function(p){var g=this;return a(u,function(E){return _n(E,g,p)})})})}function il(a,u){u=u===t?" ":Tn(u);var p=u.length;if(p<2)return p?Ed(u,a):u;var g=Ed(u,Ka(a/So(u)));return _o(u)?si(Zn(g),0,a).join(""):g.slice(0,a)}function bC(a,u,p,g){var E=u&b,x=ks(a);function C(){for(var M=-1,k=arguments.length,U=-1,W=g.length,q=P(W+k),te=this&&this!==Ft&&this instanceof C?x:a;++UM))return!1;var U=x.get(a),W=x.get(u);if(U&&W)return U==u&&W==a;var q=-1,te=!0,de=p&y?new Ri:t;for(x.set(a,u),x.set(u,a);++q1?"& ":"")+u[g],u=u.join(p>2?", ":" "),a.replace(NS,`{ +/* [wrapped with `+u+`] */ +`)}function MC(a){return Ne(a)||Bi(a)||!!(Sg&&a&&a[Sg])}function Nr(a,u){var p=typeof a;return u=u??_e,!!u&&(p=="number"||p!="symbol"&&$S.test(a))&&a>-1&&a%1==0&&a0){if(++u>=re)return arguments[0]}else u=0;return a.apply(t,arguments)}}function ll(a,u){var p=-1,g=a.length,E=g-1;for(u=u===t?g:u;++p1?a[u-1]:t;return p=typeof p=="function"?(a.pop(),p):t,Db(a,p)});function Lb(a){var u=v(a);return u.__chain__=!0,u}function HA(a,u){return u(a),a}function cl(a,u){return u(a)}var $A=Mr(function(a){var u=a.length,p=u?a[0]:0,g=this.__wrapped__,E=function(x){return cd(x,a)};return u>1||this.__actions__.length||!(g instanceof Ue)||!Nr(p)?this.thru(E):(g=g.slice(p,+p+(u?1:0)),g.__actions__.push({func:cl,args:[E],thisArg:t}),new In(g,this.__chain__).thru(function(x){return u&&!x.length&&x.push(t),x}))});function zA(){return Lb(this)}function UA(){return new In(this.value(),this.__chain__)}function WA(){this.__values__===t&&(this.__values__=Jb(this.value()));var a=this.__index__>=this.__values__.length,u=a?t:this.__values__[this.__index__++];return{done:a,value:u}}function KA(){return this}function VA(a){for(var u,p=this;p instanceof Ya;){var g=Mb(p);g.__index__=0,g.__values__=t,u?E.__wrapped__=g:u=g;var E=g;p=p.__wrapped__}return E.__wrapped__=a,u}function GA(){var a=this.__wrapped__;if(a instanceof Ue){var u=a;return this.__actions__.length&&(u=new Ue(this)),u=u.reverse(),u.__actions__.push({func:cl,args:[Bd],thisArg:t}),new In(u,this.__chain__)}return this.thru(Bd)}function qA(){return Zg(this.__wrapped__,this.__actions__)}var YA=tl(function(a,u,p){Ze.call(a,p)?++a[p]:Cr(a,p,1)});function JA(a,u,p){var g=Ne(a)?ug:HT;return p&&cn(a,u,p)&&(u=t),g(a,ye(u,3))}function XA(a,u){var p=Ne(a)?jr:Dg;return p(a,ye(u,3))}var ZA=lb(Nb),jA=lb(kb);function QA(a,u){return Kt(ul(a,u),1)}function eM(a,u){return Kt(ul(a,u),ge)}function tM(a,u,p){return p=p===t?1:Re(p),Kt(ul(a,u),p)}function Pb(a,u){var p=Ne(a)?On:ri;return p(a,ye(u,3))}function Bb(a,u){var p=Ne(a)?v1:Ig;return p(a,ye(u,3))}var nM=tl(function(a,u,p){Ze.call(a,p)?a[p].push(u):Cr(a,p,[u])});function rM(a,u,p,g){a=gn(a)?a:Io(a),p=p&&!g?Re(p):0;var E=a.length;return p<0&&(p=Rt(E+p,0)),ml(a)?p<=E&&a.indexOf(u,p)>-1:!!E&&xo(a,u,p)>-1}var iM=He(function(a,u,p){var g=-1,E=typeof u=="function",x=gn(a)?P(a.length):[];return ri(a,function(C){x[++g]=E?_n(u,C,p):As(C,u,p)}),x}),oM=tl(function(a,u,p){Cr(a,p,u)});function ul(a,u){var p=Ne(a)?at:$g;return p(a,ye(u,3))}function sM(a,u,p,g){return a==null?[]:(Ne(u)||(u=u==null?[]:[u]),p=g?t:p,Ne(p)||(p=p==null?[]:[p]),Kg(a,u,p))}var aM=tl(function(a,u,p){a[p?0:1].push(u)},function(){return[[],[]]});function lM(a,u,p){var g=Ne(a)?Xu:hg,E=arguments.length<3;return g(a,ye(u,4),p,E,ri)}function cM(a,u,p){var g=Ne(a)?w1:hg,E=arguments.length<3;return g(a,ye(u,4),p,E,Ig)}function uM(a,u){var p=Ne(a)?jr:Dg;return p(a,pl(ye(u,3)))}function dM(a){var u=Ne(a)?Ng:rC;return u(a)}function fM(a,u,p){(p?cn(a,u,p):u===t)?u=1:u=Re(u);var g=Ne(a)?DT:iC;return g(a,u)}function pM(a){var u=Ne(a)?LT:sC;return u(a)}function hM(a){if(a==null)return 0;if(gn(a))return ml(a)?So(a):a.length;var u=jt(a);return u==pt||u==V?a.size:md(a).length}function mM(a,u,p){var g=Ne(a)?Zu:aC;return p&&cn(a,u,p)&&(u=t),g(a,ye(u,3))}var gM=He(function(a,u){if(a==null)return[];var p=u.length;return p>1&&cn(a,u[0],u[1])?u=[]:p>2&&cn(u[0],u[1],u[2])&&(u=[u[0]]),Kg(a,Kt(u,1),[])}),dl=X1||function(){return Ft.Date.now()};function bM(a,u){if(typeof u!="function")throw new Rn(i);return a=Re(a),function(){if(--a<1)return u.apply(this,arguments)}}function Fb(a,u,p){return u=p?t:u,u=a&&u==null?a.length:u,Ar(a,$,t,t,t,t,u)}function Hb(a,u){var p;if(typeof u!="function")throw new Rn(i);return a=Re(a),function(){return--a>0&&(p=u.apply(this,arguments)),a<=1&&(u=t),p}}var Hd=He(function(a,u,p){var g=b;if(p.length){var E=ei(p,Oo(Hd));g|=D}return Ar(a,g,u,p,E)}),$b=He(function(a,u,p){var g=b|w;if(p.length){var E=ei(p,Oo($b));g|=D}return Ar(u,g,a,p,E)});function zb(a,u,p){u=p?t:u;var g=Ar(a,S,t,t,t,t,t,u);return g.placeholder=zb.placeholder,g}function Ub(a,u,p){u=p?t:u;var g=Ar(a,L,t,t,t,t,t,u);return g.placeholder=Ub.placeholder,g}function Wb(a,u,p){var g,E,x,C,M,k,U=0,W=!1,q=!1,te=!0;if(typeof a!="function")throw new Rn(i);u=Bn(u)||0,dt(p)&&(W=!!p.leading,q="maxWait"in p,x=q?Rt(Bn(p.maxWait)||0,u):x,te="trailing"in p?!!p.trailing:te);function de(Et){var er=g,Rr=E;return g=E=t,U=Et,C=a.apply(Rr,er),C}function Ee(Et){return U=Et,M=Rs($e,u),W?de(Et):C}function Le(Et){var er=Et-k,Rr=Et-U,ly=u-er;return q?Zt(ly,x-Rr):ly}function ve(Et){var er=Et-k,Rr=Et-U;return k===t||er>=u||er<0||q&&Rr>=x}function $e(){var Et=dl();if(ve(Et))return Ve(Et);M=Rs($e,Le(Et))}function Ve(Et){return M=t,te&&g?de(Et):(g=E=t,C)}function An(){M!==t&&Qg(M),U=0,g=k=E=M=t}function un(){return M===t?C:Ve(dl())}function Mn(){var Et=dl(),er=ve(Et);if(g=arguments,E=this,k=Et,er){if(M===t)return Ee(k);if(q)return Qg(M),M=Rs($e,u),de(k)}return M===t&&(M=Rs($e,u)),C}return Mn.cancel=An,Mn.flush=un,Mn}var yM=He(function(a,u){return Rg(a,1,u)}),EM=He(function(a,u,p){return Rg(a,Bn(u)||0,p)});function vM(a){return Ar(a,Y)}function fl(a,u){if(typeof a!="function"||u!=null&&typeof u!="function")throw new Rn(i);var p=function(){var g=arguments,E=u?u.apply(this,g):g[0],x=p.cache;if(x.has(E))return x.get(E);var C=a.apply(this,g);return p.cache=x.set(E,C)||x,C};return p.cache=new(fl.Cache||Tr),p}fl.Cache=Tr;function pl(a){if(typeof a!="function")throw new Rn(i);return function(){var u=arguments;switch(u.length){case 0:return!a.call(this);case 1:return!a.call(this,u[0]);case 2:return!a.call(this,u[0],u[1]);case 3:return!a.call(this,u[0],u[1],u[2])}return!a.apply(this,u)}}function wM(a){return Hb(2,a)}var xM=lC(function(a,u){u=u.length==1&&Ne(u[0])?at(u[0],Sn(ye())):at(Kt(u,1),Sn(ye()));var p=u.length;return He(function(g){for(var E=-1,x=Zt(g.length,p);++E=u}),Bi=Bg(function(){return arguments}())?Bg:function(a){return ht(a)&&Ze.call(a,"callee")&&!_g.call(a,"callee")},Ne=P.isArray,BM=ig?Sn(ig):VT;function gn(a){return a!=null&&hl(a.length)&&!kr(a)}function yt(a){return ht(a)&&gn(a)}function FM(a){return a===!0||a===!1||ht(a)&&ln(a)==Be}var ai=j1||Zd,HM=og?Sn(og):GT;function $M(a){return ht(a)&&a.nodeType===1&&!Is(a)}function zM(a){if(a==null)return!0;if(gn(a)&&(Ne(a)||typeof a=="string"||typeof a.splice=="function"||ai(a)||Ro(a)||Bi(a)))return!a.length;var u=jt(a);if(u==pt||u==V)return!a.size;if(Os(a))return!md(a).length;for(var p in a)if(Ze.call(a,p))return!1;return!0}function UM(a,u){return Ms(a,u)}function WM(a,u,p){p=typeof p=="function"?p:t;var g=p?p(a,u):t;return g===t?Ms(a,u,t,p):!!g}function zd(a){if(!ht(a))return!1;var u=ln(a);return u==Oe||u==Nt||typeof a.message=="string"&&typeof a.name=="string"&&!Is(a)}function KM(a){return typeof a=="number"&&Tg(a)}function kr(a){if(!dt(a))return!1;var u=ln(a);return u==xt||u==Jt||u==Me||u==Xn}function Vb(a){return typeof a=="number"&&a==Re(a)}function hl(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=_e}function dt(a){var u=typeof a;return a!=null&&(u=="object"||u=="function")}function ht(a){return a!=null&&typeof a=="object"}var Gb=sg?Sn(sg):YT;function VM(a,u){return a===u||hd(a,u,Od(u))}function GM(a,u,p){return p=typeof p=="function"?p:t,hd(a,u,Od(u),p)}function qM(a){return qb(a)&&a!=+a}function YM(a){if(OC(a))throw new Ae(r);return Fg(a)}function JM(a){return a===null}function XM(a){return a==null}function qb(a){return typeof a=="number"||ht(a)&&ln(a)==sn}function Is(a){if(!ht(a)||ln(a)!=_t)return!1;var u=za(a);if(u===null)return!0;var p=Ze.call(u,"constructor")&&u.constructor;return typeof p=="function"&&p instanceof p&&Ba.call(p)==G1}var Ud=ag?Sn(ag):JT;function ZM(a){return Vb(a)&&a>=-_e&&a<=_e}var Yb=lg?Sn(lg):XT;function ml(a){return typeof a=="string"||!Ne(a)&&ht(a)&&ln(a)==bt}function Cn(a){return typeof a=="symbol"||ht(a)&&ln(a)==we}var Ro=cg?Sn(cg):ZT;function jM(a){return a===t}function QM(a){return ht(a)&&jt(a)==ct}function eN(a){return ht(a)&&ln(a)==ut}var tN=ol(gd),nN=ol(function(a,u){return a<=u});function Jb(a){if(!a)return[];if(gn(a))return ml(a)?Zn(a):mn(a);if(vs&&a[vs])return D1(a[vs]());var u=jt(a),p=u==pt?rd:u==V?Da:Io;return p(a)}function Or(a){if(!a)return a===0?a:0;if(a=Bn(a),a===ge||a===-ge){var u=a<0?-1:1;return u*A}return a===a?a:0}function Re(a){var u=Or(a),p=u%1;return u===u?p?u-p:u:0}function Xb(a){return a?Ii(Re(a),0,K):0}function Bn(a){if(typeof a=="number")return a;if(Cn(a))return R;if(dt(a)){var u=typeof a.valueOf=="function"?a.valueOf():a;a=dt(u)?u+"":u}if(typeof a!="string")return a===0?a:+a;a=mg(a);var p=BS.test(a);return p||HS.test(a)?b1(a.slice(2),p?2:8):PS.test(a)?R:+a}function Zb(a){return dr(a,bn(a))}function rN(a){return a?Ii(Re(a),-_e,_e):a===0?a:0}function Xe(a){return a==null?"":Tn(a)}var iN=No(function(a,u){if(Os(u)||gn(u)){dr(u,Ht(u),a);return}for(var p in u)Ze.call(u,p)&&Ts(a,p,u[p])}),jb=No(function(a,u){dr(u,bn(u),a)}),gl=No(function(a,u,p,g){dr(u,bn(u),a,g)}),oN=No(function(a,u,p,g){dr(u,Ht(u),a,g)}),sN=Mr(cd);function aN(a,u){var p=Mo(a);return u==null?p:kg(p,u)}var lN=He(function(a,u){a=Qe(a);var p=-1,g=u.length,E=g>2?u[2]:t;for(E&&cn(u[0],u[1],E)&&(g=1);++p1),x}),dr(a,Nd(a),p),g&&(p=Dn(p,d|f|h,EC));for(var E=u.length;E--;)wd(p,u[E]);return p});function CN(a,u){return ey(a,pl(ye(u)))}var AN=Mr(function(a,u){return a==null?{}:eC(a,u)});function ey(a,u){if(a==null)return{};var p=at(Nd(a),function(g){return[g]});return u=ye(u),Vg(a,p,function(g,E){return u(g,E[0])})}function MN(a,u,p){u=oi(u,a);var g=-1,E=u.length;for(E||(E=1,a=t);++gu){var g=a;a=u,u=g}if(p||a%1||u%1){var E=Cg();return Zt(a+E*(u-a+g1("1e-"+((E+"").length-1))),u)}return yd(a,u)}var HN=ko(function(a,u,p){return u=u.toLowerCase(),a+(p?ry(u):u)});function ry(a){return Vd(Xe(a).toLowerCase())}function iy(a){return a=Xe(a),a&&a.replace(zS,N1).replace(s1,"")}function $N(a,u,p){a=Xe(a),u=Tn(u);var g=a.length;p=p===t?g:Ii(Re(p),0,g);var E=p;return p-=u.length,p>=0&&a.slice(p,E)==u}function zN(a){return a=Xe(a),a&&Ma.test(a)?a.replace(an,k1):a}function UN(a){return a=Xe(a),a&&AS.test(a)?a.replace(Zr,"\\$&"):a}var WN=ko(function(a,u,p){return a+(p?"-":"")+u.toLowerCase()}),KN=ko(function(a,u,p){return a+(p?" ":"")+u.toLowerCase()}),VN=ab("toLowerCase");function GN(a,u,p){a=Xe(a),u=Re(u);var g=u?So(a):0;if(!u||g>=u)return a;var E=(u-g)/2;return il(Va(E),p)+a+il(Ka(E),p)}function qN(a,u,p){a=Xe(a),u=Re(u);var g=u?So(a):0;return u&&g>>0,p?(a=Xe(a),a&&(typeof u=="string"||u!=null&&!Ud(u))&&(u=Tn(u),!u&&_o(a))?si(Zn(a),0,p):a.split(u,p)):[]}var ek=ko(function(a,u,p){return a+(p?" ":"")+Vd(u)});function tk(a,u,p){return a=Xe(a),p=p==null?0:Ii(Re(p),0,a.length),u=Tn(u),a.slice(p,p+u.length)==u}function nk(a,u,p){var g=v.templateSettings;p&&cn(a,u,p)&&(u=t),a=Xe(a),u=gl({},u,g,hb);var E=gl({},u.imports,g.imports,hb),x=Ht(E),C=nd(E,x),M,k,U=0,W=u.interpolate||Na,q="__p += '",te=id((u.escape||Na).source+"|"+W.source+"|"+(W===Mi?LS:Na).source+"|"+(u.evaluate||Na).source+"|$","g"),de="//# sourceURL="+(Ze.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++d1+"]")+` +`;a.replace(te,function(ve,$e,Ve,An,un,Mn){return Ve||(Ve=An),q+=a.slice(U,Mn).replace(US,O1),$e&&(M=!0,q+=`' + +__e(`+$e+`) + +'`),un&&(k=!0,q+=`'; +`+un+`; +__p += '`),Ve&&(q+=`' + +((__t = (`+Ve+`)) == null ? '' : __t) + +'`),U=Mn+ve.length,ve}),q+=`'; +`;var Ee=Ze.call(u,"variable")&&u.variable;if(!Ee)q=`with (obj) { +`+q+` +} +`;else if(IS.test(Ee))throw new Ae(o);q=(k?q.replace(xe,""):q).replace(qe,"$1").replace(Ke,"$1;"),q="function("+(Ee||"obj")+`) { +`+(Ee?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(M?", __e = _.escape":"")+(k?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+q+`return __p +}`;var Le=sy(function(){return Ye(x,de+"return "+q).apply(t,C)});if(Le.source=q,zd(Le))throw Le;return Le}function rk(a){return Xe(a).toLowerCase()}function ik(a){return Xe(a).toUpperCase()}function ok(a,u,p){if(a=Xe(a),a&&(p||u===t))return mg(a);if(!a||!(u=Tn(u)))return a;var g=Zn(a),E=Zn(u),x=gg(g,E),C=bg(g,E)+1;return si(g,x,C).join("")}function sk(a,u,p){if(a=Xe(a),a&&(p||u===t))return a.slice(0,Eg(a)+1);if(!a||!(u=Tn(u)))return a;var g=Zn(a),E=bg(g,Zn(u))+1;return si(g,0,E).join("")}function ak(a,u,p){if(a=Xe(a),a&&(p||u===t))return a.replace(zu,"");if(!a||!(u=Tn(u)))return a;var g=Zn(a),E=gg(g,Zn(u));return si(g,E).join("")}function lk(a,u){var p=ee,g=z;if(dt(u)){var E="separator"in u?u.separator:E;p="length"in u?Re(u.length):p,g="omission"in u?Tn(u.omission):g}a=Xe(a);var x=a.length;if(_o(a)){var C=Zn(a);x=C.length}if(p>=x)return a;var M=p-So(g);if(M<1)return g;var k=C?si(C,0,M).join(""):a.slice(0,M);if(E===t)return k+g;if(C&&(M+=k.length-M),Ud(E)){if(a.slice(M).search(E)){var U,W=k;for(E.global||(E=id(E.source,Xe(Bm.exec(E))+"g")),E.lastIndex=0;U=E.exec(W);)var q=U.index;k=k.slice(0,q===t?M:q)}}else if(a.indexOf(Tn(E),M)!=M){var te=k.lastIndexOf(E);te>-1&&(k=k.slice(0,te))}return k+g}function ck(a){return a=Xe(a),a&&Jr.test(a)?a.replace(Bt,F1):a}var uk=ko(function(a,u,p){return a+(p?" ":"")+u.toUpperCase()}),Vd=ab("toUpperCase");function oy(a,u,p){return a=Xe(a),u=p?t:u,u===t?I1(a)?z1(a):S1(a):a.match(u)||[]}var sy=He(function(a,u){try{return _n(a,t,u)}catch(p){return zd(p)?p:new Ae(p)}}),dk=Mr(function(a,u){return On(u,function(p){p=fr(p),Cr(a,p,Hd(a[p],a))}),a});function fk(a){var u=a==null?0:a.length,p=ye();return a=u?at(a,function(g){if(typeof g[1]!="function")throw new Rn(i);return[p(g[0]),g[1]]}):[],He(function(g){for(var E=-1;++E_e)return[];var p=K,g=Zt(a,K);u=ye(u),a-=K;for(var E=td(g,u);++p0||u<0)?new Ue(p):(a<0?p=p.takeRight(-a):a&&(p=p.drop(a)),u!==t&&(u=Re(u),p=u<0?p.dropRight(-u):p.take(u-a)),p)},Ue.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},Ue.prototype.toArray=function(){return this.take(K)},ur(Ue.prototype,function(a,u){var p=/^(?:filter|find|map|reject)|While$/.test(u),g=/^(?:head|last)$/.test(u),E=v[g?"take"+(u=="last"?"Right":""):u],x=g||/^find/.test(u);E&&(v.prototype[u]=function(){var C=this.__wrapped__,M=g?[1]:arguments,k=C instanceof Ue,U=M[0],W=k||Ne(C),q=function($e){var Ve=E.apply(v,Qr([$e],M));return g&&te?Ve[0]:Ve};W&&p&&typeof U=="function"&&U.length!=1&&(k=W=!1);var te=this.__chain__,de=!!this.__actions__.length,Ee=x&&!te,Le=k&&!de;if(!x&&W){C=Le?C:new Ue(this);var ve=a.apply(C,M);return ve.__actions__.push({func:cl,args:[q],thisArg:t}),new In(ve,te)}return Ee&&Le?a.apply(this,M):(ve=this.thru(q),Ee?g?ve.value()[0]:ve.value():ve)})}),On(["pop","push","shift","sort","splice","unshift"],function(a){var u=La[a],p=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",g=/^(?:pop|shift)$/.test(a);v.prototype[a]=function(){var E=arguments;if(g&&!this.__chain__){var x=this.value();return u.apply(Ne(x)?x:[],E)}return this[p](function(C){return u.apply(Ne(C)?C:[],E)})}}),ur(Ue.prototype,function(a,u){var p=v[u];if(p){var g=p.name+"";Ze.call(Ao,g)||(Ao[g]=[]),Ao[g].push({name:u,func:p})}}),Ao[nl(t,w).name]=[{name:"wrapper",func:t}],Ue.prototype.clone=cT,Ue.prototype.reverse=uT,Ue.prototype.value=dT,v.prototype.at=$A,v.prototype.chain=zA,v.prototype.commit=UA,v.prototype.next=WA,v.prototype.plant=VA,v.prototype.reverse=GA,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=qA,v.prototype.first=v.prototype.head,vs&&(v.prototype[vs]=KA),v},ti=U1();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ft._=ti,define(function(){return ti})):Ni?((Ni.exports=ti)._=ti,qu._=ti):Ft._=ti}).call(gs)});function Qt(t){this.content=t}Qt.prototype={constructor:Qt,find:function(t){for(var e=0;e>1}};Qt.from=function(t){if(t instanceof Qt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Qt(e)};var ef=Qt;function Ey(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=Ey(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function vy(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),l=e.child(--o),c=s.nodeSize;if(s==l){n-=c,r-=c;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let d=0,f=Math.min(s.text.length,l.text.length);for(;de&&r(c,i+l,o||null,s)!==!1&&c.content.size){let f=l+1;c.nodesBetween(Math.max(0,e-f),Math.min(c.content.size,n-f),r,i+f)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(l,c)=>{let d=l.isText?l.text.slice(Math.max(e,c)-c,n-c):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);oe)for(let o=0,s=0;se&&((sn)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,n-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,n-s-1))),r.push(l),i+=l.nodeSize),s=c}return new t(r,i)}cutByIndex(e,n){return e==n?t.empty:e==0&&n==this.content.length?this:new t(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new t(i,o)}addToStart(e){return new t([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new t(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?bl(r+1,s):bl(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return t.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new t(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return t.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}};Ge.none=[];var $i=class extends Error{},Z=class t{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=xy(this.content,e+this.openStart,n);return r&&new t(r,this.openStart,this.openEnd)}removeBetween(e,n){return new t(wy(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return t.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new t(G.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new t(e,r,i)}};Z.empty=new Z(G.empty,0,0);function wy(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:l}=t.findIndex(n);if(i==e||o.isText){if(l!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(wy(o.content,e-i-1,n-i-1)))}function xy(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let l=xy(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function nO(t,e,n){if(n.openStart>t.depth)throw new $i("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new $i("Inconsistent open depths");return _y(t,e,n,0)}function _y(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Ds(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(Fi(t.nodeAfter,r),o++));for(let l=o;li&&rf(t,e,i+1),s=r.depth>i&&rf(n,r,i+1),l=[];return Ds(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(Sy(o,s),Fi(Hi(o,Ty(t,e,n,r,i+1)),l)):(o&&Fi(Hi(o,vl(t,e,i+1)),l),Ds(e,n,i,l),s&&Fi(Hi(s,vl(n,r,i+1)),l)),Ds(r,null,i,l),new G(l)}function vl(t,e,n){let r=[];if(Ds(null,t,n,r),t.depth>n){let i=rf(t,e,n+1);Fi(Hi(i,vl(t,e,n+1)),r)}return Ds(e,null,n,r),new G(r)}function rO(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(G.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}var wl=class t{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new zi(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:l,offset:c}=s.content.findIndex(o),d=o-c;if(r.push(s,l,i+c),!d||(s=s.child(l),s.isText))break;o=d-1,i+=c+1}return new t(n,r,o)}static resolveCached(e,n){let r=uy.get(e);if(r)for(let o=0;oe&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}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 e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Cy(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=G.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let c=i;cn.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=G.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};tr.prototype.text=void 0;var sf=class t extends tr{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Cy(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new t(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new t(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Cy(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var Ui=class t{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new af(e,n);if(r.next==null)return t.empty;let i=Ay(r);r.next&&r.err("Unexpected trailing text");let o=fO(dO(i));return pO(o,r),o}matchType(e){for(let n=0;nd.createAndFill()));for(let d=0;d=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` +`)}};Ui.empty=new Ui(!0);var af=class{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.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(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};function Ay(t){let e=[];do e.push(sO(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function sO(t){let e=[];do e.push(aO(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function aO(t){let e=uO(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=lO(t,e);else break;return e}function dy(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function lO(t,e){let n=dy(t),r=n;return t.eat(",")&&(t.next!="}"?r=dy(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function cO(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.isInGroup(e)&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function uO(t){if(t.eat("(")){let e=Ay(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=cO(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function dO(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,c){let d={term:c,to:l};return e[s].push(d),d}function i(s,l){s.forEach(c=>c.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((c,d)=>c.concat(o(d,l)),[]);if(s.type=="seq")for(let c=0;;c++){let d=o(s.exprs[c],l);if(c==s.exprs.length-1)return d;i(d,l=n())}else if(s.type=="star"){let c=n();return r(l,c),i(o(s.expr,c),c),[r(c)]}else if(s.type=="plus"){let c=n();return i(o(s.expr,l),c),i(o(s.expr,c),c),[r(c)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let c=l;for(let d=0;d{t[s].forEach(({term:l,to:c})=>{if(!l)return;let d;for(let f=0;f{d||i.push([l,d=[]]),d.indexOf(f)==-1&&d.push(f)})})});let o=e[r.join(",")]=new Ui(r.indexOf(t.length-1)>-1);for(let s=0;s-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:ky(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new tr(this,this.computeAttrs(e),G.from(n),Ge.setFrom(r))}createChecked(e=null,n,r){return n=G.from(n),this.checkContent(n),new tr(this,this.computeAttrs(e),n,Ge.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=G.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(G.empty,!0);return o?new tr(this,e,n.append(o),Ge.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[o]=new t(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function hO(t,e,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`)}}var lf=class{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?hO(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}},Ps=class t{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=Ry(e,i.attrs),this.excluded=null;let o=Ny(this.attrs);this.instance=o?new Ge(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Ge(this,ky(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new t(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n-1}},Bs=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=ef.from(e.nodes),n.marks=ef.from(e.marks||{}),this.nodes=xl.compile(this.spec.nodes,this),this.marks=Ps.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",l=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=Ui.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=l=="_"?null:l?py(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:py(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(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof xl){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new sf(r,r.defaultAttrs,e,Ge.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return tr.fromJSON(this,e)}markFromJSON(e){return Ge.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function py(t,e){let n=[];for(let r=0;r-1)&&n.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function mO(t){return t.tag!=null}function gO(t){return t.style!=null}var Ir=class t{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(mO(i))this.tags.push(i);else if(gO(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new Tl(this,n,!1);return r.addAll(e,Ge.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Tl(this,n,!0);return r.addAll(e,Ge.none,n.from,n.to),Z.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(s.getAttrs){let c=s.getAttrs(n);if(c===!1)continue;s.attrs=c||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s{r(s=my(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=my(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new t(e,t.schemaRules(e)))}},Iy={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},bO={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Dy={ol:!0,ul:!0},_l=1,Sl=2,Ls=4;function hy(t,e,n){return e!=null?(e?_l:0)|(e==="full"?Sl:0):t&&t.whitespace=="pre"?_l|Sl:n&~Ls}var Do=class{constructor(e,n,r,i,o,s){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=Ge.none,this.match=o||(s&Ls?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(G.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&_l)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=G.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(G.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Iy.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},Tl=class{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,s=hy(null,n.preserveWhitespace,0)|(r?Ls:0);i?o=new Do(i.type,i.attrs,Ge.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new Do(null,null,Ge.none,!0,null,s):o=new Do(e.schema.topNodeType,null,Ge.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top;if(i.options&Sl||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i.options&_l)i.options&Sl?r=r.replace(/\r\n?/g,` +`):r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let o=i.content[i.content.length-1],s=e.previousSibling;(!o||s&&s.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=e.nodeName.toLowerCase(),o;Dy.hasOwnProperty(i)&&this.parser.normalizeLists&&yO(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,r));if(s?s.ignore:bO.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,n);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let l,c=this.top,d=this.needsBlock;if(Iy.hasOwnProperty(i))c.content.length&&c.content[0].isInline&&this.open&&(this.open--,c=this.top),l=!0,c.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);return}let f=s&&s.skip?n:this.readStyles(e,n);f&&this.addAll(e,f),l&&this.sync(c),this.needsBlock=d}else{let l=this.readStyles(e,n);l&&this.addElementByRule(e,s,l,s.consuming===!1?o:void 0)}}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` +`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i!c.clearMark(d)):n=n.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)l=c;else break}}return n}addElementByRule(e,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(e,r);else{let c=this.enter(s,n.attrs||null,r,n.preserveWhitespace);c&&(o=!0,r=c)}else{let c=this.parser.schema.marks[n.mark];r=r.concat(c.create(n.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,r));else{let c=e;typeof n.contentElement=="string"?c=e.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(e):n.contentElement&&(c=n.contentElement),this.findAround(e,c,!0),this.addAll(c,r),this.findAround(e,c,!1)}o&&this.sync(l)&&this.open--}addAll(e,n,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];s!=l;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o)}findPlace(e,n){let r,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],l=s.findWrapping(e);if(l&&(!r||r.length>l.length)&&(r=l,i=s,!l.length)||s.solid)break}if(!r)return null;this.sync(i);for(let o=0;o(s.type?s.type.allowsMarkType(d.type):gy(d.type,e))?(c=d.addToSet(c),!1):!0),this.nodes.push(new Do(e,n,c,i,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));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(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,c)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;c>=o;c--)if(s(l-1,c))return!0;return!1}else{let f=c>0||c==0&&i?this.nodes[c].type:r&&c>=o?r.node(c-o).type:null;if(!f||f.name!=d&&!f.isInGroup(d))return!1;c--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}};function yO(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Dy.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function EO(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function my(t){let e={};for(let n in t)e[n]=t[n];return e}function gy(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=l=>{o.push(l);for(let c=0;c{if(o.length||s.marks.length){let l=0,c=0;for(;l=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&yl(nf(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return yl(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new t(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=by(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return by(e.marks)}};function by(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function nf(t){return t.document||window.document}var yy=new WeakMap;function vO(t){let e=yy.get(t);return e===void 0&&yy.set(t,e=wO(t)),e}function wO(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let l,c=n?t.createElementNS(n,i):t.createElement(i),d=e[1],f=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){f=2;for(let h in d)if(d[h]!=null){let m=h.indexOf(" ");m>0?c.setAttributeNS(h.slice(0,m),h.slice(m+1),d[h]):c.setAttribute(h,d[h])}}for(let h=f;hf)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:y,contentDOM:b}=yl(t,m,n,r);if(c.appendChild(y),b){if(l)throw new RangeError("Multiple content holes");l=b}}}return{dom:c,contentDOM:l}}var By=65535,Fy=Math.pow(2,16);function xO(t,e){return t+e*Fy}function Ly(t){return t&By}function _O(t){return(t-(t&By))/Fy}var Hy=1,$y=2,Cl=4,zy=8,$s=class{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&zy)>0}get deletedBefore(){return(this.delInfo&(Hy|Cl))>0}get deletedAfter(){return(this.delInfo&($y|Cl))>0}get deletedAcross(){return(this.delInfo&Cl)>0}},Lr=class t{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&t.empty)return t.empty}recover(e){let n=0,r=Ly(e);if(!this.inverted)for(let i=0;ie)break;let d=this.ranges[l+o],f=this.ranges[l+s],h=c+d;if(e<=h){let m=d?e==c?-1:e==h?1:n:n,y=c+i+(m<0?0:f);if(r)return y;let b=e==(n<0?c:h)?null:xO(l/3,e-c),w=e==c?$y:e==h?Hy:Cl;return(n<0?e!=c:e!=h)&&(w|=zy),new $s(y,w,b)}i+=f-d}return r?e+i:new $s(e+i,0,null)}touches(e,n){let r=0,i=Ly(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;le)break;let d=this.ranges[l+o],f=c+d;if(e<=f&&l==i*3)return!0;r+=this.ranges[l+s]-d}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new t;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;ro&&c!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Vt.fromReplace(e,this.from,this.to,o)}invert(){return new Wi(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)}merge(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))}};$t.jsonID("addMark",Us);var Wi=class t extends $t{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new Z(hf(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Vt.fromReplace(e,this.from,this.to,r)}invert(){return new Us(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)}merge(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))}};$t.jsonID("removeMark",Wi);var Ws=class t extends $t{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Vt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Vt.fromReplace(e,this.pos,this.pos+1,new Z(G.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new t(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(n.from,n.to,n.gapFrom,n.gapTo,Z.fromJSON(e,n.slice),n.insert,!!n.structure)}};$t.jsonID("replaceAround",St);function ff(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function SO(t,e,n,r){let i=[],o=[],s,l;t.doc.nodesBetween(e,n,(c,d,f)=>{if(!c.isInline)return;let h=c.marks;if(!r.isInSet(h)&&f.type.allowsMarkType(r.type)){let m=Math.max(d,e),y=Math.min(d+c.nodeSize,n),b=r.addToSet(h);for(let w=0;wt.step(c)),o.forEach(c=>t.step(c))}function TO(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,l)=>{if(!s.isInline)return;o++;let c=null;if(r instanceof Ps){let d=s.marks,f;for(;f=r.isInSet(d);)(c||(c=[])).push(f),d=f.removeFromSet(d)}else r?r.isInSet(s.marks)&&(c=[r]):c=s.marks;if(c&&c.length){let d=Math.min(l+s.nodeSize,n);for(let f=0;ft.step(new Wi(s.from,s.to,s.style)))}function mf(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],l=e+1;for(let c=0;c=0;c--)t.step(s[c])}function CO(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Pr(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(rn;b--)w||r.index(b)>0?(w=!0,f=G.from(r.node(b).copy(f)),h++):c--;let m=G.empty,y=0;for(let b=o,w=!1;b>n;b--)w||i.after(b+1)=0;s--){if(r.size){let l=n[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=G.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new St(i,o,i,o,new Z(r,0,0),n.length,!0))}function OO(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,l)=>{let c=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,c)&&RO(t.doc,t.mapping.slice(o).map(l),r)){let d=null;if(r.schema.linebreakReplacement){let y=r.whitespace=="pre",b=!!r.contentMatch.matchType(r.schema.linebreakReplacement);y&&!b?d=!1:!y&&b&&(d=!0)}d===!1&&Wy(t,s,l,o),mf(t,t.mapping.slice(o).map(l,1),r,void 0,d===null);let f=t.mapping.slice(o),h=f.map(l,1),m=f.map(l+s.nodeSize,1);return t.step(new St(h,m,h+1,m-1,new Z(G.from(r.create(c,null,s.marks)),0,0),1,!0)),d===!0&&Uy(t,s,l,o),!1}})}function Uy(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let c=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function Wy(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(` +`))}})}function RO(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function IO(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new St(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new Z(G.from(s),0,0),1,!0))}function Fn(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,f=n-2;d>o;d--,f--){let h=i.node(d),m=i.index(d);if(h.type.spec.isolating)return!1;let y=h.content.cutByIndex(m,h.childCount),b=r&&r[f+1];b&&(y=y.replaceChild(0,b.type.create(b.attrs)));let w=r&&r[f]||h;if(!h.canReplace(m+1,h.childCount)||!w.type.validContent(y))return!1}let l=i.indexAfter(o),c=r&&r[0];return i.node(o).canReplaceWith(l,l,c?c.type:i.node(o+1).type)}function DO(t,e,n=1,r){let i=t.doc.resolve(e),o=G.empty,s=G.empty;for(let l=i.depth,c=i.depth-n,d=n-1;l>c;l--,d--){o=G.from(i.node(l).copy(o));let f=r&&r[d];s=G.from(f?f.type.create(f.attrs,s):i.node(l).copy(s))}t.step(new en(e,e,new Z(o.append(s),n,n),!0))}function nr(t,e){let n=t.resolve(e),r=n.index();return Ky(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function LO(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i0?(o=r.node(i+1),l++,s=r.node(i).maybeChild(l)):(o=r.node(i).maybeChild(l-1),s=r.node(i+1)),o&&!o.isTextblock&&Ky(o,s)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function PO(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,o=t.doc.resolve(e-n),s=o.node().type;if(i&&s.inlineContent){let f=s.whitespace=="pre",h=!!s.contentMatch.matchType(i);f&&!h?r=!1:!f&&h&&(r=!0)}let l=t.steps.length;if(r===!1){let f=t.doc.resolve(e+n);Wy(t,f.node(),f.before(),l)}s.inlineContent&&mf(t,e+n-1,s,o.node().contentMatchAt(o.index()),r==null);let c=t.mapping.slice(l),d=c.map(e-n);if(t.step(new en(d,c.map(e+n,-1),Z.empty,!0)),r===!0){let f=t.doc.resolve(d);Uy(t,f.node(),f.before(),t.steps.length)}return t}function BO(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,c=r.index(s)+(l>0?1:0),d=r.node(s),f=!1;if(o==1)f=d.canReplace(c,c,i);else{let h=d.contentMatchAt(c).findWrapping(i.firstChild.type);f=h&&d.canReplaceWith(c,c,h[0])}if(f)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function Vs(t,e,n=e,r=Z.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return Vy(i,o,r)?new en(e,n,r):new pf(i,o,r).fit()}function Vy(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}var pf=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=G.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=G.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,l=i.depth;for(;s&&l&&o.childCount==1;)o=o.firstChild.content,s--,l--;let c=new Z(o,s,l);return e>-1?new St(r.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new en(r.pos,i.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=uf(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:c,match:d}=this.frontier[l],f,h=null;if(n==1&&(s?d.matchType(s.type)||(h=d.fillBefore(G.from(s),!1)):o&&c.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:h};if(n==2&&s&&(f=d.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:f};if(o&&d.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=uf(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new Z(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=uf(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new Z(Fs(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new Z(Fs(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let w=0;w1||c==0||w.content.size)&&(h=_,f.push(Gy(w.mark(m.allowedMarks(w.marks)),d==1?c:0,d==l.childCount?y:-1)))}let b=d==l.childCount;b||(y=-1),this.placed=Hs(this.placed,n,G.from(f)),this.frontier[n].match=h,b&&y<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let w=0,_=l;w1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n=0;l--){let{match:c,type:d}=this.frontier[l],f=df(e,l,d,c,!0);if(!f||f.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Hs(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Hs(this.placed,this.depth,G.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(G.empty,!0);n.childCount&&(this.placed=Hs(this.placed,this.frontier.length,n))}};function Fs(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Fs(t.firstChild.content,e-1,n)))}function Hs(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Hs(t.lastChild.content,e-1,n)))}function uf(t,e){for(let n=0;n1&&(r=r.replaceChild(0,Gy(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(G.empty,!0)))),t.copy(r)}function df(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!FO(n,o.content,s)?l:null}function FO(t,e,n){for(let r=n;r0;m--,y--){let b=i.node(m).type.spec;if(b.defining||b.definingAsContext||b.isolating)break;s.indexOf(m)>-1?l=m:i.before(m)==y&&s.splice(1,0,-m)}let c=s.indexOf(l),d=[],f=r.openStart;for(let m=r.content,y=0;;y++){let b=m.firstChild;if(d.push(b),y==r.openStart)break;m=b.content}for(let m=f-1;m>=0;m--){let y=d[m],b=HO(y.type);if(b&&!y.sameMarkup(i.node(Math.abs(l)-1)))f=m;else if(b||!y.type.isTextblock)break}for(let m=r.openStart;m>=0;m--){let y=(m+f+1)%(r.openStart+1),b=d[y];if(b)for(let w=0;w=0&&(t.replace(e,n,r),!(t.steps.length>h));m--){let y=s[m];y<0||(e=i.before(y),n=o.after(y))}}function qy(t,e,n,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(G.empty,!0))}return t}function zO(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=BO(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new Z(G.from(r),0,0))}function UO(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=Yy(r,i);for(let s=0;s0&&(c||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return t.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function Yy(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(oe.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}var Al=class t extends $t{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Vt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Vt.fromReplace(e,this.pos,this.pos+1,new Z(G.from(i),0,n.isLeaf?0:1))}getMap(){return Lr.empty}invert(e){return new t(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new t(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new t(n.pos,n.attr,n.value)}};$t.jsonID("attr",Al);var Ml=class t extends $t{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Vt.ok(r)}getMap(){return Lr.empty}invert(e){return new t(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new t(n.attr,n.value)}};$t.jsonID("docAttr",Ml);var Lo=class extends Error{};Lo=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Lo.prototype=Object.create(Error.prototype);Lo.prototype.constructor=Lo;Lo.prototype.name="TransformError";var li=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new zs}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Lo(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=Z.empty){let i=Vs(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new Z(G.from(r),0,0))}delete(e,n){return this.replace(e,n,Z.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return $O(this,e,n,r),this}replaceRangeWith(e,n,r){return zO(this,e,n,r),this}deleteRange(e,n){return UO(this,e,n),this}lift(e,n){return AO(this,e,n),this}join(e,n=1){return PO(this,e,n),this}wrap(e,n){return kO(this,e,n),this}setBlockType(e,n=e,r,i=null){return OO(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return IO(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Al(e,n,r)),this}setDocAttribute(e,n){return this.step(new Ml(e,n)),this}addNodeMark(e,n){return this.step(new Ws(e,n)),this}removeNodeMark(e,n){if(!(n instanceof Ge)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Ks(e,n)),this}split(e,n=1,r){return DO(this,e,n,r),this}addMark(e,n,r){return SO(this,e,n,r),this}removeMark(e,n,r){return TO(this,e,n,r),this}clearIncompatible(e,n,r){return mf(this,e,n,r),this}};var gf=Object.create(null),ue=class{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new Ho(e.min(n),e.max(n))]}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 e=this.ranges;for(let n=0;n=0;o--){let s=n<0?Fo(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):Fo(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Nn(e.node(0))}static atStart(e){return Fo(e,e,0,0,1)||new Nn(e)}static atEnd(e){return Fo(e,e,e.content.size,e.childCount,-1)||new Nn(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=gf[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in gf)throw new RangeError("Duplicate use of selection JSON ID "+e);return gf[e]=n,n.prototype.jsonID=e,n}getBookmark(){return le.between(this.$anchor,this.$head).getBookmark()}};ue.prototype.visible=!0;var Ho=class{constructor(e,n){this.$from=e,this.$to=n}},Jy=!1;function Xy(t){!Jy&&!t.parent.inlineContent&&(Jy=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}var le=class t extends ue{constructor(e,n=e){Xy(e),Xy(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ue.near(r);let i=e.resolve(n.map(this.anchor));return new t(i.parent.inlineContent?i:r,r)}replace(e,n=Z.empty){if(super.replace(e,n),n==Z.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ol(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=ue.findFrom(n,r,!0)||ue.findFrom(n,-r,!0);if(o)n=o.$head;else return ue.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(ue.findFrom(e,-r,!0)||ue.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&pe.isSelectable(l))return pe.create(t,n-(i<0?l.nodeSize:0))}else{let c=Fo(t,l,n+i,i<0?l.childCount:0,i,o);if(c)return c}n+=l.nodeSize*i}return null}function Zy(t,e,n){let r=t.steps.length-1;if(r{s==null&&(s=f)}),t.setSelection(ue.near(t.doc.resolve(s),n))}var jy=1,kl=2,Qy=4,Ef=class extends li{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=kl,this}ensureMarks(e){return Ge.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&kl)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~kl,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Ge.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(ue.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Qy,this}get scrolledIntoView(){return(this.updated&Qy)>0}};function e0(t,e){return!e||!t?t:t.bind(e)}var Ki=class{constructor(e,n,r){this.name=e,this.init=e0(n.init,r),this.apply=e0(n.apply,r)}},KO=[new Ki("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Ki("selection",{init(t,e){return t.selection||ue.atStart(e.doc)},apply(t){return t.selection}}),new Ki("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Ki("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})],Gs=class{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=KO.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Ki(r.key,r.spec.state,r))})}},Rl=class t{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Gs(e.schema,e.plugins),o=new t(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=tr.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=ue.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let c=r[l],d=c.spec.state;if(c.key==s.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){o[s.name]=d.fromJSON.call(c,e,n[l],o);return}}o[s.name]=s.init(e,o)}}),o}};function t0(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=t0(i,e,{})),n[r]=i}return n}var ke=class{constructor(e){this.spec=e,this.props={},e.props&&t0(e.props,this,this.props),this.key=e.key?e.key.key:n0("plugin")}getState(e){return e[this.key]}},bf=Object.create(null);function n0(t){return t in bf?t+"$"+ ++bf[t]:(bf[t]=0,t+"$")}var ze=class{constructor(e="key"){this.key=n0(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};var Gt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Xs=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e},Sf=null,Fr=function(t,e,n){let r=Sf||(Sf=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},VO=function(){Sf=null},Zi=function(t,e,n,r){return n&&(r0(t,e,n,r,-1)||r0(t,e,n,r,1))},GO=/^(img|br|input|textarea|hr)$/i;function r0(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:$n(t))){let o=t.parentNode;if(!o||o.nodeType!=1||ea(t)||GO.test(t.nodeName)||t.contentEditable=="false")return!1;e=Gt(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?$n(t):0}else return!1}}function $n(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function qO(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=$n(t)}else if(t.parentNode&&!ea(t))e=Gt(t),t=t.parentNode;else return null}}function YO(t,e){for(;;){if(t.nodeType==3&&e2),Hn=Ko||(pr?/Mac/.test(pr.platform):!1),jO=pr?/Win/.test(pr.platform):!1,rr=/Android \d/.test(hi),ta=!!i0&&"webkitFontSmoothing"in i0.documentElement.style,QO=ta?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function eR(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Br(t,e){return typeof t=="number"?t:t[e]}function tR(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function o0(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=Xs(s)){if(s.nodeType!=1)continue;let l=s,c=l==o.body,d=c?eR(o):tR(l),f=0,h=0;if(e.topd.bottom-Br(r,"bottom")&&(h=e.bottom-e.top>d.bottom-d.top?e.top+Br(i,"top")-d.top:e.bottom-d.bottom+Br(i,"bottom")),e.leftd.right-Br(r,"right")&&(f=e.right-d.right+Br(i,"right")),f||h)if(c)o.defaultView.scrollBy(f,h);else{let m=l.scrollLeft,y=l.scrollTop;h&&(l.scrollTop+=h),f&&(l.scrollLeft+=f);let b=l.scrollLeft-m,w=l.scrollTop-y;e={left:e.left-b,top:e.top-w,right:e.right-b,bottom:e.bottom-w}}if(c||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function nR(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s=n-20){r=l,i=c.top;break}}return{refDOM:r,refTop:i,stack:F0(t.dom)}}function F0(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Xs(r));return e}function rR({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;H0(n,r==0?0:r-e)}function H0(t,e){for(let n=0;n=l){s=Math.max(b.bottom,s),l=Math.min(b.top,l);let w=b.left>e.left?b.left-e.left:b.right=(b.left+b.right)/2?1:0));continue}}else b.top>e.top&&!c&&b.left<=e.left&&b.right>=e.left&&(c=f,d={left:Math.max(b.left,Math.min(b.right,e.left)),top:b.top});!n&&(e.left>=b.right&&e.top>=b.top||e.left>=b.left&&e.top>=b.bottom)&&(o=h+1)}}return!n&&c&&(n=c,i=d,r=0),n&&n.nodeType==3?oR(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:$0(n,i)}function oR(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Uf(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function sR(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function lR(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let l=t.docView.nearestDesc(o,!0);if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)){let c=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&(!s&&c.left>r.left||c.top>r.top?i=l.posBefore:(!s&&c.right-1?i:t.docView.posFromDOM(e,n,-1)}function z0(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}let d;ta&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=lR(t,r,i,e))}l==null&&(l=aR(t,s,e));let c=t.docView.nearestDesc(s,!0);return{pos:l,inside:c?c.posAtStart-c.border:-1}}function s0(t){return t.top=0&&i==r.nodeValue.length?(c--,f=1):n<0?c--:d++,qs(ci(Fr(r,c,d),f),f<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==$n(r))){let c=r.childNodes[i-1];if(c.nodeType==1)return vf(c.getBoundingClientRect(),!1)}if(o==null&&i<$n(r)){let c=r.childNodes[i];if(c.nodeType==1)return vf(c.getBoundingClientRect(),!0)}return vf(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==$n(r))){let c=r.childNodes[i-1],d=c.nodeType==3?Fr(c,$n(c)-(s?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return qs(ci(d,1),!1)}if(o==null&&i<$n(r)){let c=r.childNodes[i];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let d=c?c.nodeType==3?Fr(c,0,s?0:1):c.nodeType==1?c:null:null;if(d)return qs(ci(d,-1),!0)}return qs(ci(r.nodeType==3?Fr(r):r,-n),n>=0)}function qs(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function vf(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function W0(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function dR(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return W0(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=U0(t,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let c;if(l.nodeType==1)c=l.getClientRects();else if(l.nodeType==3)c=Fr(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;df.top+1&&(n=="up"?s.top-f.top>(f.bottom-s.top)*2:f.bottom-s.bottom>(s.bottom-f.top)*2))return!1}}return!0})}var fR=/[\u0590-\u08ac]/;function pR(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=t.domSelection();return l?!fR.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:W0(t,e,()=>{let{focusNode:c,focusOffset:d,anchorNode:f,anchorOffset:h}=t.domSelectionRange(),m=l.caretBidiLevel;l.modify("move",n,"character");let y=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:b,focusOffset:w}=t.domSelectionRange(),_=b&&!y.contains(b.nodeType==1?b:b.parentNode)||c==b&&d==w;try{l.collapse(f,h),c&&(c!=f||d!=h)&&l.extend&&l.extend(c,d)}catch{}return m!=null&&(l.caretBidiLevel=m),_}):r.pos==r.start()||r.pos==r.end()}var a0=null,l0=null,c0=!1;function hR(t,e,n){return a0==e&&l0==n?c0:(a0=e,l0=n,c0=n=="up"||n=="down"?dR(t,e,n):pR(t,e,n))}var zn=0,u0=1,Gi=2,hr=3,ji=class{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=zn,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;nGt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;ne||s instanceof Ll){i=e-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof Il&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?Gt(o.dom)+1:0}}else{let o,s=!0;for(;o=r=f&&n<=d-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,n,f);e=s;for(let h=l;h>0;h--){let m=this.children[h-1];if(m.size&&m.dom.parentNode==this.contentDOM&&!m.emptyChildAt(1)){i=Gt(m.dom)+1;break}e-=m.size}i==-1&&(i=0)}if(i>-1&&(d>n||l==this.children.length-1)){n=d;for(let f=l+1;fy&&sn){let y=l;l=c,c=y}let m=document.createRange();m.setEnd(c.node,c.offset),m.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(m)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i=r:er){let l=r+o.border,c=s-o.border;if(e>=l&&n<=c){this.dirty=e==r||n==s?Gi:u0,e==l&&n==c&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=hr:o.markDirty(e-l,n-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Gi:hr}r=s}this.dirty=Gi}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Gi:u0;n.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==zn&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.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}},Mf=class extends ji{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}},Vo=class t extends ji{constructor(e,n,r,i){super(e,[],r,i),this.mark=n}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Dr.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new t(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&hr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=hr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=zn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=Rf(o,0,e,r));for(let l=0;l{if(!c)return s;if(c.parent)return c.parent.posBeforeChild(c)},r,i),f=d&&d.dom,h=d&&d.contentDOM;if(n.isText){if(!f)f=document.createTextNode(n.text);else if(f.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else f||({dom:f,contentDOM:h}=Dr.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&f.nodeName!="BR"&&(f.hasAttribute("contenteditable")||(f.contentEditable="false"),n.type.spec.draggable&&(f.draggable=!0));let m=f;return f=G0(f,r,n),d?c=new Nf(e,n,r,i,f,h||null,m,d,o,s+1):n.isText?new Dl(e,n,r,i,f,m,o):new t(e,n,r,i,f,h||null,m,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>G.empty)}return e}matchesNode(e,n,r){return this.dirty==zn&&e.eq(this.node)&&Pl(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,c=new Of(this,s&&s.node,e);yR(this.node,this.innerDeco,(d,f,h)=>{d.spec.marks?c.syncToMarks(d.spec.marks,r,e):d.type.side>=0&&!h&&c.syncToMarks(f==this.node.childCount?Ge.none:this.node.child(f).marks,r,e),c.placeWidget(d,e,i)},(d,f,h,m)=>{c.syncToMarks(d.marks,r,e);let y;c.findNodeMatch(d,f,h,m)||l&&e.state.selection.from>i&&e.state.selection.to-1&&c.updateNodeAt(d,f,h,y,e)||c.updateNextNode(d,f,h,e,m,i)||c.addNode(d,f,h,e,i),i+=d.nodeSize}),c.syncToMarks([],r,e),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==Gi)&&(s&&this.protectLocalComposition(e,s),K0(this.contentDOM,this.children,e),Ko&&ER(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof le)||rn+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,l=vR(this.node.content,s,r-n,i-n);return l<0?null:{node:o,pos:l,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new Mf(this,o,n,i);e.input.compositionNodes.push(s),this.children=Rf(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==hr||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=zn}updateOuterDeco(e){if(Pl(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=V0(this.dom,this.nodeDOM,kf(this.outerDeco,this.node,n),kf(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}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 d0(t,e,n,r,i){G0(r,e,t);let o=new pi(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}var Dl=class t extends pi{constructor(e,n,r,i,o,s,l){super(e,n,r,i,o,null,s,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==hr||this.dirty!=zn&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=zn||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=zn,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new t(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=hr)}get domAtom(){return!1}isText(e){return this.node.text==e}},Ll=class extends ji{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==zn&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}},Nf=class extends pi{constructor(e,n,r,i,o,s,l,c,d,f){super(e,n,r,i,o,s,l,d,f),this.spec=c}update(e,n,r,i){if(this.dirty==hr)return!1;if(this.spec.update){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function K0(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o>1,s=Math.min(o,e.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let c=Vo.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,c=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(r){let d=n.children[r-1];if(d instanceof Vo)n=d,r=d.children.length;else{l=d,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let c=l.node;if(c){if(c!=t.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function bR(t,e){return t.type.side-e.type.side}function yR(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let d=0;do;)l.push(i[s++]);let b=o+m.nodeSize;if(m.isText){let _=b;s!_.inline):l.slice();r(m,w,e.forChild(o,m),y),o=b}}function ER(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function vR(t,e,n,r){for(let i=0,o=0;i=n){if(o>=r&&c.slice(r-e.length-l,r-l)==e)return r-e.length;let d=l=0&&d+e.length+l>=n)return l+d;if(n==r&&c.length>=r+e.length-l&&c.slice(r-l,r-l+e.length)==e)return r}}return-1}function Rf(t,e,n,r,i){let o=[];for(let s=0,l=0;s=n||f<=e?o.push(c):(dn&&o.push(c.slice(n-d,c.size,r)))}return o}function Wf(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),c,d;if(Kl(n)){for(c=s;i&&!i.node;)i=i.parent;let h=i.node;if(i&&h.isAtom&&pe.isSelectable(h)&&i.parent&&!(h.isInline&&JO(n.focusNode,n.focusOffset,i.dom))){let m=i.posBefore;d=new pe(s==m?l:r.resolve(m))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=s,m=s;for(let y=0;y{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!q0(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function xR(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,Gt(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&En&&fi<=11&&(r.disabled=!0,r.disabled=!1)}function Y0(t,e){if(e instanceof pe){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(g0(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else g0(t)}function g0(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Kf(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||le.between(e,n,r)}function b0(t){return t.editable&&!t.hasFocus()?!1:J0(t)}function J0(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function _R(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Zi(e.node,e.offset,n.anchorNode,n.anchorOffset)}function If(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&ue.findFrom(o,e)}function ui(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function y0(t,e,n){let r=t.state.selection;if(r instanceof le)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return ui(t,new le(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=If(t.state,e);return i&&i instanceof pe?ui(t,i):!1}else if(!(Hn&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(l))&&!s.contentDOM?pe.isSelectable(o)?ui(t,new pe(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):ta?ui(t,new le(t.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof pe&&r.node.isInline)return ui(t,new le(e>0?r.$to:r.$from));{let i=If(t.state,e);return i?ui(t,i):!1}}}function Bl(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Js(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function zo(t,e){return e<0?SR(t):TR(t)}function SR(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(ir&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(Js(l,-1))i=n,o=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(X0(n))break;{let l=n.previousSibling;for(;l&&Js(l,-1);)i=n.parentNode,o=Gt(l),l=l.previousSibling;if(l)n=l,r=Bl(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Df(t,n,r):i&&Df(t,i,o)}function TR(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=Bl(n),o,s;for(;;)if(r{t.state==i&&Hr(t)},50)}function E0(t,e){let n=t.state.doc.resolve(e);if(!(nn||jO)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function v0(t,e,n){let r=t.state.selection;if(r instanceof le&&!r.empty||n.indexOf("s")>-1||Hn&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=If(t.state,e);if(s&&s instanceof pe)return ui(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof Nn?ue.near(s,e):ue.findFrom(s,e);return l?ui(t,l):!1}return!1}function w0(t,e){if(!(t.state.selection instanceof le))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function x0(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function MR(t){if(!dn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;x0(t,r,"true"),setTimeout(()=>x0(t,r,"false"),20)}return!1}function NR(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function kR(t,e){let n=e.keyCode,r=NR(e);if(n==8||Hn&&n==72&&r=="c")return w0(t,-1)||zo(t,-1);if(n==46&&!e.shiftKey||Hn&&n==68&&r=="c")return w0(t,1)||zo(t,1);if(n==13||n==27)return!0;if(n==37||Hn&&n==66&&r=="c"){let i=n==37?E0(t,t.state.selection.from)=="ltr"?-1:1:-1;return y0(t,i,r)||zo(t,i)}else if(n==39||Hn&&n==70&&r=="c"){let i=n==39?E0(t,t.state.selection.from)=="ltr"?1:-1:1;return y0(t,i,r)||zo(t,i)}else{if(n==38||Hn&&n==80&&r=="c")return v0(t,-1,r)||zo(t,-1);if(n==40||Hn&&n==78&&r=="c")return MR(t)||v0(t,1,r)||zo(t,1);if(r==(Hn?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Z0(t,e){t.someProp("transformCopied",y=>{e=y(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let y=r.firstChild;n.push(y.type.name,y.attrs!=y.type.defaultAttrs?y.attrs:null),r=y.content}let s=t.someProp("clipboardSerializer")||Dr.fromSchema(t.state.schema),l=rE(),c=l.createElement("div");c.appendChild(s.serializeFragment(r,{document:l}));let d=c.firstChild,f,h=0;for(;d&&d.nodeType==1&&(f=nE[d.nodeName.toLowerCase()]);){for(let y=f.length-1;y>=0;y--){let b=l.createElement(f[y]);for(;c.firstChild;)b.appendChild(c.firstChild);c.appendChild(b),h++}d=c.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${h?` -${h}`:""} ${JSON.stringify(n)}`);let m=t.someProp("clipboardTextSerializer",y=>y(e,t))||e.content.textBetween(0,e.content.size,` + +`);return{dom:c,text:m,slice:e}}function j0(t,e,n,r,i){let o=i.parent.type.spec.code,s,l;if(!n&&!e)return null;let c=e&&(r||o||!n);if(c){if(t.someProp("transformPastedText",m=>{e=m(e,o||r,t)}),o)return e?new Z(G.from(t.state.schema.text(e.replace(/\r\n?/g,` +`))),0,0):Z.empty;let h=t.someProp("clipboardTextParser",m=>m(e,i,r,t));if(h)l=h;else{let m=i.marks(),{schema:y}=t.state,b=Dr.fromSchema(y);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(w=>{let _=s.appendChild(document.createElement("p"));w&&_.appendChild(b.serializeNode(y.text(w,m)))})}}else t.someProp("transformPastedHTML",h=>{n=h(n,t)}),s=DR(n),ta&&LR(s);let d=s&&s.querySelector("[data-pm-slice]"),f=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let h=+f[3];h>0;h--){let m=s.firstChild;for(;m&&m.nodeType!=1;)m=m.nextSibling;if(!m)break;s=m}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||Ir.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(c||f),context:i,ruleFromNode(m){return m.nodeName=="BR"&&!m.nextSibling&&m.parentNode&&!OR.test(m.parentNode.nodeName)?{ignore:!0}:null}})),f)l=PR(_0(l,+f[1],+f[2]),f[4]);else if(l=Z.maxOpen(RR(l.content,i),!0),l.openStart||l.openEnd){let h=0,m=0;for(let y=l.content.firstChild;h{l=h(l,t)}),l}var OR=/^(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 RR(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(l=>{if(!s)return;let c=i.findWrapping(l.type),d;if(!c)return s=null;if(d=s.length&&o.length&&eE(c,o,l,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=tE(s[s.length-1],o.length));let f=Q0(l,c);s.push(f),i=i.matchType(f.type),o=c}}),s)return G.from(s)}return t}function Q0(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,G.from(t));return t}function eE(t,e,n,r,i){if(i1&&(o=0),i=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(G.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function _0(t,e,n){return en}).createHTML(t):t}function DR(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=rE().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&nE[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"").reverse().join("")),n.innerHTML=IR(t),i)for(let o=0;o=0;l-=2){let c=n.nodes[r[l]];if(!c||c.hasRequiredAttrs())break;i=G.from(c.create(r[l+1],i)),o++,s++}return new Z(i,o,s)}var fn={},pn={},BR={touchstart:!0,touchmove:!0},Pf=class{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.compositionNode=null,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 FR(t){for(let e in fn){let n=fn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{$R(t,r)&&!Vf(t,r)&&(t.editable||!(r.type in pn))&&n(t,r)},BR[e]?{passive:!0}:void 0)}dn&&t.dom.addEventListener("input",()=>null),Bf(t)}function di(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function HR(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Bf(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Vf(t,r))})}function Vf(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function $R(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function zR(t,e){!Vf(t,e)&&fn[e.type]&&(t.editable||!(e.type in pn))&&fn[e.type](t,e)}pn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!oE(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(rr&&nn&&n.keyCode==13)))if(t.domObserver.selectionChanged(t.domSelectionRange())?t.domObserver.flush():n.keyCode!=229&&t.domObserver.forceFlush(),Ko&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,Vi(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||kR(t,n)?n.preventDefault():di(t,"key")};pn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};pn.keypress=(t,e)=>{let n=e;if(oE(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Hn&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof le)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function Vl(t){return{left:t.clientX,top:t.clientY}}function UR(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Gf(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,l=>s>o.depth?l(t,n,o.nodeAfter,o.before(s),i,!0):l(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function Wo(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}function WR(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&pe.isSelectable(r)?(Wo(t,new pe(n),"pointer"),!0):!1}function KR(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof pe&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(pe.isSelectable(l)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(Wo(t,pe.create(t.state.doc,i),"pointer"),!0):!1}function VR(t,e,n,r,i){return Gf(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?KR(t,n):WR(t,n))}function GR(t,e,n,r){return Gf(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function qR(t,e,n,r){return Gf(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||YR(t,n,r)}function YR(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Wo(t,le.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)Wo(t,le.create(r,l+1,l+1+s.content.size),"pointer");else if(pe.isSelectable(s))Wo(t,pe.create(r,l),"pointer");else continue;return!0}}function qf(t){return Fl(t)}var iE=Hn?"metaKey":"ctrlKey";fn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=qf(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&UR(n,t.input.lastClick)&&!n[iE]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(Vl(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Ff(t,s,n,!!r)):(o=="doubleClick"?GR:qR)(t,s.pos,s.inside,n)?n.preventDefault():di(t,"pointer"))};var Ff=class{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[iE],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let f=e.state.doc.resolve(n.pos);o=f.parent,s=f.depth?f.before():0}let l=i?null:r.target,c=l?e.docView.nearestDesc(l,!0):null;this.target=c&&c.dom.nodeType==1?c.dom:null;let{selection:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof pe&&d.from<=s&&d.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ir&&!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()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),di(e,"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(()=>Hr(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Vl(e))),this.updateAllowDefault(e),this.allowDefault||!n?di(this.view,"pointer"):VR(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||dn&&this.mightDrag&&!this.mightDrag.node.isAtom||nn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Wo(this.view,ue.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):di(this.view,"pointer")}move(e){this.updateAllowDefault(e),di(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};fn.touchstart=t=>{t.input.lastTouch=Date.now(),qf(t),di(t,"pointer")};fn.touchmove=t=>{t.input.lastTouch=Date.now(),di(t,"pointer")};fn.contextmenu=t=>qf(t);function oE(t,e){return t.composing?!0:dn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}var JR=rr?5e3:-1;pn.compositionstart=pn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof le&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Fl(t,!0),t.markCursor=null;else if(Fl(t,!e.selection.empty),ir&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let l=t.domSelection();l&&l.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}sE(t,JR)};pn.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,sE(t,20))};function sE(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Fl(t),e))}function aE(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=ZR());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function XR(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=qO(e.focusNode,e.focusOffset),r=YO(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function ZR(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Fl(t,e=!1){if(!(rr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),aE(t),e||t.docView&&t.docView.dirty){let n=Wf(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function jR(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}var Zs=En&&fi<15||Ko&&QO<604;fn.copy=pn.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=Zs?null:n.clipboardData,s=r.content(),{dom:l,text:c}=Z0(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",c)):jR(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function QR(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function eI(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?js(t,r.value,null,i,e):js(t,r.textContent,r.innerHTML,i,e)},50)}function js(t,e,n,r,i){let o=j0(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",c=>c(t,i,o||Z.empty)))return!0;if(!o)return!1;let s=QR(o),l=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function lE(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}pn.paste=(t,e)=>{let n=e;if(t.composing&&!rr)return;let r=Zs?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&js(t,lE(r),r.getData("text/html"),i,n)?n.preventDefault():eI(t,n)};var Hl=class{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}},cE=Hn?"altKey":"ctrlKey";fn.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(Vl(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof pe?i.to-1:i.to))){if(r&&r.mightDrag)s=pe.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=t.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(s=pe.create(t.state.doc,h.posBefore))}}let l=(s||t.state.selection).content(),{dom:c,text:d,slice:f}=Z0(t,l);(!n.dataTransfer.files.length||!nn||B0>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Zs?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",Zs||n.dataTransfer.setData("text/plain",d),t.dragging=new Hl(f,!n[cE],s)};fn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};pn.dragover=pn.dragenter=(t,e)=>e.preventDefault();pn.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Vl(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",b=>{s=b(s,t)}):s=j0(t,lE(n.dataTransfer),Zs?null:n.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!n[cE]);if(t.someProp("handleDrop",b=>b(t,n,s||Z.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let c=s?Nl(t.state.doc,o.pos,s):o.pos;c==null&&(c=o.pos);let d=t.state.tr;if(l){let{node:b}=r;b?b.replace(d):d.deleteSelection()}let f=d.mapping.map(c),h=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,m=d.doc;if(h?d.replaceRangeWith(f,f,s.content.firstChild):d.replaceRange(f,f,s),d.doc.eq(m))return;let y=d.doc.resolve(f);if(h&&pe.isSelectable(s.content.firstChild)&&y.nodeAfter&&y.nodeAfter.sameMarkup(s.content.firstChild))d.setSelection(new pe(y));else{let b=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((w,_,S,L)=>b=L),d.setSelection(Kf(t,y,d.doc.resolve(b)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))};fn.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Hr(t)},20))};fn.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};fn.beforeinput=(t,e)=>{if(nn&&rr&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Vi(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in pn)fn[t]=pn[t];function Qs(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}var $l=class t{constructor(e,n){this.toDOM=e,this.spec=n||Ji,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new Tt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof t&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Qs(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},Yi=class t{constructor(e,n){this.attrs=e,this.spec=n||Ji}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new Tt(o,s,this)}valid(e,n){return n.from=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;se){let l=this.children[s]+1;this.children[s+2].findInner(e-l,n-l,r,i+l,o)}}map(e,n,r){return this==tn||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Ji)}mapInner(e,n,r,i,o){let s;for(let l=0;l{let d=c+r,f;if(f=dE(n,l,d)){for(i||(i=this.children.slice());ol&&h.to=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,s=o+n.content.size;for(let l=0;lo&&c.type instanceof Yi){let d=Math.max(o,c.from)-o,f=Math.min(s,c.to)-o;di.map(e,n,Ji));return t.from(r)}forChild(e,n){if(n.isLeaf)return ot.empty;let r=[];for(let i=0;in instanceof ot)?e:e.reduce((n,r)=>n.concat(r instanceof ot?r:r.members),[]))}}forEachSet(e){for(let n=0;n{let _=w-b-(y-m);for(let S=0;SL+f-h)continue;let D=l[S]+f-h;y>=D?l[S+1]=m<=D?-2:-1:m>=f&&_&&(l[S]+=_,l[S+1]+=_)}h+=_}),f=n.maps[d].map(f,-1)}let c=!1;for(let d=0;d=r.content.size){c=!0;continue}let m=n.map(t[d+1]+o,-1),y=m-i,{index:b,offset:w}=r.content.findIndex(h),_=r.maybeChild(b);if(_&&w==h&&w+_.nodeSize==y){let S=l[d+2].mapInner(n,_,f+1,t[d]+o+1,s);S!=tn?(l[d]=h,l[d+1]=y,l[d+2]=S):(l[d+1]=-2,c=!0)}else c=!0}if(c){let d=nI(l,t,e,n,i,o,s),f=Ul(d,r,0,s);e=f.local;for(let h=0;hn&&s.to{let d=dE(t,l,c+n);if(d){o=!0;let f=Ul(d,l,n+c+1,r);f!=tn&&i.push(c,c+l.nodeSize,f)}});let s=uE(o?fE(t):t,-n).sort(Xi);for(let l=0;l0;)e++;t.splice(e,0,n)}function xf(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=tn&&e.push(r)}),t.cursorWrapper&&e.push(ot.create(t.state.doc,[t.cursorWrapper.deco])),zl.from(e)}var rI={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},iI=En&&fi<=11,$f=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},zf=class{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new $f,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),iI&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.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,rI)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;nthis.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(b0(this.view)){if(this.suppressingSelectionUpdates)return Hr(this.view);if(En&&fi<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Zi(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let o=e.focusNode;o;o=Xs(o))n.add(o);for(let o=e.anchorNode;o;o=Xs(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}selectionChanged(e){return!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&b0(this.view)&&!this.ignoreSelectionChange(e)}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=this.selectionChanged(r),o=-1,s=-1,l=!1,c=[];if(e.editable)for(let f=0;fh.nodeName=="BR");if(f.length==2){let[h,m]=f;h.parentNode&&h.parentNode.parentNode==m.parentNode?m.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let m of f){let y=m.parentNode;y&&y.nodeName=="LI"&&(!h||aI(e,h)!=y)&&m.remove()}}}let d=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),oI(e)),this.handleDOMChange(o,s,l,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Hr(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let f=0;fi;_--){let S=r.childNodes[_-1],L=S.pmViewDesc;if(S.nodeName=="BR"&&!L){o=_;break}if(!L||L.size)break}let h=t.state.doc,m=t.someProp("domParser")||Ir.fromSchema(t.state.schema),y=h.resolve(s),b=null,w=m.parse(r,{topNode:y.parent,topMatch:y.parent.contentMatchAt(y.index()),topOpen:!0,from:i,to:o,preserveWhitespace:y.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:cI,context:y});if(d&&d[0].pos!=null){let _=d[0].pos,S=d[1]&&d[1].pos;S==null&&(S=_),b={anchor:_+s,head:S+s}}return{doc:w,sel:b,from:s,to:l}}function cI(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(dn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||dn&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}var uI=/^(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 dI(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let z=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,re=Wf(t,z);if(re&&!t.state.selection.eq(re)){if(nn&&rr&&t.input.lastKeyCode===13&&Date.now()-100Se(t,Vi(13,"Enter"))))return;let he=t.state.tr.setSelection(re);z=="pointer"?he.setMeta("pointer",!0):z=="key"&&he.scrollIntoView(),o&&he.setMeta("composition",o),t.dispatch(he)}return}let s=t.state.doc.resolve(e),l=s.sharedDepth(n);e=s.before(l+1),n=t.state.doc.resolve(n).after(l+1);let c=t.state.selection,d=lI(t,e,n),f=t.state.doc,h=f.slice(d.from,d.to),m,y;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||rr)&&i.some(z=>z.nodeType==1&&!uI.test(z.nodeName))&&(!b||b.endA>=b.endB)&&t.someProp("handleKeyDown",z=>z(t,Vi(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!b)if(r&&c instanceof le&&!c.empty&&c.$head.sameParent(c.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))b={start:c.from,endA:c.to,endB:c.to};else{if(d.sel){let z=N0(t,t.state.doc,d.sel);if(z&&!z.eq(t.state.selection)){let re=t.state.tr.setSelection(z);o&&re.setMeta("composition",o),t.dispatch(re)}}return}t.state.selection.fromt.state.selection.from&&b.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?b.start=t.state.selection.from:b.endA=t.state.selection.to-2&&t.state.selection.to<=d.to&&(b.endB+=t.state.selection.to-b.endA,b.endA=t.state.selection.to)),En&&fi<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>d.from&&d.doc.textBetween(b.start-d.from-1,b.start-d.from+1)==" \xA0"&&(b.start--,b.endA--,b.endB--);let w=d.doc.resolveNoCache(b.start-d.from),_=d.doc.resolveNoCache(b.endB-d.from),S=f.resolve(b.start),L=w.sameParent(_)&&w.parent.inlineContent&&S.end()>=b.endA,D;if((Ko&&t.input.lastIOSEnter>Date.now()-225&&(!L||i.some(z=>z.nodeName=="DIV"||z.nodeName=="P"))||!L&&w.posz(t,Vi(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>b.start&&pI(f,b.start,b.endA,w,_)&&t.someProp("handleKeyDown",z=>z(t,Vi(8,"Backspace")))){rr&&nn&&t.domObserver.suppressSelectionUpdates();return}nn&&rr&&b.endB==b.start&&(t.input.lastAndroidDelete=Date.now()),rr&&!L&&w.start()!=_.start()&&_.parentOffset==0&&w.depth==_.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==b.endA&&(b.endB-=2,_=d.doc.resolveNoCache(b.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(z){return z(t,Vi(13,"Enter"))})},20));let T=b.start,$=b.endA,O,Y,ee;if(L){if(w.pos==_.pos)En&&fi<=11&&w.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Hr(t),20)),O=t.state.tr.delete(T,$),Y=f.resolve(b.start).marksAcross(f.resolve(b.endA));else if(b.endA==b.endB&&(ee=fI(w.parent.content.cut(w.parentOffset,_.parentOffset),S.parent.content.cut(S.parentOffset,b.endA-S.start()))))O=t.state.tr,ee.type=="add"?O.addMark(T,$,ee.mark):O.removeMark(T,$,ee.mark);else if(w.parent.child(w.index()).isText&&w.index()==_.index()-(_.textOffset?0:1)){let z=w.parent.textBetween(w.parentOffset,_.parentOffset);if(t.someProp("handleTextInput",re=>re(t,T,$,z)))return;O=t.state.tr.insertText(z,T,$)}}if(O||(O=t.state.tr.replace(T,$,d.doc.slice(b.start-d.from,b.endB-d.from))),d.sel){let z=N0(t,O.doc,d.sel);z&&!(nn&&rr&&t.composing&&z.empty&&(b.start!=b.endB||t.input.lastAndroidDeletee.content.size?null:Kf(t,e.resolve(n.anchor),e.resolve(n.head))}function fI(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,l,c;for(let f=0;ff.mark(l.addToSet(f.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",c=f=>f.mark(l.removeFromSet(f.marks));else return null;let d=[];for(let f=0;fn||_f(s,!0,!1)0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function hI(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let c=Math.max(0,o-Math.min(s,l));r-=s+c-o}if(s=s?o-r:0;o-=c,o&&o=l?o-r:0;o-=c,o&&o=56320&&e<=57343&&n>=55296&&n<=56319}var Wl=class{constructor(e,n){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 Pf,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(L0),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=I0(this),R0(this),this.nodeViews=D0(this),this.docView=d0(this.state.doc,O0(this),xf(this),this.dom,this),this.domObserver=new zf(this,(r,i,o,s)=>dI(this,r,i,o,s)),this.domObserver.start(),FR(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Bf(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(L0),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(aE(this),s=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let y=D0(this);gI(y,this.nodeViews)&&(this.nodeViews=y,o=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&Bf(this),this.editable=I0(this),R0(this);let c=xf(this),d=O0(this),f=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",h=o||!this.docView.matchesNode(e.doc,d,c);(h||!e.selection.eq(i.selection))&&(s=!0);let m=f=="preserve"&&s&&this.dom.style.overflowAnchor==null&&nR(this);if(s){this.domObserver.stop();let y=h&&(En||nn)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&mI(i.selection,e.selection);if(h){let b=nn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=XR(this)),(o||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=d0(e.doc,d,c,this.dom,this)),b&&!this.trackWrites&&(y=!0)}y||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&_R(this))?Hr(this,y):(Y0(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),f=="reset"?this.dom.scrollTop=0:f=="to selection"?this.scrollToSelection():m&&rR(m)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof pe){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&o0(this,n.getBoundingClientRect(),e)}else o0(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new Hl(e.slice,e.move,i<0?void 0:pe.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;sn.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return cR(this,e)}coordsAtPos(e,n=1){return U0(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return hR(this,n||this.state,e)}pasteHTML(e,n){return js(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return js(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(HR(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],xf(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,VO())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return zR(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?dn&&this.root.nodeType===11&&XO(this.dom.ownerDocument)==this.dom&&sI(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};function O0(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Tt.node(0,t.state.doc.content.size,e)]}function R0(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Tt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function I0(t){return!t.someProp("editable",e=>e(t.state)===!1)}function mI(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function D0(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function gI(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function L0(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var $r={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ql={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},bI=typeof navigator<"u"&&/Mac/.test(navigator.platform),yI=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(Ct=0;Ct<10;Ct++)$r[48+Ct]=$r[96+Ct]=String(Ct);var Ct;for(Ct=1;Ct<=24;Ct++)$r[Ct+111]="F"+Ct;var Ct;for(Ct=65;Ct<=90;Ct++)$r[Ct]=String.fromCharCode(Ct+32),ql[Ct]=String.fromCharCode(Ct);var Ct;for(Gl in $r)ql.hasOwnProperty(Gl)||(ql[Gl]=$r[Gl]);var Gl;function pE(t){var e=bI&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||yI&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?ql:$r)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}var EI=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function vI(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let l=0;l127)&&(o=$r[r.keyCode])&&o!=i){let l=e[Jf(o,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var Yl=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function gE(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}var Zf=(t,e,n)=>{let r=gE(t,n);if(!r)return!1;let i=Qf(r);if(!i){let s=r.blockRange(),l=s&&Pr(s);return l==null?!1:(e&&e(t.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(TE(t,i,e,-1))return!0;if(r.parent.content.size==0&&(Go(o,"end")||pe.isSelectable(o)))for(let s=r.depth;;s--){let l=Vs(t.doc,r.before(s),r.after(s),Z.empty);if(l&&l.slice.size1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},bE=(t,e,n)=>{let r=gE(t,n);if(!r)return!1;let i=Qf(r);return i?EE(t,i,e):!1},yE=(t,e,n)=>{let r=vE(t,n);if(!r)return!1;let i=np(r);return i?EE(t,i,e):!1};function EE(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let f=i.lastChild;if(!f)return!1;i=f}let s=e.nodeAfter,l=s,c=e.pos+1;for(;!l.isTextblock;c++){if(l.type.spec.isolating)return!1;let f=l.firstChild;if(!f)return!1;l=f}let d=Vs(t.doc,o,c,Z.empty);if(!d||d.from!=o||d instanceof en&&d.slice.size>=c-o)return!1;if(n){let f=t.tr.step(d);f.setSelection(le.create(f.doc,o)),n(f.scrollIntoView())}return!0}function Go(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var jf=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=Qf(r)}let s=o&&o.nodeBefore;return!s||!pe.isSelectable(s)?!1:(e&&e(t.tr.setSelection(pe.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function Qf(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function vE(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=vE(t,n);if(!r)return!1;let i=np(r);if(!i)return!1;let o=i.nodeAfter;if(TE(t,i,e,1))return!0;if(r.parent.content.size==0&&(Go(o,"start")||pe.isSelectable(o))){let s=Vs(t.doc,r.before(),r.after(),Z.empty);if(s&&s.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof pe,i;if(r){if(n.node.isTextblock||!nr(t.doc,n.from))return!1;i=n.from}else if(i=Bo(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(pe.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},xE=(t,e)=>{let n=t.selection,r;if(n instanceof pe){if(n.node.isTextblock||!nr(t.doc,n.to))return!1;r=n.to}else if(r=Bo(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},_E=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&Pr(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},rp=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` +`).scrollIntoView()),!0)};function ip(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=ip(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let l=n.after(),c=t.tr.replaceWith(l,l,s.createAndFill());c.setSelection(ue.near(c.doc.resolve(l),1)),e(c.scrollIntoView())}return!0},sp=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Nn||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=ip(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Fn(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Pr(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function xI(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof pe&&e.selection.node.isBlock)return!r.parentOffset||!Fn(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;let o=i.parentOffset==i.parent.content.size,s=e.tr;(e.selection instanceof le||e.selection instanceof Nn)&&s.deleteSelection();let l=r.depth==0?null:ip(r.node(-1).contentMatchAt(r.indexAfter(-1))),c=t&&t(i.parent,o,r),d=c?[c]:o&&l?[{type:l}]:void 0,f=Fn(s.doc,s.mapping.map(r.pos),1,d);if(!d&&!f&&Fn(s.doc,s.mapping.map(r.pos),1,l?[{type:l}]:void 0)&&(l&&(d=[{type:l}]),f=!0),!f)return!1;if(s.split(s.mapping.map(r.pos),1,d),!o&&!r.parentOffset&&r.parent.type!=l){let h=s.mapping.map(r.before()),m=s.doc.resolve(h);l&&r.node(-1).canReplaceWith(m.index(),m.index()+1,l)&&s.setNodeMarkup(s.mapping.map(r.before()),l)}return n&&n(s.scrollIntoView()),!0}}var _I=xI();var SE=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(pe.create(t.doc,i))),!0)},SI=(t,e)=>(e&&e(t.tr.setSelection(new Nn(t.doc))),!0);function TI(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||nr(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function TE(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,l,c=i.type.spec.isolating||o.type.spec.isolating;if(!c&&TI(t,e,n))return!0;let d=!c&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(s=(l=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&l.matchType(s[0]||o.type).validEnd){if(n){let y=e.pos+o.nodeSize,b=G.empty;for(let S=s.length-1;S>=0;S--)b=G.from(s[S].create(null,b));b=G.from(i.copy(b));let w=t.tr.step(new St(e.pos-1,y,e.pos,y,new Z(b,1,0),s.length,!0)),_=w.doc.resolve(y+2*s.length);_.nodeAfter&&_.nodeAfter.type==i.type&&nr(w.doc,_.pos)&&w.join(_.pos),n(w.scrollIntoView())}return!0}let f=o.type.spec.isolating||r>0&&c?null:ue.findFrom(e,1),h=f&&f.$from.blockRange(f.$to),m=h&&Pr(h);if(m!=null&&m>=e.depth)return n&&n(t.tr.lift(h,m).scrollIntoView()),!0;if(d&&Go(o,"start",!0)&&Go(i,"end")){let y=i,b=[];for(;b.push(y),!y.isTextblock;)y=y.lastChild;let w=o,_=1;for(;!w.isTextblock;w=w.firstChild)_++;if(y.canReplace(y.childCount,y.childCount,w.content)){if(n){let S=G.empty;for(let D=b.length-1;D>=0;D--)S=G.from(b[D].copy(S));let L=t.tr.step(new St(e.pos-b.length,e.pos+o.nodeSize,e.pos+_,e.pos+o.nodeSize-_,new Z(S,b.length,0),0,!0));n(L.scrollIntoView())}return!0}}return!1}function CE(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(le.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}var lp=CE(-1),cp=CE(1);function AE(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&Po(s,t,e);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function up(t,e=null){return function(n,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!c.isTextblock||c.hasMarkup(t,e)))if(c.type==t)i=!0;else{let f=n.doc.resolve(d),h=f.index();i=f.parent.canReplaceWith(h,h+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s=2&&i.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let f=n.doc.resolve(s.start-2);c=new zi(f,f,s.depth),s.endIndex=0;f--)o=G.from(n[f].type.create(n[f].attrs,o));t.step(new St(e.start-(r?2:0),e.end,e.start,e.end,new Z(o,0,0),n.length,!0));let s=0;for(let f=0;fs.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?MI(e,n,t,o):NI(e,n,o):!0:!1}}function MI(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);ow;b--)y-=i.child(b).nodeSize,r.delete(y-1,y+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,c=n.endIndex==i.childCount,d=o.node(-1),f=o.index(-1);if(!d.canReplace(f+(l?0:1),f+1,s.content.append(c?G.empty:G.from(i))))return!1;let h=o.pos,m=h+s.nodeSize;return r.step(new St(h-(l?1:0),m+(c?1:0),h+1,m-1,new Z((l?G.empty:G.from(i.copy(G.empty))).append(c?G.empty:G.from(i.copy(G.empty))),l?0:1,c?0:1),l?0:1)),e(r.scrollIntoView()),!0}function kE(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let l=o.parent,c=l.child(s-1);if(c.type!=t)return!1;if(n){let d=c.lastChild&&c.lastChild.type==l.type,f=G.from(d?t.create():null),h=new Z(G.from(t.create(null,G.from(l.type.create(null,f)))),d?3:1,0),m=o.start,y=o.end;n(e.tr.step(new St(m-(d?3:1),y,m,y,h,1,!0)).scrollIntoView())}return!0}}function nc(t){let{state:e,transaction:n}=t,{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}var qo=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([l,c])=>[l,(...f)=>{let h=c(...f)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l=[],c=!!e,d=e||o.tr,f=()=>(!c&&n&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(d),l.every(m=>m===!0)),h={...Object.fromEntries(Object.entries(r).map(([m,y])=>[m,(...w)=>{let _=this.buildProps(d,n),S=y(...w)(_);return l.push(S),h}])),run:f};return h}createCan(e){let{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([c,d])=>[c,(...f)=>d(...f)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l={tr:e,editor:i,view:s,state:nc({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([c,d])=>[c,(...f)=>d(...f)(l)]))}};return l}},mp=class{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){let r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){let r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}};function ne(t,e,n){return t.config[e]===void 0&&t.parent?ne(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?ne(t.parent,e,n):null}):t.config[e]}function rc(t){let e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function BE(t){let e=[],{nodeExtensions:n,markExtensions:r}=rc(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{let l={name:s.name,options:s.options,storage:s.storage,extensions:i},c=ne(s,"addGlobalAttributes",l);if(!c)return;c().forEach(f=>{f.types.forEach(h=>{Object.entries(f.attributes).forEach(([m,y])=>{e.push({type:h,name:m,attribute:{...o,...y}})})})})}),i.forEach(s=>{let l={name:s.name,options:s.options,storage:s.storage},c=ne(s,"addAttributes",l);if(!c)return;let d=c();Object.entries(d).forEach(([f,h])=>{let m={...o,...h};typeof m?.default=="function"&&(m.default=m.default()),m?.isRequired&&m?.default===void 0&&delete m.default,e.push({type:s.name,name:f,attribute:m})})}),e}function zt(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function Q(...t){return t.filter(e=>!!e).reduce((e,n)=>{let r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){let l=o?o.split(" "):[],c=r[i]?r[i].split(" "):[],d=l.filter(f=>!c.includes(f));r[i]=[...c,...d].join(" ")}else if(i==="style"){let l=o?o.split(";").map(f=>f.trim()).filter(Boolean):[],c=r[i]?r[i].split(";").map(f=>f.trim()).filter(Boolean):[],d=new Map;c.forEach(f=>{let[h,m]=f.split(":").map(y=>y.trim());d.set(h,m)}),l.forEach(f=>{let[h,m]=f.split(":").map(y=>y.trim());d.set(h,m)}),r[i]=Array.from(d.entries()).map(([f,h])=>`${f}: ${h}`).join("; ")}else r[i]=o}),r},{})}function gp(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>Q(n,r),{})}function FE(t){return typeof t=="function"}function Te(t,e=void 0,...n){return FE(t)?e?t.bind(e)(...n):t(...n):t}function kI(t={}){return Object.keys(t).length===0&&t.constructor===Object}function OI(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function OE(t,e){return"style"in t?t:{...t,getAttrs:n=>{let r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;let i=e.reduce((o,s)=>{let l=s.attribute.parseHTML?s.attribute.parseHTML(n):OI(n.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function RE(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&kI(n)?!1:n!=null))}function RI(t,e){var n;let r=BE(t),{nodeExtensions:i,markExtensions:o}=rc(t),s=(n=i.find(d=>ne(d,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(i.map(d=>{let f=r.filter(S=>S.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((S,L)=>{let D=ne(L,"extendNodeSchema",h);return{...S,...D?D(d):{}}},{}),y=RE({...m,content:Te(ne(d,"content",h)),marks:Te(ne(d,"marks",h)),group:Te(ne(d,"group",h)),inline:Te(ne(d,"inline",h)),atom:Te(ne(d,"atom",h)),selectable:Te(ne(d,"selectable",h)),draggable:Te(ne(d,"draggable",h)),code:Te(ne(d,"code",h)),whitespace:Te(ne(d,"whitespace",h)),defining:Te(ne(d,"defining",h)),isolating:Te(ne(d,"isolating",h)),attrs:Object.fromEntries(f.map(S=>{var L;return[S.name,{default:(L=S?.attribute)===null||L===void 0?void 0:L.default}]}))}),b=Te(ne(d,"parseHTML",h));b&&(y.parseDOM=b.map(S=>OE(S,f)));let w=ne(d,"renderHTML",h);w&&(y.toDOM=S=>w({node:S,HTMLAttributes:gp(S,f)}));let _=ne(d,"renderText",h);return _&&(y.toText=_),[d.name,y]})),c=Object.fromEntries(o.map(d=>{let f=r.filter(_=>_.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((_,S)=>{let L=ne(S,"extendMarkSchema",h);return{..._,...L?L(d):{}}},{}),y=RE({...m,inclusive:Te(ne(d,"inclusive",h)),excludes:Te(ne(d,"excludes",h)),group:Te(ne(d,"group",h)),spanning:Te(ne(d,"spanning",h)),code:Te(ne(d,"code",h)),attrs:Object.fromEntries(f.map(_=>{var S;return[_.name,{default:(S=_?.attribute)===null||S===void 0?void 0:S.default}]}))}),b=Te(ne(d,"parseHTML",h));b&&(y.parseDOM=b.map(_=>OE(_,f)));let w=ne(d,"renderHTML",h);return w&&(y.toDOM=_=>w({mark:_,HTMLAttributes:gp(_,f)})),[d.name,y]}));return new Bs({topNode:s,nodes:l,marks:c})}function fp(t,e){return e.nodes[t]||e.marks[t]||null}function IE(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}var II=(t,e=500)=>{let n="",r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,l)=>{var c,d;let f=((d=(c=i.type.spec).toText)===null||d===void 0?void 0:d.call(c,{node:i,pos:o,parent:s,index:l}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?f:f.slice(0,Math.max(0,r-o))}),n};function _p(t){return Object.prototype.toString.call(t)==="[object RegExp]"}var Yo=class{constructor(e){this.find=e.find,this.handler=e.handler}},DI=(t,e)=>{if(_p(e))return e.exec(t);let n=e(t);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Jl(t){var e;let{editor:n,from:r,to:i,text:o,rules:s,plugin:l}=t,{view:c}=n;if(c.composing)return!1;let d=c.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(m=>m.type.spec.code))return!1;let f=!1,h=II(d)+o;return s.forEach(m=>{if(f)return;let y=DI(h,m.find);if(!y)return;let b=c.state.tr,w=nc({state:c.state,transaction:b}),_={from:r-(y[0].length-o.length),to:i},{commands:S,chain:L,can:D}=new qo({editor:n,state:w});m.handler({state:w,range:_,match:y,commands:S,chain:L,can:D})===null||!b.steps.length||(b.setMeta(l,{transform:b,from:r,to:i,text:o}),c.dispatch(b),f=!0)}),f}function LI(t){let{editor:e,rules:n}=t,r=new ke({state:{init(){return null},apply(i,o){let s=i.getMeta(r);if(s)return s;let l=i.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{from:d,text:f}=l,h=d+f.length;Jl({editor:e,from:d,to:h,text:f,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,l){return Jl({editor:e,from:o,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{let{$cursor:o}=i.state.selection;o&&Jl({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;let{$cursor:s}=i.state.selection;return s?Jl({editor:e,from:s.pos,to:s.pos,text:` +`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function PI(t){return Object.prototype.toString.call(t).slice(8,-1)}function Xl(t){return PI(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function ic(t,e){let n={...t};return Xl(t)&&Xl(e)&&Object.keys(e).forEach(r=>{Xl(e[r])&&Xl(t[r])?n[r]=ic(t[r],e[r]):n[r]=e[r]}),n}var st=class t{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Te(ne(this,"addOptions",{name:this.name}))),this.storage=Te(ne(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend({...this.config,addOptions:()=>ic(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){let n=new t(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Te(ne(n,"addOptions",{name:n.name})),n.storage=Te(ne(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){let{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){let s=i.marks();if(!!!s.find(d=>d?.type.name===n.name))return!1;let c=s.find(d=>d?.type.name===n.name);return c&&r.removeStoredMark(c),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}};function BI(t){return typeof t=="number"}var bp=class{constructor(e){this.find=e.find,this.handler=e.handler}},FI=(t,e,n)=>{if(_p(e))return[...t.matchAll(e)];let r=e(t,n);return r?r.map(i=>{let o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function HI(t){let{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=t,{commands:c,chain:d,can:f}=new qo({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,i,(y,b)=>{if(!y.isTextblock||y.type.spec.code)return;let w=Math.max(r,b),_=Math.min(i,b+y.content.size),S=y.textBetween(w-b,_-b,void 0,"\uFFFC");FI(S,o.find,s).forEach(D=>{if(D.index===void 0)return;let T=w+D.index+1,$=T+D[0].length,O={from:n.tr.mapping.map(T),to:n.tr.mapping.map($)},Y=o.handler({state:n,range:O,match:D,commands:c,chain:d,can:f,pasteEvent:s,dropEvent:l});h.push(Y)})}),h.every(y=>y!==null)}var $I=t=>{var e;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function zI(t){let{editor:e,rules:n}=t,r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l=typeof DragEvent<"u"?new DragEvent("drop"):null,c=({state:f,from:h,to:m,rule:y,pasteEvt:b})=>{let w=f.tr,_=nc({state:f,transaction:w});if(!(!HI({editor:e,state:_,from:Math.max(h-1,0),to:m.b-1,rule:y,pasteEvent:b,dropEvent:l})||!w.steps.length))return l=typeof DragEvent<"u"?new DragEvent("drop"):null,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,w};return n.map(f=>new ke({view(h){let m=y=>{var b;r=!((b=h.dom.parentElement)===null||b===void 0)&&b.contains(y.target)?h.dom.parentElement:null};return window.addEventListener("dragstart",m),{destroy(){window.removeEventListener("dragstart",m)}}},props:{handleDOMEvents:{drop:(h,m)=>(o=r===h.dom.parentElement,l=m,!1),paste:(h,m)=>{var y;let b=(y=m.clipboardData)===null||y===void 0?void 0:y.getData("text/html");return s=m,i=!!b?.includes("data-pm-slice"),!1}}},appendTransaction:(h,m,y)=>{let b=h[0],w=b.getMeta("uiEvent")==="paste"&&!i,_=b.getMeta("uiEvent")==="drop"&&!o,S=b.getMeta("applyPasteRules"),L=!!S;if(!w&&!_&&!L)return;if(L){let{from:$,text:O}=S,Y=$+O.length,ee=$I(O);return c({rule:f,state:y,from:$,to:{b:Y},pasteEvt:ee})}let D=m.doc.content.findDiffStart(y.doc.content),T=m.doc.content.findDiffEnd(y.doc.content);if(!(!BI(D)||!T||D===T.b))return c({rule:f,state:y,from:D,to:T,pasteEvt:s})}}))}function UI(t){let e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}var yp=class t{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=t.resolve(e),this.schema=RI(this.extensions,n),this.setupExtensions()}static resolve(e){let n=t.sort(t.flatten(e)),r=UI(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{let r={name:n.name,options:n.options,storage:n.storage},i=ne(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{let o=ne(r,"priority")||100,s=ne(i,"priority")||100;return o>s?-1:o{let r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:fp(n.name,this.schema)},i=ne(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){let{editor:e}=this,n=t.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{let l={name:s.name,options:s.options,storage:s.storage,editor:e,type:fp(s.name,this.schema)},c=[],d=ne(s,"addKeyboardShortcuts",l),f={};if(s.type==="mark"&&ne(s,"exitable",l)&&(f.ArrowRight=()=>st.handleExit({editor:e,mark:s})),d){let w=Object.fromEntries(Object.entries(d()).map(([_,S])=>[_,()=>S({editor:e})]));f={...f,...w}}let h=hE(f);c.push(h);let m=ne(s,"addInputRules",l);IE(s,e.options.enableInputRules)&&m&&r.push(...m());let y=ne(s,"addPasteRules",l);IE(s,e.options.enablePasteRules)&&y&&i.push(...y());let b=ne(s,"addProseMirrorPlugins",l);if(b){let w=b();c.push(...w)}return c}).flat();return[LI({editor:e,rules:r}),...zI({editor:e,rules:i}),...o]}get attributes(){return BE(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:n}=rc(this.extensions);return Object.fromEntries(n.filter(r=>!!ne(r,"addNodeView")).map(r=>{let i=this.attributes.filter(c=>c.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:zt(r.name,this.schema)},s=ne(r,"addNodeView",o);if(!s)return[];let l=(c,d,f,h,m)=>{let y=gp(c,i);return s()({node:c,view:d,getPos:f,decorations:h,innerDecorations:m,editor:e,extension:r,HTMLAttributes:y})};return[r.name,l]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;let r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:fp(e.name,this.schema)};e.type==="mark"&&(!((n=Te(ne(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);let i=ne(e,"onBeforeCreate",r),o=ne(e,"onCreate",r),s=ne(e,"onUpdate",r),l=ne(e,"onSelectionUpdate",r),c=ne(e,"onTransaction",r),d=ne(e,"onFocus",r),f=ne(e,"onBlur",r),h=ne(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),l&&this.editor.on("selectionUpdate",l),c&&this.editor.on("transaction",c),d&&this.editor.on("focus",d),f&&this.editor.on("blur",f),h&&this.editor.on("destroy",h)})}},We=class t{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Te(ne(this,"addOptions",{name:this.name}))),this.storage=Te(ne(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend({...this.config,addOptions:()=>ic(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){let n=new t({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Te(ne(n,"addOptions",{name:n.name})),n.storage=Te(ne(n,"addStorage",{name:n.name,options:n.options})),n}};function HE(t,e,n){let{from:r,to:i}=e,{blockSeparator:o=` + +`,textSerializers:s={}}=n||{},l="";return t.nodesBetween(r,i,(c,d,f,h)=>{var m;c.isBlock&&d>r&&(l+=o);let y=s?.[c.type.name];if(y)return f&&(l+=y({node:c,pos:d,parent:f,index:h,range:e})),!1;c.isText&&(l+=(m=c?.text)===null||m===void 0?void 0:m.slice(Math.max(r,d)-d,i-d))}),l}function $E(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}var WI=We.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ke({key:new ze("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(f=>f.$from.pos)),l=Math.max(...o.map(f=>f.$to.pos)),c=$E(n);return HE(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),KI=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),VI=(t=!1)=>({commands:e})=>e.setContent("",t),GI=()=>({state:t,tr:e,dispatch:n})=>{let{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(l,c)=>{if(l.type.isText)return;let{doc:d,mapping:f}=e,h=d.resolve(f.map(c)),m=d.resolve(f.map(c+l.nodeSize)),y=h.blockRange(m);if(!y)return;let b=Pr(y);if(l.type.isTextblock){let{defaultType:w}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(y.start,w)}(b||b===0)&&e.lift(y,b)})}),!0},qI=t=>e=>t(e),YI=()=>({state:t,dispatch:e})=>sp(t,e),JI=(t,e)=>({editor:n,tr:r})=>{let{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);let s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new le(r.doc.resolve(s-1))),!0},XI=()=>({tr:t,dispatch:e})=>{let{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;let i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){let l=i.before(o),c=i.after(o);t.delete(l,c).scrollIntoView()}return!0}return!1},ZI=t=>({tr:e,state:n,dispatch:r})=>{let i=zt(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){let c=o.before(s),d=o.after(s);e.delete(c,d).scrollIntoView()}return!0}return!1},jI=t=>({tr:e,dispatch:n})=>{let{from:r,to:i}=t;return n&&e.delete(r,i),!0},QI=()=>({state:t,dispatch:e})=>Yl(t,e),eD=()=>({commands:t})=>t.keyboardShortcut("Enter"),tD=()=>({state:t,dispatch:e})=>op(t,e);function Ql(t,e,n={strict:!0}){let r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:_p(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function Ep(t,e,n={}){return t.find(r=>r.type===e&&Ql(r.attrs,n))}function nD(t,e,n={}){return!!Ep(t,e,n)}function Sp(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;let i=Ep([...r.node.marks],e,n);if(!i)return;let o=r.index,s=t.start()+r.offset,l=o+1,c=s+r.node.nodeSize;for(Ep([...r.node.marks],e,n);o>0&&i.isInSet(t.parent.child(o-1).marks);)o-=1,s-=t.parent.child(o).nodeSize;for(;l({tr:n,state:r,dispatch:i})=>{let o=gi(t,r.schema),{doc:s,selection:l}=n,{$from:c,from:d,to:f}=l;if(i){let h=Sp(c,o,e);if(h&&h.from<=d&&h.to>=f){let m=le.create(s,h.from,h.to);n.setSelection(m)}}return!0},iD=t=>e=>{let n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};let s=()=>{Tp()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e?.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!oc(n.state.selection))return s(),!0;let l=zE(i.doc,t)||n.state.selection,c=n.state.selection.eq(l);return o&&(c||i.setSelection(l),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},sD=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),aD=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),UE=t=>{let e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){let r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&UE(r)}return t};function Zl(t){let e=`${t}`,n=new window.DOMParser().parseFromString(e,"text/html").body;return UE(n)}function ec(t,e,n){n={slice:!0,parseOptions:{},...n};let r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return G.fromArray(t.map(l=>e.nodeFromJSON(l)));let s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),ec("",e,n)}if(i){if(n.errorOnInvalidContent){let s=!1,l="",c=new Bs({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(s=!0,l=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?Ir.fromSchema(c).parseSlice(Zl(t),n.parseOptions):Ir.fromSchema(c).parse(Zl(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}let o=Ir.fromSchema(e);return n.slice?o.parseSlice(Zl(t),n.parseOptions).content:o.parse(Zl(t),n.parseOptions)}return ec("",e,n)}function lD(t,e,n){let r=t.steps.length-1;if(r{s===0&&(s=f)}),t.setSelection(ue.near(t.doc.resolve(s),n))}var cD=t=>!("type"in t),uD=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;try{l=ec(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch(b){return o.emit("contentError",{editor:o,error:b,disableCollaboration:()=>{console.error("[tiptap error]: Unable to disable collaboration at this point in time")}}),!1}let{from:c,to:d}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,h=!0;if((cD(l)?l:[l]).forEach(b=>{b.check(),f=f?b.isText&&b.marks.length===0:!1,h=h?b.isBlock:!1}),c===d&&h){let{parent:b}=r.doc.resolve(c);b.isTextblock&&!b.type.spec.code&&!b.childCount&&(c-=1,d+=1)}let y;f?(Array.isArray(e)?y=e.map(b=>b.text||"").join(""):typeof e=="object"&&e&&e.text?y=e.text:y=e,r.insertText(y,c,d)):(y=l,r.replaceWith(c,d,y)),n.updateSelection&&lD(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:y}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:y})}return!0},dD=()=>({state:t,dispatch:e})=>wE(t,e),fD=()=>({state:t,dispatch:e})=>xE(t,e),pD=()=>({state:t,dispatch:e})=>Zf(t,e),hD=()=>({state:t,dispatch:e})=>ep(t,e),mD=()=>({state:t,dispatch:e,tr:n})=>{try{let r=Bo(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},gD=()=>({state:t,dispatch:e,tr:n})=>{try{let r=Bo(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},bD=()=>({state:t,dispatch:e})=>bE(t,e),yD=()=>({state:t,dispatch:e})=>yE(t,e);function WE(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function ED(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let l=0;l({editor:e,view:n,tr:r,dispatch:i})=>{let o=ED(t).split(/-(?!$)/),s=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,l))});return c?.steps.forEach(d=>{let f=d.map(r.mapping);f&&i&&r.maybeStep(f)}),!0};function ra(t,e,n={}){let{from:r,to:i,empty:o}=t.selection,s=e?zt(e,t.schema):null,l=[];t.doc.nodesBetween(r,i,(h,m)=>{if(h.isText)return;let y=Math.max(r,m),b=Math.min(i,m+h.nodeSize);l.push({node:h,from:y,to:b})});let c=i-r,d=l.filter(h=>s?s.name===h.node.type.name:!0).filter(h=>Ql(h.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((h,m)=>h+m.to-m.from,0)>=c}var wD=(t,e={})=>({state:n,dispatch:r})=>{let i=zt(t,n.schema);return ra(n,i,e)?_E(n,r):!1},xD=()=>({state:t,dispatch:e})=>ap(t,e),_D=t=>({state:e,dispatch:n})=>{let r=zt(t,e.schema);return NE(r)(e,n)},SD=()=>({state:t,dispatch:e})=>rp(t,e);function sc(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function DE(t,e){let n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}var TD=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=sc(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=zt(t,r.schema)),l==="mark"&&(s=gi(t,r.schema)),i&&n.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(d,f)=>{o&&o===d.type&&n.setNodeMarkup(f,void 0,DE(d.attrs,e)),s&&d.marks.length&&d.marks.forEach(h=>{s===h.type&&n.addMark(f,f+d.nodeSize,s.create(DE(h.attrs,e)))})})}),!0):!1},CD=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),AD=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),MD=()=>({state:t,dispatch:e})=>jf(t,e),ND=()=>({state:t,dispatch:e})=>tp(t,e),kD=()=>({state:t,dispatch:e})=>SE(t,e),OD=()=>({state:t,dispatch:e})=>cp(t,e),RD=()=>({state:t,dispatch:e})=>lp(t,e);function vp(t,e,n={},r={}){return ec(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var ID=(t,e=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:l})=>{var c,d;let{doc:f}=o;if(n.preserveWhitespace!=="full"){let h=vp(t,i.schema,n,{errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:i.options.enableContentCheck});return s&&o.replaceWith(0,f.content.size,h).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),l.insertContentAt({from:0,to:f.content.size},t,{parseOptions:n,errorOnInvalidContent:(d=r.errorOnInvalidContent)!==null&&d!==void 0?d:i.options.enableContentCheck})};function ac(t,e){let n=gi(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,c=>{s.push(...c.marks)});let l=s.find(c=>c.type.name===n.name);return l?{...l.attrs}:{}}function KE(t,e){let n=new li(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function Cp(t){for(let e=0;e{e(r)&&n.push({node:r,pos:i})}),n}function VE(t,e,n){let r=[];return t.nodesBetween(e.from,e.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function Ap(t,e){for(let n=t.depth;n>0;n-=1){let r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function eo(t){return e=>Ap(e.$from,t)}function DD(t,e){let n=Dr.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function LD(t,e){let n={from:0,to:t.content.size};return HE(t,n,e)}function PD(t,e){let n=zt(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,l=>{o.push(l)});let s=o.reverse().find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function Mp(t,e){let n=sc(typeof e=="string"?e:e.name,t.schema);return n==="node"?PD(t,e):n==="mark"?ac(t,e):{}}function BD(t,e=JSON.stringify){let n={};return t.filter(r=>{let i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function FD(t){let e=BD(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function GE(t){let{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,o)=>{let s=[];if(i.ranges.length)i.forEach((l,c)=>{s.push({from:l,to:c})});else{let{from:l,to:c}=n[o];if(l===void 0||c===void 0)return;s.push({from:l,to:c})}s.forEach(({from:l,to:c})=>{let d=e.slice(o).map(l,-1),f=e.slice(o).map(c),h=e.invert().map(d,-1),m=e.invert().map(f);r.push({oldRange:{from:h,to:m},newRange:{from:d,to:f}})})}),FD(r)}function lc(t,e,n){let r=[];return t===e?n.resolve(t).marks().forEach(i=>{let o=n.resolve(t),s=Sp(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function jl(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{let i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function wp(t,e,n={}){let{empty:r,ranges:i}=t.selection,o=e?gi(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>o?o.name===h.type.name:!0).find(h=>Ql(h.attrs,n,{strict:!1}));let s=0,l=[];if(i.forEach(({$from:h,$to:m})=>{let y=h.pos,b=m.pos;t.doc.nodesBetween(y,b,(w,_)=>{if(!w.isText&&!w.marks.length)return;let S=Math.max(y,_),L=Math.min(b,_+w.nodeSize),D=L-S;s+=D,l.push(...w.marks.map(T=>({mark:T,from:S,to:L})))})}),s===0)return!1;let c=l.filter(h=>o?o.name===h.mark.type.name:!0).filter(h=>Ql(h.mark.attrs,n,{strict:!1})).reduce((h,m)=>h+m.to-m.from,0),d=l.filter(h=>o?h.mark.type!==o&&h.mark.type.excludes(o):!0).reduce((h,m)=>h+m.to-m.from,0);return(c>0?c+d:c)>=s}function Ur(t,e,n={}){if(!e)return ra(t,null,n)||wp(t,null,n);let r=sc(e,t.schema);return r==="node"?ra(t,e,n):r==="mark"?wp(t,e,n):!1}function LE(t,e){let{nodeExtensions:n}=rc(e),r=n.find(s=>s.name===t);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=Te(ne(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function ia(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(o=>{i!==!1&&(ia(o,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function cc(t){return t instanceof pe}function uc(t,e,n){let i=t.state.doc.content.size,o=zr(e,0,i),s=zr(n,0,i),l=t.coordsAtPos(o),c=t.coordsAtPos(s,-1),d=Math.min(l.top,c.top),f=Math.max(l.bottom,c.bottom),h=Math.min(l.left,c.left),m=Math.max(l.right,c.right),y=m-h,b=f-d,S={top:d,bottom:f,left:h,right:m,width:y,height:b,x:h,y:d};return{...S,toJSON:()=>S}}function HD(t,e,n){var r;let{selection:i}=e,o=null;if(oc(i)&&(o=i.$cursor),o){let l=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(l)||!l.some(c=>c.type.excludes(n))}let{ranges:s}=i;return s.some(({$from:l,$to:c})=>{let d=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,c.pos,(f,h,m)=>{if(d)return!1;if(f.isInline){let y=!m||m.type.allowsMarkType(n),b=!!n.isInSet(f.marks)||!f.marks.some(w=>w.type.excludes(n));d=y&&b}return!d}),d})}var $D=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:l}=o,c=gi(t,r.schema);if(i)if(s){let d=ac(r,c);n.addStoredMark(c.create({...d,...e}))}else l.forEach(d=>{let f=d.$from.pos,h=d.$to.pos;r.doc.nodesBetween(f,h,(m,y)=>{let b=Math.max(y,f),w=Math.min(y+m.nodeSize,h);m.marks.find(S=>S.type===c)?m.marks.forEach(S=>{c===S.type&&n.addMark(b,w,c.create({...S.attrs,...e}))}):n.addMark(b,w,c.create(e))})});return HD(r,n,c)},zD=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),UD=(t,e={})=>({state:n,dispatch:r,chain:i})=>{let o=zt(t,n.schema);return o.isTextblock?i().command(({commands:s})=>up(o,e)(n)?!0:s.clearNodes()).command(({state:s})=>up(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},WD=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,i=zr(t,0,r.content.size),o=pe.create(r,i);e.setSelection(o)}return!0},KD=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=le.atStart(r).from,l=le.atEnd(r).to,c=zr(i,s,l),d=zr(o,s,l),f=le.create(r,c,d);e.setSelection(f)}return!0},VD=t=>({state:e,dispatch:n})=>{let r=zt(t,e.schema);return kE(r)(e,n)};function PE(t,e){let n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){let r=n.filter(i=>e?.includes(i.type.name));t.tr.ensureMarks(r)}}var GD=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{let{selection:o,doc:s}=e,{$from:l,$to:c}=o,d=i.extensionManager.attributes,f=jl(d,l.node().type.name,l.node().attrs);if(o instanceof pe&&o.node.isBlock)return!l.parentOffset||!Fn(s,l.pos)?!1:(r&&(t&&PE(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;let h=c.parentOffset===c.parent.content.size,m=l.depth===0?void 0:Cp(l.node(-1).contentMatchAt(l.indexAfter(-1))),y=h&&m?[{type:m,attrs:f}]:void 0,b=Fn(e.doc,e.mapping.map(l.pos),1,y);if(!y&&!b&&Fn(e.doc,e.mapping.map(l.pos),1,m?[{type:m}]:void 0)&&(b=!0,y=m?[{type:m,attrs:f}]:void 0),r){if(b&&(o instanceof le&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,y),m&&!h&&!l.parentOffset&&l.parent.type!==m)){let w=e.mapping.map(l.before()),_=e.doc.resolve(w);l.node(-1).canReplaceWith(_.index(),_.index()+1,m)&&e.setNodeMarkup(e.mapping.map(l.before()),m)}t&&PE(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return b},qD=(t,e={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;let l=zt(t,r.schema),{$from:c,$to:d}=r.selection,f=r.selection.node;if(f&&f.isBlock||c.depth<2||!c.sameParent(d))return!1;let h=c.node(-1);if(h.type!==l)return!1;let m=o.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==l||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){let S=G.empty,L=c.index(-1)?1:c.index(-2)?2:3;for(let ee=c.depth-L;ee>=c.depth-3;ee-=1)S=G.from(c.node(ee).copy(S));let D=c.indexAfter(-1){if(Y>-1)return!1;ee.isTextblock&&ee.content.size===0&&(Y=z+1)}),Y>-1&&n.setSelection(le.near(n.doc.resolve(Y))),n.scrollIntoView()}return!0}let y=d.pos===c.end()?h.contentMatchAt(0).defaultType:null,b={...jl(m,h.type.name,h.attrs),...e},w={...jl(m,c.node().type.name,c.node().attrs),...e};n.delete(c.pos,d.pos);let _=y?[{type:l,attrs:b},{type:y,attrs:w}]:[{type:l,attrs:b}];if(!Fn(n.doc,c.pos,2))return!1;if(i){let{selection:S,storedMarks:L}=r,{splittableMarks:D}=o.extensionManager,T=L||S.$to.parentOffset&&S.$from.marks();if(n.split(c.pos,2,_).scrollIntoView(),!T||!i)return!0;let $=T.filter(O=>D.includes(O.type.name));n.ensureMarks($)}return!0},pp=(t,e)=>{let n=eo(s=>s.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=t.doc.nodeAt(r);return n.node.type===i?.type&&nr(t.doc,n.pos)&&t.join(n.pos),!0},hp=(t,e)=>{let n=eo(s=>s.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=t.doc.nodeAt(r);return n.node.type===i?.type&&nr(t.doc,r)&&t.join(r),!0},YD=(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:c,commands:d,can:f})=>{let{extensions:h,splittableMarks:m}=i.extensionManager,y=zt(t,s.schema),b=zt(e,s.schema),{selection:w,storedMarks:_}=s,{$from:S,$to:L}=w,D=S.blockRange(L),T=_||w.$to.parentOffset&&w.$from.marks();if(!D)return!1;let $=eo(O=>LE(O.type.name,h))(w);if(D.depth>=1&&$&&D.depth-$.depth<=1){if($.node.type===y)return d.liftListItem(b);if(LE($.node.type.name,h)&&y.validContent($.node.content)&&l)return c().command(()=>(o.setNodeMarkup($.pos,y),!0)).command(()=>pp(o,y)).command(()=>hp(o,y)).run()}return!n||!T||!l?c().command(()=>f().wrapInList(y,r)?!0:d.clearNodes()).wrapInList(y,r).command(()=>pp(o,y)).command(()=>hp(o,y)).run():c().command(()=>{let O=f().wrapInList(y,r),Y=T.filter(ee=>m.includes(ee.type.name));return o.ensureMarks(Y),O?!0:d.clearNodes()}).wrapInList(y,r).command(()=>pp(o,y)).command(()=>hp(o,y)).run()},JD=(t,e={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=gi(t,r.schema);return wp(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},XD=(t,e,n={})=>({state:r,commands:i})=>{let o=zt(t,r.schema),s=zt(e,r.schema),l=ra(r,o,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),l?i.setNode(s,c):i.setNode(o,{...c,...n})},ZD=(t,e={})=>({state:n,commands:r})=>{let i=zt(t,n.schema);return ra(n,i,e)?r.lift(i):r.wrapIn(i,e)},jD=()=>({state:t,dispatch:e})=>{let n=t.plugins;for(let r=0;r=0;c-=1)s.step(l.steps[c].invert(l.docs[c]));if(o.text){let c=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,c))}else s.delete(o.from,o.to)}return!0}}return!1},QD=()=>({tr:t,dispatch:e})=>{let{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},eL=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=e,{selection:l}=n,c=gi(t,r.schema),{$from:d,empty:f,ranges:h}=l;if(!i)return!0;if(f&&s){let{from:m,to:y}=l,b=(o=d.marks().find(_=>_.type===c))===null||o===void 0?void 0:o.attrs,w=Sp(d,c,b);w&&(m=w.from,y=w.to),n.removeMark(m,y,c)}else h.forEach(m=>{n.removeMark(m.$from.pos,m.$to.pos,c)});return n.removeStoredMark(c),!0},tL=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=sc(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=zt(t,r.schema)),l==="mark"&&(s=gi(t,r.schema)),i&&n.selection.ranges.forEach(c=>{let d=c.$from.pos,f=c.$to.pos;r.doc.nodesBetween(d,f,(h,m)=>{o&&o===h.type&&n.setNodeMarkup(m,void 0,{...h.attrs,...e}),s&&h.marks.length&&h.marks.forEach(y=>{if(s===y.type){let b=Math.max(m,d),w=Math.min(m+h.nodeSize,f);n.addMark(b,w,s.create({...y.attrs,...e}))}})})}),!0):!1},nL=(t,e={})=>({state:n,dispatch:r})=>{let i=zt(t,n.schema);return AE(i,e)(n,r)},rL=(t,e={})=>({state:n,dispatch:r})=>{let i=zt(t,n.schema);return ME(i,e)(n,r)},iL=Object.freeze({__proto__:null,blur:KI,clearContent:VI,clearNodes:GI,command:qI,createParagraphNear:YI,cut:JI,deleteCurrentNode:XI,deleteNode:ZI,deleteRange:jI,deleteSelection:QI,enter:eD,exitCode:tD,extendMarkRange:rD,first:iD,focus:oD,forEach:sD,insertContent:aD,insertContentAt:uD,joinBackward:pD,joinDown:fD,joinForward:hD,joinItemBackward:mD,joinItemForward:gD,joinTextblockBackward:bD,joinTextblockForward:yD,joinUp:dD,keyboardShortcut:vD,lift:wD,liftEmptyBlock:xD,liftListItem:_D,newlineInCode:SD,resetAttributes:TD,scrollIntoView:CD,selectAll:AD,selectNodeBackward:MD,selectNodeForward:ND,selectParentNode:kD,selectTextblockEnd:OD,selectTextblockStart:RD,setContent:ID,setMark:$D,setMeta:zD,setNode:UD,setNodeSelection:WD,setTextSelection:KD,sinkListItem:VD,splitBlock:GD,splitListItem:qD,toggleList:YD,toggleMark:JD,toggleNode:XD,toggleWrap:ZD,undoInputRule:jD,unsetAllMarks:QD,unsetMark:eL,updateAttributes:tL,wrapIn:nL,wrapInList:rL}),oL=We.create({name:"commands",addCommands(){return{...iL}}}),sL=We.create({name:"drop",addProseMirrorPlugins(){return[new ke({key:new ze("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),aL=We.create({name:"editable",addProseMirrorPlugins(){return[new ke({key:new ze("editable"),props:{editable:()=>this.editor.options.editable}})]}}),lL=We.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new ke({key:new ze("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;let r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;let r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),cL=We.create({name:"keymap",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{let{selection:c,doc:d}=l,{empty:f,$anchor:h}=c,{pos:m,parent:y}=h,b=h.parent.isTextblock&&m>0?l.doc.resolve(m-1):h,w=b.parent.type.spec.isolating,_=h.pos-h.parentOffset,S=w&&b.parent.childCount===1?_===h.pos:ue.atStart(d).from===m;return!f||!y.type.isTextblock||y.textContent.length||!S||S&&h.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Tp()||WE()?o:i},addProseMirrorPlugins(){return[new ke({key:new ze("clearDocument"),appendTransaction:(t,e,n)=>{let r=t.some(w=>w.docChanged)&&!e.doc.eq(n.doc),i=t.some(w=>w.getMeta("preventClearDocument"));if(!r||i)return;let{empty:o,from:s,to:l}=e.selection,c=ue.atStart(e.doc).from,d=ue.atEnd(e.doc).to;if(o||!(s===c&&l===d)||!ia(n.doc))return;let m=n.tr,y=nc({state:n,transaction:m}),{commands:b}=new qo({editor:this.editor,state:y});if(b.clearNodes(),!!m.steps.length)return m}})]}}),uL=We.create({name:"paste",addProseMirrorPlugins(){return[new ke({key:new ze("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),dL=We.create({name:"tabindex",addProseMirrorPlugins(){return[new ke({key:new ze("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});var xp=class t{get name(){return this.node.type.name}constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;let e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new t(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new t(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new t(e,this.editor)}get children(){let e=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,o=this.pos+r+1,s=this.resolvedPos.doc.resolve(o);if(!i&&s.depth<=this.depth)return;let l=new t(s,this.editor,i,i?n:null);i&&(l.actualDepth=this.depth+1),e.push(new t(s,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){let o=i.node.attrs,s=Object.keys(n);for(let l=0;l{r&&i.length>0||(s.node.type.name===e&&o.every(c=>n[c]===s.node.attrs[c])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,n,r))))}),i}setAttribute(e){let n=this.editor.state.selection;this.editor.chain().setTextSelection(this.from).updateAttributes(this.node.type.name,e).setTextSelection(n.from).run()}},fL=`.ProseMirror { + position: relative; +} + +.ProseMirror { + word-wrap: break-word; + white-space: pre-wrap; + white-space: break-spaces; + -webkit-font-variant-ligatures: none; + font-variant-ligatures: none; + font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ +} + +.ProseMirror [contenteditable="false"] { + white-space: normal; +} + +.ProseMirror [contenteditable="false"] [contenteditable="true"] { + white-space: pre-wrap; +} + +.ProseMirror pre { + white-space: pre-wrap; +} + +img.ProseMirror-separator { + display: inline !important; + border: none !important; + margin: 0 !important; + width: 0 !important; + height: 0 !important; +} + +.ProseMirror-gapcursor { + display: none; + pointer-events: none; + position: absolute; + margin: 0; +} + +.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; + } +} + +.ProseMirror-hideselection *::selection { + background: transparent; +} + +.ProseMirror-hideselection *::-moz-selection { + background: transparent; +} + +.ProseMirror-hideselection * { + caret-color: transparent; +} + +.ProseMirror-focused .ProseMirror-gapcursor { + display: block; +} + +.tippy-box[data-animation=fade][data-state=hidden] { + opacity: 0 +}`;function pL(t,e,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(r!==null)return r;let i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute(`data-tiptap-style${n?`-${n}`:""}`,""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}var tc=class extends mp{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:i})=>this.options.onDrop(n,r,i)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=pL(fL,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){let r=FE(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}unregisterPlugin(e){if(this.isDestroyed)return;let n=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(n))});return this.view.updateState(r),r}createExtensionManager(){var e,n;let i=[...this.options.enableCoreExtensions?[aL,WI.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),oL,lL,cL,dL,sL,uL].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o?.type));this.extensionManager=new yp(i,this)}createCommandManager(){this.commandManager=new qo({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let e;try{e=vp(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(o){if(!(o instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(o.message))throw o;this.emit("contentError",{editor:this,error:o,disableCollaboration:()=>{this.options.extensions=this.options.extensions.filter(s=>s.name!=="collaboration"),this.createExtensionManager()}}),e=vp(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}let n=zE(e,this.options.autofocus);this.view=new Wl(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Rl.create({doc:e,selection:n||void 0})});let r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();let i=this.view.dom;i.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var l;return(l=this.capturedTransaction)===null||l===void 0?void 0:l.step(s)});return}let n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});let i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return Mp(this.state,e)}isActive(e,n){let r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return Ur(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return DD(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:n=` + +`,textSerializers:r={}}=e||{};return LD(this.state.doc,{blockSeparator:n,textSerializers:{...$E(this.schema),...r}})}get isEmpty(){return ia(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){let e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){let n=this.state.doc.resolve(e);return new xp(n,this)}get $doc(){return this.$pos(0)}};function Un(t){return new Yo({find:t.find,handler:({state:e,range:n,match:r})=>{let i=Te(t.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:o}=e,s=r[r.length-1],l=r[0];if(s){let c=l.search(/\S/),d=n.from+l.indexOf(s),f=d+s.length;if(lc(n.from,n.to,e.doc).filter(y=>y.mark.type.excluded.find(w=>w===t.type&&w!==y.mark.type)).filter(y=>y.to>d).length)return null;fn.from&&o.delete(n.from+c,d);let m=n.from+c+s.length;o.addMark(n.from+c,m,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function dc(t){return new Yo({find:t.find,handler:({state:e,range:n,match:r})=>{let i=Te(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from,l=n.to,c=t.type.create(i);if(r[1]){let d=r[0].lastIndexOf(r[1]),f=s+d;f>l?f=l:l=f+r[1].length;let h=r[0][r[0].length-1];o.insertText(h,s+r[0].length-1),o.replaceWith(f,l,c)}else if(r[0]){let d=t.type.isInline?s:s-1;o.insert(d,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l))}o.scrollIntoView()}})}function oa(t){return new Yo({find:t.find,handler:({state:e,range:n,match:r})=>{let i=e.doc.resolve(n.from),o=Te(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function bi(t){return new Yo({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{let o=Te(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),c=s.doc.resolve(n.from).blockRange(),d=c&&Po(c,t.type,o);if(!d)return null;if(s.wrap(c,d),t.keepMarks&&t.editor){let{selection:h,storedMarks:m}=e,{splittableMarks:y}=t.editor.extensionManager,b=m||h.$to.parentOffset&&h.$from.marks();if(b){let w=b.filter(_=>y.includes(_.type.name));s.ensureMarks(w)}}if(t.keepAttributes){let h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(h,o).run()}let f=s.doc.resolve(n.from-1).nodeBefore;f&&f.type===t.type&&nr(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,f))&&s.join(n.from-1)}})}var ce=class t{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Te(ne(this,"addOptions",{name:this.name}))),this.storage=Te(ne(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend({...this.config,addOptions:()=>ic(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){let n=new t(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Te(ne(n,"addOptions",{name:n.name})),n.storage=Te(ne(n,"addStorage",{name:n.name,options:n.options})),n}};function vn(t){return new bp({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{let o=Te(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;let{tr:s}=e,l=r[r.length-1],c=r[0],d=n.to;if(l){let f=c.search(/\S/),h=n.from+c.indexOf(l),m=h+l.length;if(lc(n.from,n.to,e.doc).filter(b=>b.mark.type.excluded.find(_=>_===t.type&&_!==b.mark.type)).filter(b=>b.to>h).length)return null;mn.from&&s.delete(n.from+f,h),d=n.from+f+l.length,s.addMark(n.from+f,d,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}function qE(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var hL=/^\s*>\s$/,YE=ce.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",Q(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[bi({find:hL,type:this.type})]}});var mL=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,gL=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,bL=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,yL=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,JE=st.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",Q(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Un({find:mL,type:this.type}),Un({find:bL,type:this.type})]},addPasteRules(){return[vn({find:gL,type:this.type}),vn({find:yL,type:this.type})]}});var to=ce.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Q(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});var yi=st.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",Q(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{let n=ac(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}});var XE=/^\s*([-+*])\s$/,ZE=ce.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Q(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(to.name,this.editor.getAttributes(yi.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=bi({find:XE,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=bi({find:XE,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(yi.name),editor:this.editor})),[t]}});var EL=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,vL=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,jE=st.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Q(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Un({find:EL,type:this.type})]},addPasteRules(){return[vn({find:vL,type:this.type})]}});var QE=We.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}});var ev=ce.create({name:"doc",topNode:!0,content:"block+"});function tv(t={}){return new ke({view(e){return new Np(e,t)}})}var Np=class{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let l=e.nodeBefore,c=e.nodeAfter;if(l||c){let d=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(d){let f=d.getBoundingClientRect(),h=l?f.bottom:f.top;l&&c&&(h=(h+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:f.left,right:f.right,top:h-this.width/2,bottom:h+this.width/2}}}}if(!r){let l=this.editorView.coordsAtPos(this.cursorPos);r={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let l=i.getBoundingClientRect();o=l.left-i.scrollLeft,s=l.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Nl(this.editorView.state.doc,s,this.editorView.dragging.slice);l!=null&&(s=l)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}};var nv=We.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[tv(this.options)]}});var rn=class t extends ue{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return t.valid(r)?new t(r):ue.near(r)}content(){return Z.empty}eq(e){return e instanceof t&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(n.pos))}getBookmark(){return new kp(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!wL(e)||!xL(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&t.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let l=e.node(s);if(n>0?e.indexAfter(s)0){o=l.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let c=e.doc.resolve(i);if(t.valid(c))return c}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!pe.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let l=e.doc.resolve(i);if(t.valid(l))return l}return null}}};rn.prototype.visible=!1;rn.findFrom=rn.findGapCursorFrom;ue.jsonID("gapcursor",rn);var kp=class t{constructor(e){this.pos=e}map(e){return new t(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return rn.valid(n)?new rn(n):ue.near(n)}};function wL(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function xL(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function rv(){return new ke({props:{decorations:CL,createSelectionBetween(t,e,n){return e.pos==n.pos&&rn.valid(n)?new rn(n):null},handleClick:SL,handleKeyDown:_L,handleDOMEvents:{beforeinput:TL}}})}var _L=na({ArrowLeft:fc("horiz",-1),ArrowRight:fc("horiz",1),ArrowUp:fc("vert",-1),ArrowDown:fc("vert",1)});function fc(t,e){let n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,l=e>0?s.$to:s.$from,c=s.empty;if(s instanceof le){if(!o.endOfTextblock(n)||l.depth==0)return!1;c=!1,l=r.doc.resolve(e>0?l.after():l.before())}let d=rn.findGapCursorFrom(l,e,c);return d?(i&&i(r.tr.setSelection(new rn(d))),!0):!1}}function SL(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!rn.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&pe.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new rn(r))),!0)}function TL(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof rn))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=G.empty;for(let s=r.length-1;s>=0;s--)i=G.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new Z(i,0,0));return o.setSelection(le.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function CL(t){if(!(t.selection instanceof rn))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ot.create(t.doc,[Tt.widget(t.selection.head,e,{key:"gapcursor"})])}var iv=We.create({name:"gapCursor",addProseMirrorPlugins(){return[rv()]},extendNodeSchema(t){var e;let n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Te(ne(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}});var ov=ce.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Q(this.options.HTMLAttributes,t)]},renderText(){return` +`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;let{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,c=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:f})=>{if(f&&c&&s){let h=c.filter(m=>l.includes(m.type.name));d.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});var sv=ce.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Q(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>oa({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var pc=200,qt=function(){};qt.prototype.append=function(e){return e.length?(e=qt.from(e),!this.length&&e||e.length=n?qt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};qt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};qt.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};qt.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i};qt.from=function(e){return e instanceof qt?e:e&&e.length?new av(e):qt.empty};var av=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,l){for(var c=o;c=s;c--)if(i(this.values[c],l+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=pc)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=pc)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(qt);qt.empty=new av([]);var AL=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return rl&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(qt),Op=qt;var ML=500,ro=class t{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,l,c,d=[],f=[];return this.items.forEach((h,m)=>{if(!h.step){i||(i=this.remapping(r,m+1),o=i.maps.length),o--,f.push(h);return}if(i){f.push(new mr(h.map));let y=h.step.map(i.slice(o)),b;y&&s.maybeStep(y).doc&&(b=s.mapping.maps[s.mapping.maps.length-1],d.push(new mr(b,void 0,void 0,d.length+f.length))),o--,b&&i.appendMap(b,o)}else s.maybeStep(h.step);if(h.selection)return l=i?h.selection.map(i.slice(o)):h.selection,c=new t(this.items.slice(0,r).append(f.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:s,selection:l}}addTransform(e,n,r,i){let o=[],s=this.eventCount,l=this.items,c=!i&&l.length?l.get(l.length-1):null;for(let f=0;fkL&&(l=NL(l,d),s-=d),new t(l.append(o),s)}remapping(e,n){let r=new zs;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new t(this.items.append(e.map(n=>new mr(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(m=>{m.selection&&l--},i);let c=n;this.items.forEach(m=>{let y=o.getMirror(--c);if(y==null)return;s=Math.min(s,y);let b=o.maps[y];if(m.step){let w=e.steps[y].invert(e.docs[y]),_=m.selection&&m.selection.map(o.slice(c+1,y));_&&l++,r.push(new mr(b,w,_))}else r.push(new mr(b))},i);let d=[];for(let m=n;mML&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let c=s.step.map(n.slice(r)),d=c&&c.getMap();if(r--,d&&n.appendMap(d,r),c){let f=s.selection&&s.selection.map(n.slice(r));f&&o++;let h=new mr(d.invert(),c,f),m,y=i.length-1;(m=i.length&&i[y].merge(h))?i[y]=m:i.push(h)}}else s.map&&r--},this.items.length,0),new t(Op.from(i.reverse()),o)}};ro.empty=new ro(Op.empty,0);function NL(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}var mr=class t{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new t(n.getMap().invert(),n,this.selection)}}},gr=class{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}},kL=20;function OL(t,e,n,r){let i=n.getMeta(no),o;if(i)return i.historyState;n.getMeta(DL)&&(t=new gr(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(no))return s.getMeta(no).redo?new gr(t.done.addTransform(n,void 0,r,hc(e)),t.undone,lv(n.mapping.maps),t.prevTime,t.prevComposition):new gr(t.done,t.undone.addTransform(n,void 0,r,hc(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),c=t.prevTime==0||!s&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!RL(n,t.prevRanges)),d=s?Rp(t.prevRanges,n.mapping):lv(n.mapping.maps);return new gr(t.done.addTransform(n,c?e.selection.getBookmark():void 0,r,hc(e)),ro.empty,d,n.time,l??t.prevComposition)}else return(o=n.getMeta("rebased"))?new gr(t.done.rebased(n,o),t.undone.rebased(n,o),Rp(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new gr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Rp(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function RL(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=e[o]&&(n=!0)}),n}function lv(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,o,s)=>e.push(o,s));return e}function Rp(t,e){if(!t)return null;let n=[];for(let r=0;r{let i=no.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=IL(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}var Dp=mc(!1,!0),Lp=mc(!0,!0),kz=mc(!1,!1),Oz=mc(!0,!1);var dv=We.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Dp(t,e),redo:()=>({state:t,dispatch:e})=>Lp(t,e)}},addProseMirrorPlugins(){return[uv(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}});var fv=ce.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Q(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{let{selection:n}=e,{$from:r,$to:i}=n,o=t();return r.parentOffset===0?o.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):cc(n)?o.insertContentAt(i.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:s,dispatch:l})=>{var c;if(l){let{$to:d}=s.selection,f=d.end();if(d.nodeAfter)d.nodeAfter.isTextblock?s.setSelection(le.create(s.doc,d.pos+1)):d.nodeAfter.isBlock?s.setSelection(pe.create(s.doc,d.pos)):s.setSelection(le.create(s.doc,d.pos));else{let h=(c=d.parent.type.contentMatch.defaultType)===null||c===void 0?void 0:c.create();h&&(s.insert(f,h),s.setSelection(le.create(s.doc,f+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[dc({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}});var LL=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,PL=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,BL=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,FL=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,pv=st.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Q(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Un({find:LL,type:this.type}),Un({find:BL,type:this.type})]},addPasteRules(){return[vn({find:PL,type:this.type}),vn({find:FL,type:this.type})]}});var hv=/^(\d+)\.\s$/,mv=ce.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){let{start:e,...n}=t;return e===1?["ol",Q(this.options.HTMLAttributes,n),0]:["ol",Q(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(to.name,this.editor.getAttributes(yi.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=bi({find:hv,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=bi({find:hv,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(yi.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}});var gc=ce.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Q(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}});var gv=We.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new ke({key:new ze("placeholder"),props:{decorations:({doc:t,selection:e})=>{let n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!n)return null;let o=this.editor.isEmpty;return t.descendants((s,l)=>{let c=r>=l&&r<=l+s.nodeSize,d=!s.isLeaf&&ia(s);if((c||!this.options.showOnlyCurrent)&&d){let f=[this.options.emptyNodeClass];o&&f.push(this.options.emptyEditorClass);let h=Tt.node(l,l+s.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:l,hasAnchor:c}):this.options.placeholder});i.push(h)}return this.options.includeChildren}),ot.create(t,i)}}})]}});var HL=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,$L=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,bv=st.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",Q(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Un({find:HL,type:this.type})]},addPasteRules(){return[vn({find:$L,type:this.type})]}});var yv=st.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",Q(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}});var Ev=st.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",Q(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}});var Bp,Fp;if(typeof WeakMap<"u"){let t=new WeakMap;Bp=e=>t.get(e),Fp=(e,n)=>(t.set(e,n),n)}else{let t=[],n=0;Bp=r=>{for(let i=0;i(n==10&&(n=0),t[n++]=r,t[n++]=i)}var mt=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e=n){(o||(o=[])).push({type:"overlong_rowspan",pos:f,n:S-D});break}let T=i+D*e;for(let $=0;$<_;$++){r[T+$]==0?r[T+$]=f:(o||(o=[])).push({type:"collision",row:d,pos:f,n:_-$});let O=L&&L[$];if(O){let Y=(T+$)%e*2,ee=s[Y];ee==null||ee!=O&&s[Y+1]==1?(s[Y]=O,s[Y+1]=1):ee==O&&s[Y+1]++}}}i+=_,f+=w.nodeSize}let m=(d+1)*e,y=0;for(;ir&&(o+=d.attrs.colspan)}}for(let s=0;s1&&(n=!0)}e==-1?e=o:e!=o&&(e=Math.max(e,o))}return e}function WL(t,e,n){t.problems||(t.problems=[]);let r={};for(let i=0;i0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function VL(t){for(let e=t.depth;e>0;e--){let n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function or(t){let e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function xc(t){let e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;let n=Jo(e.$head)||GL(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function GL(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Hp(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function qL(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function Up(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Mv(t,e,n){let r=t.node(-1),i=mt.get(r),o=t.start(-1),s=i.nextCell(t.pos-o,e,n);return s==null?null:t.node(0).resolve(o+s)}function io(t,e,n=1){let r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function Nv(t,e,n=1){let r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;if!=n.pos-o);c.unshift(n.pos-o);let d=c.map(f=>{let h=r.nodeAt(f);if(!h)throw RangeError(`No cell with offset ${f} found`);let m=o+f+1;return new Ho(l.resolve(m),l.resolve(m+h.content.size))});super(d[0].$from,d[0].$to,d),this.$anchorCell=e,this.$headCell=n}map(e,n){let r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if(Hp(r)&&Hp(i)&&Up(r,i)){let o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?Wr.rowSelection(r,i):o&&this.isColSelection()?Wr.colSelection(r,i):new Wr(r,i)}return le.between(r,i)}content(){let e=this.$anchorCell.node(-1),n=mt.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},s=[];for(let c=i.top;c0||_>0){let S=b.attrs;if(w>0&&(S=io(S,0,w)),_>0&&(S=io(S,S.colspan-_,_)),y.lefti.bottom){let S={...b.attrs,rowspan:Math.min(y.bottom,i.bottom)-Math.max(y.top,i.top)};y.top0)return!1;let r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){let r=e.node(-1),i=mt.get(r),o=e.start(-1),s=i.findCell(e.pos-o),l=i.findCell(n.pos-o),c=e.node(0);return s.top<=l.top?(s.top>0&&(e=c.resolve(o+i.map[s.left])),l.bottom0&&(n=c.resolve(o+i.map[l.left])),s.bottom0)return!1;let s=i+this.$anchorCell.nodeAfter.attrs.colspan,l=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,l)==n.width}eq(e){return e instanceof Wr&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){let r=e.node(-1),i=mt.get(r),o=e.start(-1),s=i.findCell(e.pos-o),l=i.findCell(n.pos-o),c=e.node(0);return s.left<=l.left?(s.left>0&&(e=c.resolve(o+i.map[s.top*i.width])),l.right0&&(n=c.resolve(o+i.map[l.top*i.width])),s.right{e.push(Tt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),ot.create(t.doc,e)}function ZL({$from:t,$to:e}){if(t.pos==e.pos||t.pos=0&&!(t.after(i+1)=0&&!(e.before(o+1)>e.start(o));o--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function jL({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){let o=t.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}for(let i=e.depth;i>0;i--){let o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return n!==r&&e.parentOffset===0}function QL(t,e,n){let r=(e||t).selection,i=(e||t).doc,o,s;if(r instanceof pe&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=et.create(i,r.from);else if(s=="row"){let l=i.resolve(r.from+1);o=et.rowSelection(l,l)}else if(!n){let l=mt.get(r.node),c=r.from+1,d=c+l.map[l.width*l.height-1];o=et.create(i,c+1,d)}}else r instanceof le&&ZL(r)?o=le.create(i,r.from):r instanceof le&&jL(r)&&(o=le.create(i,r.$from.start(),r.$from.end()));return o&&(e||(e=t.tr)).setSelection(o),e}var eP=new ze("fix-tables");function Ov(t,e,n,r){let i=t.childCount,o=e.childCount;e:for(let s=0,l=0;s{i.type.spec.tableRole=="table"&&(n=tP(t,i,o,n))};return e?e.doc!=t.doc&&Ov(e.doc,t.doc,0,r):t.doc.descendants(r),n}function tP(t,e,n,r){let i=mt.get(e);if(!i.problems)return r;r||(r=t.tr);let o=[];for(let c=0;c0){let y="cell";f.firstChild&&(y=f.firstChild.type.spec.tableRole);let b=[];for(let _=0;_0?-1:0;YL(e,r,i+o)&&(o=i==0||i==e.width?null:0);for(let s=0;s0&&i0&&e.map[l-1]==c||i0?-1:0;rP(e,r,i+c)&&(c=i==0||i==e.height?null:0);for(let d=0,f=e.width*i;d0&&i0&&h==e.map[f-e.width]){let m=n.nodeAt(h).attrs;t.setNodeMarkup(t.mapping.slice(l).map(h+r),null,{...m,rowspan:m.rowspan-1}),d+=m.colspan-1}else if(i0&&n[o]==n[o-1]||r.right0&&n[i]==n[i-t]||r.bottomn[r.type.spec.tableRole])(t,e)}function sP(t){return(e,n)=>{var r;let i=e.selection,o,s;if(i instanceof et){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,s=i.$anchorCell.pos}else{if(o=VL(i.$from),!o)return!1;s=(r=Jo(i.$from))==null?void 0:r.pos}if(o==null||s==null||o.attrs.colspan==1&&o.attrs.rowspan==1)return!1;if(n){let l=o.attrs,c=[],d=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});let f=br(e),h=e.tr;for(let y=0;y{s.attrs[t]!==e&&o.setNodeMarkup(l,null,{...s.attrs,[t]:e})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),r(o)}return!0}}function aP(t){return function(e,n){if(!or(e))return!1;if(n){let r=on(e.schema),i=br(e),o=e.tr,s=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),l=s.map(c=>i.table.nodeAt(c));for(let c=0;c{let b=y+o.tableStart,w=s.doc.nodeAt(b);w&&s.setNodeMarkup(b,m,w.attrs)}),r(s)}return!0}}var gU=Xo("row",{useDeprecatedLogic:!0}),bU=Xo("column",{useDeprecatedLogic:!0}),zv=Xo("cell",{useDeprecatedLogic:!0});function lP(t,e){if(e<0){let n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){let o=t.node(-1).child(r),s=o.lastChild;if(s)return i-1-s.nodeSize;i-=o.nodeSize}}else{if(t.index()0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function bc(t,e){let n=t.selection;if(!(n instanceof et))return!1;if(e){let r=t.tr,i=on(t.schema).cell.createAndFill().content;n.forEachCell((o,s)=>{o.content.eq(i)||r.replace(r.mapping.map(s+1),r.mapping.map(s+o.nodeSize-1),new Z(i,0,0))}),r.docChanged&&e(r)}return!0}function cP(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;let i=e.child(0),o=i.type.spec.tableRole,s=i.type.schema,l=[];if(o=="row")for(let c=0;c=0;s--){let{rowspan:l,colspan:c}=o.child(s).attrs;for(let d=i;d=e.length&&e.push(G.empty),n[i]r&&(m=m.type.createChecked(io(m.attrs,m.attrs.colspan,f+m.attrs.colspan-r),m.content)),d.push(m),f+=m.attrs.colspan;for(let y=1;yi&&(h=h.type.create({...h.attrs,rowspan:Math.max(1,i-h.attrs.rowspan)},h.content)),c.push(h)}o.push(G.from(c))}n=o,e=i}return{width:t,height:e,rows:n}}function fP(t,e,n,r,i,o,s){let l=t.doc.type.schema,c=on(l),d,f;if(i>e.width)for(let h=0,m=0;he.height){let h=[];for(let b=0,w=(e.height-1)*e.width;b=e.width?!1:n.nodeAt(e.map[w+b]).type==c.header_cell;h.push(_?f||(f=c.header_cell.createAndFill()):d||(d=c.cell.createAndFill()))}let m=c.row.create(null,G.from(h)),y=[];for(let b=e.height;b{if(!i)return!1;let o=n.selection;if(o instanceof et)return vc(n,r,ue.near(o.$headCell,e));if(t!="horiz"&&!o.empty)return!1;let s=Wv(i,t,e);if(s==null)return!1;if(t=="horiz")return vc(n,r,ue.near(n.doc.resolve(o.head+e),e));{let l=n.doc.resolve(s),c=Mv(l,t,e),d;return c?d=ue.near(c,1):e<0?d=ue.near(n.doc.resolve(l.before(-1)),-1):d=ue.near(n.doc.resolve(l.after(-1)),1),vc(n,r,d)}}}function Ec(t,e){return(n,r,i)=>{if(!i)return!1;let o=n.selection,s;if(o instanceof et)s=o;else{let c=Wv(i,t,e);if(c==null)return!1;s=new et(n.doc.resolve(c))}let l=Mv(s.$headCell,t,e);return l?vc(n,r,new et(s.$anchorCell,l)):!1}}function hP(t,e){let n=t.state.doc,r=Jo(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new et(r))),!0):!1}function mP(t,e,n){if(!or(t.state))return!1;let r=cP(n),i=t.state.selection;if(i instanceof et){r||(r={width:1,height:1,rows:[G.from($p(on(t.state.schema).cell,n))]});let o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),l=mt.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return r=dP(r,l.right-l.left,l.bottom-l.top),Sv(t.state,t.dispatch,s,l,r),!0}else if(r){let o=xc(t.state),s=o.start(-1);return Sv(t.state,t.dispatch,s,mt.get(o.node(-1)).findCell(o.pos-s),r),!0}else return!1}function gP(t,e){var n;if(e.ctrlKey||e.metaKey)return;let r=Tv(t,e.target),i;if(e.shiftKey&&t.state.selection instanceof et)o(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=Jo(t.state.selection.$anchor))!=null&&((n=Pp(t,e))==null?void 0:n.pos)!=i.pos)o(i,e),e.preventDefault();else if(!r)return;function o(c,d){let f=Pp(t,d),h=Ei.getState(t.state)==null;if(!f||!Up(c,f))if(h)f=c;else return;let m=new et(c,f);if(h||!t.state.selection.eq(m)){let y=t.state.tr.setSelection(m);h&&y.setMeta(Ei,c.pos),t.dispatch(y)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",l),Ei.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(Ei,-1))}function l(c){let d=c,f=Ei.getState(t.state),h;if(f!=null)h=t.state.doc.resolve(f);else if(Tv(t,d.target)!=r&&(h=Pp(t,e),!h))return s();h&&o(h,d)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",l)}function Wv(t,e,n){if(!(t.state.selection instanceof le))return null;let{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){let o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){let l=r.before(i),c=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(c)?l:null}}return null}function Tv(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Pp(t,e){let n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?Jo(t.state.doc.resolve(n.pos)):null}var bP=class{constructor(t,e){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),zp(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,zp(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function zp(t,e,n,r,i,o){var s;let l=0,c=!0,d=e.firstChild,f=t.firstChild;if(f){for(let h=0,m=0;hnew n(h,e,m)),new yP(-1,!1)},apply(o,s){return s.apply(o)}},props:{attributes:o=>{let s=Wn.getState(o);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,s)=>{EP(o,s,t,e,r)},mouseleave:o=>{vP(o)},mousedown:(o,s)=>{wP(o,s,e)}},decorations:o=>{let s=Wn.getState(o);if(s&&s.activeHandle>-1)return AP(o,s.activeHandle)},nodeViews:{}}});return i}var yP=class wc{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){let n=this,r=e.getMeta(Wn);if(r&&r.setHandle!=null)return new wc(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new wc(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);return Hp(e.doc.resolve(i))||(i=-1),new wc(i,n.dragging)}return n}};function EP(t,e,n,r,i){let o=Wn.getState(t.state);if(o&&!o.dragging){let s=_P(e.target),l=-1;if(s){let{left:c,right:d}=s.getBoundingClientRect();e.clientX-c<=n?l=Cv(t,e,"left",n):d-e.clientX<=n&&(l=Cv(t,e,"right",n))}if(l!=o.activeHandle){if(!i&&l!==-1){let c=t.state.doc.resolve(l),d=c.node(-1),f=mt.get(d),h=c.start(-1);if(f.colCount(c.pos-h)+c.nodeAfter.attrs.colspan-1==f.width-1)return}Vv(t,l)}}}function vP(t){let e=Wn.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&Vv(t,-1)}function wP(t,e,n){var r;let i=(r=t.dom.ownerDocument.defaultView)!=null?r:window,o=Wn.getState(t.state);if(!o||o.activeHandle==-1||o.dragging)return!1;let s=t.state.doc.nodeAt(o.activeHandle),l=xP(t,o.activeHandle,s.attrs);t.dispatch(t.state.tr.setMeta(Wn,{setDragging:{startX:e.clientX,startWidth:l}}));function c(f){i.removeEventListener("mouseup",c),i.removeEventListener("mousemove",d);let h=Wn.getState(t.state);h?.dragging&&(SP(t,h.activeHandle,Av(h.dragging,f,n)),t.dispatch(t.state.tr.setMeta(Wn,{setDragging:null})))}function d(f){if(!f.which)return c(f);let h=Wn.getState(t.state);if(h&&h.dragging){let m=Av(h.dragging,f,n);TP(t,h.activeHandle,m,n)}}return i.addEventListener("mouseup",c),i.addEventListener("mousemove",d),e.preventDefault(),!0}function xP(t,e,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let o=t.domAtPos(e),l=o.node.childNodes[o.offset].offsetWidth,c=n;if(r)for(let d=0;d{let r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function kP(t,e,n,r,i){let o=NP(t),s=[],l=[];for(let d=0;d{let{selection:e}=t.state;if(!OP(e))return!1;let n=0,r=Ap(e.ranges[0].$from,o=>o.type.name==="table");return r?.node.descendants(o=>{if(o.type.name==="table")return!1;["tableCell","tableHeader"].includes(o.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},Jv=ce.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:qp,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=MP(t,this.options.cellMinWidth);return["table",Q(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${i}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:o})=>{let s=kP(o.schema,t,e,n);if(i){let l=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(le.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>Iv(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>Dv(t,e),deleteColumn:()=>({state:t,dispatch:e})=>Lv(t,e),addRowBefore:()=>({state:t,dispatch:e})=>Bv(t,e),addRowAfter:()=>({state:t,dispatch:e})=>Fv(t,e),deleteRow:()=>({state:t,dispatch:e})=>Hv(t,e),deleteTable:()=>({state:t,dispatch:e})=>Uv(t,e),mergeCells:()=>({state:t,dispatch:e})=>Kp(t,e),splitCell:()=>({state:t,dispatch:e})=>Vp(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Xo("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Xo("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>zv(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>Kp(t,e)?!0:Vp(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>$v(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>Gp(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>Gp(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&Wp(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){let r=et.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:_c,"Mod-Backspace":_c,Delete:_c,"Mod-Delete":_c}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Kv({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Gv({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{tableRole:Te(ne(t,"tableRole",e))}}});var Xv=ce.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{let e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",Q(this.options.HTMLAttributes,t),0]}});var Zv=ce.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{let e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",Q(this.options.HTMLAttributes,t),0]}});var jv=ce.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",Q(this.options.HTMLAttributes,t),0]}});var Qv=ce.create({name:"text",group:"inline"});var ew=st.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",Q(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});var RP=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,IP=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,tw=st.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",Q(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Un({find:RP,type:this.type})]},addPasteRules(){return[vn({find:IP,type:this.type})]}});var gt="top",It="bottom",At="right",vt="left",Sc="auto",vi=[gt,It,At,vt],Kr="start",oo="end",nw="clippingParents",Tc="viewport",Zo="popper",rw="reference",Yp=vi.reduce(function(t,e){return t.concat([e+"-"+Kr,e+"-"+oo])},[]),Cc=[].concat(vi,[Sc]).reduce(function(t,e){return t.concat([e,e+"-"+Kr,e+"-"+oo])},[]),DP="beforeRead",LP="read",PP="afterRead",BP="beforeMain",FP="main",HP="afterMain",$P="beforeWrite",zP="write",UP="afterWrite",iw=[DP,LP,PP,BP,FP,HP,$P,zP,UP];function Ut(t){return t?(t.nodeName||"").toLowerCase():null}function lt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Kn(t){var e=lt(t).Element;return t instanceof e||t instanceof Element}function Dt(t){var e=lt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function jo(t){if(typeof ShadowRoot>"u")return!1;var e=lt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function WP(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!Dt(o)||!Ut(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var l=i[s];l===!1?o.removeAttribute(s):o.setAttribute(s,l===!0?"":l)}))})}function KP(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=s.reduce(function(c,d){return c[d]="",c},{});!Dt(i)||!Ut(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(c){i.removeAttribute(c)}))})}}var sa={name:"applyStyles",enabled:!0,phase:"write",fn:WP,effect:KP,requires:["computeStyles"]};function Wt(t){return t.split("-")[0]}var sr=Math.max,so=Math.min,Vr=Math.round;function Qo(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function aa(){return!/^((?!chrome|android).)*safari/i.test(Qo())}function Vn(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&Dt(t)&&(i=t.offsetWidth>0&&Vr(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Vr(r.height)/t.offsetHeight||1);var s=Kn(t)?lt(t):window,l=s.visualViewport,c=!aa()&&n,d=(r.left+(c&&l?l.offsetLeft:0))/i,f=(r.top+(c&&l?l.offsetTop:0))/o,h=r.width/i,m=r.height/o;return{width:h,height:m,top:f,right:d+h,bottom:f+m,left:d,x:d,y:f}}function ao(t){var e=Vn(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function la(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&jo(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function hn(t){return lt(t).getComputedStyle(t)}function Jp(t){return["table","td","th"].indexOf(Ut(t))>=0}function Yt(t){return((Kn(t)?t.ownerDocument:t.document)||window.document).documentElement}function Gr(t){return Ut(t)==="html"?t:t.assignedSlot||t.parentNode||(jo(t)?t.host:null)||Yt(t)}function ow(t){return!Dt(t)||hn(t).position==="fixed"?null:t.offsetParent}function VP(t){var e=/firefox/i.test(Qo()),n=/Trident/i.test(Qo());if(n&&Dt(t)){var r=hn(t);if(r.position==="fixed")return null}var i=Gr(t);for(jo(i)&&(i=i.host);Dt(i)&&["html","body"].indexOf(Ut(i))<0;){var o=hn(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function ar(t){for(var e=lt(t),n=ow(t);n&&Jp(n)&&hn(n).position==="static";)n=ow(n);return n&&(Ut(n)==="html"||Ut(n)==="body"&&hn(n).position==="static")?e:n||VP(t)||e}function lo(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function co(t,e,n){return sr(t,so(e,n))}function sw(t,e,n){var r=co(t,e,n);return r>n?n:r}function ca(){return{top:0,right:0,bottom:0,left:0}}function ua(t){return Object.assign({},ca(),t)}function da(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var GP=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,ua(typeof e!="number"?e:da(e,vi))};function qP(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,l=Wt(n.placement),c=lo(l),d=[vt,At].indexOf(l)>=0,f=d?"height":"width";if(!(!o||!s)){var h=GP(i.padding,n),m=ao(o),y=c==="y"?gt:vt,b=c==="y"?It:At,w=n.rects.reference[f]+n.rects.reference[c]-s[c]-n.rects.popper[f],_=s[c]-n.rects.reference[c],S=ar(o),L=S?c==="y"?S.clientHeight||0:S.clientWidth||0:0,D=w/2-_/2,T=h[y],$=L-m[f]-h[b],O=L/2-m[f]/2+D,Y=co(T,O,$),ee=c;n.modifiersData[r]=(e={},e[ee]=Y,e.centerOffset=Y-O,e)}}function YP(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||la(e.elements.popper,i)&&(e.elements.arrow=i))}var aw={name:"arrow",enabled:!0,phase:"main",fn:qP,effect:YP,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Gn(t){return t.split("-")[1]}var JP={top:"auto",right:"auto",bottom:"auto",left:"auto"};function XP(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:Vr(n*i)/i||0,y:Vr(r*i)/i||0}}function lw(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,l=t.position,c=t.gpuAcceleration,d=t.adaptive,f=t.roundOffsets,h=t.isFixed,m=s.x,y=m===void 0?0:m,b=s.y,w=b===void 0?0:b,_=typeof f=="function"?f({x:y,y:w}):{x:y,y:w};y=_.x,w=_.y;var S=s.hasOwnProperty("x"),L=s.hasOwnProperty("y"),D=vt,T=gt,$=window;if(d){var O=ar(n),Y="clientHeight",ee="clientWidth";if(O===lt(n)&&(O=Yt(n),hn(O).position!=="static"&&l==="absolute"&&(Y="scrollHeight",ee="scrollWidth")),O=O,i===gt||(i===vt||i===At)&&o===oo){T=It;var z=h&&O===$&&$.visualViewport?$.visualViewport.height:O[Y];w-=z-r.height,w*=c?1:-1}if(i===vt||(i===gt||i===It)&&o===oo){D=At;var re=h&&O===$&&$.visualViewport?$.visualViewport.width:O[ee];y-=re-r.width,y*=c?1:-1}}var he=Object.assign({position:l},d&&JP),Se=f===!0?XP({x:y,y:w},lt(n)):{x:y,y:w};if(y=Se.x,w=Se.y,c){var me;return Object.assign({},he,(me={},me[T]=L?"0":"",me[D]=S?"0":"",me.transform=($.devicePixelRatio||1)<=1?"translate("+y+"px, "+w+"px)":"translate3d("+y+"px, "+w+"px, 0)",me))}return Object.assign({},he,(e={},e[T]=L?w+"px":"",e[D]=S?y+"px":"",e.transform="",e))}function ZP(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,l=n.roundOffsets,c=l===void 0?!0:l,d={placement:Wt(e.placement),variation:Gn(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,lw(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,lw(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var cw={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ZP,data:{}};var Ac={passive:!0};function jP(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,l=s===void 0?!0:s,c=lt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(f){f.addEventListener("scroll",n.update,Ac)}),l&&c.addEventListener("resize",n.update,Ac),function(){o&&d.forEach(function(f){f.removeEventListener("scroll",n.update,Ac)}),l&&c.removeEventListener("resize",n.update,Ac)}}var uw={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:jP,data:{}};var QP={left:"right",right:"left",bottom:"top",top:"bottom"};function es(t){return t.replace(/left|right|bottom|top/g,function(e){return QP[e]})}var eB={start:"end",end:"start"};function Mc(t){return t.replace(/start|end/g,function(e){return eB[e]})}function uo(t){var e=lt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function fo(t){return Vn(Yt(t)).left+uo(t).scrollLeft}function Xp(t,e){var n=lt(t),r=Yt(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,c=0;if(i){o=i.width,s=i.height;var d=aa();(d||!d&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:l+fo(t),y:c}}function Zp(t){var e,n=Yt(t),r=uo(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=sr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=sr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+fo(t),c=-r.scrollTop;return hn(i||n).direction==="rtl"&&(l+=sr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:c}}function po(t){var e=hn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Nc(t){return["html","body","#document"].indexOf(Ut(t))>=0?t.ownerDocument.body:Dt(t)&&po(t)?t:Nc(Gr(t))}function wi(t,e){var n;e===void 0&&(e=[]);var r=Nc(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=lt(r),s=i?[o].concat(o.visualViewport||[],po(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(wi(Gr(s)))}function ts(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function tB(t,e){var n=Vn(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function dw(t,e,n){return e===Tc?ts(Xp(t,n)):Kn(e)?tB(e,n):ts(Zp(Yt(t)))}function nB(t){var e=wi(Gr(t)),n=["absolute","fixed"].indexOf(hn(t).position)>=0,r=n&&Dt(t)?ar(t):t;return Kn(r)?e.filter(function(i){return Kn(i)&&la(i,r)&&Ut(i)!=="body"}):[]}function jp(t,e,n,r){var i=e==="clippingParents"?nB(t):[].concat(e),o=[].concat(i,[n]),s=o[0],l=o.reduce(function(c,d){var f=dw(t,d,r);return c.top=sr(f.top,c.top),c.right=so(f.right,c.right),c.bottom=so(f.bottom,c.bottom),c.left=sr(f.left,c.left),c},dw(t,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function fa(t){var e=t.reference,n=t.element,r=t.placement,i=r?Wt(r):null,o=r?Gn(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,c;switch(i){case gt:c={x:s,y:e.y-n.height};break;case It:c={x:s,y:e.y+e.height};break;case At:c={x:e.x+e.width,y:l};break;case vt:c={x:e.x-n.width,y:l};break;default:c={x:e.x,y:e.y}}var d=i?lo(i):null;if(d!=null){var f=d==="y"?"height":"width";switch(o){case Kr:c[d]=c[d]-(e[f]/2-n[f]/2);break;case oo:c[d]=c[d]+(e[f]/2-n[f]/2);break;default:}}return c}function lr(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,l=n.boundary,c=l===void 0?nw:l,d=n.rootBoundary,f=d===void 0?Tc:d,h=n.elementContext,m=h===void 0?Zo:h,y=n.altBoundary,b=y===void 0?!1:y,w=n.padding,_=w===void 0?0:w,S=ua(typeof _!="number"?_:da(_,vi)),L=m===Zo?rw:Zo,D=t.rects.popper,T=t.elements[b?L:m],$=jp(Kn(T)?T:T.contextElement||Yt(t.elements.popper),c,f,s),O=Vn(t.elements.reference),Y=fa({reference:O,element:D,strategy:"absolute",placement:i}),ee=ts(Object.assign({},D,Y)),z=m===Zo?ee:O,re={top:$.top-z.top+S.top,bottom:z.bottom-$.bottom+S.bottom,left:$.left-z.left+S.left,right:z.right-$.right+S.right},he=t.modifiersData.offset;if(m===Zo&&he){var Se=he[i];Object.keys(re).forEach(function(me){var Ce=[At,It].indexOf(me)>=0?1:-1,ge=[gt,It].indexOf(me)>=0?"y":"x";re[me]+=Se[ge]*Ce})}return re}function Qp(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,d=c===void 0?Cc:c,f=Gn(r),h=f?l?Yp:Yp.filter(function(b){return Gn(b)===f}):vi,m=h.filter(function(b){return d.indexOf(b)>=0});m.length===0&&(m=h);var y=m.reduce(function(b,w){return b[w]=lr(t,{placement:w,boundary:i,rootBoundary:o,padding:s})[Wt(w)],b},{});return Object.keys(y).sort(function(b,w){return y[b]-y[w]})}function rB(t){if(Wt(t)===Sc)return[];var e=es(t);return[Mc(t),e,Mc(e)]}function iB(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!0:s,c=n.fallbackPlacements,d=n.padding,f=n.boundary,h=n.rootBoundary,m=n.altBoundary,y=n.flipVariations,b=y===void 0?!0:y,w=n.allowedAutoPlacements,_=e.options.placement,S=Wt(_),L=S===_,D=c||(L||!b?[es(_)]:rB(_)),T=[_].concat(D).reduce(function(je,Me){return je.concat(Wt(Me)===Sc?Qp(e,{placement:Me,boundary:f,rootBoundary:h,padding:d,flipVariations:b,allowedAutoPlacements:w}):Me)},[]),$=e.rects.reference,O=e.rects.popper,Y=new Map,ee=!0,z=T[0],re=0;re=0,ge=Ce?"width":"height",_e=lr(e,{placement:he,boundary:f,rootBoundary:h,altBoundary:m,padding:d}),A=Ce?me?At:vt:me?It:gt;$[ge]>O[ge]&&(A=es(A));var R=es(A),K=[];if(o&&K.push(_e[Se]<=0),l&&K.push(_e[A]<=0,_e[R]<=0),K.every(function(je){return je})){z=he,ee=!1;break}Y.set(he,K)}if(ee)for(var J=b?3:1,se=function(Me){var Be=T.find(function(wt){var Nt=Y.get(wt);if(Nt)return Nt.slice(0,Me).every(function(Oe){return Oe})});if(Be)return z=Be,"break"},be=J;be>0;be--){var De=se(be);if(De==="break")break}e.placement!==z&&(e.modifiersData[r]._skip=!0,e.placement=z,e.reset=!0)}}var fw={name:"flip",enabled:!0,phase:"main",fn:iB,requiresIfExists:["offset"],data:{_skip:!1}};function pw(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function hw(t){return[gt,At,It,vt].some(function(e){return t[e]>=0})}function oB(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=lr(e,{elementContext:"reference"}),l=lr(e,{altBoundary:!0}),c=pw(s,r),d=pw(l,i,o),f=hw(c),h=hw(d);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:f,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":h})}var mw={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:oB};function sB(t,e,n){var r=Wt(t),i=[vt,gt].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],l=o[1];return s=s||0,l=(l||0)*i,[vt,At].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function aB(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=Cc.reduce(function(f,h){return f[h]=sB(h,e.rects,o),f},{}),l=s[e.placement],c=l.x,d=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=s}var gw={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:aB};function lB(t){var e=t.state,n=t.name;e.modifiersData[n]=fa({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var bw={name:"popperOffsets",enabled:!0,phase:"read",fn:lB,data:{}};function eh(t){return t==="x"?"y":"x"}function cB(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!1:s,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.padding,m=n.tether,y=m===void 0?!0:m,b=n.tetherOffset,w=b===void 0?0:b,_=lr(e,{boundary:c,rootBoundary:d,padding:h,altBoundary:f}),S=Wt(e.placement),L=Gn(e.placement),D=!L,T=lo(S),$=eh(T),O=e.modifiersData.popperOffsets,Y=e.rects.reference,ee=e.rects.popper,z=typeof w=="function"?w(Object.assign({},e.rects,{placement:e.placement})):w,re=typeof z=="number"?{mainAxis:z,altAxis:z}:Object.assign({mainAxis:0,altAxis:0},z),he=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,Se={x:0,y:0};if(O){if(o){var me,Ce=T==="y"?gt:vt,ge=T==="y"?It:At,_e=T==="y"?"height":"width",A=O[T],R=A+_[Ce],K=A-_[ge],J=y?-ee[_e]/2:0,se=L===Kr?Y[_e]:ee[_e],be=L===Kr?-ee[_e]:-Y[_e],De=e.elements.arrow,je=y&&De?ao(De):{width:0,height:0},Me=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:ca(),Be=Me[Ce],wt=Me[ge],Nt=co(0,Y[_e],je[_e]),Oe=D?Y[_e]/2-J-Nt-Be-re.mainAxis:se-Nt-Be-re.mainAxis,xt=D?-Y[_e]/2+J+Nt+wt+re.mainAxis:be+Nt+wt+re.mainAxis,Jt=e.elements.arrow&&ar(e.elements.arrow),pt=Jt?T==="y"?Jt.clientTop||0:Jt.clientLeft||0:0,sn=(me=he?.[T])!=null?me:0,Xt=A+Oe-sn-pt,_t=A+xt-sn,Je=co(y?so(R,Xt):R,A,y?sr(K,_t):K);O[T]=Je,Se[T]=Je-A}if(l){var Xn,Lt=T==="x"?gt:vt,V=T==="x"?It:At,bt=O[$],we=$==="y"?"height":"width",fe=bt+_[Lt],ct=bt-_[V],ut=[gt,vt].indexOf(S)!==-1,Pt=(Xn=he?.[$])!=null?Xn:0,kt=ut?fe:bt-Y[we]-ee[we]-Pt+re.altAxis,I=ut?bt+Y[we]+ee[we]-Pt-re.altAxis:ct,F=y&&ut?sw(kt,bt,I):co(y?kt:fe,bt,y?I:ct);O[$]=F,Se[$]=F-bt}e.modifiersData[r]=Se}}var yw={name:"preventOverflow",enabled:!0,phase:"main",fn:cB,requiresIfExists:["offset"]};function th(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function nh(t){return t===lt(t)||!Dt(t)?uo(t):th(t)}function uB(t){var e=t.getBoundingClientRect(),n=Vr(e.width)/t.offsetWidth||1,r=Vr(e.height)/t.offsetHeight||1;return n!==1||r!==1}function rh(t,e,n){n===void 0&&(n=!1);var r=Dt(e),i=Dt(e)&&uB(e),o=Yt(e),s=Vn(t,i,n),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((Ut(e)!=="body"||po(o))&&(l=nh(e)),Dt(e)?(c=Vn(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):o&&(c.x=fo(o))),{x:s.left+l.scrollLeft-c.x,y:s.top+l.scrollTop-c.y,width:s.width,height:s.height}}function dB(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(l){if(!n.has(l)){var c=e.get(l);c&&i(c)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function ih(t){var e=dB(t);return iw.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function oh(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function sh(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Ew={placement:"bottom",modifiers:[],strategy:"absolute"};function vw(){for(var t=arguments.length,e=new Array(t),n=0;n-1}function Lw(t,e){return typeof t=="function"?t.apply(void 0,e):t}function xw(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function mB(t){return t.split(/\s+/).filter(Boolean)}function ns(t){return[].concat(t)}function _w(t,e){t.indexOf(e)===-1&&t.push(e)}function gB(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function bB(t){return t.split("-")[0]}function Oc(t){return[].slice.call(t)}function Sw(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function pa(){return document.createElement("div")}function Rc(t){return["Element","Fragment"].some(function(e){return hh(t,e)})}function yB(t){return hh(t,"NodeList")}function EB(t){return hh(t,"MouseEvent")}function vB(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function wB(t){return Rc(t)?[t]:yB(t)?Oc(t):Array.isArray(t)?t:Oc(document.querySelectorAll(t))}function ch(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function Tw(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function xB(t){var e,n=ns(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function _B(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,l=i.props,c=l.interactiveBorder,d=bB(s.placement),f=s.modifiersData.offset;if(!f)return!0;var h=d==="bottom"?f.top.y:0,m=d==="top"?f.bottom.y:0,y=d==="right"?f.left.x:0,b=d==="left"?f.right.x:0,w=o.top-r+h>c,_=r-o.bottom-m>c,S=o.left-n+y>c,L=n-o.right-b>c;return w||_||S||L})}function uh(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function Cw(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var yr={isTouch:!1},Aw=0;function SB(){yr.isTouch||(yr.isTouch=!0,window.performance&&document.addEventListener("mousemove",Pw))}function Pw(){var t=performance.now();t-Aw<20&&(yr.isTouch=!1,document.removeEventListener("mousemove",Pw)),Aw=t}function TB(){var t=document.activeElement;if(vB(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function CB(){document.addEventListener("touchstart",SB,ho),window.addEventListener("blur",TB)}var AB=typeof window<"u"&&typeof document<"u",MB=AB?!!window.msCrypto:!1;var NB={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},kB={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},cr=Object.assign({appendTo:Dw,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},NB,kB),OB=Object.keys(cr),RB=function(e){var n=Object.keys(e);n.forEach(function(r){cr[r]=e[r]})};function Bw(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var l;r[o]=t[o]!==void 0?t[o]:(l=cr[o])!=null?l:s}return r},{});return Object.assign({},t,n)}function IB(t,e){var n=e?Object.keys(Bw(Object.assign({},cr,{plugins:e}))):OB,r=n.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function Mw(t,e){var n=Object.assign({},e,{content:Lw(e.content,[t])},e.ignoreAttributes?{}:IB(t,e.plugins));return n.aria=Object.assign({},cr.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var DB=function(){return"innerHTML"};function fh(t,e){t[DB()]=e}function Nw(t){var e=pa();return t===!0?e.className=Rw:(e.className=Iw,Rc(t)?e.appendChild(t):fh(e,t)),e}function kw(t,e){Rc(e.content)?(fh(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?fh(t,e.content):t.textContent=e.content)}function ph(t){var e=t.firstElementChild,n=Oc(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Ow)}),arrow:n.find(function(r){return r.classList.contains(Rw)||r.classList.contains(Iw)}),backdrop:n.find(function(r){return r.classList.contains(hB)})}}function Fw(t){var e=pa(),n=pa();n.className=pB,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=pa();r.className=Ow,r.setAttribute("data-state","hidden"),kw(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var l=ph(e),c=l.box,d=l.content,f=l.arrow;s.theme?c.setAttribute("data-theme",s.theme):c.removeAttribute("data-theme"),typeof s.animation=="string"?c.setAttribute("data-animation",s.animation):c.removeAttribute("data-animation"),s.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?c.setAttribute("role",s.role):c.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&kw(d,t.props),s.arrow?f?o.arrow!==s.arrow&&(c.removeChild(f),c.appendChild(Nw(s.arrow))):c.appendChild(Nw(s.arrow)):f&&c.removeChild(f)}return{popper:e,onUpdate:i}}Fw.$$tippy=!0;var LB=1,kc=[],dh=[];function PB(t,e){var n=Mw(t,Object.assign({},cr,Bw(Sw(e)))),r,i,o,s=!1,l=!1,c=!1,d=!1,f,h,m,y=[],b=xw(Xt,n.interactiveDebounce),w,_=LB++,S=null,L=gB(n.plugins),D={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},T={id:_,reference:t,popper:pa(),popperInstance:S,props:n,state:D,plugins:L,clearDelayTimeouts:kt,setProps:I,setContent:F,show:X,hide:oe,hideWithInteractivity:Fe,enable:ut,disable:Pt,unmount:rt,destroy:xr};if(!n.render)return T;var $=n.render(T),O=$.popper,Y=$.onUpdate;O.setAttribute("data-tippy-root",""),O.id="tippy-"+T.id,T.popper=O,t._tippy=T,O._tippy=T;var ee=L.map(function(B){return B.fn(T)}),z=t.hasAttribute("aria-expanded");return Jt(),J(),A(),R("onCreate",[T]),n.showOnCreate&&fe(),O.addEventListener("mouseenter",function(){T.props.interactive&&T.state.isVisible&&T.clearDelayTimeouts()}),O.addEventListener("mouseleave",function(){T.props.interactive&&T.props.trigger.indexOf("mouseenter")>=0&&Ce().addEventListener("mousemove",b)}),T;function re(){var B=T.props.touch;return Array.isArray(B)?B:[B,0]}function he(){return re()[0]==="hold"}function Se(){var B;return!!((B=T.props.render)!=null&&B.$$tippy)}function me(){return w||t}function Ce(){var B=me().parentNode;return B?xB(B):document}function ge(){return ph(O)}function _e(B){return T.state.isMounted&&!T.state.isVisible||yr.isTouch||f&&f.type==="focus"?0:lh(T.props.delay,B?0:1,cr.delay)}function A(B){B===void 0&&(B=!1),O.style.pointerEvents=T.props.interactive&&!B?"":"none",O.style.zIndex=""+T.props.zIndex}function R(B,ae,xe){if(xe===void 0&&(xe=!0),ee.forEach(function(Ke){Ke[B]&&Ke[B].apply(Ke,ae)}),xe){var qe;(qe=T.props)[B].apply(qe,ae)}}function K(){var B=T.props.aria;if(B.content){var ae="aria-"+B.content,xe=O.id,qe=ns(T.props.triggerTarget||t);qe.forEach(function(Ke){var Bt=Ke.getAttribute(ae);if(T.state.isVisible)Ke.setAttribute(ae,Bt?Bt+" "+xe:xe);else{var an=Bt&&Bt.replace(xe,"").trim();an?Ke.setAttribute(ae,an):Ke.removeAttribute(ae)}})}}function J(){if(!(z||!T.props.aria.expanded)){var B=ns(T.props.triggerTarget||t);B.forEach(function(ae){T.props.interactive?ae.setAttribute("aria-expanded",T.state.isVisible&&ae===me()?"true":"false"):ae.removeAttribute("aria-expanded")})}}function se(){Ce().removeEventListener("mousemove",b),kc=kc.filter(function(B){return B!==b})}function be(B){if(!(yr.isTouch&&(c||B.type==="mousedown"))){var ae=B.composedPath&&B.composedPath()[0]||B.target;if(!(T.props.interactive&&Cw(O,ae))){if(ns(T.props.triggerTarget||t).some(function(xe){return Cw(xe,ae)})){if(yr.isTouch||T.state.isVisible&&T.props.trigger.indexOf("click")>=0)return}else R("onClickOutside",[T,B]);T.props.hideOnClick===!0&&(T.clearDelayTimeouts(),T.hide(),l=!0,setTimeout(function(){l=!1}),T.state.isMounted||Be())}}}function De(){c=!0}function je(){c=!1}function Me(){var B=Ce();B.addEventListener("mousedown",be,!0),B.addEventListener("touchend",be,ho),B.addEventListener("touchstart",je,ho),B.addEventListener("touchmove",De,ho)}function Be(){var B=Ce();B.removeEventListener("mousedown",be,!0),B.removeEventListener("touchend",be,ho),B.removeEventListener("touchstart",je,ho),B.removeEventListener("touchmove",De,ho)}function wt(B,ae){Oe(B,function(){!T.state.isVisible&&O.parentNode&&O.parentNode.contains(O)&&ae()})}function Nt(B,ae){Oe(B,ae)}function Oe(B,ae){var xe=ge().box;function qe(Ke){Ke.target===xe&&(uh(xe,"remove",qe),ae())}if(B===0)return ae();uh(xe,"remove",h),uh(xe,"add",qe),h=qe}function xt(B,ae,xe){xe===void 0&&(xe=!1);var qe=ns(T.props.triggerTarget||t);qe.forEach(function(Ke){Ke.addEventListener(B,ae,xe),y.push({node:Ke,eventType:B,handler:ae,options:xe})})}function Jt(){he()&&(xt("touchstart",sn,{passive:!0}),xt("touchend",_t,{passive:!0})),mB(T.props.trigger).forEach(function(B){if(B!=="manual")switch(xt(B,sn),B){case"mouseenter":xt("mouseleave",_t);break;case"focus":xt(MB?"focusout":"blur",Je);break;case"focusin":xt("focusout",Je);break}})}function pt(){y.forEach(function(B){var ae=B.node,xe=B.eventType,qe=B.handler,Ke=B.options;ae.removeEventListener(xe,qe,Ke)}),y=[]}function sn(B){var ae,xe=!1;if(!(!T.state.isEnabled||Xn(B)||l)){var qe=((ae=f)==null?void 0:ae.type)==="focus";f=B,w=B.currentTarget,J(),!T.state.isVisible&&EB(B)&&kc.forEach(function(Ke){return Ke(B)}),B.type==="click"&&(T.props.trigger.indexOf("mouseenter")<0||s)&&T.props.hideOnClick!==!1&&T.state.isVisible?xe=!0:fe(B),B.type==="click"&&(s=!xe),xe&&!qe&&ct(B)}}function Xt(B){var ae=B.target,xe=me().contains(ae)||O.contains(ae);if(!(B.type==="mousemove"&&xe)){var qe=we().concat(O).map(function(Ke){var Bt,an=Ke._tippy,Jr=(Bt=an.popperInstance)==null?void 0:Bt.state;return Jr?{popperRect:Ke.getBoundingClientRect(),popperState:Jr,props:n}:null}).filter(Boolean);_B(qe,B)&&(se(),ct(B))}}function _t(B){var ae=Xn(B)||T.props.trigger.indexOf("click")>=0&&s;if(!ae){if(T.props.interactive){T.hideWithInteractivity(B);return}ct(B)}}function Je(B){T.props.trigger.indexOf("focusin")<0&&B.target!==me()||T.props.interactive&&B.relatedTarget&&O.contains(B.relatedTarget)||ct(B)}function Xn(B){return yr.isTouch?he()!==B.type.indexOf("touch")>=0:!1}function Lt(){V();var B=T.props,ae=B.popperOptions,xe=B.placement,qe=B.offset,Ke=B.getReferenceClientRect,Bt=B.moveTransition,an=Se()?ph(O).arrow:null,Jr=Ke?{getBoundingClientRect:Ke,contextElement:Ke.contextElement||me()}:t,Ma={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Mi){var Xr=Mi.state;if(Se()){var $u=ge(),ys=$u.box;["placement","reference-hidden","escaped"].forEach(function(Zr){Zr==="placement"?ys.setAttribute("data-placement",Xr.placement):Xr.attributes.popper["data-popper-"+Zr]?ys.setAttribute("data-"+Zr,""):ys.removeAttribute("data-"+Zr)}),Xr.attributes.popper={}}}},_r=[{name:"offset",options:{offset:qe}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Bt}},Ma];Se()&&an&&_r.push({name:"arrow",options:{element:an,padding:3}}),_r.push.apply(_r,ae?.modifiers||[]),T.popperInstance=ah(Jr,O,Object.assign({},ae,{placement:xe,onFirstUpdate:m,modifiers:_r}))}function V(){T.popperInstance&&(T.popperInstance.destroy(),T.popperInstance=null)}function bt(){var B=T.props.appendTo,ae,xe=me();T.props.interactive&&B===Dw||B==="parent"?ae=xe.parentNode:ae=Lw(B,[xe]),ae.contains(O)||ae.appendChild(O),T.state.isMounted=!0,Lt()}function we(){return Oc(O.querySelectorAll("[data-tippy-root]"))}function fe(B){T.clearDelayTimeouts(),B&&R("onTrigger",[T,B]),Me();var ae=_e(!0),xe=re(),qe=xe[0],Ke=xe[1];yr.isTouch&&qe==="hold"&&Ke&&(ae=Ke),ae?r=setTimeout(function(){T.show()},ae):T.show()}function ct(B){if(T.clearDelayTimeouts(),R("onUntrigger",[T,B]),!T.state.isVisible){Be();return}if(!(T.props.trigger.indexOf("mouseenter")>=0&&T.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(B.type)>=0&&s)){var ae=_e(!1);ae?i=setTimeout(function(){T.state.isVisible&&T.hide()},ae):o=requestAnimationFrame(function(){T.hide()})}}function ut(){T.state.isEnabled=!0}function Pt(){T.hide(),T.state.isEnabled=!1}function kt(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function I(B){if(!T.state.isDestroyed){R("onBeforeUpdate",[T,B]),pt();var ae=T.props,xe=Mw(t,Object.assign({},ae,Sw(B),{ignoreAttributes:!0}));T.props=xe,Jt(),ae.interactiveDebounce!==xe.interactiveDebounce&&(se(),b=xw(Xt,xe.interactiveDebounce)),ae.triggerTarget&&!xe.triggerTarget?ns(ae.triggerTarget).forEach(function(qe){qe.removeAttribute("aria-expanded")}):xe.triggerTarget&&t.removeAttribute("aria-expanded"),J(),A(),Y&&Y(ae,xe),T.popperInstance&&(Lt(),we().forEach(function(qe){requestAnimationFrame(qe._tippy.popperInstance.forceUpdate)})),R("onAfterUpdate",[T,B])}}function F(B){T.setProps({content:B})}function X(){var B=T.state.isVisible,ae=T.state.isDestroyed,xe=!T.state.isEnabled,qe=yr.isTouch&&!T.props.touch,Ke=lh(T.props.duration,0,cr.duration);if(!(B||ae||xe||qe)&&!me().hasAttribute("disabled")&&(R("onShow",[T],!1),T.props.onShow(T)!==!1)){if(T.state.isVisible=!0,Se()&&(O.style.visibility="visible"),A(),Me(),T.state.isMounted||(O.style.transition="none"),Se()){var Bt=ge(),an=Bt.box,Jr=Bt.content;ch([an,Jr],0)}m=function(){var _r;if(!(!T.state.isVisible||d)){if(d=!0,O.offsetHeight,O.style.transition=T.props.moveTransition,Se()&&T.props.animation){var bs=ge(),Mi=bs.box,Xr=bs.content;ch([Mi,Xr],Ke),Tw([Mi,Xr],"visible")}K(),J(),_w(dh,T),(_r=T.popperInstance)==null||_r.forceUpdate(),R("onMount",[T]),T.props.animation&&Se()&&Nt(Ke,function(){T.state.isShown=!0,R("onShown",[T])})}},bt()}}function oe(){var B=!T.state.isVisible,ae=T.state.isDestroyed,xe=!T.state.isEnabled,qe=lh(T.props.duration,1,cr.duration);if(!(B||ae||xe)&&(R("onHide",[T],!1),T.props.onHide(T)!==!1)){if(T.state.isVisible=!1,T.state.isShown=!1,d=!1,s=!1,Se()&&(O.style.visibility="hidden"),se(),Be(),A(!0),Se()){var Ke=ge(),Bt=Ke.box,an=Ke.content;T.props.animation&&(ch([Bt,an],qe),Tw([Bt,an],"hidden"))}K(),J(),T.props.animation?Se()&&wt(qe,T.unmount):T.unmount()}}function Fe(B){Ce().addEventListener("mousemove",b),_w(kc,b),b(B)}function rt(){T.state.isVisible&&T.hide(),T.state.isMounted&&(V(),we().forEach(function(B){B._tippy.unmount()}),O.parentNode&&O.parentNode.removeChild(O),dh=dh.filter(function(B){return B!==T}),T.state.isMounted=!1,R("onHidden",[T]))}function xr(){T.state.isDestroyed||(T.clearDelayTimeouts(),T.unmount(),pt(),delete t._tippy,T.state.isDestroyed=!0,R("onDestroy",[T]))}}function ha(t,e){e===void 0&&(e={});var n=cr.plugins.concat(e.plugins||[]);CB();var r=Object.assign({},e,{plugins:n}),i=wB(t);if(0)var o,s;var l=i.reduce(function(c,d){var f=d&&PB(d,r);return f&&c.push(f),c},[]);return Rc(t)?l[0]:l}ha.defaultProps=cr;ha.setDefaultProps=RB;ha.currentInput=yr;var HV=Object.assign({},sa,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});ha.setDefaultProps({render:Fw});var rs=ha;var mh=class{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:l,state:c,from:d,to:f})=>{let{doc:h,selection:m}=c,{empty:y}=m,b=!h.textBetween(d,f).length&&oc(c.selection),w=this.element.contains(document.activeElement);return!(!(l.hasFocus()||w)||y||b||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:l})=>{var c;if(this.preventHide){this.preventHide=!1;return}l?.relatedTarget&&(!((c=this.element.parentNode)===null||c===void 0)&&c.contains(l.relatedTarget))||this.hide()},this.tippyBlurHandler=l=>{this.blurHandler({event:l})},this.handleDebouncedUpdate=(l,c)=>{let d=!c?.selection.eq(l.state.selection),f=!c?.doc.eq(l.state.doc);!d&&!f||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(l,d,f,c)},this.updateDelay))},this.updateHandler=(l,c,d,f)=>{var h,m,y;let{state:b,composing:w}=l,{selection:_}=b;if(w||!c&&!d)return;this.createTooltip();let{ranges:L}=_,D=Math.min(...L.map(O=>O.$from.pos)),T=Math.max(...L.map(O=>O.$to.pos));if(!((h=this.shouldShow)===null||h===void 0?void 0:h.call(this,{editor:this.editor,view:l,state:b,oldState:f,from:D,to:T}))){this.hide();return}(m=this.tippy)===null||m===void 0||m.setProps({getReferenceClientRect:((y=this.tippyOptions)===null||y===void 0?void 0:y.getReferenceClientRect)||(()=>{if(cc(b.selection)){let O=l.nodeDOM(D),Y=O.dataset.nodeViewWrapper?O:O.querySelector("[data-node-view-wrapper]");if(Y&&(O=Y.firstChild),O)return O.getBoundingClientRect()}return uc(l,D,T)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){let{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=rs(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){let{state:r}=e,i=r.selection.from!==r.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}let o=!n?.selection.eq(e.state.selection),s=!n?.doc.eq(e.state.doc);this.updateHandler(e,o,s,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}},BB=t=>new ke({key:typeof t.pluginKey=="string"?new ze(t.pluginKey):t.pluginKey,view:e=>new mh({view:e,...t})}),Hw=We.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[BB({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});var gh=class{constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:s,state:l})=>{let{selection:c}=l,{$anchor:d,empty:f}=c,h=d.depth===1,m=d.parent.isTextblock&&!d.parent.type.spec.code&&!d.parent.textContent;return!(!s.hasFocus()||!f||!h||!m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var l;if(this.preventHide){this.preventHide=!1;return}s?.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(s.relatedTarget))||this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.editor=e,this.element=n,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){let{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=rs(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,i,o;let{state:s}=e,{doc:l,selection:c}=s,{from:d,to:f}=c;if(n&&n.doc.eq(l)&&n.selection.eq(c))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:s,oldState:n}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((o=this.tippyOptions)===null||o===void 0?void 0:o.getReferenceClientRect)||(()=>uc(e,d,f))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}},FB=t=>new ke({key:typeof t.pluginKey=="string"?new ze(t.pluginKey):t.pluginKey,view:e=>new gh({view:e,...t})}),$w=We.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[FB({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});var bh=ce.create({name:"checkedList",priority:50,addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{class:"checked-list"}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul",getAttrs:t=>t.classList.contains("checked-list"),priority:1e3}]},renderHTML({HTMLAttributes:t}){return["ul",Q(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleCheckedList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}}});var yh=ce.create({name:"lead",group:"block",content:"block+",addOptions(){return{HTMLAttributes:{class:"lead"}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("lead")}]},renderHTML({node:t,HTMLAttributes:e}){return["div",Q(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleLead:()=>({commands:t})=>t.toggleWrap(this.name)}}});var HB="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",$B="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",as=(t,e)=>{for(let n in e)t[n]=e[n];return t},_h="numeric",Sh="ascii",Th="alpha",Bc="asciinumeric",Ic="alphanumeric",Ch="domain",Jw="emoji",zB="scheme",UB="slashscheme",zw="whitespace";function WB(t,e){return t in e||(e[t]=[]),e[t]}function mo(t,e,n){e[_h]&&(e[Bc]=!0,e[Ic]=!0),e[Sh]&&(e[Bc]=!0,e[Th]=!0),e[Bc]&&(e[Ic]=!0),e[Th]&&(e[Ic]=!0),e[Ic]&&(e[Ch]=!0),e[Jw]&&(e[Ch]=!0);for(let r in e){let i=WB(r,n);i.indexOf(t)<0&&i.push(t)}}function KB(t,e){let n={};for(let r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function wn(t){t===void 0&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}wn.groups={};wn.prototype={accepts(){return!!this.t},go(t){let e=this,n=e.j[t];if(n)return n;for(let r=0;rt.ta(e,n,r,i),qn=(t,e,n,r,i)=>t.tr(e,n,r,i),Uw=(t,e,n,r,i)=>t.ts(e,n,r,i),j=(t,e,n,r,i)=>t.tt(e,n,r,i),qr="WORD",Ah="UWORD",ya="LOCALHOST",Mh="TLD",Nh="UTLD",Fc="SCHEME",ss="SLASH_SCHEME",kh="NUM",Xw="WS",Oh="NL",ma="OPENBRACE",ga="CLOSEBRACE",Hc="OPENBRACKET",$c="CLOSEBRACKET",zc="OPENPAREN",Uc="CLOSEPAREN",Wc="OPENANGLEBRACKET",Kc="CLOSEANGLEBRACKET",Vc="FULLWIDTHLEFTPAREN",Gc="FULLWIDTHRIGHTPAREN",qc="LEFTCORNERBRACKET",Yc="RIGHTCORNERBRACKET",Jc="LEFTWHITECORNERBRACKET",Xc="RIGHTWHITECORNERBRACKET",Zc="FULLWIDTHLESSTHAN",jc="FULLWIDTHGREATERTHAN",Qc="AMPERSAND",eu="APOSTROPHE",tu="ASTERISK",_i="AT",nu="BACKSLASH",ru="BACKTICK",iu="CARET",Si="COLON",Rh="COMMA",ou="DOLLAR",Er="DOT",su="EQUALS",Ih="EXCLAMATION",vr="HYPHEN",au="PERCENT",lu="PIPE",cu="PLUS",uu="POUND",du="QUERY",Dh="QUOTE",Lh="SEMI",wr="SLASH",ba="TILDE",fu="UNDERSCORE",Zw="EMOJI",pu="SYM",jw=Object.freeze({__proto__:null,WORD:qr,UWORD:Ah,LOCALHOST:ya,TLD:Mh,UTLD:Nh,SCHEME:Fc,SLASH_SCHEME:ss,NUM:kh,WS:Xw,NL:Oh,OPENBRACE:ma,CLOSEBRACE:ga,OPENBRACKET:Hc,CLOSEBRACKET:$c,OPENPAREN:zc,CLOSEPAREN:Uc,OPENANGLEBRACKET:Wc,CLOSEANGLEBRACKET:Kc,FULLWIDTHLEFTPAREN:Vc,FULLWIDTHRIGHTPAREN:Gc,LEFTCORNERBRACKET:qc,RIGHTCORNERBRACKET:Yc,LEFTWHITECORNERBRACKET:Jc,RIGHTWHITECORNERBRACKET:Xc,FULLWIDTHLESSTHAN:Zc,FULLWIDTHGREATERTHAN:jc,AMPERSAND:Qc,APOSTROPHE:eu,ASTERISK:tu,AT:_i,BACKSLASH:nu,BACKTICK:ru,CARET:iu,COLON:Si,COMMA:Rh,DOLLAR:ou,DOT:Er,EQUALS:su,EXCLAMATION:Ih,HYPHEN:vr,PERCENT:au,PIPE:lu,PLUS:cu,POUND:uu,QUERY:du,QUOTE:Dh,SEMI:Lh,SLASH:wr,TILDE:ba,UNDERSCORE:fu,EMOJI:Zw,SYM:pu}),is=/[a-z]/,Eh=/\p{L}/u,vh=/\p{Emoji}/u;var wh=/\d/,Ww=/\s/;var Kw=` +`,VB="\uFE0F",GB="\u200D",Dc=null,Lc=null;function qB(t){t===void 0&&(t=[]);let e={};wn.groups=e;let n=new wn;Dc==null&&(Dc=Vw(HB)),Lc==null&&(Lc=Vw($B)),j(n,"'",eu),j(n,"{",ma),j(n,"}",ga),j(n,"[",Hc),j(n,"]",$c),j(n,"(",zc),j(n,")",Uc),j(n,"<",Wc),j(n,">",Kc),j(n,"\uFF08",Vc),j(n,"\uFF09",Gc),j(n,"\u300C",qc),j(n,"\u300D",Yc),j(n,"\u300E",Jc),j(n,"\u300F",Xc),j(n,"\uFF1C",Zc),j(n,"\uFF1E",jc),j(n,"&",Qc),j(n,"*",tu),j(n,"@",_i),j(n,"`",ru),j(n,"^",iu),j(n,":",Si),j(n,",",Rh),j(n,"$",ou),j(n,".",Er),j(n,"=",su),j(n,"!",Ih),j(n,"-",vr),j(n,"%",au),j(n,"|",lu),j(n,"+",cu),j(n,"#",uu),j(n,"?",du),j(n,'"',Dh),j(n,"/",wr),j(n,";",Lh),j(n,"~",ba),j(n,"_",fu),j(n,"\\",nu);let r=qn(n,wh,kh,{[_h]:!0});qn(r,wh,r);let i=qn(n,is,qr,{[Sh]:!0});qn(i,is,i);let o=qn(n,Eh,Ah,{[Th]:!0});qn(o,is),qn(o,Eh,o);let s=qn(n,Ww,Xw,{[zw]:!0});j(n,Kw,Oh,{[zw]:!0}),j(s,Kw),qn(s,Ww,s);let l=qn(n,vh,Zw,{[Jw]:!0});qn(l,vh,l),j(l,VB,l);let c=j(l,GB);qn(c,vh,l);let d=[[is,i]],f=[[is,null],[Eh,o]];for(let h=0;hh[0]>m[0]?1:-1);for(let h=0;h=0?b[Ch]=!0:is.test(m)?wh.test(m)?b[Bc]=!0:b[Sh]=!0:b[_h]=!0,Uw(n,m,m,b)}return Uw(n,"localhost",ya,{ascii:!0}),n.jd=new wn(pu),{start:n,tokens:as({groups:e},jw)}}function YB(t,e){let n=JB(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,i=[],o=0,s=0;for(;s=0&&(h+=n[s].length,m++),d+=n[s].length,o+=n[s].length,s++;o-=h,s-=m,d-=h,i.push({t:f.t,v:e.slice(o-d,o),s:o-d,e:o})}return i}function JB(t){let e=[],n=t.length,r=0;for(;r56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function xi(t,e,n,r,i){let o,s=e.length;for(let l=0;l=0;)o++;if(o>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(t[r]),r++}return e}var Ea={defaultProtocol:"http",events:null,format:Gw,formatHref:Gw,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Ph(t,e){e===void 0&&(e=null);let n=as({},Ea);t&&(n=as(n,t instanceof Ph?t.o:t));let r=n.ignoreTags,i=[];for(let o=0;on?r.substring(0,n)+"\u2026":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return t===void 0&&(t=Ea.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){let e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),o=this.toFormattedString(t),s={},l=t.get("className",n,e),c=t.get("target",n,e),d=t.get("rel",n,e),f=t.getObj("attributes",n,e),h=t.getObj("events",n,e);return s.href=r,l&&(s.class=l),c&&(s.target=c),d&&(s.rel=d),f&&as(s,f),{tagName:i,attributes:s,content:o,eventListeners:h}}};function hu(t,e){class n extends Qw{constructor(i,o){super(i,o),this.t=t}}for(let r in e)n.prototype[r]=e[r];return n.t=t,n}var qw=hu("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Yw=hu("text"),XB=hu("nl"),Pc=hu("url",{isLink:!0,toHref(t){return t===void 0&&(t=Ea.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){let t=this.tk;return t.length>=2&&t[0].t!==ya&&t[1].t===Si}});var Yn=t=>new wn(t);function ZB(t){let{groups:e}=t,n=e.domain.concat([Qc,tu,_i,nu,ru,iu,ou,su,vr,kh,au,lu,cu,uu,wr,pu,ba,fu]),r=[eu,Si,Rh,Er,Ih,du,Dh,Lh,Wc,Kc,ma,ga,$c,Hc,zc,Uc,Vc,Gc,qc,Yc,Jc,Xc,Zc,jc],i=[Qc,eu,tu,nu,ru,iu,ou,su,vr,ma,ga,au,lu,cu,uu,du,wr,pu,ba,fu],o=Yn(),s=j(o,ba);Pe(s,i,s),Pe(s,e.domain,s);let l=Yn(),c=Yn(),d=Yn();Pe(o,e.domain,l),Pe(o,e.scheme,c),Pe(o,e.slashscheme,d),Pe(l,i,s),Pe(l,e.domain,l);let f=j(l,_i);j(s,_i,f),j(c,_i,f),j(d,_i,f);let h=j(s,Er);Pe(h,i,s),Pe(h,e.domain,s);let m=Yn();Pe(f,e.domain,m),Pe(m,e.domain,m);let y=j(m,Er);Pe(y,e.domain,m);let b=Yn(qw);Pe(y,e.tld,b),Pe(y,e.utld,b),j(f,ya,b);let w=j(m,vr);Pe(w,e.domain,m),Pe(b,e.domain,m),j(b,Er,y),j(b,vr,w);let _=j(b,Si);Pe(_,e.numeric,qw);let S=j(l,vr),L=j(l,Er);Pe(S,e.domain,l),Pe(L,i,s),Pe(L,e.domain,l);let D=Yn(Pc);Pe(L,e.tld,D),Pe(L,e.utld,D),Pe(D,e.domain,l),Pe(D,i,s),j(D,Er,L),j(D,vr,S),j(D,_i,f);let T=j(D,Si),$=Yn(Pc);Pe(T,e.numeric,$);let O=Yn(Pc),Y=Yn();Pe(O,n,O),Pe(O,r,Y),Pe(Y,n,O),Pe(Y,r,Y),j(D,wr,O),j($,wr,O);let ee=j(c,Si),z=j(d,Si),re=j(z,wr),he=j(re,wr);Pe(c,e.domain,l),j(c,Er,L),j(c,vr,S),Pe(d,e.domain,l),j(d,Er,L),j(d,vr,S),Pe(ee,e.domain,O),j(ee,wr,O),Pe(he,e.domain,O),Pe(he,n,O),j(he,wr,O);let Se=[[ma,ga],[Hc,$c],[zc,Uc],[Wc,Kc],[Vc,Gc],[qc,Yc],[Jc,Xc],[Zc,jc]];for(let me=0;me=0&&m++,i++,f++;if(m<0)i-=f,i0&&(o.push(xh(Yw,e,s)),s=[]),i-=m,f-=m;let y=h.t,b=n.slice(i-f,i);o.push(xh(y,e,b))}}return s.length>0&&o.push(xh(Yw,e,s)),o}function xh(t,e,n){let r=n[0].s,i=n[n.length-1].e,o=e.slice(r,i);return new t(o,n)}var QB=typeof console<"u"&&console&&console.warn||(()=>{}),e2="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ft={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function ex(){wn.groups={},ft.scanner=null,ft.parser=null,ft.tokenQueue=[],ft.pluginQueue=[],ft.customSchemes=[],ft.initialized=!1}function Bh(t,e){if(e===void 0&&(e=!1),ft.initialized&&QB(`linkifyjs: already initialized - will not register custom scheme "${t}" ${e2}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. +1. Must only contain digits, lowercase ASCII letters or "-" +2. Cannot start or end with "-" +3. "-" cannot repeat`);ft.customSchemes.push([t,e])}function t2(){ft.scanner=qB(ft.customSchemes);for(let t=0;t{let i=e.some(d=>d.docChanged)&&!n.doc.eq(r.doc),o=e.some(d=>d.getMeta("preventAutolink"));if(!i||o)return;let{tr:s}=r,l=KE(n.doc,[...e]);if(GE(l).forEach(({newRange:d})=>{let f=VE(r.doc,d,y=>y.isTextblock),h,m;if(f.length>1?(h=f[0],m=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ")):f.length&&r.doc.textBetween(d.from,d.to," "," ").endsWith(" ")&&(h=f[0],m=r.doc.textBetween(h.pos,d.to,void 0," ")),h&&m){let y=m.split(" ").filter(S=>S!=="");if(y.length<=0)return!1;let b=y[y.length-1],w=h.pos+m.lastIndexOf(b);if(!b)return!1;let _=Fh(b).map(S=>S.toObject(t.defaultProtocol));if(!n2(_))return!1;_.filter(S=>S.isLink).map(S=>({...S,from:w+S.start+1,to:w+S.end+1})).filter(S=>r.schema.marks.code?!r.doc.rangeHasMark(S.from,S.to,r.schema.marks.code):!0).filter(S=>t.validate(S.value)).forEach(S=>{lc(S.from,S.to,r.doc).some(L=>L.mark.type===t.type)||s.addMark(S.from,S.to,t.type.create({href:S.href}))})}}),!!s.steps.length)return s}})}function i2(t){return new ke({key:new ze("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(r.button!==0||!e.editable)return!1;let s=r.target,l=[];for(;s.nodeName!=="DIV";)l.push(s),s=s.parentNode;if(!l.find(m=>m.nodeName==="A"))return!1;let c=Mp(e.state,t.type.name),d=r.target,f=(i=d?.href)!==null&&i!==void 0?i:c.href,h=(o=d?.target)!==null&&o!==void 0?o:c.target;return d&&f?(window.open(f,h),!0):!1}}})}function o2(t){return new ke({key:new ze("handlePasteLink"),props:{handlePaste:(e,n,r)=>{let{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let l="";r.content.forEach(d=>{l+=d.textContent});let c=Hh(l,{defaultProtocol:t.defaultProtocol}).find(d=>d.isLink&&d.value===l);return!l||!c?!1:(t.editor.commands.setMark(t.type,{href:c.href}),!0)}}})}var s2=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function tx(t,e){let n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{let i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(s2,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}var nx=st.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.protocols.forEach(t=>{if(typeof t=="string"){Bh(t);return}Bh(t.scheme,t.optionalSlashes)})},onDestroy(){ex()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{let e=t.getAttribute("href");return!e||!tx(e,this.options.protocols)?!1:null}}]},renderHTML({HTMLAttributes:t}){return tx(t.href,this.options.protocols)?["a",Q(this.options.HTMLAttributes,t),0]:["a",Q(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[vn({find:t=>{let e=[];if(t){let{validate:n}=this.options,r=Hh(t).filter(i=>i.isLink&&n(i.value));r.length&&r.forEach(i=>e.push({text:i.value,data:{href:i.href},index:i.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){let t=[];return this.options.autolink&&t.push(r2({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:this.options.validate})),this.options.openOnClick===!0&&t.push(i2({type:this.type})),this.options.linkOnPaste&&t.push(o2({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}});var $h=nx.extend({addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{},validate:void 0}},addAttributes(){return{href:{default:null},id:{default:null},target:{default:this.options.HTMLAttributes.target},hreflang:{default:null},rel:{default:null},referrerpolicy:{default:null},class:{default:null},as_button:{default:null,parseHTML:t=>t.getAttribute("data-as-button"),renderHTML:t=>({"data-as-button":t.as_button})},button_theme:{default:null,parseHTML:t=>t.getAttribute("data-as-button-theme"),renderHTML:t=>({"data-as-button-theme":t.button_theme})}}}});var a2=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,rx=ce.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",Q(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[dc({find:a2,type:this.type,getAttributes:t=>{let[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});var zh=rx.extend({addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null},lazy:{default:null,parseHTML:t=>t.getAttribute("loading")==="lazy"?t.getAttribute("data-lazy"):null,renderHTML:t=>{if(t.lazy)return{"data-lazy":t.lazy,loading:"lazy"}}}}}});var l2=gc.extend({addAttributes(){return{class:{default:null}}}});var Uh=st.create({name:"small",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"small"}]},renderHTML({HTMLAttributes:t}){return["small",Q(this.options.HTMLAttributes,t),0]},addCommands(){return{setSmall:()=>({commands:t})=>t.setMark(this.name),toggleSmall:()=>({commands:t})=>t.toggleMark(this.name),unsetSmall:()=>({commands:t})=>t.unsetMark(this.name)}}});function ix(t,e=null){return e?t.createChecked(null,e):t.createAndFill()}function ox(t){if(t.cached.gridNodeTypes)return t.cached.gridNodeTypes;let e={};return Object.keys(t.nodes).forEach(n=>{let r=t.nodes[n];r.spec.gridRole&&(e[r.spec.gridRole]=r)}),t.cached.gridNodeTypes=e,e}function sx(t,e,n,r){let i=ox(t),o=[];for(let s=0;st.getAttribute("type")},cols:{default:2,parseHTML:t=>t.getAttribute("cols")}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid")&&null}]},renderHTML({HTMLAttributes:t}){return["div",Q(this.options.HTMLAttributes,t),0]},addCommands(){return{insertGrid:({cols:t=3,type:e="responsive"}={})=>({tr:n,dispatch:r,editor:i})=>{let o=sx(i.schema,t,e);if(r){let s=n.selection.anchor+1;n.replaceSelectionWith(o).scrollIntoView().setSelection(le.near(n.doc.resolve(s)))}return!0}}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertGrid()}},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{gridRole:Te(ne(t,"gridRole",e))}}});var Kh=ce.create({name:"gridColumn",content:"block+",gridRole:"column",isolating:!0,addOptions(){return{HTMLAttributes:{class:"filament-tiptap-grid__column"}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid__column")&&null}]},renderHTML({HTMLAttributes:t}){return["div",Q(this.options.HTMLAttributes,t),0]}});var lx=t=>t.match(/(youtube\.com|youtu\.be)(.+)?$/),ax=(t=!1)=>t?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",Vh=t=>{let{url:e,controls:n,nocookie:r,startAt:i}=t;if(e.includes("/embed/"))return e;if(e.includes("youtu.be")){let d=e.split("/").pop();return d?`${ax(r)}${d}`:null}let s=/v=([-\w]+)/gm.exec(e);if(!s||!s[1])return null;let l=`${ax(r)}${s[1]}`,c=[];return n?c.push("controls=1"):c.push("controls=0"),i&&c.push(`start=${i}`),c.length&&(l+=`?${c.join("&")}`),l};var Gh=ce.create({name:"youtube",selectable:!0,draggable:!0,atom:!0,addOptions(){return{inline:!1,HTMLAttributes:{},width:640,height:480}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},start:{default:0},controls:{default:!0},nocookie:{default:!1},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-youtube-video] iframe"}]},addCommands(){return{setYoutubeVideo:t=>({commands:e})=>{if(!lx(t.src))return!1;let n=Vh({url:t.src,controls:t.controls,nocookie:t.nocookie,startAt:t.start||0});return e.insertContent({type:this.name,attrs:{...t,src:n}})}}},renderHTML({HTMLAttributes:t}){let e=Vh({url:t.src,controls:t.controls,nocookie:t.nocookie,startAt:t.start||0});return["div",{"data-youtube-video":"",class:t.responsive?"responsive":null},["iframe",{src:e,width:t.width,height:t.height,allowfullscreen:this.options.allowFullscreen,style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var cx=t=>t.match(/(vimeo\.com)(.+)?$/),qh=t=>{let{url:e,autoplay:n,loop:r,title:i,byline:o,portrait:s}=t;if(e.includes("/video/"))return e;let c=/\.com\/([0-9]+)/gm.exec(e);if(!c||!c[1])return null;let d=`https://player.vimeo.com/video/${c[1]}`,f=[`autoplay=${n}`,`loop=${r}`,`title=${i}`,`byline=${o}`,`portrait=${s}`];return d+=`?${f.join("&")}`,d};var Yh=ce.create({name:"vimeo",selectable:!0,draggable:!0,atom:!0,addOptions(){return{inline:!1,HTMLAttributes:{},allowFullscreen:!0,width:640,height:480}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},autoplay:{default:0},loop:{default:0},title:{default:0},byline:{default:0},portrait:{default:0},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-vimeo-video] iframe"}]},addCommands(){return{setVimeoVideo:t=>({commands:e})=>{if(!cx(t.src))return!1;let n=qh({url:t.src,autoplay:t?.autoplay||0,loop:t?.loop||0,title:t?.title||0,byline:t?.byline||0,portrait:t?.portrait||0});return e.insertContent({type:this.name,attrs:{...t,src:n}})}}},renderHTML({HTMLAttributes:t}){let e=qh({url:t.src,autoplay:t?.autoplay||0,loop:t?.loop||0,title:t?.title||0,byline:t?.byline||0,portrait:t?.portrait||0});return["div",{"data-vimeo-video":"",class:t.responsive?"responsive":null},["iframe",{src:e,width:t.width,height:t.height,allowfullscreen:this.options.allowfullscreen,frameborder:0,allow:"autoplay; fullscreen; picture-in-picture",style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var Jh=ce.create({name:"video",selectable:!0,draggable:!0,atom:!0,inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addOptions(){return{inline:!1,HTMLAttributes:{autoplay:null,controls:null,loop:null},width:640,height:480}},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},autoplay:{default:null,parseHTML:t=>t.getAttribute("autoplay")},controls:{default:null,parseHTML:t=>t.getAttribute("controls")},loop:{default:null,parseHTML:t=>t.getAttribute("loop")},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-native-video] video"}]},addCommands(){return{setVideo:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},renderHTML({HTMLAttributes:t}){return["div",{"data-native-video":"",class:t.responsive?"responsive":null},["video",{src:t.src,width:t.width,height:t.height,autoplay:t.autoplay?"true":null,controls:t.controls?"true":null,loop:t.loop?"true":null,style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var Xh=ce.create({name:"details",content:"detailsSummary detailsContent",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,addOptions(){return{HTMLAttributes:{}}},addAttributes(){return{}},parseHTML(){return[{tag:"details"}]},renderHTML({HTMLAttributes:t}){return["details",Q(this.options.HTMLAttributes,t),0]},addNodeView(){return({editor:t,getPos:e,node:n,HTMLAttributes:r})=>{let i=document.createElement("div"),o=document.createElement("div"),s=Q(this.options.HTMLAttributes,r,{"data-type":this.name});return Object.entries(s).forEach(([l,c])=>i.setAttribute(l,c)),{dom:i,contentDOM:i,ignoreMutation(l){return l.type==="selection"?!1:!i.contains(l.target)||i===l.target},update:l=>l.type===this.type}}},addCommands(){return{setDetails:()=>({state:t,chain:e})=>{var n;let{schema:r,selection:i}=t,{$from:o,$to:s}=i,l=o.blockRange(s);if(!l)return!1;let c=t.doc.slice(l.start,l.end);if(!r.nodes.detailsContent.contentMatch.matchFragment(c.content))return!1;let f=((n=c.toJSON())===null||n===void 0?void 0:n.content)||[];return e().insertContentAt({from:l.start,to:l.end},{type:this.name,content:[{type:"detailsSummary"},{type:"detailsContent",content:f}]}).setTextSelection(l.start+2).run()},unsetDetails:()=>({state:t,chain:e})=>{let{selection:n,schema:r}=t,i=eo(S=>S.type===this.type)(n);if(!i)return!1;let o=Qi(i.node,S=>S.type===r.nodes.detailsSummary),s=Qi(i.node,S=>S.type===r.nodes.detailsContent);if(!o.length||!s.length)return!1;let l=o[0],c=s[0],d=i.pos,f=t.doc.resolve(d),h=d+i.node.nodeSize,m={from:d,to:h},y=c.node.content.toJSON()||[],b=f.parent.type.contentMatch.defaultType,_=[b?.create(null,l.node.content).toJSON(),...y];return e().insertContentAt(m,_).setTextSelection(d+1).run()}}},addKeyboardShortcuts(){return{Backspace:()=>{let{schema:t,selection:e}=this.editor.state,{empty:n,$anchor:r}=e;return!n||r.parent.type!==t.nodes.detailsSummary?!1:r.parentOffset!==0?this.editor.commands.command(({tr:i})=>{let o=r.pos-1,s=r.pos;return i.delete(o,s),!0}):this.editor.commands.unsetDetails()}}}});var Zh=ce.create({name:"detailsSummary",content:"text*",defining:!0,selectable:!1,isolating:!0,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"summary"}]},renderHTML({HTMLAttributes:t}){return["summary",Q(this.options.HTMLAttributes,t),0]}});var jh=ce.create({name:"detailsContent",content:"block+",defining:!0,selectable:!1,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:'div[data-type="details-content"]'}]},renderHTML({HTMLAttributes:t}){return["div",Q(this.options.HTMLAttributes,t,{"data-type":"details-content"}),0]},addKeyboardShortcuts(){return{Enter:({editor:t})=>{let{state:e,view:n}=t,{selection:r}=e,{$from:i,empty:o}=r,s=eo(he=>he.type===this.type)(r);if(!o||!s||!s.node.childCount)return!1;let l=i.index(s.depth),{childCount:c}=s.node;if(!(c===l+1))return!1;let f=s.node.type.contentMatch.defaultType,h=f?.createAndFill();if(!h)return!1;let m=e.doc.resolve(s.pos+1),y=c-1,b=s.node.child(y),w=m.posAtIndex(y,s.depth);if(!b.eq(h))return!1;let S=i.node(-3);if(!S)return!1;let L=i.indexAfter(-3),D=Cp(S.contentMatchAt(L));if(!D||!S.canReplaceWith(L,L,D))return!1;let T=D.createAndFill();if(!T)return!1;let{tr:$}=e,O=i.after(-2);$.replaceWith(O,O,T);let Y=$.doc.resolve(O),ee=ue.near(Y,1);$.setSelection(ee);let z=w,re=w+b.nodeSize;return $.delete(z,re),$.scrollIntoView(),n.dispatch($),!0}}}});var c2=/^```([a-z]+)?[\s\n]$/,u2=/^~~~([a-z]+)?[\s\n]$/,ux=ce.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;let{languageClassPrefix:n}=this.options,o=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Q(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(` + +`);return!o||!s?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;let{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;let l=i.after();return l===void 0?!1:r.nodeAt(l)?t.commands.command(({tr:d})=>(d.setSelection(ue.near(r.resolve(l))),!0)):t.commands.exitCode()}}},addInputRules(){return[oa({find:c2,type:this.type,getAttributes:t=>({language:t[1]})}),oa({find:u2,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new ke({key:new ze("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;let n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i?.mode;if(!n||!o)return!1;let{tr:s,schema:l}=t.state,c=l.text(n.replace(/\r\n?/g,` +`));return s.replaceSelectionWith(this.type.create({language:o},c)),s.selection.$from.parent.type!==this.type&&s.setSelection(le.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}});function d2(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ex(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{let n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&Ex(n)}),t}var gu=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function vx(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Ti(t,...e){let n=Object.create(null);for(let r in t)n[r]=t[r];return e.forEach(function(r){for(let i in r)n[i]=r[i]}),n}var f2="",dx=t=>!!t.scope,p2=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){let n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`},em=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=vx(e)}openNode(e){if(!dx(e))return;let n=p2(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){dx(e)&&(this.buffer+=f2)}value(){return this.buffer}span(e){this.buffer+=``}},fx=(t={})=>{let e={children:[]};return Object.assign(e,t),e},tm=class t{constructor(){this.rootNode=fx(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n=fx({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{t._collapse(n)}))}},nm=class extends tm{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){let r=e.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new em(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function va(t){return t?typeof t=="string"?t:t.source:null}function wx(t){return bo("(?=",t,")")}function h2(t){return bo("(?:",t,")*")}function m2(t){return bo("(?:",t,")?")}function bo(...t){return t.map(n=>va(n)).join("")}function g2(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function im(...t){return"("+(g2(t).capture?"":"?:")+t.map(r=>va(r)).join("|")+")"}function xx(t){return new RegExp(t.toString()+"|").exec("").length-1}function b2(t,e){let n=t&&t.exec(e);return n&&n.index===0}var y2=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function om(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;let i=n,o=va(r),s="";for(;o.length>0;){let l=y2.exec(o);if(!l){s+=o;break}s+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?s+="\\"+String(Number(l[1])+i):(s+=l[0],l[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(e)}var E2=/\b\B/,_x="[a-zA-Z]\\w*",sm="[a-zA-Z_]\\w*",Sx="\\b\\d+(\\.\\d+)?",Tx="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Cx="\\b(0b[01]+)",v2="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",w2=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=bo(e,/.*\b/,t.binary,/\b.*/)),Ti({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},wa={begin:"\\\\[\\s\\S]",relevance:0},x2={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[wa]},_2={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[wa]},S2={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},yu=function(t,e,n={}){let r=Ti({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=im("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:bo(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},T2=yu("//","$"),C2=yu("/\\*","\\*/"),A2=yu("#","$"),M2={scope:"number",begin:Sx,relevance:0},N2={scope:"number",begin:Tx,relevance:0},k2={scope:"number",begin:Cx,relevance:0},O2={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[wa,{begin:/\[/,end:/\]/,relevance:0,contains:[wa]}]},R2={scope:"title",begin:_x,relevance:0},I2={scope:"title",begin:sm,relevance:0},D2={begin:"\\.\\s*"+sm,relevance:0},L2=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},mu=Object.freeze({__proto__:null,APOS_STRING_MODE:x2,BACKSLASH_ESCAPE:wa,BINARY_NUMBER_MODE:k2,BINARY_NUMBER_RE:Cx,COMMENT:yu,C_BLOCK_COMMENT_MODE:C2,C_LINE_COMMENT_MODE:T2,C_NUMBER_MODE:N2,C_NUMBER_RE:Tx,END_SAME_AS_BEGIN:L2,HASH_COMMENT_MODE:A2,IDENT_RE:_x,MATCH_NOTHING_RE:E2,METHOD_GUARD:D2,NUMBER_MODE:M2,NUMBER_RE:Sx,PHRASAL_WORDS_MODE:S2,QUOTE_STRING_MODE:_2,REGEXP_MODE:O2,RE_STARTERS_RE:v2,SHEBANG:w2,TITLE_MODE:R2,UNDERSCORE_IDENT_RE:sm,UNDERSCORE_TITLE_MODE:I2});function P2(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function B2(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function F2(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=P2,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function H2(t,e){Array.isArray(t.illegal)&&(t.illegal=im(...t.illegal))}function $2(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function z2(t,e){t.relevance===void 0&&(t.relevance=1)}var U2=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=bo(n.beforeMatch,wx(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},W2=["of","and","for","in","not","or","if","then","parent","list","value"],K2="keyword";function Ax(t,e,n=K2){let r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(o){Object.assign(r,Ax(t[o],e,o))}),r;function i(o,s){e&&(s=s.map(l=>l.toLowerCase())),s.forEach(function(l){let c=l.split("|");r[c[0]]=[o,V2(c[0],c[1])]})}}function V2(t,e){return e?Number(e):G2(t)?0:1}function G2(t){return W2.includes(t.toLowerCase())}var px={},go=t=>{console.error(t)},hx=(t,...e)=>{console.log(`WARN: ${t}`,...e)},ls=(t,e)=>{px[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),px[`${t}/${e}`]=!0)},bu=new Error;function Mx(t,e,{key:n}){let r=0,i=t[n],o={},s={};for(let l=1;l<=e.length;l++)s[l+r]=i[l],o[l+r]=!0,r+=xx(e[l-1]);t[n]=s,t[n]._emit=o,t[n]._multi=!0}function q2(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw go("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),bu;if(typeof t.beginScope!="object"||t.beginScope===null)throw go("beginScope must be object"),bu;Mx(t,t.begin,{key:"beginScope"}),t.begin=om(t.begin,{joinWith:""})}}function Y2(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw go("skip, excludeEnd, returnEnd not compatible with endScope: {}"),bu;if(typeof t.endScope!="object"||t.endScope===null)throw go("endScope must be object"),bu;Mx(t,t.end,{key:"endScope"}),t.end=om(t.end,{joinWith:""})}}function J2(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function X2(t){J2(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),q2(t),Y2(t)}function Z2(t){function e(s,l){return new RegExp(va(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=xx(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let l=this.regexes.map(c=>c[1]);this.matcherRe=e(om(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;let c=this.matcherRe.exec(l);if(!c)return null;let d=c.findIndex((h,m)=>m>0&&h!==void 0),f=this.matchIndexes[d];return c.splice(0,d),Object.assign(c,f)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];let c=new n;return this.rules.slice(l).forEach(([d,f])=>c.addRule(d,f)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){let c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let d=c.exec(l);if(this.resumingScanAtSamePosition()&&!(d&&d.index===this.lastIndex)){let f=this.getMatcher(0);f.lastIndex=this.lastIndex+1,d=f.exec(l)}return d&&(this.regexIndex+=d.position+1,this.regexIndex===this.count&&this.considerAll()),d}}function i(s){let l=new r;return s.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),s.terminatorEnd&&l.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&l.addRule(s.illegal,{type:"illegal"}),l}function o(s,l){let c=s;if(s.isCompiled)return c;[B2,$2,X2,U2].forEach(f=>f(s,l)),t.compilerExtensions.forEach(f=>f(s,l)),s.__beforeBegin=null,[F2,H2,z2].forEach(f=>f(s,l)),s.isCompiled=!0;let d=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),d=s.keywords.$pattern,delete s.keywords.$pattern),d=d||/\w+/,s.keywords&&(s.keywords=Ax(s.keywords,t.case_insensitive)),c.keywordPatternRe=e(d,!0),l&&(s.begin||(s.begin=/\B|\b/),c.beginRe=e(c.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(c.endRe=e(c.end)),c.terminatorEnd=va(c.end)||"",s.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(s.end?"|":"")+l.terminatorEnd)),s.illegal&&(c.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(f){return j2(f==="self"?s:f)})),s.contains.forEach(function(f){o(f,c)}),s.starts&&o(s.starts,l),c.matcher=i(c),c}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Ti(t.classNameAliases||{}),o(t)}function Nx(t){return t?t.endsWithParent||Nx(t.starts):!1}function j2(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Ti(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:Nx(t)?Ti(t,{starts:t.starts?Ti(t.starts):null}):Object.isFrozen(t)?Ti(t):t}var Q2="11.10.0",rm=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},Qh=vx,mx=Ti,gx=Symbol("nomatch"),eF=7,kx=function(t){let e=Object.create(null),n=Object.create(null),r=[],i=!0,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:nm};function c(A){return l.noHighlightRe.test(A)}function d(A){let R=A.className+" ";R+=A.parentNode?A.parentNode.className:"";let K=l.languageDetectRe.exec(R);if(K){let J=z(K[1]);return J||(hx(o.replace("{}",K[1])),hx("Falling back to no-highlight mode for this block.",A)),J?K[1]:"no-highlight"}return R.split(/\s+/).find(J=>c(J)||z(J))}function f(A,R,K){let J="",se="";typeof R=="object"?(J=A,K=R.ignoreIllegals,se=R.language):(ls("10.7.0","highlight(lang, code, ...args) has been deprecated."),ls("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),se=A,J=R),K===void 0&&(K=!0);let be={code:J,language:se};ge("before:highlight",be);let De=be.result?be.result:h(be.language,be.code,K);return De.code=be.code,ge("after:highlight",De),De}function h(A,R,K,J){let se=Object.create(null);function be(I,F){return I.keywords[F]}function De(){if(!V.keywords){we.addText(fe);return}let I=0;V.keywordPatternRe.lastIndex=0;let F=V.keywordPatternRe.exec(fe),X="";for(;F;){X+=fe.substring(I,F.index);let oe=Je.case_insensitive?F[0].toLowerCase():F[0],Fe=be(V,oe);if(Fe){let[rt,xr]=Fe;if(we.addText(X),X="",se[oe]=(se[oe]||0)+1,se[oe]<=eF&&(ct+=xr),rt.startsWith("_"))X+=F[0];else{let B=Je.classNameAliases[rt]||rt;Be(F[0],B)}}else X+=F[0];I=V.keywordPatternRe.lastIndex,F=V.keywordPatternRe.exec(fe)}X+=fe.substring(I),we.addText(X)}function je(){if(fe==="")return;let I=null;if(typeof V.subLanguage=="string"){if(!e[V.subLanguage]){we.addText(fe);return}I=h(V.subLanguage,fe,!0,bt[V.subLanguage]),bt[V.subLanguage]=I._top}else I=y(fe,V.subLanguage.length?V.subLanguage:null);V.relevance>0&&(ct+=I.relevance),we.__addSublanguage(I._emitter,I.language)}function Me(){V.subLanguage!=null?je():De(),fe=""}function Be(I,F){I!==""&&(we.startScope(F),we.addText(I),we.endScope())}function wt(I,F){let X=1,oe=F.length-1;for(;X<=oe;){if(!I._emit[X]){X++;continue}let Fe=Je.classNameAliases[I[X]]||I[X],rt=F[X];Fe?Be(rt,Fe):(fe=rt,De(),fe=""),X++}}function Nt(I,F){return I.scope&&typeof I.scope=="string"&&we.openNode(Je.classNameAliases[I.scope]||I.scope),I.beginScope&&(I.beginScope._wrap?(Be(fe,Je.classNameAliases[I.beginScope._wrap]||I.beginScope._wrap),fe=""):I.beginScope._multi&&(wt(I.beginScope,F),fe="")),V=Object.create(I,{parent:{value:V}}),V}function Oe(I,F,X){let oe=b2(I.endRe,X);if(oe){if(I["on:end"]){let Fe=new gu(I);I["on:end"](F,Fe),Fe.isMatchIgnored&&(oe=!1)}if(oe){for(;I.endsParent&&I.parent;)I=I.parent;return I}}if(I.endsWithParent)return Oe(I.parent,F,X)}function xt(I){return V.matcher.regexIndex===0?(fe+=I[0],1):(kt=!0,0)}function Jt(I){let F=I[0],X=I.rule,oe=new gu(X),Fe=[X.__beforeBegin,X["on:begin"]];for(let rt of Fe)if(rt&&(rt(I,oe),oe.isMatchIgnored))return xt(F);return X.skip?fe+=F:(X.excludeBegin&&(fe+=F),Me(),!X.returnBegin&&!X.excludeBegin&&(fe=F)),Nt(X,I),X.returnBegin?0:F.length}function pt(I){let F=I[0],X=R.substring(I.index),oe=Oe(V,I,X);if(!oe)return gx;let Fe=V;V.endScope&&V.endScope._wrap?(Me(),Be(F,V.endScope._wrap)):V.endScope&&V.endScope._multi?(Me(),wt(V.endScope,I)):Fe.skip?fe+=F:(Fe.returnEnd||Fe.excludeEnd||(fe+=F),Me(),Fe.excludeEnd&&(fe=F));do V.scope&&we.closeNode(),!V.skip&&!V.subLanguage&&(ct+=V.relevance),V=V.parent;while(V!==oe.parent);return oe.starts&&Nt(oe.starts,I),Fe.returnEnd?0:F.length}function sn(){let I=[];for(let F=V;F!==Je;F=F.parent)F.scope&&I.unshift(F.scope);I.forEach(F=>we.openNode(F))}let Xt={};function _t(I,F){let X=F&&F[0];if(fe+=I,X==null)return Me(),0;if(Xt.type==="begin"&&F.type==="end"&&Xt.index===F.index&&X===""){if(fe+=R.slice(F.index,F.index+1),!i){let oe=new Error(`0 width match regex (${A})`);throw oe.languageName=A,oe.badRule=Xt.rule,oe}return 1}if(Xt=F,F.type==="begin")return Jt(F);if(F.type==="illegal"&&!K){let oe=new Error('Illegal lexeme "'+X+'" for mode "'+(V.scope||"")+'"');throw oe.mode=V,oe}else if(F.type==="end"){let oe=pt(F);if(oe!==gx)return oe}if(F.type==="illegal"&&X==="")return 1;if(Pt>1e5&&Pt>F.index*3)throw new Error("potential infinite loop, way more iterations than matches");return fe+=X,X.length}let Je=z(A);if(!Je)throw go(o.replace("{}",A)),new Error('Unknown language: "'+A+'"');let Xn=Z2(Je),Lt="",V=J||Xn,bt={},we=new l.__emitter(l);sn();let fe="",ct=0,ut=0,Pt=0,kt=!1;try{if(Je.__emitTokens)Je.__emitTokens(R,we);else{for(V.matcher.considerAll();;){Pt++,kt?kt=!1:V.matcher.considerAll(),V.matcher.lastIndex=ut;let I=V.matcher.exec(R);if(!I)break;let F=R.substring(ut,I.index),X=_t(F,I);ut=I.index+X}_t(R.substring(ut))}return we.finalize(),Lt=we.toHTML(),{language:A,value:Lt,relevance:ct,illegal:!1,_emitter:we,_top:V}}catch(I){if(I.message&&I.message.includes("Illegal"))return{language:A,value:Qh(R),illegal:!0,relevance:0,_illegalBy:{message:I.message,index:ut,context:R.slice(ut-100,ut+100),mode:I.mode,resultSoFar:Lt},_emitter:we};if(i)return{language:A,value:Qh(R),illegal:!1,relevance:0,errorRaised:I,_emitter:we,_top:V};throw I}}function m(A){let R={value:Qh(A),illegal:!1,relevance:0,_top:s,_emitter:new l.__emitter(l)};return R._emitter.addText(A),R}function y(A,R){R=R||l.languages||Object.keys(e);let K=m(A),J=R.filter(z).filter(he).map(Me=>h(Me,A,!1));J.unshift(K);let se=J.sort((Me,Be)=>{if(Me.relevance!==Be.relevance)return Be.relevance-Me.relevance;if(Me.language&&Be.language){if(z(Me.language).supersetOf===Be.language)return 1;if(z(Be.language).supersetOf===Me.language)return-1}return 0}),[be,De]=se,je=be;return je.secondBest=De,je}function b(A,R,K){let J=R&&n[R]||K;A.classList.add("hljs"),A.classList.add(`language-${J}`)}function w(A){let R=null,K=d(A);if(c(K))return;if(ge("before:highlightElement",{el:A,language:K}),A.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",A);return}if(A.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(A)),l.throwUnescapedHTML))throw new rm("One of your code blocks includes unescaped HTML.",A.innerHTML);R=A;let J=R.textContent,se=K?f(J,{language:K,ignoreIllegals:!0}):y(J);A.innerHTML=se.value,A.dataset.highlighted="yes",b(A,K,se.language),A.result={language:se.language,re:se.relevance,relevance:se.relevance},se.secondBest&&(A.secondBest={language:se.secondBest.language,relevance:se.secondBest.relevance}),ge("after:highlightElement",{el:A,result:se,text:J})}function _(A){l=mx(l,A)}let S=()=>{T(),ls("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function L(){T(),ls("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let D=!1;function T(){if(document.readyState==="loading"){D=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function $(){D&&T()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",$,!1);function O(A,R){let K=null;try{K=R(t)}catch(J){if(go("Language definition for '{}' could not be registered.".replace("{}",A)),i)go(J);else throw J;K=s}K.name||(K.name=A),e[A]=K,K.rawDefinition=R.bind(null,t),K.aliases&&re(K.aliases,{languageName:A})}function Y(A){delete e[A];for(let R of Object.keys(n))n[R]===A&&delete n[R]}function ee(){return Object.keys(e)}function z(A){return A=(A||"").toLowerCase(),e[A]||e[n[A]]}function re(A,{languageName:R}){typeof A=="string"&&(A=[A]),A.forEach(K=>{n[K.toLowerCase()]=R})}function he(A){let R=z(A);return R&&!R.disableAutodetect}function Se(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=R=>{A["before:highlightBlock"](Object.assign({block:R.el},R))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=R=>{A["after:highlightBlock"](Object.assign({block:R.el},R))})}function me(A){Se(A),r.push(A)}function Ce(A){let R=r.indexOf(A);R!==-1&&r.splice(R,1)}function ge(A,R){let K=A;r.forEach(function(J){J[K]&&J[K](R)})}function _e(A){return ls("10.7.0","highlightBlock will be removed entirely in v12.0"),ls("10.7.0","Please use highlightElement now."),w(A)}Object.assign(t,{highlight:f,highlightAuto:y,highlightAll:T,highlightElement:w,highlightBlock:_e,configure:_,initHighlighting:S,initHighlightingOnLoad:L,registerLanguage:O,unregisterLanguage:Y,listLanguages:ee,getLanguage:z,registerAliases:re,autoDetection:he,inherit:mx,addPlugin:me,removePlugin:Ce}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=Q2,t.regex={concat:bo,lookahead:wx,either:im,optional:m2,anyNumberOfTimes:h2};for(let A in mu)typeof mu[A]=="object"&&Ex(mu[A]);return Object.assign(t,mu),t},cs=kx({});cs.newInstance=()=>kx({});var tF=cs;cs.HighlightJS=cs;cs.default=cs;var nF=d2(tF);function Ox(t,e=[]){return t.map(n=>{let r=[...e,...n.properties?n.properties.className:[]];return n.children?Ox(n.children,r):{text:n.value,classes:r}}).flat()}function bx(t){return t.value||t.children||[]}function rF(t){return!!nF.getLanguage(t)}function yx({doc:t,name:e,lowlight:n,defaultLanguage:r}){let i=[];return Qi(t,o=>o.type.name===e).forEach(o=>{var s;let l=o.pos+1,c=o.node.attrs.language||r,d=n.listLanguages(),f=c&&(d.includes(c)||rF(c)||!((s=n.registered)===null||s===void 0)&&s.call(n,c))?bx(n.highlight(c,o.node.textContent)):bx(n.highlightAuto(o.node.textContent));Ox(f).forEach(h=>{let m=l+h.text.length;if(h.classes.length){let y=Tt.inline(l,m,{class:h.classes.join(" ")});i.push(y)}l=m})}),ot.create(t,i)}function iF(t){return typeof t=="function"}function oF({name:t,lowlight:e,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(i=>iF(e[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");let r=new ke({key:new ze("lowlight"),state:{init:(i,{doc:o})=>yx({doc:o,name:t,lowlight:e,defaultLanguage:n}),apply:(i,o,s,l)=>{let c=s.selection.$head.parent.type.name,d=l.selection.$head.parent.type.name,f=Qi(s.doc,m=>m.type.name===t),h=Qi(l.doc,m=>m.type.name===t);return i.docChanged&&([c,d].includes(t)||h.length!==f.length||i.steps.some(m=>m.from!==void 0&&m.to!==void 0&&f.some(y=>y.pos>=m.from&&y.pos+y.node.nodeSize<=m.to)))?yx({doc:i.doc,name:t,lowlight:e,defaultLanguage:n}):o.map(i.mapping,i.doc)}},props:{decorations(i){return r.getState(i)}}});return r}var Rx=ux.extend({addOptions(){var t;return{...(t=this.parent)===null||t===void 0?void 0:t.call(this),lowlight:{}}},addProseMirrorPlugins(){var t;return[...((t=this.parent)===null||t===void 0?void 0:t.call(this))||[],oF({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});var am=Rx.extend({addKeyboardShortcuts(){return{...this.parent?.(),ArrowDown:()=>{let t=this.editor.state,{from:e,to:n}=t.selection;if(e>1&&e===n){let r=!1;t.doc.nodesBetween(e-1,n-1,o=>{o.type.name==="codeBlock"&&(r=!0)});let i=!0;if(t.doc.nodesBetween(e+1,n+1,o=>{o&&(i=!1)}),r&&i)return this.editor.commands.setHardBreak()}return!1}}}});var lm=ce.create({name:"hurdle",group:"block",content:"block+",addOptions(){return{colors:["gray_light","gray","gray_dark","primary","secondary","tertiary","accent"],HTMLAttributes:{class:"filament-tiptap-hurdle"}}},addAttributes(){return{color:{default:"gray",parseHTML:t=>t.getAttribute("data-color"),renderHTML:t=>({"data-color":t.color})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-hurdle")}]},renderHTML({node:t,HTMLAttributes:e}){return["div",Q(this.options.HTMLAttributes,e),0]},addCommands(){return{setHurdle:t=>({commands:e})=>this.options.colors.includes(t.color)?e.toggleWrap(this.name,t):!1}}});var cm=We.create({name:"textAlign",addOptions(){return{types:[],alignments:["start","center","end","justify"],defaultAlignment:"start"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>t.style.textAlign||this.options.defaultAlignment,renderHTML:t=>t.style&&t.style.includes("text-align")?{}:t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.every(n=>e.updateAttributes(n,{textAlign:t})):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("start"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("end"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});function Eu(t,e,n=null){return n?t.createChecked({"data-col-span":e},n):t.createAndFill({"data-col-span":e})}function Ix(t){if(t.cached.gridBuilderNodeTypes)return t.cached.gridBuilderNodeTypes;let e={};return Object.keys(t.nodes).forEach(n=>{let r=t.nodes[n];r.spec.gridBuilderRole&&(e[r.spec.gridBuilderRole]=r)}),t.cached.gridBuilderNodeTypes=e,e}function Dx(t,e,n,r,i,o,s){let l=Ix(t),c=[];if(n==="asymmetric")c.push(Eu(l.builderColumn,i,s)),c.push(Eu(l.builderColumn,o,s));else for(let d=0;dt.getAttribute("data-type")},"data-cols":{default:2,parseHTML:t=>t.getAttribute("data-cols")},"data-stack-at":{default:"md",parseHTML:t=>t.getAttribute("data-stack-at")},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`grid-template-columns: repeat(${t["data-cols"]}, 1fr);`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid-builder")&&null}]},renderHTML({HTMLAttributes:t}){return["div",Q(this.options.HTMLAttributes,t),0]},addCommands(){return{insertGridBuilder:({cols:t=3,type:e="responsive",stackAt:n,asymmetricLeft:r=null,asymmetricRight:i=null}={})=>({tr:o,dispatch:s,editor:l})=>{let c=Dx(l.schema,t,e,n,r,i);if(s){let d=o.selection.anchor+1;o.replaceSelectionWith(c).scrollIntoView().setSelection(le.near(o.doc.resolve(d)))}return!0}}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertGridBuilder()}},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{gridBuilderRole:Te(ne(t,"gridBuilderRole",e))}}});var dm=ce.create({name:"gridBuilderColumn",content:"block+",gridBuilderRole:"builderColumn",isolating:!0,addOptions(){return{HTMLAttributes:{class:"filament-tiptap-grid-builder__column"}}},addAttributes(){return{"data-col-span":{default:1,parseHTML:t=>t.getAttribute("data-col-span")},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`grid-column: span ${t["data-col-span"]};`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid-builder__column")&&null}]},renderHTML({HTMLAttributes:t}){return["div",Q(this.options.HTMLAttributes,t),0]}});var fm=We.create({name:"dragAndDrop",addProseMirrorPlugins(t){return[new ke({props:{handleDrop(e,n){if(!n)return!1;n.preventDefault();let r=e.posAtCoords({left:n.clientX,top:n.clientY});return n.dataTransfer.getData("block")?(n.target.dispatchEvent(new CustomEvent("dragged-block",{detail:{type:n.dataTransfer.getData("block"),coordinates:r},bubbles:!0})),!1):(n.dataTransfer.getData("mergeTag")&&n.target.dispatchEvent(new CustomEvent("dragged-merge-tag",{detail:{tag:n.dataTransfer.getData("mergeTag"),coordinates:r},bubbles:!0})),!1)}}})]}});var pm=ce.create({name:"tiptapBlock",group:"block",atom:!0,defining:!0,draggable:!0,selectable:!0,isolating:!0,allowGapCursor:!0,inline:!1,addAttributes(){return{preview:{default:null,parseHTML:t=>t.getAttribute("data-preview"),renderHTML:t=>t.preview?{"data-preview":t.preview}:null},statePath:{default:null,parseHTML:t=>t.getAttribute("data-state-path"),renderHTML:t=>t.statePath?{"data-state-path":t.statePath}:null},type:{default:null,parseHTML:t=>t.getAttribute("data-type"),renderHTML:t=>t.type?{"data-type":t.type}:null},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:null},data:{default:null,parseHTML:t=>t.getAttribute("data-data"),renderHTML:t=>t.data?{"data-data":JSON.stringify(t.data)}:null}}},parseHTML(){return[{tag:"tiptap-block"}]},renderHTML({HTMLAttributes:t}){return["tiptap-block",Q(t)]},addNodeView(){return({editor:t,node:e,getPos:n})=>{let r=document.createElement("div");r.contentEditable="false",r.classList.add("tiptap-block-wrapper");let i=typeof e.attrs.data=="object"?JSON.stringify(e.attrs.data):e.attrs.data;return r.innerHTML=` +
+
+

${e.attrs.label}

+
+ + +
+
+
+ ${e.attrs.preview} +
+
+ `,{dom:r}}},addCommands(){return{insertBlock:t=>({chain:e,state:n})=>{let r=e();if(![null,void 0].includes(t.coordinates?.pos))return r.insertContentAt({from:t.coordinates.pos,to:t.coordinates.pos},{type:this.name,attrs:t}),r.setTextSelection(t.coordinates.pos);let{selection:i}=n,{$from:o,$to:s}=i,l=o.blockRange(s);return l?(s.parentOffset===0?r.insertContentAt(Math.max(s.pos-1,0),{type:this.name,attrs:t}):r.insertContentAt({from:l.start,to:l.end},{type:this.name,attrs:t}),r.setTextSelection(l.end)):(s.parentOffset===0?r.insertContentAt(Math.max(s.pos-1,0),{type:"paragraph"}).insertContentAt({from:o.pos,to:s.pos},{type:this.name,attrs:t}):r.setNode({type:"paragraph"}).insertContentAt({from:o.pos,to:s.pos},{type:this.name,attrs:t}),r.setTextSelection(s.pos+1))},updateBlock:t=>({commands:e,chain:n,state:r})=>{let{selection:i}=r,{$from:o,$to:s}=i,l=o.blockRange(s),c=n();return l?(c.insertContentAt({from:l.start,to:l.end},{type:this.name,attrs:t}),c.focus(l.end+1)):t.coordinates?(c.insertContentAt({from:t.coordinates,to:t.coordinates+1},{type:this.name,attrs:t}),!1):(c.insertContentAt({from:o.pos,to:o.pos+1},{type:this.name,attrs:t}),!1)},removeBlock:()=>({commands:t})=>t.deleteSelection()}}});function sF(t){var e;let{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:s}=t,l=qE(n),c=new RegExp(`\\s${l}$`),d=o?"^":"",f=r?new RegExp(`${d}${l}.*?(?=\\s${l}|$)`,"gm"):new RegExp(`${d}(?:^)?${l}[^\\s${l}]*`,"gm"),h=((e=s.nodeBefore)===null||e===void 0?void 0:e.isText)&&s.nodeBefore.text;if(!h)return null;let m=s.pos-h.length,y=Array.from(h.matchAll(f)).pop();if(!y||y.input===void 0||y.index===void 0)return null;let b=y.input.slice(Math.max(0,y.index-1),y.index),w=new RegExp(`^[${i?.join("")}\0]?$`).test(b);if(i!==null&&!w)return null;let _=m+y.index,S=_+y[0].length;return r&&c.test(h.slice(S-1,S+1))&&(y[0]+=" ",S+=1),_=s.pos?{range:{from:_,to:S},query:y[0].slice(n.length),text:y[0]}:null}var aF=new ze("suggestion");function Lx({pluginKey:t=aF,editor:e,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:s="span",decorationClass:l="suggestion",command:c=()=>null,items:d=()=>[],render:f=()=>({}),allow:h=()=>!0,findSuggestionMatch:m=sF}){let y,b=f?.(),w=new ke({key:t,view(){return{update:async(_,S)=>{var L,D,T,$,O,Y,ee;let z=(L=this.key)===null||L===void 0?void 0:L.getState(S),re=(D=this.key)===null||D===void 0?void 0:D.getState(_.state),he=z.active&&re.active&&z.range.from!==re.range.from,Se=!z.active&&re.active,me=z.active&&!re.active,Ce=!Se&&!me&&z.query!==re.query,ge=Se||he&&Ce,_e=Ce||he,A=me||he&&Ce;if(!ge&&!_e&&!A)return;let R=A&&!ge?z:re,K=_.dom.querySelector(`[data-decoration-id="${R.decorationId}"]`);y={editor:e,range:R.range,query:R.query,text:R.text,items:[],command:J=>c({editor:e,range:R.range,props:J}),decorationNode:K,clientRect:K?()=>{var J;let{decorationId:se}=(J=this.key)===null||J===void 0?void 0:J.getState(e.state),be=_.dom.querySelector(`[data-decoration-id="${se}"]`);return be?.getBoundingClientRect()||null}:null},ge&&((T=b?.onBeforeStart)===null||T===void 0||T.call(b,y)),_e&&(($=b?.onBeforeUpdate)===null||$===void 0||$.call(b,y)),(_e||ge)&&(y.items=await d({editor:e,query:R.query})),A&&((O=b?.onExit)===null||O===void 0||O.call(b,y)),_e&&((Y=b?.onUpdate)===null||Y===void 0||Y.call(b,y)),ge&&((ee=b?.onStart)===null||ee===void 0||ee.call(b,y))},destroy:()=>{var _;y&&((_=b?.onExit)===null||_===void 0||_.call(b,y))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(_,S,L,D){let{isEditable:T}=e,{composing:$}=e.view,{selection:O}=_,{empty:Y,from:ee}=O,z={...S};if(z.composing=$,T&&(Y||e.view.composing)){(eeS.range.to)&&!$&&!S.composing&&(z.active=!1);let re=m({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:O.$from}),he=`id_${Math.floor(Math.random()*4294967295)}`;re&&h({editor:e,state:D,range:re.range,isActive:S.active})?(z.active=!0,z.decorationId=S.decorationId?S.decorationId:he,z.range=re.range,z.query=re.query,z.text=re.text):z.active=!1}else z.active=!1;return z.active||(z.decorationId=null,z.range={from:0,to:0},z.query=null,z.text=null),z}},props:{handleKeyDown(_,S){var L;let{active:D,range:T}=w.getState(_.state);return D&&((L=b?.onKeyDown)===null||L===void 0?void 0:L.call(b,{view:_,event:S,range:T}))||!1},decorations(_){let{active:S,range:L,decorationId:D}=w.getState(_);return S?ot.create(_.doc,[Tt.inline(L.from,L.to,{nodeName:s,class:l,"data-decoration-id":D})]):null}}});return w}var lF=new ze("mergeTag"),hm=ce.create({name:"mergeTag",group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}}}},parseHTML(){return[{tag:`span[data-type='${this.name}']`}]},renderHTML({node:t,HTMLAttributes:e}){return["span",Q({"data-type":this.name},e),`{{ ${t.attrs.id} }}`]},renderText({node:t}){return`{{ ${t.attrs.id} }}`},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1,{selection:r}=e,{empty:i,anchor:o}=r;return i?(e.doc.nodesBetween(o-1,o,(s,l)=>{if(s.type.name===this.name)return n=!0,t.insertText("{{",l,l+s.nodeSize),!1}),n):!1})}},addCommands(){return{insertMergeTag:t=>({chain:e,state:n})=>{let r=e();if(![null,void 0].includes(t.coordinates?.pos))return r.insertContentAt({from:t.coordinates.pos,to:t.coordinates.pos},[{type:this.name,attrs:{id:t.tag}},{type:"text",text:" "}]),r}}},addProseMirrorPlugins(){return[Lx({editor:this.editor,char:"{{",items:({query:t})=>this.options.mergeTags.filter(e=>e.toLowerCase().startsWith(t.toLowerCase())).slice(0,5),pluginKey:lF,command:({editor:t,range:e,props:n})=>{t.view.state.selection.$to.nodeAfter?.text?.startsWith(" ")&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),window.getSelection()?.collapseToEnd()},allow:({state:t,range:e})=>{let n=t.doc.resolve(e.from),r=t.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(r)},render:()=>{let t,e;return{onStart:n=>{if(!n.clientRect)return;let r=` +
this.onKeyDown(event.detail), + ); + + this.$el.parentElement.addEventListener( + 'merge-tags-update-items', + (event) => (items = event.detail), + ); + }, + + onKeyDown: function (event) { + if (event.key === 'ArrowUp') { + event.preventDefault(); + this.selectedIndex = ((this.selectedIndex + this.items.length) - 1) % this.items.length; + + return true; + }; + + if (event.key === 'ArrowDown') { + event.preventDefault(); + this.selectedIndex = (this.selectedIndex + 1) % this.items.length; + + return true; + }; + + if (event.key === 'Enter') { + event.preventDefault(); + this.selectItem(this.selectedIndex); + + return true; + }; + + return false; + }, + + selectItem: function (index) { + const item = this.items[index]; + + if (! item) { + return; + }; + + $el.parentElement.dispatchEvent(new CustomEvent('merge-tags-select', { detail: { item } })); + }, + + }" + class="tippy-content-p-0" + > + +
+ `;t=document.createElement("div"),t.innerHTML=r,t.addEventListener("merge-tags-select",i=>{n.command({id:i.detail.item})}),e=rs("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t,allowHTML:!0,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate(n){if(!n.items.length){e[0].hide();return}e[0].show(),t.dispatchEvent(new CustomEvent("merge-tags-update-items",{detail:n.items}))},onKeyDown(n){t.dispatchEvent(new CustomEvent("merge-tags-key-down",{detail:n.event}))},onExit(){e[0].destroy()}}}})]}});var mm=We.create({name:"classExtension",addGlobalAttributes(){return[{types:["heading","paragraph","link","image","listItem","bulletList","orderedList","table","tableHeader","tableRow","tableCell","textStyle"],attributes:{class:{default:null,parseHTML:t=>t.getAttribute("class")??null,renderHTML:t=>t.class?{class:t.class}:null}}}]}});var gm=We.create({name:"idExtension",addGlobalAttributes(){return[{types:["heading","link"],attributes:{id:{default:null,parseHTML:t=>t.getAttribute("id")??null,renderHTML:t=>t.id?{id:t.id}:null}}}]}});var bm=We.create({name:"styleExtension",addGlobalAttributes(){return[{types:["heading","paragraph","link","image","listItem","bulletList","orderedList","table","tableHeader","tableRow","tableCell","textStyle"],attributes:{style:{default:null,parseHTML:t=>t.getAttribute("style")??null,renderHTML:t=>t.style?{style:t.style}:null}}}]}});var ym=We.create({name:"statePath",addOptions(){return{statePath:null}},addStorage(){return{statePath:null}},onBeforeCreate(){this.storage.statePath=this.options.statePath},addCommands(){return{getStatePath:()=>()=>this.storage.statePath}}});function cF(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},y=e.optional(i)+t.IDENT_RE+"\\s*\\(",b=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],w=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],_=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],S=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],T={type:w,keyword:b,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:_},$={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},O=[$,h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],Y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:T,contains:O.concat([{begin:/\(/,end:/\)/,keywords:T,contains:O.concat(["self"]),relevance:0}]),relevance:0},ee={className:"function",begin:"("+s+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:T,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:T,relevance:0},{begin:y,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,h]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:T,illegal:"",keywords:T,contains:["self",l]},{begin:t.IDENT_RE+"::",keywords:T},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Px(t){let e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=cF(t),r=n.keywords;return r.type=[...r.type,...e.type],r.literal=[...r.literal,...e.literal],r.built_in=[...r.built_in,...e.built_in],r._hints=e._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function Bx(t){let e=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});let i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let l={className:"",begin:/\\"/},c={className:"string",begin:/'/,end:/'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=t.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},y=["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"],b=["true","false"],w={match:/(\/[a-z._-]+)+/},_=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias"],L=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],D=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:y,literal:b,built_in:[..._,...S,"set","shopt",...L,...D]},contains:[h,t.SHEBANG(),m,d,t.HASH_COMMENT_MODE,o,w,s,l,c,n]}}function Fx(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},y=e.optional(i)+t.IDENT_RE+"\\s*\\(",_={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},S=[h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],L={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:S.concat([{begin:/\(/,end:/\)/,keywords:_,contains:S.concat(["self"]),relevance:0}]),relevance:0},D={begin:"("+s+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:_,relevance:0},{begin:y,returnBegin:!0,contains:[t.inherit(m,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,h]};return{name:"C",aliases:["h"],keywords:_,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:h,strings:d,keywords:_}}}function Hx(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},y=e.optional(i)+t.IDENT_RE+"\\s*\\(",b=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],w=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],_=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],S=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],T={type:w,keyword:b,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:_},$={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},O=[$,h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],Y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:T,contains:O.concat([{begin:/\(/,end:/\)/,keywords:T,contains:O.concat(["self"]),relevance:0}]),relevance:0},ee={className:"function",begin:"("+s+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:T,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:T,relevance:0},{begin:y,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,h]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:T,illegal:"",keywords:T,contains:["self",l]},{begin:t.IDENT_RE+"::",keywords:T},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function $x(t){let e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],o=["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:i.concat(o),built_in:e,literal:r},l=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=t.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:s},m=t.inherit(h,{illegal:/\n/}),y={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,m]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},w=t.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});h.contains=[b,y,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,c,t.C_BLOCK_COMMENT_MODE],m.contains=[w,y,f,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,c,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let _={variants:[b,y,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},S={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},L=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",D={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},_,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,S,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,S,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+L+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,S],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[_,c,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},D]}}var uF=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),dF=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],fF=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],pF=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],hF=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],mF=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function zx(t){let e=t.regex,n=uF(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",o=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",l=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+pF.join("|")+")"},{begin:":(:)?("+hF.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+mF.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:fF.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+dF.join("|")+")\\b"}]}}function Ux(t){let e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Wx(t){let o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"qx(t,e,n-1))}function Yx(t){let e=t.regex,n="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",r=n+qx("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},d={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},f={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[f,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Gx,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Gx,d]}}var Jx="[A-Za-z$_][0-9A-Za-z$_]*",gF=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],bF=["true","false","null","undefined","NaN","Infinity"],Xx=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Zx=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],jx=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],yF=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],EF=[].concat(jx,Xx,Zx);function Qx(t){let e=t.regex,n=(R,{after:K})=>{let J="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(R,K)=>{let J=R[0].length+R.index,se=R.input[J];if(se==="<"||se===","){K.ignoreMatch();return}se===">"&&(n(R,{after:J})||K.ignoreMatch());let be,De=R.input.substring(J);if(be=De.match(/^\s*=/)){K.ignoreMatch();return}if((be=De.match(/^\s+extends\s+/))&&be.index===0){K.ignoreMatch();return}}},l={$pattern:Jx,keyword:gF,literal:bF,built_in:EF,"variable.language":yF},c="[0-9](_?[0-9])*",d=`\\.(${c})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${f})((${d})|\\.)?|(${d}))[eE][+-]?(${c})\\b`},{begin:`\\b(${f})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},y={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},b={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"css"}},w={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},_={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,m]},L={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},D=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,y,b,w,_,{match:/\$\d+/},h];m.contains=D.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(D)});let T=[].concat(L,m.contains),$=T.concat([{begin:/\(/,end:/\)/,keywords:l,contains:["self"].concat(T)}]),O={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:$},Y={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ee={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Xx,...Zx]}},z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},re={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},he={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Se(R){return e.concat("(?!",R.join("|"),")")}let me={match:e.concat(/\b/,Se([...jx,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},Ce={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ge={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},_e="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(_e)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:$,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),z,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,y,b,w,_,L,{match:/\$\d+/},h,ee,{className:"attr",begin:r+e.lookahead(":"),relevance:0},A,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[L,t.REGEXP_MODE,{className:"function",begin:_e,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:$}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},re,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[O,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Ce,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},me,he,Y,ge,{match:/\$[(.]/}]}}function e_(t){let e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",keywords:{literal:r},contains:[e,n,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var ds="[0-9](_*[0-9])*",xu=`\\.(${ds})`,_u="[0-9a-fA-F](_*[0-9a-fA-F])*",vF={className:"number",variants:[{begin:`(\\b(${ds})((${xu})|\\.)?|(${xu}))[eE][+-]?(${ds})[fFdD]?\\b`},{begin:`\\b(${ds})((${xu})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${xu})[fFdD]?\\b`},{begin:`\\b(${ds})[fFdD]\\b`},{begin:`\\b0[xX]((${_u})\\.?|(${_u})?\\.(${_u}))[pP][+-]?(${ds})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${_u})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function t_(t){let e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,i]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,o,i]}]};i.contains.push(s);let l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},c={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(s,{className:"string"}),"self"]}]},d=vF,f=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),h={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},m=h;return m.variants[1].contains=[h],h.variants[1].contains=[m],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,f,n,r,l,c,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[h,t.C_LINE_COMMENT_MODE,f],relevance:0},t.C_LINE_COMMENT_MODE,f,l,c,s,t.C_NUMBER_MODE]},f]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,c]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},d]}}var wF=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),xF=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],_F=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],n_=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],r_=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],SF=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),TF=n_.concat(r_);function i_(t){let e=wF(t),n=TF,r="and or not only",i="[\\w-]+",o="("+i+"|@\\{"+i+"\\})",s=[],l=[],c=function(D){return{className:"string",begin:"~?"+D+".*?"+D}},d=function(D,T,$){return{className:D,begin:T,relevance:$}},f={$pattern:/[a-z-]+/,keyword:r,attribute:_F.join(" ")},h={begin:"\\(",end:"\\)",contains:l,keywords:f,relevance:0};l.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,c("'"),c('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,h,d("variable","@@?"+i,10),d("variable","@\\{"+i+"\\}"),d("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);let m=l.concat({begin:/\{/,end:/\}/,contains:s}),y={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},b={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+SF.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},w={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:f,returnEnd:!0,contains:l,relevance:0}},_={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:m}},S={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,y,d("keyword","all\\b"),d("variable","@\\{"+i+"\\}"),{begin:"\\b("+xF.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,d("selector-tag",o,0),d("selector-id","#"+o),d("selector-class","\\."+o,0),d("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+n_.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+r_.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:m},{begin:"!important"},e.FUNCTION_DISPATCH]},L={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[S]};return s.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,w,_,L,b,S,y,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function o_(t){let e="\\[=*\\[",n="\\]=*\\]",r={begin:e,end:n,contains:["self"]},i=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[r],relevance:10})];return{name:"Lua",keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[r],relevance:5}])}}function s_(t){let e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},d={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},f={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},h=t.inherit(d,{contains:[]}),m=t.inherit(f,{contains:[]});d.contains.push(m),f.contains.push(h);let y=[n,c];return[d,f,h,m].forEach(_=>{_.contains=_.contains.concat(y)}),y=y.concat(d,f),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:y},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:y}]}]},n,o,d,f,{className:"quote",begin:"^>\\s+",contains:y,end:"$"},i,r,c,s]}}function l_(t){let e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},c={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+c.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:c,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function c_(t){let e=t.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},s={begin:/->\{/,end:/\}/},l={variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},c=[t.BACKSLASH_ESCAPE,o,l],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(y,b,w="\\1")=>{let _=w==="\\1"?w:e.concat(w,b);return e.concat(e.concat("(?:",y,")"),b,/(?:\\.|[^\\\/])*?/,_,/(?:\\.|[^\\\/])*?/,w,r)},h=(y,b,w)=>e.concat(e.concat("(?:",y,")"),b,/(?:\\.|[^\\\/])*?/,w,r),m=[l,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:c,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:f("s|tr|y",e.either(...d,{capture:!0}))},{begin:f("s|tr|y","\\(","\\)")},{begin:f("s|tr|y","\\[","\\]")},{begin:f("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:h("(?:m|qr)?",/\//,/\//)},{begin:h("m|qr",e.either(...d,{capture:!0}),/\1/)},{begin:h("m|qr",/\(/,/\)/)},{begin:h("m|qr",/\[/,/\]/)},{begin:h("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=m,s.contains=m,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:m}}function u_(t){let e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o={scope:"variable",match:"\\$+"+r},s={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=t.inherit(t.APOS_STRING_MODE,{illegal:null}),d=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(l)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(me,Ce)=>{Ce.data._beginMatch=me[1]||me[2]},"on:end":(me,Ce)=>{Ce.data._beginMatch!==me[1]&&Ce.ignoreMatch()}},h=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),m=`[ +]`,y={scope:"string",variants:[d,c,f,h]},b={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},w=["false","null","true"],_=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],S=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],D={keyword:_,literal:(me=>{let Ce=[];return me.forEach(ge=>{Ce.push(ge),ge.toLowerCase()===ge?Ce.push(ge.toUpperCase()):Ce.push(ge.toLowerCase())}),Ce})(w),built_in:S},T=me=>me.map(Ce=>Ce.replace(/\|\d+$/,"")),$={variants:[{match:[/new/,e.concat(m,"+"),e.concat("(?!",T(S).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},O=e.concat(r,"\\b(?!\\()"),Y={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),O],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),O],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},ee={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},z={relevance:0,begin:/\(/,end:/\)/,keywords:D,contains:[ee,o,Y,t.C_BLOCK_COMMENT_MODE,y,b,$]},re={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",T(_).join("\\b|"),"|",T(S).join("\\b|"),"\\b)"),r,e.concat(m,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[z]};z.contains.push(re);let he=[ee,Y,t.C_BLOCK_COMMENT_MODE,y,b,$],Se={begin:e.concat(/#\[\s*/,i),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:w,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:w,keyword:["new","array"]},contains:["self",...he]},...he,{scope:"meta",match:i}]};return{case_insensitive:!1,keywords:D,contains:[Se,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},s,{scope:"variable.language",match:/\$this\b/},o,re,Y,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},$,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:D,contains:["self",o,Y,t.C_BLOCK_COMMENT_MODE,y,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},y,b]}}function d_(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function f_(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function p_(t){let e=t.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},d={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},f={begin:/\{\{/,relevance:0},h={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,c,f,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,c,f,d]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,f,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,f,d]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},m="[0-9](_?[0-9])*",y=`(\\b(${m}))?\\.(${m})|\\b(${m})\\.`,b=`\\b|${r.join("|")}`,w={className:"number",relevance:0,variants:[{begin:`(\\b(${m})|(${y}))[eE][+-]?(${m})[jJ]?(?=${b})`},{begin:`(${y})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${b})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${b})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${b})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${b})`},{begin:`\\b(${m})[jJ](?=${b})`}]},_={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},S={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,w,h,t.HASH_COMMENT_MODE]}]};return d.contains=[h,w,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,w,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},h,_,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[S]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[w,S,h]}]}}function h_(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function m_(t){let e=t.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function g_(t){let e=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=e.concat(r,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},d=[t.COMMENT("#","$",{contains:[l]}),t.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],f={className:"subst",begin:/#\{/,end:/\}/,keywords:s},h={className:"string",contains:[t.BACKSLASH_ESCAPE,f],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,f]})]}]},m="[1-9](_?[0-9])*|0",y="[0-9](_?[0-9])*",b={className:"number",relevance:0,variants:[{begin:`\\b(${m})(\\.(${y}))?([eE][+-]?(${y})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},w={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},O=[h,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:s},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[w]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[h,{begin:n}],relevance:0},b,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,f],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,d),relevance:0}].concat(c,d);f.contains=O,w.contains=O;let re=[{begin:/^\s*=>/,starts:{end:"$",contains:O}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:s,contains:O}}];return d.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(re).concat(d).concat(O)}}function b_(t){let e=t.regex,n={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let\b)/,t.IDENT_RE,e.lookahead(/\s*\(/))},r="([ui](8|16|32|64|128|size)|f(32|64))?",i=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],o=["true","false","Some","None","Ok","Err"],s=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],l=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:l,keyword:i,literal:o,built_in:s},illegal:""},n]}}var CF=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),AF=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],MF=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],NF=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],kF=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],OF=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function y_(t){let e=CF(t),n=kF,r=NF,i="@[a-z-]+",o="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+AF.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+OF.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,l,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:MF.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function E_(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function v_(t){let e=t.regex,n=t.COMMENT("--","$"),r={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},i={begin:/"/,end:/"/,contains:[{begin:/""/}]},o=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],d=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],f=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],h=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],m=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],y=f,b=[...d,...c].filter(D=>!f.includes(D)),w={className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},_={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},S={begin:e.concat(/\b/,e.either(...y),/\s*\(/),relevance:0,keywords:{built_in:y}};function L(D,{exceptions:T,when:$}={}){let O=$;return T=T||[],D.map(Y=>Y.match(/\|\d+$/)||T.includes(Y)?Y:O(Y)?`${Y}|0`:Y)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:L(b,{when:D=>D.length<3}),literal:o,type:l,built_in:h},contains:[{begin:e.either(...m),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:b.concat(m),literal:o,type:l}},{className:"type",begin:e.either(...s)},S,w,r,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,_]}}function S_(t){return t?typeof t=="string"?t:t.source:null}function Su(t){return nt("(?=",t,")")}function nt(...t){return t.map(n=>S_(n)).join("")}function RF(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function xn(...t){return"("+(RF(t).capture?"":"?:")+t.map(r=>S_(r)).join("|")+")"}var xm=t=>nt(/\b/,t,/\w$/.test(t)?/\b/:/\B/),IF=["Protocol","Type"].map(xm),w_=["init","self"].map(xm),DF=["Any","Self"],Em=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","distributed","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],x_=["false","nil","true"],LF=["assignment","associativity","higherThan","left","lowerThan","none","right"],PF=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],__=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],T_=xn(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),C_=xn(T_,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),vm=nt(T_,C_,"*"),A_=xn(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Tu=xn(A_,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Yr=nt(A_,Tu,"*"),wm=nt(/[A-Z]/,Tu,"*"),BF=["autoclosure",nt(/convention\(/,xn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",nt(/objc\(/,Yr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],FF=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function M_(t){let e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],i={match:[/\./,xn(...IF,...w_)],className:{2:"keyword"}},o={match:nt(/\./,xn(...Em)),relevance:0},s=Em.filter(Oe=>typeof Oe=="string").concat(["_|0"]),l=Em.filter(Oe=>typeof Oe!="string").concat(DF).map(xm),c={variants:[{className:"keyword",match:xn(...l,...w_)}]},d={$pattern:xn(/\b\w+/,/#\w+/),keyword:s.concat(PF),literal:x_},f=[i,o,c],h={match:nt(/\./,xn(...__)),relevance:0},m={className:"built_in",match:nt(/\b/,xn(...__),/(?=\()/)},y=[h,m],b={match:/->/,relevance:0},w={className:"operator",relevance:0,variants:[{match:vm},{match:`\\.(\\.|${C_})+`}]},_=[b,w],S="([0-9]_*)+",L="([0-9a-fA-F]_*)+",D={className:"number",relevance:0,variants:[{match:`\\b(${S})(\\.(${S}))?([eE][+-]?(${S}))?\\b`},{match:`\\b0x(${L})(\\.(${L}))?([pP][+-]?(${S}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},T=(Oe="")=>({className:"subst",variants:[{match:nt(/\\/,Oe,/[0\\tnr"']/)},{match:nt(/\\/,Oe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),$=(Oe="")=>({className:"subst",match:nt(/\\/,Oe,/[\t ]*(?:[\r\n]|\r\n)/)}),O=(Oe="")=>({className:"subst",label:"interpol",begin:nt(/\\/,Oe,/\(/),end:/\)/}),Y=(Oe="")=>({begin:nt(Oe,/"""/),end:nt(/"""/,Oe),contains:[T(Oe),$(Oe),O(Oe)]}),ee=(Oe="")=>({begin:nt(Oe,/"/),end:nt(/"/,Oe),contains:[T(Oe),O(Oe)]}),z={className:"string",variants:[Y(),Y("#"),Y("##"),Y("###"),ee(),ee("#"),ee("##"),ee("###")]},re={match:nt(/`/,Yr,/`/)},he={className:"variable",match:/\$\d+/},Se={className:"variable",match:`\\$${Tu}+`},me=[re,he,Se],Ce={match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:FF,contains:[..._,D,z]}]}},ge={className:"keyword",match:nt(/@/,xn(...BF))},_e={className:"meta",match:nt(/@/,Yr)},A=[Ce,ge,_e],R={match:Su(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:nt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Tu,"+")},{className:"type",match:wm,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:nt(/\s+&\s+/,Su(wm)),relevance:0}]},K={begin://,keywords:d,contains:[...r,...f,...A,b,R]};R.contains.push(K);let J={match:nt(Yr,/\s*:/),keywords:"_|0",relevance:0},se={begin:/\(/,end:/\)/,relevance:0,keywords:d,contains:["self",J,...r,...f,...y,..._,D,z,...me,...A,R]},be={begin://,contains:[...r,R]},De={begin:xn(Su(nt(Yr,/\s*:/)),Su(nt(Yr,/\s+/,Yr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Yr}]},je={begin:/\(/,end:/\)/,keywords:d,contains:[De,...r,...f,..._,D,z,...A,R,se],endsParent:!0,illegal:/["']/},Me={match:[/func/,/\s+/,xn(re.match,Yr,vm)],className:{1:"keyword",3:"title.function"},contains:[be,je,e],illegal:[/\[/,/%/]},Be={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[be,je,e],illegal:/\[|%/},wt={match:[/operator/,/\s+/,vm],className:{1:"keyword",3:"title"}},Nt={begin:[/precedencegroup/,/\s+/,wm],className:{1:"keyword",3:"title"},contains:[R],keywords:[...LF,...x_],end:/}/};for(let Oe of z.variants){let xt=Oe.contains.find(pt=>pt.label==="interpol");xt.keywords=d;let Jt=[...f,...y,..._,D,z,...me];xt.contains=[...Jt,{begin:/\(/,end:/\)/,contains:["self",...Jt]}]}return{name:"Swift",keywords:d,contains:[...r,Me,Be,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:d,contains:[t.inherit(t.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...f]},wt,Nt,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...f,...y,..._,D,z,...me,...A,R,se]}}var Cu="[A-Za-z$_][0-9A-Za-z$_]*",N_=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],k_=["true","false","null","undefined","NaN","Infinity"],O_=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],R_=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],I_=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],D_=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],L_=[].concat(I_,O_,R_);function HF(t){let e=t.regex,n=(R,{after:K})=>{let J="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(R,K)=>{let J=R[0].length+R.index,se=R.input[J];if(se==="<"||se===","){K.ignoreMatch();return}se===">"&&(n(R,{after:J})||K.ignoreMatch());let be,De=R.input.substring(J);if(be=De.match(/^\s*=/)){K.ignoreMatch();return}if((be=De.match(/^\s+extends\s+/))&&be.index===0){K.ignoreMatch();return}}},l={$pattern:Cu,keyword:N_,literal:k_,built_in:L_,"variable.language":D_},c="[0-9](_?[0-9])*",d=`\\.(${c})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${f})((${d})|\\.)?|(${d}))[eE][+-]?(${c})\\b`},{begin:`\\b(${f})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},y={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},b={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"css"}},w={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},_={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,m]},L={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},D=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,y,b,w,_,{match:/\$\d+/},h];m.contains=D.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(D)});let T=[].concat(L,m.contains),$=T.concat([{begin:/\(/,end:/\)/,keywords:l,contains:["self"].concat(T)}]),O={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:$},Y={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ee={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...O_,...R_]}},z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},re={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},he={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Se(R){return e.concat("(?!",R.join("|"),")")}let me={match:e.concat(/\b/,Se([...I_,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},Ce={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ge={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},_e="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(_e)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:$,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),z,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,y,b,w,_,L,{match:/\$\d+/},h,ee,{className:"attr",begin:r+e.lookahead(":"),relevance:0},A,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[L,t.REGEXP_MODE,{className:"function",begin:_e,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:$}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},re,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[O,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Ce,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},me,he,Y,ge,{match:/\$[(.]/}]}}function P_(t){let e=HF(t),n=Cu,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[e.exports.CLASS_REFERENCE]},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[e.exports.CLASS_REFERENCE]},s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"],c={$pattern:Cu,keyword:N_.concat(l),literal:k_,built_in:L_.concat(r),"variable.language":D_},d={className:"meta",begin:"@"+n},f=(m,y,b)=>{let w=m.contains.findIndex(_=>_.label===y);if(w===-1)throw new Error("can not find mode to replace");m.contains.splice(w,1,b)};Object.assign(e.keywords,c),e.exports.PARAMS_CONTAINS.push(d),e.contains=e.contains.concat([d,i,o]),f(e,"shebang",t.SHEBANG()),f(e,"use_strict",s);let h=e.contains.find(m=>m.label==="func.def");return h.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),e}function B_(t){let e=t.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:e.concat(/# */,e.either(o,i),/ *#/)},{begin:e.concat(/# */,l,/ *#/)},{begin:e.concat(/# */,s,/ *#/)},{begin:e.concat(/# */,e.either(o,i),/ +/,e.either(s,l),/ *#/)}]},d={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},f={className:"label",begin:/^\w+:/},h=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),m=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,c,d,f,h,m,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[m]}]}}function F_(t){t.regex;let e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");let n=t.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},d={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,s,i,t.QUOTE_STRING_MODE,c,d,l]}}function H_(t){let e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(o,{begin:/\(/,end:/\)/}),l=t.inherit(t.APOS_STRING_MODE,{className:"string"}),c=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),d={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[o,c,l,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[o,s,c,l]}]}]},t.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[d],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[d],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:d}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function $_(t){let e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ ]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ ]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ ]|$)"}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},s=t.inherit(o,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},y={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[m],illegal:"\\n",relevance:0},w=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},h,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},y,b,o],_=[...w];return _.pop(),_.push(s),m.contains=_,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:w}}var aS=Qd(sS(),1);var Jn=aS.default;var cS=Qd(lS(),1),Sa=Object.assign(vo(Error),{eval:vo(EvalError),range:vo(RangeError),reference:vo(ReferenceError),syntax:vo(SyntaxError),type:vo(TypeError),uri:vo(URIError)});function vo(t){return e.displayName=t.displayName||t.name,e;function e(n,...r){let i=n&&(0,cS.default)(n,...r);return new t(i)}}var NH={}.hasOwnProperty,uS="hljs-";function dS(t,e,n={}){let r=n.prefix;if(typeof t!="string")throw Sa("Expected `string` for name, got `%s`",t);if(!Jn.getLanguage(t))throw Sa("Unknown language: `%s` is not registered",t);if(typeof e!="string")throw Sa("Expected `string` for value, got `%s`",e);r==null&&(r=uS),Jn.configure({__emitter:Rm,classPrefix:r});let i=Jn.highlight(e,{language:t,ignoreIllegals:!0});if(Jn.configure({}),i.errorRaised)throw i.errorRaised;return i._emitter.root.data.language=i.language,i._emitter.root.data.relevance=i.relevance,i._emitter.root}function kH(t,e={}){let n=e.subset||Jn.listLanguages(),r=e.prefix,i=-1,o={type:"root",data:{language:null,relevance:0},children:[]};if(r==null&&(r=uS),typeof t!="string")throw Sa("Expected `string` for value, got `%s`",t);for(;++io.data.relevance&&(o=l)}return o}function OH(t,e){Jn.registerLanguage(t,e)}var RH=function(t,e){if(typeof t=="string")Jn.registerAliases(e,{languageName:t});else{let n;for(n in t)NH.call(t,n)&&Jn.registerAliases(t[n],{languageName:n})}};function IH(t){return!!Jn.getLanguage(t)}function DH(){return Jn.listLanguages()}var Rm=class{constructor(e){this.options=e,this.root={type:"root",data:{language:null,relevance:0},children:[]},this.stack=[this.root]}addText(e){if(e==="")return;let n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=e:n.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,n){let r=this.stack[this.stack.length-1],i=e.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(e){let n=e.split(".").map((o,s)=>s?o+"_".repeat(s):this.options.classPrefix+o),r=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}},Ie={highlight:dS,highlightAuto:kH,registerLanguage:OH,registered:IH,listLanguages:DH,registerAlias:RH};Ie.registerLanguage("arduino",Px);Ie.registerLanguage("bash",Bx);Ie.registerLanguage("c",Fx);Ie.registerLanguage("cpp",Hx);Ie.registerLanguage("csharp",$x);Ie.registerLanguage("css",zx);Ie.registerLanguage("diff",Ux);Ie.registerLanguage("go",Wx);Ie.registerLanguage("graphql",Kx);Ie.registerLanguage("ini",Vx);Ie.registerLanguage("java",Yx);Ie.registerLanguage("javascript",Qx);Ie.registerLanguage("json",e_);Ie.registerLanguage("kotlin",t_);Ie.registerLanguage("less",i_);Ie.registerLanguage("lua",o_);Ie.registerLanguage("makefile",s_);Ie.registerLanguage("markdown",a_);Ie.registerLanguage("objectivec",l_);Ie.registerLanguage("perl",c_);Ie.registerLanguage("php",u_);Ie.registerLanguage("php-template",d_);Ie.registerLanguage("plaintext",f_);Ie.registerLanguage("python",p_);Ie.registerLanguage("python-repl",h_);Ie.registerLanguage("r",m_);Ie.registerLanguage("ruby",g_);Ie.registerLanguage("rust",b_);Ie.registerLanguage("scss",y_);Ie.registerLanguage("shell",E_);Ie.registerLanguage("sql",v_);Ie.registerLanguage("swift",M_);Ie.registerLanguage("typescript",P_);Ie.registerLanguage("vbnet",B_);Ie.registerLanguage("wasm",F_);Ie.registerLanguage("xml",H_);Ie.registerLanguage("yaml",$_);var Ai=(t,e=0,n=1)=>t>n?n:tMath.round(n*t)/n;var e6={grad:360/400,turn:360,rad:360/(Math.PI*2)},fS=t=>FH(Ru(t)),Ru=t=>(t[0]==="#"&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?Mt(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?Mt(parseInt(t.substring(6,8),16)/255,2):1});var pS=t=>BH(PH(t)),LH=({h:t,s:e,v:n,a:r})=>{let i=(200-e)*n/100;return{h:Mt(t),s:Mt(i>0&&i<200?e*n/100/(i<=100?i:200-i)*100:0),l:Mt(i/2),a:Mt(r,2)}};var Ta=t=>{let{h:e,s:n,l:r}=LH(t);return`hsl(${e}, ${n}%, ${r}%)`};var PH=({h:t,s:e,v:n,a:r})=>{t=t/360*6,e=e/100,n=n/100;let i=Math.floor(t),o=n*(1-e),s=n*(1-(t-i)*e),l=n*(1-(1-t+i)*e),c=i%6;return{r:Mt([n,s,o,o,l,n][c]*255),g:Mt([l,n,n,s,o,o][c]*255),b:Mt([o,o,l,n,n,s][c]*255),a:Mt(r,2)}};var Ou=t=>{let e=t.toString(16);return e.length<2?"0"+e:e},BH=({r:t,g:e,b:n,a:r})=>{let i=r<1?Ou(Mt(r*255)):"";return"#"+Ou(t)+Ou(e)+Ou(n)+i},FH=({r:t,g:e,b:n,a:r})=>{let i=Math.max(t,e,n),o=i-Math.min(t,e,n),s=o?i===t?(e-n)/o:i===e?2+(n-t)/o:4+(t-e)/o:0;return{h:Mt(60*(s<0?s+6:s)),s:Mt(i?o/i*100:0),v:Mt(i/255*100),a:r}};var Im=(t,e)=>{if(t===e)return!0;for(let n in t)if(t[n]!==e[n])return!1;return!0};var hS=(t,e)=>t.toLowerCase()===e.toLowerCase()?!0:Im(Ru(t),Ru(e));var mS={},Iu=t=>{let e=mS[t];return e||(e=document.createElement("template"),e.innerHTML=t,mS[t]=e),e},Ca=(t,e,n)=>{t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:n}))};var hs=!1,Dm=t=>"touches"in t,HH=t=>hs&&!Dm(t)?!1:(hs||(hs=Dm(t)),!0),gS=(t,e)=>{let n=Dm(e)?e.touches[0]:e,r=t.el.getBoundingClientRect();Ca(t.el,"move",t.getMove({x:Ai((n.pageX-(r.left+window.pageXOffset))/r.width),y:Ai((n.pageY-(r.top+window.pageYOffset))/r.height)}))},$H=(t,e)=>{let n=e.keyCode;n>40||t.xy&&n<37||n<33||(e.preventDefault(),Ca(t.el,"move",t.getMove({x:n===39?.01:n===37?-.01:n===34?.05:n===33?-.05:n===35?1:n===36?-1:0,y:n===40?.01:n===38?-.01:0},!0)))},ms=class{constructor(e,n,r,i){let o=Iu(`
`);e.appendChild(o.content.cloneNode(!0));let s=e.querySelector(`[part=${n}]`);s.addEventListener("mousedown",this),s.addEventListener("touchstart",this),s.addEventListener("keydown",this),this.el=s,this.xy=i,this.nodes=[s.firstChild,s]}set dragging(e){let n=e?document.addEventListener:document.removeEventListener;n(hs?"touchmove":"mousemove",this),n(hs?"touchend":"mouseup",this)}handleEvent(e){switch(e.type){case"mousedown":case"touchstart":if(e.preventDefault(),!HH(e)||!hs&&e.button!=0)return;this.el.focus(),gS(this,e),this.dragging=!0;break;case"mousemove":case"touchmove":e.preventDefault(),gS(this,e);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":$H(this,e);break}}style(e){e.forEach((n,r)=>{for(let i in n)this.nodes[r].style.setProperty(i,n[i])})}};var Du=class extends ms{constructor(e){super(e,"hue",'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"',!1)}update({h:e}){this.h=e,this.style([{left:`${e/360*100}%`,color:Ta({h:e,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${Mt(e)}`)}getMove(e,n){return{h:n?Ai(this.h+e.x*360,0,360):360*e.x}}};var Lu=class extends ms{constructor(e){super(e,"saturation",'aria-label="Color"',!0)}update(e){this.hsva=e,this.style([{top:`${100-e.v}%`,left:`${e.s}%`,color:Ta(e)},{"background-color":Ta({h:e.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${Mt(e.s)}%, Brightness ${Mt(e.v)}%`)}getMove(e,n){return{s:n?Ai(this.hsva.s+e.x*100,0,100):e.x*100,v:n?Ai(this.hsva.v-e.y*100,0,100):Math.round(100-e.y*100)}}};var bS=':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}';var yS="[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}";var ES="[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}";var Pu=Symbol("same"),Lm=Symbol("color"),vS=Symbol("hsva"),Pm=Symbol("update"),wS=Symbol("parts"),xS=Symbol("css"),_S=Symbol("sliders"),Bu=class extends HTMLElement{static get observedAttributes(){return["color"]}get[xS](){return[bS,yS,ES]}get[_S](){return[Lu,Du]}get color(){return this[Lm]}set color(e){if(!this[Pu](e)){let n=this.colorModel.toHsva(e);this[Pm](n),this[Lm]=e}}constructor(){super();let e=Iu(``),n=this.attachShadow({mode:"open"});n.appendChild(e.content.cloneNode(!0)),n.addEventListener("move",this),this[wS]=this[_S].map(r=>new r(n))}connectedCallback(){if(this.hasOwnProperty("color")){let e=this.color;delete this.color,this.color=e}else this.color||(this.color=this.colorModel.defaultColor)}attributeChangedCallback(e,n,r){let i=this.colorModel.fromAttr(r);this[Pu](i)||(this.color=i)}handleEvent(e){let n=this[vS],r={...n,...e.detail};this[Pm](r);let i;!Im(r,n)&&!this[Pu](i=this.colorModel.fromHsva(r))&&(this[Lm]=i,Ca(this,"color-changed",{value:i}))}[Pu](e){return this.color&&this.colorModel.equal(e,this.color)}[Pm](e){this[vS]=e,this[wS].forEach(n=>n.update(e))}};var zH={defaultColor:"#000",toHsva:fS,fromHsva:({h:t,s:e,v:n})=>pS({h:t,s:e,v:n,a:1}),equal:hS,fromAttr:t=>t},Fu=class extends Bu{get colorModel(){return zH}};var CS=Qd(SS(),1);customElements.define("tiptap-hex-color-picker",Fu);var UH={blockquote:[YE],bold:[JE],"bullet-list":[ZE],"checked-list":[bh],code:[jE],"code-block":[am.configure({lowlight:Ie,HTMLAttributes:{class:"hljs"}})],color:[QE],details:[Xh,Zh,jh],grid:[Wh,Kh],"grid-builder":[um,dm],heading:[sv.configure({levels:[1,2,3,4,5,6]})],highlight:[tw],hr:[fv],hurdle:[lm],italic:[pv],lead:[yh],link:[$h.configure({openOnClick:!1,autolink:!1,HTMLAttributes:{rel:null,hreflang:null,class:null}})],media:[zh.configure({inline:!0})],oembed:[Gh,Yh,Jh],"ordered-list":[mv],small:[Uh],strike:[bv],subscript:[yv],superscript:[Ev],table:[Jv.configure({resizable:!0}),Zv,Xv,jv],underline:[ew]},WH=window.TiptapEditorExtensions||{},TS={...UH,...WH},Hu=document.getElementById("activeLocale");Hu&&Hu.addEventListener("change",()=>{let t=new CustomEvent("locale-change",{bubbles:!0,detail:{locale:Hu.value}});Hu.dispatchEvent(t)});document.addEventListener("livewire:navigating",()=>{window.filamentTiptapEditors={}});document.addEventListener("dblclick",function(t){(t.target&&(t.target.hasAttribute("data-youtube-video")||t.target.hasAttribute("data-vimeo-video"))||t.target.hasAttribute("data-native-video"))&&(t.target.firstChild.style.pointerEvents="all")});Livewire.on("insertFromAction",t=>{setTimeout(()=>{let e=new CustomEvent("insert-content",{bubble:!0,detail:t});window.dispatchEvent(e)},100)});Livewire.on("insertBlockFromAction",t=>{setTimeout(()=>{let e=new CustomEvent("insert-block",{bubble:!0,detail:t});window.dispatchEvent(e)},100)});Livewire.on("updateBlockFromAction",t=>{setTimeout(()=>{let e=new CustomEvent("update-block",{bubble:!0,detail:t});window.dispatchEvent(e)},100)});function KH({state:t,statePath:e,tools:n=[],disabled:r=!1,locale:i="en",floatingMenuTools:o=[],placeholder:s=null,mergeTags:l=[]}){let c=null;return{id:null,modalId:null,tools:n,state:t,statePath:e,fullScreenMode:!1,updatedAt:Date.now(),disabled:r,locale:i,floatingMenuTools:o,getExtensions(){let d=this.tools.map(h=>typeof h=="string"?h:h.id),f=[ev,Qv,gc,nv,iv,ov,dv,yi,fm,mm,gm,bm,ym.configure({statePath:e}),pm];if(s&&!r&&f.push(gv.configure({placeholder:s})),d.length){let h=Object.keys(TS),m=[],y=["paragraph"];f.push(Hw.configure({element:this.$refs.bubbleMenu,tippyOptions:{duration:[500,0],maxWidth:"none",placement:"top",theme:"tiptap-editor-bubble",interactive:!0,appendTo:this.$refs.element,zIndex:10},shouldShow:({state:b,from:w,to:_})=>{if(Ur(b,"link")||Ur(b,"table")||w!==_)return!0;if(Ur(b,"oembed")||Ur(b,"vimeo")||Ur(b,"youtube")||Ur(b,"video")||Ur(b,"tiptapBlock"))return!1}})),this.floatingMenuTools.length&&(f.push($w.configure({element:this.$refs.floatingMenu,tippyOptions:{duration:[500,0],maxWidth:"none",theme:"tiptap-editor-bubble",interactive:!0,appendTo:this.$refs.element,zIndex:10}})),this.floatingMenuTools.forEach(b=>{d.includes(b)||d.push(b)})),d.forEach(b=>{h.includes(b)?TS[b].forEach(w=>{["ordered-list","bullet-list","checked-list"].includes(b)?(f.push(w),f.includes(to)||f.push(to)):f.push(w)}):["align-left","align-right","align-center","align-justify"].includes(b)&&(b==="align-left"&&m.push("start"),b==="align-center"&&m.push("center"),b==="align-right"&&m.push("end"),b==="align-justify"&&m.push("justify"),d.includes("heading")&&y.push("heading"),typeof f.find(_=>_.name==="textAlign")>"u"&&f.push(cm.configure({types:y,alignments:m})))})}return l?.length&&f.push(hm.configure({mergeTags:l})),f},init:function(){this.modalId=this.$el.closest('[x-ref="modalContainer"]')?.getAttribute("wire:key");let d=this.$refs.element.querySelector(".tiptap");d&&(d.remove(),c=null),this.initEditor(this.state);let f=this.$el.parentElement.closest("[x-sortable]");f&&(window.Sortable.utils.on(f,"start",()=>{f.classList.add("sorting")}),window.Sortable.utils.on(f,"end",()=>{f.classList.remove("sorting")})),this.$watch("state",(h,m)=>{typeof h<"u"&&((0,CS.isEqual)(m,Alpine.raw(h))||this.updateEditorContent(h))})},initEditor(d){if(!this.$el.querySelector(".tiptap")){let f=this;c=new tc({element:f.$refs.element,extensions:f.getExtensions(),editable:!f.disabled,content:d,editorProps:{handlePaste(h,m,y){y.content.descendants(b=>{b.type.name==="tiptapBlock"&&(b.attrs.statePath=f.statePath,b.attrs.data=JSON.parse(b.attrs.data))})}},onCreate({editor:h}){f.$store.previous&&h.commands.getStatePath()===f.$store.previous.statePath&&(h.chain().focus().setContent(f.$store.previous.editor.getJSON()).setTextSelection(f.$store.previous.editor.state.selection).run(),f.updatedAt=Date.now())},onUpdate({editor:h}){f.updatedAt=Date.now(),f.state=h.isEmpty?null:h.getJSON()},onSelectionUpdate(){f.updatedAt=Date.now()},onBlur(){f.updatedAt=Date.now()},onFocus(){f.updatedAt=Date.now()}})}},handleOpenModal(){this.modalId&&this.$nextTick(()=>{this.$store.previous={statePath:this.statePath,editor:c}})},isActive(d,f={}){return c.isActive(d,f)},editor(){return c},blur(){let d=this.$el.querySelectorAll("[data-tippy-content]");d&&d.forEach(f=>f.destroy()),this.updatedAt=Date.now()},updateEditorContent(d){if(c.isEditable){let{from:f,to:h}=c.state.selection;c.commands.setContent(d,!0),c.chain().focus().setTextSelection({from:f,to:h}).run()}},refreshEditorContent(){this.$nextTick(()=>this.updateEditorContent(this.state))},updateLocale(d){this.locale=d.detail.locale},insertContent(d){if(d.detail.statePath===this.statePath)switch(d.detail.type){case"media":this.insertMedia(d);return;case"video":this.insertVideo(d);return;case"link":this.insertLink(d);return;case"source":this.insertSource(d);return;case"grid":this.insertGridBuilder(d);return;default:return}},insertMedia(d){Array.isArray(d.detail.media)?d.detail.media.forEach(f=>{this.executeMediaInsert(f)}):this.executeMediaInsert(d.detail.media)},executeMediaInsert(d=null){if(!(!d||d?.url===null)&&d){let f=d?.url||d?.src,h=["jpg","jpeg","svg","png","webp","gif","avif","jxl","heic"],y=/.*\.([a-zA-Z]*)\??/.exec(f.toLowerCase());y!==null&&h.includes(y[1])?c.chain().focus().setImage({src:f,alt:d?.alt,title:d?.title,width:d?.width,height:d?.height,lazy:d?.lazy}).run():c.chain().focus().extendMarkRange("link").setLink({href:f}).insertContent(d?.link_text).run()}},insertVideo(d){let f=d.detail.video;if(!f||f.url===null)return;let h={src:f.url,width:f.responsive?f.width*100:f.width,height:f.responsive?f.height*100:f.height,responsive:f.responsive??!0,"data-aspect-width":f.width,"data-aspect-height":f.height};f.url.includes("youtube")||f.url.includes("youtu.be")?c.chain().focus().setYoutubeVideo({...h,controls:f.youtube_options.includes("controls"),nocookie:f.youtube_options.includes("nocookie"),start:f.start_at??0}).run():f.url.includes("vimeo")?c.chain().focus().setVimeoVideo({...h,autoplay:f.vimeo_options.includes("autoplay"),loop:f.vimeo_options.includes("loop"),title:f.vimeo_options.includes("show_title"),byline:f.vimeo_options.includes("byline"),portrait:f.vimeo_options.includes("portrait")}).run():c.chain().focus().setVideo({...h,autoplay:f.native_options.includes("autoplay"),loop:f.native_options.includes("loop"),controls:f.native_options.includes("controls")}).run()},insertLink(d){let f=d.detail;if(!(f.href===null&&f.id===null)){if(f.href===""&&f.id===null){this.unsetLink();return}c.chain().focus().extendMarkRange("link").setLink({href:f.href,id:f.id??null,target:f.target??null,hreflang:f.hreflang??null,rel:f.rel??null,referrerpolicy:f.referrerpolicy??null,as_button:f.as_button??null,button_theme:f.button_theme??null}).selectTextblockEnd().run()}},unsetLink(){c.chain().focus().extendMarkRange("link").unsetLink().selectTextblockEnd().run()},insertSource(d){this.updateEditorContent(d.detail.source)},insertGridBuilder(d){let f=d.detail.data,h="responsive",m=parseInt(f.asymmetric_left)??null,y=parseInt(f.asymmetric_right)??null;f.fixed&&(h="fixed"),f.asymmetric&&(h="asymmetric"),c.chain().focus().insertGridBuilder({cols:f.columns,type:h,stackAt:f.stack_at,asymmetricLeft:m,asymmetricRight:y}).run()},insertBlock(d){d.detail.statePath===this.statePath&&(c.commands.insertBlock({type:d.detail.type,statePath:d.detail.statePath,data:d.detail.data,preview:d.detail.preview,label:d.detail.label,coordinates:d.detail.coordinates}),c.isFocused||c.commands.focus())},insertMergeTag(d){c.commands.insertMergeTag({tag:d.detail.tag,coordinates:d.detail.coordinates}),c.isFocused||c.commands.focus()},openBlockSettings(d){d.detail.statePath===this.statePath&&this.$wire.dispatchFormEvent("tiptap::updateBlock",this.statePath,d.detail)},updateBlock(d){d.detail.statePath===this.statePath&&(c.commands.updateBlock({type:d.detail.type,statePath:d.detail.statePath,data:d.detail.data,preview:d.detail.preview,label:d.detail.label,coordinates:d.detail.coordinates}),c.isFocused||c.commands.focus())},deleteBlock(){c.commands.removeBlock()}}}export{KH as default}; +/*! Bundled license information: + +lodash/lodash.js: + (** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + *) +*/ diff --git a/resources/js/app.js b/resources/js/app.js index e216552..2f7c2d8 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -1,6 +1,10 @@ import { Livewire, Alpine } from '../../vendor/livewire/livewire/dist/livewire.esm'; +import Clipboard from '@ryangjchandler/alpine-clipboard'; +import embed from './embed.js'; import map from './map.js'; +Alpine.plugin(Clipboard); +Alpine.data('embed', embed); Alpine.data('map', map); Livewire.start(); diff --git a/resources/js/embed.js b/resources/js/embed.js new file mode 100644 index 0000000..e0c7359 --- /dev/null +++ b/resources/js/embed.js @@ -0,0 +1,13 @@ +export default () => ({ + id: `rezultatevot-embed-${Math.floor(Date.now()).toString(36)}`, + url: this.$wire.url, + + copy() { + const code = + `` + + `` + + ``; + + this.$clipboard(code); + }, +}); diff --git a/resources/js/iframe.js b/resources/js/iframe.js new file mode 100644 index 0000000..18480b4 --- /dev/null +++ b/resources/js/iframe.js @@ -0,0 +1 @@ +import '@iframe-resizer/child'; diff --git a/resources/svg/hands.svg b/resources/svg/hands.svg new file mode 100644 index 0000000..d0dfaae --- /dev/null +++ b/resources/svg/hands.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/svg/romania.svg b/resources/svg/romania.svg new file mode 100644 index 0000000..449cad8 --- /dev/null +++ b/resources/svg/romania.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/svg/vote.svg b/resources/svg/vote.svg new file mode 100644 index 0000000..f981282 --- /dev/null +++ b/resources/svg/vote.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/views/components/election/tabs.blade.php b/resources/views/components/election/tabs.blade.php index 2724dc9..8b641db 100644 --- a/resources/views/components/election/tabs.blade.php +++ b/resources/views/components/election/tabs.blade.php @@ -1,10 +1,10 @@ -